import{d as M,aj as E,r as _,N,c as m,g as y,f as i,w as l,Y as c,t as u,u as d,e as p,i as r,j as f,b as n}from"./index-103db515.js";import{E as x}from"./EditConfig-f05929af.js";import{n as B}from"./index.browser-342e672c.js";import{V as $,a as O}from"./VCardText-1a59cac1.js";import{a as v}from"./VCard-d4f085fd.js";import{V as h}from"./VList-cac73f62.js";import{y as S}from"./VListItem-ab7a82e2.js";import{c as T}from"./VMenu-482e7fbc.js";import"./VExpansionPanels-dacf6c3c.js";import"./VCheckboxBtn-19bafbc9.js";import"./VForm-f2e1d3c9.js";import"./VTextField-73438668.js";import"./VVirtualScroll-b23fb9a8.js";import"./VSpacer-adcb10ea.js";/* empty css              */import"./VDialog-08f8879f.js";import"./VAlert-4165d2e6.js";import"./_plugin-vue_export-helper-c27b6911.js";const D={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},z=r("br",null,null,-1),A=["href"],I=r("br",null,null,-1),P=r("br",null,null,-1),R=r("br",null,null,-1),se=M({__name:"EditCoreConfig",props:{domain:{}},setup(C){const V=E(),e=_(),b=B(11),s=_(!1),k=C;N(()=>k.domain,async t=>{t&&(e.value=await n.getCoreConfig(t))},{immediate:!0});const w=async function(t){s.value=!0,n.saveCoreConfig(e.value.domain,t).then(()=>{s.value=!1,V.push({name:"providersettings"})}).catch(a=>{alert(a),s.value=!1})},j=async function(t,a){s.value=!0;for(const o of Object.values(e.value.values))o.value!==void 0&&a[o.key]==null&&(a[o.key]=o.value);a.session_id=b,n.getCoreConfigEntries(e.value.domain,t,a).then(o=>{e.value.values={};for(const g of o)e.value.values[g.key]=g;s.value=!1}).catch(o=>{alert(o),s.value=!1})};return(t,a)=>(m(),y("section",null,[i(O,null,{default:l(()=>[e.value?(m(),y("div",D,[i($,null,{default:l(()=>[c(u(t.$t("settings.setup_provider",[d(n).providerManifests[e.value.domain].name])),1)]),_:1}),i(v,null,{default:l(()=>[c(u(d(n).providerManifests[e.value.domain].description),1)]),_:1}),z,d(n).providerManifests[e.value.domain].codeowners.length?(m(),p(v,{key:0},{default:l(()=>[r("b",null,u(t.$t("settings.codeowners"))+": ",1),c(u(d(n).providerManifests[e.value.domain].codeowners.join(" / ")),1)]),_:1})):f("",!0),d(n).providerManifests[e.value.domain].documentation?(m(),p(v,{key:1},{default:l(()=>[r("b",null,u(t.$t("settings.need_help_setup_provider")),1),c("  "),r("a",{href:d(n).providerManifests[e.value.domain].documentation,target:"_blank"},u(t.$t("settings.check_docs")),9,A)]),_:1})):f("",!0),I,i(h),P,R])):f("",!0),i(h),e.value?(m(),p(x,{key:1,"config-entries":Object.values(e.value.values),disabled:!1,onSubmit:w,onAction:j},null,8,["config-entries"])):f("",!0)]),_:1}),i(T,{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=o=>s.value=o),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:l(()=>[i(S,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{se as default};
