System.register(["./index-legacy-DQdImDha.js?v=1773287522785","./index-legacy-DgZ0-E4f.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BWPgT9-g.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-IFFYkvEY.js?v=1773287522785","./useTableData-legacy-3kc3lnk4.js?v=1773287522785","./useTableColumns-legacy-DP6ypvsQ.js?v=1773287522785","./custom-legacy-BOQU43Jz.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BQ2Kqzbl.js?v=1773287522785","./data-legacy-B9xdUIE5.js?v=1773287522785","./index-legacy-hh1mlQOF.js?v=1773287522785","./copy-legacy-CoXPjkKf.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-B9P08_gB.js?v=1773287522785","./index-legacy-BFkuWVH1.js?v=1773287522785"],(function(e,t){"use strict";var a,i,n,s,l,o,u,d,c,r,_,y,m,p,g,f,h,x,j,C,w,v,W,b,k,$,E,B,O,P,S,D;return{setters:[e=>{a=e.v,i=e.h,n=e.k,s=e.i,l=e.x,o=e.P},e=>{u=e._},e=>{d=e._},e=>{c=e._},e=>{r=e.u},e=>{_=e.a,y=e.u},e=>{m=e.u,p=e.s,g=e.a,f=e.r,h=e.g},e=>{x=e.o,j=e.B,C=e.a2},e=>{w=e.k,v=e.R,W=e.a0,b=e.$,k=e.a8,$=e.a9,E=e.S,B=e.j,O=e.aa,P=e._,S=e.a3,D=e.u},null,null,null,null,null,null,null],execute:function(){e("default",w({__name:"index",setup(e){const w=S((()=>o((()=>t.import("./index-legacy-BRf7TKAg.js?v=1773287522785")),void 0))),{t:L}=v(),R=m(),T=a("",{isEdit:!1,onRefresh:()=>{q()}}),V=()=>{T.data.isEdit=!1,T.data.row=void 0,T.title=L("Waf.Custom.index_4"),T.show=!0},{table:z,columns:A,setLoading:M}=r([{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:e})=>R.getSiteName(e)},_({width:"10%",minWidth:100,status:e=>({checkedValue:1,uncheckedValue:0,onClick:async t=>{await p({id:e.id,status:t}),e.status=t}})}),{key:"hit",title:L("Waf.Custom.index_8"),width:"10%",minWidth:100,render:({hit:e})=>{return W(x,{size:"small",type:e>0?"success":"default",bordered:!1},"function"==typeof(t=e)||"[object Object]"===Object.prototype.toString.call(t)&&!D(t)?e:{default:()=>[e]});var t}},{key:"root",title:L("Waf.Custom.index_9"),width:"20%",minWidth:160,render:({root:e})=>R.getMatchCondition(e)},{key:"action",title:L("Waf.Custom.index_10"),width:"20%",minWidth:160,render:({action:e})=>R.getExecuteAction(e.type,e.response?.type||"")},y({width:140,options:e=>[{label:L("Public.Btn.Copy"),onClick:()=>{N(e)}},{label:L("Public.Btn.Edit"),onClick:()=>{(e=>{T.data.isEdit=!0,T.data.row=e,T.title=L("Waf.Custom.index_5",[e.name]),T.show=!0})(e)}},{label:L("Public.Btn.Del"),onClick:()=>{U(e)}}]})]),N=e=>{i({title:L("Waf.Custom.index_11",[e.name]),content:L("Waf.Custom.index_12"),onConfirm:async()=>{await g({name:`${e.name}_copy_${n(6)}`,servers:e.servers?e.servers:[],status:1,is_global:0,priority:0,root:e.root,action:{type:e.action.type,response:Object.assign({},e.action.response,{headers:{}})}}),q()}})},U=e=>{i({title:L("Waf.Custom.index_13",[e.name]),content:L("Waf.Custom.index_14"),onConfirm:async()=>{await f({id:e.id}),q()}})},q=async()=>{try{M(!0);const{message:e}=await h();s(e)&&e.rules&&(z.data=Object.entries(e.rules).map((([e,t])=>({...t,id:e}))))}finally{M(!1)}};return(async()=>{try{M(!0),await R.getConfig(),await q()}finally{M(!1)}})(),(e,t)=>{const a=j,i=c,n=d,s=u,o=l,r=C;return b(),k(r,{class:"p-16px"},{default:$((()=>[W(n,null,{toolsLeft:$((()=>[W(a,{type:"primary",onClick:V},{default:$((()=>[B(O(e.$t("Waf.Custom.index_1")),1)])),_:1})])),table:$((()=>[W(i,{loading:E(z).loading,data:E(z).data,columns:E(A)},null,8,["loading","data","columns"])])),_:1}),W(s,{class:"mt-20px"},{default:$((()=>[P("li",null,O(e.$t("Waf.Custom.index_2")),1),P("li",null,O(e.$t("Waf.Custom.index_3")),1)])),_:1}),W(o,{show:E(T).show,"onUpdate:show":t[0]||(t[0]=e=>E(T).show=e),title:E(T).title,data:E(T).data,width:800,"min-height":448,footer:!0,component:E(w)},null,8,["show","title","data","component"])])),_:1})}}}))}}}));
