System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1753954525509","./page_layout-legacy.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy2.js?v=1753954525509","./vue-legacy.js?v=1753954525509","./public-legacy.js?v=1753954525509","./index-legacy126.js?v=1753954525509","./naive-legacy.js?v=1753954525509","./common-legacy.js?v=1753954525509","./__commonjsHelpers__-legacy.js?v=1753954525509","./index-legacy96.js?v=1753954525509","./index-legacy127.js?v=1753954525509","./soft-legacy.js?v=1753954525509"],(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,q,k;return{setters:[e=>{l=e._},e=>{s=e.b1,t=e.eg,r=e.o,n=e.m},e=>{u=e._},e=>{d=e.k,o=e.P,i=e.$,c=e.r,_=e.e,p=e.c,b=e.U,g=e.a1,v=e.a2,m=e.Q,x=e.W,f=e.X,y=e.l,h=e.v,j=e.j,w=e.a3,D=e.N},null,e=>{$=e.g},e=>{U=e.aq,q=e.cA,k=e.cG},null,null,null,null,null],execute:function(){const a={class:"w-240px"},C={class:"w-240px"},E={class:"w-240px"},R={class:"w-240px"},A={class:"ml-8px"};e("default",d({__name:"index",props:{data:{}},setup(e,{expose:d}){const{t:G}=o(),H=e,{status:L}=H.data,N=s(),{remoteList:P}=i(N),Q=c(null),S=_({sid:P.value.length>0?P.value[0].id:null,name:"",db_user:"",password:"",active:!1,ssl:""}),W=p((()=>P.value.map((e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))))),X={name:{required:!0,message:G("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:G("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:G("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(G("Database.tools.index_64"))}},z=e=>{S.db_user=e},B=()=>{$()};return d({onConfirm:async({hide:e})=>{try{await(Q.value?.validate());const a=(()=>{const{sid:e}=S;if(null===e)throw n.error(G("Database.tools.index_64")),new Error(G("Database.tools.index_64"));return{...D(S),sid:e,ps:S.name}})();await t(N.type,a),N.setRefresh(!0),e()}catch(a){console.error(a)}}}),(e,s)=>{const t=U,n=q,d=u,o=k,i=r,c=l;return b(),g(c,{ref_key:"formRef",ref:Q,model:f(S),rules:X,class:"p-20px"},{default:v((()=>[m(n,{label:e.$t("Database.index_12"),path:"name"},{default:v((()=>[x("div",a,[m(t,{value:f(S).name,"onUpdate:value":[s[0]||(s[0]=e=>f(S).name=e),z],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",C,[m(t,{value:f(S).db_user,"onUpdate:value":s[1]||(s[1]=e=>f(S).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",E,[m(d,{value:f(S).password,"onUpdate:value":s[2]||(s[2]=e=>f(S).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",R,[m(o,{value:f(S).sid,"onUpdate:value":s[3]||(s[3]=e=>f(S).sid=e),options:f(W)},null,8,["value","options"])]),x("div",A,[m(i,{onClick:B},{default:v((()=>[j(w(e.$t("Database.form.index_10")),1)])),_:1})])])),_:1},8,["label"])])),_:1},8,["model"])}}}))}}}));
