mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-17 16:15:24 +01:00
e4a97cc8e9
The following dependencies are being updated: - `copy-webpack-plugin` from `10.2.4` to `11.0.0`. - `dotenv` from `16.0.1` to `16.0.2`. - `dotenv-expand` from `8.0.3` to `9.0.0`. - `sass` from `1.53.0` to `1.55.0`. - `sinon-test` from `3.1.3` to `3.1.4`. - `source-map-loader` from `3.0.1` to `4.0.0`. - `terser-webpack-plugin` from `5.3.1` to `5.3.6`. - `uglify-js` from `3.16.1` to `3.17.1`. - `uuid` from `8.3.2` to `9.0.0`. - `webpack` from `5.72.0` to `5.74.0`. This also contains changes after running `npm audit fix`. Fixes #56641. Built from https://develop.svn.wordpress.org/trunk@54296 git-svn-id: http://core.svn.wordpress.org/trunk@53855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
9 lines
26 KiB
JavaScript
9 lines
26 KiB
JavaScript
/*! This file is auto-generated */
|
|
!function(){var e={2167:function(e){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t){var r=e._map,n=e._arrayTreeMap,o=e._objectTreeMap;if(r.has(t))return r.get(t);for(var u=Object.keys(t).sort(),s=Array.isArray(t)?n:o,i=0;i<u.length;i++){var c=u[i];if(void 0===(s=s.get(c)))return;var a=t[c];if(void 0===(s=s.get(a)))return}var l=s.get("_ekm_value");return l?(r.delete(l[0]),l[0]=t,s.set("_ekm_value",l),r.set(t,l),l):void 0}var o=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clear(),t instanceof e){var r=[];t.forEach((function(e,t){r.push([t,e])})),t=r}if(null!=t)for(var n=0;n<t.length;n++)this.set(t[n][0],t[n][1])}var o,u,s;return o=e,u=[{key:"set",value:function(r,n){if(null===r||"object"!==t(r))return this._map.set(r,n),this;for(var o=Object.keys(r).sort(),u=[r,n],s=Array.isArray(r)?this._arrayTreeMap:this._objectTreeMap,i=0;i<o.length;i++){var c=o[i];s.has(c)||s.set(c,new e),s=s.get(c);var a=r[c];s.has(a)||s.set(a,new e),s=s.get(a)}var l=s.get("_ekm_value");return l&&this._map.delete(l[0]),s.set("_ekm_value",u),this._map.set(r,u),this}},{key:"get",value:function(e){if(null===e||"object"!==t(e))return this._map.get(e);var r=n(this,e);return r?r[1]:void 0}},{key:"has",value:function(e){return null===e||"object"!==t(e)?this._map.has(e):void 0!==n(this,e)}},{key:"delete",value:function(e){return!!this.has(e)&&(this.set(e,void 0),!0)}},{key:"forEach",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(o,u){null!==u&&"object"===t(u)&&(o=o[1]),e.call(n,o,u,r)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],u&&r(o.prototype,u),s&&r(o,s),e}();e.exports=o},9125:function(e){e.exports=function(e){var t,r=Object.keys(e);return t=function(){var e,t,n;for(e="return {",t=0;t<r.length;t++)e+=(n=JSON.stringify(r[t]))+":r["+n+"](s["+n+"],a),";return e+="}",new Function("r,s,a",e)}(),function(n,o){var u,s,i;if(void 0===n)return t(e,{},o);for(u=t(e,n,o),s=r.length;s--;)if(n[i=r[s]]!==u[i])return u;return n}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n](u,u.exports,r),u.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";r.r(n),r.d(n,{AsyncModeProvider:function(){return Me},RegistryConsumer:function(){return Ce},RegistryProvider:function(){return Fe},combineReducers:function(){return ze},controls:function(){return j},createReduxStore:function(){return se},createRegistry:function(){return le},createRegistryControl:function(){return I},createRegistrySelector:function(){return _},dispatch:function(){return et},plugins:function(){return o},register:function(){return ut},registerGenericStore:function(){return rt},registerStore:function(){return nt},resolveSelect:function(){return Ye},select:function(){return Qe},subscribe:function(){return tt},suspendSelect:function(){return Ze},use:function(){return ot},useDispatch:function(){return $e},useRegistry:function(){return Ue},useSelect:function(){return Ke},useSuspenseSelect:function(){return We},withDispatch:function(){return Be},withRegistry:function(){return Je},withSelect:function(){return Xe}});var e={};r.r(e),r.d(e,{getCachedResolvers:function(){return $},getIsResolving:function(){return K},getResolutionError:function(){return B},getResolutionState:function(){return H},hasFinishedResolution:function(){return X},hasResolutionFailed:function(){return q},hasStartedResolution:function(){return W},isResolving:function(){return J}});var t={};r.r(t),r.d(t,{failResolution:function(){return Y},failResolutions:function(){return te},finishResolution:function(){return Q},finishResolutions:function(){return ee},invalidateResolution:function(){return re},invalidateResolutionForStore:function(){return ne},invalidateResolutionForStoreSelector:function(){return oe},startResolution:function(){return z},startResolutions:function(){return Z}});var o={};r.r(o),r.d(o,{persistence:function(){return me}});var u=r(9125),s=r.n(u),i=window.lodash,c=window.wp.deprecated,a=r.n(c);function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var g="function"==typeof Symbol&&Symbol.observable||"@@observable",h=function(){return Math.random().toString(36).substring(7).split("").join(".")},v={INIT:"@@redux/INIT"+h(),REPLACE:"@@redux/REPLACE"+h(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+h()}};function y(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function S(e,t,r){var n;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(d(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(d(1));return r(S)(e,t)}if("function"!=typeof e)throw new Error(d(2));var o=e,u=t,s=[],i=s,c=!1;function a(){i===s&&(i=s.slice())}function l(){if(c)throw new Error(d(3));return u}function f(e){if("function"!=typeof e)throw new Error(d(4));if(c)throw new Error(d(5));var t=!0;return a(),i.push(e),function(){if(t){if(c)throw new Error(d(6));t=!1,a();var r=i.indexOf(e);i.splice(r,1),s=null}}}function p(e){if(!y(e))throw new Error(d(7));if(void 0===e.type)throw new Error(d(8));if(c)throw new Error(d(9));try{c=!0,u=o(u,e)}finally{c=!1}for(var t=s=i,r=0;r<t.length;r++){(0,t[r])()}return e}function h(e){if("function"!=typeof e)throw new Error(d(10));o=e,p({type:v.REPLACE})}function b(){var e,t=f;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(d(11));function r(){e.next&&e.next(l())}return r(),{unsubscribe:t(r)}}})[g]=function(){return this},e}return p({type:v.INIT}),(n={dispatch:p,subscribe:f,getState:l,replaceReducer:h})[g]=b,n}function b(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function R(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error(d(15))},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},u=t.map((function(e){return e(o)}));return n=b.apply(void 0,u)(r.dispatch),p(p({},r),{},{dispatch:n})}}}var m=r(2167),O=r.n(m),w=window.wp.reduxRoutine,E=r.n(w);function _(e){const t=function(){return e(t.registry.select)(...arguments)};return t.isRegistrySelector=!0,t}function I(e){return e.isRegistryControl=!0,e}const T="@@data/SELECT",N="@@data/RESOLVE_SELECT",A="@@data/DISPATCH";function L(e){return null!==e&&"object"==typeof e}const j={select:function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return{type:T,storeKey:L(e)?e.name:e,selectorName:t,args:n}},resolveSelect:function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return{type:N,storeKey:L(e)?e.name:e,selectorName:t,args:n}},dispatch:function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return{type:A,storeKey:L(e)?e.name:e,actionName:t,args:n}}},P={[T]:I((e=>t=>{let{storeKey:r,selectorName:n,args:o}=t;return e.select(r)[n](...o)})),[N]:I((e=>t=>{let{storeKey:r,selectorName:n,args:o}=t;const u=e.select(r)[n].hasResolver?"resolveSelect":"select";return e[u](r)[n](...o)})),[A]:I((e=>t=>{let{storeKey:r,actionName:n,args:o}=t;return e.dispatch(r)[n](...o)}))};var C=()=>e=>t=>{return!(r=t)||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?e(t):t.then((t=>{if(t)return e(t)}));var r};const F={name:"core/data",instantiate(e){const t=t=>function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return e.select(r)[t](...o)},r=t=>function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return e.dispatch(r)[t](...o)};return{getSelectors(){return Object.fromEntries(["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"].map((e=>[e,t(e)])))},getActions(){return Object.fromEntries(["startResolution","finishResolution","invalidateResolution","invalidateResolutionForStore","invalidateResolutionForStoreSelector"].map((e=>[e,r(e)])))},subscribe(){return()=>()=>{}}}}};var U=F;var k=(e,t)=>()=>r=>n=>{const o=e.select(U).getCachedResolvers(t);return Object.entries(o).forEach((r=>{let[o,u]=r;const s=(0,i.get)(e.stores,[t,"resolvers",o]);s&&s.shouldInvalidate&&u.forEach(((r,u)=>{"finished"!==(null==r?void 0:r.status)&&"error"!==(null==r?void 0:r.status)||!s.shouldInvalidate(n,...u)||e.dispatch(U).invalidateResolution(t,o,u)}))})),r(n)};function x(e){return()=>t=>r=>"function"==typeof r?r(e):t(r)}function D(e){if(null==e)return[];const t=e.length;let r=t;for(;r>0&&void 0===e[r-1];)r--;return r===t?e:e.slice(0,r)}const M=(V="selectorName",e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;const n=r[V];if(void 0===n)return t;const o=e(t[n],r);return o===t[n]?t:{...t,[n]:o}})((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new(O()),t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_RESOLUTION":{const r=new(O())(e);return r.set(D(t.args),{status:"resolving"}),r}case"FINISH_RESOLUTION":{const r=new(O())(e);return r.set(D(t.args),{status:"finished"}),r}case"FAIL_RESOLUTION":{const r=new(O())(e);return r.set(D(t.args),{status:"error",error:t.error}),r}case"START_RESOLUTIONS":{const r=new(O())(e);for(const e of t.args)r.set(D(e),{status:"resolving"});return r}case"FINISH_RESOLUTIONS":{const r=new(O())(e);for(const e of t.args)r.set(D(e),{status:"finished"});return r}case"FAIL_RESOLUTIONS":{const r=new(O())(e);return t.args.forEach(((e,n)=>{const o={status:"error",error:void 0},u=t.errors[n];u&&(o.error=u),r.set(D(e),o)})),r}case"INVALIDATE_RESOLUTION":{const r=new(O())(e);return r.delete(D(t.args)),r}}return e}));var V;var G=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INVALIDATE_RESOLUTION_FOR_STORE":return{};case"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR":if(t.selectorName in e){const{[t.selectorName]:r,...n}=e;return n}return e;case"START_RESOLUTION":case"FINISH_RESOLUTION":case"FAIL_RESOLUTION":case"START_RESOLUTIONS":case"FINISH_RESOLUTIONS":case"FAIL_RESOLUTIONS":case"INVALIDATE_RESOLUTION":return M(e,t)}return e};function H(e,t,r){const n=(0,i.get)(e,[t]);if(n)return n.get(D(r))}function K(e,t,r){const n=H(e,t,r);return n&&"resolving"===n.status}function W(e,t,r){return void 0!==H(e,t,r)}function X(e,t,r){var n;const o=null===(n=H(e,t,r))||void 0===n?void 0:n.status;return"finished"===o||"error"===o}function q(e,t,r){var n;return"error"===(null===(n=H(e,t,r))||void 0===n?void 0:n.status)}function B(e,t,r){const n=H(e,t,r);return"error"===(null==n?void 0:n.status)?n.error:null}function J(e,t,r){var n;return"resolving"===(null===(n=H(e,t,r))||void 0===n?void 0:n.status)}function $(e){return e}function z(e,t){return{type:"START_RESOLUTION",selectorName:e,args:t}}function Q(e,t){return{type:"FINISH_RESOLUTION",selectorName:e,args:t}}function Y(e,t,r){return{type:"FAIL_RESOLUTION",selectorName:e,args:t,error:r}}function Z(e,t){return{type:"START_RESOLUTIONS",selectorName:e,args:t}}function ee(e,t){return{type:"FINISH_RESOLUTIONS",selectorName:e,args:t}}function te(e,t,r){return{type:"FAIL_RESOLUTIONS",selectorName:e,args:t,errors:r}}function re(e,t){return{type:"INVALIDATE_RESOLUTION",selectorName:e,args:t}}function ne(){return{type:"INVALIDATE_RESOLUTION_FOR_STORE"}}function oe(e){return{type:"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR",selectorName:e}}const ue=e=>{const t=[...e];for(let e=t.length-1;e>=0;e--)void 0===t[e]&&t.splice(e,1);return t};function se(r,n){return{name:r,instantiate:o=>{const u=n.reducer,c=function(e,t,r,n){const o={...t.controls,...P},u=(0,i.mapValues)(o,(e=>e.isRegistryControl?e(r):e)),c=[R(k(r,e),C,E()(u),x(n))];"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&c.push(window.__REDUX_DEVTOOLS_EXTENSION__({name:e,instanceId:e}));const{reducer:a,initialState:l}=t;return S(s()({metadata:G,root:a}),{root:l},(0,i.flowRight)(c))}(r,n,o,{registry:o,get dispatch(){return Object.assign((e=>c.dispatch(e)),v())},get select(){return Object.assign((e=>e(c.__unstableOriginalGetState())),h())},get resolveSelect(){return y()}}),a=function(){const e={};return{isRunning(t,r){return e[t]&&e[t].get(ue(r))},clear(t,r){e[t]&&e[t].delete(ue(r))},markAsRunning(t,r){e[t]||(e[t]=new(O())),e[t].set(ue(r),!0)}}}();let l;const f=function(e,t){const r=e=>function(){return Promise.resolve(t.dispatch(e(...arguments)))};return(0,i.mapValues)(e,r)}({...t,...n.actions},c);let p=function(e,t){const r=e=>{const r=function(){const r=arguments.length,n=new Array(r+1);n[0]=t.__unstableOriginalGetState();for(let e=0;e<r;e++)n[e+1]=arguments[e];return e(...n)};return r.hasResolver=!1,r};return(0,i.mapValues)(e,r)}({...(0,i.mapValues)(e,(e=>function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return e(t.metadata,...n)})),...(0,i.mapValues)(n.selectors,(e=>(e.isRegistrySelector&&(e.registry=o),function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return e(t.root,...n)})))},c);if(n.resolvers){const e=function(e,t,r,n){const o=(0,i.mapValues)(e,(e=>e.fulfill?e:{...e,fulfill:e})),u=(t,u)=>{const s=e[u];if(!s)return t.hasResolver=!1,t;const i=function(){for(var e=arguments.length,i=new Array(e),c=0;c<e;c++)i[c]=arguments[c];async function a(){const e=r.getState();if(n.isRunning(u,i)||"function"==typeof s.isFulfilled&&s.isFulfilled(e,...i))return;const{metadata:t}=r.__unstableOriginalGetState();W(t,u,i)||(n.markAsRunning(u,i),setTimeout((async()=>{n.clear(u,i),r.dispatch(z(u,i));try{await ie(r,o,u,...i),r.dispatch(Q(u,i))}catch(e){r.dispatch(Y(u,i,e))}})))}return a(...i),t(...i)};return i.hasResolver=!0,i};return{resolvers:o,selectors:(0,i.mapValues)(t,u)}}(n.resolvers,p,c,a);l=e.resolvers,p=e.selectors}const d=function(e,t){const{getIsResolving:r,hasStartedResolution:n,hasFinishedResolution:o,hasResolutionFailed:u,isResolving:s,getCachedResolvers:c,getResolutionState:a,getResolutionError:l,...f}=e;return(0,i.mapValues)(f,((r,n)=>r.hasResolver?function(){for(var o=arguments.length,u=new Array(o),s=0;s<o;s++)u[s]=arguments[s];return new Promise(((o,s)=>{const i=()=>e.hasFinishedResolution(n,u),c=t=>{if(e.hasResolutionFailed(n,u)){const t=e.getResolutionError(n,u);s(t)}else o(t)},a=()=>r.apply(null,u),l=a();if(i())return c(l);const f=t.subscribe((()=>{i()&&(f(),c(a()))}))}))}:async function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.apply(null,t)}))}(p,c),g=function(e,t){return(0,i.mapValues)(e,((r,n)=>r.hasResolver?function(){for(var o=arguments.length,u=new Array(o),s=0;s<o;s++)u[s]=arguments[s];const i=r.apply(null,u);if(e.hasFinishedResolution(n,u)){if(e.hasResolutionFailed(n,u))throw e.getResolutionError(n,u);return i}throw new Promise((r=>{const o=t.subscribe((()=>{e.hasFinishedResolution(n,u)&&(r(),o())}))}))}:r))}(p,c),h=()=>p,v=()=>f,y=()=>d;c.__unstableOriginalGetState=c.getState,c.getState=()=>c.__unstableOriginalGetState().root;const b=c&&(e=>{let t=c.__unstableOriginalGetState();return c.subscribe((()=>{const r=c.__unstableOriginalGetState(),n=r!==t;t=r,n&&e()}))});return{reducer:u,store:c,actions:f,selectors:p,resolvers:l,getSelectors:h,getResolveSelectors:y,getSuspendSelectors:()=>g,getActions:v,subscribe:b}}}}async function ie(e,t,r){const n=(0,i.get)(t,[r]);if(!n)return;for(var o=arguments.length,u=new Array(o>3?o-3:0),s=3;s<o;s++)u[s-3]=arguments[s];const c=n.fulfill(...u);c&&await e.dispatch(c)}function ce(){let e=!1,t=!1;const r=new Set,n=()=>Array.from(r).forEach((e=>e()));return{get isPaused(){return e},subscribe(e){return r.add(e),()=>r.delete(e)},pause(){e=!0},resume(){e=!1,t&&(t=!1,n())},emit(){e?t=!0:n()}}}function ae(e){return null!==e&&"object"==typeof e}function le(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r={},n=ce(),o=new Set;function u(){n.emit()}const s=e=>n.subscribe(e);function c(e){const n=ae(e)?e.name:e;o.add(n);const u=r[n];return u?u.getSelectors():null==t?void 0:t.select(n)}function l(e,t){o.clear();try{return e.call(this)}finally{t.current=Array.from(o)}}function f(e){const n=ae(e)?e.name:e;o.add(n);const u=r[n];return u?u.getResolveSelectors():t&&t.resolveSelect(n)}function p(e){const n=ae(e)?e.name:e;o.add(n);const u=r[n];return u?u.getSuspendSelectors():t&&t.suspendSelect(n)}function d(e){const n=ae(e)?e.name:e,o=r[n];return o?o.getActions():t&&t.dispatch(n)}function g(e){return(0,i.mapValues)(e,((e,t)=>"function"!=typeof e?e:function(){return m[t].apply(null,arguments)}))}function h(e,t){if("function"!=typeof t.getSelectors)throw new TypeError("store.getSelectors must be a function");if("function"!=typeof t.getActions)throw new TypeError("store.getActions must be a function");if("function"!=typeof t.subscribe)throw new TypeError("store.subscribe must be a function");t.emitter=ce();const n=t.subscribe;t.subscribe=e=>{const r=t.emitter.subscribe(e),o=n((()=>{t.emitter.isPaused?t.emitter.emit():e()}));return()=>{null==o||o(),null==r||r()}},r[e]=t,t.subscribe(u)}function v(e){h(e.name,e.instantiate(m))}function y(e,t){a()("wp.data.registerGenericStore",{since:"5.9",alternative:"wp.data.register( storeDescriptor )"}),h(e,t)}function S(e,t){if(!t.reducer)throw new TypeError("Must specify store reducer");const r=se(e,t).instantiate(m);return h(e,r),r.store}function b(e,n){return e in r?r[e].subscribe(n):t?t.__unstableSubscribeStore(e,n):s(n)}function R(e){n.pause(),Object.values(r).forEach((e=>e.emitter.pause())),e(),n.resume(),Object.values(r).forEach((e=>e.emitter.resume()))}let m={batch:R,stores:r,namespaces:r,subscribe:s,select:c,resolveSelect:f,suspendSelect:p,dispatch:d,use:O,register:v,registerGenericStore:y,registerStore:S,__unstableMarkListeningStores:l,__unstableSubscribeStore:b};function O(e,t){if(e)return m={...m,...e(m,t)},m}m.register(U);for(const[t,r]of Object.entries(e))m.register(se(t,r));return t&&t.subscribe(u),g(m)}var fe=le();
|
|
/*!
|
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
*
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
* Released under the MIT License.
|
|
*/
|
|
function pe(e){return"[object Object]"===Object.prototype.toString.call(e)}function de(e){var t,r;return!1!==pe(e)&&(void 0===(t=e.constructor)||!1!==pe(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}let ge;const he={getItem(e){return ge&&ge[e]?ge[e]:null},setItem(e,t){ge||he.clear(),ge[e]=String(t)},clear(){ge=Object.create(null)}};var ve=he;let ye;try{ye=window.localStorage,ye.setItem("__wpDataTestLocalStorage",""),ye.removeItem("__wpDataTestLocalStorage")}catch(e){ye=ve}const Se=ye,be="WP_DATA";function Re(e,t){const r=function(e){const{storage:t=Se,storageKey:r=be}=e;let n;return{get:function(){if(void 0===n){const e=t.getItem(r);if(null===e)n={};else try{n=JSON.parse(e)}catch(e){n={}}}return n},set:function(e,o){n={...n,[e]:o},t.setItem(r,JSON.stringify(n))}}}(t);return{registerStore(t,n){if(!n.persist)return e.registerStore(t,n);const o=r.get()[t];if(void 0!==o){let e=n.reducer(n.initialState,{type:"@@WP/PERSISTENCE_RESTORE"});e=de(e)&&de(o)?(0,i.merge)({},e,o):o,n={...n,initialState:e}}const u=e.registerStore(t,n);return u.subscribe(function(e,t,n){let o;if(Array.isArray(n)){const e=n.reduce(((e,t)=>Object.assign(e,{[t]:(e,r)=>r.nextState[t]})),{});u=ze(e),o=(e,t)=>t.nextState===e?e:u(e,t)}else o=(e,t)=>t.nextState;var u;let s=o(void 0,{nextState:e()});return()=>{const n=o(s,{nextState:e()});n!==s&&(r.set(t,n),s=n)}}(u.getState,t,n.persist)),u}}}Re.__unstableMigrate=()=>{};var me=Re;function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oe.apply(this,arguments)}var we=window.wp.element,Ee=window.wp.compose,_e=window.React;function Ie(e,t){var r=(0,_e.useState)((function(){return{inputs:t,result:e()}}))[0],n=(0,_e.useRef)(!0),o=(0,_e.useRef)(r),u=n.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(t,o.current.inputs))?o.current:{inputs:t,result:e()};return(0,_e.useEffect)((function(){n.current=!1,o.current=u}),[u]),u.result}var Te=window.wp.priorityQueue,Ne=window.wp.isShallowEqual,Ae=r.n(Ne);const Le=(0,we.createContext)(fe),{Consumer:je,Provider:Pe}=Le,Ce=je;var Fe=Pe;function Ue(){return(0,we.useContext)(Le)}const ke=(0,we.createContext)(!1),{Consumer:xe,Provider:De}=ke;var Me=De;function Ve(){return(0,we.useContext)(ke)}const Ge=()=>{},He=(0,Te.createQueue)();function Ke(e,t){const r="function"==typeof e;r||(t=[]);const n=(0,we.useCallback)(r?e:Ge,t),o=r?n:null,u=Ue(),s=Ve(),i=(0,we.useRef)(u),c=(0,we.useRef)(),a=(0,we.useRef)(s),l=(0,we.useRef)(),f=(0,we.useRef)(),p=(0,we.useRef)([]),d=(0,we.useCallback)((e=>u.__unstableMarkListeningStores((()=>e(u.select,u)),p)),[u]),g=(0,we.useMemo)((()=>({})),t||[]);let h;if(o){h=l.current;const e=i.current!==u,t=c.current!==o,r=a.current&&!s,n=!!f.current;if(e||t||r||n)try{h=d(o)}catch(e){let t=`An error occurred while running 'mapSelect': ${e.message}`;f.current&&(t+="\nThe error may be correlated with this previous error:\n",t+=`${f.current.stack}\n\n`,t+="Original stack trace:"),console.error(t)}}(0,Ee.useIsomorphicLayoutEffect)((()=>{r&&(i.current=u,c.current=o,a.current=s,l.current=h,f.current=void 0)}));const v=Ie((()=>({queue:!0})),[u]),[,y]=(0,we.useReducer)((e=>e+1),0),S=(0,we.useRef)(!1);return(0,Ee.useIsomorphicLayoutEffect)((()=>{if(!r)return;const e=()=>{try{const e=d(c.current);if(Ae()(l.current,e))return;l.current=e}catch(e){f.current=e}y()},t=()=>{S.current&&(a.current?He.add(v,e):e())};e();const n=p.current.map((e=>u.__unstableSubscribeStore(e,t)));return S.current=!0,()=>{n.forEach((e=>null==e?void 0:e())),He.cancel(v),S.current=!1}}),[u,d,r,g]),(0,we.useDebugValue)(h),r?h:u.select(e)}function We(e,t){const r=(0,we.useCallback)(e,t),n=Ue(),o=Ve(),u=(0,we.useRef)(n),s=(0,we.useRef)(),i=(0,we.useRef)(o),c=(0,we.useRef)(),a=(0,we.useRef)(),l=(0,we.useRef)([]),f=(0,we.useCallback)((e=>n.__unstableMarkListeningStores((()=>e(n.suspendSelect,n)),l)),[n]),p=(0,we.useMemo)((()=>({})),t||[]);let d=c.current,g=a.current;const h=u.current!==n,v=s.current!==r,y=i.current&&!o;if(h||v||y)try{d=f(r)}catch(e){g=e}(0,Ee.useIsomorphicLayoutEffect)((()=>{u.current=n,s.current=r,i.current=o,c.current=d,a.current=g}));const S=Ie((()=>({queue:!0})),[n]),[,b]=(0,we.useReducer)((e=>e+1),0),R=(0,we.useRef)(!1);if((0,Ee.useIsomorphicLayoutEffect)((()=>{const e=()=>{try{const e=f(s.current);if(Ae()(c.current,e))return;c.current=e}catch(e){a.current=e}b()},t=()=>{R.current&&(i.current?He.add(S,e):e())};e();const r=l.current.map((e=>n.__unstableSubscribeStore(e,t)));return R.current=!0,()=>{r.forEach((e=>null==e?void 0:e())),He.cancel(S),R.current=!1}}),[n,f,p]),g)throw g;return d}var Xe=e=>(0,Ee.createHigherOrderComponent)((t=>(0,Ee.pure)((r=>{const n=Ke(((t,n)=>e(t,r,n)));return(0,we.createElement)(t,Oe({},r,n))}))),"withSelect");var qe=(e,t)=>{const r=Ue(),n=(0,we.useRef)(e);return(0,Ee.useIsomorphicLayoutEffect)((()=>{n.current=e})),(0,we.useMemo)((()=>{const e=n.current(r.dispatch,r);return(0,i.mapValues)(e,((e,t)=>("function"!=typeof e&&console.warn(`Property ${t} returned from dispatchMap in useDispatchWithMap must be a function.`),function(){return n.current(r.dispatch,r)[t](...arguments)})))}),[r,...t])};var Be=e=>(0,Ee.createHigherOrderComponent)((t=>r=>{const n=qe(((t,n)=>e(t,r,n)),[]);return(0,we.createElement)(t,Oe({},r,n))}),"withDispatch");var Je=(0,Ee.createHigherOrderComponent)((e=>t=>(0,we.createElement)(Ce,null,(r=>(0,we.createElement)(e,Oe({},t,{registry:r}))))),"withRegistry");var $e=e=>{const{dispatch:t}=Ue();return void 0===e?t:t(e)};const ze=s(),Qe=fe.select,Ye=fe.resolveSelect,Ze=fe.suspendSelect,et=fe.dispatch,tt=fe.subscribe,rt=fe.registerGenericStore,nt=fe.registerStore,ot=fe.use,ut=fe.register}(),(window.wp=window.wp||{}).data=n}(); |