System.register(["./page_layout-legacy.js?v=1753954525509","./index-legacy.js?v=1753954525509","./public-legacy.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy4.js?v=1753954525509","./naive-legacy.js?v=1753954525509","./vue-legacy.js?v=1753954525509","./common-legacy.js?v=1753954525509","./__commonjsHelpers__-legacy.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy7.js?v=1753954525509"],(function(t,e){"use strict";var i,a,n,s,o,l,d,c,u,r,m,_,y,p,f,h,g,C,x,w,W,b,j,v,k,E,$,O,P,B,S,D;return{setters:[t=>{i=t.c_,a=t.d0,n=t.d1,s=t.g,o=t.d2,l=t.d3,d=t.c,c=t.a},t=>{u=t._},t=>{r=t.e,m=t.b,_=t.o,y=t.h,p=t.d,f=t.f,h=t._},t=>{g=t._},t=>{C=t.c0,x=t.cD,w=t.ay},t=>{W=t.k,b=t.P,j=t.Q,v=t.U,k=t.a1,E=t.a2,$=t.u,O=t.j,P=t.a3,B=t.X,S=t.W,D=t._},null,null,null],execute:function(){t("default",W({__name:"index",setup(t){const W=D((()=>c((()=>e.import("./index-legacy223.js?v=1753954525509")),void 0))),{t:L}=b(),U=i(),V=r("",{isEdit:!1,onRefresh:()=>{R()}}),z=()=>{V.data.isEdit=!1,V.data.row=void 0,V.title=L("Waf.Custom.index_4"),V.show=!0},{table:A,columns:H,setLoading:M}=m([{key:"name",title:L("Waf.Custom.index_6"),minWidth:160,ellipsis:{tooltip:!0}},{key:"servers",title:L("Waf.Custom.index_7"),width:"20%",minWidth:260,ellipsis:{tooltip:!0},render:({servers:t})=>U.getSiteName(t)},_({width:"10%",minWidth:100,status:t=>({checkedValue:1,uncheckedValue:0,onClick:async e=>{await a({id:t.id,status:e}),t.status=e}})}),{key:"hit",title:L("Waf.Custom.index_8"),width:"10%",minWidth:100,render:({hit:t})=>{return j(C,{size:"small",type:t>0?"success":"default",bordered:!1},"function"==typeof(e=t)||"[object Object]"===Object.prototype.toString.call(e)&&!$(e)?t:{default:()=>[t]});var e}},{key:"root",title:L("Waf.Custom.index_9"),width:"20%",minWidth:160,render:({root:t})=>U.getMatchCondition(t)},{key:"action",title:L("Waf.Custom.index_10"),width:"20%",minWidth:160,render:({action:t})=>U.getExecuteAction(t.type,t.response?.type||"")},y({width:140,options:t=>[{label:L("Public.Btn.Copy"),onClick:()=>{N(t)}},{label:L("Public.Btn.Edit"),onClick:()=>{(t=>{V.data.isEdit=!0,V.data.row=t,V.title=L("Waf.Custom.index_5",[t.name]),V.show=!0})(t)}},{label:L("Public.Btn.Del"),onClick:()=>{Q(t)}}]})]),N=t=>{p({title:L("Waf.Custom.index_11",[t.name]),content:L("Waf.Custom.index_12"),onConfirm:async()=>{await n({name:`${t.name}_copy_${s(6)}`,servers:t.servers?t.servers:[],status:1,is_global:0,priority:0,root:t.root,action:{type:t.action.type,response:Object.assign({},t.action.response,{headers:{}})}}),R()}})},Q=t=>{p({title:L("Waf.Custom.index_13",[t.name]),content:L("Waf.Custom.index_14"),onConfirm:async()=>{await o({id:t.id}),R()}})},R=async()=>{try{M(!0);const{message:t}=await l();d(t)&&t.rules&&(A.data=Object.entries(t.rules).map((([t,e])=>({...e,id:t}))))}finally{M(!1)}};return(async()=>{try{M(!0),await U.getConfig(),await R()}finally{M(!1)}})(),(t,e)=>{const i=w,a=f,n=g,s=h,o=u,l=x;return v(),k(l,{class:"p-16px"},{default:E((()=>[j(n,null,{toolsLeft:E((()=>[j(i,{type:"primary",onClick:z},{default:E((()=>[O(P(t.$t("Waf.Custom.index_1")),1)])),_:1})])),table:E((()=>[j(a,{loading:B(A).loading,data:B(A).data,columns:B(H)},null,8,["loading","data","columns"])])),_:1}),j(s,{class:"mt-20px"},{default:E((()=>[S("li",null,P(t.$t("Waf.Custom.index_2")),1),S("li",null,P(t.$t("Waf.Custom.index_3")),1)])),_:1}),j(o,{show:B(V).show,"onUpdate:show":e[0]||(e[0]=t=>B(V).show=t),title:B(V).title,data:B(V).data,width:800,"min-height":448,footer:!0,component:B(W)},null,8,["show","title","data","component"])])),_:1})}}}))}}}));
