File: /var/www/delta/wp-content/plugins/better-wp-security/dist/2238.js
/*! For license information please see 2238.js.LICENSE.txt */
"use strict";(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[2238],{52238:(e,t,n)=>{n.d(t,{NL:()=>X,v7:()=>H,iI:()=>w,VS:()=>me,g8:()=>Z,uD:()=>pe,wU:()=>D,VK:()=>ve,Mf:()=>ue,KH:()=>v,Yq:()=>B,nc:()=>y,KK:()=>K,PH:()=>J,Ir:()=>G});var s=n(64467),i=n(51609),r=n(8601),a=n(39959),o=n(3075);r.Component;var l=n(62932),c=n(46942),d=n.n(c),u=n(66087),m=n(89897);function h({id:e,isVisible:t,children:n}){return(0,i.createElement)("div",{className:"itsec-site-scan__details",id:e,style:{display:t?"block":"none"}},(0,i.createElement)("ul",null,n))}function p({type:e,status:t,description:n,children:s}){const l=(0,m.useInstanceId)(p),[c,f]=(0,r.useState)(!1);let b;switch(t){case"clean":b=(0,o.__)("Clean","better-wp-security");break;case"warn":b=(0,o.__)("Warn","better-wp-security");break;case"error":b=(0,o.__)("Error","better-wp-security");break;default:b=t}const g=(0,i.createElement)("span",{className:`itsec-site-scan__status itsec-site-scan__status--${t}`},b);return(0,i.createElement)("div",{className:d()("itsec-site-scan-results-section",`itsec-site-scan-results-${e}-section`)},(0,u.isEmpty)(s)?(0,i.createElement)("p",null,g," ",n):(0,i.createElement)(r.Fragment,null,(0,i.createElement)("p",null,g,n,(0,i.createElement)(a.Button,{variant:"link",className:"itsec-site-scan-toggle-details",onClick:()=>f(!c),"aria-expanded":c,"aria-controls":`itsec-site-scan__details--${l}`},c?(0,o.__)("Hide Details","better-wp-security"):(0,o.__)("Show Details","better-wp-security"))),(0,i.createElement)(h,{id:`itsec-site-scan__details--${l}`,isVisible:c},s)))}const f=function({results:e,showErrorDetails:t=!1}){const n=e;return(0,i.createElement)(p,{status:"error",description:(0,o.__)("The scan failed to properly scan the site.","better-wp-security")},(0,i.createElement)("p",null,(0,o.sprintf)((0,o.__)("Error Message: %s","better-wp-security"),n.getErrorMessage())),(0,i.createElement)("p",null,(0,o.sprintf)((0,o.__)("Error Code: %s","better-wp-security"),n.getErrorCode())),t&&n.getErrorData()&&(0,i.createElement)(r.Fragment,null,(0,i.createElement)("p",null,(0,o.__)("If you contact support about this error, please provide the following debug details:","better-wp-security")),(0,i.createElement)("pre",null,JSON.stringify({code:n.getErrorCode(),data:n.getErrorData()},null,2))))};function b({status:e,children:t}){return(0,i.createElement)("li",{className:`itsec-site-scan__detail itsec-site-scan__detail--${e}`},(0,i.createElement)("span",null,t))}const g=function({results:e}){return e.errors.length>0&&(0,i.createElement)(p,{type:"system-error",status:"error",description:(0,o.__)("The scan failed to properly scan the site.","better-wp-security")},e.errors.map(((e,t)=>(0,i.createElement)(b,{key:t,status:"error"},e.message))))},E=function({results:e,entry:t}){let n=(0,u.get)(e,["_embedded","ithemes-security:site-scan-issues",0],[]);return(0,u.isArray)(n)||(n=[]),(0,i.createElement)(p,{type:"malware",status:t.status,description:t.title},n.filter((e=>e.entry===t.slug)).map(((e,t)=>(0,i.createElement)(b,{key:t,status:e.status},(0,i.createElement)("a",{href:e.link},e.description)))))},y=function({results:e,showSiteUrl:t=!0,showErrorDetails:n=!0}){const s=e.url;let a;return(0,l.KK)(e)?a=(0,l.n7)(e):"error"===e.code&&(a=(0,l.n7)(e.errors[0])),(0,i.createElement)("div",{className:"itsec-site-scan-results"},t&&s&&(0,i.createElement)("h4",null,(0,o.sprintf)((0,o.__)("Site: %s","better-wp-security"),s)),a?(0,i.createElement)(f,{results:a,showErrorDetails:n}):(0,i.createElement)(r.Fragment,null,(0,i.createElement)(g,{results:e}),e.entries.map(((t,n)=>(0,i.createElement)(E,{results:e,entry:t,key:n})))))};function v({json:e}){return(0,i.createElement)("pre",{className:"itsec-component-print-r"},_((0,u.cloneDeep)(e)))}function _(e,t=10,n=0,s=!0){if((0,u.isString)(e))return 0===e.length?(0,i.createElement)("strong",null,"[empty string]"):e;if((0,u.isNumber)(e))return(0,i.createElement)("strong",null,`[number] ${e}`);if((0,u.isBoolean)(e))return(0,i.createElement)("strong",null,e?"[boolean] true":"[boolean] false");if(null==e)return(0,i.createElement)("strong",null,"null");if((0,u.isArray)(e)||(0,u.isPlainObject)(e)){const a=[];if(s&&a.push((0,i.createElement)("strong",{key:"header"},"Array")),0===(0,u.size)(e))return a.push("()"),a;if(n===t)return a.push(`(${e.length})`),a;let o=0;for(const t of(0,u.keys)(e))t.length>o&&(o=t.length);const l=N(n);return(0,u.forEach)(e,((e,s)=>{a.push((0,i.createElement)(r.Fragment,{key:s},"\n",l,s,N(o-(0,u.toString)(s).length," ")," ",(0,i.createElement)("strong",null,"=>")," ",_(e,t,n+1)))})),a}return(0,i.createElement)("strong",null,"[*]")}function N(e,t=" "){let n="";for(let s=0;s<=e;s++)n+=t;return n}n(41588);var k=n(58168);function w({value:e,onChange:t,options:n,label:s,help:r,disabled:o,readOnly:l,className:c,style:m,hideLabelFromVision:h}){let p,f;return(0,u.isArray)(e)?(p=t=>e.includes(t.value),f=n=>s=>t(s?[...e,n.value]:e.filter((e=>e!==n.value)))):(p=t=>e[t.value]||!1,f=n=>s=>t({...e,[n.value]:s})),(0,i.createElement)("fieldset",{className:d()("components-base-control",c,m&&`itsec-components-checkbox-group-control--style-${m}`)},(0,i.createElement)("div",{className:"components-base-control__field"},h&&(0,i.createElement)(a.VisuallyHidden,null,s),!h&&(0,i.createElement)("legend",{className:"components-base-control__label"},s),r&&(0,i.createElement)("p",{className:"components-base-control__help"},r),(0,i.createElement)("div",{className:"itsec-components-checkbox-group-control__options"},n.map((e=>(0,i.createElement)(a.CheckboxControl,(0,k.A)({},(0,u.omit)(e,["value","disabled","readOnly"]),{key:e.value,checked:p(e),onChange:f(e),disabled:o||e.disabled,readOnly:l||e.readOnly,className:p(e)&&"itsec-components-checkbox-group-control__option--is-checked",__nextHasNoMarginBottom:!0})))))))}var I=n(98616),C=n.n(I);class S{constructor(e,t,n,i=null,r=[]){(0,s.A)(this,"tree",void 0),(0,s.A)(this,"name",void 0),(0,s.A)(this,"data",void 0),(0,s.A)(this,"parent",void 0),(0,s.A)(this,"children",void 0),this.tree=e,this.name=t,this.data=n,this.parent=i,this.children=r}getParent(){return this.parent?this.tree.nodes[this.parent]:null}getAllParents(){const e=[];let t=this.getParent();for(;t;)e.push(t.name),t=t.getParent();return e}hasChildren(){return this.children.length>0}getAllChildren(){const e=[];if(!this.hasChildren())return e;for(const t of this)e.push(t.name,...t.getAllChildren());return e}*[Symbol.iterator](){for(let e=0;e<this.children.length;e++){const t=this.children[e];yield this.tree.nodes[t]}}}class L{constructor(){(0,s.A)(this,"nodes",{}),(0,s.A)(this,"ordered",[])}add(e,t,n=null){this.ordered.push(e),this.nodes[e]?(this.nodes[e].data=t,this.nodes[e].parent=n):this.nodes[e]=new S(this,e,t,n),n&&(this.nodes[n]?this.nodes[n].children.push(e):this.nodes[n]=new S(this,n))}*[Symbol.iterator](){for(let e=0;e<this.ordered.length;e++){const t=this.ordered[e];this.nodes[t].parent||(yield this.nodes[t])}}}const A=C()((e=>{const t=new L;for(const n of e)t.add(n.value,n,n.parent);return t}));class T extends r.Component{constructor(){super(...arguments),(0,s.A)(this,"props",void 0),this.renderOption=this.renderOption.bind(this),this.isChecked=this.isChecked.bind(this),this.isIndeterminate=this.isIndeterminate.bind(this),this.onChange=this.onChange.bind(this)}indeterminate(e){e.indeterminate=!0}isChecked(e){return!!e&&((0,u.isArray)(this.props.value)?this.props.value.includes(e.name)||this.isChecked(e.getParent()):this.props.value[e.name]||this.isChecked(e.getParent()))}isIndeterminate(e){if(!e.hasChildren())return!1;for(const t of e){if(this.isChecked(t))return!0;if(this.isIndeterminate(t))return!0}return!1}onChange(e,t){const n=[e.name,...e.getAllChildren()],s=t?[]:e.getAllParents();if((0,u.isArray)(this.props.value)){let e;e=t?[...this.props.value,...n]:this.props.value.filter((e=>!n.includes(e)&&!s.includes(e))),this.props.onChange(e)}else this.props.onChange({...this.props.value,...n.reduce(((e,n)=>e[n]=t),{}),...s.reduce(((e,t)=>e[t]=!1),{})})}render(){const{label:e,help:t,options:n}=this.props,s=A(n);return(0,i.createElement)("div",{className:"components-base-control"},(0,i.createElement)("div",{className:"components-base-control__field"},(0,i.createElement)("div",{className:"components-base-control__label"},e),t&&(0,i.createElement)("p",{className:"components-base-control__help"},t)),(0,i.createElement)("ul",{className:"components-hierarchical-checkbox-control__group"},Array.from(s,this.renderOption)))}renderOption(e){const{value:t,selectable:n=!0,...s}=e.data,r=this.isChecked(e),o=!r&&this.isIndeterminate(e);return(0,i.createElement)("li",{key:t,className:d()("components-hierarchical-checkbox-control__option",{"components-hierarchical-checkbox-control__option--has-children":e.hasChildren()})},(0,i.createElement)(a.CheckboxControl,(0,k.A)({},s,{checked:!!n&&r,disabled:!n||this.props.disabled,indeterminate:o,onChange:t=>this.onChange(e,t)})),e.hasChildren()&&(0,i.createElement)("ul",{className:"components-hierarchical-checkbox-control__group"},Array.from(e,this.renderOption)))}}const D=T;var x=n(31987);(0,m.compose)([(0,x.withSelect)(((e,{context:t="ithemes-security"})=>({notices:e("core/notices").getNotices(t)}))),(0,x.withDispatch)(((e,{context:t="ithemes-security"})=>({onRemove:n=>e("core/notices").removeNotice(n,t)})))])((function({notices:e,onRemove:t}){const n=(0,u.filter)(e,(e=>e.isDismissible&&(!e.type||"default"===e.type))),s=(0,u.filter)(e,(e=>!(e.isDismissible||e.type&&"default"!==e.type))),o=(0,u.filter)(e,{type:"snackbar"});return(0,i.createElement)(r.Fragment,null,(0,i.createElement)(a.NoticeList,{notices:s,className:"components-editor-notices__pinned"}),(0,i.createElement)(a.NoticeList,{notices:n,className:"components-editor-notices__dismissible",onRemove:t}),a.SnackbarList&&(0,i.createElement)(a.SnackbarList,{notices:o,className:"components-editor-notices__snackbar",onRemove:t}))}));const O=function({className:e,status:t,children:n,onRemove:s=u.noop,isDismissible:r=!0,actions:l=[]}){const c=d()(e,"notice","notice-alt","notice-"+t,{"is-dismissible":r});return(0,i.createElement)("div",{className:c},(0,i.createElement)("p",null,n,l.map((({className:e,label:t,onClick:n,url:r,isLink:o=!1},l)=>(0,i.createElement)(a.Button,{key:l,href:r,isSmall:!o&&!r,variant:(r||o)&&"link",onClick:r?void 0:()=>{s(),n()},className:d()("notice__action",e)},t)))),r&&(0,i.createElement)("button",{type:"button",className:"notice-dismiss",onClick:s},(0,i.createElement)("span",{className:"screen-reader-text"},(0,o.__)("Dismiss this notice","better-wp-security"))))};(0,m.compose)([(0,x.withSelect)(((e,{context:t="ithemes-security"})=>({notices:e("core/notices").getNotices(t)}))),(0,x.withDispatch)(((e,{context:t="ithemes-security"})=>({onRemove:n=>e("core/notices").removeNotice(n,t)})))])((function({notices:e,onRemove:t}){const n=function(e){if(!a.SnackbarList)return e.length;let t=0;for(const n of e)"snackbar"!==n.type&&t++;return t}(e),s=function(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e})),t.current}(n);(0,r.useEffect)((()=>{n>s&&window.itsecSettingsPage&&window.itsecSettingsPage.scrollTop()}),[n,s]);const o=a.SnackbarList?(0,u.filter)(e,{type:"snackbar"}):[];return(0,i.createElement)(r.Fragment,null,(0,i.createElement)("div",{className:"itsec-module-settings-notice-list"},e.map((e=>{return"snackbar"===e.type&&a.SnackbarList?null:(0,i.createElement)(O,(0,k.A)({},(0,u.omit)(e,["content"]),{key:e.id,onRemove:(n=e.id,()=>t(n))}),e.content);var n}))),a.SnackbarList&&(0,i.createElement)(a.SnackbarList,{notices:o,className:"components-editor-notices__snackbar",onRemove:t}))}));var P=n(57677),M=n(28351),R=n(74596);function H({id:e,label:t,hideLabelFromVision:n,className:s,heading:r,checked:o,help:l,onChange:c,indeterminate:u,...h}){const p=(0,m.useInstanceId)(H);return e=e||`itsec-inspector-checkbox-control-${p}`,(0,i.createElement)(a.BaseControl,{label:r,id:e,help:l,className:d()("components-checkbox-control",s)},(0,i.createElement)("span",{className:"components-checkbox-control__input-container"},(0,i.createElement)("input",(0,k.A)({id:e,className:d()("components-checkbox-control__input",{"components-checkbox-control__input--indeterminate":u}),type:"checkbox",value:"1",onChange:e=>c(e.target.checked),checked:o,"aria-describedby":l?e+"__help":void 0},h,{ref:e=>e&&(e.indeterminate=u)})),o&&(0,i.createElement)(P.A,{icon:M.A,className:"components-checkbox-control__checked",role:"presentation"}),u&&(0,i.createElement)(P.A,{icon:R.A,className:"components-checkbox-control__checked",role:"presentation"})),t&&(n?(0,i.createElement)(a.VisuallyHidden,{as:"label",htmlFor:e},t):(0,i.createElement)("label",{className:"components-checkbox-control__label",htmlFor:e},t)))}function B({help:e,label:t,multiple:n=!1,onChange:s,options:r=[],className:o,hideLabelFromVision:l,__nextHasNoMarginBottom:c,...d}){const h=`inspector-select-control-${(0,m.useInstanceId)(B)}`,p=(0,u.groupBy)(r,"optgroup");return!(0,u.isEmpty)(r)&&(0,i.createElement)(a.BaseControl,{label:t,hideLabelFromVision:l,id:h,help:e,className:o,__nextHasNoMarginBottom:c},(0,i.createElement)("select",(0,k.A)({id:h,className:"components-select-control__input",onChange:e=>{if(n){const t=[...e.target.options].filter((({selected:e})=>e)).map((({value:e})=>e));s(t)}else s(e.target.value)},"aria-describedby":e?`${h}__help`:void 0,multiple:n},d),(0,u.map)(p,((e,t)=>{const n=e.map(((e,t)=>(0,i.createElement)("option",{key:`${e.label}-${e.value}-${t}`,value:e.value,disabled:e.disabled},e.label)));return"undefined"===t?n:(0,i.createElement)("optgroup",{label:t,key:t},n)}))))}function K({value:e,onChange:t,...n}){(0,u.isArray)(e)||(e=(0,u.isString)(e)?[e]:[]);const[s,o]=(0,r.useState)(e.join("\n"));return e.join("\n").trim()!==s.trim()&&o(e.join("\n")),(0,i.createElement)(a.TextareaControl,(0,k.A)({value:s,onChange:e=>{o(e),t(e.split("\n").map((e=>e.trim())).filter((e=>e.length>0)))}},n))}function F({tabId:e,onClick:t,children:n,selected:s,...r}){return(0,i.createElement)(a.Button,(0,k.A)({role:"tab",tabIndex:s?null:-1,"aria-selected":s,id:e,onClick:t},r),n)}class $ extends r.Component{constructor(){super(...arguments),this.handleClick=this.handleClick.bind(this),this.onNavigate=this.onNavigate.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}handleClick(e){const{onSelect:t=u.noop}=this.props;t(e)}onNavigate(e,t){const n=this.event;n&&"tab"===n.target.getAttribute("role")&&n.preventDefault(),t.click()}onKeyDown(e){this.event=e}render(){const{activeClass:e="is-active",className:t,instanceId:n,orientation:s="horizontal",tabs:r,selected:o,isStyled:l}=this.props,c=(0,u.find)(r,{name:o})||r[0],m=n+"-"+c.name;return(0,i.createElement)("div",{className:d()("itsec-tab-panel",t,{"itsec-tab-panel--styled":l})},(0,i.createElement)(a.NavigableMenu,{role:"tablist",orientation:s,onNavigate:this.onNavigate,onKeyDown:this.onKeyDown,className:"components-tab-panel__tabs"},r.map((t=>(0,i.createElement)(F,{className:d()("itsec-tab-panel__tab",t.className,{[e]:t.name===c.name}),tabId:n+"-"+t.name,"aria-controls":n+"-"+t.name+"-view",selected:t.name===c.name,key:t.name,onClick:(0,u.partial)(this.handleClick,t.name)},t.title)))),c&&(0,i.createElement)("div",{"aria-labelledby":m,role:"tabpanel",id:m+"-view",className:"components-tab-panel__tab-content",tabIndex:"0"},this.props.children(c)))}}(0,m.withInstanceId)($);var W=n(62247),z=n.n(W),V=n(98883);class U extends r.Component{constructor(){super(...arguments),this.handleClick=this.handleClick.bind(this),this.onNavigate=this.onNavigate.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.toggleTab=this.toggleTab.bind(this),this.getSelectedTabs=this.getSelectedTabs.bind(this),this.isSelected=this.isSelected.bind(this),this.getSelectedId=this.getSelectedId.bind(this),this.getLabelledBy=this.getLabelledBy.bind(this),this.getTabId=this.getTabId.bind(this),this.getTabPanelId=this.getTabPanelId.bind(this),this.isTabDisabled=this.isTabDisabled.bind(this),this.isNonMultiSelectableTabSelected=this.isNonMultiSelectableTabSelected.bind(this)}handleClick(e,t){t.metaKey||t.ctrlKey?this.toggleTab(e):this.props.onSelect([e])}onNavigate(e,t){const n=this.event;if(n){if("tab"===n.target.getAttribute("role")&&n.preventDefault(),n.ctrlKey)return;if(n.shiftKey){if(this.isTabDisabled(this.props.tabs[e]))return;const t=this.props.tabs[e].name;return void this.toggleTab(t)}}t.click()}onKeyDown(e){if(!e.nativeEvent&&(this.event=e,e.ctrlKey&&("Space"===e.code||32===e.keyCode))){e.preventDefault();const t=e.target.dataset.tabname;t&&this.toggleTab(t)}}toggleTab(e){const t=(0,u.find)(this.props.tabs,{name:e});t&&!1===t.allowMultiple||(this.props.selected.includes(e)?this.props.onSelect(this.props.selected.filter((t=>t!==e))):this.props.onSelect([...this.props.selected,e]))}getSelectedTabs(){const e=this.props.selected;!e.length&&this.props.initialTab&&e.push(this.props.initialTab);const t=[];return this.props.tabs.forEach((e=>{this.props.selected.includes(e.name)&&t.push(e)})),t}isSelected(e,t){return e.some((e=>e.name===t.name))}isTabDisabled(e){const{pressedModifierKeys:t}=this.props;if(this.props.selected.includes(e.name))return!1;if(!1!==e.allowMultiple&&!this.isNonMultiSelectableTabSelected())return!1;if(t.meta||t.ctrl)return!0;if(t.shift){const{activeElement:e}=document;if(e.parentElement&&e.parentElement.id===`components-tab-panel__tabs-${this.props.instanceId}`)return!0}return!1}isNonMultiSelectableTabSelected(){if(1!==this.props.selected.length)return!1;const e=(0,u.find)(this.props.tabs,{name:this.props.selected[0]});return e&&!1===e.allowMultiple}getSelectedId(e){return 1===e.length?this.getTabPanelId(e[0].name):`components-tab-panel__panel-${this.props.instanceId}-${(0,u.map)(e,"name").join("-")}`}getLabelledBy(e){return e.map((e=>this.getTabId(e.name))).join(",")}getTabId(e){return`components-tab-panel__tab-${this.props.instanceId}-${e}`}getTabPanelId(e){return`components-tab-panel__panel-${this.props.instanceId}-${e}`}componentDidUpdate(e){if(1!==this.props.selected.length)return;if(!z()(this.props.selected,e.selected))return;const t=this.props.selected[0];if((0,u.find)(this.props.tabs,{name:t}))return;const n=(0,u.findIndex)(e.tabs,{name:t});if(-1===n)return;const s=Math.max(n-1,0),i=this.props.tabs[s];i&&this.props.onSelect([i.name])}render(){const{tabs:e,className:t,activeClass:n="is-active",orientation:s="horizontal"}=this.props,r=this.getSelectedTabs(),o=this.getSelectedId(r);return(0,i.createElement)("div",{className:t},(0,i.createElement)(a.NavigableMenu,{role:"tablist","aria-multiselectable":!0,orientation:s,onNavigate:this.onNavigate,onKeyDown:this.onKeyDown,className:"components-tab-panel__tabs",id:`components-tab-panel__tabs-${this.props.instanceId}`},e.map((e=>{const t=this.isSelected(r,e),s=t&&r.length>1?o:this.getTabPanelId(e.name);return(0,i.createElement)(F,{className:d()(e.className,{[n]:t}),tabId:this.getTabId(e.name),"aria-controls":s,selected:t,disabled:this.isTabDisabled(e),key:e.name,onClick:(0,u.partial)(this.handleClick,e.name),"data-tabname":e.name},e.title)}))),r.length>0&&(0,i.createElement)("div",{"aria-labelledby":this.getLabelledBy(r),role:"tabpanel",id:o,className:"components-tab-panel__tab-content",tabIndex:"0"},this.props.children(r)))}}(0,m.compose)([m.withInstanceId,V.wl])(U),r.Component;var j=n(70404),q=n(79860);function G(e,t,n=void 0){for(let s=0;s<e.length;s++){const i=t(e[s],n,s);if(i!==G.skip){if(i===G.halt)return i;if((0,u.isArray)(e[s].children)&&G.halt===G(e[s].children,t,e[s]))return G.halt}}}function J({id:e,tree:t,active:n,setActive:s,onActivate:o,onLoad:l,label:c,help:d,...u}){const m=(0,r.useRef)(),h=(0,r.useMemo)((()=>{const e={};return G(t,((t,n,s)=>{e[t.id]={item:t,index:s,parent:n?.id}})),e}),[t]),[p,f]=(0,r.useState)([]),[b,g]=(0,r.useState)([]),E=e+"__item__",y=async e=>{!0===e.children&&l&&(g((t=>[...t,e.id])),await l(e.id),g((t=>t.filter((t=>t!==e.id))))),f((t=>t.includes(e.id)?t.filter((t=>t!==e.id)):[...t,e.id]))};return(0,i.createElement)(a.BaseControl,{help:d,className:"itsec-tree"},(0,i.createElement)("span",{className:"components-base-control__label",id:e+"__tree_label"},c),(0,i.createElement)("ul",(0,k.A)({ref:m,id:e,role:"tree",tabIndex:0,onKeyDown:async e=>{u.onKeyDown&&u.onKeyDown(e);const{keyCode:i}=e;if(o&&[q.ENTER,q.SPACE].includes(i)&&o(n),![q.UP,q.DOWN,q.RIGHT,q.LEFT].includes(i))return;e.stopPropagation(),e.preventDefault();const r=h[n];if(!r)return void s(t[0].id);const{item:a,parent:l}=r;let c;switch(i){case q.UP:c=function(e,t,n){let s;return G(e,(e=>e.id===t?G.halt:(s=e,!1===e.children||n.includes(e.id)?void 0:G.skip))),s}(t,a.id,p)?.id;break;case q.DOWN:c=function(e,t,n){let s,i=!1;return G(e,(e=>(s=e,i?G.halt:(e.id===t&&(i=!0),!1===e.children||n.includes(e.id)?void 0:G.skip)))),s}(t,a.id,p)?.id;break;case q.RIGHT:a.children&&(p.includes(a.id)?c=a.children?.[0].id:await y(a));break;case q.LEFT:a.children&&p.includes(a.id)?await y(a):c=l}if(c&&(s(c),m.current)){const e=m.current.ownerDocument.getElementById(E+c);e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():(0,j.A)(e,{scrollMode:"if-needed"})}},onFocus:n?void 0:()=>s(t[0].id),"aria-activedescendant":n?E+n:void 0,"aria-labelledby":e+"__tree_label"},u),t.map((e=>(0,i.createElement)(Y,{key:e.id,idBase:E,active:n,setActive:s,expandedIds:p,onToggle:y,loadingIds:b,item:e})))))}function Y(e){const{idBase:t,item:n,expandedIds:s,loadingIds:r,onToggle:a,active:o,setActive:l}=e,c=!!n.children,u=s.includes(n.id);return(0,i.createElement)("li",{id:t+n.id,role:"treeitem","aria-selected":o===n.id?"true":void 0,"aria-expanded":c?u:void 0,className:d()("itsec-tree__item",{"itsec-tree__item--loading":r.includes(n.id)})},(0,i.createElement)("span",{onClick:async()=>{await a(n),l(n.id)},"aria-label":n.label},n.label),c&&n.children.length>0&&(0,i.createElement)("ul",{role:"group"},n.children.map((t=>(0,i.createElement)(Y,(0,k.A)({key:t.id},e,{item:t}))))))}G.halt=Symbol("halt"),G.skip=Symbol("skip");const Q=["group","treeitem","option","menuitem","tab"].join(" "),X=(0,r.forwardRef)((function({active:e,onKeyDown:t=u.noop,onNavigate:n,orientation:s="vertical",cycle:a=!0,descendantRoles:o=Q,as:l="div",children:c,...d},m){const h=(0,r.useRef)();return(0,r.useImperativeHandle)(m,(()=>({focus(){h.current.focus()}}))),(0,i.createElement)(l,(0,k.A)({ref:h,tabIndex:0,"aria-activedescendant":e,"aria-orientation":s,onKeyDown:i=>{const r=function(e,t){let n=[q.DOWN],s=[q.UP];return"horizontal"===t&&(n=[q.RIGHT],s=[q.LEFT]),"both"===t&&(n=[q.RIGHT,q.DOWN],s=[q.LEFT,q.UP]),(0,u.includes)(n,e)?1:(0,u.includes)(s,e)?-1:(0,u.includes)([q.DOWN,q.UP,q.LEFT,q.RIGHT],e)?0:void 0}(i.keyCode,s);if(t(i,r),void 0===r)return;i.stopPropagation(),i.preventDefault();const l=function(e,t){const n=t.split(" ").map((e=>`[role="${e}"]`)).join(", ");return e.querySelectorAll(n)}(h.current,o),c=(0,u.findIndex)(l,{id:e}),d=a?function(e,t,n){const s=e+n;return s<0?t+s:s>=t?s-t:s}(c,l.length,r):c+r;if(d>=0&&d<l.length){const e=l[d];!function(e,t){if(t.scrollIntoViewIfNeeded)return void t.scrollIntoViewIfNeeded();const n=e.ownerDocument.defaultView.getComputedStyle(e),s=parseInt(n.getPropertyValue("border-top-width")),i=t.offsetTop-e.offsetTop<e.scrollTop,r=t.offsetTop-e.offsetTop+t.clientHeight-s>e.scrollTop+e.clientHeight;(i||r)&&(e.scrollTop=t.offsetTop-e.offsetTop-e.clientHeight/2-s+t.clientHeight/2,e.scrollLeft=0)}(h.current,e),n(e.id)}}},d),c)}));function Z(){return(0,i.createElement)("div",{style:{flexGrow:1},"aria-hidden":!0,className:"itsec-component-flex-spacer"})}var ee=n(81923);const te=(0,ee.A)(a.Dashicon,{shouldForwardProp:e=>"size"!==e&&"padding"!==e,target:"e18ui1vf0"})("border-radius:50%;font-size:calc(",(({size:e})=>e)," - (",(({padding:e})=>e)," * 2));padding:",(({padding:e})=>e),";padding-left:calc(",(({padding:e})=>e)," + 0.5px);background:",(({theme:e})=>e.colors.primary.base),";color:#ffffff;");function ne({size:e=20,className:t}){const n=`var(--itsec-recommended-icon-size, ${"number"==typeof e?`${e}px`:e})`,s=`calc(${n} / 5)`;return(0,i.createElement)(te,{className:t,icon:"star-filled",size:n,padding:s})}const se={error:{primary:"#551515",secondary:"#F7ABAB",icon:"warning"},info:{primary:"#005169",secondary:"#ecfaff",icon:"info"},warning:{primary:"#a9582e",secondary:"#fdddcd",icon:"flag"},success:{primary:"#237739",secondary:"#ddf1e2",icon:"yes-alt"}},ie=(0,ee.A)("div",{target:"emrfwy26"})("display:flex;padding:.75rem .5rem;border-radius:4px;margin-bottom:",(({noMargins:e})=>!e&&"1rem"),";background:",(({type:e})=>se[e].secondary),";border:",(({type:e,hasBorder:t})=>t&&`1px solid ${se[e].primary}`),";"),re=(0,ee.A)("h3",{target:"emrfwy25"})("font-size:1.25rem;margin:0 0 0.5rem 0;color:",(({type:e})=>se[e].primary),";"),ae=(0,ee.A)(a.Dashicon,{shouldForwardProp:e=>"type"!==e,target:"emrfwy24"})("color:",(({type:e})=>se[e].primary),";margin-right:0.5rem;"),oe=(0,ee.A)(ne,{target:"emrfwy23"})({name:"u7ytkp",styles:"margin-right:0.5rem"}),le=(0,ee.A)("ul",{target:"emrfwy22"})({name:"ti75j2",styles:"margin:0"}),ce=(0,ee.A)("li",{target:"emrfwy21"})("margin:0 0 0.25rem 0;color:",(({type:e})=>se[e].primary),";&:last-child{margin-bottom:0;}"),de=(0,ee.A)(a.Button,{shouldForwardProp:e=>"type"!==e,target:"emrfwy20"})("margin-left:auto;padding:0!important;min-width:0!important;min-height:0!important;height:min-content!important;&:hover{color:",(({theme:e})=>e.colors.primary.base),";}.dashicon{color:",(({type:e})=>se[e].primary),";margin-left:0;margin-right:0;&:hover{color:",(({theme:e})=>e.colors.primary.base),";}}");function ue({type:e="info",title:t,messages:n=[],className:s,onDismiss:r,hasBorder:a,recommended:o,noMargins:l}){return(n=(0,u.castArray)(n)).length?(0,i.createElement)(ie,{type:e,hasBorder:a,recommended:o,noMargins:l,className:d()("itsec-message-list",`itsec-message-list--type-${e}`,s)},o?(0,i.createElement)(oe,null):(0,i.createElement)(ae,{icon:se[e].icon,type:e}),(0,i.createElement)("div",null,t&&(0,i.createElement)(re,null,t),(0,i.createElement)(le,null,n.map(((t,n)=>(0,i.createElement)(ce,{key:n,type:e},t))))),r&&(0,i.createElement)(de,{icon:"dismiss",type:e,onClick:r})):null}function me({errors:e,apiError:t,schemaError:n,title:s,className:r,hasBorder:a,noMargins:o}){const c=[...e||[],...(0,l.Mr)(t),...(n||[]).map((e=>e.stack))];return c.length?(0,i.createElement)(ue,{messages:c,title:s,className:r,hasBorder:a,noMargins:o,type:"error"}):null}var he=n(46627);function pe({topic:e,fallback:t}){const n=(0,x.useSelect)((e=>e(he.HELP_STORE_NAME).isEnabled()));return void 0===n?null:n?(0,i.createElement)(be,{topic:e,fallback:t}):(0,i.createElement)(fe,null)}function fe(){const[e,t]=(0,r.useState)(!0),[n,s]=(0,r.useState)(!1),{enableHelp:l}=(0,x.useDispatch)(he.HELP_STORE_NAME);return e&&(0,i.createElement)(a.Modal,{title:(0,o.__)("Privacy Notice","better-wp-security"),onRequestClose:()=>t(!1),className:"itsec-help-list__enable-modal"},(0,i.createElement)("p",null,(0,o.__)("Loading help remotely requires making an API request to iThemes.com. Only the requested help topic is transmitted.","better-wp-security")),(0,i.createElement)("footer",null,(0,i.createElement)("a",{href:"https://go.solidwp.com/privacy-policy"},(0,o.__)("Privacy Policy","better-wp-security")),(0,i.createElement)(a.Button,{isBusy:n,onClick:async()=>{s(!0),await l(),s(!1)},variant:"primary"},(0,o.__)("Continue","better-wp-security"))))}function be({topic:e,fallback:t}){const{help:n,isLoaded:s,fallbackHelp:r,fallbackLoaded:a}=(0,x.useSelect)((n=>({help:n(he.HELP_STORE_NAME).getHelp(e),isLoaded:n(he.HELP_STORE_NAME).hasFinishedResolution("getHelp",[e]),fallbackHelp:t?n(he.HELP_STORE_NAME).getHelp(t):[],fallbackLoaded:!t||n(he.HELP_STORE_NAME).hasFinishedResolution("getHelp",[t])})));if(!s||!a)return null;const l=(0,u.groupBy)([...n,...r],"type");return(0,i.createElement)(React.Fragment,null,(0,i.createElement)(ge,{title:(0,o.__)("Help Center","better-wp-security"),icon:"sos",link:"https://help.ithemes.com/hc/en-us/categories/200147050/",items:l.hc}),(0,i.createElement)(ge,{title:(0,o.__)("Blog","better-wp-security"),icon:"book-alt",link:"https://ithemes.com/blog/",items:l.post}),(0,i.createElement)(ge,{title:(0,o.__)("Video","better-wp-security"),icon:"youtube",link:"https://www.youtube.com/channel/UCYSDQEcxAppePTn5E7iNpFg",items:l.video}))}function ge({title:e,icon:t,link:n,items:s}){return(0,i.createElement)(a.Card,{className:d()("itsec-help-list-section",{"itsec-help-list-section--has-content":!!s})},(0,i.createElement)("header",null,(0,i.createElement)("a",{href:n},(0,i.createElement)(a.Dashicon,{icon:t,className:"itsec-help-list-section__icon"}),(0,i.createElement)("h3",null,e),(0,i.createElement)(a.Dashicon,{icon:"arrow-right-alt",className:"itsec-help-list-section__more"}))),(0,i.createElement)("section",null,s?s.map((e=>(0,i.createElement)("article",{key:e.title},(0,i.createElement)("a",{href:e.link},(0,i.createElement)("h4",null,e.title),(0,i.createElement)(ve,{content:e.description,tagName:"p"}))))):(0,i.createElement)("p",null,(0,o.__)("No relevant content at this time.","better-wp-security"))))}var Ee=n(15013),ye=n(54625);function ve({transform:e,...t}){return(0,i.createElement)(Ee.VK,(0,k.A)({},t,{transform:(n,s)=>{if(e){const t=e(n,s);if(void 0!==t)return t}if("a"===n.tagName.toLowerCase()&&n.dataset.itsecPath&&!t.noHtml)return(0,i.createElement)(ye.N_,{to:n.dataset.itsecPath},s)}}))}},98883:(e,t,n)=>{n.d(t,{Yb:()=>b,ML:()=>g,$I:()=>y,Mj:()=>v,SV:()=>_,ee:()=>f,sy:()=>c,qY:()=>d,kk:()=>h,wl:()=>m,pq:()=>o});var s=n(58168),i=n(51609),r=n(8601),a=n(89897);function o(e){return(0,a.createHigherOrderComponent)((t=>class extends r.Component{render(){return(0,i.createElement)(t,(0,s.A)({},this.props,e))}}),"withProps")}var l=n(66087);function c(e,t,n={}){return(0,a.createHigherOrderComponent)((s=>class extends r.Component{constructor(){super(...arguments),this.debouncedPropInvoke=(0,l.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,i.createElement)(s,t)}}),"withDebounceHandler")}function d(e,t){let n;return n=(0,l.isFunction)(t)?[{delay:e,cb:t}]:e,(0,a.createHigherOrderComponent)((e=>class extends r.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,i.createElement)(e,this.props)}}),"withInterval")}var u=n(64467);(0,a.createHigherOrderComponent)((e=>{var t;return t=class extends r.Component{constructor(...e){super(...e),(0,u.A)(this,"state",{width:1280}),(0,u.A)(this,"mounted",!1),(0,u.A)(this,"ref",null),(0,u.A)(this,"onWindowResize",(()=>{if(!this.mounted)return;const e=(0,r.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,i.createElement)("div",{className:this.props.className,style:this.props.style}):(0,i.createElement)(e,(0,s.A)({},n,{width:this.state.width+20}))}},(0,u.A)(t,"defaultProps",{measureBeforeMount:!1}),t}),"withWidth");const m=(0,a.createHigherOrderComponent)((e=>class extends r.Component{constructor(){super(...arguments),(0,u.A)(this,"state",{pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}}),(0,u.A)(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,i.createElement)(e,(0,s.A)({pressedModifierKeys:this.state.pressed},this.props))}}),"withPressedModifierKeys"),h=(0,a.createHigherOrderComponent)((e=>function({navigate:t,...n}){return(0,i.createElement)(e,(0,s.A)({},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,r.useLayoutEffect)((()=>{p.has(e)||(t(),p.set(e,!0))}),[])}function b(e,t=!0){const[n,s]=(0,r.useState)("idle"),[i,a]=(0,r.useState)(null),[o,l]=(0,r.useState)(null),c=(0,r.useCallback)(((...t)=>(s("pending"),l(null),e(...t).then((e=>{a(e),s("success")})).catch((e=>{l(e),a(null),s("error")})))),[e]);return(0,r.useEffect)((()=>{t&&c()}),[c,t]),{execute:c,status:n,value:i,error:o}}function g(e,t,n=window){const s=(0,r.useRef)();(0,r.useEffect)((()=>{s.current=t}),[t]),(0,r.useEffect)((()=>{if(!n||!n.addEventListener)return;const t=e=>s.current(e);return n.addEventListener(e,t),()=>n.removeEventListener(e,t)}),[e,n])}const E=["button","submit"];function y(e){const t=(0,r.useRef)(e);(0,r.useEffect)((()=>{t.current=e}),[e]);const n=(0,r.useRef)(!1),s=(0,r.useRef)(),i=(0,r.useCallback)((()=>{clearTimeout(s.current)}),[]);(0,r.useEffect)((()=>()=>i()),[]),(0,r.useEffect)((()=>{e||i()}),[e,i]);const a=(0,r.useCallback)((e=>{const{type:t,target:s}=e;(0,l.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,l.includes)(E,e.type)}return!1}(s)&&(n.current=!0)}),[]),o=(0,r.useCallback)((e=>{e.persist(),n.current||(s.current=setTimeout((()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()}),0))}),[]);return{onFocus:i,onMouseDown:a,onMouseUp:a,onTouchStart:a,onTouchEnd:a,onBlur:o}}function v(e,t){const[n,s]=(0,r.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 i=t instanceof Function?t(n):t;s(i),window.localStorage.setItem(e,JSON.stringify(i))}catch(e){console.error(e)}}]}function _(e){const t=(0,r.useRef)(null),n=(0,r.useRef)(!1),s=(0,r.useRef)(e),i=(0,r.useRef)(e);return i.current=e,(0,r.useLayoutEffect)((()=>{e.forEach(((e,i)=>{const r=s.current[i];"function"==typeof e&&e!==r&&!1===n.current&&(r(null),e(t.current))})),s.current=e}),e),(0,r.useLayoutEffect)((()=>{n.current=!1})),(0,r.useCallback)((e=>{t.current=e,n.current=!0,(e?i.current:s.current).forEach((t=>{"function"==typeof t?t(e):t&&t.hasOwnProperty("current")&&(t.current=e)}))}),[])}n(31987),n(46627)}}]);