Current File : /home/k/a/r/karenpetzb/www/items/category/script-modules.tar |
a11y/index.js 0000644 00000011312 15071251711 0006762 0 ustar 00 /******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
m: () => (/* binding */ setup),
L: () => (/* reexport */ speak)
});
;// ./node_modules/@wordpress/a11y/build-module/shared/clear.js
/**
* Clears the a11y-speak-region elements and hides the explanatory text.
*/
function clear() {
const regions = document.getElementsByClassName('a11y-speak-region');
const introText = document.getElementById('a11y-speak-intro-text');
for (let i = 0; i < regions.length; i++) {
regions[i].textContent = '';
}
// Make sure the explanatory text is hidden from assistive technologies.
if (introText) {
introText.setAttribute('hidden', 'hidden');
}
}
;// ./node_modules/@wordpress/a11y/build-module/shared/filter-message.js
let previousMessage = '';
/**
* Filter the message to be announced to the screenreader.
*
* @param {string} message The message to be announced.
*
* @return {string} The filtered message.
*/
function filterMessage(message) {
/*
* Strip HTML tags (if any) from the message string. Ideally, messages should
* be simple strings, carefully crafted for specific use with A11ySpeak.
* When re-using already existing strings this will ensure simple HTML to be
* stripped out and replaced with a space. Browsers will collapse multiple
* spaces natively.
*/
message = message.replace(/<[^<>]+>/g, ' ');
/*
* Safari + VoiceOver don't announce repeated, identical strings. We use
* a `no-break space` to force them to think identical strings are different.
*/
if (previousMessage === message) {
message += '\u00A0';
}
previousMessage = message;
return message;
}
;// ./node_modules/@wordpress/a11y/build-module/shared/index.js
/**
* Internal dependencies
*/
/**
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
* This module is inspired by the `speak` function in `wp-a11y.js`.
*
* @param {string} message The message to be announced by assistive technologies.
* @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'.
*
* @example
* ```js
* import { speak } from '@wordpress/a11y';
*
* // For polite messages that shouldn't interrupt what screen readers are currently announcing.
* speak( 'The message you want to send to the ARIA live region' );
*
* // For assertive messages that should interrupt what screen readers are currently announcing.
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
* ```
*/
function speak(message, ariaLive) {
/*
* Clear previous messages to allow repeated strings being read out and hide
* the explanatory text from assistive technologies.
*/
clear();
message = filterMessage(message);
const introText = document.getElementById('a11y-speak-intro-text');
const containerAssertive = document.getElementById('a11y-speak-assertive');
const containerPolite = document.getElementById('a11y-speak-polite');
if (containerAssertive && ariaLive === 'assertive') {
containerAssertive.textContent = message;
} else if (containerPolite) {
containerPolite.textContent = message;
}
/*
* Make the explanatory text available to assistive technologies by removing
* the 'hidden' HTML attribute.
*/
if (introText) {
introText.removeAttribute('hidden');
}
}
;// ./node_modules/@wordpress/a11y/build-module/module/index.js
/**
* Internal dependencies
*/
/**
* This no-op function is exported to provide compatibility with the `wp-a11y` Script.
*
* Filters should inject the relevant HTML on page load instead of requiring setup.
*/
const setup = () => {};
var __webpack_exports__setup = __webpack_exports__.m;
var __webpack_exports__speak = __webpack_exports__.L;
export { __webpack_exports__setup as setup, __webpack_exports__speak as speak };
a11y/index.min.js 0000644 00000001443 15071251711 0007550 0 ustar 00 var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{m:()=>a,L:()=>o});let n="";function o(e,t){!function(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let t=0;t<e.length;t++)e[t].textContent="";t&&t.setAttribute("hidden","hidden")}(),e=function(e){return e=e.replace(/<[^<>]+>/g," "),n===e&&(e+=" "),n=e,e}(e);const o=document.getElementById("a11y-speak-intro-text"),a=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");a&&"assertive"===t?a.textContent=e:r&&(r.textContent=e),o&&o.removeAttribute("hidden")}const a=()=>{};var r=t.m,s=t.L;export{r as setup,s as speak}; interactivity/debug.js 0000644 00000352126 15071251711 0011077 0 ustar 00 /******/ var __webpack_modules__ = ({
/***/ 380:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
zj: () => (/* reexport */ getConfig),
SD: () => (/* reexport */ getContext),
V6: () => (/* reexport */ getElement),
$K: () => (/* reexport */ getServerContext),
vT: () => (/* reexport */ getServerState),
jb: () => (/* binding */ privateApis),
yT: () => (/* reexport */ splitTask),
M_: () => (/* reexport */ store),
hb: () => (/* reexport */ useCallback),
vJ: () => (/* reexport */ useEffect),
ip: () => (/* reexport */ useInit),
Nf: () => (/* reexport */ useLayoutEffect),
Kr: () => (/* reexport */ useMemo),
li: () => (/* reexport */ A),
J0: () => (/* reexport */ d),
FH: () => (/* reexport */ useWatch),
v4: () => (/* reexport */ withScope),
mh: () => (/* reexport */ withSyncEvent)
});
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
var preact_module = __webpack_require__(622);
;// ./node_modules/preact/hooks/dist/hooks.module.js
var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function p(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return hooks_module_o=1,h(D,n)}function h(n,u,i){var o=p(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=p(hooks_module_t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t}
;// ./node_modules/@preact/signals-core/dist/signals-core.module.js
var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)}
;// ./node_modules/@preact/signals/dist/signals.module.js
var signals_module_v,signals_module_s;function signals_module_l(i,n){preact_module/* options */.fF[i]=n.bind(null,preact_module/* options */.fF[i]||function(){})}function signals_module_d(i){if(signals_module_s)signals_module_s();signals_module_s=i&&i.S()}function signals_module_h(i){var r=this,f=i.data,o=useSignal(f);o.value=f;var e=T(function(){var i=r.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}r.__$u.c=function(){var i,t=r.__$u.S(),f=e.value;t();if((0,preact_module/* isValidElement */.zO)(f)||3!==(null==(i=r.base)?void 0:i.nodeType)){r.__$f|=1;r.setState({})}else r.base.data=f};return signals_core_module_w(function(){var i=o.value.value;return 0===i?0:!0===i?"":i||""})},[]);return e.value}signals_module_h.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_h},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(i,r){if("string"==typeof r.type){var n,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!n)r.__np=n={};n[f]=o;t[f]=o.peek()}}}i(r)});signals_module_l("__r",function(i,r){signals_module_d();var n,t=r.__c;if(t){t.__$f&=-2;if(void 0===(n=t.__$u))t.__$u=n=function(i){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(n);i(r)});signals_module_l("__e",function(i,r,n,t){signals_module_d();signals_module_v=void 0;i(r,n,t)});signals_module_l("diffed",function(i,r){signals_module_d();signals_module_v=void 0;var n;if("string"==typeof r.type&&(n=r.__e)){var t=r.__np,f=r.props;if(t){var o=n.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else n.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_p(n,a,s,f);o[a]=c}else c.o(s,f)}}}i(r)});function signals_module_p(i,r,n,t){var f=r in i&&void 0===i.ownerSVGElement,o=signals_core_module_d(n);return{o:function(i,r){o.value=i;t=r},d:E(function(){var n=o.value.value;if(t[r]!==n){t[r]=n;if(f)i[r]=n;else if(n)i.setAttribute(r,n);else i.removeAttribute(r)}})}}signals_module_l("unmount",function(i,r){if("string"==typeof r.type){var n=r.__e;if(n){var t=n.U;if(t){n.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}i(r)});signals_module_l("__h",function(i,r,n,t){if(t<3||9===t)r.__$f|=2;i(r,n,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(i,r){var n=this.__$u,t=n&&void 0!==n.s;for(var f in r)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(t||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(t||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var o in i)if("__source"!==o&&i[o]!==this.props[o])return!0;for(var e in this.props)if(!(e in i))return!0;return!1};function useSignal(i){return T(function(){return signals_core_module_d(i)},[])}function useComputed(i){var r=f(i);r.current=i;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(i){var r=f(i);r.current=i;o(function(){return c(function(){return r.current()})},[])}
;// ./node_modules/@wordpress/interactivity/build-module/namespaces.js
const namespaceStack = [];
const getNamespace = () => namespaceStack.slice(-1)[0];
const setNamespace = namespace => {
namespaceStack.push(namespace);
};
const resetNamespace = () => {
namespaceStack.pop();
};
;// ./node_modules/@wordpress/interactivity/build-module/scopes.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
// Store stacks for the current scope and the default namespaces and export APIs
// to interact with them.
const scopeStack = [];
const getScope = () => scopeStack.slice(-1)[0];
const setScope = scope => {
scopeStack.push(scope);
};
const resetScope = () => {
scopeStack.pop();
};
// Wrap the element props to prevent modifications.
const immutableMap = new WeakMap();
const immutableError = () => {
throw new Error('Please use `data-wp-bind` to modify the attributes of an element.');
};
const immutableHandlers = {
get(target, key, receiver) {
const value = Reflect.get(target, key, receiver);
return !!value && typeof value === 'object' ? deepImmutable(value) : value;
},
set: immutableError,
deleteProperty: immutableError
};
const deepImmutable = target => {
if (!immutableMap.has(target)) {
immutableMap.set(target, new Proxy(target, immutableHandlers));
}
return immutableMap.get(target);
};
/**
* Retrieves the context inherited by the element evaluating a function from the
* store. The returned value depends on the element and the namespace where the
* function calling `getContext()` exists.
*
* @param namespace Store namespace. By default, the namespace where the calling
* function exists is used.
* @return The context content.
*/
const getContext = namespace => {
const scope = getScope();
if (true) {
if (!scope) {
throw Error('Cannot call `getContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
}
}
return scope.context[namespace || getNamespace()];
};
/**
* Retrieves a representation of the element where a function from the store
* is being evaluated. Such representation is read-only, and contains a
* reference to the DOM element, its props and a local reactive state.
*
* @return Element representation.
*/
const getElement = () => {
const scope = getScope();
if (true) {
if (!scope) {
throw Error('Cannot call `getElement()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
}
}
const {
ref,
attributes
} = scope;
return Object.freeze({
ref: ref.current,
attributes: deepImmutable(attributes)
});
};
/**
* Retrieves the part of the inherited context defined and updated from the
* server.
*
* The object returned is read-only, and includes the context defined in PHP
* with `wp_interactivity_data_wp_context()`, including the corresponding
* inherited properties. When `actions.navigate()` is called, this object is
* updated to reflect the changes in the new visited page, without affecting the
* context returned by `getContext()`. Directives can subscribe to those changes
* to update the context if needed.
*
* @example
* ```js
* store('...', {
* callbacks: {
* updateServerContext() {
* const context = getContext();
* const serverContext = getServerContext();
* // Override some property with the new value that came from the server.
* context.overridableProp = serverContext.overridableProp;
* },
* },
* });
* ```
*
* @param namespace Store namespace. By default, the namespace where the calling
* function exists is used.
* @return The server context content.
*/
const getServerContext = namespace => {
const scope = getScope();
if (true) {
if (!scope) {
throw Error('Cannot call `getServerContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
}
}
return scope.serverContext[namespace || getNamespace()];
};
;// ./node_modules/@wordpress/interactivity/build-module/utils.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Executes a callback function after the next frame is rendered.
*
* @param callback The callback function to be executed.
* @return A promise that resolves after the callback function is executed.
*/
const afterNextFrame = callback => {
return new Promise(resolve => {
const done = () => {
clearTimeout(timeout);
window.cancelAnimationFrame(raf);
setTimeout(() => {
callback();
resolve();
});
};
const timeout = setTimeout(done, 100);
const raf = window.requestAnimationFrame(done);
});
};
/**
* Returns a promise that resolves after yielding to main.
*
* @return Promise<void>
*/
const splitTask = typeof window.scheduler?.yield === 'function' ? window.scheduler.yield.bind(window.scheduler) : () => {
return new Promise(resolve => {
setTimeout(resolve, 0);
});
};
/**
* Creates a Flusher object that can be used to flush computed values and notify listeners.
*
* Using the mangled properties:
* this.c: this._callback
* this.x: this._compute
* https://github.com/preactjs/signals/blob/main/mangle.json
*
* @param compute The function that computes the value to be flushed.
* @param notify The function that notifies listeners when the value is flushed.
* @return The Flusher object with `flush` and `dispose` properties.
*/
function createFlusher(compute, notify) {
let flush = () => undefined;
const dispose = E(function () {
flush = this.c.bind(this);
this.x = compute;
this.c = notify;
return compute();
});
return {
flush,
dispose
};
}
/**
* Custom hook that executes a callback function whenever a signal is triggered.
* Version of `useSignalEffect` with a `useEffect`-like execution. This hook
* implementation comes from this PR, but we added short-cirtuiting to avoid
* infinite loops: https://github.com/preactjs/signals/pull/290
*
* @param callback The callback function to be executed.
*/
function utils_useSignalEffect(callback) {
y(() => {
let eff = null;
let isExecuting = false;
const notify = async () => {
if (eff && !isExecuting) {
isExecuting = true;
await afterNextFrame(eff.flush);
isExecuting = false;
}
};
eff = createFlusher(callback, notify);
return eff.dispose;
}, []);
}
/**
* Returns the passed function wrapped with the current scope so it is
* accessible whenever the function runs. This is primarily to make the scope
* available inside hook callbacks.
*
* Asynchronous functions should use generators that yield promises instead of awaiting them.
* See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store
*
* @param func The passed function.
* @return The wrapped function.
*/
function withScope(func) {
const scope = getScope();
const ns = getNamespace();
let wrapped;
if (func?.constructor?.name === 'GeneratorFunction') {
wrapped = async (...args) => {
const gen = func(...args);
let value;
let it;
while (true) {
setNamespace(ns);
setScope(scope);
try {
it = gen.next(value);
} finally {
resetScope();
resetNamespace();
}
try {
value = await it.value;
} catch (e) {
setNamespace(ns);
setScope(scope);
gen.throw(e);
} finally {
resetScope();
resetNamespace();
}
if (it.done) {
break;
}
}
return value;
};
} else {
wrapped = (...args) => {
setNamespace(ns);
setScope(scope);
try {
return func(...args);
} finally {
resetNamespace();
resetScope();
}
};
}
// If function was annotated via `withSyncEvent()`, maintain the annotation.
const syncAware = func;
if (syncAware.sync) {
const syncAwareWrapped = wrapped;
syncAwareWrapped.sync = true;
return syncAwareWrapped;
}
return wrapped;
}
/**
* Accepts a function that contains imperative code which runs whenever any of
* the accessed _reactive_ properties (e.g., values from the global state or the
* context) is modified.
*
* This hook makes the element's scope available so functions like
* `getElement()` and `getContext()` can be used inside the passed callback.
*
* @param callback The hook callback.
*/
function useWatch(callback) {
utils_useSignalEffect(withScope(callback));
}
/**
* Accepts a function that contains imperative code which runs only after the
* element's first render, mainly useful for initialization logic.
*
* This hook makes the element's scope available so functions like
* `getElement()` and `getContext()` can be used inside the passed callback.
*
* @param callback The hook callback.
*/
function useInit(callback) {
y(withScope(callback), []);
}
/**
* Accepts a function that contains imperative, possibly effectful code. The
* effects run after browser paint, without blocking it.
*
* This hook is equivalent to Preact's `useEffect` and makes the element's scope
* available so functions like `getElement()` and `getContext()` can be used
* inside the passed callback.
*
* @param callback Imperative function that can return a cleanup
* function.
* @param inputs If present, effect will only activate if the
* values in the list change (using `===`).
*/
function useEffect(callback, inputs) {
y(withScope(callback), inputs);
}
/**
* Accepts a function that contains imperative, possibly effectful code. Use
* this to read layout from the DOM and synchronously re-render.
*
* This hook is equivalent to Preact's `useLayoutEffect` and makes the element's
* scope available so functions like `getElement()` and `getContext()` can be
* used inside the passed callback.
*
* @param callback Imperative function that can return a cleanup
* function.
* @param inputs If present, effect will only activate if the
* values in the list change (using `===`).
*/
function useLayoutEffect(callback, inputs) {
_(withScope(callback), inputs);
}
/**
* Returns a memoized version of the callback that only changes if one of the
* inputs has changed (using `===`).
*
* This hook is equivalent to Preact's `useCallback` and makes the element's
* scope available so functions like `getElement()` and `getContext()` can be
* used inside the passed callback.
*
* @param callback Callback function.
* @param inputs If present, the callback will only be updated if the
* values in the list change (using `===`).
*
* @return The callback function.
*/
function useCallback(callback, inputs) {
return q(withScope(callback), inputs);
}
/**
* Pass a factory function and an array of inputs. `useMemo` will only recompute
* the memoized value when one of the inputs has changed.
*
* This hook is equivalent to Preact's `useMemo` and makes the element's scope
* available so functions like `getElement()` and `getContext()` can be used
* inside the passed factory function.
*
* @param factory Factory function that returns that value for memoization.
* @param inputs If present, the factory will only be run to recompute if
* the values in the list change (using `===`).
*
* @return The memoized value.
*/
function useMemo(factory, inputs) {
return T(withScope(factory), inputs);
}
/**
* Creates a root fragment by replacing a node or an array of nodes in a parent element.
* For wrapperless hydration.
* See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c
*
* @param parent The parent element where the nodes will be replaced.
* @param replaceNode The node or array of nodes to replace in the parent element.
* @return The created root fragment.
*/
const createRootFragment = (parent, replaceNode) => {
replaceNode = [].concat(replaceNode);
const sibling = replaceNode[replaceNode.length - 1].nextSibling;
function insert(child, root) {
parent.insertBefore(child, root || sibling);
}
return parent.__k = {
nodeType: 1,
parentNode: parent,
firstChild: replaceNode[0],
childNodes: replaceNode,
insertBefore: insert,
appendChild: insert,
removeChild(c) {
parent.removeChild(c);
}
};
};
/**
* Transforms a kebab-case string to camelCase.
*
* @param str The kebab-case string to transform to camelCase.
* @return The transformed camelCase string.
*/
function kebabToCamelCase(str) {
return str.replace(/^-+|-+$/g, '').toLowerCase().replace(/-([a-z])/g, function (_match, group1) {
return group1.toUpperCase();
});
}
const logged = new Set();
/**
* Shows a warning with `message` if environment is not `production`.
*
* Based on the `@wordpress/warning` package.
*
* @param message Message to show in the warning.
*/
const warn = message => {
if (true) {
if (logged.has(message)) {
return;
}
// eslint-disable-next-line no-console
console.warn(message);
// Throwing an error and catching it immediately to improve debugging
// A consumer can use 'pause on caught exceptions'
try {
throw Error(message);
} catch (e) {
// Do nothing.
}
logged.add(message);
}
};
/**
* Checks if the passed `candidate` is a plain object with just the `Object`
* prototype.
*
* @param candidate The item to check.
* @return Whether `candidate` is a plain object.
*/
const isPlainObject = candidate => Boolean(candidate && typeof candidate === 'object' && candidate.constructor === Object);
/**
* Indicates that the passed `callback` requires synchronous access to the event object.
*
* @param callback The event callback.
* @return Altered event callback.
*/
function withSyncEvent(callback) {
const syncAware = callback;
syncAware.sync = true;
return syncAware;
}
;// ./node_modules/@wordpress/interactivity/build-module/proxies/registry.js
/**
* Proxies for each object.
*/
const objToProxy = new WeakMap();
const proxyToObj = new WeakMap();
/**
* Namespaces for each created proxy.
*/
const proxyToNs = new WeakMap();
/**
* Object types that can be proxied.
*/
const supported = new Set([Object, Array]);
/**
* Returns a proxy to the passed object with the given handlers, assigning the
* specified namespace to it. If a proxy for the passed object was created
* before, that proxy is returned.
*
* @param namespace The namespace that will be associated to this proxy.
* @param obj The object to proxify.
* @param handlers Handlers that the proxy will use.
*
* @throws Error if the object cannot be proxified. Use {@link shouldProxy} to
* check if a proxy can be created for a specific object.
*
* @return The created proxy.
*/
const createProxy = (namespace, obj, handlers) => {
if (!shouldProxy(obj)) {
throw Error('This object cannot be proxified.');
}
if (!objToProxy.has(obj)) {
const proxy = new Proxy(obj, handlers);
objToProxy.set(obj, proxy);
proxyToObj.set(proxy, obj);
proxyToNs.set(proxy, namespace);
}
return objToProxy.get(obj);
};
/**
* Returns the proxy for the given object. If there is no associated proxy, the
* function returns `undefined`.
*
* @param obj Object from which to know the proxy.
* @return Associated proxy or `undefined`.
*/
const getProxyFromObject = obj => objToProxy.get(obj);
/**
* Gets the namespace associated with the given proxy.
*
* Proxies have a namespace assigned upon creation. See {@link createProxy}.
*
* @param proxy Proxy.
* @return Namespace.
*/
const getNamespaceFromProxy = proxy => proxyToNs.get(proxy);
/**
* Checks if a given object can be proxied.
*
* @param candidate Object to know whether it can be proxied.
* @return True if the passed instance can be proxied.
*/
const shouldProxy = candidate => {
if (typeof candidate !== 'object' || candidate === null) {
return false;
}
return !proxyToNs.has(candidate) && supported.has(candidate.constructor);
};
/**
* Returns the target object for the passed proxy. If the passed object is not a registered proxy, the
* function returns `undefined`.
*
* @param proxy Proxy from which to know the target.
* @return The target object or `undefined`.
*/
const getObjectFromProxy = proxy => proxyToObj.get(proxy);
;// ./node_modules/@wordpress/interactivity/build-module/proxies/signals.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Identifier for property computeds not associated to any scope.
*/
const NO_SCOPE = {};
/**
* Structure that manages reactivity for a property in a state object. It uses
* signals to keep track of property value or getter modifications.
*/
class PropSignal {
/**
* Proxy that holds the property this PropSignal is associated with.
*/
/**
* Relation of computeds by scope. These computeds are read-only signals
* that depend on whether the property is a value or a getter and,
* therefore, can return different values depending on the scope in which
* the getter is accessed.
*/
/**
* Signal with the value assigned to the related property.
*/
/**
* Signal with the getter assigned to the related property.
*/
/**
* Structure that manages reactivity for a property in a state object, using
* signals to keep track of property value or getter modifications.
*
* @param owner Proxy that holds the property this instance is associated
* with.
*/
constructor(owner) {
this.owner = owner;
this.computedsByScope = new WeakMap();
}
/**
* Changes the internal value. If a getter was set before, it is set to
* `undefined`.
*
* @param value New value.
*/
setValue(value) {
this.update({
value
});
}
/**
* Changes the internal getter. If a value was set before, it is set to
* `undefined`.
*
* @param getter New getter.
*/
setGetter(getter) {
this.update({
get: getter
});
}
/**
* Returns the computed that holds the result of evaluating the prop in the
* current scope.
*
* These computeds are read-only signals that depend on whether the property
* is a value or a getter and, therefore, can return different values
* depending on the scope in which the getter is accessed.
*
* @return Computed that depends on the scope.
*/
getComputed() {
const scope = getScope() || NO_SCOPE;
if (!this.valueSignal && !this.getterSignal) {
this.update({});
}
if (!this.computedsByScope.has(scope)) {
const callback = () => {
const getter = this.getterSignal?.value;
return getter ? getter.call(this.owner) : this.valueSignal?.value;
};
setNamespace(getNamespaceFromProxy(this.owner));
this.computedsByScope.set(scope, signals_core_module_w(withScope(callback)));
resetNamespace();
}
return this.computedsByScope.get(scope);
}
/**
* Update the internal signals for the value and the getter of the
* corresponding prop.
*
* @param param0
* @param param0.get New getter.
* @param param0.value New value.
*/
update({
get,
value
}) {
if (!this.valueSignal) {
this.valueSignal = signals_core_module_d(value);
this.getterSignal = signals_core_module_d(get);
} else if (value !== this.valueSignal.peek() || get !== this.getterSignal.peek()) {
signals_core_module_r(() => {
this.valueSignal.value = value;
this.getterSignal.value = get;
});
}
}
}
;// ./node_modules/@wordpress/interactivity/build-module/proxies/state.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Set of built-in symbols.
*/
const wellKnownSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(key => Symbol[key]).filter(value => typeof value === 'symbol'));
/**
* Relates each proxy with a map of {@link PropSignal} instances, representing
* the proxy's accessed properties.
*/
const proxyToProps = new WeakMap();
/**
* Checks whether a {@link PropSignal | `PropSignal`} instance exists for the
* given property in the passed proxy.
*
* @param proxy Proxy of a state object or array.
* @param key The property key.
* @return `true` when it exists; false otherwise.
*/
const hasPropSignal = (proxy, key) => proxyToProps.has(proxy) && proxyToProps.get(proxy).has(key);
const readOnlyProxies = new WeakSet();
/**
* Returns the {@link PropSignal | `PropSignal`} instance associated with the
* specified prop in the passed proxy.
*
* The `PropSignal` instance is generated if it doesn't exist yet, using the
* `initial` parameter to initialize the internal signals.
*
* @param proxy Proxy of a state object or array.
* @param key The property key.
* @param initial Initial data for the `PropSignal` instance.
* @return The `PropSignal` instance.
*/
const getPropSignal = (proxy, key, initial) => {
if (!proxyToProps.has(proxy)) {
proxyToProps.set(proxy, new Map());
}
key = typeof key === 'number' ? `${key}` : key;
const props = proxyToProps.get(proxy);
if (!props.has(key)) {
const ns = getNamespaceFromProxy(proxy);
const prop = new PropSignal(proxy);
props.set(key, prop);
if (initial) {
const {
get,
value
} = initial;
if (get) {
prop.setGetter(get);
} else {
const readOnly = readOnlyProxies.has(proxy);
prop.setValue(shouldProxy(value) ? proxifyState(ns, value, {
readOnly
}) : value);
}
}
}
return props.get(key);
};
/**
* Relates each proxied object (i.e., the original object) with a signal that
* tracks changes in the number of properties.
*/
const objToIterable = new WeakMap();
/**
* When this flag is `true`, it avoids any signal subscription, overriding state
* props' "reactive" behavior.
*/
let peeking = false;
/**
* Handlers for reactive objects and arrays in the state.
*/
const stateHandlers = {
get(target, key, receiver) {
/*
* The property should not be reactive for the following cases:
* 1. While using the `peek` function to read the property.
* 2. The property exists but comes from the Object or Array prototypes.
* 3. The property key is a known symbol.
*/
if (peeking || !target.hasOwnProperty(key) && key in target || typeof key === 'symbol' && wellKnownSymbols.has(key)) {
return Reflect.get(target, key, receiver);
}
// At this point, the property should be reactive.
const desc = Object.getOwnPropertyDescriptor(target, key);
const prop = getPropSignal(receiver, key, desc);
const result = prop.getComputed().value;
/*
* Check if the property is a synchronous function. If it is, set the
* default namespace. Synchronous functions always run in the proper scope,
* which is set by the Directives component.
*/
if (typeof result === 'function') {
const ns = getNamespaceFromProxy(receiver);
return (...args) => {
setNamespace(ns);
try {
return result.call(receiver, ...args);
} finally {
resetNamespace();
}
};
}
return result;
},
set(target, key, value, receiver) {
if (readOnlyProxies.has(receiver)) {
return false;
}
setNamespace(getNamespaceFromProxy(receiver));
try {
return Reflect.set(target, key, value, receiver);
} finally {
resetNamespace();
}
},
defineProperty(target, key, desc) {
if (readOnlyProxies.has(getProxyFromObject(target))) {
return false;
}
const isNew = !(key in target);
const result = Reflect.defineProperty(target, key, desc);
if (result) {
const receiver = getProxyFromObject(target);
const prop = getPropSignal(receiver, key);
const {
get,
value
} = desc;
if (get) {
prop.setGetter(get);
} else {
const ns = getNamespaceFromProxy(receiver);
prop.setValue(shouldProxy(value) ? proxifyState(ns, value) : value);
}
if (isNew && objToIterable.has(target)) {
objToIterable.get(target).value++;
}
/*
* Modify the `length` property value only if the related
* `PropSignal` exists, which means that there are subscriptions to
* this property.
*/
if (Array.isArray(target) && proxyToProps.get(receiver)?.has('length')) {
const length = getPropSignal(receiver, 'length');
length.setValue(target.length);
}
}
return result;
},
deleteProperty(target, key) {
if (readOnlyProxies.has(getProxyFromObject(target))) {
return false;
}
const result = Reflect.deleteProperty(target, key);
if (result) {
const prop = getPropSignal(getProxyFromObject(target), key);
prop.setValue(undefined);
if (objToIterable.has(target)) {
objToIterable.get(target).value++;
}
}
return result;
},
ownKeys(target) {
if (!objToIterable.has(target)) {
objToIterable.set(target, signals_core_module_d(0));
}
/*
*This subscribes to the signal while preventing the minifier from
* deleting this line in production.
*/
objToIterable._ = objToIterable.get(target).value;
return Reflect.ownKeys(target);
}
};
/**
* Returns the proxy associated with the given state object, creating it if it
* does not exist.
*
* @param namespace The namespace that will be associated to this proxy.
* @param obj The object to proxify.
* @param options Options.
* @param options.readOnly Read-only.
*
* @throws Error if the object cannot be proxified. Use {@link shouldProxy} to
* check if a proxy can be created for a specific object.
*
* @return The associated proxy.
*/
const proxifyState = (namespace, obj, options) => {
const proxy = createProxy(namespace, obj, stateHandlers);
if (options?.readOnly) {
readOnlyProxies.add(proxy);
}
return proxy;
};
/**
* Reads the value of the specified property without subscribing to it.
*
* @param obj The object to read the property from.
* @param key The property key.
* @return The property value.
*/
const peek = (obj, key) => {
peeking = true;
try {
return obj[key];
} finally {
peeking = false;
}
};
/**
* Internal recursive implementation for {@link deepMerge | `deepMerge`}.
*
* @param target The target object.
* @param source The source object containing new values and props.
* @param override Whether existing props should be overwritten or not (`true`
* by default).
*/
const deepMergeRecursive = (target, source, override = true) => {
// If target is not a plain object and the source is, we don't need to merge
// them because the source will be used as the new value of the target.
if (!(isPlainObject(target) && isPlainObject(source))) {
return;
}
let hasNewKeys = false;
for (const key in source) {
const isNew = !(key in target);
hasNewKeys = hasNewKeys || isNew;
const desc = Object.getOwnPropertyDescriptor(source, key);
const proxy = getProxyFromObject(target);
const propSignal = !!proxy && hasPropSignal(proxy, key) && getPropSignal(proxy, key);
// Handle getters and setters
if (typeof desc.get === 'function' || typeof desc.set === 'function') {
if (override || isNew) {
// Because we are setting a getter or setter, we need to use
// Object.defineProperty to define the property on the target object.
Object.defineProperty(target, key, {
...desc,
configurable: true,
enumerable: true
});
// Update the getter in the property signal if it exists
if (desc.get && propSignal) {
propSignal.setGetter(desc.get);
}
}
// Handle nested objects
} else if (isPlainObject(source[key])) {
const targetValue = Object.getOwnPropertyDescriptor(target, key)?.value;
if (isNew || override && !isPlainObject(targetValue)) {
// Create a new object if the property is new or needs to be overridden
target[key] = {};
if (propSignal) {
// Create a new proxified state for the nested object
const ns = getNamespaceFromProxy(proxy);
propSignal.setValue(proxifyState(ns, target[key]));
}
deepMergeRecursive(target[key], source[key], override);
}
// Both target and source are plain objects, merge them recursively
else if (isPlainObject(targetValue)) {
deepMergeRecursive(target[key], source[key], override);
}
// Handle primitive values and non-plain objects
} else if (override || isNew) {
Object.defineProperty(target, key, desc);
if (propSignal) {
const {
value
} = desc;
const ns = getNamespaceFromProxy(proxy);
// Proxify the value if necessary before setting it in the signal
propSignal.setValue(shouldProxy(value) ? proxifyState(ns, value) : value);
}
}
}
if (hasNewKeys && objToIterable.has(target)) {
objToIterable.get(target).value++;
}
};
/**
* Recursively update prop values inside the passed `target` and nested plain
* objects, using the values present in `source`. References to plain objects
* are kept, only updating props containing primitives or arrays. Arrays are
* replaced instead of merged or concatenated.
*
* If the `override` parameter is set to `false`, then all values in `target`
* are preserved, and only new properties from `source` are added.
*
* @param target The target object.
* @param source The source object containing new values and props.
* @param override Whether existing props should be overwritten or not (`true`
* by default).
*/
const deepMerge = (target, source, override = true) => signals_core_module_r(() => deepMergeRecursive(getObjectFromProxy(target) || target, source, override));
;// ./node_modules/@wordpress/interactivity/build-module/proxies/store.js
/**
* Internal dependencies
*/
/**
* External dependencies
*/
/**
* Identifies the store proxies handling the root objects of each store.
*/
const storeRoots = new WeakSet();
/**
* Handlers for store proxies.
*/
const storeHandlers = {
get: (target, key, receiver) => {
const result = Reflect.get(target, key);
const ns = getNamespaceFromProxy(receiver);
/*
* Check if the proxy is the store root and no key with that name exist. In
* that case, return an empty object for the requested key.
*/
if (typeof result === 'undefined' && storeRoots.has(receiver)) {
const obj = {};
Reflect.set(target, key, obj);
return proxifyStore(ns, obj, false);
}
/*
* Check if the property is a function. If it is, add the store
* namespace to the stack and wrap the function with the current scope.
* The `withScope` util handles both synchronous functions and generator
* functions.
*/
if (typeof result === 'function') {
setNamespace(ns);
const scoped = withScope(result);
resetNamespace();
return scoped;
}
// Check if the property is an object. If it is, proxyify it.
if (isPlainObject(result) && shouldProxy(result)) {
return proxifyStore(ns, result, false);
}
return result;
}
};
/**
* Returns the proxy associated with the given store object, creating it if it
* does not exist.
*
* @param namespace The namespace that will be associated to this proxy.
* @param obj The object to proxify.
*
* @param isRoot Whether the passed object is the store root object.
* @throws Error if the object cannot be proxified. Use {@link shouldProxy} to
* check if a proxy can be created for a specific object.
*
* @return The associated proxy.
*/
const proxifyStore = (namespace, obj, isRoot = true) => {
const proxy = createProxy(namespace, obj, storeHandlers);
if (proxy && isRoot) {
storeRoots.add(proxy);
}
return proxy;
};
;// ./node_modules/@wordpress/interactivity/build-module/proxies/context.js
const contextObjectToProxy = new WeakMap();
const contextObjectToFallback = new WeakMap();
const contextProxies = new WeakSet();
const descriptor = Reflect.getOwnPropertyDescriptor;
// TODO: Use the proxy registry to avoid multiple proxies on the same object.
const contextHandlers = {
get: (target, key) => {
const fallback = contextObjectToFallback.get(target);
// Always subscribe to prop changes in the current context.
const currentProp = target[key];
/*
* Return the value from `target` if it exists, or from `fallback`
* otherwise. This way, in the case the property doesn't exist either in
* `target` or `fallback`, it also subscribes to changes in the parent
* context.
*/
return key in target ? currentProp : fallback[key];
},
set: (target, key, value) => {
const fallback = contextObjectToFallback.get(target);
// If the property exists in the current context, modify it. Otherwise,
// add it to the current context.
const obj = key in target || !(key in fallback) ? target : fallback;
obj[key] = value;
return true;
},
ownKeys: target => [...new Set([...Object.keys(contextObjectToFallback.get(target)), ...Object.keys(target)])],
getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key),
has: (target, key) => Reflect.has(target, key) || Reflect.has(contextObjectToFallback.get(target), key)
};
/**
* Wrap a context object with a proxy to reproduce the context stack. The proxy
* uses the passed `inherited` context as a fallback to look up for properties
* that don't exist in the given context. Also, updated properties are modified
* where they are defined, or added to the main context when they don't exist.
*
* @param current Current context.
* @param inherited Inherited context, used as fallback.
*
* @return The wrapped context object.
*/
const proxifyContext = (current, inherited = {}) => {
if (contextProxies.has(current)) {
throw Error('This object cannot be proxified.');
}
// Update the fallback object reference when it changes.
contextObjectToFallback.set(current, inherited);
if (!contextObjectToProxy.has(current)) {
const proxy = new Proxy(current, contextHandlers);
contextObjectToProxy.set(current, proxy);
contextProxies.add(proxy);
}
return contextObjectToProxy.get(current);
};
;// ./node_modules/@wordpress/interactivity/build-module/proxies/index.js
/**
* Internal dependencies
*/
;// ./node_modules/@wordpress/interactivity/build-module/store.js
/**
* Internal dependencies
*/
/**
* External dependencies
*/
const stores = new Map();
const rawStores = new Map();
const storeLocks = new Map();
const storeConfigs = new Map();
const serverStates = new Map();
/**
* Get the defined config for the store with the passed namespace.
*
* @param namespace Store's namespace from which to retrieve the config.
* @return Defined config for the given namespace.
*/
const getConfig = namespace => storeConfigs.get(namespace || getNamespace()) || {};
/**
* Get the part of the state defined and updated from the server.
*
* The object returned is read-only, and includes the state defined in PHP with
* `wp_interactivity_state()`. When using `actions.navigate()`, this object is
* updated to reflect the changes in its properties, without affecting the state
* returned by `store()`. Directives can subscribe to those changes to update
* the state if needed.
*
* @example
* ```js
* const { state } = store('myStore', {
* callbacks: {
* updateServerState() {
* const serverState = getServerState();
* // Override some property with the new value that came from the server.
* state.overridableProp = serverState.overridableProp;
* },
* },
* });
* ```
*
* @param namespace Store's namespace from which to retrieve the server state.
* @return The server state for the given namespace.
*/
const getServerState = namespace => {
const ns = namespace || getNamespace();
if (!serverStates.has(ns)) {
serverStates.set(ns, proxifyState(ns, {}, {
readOnly: true
}));
}
return serverStates.get(ns);
};
const universalUnlock = 'I acknowledge that using a private store means my plugin will inevitably break on the next store release.';
/**
* Extends the Interactivity API global store adding the passed properties to
* the given namespace. It also returns stable references to the namespace
* content.
*
* These props typically consist of `state`, which is the reactive part of the
* store ― which means that any directive referencing a state property will be
* re-rendered anytime it changes ― and function properties like `actions` and
* `callbacks`, mostly used for event handlers. These props can then be
* referenced by any directive to make the HTML interactive.
*
* @example
* ```js
* const { state } = store( 'counter', {
* state: {
* value: 0,
* get double() { return state.value * 2; },
* },
* actions: {
* increment() {
* state.value += 1;
* },
* },
* } );
* ```
*
* The code from the example above allows blocks to subscribe and interact with
* the store by using directives in the HTML, e.g.:
*
* ```html
* <div data-wp-interactive="counter">
* <button
* data-wp-text="state.double"
* data-wp-on--click="actions.increment"
* >
* 0
* </button>
* </div>
* ```
* @param namespace The store namespace to interact with.
* @param storePart Properties to add to the store namespace.
* @param options Options for the given namespace.
*
* @return A reference to the namespace content.
*/
// Overload for when the types are inferred.
// Overload for when types are passed via generics and they contain state.
// Overload for when types are passed via generics and they don't contain state.
// Overload for when types are divided into multiple parts.
function store(namespace, {
state = {},
...block
} = {}, {
lock = false
} = {}) {
if (!stores.has(namespace)) {
// Lock the store if the passed lock is different from the universal
// unlock. Once the lock is set (either false, true, or a given string),
// it cannot change.
if (lock !== universalUnlock) {
storeLocks.set(namespace, lock);
}
const rawStore = {
state: proxifyState(namespace, isPlainObject(state) ? state : {}),
...block
};
const proxifiedStore = proxifyStore(namespace, rawStore);
rawStores.set(namespace, rawStore);
stores.set(namespace, proxifiedStore);
} else {
// Lock the store if it wasn't locked yet and the passed lock is
// different from the universal unlock. If no lock is given, the store
// will be public and won't accept any lock from now on.
if (lock !== universalUnlock && !storeLocks.has(namespace)) {
storeLocks.set(namespace, lock);
} else {
const storeLock = storeLocks.get(namespace);
const isLockValid = lock === universalUnlock || lock !== true && lock === storeLock;
if (!isLockValid) {
if (!storeLock) {
throw Error('Cannot lock a public store');
} else {
throw Error('Cannot unlock a private store with an invalid lock code');
}
}
}
const target = rawStores.get(namespace);
deepMerge(target, block);
deepMerge(target.state, state);
}
return stores.get(namespace);
}
const parseServerData = (dom = document) => {
var _dom$getElementById;
const jsonDataScriptTag = // Preferred Script Module data passing form
(_dom$getElementById = dom.getElementById('wp-script-module-data-@wordpress/interactivity')) !== null && _dom$getElementById !== void 0 ? _dom$getElementById :
// Legacy form
dom.getElementById('wp-interactivity-data');
if (jsonDataScriptTag?.textContent) {
try {
return JSON.parse(jsonDataScriptTag.textContent);
} catch {}
}
return {};
};
const populateServerData = data => {
if (isPlainObject(data?.state)) {
Object.entries(data.state).forEach(([namespace, state]) => {
const st = store(namespace, {}, {
lock: universalUnlock
});
deepMerge(st.state, state, false);
deepMerge(getServerState(namespace), state);
});
}
if (isPlainObject(data?.config)) {
Object.entries(data.config).forEach(([namespace, config]) => {
storeConfigs.set(namespace, config);
});
}
};
// Parse and populate the initial state and config.
const data = parseServerData();
populateServerData(data);
;// ./node_modules/@wordpress/interactivity/build-module/hooks.js
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable react-hooks/exhaustive-deps */
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function isNonDefaultDirectiveSuffix(entry) {
return entry.suffix !== null;
}
function isDefaultDirectiveSuffix(entry) {
return entry.suffix === null;
}
// Main context.
const context = (0,preact_module/* createContext */.q6)({
client: {},
server: {}
});
// WordPress Directives.
const directiveCallbacks = {};
const directivePriorities = {};
/**
* Register a new directive type in the Interactivity API runtime.
*
* @example
* ```js
* directive(
* 'alert', // Name without the `data-wp-` prefix.
* ( { directives: { alert }, element, evaluate } ) => {
* const defaultEntry = alert.find( isDefaultDirectiveSuffix );
* element.props.onclick = () => { alert( evaluate( defaultEntry ) ); }
* }
* )
* ```
*
* The previous code registers a custom directive type for displaying an alert
* message whenever an element using it is clicked. The message text is obtained
* from the store under the inherited namespace, using `evaluate`.
*
* When the HTML is processed by the Interactivity API, any element containing
* the `data-wp-alert` directive will have the `onclick` event handler, e.g.,
*
* ```html
* <div data-wp-interactive="messages">
* <button data-wp-alert="state.alert">Click me!</button>
* </div>
* ```
* Note that, in the previous example, the directive callback gets the path
* value (`state.alert`) from the directive entry with suffix `null`. A
* custom suffix can also be specified by appending `--` to the directive
* attribute, followed by the suffix, like in the following HTML snippet:
*
* ```html
* <div data-wp-interactive="myblock">
* <button
* data-wp-color--text="state.text"
* data-wp-color--background="state.background"
* >Click me!</button>
* </div>
* ```
*
* This could be an hypothetical implementation of the custom directive used in
* the snippet above.
*
* @example
* ```js
* directive(
* 'color', // Name without prefix and suffix.
* ( { directives: { color: colors }, ref, evaluate } ) =>
* colors.forEach( ( color ) => {
* if ( color.suffix = 'text' ) {
* ref.style.setProperty(
* 'color',
* evaluate( color.text )
* );
* }
* if ( color.suffix = 'background' ) {
* ref.style.setProperty(
* 'background-color',
* evaluate( color.background )
* );
* }
* } );
* }
* )
* ```
*
* @param name Directive name, without the `data-wp-` prefix.
* @param callback Function that runs the directive logic.
* @param options Options object.
* @param options.priority Option to control the directive execution order. The
* lesser, the highest priority. Default is `10`.
*/
const directive = (name, callback, {
priority = 10
} = {}) => {
directiveCallbacks[name] = callback;
directivePriorities[name] = priority;
};
// Resolve the path to some property of the store object.
const resolve = (path, namespace) => {
if (!namespace) {
warn(`Namespace missing for "${path}". The value for that path won't be resolved.`);
return;
}
let resolvedStore = stores.get(namespace);
if (typeof resolvedStore === 'undefined') {
resolvedStore = store(namespace, {}, {
lock: universalUnlock
});
}
const current = {
...resolvedStore,
context: getScope().context[namespace]
};
try {
// TODO: Support lazy/dynamically initialized stores
return path.split('.').reduce((acc, key) => acc[key], current);
} catch (e) {}
};
// Generate the evaluate function.
const getEvaluate = ({
scope
}) =>
// TODO: When removing the temporarily remaining `value( ...args )` call below, remove the `...args` parameter too.
(entry, ...args) => {
let {
value: path,
namespace
} = entry;
if (typeof path !== 'string') {
throw new Error('The `value` prop should be a string path');
}
// If path starts with !, remove it and save a flag.
const hasNegationOperator = path[0] === '!' && !!(path = path.slice(1));
setScope(scope);
const value = resolve(path, namespace);
// Functions are returned without invoking them.
if (typeof value === 'function') {
// Except if they have a negation operator present, for backward compatibility.
// This pattern is strongly discouraged and deprecated, and it will be removed in a near future release.
// TODO: Remove this condition to effectively ignore negation operator when provided with a function.
if (hasNegationOperator) {
warn('Using a function with a negation operator is deprecated and will stop working in WordPress 6.9. Please use derived state instead.');
const functionResult = !value(...args);
resetScope();
return functionResult;
}
// Reset scope before return and wrap the function so it will still run within the correct scope.
resetScope();
return (...functionArgs) => {
setScope(scope);
const functionResult = value(...functionArgs);
resetScope();
return functionResult;
};
}
const result = value;
resetScope();
return hasNegationOperator ? !result : result;
};
// Separate directives by priority. The resulting array contains objects
// of directives grouped by same priority, and sorted in ascending order.
const getPriorityLevels = directives => {
const byPriority = Object.keys(directives).reduce((obj, name) => {
if (directiveCallbacks[name]) {
const priority = directivePriorities[name];
(obj[priority] = obj[priority] || []).push(name);
}
return obj;
}, {});
return Object.entries(byPriority).sort(([p1], [p2]) => parseInt(p1) - parseInt(p2)).map(([, arr]) => arr);
};
// Component that wraps each priority level of directives of an element.
const Directives = ({
directives,
priorityLevels: [currentPriorityLevel, ...nextPriorityLevels],
element,
originalProps,
previousScope
}) => {
// Initialize the scope of this element. These scopes are different per each
// level because each level has a different context, but they share the same
// element ref, state and props.
const scope = A({}).current;
scope.evaluate = q(getEvaluate({
scope
}), []);
const {
client,
server
} = x(context);
scope.context = client;
scope.serverContext = server;
/* eslint-disable react-hooks/rules-of-hooks */
scope.ref = previousScope?.ref || A(null);
/* eslint-enable react-hooks/rules-of-hooks */
// Create a fresh copy of the vnode element and add the props to the scope,
// named as attributes (HTML Attributes).
element = (0,preact_module/* cloneElement */.Ob)(element, {
ref: scope.ref
});
scope.attributes = element.props;
// Recursively render the wrapper for the next priority level.
const children = nextPriorityLevels.length > 0 ? (0,preact_module.h)(Directives, {
directives,
priorityLevels: nextPriorityLevels,
element,
originalProps,
previousScope: scope
}) : element;
const props = {
...originalProps,
children
};
const directiveArgs = {
directives,
props,
element,
context,
evaluate: scope.evaluate
};
setScope(scope);
for (const directiveName of currentPriorityLevel) {
const wrapper = directiveCallbacks[directiveName]?.(directiveArgs);
if (wrapper !== undefined) {
props.children = wrapper;
}
}
resetScope();
return props.children;
};
// Preact Options Hook called each time a vnode is created.
const old = preact_module/* options */.fF.vnode;
preact_module/* options */.fF.vnode = vnode => {
if (vnode.props.__directives) {
const props = vnode.props;
const directives = props.__directives;
if (directives.key) {
vnode.key = directives.key.find(isDefaultDirectiveSuffix).value;
}
delete props.__directives;
const priorityLevels = getPriorityLevels(directives);
if (priorityLevels.length > 0) {
vnode.props = {
directives,
priorityLevels,
originalProps: props,
type: vnode.type,
element: (0,preact_module.h)(vnode.type, props),
top: true
};
vnode.type = Directives;
}
}
if (old) {
old(vnode);
}
};
;// ./node_modules/@wordpress/interactivity/build-module/directives.js
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable react-hooks/exhaustive-deps */
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Recursively clone the passed object.
*
* @param source Source object.
* @return Cloned object.
*/
function deepClone(source) {
if (isPlainObject(source)) {
return Object.fromEntries(Object.entries(source).map(([key, value]) => [key, deepClone(value)]));
}
if (Array.isArray(source)) {
return source.map(i => deepClone(i));
}
return source;
}
/**
* Wraps event object to warn about access of synchronous properties and methods.
*
* For all store actions attached to an event listener the event object is proxied via this function, unless the action
* uses the `withSyncEvent()` utility to indicate that it requires synchronous access to the event object.
*
* At the moment, the proxied event only emits warnings when synchronous properties or methods are being accessed. In
* the future this will be changed and result in an error. The current temporary behavior allows implementers to update
* their relevant actions to use `withSyncEvent()`.
*
* For additional context, see https://github.com/WordPress/gutenberg/issues/64944.
*
* @param event Event object.
* @return Proxied event object.
*/
function wrapEventAsync(event) {
const handler = {
get(target, prop, receiver) {
const value = target[prop];
switch (prop) {
case 'currentTarget':
warn(`Accessing the synchronous event.${prop} property in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 6.9. Please wrap the store action in withSyncEvent().`);
break;
case 'preventDefault':
case 'stopImmediatePropagation':
case 'stopPropagation':
warn(`Using the synchronous event.${prop}() function in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 6.9. Please wrap the store action in withSyncEvent().`);
break;
}
if (value instanceof Function) {
return function (...args) {
return value.apply(this === receiver ? target : this, args);
};
}
return value;
}
};
return new Proxy(event, handler);
}
const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
const ruleClean = /\/\*[^]*?\*\/| +/g;
const ruleNewline = /\n+/g;
const empty = ' ';
/**
* Convert a css style string into a object.
*
* Made by Cristian Bote (@cristianbote) for Goober.
* https://unpkg.com/browse/goober@2.1.13/src/core/astish.js
*
* @param val CSS string.
* @return CSS object.
*/
const cssStringToObject = val => {
const tree = [{}];
let block, left;
while (block = newRule.exec(val.replace(ruleClean, ''))) {
if (block[4]) {
tree.shift();
} else if (block[3]) {
left = block[3].replace(ruleNewline, empty).trim();
tree.unshift(tree[0][left] = tree[0][left] || {});
} else {
tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
}
}
return tree[0];
};
/**
* Creates a directive that adds an event listener to the global window or
* document object.
*
* @param type 'window' or 'document'
*/
const getGlobalEventDirective = type => {
return ({
directives,
evaluate
}) => {
directives[`on-${type}`].filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const eventName = entry.suffix.split('--', 1)[0];
useInit(() => {
const cb = event => {
const result = evaluate(entry);
if (typeof result === 'function') {
if (!result?.sync) {
event = wrapEventAsync(event);
}
result(event);
}
};
const globalVar = type === 'window' ? window : document;
globalVar.addEventListener(eventName, cb);
return () => globalVar.removeEventListener(eventName, cb);
});
});
};
};
/**
* Creates a directive that adds an async event listener to the global window or
* document object.
*
* @param type 'window' or 'document'
*/
const getGlobalAsyncEventDirective = type => {
return ({
directives,
evaluate
}) => {
directives[`on-async-${type}`].filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const eventName = entry.suffix.split('--', 1)[0];
useInit(() => {
const cb = async event => {
await splitTask();
const result = evaluate(entry);
if (typeof result === 'function') {
result(event);
}
};
const globalVar = type === 'window' ? window : document;
globalVar.addEventListener(eventName, cb, {
passive: true
});
return () => globalVar.removeEventListener(eventName, cb);
});
});
};
};
/* harmony default export */ const directives = (() => {
// data-wp-context
directive('context', ({
directives: {
context
},
props: {
children
},
context: inheritedContext
}) => {
const {
Provider
} = inheritedContext;
const defaultEntry = context.find(isDefaultDirectiveSuffix);
const {
client: inheritedClient,
server: inheritedServer
} = x(inheritedContext);
const ns = defaultEntry.namespace;
const client = A(proxifyState(ns, {}));
const server = A(proxifyState(ns, {}, {
readOnly: true
}));
// No change should be made if `defaultEntry` does not exist.
const contextStack = T(() => {
const result = {
client: {
...inheritedClient
},
server: {
...inheritedServer
}
};
if (defaultEntry) {
const {
namespace,
value
} = defaultEntry;
// Check that the value is a JSON object. Send a console warning if not.
if (!isPlainObject(value)) {
warn(`The value of data-wp-context in "${namespace}" store must be a valid stringified JSON object.`);
}
deepMerge(client.current, deepClone(value), false);
deepMerge(server.current, deepClone(value));
result.client[namespace] = proxifyContext(client.current, inheritedClient[namespace]);
result.server[namespace] = proxifyContext(server.current, inheritedServer[namespace]);
}
return result;
}, [defaultEntry, inheritedClient, inheritedServer]);
return (0,preact_module.h)(Provider, {
value: contextStack
}, children);
}, {
priority: 5
});
// data-wp-watch--[name]
directive('watch', ({
directives: {
watch
},
evaluate
}) => {
watch.forEach(entry => {
useWatch(() => {
let start;
if (false) {}
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
if (false) {}
return result;
});
});
});
// data-wp-init--[name]
directive('init', ({
directives: {
init
},
evaluate
}) => {
init.forEach(entry => {
// TODO: Replace with useEffect to prevent unneeded scopes.
useInit(() => {
let start;
if (false) {}
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
if (false) {}
return result;
});
});
});
// data-wp-on--[event]
directive('on', ({
directives: {
on
},
element,
evaluate
}) => {
const events = new Map();
on.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const event = entry.suffix.split('--')[0];
if (!events.has(event)) {
events.set(event, new Set());
}
events.get(event).add(entry);
});
events.forEach((entries, eventType) => {
const existingHandler = element.props[`on${eventType}`];
element.props[`on${eventType}`] = event => {
entries.forEach(entry => {
if (existingHandler) {
existingHandler(event);
}
let start;
if (false) {}
const result = evaluate(entry);
if (typeof result === 'function') {
if (!result?.sync) {
event = wrapEventAsync(event);
}
result(event);
}
if (false) {}
});
};
});
});
// data-wp-on-async--[event]
directive('on-async', ({
directives: {
'on-async': onAsync
},
element,
evaluate
}) => {
const events = new Map();
onAsync.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const event = entry.suffix.split('--')[0];
if (!events.has(event)) {
events.set(event, new Set());
}
events.get(event).add(entry);
});
events.forEach((entries, eventType) => {
const existingHandler = element.props[`on${eventType}`];
element.props[`on${eventType}`] = event => {
if (existingHandler) {
existingHandler(event);
}
entries.forEach(async entry => {
await splitTask();
const result = evaluate(entry);
if (typeof result === 'function') {
result(event);
}
});
};
});
});
// data-wp-on-window--[event]
directive('on-window', getGlobalEventDirective('window'));
// data-wp-on-document--[event]
directive('on-document', getGlobalEventDirective('document'));
// data-wp-on-async-window--[event]
directive('on-async-window', getGlobalAsyncEventDirective('window'));
// data-wp-on-async-document--[event]
directive('on-async-document', getGlobalAsyncEventDirective('document'));
// data-wp-class--[classname]
directive('class', ({
directives: {
class: classNames
},
element,
evaluate
}) => {
classNames.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const className = entry.suffix;
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
const currentClass = element.props.class || '';
const classFinder = new RegExp(`(^|\\s)${className}(\\s|$)`, 'g');
if (!result) {
element.props.class = currentClass.replace(classFinder, ' ').trim();
} else if (!classFinder.test(currentClass)) {
element.props.class = currentClass ? `${currentClass} ${className}` : className;
}
useInit(() => {
/*
* This seems necessary because Preact doesn't change the class
* names on the hydration, so we have to do it manually. It doesn't
* need deps because it only needs to do it the first time.
*/
if (!result) {
element.ref.current.classList.remove(className);
} else {
element.ref.current.classList.add(className);
}
});
});
});
// data-wp-style--[style-prop]
directive('style', ({
directives: {
style
},
element,
evaluate
}) => {
style.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const styleProp = entry.suffix;
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
element.props.style = element.props.style || {};
if (typeof element.props.style === 'string') {
element.props.style = cssStringToObject(element.props.style);
}
if (!result) {
delete element.props.style[styleProp];
} else {
element.props.style[styleProp] = result;
}
useInit(() => {
/*
* This seems necessary because Preact doesn't change the styles on
* the hydration, so we have to do it manually. It doesn't need deps
* because it only needs to do it the first time.
*/
if (!result) {
element.ref.current.style.removeProperty(styleProp);
} else {
element.ref.current.style[styleProp] = result;
}
});
});
});
// data-wp-bind--[attribute]
directive('bind', ({
directives: {
bind
},
element,
evaluate
}) => {
bind.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const attribute = entry.suffix;
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
element.props[attribute] = result;
/*
* This is necessary because Preact doesn't change the attributes on the
* hydration, so we have to do it manually. It only needs to do it the
* first time. After that, Preact will handle the changes.
*/
useInit(() => {
const el = element.ref.current;
/*
* We set the value directly to the corresponding HTMLElement instance
* property excluding the following special cases. We follow Preact's
* logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129
*/
if (attribute === 'style') {
if (typeof result === 'string') {
el.style.cssText = result;
}
return;
} else if (attribute !== 'width' && attribute !== 'height' && attribute !== 'href' && attribute !== 'list' && attribute !== 'form' &&
/*
* The value for `tabindex` follows the parsing rules for an
* integer. If that fails, or if the attribute isn't present, then
* the browsers should "follow platform conventions to determine if
* the element should be considered as a focusable area",
* practically meaning that most elements get a default of `-1` (not
* focusable), but several also get a default of `0` (focusable in
* order after all elements with a positive `tabindex` value).
*
* @see https://html.spec.whatwg.org/#tabindex-value
*/
attribute !== 'tabIndex' && attribute !== 'download' && attribute !== 'rowSpan' && attribute !== 'colSpan' && attribute !== 'role' && attribute in el) {
try {
el[attribute] = result === null || result === undefined ? '' : result;
return;
} catch (err) {}
}
/*
* aria- and data- attributes have no boolean representation.
* A `false` value is different from the attribute not being
* present, so we can't remove it.
* We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136
*/
if (result !== null && result !== undefined && (result !== false || attribute[4] === '-')) {
el.setAttribute(attribute, result);
} else {
el.removeAttribute(attribute);
}
});
});
});
// data-wp-ignore
directive('ignore', ({
element: {
type: Type,
props: {
innerHTML,
...rest
}
}
}) => {
// Preserve the initial inner HTML.
const cached = T(() => innerHTML, []);
return (0,preact_module.h)(Type, {
dangerouslySetInnerHTML: {
__html: cached
},
...rest
});
});
// data-wp-text
directive('text', ({
directives: {
text
},
element,
evaluate
}) => {
const entry = text.find(isDefaultDirectiveSuffix);
if (!entry) {
element.props.children = null;
return;
}
try {
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
element.props.children = typeof result === 'object' ? null : result.toString();
} catch (e) {
element.props.children = null;
}
});
// data-wp-run
directive('run', ({
directives: {
run
},
evaluate
}) => {
run.forEach(entry => {
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
return result;
});
});
// data-wp-each--[item]
directive('each', ({
directives: {
each,
'each-key': eachKey
},
context: inheritedContext,
element,
evaluate
}) => {
if (element.type !== 'template') {
return;
}
const {
Provider
} = inheritedContext;
const inheritedValue = x(inheritedContext);
const [entry] = each;
const {
namespace
} = entry;
let iterable = evaluate(entry);
if (typeof iterable === 'function') {
iterable = iterable();
}
if (typeof iterable?.[Symbol.iterator] !== 'function') {
return;
}
const itemProp = isNonDefaultDirectiveSuffix(entry) ? kebabToCamelCase(entry.suffix) : 'item';
const result = [];
for (const item of iterable) {
const itemContext = proxifyContext(proxifyState(namespace, {}), inheritedValue.client[namespace]);
const mergedContext = {
client: {
...inheritedValue.client,
[namespace]: itemContext
},
server: {
...inheritedValue.server
}
};
// Set the item after proxifying the context.
mergedContext.client[namespace][itemProp] = item;
const scope = {
...getScope(),
context: mergedContext.client,
serverContext: mergedContext.server
};
const key = eachKey ? getEvaluate({
scope
})(eachKey[0]) : item;
result.push((0,preact_module.h)(Provider, {
value: mergedContext,
key
}, element.props.content));
}
return result;
}, {
priority: 20
});
directive('each-child', () => null, {
priority: 1
});
});
;// ./node_modules/@wordpress/interactivity/build-module/constants.js
const directivePrefix = 'wp';
;// ./node_modules/@wordpress/interactivity/build-module/vdom.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
const ignoreAttr = `data-${directivePrefix}-ignore`;
const islandAttr = `data-${directivePrefix}-interactive`;
const fullPrefix = `data-${directivePrefix}-`;
const namespaces = [];
const currentNamespace = () => {
var _namespaces;
return (_namespaces = namespaces[namespaces.length - 1]) !== null && _namespaces !== void 0 ? _namespaces : null;
};
const isObject = item => Boolean(item && typeof item === 'object' && item.constructor === Object);
// Regular expression for directive parsing.
const directiveParser = new RegExp(`^data-${directivePrefix}-` +
// ${p} must be a prefix string, like 'wp'.
// Match alphanumeric characters including hyphen-separated
// segments. It excludes underscore intentionally to prevent confusion.
// E.g., "custom-directive".
'([a-z0-9]+(?:-[a-z0-9]+)*)' +
// (Optional) Match '--' followed by any alphanumeric characters. It
// excludes underscore intentionally to prevent confusion, but it can
// contain multiple hyphens. E.g., "--custom-prefix--with-more-info".
'(?:--([a-z0-9_-]+))?$', 'i' // Case insensitive.
);
// Regular expression for reference parsing. It can contain a namespace before
// the reference, separated by `::`, like `some-namespace::state.somePath`.
// Namespaces can contain any alphanumeric characters, hyphens, underscores or
// forward slashes. References don't have any restrictions.
const nsPathRegExp = /^([\w_\/-]+)::(.+)$/;
const hydratedIslands = new WeakSet();
/**
* Recursive function that transforms a DOM tree into vDOM.
*
* @param root The root element or node to start traversing on.
* @return The resulting vDOM tree.
*/
function toVdom(root) {
const treeWalker = document.createTreeWalker(root, 205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT
);
function walk(node) {
const {
nodeType
} = node;
// TEXT_NODE (3)
if (nodeType === 3) {
return [node.data];
}
// CDATA_SECTION_NODE (4)
if (nodeType === 4) {
var _nodeValue;
const next = treeWalker.nextSibling();
node.replaceWith(new window.Text((_nodeValue = node.nodeValue) !== null && _nodeValue !== void 0 ? _nodeValue : ''));
return [node.nodeValue, next];
}
// COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7)
if (nodeType === 8 || nodeType === 7) {
const next = treeWalker.nextSibling();
node.remove();
return [null, next];
}
const elementNode = node;
const {
attributes
} = elementNode;
const localName = elementNode.localName;
const props = {};
const children = [];
const directives = [];
let ignore = false;
let island = false;
for (let i = 0; i < attributes.length; i++) {
const attributeName = attributes[i].name;
const attributeValue = attributes[i].value;
if (attributeName[fullPrefix.length] && attributeName.slice(0, fullPrefix.length) === fullPrefix) {
if (attributeName === ignoreAttr) {
ignore = true;
} else {
var _regexResult$, _regexResult$2;
const regexResult = nsPathRegExp.exec(attributeValue);
const namespace = (_regexResult$ = regexResult?.[1]) !== null && _regexResult$ !== void 0 ? _regexResult$ : null;
let value = (_regexResult$2 = regexResult?.[2]) !== null && _regexResult$2 !== void 0 ? _regexResult$2 : attributeValue;
try {
const parsedValue = JSON.parse(value);
value = isObject(parsedValue) ? parsedValue : value;
} catch {}
if (attributeName === islandAttr) {
island = true;
const islandNamespace =
// eslint-disable-next-line no-nested-ternary
typeof value === 'string' ? value : typeof value?.namespace === 'string' ? value.namespace : null;
namespaces.push(islandNamespace);
} else {
directives.push([attributeName, namespace, value]);
}
}
} else if (attributeName === 'ref') {
continue;
}
props[attributeName] = attributeValue;
}
if (ignore && !island) {
return [(0,preact_module.h)(localName, {
...props,
innerHTML: elementNode.innerHTML,
__directives: {
ignore: true
}
})];
}
if (island) {
hydratedIslands.add(elementNode);
}
if (directives.length) {
props.__directives = directives.reduce((obj, [name, ns, value]) => {
const directiveMatch = directiveParser.exec(name);
if (directiveMatch === null) {
warn(`Found malformed directive name: ${name}.`);
return obj;
}
const prefix = directiveMatch[1] || '';
const suffix = directiveMatch[2] || null;
obj[prefix] = obj[prefix] || [];
obj[prefix].push({
namespace: ns !== null && ns !== void 0 ? ns : currentNamespace(),
value: value,
suffix
});
return obj;
}, {});
}
if (localName === 'template') {
props.content = [...elementNode.content.childNodes].map(childNode => toVdom(childNode));
} else {
let child = treeWalker.firstChild();
if (child) {
while (child) {
const [vnode, nextChild] = walk(child);
if (vnode) {
children.push(vnode);
}
child = nextChild || treeWalker.nextSibling();
}
treeWalker.parentNode();
}
}
// Restore previous namespace.
if (island) {
namespaces.pop();
}
return [(0,preact_module.h)(localName, props, children)];
}
return walk(treeWalker.currentNode);
}
;// ./node_modules/@wordpress/interactivity/build-module/init.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
// Keep the same root fragment for each interactive region node.
const regionRootFragments = new WeakMap();
const getRegionRootFragment = region => {
if (!region.parentElement) {
throw Error('The passed region should be an element with a parent.');
}
if (!regionRootFragments.has(region)) {
regionRootFragments.set(region, createRootFragment(region.parentElement, region));
}
return regionRootFragments.get(region);
};
// Initial vDOM regions associated with its DOM element.
const initialVdom = new WeakMap();
// Initialize the router with the initial DOM.
const init = async () => {
const nodes = document.querySelectorAll(`[data-${directivePrefix}-interactive]`);
/*
* This `await` with setTimeout is required to apparently ensure that the interactive blocks have their stores
* fully initialized prior to hydrating the blocks. If this is not present, then an error occurs, for example:
* > view.js:46 Uncaught (in promise) ReferenceError: Cannot access 'state' before initialization
* This occurs when splitTask() is implemented with scheduler.yield() as opposed to setTimeout(), as with the former
* split tasks are added to the front of the task queue whereas with the latter they are added to the end of the queue.
*/
await new Promise(resolve => {
setTimeout(resolve, 0);
});
for (const node of nodes) {
if (!hydratedIslands.has(node)) {
await splitTask();
const fragment = getRegionRootFragment(node);
const vdom = toVdom(node);
initialVdom.set(node, vdom);
await splitTask();
(0,preact_module/* hydrate */.Qv)(vdom, fragment);
}
}
};
;// ./node_modules/@wordpress/interactivity/build-module/index.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
const requiredConsent = 'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.';
const privateApis = lock => {
if (lock === requiredConsent) {
return {
directivePrefix: directivePrefix,
getRegionRootFragment: getRegionRootFragment,
initialVdom: initialVdom,
toVdom: toVdom,
directive: directive,
getNamespace: getNamespace,
h: preact_module.h,
cloneElement: preact_module/* cloneElement */.Ob,
render: preact_module/* render */.XX,
proxifyState: proxifyState,
parseServerData: parseServerData,
populateServerData: populateServerData,
batch: signals_core_module_r
};
}
throw new Error('Forbidden access.');
};
directives();
init();
/***/ }),
/***/ 622:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ FK: () => (/* binding */ k),
/* harmony export */ Ob: () => (/* binding */ J),
/* harmony export */ Qv: () => (/* binding */ G),
/* harmony export */ XX: () => (/* binding */ E),
/* harmony export */ fF: () => (/* binding */ l),
/* harmony export */ h: () => (/* binding */ _),
/* harmony export */ q6: () => (/* binding */ K),
/* harmony export */ uA: () => (/* binding */ x),
/* harmony export */ zO: () => (/* binding */ u)
/* harmony export */ });
/* unused harmony exports createElement, createRef, toChildArray */
var n,l,t,u,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var t in l)n[t]=l[t];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,t,u){var i,r,o,e={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:e[o]=t[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,u,i,r,o){var e={type:n,props:u,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++t:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?S(n):null}function C(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!$.__r++||r!==l.debounceRendering)&&((r=l.debounceRendering)||o)($)}function $(){for(var n,t,u,r,o,f,c,s=1;i.length;)i.length>s&&i.sort(e),n=i.shift(),s=i.length,n.__d&&(u=void 0,o=(r=(t=n).__v).__e,f=[],c=[],t.__P&&((u=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(u),O(t.__P,u,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),u.__v=r.__v,u.__.__k[u.__i]=u,z(f,u,c),u.__e!=o&&C(u)));$.__r=0}function I(n,l,t,u,i,r,o,e,f,c,s){var a,h,y,d,w,g,_=u&&u.__k||v,m=l.length;for(f=P(t,l,_,f,m),a=0;a<m;a++)null!=(y=t.__k[a])&&(h=-1===y.__i?p:_[y.__i]||p,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&q(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=A(y,f,n):"function"==typeof y.type&&void 0!==g?f=g:d&&(f=d.nextSibling),y.__u&=-7);return t.__e=w,f}function P(n,l,t,u,i){var r,o,e,f,c,s=t.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!==(c=o.__i=L(o,t,f,a))&&(a--,(e=t[c])&&(e.__u|=2)),null==e||null===e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=t[r])&&0==(2&e.__u)&&(e.__e==u&&(u=S(e)),B(e,e));return u}function A(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=A(u[i],l,t));return l}n.__e!=l&&(l&&n.type&&!t.contains(l)&&(l=S(n)),t.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8==l.nodeType);return l}function H(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){H(n,l)}):l.push(n)),l}function L(n,l,t,u){var i,r,o=n.key,e=n.type,f=l[t];if(null===f&&null==n.key||f&&o==f.key&&e===f.type&&0==(2&f.__u))return t;if(u>(null!=f&&0==(2&f.__u)?1:0))for(i=t-1,r=t+1;i>=0||r<l.length;){if(i>=0){if((f=l[i])&&0==(2&f.__u)&&o==f.key&&e===f.type)return i;i--}if(r<l.length){if((f=l[r])&&0==(2&f.__u)&&o==f.key&&e===f.type)return r;r++}}return-1}function T(n,l,t){"-"==l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||y.test(l)?t:t+"px"}function j(n,l,t,u,i){var r;n:if("style"==l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||T(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||T(n.style,l,t[l])}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"==l||"onFocusIn"==l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=t,t?u?t.t=u.t:(t.t=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==t?"":t;break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==t?"":t))}}function F(n){return function(t){if(this.l){var u=this.l[t.type+n];if(null==t.u)t.u=c++;else if(t.u<u.t)return;return u(l.event?l.event(t):t)}}}function O(n,t,u,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=t.type;if(void 0!==t.constructor)return null;128&u.__u&&(c=!!(32&u.__u),o=[f=t.__e=u.__e]),(a=l.__b)&&a(t);n:if("function"==typeof j)try{if(b=t.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,u.__c?m=(h=t.__c=u.__c).__=h.__E:(S?t.__c=h=new j(b,M):(t.__c=h=new x(b,M),h.constructor=j,h.render=D),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=t,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||t.__v==u.__v)){for(t.__v!=u.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=u.__e,t.__k=u.__k,t.__k.some(function(n){n&&(n.__=t)}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(t),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[]}else do{h.__d=!1,P&&P(t),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k&&null==a.key&&(L=N(a.props.children)),f=I(n,d(L)?L:[L],t,u,i,r,o,e,f,c,s),h.base=t.__e,t.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(t.__v=null,c||null!=o)if(n.then){for(t.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,t.__e=f}else for(T=o.length;T--;)g(o[T]);else t.__e=u.__e,t.__k=u.__k;l.__e(n,t,u)}else null==o&&t.__v==u.__v?(t.__k=u.__k,t.__e=u.__e):f=t.__e=V(u.__e,t,u,i,r,o,e,c,s);return(a=l.diffed)&&a(t),128&t.__u?void 0:f}function z(n,t,u){for(var i=0;i<u.length;i++)q(u[i],u[++i],u[++i]);l.__c&&l.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){l.__e(n,t.__v)}})}function N(n){return"object"!=typeof n||null==n?n:d(n)?n.map(N):w({},n)}function V(t,u,i,r,o,e,f,c,s){var a,h,v,y,w,_,m,b=i.props,k=u.props,x=u.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!x&&(x?w.localName==x:3==w.nodeType)){t=w,e[a]=null;break}if(null==t){if(null==x)return document.createTextNode(k);t=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(u,e),c=!1),e=null}if(null===x)b===k||c&&t.data===k||(t.data=k);else{if(e=e&&n.call(t.childNodes),b=i.props||p,!c&&null!=e)for(b={},a=0;a<t.attributes.length;a++)b[(w=t.attributes[a]).name]=w.value;for(a in b)if(w=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j(t,a,null,w,o)}for(a in k)w=k[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?_=w:"checked"==a?m=w:c&&"function"!=typeof w||b[a]===w||j(t,a,w,b[a],o);if(h)c||v&&(h.__html===v.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),u.__k=[];else if(v&&(t.innerHTML=""),I("template"===u.type?t.content:t,d(y)?y:[y],u,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?t.removeAttribute("value"):void 0!==_&&(_!==t[a]||"progress"==x&&!_||"option"==x&&_!==b[a])&&j(t,a,_,b[a],o),a="checked",void 0!==m&&m!==t[a]&&j(t,a,m,b[a],o))}return t}function q(n,t,u){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==t||(n.__u=n(t))}else n.current=t}catch(n){l.__e(n,u)}}function B(n,t,u){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||q(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,t)}i.base=i.__P=null}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&B(i[r],t,u||"function"!=typeof n.type);u||g(n.__e),n.__c=n.__=n.__e=void 0}function D(n,l,t){return this.constructor(n,t)}function E(t,u,i){var r,o,e,f;u==document&&(u=document.documentElement),l.__&&l.__(t,u),o=(r="function"==typeof i)?null:i&&i.__k||u.__k,e=[],f=[],O(u,t=(!r&&i||u).__k=_(k,null,[t]),o||p,p,u.namespaceURI,!r&&i?[i]:o?null:u.firstChild?n.call(u.childNodes):null,e,!r&&i?i:o?o.__e:u.firstChild,r,f),z(e,t,f)}function G(n,l){E(n,l,G)}function J(l,t,u){var i,r,o,e,f=w({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?r=t[o]:f[o]=void 0===t[o]&&void 0!==e?e[o]:t[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):u),m(l.type,f,i||l.key,r||l.ref,null)}function K(n){function l(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l.__c]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}return l.__c="__cC"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v.slice,l={__e:function(n,l,t,u){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,u||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},t=0,u=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},t),this.props)),n&&w(t,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=F(!1),a=F(!0),h=0;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
zj: () => (/* reexport */ debug_build_module/* getConfig */.zj),
SD: () => (/* reexport */ debug_build_module/* getContext */.SD),
V6: () => (/* reexport */ debug_build_module/* getElement */.V6),
$K: () => (/* reexport */ debug_build_module/* getServerContext */.$K),
vT: () => (/* reexport */ debug_build_module/* getServerState */.vT),
jb: () => (/* reexport */ debug_build_module/* privateApis */.jb),
yT: () => (/* reexport */ debug_build_module/* splitTask */.yT),
M_: () => (/* reexport */ debug_build_module/* store */.M_),
hb: () => (/* reexport */ debug_build_module/* useCallback */.hb),
vJ: () => (/* reexport */ debug_build_module/* useEffect */.vJ),
ip: () => (/* reexport */ debug_build_module/* useInit */.ip),
Nf: () => (/* reexport */ debug_build_module/* useLayoutEffect */.Nf),
Kr: () => (/* reexport */ debug_build_module/* useMemo */.Kr),
li: () => (/* reexport */ debug_build_module/* useRef */.li),
J0: () => (/* reexport */ debug_build_module/* useState */.J0),
FH: () => (/* reexport */ debug_build_module/* useWatch */.FH),
v4: () => (/* reexport */ debug_build_module/* withScope */.v4),
mh: () => (/* reexport */ debug_build_module/* withSyncEvent */.mh)
});
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
var debug_preact_module = __webpack_require__(622);
;// ./node_modules/preact/devtools/dist/devtools.module.js
var debug_i;function debug_t(o,e){return n.__a&&n.__a(e),o}null!=(debug_i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&debug_i.__PREACT_DEVTOOLS__&&debug_i.__PREACT_DEVTOOLS__.attachPreact("10.26.4",debug_preact_module/* options */.fF,{Fragment:debug_preact_module/* Fragment */.FK,Component:debug_preact_module/* Component */.uA});
;// ./node_modules/preact/debug/dist/debug.module.js
var debug_debug_module_t={};function debug_r(){debug_debug_module_t={}}function debug_a(e){return e.type===debug_preact_module/* Fragment */.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var debug_debug_module_i=[],debug_s=[];function debug_c(){return debug_debug_module_i.length>0?debug_debug_module_i[debug_debug_module_i.length-1]:null}var debug_l=!0;function debug_u(e){return"function"==typeof e.type&&e.type!=debug_preact_module/* Fragment */.FK}function debug_f(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+debug_a(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":debug_l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),debug_l=!1,n+"\n"},"")}var debug_d="function"==typeof WeakMap;function debug_p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,debug_p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function debug_h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":debug_h(n.__):n.type:""}var debug_v=debug_preact_module/* Component */.uA.prototype.setState;function debug_y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}debug_preact_module/* Component */.uA.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+debug_f(debug_c())),debug_v.call(this,n,e)};var debug_m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,debug_b=debug_preact_module/* Component */.uA.prototype.forceUpdate;function debug_w(n){var e=n.props,o=debug_a(n),t="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),t+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+o+t+(s&&s.length?">..</"+o+">":" />")}debug_preact_module/* Component */.uA.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+debug_f(debug_c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+debug_f(this.__v)),debug_b.call(this,n)},debug_preact_module/* options */.fF.__m=function(n,e){var o=n.type,t=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error('Expected a DOM node of type "'+o+'" but found "'+t.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+debug_f(n))},function(){!function(){var n=debug_preact_module/* options */.fF.__b,o=debug_preact_module/* options */.fF.diffed,t=debug_preact_module/* options */.fF.__,r=debug_preact_module/* options */.fF.vnode,a=debug_preact_module/* options */.fF.__r;debug_preact_module/* options */.fF.diffed=function(n){debug_u(n)&&debug_s.pop(),debug_debug_module_i.pop(),o&&o(n)},debug_preact_module/* options */.fF.__b=function(e){debug_u(e)&&debug_debug_module_i.push(e),n&&n(e)},debug_preact_module/* options */.fF.__=function(n,e){debug_s=[],t&&t(n,e)},debug_preact_module/* options */.fF.vnode=function(n){n.__o=debug_s.length>0?debug_s[debug_s.length-1]:null,r&&r(n)},debug_preact_module/* options */.fF.__r=function(n){debug_u(n)&&debug_s.push(n),a&&a(n)}}();var n=!1,o=debug_preact_module/* options */.fF.__b,r=debug_preact_module/* options */.fF.diffed,c=debug_preact_module/* options */.fF.vnode,l=debug_preact_module/* options */.fF.__r,v=debug_preact_module/* options */.fF.__e,b=debug_preact_module/* options */.fF.__,g=debug_preact_module/* options */.fF.__h,E=debug_d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];debug_preact_module/* options */.fF.__e=function(n,e,o,t){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+debug_a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(t=t||{}).componentStack=debug_f(e),v(n,e,o,t),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},debug_preact_module/* options */.fF.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var t=debug_a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+t+" />, "+e+");")}b&&b(n,e)},debug_preact_module/* options */.fF.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+debug_w(e)+"\n\n"+debug_f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+debug_a(e)+" = "+debug_w(r)+";\n let vnode = <My"+debug_a(e)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+debug_f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+debug_w(e)+"\n\n"+debug_f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+debug_w(e)+"\n\n"+debug_f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+debug_a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var o in e)n[o]=e[o];return n}({},l)).ref,function(n,e,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](e,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in debug_debug_module_t)&&(debug_debug_module_t[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,debug_a(e),function(){return debug_f(e)})}o&&o(e)};var T,_=0;debug_preact_module/* options */.fF.__r=function(e){l&&l(e),n=!0;var o=e.__c;if(o===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+debug_a(e));T=o},debug_preact_module/* options */.fF.__h=function(e,o,t){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,o,t)};var O=function(n,e){return{get:function(){var o="get"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var o="set"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);debug_preact_module/* options */.fF.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var o=n.props={};for(var t in e){var r=e[t];"__source"===t?n.__source=r:"__self"===t?n.__self=r:o[t]=r}}n.__proto__=M,c&&c(n)},debug_preact_module/* options */.fF.diffed=function(e){var o,t=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var o=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+o+"}.\n\n"+debug_f(e))}}),e.__c===T&&(_=0),"string"==typeof t&&(debug_y(t)||"p"===t||"a"===t||"button"===t)){var s=debug_h(i);if(""!==s&&debug_y(t))"table"===t&&"td"!==s&&debug_y(s)?console.error("Improper nesting of table. Your <table> should not have a table-node parent."+debug_w(e)+"\n\n"+debug_f(e)):"thead"!==t&&"tfoot"!==t&&"tbody"!==t||"table"===s?"tr"===t&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot> parent."+debug_w(e)+"\n\n"+debug_f(e)):"td"===t&&"tr"!==s?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+debug_w(e)+"\n\n"+debug_f(e)):"th"===t&&"tr"!==s&&console.error("Improper nesting of table. Your <th> should have a <tr>."+debug_w(e)+"\n\n"+debug_f(e)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+debug_w(e)+"\n\n"+debug_f(e));else if("p"===t){var c=debug_p(e).filter(function(n){return debug_m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your <p> should not have "+c.join(", ")+" as child-elements."+debug_w(e)+"\n\n"+debug_f(e))}else"a"!==t&&"button"!==t||-1!==debug_p(e).indexOf(t)&&console.error("Improper nesting of interactive content. Your <"+t+"> should not have other "+("a"===t?"anchor":"button")+" tags as child-elements."+debug_w(e)+"\n\n"+debug_f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u<e.__k.length;u++){var d=e.__k[u];if(d&&null!=d.key){var v=d.key;if(-1!==l.indexOf(v)){console.error('Following component has two or more children with the same key attribute: "'+v+'". This may cause glitches and misbehavior in rendering process. Component: \n\n'+debug_w(e)+"\n\n"+debug_f(e));break}l.push(v)}}if(null!=e.__c&&null!=e.__c.__H){var b=e.__c.__H.__;if(b)for(var g=0;g<b.length;g+=1){var E=b[g];if(E.__H)for(var k=0;k<E.__H.length;k++)if((o=E.__H[k])!=o){var O=debug_a(e);console.warn("Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index "+g+" in component "+O+" was called with NaN.")}}}}}();
// EXTERNAL MODULE: ./node_modules/@wordpress/interactivity/build-module/index.js + 18 modules
var debug_build_module = __webpack_require__(380);
;// ./node_modules/@wordpress/interactivity/build-module/debug.js
/**
* External dependencies
*/
var __webpack_exports__getConfig = __webpack_exports__.zj;
var __webpack_exports__getContext = __webpack_exports__.SD;
var __webpack_exports__getElement = __webpack_exports__.V6;
var __webpack_exports__getServerContext = __webpack_exports__.$K;
var __webpack_exports__getServerState = __webpack_exports__.vT;
var __webpack_exports__privateApis = __webpack_exports__.jb;
var __webpack_exports__splitTask = __webpack_exports__.yT;
var __webpack_exports__store = __webpack_exports__.M_;
var __webpack_exports__useCallback = __webpack_exports__.hb;
var __webpack_exports__useEffect = __webpack_exports__.vJ;
var __webpack_exports__useInit = __webpack_exports__.ip;
var __webpack_exports__useLayoutEffect = __webpack_exports__.Nf;
var __webpack_exports__useMemo = __webpack_exports__.Kr;
var __webpack_exports__useRef = __webpack_exports__.li;
var __webpack_exports__useState = __webpack_exports__.J0;
var __webpack_exports__useWatch = __webpack_exports__.FH;
var __webpack_exports__withScope = __webpack_exports__.v4;
var __webpack_exports__withSyncEvent = __webpack_exports__.mh;
export { __webpack_exports__getConfig as getConfig, __webpack_exports__getContext as getContext, __webpack_exports__getElement as getElement, __webpack_exports__getServerContext as getServerContext, __webpack_exports__getServerState as getServerState, __webpack_exports__privateApis as privateApis, __webpack_exports__splitTask as splitTask, __webpack_exports__store as store, __webpack_exports__useCallback as useCallback, __webpack_exports__useEffect as useEffect, __webpack_exports__useInit as useInit, __webpack_exports__useLayoutEffect as useLayoutEffect, __webpack_exports__useMemo as useMemo, __webpack_exports__useRef as useRef, __webpack_exports__useState as useState, __webpack_exports__useWatch as useWatch, __webpack_exports__withScope as withScope, __webpack_exports__withSyncEvent as withSyncEvent };
interactivity/index.js 0000644 00000320411 15071251711 0011110 0 ustar 00 /******/ var __webpack_modules__ = ({
/***/ 622:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Ob: () => (/* binding */ J),
/* harmony export */ Qv: () => (/* binding */ G),
/* harmony export */ XX: () => (/* binding */ E),
/* harmony export */ fF: () => (/* binding */ l),
/* harmony export */ h: () => (/* binding */ _),
/* harmony export */ q6: () => (/* binding */ K),
/* harmony export */ uA: () => (/* binding */ x),
/* harmony export */ zO: () => (/* binding */ u)
/* harmony export */ });
/* unused harmony exports Fragment, createElement, createRef, toChildArray */
var n,l,t,u,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var t in l)n[t]=l[t];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,t,u){var i,r,o,e={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:e[o]=t[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,u,i,r,o){var e={type:n,props:u,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++t:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?S(n):null}function C(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!$.__r++||r!==l.debounceRendering)&&((r=l.debounceRendering)||o)($)}function $(){for(var n,t,u,r,o,f,c,s=1;i.length;)i.length>s&&i.sort(e),n=i.shift(),s=i.length,n.__d&&(u=void 0,o=(r=(t=n).__v).__e,f=[],c=[],t.__P&&((u=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(u),O(t.__P,u,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),u.__v=r.__v,u.__.__k[u.__i]=u,z(f,u,c),u.__e!=o&&C(u)));$.__r=0}function I(n,l,t,u,i,r,o,e,f,c,s){var a,h,y,d,w,g,_=u&&u.__k||v,m=l.length;for(f=P(t,l,_,f,m),a=0;a<m;a++)null!=(y=t.__k[a])&&(h=-1===y.__i?p:_[y.__i]||p,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&q(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=A(y,f,n):"function"==typeof y.type&&void 0!==g?f=g:d&&(f=d.nextSibling),y.__u&=-7);return t.__e=w,f}function P(n,l,t,u,i){var r,o,e,f,c,s=t.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!==(c=o.__i=L(o,t,f,a))&&(a--,(e=t[c])&&(e.__u|=2)),null==e||null===e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=t[r])&&0==(2&e.__u)&&(e.__e==u&&(u=S(e)),B(e,e));return u}function A(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=A(u[i],l,t));return l}n.__e!=l&&(l&&n.type&&!t.contains(l)&&(l=S(n)),t.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8==l.nodeType);return l}function H(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){H(n,l)}):l.push(n)),l}function L(n,l,t,u){var i,r,o=n.key,e=n.type,f=l[t];if(null===f&&null==n.key||f&&o==f.key&&e===f.type&&0==(2&f.__u))return t;if(u>(null!=f&&0==(2&f.__u)?1:0))for(i=t-1,r=t+1;i>=0||r<l.length;){if(i>=0){if((f=l[i])&&0==(2&f.__u)&&o==f.key&&e===f.type)return i;i--}if(r<l.length){if((f=l[r])&&0==(2&f.__u)&&o==f.key&&e===f.type)return r;r++}}return-1}function T(n,l,t){"-"==l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||y.test(l)?t:t+"px"}function j(n,l,t,u,i){var r;n:if("style"==l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||T(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||T(n.style,l,t[l])}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"==l||"onFocusIn"==l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=t,t?u?t.t=u.t:(t.t=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==t?"":t;break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==t?"":t))}}function F(n){return function(t){if(this.l){var u=this.l[t.type+n];if(null==t.u)t.u=c++;else if(t.u<u.t)return;return u(l.event?l.event(t):t)}}}function O(n,t,u,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=t.type;if(void 0!==t.constructor)return null;128&u.__u&&(c=!!(32&u.__u),o=[f=t.__e=u.__e]),(a=l.__b)&&a(t);n:if("function"==typeof j)try{if(b=t.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,u.__c?m=(h=t.__c=u.__c).__=h.__E:(S?t.__c=h=new j(b,M):(t.__c=h=new x(b,M),h.constructor=j,h.render=D),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=t,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||t.__v==u.__v)){for(t.__v!=u.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=u.__e,t.__k=u.__k,t.__k.some(function(n){n&&(n.__=t)}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(t),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[]}else do{h.__d=!1,P&&P(t),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k&&null==a.key&&(L=N(a.props.children)),f=I(n,d(L)?L:[L],t,u,i,r,o,e,f,c,s),h.base=t.__e,t.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(t.__v=null,c||null!=o)if(n.then){for(t.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,t.__e=f}else for(T=o.length;T--;)g(o[T]);else t.__e=u.__e,t.__k=u.__k;l.__e(n,t,u)}else null==o&&t.__v==u.__v?(t.__k=u.__k,t.__e=u.__e):f=t.__e=V(u.__e,t,u,i,r,o,e,c,s);return(a=l.diffed)&&a(t),128&t.__u?void 0:f}function z(n,t,u){for(var i=0;i<u.length;i++)q(u[i],u[++i],u[++i]);l.__c&&l.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){l.__e(n,t.__v)}})}function N(n){return"object"!=typeof n||null==n?n:d(n)?n.map(N):w({},n)}function V(t,u,i,r,o,e,f,c,s){var a,h,v,y,w,_,m,b=i.props,k=u.props,x=u.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!x&&(x?w.localName==x:3==w.nodeType)){t=w,e[a]=null;break}if(null==t){if(null==x)return document.createTextNode(k);t=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(u,e),c=!1),e=null}if(null===x)b===k||c&&t.data===k||(t.data=k);else{if(e=e&&n.call(t.childNodes),b=i.props||p,!c&&null!=e)for(b={},a=0;a<t.attributes.length;a++)b[(w=t.attributes[a]).name]=w.value;for(a in b)if(w=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j(t,a,null,w,o)}for(a in k)w=k[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?_=w:"checked"==a?m=w:c&&"function"!=typeof w||b[a]===w||j(t,a,w,b[a],o);if(h)c||v&&(h.__html===v.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),u.__k=[];else if(v&&(t.innerHTML=""),I("template"===u.type?t.content:t,d(y)?y:[y],u,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?t.removeAttribute("value"):void 0!==_&&(_!==t[a]||"progress"==x&&!_||"option"==x&&_!==b[a])&&j(t,a,_,b[a],o),a="checked",void 0!==m&&m!==t[a]&&j(t,a,m,b[a],o))}return t}function q(n,t,u){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==t||(n.__u=n(t))}else n.current=t}catch(n){l.__e(n,u)}}function B(n,t,u){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||q(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,t)}i.base=i.__P=null}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&B(i[r],t,u||"function"!=typeof n.type);u||g(n.__e),n.__c=n.__=n.__e=void 0}function D(n,l,t){return this.constructor(n,t)}function E(t,u,i){var r,o,e,f;u==document&&(u=document.documentElement),l.__&&l.__(t,u),o=(r="function"==typeof i)?null:i&&i.__k||u.__k,e=[],f=[],O(u,t=(!r&&i||u).__k=_(k,null,[t]),o||p,p,u.namespaceURI,!r&&i?[i]:o?null:u.firstChild?n.call(u.childNodes):null,e,!r&&i?i:o?o.__e:u.firstChild,r,f),z(e,t,f)}function G(n,l){E(n,l,G)}function J(l,t,u){var i,r,o,e,f=w({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?r=t[o]:f[o]=void 0===t[o]&&void 0!==e?e[o]:t[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):u),m(l.type,f,i||l.key,r||l.ref,null)}function K(n){function l(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l.__c]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}return l.__c="__cC"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v.slice,l={__e:function(n,l,t,u){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,u||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},t=0,u=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},t),this.props)),n&&w(t,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=F(!1),a=F(!0),h=0;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
zj: () => (/* reexport */ getConfig),
SD: () => (/* reexport */ getContext),
V6: () => (/* reexport */ getElement),
$K: () => (/* reexport */ getServerContext),
vT: () => (/* reexport */ getServerState),
jb: () => (/* binding */ privateApis),
yT: () => (/* reexport */ splitTask),
M_: () => (/* reexport */ store),
hb: () => (/* reexport */ useCallback),
vJ: () => (/* reexport */ useEffect),
ip: () => (/* reexport */ useInit),
Nf: () => (/* reexport */ useLayoutEffect),
Kr: () => (/* reexport */ useMemo),
li: () => (/* reexport */ A),
J0: () => (/* reexport */ d),
FH: () => (/* reexport */ useWatch),
v4: () => (/* reexport */ withScope),
mh: () => (/* reexport */ withSyncEvent)
});
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
var preact_module = __webpack_require__(622);
;// ./node_modules/preact/hooks/dist/hooks.module.js
var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function p(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return hooks_module_o=1,h(D,n)}function h(n,u,i){var o=p(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=p(hooks_module_t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t}
;// ./node_modules/@preact/signals-core/dist/signals-core.module.js
var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)}
;// ./node_modules/@preact/signals/dist/signals.module.js
var signals_module_v,signals_module_s;function signals_module_l(i,n){preact_module/* options */.fF[i]=n.bind(null,preact_module/* options */.fF[i]||function(){})}function signals_module_d(i){if(signals_module_s)signals_module_s();signals_module_s=i&&i.S()}function signals_module_h(i){var r=this,f=i.data,o=useSignal(f);o.value=f;var e=T(function(){var i=r.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}r.__$u.c=function(){var i,t=r.__$u.S(),f=e.value;t();if((0,preact_module/* isValidElement */.zO)(f)||3!==(null==(i=r.base)?void 0:i.nodeType)){r.__$f|=1;r.setState({})}else r.base.data=f};return signals_core_module_w(function(){var i=o.value.value;return 0===i?0:!0===i?"":i||""})},[]);return e.value}signals_module_h.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_h},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(i,r){if("string"==typeof r.type){var n,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!n)r.__np=n={};n[f]=o;t[f]=o.peek()}}}i(r)});signals_module_l("__r",function(i,r){signals_module_d();var n,t=r.__c;if(t){t.__$f&=-2;if(void 0===(n=t.__$u))t.__$u=n=function(i){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(n);i(r)});signals_module_l("__e",function(i,r,n,t){signals_module_d();signals_module_v=void 0;i(r,n,t)});signals_module_l("diffed",function(i,r){signals_module_d();signals_module_v=void 0;var n;if("string"==typeof r.type&&(n=r.__e)){var t=r.__np,f=r.props;if(t){var o=n.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else n.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_p(n,a,s,f);o[a]=c}else c.o(s,f)}}}i(r)});function signals_module_p(i,r,n,t){var f=r in i&&void 0===i.ownerSVGElement,o=signals_core_module_d(n);return{o:function(i,r){o.value=i;t=r},d:E(function(){var n=o.value.value;if(t[r]!==n){t[r]=n;if(f)i[r]=n;else if(n)i.setAttribute(r,n);else i.removeAttribute(r)}})}}signals_module_l("unmount",function(i,r){if("string"==typeof r.type){var n=r.__e;if(n){var t=n.U;if(t){n.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}i(r)});signals_module_l("__h",function(i,r,n,t){if(t<3||9===t)r.__$f|=2;i(r,n,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(i,r){var n=this.__$u,t=n&&void 0!==n.s;for(var f in r)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(t||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(t||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var o in i)if("__source"!==o&&i[o]!==this.props[o])return!0;for(var e in this.props)if(!(e in i))return!0;return!1};function useSignal(i){return T(function(){return signals_core_module_d(i)},[])}function useComputed(i){var r=f(i);r.current=i;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(i){var r=f(i);r.current=i;o(function(){return c(function(){return r.current()})},[])}
;// ./node_modules/@wordpress/interactivity/build-module/namespaces.js
const namespaceStack = [];
const getNamespace = () => namespaceStack.slice(-1)[0];
const setNamespace = namespace => {
namespaceStack.push(namespace);
};
const resetNamespace = () => {
namespaceStack.pop();
};
;// ./node_modules/@wordpress/interactivity/build-module/scopes.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
// Store stacks for the current scope and the default namespaces and export APIs
// to interact with them.
const scopeStack = [];
const getScope = () => scopeStack.slice(-1)[0];
const setScope = scope => {
scopeStack.push(scope);
};
const resetScope = () => {
scopeStack.pop();
};
// Wrap the element props to prevent modifications.
const immutableMap = new WeakMap();
const immutableError = () => {
throw new Error('Please use `data-wp-bind` to modify the attributes of an element.');
};
const immutableHandlers = {
get(target, key, receiver) {
const value = Reflect.get(target, key, receiver);
return !!value && typeof value === 'object' ? deepImmutable(value) : value;
},
set: immutableError,
deleteProperty: immutableError
};
const deepImmutable = target => {
if (!immutableMap.has(target)) {
immutableMap.set(target, new Proxy(target, immutableHandlers));
}
return immutableMap.get(target);
};
/**
* Retrieves the context inherited by the element evaluating a function from the
* store. The returned value depends on the element and the namespace where the
* function calling `getContext()` exists.
*
* @param namespace Store namespace. By default, the namespace where the calling
* function exists is used.
* @return The context content.
*/
const getContext = namespace => {
const scope = getScope();
if (true) {
if (!scope) {
throw Error('Cannot call `getContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
}
}
return scope.context[namespace || getNamespace()];
};
/**
* Retrieves a representation of the element where a function from the store
* is being evaluated. Such representation is read-only, and contains a
* reference to the DOM element, its props and a local reactive state.
*
* @return Element representation.
*/
const getElement = () => {
const scope = getScope();
if (true) {
if (!scope) {
throw Error('Cannot call `getElement()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
}
}
const {
ref,
attributes
} = scope;
return Object.freeze({
ref: ref.current,
attributes: deepImmutable(attributes)
});
};
/**
* Retrieves the part of the inherited context defined and updated from the
* server.
*
* The object returned is read-only, and includes the context defined in PHP
* with `wp_interactivity_data_wp_context()`, including the corresponding
* inherited properties. When `actions.navigate()` is called, this object is
* updated to reflect the changes in the new visited page, without affecting the
* context returned by `getContext()`. Directives can subscribe to those changes
* to update the context if needed.
*
* @example
* ```js
* store('...', {
* callbacks: {
* updateServerContext() {
* const context = getContext();
* const serverContext = getServerContext();
* // Override some property with the new value that came from the server.
* context.overridableProp = serverContext.overridableProp;
* },
* },
* });
* ```
*
* @param namespace Store namespace. By default, the namespace where the calling
* function exists is used.
* @return The server context content.
*/
const getServerContext = namespace => {
const scope = getScope();
if (true) {
if (!scope) {
throw Error('Cannot call `getServerContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
}
}
return scope.serverContext[namespace || getNamespace()];
};
;// ./node_modules/@wordpress/interactivity/build-module/utils.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Executes a callback function after the next frame is rendered.
*
* @param callback The callback function to be executed.
* @return A promise that resolves after the callback function is executed.
*/
const afterNextFrame = callback => {
return new Promise(resolve => {
const done = () => {
clearTimeout(timeout);
window.cancelAnimationFrame(raf);
setTimeout(() => {
callback();
resolve();
});
};
const timeout = setTimeout(done, 100);
const raf = window.requestAnimationFrame(done);
});
};
/**
* Returns a promise that resolves after yielding to main.
*
* @return Promise<void>
*/
const splitTask = typeof window.scheduler?.yield === 'function' ? window.scheduler.yield.bind(window.scheduler) : () => {
return new Promise(resolve => {
setTimeout(resolve, 0);
});
};
/**
* Creates a Flusher object that can be used to flush computed values and notify listeners.
*
* Using the mangled properties:
* this.c: this._callback
* this.x: this._compute
* https://github.com/preactjs/signals/blob/main/mangle.json
*
* @param compute The function that computes the value to be flushed.
* @param notify The function that notifies listeners when the value is flushed.
* @return The Flusher object with `flush` and `dispose` properties.
*/
function createFlusher(compute, notify) {
let flush = () => undefined;
const dispose = E(function () {
flush = this.c.bind(this);
this.x = compute;
this.c = notify;
return compute();
});
return {
flush,
dispose
};
}
/**
* Custom hook that executes a callback function whenever a signal is triggered.
* Version of `useSignalEffect` with a `useEffect`-like execution. This hook
* implementation comes from this PR, but we added short-cirtuiting to avoid
* infinite loops: https://github.com/preactjs/signals/pull/290
*
* @param callback The callback function to be executed.
*/
function utils_useSignalEffect(callback) {
y(() => {
let eff = null;
let isExecuting = false;
const notify = async () => {
if (eff && !isExecuting) {
isExecuting = true;
await afterNextFrame(eff.flush);
isExecuting = false;
}
};
eff = createFlusher(callback, notify);
return eff.dispose;
}, []);
}
/**
* Returns the passed function wrapped with the current scope so it is
* accessible whenever the function runs. This is primarily to make the scope
* available inside hook callbacks.
*
* Asynchronous functions should use generators that yield promises instead of awaiting them.
* See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store
*
* @param func The passed function.
* @return The wrapped function.
*/
function withScope(func) {
const scope = getScope();
const ns = getNamespace();
let wrapped;
if (func?.constructor?.name === 'GeneratorFunction') {
wrapped = async (...args) => {
const gen = func(...args);
let value;
let it;
while (true) {
setNamespace(ns);
setScope(scope);
try {
it = gen.next(value);
} finally {
resetScope();
resetNamespace();
}
try {
value = await it.value;
} catch (e) {
setNamespace(ns);
setScope(scope);
gen.throw(e);
} finally {
resetScope();
resetNamespace();
}
if (it.done) {
break;
}
}
return value;
};
} else {
wrapped = (...args) => {
setNamespace(ns);
setScope(scope);
try {
return func(...args);
} finally {
resetNamespace();
resetScope();
}
};
}
// If function was annotated via `withSyncEvent()`, maintain the annotation.
const syncAware = func;
if (syncAware.sync) {
const syncAwareWrapped = wrapped;
syncAwareWrapped.sync = true;
return syncAwareWrapped;
}
return wrapped;
}
/**
* Accepts a function that contains imperative code which runs whenever any of
* the accessed _reactive_ properties (e.g., values from the global state or the
* context) is modified.
*
* This hook makes the element's scope available so functions like
* `getElement()` and `getContext()` can be used inside the passed callback.
*
* @param callback The hook callback.
*/
function useWatch(callback) {
utils_useSignalEffect(withScope(callback));
}
/**
* Accepts a function that contains imperative code which runs only after the
* element's first render, mainly useful for initialization logic.
*
* This hook makes the element's scope available so functions like
* `getElement()` and `getContext()` can be used inside the passed callback.
*
* @param callback The hook callback.
*/
function useInit(callback) {
y(withScope(callback), []);
}
/**
* Accepts a function that contains imperative, possibly effectful code. The
* effects run after browser paint, without blocking it.
*
* This hook is equivalent to Preact's `useEffect` and makes the element's scope
* available so functions like `getElement()` and `getContext()` can be used
* inside the passed callback.
*
* @param callback Imperative function that can return a cleanup
* function.
* @param inputs If present, effect will only activate if the
* values in the list change (using `===`).
*/
function useEffect(callback, inputs) {
y(withScope(callback), inputs);
}
/**
* Accepts a function that contains imperative, possibly effectful code. Use
* this to read layout from the DOM and synchronously re-render.
*
* This hook is equivalent to Preact's `useLayoutEffect` and makes the element's
* scope available so functions like `getElement()` and `getContext()` can be
* used inside the passed callback.
*
* @param callback Imperative function that can return a cleanup
* function.
* @param inputs If present, effect will only activate if the
* values in the list change (using `===`).
*/
function useLayoutEffect(callback, inputs) {
_(withScope(callback), inputs);
}
/**
* Returns a memoized version of the callback that only changes if one of the
* inputs has changed (using `===`).
*
* This hook is equivalent to Preact's `useCallback` and makes the element's
* scope available so functions like `getElement()` and `getContext()` can be
* used inside the passed callback.
*
* @param callback Callback function.
* @param inputs If present, the callback will only be updated if the
* values in the list change (using `===`).
*
* @return The callback function.
*/
function useCallback(callback, inputs) {
return q(withScope(callback), inputs);
}
/**
* Pass a factory function and an array of inputs. `useMemo` will only recompute
* the memoized value when one of the inputs has changed.
*
* This hook is equivalent to Preact's `useMemo` and makes the element's scope
* available so functions like `getElement()` and `getContext()` can be used
* inside the passed factory function.
*
* @param factory Factory function that returns that value for memoization.
* @param inputs If present, the factory will only be run to recompute if
* the values in the list change (using `===`).
*
* @return The memoized value.
*/
function useMemo(factory, inputs) {
return T(withScope(factory), inputs);
}
/**
* Creates a root fragment by replacing a node or an array of nodes in a parent element.
* For wrapperless hydration.
* See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c
*
* @param parent The parent element where the nodes will be replaced.
* @param replaceNode The node or array of nodes to replace in the parent element.
* @return The created root fragment.
*/
const createRootFragment = (parent, replaceNode) => {
replaceNode = [].concat(replaceNode);
const sibling = replaceNode[replaceNode.length - 1].nextSibling;
function insert(child, root) {
parent.insertBefore(child, root || sibling);
}
return parent.__k = {
nodeType: 1,
parentNode: parent,
firstChild: replaceNode[0],
childNodes: replaceNode,
insertBefore: insert,
appendChild: insert,
removeChild(c) {
parent.removeChild(c);
}
};
};
/**
* Transforms a kebab-case string to camelCase.
*
* @param str The kebab-case string to transform to camelCase.
* @return The transformed camelCase string.
*/
function kebabToCamelCase(str) {
return str.replace(/^-+|-+$/g, '').toLowerCase().replace(/-([a-z])/g, function (_match, group1) {
return group1.toUpperCase();
});
}
const logged = new Set();
/**
* Shows a warning with `message` if environment is not `production`.
*
* Based on the `@wordpress/warning` package.
*
* @param message Message to show in the warning.
*/
const warn = message => {
if (true) {
if (logged.has(message)) {
return;
}
// eslint-disable-next-line no-console
console.warn(message);
// Throwing an error and catching it immediately to improve debugging
// A consumer can use 'pause on caught exceptions'
try {
throw Error(message);
} catch (e) {
// Do nothing.
}
logged.add(message);
}
};
/**
* Checks if the passed `candidate` is a plain object with just the `Object`
* prototype.
*
* @param candidate The item to check.
* @return Whether `candidate` is a plain object.
*/
const isPlainObject = candidate => Boolean(candidate && typeof candidate === 'object' && candidate.constructor === Object);
/**
* Indicates that the passed `callback` requires synchronous access to the event object.
*
* @param callback The event callback.
* @return Altered event callback.
*/
function withSyncEvent(callback) {
const syncAware = callback;
syncAware.sync = true;
return syncAware;
}
;// ./node_modules/@wordpress/interactivity/build-module/proxies/registry.js
/**
* Proxies for each object.
*/
const objToProxy = new WeakMap();
const proxyToObj = new WeakMap();
/**
* Namespaces for each created proxy.
*/
const proxyToNs = new WeakMap();
/**
* Object types that can be proxied.
*/
const supported = new Set([Object, Array]);
/**
* Returns a proxy to the passed object with the given handlers, assigning the
* specified namespace to it. If a proxy for the passed object was created
* before, that proxy is returned.
*
* @param namespace The namespace that will be associated to this proxy.
* @param obj The object to proxify.
* @param handlers Handlers that the proxy will use.
*
* @throws Error if the object cannot be proxified. Use {@link shouldProxy} to
* check if a proxy can be created for a specific object.
*
* @return The created proxy.
*/
const createProxy = (namespace, obj, handlers) => {
if (!shouldProxy(obj)) {
throw Error('This object cannot be proxified.');
}
if (!objToProxy.has(obj)) {
const proxy = new Proxy(obj, handlers);
objToProxy.set(obj, proxy);
proxyToObj.set(proxy, obj);
proxyToNs.set(proxy, namespace);
}
return objToProxy.get(obj);
};
/**
* Returns the proxy for the given object. If there is no associated proxy, the
* function returns `undefined`.
*
* @param obj Object from which to know the proxy.
* @return Associated proxy or `undefined`.
*/
const getProxyFromObject = obj => objToProxy.get(obj);
/**
* Gets the namespace associated with the given proxy.
*
* Proxies have a namespace assigned upon creation. See {@link createProxy}.
*
* @param proxy Proxy.
* @return Namespace.
*/
const getNamespaceFromProxy = proxy => proxyToNs.get(proxy);
/**
* Checks if a given object can be proxied.
*
* @param candidate Object to know whether it can be proxied.
* @return True if the passed instance can be proxied.
*/
const shouldProxy = candidate => {
if (typeof candidate !== 'object' || candidate === null) {
return false;
}
return !proxyToNs.has(candidate) && supported.has(candidate.constructor);
};
/**
* Returns the target object for the passed proxy. If the passed object is not a registered proxy, the
* function returns `undefined`.
*
* @param proxy Proxy from which to know the target.
* @return The target object or `undefined`.
*/
const getObjectFromProxy = proxy => proxyToObj.get(proxy);
;// ./node_modules/@wordpress/interactivity/build-module/proxies/signals.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Identifier for property computeds not associated to any scope.
*/
const NO_SCOPE = {};
/**
* Structure that manages reactivity for a property in a state object. It uses
* signals to keep track of property value or getter modifications.
*/
class PropSignal {
/**
* Proxy that holds the property this PropSignal is associated with.
*/
/**
* Relation of computeds by scope. These computeds are read-only signals
* that depend on whether the property is a value or a getter and,
* therefore, can return different values depending on the scope in which
* the getter is accessed.
*/
/**
* Signal with the value assigned to the related property.
*/
/**
* Signal with the getter assigned to the related property.
*/
/**
* Structure that manages reactivity for a property in a state object, using
* signals to keep track of property value or getter modifications.
*
* @param owner Proxy that holds the property this instance is associated
* with.
*/
constructor(owner) {
this.owner = owner;
this.computedsByScope = new WeakMap();
}
/**
* Changes the internal value. If a getter was set before, it is set to
* `undefined`.
*
* @param value New value.
*/
setValue(value) {
this.update({
value
});
}
/**
* Changes the internal getter. If a value was set before, it is set to
* `undefined`.
*
* @param getter New getter.
*/
setGetter(getter) {
this.update({
get: getter
});
}
/**
* Returns the computed that holds the result of evaluating the prop in the
* current scope.
*
* These computeds are read-only signals that depend on whether the property
* is a value or a getter and, therefore, can return different values
* depending on the scope in which the getter is accessed.
*
* @return Computed that depends on the scope.
*/
getComputed() {
const scope = getScope() || NO_SCOPE;
if (!this.valueSignal && !this.getterSignal) {
this.update({});
}
if (!this.computedsByScope.has(scope)) {
const callback = () => {
const getter = this.getterSignal?.value;
return getter ? getter.call(this.owner) : this.valueSignal?.value;
};
setNamespace(getNamespaceFromProxy(this.owner));
this.computedsByScope.set(scope, signals_core_module_w(withScope(callback)));
resetNamespace();
}
return this.computedsByScope.get(scope);
}
/**
* Update the internal signals for the value and the getter of the
* corresponding prop.
*
* @param param0
* @param param0.get New getter.
* @param param0.value New value.
*/
update({
get,
value
}) {
if (!this.valueSignal) {
this.valueSignal = signals_core_module_d(value);
this.getterSignal = signals_core_module_d(get);
} else if (value !== this.valueSignal.peek() || get !== this.getterSignal.peek()) {
signals_core_module_r(() => {
this.valueSignal.value = value;
this.getterSignal.value = get;
});
}
}
}
;// ./node_modules/@wordpress/interactivity/build-module/proxies/state.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Set of built-in symbols.
*/
const wellKnownSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(key => Symbol[key]).filter(value => typeof value === 'symbol'));
/**
* Relates each proxy with a map of {@link PropSignal} instances, representing
* the proxy's accessed properties.
*/
const proxyToProps = new WeakMap();
/**
* Checks whether a {@link PropSignal | `PropSignal`} instance exists for the
* given property in the passed proxy.
*
* @param proxy Proxy of a state object or array.
* @param key The property key.
* @return `true` when it exists; false otherwise.
*/
const hasPropSignal = (proxy, key) => proxyToProps.has(proxy) && proxyToProps.get(proxy).has(key);
const readOnlyProxies = new WeakSet();
/**
* Returns the {@link PropSignal | `PropSignal`} instance associated with the
* specified prop in the passed proxy.
*
* The `PropSignal` instance is generated if it doesn't exist yet, using the
* `initial` parameter to initialize the internal signals.
*
* @param proxy Proxy of a state object or array.
* @param key The property key.
* @param initial Initial data for the `PropSignal` instance.
* @return The `PropSignal` instance.
*/
const getPropSignal = (proxy, key, initial) => {
if (!proxyToProps.has(proxy)) {
proxyToProps.set(proxy, new Map());
}
key = typeof key === 'number' ? `${key}` : key;
const props = proxyToProps.get(proxy);
if (!props.has(key)) {
const ns = getNamespaceFromProxy(proxy);
const prop = new PropSignal(proxy);
props.set(key, prop);
if (initial) {
const {
get,
value
} = initial;
if (get) {
prop.setGetter(get);
} else {
const readOnly = readOnlyProxies.has(proxy);
prop.setValue(shouldProxy(value) ? proxifyState(ns, value, {
readOnly
}) : value);
}
}
}
return props.get(key);
};
/**
* Relates each proxied object (i.e., the original object) with a signal that
* tracks changes in the number of properties.
*/
const objToIterable = new WeakMap();
/**
* When this flag is `true`, it avoids any signal subscription, overriding state
* props' "reactive" behavior.
*/
let peeking = false;
/**
* Handlers for reactive objects and arrays in the state.
*/
const stateHandlers = {
get(target, key, receiver) {
/*
* The property should not be reactive for the following cases:
* 1. While using the `peek` function to read the property.
* 2. The property exists but comes from the Object or Array prototypes.
* 3. The property key is a known symbol.
*/
if (peeking || !target.hasOwnProperty(key) && key in target || typeof key === 'symbol' && wellKnownSymbols.has(key)) {
return Reflect.get(target, key, receiver);
}
// At this point, the property should be reactive.
const desc = Object.getOwnPropertyDescriptor(target, key);
const prop = getPropSignal(receiver, key, desc);
const result = prop.getComputed().value;
/*
* Check if the property is a synchronous function. If it is, set the
* default namespace. Synchronous functions always run in the proper scope,
* which is set by the Directives component.
*/
if (typeof result === 'function') {
const ns = getNamespaceFromProxy(receiver);
return (...args) => {
setNamespace(ns);
try {
return result.call(receiver, ...args);
} finally {
resetNamespace();
}
};
}
return result;
},
set(target, key, value, receiver) {
if (readOnlyProxies.has(receiver)) {
return false;
}
setNamespace(getNamespaceFromProxy(receiver));
try {
return Reflect.set(target, key, value, receiver);
} finally {
resetNamespace();
}
},
defineProperty(target, key, desc) {
if (readOnlyProxies.has(getProxyFromObject(target))) {
return false;
}
const isNew = !(key in target);
const result = Reflect.defineProperty(target, key, desc);
if (result) {
const receiver = getProxyFromObject(target);
const prop = getPropSignal(receiver, key);
const {
get,
value
} = desc;
if (get) {
prop.setGetter(get);
} else {
const ns = getNamespaceFromProxy(receiver);
prop.setValue(shouldProxy(value) ? proxifyState(ns, value) : value);
}
if (isNew && objToIterable.has(target)) {
objToIterable.get(target).value++;
}
/*
* Modify the `length` property value only if the related
* `PropSignal` exists, which means that there are subscriptions to
* this property.
*/
if (Array.isArray(target) && proxyToProps.get(receiver)?.has('length')) {
const length = getPropSignal(receiver, 'length');
length.setValue(target.length);
}
}
return result;
},
deleteProperty(target, key) {
if (readOnlyProxies.has(getProxyFromObject(target))) {
return false;
}
const result = Reflect.deleteProperty(target, key);
if (result) {
const prop = getPropSignal(getProxyFromObject(target), key);
prop.setValue(undefined);
if (objToIterable.has(target)) {
objToIterable.get(target).value++;
}
}
return result;
},
ownKeys(target) {
if (!objToIterable.has(target)) {
objToIterable.set(target, signals_core_module_d(0));
}
/*
*This subscribes to the signal while preventing the minifier from
* deleting this line in production.
*/
objToIterable._ = objToIterable.get(target).value;
return Reflect.ownKeys(target);
}
};
/**
* Returns the proxy associated with the given state object, creating it if it
* does not exist.
*
* @param namespace The namespace that will be associated to this proxy.
* @param obj The object to proxify.
* @param options Options.
* @param options.readOnly Read-only.
*
* @throws Error if the object cannot be proxified. Use {@link shouldProxy} to
* check if a proxy can be created for a specific object.
*
* @return The associated proxy.
*/
const proxifyState = (namespace, obj, options) => {
const proxy = createProxy(namespace, obj, stateHandlers);
if (options?.readOnly) {
readOnlyProxies.add(proxy);
}
return proxy;
};
/**
* Reads the value of the specified property without subscribing to it.
*
* @param obj The object to read the property from.
* @param key The property key.
* @return The property value.
*/
const peek = (obj, key) => {
peeking = true;
try {
return obj[key];
} finally {
peeking = false;
}
};
/**
* Internal recursive implementation for {@link deepMerge | `deepMerge`}.
*
* @param target The target object.
* @param source The source object containing new values and props.
* @param override Whether existing props should be overwritten or not (`true`
* by default).
*/
const deepMergeRecursive = (target, source, override = true) => {
// If target is not a plain object and the source is, we don't need to merge
// them because the source will be used as the new value of the target.
if (!(isPlainObject(target) && isPlainObject(source))) {
return;
}
let hasNewKeys = false;
for (const key in source) {
const isNew = !(key in target);
hasNewKeys = hasNewKeys || isNew;
const desc = Object.getOwnPropertyDescriptor(source, key);
const proxy = getProxyFromObject(target);
const propSignal = !!proxy && hasPropSignal(proxy, key) && getPropSignal(proxy, key);
// Handle getters and setters
if (typeof desc.get === 'function' || typeof desc.set === 'function') {
if (override || isNew) {
// Because we are setting a getter or setter, we need to use
// Object.defineProperty to define the property on the target object.
Object.defineProperty(target, key, {
...desc,
configurable: true,
enumerable: true
});
// Update the getter in the property signal if it exists
if (desc.get && propSignal) {
propSignal.setGetter(desc.get);
}
}
// Handle nested objects
} else if (isPlainObject(source[key])) {
const targetValue = Object.getOwnPropertyDescriptor(target, key)?.value;
if (isNew || override && !isPlainObject(targetValue)) {
// Create a new object if the property is new or needs to be overridden
target[key] = {};
if (propSignal) {
// Create a new proxified state for the nested object
const ns = getNamespaceFromProxy(proxy);
propSignal.setValue(proxifyState(ns, target[key]));
}
deepMergeRecursive(target[key], source[key], override);
}
// Both target and source are plain objects, merge them recursively
else if (isPlainObject(targetValue)) {
deepMergeRecursive(target[key], source[key], override);
}
// Handle primitive values and non-plain objects
} else if (override || isNew) {
Object.defineProperty(target, key, desc);
if (propSignal) {
const {
value
} = desc;
const ns = getNamespaceFromProxy(proxy);
// Proxify the value if necessary before setting it in the signal
propSignal.setValue(shouldProxy(value) ? proxifyState(ns, value) : value);
}
}
}
if (hasNewKeys && objToIterable.has(target)) {
objToIterable.get(target).value++;
}
};
/**
* Recursively update prop values inside the passed `target` and nested plain
* objects, using the values present in `source`. References to plain objects
* are kept, only updating props containing primitives or arrays. Arrays are
* replaced instead of merged or concatenated.
*
* If the `override` parameter is set to `false`, then all values in `target`
* are preserved, and only new properties from `source` are added.
*
* @param target The target object.
* @param source The source object containing new values and props.
* @param override Whether existing props should be overwritten or not (`true`
* by default).
*/
const deepMerge = (target, source, override = true) => signals_core_module_r(() => deepMergeRecursive(getObjectFromProxy(target) || target, source, override));
;// ./node_modules/@wordpress/interactivity/build-module/proxies/store.js
/**
* Internal dependencies
*/
/**
* External dependencies
*/
/**
* Identifies the store proxies handling the root objects of each store.
*/
const storeRoots = new WeakSet();
/**
* Handlers for store proxies.
*/
const storeHandlers = {
get: (target, key, receiver) => {
const result = Reflect.get(target, key);
const ns = getNamespaceFromProxy(receiver);
/*
* Check if the proxy is the store root and no key with that name exist. In
* that case, return an empty object for the requested key.
*/
if (typeof result === 'undefined' && storeRoots.has(receiver)) {
const obj = {};
Reflect.set(target, key, obj);
return proxifyStore(ns, obj, false);
}
/*
* Check if the property is a function. If it is, add the store
* namespace to the stack and wrap the function with the current scope.
* The `withScope` util handles both synchronous functions and generator
* functions.
*/
if (typeof result === 'function') {
setNamespace(ns);
const scoped = withScope(result);
resetNamespace();
return scoped;
}
// Check if the property is an object. If it is, proxyify it.
if (isPlainObject(result) && shouldProxy(result)) {
return proxifyStore(ns, result, false);
}
return result;
}
};
/**
* Returns the proxy associated with the given store object, creating it if it
* does not exist.
*
* @param namespace The namespace that will be associated to this proxy.
* @param obj The object to proxify.
*
* @param isRoot Whether the passed object is the store root object.
* @throws Error if the object cannot be proxified. Use {@link shouldProxy} to
* check if a proxy can be created for a specific object.
*
* @return The associated proxy.
*/
const proxifyStore = (namespace, obj, isRoot = true) => {
const proxy = createProxy(namespace, obj, storeHandlers);
if (proxy && isRoot) {
storeRoots.add(proxy);
}
return proxy;
};
;// ./node_modules/@wordpress/interactivity/build-module/proxies/context.js
const contextObjectToProxy = new WeakMap();
const contextObjectToFallback = new WeakMap();
const contextProxies = new WeakSet();
const descriptor = Reflect.getOwnPropertyDescriptor;
// TODO: Use the proxy registry to avoid multiple proxies on the same object.
const contextHandlers = {
get: (target, key) => {
const fallback = contextObjectToFallback.get(target);
// Always subscribe to prop changes in the current context.
const currentProp = target[key];
/*
* Return the value from `target` if it exists, or from `fallback`
* otherwise. This way, in the case the property doesn't exist either in
* `target` or `fallback`, it also subscribes to changes in the parent
* context.
*/
return key in target ? currentProp : fallback[key];
},
set: (target, key, value) => {
const fallback = contextObjectToFallback.get(target);
// If the property exists in the current context, modify it. Otherwise,
// add it to the current context.
const obj = key in target || !(key in fallback) ? target : fallback;
obj[key] = value;
return true;
},
ownKeys: target => [...new Set([...Object.keys(contextObjectToFallback.get(target)), ...Object.keys(target)])],
getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key),
has: (target, key) => Reflect.has(target, key) || Reflect.has(contextObjectToFallback.get(target), key)
};
/**
* Wrap a context object with a proxy to reproduce the context stack. The proxy
* uses the passed `inherited` context as a fallback to look up for properties
* that don't exist in the given context. Also, updated properties are modified
* where they are defined, or added to the main context when they don't exist.
*
* @param current Current context.
* @param inherited Inherited context, used as fallback.
*
* @return The wrapped context object.
*/
const proxifyContext = (current, inherited = {}) => {
if (contextProxies.has(current)) {
throw Error('This object cannot be proxified.');
}
// Update the fallback object reference when it changes.
contextObjectToFallback.set(current, inherited);
if (!contextObjectToProxy.has(current)) {
const proxy = new Proxy(current, contextHandlers);
contextObjectToProxy.set(current, proxy);
contextProxies.add(proxy);
}
return contextObjectToProxy.get(current);
};
;// ./node_modules/@wordpress/interactivity/build-module/proxies/index.js
/**
* Internal dependencies
*/
;// ./node_modules/@wordpress/interactivity/build-module/store.js
/**
* Internal dependencies
*/
/**
* External dependencies
*/
const stores = new Map();
const rawStores = new Map();
const storeLocks = new Map();
const storeConfigs = new Map();
const serverStates = new Map();
/**
* Get the defined config for the store with the passed namespace.
*
* @param namespace Store's namespace from which to retrieve the config.
* @return Defined config for the given namespace.
*/
const getConfig = namespace => storeConfigs.get(namespace || getNamespace()) || {};
/**
* Get the part of the state defined and updated from the server.
*
* The object returned is read-only, and includes the state defined in PHP with
* `wp_interactivity_state()`. When using `actions.navigate()`, this object is
* updated to reflect the changes in its properties, without affecting the state
* returned by `store()`. Directives can subscribe to those changes to update
* the state if needed.
*
* @example
* ```js
* const { state } = store('myStore', {
* callbacks: {
* updateServerState() {
* const serverState = getServerState();
* // Override some property with the new value that came from the server.
* state.overridableProp = serverState.overridableProp;
* },
* },
* });
* ```
*
* @param namespace Store's namespace from which to retrieve the server state.
* @return The server state for the given namespace.
*/
const getServerState = namespace => {
const ns = namespace || getNamespace();
if (!serverStates.has(ns)) {
serverStates.set(ns, proxifyState(ns, {}, {
readOnly: true
}));
}
return serverStates.get(ns);
};
const universalUnlock = 'I acknowledge that using a private store means my plugin will inevitably break on the next store release.';
/**
* Extends the Interactivity API global store adding the passed properties to
* the given namespace. It also returns stable references to the namespace
* content.
*
* These props typically consist of `state`, which is the reactive part of the
* store ― which means that any directive referencing a state property will be
* re-rendered anytime it changes ― and function properties like `actions` and
* `callbacks`, mostly used for event handlers. These props can then be
* referenced by any directive to make the HTML interactive.
*
* @example
* ```js
* const { state } = store( 'counter', {
* state: {
* value: 0,
* get double() { return state.value * 2; },
* },
* actions: {
* increment() {
* state.value += 1;
* },
* },
* } );
* ```
*
* The code from the example above allows blocks to subscribe and interact with
* the store by using directives in the HTML, e.g.:
*
* ```html
* <div data-wp-interactive="counter">
* <button
* data-wp-text="state.double"
* data-wp-on--click="actions.increment"
* >
* 0
* </button>
* </div>
* ```
* @param namespace The store namespace to interact with.
* @param storePart Properties to add to the store namespace.
* @param options Options for the given namespace.
*
* @return A reference to the namespace content.
*/
// Overload for when the types are inferred.
// Overload for when types are passed via generics and they contain state.
// Overload for when types are passed via generics and they don't contain state.
// Overload for when types are divided into multiple parts.
function store(namespace, {
state = {},
...block
} = {}, {
lock = false
} = {}) {
if (!stores.has(namespace)) {
// Lock the store if the passed lock is different from the universal
// unlock. Once the lock is set (either false, true, or a given string),
// it cannot change.
if (lock !== universalUnlock) {
storeLocks.set(namespace, lock);
}
const rawStore = {
state: proxifyState(namespace, isPlainObject(state) ? state : {}),
...block
};
const proxifiedStore = proxifyStore(namespace, rawStore);
rawStores.set(namespace, rawStore);
stores.set(namespace, proxifiedStore);
} else {
// Lock the store if it wasn't locked yet and the passed lock is
// different from the universal unlock. If no lock is given, the store
// will be public and won't accept any lock from now on.
if (lock !== universalUnlock && !storeLocks.has(namespace)) {
storeLocks.set(namespace, lock);
} else {
const storeLock = storeLocks.get(namespace);
const isLockValid = lock === universalUnlock || lock !== true && lock === storeLock;
if (!isLockValid) {
if (!storeLock) {
throw Error('Cannot lock a public store');
} else {
throw Error('Cannot unlock a private store with an invalid lock code');
}
}
}
const target = rawStores.get(namespace);
deepMerge(target, block);
deepMerge(target.state, state);
}
return stores.get(namespace);
}
const parseServerData = (dom = document) => {
var _dom$getElementById;
const jsonDataScriptTag = // Preferred Script Module data passing form
(_dom$getElementById = dom.getElementById('wp-script-module-data-@wordpress/interactivity')) !== null && _dom$getElementById !== void 0 ? _dom$getElementById :
// Legacy form
dom.getElementById('wp-interactivity-data');
if (jsonDataScriptTag?.textContent) {
try {
return JSON.parse(jsonDataScriptTag.textContent);
} catch {}
}
return {};
};
const populateServerData = data => {
if (isPlainObject(data?.state)) {
Object.entries(data.state).forEach(([namespace, state]) => {
const st = store(namespace, {}, {
lock: universalUnlock
});
deepMerge(st.state, state, false);
deepMerge(getServerState(namespace), state);
});
}
if (isPlainObject(data?.config)) {
Object.entries(data.config).forEach(([namespace, config]) => {
storeConfigs.set(namespace, config);
});
}
};
// Parse and populate the initial state and config.
const data = parseServerData();
populateServerData(data);
;// ./node_modules/@wordpress/interactivity/build-module/hooks.js
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable react-hooks/exhaustive-deps */
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function isNonDefaultDirectiveSuffix(entry) {
return entry.suffix !== null;
}
function isDefaultDirectiveSuffix(entry) {
return entry.suffix === null;
}
// Main context.
const context = (0,preact_module/* createContext */.q6)({
client: {},
server: {}
});
// WordPress Directives.
const directiveCallbacks = {};
const directivePriorities = {};
/**
* Register a new directive type in the Interactivity API runtime.
*
* @example
* ```js
* directive(
* 'alert', // Name without the `data-wp-` prefix.
* ( { directives: { alert }, element, evaluate } ) => {
* const defaultEntry = alert.find( isDefaultDirectiveSuffix );
* element.props.onclick = () => { alert( evaluate( defaultEntry ) ); }
* }
* )
* ```
*
* The previous code registers a custom directive type for displaying an alert
* message whenever an element using it is clicked. The message text is obtained
* from the store under the inherited namespace, using `evaluate`.
*
* When the HTML is processed by the Interactivity API, any element containing
* the `data-wp-alert` directive will have the `onclick` event handler, e.g.,
*
* ```html
* <div data-wp-interactive="messages">
* <button data-wp-alert="state.alert">Click me!</button>
* </div>
* ```
* Note that, in the previous example, the directive callback gets the path
* value (`state.alert`) from the directive entry with suffix `null`. A
* custom suffix can also be specified by appending `--` to the directive
* attribute, followed by the suffix, like in the following HTML snippet:
*
* ```html
* <div data-wp-interactive="myblock">
* <button
* data-wp-color--text="state.text"
* data-wp-color--background="state.background"
* >Click me!</button>
* </div>
* ```
*
* This could be an hypothetical implementation of the custom directive used in
* the snippet above.
*
* @example
* ```js
* directive(
* 'color', // Name without prefix and suffix.
* ( { directives: { color: colors }, ref, evaluate } ) =>
* colors.forEach( ( color ) => {
* if ( color.suffix = 'text' ) {
* ref.style.setProperty(
* 'color',
* evaluate( color.text )
* );
* }
* if ( color.suffix = 'background' ) {
* ref.style.setProperty(
* 'background-color',
* evaluate( color.background )
* );
* }
* } );
* }
* )
* ```
*
* @param name Directive name, without the `data-wp-` prefix.
* @param callback Function that runs the directive logic.
* @param options Options object.
* @param options.priority Option to control the directive execution order. The
* lesser, the highest priority. Default is `10`.
*/
const directive = (name, callback, {
priority = 10
} = {}) => {
directiveCallbacks[name] = callback;
directivePriorities[name] = priority;
};
// Resolve the path to some property of the store object.
const resolve = (path, namespace) => {
if (!namespace) {
warn(`Namespace missing for "${path}". The value for that path won't be resolved.`);
return;
}
let resolvedStore = stores.get(namespace);
if (typeof resolvedStore === 'undefined') {
resolvedStore = store(namespace, {}, {
lock: universalUnlock
});
}
const current = {
...resolvedStore,
context: getScope().context[namespace]
};
try {
// TODO: Support lazy/dynamically initialized stores
return path.split('.').reduce((acc, key) => acc[key], current);
} catch (e) {}
};
// Generate the evaluate function.
const getEvaluate = ({
scope
}) =>
// TODO: When removing the temporarily remaining `value( ...args )` call below, remove the `...args` parameter too.
(entry, ...args) => {
let {
value: path,
namespace
} = entry;
if (typeof path !== 'string') {
throw new Error('The `value` prop should be a string path');
}
// If path starts with !, remove it and save a flag.
const hasNegationOperator = path[0] === '!' && !!(path = path.slice(1));
setScope(scope);
const value = resolve(path, namespace);
// Functions are returned without invoking them.
if (typeof value === 'function') {
// Except if they have a negation operator present, for backward compatibility.
// This pattern is strongly discouraged and deprecated, and it will be removed in a near future release.
// TODO: Remove this condition to effectively ignore negation operator when provided with a function.
if (hasNegationOperator) {
warn('Using a function with a negation operator is deprecated and will stop working in WordPress 6.9. Please use derived state instead.');
const functionResult = !value(...args);
resetScope();
return functionResult;
}
// Reset scope before return and wrap the function so it will still run within the correct scope.
resetScope();
return (...functionArgs) => {
setScope(scope);
const functionResult = value(...functionArgs);
resetScope();
return functionResult;
};
}
const result = value;
resetScope();
return hasNegationOperator ? !result : result;
};
// Separate directives by priority. The resulting array contains objects
// of directives grouped by same priority, and sorted in ascending order.
const getPriorityLevels = directives => {
const byPriority = Object.keys(directives).reduce((obj, name) => {
if (directiveCallbacks[name]) {
const priority = directivePriorities[name];
(obj[priority] = obj[priority] || []).push(name);
}
return obj;
}, {});
return Object.entries(byPriority).sort(([p1], [p2]) => parseInt(p1) - parseInt(p2)).map(([, arr]) => arr);
};
// Component that wraps each priority level of directives of an element.
const Directives = ({
directives,
priorityLevels: [currentPriorityLevel, ...nextPriorityLevels],
element,
originalProps,
previousScope
}) => {
// Initialize the scope of this element. These scopes are different per each
// level because each level has a different context, but they share the same
// element ref, state and props.
const scope = A({}).current;
scope.evaluate = q(getEvaluate({
scope
}), []);
const {
client,
server
} = x(context);
scope.context = client;
scope.serverContext = server;
/* eslint-disable react-hooks/rules-of-hooks */
scope.ref = previousScope?.ref || A(null);
/* eslint-enable react-hooks/rules-of-hooks */
// Create a fresh copy of the vnode element and add the props to the scope,
// named as attributes (HTML Attributes).
element = (0,preact_module/* cloneElement */.Ob)(element, {
ref: scope.ref
});
scope.attributes = element.props;
// Recursively render the wrapper for the next priority level.
const children = nextPriorityLevels.length > 0 ? (0,preact_module.h)(Directives, {
directives,
priorityLevels: nextPriorityLevels,
element,
originalProps,
previousScope: scope
}) : element;
const props = {
...originalProps,
children
};
const directiveArgs = {
directives,
props,
element,
context,
evaluate: scope.evaluate
};
setScope(scope);
for (const directiveName of currentPriorityLevel) {
const wrapper = directiveCallbacks[directiveName]?.(directiveArgs);
if (wrapper !== undefined) {
props.children = wrapper;
}
}
resetScope();
return props.children;
};
// Preact Options Hook called each time a vnode is created.
const old = preact_module/* options */.fF.vnode;
preact_module/* options */.fF.vnode = vnode => {
if (vnode.props.__directives) {
const props = vnode.props;
const directives = props.__directives;
if (directives.key) {
vnode.key = directives.key.find(isDefaultDirectiveSuffix).value;
}
delete props.__directives;
const priorityLevels = getPriorityLevels(directives);
if (priorityLevels.length > 0) {
vnode.props = {
directives,
priorityLevels,
originalProps: props,
type: vnode.type,
element: (0,preact_module.h)(vnode.type, props),
top: true
};
vnode.type = Directives;
}
}
if (old) {
old(vnode);
}
};
;// ./node_modules/@wordpress/interactivity/build-module/directives.js
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable react-hooks/exhaustive-deps */
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Recursively clone the passed object.
*
* @param source Source object.
* @return Cloned object.
*/
function deepClone(source) {
if (isPlainObject(source)) {
return Object.fromEntries(Object.entries(source).map(([key, value]) => [key, deepClone(value)]));
}
if (Array.isArray(source)) {
return source.map(i => deepClone(i));
}
return source;
}
/**
* Wraps event object to warn about access of synchronous properties and methods.
*
* For all store actions attached to an event listener the event object is proxied via this function, unless the action
* uses the `withSyncEvent()` utility to indicate that it requires synchronous access to the event object.
*
* At the moment, the proxied event only emits warnings when synchronous properties or methods are being accessed. In
* the future this will be changed and result in an error. The current temporary behavior allows implementers to update
* their relevant actions to use `withSyncEvent()`.
*
* For additional context, see https://github.com/WordPress/gutenberg/issues/64944.
*
* @param event Event object.
* @return Proxied event object.
*/
function wrapEventAsync(event) {
const handler = {
get(target, prop, receiver) {
const value = target[prop];
switch (prop) {
case 'currentTarget':
warn(`Accessing the synchronous event.${prop} property in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 6.9. Please wrap the store action in withSyncEvent().`);
break;
case 'preventDefault':
case 'stopImmediatePropagation':
case 'stopPropagation':
warn(`Using the synchronous event.${prop}() function in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 6.9. Please wrap the store action in withSyncEvent().`);
break;
}
if (value instanceof Function) {
return function (...args) {
return value.apply(this === receiver ? target : this, args);
};
}
return value;
}
};
return new Proxy(event, handler);
}
const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
const ruleClean = /\/\*[^]*?\*\/| +/g;
const ruleNewline = /\n+/g;
const empty = ' ';
/**
* Convert a css style string into a object.
*
* Made by Cristian Bote (@cristianbote) for Goober.
* https://unpkg.com/browse/goober@2.1.13/src/core/astish.js
*
* @param val CSS string.
* @return CSS object.
*/
const cssStringToObject = val => {
const tree = [{}];
let block, left;
while (block = newRule.exec(val.replace(ruleClean, ''))) {
if (block[4]) {
tree.shift();
} else if (block[3]) {
left = block[3].replace(ruleNewline, empty).trim();
tree.unshift(tree[0][left] = tree[0][left] || {});
} else {
tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
}
}
return tree[0];
};
/**
* Creates a directive that adds an event listener to the global window or
* document object.
*
* @param type 'window' or 'document'
*/
const getGlobalEventDirective = type => {
return ({
directives,
evaluate
}) => {
directives[`on-${type}`].filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const eventName = entry.suffix.split('--', 1)[0];
useInit(() => {
const cb = event => {
const result = evaluate(entry);
if (typeof result === 'function') {
if (!result?.sync) {
event = wrapEventAsync(event);
}
result(event);
}
};
const globalVar = type === 'window' ? window : document;
globalVar.addEventListener(eventName, cb);
return () => globalVar.removeEventListener(eventName, cb);
});
});
};
};
/**
* Creates a directive that adds an async event listener to the global window or
* document object.
*
* @param type 'window' or 'document'
*/
const getGlobalAsyncEventDirective = type => {
return ({
directives,
evaluate
}) => {
directives[`on-async-${type}`].filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const eventName = entry.suffix.split('--', 1)[0];
useInit(() => {
const cb = async event => {
await splitTask();
const result = evaluate(entry);
if (typeof result === 'function') {
result(event);
}
};
const globalVar = type === 'window' ? window : document;
globalVar.addEventListener(eventName, cb, {
passive: true
});
return () => globalVar.removeEventListener(eventName, cb);
});
});
};
};
/* harmony default export */ const directives = (() => {
// data-wp-context
directive('context', ({
directives: {
context
},
props: {
children
},
context: inheritedContext
}) => {
const {
Provider
} = inheritedContext;
const defaultEntry = context.find(isDefaultDirectiveSuffix);
const {
client: inheritedClient,
server: inheritedServer
} = x(inheritedContext);
const ns = defaultEntry.namespace;
const client = A(proxifyState(ns, {}));
const server = A(proxifyState(ns, {}, {
readOnly: true
}));
// No change should be made if `defaultEntry` does not exist.
const contextStack = T(() => {
const result = {
client: {
...inheritedClient
},
server: {
...inheritedServer
}
};
if (defaultEntry) {
const {
namespace,
value
} = defaultEntry;
// Check that the value is a JSON object. Send a console warning if not.
if (!isPlainObject(value)) {
warn(`The value of data-wp-context in "${namespace}" store must be a valid stringified JSON object.`);
}
deepMerge(client.current, deepClone(value), false);
deepMerge(server.current, deepClone(value));
result.client[namespace] = proxifyContext(client.current, inheritedClient[namespace]);
result.server[namespace] = proxifyContext(server.current, inheritedServer[namespace]);
}
return result;
}, [defaultEntry, inheritedClient, inheritedServer]);
return (0,preact_module.h)(Provider, {
value: contextStack
}, children);
}, {
priority: 5
});
// data-wp-watch--[name]
directive('watch', ({
directives: {
watch
},
evaluate
}) => {
watch.forEach(entry => {
useWatch(() => {
let start;
if (false) {}
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
if (false) {}
return result;
});
});
});
// data-wp-init--[name]
directive('init', ({
directives: {
init
},
evaluate
}) => {
init.forEach(entry => {
// TODO: Replace with useEffect to prevent unneeded scopes.
useInit(() => {
let start;
if (false) {}
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
if (false) {}
return result;
});
});
});
// data-wp-on--[event]
directive('on', ({
directives: {
on
},
element,
evaluate
}) => {
const events = new Map();
on.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const event = entry.suffix.split('--')[0];
if (!events.has(event)) {
events.set(event, new Set());
}
events.get(event).add(entry);
});
events.forEach((entries, eventType) => {
const existingHandler = element.props[`on${eventType}`];
element.props[`on${eventType}`] = event => {
entries.forEach(entry => {
if (existingHandler) {
existingHandler(event);
}
let start;
if (false) {}
const result = evaluate(entry);
if (typeof result === 'function') {
if (!result?.sync) {
event = wrapEventAsync(event);
}
result(event);
}
if (false) {}
});
};
});
});
// data-wp-on-async--[event]
directive('on-async', ({
directives: {
'on-async': onAsync
},
element,
evaluate
}) => {
const events = new Map();
onAsync.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const event = entry.suffix.split('--')[0];
if (!events.has(event)) {
events.set(event, new Set());
}
events.get(event).add(entry);
});
events.forEach((entries, eventType) => {
const existingHandler = element.props[`on${eventType}`];
element.props[`on${eventType}`] = event => {
if (existingHandler) {
existingHandler(event);
}
entries.forEach(async entry => {
await splitTask();
const result = evaluate(entry);
if (typeof result === 'function') {
result(event);
}
});
};
});
});
// data-wp-on-window--[event]
directive('on-window', getGlobalEventDirective('window'));
// data-wp-on-document--[event]
directive('on-document', getGlobalEventDirective('document'));
// data-wp-on-async-window--[event]
directive('on-async-window', getGlobalAsyncEventDirective('window'));
// data-wp-on-async-document--[event]
directive('on-async-document', getGlobalAsyncEventDirective('document'));
// data-wp-class--[classname]
directive('class', ({
directives: {
class: classNames
},
element,
evaluate
}) => {
classNames.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const className = entry.suffix;
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
const currentClass = element.props.class || '';
const classFinder = new RegExp(`(^|\\s)${className}(\\s|$)`, 'g');
if (!result) {
element.props.class = currentClass.replace(classFinder, ' ').trim();
} else if (!classFinder.test(currentClass)) {
element.props.class = currentClass ? `${currentClass} ${className}` : className;
}
useInit(() => {
/*
* This seems necessary because Preact doesn't change the class
* names on the hydration, so we have to do it manually. It doesn't
* need deps because it only needs to do it the first time.
*/
if (!result) {
element.ref.current.classList.remove(className);
} else {
element.ref.current.classList.add(className);
}
});
});
});
// data-wp-style--[style-prop]
directive('style', ({
directives: {
style
},
element,
evaluate
}) => {
style.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const styleProp = entry.suffix;
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
element.props.style = element.props.style || {};
if (typeof element.props.style === 'string') {
element.props.style = cssStringToObject(element.props.style);
}
if (!result) {
delete element.props.style[styleProp];
} else {
element.props.style[styleProp] = result;
}
useInit(() => {
/*
* This seems necessary because Preact doesn't change the styles on
* the hydration, so we have to do it manually. It doesn't need deps
* because it only needs to do it the first time.
*/
if (!result) {
element.ref.current.style.removeProperty(styleProp);
} else {
element.ref.current.style[styleProp] = result;
}
});
});
});
// data-wp-bind--[attribute]
directive('bind', ({
directives: {
bind
},
element,
evaluate
}) => {
bind.filter(isNonDefaultDirectiveSuffix).forEach(entry => {
const attribute = entry.suffix;
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
element.props[attribute] = result;
/*
* This is necessary because Preact doesn't change the attributes on the
* hydration, so we have to do it manually. It only needs to do it the
* first time. After that, Preact will handle the changes.
*/
useInit(() => {
const el = element.ref.current;
/*
* We set the value directly to the corresponding HTMLElement instance
* property excluding the following special cases. We follow Preact's
* logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129
*/
if (attribute === 'style') {
if (typeof result === 'string') {
el.style.cssText = result;
}
return;
} else if (attribute !== 'width' && attribute !== 'height' && attribute !== 'href' && attribute !== 'list' && attribute !== 'form' &&
/*
* The value for `tabindex` follows the parsing rules for an
* integer. If that fails, or if the attribute isn't present, then
* the browsers should "follow platform conventions to determine if
* the element should be considered as a focusable area",
* practically meaning that most elements get a default of `-1` (not
* focusable), but several also get a default of `0` (focusable in
* order after all elements with a positive `tabindex` value).
*
* @see https://html.spec.whatwg.org/#tabindex-value
*/
attribute !== 'tabIndex' && attribute !== 'download' && attribute !== 'rowSpan' && attribute !== 'colSpan' && attribute !== 'role' && attribute in el) {
try {
el[attribute] = result === null || result === undefined ? '' : result;
return;
} catch (err) {}
}
/*
* aria- and data- attributes have no boolean representation.
* A `false` value is different from the attribute not being
* present, so we can't remove it.
* We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136
*/
if (result !== null && result !== undefined && (result !== false || attribute[4] === '-')) {
el.setAttribute(attribute, result);
} else {
el.removeAttribute(attribute);
}
});
});
});
// data-wp-ignore
directive('ignore', ({
element: {
type: Type,
props: {
innerHTML,
...rest
}
}
}) => {
// Preserve the initial inner HTML.
const cached = T(() => innerHTML, []);
return (0,preact_module.h)(Type, {
dangerouslySetInnerHTML: {
__html: cached
},
...rest
});
});
// data-wp-text
directive('text', ({
directives: {
text
},
element,
evaluate
}) => {
const entry = text.find(isDefaultDirectiveSuffix);
if (!entry) {
element.props.children = null;
return;
}
try {
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
element.props.children = typeof result === 'object' ? null : result.toString();
} catch (e) {
element.props.children = null;
}
});
// data-wp-run
directive('run', ({
directives: {
run
},
evaluate
}) => {
run.forEach(entry => {
let result = evaluate(entry);
if (typeof result === 'function') {
result = result();
}
return result;
});
});
// data-wp-each--[item]
directive('each', ({
directives: {
each,
'each-key': eachKey
},
context: inheritedContext,
element,
evaluate
}) => {
if (element.type !== 'template') {
return;
}
const {
Provider
} = inheritedContext;
const inheritedValue = x(inheritedContext);
const [entry] = each;
const {
namespace
} = entry;
let iterable = evaluate(entry);
if (typeof iterable === 'function') {
iterable = iterable();
}
if (typeof iterable?.[Symbol.iterator] !== 'function') {
return;
}
const itemProp = isNonDefaultDirectiveSuffix(entry) ? kebabToCamelCase(entry.suffix) : 'item';
const result = [];
for (const item of iterable) {
const itemContext = proxifyContext(proxifyState(namespace, {}), inheritedValue.client[namespace]);
const mergedContext = {
client: {
...inheritedValue.client,
[namespace]: itemContext
},
server: {
...inheritedValue.server
}
};
// Set the item after proxifying the context.
mergedContext.client[namespace][itemProp] = item;
const scope = {
...getScope(),
context: mergedContext.client,
serverContext: mergedContext.server
};
const key = eachKey ? getEvaluate({
scope
})(eachKey[0]) : item;
result.push((0,preact_module.h)(Provider, {
value: mergedContext,
key
}, element.props.content));
}
return result;
}, {
priority: 20
});
directive('each-child', () => null, {
priority: 1
});
});
;// ./node_modules/@wordpress/interactivity/build-module/constants.js
const directivePrefix = 'wp';
;// ./node_modules/@wordpress/interactivity/build-module/vdom.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
const ignoreAttr = `data-${directivePrefix}-ignore`;
const islandAttr = `data-${directivePrefix}-interactive`;
const fullPrefix = `data-${directivePrefix}-`;
const namespaces = [];
const currentNamespace = () => {
var _namespaces;
return (_namespaces = namespaces[namespaces.length - 1]) !== null && _namespaces !== void 0 ? _namespaces : null;
};
const isObject = item => Boolean(item && typeof item === 'object' && item.constructor === Object);
// Regular expression for directive parsing.
const directiveParser = new RegExp(`^data-${directivePrefix}-` +
// ${p} must be a prefix string, like 'wp'.
// Match alphanumeric characters including hyphen-separated
// segments. It excludes underscore intentionally to prevent confusion.
// E.g., "custom-directive".
'([a-z0-9]+(?:-[a-z0-9]+)*)' +
// (Optional) Match '--' followed by any alphanumeric characters. It
// excludes underscore intentionally to prevent confusion, but it can
// contain multiple hyphens. E.g., "--custom-prefix--with-more-info".
'(?:--([a-z0-9_-]+))?$', 'i' // Case insensitive.
);
// Regular expression for reference parsing. It can contain a namespace before
// the reference, separated by `::`, like `some-namespace::state.somePath`.
// Namespaces can contain any alphanumeric characters, hyphens, underscores or
// forward slashes. References don't have any restrictions.
const nsPathRegExp = /^([\w_\/-]+)::(.+)$/;
const hydratedIslands = new WeakSet();
/**
* Recursive function that transforms a DOM tree into vDOM.
*
* @param root The root element or node to start traversing on.
* @return The resulting vDOM tree.
*/
function toVdom(root) {
const treeWalker = document.createTreeWalker(root, 205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT
);
function walk(node) {
const {
nodeType
} = node;
// TEXT_NODE (3)
if (nodeType === 3) {
return [node.data];
}
// CDATA_SECTION_NODE (4)
if (nodeType === 4) {
var _nodeValue;
const next = treeWalker.nextSibling();
node.replaceWith(new window.Text((_nodeValue = node.nodeValue) !== null && _nodeValue !== void 0 ? _nodeValue : ''));
return [node.nodeValue, next];
}
// COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7)
if (nodeType === 8 || nodeType === 7) {
const next = treeWalker.nextSibling();
node.remove();
return [null, next];
}
const elementNode = node;
const {
attributes
} = elementNode;
const localName = elementNode.localName;
const props = {};
const children = [];
const directives = [];
let ignore = false;
let island = false;
for (let i = 0; i < attributes.length; i++) {
const attributeName = attributes[i].name;
const attributeValue = attributes[i].value;
if (attributeName[fullPrefix.length] && attributeName.slice(0, fullPrefix.length) === fullPrefix) {
if (attributeName === ignoreAttr) {
ignore = true;
} else {
var _regexResult$, _regexResult$2;
const regexResult = nsPathRegExp.exec(attributeValue);
const namespace = (_regexResult$ = regexResult?.[1]) !== null && _regexResult$ !== void 0 ? _regexResult$ : null;
let value = (_regexResult$2 = regexResult?.[2]) !== null && _regexResult$2 !== void 0 ? _regexResult$2 : attributeValue;
try {
const parsedValue = JSON.parse(value);
value = isObject(parsedValue) ? parsedValue : value;
} catch {}
if (attributeName === islandAttr) {
island = true;
const islandNamespace =
// eslint-disable-next-line no-nested-ternary
typeof value === 'string' ? value : typeof value?.namespace === 'string' ? value.namespace : null;
namespaces.push(islandNamespace);
} else {
directives.push([attributeName, namespace, value]);
}
}
} else if (attributeName === 'ref') {
continue;
}
props[attributeName] = attributeValue;
}
if (ignore && !island) {
return [(0,preact_module.h)(localName, {
...props,
innerHTML: elementNode.innerHTML,
__directives: {
ignore: true
}
})];
}
if (island) {
hydratedIslands.add(elementNode);
}
if (directives.length) {
props.__directives = directives.reduce((obj, [name, ns, value]) => {
const directiveMatch = directiveParser.exec(name);
if (directiveMatch === null) {
warn(`Found malformed directive name: ${name}.`);
return obj;
}
const prefix = directiveMatch[1] || '';
const suffix = directiveMatch[2] || null;
obj[prefix] = obj[prefix] || [];
obj[prefix].push({
namespace: ns !== null && ns !== void 0 ? ns : currentNamespace(),
value: value,
suffix
});
return obj;
}, {});
}
if (localName === 'template') {
props.content = [...elementNode.content.childNodes].map(childNode => toVdom(childNode));
} else {
let child = treeWalker.firstChild();
if (child) {
while (child) {
const [vnode, nextChild] = walk(child);
if (vnode) {
children.push(vnode);
}
child = nextChild || treeWalker.nextSibling();
}
treeWalker.parentNode();
}
}
// Restore previous namespace.
if (island) {
namespaces.pop();
}
return [(0,preact_module.h)(localName, props, children)];
}
return walk(treeWalker.currentNode);
}
;// ./node_modules/@wordpress/interactivity/build-module/init.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
// Keep the same root fragment for each interactive region node.
const regionRootFragments = new WeakMap();
const getRegionRootFragment = region => {
if (!region.parentElement) {
throw Error('The passed region should be an element with a parent.');
}
if (!regionRootFragments.has(region)) {
regionRootFragments.set(region, createRootFragment(region.parentElement, region));
}
return regionRootFragments.get(region);
};
// Initial vDOM regions associated with its DOM element.
const initialVdom = new WeakMap();
// Initialize the router with the initial DOM.
const init = async () => {
const nodes = document.querySelectorAll(`[data-${directivePrefix}-interactive]`);
/*
* This `await` with setTimeout is required to apparently ensure that the interactive blocks have their stores
* fully initialized prior to hydrating the blocks. If this is not present, then an error occurs, for example:
* > view.js:46 Uncaught (in promise) ReferenceError: Cannot access 'state' before initialization
* This occurs when splitTask() is implemented with scheduler.yield() as opposed to setTimeout(), as with the former
* split tasks are added to the front of the task queue whereas with the latter they are added to the end of the queue.
*/
await new Promise(resolve => {
setTimeout(resolve, 0);
});
for (const node of nodes) {
if (!hydratedIslands.has(node)) {
await splitTask();
const fragment = getRegionRootFragment(node);
const vdom = toVdom(node);
initialVdom.set(node, vdom);
await splitTask();
(0,preact_module/* hydrate */.Qv)(vdom, fragment);
}
}
};
;// ./node_modules/@wordpress/interactivity/build-module/index.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
const requiredConsent = 'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.';
const privateApis = lock => {
if (lock === requiredConsent) {
return {
directivePrefix: directivePrefix,
getRegionRootFragment: getRegionRootFragment,
initialVdom: initialVdom,
toVdom: toVdom,
directive: directive,
getNamespace: getNamespace,
h: preact_module.h,
cloneElement: preact_module/* cloneElement */.Ob,
render: preact_module/* render */.XX,
proxifyState: proxifyState,
parseServerData: parseServerData,
populateServerData: populateServerData,
batch: signals_core_module_r
};
}
throw new Error('Forbidden access.');
};
directives();
init();
var __webpack_exports__getConfig = __webpack_exports__.zj;
var __webpack_exports__getContext = __webpack_exports__.SD;
var __webpack_exports__getElement = __webpack_exports__.V6;
var __webpack_exports__getServerContext = __webpack_exports__.$K;
var __webpack_exports__getServerState = __webpack_exports__.vT;
var __webpack_exports__privateApis = __webpack_exports__.jb;
var __webpack_exports__splitTask = __webpack_exports__.yT;
var __webpack_exports__store = __webpack_exports__.M_;
var __webpack_exports__useCallback = __webpack_exports__.hb;
var __webpack_exports__useEffect = __webpack_exports__.vJ;
var __webpack_exports__useInit = __webpack_exports__.ip;
var __webpack_exports__useLayoutEffect = __webpack_exports__.Nf;
var __webpack_exports__useMemo = __webpack_exports__.Kr;
var __webpack_exports__useRef = __webpack_exports__.li;
var __webpack_exports__useState = __webpack_exports__.J0;
var __webpack_exports__useWatch = __webpack_exports__.FH;
var __webpack_exports__withScope = __webpack_exports__.v4;
var __webpack_exports__withSyncEvent = __webpack_exports__.mh;
export { __webpack_exports__getConfig as getConfig, __webpack_exports__getContext as getContext, __webpack_exports__getElement as getElement, __webpack_exports__getServerContext as getServerContext, __webpack_exports__getServerState as getServerState, __webpack_exports__privateApis as privateApis, __webpack_exports__splitTask as splitTask, __webpack_exports__store as store, __webpack_exports__useCallback as useCallback, __webpack_exports__useEffect as useEffect, __webpack_exports__useInit as useInit, __webpack_exports__useLayoutEffect as useLayoutEffect, __webpack_exports__useMemo as useMemo, __webpack_exports__useRef as useRef, __webpack_exports__useState as useState, __webpack_exports__useWatch as useWatch, __webpack_exports__withScope as withScope, __webpack_exports__withSyncEvent as withSyncEvent };
interactivity/debug.min.js 0000644 00000135423 15071251711 0011660 0 ustar 00 var e={380:(e,t,n)=>{n.d(t,{zj:()=>pt,SD:()=>ve,V6:()=>ye,$K:()=>me,vT:()=>ht,jb:()=>qt,yT:()=>we,M_:()=>vt,hb:()=>Oe,vJ:()=>Ee,ip:()=>xe,Nf:()=>Te,Kr:()=>Pe,li:()=>b,J0:()=>m,FH:()=>Se,v4:()=>ke,mh:()=>Ne});var r,o,i,s,a=n(622),u=0,c=[],l=a.fF,f=l.__b,_=l.__r,p=l.diffed,h=l.__c,d=l.unmount,v=l.__;function y(e,t){l.__h&&l.__h(o,e,u||t),u=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return u=1,function(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):N(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.__f)){var s=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!a||a.call(this,e,t,n);var o=i.__c.props!==e;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),a&&a.call(this,e,t,n)||o};o.__f=!0;var a=o.shouldComponentUpdate,u=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,s(e,t,n),a=r}u&&u.call(this,e,t,n)},o.shouldComponentUpdate=s}return i.__N||i.__}(N,e)}function g(e,t){var n=y(r++,3);!l.__s&&C(n.__H,t)&&(n.__=e,n.u=t,o.__H.__h.push(n))}function w(e,t){var n=y(r++,4);!l.__s&&C(n.__H,t)&&(n.__=e,n.u=t,o.__h.push(n))}function b(e){return u=5,k((function(){return{current:e}}),[])}function k(e,t){var n=y(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function S(e,t){return u=8,k((function(){return e}),t)}function x(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function E(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(P),e.__H.__h.forEach(F),e.__H.__h=[]}catch(t){e.__H.__h=[],l.__e(t,e.__v)}}l.__b=function(e){o=null,f&&f(e)},l.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},l.__r=function(e){_&&_(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(P),t.__h.forEach(F),t.__h=[],r=0)),i=o},l.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&s===l.requestAnimationFrame||((s=l.requestAnimationFrame)||O)(E)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),i=o=null},l.__c=function(e,t){t.some((function(e){try{e.__h.forEach(P),e.__h=e.__h.filter((function(e){return!e.__||F(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],l.__e(n,e.__v)}})),h&&h(e,t)},l.unmount=function(e){d&&d(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{P(e)}catch(e){t=e}})),n.__H=void 0,t&&l.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame;function O(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function P(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function F(e){var t=o;e.__c=e.__(),o=t}function C(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}var j=Symbol.for("preact-signals");function M(){if(W>1)W--;else{for(var e,t=!1;void 0!==A;){var n=A;for(A=void 0,D++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&V(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(D=0,W--,t)throw e}}function $(e){if(W>0)return e();W++;try{return e()}finally{M()}}var H=void 0;var U,A=void 0,W=0,D=0,L=0;function I(e){if(void 0!==H){var t=e.n;if(void 0===t||t.t!==H)return t={i:0,S:e,p:H.s,n:void 0,t:H,e:void 0,x:void 0,r:t},void 0!==H.s&&(H.s.n=t),H.s=t,e.n=t,32&H.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=H.s,t.n=void 0,H.s.n=t,H.s=t),t}}function R(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function z(e){return new R(e)}function V(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function B(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function J(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function K(e){R.call(this,void 0),this.x=e,this.s=void 0,this.g=L-1,this.f=4}function q(e){return new K(e)}function Y(e){var t=e.u;if(e.u=void 0,"function"==typeof t){W++;var n=H;H=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,X(e),t}finally{H=n,M()}}}function X(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Y(e)}function G(e){if(H!==this)throw new Error("Out-of-order effect");J(this),H=e,this.f&=-2,8&this.f&&X(this),M()}function Q(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Z(e){var t=new Q(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function ee(e,t){a.fF[e]=t.bind(null,a.fF[e]||function(){})}function te(e){U&&U(),U=e&&e.S()}function ne(e){var t=this,n=e.data,r=function(e){return k((function(){return z(e)}),[])}(n);r.value=n;var o=k((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e,n=t.__$u.S(),r=o.value;n(),(0,a.zO)(r)||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=r},q((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function re(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=z(n);return{o:function(e,t){i.value=e,r=t},d:Z((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}R.prototype.brand=j,R.prototype.h=function(){return!0},R.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},R.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},R.prototype.subscribe=function(e){var t=this;return Z((function(){var n=t.value,r=H;H=void 0;try{e(n)}finally{H=r}}))},R.prototype.valueOf=function(){return this.value},R.prototype.toString=function(){return this.value+""},R.prototype.toJSON=function(){return this.value},R.prototype.peek=function(){var e=H;H=void 0;try{return this.value}finally{H=e}},Object.defineProperty(R.prototype,"value",{get:function(){var e=I(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(D>100)throw new Error("Cycle detected");this.v=e,this.i++,L++,W++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{M()}}}}),(K.prototype=new R).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===L)return!0;if(this.g=L,this.f|=1,this.i>0&&!V(this))return this.f&=-2,!0;var e=H;try{B(this),H=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return H=e,J(this),this.f&=-2,!0},K.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}R.prototype.S.call(this,e)},K.prototype.U=function(e){if(void 0!==this.t&&(R.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},K.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(K.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=I(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Q.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Q.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Y(this),B(this),W++;var e=H;return H=this,G.bind(this,e)},Q.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},Q.prototype.d=function(){this.f|=8,1&this.f||X(this)},ne.displayName="_st",Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ne},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ee("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof R&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),ee("__r",(function(e,t){te();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return Z((function(){e=this})),e.c=function(){r.__$f|=1,r.setState({})},e}())),te(n),e(t)})),ee("__e",(function(e,t,n,r){te(),e(t,n,r)})),ee("diffed",(function(e,t){var n;if(te(),"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var a=i[s];void 0===a||s in r||(a.d(),i[s]=void 0)}else n.U=i={};for(var u in r){var c=i[u],l=r[u];void 0===c?(c=re(n,u,l,o),i[u]=c):c.o(l,o)}}}e(t)})),ee("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)})),ee("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),a.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&void 0!==n.s;for(var o in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(r||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var i in e)if("__source"!==i&&e[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};const oe=[],ie=()=>oe.slice(-1)[0],se=e=>{oe.push(e)},ae=()=>{oe.pop()},ue=[],ce=()=>ue.slice(-1)[0],le=e=>{ue.push(e)},fe=()=>{ue.pop()},_e=new WeakMap,pe=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},he={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?de(r):r},set:pe,deleteProperty:pe},de=e=>(_e.has(e)||_e.set(e,new Proxy(e,he)),_e.get(e)),ve=e=>ce().context[e||ie()],ye=()=>{const e=ce();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:de(n)})},me=e=>ce().serverContext[e||ie()],ge=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),we="function"==typeof window.scheduler?.yield?window.scheduler.yield.bind(window.scheduler):()=>new Promise((e=>{setTimeout(e,0)}));function be(e){g((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=Z((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await ge(t.flush),n=!1)})),t.dispose}),[])}function ke(e){const t=ce(),n=ie();let r;r="GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){se(n),le(t);try{s=o.next(i)}finally{fe(),ae()}try{i=await s.value}catch(e){se(n),le(t),o.throw(e)}finally{fe(),ae()}if(s.done)break}return i}:(...r)=>{se(n),le(t);try{return e(...r)}finally{ae(),fe()}};if(e.sync){const e=r;return e.sync=!0,e}return r}function Se(e){be(ke(e))}function xe(e){g(ke(e),[])}function Ee(e,t){g(ke(e),t)}function Te(e,t){w(ke(e),t)}function Oe(e,t){return S(ke(e),t)}function Pe(e,t){return k(ke(e),t)}new Set;const Fe=e=>{0},Ce=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object);function Ne(e){const t=e;return t.sync=!0,t}const je=new WeakMap,Me=new WeakMap,$e=new WeakMap,He=new Set([Object,Array]),Ue=(e,t,n)=>{if(!De(t))throw Error("This object cannot be proxified.");if(!je.has(t)){const r=new Proxy(t,n);je.set(t,r),Me.set(r,t),$e.set(r,e)}return je.get(t)},Ae=e=>je.get(e),We=e=>$e.get(e),De=e=>"object"==typeof e&&null!==e&&(!$e.has(e)&&He.has(e.constructor)),Le={};class Ie{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=ce()||Le;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};se(We(this.owner)),this.computedsByScope.set(e,q(ke(t))),ae()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||$((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=z(t),this.getterSignal=z(e))}}const Re=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),ze=new WeakMap,Ve=(e,t)=>ze.has(e)&&ze.get(e).has(t),Be=new WeakSet,Je=(e,t,n)=>{ze.has(e)||ze.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=ze.get(e);if(!r.has(t)){const o=We(e),i=new Ie(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=Be.has(e);i.setValue(De(r)?Xe(o,r,{readOnly:t}):r)}}}return r.get(t)},Ke=new WeakMap;let qe=!1;const Ye={get(e,t,n){if(qe||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&Re.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Je(n,t,r).getComputed().value;if("function"==typeof o){const e=We(n);return(...t)=>{se(e);try{return o.call(n,...t)}finally{ae()}}}return o},set(e,t,n,r){if(Be.has(r))return!1;se(We(r));try{return Reflect.set(e,t,n,r)}finally{ae()}},defineProperty(e,t,n){if(Be.has(Ae(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Ae(e),i=Je(o,t),{get:s,value:a}=n;if(s)i.setGetter(s);else{const e=We(o);i.setValue(De(a)?Xe(e,a):a)}if(r&&Ke.has(e)&&Ke.get(e).value++,Array.isArray(e)&&ze.get(o)?.has("length")){Je(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(Be.has(Ae(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){Je(Ae(e),t).setValue(void 0),Ke.has(e)&&Ke.get(e).value++}return n},ownKeys:e=>(Ke.has(e)||Ke.set(e,z(0)),Ke._=Ke.get(e).value,Reflect.ownKeys(e))},Xe=(e,t,n)=>{const r=Ue(e,t,Ye);return n?.readOnly&&Be.add(r),r},Ge=(e,t,n=!0)=>{if(!Ce(e)||!Ce(t))return;let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o),a=Ae(e),u=!!a&&Ve(a,o)&&Je(a,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0}),s.get&&u&&u.setGetter(s.get));else if(Ce(t[o])){const r=Object.getOwnPropertyDescriptor(e,o)?.value;if(i||n&&!Ce(r)){if(e[o]={},u){const t=We(a);u.setValue(Xe(t,e[o]))}Ge(e[o],t[o],n)}else Ce(r)&&Ge(e[o],t[o],n)}else if((n||i)&&(Object.defineProperty(e,o,s),u)){const{value:e}=s,t=We(a);u.setValue(De(e)?Xe(t,e):e)}}r&&Ke.has(e)&&Ke.get(e).value++},Qe=(e,t,n=!0)=>$((()=>{return Ge((r=e,Me.get(r)||e),t,n);var r})),Ze=new WeakSet,et={get:(e,t,n)=>{const r=Reflect.get(e,t),o=We(n);if(void 0===r&&Ze.has(n)){const n={};return Reflect.set(e,t,n),tt(o,n,!1)}if("function"==typeof r){se(o);const e=ke(r);return ae(),e}return Ce(r)&&De(r)?tt(o,r,!1):r}},tt=(e,t,n=!0)=>{const r=Ue(e,t,et);return r&&n&&Ze.add(r),r},nt=new WeakMap,rt=new WeakMap,ot=new WeakSet,it=Reflect.getOwnPropertyDescriptor,st={get:(e,t)=>{const n=rt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=rt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(rt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>it(e,t)||it(rt.get(e),t),has:(e,t)=>Reflect.has(e,t)||Reflect.has(rt.get(e),t)},at=(e,t={})=>{if(ot.has(e))throw Error("This object cannot be proxified.");if(rt.set(e,t),!nt.has(e)){const t=new Proxy(e,st);nt.set(e,t),ot.add(t)}return nt.get(e)},ut=new Map,ct=new Map,lt=new Map,ft=new Map,_t=new Map,pt=e=>ft.get(e||ie())||{},ht=e=>{const t=e||ie();return _t.has(t)||_t.set(t,Xe(t,{},{readOnly:!0})),_t.get(t)},dt="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function vt(e,{state:t={},...n}={},{lock:r=!1}={}){if(ut.has(e)){if(r===dt||lt.has(e)){const t=lt.get(e);if(!(r===dt||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else lt.set(e,r);const o=ct.get(e);Qe(o,n),Qe(o.state,t)}else{r!==dt&<.set(e,r);const o={state:Xe(e,Ce(t)?t:{}),...n},i=tt(e,o);ct.set(e,o),ut.set(e,i)}return ut.get(e)}const yt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},mt=e=>{Ce(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=vt(e,{},{lock:dt});Qe(n.state,t,!1),Qe(ht(e),t)})),Ce(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{ft.set(e,t)}))},gt=yt();function wt(e){return null!==e.suffix}function bt(e){return null===e.suffix}mt(gt);const kt=(0,a.q6)({client:{},server:{}}),St={},xt={},Et=(e,t,{priority:n=10}={})=>{St[e]=t,xt[e]=n},Tt=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));le(e);const s=((e,t)=>{if(!t)return void Fe();let n=ut.get(t);void 0===n&&(n=vt(t,{},{lock:dt}));const r={...n,context:ce().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o);if("function"==typeof s){if(i){Fe();const e=!s(...n);return fe(),e}return fe(),(...t)=>{le(e);const n=s(...t);return fe(),n}}const a=s;return fe(),i?!a:a},Ot=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=b({}).current;s.evaluate=S(Tt({scope:s}),[]);const{client:u,server:c}=x(kt);s.context=u,s.serverContext=c,s.ref=i?.ref||b(null),r=(0,a.Ob)(r,{ref:s.ref}),s.attributes=r.props;const l=n.length>0?(0,a.h)(Ot,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,f={...o,children:l},_={directives:e,props:f,element:r,context:kt,evaluate:s.evaluate};le(s);for(const e of t){const t=St[e]?.(_);void 0!==t&&(f.children=t)}return fe(),f.children},Pt=a.fF.vnode;function Ft(e){return Ce(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Ft(t)]))):Array.isArray(e)?e.map((e=>Ft(e))):e}function Ct(e){return new Proxy(e,{get(e,t,n){const r=e[t];switch(t){case"currentTarget":case"preventDefault":case"stopImmediatePropagation":case"stopPropagation":Fe()}return r instanceof Function?function(...t){return r.apply(this===n?e:this,t)}:r}})}a.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find(bt).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(St[t]){const n=xt[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,a.h)(e.type,t),top:!0},e.type=Ot)}Pt&&Pt(e)};const Nt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,jt=/\/\*[^]*?\*\/| +/g,Mt=/\n+/g,$t=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter(wt).forEach((t=>{const r=t.suffix.split("--",1)[0];xe((()=>{const o=e=>{const r=n(t);"function"==typeof r&&(r?.sync||(e=Ct(e)),r(e))},i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Ht=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter(wt).forEach((t=>{const r=t.suffix.split("--",1)[0];xe((()=>{const o=async e=>{await we();const r=n(t);"function"==typeof r&&r(e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Ut="wp",At=`data-${Ut}-ignore`,Wt=`data-${Ut}-interactive`,Dt=`data-${Ut}-`,Lt=[],It=new RegExp(`^data-${Ut}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Rt=/^([\w_\/-]+)::(.+)$/,zt=new WeakSet;function Vt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:s}=i,u=i.localName,c={},l=[],f=[];let _=!1,p=!1;for(let e=0;e<s.length;e++){const t=s[e].name,n=s[e].value;if(t[Dt.length]&&t.slice(0,Dt.length)===Dt)if(t===At)_=!0;else{var h,d;const e=Rt.exec(n),r=null!==(h=e?.[1])&&void 0!==h?h:null;let o=null!==(d=e?.[2])&&void 0!==d?d:n;try{const e=JSON.parse(o);v=e,o=Boolean(v&&"object"==typeof v&&v.constructor===Object)?e:o}catch{}if(t===Wt){p=!0;const e="string"==typeof o?o:"string"==typeof o?.namespace?o.namespace:null;Lt.push(e)}else f.push([t,r,o])}else if("ref"===t)continue;c[t]=n}var v;if(_&&!p)return[(0,a.h)(u,{...c,innerHTML:i.innerHTML,__directives:{ignore:!0}})];if(p&&zt.add(i),f.length&&(c.__directives=f.reduce(((e,[t,n,r])=>{const o=It.exec(t);if(null===o)return Fe(),e;const i=o[1]||"",s=o[2]||null;var a;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(a=Lt[Lt.length-1])&&void 0!==a?a:null,value:r,suffix:s}),e}),{})),"template"===u)c.content=[...i.content.childNodes].map((e=>Vt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&l.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Lt.pop(),[(0,a.h)(u,c,l)]}(t.currentNode)}const Bt=new WeakMap,Jt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return Bt.has(e)||Bt.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),Bt.get(e)},Kt=new WeakMap,qt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:Ut,getRegionRootFragment:Jt,initialVdom:Kt,toVdom:Vt,directive:Et,getNamespace:ie,h:a.h,cloneElement:a.Ob,render:a.XX,proxifyState:Xe,parseServerData:yt,populateServerData:mt,batch:$};throw new Error("Forbidden access.")};Et("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find(bt),{client:i,server:s}=x(n),u=o.namespace,c=b(Xe(u,{})),l=b(Xe(u,{},{readOnly:!0})),f=k((()=>{const e={client:{...i},server:{...s}};if(o){const{namespace:t,value:n}=o;Ce(n)||Fe(),Qe(c.current,Ft(n),!1),Qe(l.current,Ft(n)),e.client[t]=at(c.current,i[t]),e.server[t]=at(l.current,s[t])}return e}),[o,i,s]);return(0,a.h)(r,{value:f},t)}),{priority:5}),Et("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{Se((()=>{let n=t(e);return"function"==typeof n&&(n=n()),n}))}))})),Et("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{xe((()=>{let n=t(e);return"function"==typeof n&&(n=n()),n}))}))})),Et("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter(wt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t);const r=n(e);"function"==typeof r&&(r?.sync||(t=Ct(t)),r(t))}))}}))})),Et("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter(wt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await we();const r=n(e);"function"==typeof r&&r(t)}))}}))})),Et("on-window",$t("window")),Et("on-document",$t("document")),Et("on-async-window",Ht("window")),Et("on-async-document",Ht("document")),Et("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix;let o=n(e);"function"==typeof o&&(o=o());const i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),xe((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),Et("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix;let o=n(e);"function"==typeof o&&(o=o()),t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=Nt.exec(e.replace(jt,""));)n[4]?t.shift():n[3]?(r=n[3].replace(Mt," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(Mt," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],xe((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),Et("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix;let o=n(e);"function"==typeof o&&(o=o()),t.props[r]=o,xe((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),Et("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=k((()=>t),[]);return(0,a.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),Et("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find(bt);if(r)try{let e=n(r);"function"==typeof e&&(e=e()),t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),Et("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>{let n=t(e);return"function"==typeof n&&(n=n()),n}))})),Et("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=x(n),[u]=e,{namespace:c}=u;let l=o(u);if("function"==typeof l&&(l=l()),"function"!=typeof l?.[Symbol.iterator])return;const f=wt(u)?u.suffix.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})):"item",_=[];for(const e of l){const n=at(Xe(c,{}),s.client[c]),o={client:{...s.client,[c]:n},server:{...s.server}};o.client[c][f]=e;const u={...ce(),context:o.client,serverContext:o.server},l=t?Tt({scope:u})(t[0]):e;_.push((0,a.h)(i,{value:o,key:l},r.props.content))}return _}),{priority:20}),Et("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${Ut}-interactive]`);await new Promise((e=>{setTimeout(e,0)}));for(const t of e)if(!zt.has(t)){await we();const e=Jt(t),n=Vt(t);Kt.set(t,n),await we(),(0,a.Qv)(n,e)}})()},622:(e,t,n)=>{n.d(t,{FK:()=>x,Ob:()=>J,Qv:()=>B,XX:()=>V,fF:()=>o,h:()=>k,q6:()=>K,uA:()=>E,zO:()=>s});var r,o,i,s,a,u,c,l,f,_,p,h,d,v={},y=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function k(e,t,n){var o,i,s,a={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return S(e,a,o,i,null)}function S(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(a),a}function x(e){return e.children}function E(e,t){this.props=e,this.context=t}function T(e,t){if(null==t)return e.__?T(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?T(e):null}function O(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return O(e)}}function P(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!F.__r++||u!==o.debounceRendering)&&((u=o.debounceRendering)||c)(F)}function F(){for(var e,t,n,r,i,s,u,c=1;a.length;)a.length>c&&a.sort(l),e=a.shift(),c=a.length,e.__d&&(n=void 0,i=(r=(t=e).__v).__e,s=[],u=[],t.__P&&((n=w({},r)).__v=r.__v+1,o.vnode&&o.vnode(n),A(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,s,null==i?T(r):i,!!(32&r.__u),u),n.__v=r.__v,n.__.__k[n.__i]=n,W(s,n,u),n.__e!=i&&O(n)));F.__r=0}function C(e,t,n,r,o,i,s,a,u,c,l){var f,_,p,h,d,m,g=r&&r.__k||y,w=t.length;for(u=N(n,t,g,u,w),f=0;f<w;f++)null!=(p=n.__k[f])&&(_=-1===p.__i?v:g[p.__i]||v,p.__i=f,m=A(e,p,_,o,i,s,a,u,c,l),h=p.__e,p.ref&&_.ref!=p.ref&&(_.ref&&I(_.ref,null,p),l.push(p.ref,p.__c||h,p)),null==d&&null!=h&&(d=h),4&p.__u||_.__k===p.__k?u=j(p,u,e):"function"==typeof p.type&&void 0!==m?u=m:h&&(u=h.nextSibling),p.__u&=-7);return n.__e=d,u}function N(e,t,n,r,o){var i,s,a,u,c,l=n.length,f=l,_=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(s=t[i])&&"boolean"!=typeof s&&"function"!=typeof s?(u=i+_,(s=e.__k[i]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?S(null,s,null,null,null):g(s)?S(x,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?S(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,-1!==(c=s.__i=M(s,n,u,f))&&(f--,(a=n[c])&&(a.__u|=2)),null==a||null===a.__v?(-1==c&&(o>l?_--:o<l&&_++),"function"!=typeof s.type&&(s.__u|=4)):c!=u&&(c==u-1?_--:c==u+1?_++:(c>u?_--:_++,s.__u|=4))):e.__k[i]=null;if(f)for(i=0;i<l;i++)null!=(a=n[i])&&!(2&a.__u)&&(a.__e==r&&(r=T(a)),R(a,a));return r}function j(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=j(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=T(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function M(e,t,n,r){var o,i,s=e.key,a=e.type,u=t[n];if(null===u&&null==e.key||u&&s==u.key&&a===u.type&&!(2&u.__u))return n;if(r>(null==u||2&u.__u?0:1))for(o=n-1,i=n+1;o>=0||i<t.length;){if(o>=0){if((u=t[o])&&!(2&u.__u)&&s==u.key&&a===u.type)return o;o--}if(i<t.length){if((u=t[i])&&!(2&u.__u)&&s==u.key&&a===u.type)return i;i++}}return-1}function $(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function H(e,t,n,r,o){var i;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||$(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||$(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(f,"$1")),t=t.toLowerCase()in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.t=r.t:(n.t=_,e.addEventListener(t,i?h:p,i)):e.removeEventListener(t,i?h:p,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function U(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.u)t.u=_++;else if(t.u<n.t)return;return n(o.event?o.event(t):t)}}}function A(e,t,n,r,i,s,a,u,c,l){var f,_,p,h,d,v,y,m,k,S,T,O,P,F,N,j,M,$=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),s=[u=t.__e=n.__e]),(f=o.__b)&&f(t);e:if("function"==typeof $)try{if(m=t.props,k="prototype"in $&&$.prototype.render,S=(f=$.contextType)&&r[f.__c],T=f?S?S.props.value:f.__:r,n.__c?y=(_=t.__c=n.__c).__=_.__E:(k?t.__c=_=new $(m,T):(t.__c=_=new E(m,T),_.constructor=$,_.render=z),S&&S.sub(_),_.props=m,_.state||(_.state={}),_.context=T,_.__n=r,p=_.__d=!0,_.__h=[],_._sb=[]),k&&null==_.__s&&(_.__s=_.state),k&&null!=$.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=w({},_.__s)),w(_.__s,$.getDerivedStateFromProps(m,_.__s))),h=_.props,d=_.state,_.__v=t,p)k&&null==$.getDerivedStateFromProps&&null!=_.componentWillMount&&_.componentWillMount(),k&&null!=_.componentDidMount&&_.__h.push(_.componentDidMount);else{if(k&&null==$.getDerivedStateFromProps&&m!==h&&null!=_.componentWillReceiveProps&&_.componentWillReceiveProps(m,T),!_.__e&&(null!=_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(m,_.__s,T)||t.__v==n.__v)){for(t.__v!=n.__v&&(_.props=m,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),O=0;O<_._sb.length;O++)_.__h.push(_._sb[O]);_._sb=[],_.__h.length&&a.push(_);break e}null!=_.componentWillUpdate&&_.componentWillUpdate(m,_.__s,T),k&&null!=_.componentDidUpdate&&_.__h.push((function(){_.componentDidUpdate(h,d,v)}))}if(_.context=T,_.props=m,_.__P=e,_.__e=!1,P=o.__r,F=0,k){for(_.state=_.__s,_.__d=!1,P&&P(t),f=_.render(_.props,_.state,_.context),N=0;N<_._sb.length;N++)_.__h.push(_._sb[N]);_._sb=[]}else do{_.__d=!1,P&&P(t),f=_.render(_.props,_.state,_.context),_.state=_.__s}while(_.__d&&++F<25);_.state=_.__s,null!=_.getChildContext&&(r=w(w({},r),_.getChildContext())),k&&!p&&null!=_.getSnapshotBeforeUpdate&&(v=_.getSnapshotBeforeUpdate(h,d)),j=f,null!=f&&f.type===x&&null==f.key&&(j=D(f.props.children)),u=C(e,g(j)?j:[j],t,n,r,i,s,a,u,c,l),_.base=t.__e,t.__u&=-161,_.__h.length&&a.push(_),y&&(_.__E=_.__=null)}catch(e){if(t.__v=null,c||null!=s)if(e.then){for(t.__u|=c?160:128;u&&8==u.nodeType&&u.nextSibling;)u=u.nextSibling;s[s.indexOf(u)]=null,t.__e=u}else for(M=s.length;M--;)b(s[M]);else t.__e=n.__e,t.__k=n.__k;o.__e(e,t,n)}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):u=t.__e=L(n.__e,t,n,r,i,s,a,c,l);return(f=o.diffed)&&f(t),128&t.__u?void 0:u}function W(e,t,n){for(var r=0;r<n.length;r++)I(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function D(e){return"object"!=typeof e||null==e?e:g(e)?e.map(D):w({},e)}function L(e,t,n,i,s,a,u,c,l){var f,_,p,h,d,y,m,w=n.props,k=t.props,S=t.type;if("svg"==S?s="http://www.w3.org/2000/svg":"math"==S?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a)for(f=0;f<a.length;f++)if((d=a[f])&&"setAttribute"in d==!!S&&(S?d.localName==S:3==d.nodeType)){e=d,a[f]=null;break}if(null==e){if(null==S)return document.createTextNode(k);e=document.createElementNS(s,S,k.is&&k),c&&(o.__m&&o.__m(t,a),c=!1),a=null}if(null===S)w===k||c&&e.data===k||(e.data=k);else{if(a=a&&r.call(e.childNodes),w=n.props||v,!c&&null!=a)for(w={},f=0;f<e.attributes.length;f++)w[(d=e.attributes[f]).name]=d.value;for(f in w)if(d=w[f],"children"==f);else if("dangerouslySetInnerHTML"==f)p=d;else if(!(f in k)){if("value"==f&&"defaultValue"in k||"checked"==f&&"defaultChecked"in k)continue;H(e,f,null,d,s)}for(f in k)d=k[f],"children"==f?h=d:"dangerouslySetInnerHTML"==f?_=d:"value"==f?y=d:"checked"==f?m=d:c&&"function"!=typeof d||w[f]===d||H(e,f,d,w[f],s);if(_)c||p&&(_.__html===p.__html||_.__html===e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(p&&(e.innerHTML=""),C("template"===t.type?e.content:e,g(h)?h:[h],t,n,i,"foreignObject"==S?"http://www.w3.org/1999/xhtml":s,a,u,a?a[0]:n.__k&&T(n,0),c,l),null!=a)for(f=a.length;f--;)b(a[f]);c||(f="value","progress"==S&&null==y?e.removeAttribute("value"):void 0!==y&&(y!==e[f]||"progress"==S&&!y||"option"==S&&y!==w[f])&&H(e,f,y,w[f],s),f="checked",void 0!==m&&m!==e[f]&&H(e,f,m,w[f],s))}return e}function I(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function R(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||I(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&R(r[i],t,n||"function"!=typeof e.type);n||b(e.__e),e.__c=e.__=e.__e=void 0}function z(e,t,n){return this.constructor(e,n)}function V(e,t,n){var i,s,a,u;t==document&&(t=document.documentElement),o.__&&o.__(e,t),s=(i="function"==typeof n)?null:n&&n.__k||t.__k,a=[],u=[],A(t,e=(!i&&n||t).__k=k(x,null,[e]),s||v,v,t.namespaceURI,!i&&n?[n]:s?null:t.firstChild?r.call(t.childNodes):null,a,!i&&n?n:s?s.__e:t.firstChild,i,u),W(a,e,u)}function B(e,t){V(e,t,B)}function J(e,t,n){var o,i,s,a,u=w({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=void 0===t[s]&&void 0!==a?a[s]:t[s];return arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),S(e.type,u,o||e.key,i||e.ref,null)}function K(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,P(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+d++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=y.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},n),this.props)),e&&w(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),P(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),P(this))},E.prototype.render=x,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},F.__r=0,f=/(PointerCapture)$|Capture$/i,_=0,p=U(!1),h=U(!0),d=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{zj:()=>k.zj,SD:()=>k.SD,V6:()=>k.V6,$K:()=>k.$K,vT:()=>k.vT,jb:()=>k.jb,yT:()=>k.yT,M_:()=>k.M_,hb:()=>k.hb,vJ:()=>k.vJ,ip:()=>k.ip,Nf:()=>k.Nf,Kr:()=>k.Kr,li:()=>k.li,J0:()=>k.J0,FH:()=>k.FH,v4:()=>k.v4,mh:()=>k.mh});var o,i=n(622);null!=(o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&o.__PREACT_DEVTOOLS__&&o.__PREACT_DEVTOOLS__.attachPreact("10.26.4",i.fF,{Fragment:i.FK,Component:i.uA});var s={};function a(e){return e.type===i.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var u=[],c=[];function l(){return u.length>0?u[u.length-1]:null}var f=!0;function _(e){return"function"==typeof e.type&&e.type!=i.FK}function p(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+a(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":f&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),f=!1,e+"\n"}),"")}var h="function"==typeof WeakMap;function d(e){var t=[];return e.__k?(e.__k.forEach((function(e){e&&"function"==typeof e.type?t.push.apply(t,d(e)):e&&"string"==typeof e.type&&t.push(e.type)})),t):t}function v(e){return e?"function"==typeof e.type?null==e.__?null!=e.__e&&null!=e.__e.parentNode?e.__e.parentNode.localName:"":v(e.__):e.type:""}var y=i.uA.prototype.setState;function m(e){return"table"===e||"tfoot"===e||"tbody"===e||"thead"===e||"td"===e||"tr"===e||"th"===e}i.uA.prototype.setState=function(e,t){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+p(l())),y.call(this,e,t)};var g=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,w=i.uA.prototype.forceUpdate;function b(e){var t=e.props,n=a(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var s=t.children;return"<"+n+r+(s&&s.length?">..</"+n+">":" />")}i.uA.prototype.forceUpdate=function(e){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+p(l())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+p(this.__v)),w.call(this,e)},i.fF.__m=function(e,t){var n=e.type,r=t.map((function(e){return e&&e.localName})).filter(Boolean);console.error('Expected a DOM node of type "'+n+'" but found "'+r.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+p(e))},function(){!function(){var e=i.fF.__b,t=i.fF.diffed,n=i.fF.__,r=i.fF.vnode,o=i.fF.__r;i.fF.diffed=function(e){_(e)&&c.pop(),u.pop(),t&&t(e)},i.fF.__b=function(t){_(t)&&u.push(t),e&&e(t)},i.fF.__=function(e,t){c=[],n&&n(e,t)},i.fF.vnode=function(e){e.__o=c.length>0?c[c.length-1]:null,r&&r(e)},i.fF.__r=function(e){_(e)&&c.push(e),o&&o(e)}}();var e=!1,t=i.fF.__b,n=i.fF.diffed,r=i.fF.vnode,o=i.fF.__r,l=i.fF.__e,f=i.fF.__,y=i.fF.__h,w=h?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];i.fF.__e=function(e,t,n,r){if(t&&t.__c&&"function"==typeof e.then){var o=e;e=new Error("Missing Suspense. The throwing component was: "+a(t));for(var i=t;i;i=i.__)if(i.__c&&i.__c.__c){e=o;break}if(e instanceof Error)throw e}try{(r=r||{}).componentStack=p(t),l(e,t,n,r),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},i.fF.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=a(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}f&&f(e,t)},i.fF.__b=function(n){var r=n.type;if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+b(n)+"\n\n"+p(n));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+a(n)+" = "+b(r)+";\n let vnode = <My"+a(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+p(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+b(n)+"\n\n"+p(n));if("string"==typeof n.type)for(var o in n.props)if("o"===o[0]&&"n"===o[1]&&"function"!=typeof n.props[o]&&null!=n.props[o])throw new Error("Component's \""+o+'" property should be a function, but got ['+typeof n.props[o]+"] instead\n"+b(n)+"\n\n"+p(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&w&&!w.lazyPropTypes.has(n.type)){var i="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var u=n.type();w.lazyPropTypes.set(n.type,!0),console.warn(i+"Component wrapped in lazy() is "+a(u))}catch(e){console.warn(i+"We will log the wrapped component's name once it is loaded.")}}var c=n.props;n.type.__f&&delete(c=function(e,t){for(var n in t)e[n]=t[n];return e}({},c)).ref,function(e,t,n,r,o){Object.keys(e).forEach((function(n){var i;try{i=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}i&&!(i.message in s)&&(s[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,c,0,a(n),(function(){return p(n)}))}t&&t(n)};var S,x=0;i.fF.__r=function(t){o&&o(t),e=!0;var n=t.__c;if(n===S?x++:x=1,x>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+a(t));S=n},i.fF.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");y&&y(t,n,r)};var E=function(e,t){return{get:function(){var n="get"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},T={nodeName:E("nodeName","use vnode.type"),attributes:E("attributes","use vnode.props"),children:E("children","use vnode.props.children")},O=Object.create({},T);i.fF.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var o in t){var i=t[o];"__source"===o?e.__source=i:"__self"===o?e.__self=i:n[o]=i}}e.__proto__=O,r&&r(e)},i.fF.diffed=function(t){var r,o=t.type,i=t.__;if(t.__k&&t.__k.forEach((function(e){if("object"==typeof e&&e&&void 0===e.type){var n=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+p(t))}})),t.__c===S&&(x=0),"string"==typeof o&&(m(o)||"p"===o||"a"===o||"button"===o)){var s=v(i);if(""!==s&&m(o))"table"===o&&"td"!==s&&m(s)?console.error("Improper nesting of table. Your <table> should not have a table-node parent."+b(t)+"\n\n"+p(t)):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===s?"tr"===o&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot> parent."+b(t)+"\n\n"+p(t)):"td"===o&&"tr"!==s?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+b(t)+"\n\n"+p(t)):"th"===o&&"tr"!==s&&console.error("Improper nesting of table. Your <th> should have a <tr>."+b(t)+"\n\n"+p(t)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+b(t)+"\n\n"+p(t));else if("p"===o){var u=d(t).filter((function(e){return g.test(e)}));u.length&&console.error("Improper nesting of paragraph. Your <p> should not have "+u.join(", ")+" as child-elements."+b(t)+"\n\n"+p(t))}else"a"!==o&&"button"!==o||-1!==d(t).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+b(t)+"\n\n"+p(t))}if(e=!1,n&&n(t),null!=t.__k)for(var c=[],l=0;l<t.__k.length;l++){var f=t.__k[l];if(f&&null!=f.key){var _=f.key;if(-1!==c.indexOf(_)){console.error('Following component has two or more children with the same key attribute: "'+_+'". This may cause glitches and misbehavior in rendering process. Component: \n\n'+b(t)+"\n\n"+p(t));break}c.push(_)}}if(null!=t.__c&&null!=t.__c.__H){var h=t.__c.__H.__;if(h)for(var y=0;y<h.length;y+=1){var w=h[y];if(w.__H)for(var k=0;k<w.__H.length;k++)if((r=w.__H[k])!=r){var E=a(t);console.warn("Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index "+y+" in component "+E+" was called with NaN.")}}}}}();var k=n(380),S=r.zj,x=r.SD,E=r.V6,T=r.$K,O=r.vT,P=r.jb,F=r.yT,C=r.M_,N=r.hb,j=r.vJ,M=r.ip,$=r.Nf,H=r.Kr,U=r.li,A=r.J0,W=r.FH,D=r.v4,L=r.mh;export{S as getConfig,x as getContext,E as getElement,T as getServerContext,O as getServerState,P as privateApis,F as splitTask,C as store,N as useCallback,j as useEffect,M as useInit,$ as useLayoutEffect,H as useMemo,U as useRef,A as useState,W as useWatch,D as withScope,L as withSyncEvent}; interactivity/index.min.js 0000644 00000112560 15071251711 0011676 0 ustar 00 var t={622:(t,e,n)=>{n.d(e,{Ob:()=>q,Qv:()=>z,XX:()=>B,fF:()=>o,h:()=>S,q6:()=>J,uA:()=>E,zO:()=>s});var r,o,i,s,u,c,l,_,a,f,p,h,v,d={},y=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function w(t,e){for(var n in e)t[n]=e[n];return t}function b(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function S(t,e,n){var o,i,s,u={};for(s in e)"key"==s?o=e[s]:"ref"==s?i=e[s]:u[s]=e[s];if(arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===u[s]&&(u[s]=t.defaultProps[s]);return x(t,u,o,i,null)}function x(t,e,n,r,s){var u={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(u),u}function k(t){return t.children}function E(t,e){this.props=t,this.context=e}function P(t,e){if(null==e)return t.__?P(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?P(t):null}function C(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return C(t)}}function O(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!$.__r++||c!==o.debounceRendering)&&((c=o.debounceRendering)||l)($)}function $(){for(var t,e,n,r,i,s,c,l=1;u.length;)u.length>l&&u.sort(_),t=u.shift(),l=u.length,t.__d&&(n=void 0,i=(r=(e=t).__v).__e,s=[],c=[],e.__P&&((n=w({},r)).__v=r.__v+1,o.vnode&&o.vnode(n),F(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,s,null==i?P(r):i,!!(32&r.__u),c),n.__v=r.__v,n.__.__k[n.__i]=n,A(s,n,c),n.__e!=i&&C(n)));$.__r=0}function T(t,e,n,r,o,i,s,u,c,l,_){var a,f,p,h,v,g,m=r&&r.__k||y,w=e.length;for(c=M(n,e,m,c,w),a=0;a<w;a++)null!=(p=n.__k[a])&&(f=-1===p.__i?d:m[p.__i]||d,p.__i=a,g=F(t,p,f,o,i,s,u,c,l,_),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&R(f.ref,null,p),_.push(p.ref,p.__c||h,p)),null==v&&null!=h&&(v=h),4&p.__u||f.__k===p.__k?c=N(p,c,t):"function"==typeof p.type&&void 0!==g?c=g:h&&(c=h.nextSibling),p.__u&=-7);return n.__e=v,c}function M(t,e,n,r,o){var i,s,u,c,l,_=n.length,a=_,f=0;for(t.__k=new Array(o),i=0;i<o;i++)null!=(s=e[i])&&"boolean"!=typeof s&&"function"!=typeof s?(c=i+f,(s=t.__k[i]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?x(null,s,null,null,null):m(s)?x(k,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?x(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,u=null,-1!==(l=s.__i=j(s,n,c,a))&&(a--,(u=n[l])&&(u.__u|=2)),null==u||null===u.__v?(-1==l&&(o>_?f--:o<_&&f++),"function"!=typeof s.type&&(s.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,s.__u|=4))):t.__k[i]=null;if(a)for(i=0;i<_;i++)null!=(u=n[i])&&!(2&u.__u)&&(u.__e==r&&(r=P(u)),I(u,u));return r}function N(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=N(r[o],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=P(t)),n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function j(t,e,n,r){var o,i,s=t.key,u=t.type,c=e[n];if(null===c&&null==t.key||c&&s==c.key&&u===c.type&&!(2&c.__u))return n;if(r>(null==c||2&c.__u?0:1))for(o=n-1,i=n+1;o>=0||i<e.length;){if(o>=0){if((c=e[o])&&!(2&c.__u)&&s==c.key&&u===c.type)return o;o--}if(i<e.length){if((c=e[i])&&!(2&c.__u)&&s==c.key&&u===c.type)return i;i++}}return-1}function H(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||g.test(e)?n:n+"px"}function U(t,e,n,r,o){var i;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||H(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||H(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])i=e!=(e=e.replace(a,"$1")),e=e.toLowerCase()in t||"onFocusOut"==e||"onFocusIn"==e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.t=r.t:(n.t=f,t.addEventListener(e,i?h:p,i)):t.removeEventListener(e,i?h:p,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function W(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.u)e.u=f++;else if(e.u<n.t)return;return n(o.event?o.event(e):e)}}}function F(t,e,n,r,i,s,u,c,l,_){var a,f,p,h,v,d,y,g,S,x,P,C,O,$,M,N,j,H=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[c=e.__e=n.__e]),(a=o.__b)&&a(e);t:if("function"==typeof H)try{if(g=e.props,S="prototype"in H&&H.prototype.render,x=(a=H.contextType)&&r[a.__c],P=a?x?x.props.value:a.__:r,n.__c?y=(f=e.__c=n.__c).__=f.__E:(S?e.__c=f=new H(g,P):(e.__c=f=new E(g,P),f.constructor=H,f.render=V),x&&x.sub(f),f.props=g,f.state||(f.state={}),f.context=P,f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),S&&null==f.__s&&(f.__s=f.state),S&&null!=H.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=w({},f.__s)),w(f.__s,H.getDerivedStateFromProps(g,f.__s))),h=f.props,v=f.state,f.__v=e,p)S&&null==H.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),S&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(S&&null==H.getDerivedStateFromProps&&g!==h&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(g,P),!f.__e&&(null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(g,f.__s,P)||e.__v==n.__v)){for(e.__v!=n.__v&&(f.props=g,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some((function(t){t&&(t.__=e)})),C=0;C<f._sb.length;C++)f.__h.push(f._sb[C]);f._sb=[],f.__h.length&&u.push(f);break t}null!=f.componentWillUpdate&&f.componentWillUpdate(g,f.__s,P),S&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(h,v,d)}))}if(f.context=P,f.props=g,f.__P=t,f.__e=!1,O=o.__r,$=0,S){for(f.state=f.__s,f.__d=!1,O&&O(e),a=f.render(f.props,f.state,f.context),M=0;M<f._sb.length;M++)f.__h.push(f._sb[M]);f._sb=[]}else do{f.__d=!1,O&&O(e),a=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++$<25);f.state=f.__s,null!=f.getChildContext&&(r=w(w({},r),f.getChildContext())),S&&!p&&null!=f.getSnapshotBeforeUpdate&&(d=f.getSnapshotBeforeUpdate(h,v)),N=a,null!=a&&a.type===k&&null==a.key&&(N=L(a.props.children)),c=T(t,m(N)?N:[N],e,n,r,i,s,u,c,l,_),f.base=e.__e,e.__u&=-161,f.__h.length&&u.push(f),y&&(f.__E=f.__=null)}catch(t){if(e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;c&&8==c.nodeType&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,e.__e=c}else for(j=s.length;j--;)b(s[j]);else e.__e=n.__e,e.__k=n.__k;o.__e(t,e,n)}else null==s&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):c=e.__e=D(n.__e,e,n,r,i,s,u,l,_);return(a=o.diffed)&&a(e),128&e.__u?void 0:c}function A(t,e,n){for(var r=0;r<n.length;r++)R(n[r],n[++r],n[++r]);o.__c&&o.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){o.__e(t,e.__v)}}))}function L(t){return"object"!=typeof t||null==t?t:m(t)?t.map(L):w({},t)}function D(t,e,n,i,s,u,c,l,_){var a,f,p,h,v,y,g,w=n.props,S=e.props,x=e.type;if("svg"==x?s="http://www.w3.org/2000/svg":"math"==x?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=u)for(a=0;a<u.length;a++)if((v=u[a])&&"setAttribute"in v==!!x&&(x?v.localName==x:3==v.nodeType)){t=v,u[a]=null;break}if(null==t){if(null==x)return document.createTextNode(S);t=document.createElementNS(s,x,S.is&&S),l&&(o.__m&&o.__m(e,u),l=!1),u=null}if(null===x)w===S||l&&t.data===S||(t.data=S);else{if(u=u&&r.call(t.childNodes),w=n.props||d,!l&&null!=u)for(w={},a=0;a<t.attributes.length;a++)w[(v=t.attributes[a]).name]=v.value;for(a in w)if(v=w[a],"children"==a);else if("dangerouslySetInnerHTML"==a)p=v;else if(!(a in S)){if("value"==a&&"defaultValue"in S||"checked"==a&&"defaultChecked"in S)continue;U(t,a,null,v,s)}for(a in S)v=S[a],"children"==a?h=v:"dangerouslySetInnerHTML"==a?f=v:"value"==a?y=v:"checked"==a?g=v:l&&"function"!=typeof v||w[a]===v||U(t,a,v,w[a],s);if(f)l||p&&(f.__html===p.__html||f.__html===t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(p&&(t.innerHTML=""),T("template"===e.type?t.content:t,m(h)?h:[h],e,n,i,"foreignObject"==x?"http://www.w3.org/1999/xhtml":s,u,c,u?u[0]:n.__k&&P(n,0),l,_),null!=u)for(a=u.length;a--;)b(u[a]);l||(a="value","progress"==x&&null==y?t.removeAttribute("value"):void 0!==y&&(y!==t[a]||"progress"==x&&!y||"option"==x&&y!==w[a])&&U(t,a,y,w[a],s),a="checked",void 0!==g&&g!==t[a]&&U(t,a,g,w[a],s))}return t}function R(t,e,n){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){o.__e(t,n)}}function I(t,e,n){var r,i;if(o.unmount&&o.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||R(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){o.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&I(r[i],e,n||"function"!=typeof t.type);n||b(t.__e),t.__c=t.__=t.__e=void 0}function V(t,e,n){return this.constructor(t,n)}function B(t,e,n){var i,s,u,c;e==document&&(e=document.documentElement),o.__&&o.__(t,e),s=(i="function"==typeof n)?null:n&&n.__k||e.__k,u=[],c=[],F(e,t=(!i&&n||e).__k=S(k,null,[t]),s||d,d,e.namespaceURI,!i&&n?[n]:s?null:e.firstChild?r.call(e.childNodes):null,u,!i&&n?n:s?s.__e:e.firstChild,i,c),A(u,t,c)}function z(t,e){B(t,e,z)}function q(t,e,n){var o,i,s,u,c=w({},t.props);for(s in t.type&&t.type.defaultProps&&(u=t.type.defaultProps),e)"key"==s?o=e[s]:"ref"==s?i=e[s]:c[s]=void 0===e[s]&&void 0!==u?u[s]:e[s];return arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),x(t.type,c,o||t.key,i||t.ref,null)}function J(t){function e(t){var n,r;return this.getChildContext||(n=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.forEach((function(t){t.__e=!0,O(t)}))},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+v++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}r=y.slice,o={__e:function(t,e,n,r){for(var o,i,s;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),s=o.__d),s)return o.__E=o}catch(e){t=e}throw t}},i=0,s=function(t){return null!=t&&null==t.constructor},E.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof t&&(t=t(w({},n),this.props)),t&&w(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),O(this))},E.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),O(this))},E.prototype.render=k,u=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,a=/(PointerCapture)$|Capture$/i,f=0,p=W(!1),h=W(!0),v=0}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};n.d(r,{zj:()=>he,SD:()=>yt,V6:()=>gt,$K:()=>mt,vT:()=>ve,jb:()=>Ge,yT:()=>bt,M_:()=>ye,hb:()=>Ot,vJ:()=>Pt,ip:()=>Et,Nf:()=>Ct,Kr:()=>$t,li:()=>S,J0:()=>m,FH:()=>kt,v4:()=>xt,mh:()=>Nt});var o,i,s,u,c=n(622),l=0,_=[],a=c.fF,f=a.__b,p=a.__r,h=a.diffed,v=a.__c,d=a.unmount,y=a.__;function g(t,e){a.__h&&a.__h(i,t,l||e),l=0;var n=i.__H||(i.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function m(t){return l=1,function(t,e,n){var r=g(o++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):N(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],n=r.t(e,t);e!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=i,!i.__f)){var s=function(t,e,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(t){return!!t.__c}));if(o.every((function(t){return!t.__N})))return!u||u.call(this,t,e,n);var i=r.__c.props!==t;return o.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(i=!0)}})),u&&u.call(this,t,e,n)||i};i.__f=!0;var u=i.shouldComponentUpdate,c=i.componentWillUpdate;i.componentWillUpdate=function(t,e,n){if(this.__e){var r=u;u=void 0,s(t,e,n),u=r}c&&c.call(this,t,e,n)},i.shouldComponentUpdate=s}return r.__N||r.__}(N,t)}function w(t,e){var n=g(o++,3);!a.__s&&M(n.__H,e)&&(n.__=t,n.u=e,i.__H.__h.push(n))}function b(t,e){var n=g(o++,4);!a.__s&&M(n.__H,e)&&(n.__=t,n.u=e,i.__h.push(n))}function S(t){return l=5,x((function(){return{current:t}}),[])}function x(t,e){var n=g(o++,7);return M(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function k(t,e){return l=8,x((function(){return t}),e)}function E(t){var e=i.context[t.__c],n=g(o++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(i)),e.props.value):t.__}function P(){for(var t;t=_.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach($),t.__H.__h.forEach(T),t.__H.__h=[]}catch(e){t.__H.__h=[],a.__e(e,t.__v)}}a.__b=function(t){i=null,f&&f(t)},a.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),y&&y(t,e)},a.__r=function(t){p&&p(t),o=0;var e=(i=t.__c).__H;e&&(s===i?(e.__h=[],i.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach($),e.__h.forEach(T),e.__h=[],o=0)),s=i},a.diffed=function(t){h&&h(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==_.push(e)&&u===a.requestAnimationFrame||((u=a.requestAnimationFrame)||O)(P)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),s=i=null},a.__c=function(t,e){e.some((function(t){try{t.__h.forEach($),t.__h=t.__h.filter((function(t){return!t.__||T(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],a.__e(n,t.__v)}})),v&&v(t,e)},a.unmount=function(t){d&&d(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{$(t)}catch(t){e=t}})),n.__H=void 0,e&&a.__e(e,n.__v))};var C="function"==typeof requestAnimationFrame;function O(t){var e,n=function(){clearTimeout(r),C&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);C&&(e=requestAnimationFrame(n))}function $(t){var e=i,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),i=e}function T(t){var e=i;t.__c=t.__(),i=e}function M(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function N(t,e){return"function"==typeof e?e(t):e}var j=Symbol.for("preact-signals");function H(){if(L>1)L--;else{for(var t,e=!1;void 0!==A;){var n=A;for(A=void 0,D++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&z(n))try{n.c()}catch(n){e||(t=n,e=!0)}n=r}}if(D=0,L--,e)throw t}}function U(t){if(L>0)return t();L++;try{return t()}finally{H()}}var W=void 0;var F,A=void 0,L=0,D=0,R=0;function I(t){if(void 0!==W){var e=t.n;if(void 0===e||e.t!==W)return e={i:0,S:t,p:W.s,n:void 0,t:W,e:void 0,x:void 0,r:e},void 0!==W.s&&(W.s.n=e),W.s=e,t.n=e,32&W.f&&t.S(e),e;if(-1===e.i)return e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=W.s,e.n=void 0,W.s.n=e,W.s=e),e}}function V(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function B(t){return new V(t)}function z(t){for(var e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function q(t){for(var e=t.s;void 0!==e;e=e.n){var n=e.S.n;if(void 0!==n&&(e.r=n),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function J(t){for(var e=t.s,n=void 0;void 0!==e;){var r=e.p;-1===e.i?(e.S.U(e),void 0!==r&&(r.n=e.n),void 0!==e.n&&(e.n.p=r)):n=e,e.S.n=e.r,void 0!==e.r&&(e.r=void 0),e=r}t.s=n}function K(t){V.call(this,void 0),this.x=t,this.s=void 0,this.g=R-1,this.f=4}function G(t){return new K(t)}function X(t){var e=t.u;if(t.u=void 0,"function"==typeof e){L++;var n=W;W=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,Q(t),e}finally{W=n,H()}}}function Q(t){for(var e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,X(t)}function Y(t){if(W!==this)throw new Error("Out-of-order effect");J(this),W=t,this.f&=-2,8&this.f&&Q(this),H()}function Z(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function tt(t){var e=new Z(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}function et(t,e){c.fF[t]=e.bind(null,c.fF[t]||function(){})}function nt(t){F&&F(),F=t&&t.S()}function rt(t){var e=this,n=t.data,r=function(t){return x((function(){return B(t)}),[])}(n);r.value=n;var o=x((function(){for(var t=e.__v;t=t.__;)if(t.__c){t.__c.__$f|=4;break}return e.__$u.c=function(){var t,n=e.__$u.S(),r=o.value;n(),(0,c.zO)(r)||3!==(null==(t=e.base)?void 0:t.nodeType)?(e.__$f|=1,e.setState({})):e.base.data=r},G((function(){var t=r.value.value;return 0===t?0:!0===t?"":t||""}))}),[]);return o.value}function ot(t,e,n,r){var o=e in t&&void 0===t.ownerSVGElement,i=B(n);return{o:function(t,e){i.value=t,r=e},d:tt((function(){var n=i.value.value;r[e]!==n&&(r[e]=n,o?t[e]=n:n?t.setAttribute(e,n):t.removeAttribute(e))}))}}V.prototype.brand=j,V.prototype.h=function(){return!0},V.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},V.prototype.U=function(t){if(void 0!==this.t){var e=t.e,n=t.x;void 0!==e&&(e.x=n,t.e=void 0),void 0!==n&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n)}},V.prototype.subscribe=function(t){var e=this;return tt((function(){var n=e.value,r=W;W=void 0;try{t(n)}finally{W=r}}))},V.prototype.valueOf=function(){return this.value},V.prototype.toString=function(){return this.value+""},V.prototype.toJSON=function(){return this.value},V.prototype.peek=function(){var t=W;W=void 0;try{return this.value}finally{W=t}},Object.defineProperty(V.prototype,"value",{get:function(){var t=I(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(D>100)throw new Error("Cycle detected");this.v=t,this.i++,R++,L++;try{for(var e=this.t;void 0!==e;e=e.x)e.t.N()}finally{H()}}}}),(K.prototype=new V).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===R)return!0;if(this.g=R,this.f|=1,this.i>0&&!z(this))return this.f&=-2,!0;var t=W;try{q(this),W=this;var e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return W=t,J(this),this.f&=-2,!0},K.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var e=this.s;void 0!==e;e=e.n)e.S.S(e)}V.prototype.S.call(this,t)},K.prototype.U=function(t){if(void 0!==this.t&&(V.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var e=this.s;void 0!==e;e=e.n)e.S.U(e)}},K.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(K.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=I(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),Z.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var e=this.x();"function"==typeof e&&(this.u=e)}finally{t()}},Z.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,X(this),q(this),L++;var t=W;return W=this,Y.bind(this,t)},Z.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},Z.prototype.d=function(){this.f|=8,1&this.f||Q(this)},rt.displayName="_st",Object.defineProperties(V.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:rt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),et("__b",(function(t,e){if("string"==typeof e.type){var n,r=e.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof V&&(n||(e.__np=n={}),n[o]=i,r[o]=i.peek())}}t(e)})),et("__r",(function(t,e){nt();var n,r=e.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var t;return tt((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),nt(n),t(e)})),et("__e",(function(t,e,n,r){nt(),t(e,n,r)})),et("diffed",(function(t,e){var n;if(nt(),"string"==typeof e.type&&(n=e.__e)){var r=e.__np,o=e.props;if(r){var i=n.U;if(i)for(var s in i){var u=i[s];void 0===u||s in r||(u.d(),i[s]=void 0)}else n.U=i={};for(var c in r){var l=i[c],_=r[c];void 0===l?(l=ot(n,c,_,o),i[c]=l):l.o(_,o)}}}t(e)})),et("unmount",(function(t,e){if("string"==typeof e.type){var n=e.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=e.__c;if(s){var u=s.__$u;u&&(s.__$u=void 0,u.d())}}t(e)})),et("__h",(function(t,e,n,r){(r<3||9===r)&&(e.__$f|=2),t(e,n,r)})),c.uA.prototype.shouldComponentUpdate=function(t,e){var n=this.__$u,r=n&&void 0!==n.s;for(var o in e)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(r||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var i in t)if("__source"!==i&&t[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};const it=[],st=()=>it.slice(-1)[0],ut=t=>{it.push(t)},ct=()=>{it.pop()},lt=[],_t=()=>lt.slice(-1)[0],at=t=>{lt.push(t)},ft=()=>{lt.pop()},pt=new WeakMap,ht=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},vt={get(t,e,n){const r=Reflect.get(t,e,n);return r&&"object"==typeof r?dt(r):r},set:ht,deleteProperty:ht},dt=t=>(pt.has(t)||pt.set(t,new Proxy(t,vt)),pt.get(t)),yt=t=>_t().context[t||st()],gt=()=>{const t=_t();const{ref:e,attributes:n}=t;return Object.freeze({ref:e.current,attributes:dt(n)})},mt=t=>_t().serverContext[t||st()],wt=t=>new Promise((e=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{t(),e()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),bt="function"==typeof window.scheduler?.yield?window.scheduler.yield.bind(window.scheduler):()=>new Promise((t=>{setTimeout(t,0)}));function St(t){w((()=>{let e=null,n=!1;return e=function(t,e){let n=()=>{};const r=tt((function(){return n=this.c.bind(this),this.x=t,this.c=e,t()}));return{flush:n,dispose:r}}(t,(async()=>{e&&!n&&(n=!0,await wt(e.flush),n=!1)})),e.dispose}),[])}function xt(t){const e=_t(),n=st();let r;r="GeneratorFunction"===t?.constructor?.name?async(...r)=>{const o=t(...r);let i,s;for(;;){ut(n),at(e);try{s=o.next(i)}finally{ft(),ct()}try{i=await s.value}catch(t){ut(n),at(e),o.throw(t)}finally{ft(),ct()}if(s.done)break}return i}:(...r)=>{ut(n),at(e);try{return t(...r)}finally{ct(),ft()}};if(t.sync){const t=r;return t.sync=!0,t}return r}function kt(t){St(xt(t))}function Et(t){w(xt(t),[])}function Pt(t,e){w(xt(t),e)}function Ct(t,e){b(xt(t),e)}function Ot(t,e){return k(xt(t),e)}function $t(t,e){return x(xt(t),e)}new Set;const Tt=t=>{0},Mt=t=>Boolean(t&&"object"==typeof t&&t.constructor===Object);function Nt(t){const e=t;return e.sync=!0,e}const jt=new WeakMap,Ht=new WeakMap,Ut=new WeakMap,Wt=new Set([Object,Array]),Ft=(t,e,n)=>{if(!Dt(e))throw Error("This object cannot be proxified.");if(!jt.has(e)){const r=new Proxy(e,n);jt.set(e,r),Ht.set(r,e),Ut.set(r,t)}return jt.get(e)},At=t=>jt.get(t),Lt=t=>Ut.get(t),Dt=t=>"object"==typeof t&&null!==t&&(!Ut.has(t)&&Wt.has(t.constructor)),Rt={};class It{constructor(t){this.owner=t,this.computedsByScope=new WeakMap}setValue(t){this.update({value:t})}setGetter(t){this.update({get:t})}getComputed(){const t=_t()||Rt;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(t)){const e=()=>{const t=this.getterSignal?.value;return t?t.call(this.owner):this.valueSignal?.value};ut(Lt(this.owner)),this.computedsByScope.set(t,G(xt(e))),ct()}return this.computedsByScope.get(t)}update({get:t,value:e}){this.valueSignal?e===this.valueSignal.peek()&&t===this.getterSignal.peek()||U((()=>{this.valueSignal.value=e,this.getterSignal.value=t})):(this.valueSignal=B(e),this.getterSignal=B(t))}}const Vt=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter((t=>"symbol"==typeof t))),Bt=new WeakMap,zt=(t,e)=>Bt.has(t)&&Bt.get(t).has(e),qt=new WeakSet,Jt=(t,e,n)=>{Bt.has(t)||Bt.set(t,new Map),e="number"==typeof e?`${e}`:e;const r=Bt.get(t);if(!r.has(e)){const o=Lt(t),i=new It(t);if(r.set(e,i),n){const{get:e,value:r}=n;if(e)i.setGetter(e);else{const e=qt.has(t);i.setValue(Dt(r)?Qt(o,r,{readOnly:e}):r)}}}return r.get(e)},Kt=new WeakMap;let Gt=!1;const Xt={get(t,e,n){if(Gt||!t.hasOwnProperty(e)&&e in t||"symbol"==typeof e&&Vt.has(e))return Reflect.get(t,e,n);const r=Object.getOwnPropertyDescriptor(t,e),o=Jt(n,e,r).getComputed().value;if("function"==typeof o){const t=Lt(n);return(...e)=>{ut(t);try{return o.call(n,...e)}finally{ct()}}}return o},set(t,e,n,r){if(qt.has(r))return!1;ut(Lt(r));try{return Reflect.set(t,e,n,r)}finally{ct()}},defineProperty(t,e,n){if(qt.has(At(t)))return!1;const r=!(e in t),o=Reflect.defineProperty(t,e,n);if(o){const o=At(t),i=Jt(o,e),{get:s,value:u}=n;if(s)i.setGetter(s);else{const t=Lt(o);i.setValue(Dt(u)?Qt(t,u):u)}if(r&&Kt.has(t)&&Kt.get(t).value++,Array.isArray(t)&&Bt.get(o)?.has("length")){Jt(o,"length").setValue(t.length)}}return o},deleteProperty(t,e){if(qt.has(At(t)))return!1;const n=Reflect.deleteProperty(t,e);if(n){Jt(At(t),e).setValue(void 0),Kt.has(t)&&Kt.get(t).value++}return n},ownKeys:t=>(Kt.has(t)||Kt.set(t,B(0)),Kt._=Kt.get(t).value,Reflect.ownKeys(t))},Qt=(t,e,n)=>{const r=Ft(t,e,Xt);return n?.readOnly&&qt.add(r),r},Yt=(t,e,n=!0)=>{if(!Mt(t)||!Mt(e))return;let r=!1;for(const o in e){const i=!(o in t);r=r||i;const s=Object.getOwnPropertyDescriptor(e,o),u=At(t),c=!!u&&zt(u,o)&&Jt(u,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(t,o,{...s,configurable:!0,enumerable:!0}),s.get&&c&&c.setGetter(s.get));else if(Mt(e[o])){const r=Object.getOwnPropertyDescriptor(t,o)?.value;if(i||n&&!Mt(r)){if(t[o]={},c){const e=Lt(u);c.setValue(Qt(e,t[o]))}Yt(t[o],e[o],n)}else Mt(r)&&Yt(t[o],e[o],n)}else if((n||i)&&(Object.defineProperty(t,o,s),c)){const{value:t}=s,e=Lt(u);c.setValue(Dt(t)?Qt(e,t):t)}}r&&Kt.has(t)&&Kt.get(t).value++},Zt=(t,e,n=!0)=>U((()=>{return Yt((r=t,Ht.get(r)||t),e,n);var r})),te=new WeakSet,ee={get:(t,e,n)=>{const r=Reflect.get(t,e),o=Lt(n);if(void 0===r&&te.has(n)){const n={};return Reflect.set(t,e,n),ne(o,n,!1)}if("function"==typeof r){ut(o);const t=xt(r);return ct(),t}return Mt(r)&&Dt(r)?ne(o,r,!1):r}},ne=(t,e,n=!0)=>{const r=Ft(t,e,ee);return r&&n&&te.add(r),r},re=new WeakMap,oe=new WeakMap,ie=new WeakSet,se=Reflect.getOwnPropertyDescriptor,ue={get:(t,e)=>{const n=oe.get(t),r=t[e];return e in t?r:n[e]},set:(t,e,n)=>{const r=oe.get(t);return(e in t||!(e in r)?t:r)[e]=n,!0},ownKeys:t=>[...new Set([...Object.keys(oe.get(t)),...Object.keys(t)])],getOwnPropertyDescriptor:(t,e)=>se(t,e)||se(oe.get(t),e),has:(t,e)=>Reflect.has(t,e)||Reflect.has(oe.get(t),e)},ce=(t,e={})=>{if(ie.has(t))throw Error("This object cannot be proxified.");if(oe.set(t,e),!re.has(t)){const e=new Proxy(t,ue);re.set(t,e),ie.add(e)}return re.get(t)},le=new Map,_e=new Map,ae=new Map,fe=new Map,pe=new Map,he=t=>fe.get(t||st())||{},ve=t=>{const e=t||st();return pe.has(e)||pe.set(e,Qt(e,{},{readOnly:!0})),pe.get(e)},de="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function ye(t,{state:e={},...n}={},{lock:r=!1}={}){if(le.has(t)){if(r===de||ae.has(t)){const e=ae.get(t);if(!(r===de||!0!==r&&r===e))throw e?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else ae.set(t,r);const o=_e.get(t);Zt(o,n),Zt(o.state,e)}else{r!==de&&ae.set(t,r);const o={state:Qt(t,Mt(e)?e:{}),...n},i=ne(t,o);_e.set(t,o),le.set(t,i)}return le.get(t)}const ge=(t=document)=>{var e;const n=null!==(e=t.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==e?e:t.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},me=t=>{Mt(t?.state)&&Object.entries(t.state).forEach((([t,e])=>{const n=ye(t,{},{lock:de});Zt(n.state,e,!1),Zt(ve(t),e)})),Mt(t?.config)&&Object.entries(t.config).forEach((([t,e])=>{fe.set(t,e)}))},we=ge();function be(t){return null!==t.suffix}function Se(t){return null===t.suffix}me(we);const xe=(0,c.q6)({client:{},server:{}}),ke={},Ee={},Pe=(t,e,{priority:n=10}={})=>{ke[t]=e,Ee[t]=n},Ce=({scope:t})=>(e,...n)=>{let{value:r,namespace:o}=e;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));at(t);const s=((t,e)=>{if(!e)return void Tt();let n=le.get(e);void 0===n&&(n=ye(e,{},{lock:de}));const r={...n,context:_t().context[e]};try{return t.split(".").reduce(((t,e)=>t[e]),r)}catch(t){}})(r,o);if("function"==typeof s){if(i){Tt();const t=!s(...n);return ft(),t}return ft(),(...e)=>{at(t);const n=s(...e);return ft(),n}}const u=s;return ft(),i?!u:u},Oe=({directives:t,priorityLevels:[e,...n],element:r,originalProps:o,previousScope:i})=>{const s=S({}).current;s.evaluate=k(Ce({scope:s}),[]);const{client:u,server:l}=E(xe);s.context=u,s.serverContext=l,s.ref=i?.ref||S(null),r=(0,c.Ob)(r,{ref:s.ref}),s.attributes=r.props;const _=n.length>0?(0,c.h)(Oe,{directives:t,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,a={...o,children:_},f={directives:t,props:a,element:r,context:xe,evaluate:s.evaluate};at(s);for(const t of e){const e=ke[t]?.(f);void 0!==e&&(a.children=e)}return ft(),a.children},$e=c.fF.vnode;function Te(t){return Mt(t)?Object.fromEntries(Object.entries(t).map((([t,e])=>[t,Te(e)]))):Array.isArray(t)?t.map((t=>Te(t))):t}function Me(t){return new Proxy(t,{get(t,e,n){const r=t[e];switch(e){case"currentTarget":case"preventDefault":case"stopImmediatePropagation":case"stopPropagation":Tt()}return r instanceof Function?function(...e){return r.apply(this===n?t:this,e)}:r}})}c.fF.vnode=t=>{if(t.props.__directives){const e=t.props,n=e.__directives;n.key&&(t.key=n.key.find(Se).value),delete e.__directives;const r=(t=>{const e=Object.keys(t).reduce(((t,e)=>{if(ke[e]){const n=Ee[e];(t[n]=t[n]||[]).push(e)}return t}),{});return Object.entries(e).sort((([t],[e])=>parseInt(t)-parseInt(e))).map((([,t])=>t))})(n);r.length>0&&(t.props={directives:n,priorityLevels:r,originalProps:e,type:t.type,element:(0,c.h)(t.type,e),top:!0},t.type=Oe)}$e&&$e(t)};const Ne=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,je=/\/\*[^]*?\*\/| +/g,He=/\n+/g,Ue=t=>({directives:e,evaluate:n})=>{e[`on-${t}`].filter(be).forEach((e=>{const r=e.suffix.split("--",1)[0];Et((()=>{const o=t=>{const r=n(e);"function"==typeof r&&(r?.sync||(t=Me(t)),r(t))},i="window"===t?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},We=t=>({directives:e,evaluate:n})=>{e[`on-async-${t}`].filter(be).forEach((e=>{const r=e.suffix.split("--",1)[0];Et((()=>{const o=async t=>{await bt();const r=n(e);"function"==typeof r&&r(t)},i="window"===t?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Fe="wp",Ae=`data-${Fe}-ignore`,Le=`data-${Fe}-interactive`,De=`data-${Fe}-`,Re=[],Ie=new RegExp(`^data-${Fe}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Ve=/^([\w_\/-]+)::(.+)$/,Be=new WeakSet;function ze(t){const e=document.createTreeWalker(t,205);return function t(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const t=e.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,t]}if(8===r||7===r){const t=e.nextSibling();return n.remove(),[null,t]}const i=n,{attributes:s}=i,u=i.localName,l={},_=[],a=[];let f=!1,p=!1;for(let t=0;t<s.length;t++){const e=s[t].name,n=s[t].value;if(e[De.length]&&e.slice(0,De.length)===De)if(e===Ae)f=!0;else{var h,v;const t=Ve.exec(n),r=null!==(h=t?.[1])&&void 0!==h?h:null;let o=null!==(v=t?.[2])&&void 0!==v?v:n;try{const t=JSON.parse(o);d=t,o=Boolean(d&&"object"==typeof d&&d.constructor===Object)?t:o}catch{}if(e===Le){p=!0;const t="string"==typeof o?o:"string"==typeof o?.namespace?o.namespace:null;Re.push(t)}else a.push([e,r,o])}else if("ref"===e)continue;l[e]=n}var d;if(f&&!p)return[(0,c.h)(u,{...l,innerHTML:i.innerHTML,__directives:{ignore:!0}})];if(p&&Be.add(i),a.length&&(l.__directives=a.reduce(((t,[e,n,r])=>{const o=Ie.exec(e);if(null===o)return Tt(),t;const i=o[1]||"",s=o[2]||null;var u;return t[i]=t[i]||[],t[i].push({namespace:null!=n?n:null!==(u=Re[Re.length-1])&&void 0!==u?u:null,value:r,suffix:s}),t}),{})),"template"===u)l.content=[...i.content.childNodes].map((t=>ze(t)));else{let n=e.firstChild();if(n){for(;n;){const[r,o]=t(n);r&&_.push(r),n=o||e.nextSibling()}e.parentNode()}}return p&&Re.pop(),[(0,c.h)(u,l,_)]}(e.currentNode)}const qe=new WeakMap,Je=t=>{if(!t.parentElement)throw Error("The passed region should be an element with a parent.");return qe.has(t)||qe.set(t,((t,e)=>{const n=(e=[].concat(e))[e.length-1].nextSibling;function r(e,r){t.insertBefore(e,r||n)}return t.__k={nodeType:1,parentNode:t,firstChild:e[0],childNodes:e,insertBefore:r,appendChild:r,removeChild(e){t.removeChild(e)}}})(t.parentElement,t)),qe.get(t)},Ke=new WeakMap,Ge=t=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===t)return{directivePrefix:Fe,getRegionRootFragment:Je,initialVdom:Ke,toVdom:ze,directive:Pe,getNamespace:st,h:c.h,cloneElement:c.Ob,render:c.XX,proxifyState:Qt,parseServerData:ge,populateServerData:me,batch:U};throw new Error("Forbidden access.")};Pe("context",(({directives:{context:t},props:{children:e},context:n})=>{const{Provider:r}=n,o=t.find(Se),{client:i,server:s}=E(n),u=o.namespace,l=S(Qt(u,{})),_=S(Qt(u,{},{readOnly:!0})),a=x((()=>{const t={client:{...i},server:{...s}};if(o){const{namespace:e,value:n}=o;Mt(n)||Tt(),Zt(l.current,Te(n),!1),Zt(_.current,Te(n)),t.client[e]=ce(l.current,i[e]),t.server[e]=ce(_.current,s[e])}return t}),[o,i,s]);return(0,c.h)(r,{value:a},e)}),{priority:5}),Pe("watch",(({directives:{watch:t},evaluate:e})=>{t.forEach((t=>{kt((()=>{let n=e(t);return"function"==typeof n&&(n=n()),n}))}))})),Pe("init",(({directives:{init:t},evaluate:e})=>{t.forEach((t=>{Et((()=>{let n=e(t);return"function"==typeof n&&(n=n()),n}))}))})),Pe("on",(({directives:{on:t},element:e,evaluate:n})=>{const r=new Map;t.filter(be).forEach((t=>{const e=t.suffix.split("--")[0];r.has(e)||r.set(e,new Set),r.get(e).add(t)})),r.forEach(((t,r)=>{const o=e.props[`on${r}`];e.props[`on${r}`]=e=>{t.forEach((t=>{o&&o(e);const r=n(t);"function"==typeof r&&(r?.sync||(e=Me(e)),r(e))}))}}))})),Pe("on-async",(({directives:{"on-async":t},element:e,evaluate:n})=>{const r=new Map;t.filter(be).forEach((t=>{const e=t.suffix.split("--")[0];r.has(e)||r.set(e,new Set),r.get(e).add(t)})),r.forEach(((t,r)=>{const o=e.props[`on${r}`];e.props[`on${r}`]=e=>{o&&o(e),t.forEach((async t=>{await bt();const r=n(t);"function"==typeof r&&r(e)}))}}))})),Pe("on-window",Ue("window")),Pe("on-document",Ue("document")),Pe("on-async-window",We("window")),Pe("on-async-document",We("document")),Pe("class",(({directives:{class:t},element:e,evaluate:n})=>{t.filter(be).forEach((t=>{const r=t.suffix;let o=n(t);"function"==typeof o&&(o=o());const i=e.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(e.props.class=i?`${i} ${r}`:r):e.props.class=i.replace(s," ").trim(),Et((()=>{o?e.ref.current.classList.add(r):e.ref.current.classList.remove(r)}))}))})),Pe("style",(({directives:{style:t},element:e,evaluate:n})=>{t.filter(be).forEach((t=>{const r=t.suffix;let o=n(t);"function"==typeof o&&(o=o()),e.props.style=e.props.style||{},"string"==typeof e.props.style&&(e.props.style=(t=>{const e=[{}];let n,r;for(;n=Ne.exec(t.replace(je,""));)n[4]?e.shift():n[3]?(r=n[3].replace(He," ").trim(),e.unshift(e[0][r]=e[0][r]||{})):e[0][n[1]]=n[2].replace(He," ").trim();return e[0]})(e.props.style)),o?e.props.style[r]=o:delete e.props.style[r],Et((()=>{o?e.ref.current.style[r]=o:e.ref.current.style.removeProperty(r)}))}))})),Pe("bind",(({directives:{bind:t},element:e,evaluate:n})=>{t.filter(be).forEach((t=>{const r=t.suffix;let o=n(t);"function"==typeof o&&(o=o()),e.props[r]=o,Et((()=>{const t=e.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in t)try{return void(t[r]=null==o?"":o)}catch(t){}null==o||!1===o&&"-"!==r[4]?t.removeAttribute(r):t.setAttribute(r,o)}else"string"==typeof o&&(t.style.cssText=o)}))}))})),Pe("ignore",(({element:{type:t,props:{innerHTML:e,...n}}})=>{const r=x((()=>e),[]);return(0,c.h)(t,{dangerouslySetInnerHTML:{__html:r},...n})})),Pe("text",(({directives:{text:t},element:e,evaluate:n})=>{const r=t.find(Se);if(r)try{let t=n(r);"function"==typeof t&&(t=t()),e.props.children="object"==typeof t?null:t.toString()}catch(t){e.props.children=null}else e.props.children=null})),Pe("run",(({directives:{run:t},evaluate:e})=>{t.forEach((t=>{let n=e(t);return"function"==typeof n&&(n=n()),n}))})),Pe("each",(({directives:{each:t,"each-key":e},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=E(n),[u]=t,{namespace:l}=u;let _=o(u);if("function"==typeof _&&(_=_()),"function"!=typeof _?.[Symbol.iterator])return;const a=be(u)?u.suffix.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()})):"item",f=[];for(const t of _){const n=ce(Qt(l,{}),s.client[l]),o={client:{...s.client,[l]:n},server:{...s.server}};o.client[l][a]=t;const u={..._t(),context:o.client,serverContext:o.server},_=e?Ce({scope:u})(e[0]):t;f.push((0,c.h)(i,{value:o,key:_},r.props.content))}return f}),{priority:20}),Pe("each-child",(()=>null),{priority:1}),(async()=>{const t=document.querySelectorAll(`[data-${Fe}-interactive]`);await new Promise((t=>{setTimeout(t,0)}));for(const e of t)if(!Be.has(e)){await bt();const t=Je(e),n=ze(e);Ke.set(e,n),await bt(),(0,c.Qv)(n,t)}})();var Xe=r.zj,Qe=r.SD,Ye=r.V6,Ze=r.$K,tn=r.vT,en=r.jb,nn=r.yT,rn=r.M_,on=r.hb,sn=r.vJ,un=r.ip,cn=r.Nf,ln=r.Kr,_n=r.li,an=r.J0,fn=r.FH,pn=r.v4,hn=r.mh;export{Xe as getConfig,Qe as getContext,Ye as getElement,Ze as getServerContext,tn as getServerState,en as privateApis,nn as splitTask,rn as store,on as useCallback,sn as useEffect,un as useInit,cn as useLayoutEffect,ln as useMemo,_n as useRef,an as useState,fn as useWatch,pn as withScope,hn as withSyncEvent}; interactivity-router/index.js 0000644 00000042067 15071251711 0012436 0 ustar 00 import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
/******/ var __webpack_modules__ = ({
/***/ 317:
/***/ ((module) => {
module.exports = import("@wordpress/a11y");;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
o: () => (/* binding */ actions),
w: () => (/* binding */ state)
});
;// external "@wordpress/interactivity"
var x = (y) => {
var x = {}; __webpack_require__.d(x, y); return x
}
var y = (x) => (() => (x))
const interactivity_namespaceObject = x({ ["getConfig"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getConfig), ["privateApis"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.privateApis), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });
;// ./node_modules/@wordpress/interactivity-router/build-module/head.js
/**
* The cache of prefetched stylesheets and scripts.
*/
const headElements = new Map();
/**
* Helper to update only the necessary tags in the head.
*
* @async
* @param newHead The head elements of the new page.
*/
const updateHead = async newHead => {
// Helper to get the tag id store in the cache.
const getTagId = tag => tag.id || tag.outerHTML;
// Map incoming head tags by their content.
const newHeadMap = new Map();
for (const child of newHead) {
newHeadMap.set(getTagId(child), child);
}
const toRemove = [];
// Detect nodes that should be added or removed.
for (const child of document.head.children) {
const id = getTagId(child);
// Always remove styles and links as they might change.
if (child.nodeName === 'LINK' || child.nodeName === 'STYLE') {
toRemove.push(child);
} else if (newHeadMap.has(id)) {
newHeadMap.delete(id);
} else if (child.nodeName !== 'SCRIPT' && child.nodeName !== 'META') {
toRemove.push(child);
}
}
await Promise.all([...headElements.entries()].filter(([, {
tag
}]) => tag.nodeName === 'SCRIPT').map(async ([url]) => {
await import(/* webpackIgnore: true */url);
}));
// Prepare new assets.
const toAppend = [...newHeadMap.values()];
// Apply the changes.
toRemove.forEach(n => n.remove());
document.head.append(...toAppend);
};
/**
* Fetches and processes head assets (stylesheets and scripts) from a specified document.
*
* @async
* @param doc The document from which to fetch head assets. It should support standard DOM querying methods.
*
* @return Returns an array of HTML elements representing the head assets.
*/
const fetchHeadAssets = async doc => {
const headTags = [];
// We only want to fetch module scripts because regular scripts (without
// `async` or `defer` attributes) can depend on the execution of other scripts.
// Scripts found in the head are blocking and must be executed in order.
const scripts = doc.querySelectorAll('script[type="module"][src]');
scripts.forEach(script => {
const src = script.getAttribute('src');
if (!headElements.has(src)) {
// add the <link> elements to prefetch the module scripts
const link = doc.createElement('link');
link.rel = 'modulepreload';
link.href = src;
document.head.append(link);
headElements.set(src, {
tag: script
});
}
});
const stylesheets = doc.querySelectorAll('link[rel=stylesheet]');
await Promise.all(Array.from(stylesheets).map(async tag => {
const href = tag.getAttribute('href');
if (!href) {
return;
}
if (!headElements.has(href)) {
try {
const response = await fetch(href);
const text = await response.text();
headElements.set(href, {
tag,
text
});
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
}
}
const headElement = headElements.get(href);
const styleElement = doc.createElement('style');
styleElement.textContent = headElement.text;
headTags.push(styleElement);
}));
return [doc.querySelector('title'), ...doc.querySelectorAll('style'), ...headTags];
};
;// ./node_modules/@wordpress/interactivity-router/build-module/index.js
var _getConfig$navigation;
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
directivePrefix,
getRegionRootFragment,
initialVdom,
toVdom,
render,
parseServerData,
populateServerData,
batch
} = (0,interactivity_namespaceObject.privateApis)('I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.');
// Check if the navigation mode is full page or region based.
const navigationMode = (_getConfig$navigation = (0,interactivity_namespaceObject.getConfig)('core/router').navigationMode) !== null && _getConfig$navigation !== void 0 ? _getConfig$navigation : 'regionBased';
// The cache of visited and prefetched pages, stylesheets and scripts.
const pages = new Map();
// Helper to remove domain and hash from the URL. We are only interesting in
// caching the path and the query.
const getPagePath = url => {
const u = new URL(url, window.location.href);
return u.pathname + u.search;
};
// Fetch a new page and convert it to a static virtual DOM.
const fetchPage = async (url, {
html
}) => {
try {
if (!html) {
const res = await window.fetch(url);
if (res.status !== 200) {
return false;
}
html = await res.text();
}
const dom = new window.DOMParser().parseFromString(html, 'text/html');
return regionsToVdom(dom);
} catch (e) {
return false;
}
};
// Return an object with VDOM trees of those HTML regions marked with a
// `router-region` directive.
const regionsToVdom = async (dom, {
vdom
} = {}) => {
const regions = {
body: undefined
};
let head;
if (false) {}
if (navigationMode === 'regionBased') {
const attrName = `data-${directivePrefix}-router-region`;
dom.querySelectorAll(`[${attrName}]`).forEach(region => {
const id = region.getAttribute(attrName);
regions[id] = vdom?.has(region) ? vdom.get(region) : toVdom(region);
});
}
const title = dom.querySelector('title')?.innerText;
const initialData = parseServerData(dom);
return {
regions,
head,
title,
initialData
};
};
// Render all interactive regions contained in the given page.
const renderRegions = async page => {
if (false) {}
if (navigationMode === 'regionBased') {
const attrName = `data-${directivePrefix}-router-region`;
batch(() => {
populateServerData(page.initialData);
document.querySelectorAll(`[${attrName}]`).forEach(region => {
const id = region.getAttribute(attrName);
const fragment = getRegionRootFragment(region);
render(page.regions[id], fragment);
});
});
}
if (page.title) {
document.title = page.title;
}
};
/**
* Load the given page forcing a full page reload.
*
* The function returns a promise that won't resolve, useful to prevent any
* potential feedback indicating that the navigation has finished while the new
* page is being loaded.
*
* @param href The page href.
* @return Promise that never resolves.
*/
const forcePageReload = href => {
window.location.assign(href);
return new Promise(() => {});
};
// Listen to the back and forward buttons and restore the page if it's in the
// cache.
window.addEventListener('popstate', async () => {
const pagePath = getPagePath(window.location.href); // Remove hash.
const page = pages.has(pagePath) && (await pages.get(pagePath));
if (page) {
await renderRegions(page);
// Update the URL in the state.
state.url = window.location.href;
} else {
window.location.reload();
}
});
// Initialize the router and cache the initial page using the initial vDOM.
// Once this code is tested and more mature, the head should be updated for
// region based navigation as well.
if (false) {}
pages.set(getPagePath(window.location.href), Promise.resolve(regionsToVdom(document, {
vdom: initialVdom
})));
// Check if the link is valid for client-side navigation.
const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin && !ref.pathname.startsWith('/wp-admin') && !ref.pathname.startsWith('/wp-login.php') && !ref.getAttribute('href').startsWith('#') && !new URL(ref.href).searchParams.has('_wpnonce');
// Check if the event is valid for client-side navigation.
const isValidEvent = event => event && event.button === 0 &&
// Left clicks only.
!event.metaKey &&
// Open in new tab (Mac).
!event.ctrlKey &&
// Open in new tab (Windows).
!event.altKey &&
// Download.
!event.shiftKey && !event.defaultPrevented;
// Variable to store the current navigation.
let navigatingTo = '';
let hasLoadedNavigationTextsData = false;
const navigationTexts = {
loading: 'Loading page, please wait.',
loaded: 'Page Loaded.'
};
const {
state,
actions
} = (0,interactivity_namespaceObject.store)('core/router', {
state: {
url: window.location.href,
navigation: {
hasStarted: false,
hasFinished: false
}
},
actions: {
/**
* Navigates to the specified page.
*
* This function normalizes the passed href, fetches the page HTML if
* needed, and updates any interactive regions whose contents have
* changed. It also creates a new entry in the browser session history.
*
* @param href The page href.
* @param [options] Options object.
* @param [options.force] If true, it forces re-fetching the URL.
* @param [options.html] HTML string to be used instead of fetching the requested URL.
* @param [options.replace] If true, it replaces the current entry in the browser session history.
* @param [options.timeout] Time until the navigation is aborted, in milliseconds. Default is 10000.
* @param [options.loadingAnimation] Whether an animation should be shown while navigating. Default to `true`.
* @param [options.screenReaderAnnouncement] Whether a message for screen readers should be announced while navigating. Default to `true`.
*
* @return Promise that resolves once the navigation is completed or aborted.
*/
*navigate(href, options = {}) {
const {
clientNavigationDisabled
} = (0,interactivity_namespaceObject.getConfig)();
if (clientNavigationDisabled) {
yield forcePageReload(href);
}
const pagePath = getPagePath(href);
const {
navigation
} = state;
const {
loadingAnimation = true,
screenReaderAnnouncement = true,
timeout = 10000
} = options;
navigatingTo = href;
actions.prefetch(pagePath, options);
// Create a promise that resolves when the specified timeout ends.
// The timeout value is 10 seconds by default.
const timeoutPromise = new Promise(resolve => setTimeout(resolve, timeout));
// Don't update the navigation status immediately, wait 400 ms.
const loadingTimeout = setTimeout(() => {
if (navigatingTo !== href) {
return;
}
if (loadingAnimation) {
navigation.hasStarted = true;
navigation.hasFinished = false;
}
if (screenReaderAnnouncement) {
a11ySpeak('loading');
}
}, 400);
const page = yield Promise.race([pages.get(pagePath), timeoutPromise]);
// Dismiss loading message if it hasn't been added yet.
clearTimeout(loadingTimeout);
// Once the page is fetched, the destination URL could have changed
// (e.g., by clicking another link in the meantime). If so, bail
// out, and let the newer execution to update the HTML.
if (navigatingTo !== href) {
return;
}
if (page && !page.initialData?.config?.['core/router']?.clientNavigationDisabled) {
yield renderRegions(page);
window.history[options.replace ? 'replaceState' : 'pushState']({}, '', href);
// Update the URL in the state.
state.url = href;
// Update the navigation status once the the new page rendering
// has been completed.
if (loadingAnimation) {
navigation.hasStarted = false;
navigation.hasFinished = true;
}
if (screenReaderAnnouncement) {
a11ySpeak('loaded');
}
// Scroll to the anchor if exits in the link.
const {
hash
} = new URL(href, window.location.href);
if (hash) {
document.querySelector(hash)?.scrollIntoView();
}
} else {
yield forcePageReload(href);
}
},
/**
* Prefetches the page with the passed URL.
*
* The function normalizes the URL and stores internally the fetch
* promise, to avoid triggering a second fetch for an ongoing request.
*
* @param url The page URL.
* @param [options] Options object.
* @param [options.force] Force fetching the URL again.
* @param [options.html] HTML string to be used instead of fetching the requested URL.
*/
prefetch(url, options = {}) {
const {
clientNavigationDisabled
} = (0,interactivity_namespaceObject.getConfig)();
if (clientNavigationDisabled) {
return;
}
const pagePath = getPagePath(url);
if (options.force || !pages.has(pagePath)) {
pages.set(pagePath, fetchPage(pagePath, {
html: options.html
}));
}
}
}
});
/**
* Announces a message to screen readers.
*
* This is a wrapper around the `@wordpress/a11y` package's `speak` function. It handles importing
* the package on demand and should be used instead of calling `ally.speak` direacly.
*
* @param messageKey The message to be announced by assistive technologies.
*/
function a11ySpeak(messageKey) {
if (!hasLoadedNavigationTextsData) {
hasLoadedNavigationTextsData = true;
const content = document.getElementById('wp-script-module-data-@wordpress/interactivity-router')?.textContent;
if (content) {
try {
const parsed = JSON.parse(content);
if (typeof parsed?.i18n?.loading === 'string') {
navigationTexts.loading = parsed.i18n.loading;
}
if (typeof parsed?.i18n?.loaded === 'string') {
navigationTexts.loaded = parsed.i18n.loaded;
}
} catch {}
} else {
// Fallback to localized strings from Interactivity API state.
// @todo This block is for Core < 6.7.0. Remove when support is dropped.
// @ts-expect-error
if (state.navigation.texts?.loading) {
// @ts-expect-error
navigationTexts.loading = state.navigation.texts.loading;
}
// @ts-expect-error
if (state.navigation.texts?.loaded) {
// @ts-expect-error
navigationTexts.loaded = state.navigation.texts.loaded;
}
}
}
const message = navigationTexts[messageKey];
Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 317)).then(({
speak
}) => speak(message),
// Ignore failures to load the a11y module.
() => {});
}
// Add click and prefetch to all links.
if (false) {}
var __webpack_exports__actions = __webpack_exports__.o;
var __webpack_exports__state = __webpack_exports__.w;
export { __webpack_exports__actions as actions, __webpack_exports__state as state };
interactivity-router/index.min.js 0000644 00000007105 15071251711 0013212 0 ustar 00 import*as e from"@wordpress/interactivity";var t={317:e=>{e.exports=import("@wordpress/a11y")}},o={};function i(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};i.d(n,{o:()=>D,w:()=>A});const a=(e=>{var t={};return i.d(t,e),t})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});new Map;var r;const{directivePrefix:s,getRegionRootFragment:d,initialVdom:l,toVdom:c,render:g,parseServerData:w,populateServerData:p,batch:u}=(0,a.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),h=null!==(r=(0,a.getConfig)("core/router").navigationMode)&&void 0!==r?r:"regionBased",f=new Map,v=e=>{const t=new URL(e,window.location.href);return t.pathname+t.search},m=async(e,{vdom:t}={})=>{const o={body:void 0};if("regionBased"===h){const i=`data-${s}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{const n=e.getAttribute(i);o[n]=t?.has(e)?t.get(e):c(e)}))}const i=e.querySelector("title")?.innerText,n=w(e);return{regions:o,head:undefined,title:i,initialData:n}},y=async e=>{if("regionBased"===h){const t=`data-${s}-router-region`;u((()=>{p(e.initialData),document.querySelectorAll(`[${t}]`).forEach((o=>{const i=o.getAttribute(t),n=d(o);g(e.regions[i],n)}))}))}e.title&&(document.title=e.title)},x=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=v(window.location.href),t=f.has(e)&&await f.get(e);t?(await y(t),A.url=window.location.href):window.location.reload()})),f.set(v(window.location.href),Promise.resolve(m(document,{vdom:l})));let b="",S=!1;const P={loading:"Loading page, please wait.",loaded:"Page Loaded."},{state:A,actions:D}=(0,a.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,a.getConfig)();o&&(yield x(e));const i=v(e),{navigation:n}=A,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:d=1e4}=t;b=e,D.prefetch(i,t);const l=new Promise((e=>setTimeout(e,d))),c=setTimeout((()=>{b===e&&(r&&(n.hasStarted=!0,n.hasFinished=!1),s&&C("loading"))}),400),g=yield Promise.race([f.get(i),l]);if(clearTimeout(c),b===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield y(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),A.url=e,r&&(n.hasStarted=!1,n.hasFinished=!0),s&&C("loaded");const{hash:o}=new URL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}else yield x(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,a.getConfig)();if(o)return;const i=v(e);!t.force&&f.has(i)||f.set(i,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return m(o)}catch(e){return!1}})(i,{html:t.html}))}}});function C(e){if(!S){S=!0;const e=document.getElementById("wp-script-module-data-@wordpress/interactivity-router")?.textContent;if(e)try{const t=JSON.parse(e);"string"==typeof t?.i18n?.loading&&(P.loading=t.i18n.loading),"string"==typeof t?.i18n?.loaded&&(P.loaded=t.i18n.loaded)}catch{}else A.navigation.texts?.loading&&(P.loading=A.navigation.texts.loading),A.navigation.texts?.loaded&&(P.loaded=A.navigation.texts.loaded)}const t=P[e];Promise.resolve().then(i.bind(i,317)).then((({speak:e})=>e(t)),(()=>{}))}var F=n.o,L=n.w;export{F as actions,L as state}; block-library/file/view.js 0000644 00000006045 15071251711 0011534 0 ustar 00 import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// external "@wordpress/interactivity"
var x = (y) => {
var x = {}; __webpack_require__.d(x, y); return x
}
var y = (x) => (() => (x))
const interactivity_namespaceObject = x({ ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });
;// ./node_modules/@wordpress/block-library/build-module/file/utils/index.js
/**
* Uses a combination of user agent matching and feature detection to determine whether
* the current browser supports rendering PDFs inline.
*
* @return {boolean} Whether or not the browser supports inline PDFs.
*/
const browserSupportsPdfs = () => {
// Most mobile devices include "Mobi" in their UA.
if (window.navigator.userAgent.indexOf('Mobi') > -1) {
return false;
}
// Android tablets are the notable exception.
if (window.navigator.userAgent.indexOf('Android') > -1) {
return false;
}
// iPad pretends to be a Mac.
if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
return false;
}
// IE only supports PDFs when there's an ActiveX object available for it.
if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) {
return false;
}
return true;
};
/**
* Helper function for creating ActiveX objects, catching any errors that are thrown
* when it's generated.
*
* @param {string} type The name of the ActiveX object to create.
* @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.
*/
const createActiveXObject = type => {
let ax;
try {
ax = new window.ActiveXObject(type);
} catch (e) {
ax = undefined;
}
return ax;
};
;// ./node_modules/@wordpress/block-library/build-module/file/view.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
(0,interactivity_namespaceObject.store)('core/file', {
state: {
get hasPdfPreview() {
return browserSupportsPdfs();
}
}
}, {
lock: true
});
block-library/file/view.min.js 0000644 00000001315 15071251711 0012311 0 ustar 00 import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(e=>{var o={};return t.d(o,e),o})({store:()=>e.store}),r=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t};(0,o.store)("core/file",{state:{get hasPdfPreview(){return!(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!r("AcroPDF.PDF")&&!r("PDF.PdfCtrl"))}}},{lock:!0}); block-library/navigation/view.min.js 0000644 00000006436 15071251711 0013542 0 ustar 00 import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store,withSyncEvent:()=>e.withSyncEvent}),o=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];document.addEventListener("click",(()=>{}));const{state:l,actions:c}=(0,n.store)("core/navigation",{state:{get roleAttribute(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"dialog":null},get ariaModal(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"true":null},get ariaLabel(){const e=(0,n.getContext)();return"overlay"===e.type&&l.isMenuOpen?e.ariaLabel:null},get isMenuOpen(){return Object.values(l.menuOpenedBy).filter(Boolean).length>0},get menuOpenedBy(){const e=(0,n.getContext)();return"overlay"===e.type?e.overlayOpenedBy:e.submenuOpenedBy}},actions:{openMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.openMenu("hover")},closeMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.closeMenu("hover")},openMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();e.previousFocus=t,c.openMenu("click")},closeMenuOnClick(){c.closeMenu("click"),c.closeMenu("focus")},openMenuOnFocus(){c.openMenu("focus")},toggleMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();window.document.activeElement!==t&&t.focus();const{menuOpenedBy:o}=l;o.click||o.focus?(c.closeMenu("click"),c.closeMenu("focus")):(e.previousFocus=t,c.openMenu("click"))},handleMenuKeydown:(0,n.withSyncEvent)((e=>{const{type:t,firstFocusableElement:o,lastFocusableElement:u}=(0,n.getContext)();if(l.menuOpenedBy.click){if("Escape"===e?.key)return c.closeMenu("click"),void c.closeMenu("focus");"overlay"===t&&"Tab"===e.key&&(e.shiftKey&&window.document.activeElement===o?(e.preventDefault(),u.focus()):e.shiftKey||window.document.activeElement!==u||(e.preventDefault(),o.focus()))}})),handleMenuFocusout(e){const{modal:t,type:o}=(0,n.getContext)();(null===e.relatedTarget||!t?.contains(e.relatedTarget)&&e.target!==window.document.activeElement&&"submenu"===o)&&(c.closeMenu("click"),c.closeMenu("focus"))},openMenu(e="click"){const{type:t}=(0,n.getContext)();l.menuOpenedBy[e]=!0,"overlay"===t&&document.documentElement.classList.add("has-modal-open")},closeMenu(e="click"){const t=(0,n.getContext)();l.menuOpenedBy[e]=!1,l.isMenuOpen||(t.modal?.contains(window.document.activeElement)&&t.previousFocus?.focus(),t.modal=null,t.previousFocus=null,"overlay"===t.type&&document.documentElement.classList.remove("has-modal-open"))}},callbacks:{initMenu(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();if(l.isMenuOpen){const n=t.querySelectorAll(o);e.modal=t,e.firstFocusableElement=n[0],e.lastFocusableElement=n[n.length-1]}},focusFirstElement(){const{ref:e}=(0,n.getElement)();if(l.isMenuOpen){const t=e.querySelectorAll(o);t?.[0]?.focus()}}}},{lock:!0}); block-library/navigation/view.js 0000644 00000020513 15071251711 0012750 0 ustar 00 import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// external "@wordpress/interactivity"
var x = (y) => {
var x = {}; __webpack_require__.d(x, y); return x
}
var y = (x) => (() => (x))
const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store), ["withSyncEvent"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.withSyncEvent) });
;// ./node_modules/@wordpress/block-library/build-module/navigation/view.js
/**
* WordPress dependencies
*/
const focusableSelectors = ['a[href]', 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', '[contenteditable]', '[tabindex]:not([tabindex^="-"])'];
// This is a fix for Safari in iOS/iPadOS. Without it, Safari doesn't focus out
// when the user taps in the body. It can be removed once we add an overlay to
// capture the clicks, instead of relying on the focusout event.
document.addEventListener('click', () => {});
const {
state,
actions
} = (0,interactivity_namespaceObject.store)('core/navigation', {
state: {
get roleAttribute() {
const ctx = (0,interactivity_namespaceObject.getContext)();
return ctx.type === 'overlay' && state.isMenuOpen ? 'dialog' : null;
},
get ariaModal() {
const ctx = (0,interactivity_namespaceObject.getContext)();
return ctx.type === 'overlay' && state.isMenuOpen ? 'true' : null;
},
get ariaLabel() {
const ctx = (0,interactivity_namespaceObject.getContext)();
return ctx.type === 'overlay' && state.isMenuOpen ? ctx.ariaLabel : null;
},
get isMenuOpen() {
// The menu is opened if either `click`, `hover` or `focus` is true.
return Object.values(state.menuOpenedBy).filter(Boolean).length > 0;
},
get menuOpenedBy() {
const ctx = (0,interactivity_namespaceObject.getContext)();
return ctx.type === 'overlay' ? ctx.overlayOpenedBy : ctx.submenuOpenedBy;
}
},
actions: {
openMenuOnHover() {
const {
type,
overlayOpenedBy
} = (0,interactivity_namespaceObject.getContext)();
if (type === 'submenu' &&
// Only open on hover if the overlay is closed.
Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) {
actions.openMenu('hover');
}
},
closeMenuOnHover() {
const {
type,
overlayOpenedBy
} = (0,interactivity_namespaceObject.getContext)();
if (type === 'submenu' &&
// Only close on hover if the overlay is closed.
Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) {
actions.closeMenu('hover');
}
},
openMenuOnClick() {
const ctx = (0,interactivity_namespaceObject.getContext)();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
ctx.previousFocus = ref;
actions.openMenu('click');
},
closeMenuOnClick() {
actions.closeMenu('click');
actions.closeMenu('focus');
},
openMenuOnFocus() {
actions.openMenu('focus');
},
toggleMenuOnClick() {
const ctx = (0,interactivity_namespaceObject.getContext)();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
// Safari won't send focus to the clicked element, so we need to manually place it: https://bugs.webkit.org/show_bug.cgi?id=22261
if (window.document.activeElement !== ref) {
ref.focus();
}
const {
menuOpenedBy
} = state;
if (menuOpenedBy.click || menuOpenedBy.focus) {
actions.closeMenu('click');
actions.closeMenu('focus');
} else {
ctx.previousFocus = ref;
actions.openMenu('click');
}
},
handleMenuKeydown: (0,interactivity_namespaceObject.withSyncEvent)(event => {
const {
type,
firstFocusableElement,
lastFocusableElement
} = (0,interactivity_namespaceObject.getContext)();
if (state.menuOpenedBy.click) {
// If Escape close the menu.
if (event?.key === 'Escape') {
actions.closeMenu('click');
actions.closeMenu('focus');
return;
}
// Trap focus if it is an overlay (main menu).
if (type === 'overlay' && event.key === 'Tab') {
// If shift + tab it change the direction.
if (event.shiftKey && window.document.activeElement === firstFocusableElement) {
event.preventDefault();
lastFocusableElement.focus();
} else if (!event.shiftKey && window.document.activeElement === lastFocusableElement) {
event.preventDefault();
firstFocusableElement.focus();
}
}
}
}),
handleMenuFocusout(event) {
const {
modal,
type
} = (0,interactivity_namespaceObject.getContext)();
// If focus is outside modal, and in the document, close menu
// event.target === The element losing focus
// event.relatedTarget === The element receiving focus (if any)
// When focusout is outside the document,
// `window.document.activeElement` doesn't change.
// The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari.
if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement && type === 'submenu') {
actions.closeMenu('click');
actions.closeMenu('focus');
}
},
openMenu(menuOpenedOn = 'click') {
const {
type
} = (0,interactivity_namespaceObject.getContext)();
state.menuOpenedBy[menuOpenedOn] = true;
if (type === 'overlay') {
// Add a `has-modal-open` class to the <html> root.
document.documentElement.classList.add('has-modal-open');
}
},
closeMenu(menuClosedOn = 'click') {
const ctx = (0,interactivity_namespaceObject.getContext)();
state.menuOpenedBy[menuClosedOn] = false;
// Check if the menu is still open or not.
if (!state.isMenuOpen) {
if (ctx.modal?.contains(window.document.activeElement)) {
ctx.previousFocus?.focus();
}
ctx.modal = null;
ctx.previousFocus = null;
if (ctx.type === 'overlay') {
document.documentElement.classList.remove('has-modal-open');
}
}
}
},
callbacks: {
initMenu() {
const ctx = (0,interactivity_namespaceObject.getContext)();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
if (state.isMenuOpen) {
const focusableElements = ref.querySelectorAll(focusableSelectors);
ctx.modal = ref;
ctx.firstFocusableElement = focusableElements[0];
ctx.lastFocusableElement = focusableElements[focusableElements.length - 1];
}
},
focusFirstElement() {
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
if (state.isMenuOpen) {
const focusableElements = ref.querySelectorAll(focusableSelectors);
focusableElements?.[0]?.focus();
}
}
}
}, {
lock: true
});
block-library/search/view.js 0000644 00000007773 15071251711 0012073 0 ustar 00 import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// external "@wordpress/interactivity"
var x = (y) => {
var x = {}; __webpack_require__.d(x, y); return x
}
var y = (x) => (() => (x))
const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store), ["withSyncEvent"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.withSyncEvent) });
;// ./node_modules/@wordpress/block-library/build-module/search/view.js
/**
* WordPress dependencies
*/
const {
actions
} = (0,interactivity_namespaceObject.store)('core/search', {
state: {
get ariaLabel() {
const {
isSearchInputVisible,
ariaLabelCollapsed,
ariaLabelExpanded
} = (0,interactivity_namespaceObject.getContext)();
return isSearchInputVisible ? ariaLabelExpanded : ariaLabelCollapsed;
},
get ariaControls() {
const {
isSearchInputVisible,
inputId
} = (0,interactivity_namespaceObject.getContext)();
return isSearchInputVisible ? null : inputId;
},
get type() {
const {
isSearchInputVisible
} = (0,interactivity_namespaceObject.getContext)();
return isSearchInputVisible ? 'submit' : 'button';
},
get tabindex() {
const {
isSearchInputVisible
} = (0,interactivity_namespaceObject.getContext)();
return isSearchInputVisible ? '0' : '-1';
}
},
actions: {
openSearchInput: (0,interactivity_namespaceObject.withSyncEvent)(event => {
const ctx = (0,interactivity_namespaceObject.getContext)();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
if (!ctx.isSearchInputVisible) {
event.preventDefault();
ctx.isSearchInputVisible = true;
ref.parentElement.querySelector('input').focus();
}
}),
closeSearchInput() {
const ctx = (0,interactivity_namespaceObject.getContext)();
ctx.isSearchInputVisible = false;
},
handleSearchKeydown(event) {
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
// If Escape close the menu.
if (event?.key === 'Escape') {
actions.closeSearchInput();
ref.querySelector('button').focus();
}
},
handleSearchFocusout(event) {
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
// If focus is outside search form, and in the document, close menu
// event.target === The element losing focus
// event.relatedTarget === The element receiving focus (if any)
// When focusout is outside the document,
// `window.document.activeElement` doesn't change.
if (!ref.contains(event.relatedTarget) && event.target !== window.document.activeElement) {
actions.closeSearchInput();
}
}
}
}, {
lock: true
});
block-library/search/view.min.js 0000644 00000002531 15071251711 0012640 0 ustar 00 import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store,withSyncEvent:()=>e.withSyncEvent}),{actions:r}=(0,n.store)("core/search",{state:{get ariaLabel(){const{isSearchInputVisible:e,ariaLabelCollapsed:t,ariaLabelExpanded:r}=(0,n.getContext)();return e?r:t},get ariaControls(){const{isSearchInputVisible:e,inputId:t}=(0,n.getContext)();return e?null:t},get type(){const{isSearchInputVisible:e}=(0,n.getContext)();return e?"submit":"button"},get tabindex(){const{isSearchInputVisible:e}=(0,n.getContext)();return e?"0":"-1"}},actions:{openSearchInput:(0,n.withSyncEvent)((e=>{const t=(0,n.getContext)(),{ref:r}=(0,n.getElement)();t.isSearchInputVisible||(e.preventDefault(),t.isSearchInputVisible=!0,r.parentElement.querySelector("input").focus())})),closeSearchInput(){(0,n.getContext)().isSearchInputVisible=!1},handleSearchKeydown(e){const{ref:t}=(0,n.getElement)();"Escape"===e?.key&&(r.closeSearchInput(),t.querySelector("button").focus())},handleSearchFocusout(e){const{ref:t}=(0,n.getElement)();t.contains(e.relatedTarget)||e.target===window.document.activeElement||r.closeSearchInput()}}},{lock:!0}); block-library/form/view.js 0000644 00000003304 15071251711 0011553 0 ustar 00 var __webpack_exports__ = {};
/* wp:polyfill */
let formSettings;
try {
formSettings = JSON.parse(document.getElementById('wp-script-module-data-@wordpress/block-library/form/view')?.textContent);
} catch {}
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable no-undef */
document.querySelectorAll('form.wp-block-form').forEach(function (form) {
// Bail If the form settings not provided or the form is not using the mailto: action.
if (!formSettings || !form.action || !form.action.startsWith('mailto:')) {
return;
}
const redirectNotification = status => {
const urlParams = new URLSearchParams(window.location.search);
urlParams.append('wp-form-result', status);
window.location.search = urlParams.toString();
};
// Add an event listener for the form submission.
form.addEventListener('submit', async function (event) {
event.preventDefault();
// Get the form data and merge it with the form action and nonce.
const formData = Object.fromEntries(new FormData(form).entries());
formData.formAction = form.action;
formData._ajax_nonce = formSettings.nonce;
formData.action = formSettings.action;
formData._wp_http_referer = window.location.href;
formData.formAction = form.action;
try {
const response = await fetch(formSettings.ajaxUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams(formData).toString()
});
if (response.ok) {
redirectNotification('success');
} else {
redirectNotification('error');
}
} catch (error) {
redirectNotification('error');
}
});
});
block-library/form/view.min.js 0000644 00000001473 15071251711 0012342 0 ustar 00 let t;try{t=JSON.parse(document.getElementById("wp-script-module-data-@wordpress/block-library/form/view")?.textContent)}catch{}document.querySelectorAll("form.wp-block-form").forEach((function(o){if(!t||!o.action||!o.action.startsWith("mailto:"))return;const e=t=>{const o=new URLSearchParams(window.location.search);o.append("wp-form-result",t),window.location.search=o.toString()};o.addEventListener("submit",(async function(r){r.preventDefault();const n=Object.fromEntries(new FormData(o).entries());n.formAction=o.action,n._ajax_nonce=t.nonce,n.action=t.action,n._wp_http_referer=window.location.href,n.formAction=o.action;try{(await fetch(t.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(n).toString()})).ok?e("success"):e("error")}catch(t){e("error")}}))})); block-library/query/view.js 0000644 00000011300 15071251711 0011750 0 ustar 00 import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
/******/ var __webpack_modules__ = ({
/***/ 438:
/***/ ((module) => {
module.exports = import("@wordpress/interactivity-router");;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// external "@wordpress/interactivity"
var x = (y) => {
var x = {}; __webpack_require__.d(x, y); return x
}
var y = (x) => (() => (x))
const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store), ["withSyncEvent"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.withSyncEvent) });
;// ./node_modules/@wordpress/block-library/build-module/query/view.js
/**
* WordPress dependencies
*/
const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin;
const isValidEvent = event => event.button === 0 &&
// Left clicks only.
!event.metaKey &&
// Open in new tab (Mac).
!event.ctrlKey &&
// Open in new tab (Windows).
!event.altKey &&
// Download.
!event.shiftKey && !event.defaultPrevented;
(0,interactivity_namespaceObject.store)('core/query', {
actions: {
navigate: (0,interactivity_namespaceObject.withSyncEvent)(function* (event) {
const ctx = (0,interactivity_namespaceObject.getContext)();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
const queryRef = ref.closest('.wp-block-query[data-wp-router-region]');
if (isValidLink(ref) && isValidEvent(event)) {
event.preventDefault();
const {
actions
} = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438));
yield actions.navigate(ref.href);
ctx.url = ref.href;
// Focus the first anchor of the Query block.
const firstAnchor = `.wp-block-post-template a[href]`;
queryRef.querySelector(firstAnchor)?.focus();
}
}),
*prefetch() {
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
if (isValidLink(ref)) {
const {
actions
} = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438));
yield actions.prefetch(ref.href);
}
}
},
callbacks: {
*prefetch() {
const {
url
} = (0,interactivity_namespaceObject.getContext)();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
if (url && isValidLink(ref)) {
const {
actions
} = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438));
yield actions.prefetch(ref.href);
}
}
}
}, {
lock: true
});
block-library/query/view.min.js 0000644 00000002704 15071251711 0012542 0 ustar 00 import*as e from"@wordpress/interactivity";var t={438:e=>{e.exports=import("@wordpress/interactivity-router")}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=(e=>{var t={};return o.d(t,e),t})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store,withSyncEvent:()=>e.withSyncEvent}),i=e=>e&&e instanceof window.HTMLAnchorElement&&e.href&&(!e.target||"_self"===e.target)&&e.origin===window.location.origin;(0,n.store)("core/query",{actions:{navigate:(0,n.withSyncEvent)((function*(e){const t=(0,n.getContext)(),{ref:r}=(0,n.getElement)(),s=r.closest(".wp-block-query[data-wp-router-region]");if(i(r)&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.defaultPrevented))(e)){e.preventDefault();const{actions:n}=yield Promise.resolve().then(o.bind(o,438));yield n.navigate(r.href),t.url=r.href;const i=".wp-block-post-template a[href]";s.querySelector(i)?.focus()}})),*prefetch(){const{ref:e}=(0,n.getElement)();if(i(e)){const{actions:t}=yield Promise.resolve().then(o.bind(o,438));yield t.prefetch(e.href)}}},callbacks:{*prefetch(){const{url:e}=(0,n.getContext)(),{ref:t}=(0,n.getElement)();if(e&&i(t)){const{actions:e}=yield Promise.resolve().then(o.bind(o,438));yield e.prefetch(t.href)}}}},{lock:!0}); block-library/image/view.min.js 0000644 00000011053 15071251711 0012454 0 ustar 00 import*as t from"@wordpress/interactivity";var e={d:(t,n)=>{for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const n=(t=>{var n={};return e.d(n,t),n})({getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store,withSyncEvent:()=>t.withSyncEvent});let a=!1,o=0;const{state:r,actions:i,callbacks:l}=(0,n.store)("core/image",{state:{currentImageId:null,get currentImage(){return r.metadata[r.currentImageId]},get overlayOpened(){return null!==r.currentImageId},get roleAttribute(){return r.overlayOpened?"dialog":null},get ariaModal(){return r.overlayOpened?"true":null},get enlargedSrc(){return r.currentImage.uploadedSrc||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},get figureStyles(){return r.overlayOpened&&`${r.currentImage.figureStyles?.replace(/margin[^;]*;?/g,"")};`},get imgStyles(){return r.overlayOpened&&`${r.currentImage.imgStyles?.replace(/;$/,"")}; object-fit:cover;`},get imageButtonRight(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonRight},get imageButtonTop(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonTop},get isContentHidden(){const t=(0,n.getContext)();return r.overlayEnabled&&r.currentImageId===t.imageId},get isContentVisible(){const t=(0,n.getContext)();return!r.overlayEnabled&&r.currentImageId===t.imageId}},actions:{showLightbox(){const{imageId:t}=(0,n.getContext)();r.metadata[t].imageRef?.complete&&(r.scrollTopReset=document.documentElement.scrollTop,r.scrollLeftReset=document.documentElement.scrollLeft,r.overlayEnabled=!0,r.currentImageId=t,l.setOverlayStyles())},hideLightbox(){r.overlayEnabled&&(r.showClosingAnimation=!0,r.overlayEnabled=!1,setTimeout((function(){r.currentImage.buttonRef.focus({preventScroll:!0}),r.currentImageId=null}),450))},handleKeydown:(0,n.withSyncEvent)((t=>{if(r.overlayEnabled){if("Tab"===t.key){t.preventDefault();const{ref:e}=(0,n.getElement)();e.querySelector("button").focus()}"Escape"===t.key&&i.hideLightbox()}})),handleTouchMove:(0,n.withSyncEvent)((t=>{r.overlayEnabled&&t.preventDefault()})),handleTouchStart(){a=!0},handleTouchEnd(){o=Date.now(),a=!1},handleScroll(){r.overlayOpened&&!a&&Date.now()-o>450&&window.scrollTo(r.scrollLeftReset,r.scrollTopReset)}},callbacks:{setOverlayStyles(){if(!r.overlayEnabled)return;let{naturalWidth:t,naturalHeight:e,offsetWidth:n,offsetHeight:a}=r.currentImage.imageRef,{x:o,y:i}=r.currentImage.imageRef.getBoundingClientRect();const l=t/e;let g=n/a;if("contain"===r.currentImage.scaleAttr)if(l>g){const t=n/l;i+=(a-t)/2,a=t}else{const t=a*l;o+=(n-t)/2,n=t}g=n/a;let c=parseFloat("none"!==r.currentImage.targetWidth?r.currentImage.targetWidth:t),s=parseFloat("none"!==r.currentImage.targetHeight?r.currentImage.targetHeight:e),d=c/s,u=c,m=s,h=c,p=s;if(l.toFixed(2)!==d.toFixed(2)){if(l>d){const t=c/l;s-t>c?(s=t,c=t*l):s=c/l}else{const t=s*l;c-t>s?(c=t,s=t/l):c=s*l}h=c,p=s,d=c/s,g>d?(u=c,m=u/g):(m=s,u=m*g)}(n>h||a>p)&&(h=n,p=a);let f=0;window.innerWidth>480?f=80:window.innerWidth>1920&&(f=160);const y=Math.min(window.innerWidth-f,h),w=Math.min(window.innerHeight-80,p);g>y/w?(h=y,p=h/g):(p=w,h=p*g);const b=n/h,I=c*(h/u),v=s*(p/m);r.overlayStyles=`\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${i}px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${o}px;\n\t\t\t\t\t--wp--lightbox-container-width: ${h+1}px;\n\t\t\t\t\t--wp--lightbox-container-height: ${p+1}px;\n\t\t\t\t\t--wp--lightbox-image-width: ${I}px;\n\t\t\t\t\t--wp--lightbox-image-height: ${v}px;\n\t\t\t\t\t--wp--lightbox-scale: ${b};\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${window.innerWidth-document.documentElement.clientWidth}px;\n\t\t\t\t`},setButtonStyles(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].imageRef=e,r.metadata[t].currentSrc=e.currentSrc;const{naturalWidth:a,naturalHeight:o,offsetWidth:i,offsetHeight:l}=e;if(0===a||0===o)return;const g=e.parentElement,c=e.parentElement.clientWidth;let s=e.parentElement.clientHeight;const d=g.querySelector("figcaption");if(d){const t=window.getComputedStyle(d);["absolute","fixed"].includes(t.position)||(s=s-d.offsetHeight-parseFloat(t.marginTop)-parseFloat(t.marginBottom))}const u=s-l,m=c-i;let h=u+16,p=m+16;if("contain"===r.metadata[t].scaleAttr){const t=a/o;if(t>=i/l){h=(l-i/t)/2+u+16,p=m+16}else{h=u+16,p=(i-l*t)/2+m+16}}r.metadata[t].imageButtonTop=h,r.metadata[t].imageButtonRight=p},setOverlayFocus(){if(r.overlayEnabled){const{ref:t}=(0,n.getElement)();t.focus()}},initTriggerButton(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].buttonRef=e}}},{lock:!0}); block-library/image/view.js 0000644 00000043426 15071251711 0011703 0 ustar 00 import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// external "@wordpress/interactivity"
var x = (y) => {
var x = {}; __webpack_require__.d(x, y); return x
}
var y = (x) => (() => (x))
const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store), ["withSyncEvent"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.withSyncEvent) });
;// ./node_modules/@wordpress/block-library/build-module/image/view.js
/**
* WordPress dependencies
*/
/**
* Tracks whether user is touching screen; used to differentiate behavior for
* touch and mouse input.
*
* @type {boolean}
*/
let isTouching = false;
/**
* Tracks the last time the screen was touched; used to differentiate behavior
* for touch and mouse input.
*
* @type {number}
*/
let lastTouchTime = 0;
const {
state,
actions,
callbacks
} = (0,interactivity_namespaceObject.store)('core/image', {
state: {
currentImageId: null,
get currentImage() {
return state.metadata[state.currentImageId];
},
get overlayOpened() {
return state.currentImageId !== null;
},
get roleAttribute() {
return state.overlayOpened ? 'dialog' : null;
},
get ariaModal() {
return state.overlayOpened ? 'true' : null;
},
get enlargedSrc() {
return state.currentImage.uploadedSrc || 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
},
get figureStyles() {
return state.overlayOpened && `${state.currentImage.figureStyles?.replace(/margin[^;]*;?/g, '')};`;
},
get imgStyles() {
return state.overlayOpened && `${state.currentImage.imgStyles?.replace(/;$/, '')}; object-fit:cover;`;
},
get imageButtonRight() {
const {
imageId
} = (0,interactivity_namespaceObject.getContext)();
return state.metadata[imageId].imageButtonRight;
},
get imageButtonTop() {
const {
imageId
} = (0,interactivity_namespaceObject.getContext)();
return state.metadata[imageId].imageButtonTop;
},
get isContentHidden() {
const ctx = (0,interactivity_namespaceObject.getContext)();
return state.overlayEnabled && state.currentImageId === ctx.imageId;
},
get isContentVisible() {
const ctx = (0,interactivity_namespaceObject.getContext)();
return !state.overlayEnabled && state.currentImageId === ctx.imageId;
}
},
actions: {
showLightbox() {
const {
imageId
} = (0,interactivity_namespaceObject.getContext)();
// Bails out if the image has not loaded yet.
if (!state.metadata[imageId].imageRef?.complete) {
return;
}
// Stores the positions of the scroll to fix it until the overlay is
// closed.
state.scrollTopReset = document.documentElement.scrollTop;
state.scrollLeftReset = document.documentElement.scrollLeft;
// Sets the current expanded image in the state and enables the overlay.
state.overlayEnabled = true;
state.currentImageId = imageId;
// Computes the styles of the overlay for the animation.
callbacks.setOverlayStyles();
},
hideLightbox() {
if (state.overlayEnabled) {
// Starts the overlay closing animation. The showClosingAnimation
// class is used to avoid showing it on page load.
state.showClosingAnimation = true;
state.overlayEnabled = false;
// Waits until the close animation has completed before allowing a
// user to scroll again. The duration of this animation is defined in
// the `styles.scss` file, but in any case we should wait a few
// milliseconds longer than the duration, otherwise a user may scroll
// too soon and cause the animation to look sloppy.
setTimeout(function () {
// Delays before changing the focus. Otherwise the focus ring will
// appear on Firefox before the image has finished animating, which
// looks broken.
state.currentImage.buttonRef.focus({
preventScroll: true
});
// Resets the current image id to mark the overlay as closed.
state.currentImageId = null;
}, 450);
}
},
handleKeydown: (0,interactivity_namespaceObject.withSyncEvent)(event => {
if (state.overlayEnabled) {
// Focuses the close button when the user presses the tab key.
if (event.key === 'Tab') {
event.preventDefault();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
ref.querySelector('button').focus();
}
// Closes the lightbox when the user presses the escape key.
if (event.key === 'Escape') {
actions.hideLightbox();
}
}
}),
handleTouchMove: (0,interactivity_namespaceObject.withSyncEvent)(event => {
// On mobile devices, prevents triggering the scroll event because
// otherwise the page jumps around when it resets the scroll position.
// This also means that closing the lightbox requires that a user
// perform a simple tap. This may be changed in the future if there is a
// better alternative to override or reset the scroll position during
// swipe actions.
if (state.overlayEnabled) {
event.preventDefault();
}
}),
handleTouchStart() {
isTouching = true;
},
handleTouchEnd() {
// Waits a few milliseconds before resetting to ensure that pinch to
// zoom works consistently on mobile devices when the lightbox is open.
lastTouchTime = Date.now();
isTouching = false;
},
handleScroll() {
// Prevents scrolling behaviors that trigger content shift while the
// lightbox is open. It would be better to accomplish through CSS alone,
// but using overflow: hidden is currently the only way to do so and
// that causes a layout to shift and prevents the zoom animation from
// working in some cases because it's not possible to account for the
// layout shift when doing the animation calculations. Instead, it uses
// JavaScript to prevent and reset the scrolling behavior.
if (state.overlayOpened) {
// Avoids overriding the scroll behavior on mobile devices because
// doing so breaks the pinch to zoom functionality, and users should
// be able to zoom in further on the high-res image.
if (!isTouching && Date.now() - lastTouchTime > 450) {
// It doesn't rely on `event.preventDefault()` to prevent scrolling
// because the scroll event can't be canceled, so it resets the
// position instead.
window.scrollTo(state.scrollLeftReset, state.scrollTopReset);
}
}
}
},
callbacks: {
setOverlayStyles() {
if (!state.overlayEnabled) {
return;
}
let {
naturalWidth,
naturalHeight,
offsetWidth: originalWidth,
offsetHeight: originalHeight
} = state.currentImage.imageRef;
let {
x: screenPosX,
y: screenPosY
} = state.currentImage.imageRef.getBoundingClientRect();
// Natural ratio of the image clicked to open the lightbox.
const naturalRatio = naturalWidth / naturalHeight;
// Original ratio of the image clicked to open the lightbox.
let originalRatio = originalWidth / originalHeight;
// If it has object-fit: contain, recalculates the original sizes
// and the screen position without the blank spaces.
if (state.currentImage.scaleAttr === 'contain') {
if (naturalRatio > originalRatio) {
const heightWithoutSpace = originalWidth / naturalRatio;
// Recalculates screen position without the top space.
screenPosY += (originalHeight - heightWithoutSpace) / 2;
originalHeight = heightWithoutSpace;
} else {
const widthWithoutSpace = originalHeight * naturalRatio;
// Recalculates screen position without the left space.
screenPosX += (originalWidth - widthWithoutSpace) / 2;
originalWidth = widthWithoutSpace;
}
}
originalRatio = originalWidth / originalHeight;
// Typically, it uses the image's full-sized dimensions. If those
// dimensions have not been set (i.e. an external image with only one
// size), the image's dimensions in the lightbox are the same
// as those of the image in the content.
let imgMaxWidth = parseFloat(state.currentImage.targetWidth !== 'none' ? state.currentImage.targetWidth : naturalWidth);
let imgMaxHeight = parseFloat(state.currentImage.targetHeight !== 'none' ? state.currentImage.targetHeight : naturalHeight);
// Ratio of the biggest image stored in the database.
let imgRatio = imgMaxWidth / imgMaxHeight;
let containerMaxWidth = imgMaxWidth;
let containerMaxHeight = imgMaxHeight;
let containerWidth = imgMaxWidth;
let containerHeight = imgMaxHeight;
// Checks if the target image has a different ratio than the original
// one (thumbnail). Recalculates the width and height.
if (naturalRatio.toFixed(2) !== imgRatio.toFixed(2)) {
if (naturalRatio > imgRatio) {
// If the width is reached before the height, it keeps the maxWidth
// and recalculates the height unless the difference between the
// maxHeight and the reducedHeight is higher than the maxWidth,
// where it keeps the reducedHeight and recalculate the width.
const reducedHeight = imgMaxWidth / naturalRatio;
if (imgMaxHeight - reducedHeight > imgMaxWidth) {
imgMaxHeight = reducedHeight;
imgMaxWidth = reducedHeight * naturalRatio;
} else {
imgMaxHeight = imgMaxWidth / naturalRatio;
}
} else {
// If the height is reached before the width, it keeps the maxHeight
// and recalculate the width unlesss the difference between the
// maxWidth and the reducedWidth is higher than the maxHeight, where
// it keeps the reducedWidth and recalculate the height.
const reducedWidth = imgMaxHeight * naturalRatio;
if (imgMaxWidth - reducedWidth > imgMaxHeight) {
imgMaxWidth = reducedWidth;
imgMaxHeight = reducedWidth / naturalRatio;
} else {
imgMaxWidth = imgMaxHeight * naturalRatio;
}
}
containerWidth = imgMaxWidth;
containerHeight = imgMaxHeight;
imgRatio = imgMaxWidth / imgMaxHeight;
// Calculates the max size of the container.
if (originalRatio > imgRatio) {
containerMaxWidth = imgMaxWidth;
containerMaxHeight = containerMaxWidth / originalRatio;
} else {
containerMaxHeight = imgMaxHeight;
containerMaxWidth = containerMaxHeight * originalRatio;
}
}
// If the image has been pixelated on purpose, it keeps that size.
if (originalWidth > containerWidth || originalHeight > containerHeight) {
containerWidth = originalWidth;
containerHeight = originalHeight;
}
// Calculates the final lightbox image size and the scale factor.
// MaxWidth is either the window container (accounting for padding) or
// the image resolution.
let horizontalPadding = 0;
if (window.innerWidth > 480) {
horizontalPadding = 80;
} else if (window.innerWidth > 1920) {
horizontalPadding = 160;
}
const verticalPadding = 80;
const targetMaxWidth = Math.min(window.innerWidth - horizontalPadding, containerWidth);
const targetMaxHeight = Math.min(window.innerHeight - verticalPadding, containerHeight);
const targetContainerRatio = targetMaxWidth / targetMaxHeight;
if (originalRatio > targetContainerRatio) {
// If targetMaxWidth is reached before targetMaxHeight.
containerWidth = targetMaxWidth;
containerHeight = containerWidth / originalRatio;
} else {
// If targetMaxHeight is reached before targetMaxWidth.
containerHeight = targetMaxHeight;
containerWidth = containerHeight * originalRatio;
}
const containerScale = originalWidth / containerWidth;
const lightboxImgWidth = imgMaxWidth * (containerWidth / containerMaxWidth);
const lightboxImgHeight = imgMaxHeight * (containerHeight / containerMaxHeight);
// As of this writing, using the calculations above will render the
// lightbox with a small, erroneous whitespace on the left side of the
// image in iOS Safari, perhaps due to an inconsistency in how browsers
// handle absolute positioning and CSS transformation. In any case,
// adding 1 pixel to the container width and height solves the problem,
// though this can be removed if the issue is fixed in the future.
state.overlayStyles = `
--wp--lightbox-initial-top-position: ${screenPosY}px;
--wp--lightbox-initial-left-position: ${screenPosX}px;
--wp--lightbox-container-width: ${containerWidth + 1}px;
--wp--lightbox-container-height: ${containerHeight + 1}px;
--wp--lightbox-image-width: ${lightboxImgWidth}px;
--wp--lightbox-image-height: ${lightboxImgHeight}px;
--wp--lightbox-scale: ${containerScale};
--wp--lightbox-scrollbar-width: ${window.innerWidth - document.documentElement.clientWidth}px;
`;
},
setButtonStyles() {
const {
imageId
} = (0,interactivity_namespaceObject.getContext)();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
state.metadata[imageId].imageRef = ref;
state.metadata[imageId].currentSrc = ref.currentSrc;
const {
naturalWidth,
naturalHeight,
offsetWidth,
offsetHeight
} = ref;
// If the image isn't loaded yet, it can't calculate where the button
// should be.
if (naturalWidth === 0 || naturalHeight === 0) {
return;
}
const figure = ref.parentElement;
const figureWidth = ref.parentElement.clientWidth;
// It needs special handling for the height because a caption will cause
// the figure to be taller than the image, which means it needs to
// account for that when calculating the placement of the button in the
// top right corner of the image.
let figureHeight = ref.parentElement.clientHeight;
const caption = figure.querySelector('figcaption');
if (caption) {
const captionComputedStyle = window.getComputedStyle(caption);
if (!['absolute', 'fixed'].includes(captionComputedStyle.position)) {
figureHeight = figureHeight - caption.offsetHeight - parseFloat(captionComputedStyle.marginTop) - parseFloat(captionComputedStyle.marginBottom);
}
}
const buttonOffsetTop = figureHeight - offsetHeight;
const buttonOffsetRight = figureWidth - offsetWidth;
let imageButtonTop = buttonOffsetTop + 16;
let imageButtonRight = buttonOffsetRight + 16;
// In the case of an image with object-fit: contain, the size of the
// <img> element can be larger than the image itself, so it needs to
// calculate where to place the button.
if (state.metadata[imageId].scaleAttr === 'contain') {
// Natural ratio of the image.
const naturalRatio = naturalWidth / naturalHeight;
// Offset ratio of the image.
const offsetRatio = offsetWidth / offsetHeight;
if (naturalRatio >= offsetRatio) {
// If it reaches the width first, it keeps the width and compute the
// height.
const referenceHeight = offsetWidth / naturalRatio;
imageButtonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16;
imageButtonRight = buttonOffsetRight + 16;
} else {
// If it reaches the height first, it keeps the height and compute
// the width.
const referenceWidth = offsetHeight * naturalRatio;
imageButtonTop = buttonOffsetTop + 16;
imageButtonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16;
}
}
state.metadata[imageId].imageButtonTop = imageButtonTop;
state.metadata[imageId].imageButtonRight = imageButtonRight;
},
setOverlayFocus() {
if (state.overlayEnabled) {
// Moves the focus to the dialog when it opens.
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
ref.focus();
}
},
initTriggerButton() {
const {
imageId
} = (0,interactivity_namespaceObject.getContext)();
const {
ref
} = (0,interactivity_namespaceObject.getElement)();
state.metadata[imageId].buttonRef = ref;
}
}
}, {
lock: true
});