import{aw as x,J as y,L as B,ax as C,ay as m,o as i,aD as u,az as f,aG as p,E as r,be as $,bf as v,aL as d,aB as l,aN as o,bg as c,cC as j,aS as b,c1 as S,b6 as T,bv as D,aC as L}from"./index-BeguICWm.js";import{E as O}from"./EditConfig-BikzkWGK.js";import{n as z}from"./index.browser-OxPLOBIU.js";import"./VForm-o34xemXk.js";import"./VExpansionPanels-B8yzmmSz.js";import"./VDialog-3N5CnNiB.js";import"./VAlert-Dkia6PbV.js";import"./VSwitch-DhgrqvI4.js";import"./VCheckboxBtn-HpD-UT_z.js";import"./VSlider-5AtOwDvY.js";import"./VSelect-Be4aEu8s.js";import"./VVirtualScroll-Vx_hX6dw.js";const I={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},W=x({__name:"EditCoreConfig",props:{domain:{}},setup(k){const V=L(),t=y(),w=z(11),s=y(!1),E=k;B(()=>E.domain,async a=>{a&&(t.value=await o.getCoreConfig(a))},{immediate:!0});const M=async function(a){s.value=!0,o.saveCoreConfig(t.value.domain,a).then(()=>{s.value=!1,V.push({name:"providersettings"})}).catch(e=>{alert(e),s.value=!1})},N=async function(a,e){s.value=!0;for(const n of Object.values(t.value.values))n.value!==void 0&&e[n.key]==null&&(e[n.key]=n.value);e.session_id=w,o.getCoreConfigEntries(t.value.domain,a,e).then(n=>{t.value.values={};for(const g of n)t.value.values[g.key]=g;s.value=!1}).catch(n=>{alert(n),s.value=!1})};return(a,e)=>(m(),C("section",null,[i(S,null,{default:u(()=>[t.value?(m(),C("div",I,[i($,null,{default:u(()=>[v(d(a.$t("settings.setup_provider",[l(o).providerManifests[t.value.domain].name])),1)]),_:1}),i(c,null,{default:u(()=>[v(d(l(o).providerManifests[t.value.domain].description),1)]),_:1}),e[3]||(e[3]=r("br",null,null,-1)),l(o).providerManifests[t.value.domain].codeowners.length?(m(),p(c,{key:0},{default:u(()=>[r("b",null,d(a.$t("settings.codeowners"))+": ",1),v(d(l(o).providerManifests[t.value.domain].codeowners.join(" / ")),1)]),_:1})):f("",!0),l(o).providerManifests[t.value.domain].documentation?(m(),p(c,{key:1},{default:u(()=>[r("b",null,d(a.$t("settings.need_help_setup_provider")),1),e[2]||(e[2]=v("  ",-1)),r("a",{onClick:e[0]||(e[0]=n=>l(j)(l(o).providerManifests[t.value.domain].documentation))},d(a.$t("settings.check_docs")),1)]),_:1})):f("",!0),e[4]||(e[4]=r("br",null,null,-1)),i(b),e[5]||(e[5]=r("br",null,null,-1)),e[6]||(e[6]=r("br",null,null,-1))])):f("",!0),i(b),t.value?(m(),p(O,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:M,onAction:N},null,8,["config-entries"])):f("",!0)]),_:1}),i(D,{modelValue:s.value,"onUpdate:modelValue":e[1]||(e[1]=n=>s.value=n),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:u(()=>[i(T,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{W as default};
