System.register(["./page_layout-legacy.js?v=1764830988434","./index-legacy.js?v=1764830988434","./public-legacy.js?v=1764830988434","./index.vue_vue_type_script_setup_true_lang-legacy5.js?v=1764830988434","./naive-legacy.js?v=1764830988434","./vue-legacy.js?v=1764830988434","./common-legacy.js?v=1764830988434","./__commonjsHelpers__-legacy.js?v=1764830988434","./index.vue_vue_type_script_setup_true_lang-legacy6.js?v=1764830988434"],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,j,b,v,k,E,S,$,O,P,B,V;return{setters:[t=>{i=t.dj,a=t.dk,n=t.dl,s=t.g,o=t.dm,l=t.dn,d=t.d,c=t.a},t=>{u=t._},t=>{r=t.e,m=t.c,_=t.n,y=t.f,p=t.a,f=t.h,h=t._},t=>{g=t._},t=>{C=t.dd,x=t.aC,w=t.dS},t=>{W=t.k,j=t.P,b=t.W,v=t.a2,k=t.V,E=t.a3,S=t.U,$=t.j,O=t.a4,P=t.S,B=t._,V=t.u},null,null,null],execute:function(){t("default",W({__name:"index",setup(t){const W=B(()=>c(()=>e.import("./index-legacy232.js?v=1764830988434"),void 0)),{t:L}=j(),U=i(),z=r("",{isEdit:!1,onRefresh:()=>{q()}}),A=()=>{z.data.isEdit=!1,z.data.row=void 0,z.title=L("Waf.Custom.index_4"),z.show=!0},{table:D,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 b(C,{size:"small",type:t>0?"success":"default",bordered:!1},"function"==typeof(e=t)||"[object Object]"===Object.prototype.toString.call(e)&&!V(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=>{z.data.isEdit=!0,z.data.row=t,z.title=L("Waf.Custom.index_5",[t.name]),z.show=!0})(t)}},{label:L("Public.Btn.Del"),onClick:()=>{R(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:{}})}}),q()}})},R=t=>{p({title:L("Waf.Custom.index_13",[t.name]),content:L("Waf.Custom.index_14"),onConfirm:async()=>{await o({id:t.id}),q()}})},q=async()=>{try{M(!0);const{message:t}=await l();d(t)&&t.rules&&(D.data=Object.entries(t.rules).map(([t,e])=>({...e,id:t})))}finally{M(!1)}};return(async()=>{try{M(!0),await U.getConfig(),await q()}finally{M(!1)}})(),(t,e)=>{const i=x,a=f,n=g,s=h,o=u,l=w;return k(),v(l,{class:"p-16px"},{default:E(()=>[b(n,null,{toolsLeft:E(()=>[b(i,{type:"primary",onClick:A},{default:E(()=>[$(O(t.$t("Waf.Custom.index_1")),1)]),_:1})]),table:E(()=>[b(a,{loading:S(D).loading,data:S(D).data,columns:S(H)},null,8,["loading","data","columns"])]),_:1}),b(s,{class:"mt-20px"},{default:E(()=>[P("li",null,O(t.$t("Waf.Custom.index_2")),1),P("li",null,O(t.$t("Waf.Custom.index_3")),1)]),_:1}),b(o,{show:S(z).show,"onUpdate:show":e[0]||(e[0]=t=>S(z).show=t),title:S(z).title,data:S(z).data,width:800,"min-height":448,footer:!0,component:S(W)},null,8,["show","title","data","component"])]),_:1})}}}))}}});
