System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1753954525509","./vue-legacy.js?v=1753954525509","./page_layout-legacy.js?v=1753954525509","./naive-legacy.js?v=1753954525509","./__commonjsHelpers__-legacy.js?v=1753954525509","./common-legacy.js?v=1753954525509","./public-legacy.js?v=1753954525509"],(function(e,l){"use strict";var a,t,r,o,u,s,i,n,p,c,y,d,f,_,v,m,w,b,h,g,x,S,A,F,$;return{setters:[e=>{a=e._},e=>{t=e.k,r=e.P,o=e.r,u=e.e,s=e.U,i=e.V,n=e.Q,p=e.a2,c=e.W,y=e.X,d=e.l,f=e.v,_=e.a1,v=e.al},e=>{m=e.aP,w=e.f$,b=e.w,h=e.k,g=e.g0,x=e.g1},e=>{S=e.cG,A=e.cA,F=e.c1,$=e._},null,null,null],execute:function(){const l={class:"px-20px pt-24px pb-8px"},j={class:"w-240px"},U={class:"w-240px"},k={class:"w-240px"},E={class:"w-240px"};e("default",t({__name:"form",props:{row:{},isEdit:{type:Boolean,default:!1}},emits:["refresh"],setup(e,{expose:t,emit:P}){const C=e,H=P,{t:B}=r(),{isEdit:G,row:I}=C,Q=o(null),R=u({types:"drop",choose:"all",ports:null,country:["United States"],is_update:!1}),V={country:{trigger:"change",validator:()=>0!==R.country.length||new Error(B("Security.Firewall.Area.form_8"))},ports:{trigger:["blur","input"],validator:()=>{if("point"===R.choose){if(!R.ports)return new Error(B("Security.Firewall.Area.form_9"));if(!m(`${R.ports}`))return new Error(B("Security.Firewall.Area.form_10"))}return!0}}},W=[{label:B("Security.Firewall.Area.form_11"),value:"all"},{label:B("Security.Firewall.Area.form_3"),value:"point"}],X=[{label:B("Security.Firewall.Area.form_12"),value:"drop"}],q=o(!1),z=o([]);return(async()=>{try{q.value=!0;const{message:e}=await w();b(e)&&(z.value=e.map((e=>({label:e.CH,value:e.CH,brief:e.brief}))))}finally{q.value=!1}})(),G&&I&&(R.types=I.types,R.choose=I.ports?"point":"all",R.ports=I.ports?h(I.ports):null,R.country=I.country),t({onConfirm:async()=>{await(Q.value?.validate());const e={types:R.types,choose:R.choose,ports:"point"===R.choose?`${R.ports||""}`:"",country:R.country,brief:"",is_update:R.is_update};G&&I?(e.brief=`${z.value.find((e=>e.label===I.country))?.brief||""}`,await g({...e,id:I.id})):await x(e),H("refresh")}}),(e,t)=>{const r=S,o=A,u=F,m=$,w=a;return s(),i("div",l,[n(w,{ref_key:"formRef",ref:Q,model:y(R),rules:V},{default:p((()=>[n(o,{label:e.$t("Security.Firewall.Area.form_1"),path:"types"},{default:p((()=>[c("div",j,[n(r,{value:y(R).types,"onUpdate:value":t[0]||(t[0]=e=>y(R).types=e),options:X},null,8,["value"])])])),_:1},8,["label"]),n(o,{label:e.$t("Security.Firewall.Area.form_2"),path:"choose"},{default:p((()=>[c("div",U,[n(r,{value:y(R).choose,"onUpdate:value":t[1]||(t[1]=e=>y(R).choose=e),options:W},null,8,["value"])])])),_:1},8,["label"]),d(n(o,{label:e.$t("Security.Firewall.Area.form_3"),path:"ports"},{default:p((()=>[c("div",k,[n(u,{value:y(R).ports,"onUpdate:value":t[2]||(t[2]=e=>y(R).ports=e),min:1,max:65535,"show-button":!1,placeholder:e.$t("Security.Firewall.Area.form_4")},null,8,["value","placeholder"])])])),_:1},8,["label"]),[[f,"point"===y(R).choose]]),n(o,{label:e.$t("Security.Firewall.Area.form_5"),path:"country"},{default:p((()=>[c("div",E,[n(r,{value:y(R).country,"onUpdate:value":t[3]||(t[3]=e=>y(R).country=e),filterable:"","max-tag-count":"responsive",multiple:!y(G),loading:y(q),options:y(z)},null,8,["value","multiple","loading","options"])])])),_:1},8,["label"]),y(G)?v("",!0):(s(),_(o,{key:0,label:" "},{default:p((()=>[n(m,{checked:y(R).is_update,"onUpdate:checked":t[4]||(t[4]=e=>y(R).is_update=e),label:"Update IP Pool"},null,8,["checked"])])),_:1}))])),_:1},8,["model"])])}}}))}}}));
