import{r as m,C as Ue,o as s,g as n,a as o,u as a,F as C,D as B,b as i,w as r,f as d,t as _,h as u,i as w,d as be,c as D,L as Fe,aa as Ie,J as P,ak as Le,e as Ke,n as ke,bb as b,a_ as k}from"./app-BYcXwl4U.js";import{u as Re}from"./app-a6cKceqE.js";import"./app-MtOp7vk3.js";import{T as _e}from"./app-D2Wz0BUQ.js";import{P as we}from"./app-0YmIdYYs.js";import{a as I,_ as W}from"./app-DxbU-QrX.js";import{T as Oe}from"./app-CrjU8lgK.js";import{_ as g}from"./app-Ufpj4Ll4.js";import{_ as Be}from"./app-DKwGUiXR.js";import{_ as De}from"./app-DY-0PadZ.js";import{_ as Pe}from"./app-DwtlHtUX.js";import{a as R,T as O}from"./app-BmaR5UVy.js";import{S as Ae}from"./app-C0-Qcoum.js";import{C as Ee}from"./app-iaXXZg9Y.js";const Me=["value"],je={key:0,class:"label-group"},Ge=["title"],We={class:"small grey"},ze={key:0},Je={key:1},He={key:0},qe={key:1},Ye={key:2},Qe={key:3},Xe=["title"],Ze={key:1,class:"hover"},et={key:2,class:"disabled",style:{"font-weight":"normal"},title:"空字符串"},tt={key:4,class:"grey small"},lt=["onClick"],ot=o("i",{class:"icon pencil small"},null,-1),st=[ot],nt=["onClick"],at=o("i",{class:"icon remove"},null,-1),ut=[at],Eo={__name:"HTTPFirewallRulesBox",props:["v-rules","v-type","connector"],emits:["change"],setup(pe,{emit:ve}){const ue=Re(),$=pe,ie=ve,{rules:M}=function(){let y=$.vRules;return y==null&&(y=[]),{rules:m(y)}}(),me=function(){window.UPDATING_RULE=null,ue.popup("/servers/components/waf/createRulePopup?type="+$.vType,{width:"60em",height:"50em",callback:function(y){M.value.push(y.data.rule),ie("change")}})},A=function(y,h){window.UPDATING_RULE=ue.clone(h),ue.popup("/servers/components/waf/createRulePopup?type="+$.vType,{width:"60em",height:"50em",callback:function(f){M.value[y]=f.data.rule,ie("change")}})},j=function(y){ue.confirm("确定要删除此规则吗？",function(){M.value.$remove(y),ie("change")})},U=function(y){let h=y;return typeof window.WAF_RULE_OPERATORS!=null&&window.WAF_RULE_OPERATORS.forEach(function(f){f.code==y&&(h=f.name)}),h},T=function(y){let h=y,f="";return typeof window.WAF_RULE_OPERATORS!=null&&window.WAF_RULE_OPERATORS.forEach(function(p){p.code==y&&(h=p.name,f=p.description)}),h+": "+f},v=function(y){let h="none";return typeof window.WAF_RULE_OPERATORS!=null&&window.WAF_RULE_OPERATORS.forEach(function(f){f.code==y&&(h=f.dataType)}),h},c=function(y){let h="";return y!=null&&window.WAF_RULE_CHECKPOINTS.forEach(function(f){(y=="${"+f.prefix+"}"||y.startsWith("${"+f.prefix+"."))&&(h=f.name)}),h},ye=function(y){let h="",f="";return y!=null&&window.WAF_RULE_CHECKPOINTS.forEach(function(p){(y=="${"+p.prefix+"}"||y.startsWith("${"+p.prefix+"."))&&(h=p.name,f=p.description)}),h+": "+f},x=function(y){return typeof y=="string"&&y.length==0};return(y,h)=>{const f=Ue("tooltip");return s(),n("div",null,[o("input",{type:"hidden",name:"rulesJSON",value:JSON.stringify(a(M))},null,8,Me),a(M).length>0?(s(),n("div",je,[(s(!0),n(C,null,B(a(M),(p,L)=>(s(),n(C,null,[i(_e,{outlined:""},{default:r(()=>[d(_(p.name)+" ",1),o("span",{title:ye(p.param),class:"hover"},[d(_(c(p.param))+" ",1),o("span",We,_(p.param),1),d(" ")],8,Ge),p.param=="${cc}"?(s(),n("span",ze,_(p.checkpointOptions.period)+"秒内请求数 ",1)):u("",!0),p.param=="${refererBlock}"?(s(),n("span",Je,[p.checkpointOptions.allowDomains!=null&&p.checkpointOptions.allowDomains.length>0?(s(),n("span",He,"允许"+_(p.checkpointOptions.allowDomains),1)):u("",!0),p.checkpointOptions.denyDomains!=null&&p.checkpointOptions.denyDomains.length>0?(s(),n("span",qe,"禁止"+_(p.checkpointOptions.denyDomains),1)):u("",!0)])):p.param=="${commonAIBot}"?(s(),n("span",Ye)):(s(),n("span",Qe,[p.paramFilters!=null&&p.paramFilters.length>0?(s(!0),n(C,{key:0},B(p.paramFilters,N=>(s(),n("span",null," | "+_(N.code),1))),256)):u("",!0),d(),o("span",{class:"hover",title:T(p.operator)+(!p.isComposed&&p.isCaseInsensitive?"\\n[大小写不敏感] ":"")},"<"+_(U(p.operator))+">",9,Xe),d("  "),x(p.value)?v(p.operator)!="none"?(s(),n("span",et,"[空]")):u("",!0):(s(),n("span",Ze,_(p.value),1))])),p.description!=null&&p.description.length>0?(s(),n("span",tt,"（"+_(p.description)+"）",1)):u("",!0),d("   "),o("a",{href:"",title:"修改",onClick:w(N=>A(L,p),["prevent"])},st,8,lt),d("  "),o("a",{href:"",title:"删除",onClick:w(N=>j(L),["prevent"])},ut,8,nt)]),_:2},1024),L!=a(M).length-1?(s(),n(C,{key:0},[pe.connector=="and"?be((s(),D(_e,{key:0},{default:r(()=>[d("和")]),_:1})),[[f,`规则之间关系-和：
所有规则都满足才视为匹配`,void 0,{bottom:!0}]]):u("",!0),pe.connector=="or"?be((s(),D(_e,{key:1},{default:r(()=>[d("或")]),_:1})),[[f,`规则之间关系-或：
任一规则满足了就视为匹配`,void 0,{bottom:!0}]]):u("",!0)],64)):u("",!0)],64))),256)),i(Fe)])):u("",!0),i(we,{size:"small",type:"button",onClick:h[0]||(h[0]=w(p=>me(),["prevent"]))})])}}},it=["value"],rt={class:"small"},dt={key:0,class:"small"},pt={key:0},vt={key:1},mt={key:2},ct={key:1},_t={key:0},yt={key:0},ft={key:1},ht={key:1},kt={key:2},bt={key:0},wt={key:3},$t={key:0},Vt={key:4},It={key:5},Pt={key:6},Ft={key:7},Nt={key:8},gt={key:0},Ct={key:9},Tt={key:10},xt={key:11},St={key:12,class:"small grey"},Ut={key:0},Lt={key:1},Kt=["onClick"],Rt=o("i",{class:"icon pencil small"},null,-1),Ot=[Rt],Bt=["onClick"],Dt=o("i",{class:"icon remove small"},null,-1),At=[Dt],Et=o("a",{href:"",title:"拖动改变顺序"},[o("i",{class:"icon bars sort-handle"})],-1),Mt={key:0,style:{"margin-bottom":"0.5em"}},jt=o("td",{class:"title"},"动作类型 *",-1),Gt={key:0,class:"comment"},Wt={key:0},zt=o("td",null,"有效范围",-1),Jt={key:0,class:"comment"},Ht={key:1,class:"comment"},qt={key:2,class:"comment"},Yt={key:1},Qt=o("td",null,"封禁范围",-1),Xt={key:0,class:"comment"},Zt={key:1,class:"comment"},el={key:2},tl=o("td",null,"封禁时长",-1),ll=o("span",null,"秒",-1),ol={key:3},sl=o("td",null,"最大封禁时长",-1),nl=o("span",null,"秒",-1),al=o("p",{class:"comment"},"选填项。如果同时填写了封禁时长和最大封禁时长，则会在两者之间随机选择一个数字作为最终的封禁时长。",-1),ul={key:4},il=o("td",null,"封禁整个C段IP",-1),rl=o("p",{class:"comment"},"选中后，表示在封禁当前访客IP的同时，封禁整个对应的C段IP；比如当前访客IP为192.168.1.100，则封禁C段192.168.1.0~192.168.1.255。",-1),dl={key:5},pl=o("td",null,"有效时间",-1),vl=o("span",null,"秒",-1),ml=o("p",{class:"comment"},"验证通过后在这个时间内不再验证；如果为空或者为0表示默认。",-1),cl={key:6},_l=o("td",null,"最多失败次数",-1),yl=o("span",null,"次",-1),fl={class:"comment"},hl={key:0,class:"red"},kl={key:7},bl=o("td",null,"失败拦截时间",-1),wl=o("span",null,"秒",-1),$l=o("p",{class:"comment"},"在达到最多失败次数（大于0）时，自动拦截的时间；如果为空或者为0表示默认。",-1),Vl={key:8},Il=o("td",null,"有效时间",-1),Pl=o("span",null,"秒",-1),Fl=o("p",{class:"comment"},"验证通过后在这个时间内不再验证；如果为空或者为0表示默认。",-1),Nl={key:9},gl=o("td",null,"最多失败次数",-1),Cl=o("span",null,"次",-1),Tl=o("p",{class:"comment"},"允许用户失败尝试的最多次数，超过这个次数将被自动加入黑名单；如果为空或者为0表示默认。",-1),xl={key:10},Sl=o("td",null,"失败拦截时间",-1),Ul=o("span",null,"秒",-1),Ll=o("p",{class:"comment"},"在达到最多失败次数（大于0）时，自动拦截的时间；如果为空或者为0表示默认。",-1),Kl={key:11},Rl=o("td",null,"有效时间",-1),Ol=o("span",null,"秒",-1),Bl=o("p",{class:"comment"},"验证通过后在这个时间内不再验证。",-1),Dl={key:12},Al=o("td",null,"有效时间",-1),El=o("span",null,"秒",-1),Ml=o("p",{class:"comment"},"验证通过后在这个时间内不再验证。",-1),jl={key:13},Gl=o("td",null,"IP名单类型 *",-1),Wl={key:14},zl=o("td",null,"选择IP名单",-1),Jl={key:0,class:"mb-2"},Hl=o("i",{class:"icon remove small"},null,-1),ql=[Hl],Yl=o("p",{class:"comment"},"如不选择，则自动添加到当前策略的IP名单中。",-1),Ql={key:15},Xl=o("td",null,"级别",-1),Zl={key:16},eo=o("td",null,"超时时间",-1),to=o("span",null,"秒",-1),lo=o("p",{class:"comment"},"0表示不超时。",-1),oo={key:17},so=o("td",null,"标签 *",-1),no={key:18},ao=o("td",null,"使用默认提示",-1),uo={key:19},io=o("td",{class:"color-border"},"状态码 *",-1),ro={key:20},po=o("td",{class:"color-border"},"网页内容",-1),vo={key:21},mo=o("td",null,"状态码 *",-1),co={key:22},_o=o("td",null,"跳转到URL",-1),yo={class:"comment"},fo={key:23},ho=o("td",null,"下一个分组 *",-1),ko={key:24},bo=o("td",null,"下一个分组 *",-1),wo={key:25},$o=o("td",null,"下一个规则集 *",-1),Vo=o("i",{class:"icon remove small"},null,-1),Io=[Vo],Po={key:1},Fo=o("p",{class:"comment"},"系统总是会先执行记录日志、标签等不会修改请求的动作，再执行阻止、验证码等可能改变请求的动作。",-1),Mo={__name:"HTTPFirewallActionsBox",props:["v-actions","v-firewall-policy","v-action-configs","v-group-type"],setup(pe){const ve=Ie("$utils"),ue=Ie("$Tea"),$=pe,ie=m(),{id:M,actions:me,configs:A,isAdding:j,editingIndex:U,action:T,actionCode:v,actionOptions:c,ipListLevels:ye,allowScope:x,blockTimeout:y,blockTimeoutMax:h,blockScope:f,blockCClassIP:p,captchaLife:L,captchaMaxFails:N,captchaFailBlockTimeout:Q,get302Life:X,post307Life:Z,recordIPType:z,recordIPLevel:re,recordIPTimeout:ee,recordIPListId:J,recordIPListName:ce,tagTags:H,pageUseDefault:E,pageStatus:te,pageBody:le,defaultPageBody:$e,redirectStatus:oe,redirectURL:q,goGroupName:Y,goGroupId:S,goGroup:K,goSetId:G,goSetName:de,jsCookieLife:se,jsCookieMaxFails:ne,jsCookieFailBlockTimeout:ae,statusOptions:Ne}=function(){$.vFirewallPolicy.inbound==null&&($.vFirewallPolicy.inbound={}),$.vFirewallPolicy.inbound.groups==null&&($.vFirewallPolicy.inbound.groups=[]),$.vFirewallPolicy.outbound==null&&($.vFirewallPolicy.outbound={}),$.vFirewallPolicy.outbound.groups==null&&($.vFirewallPolicy.outbound.groups=[]);let l=0,e=[];$.vActionConfigs!=null&&(e=$.vActionConfigs,e.forEach(function(V){V.id=l++}));var t=`<!DOCTYPE html>
<html lang="en">
<head>
	<title>403 Forbidden</title>
	<style>
		address { line-height: 1.8; }
	</style>
</head>
<body>
<h1>403 Forbidden</h1>
<address>Connection: \${remoteAddr} (Client) -&gt; \${serverAddr} (Server)</address>
<address>Request ID: \${requestId}</address>
</body>
</html>`;return{id:m(l),actions:m($.vActions),configs:m(e),isAdding:m(!1),editingIndex:m(-1),action:m(null),actionCode:m(""),actionOptions:m({}),ipListLevels:m([]),allowScope:m("global"),blockTimeout:m(""),blockTimeoutMax:m(""),blockScope:m("global"),blockCClassIP:m(!1),captchaLife:m(""),captchaMaxFails:m(""),captchaFailBlockTimeout:m(""),get302Life:m(""),post307Life:m(""),recordIPType:m("black"),recordIPLevel:m("critical"),recordIPTimeout:m(""),recordIPListId:m(0),recordIPListName:m(""),tagTags:m([]),pageUseDefault:m(!0),pageStatus:m(403),pageBody:m(t),defaultPageBody:m(t),redirectStatus:m(307),redirectURL:m(""),goGroupName:m(""),goGroupId:m(0),goGroup:m(null),goSetId:m(0),goSetName:m(""),jsCookieLife:m(""),jsCookieMaxFails:m(""),jsCookieFailBlockTimeout:m(""),statusOptions:m([{code:301,text:"Moved Permanently"},{code:308,text:"Permanent Redirect"},{code:302,text:"Found"},{code:303,text:"See Other"},{code:307,text:"Temporary Redirect"}])}}(),Ve=function(){T.value=null,v.value="page",j.value=!0,c.value={},x.value="global",y.value="",h.value="",f.value="global",p.value=!1,L.value="",N.value="",Q.value="",se.value="",ne.value="",ae.value="",X.value="",Z.value="",re.value="critical",z.value="black",ee.value="",J.value=0,ce.value="",H.value=[],E.value=!0,te.value=403,le.value=$e.value,oe.value=307,q.value="",Y.value="",S.value=0,K.value=null,G.value=0,de.value="",T.value=$.vActions.$find(function(l,e){return e.code==v.value})},ge=function(l){j.value=!1,U.value=-1,A.value.$remove(l)},Ce=function(l,e){if(j.value&&U.value==l){fe();return}switch(Ve(),j.value=!0,U.value=l,v.value=e.code,T.value=me.value.$find(function(t,V){return V.code==e.code}),e.code){case"block":y.value="",h.value="",(e.options.timeout!=null||e.options.timeout>0)&&(y.value=e.options.timeout.toString()),(e.options.timeoutMax!=null||e.options.timeoutMax>0)&&(h.value=e.options.timeoutMax.toString()),e.options.scope!=null&&e.options.scope.length>0?f.value=e.options.scope:f.value="global",p.value=!1,typeof e.options.blockCClassIP=="boolean"&&(p.value=e.options.blockCClassIP);break;case"allow":e.options!=null&&e.options.scope!=null&&e.options.scope.length>0?x.value=e.options.scope:x.value="global";break;case"log":break;case"captcha":L.value="",(e.options.life!=null||e.options.life>0)&&(L.value=e.options.life.toString()),N.value="",(e.options.maxFails!=null||e.options.maxFails>0)&&(N.value=e.options.maxFails.toString()),Q.value="",(e.options.failBlockTimeout!=null||e.options.failBlockTimeout>0)&&(Q.value=e.options.failBlockTimeout.toString());break;case"js_cookie":se.value="",(e.options.life!=null||e.options.life>0)&&(se.value=e.options.life.toString()),ne.value="",(e.options.maxFails!=null||e.options.maxFails>0)&&(ne.value=e.options.maxFails.toString()),ae.value="",(e.options.failBlockTimeout!=null||e.options.failBlockTimeout>0)&&(ae.value=e.options.failBlockTimeout.toString());break;case"notify":break;case"get_302":X.value="",(e.options.life!=null||e.options.life>0)&&(X.value=e.options.life.toString());break;case"post_307":Z.value="",(e.options.life!=null||e.options.life>0)&&(Z.value=e.options.life.toString());break;case"record_ip":e.options!=null&&(re.value=e.options.level,z.value=e.options.type,e.options.timeout>0&&(ee.value=e.options.timeout.toString()),setTimeout(function(){J.value=e.options.ipListId,ce.value=e.options.ipListName}));break;case"tag":H.value=[],e.options.tags!=null&&(H.value=e.options.tags);break;case"page":E.value=!0,te.value=403,le.value=$e.value,typeof e.options.useDefault=="boolean"?E.value=e.options.useDefault:E.value=!1,e.options.status!=null&&(te.value=e.options.status),e.options.body!=null&&(le.value=e.options.body);break;case"redirect":oe.value=307,q.value="",e.options.status!=null&&(oe.value=e.options.status),e.options.url!=null&&(q.value=e.options.url);break;case"go_group":e.options!=null&&(Y.value=e.options.groupName,S.value=e.options.groupId,K.value=$.vFirewallPolicy.inbound.groups.$find(function(t,V){return V.id==e.options.groupId}));break;case"go_set":e.options!=null&&(Y.value=e.options.groupName,S.value=e.options.groupId,K.value=$.vFirewallPolicy.inbound.groups.$find(function(t,V){return V.id==e.options.groupId}),setTimeout(function(){if(G.value=e.options.setId,K.value!=null){let t=K.value.sets.$find(function(V,he){return he.id==e.options.setId});t!=null&&(de.value=t.name)}}));break}},fe=function(){j.value=!1,U.value=-1},F=function(){if(T.value==null)return;if(c.value==null&&(c.value={}),v.value=="record_ip"){let e=parseInt(ee.value);if(isNaN(e)&&(e=0),J.value<0)return;c.value={type:z.value,level:re.value,timeout:e,ipListId:J.value,ipListName:ce.value}}else if(v.value=="tag"){if(H.value==null||H.value.length==0)return;c.value={tags:H.value}}else if(v.value=="page"){let e=te.value.toString();e.match(/^\d{3}$/)?e=parseInt(e):e=403,c.value={useDefault:E.value,status:e,body:le.value}}else if(v.value=="redirect"){let e=oe.value.toString();if(e.match(/^\d{3}$/)?e=parseInt(e):e=307,q.value.length==0){ve.warn("请输入跳转到URL");return}c.value={status:e,url:q.value}}else if(v.value=="go_group"){let e=S.value;if(typeof e=="string"&&(e=parseInt(e),isNaN(e)&&(e=0)),e<=0)return;c.value={groupId:e.toString(),groupName:Y.value}}else if(v.value=="go_set"){let e=S.value;typeof e=="string"&&(e=parseInt(e),isNaN(e)&&(e=0));let t=G.value;if(typeof t=="string"&&(t=parseInt(t),isNaN(t)&&(t=0)),t<=0)return;c.value={groupId:e.toString(),groupName:Y.value,setId:t.toString(),setName:de.value}}let l={};for(let e in c.value)c.value.hasOwnProperty(e)&&(l[e]=c.value[e]);U.value>-1?A.value[U.value]={id:A.value[U.value].id,code:v.value,name:T.value.name,options:l}:A.value.push({id:M.value++,code:v.value,name:T.value.name,options:l}),fe()},Te=function(){J.value=0},xe=function(){ve.popup("/servers/iplists/selectPopup?type="+z.value,{width:"50em",callback:function(l){J.value=l.data.list.id,ce.value=l.data.list.name}})},Se=function(l){H.value=l};return P(v,function(l){T.value=me.value.$find(function(e,t){return t.code==l}),c.value={}}),P(x,function(l){c.value.scope=l}),P(y,function(l){l=parseInt(l),isNaN(l)?c.value.timeout=0:c.value.timeout=l}),P(h,function(l){l=parseInt(l),isNaN(l)?c.value.timeoutMax=0:c.value.timeoutMax=l}),P(f,function(l){c.value.scope=l}),P(p,function(l){c.value.blockCClassIP=l}),P(L,function(l){l=parseInt(l),isNaN(l)?c.value.life=0:c.value.life=l}),P(N,function(l){l=parseInt(l),isNaN(l)?c.value.maxFails=0:c.value.maxFails=l}),P(Q,function(l){l=parseInt(l),isNaN(l)?c.value.failBlockTimeout=0:c.value.failBlockTimeout=l}),P(X,function(l){l=parseInt(l),isNaN(l)?c.value.life=0:c.value.life=l}),P(Z,function(l){l=parseInt(l),isNaN(l)?c.value.life=0:c.value.life=l}),P(z,function(l){J.value=0}),P(ee,function(l){l=parseInt(l),isNaN(l)?c.value.timeout=0:c.value.timeout=l}),P(S,function(l){let e=$.vFirewallPolicy.inbound.groups.$find(function(t,V){return V.id==l});K.value=e,e==null?(e=$.vFirewallPolicy.outbound.groups.$find(function(t,V){return V.id==l}),e==null?Y.value="":(K.value=e,Y.value=e.name)):Y.value=e.name,G.value=0,de.value=""}),P(G,function(l){if(K.value==null)return;let e=K.value.sets.$find(function(t,V){return V.id==l});e==null?(G.value=0,de.value=""):de.value=e.name}),P(se,function(l){l=parseInt(l),isNaN(l)?c.value.life=0:c.value.life=l}),P(ne,function(l){l=parseInt(l),isNaN(l)?c.value.maxFails=0:c.value.maxFails=l}),P(ae,function(l){l=parseInt(l),isNaN(l)?c.value.failBlockTimeout=0:c.value.failBlockTimeout=l}),Le(()=>{ue.action("/servers/iplists/levelOptions").success(function(l){ye.value=l.data.levels}).post(),Ae.create(ie.value,{draggable:".sort-label",handle:".sort-handle",onUpdate:function(l){ve.moveElement(A.value,l.oldDraggableIndex,l.newDraggableIndex)}})}),(l,e)=>(s(),n("div",null,[o("input",{type:"hidden",name:"actionsJSON",value:JSON.stringify(a(A))},null,8,it),be(o("div",{class:"label-group",ref_key:"actionsBoxRef",ref:ie},[(s(!0),n(C,null,B(a(A),(t,V)=>(s(),D(_e,{outlined:"","data-index":V,key:t.id,class:ke(["sort-label",{blue:V==a(U)}])},{default:r(()=>[d(_(t.name)+" ",1),o("span",rt,"("+_(t.code.toUpperCase())+")",1),t.code=="allow"&&t.options!=null&&t.options.scope!=null&&t.options.scope.length>0?(s(),n("span",dt,[t.options.scope=="group"?(s(),n("span",pt,"[分组]")):u("",!0),t.options.scope=="server"?(s(),n("span",vt,"[网站]")):u("",!0),t.options.scope=="global"?(s(),n("span",mt,"[网站和策略]")):u("",!0)])):u("",!0),t.code=="block"&&(t.options.timeout>0||t.options.blockCClassIP)?(s(),n("span",ct,[d("： "),t.options.timeout>0?(s(),n("span",_t,[d(" 封禁时长"+_(t.options.timeout),1),t.options.timeoutMax>t.options.timeout?(s(),n("span",yt,"-"+_(t.options.timeoutMax),1)):u("",!0),d("秒 "),t.options.blockCClassIP?(s(),n("span",ft,"/ 封禁C段")):u("",!0)])):t.options.blockCClassIP?(s(),n("span",ht,"封禁C段")):u("",!0)])):u("",!0),t.code=="captcha"&&t.options.life>0?(s(),n("span",kt,[d("：有效期"+_(t.options.life)+"秒 ",1),t.options.maxFails>0?(s(),n("span",bt," / 最多失败"+_(t.options.maxFails)+"次",1)):u("",!0)])):u("",!0),t.code=="js_cookie"&&t.options.life>0?(s(),n("span",wt,[d("：有效期"+_(t.options.life)+"秒 ",1),t.options.maxFails>0?(s(),n("span",$t," / 最多失败"+_(t.options.maxFails)+"次",1)):u("",!0)])):u("",!0),t.code=="get_302"&&t.options.life>0?(s(),n("span",Vt,"：有效期"+_(t.options.life)+"秒",1)):u("",!0),t.code=="post_307"&&t.options.life>0?(s(),n("span",It,"：有效期"+_(t.options.life)+"秒",1)):u("",!0),t.code=="record_ip"?(s(),n("span",Pt,[d("："),o("span",{class:ke({red:t.options.ipListIsDeleted})},_(t.options.ipListName),3)])):u("",!0),t.code=="tag"?(s(),n("span",Ft,"："+_(t.options.tags.join(", ")),1)):u("",!0),t.code=="page"?(s(),n("span",Nt,[d("：["+_(t.options.status)+"]",1),t.options.useDefault?(s(),n("span",gt,"  [默认页面]")):u("",!0)])):u("",!0),t.code=="redirect"?(s(),n("span",Ct,"："+_(t.options.url),1)):u("",!0),t.code=="go_group"?(s(),n("span",Tt,"："+_(t.options.groupName),1)):u("",!0),t.code=="go_set"?(s(),n("span",xt,"："+_(t.options.groupName)+" / "+_(t.options.setName),1)):u("",!0),t.code!="allow"&&t.options.scope!=null&&t.options.scope.length>0?(s(),n("span",St,[d("   "),t.options.scope=="global"?(s(),n("span",Ut,"[所有网站]")):u("",!0),t.options.scope=="service"?(s(),n("span",Lt,"[当前网站]")):u("",!0)])):u("",!0),d("   "),o("a",{href:"",title:"修改",onClick:w(he=>Ce(V,t),["prevent"])},Ot,8,Kt),d("   "),o("a",{href:"",title:"删除",onClick:w(he=>ge(V),["prevent"])},At,8,Bt),d("   "),Et]),_:2},1032,["data-index","class"]))),128)),i(Fe)],512),[[Ke,a(A).length>0]]),a(j)?(s(),n("div",Mt,[o("table",{class:ke(["ui table definition",{blue:a(U)>-1}])},[o("tr",null,[jt,o("td",null,[i(W,{modelValue:a(v),"onUpdate:modelValue":e[0]||(e[0]=t=>b(v)?v.value=t:null)},{default:r(()=>[(s(!0),n(C,null,B(a(me),t=>(s(),D(I,{value:t.code},{default:r(()=>[d(_(t.name)+" ("+_(t.code.toUpperCase())+")",1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),a(T)!=null&&a(T).description.length>0?(s(),n("p",Gt,_(a(T).description),1)):u("",!0)])]),a(v)=="allow"?(s(),n("tr",Wt,[zt,o("td",null,[i(W,{modelValue:a(x),"onUpdate:modelValue":e[1]||(e[1]=t=>b(x)?x.value=t:null)},{default:r(()=>[i(I,{value:"group"},{default:r(()=>[d("分组")]),_:1}),i(I,{value:"server"},{default:r(()=>[d("网站")]),_:1}),i(I,{value:"global"},{default:r(()=>[d("网站和策略")]),_:1})]),_:1},8,["modelValue"]),a(x)=="group"?(s(),n("p",Jt,"跳过当前分组其他规则集，继续执行其他分组的规则集。")):u("",!0),a(x)=="server"?(s(),n("p",Ht,"跳过当前网站所有的规则集。")):u("",!0),a(x)=="global"?(s(),n("p",qt,"跳过当前网站和网站对应WAF策略所有的规则集。")):u("",!0)])])):u("",!0),a(v)=="block"?(s(),n("tr",Yt,[Qt,o("td",null,[i(W,{modelValue:a(f),"onUpdate:modelValue":e[2]||(e[2]=t=>b(f)?f.value=t:null)},{default:r(()=>[i(I,{value:"service"},{default:r(()=>[d("当前网站")]),_:1}),i(I,{value:"global"},{default:r(()=>[d("所有网站")]),_:1})]),_:1},8,["modelValue"]),a(f)=="service"?(s(),n("p",Xt,"只封禁用户对当前网站的访问，其他网站不受影响。")):u("",!0),a(f)=="global"?(s(),n("p",Zt,"封禁用户对所有网站的访问。")):u("",!0)])])):u("",!0),a(v)=="block"?(s(),n("tr",el,[tl,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(y),"onUpdate:modelValue":e[3]||(e[3]=t=>b(y)?y.value=t:null),onKeyup:e[4]||(e[4]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[ll]),_:1})]),_:1})])])):u("",!0),a(v)=="block"?(s(),n("tr",ol,[sl,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(h),"onUpdate:modelValue":e[5]||(e[5]=t=>b(h)?h.value=t:null),onKeyup:e[6]||(e[6]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[nl]),_:1})]),_:1}),al])])):u("",!0),a(v)=="block"?(s(),n("tr",ul,[il,o("td",null,[i(Pe,{modelValue:a(p),"onUpdate:modelValue":e[7]||(e[7]=t=>b(p)?p.value=t:null)},null,8,["modelValue"]),rl])])):u("",!0),a(v)=="captcha"?(s(),n("tr",dl,[pl,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(L),"onUpdate:modelValue":e[8]||(e[8]=t=>b(L)?L.value=t:null),onKeyup:e[9]||(e[9]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[vl]),_:1})]),_:1}),ml])])):u("",!0),a(v)=="captcha"?(s(),n("tr",cl,[_l,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(N),"onUpdate:modelValue":e[10]||(e[10]=t=>b(N)?N.value=t:null),onKeyup:e[11]||(e[11]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[yl]),_:1})]),_:1}),o("p",fl,[a(N)>0&&a(N)<5?(s(),n("span",hl,"建议填入一个不小于5的数字，以减少误判几率。")):u("",!0),d("允许用户失败尝试的最多次数，超过这个次数将被自动加入黑名单；如果为空或者为0表示默认。 ")])])])):u("",!0),a(v)=="captcha"?(s(),n("tr",kl,[bl,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(Q),"onUpdate:modelValue":e[12]||(e[12]=t=>b(Q)?Q.value=t:null),onKeyup:e[13]||(e[13]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[wl]),_:1})]),_:1}),$l])])):u("",!0),a(v)=="js_cookie"?(s(),n("tr",Vl,[Il,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(se),"onUpdate:modelValue":e[14]||(e[14]=t=>b(se)?se.value=t:null),onKeyup:e[15]||(e[15]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[Pl]),_:1})]),_:1}),Fl])])):u("",!0),a(v)=="js_cookie"?(s(),n("tr",Nl,[gl,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(ne),"onUpdate:modelValue":e[16]||(e[16]=t=>b(ne)?ne.value=t:null),onKeyup:e[17]||(e[17]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[Cl]),_:1})]),_:1}),Tl])])):u("",!0),a(v)=="js_cookie"?(s(),n("tr",xl,[Sl,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(ae),"onUpdate:modelValue":e[18]||(e[18]=t=>b(ae)?ae.value=t:null),onKeyup:e[19]||(e[19]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[Ul]),_:1})]),_:1}),Ll])])):u("",!0),a(v)=="get_302"?(s(),n("tr",Kl,[Rl,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(X),"onUpdate:modelValue":e[20]||(e[20]=t=>b(X)?X.value=t:null),onKeyup:e[21]||(e[21]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[Ol]),_:1})]),_:1}),Bl])])):u("",!0),a(v)=="post_307"?(s(),n("tr",Dl,[Al,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:a(Z),"onUpdate:modelValue":e[22]||(e[22]=t=>b(Z)?Z.value=t:null),onKeyup:e[23]||(e[23]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[El]),_:1})]),_:1}),Ml])])):u("",!0),a(v)=="record_ip"?(s(),n("tr",jl,[Gl,o("td",null,[i(W,{modelValue:a(z),"onUpdate:modelValue":e[24]||(e[24]=t=>b(z)?z.value=t:null)},{default:r(()=>[i(I,{value:"black"},{default:r(()=>[d("黑名单")]),_:1}),i(I,{value:"white"},{default:r(()=>[d("白名单")]),_:1}),i(I,{value:"grey"},{default:r(()=>[d("灰名单")]),_:1})]),_:1},8,["modelValue"])])])):u("",!0),a(v)=="record_ip"?(s(),n("tr",Wl,[zl,o("td",null,[a(J)>0?(s(),n("div",Jl,[i(_e,{outlined:""},{default:r(()=>[d(_(a(ce))+" ",1),o("a",{href:"",onClick:w(Te,["prevent"])},ql)]),_:1})])):u("",!0),i(we,{size:"small",onClick:w(xe,["prevent"])},{default:r(()=>[d("+")]),_:1}),Yl])])):u("",!0),a(v)=="record_ip"?(s(),n("tr",Ql,[Xl,o("td",null,[i(W,{modelValue:a(re),"onUpdate:modelValue":e[25]||(e[25]=t=>b(re)?re.value=t:null)},{default:r(()=>[(s(!0),n(C,null,B(a(ye),t=>(s(),D(I,{value:t.code},{default:r(()=>[d(_(t.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])])):u("",!0),a(v)=="record_ip"?(s(),n("tr",Zl,[eo,o("td",null,[i(O,null,{default:r(()=>[i(g,{type:"text",style:{width:"6em"},maxlength:"9",modelValue:a(ee),"onUpdate:modelValue":e[26]||(e[26]=t=>b(ee)?ee.value=t:null),onKeyup:e[27]||(e[27]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[to]),_:1})]),_:1}),lo])])):u("",!0),a(v)=="tag"?(s(),n("tr",oo,[so,o("td",null,[i(Be,{onChange:Se,values:a(H)},null,8,["values"])])])):u("",!0),a(v)=="page"?(s(),n("tr",no,[ao,o("td",null,[i(Pe,{modelValue:a(E),"onUpdate:modelValue":e[28]||(e[28]=t=>b(E)?E.value=t:null)},null,8,["modelValue"])])])):u("",!0),a(v)=="page"&&!a(E)?(s(),n("tr",uo,[io,o("td",null,[i(g,{type:"text",style:{width:"4em"},maxlength:"3",modelValue:a(te),"onUpdate:modelValue":e[29]||(e[29]=t=>b(te)?te.value=t:null),onKeyup:e[30]||(e[30]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"])])])):u("",!0),a(v)=="page"&&!a(E)?(s(),n("tr",ro,[po,o("td",null,[i(De,{modelValue:a(le),"onUpdate:modelValue":e[31]||(e[31]=t=>b(le)?le.value=t:null),class:"w-full",rows:"5"},null,8,["modelValue"])])])):u("",!0),a(v)=="redirect"?(s(),n("tr",vo,[mo,o("td",null,[i(W,{modelValue:a(oe),"onUpdate:modelValue":e[32]||(e[32]=t=>b(oe)?oe.value=t:null)},{default:r(()=>[(s(!0),n(C,null,B(a(Ne),t=>(s(),D(I,{value:t.code},{default:r(()=>[d(_(t.code)+" "+_(t.text),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])])):u("",!0),a(v)=="redirect"?(s(),n("tr",co,[_o,o("td",null,[i(g,{type:"text",modelValue:a(q),"onUpdate:modelValue":e[33]||(e[33]=t=>b(q)?q.value=t:null),class:"w-full",onKeyup:e[34]||(e[34]=k(t=>F(),["enter"])),onKeypress:k(w(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),o("p",yo,[d("支持在URL中使用类似于"),i(Ee,null,{default:r(()=>[d("${host}")]),_:1}),d("之类的请求变量。")])])])):u("",!0),a(v)=="go_group"?(s(),n("tr",fo,[ho,o("td",null,[i(W,{modelValue:a(S),"onUpdate:modelValue":e[35]||(e[35]=t=>b(S)?S.value=t:null)},{default:r(()=>[i(I,{value:"0"},{default:r(()=>[d("[选择分组]")]),_:1}),l.vFirewallPolicy.inbound!=null&&l.vFirewallPolicy.inbound.groups!=null?(s(!0),n(C,{key:0},B(l.vFirewallPolicy.inbound.groups,t=>(s(),D(I,{value:t.id},{default:r(()=>[d("入站："+_(t.name),1)]),_:2},1032,["value"]))),256)):u("",!0),l.vGroupType=="outbound"&&l.vFirewallPolicy.outbound!=null&&l.vFirewallPolicy.outbound.groups!=null?(s(!0),n(C,{key:1},B(l.vFirewallPolicy.outbound.groups,t=>(s(),D(I,{value:t.id},{default:r(()=>[d("出站："+_(t.name),1)]),_:2},1032,["value"]))),256)):u("",!0)]),_:1},8,["modelValue"])])])):u("",!0),a(v)=="go_set"?(s(),n("tr",ko,[bo,o("td",null,[i(W,{modelValue:a(S),"onUpdate:modelValue":e[36]||(e[36]=t=>b(S)?S.value=t:null)},{default:r(()=>[i(I,{value:"0"},{default:r(()=>[d("[选择分组]")]),_:1}),l.vFirewallPolicy.inbound!=null&&l.vFirewallPolicy.inbound.groups!=null?(s(!0),n(C,{key:0},B(l.vFirewallPolicy.inbound.groups,t=>(s(),D(I,{value:t.id},{default:r(()=>[d("入站："+_(t.name),1)]),_:2},1032,["value"]))),256)):u("",!0),l.vGroupType=="outbound"&&l.vFirewallPolicy.outbound!=null&&l.vFirewallPolicy.outbound.groups!=null?(s(!0),n(C,{key:1},B(l.vFirewallPolicy.outbound.groups,t=>(s(),D(I,{value:t.id},{default:r(()=>[d("出站："+_(t.name),1)]),_:2},1032,["value"]))),256)):u("",!0)]),_:1},8,["modelValue"])])])):u("",!0),a(v)=="go_set"&&a(K)!=null?(s(),n("tr",wo,[$o,o("td",null,[i(W,{modelValue:a(G),"onUpdate:modelValue":e[37]||(e[37]=t=>b(G)?G.value=t:null)},{default:r(()=>[i(I,{value:"0"},{default:r(()=>[d("[选择规则集]")]),_:1}),(s(!0),n(C,null,B(a(K).sets,t=>(s(),D(I,{value:t.id},{default:r(()=>[d(_(t.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])])):u("",!0)],2),i(Oe,{secondary:"",size:"small",type:"button",onClick:w(F,["prevent"])},{default:r(()=>[d("确定")]),_:1}),d("   "),o("a",{href:"",onClick:w(fe,["prevent"]),title:"取消"},Io)])):u("",!0),a(j)?u("",!0):(s(),n("div",Po,[i(we,{size:"small",onClick:w(Ve,["prevent"])})])),Fo]))}};export{Eo as _,Mo as a};
