System.register(["./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BSBh0Le2.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./index-legacy-y1mYB81o.js?v=1773287522785","./index-legacy-CDUlQ1jh.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785","./index-legacy-DGWsVoxN.js?v=1773287522785","./index-legacy-DWPn48Vb.js?v=1773287522785"],(function(e,a){"use strict";var l,s,r,t,n,d,u,i,o,_,c,p,b,v,g,m,x,f,h,y,w,D,j,$,U;return{setters:[e=>{l=e._},e=>{s=e._,r=e.fc,t=e.m},e=>{n=e._},e=>{d=e.k,u=e.R,i=e.a6,o=e.r,_=e.e,c=e.c,p=e.$,b=e.a8,v=e.a9,g=e.a0,m=e._,x=e.S,f=e.j,h=e.aa,y=e.N},e=>{w=e.u},e=>{D=e.g},e=>{j=e.a1,$=e.b,U=e.a6},null,null,null],execute:function(){const a={class:"w-240px"},k={class:"w-240px"},q={class:"w-240px"},R={class:"w-240px"},C={class:"ml-8px"};e("default",d({__name:"index",setup(e,{expose:d}){const{t:E}=u(),S=w(),{remoteList:L}=i(S),N=o(null),Z=_({sid:L.value.length>0?L.value[0].id:null,name:"",db_user:"",password:"",active:!1,ssl:""}),z=c((()=>L.value.map((e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))))),A={name:{required:!0,message:E("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:E("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:E("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(E("Database.form.index_18"))}},B=e=>{Z.db_user=e},F=()=>{D()};return d({onConfirm:async({hide:e})=>{await(N.value?.validate());const a=(()=>{const{sid:e}=Z;if(null===e)throw t.error(E("Database.form.index_18")),new Error(E("Database.form.index_18"));return{...y(Z),sid:e,ps:Z.name}})();await r(S.type,a),S.setRefresh(!0),e()}}),(e,r)=>{const t=$,d=j,u=n,i=U,o=s,_=l;return p(),b(_,{ref_key:"formRef",ref:N,model:x(Z),rules:A,class:"p-20px"},{default:v((()=>[g(d,{label:e.$t("Database.index_12"),path:"name"},{default:v((()=>[m("div",a,[g(t,{value:x(Z).name,"onUpdate:value":[r[0]||(r[0]=e=>x(Z).name=e),B],placeholder:e.$t("Database.form.index_2")},null,8,["value","placeholder"])])])),_:1},8,["label"]),g(d,{label:e.$t("Database.index_13"),path:"db_user"},{default:v((()=>[m("div",k,[g(t,{value:x(Z).db_user,"onUpdate:value":r[1]||(r[1]=e=>x(Z).db_user=e),placeholder:e.$t("Database.form.index_4")},null,8,["value","placeholder"])])])),_:1},8,["label"]),g(d,{label:e.$t("Database.index_14"),path:"password"},{default:v((()=>[m("div",q,[g(u,{value:x(Z).password,"onUpdate:value":r[2]||(r[2]=e=>x(Z).password=e),placeholder:""},null,8,["value"])])])),_:1},8,["label"]),g(d,{label:e.$t("Database.form.index_9"),path:"sid"},{default:v((()=>[m("div",R,[g(i,{value:x(Z).sid,"onUpdate:value":r[3]||(r[3]=e=>x(Z).sid=e),options:x(z)},null,8,["value","options"])]),m("div",C,[g(o,{onClick:F},{default:v((()=>[f(h(e.$t("Database.form.index_10")),1)])),_:1})])])),_:1},8,["label"])])),_:1},8,["model"])}}}))}}}));
