import{B as e,Ct as t,H as n,It as r,Mt as i,Q as a,U as o,V as s,W as c,Z as l,_t as u,at as d,d as f,ft as p,ht as m,jt as h,mt as g,ot as _,pt as v,s as y,st as b,tt as x,wt as S,yt as C}from"../chunks/BA99CCI5.js";import"../chunks/xihTtKlq.js";import"../chunks/DGo8yE5j.js";import{t as w}from"../chunks/BfBgZfCV2.js";import{t as T}from"../chunks/DCohNkHF.js";import{t as E}from"../chunks/Cme17KJK.js";import{t as D}from"../chunks/Co6rAu4X.js";import{t as O}from"../chunks/D-q_ZSae2.js";import{t as k}from"../chunks/BhExzYrM2.js";var A=c(`<p class="text-sm text-neutral-500 dark:text-neutral-400">Not used in any quality profiles.</p>`),j=c(`<!> <!> <div class="space-y-3 md:px-4" data-onboarding="cf-general-references"><div class="text-sm font-medium text-neutral-900 dark:text-neutral-100"> </div> <!></div>`,1);function M(c,M){i(M,!1);let N=()=>S(w,`$page`,P),[P,F]=t(),I=m(),L=m(),R=y(M,`data`,8),z=[{key:`name`,header:`Profile`},{key:`radarrScore`,header:`Radarr`,align:`center`},{key:`sonarrScore`,header:`Sonarr`,align:`center`}];d(()=>N(),()=>{u(I,N().params.databaseId)}),d(()=>l(R()),()=>{u(L,{name:R().format.name,tags:R().format.tags.map(e=>e.name),description:R().format.description??``,includeInRename:R().format.include_in_rename})}),_(),f();var B=j(),V=v(B);{let e=C(()=>(l(R()),x(()=>`${R().format.name} · General`)));T(V,{get title(){return a(e)}})}var H=g(V,2);O(H,{mode:`edit`,get canWriteToBase(){return l(R()),x(()=>R().canWriteToBase)},actionUrl:`?/update`,get initialData(){return a(L)},get failOnReferencedDelete(){return l(R()),x(()=>R().failOnReferencedDelete)},get referenceCount(){return l(R()),x(()=>R().profileRefs.length)}});var U=g(H,2),W=p(U),G=p(W);r(W);var K=g(W,2),q=t=>{E(t,{get data(){return l(R()),x(()=>R().profileRefs)},get columns(){return z},compact:!0,responsive:!0,$$slots:{cell:(t,r)=>{let i=C(()=>r.row),s=C(()=>r.column);var c=o(),u=v(c),d=e=>{k(e,{get href(){return`/quality-profiles/${a(I)??``}/${l(a(i)),x(()=>a(i).id)??``}/scoring`},get text(){return l(a(i)),x(()=>a(i).name)},external:!0})},f=e=>{D(e,{get score(){return l(a(i)),x(()=>a(i).radarrScore)},size:`sm`})},p=e=>{D(e,{get score(){return l(a(i)),x(()=>a(i).sonarrScore)},size:`sm`})};e(u,e=>{l(a(s)),x(()=>a(s).key===`name`)?e(d):(l(a(s)),x(()=>a(s).key===`radarrScore`)?e(f,1):(l(a(s)),x(()=>a(s).key===`sonarrScore`)&&e(p,2)))}),n(t,c)}}})},J=e=>{var t=A();n(e,t)};e(K,e=>{l(R()),x(()=>R().profileRefs.length>0)?e(q):e(J,-1)}),r(U),b(()=>s(G,`References (${l(R()),x(()=>R().profileRefs.length)??``})`)),n(c,B),h(),F()}export{M as component};