File "admin-notices-api.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/better-wp-security/dist/core/admin-notices-api.js
File size: 5.3 KB
MIME-type: text/plain
Charset: utf-8
(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[8689],{76864:(t,e,i)=>{"use strict";i.r(e),i.d(e,{store:()=>Z});var n={};i.r(n),i.d(n,{FAILED_NOTICE_ACTION:()=>D,FAILED_UPDATE_MUTED_HIGHLIGHT:()=>v,FINISH_NOTICE_ACTION:()=>C,FINISH_UPDATE_MUTED_HIGHLIGHT:()=>S,RECEIVE_MUTED_HIGHLIGHTS:()=>O,RECEIVE_NOTICES:()=>N,START_NOTICE_ACTION:()=>U,START_UPDATE_MUTED_HIGHLIGHT:()=>F,doNoticeAction:()=>_,failedNoticeAction:()=>T,failedUpdateMutedHighlight:()=>E,finishNoticeAction:()=>p,finishUpdateMutedHighlight:()=>f,receiveMutedHighlights:()=>H,receiveNotices:()=>I,startNoticeAction:()=>m,startUpdateMutedHighlight:()=>y,updateMutedHighlight:()=>A});var s={};i.r(s),i.d(s,{areNoticesLoaded:()=>R,getInProgressActions:()=>x,getMutedHighlightUpdatesInFlight:()=>V,getMutedHighlights:()=>k,getNotices:()=>M,isDoingAction:()=>L,isNoticeDismissed:()=>P,isResolved:()=>G,isResolving:()=>w});var o={};i.r(o),i.d(o,{getMutedHighlights:()=>W,getNotices:()=>J});var c=i(48015),r=i(92819),u=i(87514),d=i.n(u),h=i(54761),g=i(31511);function a(t){return{type:"API_FETCH",request:t}}const l={API_FETCH:({request:t})=>d()(t).catch(g.xJ),SELECT:({selectorName:t,args:e})=>(0,c.select)("ithemes-security/admin-notices")[t](...e),CREATE_NOTICE({status:t,content:e,options:i}){i.autoDismiss&&(i.id=i.id||(0,r.uniqueId)("itsec-auto-dismiss-"),setTimeout((()=>(0,c.dispatch)("core/notices").removeNotice(i.id,i.context)),i.autoDismiss)),(0,c.dispatch)("core/notices").createNotice(t,e,i)},DO_ACTION:(0,c.createRegistryControl)((t=>({action:e,args:i})=>{(0,h.doAction)(`ithemes-security.${e}`,t,...i)}))};function I(t){return{type:N,notices:t}}function m(t,e){return{type:U,noticeId:t,actionId:e}}function p(t,e,i){return{type:C,noticeId:t,actionId:e,response:i}}function T(t,e,i){return{type:D,noticeId:t,actionId:e,error:i}}function H(t){return{type:O,mutedHighlights:t}}function y(t,e){return{type:F,slug:t,mute:e}}function f(t,e){return{type:S,slug:t,mute:e}}function E(t,e,i){return{type:v,slug:t,mute:e,error:i}}function*_(t,e,i={}){let n;yield m(t,e),yield function(t,...e){return{type:"DO_ACTION",action:"admin-notices.triggerAction",args:e}}(0,t,e,i);try{n=yield a({path:`/ithemes-security/v1/admin-notices/${t}/${e}`,method:"POST",data:i})}catch(i){return yield T(t,e,i),i}return yield p(t,e,n),n}function*A(t,e){let i;yield y(t,e);try{i=yield a({path:"/ithemes-security/v1/admin-notices/settings",method:"PUT",data:{muted_highlights:{[t]:e}}})}catch(i){return yield E(t,e,i),i}return yield f(t,e),i}const N="RECEIVE_NOTICES",U="START_NOTICE_ACTION",C="FINISH_NOTICE_ACTION",D="FAILED_NOTICE_ACTION",O="RECEIVE_MUTED_HIGHLIGHTS",F="START_UPDATE_MUTED_HIGHLIGHT",S="FINISH_UPDATE_MUTED_HIGHLIGHT",v="FAILED_UPDATE_MUTED_HIGHLIGHT";function w(t,...e){return(0,c.select)("core/data").isResolving("ithemes-security/admin-notices",t,e)}function G(t,...e){return(0,c.select)("core/data").hasFinishedResolution("ithemes-security/admin-notices",t,e)}function M(t){return t.notices}function P(t,e){return!t.notices.find((t=>t.id===e))}function R(){return G("getNotices")}function L(t,e,i=""){return!!t.doingActions[e]&&(""===i||t.doingActions[e].includes(i))}const b=[];function x(t,e){return t.doingActions[e]||b}function k(t){return t.mutedHighlights}function V(t){return t.mutedHighlightUpdatesInFlight}const q={notices:[],doingActions:{},mutedHighlights:{},mutedHighlightUpdatesInFlight:{}},J={*fulfill(){const t=yield a({path:"/ithemes-security/v1/admin-notices"});yield I(t)},shouldInvalidate:t=>t.type===C||t.type===S};function*W(){const t=yield a({path:"/ithemes-security/v1/admin-notices/settings"});yield H((0,r.isEmpty)(t.muted_highlights)?{}:t.muted_highlights)}const $=(0,c.createReduxStore)("ithemes-security/admin-notices",{controls:l,actions:n,selectors:s,resolvers:o,reducer:function(t=q,e){switch(e.type){case N:return{...t,notices:[...e.notices]};case U:return{...t,doingActions:{...t.doingActions,[e.noticeId]:[...t.doingActions[e.noticeId]||[],e.actionId]}};case C:case D:return{...t,doingActions:{...t.doingActions,[e.noticeId]:(t.doingActions[e.noticeId]||[]).filter((t=>t!==e.actionId))}};case O:return{...t,mutedHighlights:e.mutedHighlights};case F:return{...t,mutedHighlightUpdatesInFlight:{...t.mutedHighlightUpdatesInFlight,[e.slug]:{mute:e.mute}}};case S:return{...t,mutedHighlightUpdatesInFlight:(0,r.omit)(t.mutedHighlightUpdatesInFlight,e.slug),mutedHighlights:{...t.mutedHighlights,[e.slug]:e.mute}};case v:return{...t,mutedHighlightUpdatesInFlight:(0,r.omit)(t.mutedHighlightUpdatesInFlight,e.slug)};default:return t}}});(0,c.register)($);const Z=$;i.p=window.itsecWebpackPublicPath},87514:t=>{t.exports=function(){return this.wp.apiFetch}()},48015:t=>{t.exports=function(){return this.wp.data}()},6293:t=>{t.exports=function(){return this.wp.element}()},54761:t=>{t.exports=function(){return this.wp.hooks}()},95122:t=>{t.exports=function(){return this.wp.i18n}()},73470:t=>{t.exports=function(){return this.wp.url}()},92819:t=>{"use strict";t.exports=window.lodash},71002:(t,e,i)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}i.d(e,{Z:()=>n})}},t=>{t.O(0,[5307,1511],(()=>(76864,t(t.s=76864))));var e=t.O();((window.itsec=window.itsec||{}).core=window.itsec.core||{})["admin-notices-api"]=e}]);