File "tools.js"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/better-wp-security/dist/pages/tools.js
File size: 33.15 KB
MIME-type: text/plain
Charset: utf-8

/*! For license information please see tools.js.LICENSE.txt */
(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[9289,5813],{79612:(e,t,n)=>{"use strict";n.d(t,{f:()=>l});var r=n(90071),o=n(17563),i=n(92819);function l(e,t){const n=(0,r.lX)(),l=n=>{const i="string"==typeof n?(0,r.cP)(n):n,l=(0,o.parse)(i.search?.substring(1))||{};return{...i,pathname:e.pathname,search:"?"+(0,o.stringify)({...l,path:i.pathname,...t})}};return{get length(){return n.length},get action(){return n.action},get location(){const e=(0,o.parse)(n.location.search.substring(1)),r=e.path||"/";return{...n.location,pathname:r,search:"?"+(0,o.stringify)((0,i.omit)(e,["path",Object.keys(t)]))}},createHref:e=>n.createHref(l(e)),push:(e,t)=>{n.push(l(e),t)},replace:(e,t)=>{n.replace(l(e),t)},go:(...e)=>n.go.apply(n,e),goBack:(...e)=>n.goBack.apply(n,e),goForward:(...e)=>n.goForward.apply(n,e),block:(...e)=>n.block.apply(n,e),listen(e){return n.listen((()=>{e(this.location,this.action)}))}}}},77388:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AfterImportExportToolsFill:()=>Q,BeforeImportExportToolsFill:()=>G,ExportFill:()=>ee,PageContainer:()=>$,PageHeader:()=>v,ToolFill:()=>q});var r=n(6293),o=n(25993),i=n.n(o),l=n(95122),s=n(52117),a=n(16550),c=n(42236),u=n(12614),d=n(64893),m=n(3571),p=n(71930),f=n(47959),h=n(73727),g=n(52278),E=n(65813);const b=(0,s.Z)(h.rU,{target:"e1jry2z10"})({name:"8dk3vg",styles:"margin-bottom:1rem"});function v(){const{pathname:e}=(0,a.TH)();return(0,r.createElement)("header",null,"/tools"!==e&&(0,r.createElement)(b,{to:"/tools",component:(0,E.Sj)(p.zx),icon:g.Z,variant:"tertiary",text:(0,l.__)("Back to list","better-wp-security")}),(0,r.createElement)(p.X6,{level:1,text:(0,l.__)("Tools","better-wp-security"),weight:p.fs.NORMAL}),(0,r.createElement)(p.xv,{size:p.yH.SMALL,variant:p.rK.MUTED,text:(0,l.__)("Advanced tools to help you manage your site’s security.","better-wp-security")}))}var y=n(87462),x=n(94184),w=n.n(x),_=n(92819),C=n(9576),S=n(48015),L=n(31600),N=n(96302);const k=(0,s.Z)("div",{target:"e13vre549"})({name:"1cwpjew",styles:"display:grid;grid-template-columns:repeat( auto-fit, minmax(min(800px, 100%), 1fr) );gap:2rem;margin-top:1rem"}),O=(0,s.Z)(d.Card,{target:"e13vre548"})("display:flex;flex-direction:column;margin-bottom:0.75rem;box-shadow:none!important;border:1px solid ",(({theme:e})=>e.colors.border.normal),";>div:first-child{display:flex;flex-direction:column;}"),F=(0,s.Z)(p.X6,{target:"e13vre547"})({name:"ol9ofu",styles:"font-size:0.875rem"}),I=(0,s.Z)(d.CardBody,{target:"e13vre546"})({name:"v1mh8",styles:"flex-grow:2;display:flex;flex-direction:column"}),T=(0,s.Z)("div",{target:"e13vre545"})({name:"1gok8e8",styles:"margin-bottom:0.5rem"}),R=(0,s.Z)("div",{target:"e13vre544"})({name:"1k0t4vh",styles:"width:90%"}),j=(0,s.Z)(f.Lu,{target:"e13vre543"})("font-size:0.75rem;color:",(({theme:e})=>e.colors.text.muted),";"),B=(0,s.Z)("div",{target:"e13vre542"})({name:"l2ils0",styles:"flex:0 0 90%"}),D=(0,s.Z)("div",{target:"e13vre541"})("display:flex;margin-top:auto;@media screen and (min-width: ",(({theme:e})=>e.breaks.medium),"px){flex-direction:",(({hasMessage:e})=>e?"column":"row"),";}"),A=(0,s.Z)(p.rN,{target:"e13vre540"})({name:"14mfhm0",styles:"margin:0.5rem 0"});var M=n(65096),P=n.n(M);function Z(){return Z.instance||(Z.instance=new(P())({schemaId:"id"}),Z.instance.addMetaSchema(n(27171)),Z.instance.addFormat("html",{type:"string",validate:()=>!0})),Z.instance}function W(){const{tools:e,activeModules:t,isLoaded:n}=(0,S.useSelect)((e=>({tools:e(L.toolsStore).getResolvedTools(),activeModules:e(L.MODULES_STORE_NAME).getActiveModules(),isLoaded:e(L.toolsStore).hasFinishedResolution("getTools")})),[]),o=(0,r.useMemo)((()=>e.filter((e=>t.includes(e.module)&&!1!==e.available))),[e,t]);return(0,r.createElement)(k,null,o.length>0&&n&&o.map((e=>(0,r.createElement)(z,{key:e.slug,tool:e}))))}function z({tool:e,className:t,...n}){const{result:o,isRunning:i}=(0,S.useSelect)((t=>({result:t(L.toolsStore).getLastResult(e.slug),isRunning:t(L.toolsStore).isRunning(e.slug)})),[e.slug]),[l,s]=(0,r.useState)([]);return(0,r.useEffect)((()=>s([])),[e]),(0,r.createElement)(O,(0,y.Z)({className:w()(t,"itsec-tool"),isRounded:!0,size:"small"},n),(0,r.createElement)(d.CardHeader,{size:"small"},(0,r.createElement)(F,{level:3,variant:p.rK.DARK,weight:600,text:e.title})),(0,r.createElement)(I,null,(0,r.createElement)(K,{result:o,schemaError:l}),(0,r.createElement)(R,null,(0,r.createElement)(p.xv,{variant:p.rK.DARK,text:e.description}),e.help&&(0,r.createElement)(j,{content:e.help,tagName:"p"})),(0,r.createElement)(H,{tool:e.slug}),(0,r.createElement)(U,{tool:e,setSchemaError:s,isRunning:i})))}function K({result:e,schemaError:t}){var n,o,i;return(0,r.createElement)(T,null,(0,r.createElement)(f.KM,{schemaError:t,apiError:e?.error}),(0,r.createElement)(p.rN,{messages:null!==(n=e?.success)&&void 0!==n?n:[],type:"success"}),(0,r.createElement)(p.rN,{messages:null!==(o=e?.warning)&&void 0!==o?o:[],type:"warning"}),(0,r.createElement)(p.rN,{messages:null!==(i=e?.info)&&void 0!==i?i:[],type:"info"}))}function U({tool:e,setSchemaError:t,isRunning:n}){const o=function(e){const{activeModules:t,settings:n}=(0,S.useSelect)((t=>({settings:(0,_.mapValues)(e.condition?.settings||{},((e,n)=>t(L.MODULES_STORE_NAME).getSettings(n))),activeModules:t(L.MODULES_STORE_NAME).getActiveModules()})),[e]);if(!e.condition)return!0;if(e.condition["active-modules"])for(const n of e.condition["active-modules"])if(!t?.includes(n))return!1;if(e.condition.settings){const t=Z();for(const[r,o]of Object.entries(e.condition.settings))if(!t.compile(o)(n[r]))return!1}return!0}(e),i=(0,C.useInstanceId)(U,"itsec-tool-form"),s=(0,r.useMemo)((()=>({disableInlineErrors:!0,tool:e.slug})),[e.slug]),{runTool:a}=(0,S.useDispatch)(L.toolsStore),c=!o&&e.condition?.description;return(0,r.createElement)(D,{hasMessage:c},e.form&&o&&(0,r.createElement)(B,null,(0,r.createElement)(N.b,{id:i,idPrefix:`itsec_tool_${e.slug}`,schema:e.form,uiSchema:e.form.uiSchema,formContext:s,showErrorList:!1,onError:t,onSubmit:({formData:n})=>{t([]),a(e.slug,n)}})),!o&&e.condition?.description&&(0,r.createElement)(A,{type:"warning",messages:[e.condition.description]}),(0,r.createElement)(d.Flex,{className:"itsec-tool__actions",justify:"flex-end",align:"flex-end"},(0,r.createElement)(d.FlexItem,null,(0,r.createElement)(p.zx,{variant:"primary",className:"itsec-tool__trigger",type:e.form?"submit":"button",form:e.form?i:void 0,onClick:e.form?void 0:()=>a(e.slug),isBusy:n,disabled:!o},(0,l.__)("Run","better-wp-security"))),(0,r.createElement)(H,{tool:e.slug,fillProps:{isActive:o},area:"actions"},(e=>r.Children.map(e,((e,t)=>(0,r.createElement)(r.Fragment,{key:t},e&&(0,r.createElement)(d.FlexItem,null,e))))))))}function q({tool:e,area:t="main",...n}){return(0,r.createElement)(d.Fill,(0,y.Z)({name:`Tool${t}${e}`},n))}function H({tool:e,area:t="main",...n}){return(0,r.createElement)(d.Slot,(0,y.Z)({name:`Tool${t}${e}`},n))}const $=(0,s.Z)("div",{target:"e1h1ua4f1"})({name:"94gy5t",styles:"width:100%;max-width:1680px;align-self:center;padding:1rem 1.25rem"}),V=(0,s.Z)(p.X6,{target:"e1h1ua4f0"})({name:"akdqam",styles:"margin-top:1rem"}),{Slot:X,Fill:G}=(0,d.createSlotFill)("BeforeImportExportTools"),{Slot:J,Fill:Q}=(0,d.createSlotFill)("AfterImportExportTools"),{Slot:Y,Fill:ee}=(0,d.createSlotFill)("Export");function te(){const[e,t]=(0,r.useState)(!1);return(0,r.createElement)($,null,(0,r.createElement)(v,null),(0,r.createElement)(X,null,(e=>(0,r.createElement)(ne,{fills:e,setHasTools:t}))),e&&(0,r.createElement)(V,{level:2,size:p.yH.LARGE,variant:p.rK.DARK,weight:600,text:(0,l.__)("Additional Tools","better-wp-security")}),(0,r.createElement)(W,null),(0,r.createElement)(J,null))}function ne({fills:e,setHasTools:t}){return(0,r.useEffect)((()=>t(e.length>0)),[e,t]),e}function re(){return(0,r.createElement)(Y,null)}const oe=(0,s.Z)(p.Tg,{target:"e1nmkgzj0"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"});function ie({history:e}){return(0,r.createElement)(u.a,{theme:p.U1},(0,r.createElement)(a.F0,{history:e},(0,r.createElement)(c.Fz,{ReactRouterRoute:a.AW},(0,r.createElement)(oe,{className:"itsec-tools",variant:p.h1.UNDER_PAGE},(0,r.createElement)(d.SlotFillProvider,null,(0,r.createElement)(m.PluginArea,null),(0,r.createElement)(d.Popover.Slot,null),(0,r.createElement)(f.Qf,null),(0,r.createElement)(a.rs,null,(0,r.createElement)(a.AW,{path:"/export",component:re}),(0,r.createElement)(a.AW,{path:"/tools",component:te}),(0,r.createElement)(a.AW,{path:"/"},(0,r.createElement)(a.l_,{to:"/tools"}))))))))}var le=n(79612);n.p=window.itsecWebpackPublicPath,(0,l.setLocaleData)({"":{}},"ithemes-security-pro");const se=(0,le.f)(document.location,{page:"itsec-tools"});i()((()=>(0,r.render)((0,r.createElement)(ie,{history:se}),document.getElementById("itsec-tools-root"))))},65813:(e,t,n)=>{"use strict";n.d(t,{r5:()=>h,OR:()=>g,Zk:()=>b,_:()=>v,qq:()=>y,eH:()=>f,gU:()=>a,nP:()=>c,Sj:()=>m,lo:()=>d,vl:()=>l});var r=n(87462),o=n(6293),i=n(9576);function l(e){return(0,i.createHigherOrderComponent)((t=>class extends o.Component{render(){return(0,o.createElement)(t,(0,r.Z)({},this.props,e))}}),"withProps")}var s=n(92819);function a(e,t,n={}){return(0,i.createHigherOrderComponent)((r=>class extends o.Component{constructor(){super(...arguments),this.debouncedPropInvoke=(0,s.debounce)(((...t)=>this.props[e](...t)),"function"==typeof t?t(this.props):t,n),this.handler=(e,...t)=>(e&&"function"==typeof e.persist&&e.persist(),this.debouncedPropInvoke(e,...t))}componentWillUnmount(){this.debouncedPropInvoke.cancel()}render(){const t={...this.props,[e]:this.handler};return(0,o.createElement)(r,t)}}),"withDebounceHandler")}function c(e,t){let n;return n=(0,s.isFunction)(t)?[{delay:e,cb:t}]:e,(0,i.createHigherOrderComponent)((e=>class extends o.Component{constructor(){super(...arguments),this.intervalIds=[]}componentDidMount(){for(const e of n)(t=>{this.intervalIds.push(setInterval((()=>t(this.props)),e.delay))})(e.cb)}componentWillUnmount(){this.intervalIds.forEach(clearInterval)}render(){return(0,o.createElement)(e,this.props)}}),"withInterval")}var u=n(4942);(0,i.createHigherOrderComponent)((e=>{var t;return t=class extends o.Component{constructor(...e){super(...e),(0,u.Z)(this,"state",{width:1280}),(0,u.Z)(this,"mounted",!1),(0,u.Z)(this,"ref",null),(0,u.Z)(this,"onWindowResize",(()=>{if(!this.mounted)return;const e=(0,o.findDOMNode)(this);if(e instanceof window.HTMLElement){const t=e.offsetWidth;this.setState({width:t})}}))}componentDidMount(){this.mounted=!0,window.addEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").addEventListener("click",this.onWindowResize),this.onWindowResize()}componentWillUnmount(){this.mounted=!1,window.removeEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").removeEventListener("click",this.onWindowResize)}render(){const{measureBeforeMount:t,...n}=this.props;return t&&!this.mounted?(0,o.createElement)("div",{className:this.props.className,style:this.props.style}):(0,o.createElement)(e,(0,r.Z)({},n,{width:this.state.width+20}))}},(0,u.Z)(t,"defaultProps",{measureBeforeMount:!1}),t}),"withWidth");const d=(0,i.createHigherOrderComponent)((e=>class extends o.Component{constructor(){super(...arguments),(0,u.Z)(this,"state",{pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}}),(0,u.Z)(this,"mounted",!1),this.listener=this.listener.bind(this),this.onBlur=this.onBlur.bind(this)}componentDidMount(){this.mounted=!0,window.addEventListener("keydown",this.listener),window.addEventListener("keyup",this.listener),window.addEventListener("click",this.listener),window.addEventListener("blur",this.onBlur)}componentWillUnmount(){this.mounted=!1,window.removeEventListener("keydown",this.listener),window.removeEventListener("keyup",this.listener),window.removeEventListener("click",this.listener),window.removeEventListener("blur",this.onBlur)}listener(e){this.mounted&&this.setState({pressed:{shift:e.shiftKey,ctrl:e.ctrlKey,meta:e.metaKey,alt:e.altKey}})}onBlur(){this.setState({pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}})}render(){return(0,o.createElement)(e,(0,r.Z)({pressedModifierKeys:this.state.pressed},this.props))}}),"withPressedModifierKeys"),m=(0,i.createHigherOrderComponent)((e=>function({navigate:t,...n}){return(0,o.createElement)(e,(0,r.Z)({},n,{onClick:e=>{try{n.onClick&&n.onClick(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||n.target&&"_self"!==n.target||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),t())}}))}),"withNavigate"),p=new WeakMap;function f(e,t){(0,o.useLayoutEffect)((()=>{p.has(e)||(t(),p.set(e,!0))}),[])}function h(e,t=!0){const[n,r]=(0,o.useState)("idle"),[i,l]=(0,o.useState)(null),[s,a]=(0,o.useState)(null),c=(0,o.useCallback)(((...t)=>(r("pending"),a(null),e(...t).then((e=>{l(e),r("success")})).catch((e=>{a(e),l(null),r("error")})))),[e]);return(0,o.useEffect)((()=>{t&&c()}),[c,t]),{execute:c,status:n,value:i,error:s}}function g(e,t,n=window){const r=(0,o.useRef)();(0,o.useEffect)((()=>{r.current=t}),[t]),(0,o.useEffect)((()=>{if(!n||!n.addEventListener)return;const t=e=>r.current(e);return n.addEventListener(e,t),()=>n.removeEventListener(e,t)}),[e,n])}const E=["button","submit"];function b(e){const t=(0,o.useRef)(e);(0,o.useEffect)((()=>{t.current=e}),[e]);const n=(0,o.useRef)(!1),r=(0,o.useRef)(),i=(0,o.useCallback)((()=>{clearTimeout(r.current)}),[]);(0,o.useEffect)((()=>()=>i()),[]),(0,o.useEffect)((()=>{e||i()}),[e,i]);const l=(0,o.useCallback)((e=>{const{type:t,target:r}=e;(0,s.includes)(["mouseup","touchend"],t)?n.current=!1:function(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return(0,s.includes)(E,e.type)}return!1}(r)&&(n.current=!0)}),[]),a=(0,o.useCallback)((e=>{e.persist(),n.current||(r.current=setTimeout((()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()}),0))}),[]);return{onFocus:i,onMouseDown:l,onMouseUp:l,onTouchStart:l,onTouchEnd:l,onBlur:a}}function v(e,t){const[n,r]=(0,o.useState)((()=>{try{const n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return console.error(e),t}}));return[n,t=>{try{const o=t instanceof Function?t(n):t;r(o),window.localStorage.setItem(e,JSON.stringify(o))}catch(e){console.error(e)}}]}function y(e){const t=(0,o.useRef)(null),n=(0,o.useRef)(!1),r=(0,o.useRef)(e),i=(0,o.useRef)(e);return i.current=e,(0,o.useLayoutEffect)((()=>{e.forEach(((e,o)=>{const i=r.current[o];"function"==typeof e&&e!==i&&!1===n.current&&(i(null),e(t.current))})),r.current=e}),e),(0,o.useLayoutEffect)((()=>{n.current=!1})),(0,o.useCallback)((e=>{t.current=e,n.current=!0,(e?i.current:r.current).forEach((t=>{"function"==typeof t?t(e):t&&t.hasOwnProperty("current")&&(t.current=e)}))}),[])}n(48015),n(31600)},33590:(e,t,n)=>{"use strict";n.d(t,{bB:()=>U,ZP:()=>Q});var r={};n.r(r),n.d(r,{BaseInput:()=>u,CheckboxWidget:()=>p,CheckboxesWidget:()=>f,IncludeExcludeWidget:()=>I,RadioWidget:()=>N,SelectWidget:()=>y,TextareaWidget:()=>w,ToggleWidget:()=>m});var o={};n.r(o),n.d(o,{EntitySelectField:()=>A,FileTreeField:()=>K,TextareaListField:()=>P,TitleField:()=>j});var i=n(92819),l=n(87462),s=n(6293),a=n(64893),c=n(36179);const u=function(e){const{id:t,label:n,value:r,readonly:o,disabled:u,onBlur:d,onFocus:m,options:p,onChange:f,schema:h,uiSchema:g={},...E}=e;p.inputType?E.type=p.inputType:E.type||("number"===h.type?(E.type="number",E.step="any"):"integer"===h.type?(E.type="number",E.step="1"):E.type="text"),p.autocomplete&&(E.autoComplete=p.autocomplete),h.multipleOf&&(E.step=h.multipleOf),void 0!==h.minimum&&(E.min=h.minimum),void 0!==h.maximum&&(E.max=h.maximum);const b=g["ui:description"]||h.description;return(0,s.createElement)(a.TextControl,(0,l.Z)({label:n,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:b}),readOnly:o,disabled:u,value:r||""},(0,i.omit)(E,["autofocus","formContext","registry","rawErrors"]),{onChange:e=>f(""===e?p.emptyValue:e),onBlur:d&&(e=>d(E.id,e.target.value)),onFocus:m&&(e=>m(E.id,e.target.value))}))};var d=n(54639);function m({schema:e,uiSchema:t={},id:n,value:r,disabled:o,readonly:i,label:l,onBlur:u,onFocus:m,onChange:p}){const f=d.P6.schemaRequiresTrueValue(e),h=t["ui:description"]||e.description;return(0,s.createElement)(a.ToggleControl,{checked:r||!1,onChange:p,required:f,disabled:o,readOnly:i,label:l,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:h}),onBlur:u&&(e=>u(n,e.target.checked)),onFocus:m&&(e=>m(n,e.target.checked))})}function p({schema:e,uiSchema:t={},id:n,value:r,disabled:o,readonly:i,label:l,onBlur:u,onFocus:m,onChange:p}){const f=d.P6.schemaRequiresTrueValue(e),h=t["ui:description"]||e.description;return(0,s.createElement)(a.CheckboxControl,{checked:r||!1,onChange:p,required:f,disabled:o,readOnly:i,label:l,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:h}),onBlur:u&&(e=>u(n,e.target.checked)),onFocus:m&&(e=>m(n,e.target.checked))})}function f(e){const{disabled:t,options:n,value:r,readonly:o,onChange:i,label:l,schema:a,uiSchema:u={}}=e,{enumOptions:d,enumDisabled:m=[],enumDescriptions:p=[],style:f}=n,h=u["ui:description"]||a.description,g=d.map(((e,t)=>({...e,disabled:m.includes(e.value),help:p[t]&&(0,s.createElement)(c.Lu,{noWrap:!0,content:p[t]})})));return(0,s.createElement)(c.w2,{value:r||[],onChange:i,options:g,label:l||u["ui:title"]||a.title,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:h}),readOnly:o,disabled:t,style:f})}const{asNumber:h,guessType:g}=d.P6,E=new Set(["number","integer"]);function b(e,t){const{type:n,items:r}=e;if(""!==t){if("array"===n&&r&&E.has(r.type))return t.map(h);if("boolean"===n)return"true"===t;if("number"===n)return h(t);if(e.enum){if(e.enum.every((e=>"number"===g(e))))return h(t);if(e.enum.every((e=>"boolean"===g(e))))return"true"===t}return t}}function v(e,t){return t?[].slice.call(e.target.options).filter((e=>e.selected)).map((e=>e.value)):e.target.value}const y=function(e){const{schema:t,uiSchema:n={},id:r,options:o,value:i,label:l,required:u,disabled:d,readonly:m,multiple:p,onChange:f,onBlur:h,onFocus:g,placeholder:E}=e,{enumOptions:y,enumDisabled:x}=o,w=p?[]:"",_=[];p||void 0!==t.default||_.push({value:"",label:E});for(const e of y)_.push({...e,disabled:x&&x.includes(e.value)});const C=n["ui:description"]||t.description;return(0,s.createElement)(a.SelectControl,{multiple:p,options:_,value:void 0===i?w:i,label:l,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:C}),required:u,disabled:d,readOnly:m,onChange:e=>f(b(t,e)),onBlur:h&&(e=>h(r,b(t,v(e,p)))),onFocus:g&&(e=>g(r,b(t,v(e,p))))})},{getUiOptions:x}=d.P6;function w({schema:e,uiSchema:t={},id:n,value:r,disabled:o,readonly:u,label:d,onBlur:m,onFocus:p,onChange:f,...h}){const g=x(t),{rows:E,placeholder:b,description:v=e.description}=g;return(0,s.createElement)(a.TextareaControl,(0,l.Z)({value:void 0===r?"":r,onChange:f,disabled:o,readOnly:u,label:d,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:v}),onBlur:m&&(e=>m(n,e.target.value)),onFocus:p&&(e=>p(n,e.target.value)),rows:E,placeholder:b},(0,i.without)(h,["autofocus","formContext","registry","rawErrors"])))}const{asNumber:_,guessType:C}=d.P6,S=new Set(["number","integer"]);function L(e,t){const{type:n,items:r}=e;if(""!==t){if("array"===n&&r&&S.has(r.type))return t.map(_);if("boolean"===n)return"true"===t;if("number"===n)return _(t);if(e.enum){if(e.enum.every((e=>"number"===C(e))))return _(t);if(e.enum.every((e=>"boolean"===C(e))))return"true"===t}return t}}function N({schema:e,uiSchema:t={},id:n,options:r,value:o,label:i,required:l,disabled:u,readonly:d,onChange:m,onBlur:p,onFocus:f}){const{enumOptions:h}=r,g=t["ui:description"]||e.description;return(0,s.createElement)(a.RadioControl,{selected:o,options:h,label:i,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:g}),required:l,disabled:u,readOnly:d,onChange:t=>m(L(e,t)),onBlur:p&&(t=>p(n,L(e,t.target.value))),onFocus:f&&(t=>f(n,L(e,t.target.value)))})}var k=n(95122),O=n(82839),F=n(81019);function I({id:e,disabled:t,options:n,value:r,onChange:o,schema:l,autofocus:c,readonly:u}){const{enumOptions:d,enumDisabled:m=[],excludeList:{title:p=(0,k.__)("Excluded","better-wp-security"),description:f=(0,k.__)("The list of items to exclude from the selection.","better-wp-security"),button:h=(0,k.__)("Include","better-wp-security")}={},includeList:{title:g=(0,k.__)("Included","better-wp-security"),description:E=(0,k.__)("The list of items to include in the selection.","better-wp-security"),button:b=(0,k.__)("Exclude","better-wp-security")}={},title:v=l.title,description:y=l.description}=n;(0,s.useEffect)((()=>{const e=d.map((e=>e.value)),t=r.filter((t=>e.includes(t)));t.length!==r.length&&o(t)}),[r,d,o]);const[x,w]=(0,i.partition)(d,(e=>!r.includes(e.value)));return(0,s.createElement)("div",{className:"itsec-rjsf-include-exclude-widget"},v&&(0,s.createElement)(a.BaseControl.VisualLabel,null,v),y&&(0,s.createElement)("p",null,y),(0,s.createElement)("div",{className:"itsec-rjsf-include-exclude-widget__sides",id:e},(0,s.createElement)(T,{id:e+"__exclude",options:x,label:p,description:f,button:h,disabled:t||u,disabledOptions:m,autofocus:c,onToggle:e=>{(0,O.speak)((0,k.sprintf)((0,k.__)("Moved %1$s to %2$s.","better-wp-security"),(0,i.find)(x,{value:e}).label,g)),o([...r,e])}}),(0,s.createElement)(T,{id:e+"__include",options:w,label:g,description:E,button:b,disabled:t||u,disabledOptions:m,onToggle:e=>{(0,O.speak)((0,k.sprintf)((0,k.__)("Moved %1$s to %2$s.","better-wp-security"),(0,i.find)(w,{value:e}).label,p)),o(r.filter((t=>t!==e)))}})))}function T({id:e,label:t,description:n,options:r,button:o,onToggle:l,disabled:u,disabledOptions:d=[],autofocus:m}){const p=e+"__option__",[f,h]=(0,s.useState)("");return f&&!(0,i.find)(r,{value:f})&&h(""),(0,s.createElement)("div",{className:"itsec-rjsf-include-exclude-widget__side"},(0,s.createElement)(a.BaseControl,{id:e,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:n}),className:"itsec-rjsf-include-exclude-widget__listbox"},(0,s.createElement)("span",{className:"components-base-control__label",id:e+"__label"},t),(0,s.createElement)(c.T2,{role:"listbox",id:e,active:f&&p+f,"aria-labelledby":e+"__label","aria-describedby":n&&e+"__help",onNavigate:e=>h(e.substr(p.length)),onKeyDown:({keyCode:e})=>{if(!f||e!==F.DELETE&&e!==F.BACKSPACE)return;const t=(0,i.findIndex)(r,{value:f}),n=t+1<r.length?t+1:t-1;l(f),h(r[n]?.value||"")},autoFocus:m},r.map((e=>(0,s.createElement)("div",{id:p+e.value,key:e.value,role:u||d.includes(e.value)?"presentation":"option","aria-selected":e.value===f||void 0,onClick:u||d.includes(e.value)?void 0:()=>h(e.value)},e.label))))),(0,s.createElement)(a.Button,{variant:"secondary",disabled:!f,className:"itsec-rjsf-include-exclude-widget__move",onClick:()=>l(f),"aria-keyshortcuts":"Delete Backspace"},o))}const R="*";function j(e){const{id:t,title:n,required:r}=e;return(0,s.createElement)("span",{className:"itsec-rjsf-title-field",id:t},n,r&&(0,s.createElement)("span",{className:"required"},R))}var B=n(47959);const{getUiOptions:D}=d.P6;function A({uiSchema:e,schema:t,idSchema:n,name:r,formData:o,disabled:i,readonly:l,onChange:a}){const c=D(e);return(0,s.createElement)(B.fv,{id:n.$id,value:o,disabled:i,readonly:l,onChange:a,isMultiple:"array"===t.type,label:e["ui:title"]||t.title||r,description:e["ui:description"]||t.description,path:c.path,query:c.query,labelAttr:c.labelAttr,idAttr:c.idAttr,searchArg:c.searchArg})}const{getUiOptions:M}=d.P6;function P({uiSchema:e,schema:t,name:n,formData:r,disabled:o,readonly:i,onChange:l}){const a=e["ui:title"]||t.title||n,u=e["ui:description"]||t.description,d=M(e),{rows:m,placeholder:p}=d;return(0,s.createElement)(c.yA,{label:a,help:(0,s.createElement)(c.Lu,{noWrap:!0,content:u}),disabled:o,readonly:i,rows:m,value:r,onChange:l,placeholder:p})}var Z=n(87514),W=n.n(Z),z=n(73470);function K({idSchema:e,formData:t,onChange:n,uiSchema:r,schema:o,name:l,disabled:u,readonly:d,autofocus:m}){const p=e.$id,f=r["ui:title"]||o.title||l,h=r["ui:description"]||o.description,[g,E]=(0,s.useState)([]),[b,v]=(0,s.useState)("");(0,s.useEffect)((()=>{W()({path:(0,z.addQueryArgs)("/ithemes-security/rpc/file-change/file-tree",{directory:"/"})}).then(E)}),[]);const y=e=>{n(t.includes(e)?t.filter((t=>t!==e)):[...t,e])};return(0,s.createElement)("div",{className:"itsec-rjsf-file-tree"},h&&(0,s.createElement)(c.Lu,{content:h,tagName:"p"}),(0,s.createElement)("div",{className:"itsec-rjsf-file-tree__controls"},(0,s.createElement)("div",null,(0,s.createElement)(c.mp,{tree:g,id:p,label:(0,k.__)("File Selector","better-wp-security"),active:b,setActive:v,onActivate:y,onLoad:async e=>{const t=await W()({path:(0,z.addQueryArgs)("/ithemes-security/rpc/file-change/file-tree",{directory:e})}),n=(0,i.cloneDeep)(g);(0,c.in)(n,(n=>{if(n.id===e)return n.children=t,c.in.halt})),E(n)}}),(0,s.createElement)(a.Button,{variant:"secondary",disabled:!b,className:"itsec-rjsf-file-tree__select",onClick:()=>y(b),"aria-keyshortcuts":"Enter Space"},(0,k.__)("Select","better-wp-security"))),(0,s.createElement)(c.yA,{value:t,onChange:n,className:"itsec-rjsf-file-tree__list",label:f,disabled:u,readonly:d,autoFocus:m})))}function U({name:e,...t}){return(0,s.createElement)(a.Fill,(0,l.Z)({name:`RjsfField${e}`},t))}function q({name:e,...t}){return(0,s.createElement)(a.Slot,(0,l.Z)({name:`RjsfField${e}`},t))}const{ADDITIONAL_PROPERTY_FLAG:H,getUiOptions:$}=d.P6;function V(e){const{id:t,classNames:n,disabled:r,label:o,onKeyChange:i,onDropPropertyClick:l,readonly:c,required:u,schema:d,uiSchema:m}=e,p=`${o} Key`,f=d.hasOwnProperty(H),{removable:h}=$(m);return f&&!1!==h?(0,s.createElement)("div",{className:n},(0,s.createElement)("div",{className:"row"},(0,s.createElement)("div",{className:"col-xs-5 form-additional"},(0,s.createElement)(a.TextControl,{label:p,required:u,id:`${t}-key`,onBlur:e=>i(e.target.value)})),(0,s.createElement)("div",{className:"form-additional form-group col-xs-5"},e.children),(0,s.createElement)("div",{className:"col-xs-2"},(0,s.createElement)(a.Button,{icon:"no-alt",isDestructive:!0,disabled:r||c,onClick:l(o)})))):(0,s.createElement)("div",{className:n},e.children)}const{canExpand:X}=d.P6;function G({className:e,onClick:t,disabled:n}){return(0,s.createElement)("div",{className:"row"},(0,s.createElement)("p",{className:`col-xs-3 col-xs-offset-9 text-right ${e}`},(0,s.createElement)(a.Button,{icon:"plus-alt2",className:"btn-add col-xs-12","aria-label":(0,k.__)("Add","better-wp-security"),tabIndex:"0",onClick:t,disabled:n})))}const J={FieldTemplate:function(e){const{children:t,errors:n,hidden:r,schema:o,uiSchema:i,formContext:l,onChange:c}=e;if(r)return null;const{resettable:u}=$(i);return(0,s.createElement)(V,e,t,(0,s.createElement)(q,{name:e.id,fillProps:e}),u&&(0,s.createElement)(a.Button,{className:"itsec-rjsf-reset-field",variant:"secondary",onClick:()=>c(o.default)},(0,k.__)("Restore Default","better-wp-security")),!0!==l?.disableInlineErrors&&n)},ObjectFieldTemplate:function(e){const{TitleField:t,DescriptionField:n,schema:r,uiSchema:o,properties:i}=e;if(!i.length)return null;const l=(o["ui:sections"]||[]).reduce(((e,t)=>({...e,[t.fields.find((e=>!!r.properties[e]))]:t})),{});return(0,s.createElement)("div",{className:"itsec-rjsf-object-fieldset",id:e.idSchema.$id},(o["ui:title"]||e.title)&&(0,s.createElement)(t,{id:`${e.idSchema.$id}__title`,title:e.title||o["ui:title"],required:e.required,formContext:e.formContext}),e.description&&(0,s.createElement)(n,{id:`${e.idSchema.$id}__description`,description:(0,s.createElement)(c.Lu,{noWrap:!0,content:e.description}),formContext:e.formContext}),i.map((({name:e,content:t})=>l[e]?(0,s.createElement)(s.Fragment,{key:e},(0,s.createElement)("h3",{className:"itsec-rjsf-section-title"},l[e].title),l[e].description&&(0,s.createElement)("p",{className:"itsec-rjsf-section-description"},(0,s.createElement)(c.Lu,{noWrap:!0,content:l[e].description})),t):t)),X(r,o,e.formData)&&(0,s.createElement)(G,{className:"object-property-expand",onClick:e.onAddClick(r),disabled:e.disabled||e.readonly}))},ErrorList:function({errors:e}){return(0,s.createElement)(c.KM,{errors:e.map((({stack:e}={})=>e)).filter((e=>!!e))})},widgets:r,fields:o},Q=J},96302:(e,t,n)=>{"use strict";n.d(t,{T:()=>E,b:()=>b});var r=n(87462),o=n(6293),i=n(73727),l=n(64893),s=n(95122),a=n(9576),c=n(71930),u=n(65813),d=n(47959),m=n(52117),p=n(54639),f=n(33590);const h=(0,p.Zz)(f.ZP),g=(0,m.Z)(h,{target:"ejy4qm0"})(".itsec-rjsf-object-fieldset{display:grid;grid-template-columns:[label fields] minmax(0, 1fr);grid-template-rows:auto;grid-gap:.5rem 0;@media (min-width: ",(({theme:{breaks:e}})=>e.small),"px){grid-template-columns:[label] 10rem [fields] minmax(0, 1fr);}}.itsec-rjsf-section-description{margin-top:0;grid-column:fields;}>.field-object>.itsec-rjsf-object-fieldset{&>.itsec-rjsf-title-field,&>.itsec-rjsf-section-title{grid-column:label;font-size:1rem;padding-right:1rem;margin-top:0;&:not(:first-child){border-top:1px solid ",(({theme:e})=>e.colors.border.normal),";margin-top:.5rem;padding-top:1rem;@media (min-width: ",(({theme:{breaks:e}})=>e.small),"px){&+*{border-top:1px solid ",(({theme:e})=>e.colors.border.normal),";margin-top:.5rem;padding-top:1rem;}}}}&>.form-group:not(.field-object){grid-column:label/fields-end;}&>.itsec-rjsf-section-title~.form-group{grid-column:fields;}&>.itsec-rjsf-section-title:has(+ .itsec-highlighted-search-result){border-left:5px solid ",(({theme:e})=>e.colors.border.info),";background:#f9f7fd;margin-bottom:0;padding-top:1rem!important;}&>.field-object{grid-column:label/fields-end;}&>.field-description{margin-top:0;}}.itsec-rjsf-object-fieldset>*>.itsec-rjsf-object-fieldset{&>.itsec-rjsf-title-field{grid-column:label;font-size:1rem;padding-right:1rem;}&>.form-group{grid-column:fields;}&>.field-description{grid-column:fields;margin-top:0;}}.components-base-control__label,.components-input-control__label,label,caption,legend{color:",(({theme:e})=>e.colors.text.dark),";}.itsec-highlighted-search-result{background:#f9f7fd;padding-bottom:1rem;padding-top:1rem!important;.components-base-control__label,.components-input-control__label,label,caption{border-bottom:3px solid ",(({theme:e})=>e.colors.border.info),";padding-bottom:3px;margin-bottom:6px;}.components-base-control__field{margin-bottom:12px;}}.field-object:not(:first-child):not(:empty){border-top:1px solid ",(({theme:e})=>e.colors.border.normal),";margin-top:1rem;padding-top:1rem;}.field-object:empty{display:none;}.itsec-rjsf-title-field+.field-object:not(:first-child),.itsec-rjsf-section-description+.field-object:not(:first-child){border-top:none;margin-top:0;padding-top:0;}");function E({saveLabel:e,isSaving:t,saveDisabled:n,cancelLabel:i,onCancel:s,cancelRoute:c,undoLabel:u,undoDisabled:m,onUndo:p,children:f,errors:h,apiError:g,schemaError:y,withCard:x,alignActions:w,..._}){let C=(0,a.useInstanceId)(E,"itsec-schema-form");C=_.id||C;const S=(0,o.createElement)(React.Fragment,null,(0,o.createElement)(d.KM,{errors:h,apiError:g,schemaError:y}),(0,o.createElement)(b,(0,r.Z)({},_,{id:C})));return(0,o.createElement)(l.Flex,{direction:"column",gap:7,justify:"start",expanded:!1},(0,o.createElement)(l.FlexItem,null,x&&(0,o.createElement)(l.Card,null,(0,o.createElement)(l.CardBody,null,S)),!x&&S),(0,o.createElement)(l.FlexItem,null,(0,o.createElement)(v,{id:C,saveLabel:e,cancelLabel:i,isSaving:t,saveDisabled:n,onCancel:s,cancelRoute:c,undoLabel:u,undoDisabled:m,onUndo:p,align:w},f)))}const b=(0,o.forwardRef)((({className:e,...t},i)=>(0,o.createElement)(g,(0,r.Z)({},t,{ref:i,className:e,additionalMetaSchemas:[n(27171)]}),(0,o.createElement)(React.Fragment,null))));function v({id:e,saveLabel:t=(0,s.__)("Save","better-wp-security"),isSaving:n,saveDisabled:r,cancelLabel:a=(0,s.__)("Cancel","better-wp-security"),onCancel:m,cancelRoute:p,undoLabel:f=(0,s.__)("Undo Changes","better-wp-security"),undoDisabled:h,onUndo:g,align:E,children:b}){return(0,o.createElement)(l.Flex,{align:E},m&&(0,o.createElement)(l.FlexItem,null,(0,o.createElement)(c.zx,{variant:"tertiary",type:"button",onClick:m},a)),p&&(0,o.createElement)(l.FlexItem,null,(0,o.createElement)(i.rU,{component:(0,u.Sj)(c.zx),variant:"tertiary",type:"button",to:p},a)),!E&&(0,o.createElement)(d.Xp,null),b,g&&(0,o.createElement)(l.FlexItem,null,(0,o.createElement)(c.zx,{variant:"secondary",disabled:h,onClick:g},f)),(0,o.createElement)(l.FlexItem,null,(0,o.createElement)(c.zx,{variant:"primary",isBusy:n,disabled:n||r,form:e,type:"submit"},t)))}},52278:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6293),o=n(14776);const i=(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(o.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}))},31600:e=>{e.exports=function(){return this.itsec.packages.data}()},82839:e=>{e.exports=function(){return this.wp.a11y}()},87514:e=>{e.exports=function(){return this.wp.apiFetch}()},64893:e=>{e.exports=function(){return this.wp.components}()},9576:e=>{e.exports=function(){return this.wp.compose}()},48015:e=>{e.exports=function(){return this.wp.data}()},82521:e=>{e.exports=function(){return this.wp.date}()},25993:e=>{e.exports=function(){return this.wp.domReady}()},6293:e=>{e.exports=function(){return this.wp.element}()},95122:e=>{e.exports=function(){return this.wp.i18n}()},81834:e=>{e.exports=function(){return this.wp.isShallowEqual}()},81019:e=>{e.exports=function(){return this.wp.keycodes}()},3571:e=>{e.exports=function(){return this.wp.plugins}()},14776:e=>{e.exports=function(){return this.wp.primitives}()},73470:e=>{e.exports=function(){return this.wp.url}()},99196:e=>{"use strict";e.exports=window.React},91850:e=>{"use strict";e.exports=window.ReactDOM},92819:e=>{"use strict";e.exports=window.lodash},76292:e=>{"use strict";e.exports=window.moment}},e=>{e.O(0,[7271,1930,5307,5257,6364,9071,2704,1511,976,7959,6179],(()=>(77388,e(e.s=77388))));var t=e.O();((window.itsec=window.itsec||{}).pages=window.itsec.pages||{}).tools=t}]);