System.register(["./index-legacy-DgZ0-E4f.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-IFFYkvEY.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./useTableColumns-legacy-DP6ypvsQ.js?v=1773287522785","./useTableData-legacy-3kc3lnk4.js?v=1773287522785","./setting-legacy-DG9cBT-a.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./data-legacy-B9xdUIE5.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.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,l){"use strict";var a,t,n,u,i,s,c,r,o,d,p,g,f,y,_,m,v,x,V,j,h,b,S,w,k,W,C,E,B,$,N;return{setters:[e=>{a=e._},e=>{t=e._},e=>{n=e.h,u=e.n,i=e.m},e=>{s=e.u},e=>{c=e.u},e=>{r=e.f,o=e.m,d=e.h,p=e.i,g=e.j},e=>{f=e.b,y=e.a8,_=e.B},e=>{m=e.k,v=e.t,x=e.R,V=e.e,j=e.r,h=e.a0,b=e.F,S=e.n,w=e.$,k=e.Z,W=e._,C=e.S,E=e.a9,B=e.j,$=e.aa,N=e.N},null,null,null,null,null,null],execute:function(){const l={class:"p-20px"},P={class:"flex mb-12px"},U={class:"flex-1 mr-12px"},z={class:"w-150px mr-12px"},D={class:"text-error"};e("default",m({__name:"index",props:{type:{}},setup(e,{expose:m}){const R=v(e,"type"),{t:T}=x(),A=V({ruleValue:"",ps:""}),F=async()=>{""!==A.ruleValue.trim()?(await g({...N(A),ruleName:R.value}),O(),A.ruleValue="",A.ps=""):i.error(T("Waf.Setting.config_194"))},L=j(null),Z=j(null),{table:q,columns:G,setLoading:H}=c([{key:"rule",title:T("Waf.Setting.config_82"),render:e=>h(b,null,[e.isEdit?h(f,{ref:L,value:e.ruleVal,size:"small",type:"textarea",autosize:{minRows:2,maxRows:2},placeholder:"",onUpdateValue:l=>{e.ruleVal=l}},null):e.rule])},{key:"ps",title:T("Waf.Setting.config_190"),width:150,render:e=>h(b,null,[e.isEdit?h(f,{ref:Z,value:e.psVal,size:"small",placeholder:"",onUpdateValue:l=>{e.psVal=l}},null):e.ps])},{key:"status",title:T("Waf.Setting.config_82"),width:60,render:(e,l)=>h(y,{value:e.status,size:"small",checkedValue:1,uncheckedValue:0,onUpdateValue:async a=>{await r({index:l,ruleName:R.value}),e.status=a}},null)},s({width:100,options:(e,l)=>e.isEdit?[{label:T("Public.Btn.Save"),onClick:()=>{J(e,l)}},{label:T("Public.Btn.Cancel"),onClick:()=>{K(e)}}]:[{label:T("Public.Btn.Edit"),onClick:()=>{I(e)}},{label:T("Public.Btn.Del"),show:e.isDel,onClick:()=>{M(e,l)}}]})]),I=e=>{e.isEdit=!0,S((()=>{L.value?.focus()}))},J=async(e,l)=>{e.isEdit=!1,await o({index:l,ruleBody:e.ruleVal,rulePs:e.psVal,ruleName:R.value}),e.rule=e.ruleVal,e.ps=e.psVal},K=e=>{e.isEdit=!1,e.ruleVal=e.rule,e.psVal=e.ps},M=async(e,l)=>{n({title:T("Waf.Setting.config_195",[e.rule]),content:T("Waf.Setting.config_196"),onConfirm:async()=>{await d({index:l,ruleName:R.value}),O()}})},O=async()=>{try{H(!0);const{message:e}=await p({ruleName:R.value});u(e)&&(q.data=e.map((e=>({rule:e[1],ruleVal:e[1],ps:e[2],psVal:e[2],status:e[0],isEdit:!1,isDel:1===e[3]}))))}finally{H(!1)}};return O(),m({init:O}),(e,n)=>{const u=_,i=t,s=a;return w(),k("div",l,[W("div",P,[W("div",U,[h(C(f),{value:C(A).ruleValue,"onUpdate:value":n[0]||(n[0]=e=>C(A).ruleValue=e),placeholder:e.$t("Waf.Setting.config_189")},null,8,["value","placeholder"])]),W("div",z,[h(C(f),{value:C(A).ps,"onUpdate:value":n[1]||(n[1]=e=>C(A).ps=e),placeholder:e.$t("Waf.Setting.config_190")},null,8,["value","placeholder"])]),h(u,{type:"primary",onClick:F},{default:E((()=>[B($(e.$t("Public.Btn.Add")),1)])),_:1})]),h(i,{"max-height":340,loading:C(q).loading,data:C(q).data,columns:C(G)},null,8,["loading","data","columns"]),h(s,{class:"mt-16px"},{default:E((()=>[W("li",D,$(e.$t("Waf.Setting.config_191")),1),W("li",null,$(e.$t("Waf.Setting.config_192")),1),W("li",null,$(e.$t("Waf.Setting.config_193")),1)])),_:1})])}}}))}}}));
