System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1764233927359","./page_layout-legacy.js?v=1764233927359","./index.vue_vue_type_script_setup_true_lang-legacy2.js?v=1764233927359","./vue-legacy.js?v=1764233927359","./public-legacy.js?v=1764233927359","./index-legacy131.js?v=1764233927359","./naive-legacy.js?v=1764233927359","./common-legacy.js?v=1764233927359","./__commonjsHelpers__-legacy.js?v=1764233927359","./index-legacy98.js?v=1764233927359","./index-legacy132.js?v=1764233927359","./soft-legacy.js?v=1764233927359","./site-legacy.js?v=1764233927359"],function(e,a){"use strict";var l,s,t,r,n,u,d,i,o,p,c,_,m,b,g,v,f,x,y,h,w,j,D,$,U;return{setters:[e=>{l=e._},e=>{s=e.bn,t=e.o,r=e.eW,n=e.m},e=>{u=e._},e=>{d=e.k,i=e.P,o=e.a0,p=e.r,c=e.e,_=e.c,m=e.a2,b=e.V,g=e.a3,v=e.W,f=e.S,x=e.U,y=e.j,h=e.a4,w=e.N},null,e=>{j=e.g},e=>{D=e.dR,$=e.au,U=e.dV},null,null,null,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}=i(),S=s(),{remoteList:V}=o(S),W=p(null),H=c({sid:V.value.length>0?V.value[0].id:null,name:"",db_user:"",password:"",active:!1,ssl:""}),L=_(()=>V.value.map(e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))),N={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"))}},P=e=>{H.db_user=e},z=()=>{j()};return d({onConfirm:async()=>{try{await(W.value?.validate());const e=(()=>{const e=w(H),{sid:a}=e;if(null===a)throw n.error(E("Database.form.index_18")),new Error(E("Database.form.index_18"));return{...e,sid:a,ps:e.name}})();await r(S.type,e),S.setRefresh(!0)}catch(e){console.warn(e)}}}),(e,s)=>{const r=$,n=D,d=u,i=U,o=t,p=l;return b(),m(p,{ref_key:"formRef",ref:W,model:x(H),rules:N,class:"p-20px"},{default:g(()=>[v(n,{label:e.$t("Database.index_12"),path:"name"},{default:g(()=>[f("div",a,[v(r,{value:x(H).name,"onUpdate:value":[s[0]||(s[0]=e=>x(H).name=e),P],placeholder:e.$t("Database.form.index_2"),"input-props":{name:"name"}},null,8,["value","placeholder"])])]),_:1},8,["label"]),v(n,{label:e.$t("Database.index_13"),path:"db_user"},{default:g(()=>[f("div",k,[v(r,{value:x(H).db_user,"onUpdate:value":s[1]||(s[1]=e=>x(H).db_user=e),placeholder:"Database user","input-props":{name:"user"}},null,8,["value"])])]),_:1},8,["label"]),v(n,{label:e.$t("Database.index_14"),path:"password"},{default:g(()=>[f("div",q,[v(d,{value:x(H).password,"onUpdate:value":s[2]||(s[2]=e=>x(H).password=e),"input-props":{name:"password"}},null,8,["value"])])]),_:1},8,["label"]),v(n,{label:e.$t("Database.form.index_9"),path:"sid"},{default:g(()=>[f("div",R,[v(i,{value:x(H).sid,"onUpdate:value":s[3]||(s[3]=e=>x(H).sid=e),class:"server-select",options:x(L)},null,8,["value","options"])]),f("div",C,[v(o,{onClick:z},{default:g(()=>[y(h(e.$t("Database.form.index_10")),1)]),_:1})])]),_:1},8,["label"])]),_:1},8,["model"])}}}))}}});
