File "data.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/better-wp-security/dist/packages/data.js
File size: 68.53 KB
MIME-type: text/plain
Charset: utf-8
(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[7118],{19169:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BANS_STORE_NAME:()=>Ze,CORE_STORE_NAME:()=>Gt,HELP_STORE_NAME:()=>st,MODULES_STORE_NAME:()=>lt,apiFetch:()=>M,apiFetchBatch:()=>X,apiFetchResult:()=>G,awaitPromise:()=>j,controls:()=>ee,coreStore:()=>ac,createNotice:()=>J,dispatch:()=>W,fetch:()=>$,firewallStore:()=>Wu,logsStore:()=>To,modulesStore:()=>Pr,parseFetchResponse:()=>Z,patchstackStore:()=>jn,select:()=>Y,siteScannerStore:()=>qn,toolsStore:()=>ts,trustedDevicesStore:()=>al,updateSettings:()=>K,userSecurityStore:()=>tu,vulnerabilitiesStore:()=>Gs});var s={};r.r(s),r.d(s,{FAILED_CREATE_BAN:()=>Re,FAILED_DELETE_BAN:()=>Ue,FAILED_QUERY:()=>Te,FAILED_UPDATE_BAN:()=>Qe,FINISH_CREATE_BAN:()=>ve,FINISH_DELETE_BAN:()=>Le,FINISH_QUERY:()=>qe,FINISH_UPDATE_BAN:()=>Ne,RECEIVE_BAN:()=>be,RECEIVE_QUERY:()=>_e,START_CREATE_BAN:()=>Ae,START_DELETE_BAN:()=>xe,START_QUERY:()=>he,START_UPDATE_BAN:()=>Pe,createBan:()=>me,deleteBan:()=>Se,failedCreateBan:()=>ce,failedDeleteBan:()=>Ee,failedUpdateBan:()=>de,fetchQueryNextPage:()=>ie,finishCreateBan:()=>ae,finishDeleteBan:()=>pe,finishUpdateBan:()=>fe,path:()=>re,query:()=>se,receiveBan:()=>oe,receiveQuery:()=>ue,refreshQuery:()=>ne,startCreateBan:()=>le,startDeleteBan:()=>ge,startUpdateBan:()=>ye,updateBan:()=>Ie});var n={};r.r(n),r.d(n,{getBan:()=>Ve,getBans:()=>De,getQueryHeader:()=>we,getQueryHeaderLink:()=>Oe,getQueryHeaderLinks:()=>ke,getQueryParams:()=>He,getQueryResults:()=>Fe,isDeleting:()=>Me,isQuerying:()=>Ge,isUpdating:()=>Be});var i={};r.r(i),r.d(i,{getBans:()=>Ye});var u={};r.r(u),r.d(u,{RECEIVE_HELP:()=>Je,enableHelp:()=>Ke,fetchHelp:()=>je});var o={};r.r(o),r.d(o,{getHelp:()=>ze,isEnabled:()=>et});var l={};r.r(l),r.d(l,{getHelp:()=>tt});var c={};r.r(c),r.d(c,{EDIT_MODULE:()=>Nt,EDIT_SETTING:()=>Ft,EDIT_SETTINGS:()=>Dt,FAILED_SAVING_MODULES:()=>Lt,FAILED_SAVING_SETTINGS:()=>Ht,FINISH_SAVING_MODULES:()=>Ut,FINISH_SAVING_SETTINGS:()=>Vt,RECEIVE_MODULE:()=>Pt,RECEIVE_MODULES:()=>bt,RECEIVE_SETTINGS:()=>Ct,RESET_MODULE_EDITS:()=>Qt,RESET_SETTING_EDIT:()=>Ot,RESET_SETTING_EDITS:()=>kt,START_SAVING_MODULES:()=>xt,START_SAVING_SETTINGS:()=>wt,activateModule:()=>dt,deactivateModule:()=>ft,editModule:()=>ct,editSetting:()=>pt,editSettings:()=>Et,fetchModules:()=>Tt,receiveModule:()=>vt,receiveModules:()=>At,receiveSettings:()=>Rt,resetModuleEdits:()=>yt,resetSettingEdits:()=>mt,saveModules:()=>at,saveSettings:()=>It,setModulesStatus:()=>gt,updateSettings:()=>St,validateSettings:()=>_t});var a={};r.r(a),r.d(a,{__unstableGetAllEditedSettings:()=>yr,__unstableGetAllSettings:()=>ar,areSettingsDirty:()=>lr,getActiveModules:()=>Zt,getDirtyModules:()=>zt,getDirtySettings:()=>or,getEditedModule:()=>$t,getEditedModules:()=>Wt,getEditedSetting:()=>ir,getEditedSettings:()=>nr,getError:()=>cr,getModule:()=>jt,getModuleEdits:()=>Jt,getModules:()=>Yt,getSetting:()=>rr,getSettingEdits:()=>sr,getSettingSchema:()=>dr,getSettings:()=>tr,getSettingsConditionalSchema:()=>gr,isActive:()=>Kt,isModuleDirty:()=>er,isSavingModule:()=>Xt,isSavingSettings:()=>ur});var y={};r.r(y),r.d(y,{__unstableGetAllEditedSettings:()=>Sr,__unstableGetAllSettings:()=>Ir,getActiveModules:()=>Tr,getEditedModule:()=>qr,getEditedModules:()=>_r,getEditedSetting:()=>Rr,getEditedSettings:()=>vr,getModule:()=>hr,getModules:()=>pr,getSetting:()=>Ar,getSettings:()=>mr});var d={};r.r(d),r.d(d,{FAILED_TOGGLE_TOOL:()=>Fr,FINISH_TOGGLE_TOOL:()=>Or,FINISH_TOOL:()=>Cr,RECEIVE_TOOLS:()=>Lr,START_TOGGLE_TOOL:()=>Dr,START_TOOL:()=>Ur,fetchTools:()=>Nr,runTool:()=>Qr,toggleTool:()=>xr});var f={};r.r(f),r.d(f,{getLastError:()=>jr,getLastResult:()=>$r,getResolvedTools:()=>Hr,getRunning:()=>Yr,getTool:()=>Gr,getTools:()=>Vr,getToolsConfig:()=>Mr,isRunning:()=>Wr,isUpdating:()=>Zr});var g={};r.r(g),r.d(g,{getResolvedTools:()=>Xr,getTool:()=>zr,getTools:()=>Jr});var E={};r.r(E),r.d(E,{FAILED_ACTION:()=>hs,FAILED_QUERY:()=>Is,FINISH_ACTION:()=>_s,FINISH_QUERY:()=>ms,RECEIVE_QUERY:()=>Es,RECEIVE_VULNERABILITY:()=>qs,START_ACTION:()=>Ss,START_QUERY:()=>ps,applyVulnerabilityAction:()=>ds,deactivateSoftware:()=>ys,fetchQueryNextPage:()=>os,fetchQueryPrevPage:()=>us,fixVulnerability:()=>as,muteVulnerability:()=>cs,query:()=>ns,receiveQuery:()=>fs,receiveVulnerability:()=>gs,refreshQuery:()=>is});var p={};r.r(p),r.d(p,{getQueryHeader:()=>Qs,getQueryHeaderLink:()=>Rs,getQueryHeaderLinks:()=>bs,getQueryParams:()=>xs,getQueryResults:()=>As,getVulnerabilities:()=>Ts,getVulnerability:()=>Ls,getVulnerabilityActions:()=>Cs,getVulnerabilityById:()=>Us,hasQueried:()=>vs,isApplyingAction:()=>ws,isDeactivatingSoftware:()=>ks,isFixing:()=>Os,isMuting:()=>Fs,isQuerying:()=>Ds,queryHasNextPage:()=>Ns,queryHasPrevPage:()=>Ps});var m={};r.r(m),r.d(m,{getVulnerabilities:()=>Hs,getVulnerabilityById:()=>Vs});var I={};r.r(I),r.d(I,{FAILED_QUERY:()=>nn,FAILED_SCAN:()=>cn,FINISH_QUERY:()=>sn,FINISH_SCAN:()=>ln,RECEIVE_QUERY:()=>tn,RECEIVE_SCAN:()=>un,START_QUERY:()=>rn,START_SCAN:()=>on,fetchQueryNextPage:()=>Ks,fetchQueryPrevPage:()=>js,query:()=>$s,receiveQuery:()=>en,receiveScan:()=>zs,refreshQuery:()=>Zs,runScan:()=>Xs});var S={};r.r(S),r.d(S,{getQueryHeader:()=>gn,getQueryHeaderLink:()=>dn,getQueryHeaderLinks:()=>fn,getQueryParams:()=>En,getQueryResults:()=>yn,getScan:()=>pn,getScans:()=>an,isQuerying:()=>mn,isScanning:()=>In});var _={};r.r(_),r.d(_,{getScans:()=>Sn});var h={};r.r(h),r.d(h,{FAILED_QUERY:()=>Un,FINISH_QUERY:()=>Ln,RECEIVE_QUERY:()=>Cn,START_QUERY:()=>xn,fetchQueryNextPage:()=>Pn,fetchQueryPrevPage:()=>bn,query:()=>vn,receiveQuery:()=>Qn,refreshQuery:()=>Rn});var q={};r.r(q),r.d(q,{getLastFetchError:()=>Gn,getPatchstackVulnerabilities:()=>Dn,getPatchstackVulnerability:()=>Fn,getQueryHeader:()=>Hn,getQueryHeaderLink:()=>kn,getQueryHeaderLinks:()=>wn,getQueryParams:()=>Vn,getQueryResults:()=>On,isQuerying:()=>Yn,queryHasNextPage:()=>Bn,queryHasPrevPage:()=>Mn});var T={};r.r(T),r.d(T,{getPatchstackVulnerabilities:()=>Wn});var A={};r.r(A),r.d(A,{CLOSE_QUICK_EDIT:()=>Ni,CONFIRM_QUICK_EDIT:()=>Qi,FAILED_ACTION:()=>Ti,FAILED_QUERY:()=>_i,FINISH_ACTION:()=>qi,FINISH_QUERY:()=>Si,OPEN_QUICK_EDIT:()=>Pi,RECEIVE_QUERY:()=>mi,RECEIVE_USER:()=>Ai,REMOVE_SELECTED_USERS:()=>xi,START_ACTION:()=>hi,START_QUERY:()=>Ii,TOGGLE_SELECTED_USER:()=>Ri,TOGGLE_SELECT_ALL:()=>bi,UPDATE_SELECTION_TYPE:()=>vi,applyQueryActionsToUsers:()=>li,applyQuickActionsToQuery:()=>oi,closeQuickEdit:()=>Ei,confirmQuickEdit:()=>pi,fetchQueryNextPage:()=>si,fetchQueryPrevPage:()=>ri,openQuickEdit:()=>gi,query:()=>ei,quickEditsSuccessSnackbar:()=>ci,receiveQuery:()=>ii,receiveUser:()=>ui,refreshQuery:()=>ti,removeSelectedUsers:()=>fi,toggleSelectAll:()=>yi,toggleSelectedUser:()=>di,updateUserSelectionType:()=>ai});var v={};r.r(v),r.d(v,{getCurrentlySelectedUsers:()=>Yi,getQueryHeader:()=>ki,getQueryHeaderLink:()=>Ci,getQueryHeaderLinks:()=>Di,getQueryParams:()=>wi,getQueryResults:()=>Ui,getQuickActionsError:()=>Gi,getQuickEditActions:()=>Ki,getQuickEditState:()=>ji,getSelectAllState:()=>Wi,getUser:()=>Hi,getUserById:()=>Vi,getUserSelectionType:()=>Bi,getUsers:()=>Li,isApplyingQuickActions:()=>Mi,isQuerying:()=>$i,isUserSelected:()=>Zi,queryHasNextPage:()=>Oi,queryHasPrevPage:()=>Fi});var R={};r.r(R),r.d(R,{getUserById:()=>Xi,getUsers:()=>Ji});var b={};r.r(b),r.d(b,{FAILED_QUERY:()=>_u,FINISH_QUERY:()=>Su,RECEIVE_ITEM:()=>mu,RECEIVE_QUERY:()=>pu,START_QUERY:()=>Iu,deleteItem:()=>gu,editItem:()=>cu,fetchQueryNextPage:()=>ou,fetchQueryPrevPage:()=>uu,query:()=>nu,refreshQuery:()=>iu,resetAllEdits:()=>yu,resetEdits:()=>au,saveEditedItem:()=>du,saveItem:()=>fu});var P={};r.r(P),r.d(P,{getEditedItem:()=>Lu,getFirewallRules:()=>hu,getItem:()=>Nu,getItemById:()=>Qu,getLastDeleteError:()=>Ou,getLastSaveError:()=>Fu,getQueryHeader:()=>bu,getQueryHeaderLink:()=>Tu,getQueryHeaderLinks:()=>Au,getQueryParams:()=>Pu,getQueryResults:()=>qu,isDeleting:()=>Du,isDirty:()=>Uu,isQuerying:()=>xu,isSaving:()=>Cu,queryHasNextPage:()=>Ru,queryHasPrevPage:()=>vu});var N={};r.r(N),r.d(N,{getEditedItem:()=>wu,getFirewallRules:()=>ku,getItemById:()=>Hu});var Q={};r.r(Q),r.d(Q,{FAILED_QUERY:()=>io,FINISH_QUERY:()=>no,RECEIVE_LOG:()=>uo,RECEIVE_QUERY:()=>ro,START_QUERY:()=>so,fetchQueryNextPage:()=>Xu,fetchQueryPrevPage:()=>Ju,query:()=>ju,receiveLog:()=>to,receiveQuery:()=>eo,refreshQuery:()=>Ku});var x={};r.r(x),r.d(x,{getLog:()=>mo,getLogById:()=>Io,getLogs:()=>oo,getQueryHeader:()=>go,getQueryHeaderLink:()=>co,getQueryHeaderLinks:()=>ao,getQueryParams:()=>Eo,getQueryResults:()=>lo,isQuerying:()=>po,queryHasNextPage:()=>fo,queryHasPrevPage:()=>yo});var L={};r.r(L),r.d(L,{getLogById:()=>_o,getLogs:()=>So});var U={};r.r(U),r.d(U,{FAILED_QUERY:()=>Vo,FINISH_QUERY:()=>Ho,RECEIVE_ITEM:()=>ko,RECEIVE_QUERY:()=>Oo,START_QUERY:()=>wo,editItem:()=>Qo,fetchQueryNextPage:()=>Po,fetchQueryPrevPage:()=>bo,query:()=>vo,refreshQuery:()=>Ro,resetAllEdits:()=>Lo,resetEdits:()=>xo,saveEditedItem:()=>Uo,saveEditedItems:()=>Co,saveItem:()=>Do});var C={};r.r(C),r.d(C,{getDirtyItems:()=>el,getEditedItem:()=>zo,getItem:()=>Ko,getItemById:()=>Jo,getLastSaveError:()=>nl,getQueryHeader:()=>$o,getQueryHeaderLink:()=>Mo,getQueryHeaderLinks:()=>Go,getQueryParams:()=>Zo,getQueryResults:()=>Bo,getQueryUser:()=>jo,isDirty:()=>tl,isQuerying:()=>Xo,isSaving:()=>rl,isSavingAnyItems:()=>sl,queryHasNextPage:()=>Wo,queryHasPrevPage:()=>Yo});var D={};r.r(D),r.d(D,{getActorTypes:()=>_l,getActors:()=>hl,getBatchMaxItems:()=>Al,getCurrentUser:()=>dl,getCurrentUserId:()=>fl,getFeatureFlags:()=>Tl,getIndex:()=>pl,getInstallType:()=>Rl,getRequirementsInfo:()=>Sl,getRoles:()=>Il,getSchema:()=>ml,getServerType:()=>vl,getSiteInfo:()=>ql,getUser:()=>yl,hasPatchstack:()=>bl,isLiquidWebCustomer:()=>Pl,isSavingCurrentUser:()=>El,isSavingUser:()=>gl});var F={};r.r(F),r.d(F,{LOAD_INITIAL_FEATURE_FLAGS:()=>$l,RECEIVE_ACTORS:()=>Yl,RECEIVE_ACTOR_TYPES:()=>Gl,RECEIVE_BATCH_MAX_ITEMS:()=>Zl,RECEIVE_CURRENT_USER_ID:()=>Ml,RECEIVE_INDEX:()=>Vl,RECEIVE_SITE_INFO:()=>Wl,RECEIVE_USER:()=>Bl,__unstableLoadInitialFeatureFlags:()=>wl,fetchIndex:()=>Nl,fetchUser:()=>Ul,receiveActorTypes:()=>Fl,receiveActors:()=>Ol,receiveBatchMaxItems:()=>Hl,receiveCurrentUserId:()=>Dl,receiveIndex:()=>Ql,receiveSiteInfo:()=>kl,receiveUser:()=>Cl,saveCurrentUser:()=>xl,saveUser:()=>Ll});var O={};r.r(O),r.d(O,{getActorTypes:()=>ic,getActors:()=>uc,getBatchMaxItems:()=>lc,getCurrentUser:()=>nc,getIndex:()=>jl,getInstallType:()=>ec,getRequirementsInfo:()=>Xl,getRoles:()=>Jl,getSchema:()=>Kl,getServerType:()=>zl,getSiteInfo:()=>oc,getUser:()=>sc,hasPatchstack:()=>tc,isLiquidWebCustomer:()=>rc});var k=r(48015),w=r(92819),H=r(87514),V=r.n(H),B=r(31511);function M(e){return{type:"API_FETCH",request:e}}function G(e){return{type:"API_FETCH_RESULT",request:e}}function Y(e,t,...r){return{type:"SELECT",storeKey:e,selectorName:t,args:r}}function W(e,t,...r){return{type:"DISPATCH",storeKey:e,actionName:t,args:r}}function $(e,t){return{type:"FETCH",request:e,init:t}}function Z(e){return{type:"PARSE_FETCH_RESPONSE",response:e}}function j(e,t){return{type:"AWAIT_PROMISE",promise:e,delay:t}}function K(e,t){return{type:"UPDATE_SETTINGS",module:e,settings:t}}function J(e="info",t,r={}){return{type:"CREATE_NOTICE",status:e,content:t,options:{context:"ithemes-security",...r}}}function X(e){return{type:"API_FETCH_BATCH",batch:e}}const z={AWAIT_PROMISE:({promise:e,delay:t})=>{return t?Promise.all([e,(r=t,new Promise((e=>setTimeout(e,r))))]):e;var r},API_FETCH:({request:e})=>V()(e).catch(B.xJ),API_FETCH_RESULT:({request:e})=>V()({...e,parse:!1}).then(B.x4.fromResponse).catch(B.xJ).catch((e=>e.getResponse?B.x4.fromResponse(e.getResponse()):new B.x4(B.x4.ERROR,new B.PN("unknown_error","Unknown error")))),SELECT({storeKey:e,selectorName:t,args:r}){const s=(0,k.select)(e)[t];return s.hasResolver?(({storeKey:e,selectorName:t,args:r})=>new Promise((s=>{const n=()=>(0,k.select)("core/data").hasFinishedResolution(e,t,r),i=()=>(0,k.select)(e)[t].apply(null,r),u=i();if(n())return s(u);const o=(0,k.subscribe)((()=>{n()&&(o(),s(i()))}))})))({storeKey:e,selectorName:t,args:r}):s(...r)},DISPATCH:({storeKey:e,actionName:t,args:r})=>(0,k.dispatch)(e)[t](...r),PARSE_FETCH_RESPONSE:async function({response:e}){return await e.json()},FETCH:({request:e,init:t})=>window.fetch(e,t),UPDATE_SETTINGS:(0,k.createRegistryControl)((e=>({module:t,settings:r})=>e.dispatch("ithemes-security/modules").updateSettings(t,r))),CREATE_NOTICE({status:e,content:t,options:r}){r.autoDismiss&&(r.id=r.id||(0,w.uniqueId)("itsec-auto-dismiss-"),setTimeout((()=>(0,k.dispatch)("core/notices").removeNotice(r.id,r.context)),r.autoDismiss)),(0,k.dispatch)("core/notices").createNotice(e,t,r)},API_FETCH_BATCH:(0,k.createRegistryControl)((e=>async({batch:t})=>{const r=await e.resolveSelect(Gt).getBatchMaxItems(),s=(0,w.chunk)(t,r||25),n=[],i=[];if(!s.length)return[];for(const e of s)try{const t=await z.API_FETCH({request:{path:"/batch/v1",method:"POST",data:{requests:e}}});i.push(...t.responses)}catch(t){n.push(t),i.push(...(0,w.times)(e.length,(0,w.constant)({body:t,status:500,headers:{}})))}if(n.length===s.length)throw n[0];return i}))},ee=z;var te=r(73470);const re="/ithemes-security/v1/bans";function*se(e,t={}){let r,s;yield{type:he,queryId:e,queryParams:t};try{r=yield M({path:(0,te.addQueryArgs)(re,t),parse:!1}),s=yield Z(r)}catch(r){return yield{type:Te,queryId:e,queryParams:t,error:r},r}return yield ue(e,t.context||"view",r,s,"replace"),yield{type:qe,queryId:e,queryParams:t,response:r},r}function*ne(e){const t=yield Y("ithemes-security/bans","getQueryParams",e);yield*se(e,t)}function*ie(e,t="append"){const r=yield Y("ithemes-security/bans","getQueryHeaderLink",e,"next");if(!r)return[];let s,n;yield{type:he,queryId:e};try{s=yield M({url:r.link,parse:!1}),n=yield Z(s)}catch(t){return yield{type:Te,queryId:e,error:t},t}const i=(0,te.getQueryArg)(r.link,"context")||"view";return yield ue(e,i,s,n,t),yield{type:qe,queryId:e,response:s},s}function ue(e,t,r,s,n){return{type:_e,queryId:e,context:t,response:r,items:s,mode:n}}function oe(e){return{type:be,ban:e}}function le(e){return{type:Ae,ban:e}}function ce(e,t){return{type:Re,ban:e,error:t}}function ae(e,t){return{type:ve,ban:e,response:t}}function ye(e,t){return{type:Pe,self:e,ban:t}}function de(e,t){return{type:Qe,self:e,error:t}}function fe(e,t){return{type:Ne,self:e,response:t}}function ge(e){return{type:xe,self:e}}function Ee(e,t){return{type:Ue,self:e,error:t}}function pe(e){return{type:Le,self:e}}function*me(e,t){const r={method:"POST",data:t};let s;(0,te.isURL)(e)?r.url=e:r.path=`${re}/${e}`,yield le(t);try{s=yield M(r)}catch(e){return yield ce(t,e),e}return yield ae(t,s),yield oe(s),s}function*Ie(e,t){const r=(0,w.isObject)(e)?(0,B.AW)(e):e;let s;yield ye(r,t);try{s=yield M({url:r,method:"PUT",data:t})}catch(e){return yield de(r,e),e}return yield fe(r,s),yield oe(s),s}function*Se(e){const t=(0,w.isObject)(e)?(0,B.AW)(e):e;yield ge(t);try{yield M({url:t,method:"DELETE"})}catch(e){return yield Ee(t,e),e}return yield pe(t),null}const _e="RECEIVE_QUERY",he="START_QUERY",qe="FINISH_QUERY",Te="FAILED_QUERY",Ae="START_CREATE_BAN",ve="FINISH_CREATE_BAN",Re="FAILED_CREATE_BAN",be="RECEIVE_BAN",Pe="START_UPDATE_BAN",Ne="FINISH_UPDATE_BAN",Qe="FAILED_UPDATE_BAN",xe="START_DELETE_BAN",Le="FINISH_DELETE_BAN",Ue="FAILED_DELETE_BAN";var Ce=r(28306);const De=(0,k.createRegistrySelector)((e=>()=>e("ithemes-security/bans").getQueryResults("main"))),Fe=(0,Ce.Z)(((e,t)=>{const r=(0,w.get)(e,["queries",t,"selves"],[]),s=e.bySelf,n=r.length,i=new Array(n);let u=-1;for(;++u<n;){const e=s[r[u]];e&&(i[u]=e.item)}return i}),((e,t)=>[e.queries[t],e.bySelf]));function Oe(e,t,r){return(0,w.find)((0,w.get)(e,["queries",t,"links"],[]),{rel:r})}function ke(e,t,r){return(0,w.filter)((0,w.get)(e,["queries",t,"links"],[]),{rel:r})}function we(e,t,r){return(0,w.get)(e,["queries",t,"headers",r])}function He(e,t){return(0,w.get)(e,["queryParams",t])}function Ve(e,t){return e.bySelf[t]}function Be(e,t){const r=(0,w.isObject)(t)?(0,B.AW)(t):t;return e.updating.includes(r)}function Me(e,t){const r=(0,w.isObject)(t)?(0,B.AW)(t):t;return e.deleting.includes(r)}function Ge(e,t){return e.querying.includes(t)}function*Ye(){yield W("ithemes-security/bans","query","main",{per_page:100})}var We=r(38085);const $e={bySelf:{},queries:{},queryParams:{},querying:[],creating:[],updating:[],deleting:[]},Ze="ithemes-security/bans";function*je(e){const t=`https://ithemes.com/wp-json/ithemes/v1/inline-help/itsec/${encodeURIComponent(e)}`,r=yield $(t,{credentials:"omit",referrer:"no-referrer"});if(!r.ok)return;if(r.status>=400)return;const s=yield Z(r);yield{type:Je,topic:e,help:s}}function*Ke(e=!0){yield K("global",{enable_remote_help:e})}(0,k.register)((0,k.createReduxStore)(Ze,{controls:ee,actions:s,selectors:n,resolvers:i,reducer:function(e=$e,t){switch(t.type){case _e:return{...e,queries:{...e.queries,[t.queryId]:{selves:"replace"===t.mode?(0,w.map)(t.items,B.AW):[...(0,w.get)(e,["queries",t.queryId,"selves"],[]),...(0,w.map)(t.items,B.AW)],headers:(0,w.fromPairs)(Array.from(t.response.headers.entries())),links:(0,We.parse)(t.response.headers.get("link"),{extended:!0}).map((e=>({...e,rel:e.rel[0]})))}},bySelf:{...e.bySelf,...(0,w.fromPairs)(t.items.filter((r=>{const s=(0,B.AW)(r);return!e.bySelf[s]||"embed"===e.bySelf[s].context||e.bySelf[s].context===t.context})).map((e=>[(0,B.AW)(e),{context:t.context,item:e}])))}};case he:return{...e,querying:[...e.querying,t.queryId],queryParams:{...e.queryParams,[t.queryId]:t.queryParams||e.queryParams[t.queryId]}};case qe:case Te:return{...e,querying:e.querying.filter((e=>e!==t.queryId))};case be:return{...e,bySelf:{...e.bySelf,[(0,B.AW)(t.ban)]:{context:"edit",item:t.ban}}};case Ae:return{...e,creating:[...e.creating,t.ban]};case ve:case Re:return{...e,creating:e.creating.filter((e=>e!==t.ban))};case Pe:return{...e,updating:[...e.updating,t.self]};case Ne:case Qe:return{...e,updating:e.updating.filter((e=>e!==t.self))};case xe:return{...e,deleting:[...e.deleting,t.self],bySelf:(0,w.omit)(e.bySelf,[t.self])};case Le:case Ue:return{...e,deleting:e.deleting.filter((e=>e!==t.self))};default:return e}}}));const Je="RECEIVE_HELP",Xe=[];function ze(e,t){return e.byTopic[t]||Xe}const et=(0,k.createRegistrySelector)((e=>()=>e("ithemes-security/modules").getSettings("global")?.enable_remote_help));function*tt(e){yield je(e)}const rt={byTopic:{}},st="ithemes-security/help",nt=(0,k.createReduxStore)(st,{controls:ee,actions:u,selectors:o,resolvers:l,reducer:function(e=rt,t){return t.type===Je?{...e,byTopic:{...e.byTopic,[t.topic]:t.help}}:e}});(0,k.register)(nt);var it=r(86076),ut=r(66e3),ot=r(95122);const lt="ithemes-security/modules";function*ct(e,t){const r=yield k.controls.select(lt,"getModule",e);r?yield{type:Nt,module:e,edit:(0,it.Z)(r,t)}:yield{type:Nt,module:e,edit:t}}function*at(e=!0){if(!0===e?e=yield k.controls.select(lt,"getDirtyModules"):(0,w.isString)(e)&&(e=[e]),!e.length)return[];const t=[];for(const r of e){const e=yield k.controls.select(lt,"getModuleEdits",r);t.push({method:"PUT",path:`/ithemes-security/v1/modules/${r}`,body:e})}let r;try{yield{type:xt,modules:e},r=yield X(t)}catch(t){return yield{type:Lt,modules:e},yield J("error",t.message),t}const s=[],n={};for(let i=0;i<t.length;i++){const t=e[i],u=r[i];u.status>=400?n[t]=u.body:(s.push(t),yield vt(u.body))}return(0,w.isEmpty)(n)||(yield{type:Lt,errors:n}),s.length&&(yield{type:Ut,modules:s}),r}function*yt(e=!0){!0===e?e=yield k.controls.select(lt,"getDirtyModules"):(0,w.isString)(e)&&(e=[e]),yield{type:Qt,modules:e}}function*dt(e){try{const t=yield qt(e,"active");yield vt(t),yield{type:Ut,modules:[e]},t.side_effects&&(yield Tt()),yield J("success",(0,ot.__)("Activated feature","better-wp-security"),{type:"snackbar"})}catch(t){yield{type:Lt,errors:{[e]:t}}}}function*ft(e){try{const t=yield qt(e,"inactive");yield vt(t),yield{type:Ut,modules:[e]},t.side_effects&&(yield Tt()),yield J("success",(0,ot.__)("Deactivated feature","better-wp-security"),{type:"snackbar"})}catch(t){yield{type:Lt,errors:{[e]:t}}}}function*gt(e){const t={requests:(0,w.map)(e,((e,t)=>({path:`/ithemes-security/v1/modules/${t}`,method:"PUT",body:{status:{selected:e}}})))},r=yield X(t);for(let e=0;e<r.length;e++){const t=r[e];t.status>=400?yield J("error",t.body.message):yield vt(t.body)}}function*Et(e,t){const r=yield k.controls.select(lt,"getSettings",e);if(!r)return void(yield{type:Dt,module:e,edit:t});const s={};let n=!1;for(const e in t)t.hasOwnProperty(e)&&((0,w.isEqual)(t[e],r[e])||(s[e]=t[e],n=!0));n?yield{type:Dt,module:e,edit:s}:yield mt(e)}function*pt(e,t,r){const s=yield k.controls.select(lt,"getSetting",e,t);(0,w.isEqual)(s,r)?yield{type:Ot,module:e,setting:t}:yield{type:Ft,module:e,setting:t,value:r}}function*mt(e=!0){!0===e?e=yield k.controls.select(lt,"getDirtySettings"):(0,w.isString)(e)&&(e=[e]),yield{type:kt,modules:e}}function*It(e=!0,t=!1){if(!0===e?e=yield k.controls.select(lt,"getDirtySettings"):(0,w.isString)(e)&&(e=[e]),!e.length)return[];const r=[],s=[],n={};for(const i of e){if(t){const e=yield k.controls.dispatch(lt,"validateSettings",i);if(!0!==e){const t=new B.PN("local_validation_failed");e.errorText.forEach((e=>t.add("local_validation_failed",e))),n[i]=t;continue}}const e=yield k.controls.select(lt,"getSettingEdits",i);s.push(i),r.push({method:"PATCH",path:`/ithemes-security/v1/settings/${i}`,body:e})}let i;try{yield{type:wt,modules:e},i=yield X(r)}catch(t){return yield{type:Ht,modules:e},yield J("error",t.message),t}const u=[];for(let e=0;e<r.length;e++){const t=s[e],r=i[e];r.status>=400?n[t]=r.body:(u.push(t),yield Rt(t,r.body))}return(0,w.isEmpty)(n)||(yield{type:Ht,errors:n}),u.length&&(yield J("success",(0,ot.__)("Saved settings.","better-wp-security"),{type:"snackbar"}),yield{type:Vt,modules:u}),i}function*St(e,t){let r;yield{type:wt,modules:[e]};try{r=yield M({path:`/ithemes-security/v1/settings/${e}`,method:"PATCH",data:t}),yield Rt(e,r)}catch(t){return yield{type:Ht,errors:{[e]:t}},t}return yield{type:Vt,modules:[e]},r}const _t=e=>async({select:t,resolveSelect:r})=>{const s=await r.getSettingsConditionalSchema(e);if(!s)return!0;const n=t.getEditedSettings(e),i=(0,B.g4)();return!!i.validate(s,n)||{errors:i.errors,errorText:ht(i.errors,e,s)}};function ht(e,t,r){const s=[];for(const{message:n,schemaPath:i,dataPath:u}of e){let e=ut.IB.create(i),o=e.parent(r);for(;o&&!o.title;)e=ut.IB.create(e.path.slice(0,e.path.length-1)),o=e.parent(r);o?.title?s.push(`${o.title} ${n}.`):s.push(`${t}${u} ${n}.`)}return s}function qt(e,t){return M({method:"PUT",path:`/ithemes-security/v1/modules/${e}`,data:{status:{selected:t}}})}function*Tt(){const e=yield M({path:"/ithemes-security/v1/modules?context=edit&_embed=1"});yield At(e)}function At(e){return{type:bt,modules:e}}function vt(e){return{type:Pt,module:e}}function Rt(e,t){return{type:Ct,module:e,settings:t}}const bt="RECEIVE_MODULES",Pt="RECEIVE_MODULE",Nt="EDIT_MODULE",Qt="RESET_MODULE_EDITS",xt="START_SAVING_MODULES",Lt="FAILED_SAVING_MODULES",Ut="FINISH_SAVING_MODULES",Ct="RECEIVE_SETTINGS",Dt="EDIT_SETTINGS",Ft="EDIT_SETTING",Ot="RESET_SETTING_EDIT",kt="RESET_SETTING_EDITS",wt="START_SAVING_SETTINGS",Ht="FAILED_SAVING_SETTINGS",Vt="FINISH_SAVING_SETTINGS";var Bt=r(59588),Mt=r.n(Bt);const Gt="ithemes-security/core";function Yt(e){return e.modules}const Wt=(0,Ce.Z)((e=>e.modules.map((t=>({...t,...e.moduleEdits[t.id]||{}})))),(e=>[e.modules,e.moduleEdits])),$t=(0,Ce.Z)(((e,t)=>{const r=jt(e,t);return r?{...r,...e.moduleEdits[t]||{}}:null}),((e,t)=>[e.modules,e.moduleEdits[t]])),Zt=(0,Ce.Z)((e=>e.modules.filter((e=>"active"===e.status.selected)).map((e=>e.id))),(e=>e.modules));function jt(e,t){return e.modules.find((e=>e.id===t))}function Kt(e,t){return"active"===jt(e,t)?.status.selected}function Jt(e,t){return e.moduleEdits[t]}function Xt(e,t){return e.savingModules.includes(t)}function zt(e){return Object.keys(e.moduleEdits)}function er(e,t){return!!e.moduleEdits[t]}function tr(e,t){var r;return null!==(r=e.settings[t])&&void 0!==r?r:{}}function rr(e,t,r){return e.settings[t]?.[r]}function sr(e,t){return e.settingEdits[t]}const nr=(0,Ce.Z)(((e,t)=>({...e.settings[t]||{},...e.settingEdits[t]||{}})),((e,t)=>[e.settings[t],e.settingEdits[t]]));function ir(e,t,r){return e.settingEdits[t]?.[r]||e.settings[t]?.[r]}function ur(e,t){return Array.isArray(t)?e.savingSettings.some((e=>t.includes(e))):e.savingSettings.includes(t)}function or(e){return Object.keys(e.settingEdits)}function lr(e,t){return e.settingEdits[t]&&!(0,w.isEmpty)(e.settingEdits[t])}function cr(e,t){return e.errors[t]}function ar(e){return e.settings}const yr=(0,Ce.Z)((e=>(0,w.reduce)(e.settings,((t,r,s)=>(t[s]={...r,...e.settingEdits[s]||{}},t)),{})),(e=>[e.settings,e.settingEdits]));function dr(e,t,r){return jt(e,t)?.settings?.schema.properties[r]}const fr=Mt()(((e,t,r,s,n,i,u,o)=>{const l={select:t,serverType:r,installType:s,featureFlags:n,activeModules:i,settings:u,userGroupsBySetting:o},c=t=>((e,t,r)=>{const{serverType:s,installType:n,activeModules:i,settings:u,featureFlags:o,userGroupsBySetting:l}=r;if(e["server-type"]&&!e["server-type"].includes(s))return!1;if(e["install-type"]&&e["install-type"]!==n)return!1;if(e["active-modules"])for(const t of e["active-modules"])if(!i.includes(t))return!1;if(e["user-groups"])for(const r of e["user-groups"])if(!l[t.id]?.[r]?.length)return!1;if(e["feature-flags"])for(const t of e["feature-flags"])if(!o?.includes(t))return!1;return!(e.settings&&!(0,B.g4)().compile(e.settings)(u))})(t,e,l),a=(t,r)=>r.properties?{...r,properties:Object.entries(r.properties).reduce(((r,[s,n])=>{const i=`${t}.${s}`;return e.settings.conditional[i]&&!c(e.settings.conditional[i])||(r[s]=a(i,n)),r}),{})}:r,y=Object.entries(e.settings.schema.properties).reduce(((t,[r,s])=>e.settings.interactive.includes(r)?(e.settings.conditional[r]&&!c(e.settings.conditional[r])||(t[r]=a(r,s)),t):t),{}),{id:d,...f}=e.settings.schema;return{...f,properties:y}})),gr=(0,k.createRegistrySelector)((e=>(t,r)=>{const s=$t(t,r);return s?.settings?fr(s,e,e(Gt).getServerType(),e(Gt).getInstallType(),e(Gt).getFeatureFlags(),Zt(t),nr(t,r),e("ithemes-security/user-groups-editor").getEditedGroupsBySetting()):null})),Er={modules:[],moduleEdits:{},savingModules:[],settings:{},settingEdits:{},savingSettings:[],errors:{}};function*pr(){yield Tt()}const mr={*fulfill(e){const t=yield M({path:`/ithemes-security/v1/settings/${e}`});yield Rt(e,t)},isFulfilled:(e,t)=>e.settings.hasOwnProperty(t)},Ir={*fulfill(){yield k.controls.resolveSelect(lt,"getModules")},isFulfilled:e=>!(0,w.isEmpty)(e.settings)};function*Sr(){yield k.controls.resolveSelect(lt,"__unstableGetAllSettings")}function*_r(){yield k.controls.resolveSelect(lt,"getModules")}const hr={*fulfill(){yield k.controls.resolveSelect(lt,"getModules")},isFulfilled:(e,t)=>e.modules.includes((e=>e.id===t))};function*qr(){yield k.controls.resolveSelect(lt,"getModules")}function*Tr(){yield k.controls.resolveSelect(lt,"getModules")}function*Ar(e){yield k.controls.resolveSelect(lt,"getSettings",e)}function*vr(e){yield k.controls.resolveSelect(lt,"getSettings",e)}function*Rr(e){yield k.controls.resolveSelect(lt,"getSettings",e)}const br=(0,k.createReduxStore)(lt,{controls:ee,actions:c,selectors:a,resolvers:y,reducer:function(e=Er,t){switch(t.type){case bt:return{...e,modules:[...t.modules],settings:{...e.settings,...t.modules.reduce(((e,t)=>{const r=(0,w.get)(t,["_embedded","ithemes-security:settings",0]);return r?{...e,[t.id]:r}:e}),{})}};case Pt:return{...e,modules:e.modules.map((e=>e.id===t.module.id?t.module:e)),settings:{...e.settings,[t.module.id]:(0,w.get)(t.module,["_embedded","ithemes-security:settings",0],e.settings[t.module.id])}};case Nt:return{...e,moduleEdits:{...e.moduleEdits,[t.module]:t.edit}};case Qt:return{...e,moduleEdits:(0,w.omit)(e.moduleEdits,t.modules)};case xt:return{...e,savingModules:[...e.savingModules,...t.modules]};case Ut:return{...e,savingModules:e.savingModules.filter((e=>!t.modules.includes(e))),moduleEdits:(0,w.omit)(e.moduleEdits,t.modules),errors:(0,w.omit)(e.errors,t.modules)};case Lt:return{...e,savingModules:(0,w.without)(e.savingModules,...Object.keys(t.errors||{}),...t.modules||[]),errors:{...e.errors,...t.errors}};case Ct:return{...e,settings:{...e.settings,[t.module]:t.settings}};case Dt:return{...e,settingEdits:{...e.settingEdits,[t.module]:t.edit}};case Ft:return{...e,settingEdits:{...e.settingEdits,[t.module]:{...e.settingEdits[t.module]||{},[t.setting]:t.value}}};case Ot:return{...e,settingEdits:{...e.settingEdits,[t.module]:(0,w.omit)(e.settingEdits[t.module]||{},t.setting)}};case kt:return{...e,settingEdits:(0,w.omit)(e.settingEdits,t.modules)};case wt:return{...e,savingSettings:[...e.savingSettings,...t.modules]};case Vt:return{...e,savingSettings:e.savingSettings.filter((e=>!t.modules.includes(e))),settingEdits:(0,w.omit)(e.settingEdits,t.modules),errors:(0,w.omit)(e.errors,t.modules)};case Ht:return{...e,savingSettings:(0,w.without)(e.savingSettings,...Object.keys(t.errors||{}),...t.modules||[]),errors:{...e.errors,...t.errors}};default:return e}},persist:["moduleEdits","settingEdits"]});(0,k.register)(br);const Pr=br;function*Nr(){const e=yield M({path:"/ithemes-security/v1/tools"});yield{type:Lr,tools:e}}function*Qr(e,t={}){let r;yield{type:Ur,tool:e,form:t};try{r=yield M({path:`/ithemes-security/v1/tools/${e}`,method:"POST",data:t,parse:!1})}catch(t){const r=yield j(B.x4.fromResponse(t.getResponse()));return yield{type:Cr,tool:e,result:r},r}const s=yield j(B.x4.fromResponse(r));return yield{type:Cr,tool:e,result:s},s}function*xr(e,t=!0){let r;yield{type:Dr,tool:e,enabled:t};try{r=yield M({path:`/ithemes-security/v1/tools/${e}`,method:"PUT",data:{enabled:t}})}catch(t){return yield{type:Fr,tool:e,error:t},t}return yield{type:Or,tool:e,data:r},r}const Lr="RECEIVE_TOOLS",Ur="START_TOOL",Cr="FINISH_TOOL",Dr="START_TOGGLE_TOOL",Fr="FAILED_TOGGLE_TOOL",Or="FINISH_TOGGLE_TOOL",kr="ithemes-security/tools",wr=Mt()(((e,t)=>e.map((e=>t[e.slug]||e))),{maxSize:1}),Hr=(0,k.createRegistrySelector)((e=>t=>wr(e(kr).getToolsConfig(),t.bySlug))),Vr=(0,Ce.Z)((e=>e.slugs.map((t=>e.bySlug[t]))),(e=>[e.bySlug,e.slugs])),Br=Mt()((e=>e.reduce(((e,t)=>{for(const[r,s]of Object.entries(t.tools))e.push({slug:r,module:t.id,toggleable:!1,schedule:"",form:null,...s});return e}),[])),{maxSize:1}),Mr=(0,k.createRegistrySelector)((e=>()=>Br(e(lt).getModules()))),Gr=(0,k.createRegistrySelector)((e=>(t,r)=>t.bySlug[r]||e(kr).getToolsConfig().find((e=>r===e.slug))));function Yr(e){return e.running}function Wr(e,t){return e.running.includes(t)}function $r(e,t){return e.lastResult[t]}function Zr(e,t){return e.updating.includes(t)}function jr(e,t){return e.lastError[t]}const Kr={bySlug:{},slugs:[],running:[],lastResult:{},updating:[],lastError:{}};function*Jr(){yield Nr()}function*Xr(){yield k.controls.resolveSelect(kr,"getTools")}const zr={*fulfill(){yield k.controls.resolveSelect(kr,"getTools")},isFulfilled:(e,t)=>!!e.bySlug[t]},es=(0,k.createReduxStore)(kr,{controls:ee,actions:d,selectors:f,resolvers:g,reducer:function(e=Kr,t){switch(t.type){case Lr:return{...e,bySlug:(0,w.keyBy)(t.tools,"slug"),slugs:(0,w.map)(t.tools,"slug")};case Ur:return{...e,running:[...e.running,t.tool]};case Cr:return{...e,running:(0,w.without)(e.running,t.tool),lastResult:{...e.lastResult,[t.tool]:t.result}};case Dr:return{...e,updating:[...e.updating,t.tool]};case Fr:return{...e,updating:(0,w.without)(e.updating,t.tool),lastError:{...e.lastError,[t.tool]:t.error}};case Or:return{...e,updating:(0,w.without)(e.updating,t.tool),lastError:(0,w.omit)(e.lastError,t.tool),bySlug:{...e.bySlug,[t.tool]:t.data}};default:return e}}});(0,k.register)(es);const ts=es,rs="ithemes-security/vulnerabilities",ss="/ithemes-security/v1/site-scanner/vulnerabilities";function*ns(e,t={}){let r,s;yield{type:ps,queryId:e,queryParams:t};try{r=yield M({path:(0,te.addQueryArgs)(ss,t),parse:!1}),s=yield Z(r)}catch(r){return yield{type:Is,queryId:e,queryParams:t,error:r},r}return yield fs(e,t.context||"view",r,s,"replace"),yield{type:ms,queryId:e,queryParams:t,response:r},s}function*is(e){const t=yield Y(rs,"getQueryParams",e);yield*ns(e,t)}function*us(e,t="append"){return yield*ls(e,"prev",t)}function*os(e,t="append"){return yield*ls(e,"next",t)}function*ls(e,t,r){const s=yield Y(rs,"getQueryHeaderLink",e,t);if(!s)return[];let n,i;yield{type:ps,queryId:e};try{n=yield M({url:s.link,parse:!1}),i=yield Z(n)}catch(t){return yield{type:Is,queryId:e,error:t},t}const u=(0,te.getQueryArg)(s.link,"context")||"view";return yield fs(e,u,n,i,r),yield{type:ms,queryId:e,response:n},n}function*cs(e){return yield*ds(e,"ithemes-security:mute-vulnerability")}function*as(e){return yield*ds(e,"ithemes-security:fix-vulnerability")}function*ys(e){return yield*ds(e,"ithemes-security:deactivate-vulnerable-software")}function*ds(e,t){const r="string"==typeof e?yield k.controls.select(rs,"getVulnerability",e):e,s=(0,B.Rg)(r,t);if(!s)return;const n=(0,B.AW)(r);yield{type:Ss,rel:t,self:n};try{const e=yield M({url:s,method:"POST"});return yield{type:_s,rel:t,self:n},yield gs(e),e}catch(e){return yield{type:hs,rel:t,self:n,error:e},e}}function fs(e,t,r,s,n){return{type:Es,queryId:e,context:t,response:r,items:s,mode:n}}function gs(e){return{type:qs,vulnerability:e}}const Es="RECEIVE_QUERY",ps="START_QUERY",ms="FINISH_QUERY",Is="FAILED_QUERY",Ss="START_ACTION",_s="FINISH_ACTION",hs="FAILED_ACTION",qs="RECEIVE_VULNERABILITY",Ts=(0,k.createRegistrySelector)((e=>()=>e(rs).getQueryResults("main"))),As=(0,Ce.Z)(((e,t)=>{const r=(0,w.get)(e,["queries",t,"selves"],[]),s=e.bySelf,n=r.length,i=new Array(n);let u=-1;for(;++u<n;){const e=s[r[u]];e&&(i[u]=e.item)}return i}),((e,t)=>[e.queries[t],e.bySelf]));function vs(e,t){return!!e.queries[t]}function Rs(e,t,r){return(0,w.find)((0,w.get)(e,["queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function bs(e,t,r){return(0,w.filter)((0,w.get)(e,["queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function Ps(e,t){return!!Rs(e,t,"prev")}function Ns(e,t){return!!Rs(e,t,"next")}function Qs(e,t,r){return(0,w.get)(e,["queries",t,"headers",r])}function xs(e,t){return(0,w.get)(e,["queryParams",t])}function Ls(e,t){return e.bySelf[t]?.item}function Us(e,t){return Ls(e,e.selfById[t])}function Cs(e,t){const r="string"==typeof t?Ls(e,t):t;return r?(0,w.reduce)(r._links,((e,t,r)=>t.reduce(((e,t)=>t.title?(e.push({rel:r,title:t.title,isDestructive:t.isDestructive||!1}),e):e),e)),[]):[]}function Ds(e,t){return e.querying.includes(t)}function Fs(e,t){return ws(e,t,"ithemes-security:mute-vulnerability")}function Os(e,t){return ws(e,t,"ithemes-security:fix-vulnerability")}function ks(e,t){return ws(e,t,"ithemes-security:deactivate-vulnerable-software")}function ws(e,t,r){const s="string"==typeof t?t:(0,B.AW)(t);return e.actions.includes(`${r}:${s}`)}function*Hs(){yield W(rs,"query","main",{per_page:100,resolution:["unresolved","patched","deactivated"]})}function*Vs(e){const t=yield M({path:`${ss}/${e}`});return yield gs(t),t}const Bs={bySelf:{},selfById:{},queries:{},queryParams:{},querying:[],actions:[]},Ms=(0,k.createReduxStore)(rs,{actions:E,selectors:p,resolvers:m,controls:ee,reducer:function(e=Bs,t){switch(t.type){case Es:return{...e,queries:{...e.queries,[t.queryId]:{selves:"replace"===t.mode?(0,w.map)(t.items,B.AW):[...(0,w.get)(e,["queries",t.queryId,"selves"],[]),...(0,w.map)(t.items,B.AW)],headers:(0,w.fromPairs)(Array.from(t.response.headers.entries())),links:(0,We.parse)(t.response.headers.get("link"),{extended:!0})}},bySelf:{...e.bySelf,...(0,w.fromPairs)(t.items.filter((r=>{const s=(0,B.AW)(r);return!e.bySelf[s]||"embed"===e.bySelf[s].context||e.bySelf[s].context===t.context})).map((e=>[(0,B.AW)(e),{context:t.context,item:e}])))},selfById:{...e.selfById,...(0,w.fromPairs)(t.items.map((e=>[e.id,(0,B.AW)(e)])))}};case ps:return{...e,querying:[...e.querying,t.queryId],queryParams:{...e.queryParams,[t.queryId]:t.queryParams||e.queryParams[t.queryId]}};case ms:case Is:return{...e,querying:e.querying.filter((e=>e!==t.queryId))};case qs:return{...e,bySelf:{...e.bySelf,[(0,B.AW)(t.vulnerability)]:{context:"edit",item:t.vulnerability}},selfById:{...e.selfById,[t.vulnerability.id]:(0,B.AW)(t.vulnerability)}};case Ss:return{...e,actions:[...e.actions,`${t.rel}:${t.self}`]};case _s:case hs:return{...e,actions:e.actions.filter((e=>e!==`${t.rel}:${t.self}`))};default:return e}}});(0,k.register)(Ms);const Gs=Ms,Ys="ithemes-security/site-scanner",Ws="/ithemes-security/v1/site-scanner/scans";function*$s(e,t={}){let r,s;yield{type:rn,queryId:e,queryParams:t};try{r=yield M({path:(0,te.addQueryArgs)(Ws,t),parse:!1}),s=yield Z(r)}catch(r){return yield{type:nn,queryId:e,queryParams:t,error:r},r}return yield en(e,t.context||"view",r,s,"replace"),yield{type:sn,queryId:e,queryParams:t,response:r},r}function*Zs(e){const t=yield Y(Ys,"getQueryParams",e);yield*$s(e,t)}function*js(e,t="append"){return yield*Js(e,"prev",t)}function*Ks(e,t="append"){return yield*Js(e,"next",t)}function*Js(e,t,r){const s=yield Y(Ys,"getQueryHeaderLink",e,t);if(!s)return[];let n,i;yield{type:rn,queryId:e};try{n=yield M({url:s.link,parse:!1}),i=yield Z(n)}catch(t){return yield{type:nn,queryId:e,error:t},t}const u=(0,te.getQueryArg)(s.link,"context")||"view";return yield en(e,u,n,i,r),yield{type:sn,queryId:e,response:n},n}function*Xs(e=0){yield{type:on,siteId:e};try{const t=yield M({path:Ws,method:"POST",data:{site_id:e}});return yield zs(t),yield{type:ln,siteId:e},t}catch(e){return yield{type:cn,error:e},e}}function zs(e){return{type:un,scan:e}}function en(e,t,r,s,n){return{type:tn,queryId:e,context:t,response:r,items:s,mode:n}}const tn="RECEIVE_QUERY",rn="START_QUERY",sn="FINISH_QUERY",nn="FAILED_QUERY",un="RECEIVE_SCAN",on="START_SCAN",ln="FINISH_SCAN",cn="FAILED_SCAN",an=(0,k.createRegistrySelector)((e=>()=>e(Ys).getQueryResults("main"))),yn=(0,Ce.Z)(((e,t)=>{const r=(0,w.get)(e,["queries",t,"selves"],[]),s=e.bySelf,n=r.length,i=new Array(n);let u=-1;for(;++u<n;){const e=s[r[u]];e&&(i[u]=e.item)}return i}),((e,t)=>[e.queries[t],e.bySelf]));function dn(e,t,r){return(0,w.find)((0,w.get)(e,["queries",t,"links"],[]),{rel:r})}function fn(e,t,r){return(0,w.filter)((0,w.get)(e,["queries",t,"links"],[]),{rel:r})}function gn(e,t,r){return(0,w.get)(e,["queries",t,"headers",r])}function En(e,t){return(0,w.get)(e,["queryParams",t])}function pn(e,t){return e.bySelf[t]?.item}function mn(e,t){return e.querying.includes(t)}function In(e,t=0){return e.scanning===t}function*Sn(){yield W(Ys,"query","main",{per_page:100})}const _n={bySelf:{},selfById:{},queries:{},queryParams:{},querying:[],scanning:null},hn=(0,k.createReduxStore)(Ys,{actions:I,selectors:S,resolvers:_,controls:ee,reducer:function(e=_n,t){switch(t.type){case tn:return{...e,queries:{...e.queries,[t.queryId]:{selves:"replace"===t.mode?(0,w.map)(t.items,B.AW):[...(0,w.get)(e,["queries",t.queryId,"selves"],[]),...(0,w.map)(t.items,B.AW)],headers:(0,w.fromPairs)(Array.from(t.response.headers.entries())),links:(0,We.parse)(t.response.headers.get("link"),{extended:!0}).map((e=>({...e,rel:e.rel[0]})))}},bySelf:{...e.bySelf,...(0,w.fromPairs)(t.items.filter((r=>{const s=(0,B.AW)(r);return!e.bySelf[s]||"embed"===e.bySelf[s].context||e.bySelf[s].context===t.context})).map((e=>[(0,B.AW)(e),{context:t.context,item:e}])))}};case rn:return{...e,querying:[...e.querying,t.queryId],queryParams:{...e.queryParams,[t.queryId]:t.queryParams||e.queryParams[t.queryId]}};case sn:case nn:return{...e,querying:e.querying.filter((e=>e!==t.queryId))};case un:return{...e,bySelf:{...e.bySelf,[(0,B.AW)(t.scan)]:{context:"edit",item:t.scan}}};case on:return{...e,scanning:t.siteId};case ln:case cn:return{...e,scanning:null};default:return e}}});(0,k.register)(hn);const qn=hn,Tn="ithemes-security/patchstack",An="https://itsec-site-scanner.ithemes.com";function*vn(e,t={}){let r,s;yield{type:xn,queryId:e,queryParams:t},t.per_page=t.per_page||100,t.page=t.page||1;try{if(r=yield $((0,te.addQueryArgs)(An+"/db",t),{credentials:"omit"}),!r.ok)throw yield Z(r);s=yield Z(r)}catch(r){return yield{type:Un,queryId:e,queryParams:t,error:r},r}return yield Qn(e,t.context||"view",r,s,"replace"),yield{type:Ln,queryId:e,queryParams:t,response:r},r}function*Rn(e){const t=yield k.controls.select(Tn,"getQueryParams",e);yield*vn(e,t)}function*bn(e,t="append"){return yield*Nn(e,"prev",t)}function*Pn(e,t="append"){return yield*Nn(e,"next",t)}function*Nn(e,t,r){const s=yield k.controls.select(Tn,"getQueryHeaderLink",e,t);if(!s)return[];let n,i;yield{type:xn,queryId:e};try{n=yield $(An+s.link,{credentials:"omit"}),i=yield Z(n)}catch(t){return yield{type:Un,queryId:e,error:t},t}const u=(0,te.getQueryArg)(s.link,"context")||"view";return yield Qn(e,u,n,i,r),yield{type:Ln,queryId:e,response:n},n}function Qn(e,t,r,s,n){return{type:Cn,queryId:e,context:t,response:r,items:s,mode:n}}const xn="START_QUERY",Ln="FINISH_QUERY",Un="FAILED_QUERY",Cn="RECEIVE_QUERY",Dn=(0,k.createRegistrySelector)((e=>()=>e(Tn).getQueryResults("main")));function Fn(e,t){return e.byId[t]}const On=(0,Ce.Z)(((e,t)=>{const r=(0,w.get)(e,["queries",t,"ids"],[]),s=e.byId,n=r.length,i=new Array(n);let u=-1;for(;++u<n;){const e=s[r[u]];e&&(i[u]=e.item)}return i}),((e,t)=>[e.queries[t],e.byId]));function kn(e,t,r){return(0,w.find)((0,w.get)(e,["queries",t,"links"],[]),{rel:[r]})}function wn(e,t,r){return(0,w.filter)((0,w.get)(e,["queries",t,"links"],[]),{rel:[r]})}function Hn(e,t,r){return(0,w.get)(e,["queries",t,"headers",r])}function Vn(e,t){return(0,w.get)(e,["queryParams",t])}function Bn(e,t){return kn(e,t,"next")}function Mn(e,t){return!!kn(e,t,"prev")}function Gn(e,t){return(0,w.get)(e,["errors",t])}function Yn(e,t){return e.querying.includes(t)}function*Wn(){yield W(Tn,"query","main",{per_page:100})}const $n={byId:{},queries:{},queryParams:{},querying:[],actions:[]},Zn=(0,k.createReduxStore)(Tn,{controls:ee,actions:h,selectors:q,resolvers:T,reducer:function(e=$n,t){switch(t.type){case Cn:return{...e,queries:{...e.queries,[t.queryId]:{ids:"replace"===t.mode?(0,w.map)(t.items,"id"):[...(0,w.get)(e,["queries",t.queryId,"ids"],[]),...(0,w.map)(t.items,"id")],headers:(0,w.fromPairs)(Array.from(t.response.headers.entries())),links:(0,We.parse)(t.response.headers.get("link"),{extended:!0})}},byId:{...e.byId,...(0,w.fromPairs)(t.items.filter((r=>{const s=r.id;return!e.byId[s]||"embed"===e.byId[s].context||e.byId[s].context===t.context})).map((e=>[e.id,{context:t.context,item:e}])))}};case xn:return{...e,querying:[...e.querying,t.queryId],queryParams:{...e.queryParams,[t.queryId]:t.queryParams||e.queryParams[t.queryId]},errors:(0,w.omit)(e.errors,[t.queryId])};case Ln:return{...e,querying:e.querying.filter((e=>e!==t.queryId))};case Un:return{...e,querying:e.querying.filter((e=>e!==t.queryId)),errors:{...e.errors,[t.queryId]:t.error}};default:return e}}});(0,k.register)(Zn);const jn=Zn;var Kn=r(25703);const Jn="ithemes-security/users",Xn="/wp/v2/users",zn="/ithemes-security/v1/user-actions";function*ei(e,t={}){let r,s;yield{type:Ii,queryId:e,queryParams:t};try{r=yield M({path:(0,te.addQueryArgs)(Xn,t),parse:!1}),s=yield Z(r)}catch(r){return yield{type:_i,queryId:e,queryParams:t,error:r},r}return yield ii(e,t.context||"view",r,s,"replace"),yield{type:Si,queryId:e,queryParams:t,response:r},r}function*ti(e){const t=yield Y(Jn,"getQueryParams",e);yield*ei(e,t)}function*ri(e,t="append"){return yield*ni(e,"prev",t)}function*si(e,t="append"){return yield*ni(e,"next",t)}function*ni(e,t,r){const s=yield Y(Jn,"getQueryHeaderLink",e,t);if(!s)return[];let n,i;yield{type:Ii,queryId:e};try{n=yield M({url:s.link,parse:!1}),i=yield Z(n)}catch(t){return yield{type:_i,queryId:e,error:t},t}const u=(0,te.getQueryArg)(s.link,"context")||"view";return yield ii(e,u,n,i,r),yield{type:Si,queryId:e,response:n},n}function ii(e,t,r,s,n){return{type:mi,queryId:e,context:t,response:r,items:s,mode:n}}function ui(e){return{type:Ai,user:e}}function*oi(e,t,r){const s=yield Y(Jn,"getQueryParams",e),n=e;yield{type:hi,id:n};try{const e=yield M({path:zn,method:"POST",data:{query:s,mode:t,actions:r}});return yield{type:qi,id:n},yield{type:Ni},yield{type:xi},yield ci(),e}catch(e){return yield{type:Ti,id:n,error:e},e}}function*li(e,t,r){yield{type:hi,id:r};try{const s=yield M({path:zn,method:"POST",data:{users:e,actions:t}});return yield{type:qi,id:r},yield{type:Ni},yield{type:xi},yield ci(),s}catch(e){return yield{type:Ti,id:r,error:e},e}}function ci(){return k.controls.dispatch(Kn.store,"createNotice","info",(0,ot.__)("Quick edits are being applied in the background. This may take a few moments.","better-wp-security"),{id:"user_security_quick_edits_success",type:"snackbar",context:"ithemes-security"})}function*ai(e){switch(e){case"all":yield k.controls.dispatch(Kn.store,"createNotice","info",(0,ot.__)("All users from the query are selected","better-wp-security"),{id:"user_security_all_selected",type:"snackbar",context:"ithemes-security"});break;case"window":yield k.controls.dispatch(Kn.store,"createNotice","info",(0,ot.__)("Only the current page of users from the query are selected","better-wp-security"),{id:"user_security_page_selected",type:"snackbar",context:"ithemes-security"});break;case"none":yield k.controls.dispatch(Kn.store,"createNotice","info",(0,ot.__)("None of the users from the query are selected","better-wp-security"),{id:"user_security_none_selected",type:"snackbar",context:"ithemes-security"}),yield{type:xi}}yield{type:vi,userSelectionType:e}}function yi(){return{type:bi}}function di(e){return{type:Ri,user:e}}function fi(){return{type:xi}}function gi(){return{type:Pi}}function Ei(){return{type:Ni}}function pi(){return{type:Qi}}const mi="RECEIVE_QUERY",Ii="START_QUERY",Si="FINISH_QUERY",_i="FAILED_QUERY",hi="START_ACTION",qi="FINISH_ACTION",Ti="FAILED_ACTION",Ai="RECEIVE_USER",vi="UPDATE_SELECTION_TYPE",Ri="TOGGLE_SELECTED_USER",bi="TOGGLE_SELECT_ALL",Pi="OPEN_QUICK_EDIT",Ni="CLOSE_QUICK_EDIT",Qi="CONFIRM_QUICK_EDIT",xi="REMOVE_SELECTED_USERS",Li=(0,k.createRegistrySelector)((e=>()=>e(Jn).getQueryResults("main"))),Ui=(0,Ce.Z)(((e,t)=>{const r=(0,w.get)(e,["queries",t,"selves"],[]),s=e.bySelf,n=r.length,i=new Array(n);let u=-1;for(;++u<n;){const e=s[r[u]];e&&(i[u]=e.item)}return i}),((e,t)=>[e.queries[t],e.bySelf]));function Ci(e,t,r){return(0,w.find)((0,w.get)(e,["queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function Di(e,t,r){return(0,w.filter)((0,w.get)(e,["queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function Fi(e,t){return!!Ci(e,t,"prev")}function Oi(e,t){return!!Ci(e,t,"next")}function ki(e,t,r){return(0,w.get)(e,["queries",t,"headers",r])}function wi(e,t){return(0,w.get)(e,["queryParams",t])}function Hi(e,t){return e.bySelf[t]?.item}function Vi(e,t){return Hi(e,e.selfById[t])}function Bi(e){return e.userSelection}function Mi(e,t){return e.actions.includes(t)}function Gi(e,t){return e.actionErrors[t]}function Yi(e){return e.selectedUsers}function Wi(e){const t=Ui(e,"main");return e.selectedUsers.length===t.length?"checked":e.selectedUsers.length>0?"indeterminate":"unchecked"}function $i(e,t){return e.querying.includes(t)}function Zi(e,t){return e.selectedUsers.includes(t)}function ji(e){return e.quickEditState}function Ki(e){return e.actions}function*Ji(){yield W(Jn,"query","main",{per_page:20,context:"edit",roles:["administrator"]})}function*Xi(e){const t=yield M({path:`${Xn}/${e}?context=edit`});return yield ui(t),t}const zi={bySelf:{},selfById:{},userSelection:"window",queries:{},queryParams:{},querying:[],actions:[],actionErrors:{},selectedUsers:[],quickEditState:!1},eu=(0,k.createReduxStore)(Jn,{actions:A,selectors:v,resolvers:R,controls:ee,reducer:function(e=zi,t){switch(t.type){case mi:return{...e,queries:{...e.queries,[t.queryId]:{selves:"replace"===t.mode?(0,w.map)(t.items,B.AW):[...(0,w.get)(e,["queries",t.queryId,"selves"],[]),...(0,w.map)(t.items,B.AW)],headers:(0,w.fromPairs)(Array.from(t.response.headers.entries())),links:(0,We.parse)(t.response.headers.get("link"),{extended:!0})}},bySelf:{...e.bySelf,...(0,w.fromPairs)(t.items.filter((r=>{const s=(0,B.AW)(r);return!e.bySelf[s]||"embed"===e.bySelf[s].context||e.bySelf[s].context===t.context})).map((e=>[(0,B.AW)(e),{context:t.context,item:e}])))},selfById:{...e.selfById,...(0,w.fromPairs)(t.items.map((e=>[e.id,(0,B.AW)(e)])))},selectedUsers:"main"===t.queryId?[]:e.selectedUsers};case Ii:return{...e,querying:[...e.querying,t.queryId],queryParams:{...e.queryParams,[t.queryId]:t.queryParams||e.queryParams[t.queryId]}};case Si:case _i:return{...e,querying:e.querying.filter((e=>e!==t.queryId))};case Ai:return{...e,bySelf:{...e.bySelf,[(0,B.AW)(t.user)]:{context:"edit",item:t.user}},selfById:{...e.selfById,[t.user.id]:(0,B.AW)(t.user)}};case vi:return{...e,userSelection:t.userSelectionType};case bi:const r=Ui(e,"main");return e.selectedUsers.length===r.length?{...e,selectedUsers:[]}:{...e,selectedUsers:r.map((e=>e.id))};case Ri:return e.selectedUsers.includes(t.user.id)?{...e,selectedUsers:e.selectedUsers.filter((e=>e!==t.user.id)),userSelection:"all"}:{...e,selectedUsers:[...e.selectedUsers,t.user.id],userSelection:"window"};case xi:return{...e,selectedUsers:[],userSelection:"none"};case Pi:return{...e,quickEditState:!0};case Ni:return{...e,quickEditState:!1};case Qi:return{...e,quickEditState:"confirm"};case hi:return{...e,actions:[...e.actions,t.id],actionErrors:(0,w.omit)(e.actionErrors,t.id)};case qi:return{...e,actions:e.actions.filter((e=>e!==t.id))};case Ti:return{...e,actions:e.actions.filter((e=>e!==t.id)),actionErrors:{...e.actionErrors,[t.id]:t.error}};default:return e}}});(0,k.register)(eu);const tu=eu,ru="ithemes-security/firewall",su="/ithemes-security/v1/firewall/rules",nu=(e,t={})=>async({dispatch:r})=>{let s,n;r({type:Iu,queryId:e,queryParams:t});try{s=await V()({path:(0,te.addQueryArgs)(su,t),parse:!1}),n=await s.json()}catch(s){return r({type:_u,queryId:e,queryParams:t,error:s}),s}return r(Eu(e,t.context||"view",s,n,"replace")),r({type:Su,queryId:e,queryParams:t,response:s}),n},iu=e=>async({select:t,dispatch:r})=>{const s=t.getQueryParams(e);r.query(e,s)},uu=(e,t="append")=>(...r)=>lu(e,"prev",t)(...r),ou=(e,t="append")=>(...r)=>lu(e,"next",t)(...r),lu=(e,t,r)=>async({select:s,dispatch:n})=>{const i=s.getQueryHeaderLink(e,t);if(!i)return[];let u,o;n({type:Iu,queryId:e});try{u=await V()({url:i.link,parse:!1}),o=await u.json()}catch(t){return n({type:_u,queryId:e,error:t}),t}const l=(0,te.getQueryArg)(i.link,"context")||"view";return n(Eu(e,l,u,o,r)),n({type:Su,queryId:e,response:u}),u},cu=(e,t)=>async({select:r,dispatch:s})=>{const n=r.getItem(e),i=r.getEditedItem(e);(0,w.isEqual)(n,{...i,...t})?s({type:"RESET_EDITS",self:e}):s({type:"EDIT_ITEM",self:e,edit:t})};function au(e){return{type:"RESET_EDITS",self:e}}function yu(){return{type:"RESET_ALL_EDITS"}}const du=e=>async({select:t,dispatch:r})=>{const s=t.getEditedItem(e);if(!s||!t.isDirty(e))return s;const n=await r.saveItem(s);return r(au(e)),n},fu=e=>async({dispatch:t})=>{const r=(0,B.AW)(e);r&&t({type:"START_SAVING",self:r});try{const s=await V()({url:r,path:!r&&su,method:r?"PUT":"POST",data:e});return t({type:"RECEIVE_ITEM",item:s}),r&&t({type:"FINISH_SAVING",self:r}),s}catch(e){throw r&&t({type:"FAILED_SAVING",self:r,error:e}),e}},gu=e=>async({dispatch:t})=>{t({type:"START_DELETING",self:e});try{await V()({url:e,method:"DELETE"}),t({type:"FINISH_DELETING",self:e})}catch(r){t({type:"FAILED_DELETING",self:e,error:r})}};function Eu(e,t,r,s,n){return{type:pu,queryId:e,context:t,response:r,items:s,mode:n}}const pu="RECEIVE_QUERY",mu="RECEIVE_ITEM",Iu="START_QUERY",Su="FINISH_QUERY",_u="FAILED_QUERY",hu=(0,k.createRegistrySelector)((e=>()=>e(ru).getQueryResults("main"))),qu=(0,Ce.Z)(((e,t)=>{const r=(0,w.get)(e,["query","queries",t,"selves"],[]),s=e.query.bySelf,n=r.length,i=new Array(n);let u=-1;for(;++u<n;){const e=s[r[u]];e&&(i[u]=e.item)}return i}),((e,t)=>[e.query.queries[t],e.query.bySelf]));function Tu(e,t,r){return(0,w.find)((0,w.get)(e,["query","queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function Au(e,t,r){return(0,w.filter)((0,w.get)(e,["query","queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function vu(e,t){return!!Tu(e,t,"prev")}function Ru(e,t){return!!Tu(e,t,"next")}function bu(e,t,r){return(0,w.get)(e,["query","queries",t,"headers",r])}function Pu(e,t){return(0,w.get)(e,["query","queryParams",t])}function Nu(e,t){return e.query.bySelf[t]?.item}function Qu(e,t){return Nu(e,e.query.selfById[t])}function xu(e,t){return e.query.querying.includes(t)}const Lu=(0,Ce.Z)(((e,t)=>e.query.bySelf[t]?.item&&{...e.query.bySelf[t].item,...e.edits.bySelf[t]||{}}),((e,t)=>[e.edits.bySelf[t],e.query.bySelf[t]]));function Uu(e,t){return void 0!==e.edits.bySelf[t]}function Cu(e,t){const r="string"==typeof t?t:(0,B.AW)(t);return e.saving.selves.includes(r)}function Du(e,t){const r="string"==typeof t?t:(0,B.AW)(t);return e.deleting.selves.includes(r)}function Fu(e,t){const r="string"==typeof t?t:(0,B.AW)(t);return e.saving.errors[r]}function Ou(e,t){const r="string"==typeof t?t:(0,B.AW)(t);return e.deleting.errors[r]}const ku=()=>async({dispatch:e})=>{await e.query("main",{per_page:100,paused:"false"})},wu={fulfill:e=>async({dispatch:t})=>{t({type:"RECEIVE_ITEM",item:await V()({url:(0,te.addQueryArgs)(e,{context:"edit"})})})},isFulfilled:(e,t)=>"edit"===e.query.bySelf[t]?.context},Hu={fulfill:e=>async({dispatch:t})=>{t({type:"RECEIVE_ITEM",item:await V()({path:`${su}/${e}?context=edit`})})},isFulfilled:(e,t)=>!!e.query.selfById[t]},Vu={bySelf:{},selfById:{},queries:{},queryParams:{},querying:[]},Bu={bySelf:{}},Mu={selves:[],errors:{}},Gu=(0,k.combineReducers)({query:function(e=Vu,t){switch(t.type){case pu:return{...e,queries:{...e.queries,[t.queryId]:{selves:"replace"===t.mode?(0,w.map)(t.items,B.AW):[...(0,w.get)(e,["queries",t.queryId,"selves"],[]),...(0,w.map)(t.items,B.AW)],headers:(0,w.fromPairs)(Array.from(t.response.headers.entries())),links:(0,We.parse)(t.response.headers.get("link"),{extended:!0})}},bySelf:{...e.bySelf,...(0,w.fromPairs)(t.items.filter((r=>{const s=(0,B.AW)(r);return!e.bySelf[s]||"embed"===e.bySelf[s].context||e.bySelf[s].context===t.context})).map((e=>[(0,B.AW)(e),{context:t.context,item:e}])))},selfById:{...e.selfById,...(0,w.fromPairs)(t.items.map((e=>[e.id,(0,B.AW)(e)])))}};case Iu:return{...e,querying:[...e.querying,t.queryId],queryParams:{...e.queryParams,[t.queryId]:t.queryParams||e.queryParams[t.queryId]}};case Su:case _u:return{...e,querying:e.querying.filter((e=>e!==t.queryId))};case mu:return{...e,bySelf:{...e.bySelf,[(0,B.AW)(t.item)]:{context:"edit",item:t.item}},selfById:{...e.selfById,[t.item.id]:(0,B.AW)(t.item)}};case"FINISH_DELETING":return{...e,bySelf:(0,w.omit)(e.bySelf,t.self),selfById:(0,w.omitBy)(e.selfById,(e=>e===t.self))};default:return e}},edits:function(e=Bu,t){switch(t.type){case"EDIT_ITEM":return{...e,bySelf:{...e.bySelf,[t.self]:{...e.bySelf[t.self]||{},...t.edit}}};case"RESET_EDITS":case"FINISH_DELETING":return{...e,bySelf:(0,w.omit)(e.bySelf,t.self)};case"RESET_ALL_EDITS":return{...e,bySelf:{}};default:return e}},saving:function(e=Mu,t){switch(t.type){case"START_SAVING":return{...e,selves:[...e.selves,t.self],errors:(0,w.omit)(e.errors,t.self)};case"FINISH_SAVING":return{...e,selves:e.selves.filter((e=>t.self!==e))};case"FAILED_SAVING":return{...e,selves:e.selves.filter((e=>t.self!==e)),errors:{...e.errors,[t.self]:t.error}};default:return e}},deleting:function(e=Mu,t){switch(t.type){case"START_DELETING":return{...e,selves:[...e.selves,t.self],errors:(0,w.omit)(e.errors,t.self)};case"FINISH_DELETING":return{...e,selves:e.selves.filter((e=>t.self!==e))};case"FAILED_DELETING":return{...e,selves:e.selves.filter((e=>t.self!==e)),errors:{...e.errors,[t.self]:t.error}};default:return e}}}),Yu=(0,k.createReduxStore)(ru,{actions:b,selectors:P,resolvers:N,reducer:Gu,controls:ee});(0,k.register)(Yu);const Wu=Yu,$u="ithemes-security/logs",Zu="/ithemes-security/v1/logs";function*ju(e,t={}){let r,s;yield{type:so,queryId:e,queryParams:t};try{r=yield M({path:(0,te.addQueryArgs)(Zu,t),parse:!1}),s=yield Z(r)}catch(r){return yield{type:io,queryId:e,queryParams:t,error:r},r}return yield eo(e,t.context||"view",r,s,"replace"),yield{type:no,queryId:e,queryParams:t,response:r},s}function*Ku(e){const t=yield Y($u,"getQueryParams",e);yield*ju(e,t)}function*Ju(e,t="append"){return yield*zu(e,"prev",t)}function*Xu(e,t="append"){return yield*zu(e,"next",t)}function*zu(e,t,r){const s=yield Y($u,"getQueryHeaderLink",e,t);if(!s)return[];let n,i;yield{type:so,queryId:e};try{n=yield M({url:s.link,parse:!1}),i=yield Z(n)}catch(t){return yield{type:io,queryId:e,error:t},t}const u=(0,te.getQueryArg)(s.link,"context")||"view";return yield eo(e,u,n,i,r),yield{type:no,queryId:e,response:n},n}function eo(e,t,r,s,n){return{type:ro,queryId:e,context:t,response:r,items:s,mode:n}}function to(e){return{type:uo,log:e}}const ro="RECEIVE_QUERY",so="START_QUERY",no="FINISH_QUERY",io="FAILED_QUERY",uo="RECEIVE_LOG",oo=(0,k.createRegistrySelector)((e=>()=>e($u).getQueryResults("main"))),lo=(0,Ce.Z)(((e,t)=>{const r=(0,w.get)(e,["queries",t,"selves"],[]),s=e?.bySelf,n=r.length,i=new Array(n);let u=-1;for(;++u<n;){const e=s[r[u]];e&&(i[u]=e.item)}return i}),((e,t)=>[e?.queries[t],e?.bySelf]));function co(e,t,r){return(0,w.find)((0,w.get)(e,["queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function ao(e,t,r){return(0,w.filter)((0,w.get)(e,["queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function yo(e,t){return!!co(e,t,"prev")}function fo(e,t){return!!co(e,t,"next")}function go(e,t,r){return(0,w.get)(e,["queries",t,"headers",r])}function Eo(e,t){return(0,w.get)(e,["queryParams",t])}function po(e,t){return e.querying.includes(t)}function mo(e,t){return e.bySelf[t]?.item}function Io(e,t){return mo(e,e.selfById[t])}function*So(){yield W($u,"query","main",{per_page:100})}function*_o(e){const t=yield M({path:`${Zu}/${e}`});return yield to(e),t}const ho={bySelf:{},selfById:{},queries:{},queryParams:{},querying:[]},qo=(0,k.createReduxStore)($u,{actions:Q,selectors:x,resolvers:L,controls:ee,reducer:function(e=ho,t){switch(t.type){case ro:return{...e,queries:{...e.queries,[t.queryId]:{selves:"replace"===t.mode?(0,w.map)(t.items,B.AW):[...(0,w.get)(e,["queries",t.queryId,"selves"],[]),...(0,w.map)(t.items,B.AW)],headers:(0,w.fromPairs)(Array.from(t.response.headers.entries())),links:(0,We.parse)(t.response.headers.get("link"),{extended:!0})}},bySelf:{...e.bySelf,...(0,w.fromPairs)(t.items.filter((r=>{const s=(0,B.AW)(r);return!e.bySelf[s]||"embed"===e.bySelf[s].context||e.bySelf[s].context===t.context})).map((e=>[(0,B.AW)(e),{context:t.context,item:e}])))},selfById:{...e.selfById,...(0,w.fromPairs)(t.items.map((e=>[e.id,(0,B.AW)(e)])))}};case so:return{...e,querying:[...e.querying,t.queryId],queryParams:{...e.queryParams,[t.queryId]:t.queryParams||e.queryParams[t.queryId]}};case no:case io:return{...e,querying:e.querying.filter((e=>e!==t.queryId))};case uo:return{...e,bySelf:{...e.bySelf,[(0,B.AW)(t.log)]:{context:"edit",item:t.log}},selfById:{...e.selfById,[t.log.id]:(0,B.AW)(t.log)}};default:return e}}});(0,k.register)(qo);const To=qo,Ao="/ithemes-security/v1/trusted-devices",vo=(e,t,r={})=>async({dispatch:s})=>{let n,i;s({type:wo,queryId:e,userId:t,queryParams:r});try{n=await V()({path:(0,te.addQueryArgs)(Ao+"/"+t,r),parse:!1}),i=await n.json()}catch(t){return s({type:Vo,queryId:e,queryParams:r,error:t}),t}return s(Fo(e,r.context||"view",n,i,"replace")),s({type:Ho,queryId:e,queryParams:r,response:n}),i},Ro=e=>async({select:t,dispatch:r})=>{const s=t.getQueryUser(e),n=t.getQueryParams(e);r.query(e,s,n)},bo=(e,t="append")=>(...r)=>No(e,"prev",t)(...r),Po=(e,t="append")=>(...r)=>No(e,"next",t)(...r),No=(e,t,r)=>async({select:s,dispatch:n})=>{const i=s.getQueryHeaderLink(e,t);if(!i)return[];let u,o;n({type:wo,queryId:e});try{u=await V()({url:i.link,parse:!1}),o=await u.json()}catch(t){return n({type:Vo,queryId:e,error:t}),t}const l=(0,te.getQueryArg)(i.link,"context")||"view";return n(Fo(e,l,u,o,r)),n({type:Ho,queryId:e,response:u}),u},Qo=(e,t)=>async({select:r,dispatch:s})=>{const n=r.getItem(e),i=r.getEditedItem(e);(0,w.isEqual)(n,{...i,...t})?s({type:"RESET_EDITS",self:e}):s({type:"EDIT_ITEM",self:e,edit:t})};function xo(e){return{type:"RESET_EDITS",self:e}}function Lo(){return{type:"RESET_ALL_EDITS"}}const Uo=e=>async({select:t,dispatch:r})=>{const s=t.getEditedItem(e);if(!s||!t.isDirty(e))return s;const n=await r.saveItem(s);return r(xo(e)),n},Co=(e=!0)=>async({dispatch:t,registry:r,select:s})=>{!0===e&&(e=s.getDirtyItems());const n=e.map((e=>({method:"PUT",path:(0,B.YS)(e),body:s.getEditedItem(e)})));e.forEach((e=>t({type:"START_SAVING",self:e})));const i=await async function(e,t){const r=await e.resolveSelect(Gt).getBatchMaxItems(),s=(0,w.chunk)(t,r||25),n=[];if(!s.length)return[];for(const e of s)try{const t=await V()({path:"/batch/v1",method:"POST",data:{requests:e}});n.push(...t.responses)}catch(t){n.push(...(0,w.times)(e.length,(0,w.constant)({body:t,status:500,headers:{}})))}return n}(r,n);for(let r=0;r<n.length;r++){const s=e[r],n=i[r];n.status>=400?t({type:"FAILED_SAVING",self:s,error:n.body}):(t({type:"FINISH_SAVING",self:s}),t({type:ko,item:n.body}))}return i},Do=e=>async({dispatch:t})=>{const r=(0,B.AW)(e);r&&t({type:"START_SAVING",self:r});try{const s=await V()({url:r,path:!r&&Ao,method:r?"PUT":"POST",data:e});return t({type:"RECEIVE_ITEM",item:s}),r&&t({type:"FINISH_SAVING",self:r}),s}catch(e){throw r&&t({type:"FAILED_SAVING",self:r,error:e}),e}};function Fo(e,t,r,s,n){return{type:Oo,queryId:e,context:t,response:r,items:s,mode:n}}const Oo="RECEIVE_QUERY",ko="RECEIVE_ITEM",wo="START_QUERY",Ho="FINISH_QUERY",Vo="FAILED_QUERY",Bo=(0,Ce.Z)(((e,t)=>{const r=(0,w.get)(e,["query","queries",t,"selves"],[]),s=e.query.bySelf,n=r.length,i=new Array(n);let u=-1;for(;++u<n;){const e=s[r[u]];e&&(i[u]=e.item)}return i}),((e,t)=>[e.query.queries[t],e.query.bySelf]));function Mo(e,t,r){return(0,w.find)((0,w.get)(e,["query","queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function Go(e,t,r){return(0,w.filter)((0,w.get)(e,["query","queries",t,"links"],[]),{rel:(0,w.castArray)(r)})}function Yo(e,t){return!!Mo(e,t,"prev")}function Wo(e,t){return!!Mo(e,t,"next")}function $o(e,t,r){return(0,w.get)(e,["query","queries",t,"headers",r])}function Zo(e,t){return(0,w.get)(e,["query","queryParams",t])}function jo(e,t){return(0,w.get)(e,["query","users",t])}function Ko(e,t){return e.query.bySelf[t]?.item}function Jo(e,t){return Ko(e,e.query.selfById[t])}function Xo(e,t){return e.query.querying.includes(t)}const zo=(0,Ce.Z)(((e,t)=>e.query.bySelf[t]?.item&&{...e.query.bySelf[t].item,...e.edits.bySelf[t]||{}}),((e,t)=>[e.edits.bySelf[t],e.query.bySelf[t]])),el=(0,Ce.Z)((e=>(0,w.reduce)(e.edits.bySelf,((e,t,r)=>((0,w.isEmpty)(t)||e.push(r),e)),[])),(e=>[e.edits]));function tl(e,t){return void 0!==e.edits.bySelf[t]}function rl(e,t){const r="string"==typeof t?t:(0,B.AW)(t);return e.saving.selves.includes(r)}function sl(e){return e.saving.selves.length>0}function nl(e,t){const r="string"==typeof t?t:(0,B.AW)(t);return e.saving.errors[r]}const il={bySelf:{},selfById:{},queries:{},queryParams:{},users:{},querying:[]},ul={bySelf:{}},ol={selves:[],errors:{}},ll=(0,k.combineReducers)({query:function(e=il,t){switch(t.type){case Oo:return{...e,queries:{...e.queries,[t.queryId]:{selves:"replace"===t.mode?(0,w.map)(t.items,B.AW):[...(0,w.get)(e,["queries",t.queryId,"selves"],[]),...(0,w.map)(t.items,B.AW)],headers:(0,w.fromPairs)(Array.from(t.response.headers.entries())),links:(0,We.parse)(t.response.headers.get("link"),{extended:!0})}},bySelf:{...e.bySelf,...(0,w.fromPairs)(t.items.filter((r=>{const s=(0,B.AW)(r);return!e.bySelf[s]||"embed"===e.bySelf[s].context||e.bySelf[s].context===t.context})).map((e=>[(0,B.AW)(e),{context:t.context,item:e}])))},selfById:{...e.selfById,...(0,w.fromPairs)(t.items.map((e=>[e.id,(0,B.AW)(e)])))}};case wo:return{...e,querying:[...e.querying,t.queryId],queryParams:{...e.queryParams,[t.queryId]:t.queryParams||e.queryParams[t.queryId]},users:{...e.users,[t.queryId]:t.userId}};case Ho:case Vo:return{...e,querying:e.querying.filter((e=>e!==t.queryId))};case ko:return{...e,bySelf:{...e.bySelf,[(0,B.AW)(t.item)]:{context:"edit",item:t.item}},selfById:{...e.selfById,[t.item.id]:(0,B.AW)(t.item)}};default:return e}},edits:function(e=ul,t){switch(t.type){case"EDIT_ITEM":return{...e,bySelf:{...e.bySelf,[t.self]:{...e.bySelf[t.self]||{},...t.edit}}};case"RESET_EDITS":return{...e,bySelf:(0,w.omit)(e.bySelf,t.self)};case"RESET_ALL_EDITS":return{...e,bySelf:{}};default:return e}},saving:function(e=ol,t){switch(t.type){case"START_SAVING":return{...e,selves:[...e.selves,t.self],errors:(0,w.omit)(e.errors,t.self)};case"FINISH_SAVING":return{...e,selves:e.selves.filter((e=>t.self!==e))};case"FAILED_SAVING":return{...e,selves:e.selves.filter((e=>t.self!==e)),errors:{...e.errors,[t.self]:t.error}};default:return e}}}),cl=(0,k.createReduxStore)("ithemes-security/trusted-devices",{actions:U,selectors:C,reducer:ll,controls:ee});(0,k.register)(cl);const al=cl,yl=(0,Ce.Z)(((e,t)=>e.users.optimisticEdits[t]?(0,w.merge)((0,w.cloneDeep)(e.users.byId[t]),e.users.optimisticEdits[t]):e.users.byId[t]),((e,t)=>[e.users.byId[t],e.users.optimisticEdits[t]]));function dl(e){return yl(e,fl(e))}function fl(e){return e.users.currentId}function gl(e,t){return e.users.saving.includes(t)}function El(e){return gl(e,e.users.currentId)}function pl(e){return e.index}function ml(e,t){const r=e.index;return r?(0,w.find)(r.routes,(e=>e?.schema?.title===t))?.schema:null}function Il(e){return e.index?.roles||null}function Sl(e){return e.index?.requirements_info||null}function _l(e){return e.actors.types}function hl(e,t){return e.actors.byType[t]}function ql(e){return e.siteInfo}const Tl=(0,k.createRegistrySelector)((e=>t=>e(lt).getSetting("feature-flags","enabled")||t.featureFlags));function Al(e){return e.batchMaxItems}function vl(e){return e.index?.server_type||null}function Rl(e){return e.index?.install_type||null}function bl(e){return e.index?.has_patchstack||null}function Pl(e){return e.index?.is_lw_customer||null}function*Nl(e=!1){let t="/ithemes-security/v1?context=help";e&&(t+="&_="+Date.now());const r=yield M({path:t});return yield Ql(r),r}function Ql(e){return{type:Vl,index:e}}function*xl(e,t=!1){yield*Ll("me",e,t)}function*Ll(e,t,r=!1){const s=yield Y("ithemes-security/core","getCurrentUserId");"me"===e&&(e=s);const n=`/wp/v2/users/${e===s?"me":e}`;yield{type:"START_SAVING_USER",id:e,data:t,optimistic:r};try{const r=yield M({method:"PUT",path:n,data:t});yield Cl(r),yield{type:"FINISH_SAVING_USER",id:e,user:r}}catch(t){yield{type:"FAILED_SAVING_USER",id:e,error:t}}}function*Ul(e){const t=yield Y("ithemes-security/core","getCurrentUserId"),r=yield M({path:`/wp/v2/users/${e===t?"me":e}?context=edit`});yield Cl(r)}function Cl(e){return{type:Bl,user:e}}function Dl(e){return{type:Ml,userId:e}}function Fl(e){return{type:Gl,types:e}}function Ol(e,t){return{type:Yl,actorType:e,actors:t}}function kl(e){return{type:Wl,siteInfo:e}}function wl(e){return{type:$l,flags:e}}function Hl(e){return{type:Zl,maxItems:e}}const Vl="RECEIVE_INDEX",Bl="RECEIVE_USER",Ml="RECEIVE_CURRENT_USER_ID",Gl="RECEIVE_ACTOR_TYPES",Yl="RECEIVE_ACTORS",Wl="RECEIVE_SITE_INFO",$l="LOAD_INITIAL_FEATURE_FLAGS",Zl="RECEIVE_BATCH_MAX_ITEMS";function*jl(){const e=yield M({path:"/ithemes-security/v1?context=help"});yield Ql(e)}const Kl=()=>({resolveSelect:e})=>e.getIndex(),Jl=()=>({resolveSelect:e})=>e.getIndex(),Xl=()=>({resolveSelect:e})=>e.getIndex(),zl=()=>({resolveSelect:e})=>e.getIndex(),ec=()=>({resolveSelect:e})=>e.getIndex(),tc=()=>({resolveSelect:e})=>e.getIndex(),rc=()=>({resolveSelect:e})=>e.getIndex(),sc={*fulfill(e){const t=yield k.controls.select("ithemes-security/core","getCurrentUserId"),r=yield M({path:`/wp/v2/users/${e===t?"me":e}?context=edit`});yield Cl(r)},isFulfilled:(e,t)=>!!e.users.byId[t]},nc={*fulfill(){const e=yield M({path:"/wp/v2/users/me?context=edit"});yield Cl(e),yield Dl(e.id)},isFulfilled:e=>e.users.currentId&&e.users.byId[e.users.currentId]},ic={*fulfill(){const e=yield M({path:"/ithemes-security/v1/actors?_embed=1"}),t=[];for(const r of e){const e=(0,w.get)(r,["_embedded","wp:items",0],[]);yield Ol(r.slug,e),t.push({slug:r.slug,label:r.label})}yield Fl(t)},isFulfilled:e=>e.actors.types.length>0},uc={*fulfill(){yield k.controls.select("ithemes-security/core","getActorTypes")},isFulfilled:(e,t)=>!!e.actors.byType[t]},oc={*fulfill(){const e=yield M({path:"/?_fields=name,description,url,home,multisite"});yield kl(e)},isFulfilled:e=>!!e.siteInfo};function*lc(){const e=yield M({path:"/batch/v1",method:"OPTIONS"});yield Hl(e.endpoints[0].args.requests.maxItems)}const cc={users:{currentId:0,byId:{},saving:[],optimisticEdits:{}},index:null,actors:{types:[],byType:{}},siteInfo:null,featureFlags:[],batchMaxItems:0};r.p=window.itsecWebpackPublicPath;const ac=(0,k.createReduxStore)(Gt,{controls:ee,selectors:D,resolvers:O,actions:F,reducer:function(e=cc,t){switch(t.type){case Vl:return{...e,index:t.index};case"START_SAVING_USER":return{...e,users:{...e.users,saving:[...e.users.saving,t.id],optimisticEdits:t.optimistic?{...e.users.optimisticEdits,[t.id]:t.data}:e.users.optimisticEdits}};case"FINISH_SAVING_USER":case"FAILED_SAVING_USER":return{...e,users:{...e.users,saving:e.users.saving.filter((e=>e!==t.id)),optimisticEdits:(0,w.omit)(e.users.optimisticEdits,t.id)}};case Bl:return{...e,users:{...e.users,byId:{...e.users.byId,[t.user.id]:t.user}}};case Ml:return{...e,users:{...e.users,currentId:t.userId}};case Gl:return{...e,actors:{...e.actors,types:t.types}};case Yl:return{...e,actors:{...e.actors,byType:{...e.actors.byType,[t.actorType]:t.actors}}};case Wl:return{...e,siteInfo:t.siteInfo};case $l:return{...e,featureFlags:t.flags};case Zl:return{...e,batchMaxItems:t.maxItems};default:return e}}});(0,k.register)(ac)},87514:e=>{e.exports=function(){return this.wp.apiFetch}()},48015:e=>{e.exports=function(){return this.wp.data}()},6293:e=>{e.exports=function(){return this.wp.element}()},95122:e=>{e.exports=function(){return this.wp.i18n}()},25703:e=>{e.exports=function(){return this.wp.notices}()},73470:e=>{e.exports=function(){return this.wp.url}()},92819:e=>{"use strict";e.exports=window.lodash}},e=>{e.O(0,[5307,761,1511],(()=>(19169,e(e.s=19169))));var t=e.O();((window.itsec=window.itsec||{}).packages=window.itsec.packages||{}).data=t}]);