System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1763625242172","./page_layout-legacy.js?v=1763625242172","./index.vue_vue_type_script_setup_true_lang-legacy2.js?v=1763625242172","./vue-legacy.js?v=1763625242172","./public-legacy.js?v=1763625242172","./index-legacy131.js?v=1763625242172","./naive-legacy.js?v=1763625242172","./common-legacy.js?v=1763625242172","./__commonjsHelpers__-legacy.js?v=1763625242172","./index-legacy98.js?v=1763625242172","./index-legacy132.js?v=1763625242172","./soft-legacy.js?v=1763625242172","./site-legacy.js?v=1763625242172"],(function(e,a){"use strict";var l,s,t,r,n,u,d,o,i,c,_,p,b,g,v,m,x,f,y,h,j,w,D,$,U,k,q;return{setters:[e=>{l=e._},e=>{s=e.bn,t=e.eV,r=e.o,n=e.m},e=>{u=e._},e=>{d=e.k,o=e.P,i=e.a0,c=e.r,_=e.e,p=e.c,b=e.R,g=e.a2,v=e.a3,m=e.X,x=e.U,f=e.V,y=e.l,h=e.v,j=e.j,w=e.a4,D=e.N},null,e=>{$=e.g},e=>{U=e.au,k=e.dP,q=e.dV},null,null,null,null,null,null],execute:function(){const a={class:"w-240px"},R={class:"w-240px"},V={class:"w-240px"},C={class:"w-240px"},E={class:"ml-8px"};e("default",d({__name:"index",props:{data:{}},setup(e,{expose:d}){const{t:P}=o(),H=e,{status:L}=H.data,N=s(),{remoteList:S}=i(N),X=c(null),z=_({sid:S.value.length>0?S.value[0].id:null,name:"",db_user:"",password:"",active:!1,ssl:""}),A=p((()=>S.value.map((e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))))),B={name:{required:!0,message:P("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:P("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:P("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(P("Database.tools.index_64"))}},F=e=>{z.db_user=e},G=()=>{$()};return d({onConfirm:async({hide:e})=>{try{await(X.value?.validate());const a=(()=>{const{sid:e}=z;if(null===e)throw n.error(P("Database.tools.index_64")),new Error(P("Database.tools.index_64"));return{...D(z),sid:e,ps:z.name}})();await t(N.type,a),N.setRefresh(!0),e()}catch(a){console.error(a)}}}),(e,s)=>{const t=U,n=k,d=u,o=q,i=r,c=l;return b(),g(c,{ref_key:"formRef",ref:X,model:f(z),rules:B,class:"p-20px"},{default:v((()=>[m(n,{label:e.$t("Database.index_12"),path:"name"},{default:v((()=>[x("div",a,[m(t,{value:f(z).name,"onUpdate:value":[s[0]||(s[0]=e=>f(z).name=e),F],placeholder:e.$t("Database.form.index_2")},null,8,["value","placeholder"])])])),_:1},8,["label"]),y(m(n,{label:e.$t("Database.index_13"),path:"db_user"},{default:v((()=>[x("div",R,[m(t,{value:f(z).db_user,"onUpdate:value":s[1]||(s[1]=e=>f(z).db_user=e),placeholder:e.$t("Database.form.index_4")},null,8,["value","placeholder"])])])),_:1},8,["label"]),[[h,f(L)]]),y(m(n,{label:e.$t("Database.index_14"),path:"password"},{default:v((()=>[x("div",V,[m(d,{value:f(z).password,"onUpdate:value":s[2]||(s[2]=e=>f(z).password=e)},null,8,["value"])])])),_:1},8,["label"]),[[h,f(L)]]),m(n,{label:e.$t("Database.form.index_9"),path:"sid"},{default:v((()=>[x("div",C,[m(o,{value:f(z).sid,"onUpdate:value":s[3]||(s[3]=e=>f(z).sid=e),options:f(A)},null,8,["value","options"])]),x("div",E,[m(i,{onClick:G},{default:v((()=>[j(w(e.$t("Database.form.index_10")),1)])),_:1})])])),_:1},8,["label"])])),_:1},8,["model"])}}}))}}}));
