ruạṛ
"use strict";(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[2932],{62932:(t,r,e)=>{e.d(r,{PY:()=>E,Z$:()=>M,Q7:()=>y,AR:()=>b,cM:()=>j,n7:()=>S,pC:()=>C,qD:()=>T,tO:()=>z,TE:()=>$,iY:()=>U,Cc:()=>I,Ng:()=>R,ZB:()=>P,d7:()=>A,KK:()=>w,Wy:()=>W,dD:()=>k,_t:()=>N,z6:()=>v,_D:()=>L,Mr:()=>x,aZ:()=>_});var n=e(66087),s=e(63282),i=e.n(s),o=e(74810),a=e(8601),c=e(77172),u=e(3075),f=e(64467);function h(t,r,e){(function(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,r),r.set(t,e)}function l(t,r,e){return t.set(g(t,r),e),e}function d(t,r){return t.get(g(t,r))}function g(t,r,e){if("function"==typeof t?t===r:t.has(r))return arguments.length<3?r:e;throw new TypeError("Private element is not present on this object")}var p=new WeakMap,m=new WeakMap;class b{constructor(t=void 0,r=void 0,e=void 0){h(this,p,{}),h(this,m,{}),(0,f.A)(this,"add",((t,r,e)=>(d(p,this)[t]||(d(p,this)[t]=[]),d(p,this)[t].push(r),e&&(d(m,this)[t]||(d(m,this)[t]=[]),d(m,this)[t].push(e)),this))),(0,f.A)(this,"hasErrors",(()=>this.getErrorCodes().length>0)),(0,f.A)(this,"getErrorCodes",(()=>Object.keys(d(p,this)))),(0,f.A)(this,"getErrorCode",(()=>this.getErrorCodes()[0])),(0,f.A)(this,"getErrorMessages",((t=void 0)=>{if(t)return d(p,this)[t];const r=[];for(const t in d(p,this))d(p,this).hasOwnProperty(t)&&r.concat(d(p,this)[t]);return r})),(0,f.A)(this,"getErrorMessage",((t=void 0)=>(t=t||this.getErrorCode(),this.getErrorMessages(t)[0]))),(0,f.A)(this,"getErrorData",((t=void 0)=>(t=t||this.getErrorCode(),d(m,this)[t]))),(0,f.A)(this,"getAllErrorMessages",(()=>{const t=[];for(const r in d(p,this))d(p,this).hasOwnProperty(r)&&t.push(...d(p,this)[r]);return t})),t&&(r&&(d(p,this)[t]=[r]),e&&(d(m,this)[t]=e))}static fromPHPObject(t){const r=new b;return l(p,r,t.errors),l(m,r,t.error_data),r}static fromApiError(t){const r=new b;if(d(p,r)[t.code]=[t.message],d(m,r)[t.code]=[t.data],t.additional_errors)for(const e of t.additional_errors)d(p,r)[e.code]=[e.message],e.data&&(d(m,r)||l(m,r,[]),d(m,r)[e.code].push(e.data));return r}}class O extends Error{constructor(t,...r){super(t.message||(0,u.__)("An unknown error occurred.","better-wp-security"),...r),Error.captureStackTrace&&Error.captureStackTrace(this,O),this.__response=t;for(const r in t)t.hasOwnProperty(r)&&Object.defineProperty(this,r,{value:t[r],configurable:!0,enumerable:!0,writable:!0})}toString(){return this.__response.toString()}getResponse(){return this.__response}}class y{constructor(t,r,e=null,n=[],s=[],i=[]){(0,f.A)(this,"type",void 0),(0,f.A)(this,"error",void 0),(0,f.A)(this,"data",void 0),(0,f.A)(this,"success",void 0),(0,f.A)(this,"info",void 0),(0,f.A)(this,"warning",void 0),this.type=t,this.error=r,this.data=e,this.success=n,this.info=s,this.warning=i,Object.seal(this)}isSuccess(){return this.type===y.SUCCESS}static async fromResponse(t){const r=r=>{const e=t.headers?.get(`X-Messages-${r}`);return e?JSON.parse(e):[]},e=204!==t.status&&t.json?await t.json():null,n=S(e),s=n.hasErrors()?y.ERROR:y.SUCCESS,i=r("Success"),o=r("Info"),a=r("Warning");return new y(s,n,e,i,o,a)}static fromResponseObject({body:t,headers:r}){const e=t=>{const e=r?.[`X-Messages-${t}`];return e?JSON.parse(e):[]},n=S(t),s=n.hasErrors()?y.ERROR:y.SUCCESS,i=e("Success"),o=e("Info"),a=e("Warning");return new y(s,n,t,i,o,a)}static fromError(t){return new y(y.ERROR,S(t))}}Object.defineProperty(y,"SUCCESS",{value:"success",writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(y,"ERROR",{value:"error",writable:!1,enumerable:!1,configurable:!1});const E=(0,a.createContext)({getUrl(t,r){t="settings"===t?"itsec":"itsec-"+t;const e=(0,c.removeQueryArgs)(document.location.href,...Object.keys((0,c.getQueryArgs)(document.location.href)));return(0,c.addQueryArgs)(e,r?{page:t,path:r}:{page:t})}});function _(t,r){const{getUrl:e}=(0,a.useContext)(E);return e(t,r)}function v(t){if(t<=999)return t.toString();if(t<=9999){const r=(t/1e3).toFixed(1);return"0"===r.charAt(r.length-1)?r.replace(".0","k"):`${r}k`}if(t<=99999)return t.toString().substring(0,2)+"k";if(t<=999999)return t.toString().substring(0,3)+"k";if(t<=9999999){const r=(t/1e6).toFixed(1);return"0"===r.charAt(r.length-1)?r.replace(".0","m"):`${r}m`}if(t<=99999999)return t.toString().substring(0,2)+"m";if(t<=999999999)return t.toString().substring(0,3)+"m";if(t<=9999999999){const r=(t/1e9).toFixed(1);return"0"===r.charAt(r.length-1)?r.replace(".0","b"):`${r}b`}return t}function w(t){if(!(0,n.isPlainObject)(t))return!1;const r=Object.keys(t);return 2===r.length&&r.includes("errors")&&r.includes("error_data")}function A(t){if(!(0,n.isPlainObject)(t))return!1;const r=Object.keys(t);return(3===r.length||4===r.length)&&!(4===r.length&&!r.includes("additional_errors"))&&r.includes("code")&&r.includes("message")&&r.includes("data")}function S(t){return t instanceof b?t:w(t)?b.fromPHPObject(t):A(t)?b.fromApiError(t):new b}function C(t){const r={};for(const[e,n]of t)r[e]=n;return r}function j(t,r){const e=[[],[]];for(const n of t)e[r(n)?0:1].push(n);return e}function k(t){if(t instanceof Error)throw t;throw new O(t)}const M="https://secure.gravatar.com/avatar/d7a973c7dab26985da5f961be7b74480?s=96&d=mm&f=y&r=g";function P(t,r,e=!0){return(0,n.get)(t,["_links","self",0,"targetHints",r],e?void 0:[])}function R(t){return $(t,"self")}function N(t){const r=t.indexOf("/ithemes-security/");if(-1!==r)return t.substring(r)}function $(t,r){return(0,n.get)(t,["_links",r,0,"href"])}function I(t,r){if(t&&t.links)for(const e of t.links)if(e.rel===r)return e}function W(t,r){if("object"!==t.type)return t;let e;for(const s in r)r.hasOwnProperty(s)&&"hidden"===r[s]["ui:widget"]&&(e||(e=(0,n.cloneDeep)(t)),delete e.properties[s]);return e||t}function x(t){let r=[];if(!t)return r;const e=t instanceof b?t:S((0,n.pick)(t,["code","message","data"]));return"rest_invalid_param"===e.getErrorCode()&&(r=Object.values(e.getErrorData().params)),[...e.getAllErrorMessages(),...r]}function L(t){const r=new Date;if(t>r)return(0,u.__)("Online Recently","better-wp-security");const e=Math.floor((r-t)/1e3);let n=e/31536e3;return n>1?(0,u.sprintf)((0,u.__)("%s years","better-wp-security"),Math.floor(n)):(n=e/2592e3,n>1?(0,u.sprintf)((0,u.__)("%s months","better-wp-security"),Math.floor(n)):(n=e/86400,n>1?(0,u.sprintf)((0,u.__)("%s days","better-wp-security"),Math.floor(n)):(n=e/3600,n>1?(0,u.sprintf)((0,u.__)("%s hours","better-wp-security"),Math.floor(n)):(n=e/60,n>1?(0,u.sprintf)((0,u.__)("%s minutes","better-wp-security"),Math.floor(n)):(0,u.sprintf)((0,u.__)("%s seconds","better-wp-security"),Math.floor(n))))))}const D={html:{type:"string",validate:()=>!0},"relative-file-path":{type:"string",validate:t=>!t.includes("../")},"file-path":{type:"string",validate:t=>!!t.startsWith("/")&&!t.includes("../")},directory:{type:"string",validate:t=>!!t.startsWith("/")&&!t.includes("../")},email:{type:"string",validate:t=>function(t){if(!t||"string"!=typeof t)return!1;if(t.length<6)return!1;if(-1===t.indexOf("@",1))return!1;const[r,e]=t.split("@");if(!/^[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~\.-]+$/.test(r))return!1;if(/\.{2,}/.test(e))return!1;if(e.trim().replace(/^\.|\.$/g,"")!==e)return!1;const n=e.split(".");if(n.length<2)return!1;for(const t of n){if(t.trim().replace(/^-|-$/g,"")!==t)return!1;if(!/^[a-z0-9-]+$/i.test(t))return!1}return t}(t)}};function T(){return T.instance||(T.instance=new(i())({strict:!1,formats:D})),T.instance}function U(){return U.instance||(U.instance=(0,o.Eg)({customFormats:D,ajvOptionsOverrides:{strict:!1}})),U.instance}function z(t){if(!t)return"";const r=t.toUpperCase().split("").map((t=>127397+t.charCodeAt()));return String.fromCodePoint(...r)}}}]);
cải xoăn