import{B as e,Ct as t,H as n,Mt as r,Q as i,W as a,Z as o,_t as s,at as c,d as l,ht as u,i as d,jt as f,mt as p,ot as m,pt as h,s as g,tt as _,wt as v,yt as y}from"../chunks/BA99CCI5.js";import{a as b}from"../chunks/DP37y6wO.js";import"../chunks/xihTtKlq.js";import"../chunks/DGo8yE5j.js";import{t as x}from"../chunks/BfBgZfCV2.js";import"../chunks/BymfG72d2.js";import{t as S}from"../chunks/CEQEwD8g.js";import{t as C}from"../chunks/DCohNkHF.js";import{t as w}from"../chunks/BzUs4yJS2.js";var T=a(`<!> <!> <!>`,1);function E(a,E){r(E,!1);let D=()=>v(x,`$page`,O),[O,k]=t(),A=u(),j=g(E,`data`,8),M=D().url.searchParams.get(`arrType`);d(()=>{M||b(`/media-management/${j().currentDatabase.id}/quality-definitions`,{replaceState:!0})}),c(()=>o(j()),()=>{s(A,M===`radarr`?j().radarrQualities:j().sonarrQualities)}),m(),l();var N=T(),P=h(N);{let e=y(()=>(o(j()),_(()=>`${j().currentDatabase.name} · Quality Definition · New`)));C(P,{get title(){return i(e)}})}var F=p(P,2),I=e=>{{let t=y(()=>(o(j()),_(()=>j().currentDatabase?.name)));w(e,{mode:`create`,get arrType(){return M},get databaseName(){return i(t)},get canWriteToBase(){return o(j()),_(()=>j().canWriteToBase)},get availableQualities(){return i(A)},initialData:null})}};e(F,e=>{M&&e(I)});var L=p(F,2);S(L,{}),n(a,N),f(),k()}export{E as component};