import{f as i,t as p,_ as x}from"./index-DkCrJWiT.js";import{n as M}from"./index.browser-OxPLOBIU.js";import{u as $}from"./vue-router-D-D-f2lE.js";import{E as B}from"./EditConfig-o1R25eFw.js";import{d as N,a as D,k as O,Z as j}from"./vuetify-DEtiqX2e.js";import{d as z,w as S,b as f,I as v,D as T,H as r,r as _,u as A,E as c,f as n,$ as H,a1 as d,c as P,e as l}from"./lucide-CCrbsyJI.js";import{u as R}from"./vue-i18n-krBRuO6q.js";import"./color-CcshWhNz.js";import"./qrcode-CCHMWIXh.js";import"./marked-i_gIkIP3.js";import"./vueuse-FEBxOGD_.js";/* empty css            */import"./swiper-YiD1SI-4.js";import"./index-DrRcO7PK.js";import"./reka-ui-CrWUNNju.js";import"./index-BBA2x4Zu.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-hy1bGinH.js";const U={class:"edit-core-config"},Z={key:0},q={class:"header-content"},F={class:"header-icon"},G={class:"header-info"},J={class:"header-title"},K={class:"header-description"},L=z({__name:"EditCoreConfig",props:{domain:{}},setup(g){const h=$(),{t:m}=R(),t=_(),y=M(11),s=_(!1),C=g,V=P(()=>t.value?Object.values(t.value.values):[]);S(()=>C.domain,async e=>{e&&(t.value=await i.getCoreConfig(e))},{immediate:!0});const k=e=>{const o=m(`settings.core_module.${e.domain}.name`);return o!==`settings.core_module.${e.domain}.name`?o:i.providerManifests[e.domain].name},b=e=>{const o=m(`settings.core_module.${e.domain}.description`);return o!==`settings.core_module.${e.domain}.description`?o:i.providerManifests[e.domain].description},E=e=>({streams:"mdi-radio-tower",players:"mdi-speaker-multiple",metadata:"mdi-tag-multiple",music:"mdi-music",webserver:"mdi-web",cache:"mdi-cached"})[e]||"mdi-cog",I=async function(e){s.value=!0,i.saveCoreConfig(t.value.domain,e).then(()=>{h.push({name:"systemsettings"})}).catch(o=>{p.error(o.message||o)}).finally(()=>{s.value=!1})},w=async function(e,o){s.value=!0;for(const a of Object.values(t.value.values))a.value!==void 0&&o[a.key]==null&&(o[a.key]=a.value);o.session_id=y,i.getCoreConfigEntries(t.value.domain,e,o).then(a=>{t.value.values={};for(const u of a)t.value.values[u.key]=u;s.value=!1}).catch(a=>{p.error(a.message||a),s.value=!1})};return(e,o)=>(l(),f("section",U,[t.value&&A(i).providerManifests[t.value.domain]?(l(),f("div",Z,[r(D,{class:"header-card mb-4",elevation:"0"},{default:c(()=>[n("div",q,[n("div",F,[r(N,{size:"32",color:"primary"},{default:c(()=>[H(d(E(t.value.domain)),1)]),_:1})]),n("div",G,[n("h2",J,d(k(t.value)),1),n("p",K,d(b(t.value)),1)])])]),_:1})])):v("",!0),t.value?(l(),T(B,{key:1,"config-entries":V.value,disabled:!1,onSubmit:I,onAction:w},null,8,["config-entries"])):v("",!0),r(j,{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=a=>s.value=a),scrim:"true",persistent:"",class:"loading-overlay"},{default:c(()=>[r(O,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}}),pe=x(L,[["__scopeId","data-v-03c6d489"]]);export{pe as default};
