import{d as j,a1 as $,r as g,I as x,c as m,h,f as r,w as l,m as c,t as u,u as d,e as p,g as i,j as f,b as n}from"./index-0ae84607.js";import{_ as B}from"./EditConfig.vue_vue_type_style_index_0_lang-991e1055.js";import{n as N}from"./index.browser-342e672c.js";import{a as E,V as O}from"./VCardText-b1a0de89.js";import{a as v}from"./VCard-e96ab32b.js";import{a as y,t as S}from"./forwardRefs-d0d7c5bd.js";import{e as T}from"./VMenu-f26d3a19.js";import"./VExpansionPanel-4cf67b18.js";import"./VInput-00e20677.js";import"./VSlideGroup-18f8a11f.js";import"./VForm-272c3dd0.js";/* empty css              */import"./VDialog-2b5eada8.js";import"./VAlert-212471f5.js";import"./VTextField-4bf39c0d.js";import"./VSelect-2b6c5c22.js";import"./VVirtualScroll-06bbaaf5.js";const D={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},I=i("br",null,null,-1),z=["href"],A=i("br",null,null,-1),P=i("br",null,null,-1),R=i("br",null,null,-1),ne=j({__name:"EditCoreConfig",props:{domain:{}},setup(C){const V=$(),e=g(),b=N(11),s=g(!1),k=C;x(()=>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(o=>{alert(o),s.value=!1})},M=async function(t,o){s.value=!0;for(const a of Object.values(e.value.values))a.value!==void 0&&o[a.key]==null&&(o[a.key]=a.value);o.session_id=b,n.getCoreConfigEntries(e.value.domain,t,o).then(a=>{e.value.values={};for(const _ of a)e.value.values[_.key]=_;s.value=!1}).catch(a=>{alert(a),s.value=!1})};return(t,o)=>(m(),h("section",null,[r(O,null,{default:l(()=>[e.value?(m(),h("div",D,[r(E,null,{default:l(()=>[c(u(t.$t("settings.setup_provider",[d(n).providerManifests[e.value.domain].name])),1)]),_:1}),r(v,null,{default:l(()=>[c(u(d(n).providerManifests[e.value.domain].description),1)]),_:1}),I,d(n).providerManifests[e.value.domain].codeowners.length?(m(),p(v,{key:0},{default:l(()=>[i("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(()=>[i("b",null,u(t.$t("settings.need_help_setup_provider")),1),c("  "),i("a",{href:d(n).providerManifests[e.value.domain].documentation,target:"_blank"},u(t.$t("settings.check_docs")),9,z)]),_:1})):f("",!0),A,r(y),P,R])):f("",!0),r(y),e.value?(m(),p(B,{key:1,"config-entries":Object.values(e.value.values),disabled:!1,onSubmit:w,onAction:M},null,8,["config-entries"])):f("",!0)]),_:1}),r(T,{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=a=>s.value=a),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:l(()=>[r(S,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{ne as default};
