PluginProbe
Gutenberg / 23.3.2
Gutenberg v23.3.2
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / build / modules / boot / index.js

index.js in Gutenberg 23.3.2, at build/modules/boot/index.js

2,960 lines 139.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var __create = Object.create;
2 var __defProp = Object.defineProperty;
3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4 var __getOwnPropNames = Object.getOwnPropertyNames;
5 var __getProtoOf = Object.getPrototypeOf;
6 var __hasOwnProp = Object.prototype.hasOwnProperty;
7 var __commonJS = (cb, mod) => function __require() {
8 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9 };
10 var __export = (target, all) => {
11 for (var name in all)
12 __defProp(target, name, { get: all[name], enumerable: true });
13 };
14 var __copyProps = (to, from, except, desc) => {
15 if (from && typeof from === "object" || typeof from === "function") {
16 for (let key of __getOwnPropNames(from))
17 if (!__hasOwnProp.call(to, key) && key !== except)
18 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19 }
20 return to;
21 };
22 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23 // If the importer is in node compatibility mode or this is not an ESM
24 // file that has been converted to a CommonJS file using a Babel-
25 // compatible transform (i.e. "__esModule" has not been set), then set
26 // "default" to the CommonJS "module.exports" for node compatibility.
27 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28 mod
29 ));
30
31 // package-external:@wordpress/element
32 var require_element = __commonJS({
33 "package-external:@wordpress/element"(exports, module) {
34 module.exports = window.wp.element;
35 }
36 });
37
38 // package-external:@wordpress/data
39 var require_data = __commonJS({
40 "package-external:@wordpress/data"(exports, module) {
41 module.exports = window.wp.data;
42 }
43 });
44
45 // package-external:@wordpress/i18n
46 var require_i18n = __commonJS({
47 "package-external:@wordpress/i18n"(exports, module) {
48 module.exports = window.wp.i18n;
49 }
50 });
51
52 // vendor-external:react
53 var require_react = __commonJS({
54 "vendor-external:react"(exports, module) {
55 module.exports = window.React;
56 }
57 });
58
59 // vendor-external:react/jsx-runtime
60 var require_jsx_runtime = __commonJS({
61 "vendor-external:react/jsx-runtime"(exports, module) {
62 module.exports = window.ReactJSXRuntime;
63 }
64 });
65
66 // package-external:@wordpress/primitives
67 var require_primitives = __commonJS({
68 "package-external:@wordpress/primitives"(exports, module) {
69 module.exports = window.wp.primitives;
70 }
71 });
72
73 // package-external:@wordpress/compose
74 var require_compose = __commonJS({
75 "package-external:@wordpress/compose"(exports, module) {
76 module.exports = window.wp.compose;
77 }
78 });
79
80 // package-external:@wordpress/theme
81 var require_theme = __commonJS({
82 "package-external:@wordpress/theme"(exports, module) {
83 module.exports = window.wp.theme;
84 }
85 });
86
87 // package-external:@wordpress/private-apis
88 var require_private_apis = __commonJS({
89 "package-external:@wordpress/private-apis"(exports, module) {
90 module.exports = window.wp.privateApis;
91 }
92 });
93
94 // package-external:@wordpress/components
95 var require_components = __commonJS({
96 "package-external:@wordpress/components"(exports, module) {
97 module.exports = window.wp.components;
98 }
99 });
100
101 // package-external:@wordpress/core-data
102 var require_core_data = __commonJS({
103 "package-external:@wordpress/core-data"(exports, module) {
104 module.exports = window.wp.coreData;
105 }
106 });
107
108 // package-external:@wordpress/notices
109 var require_notices = __commonJS({
110 "package-external:@wordpress/notices"(exports, module) {
111 module.exports = window.wp.notices;
112 }
113 });
114
115 // package-external:@wordpress/html-entities
116 var require_html_entities = __commonJS({
117 "package-external:@wordpress/html-entities"(exports, module) {
118 module.exports = window.wp.htmlEntities;
119 }
120 });
121
122 // package-external:@wordpress/keycodes
123 var require_keycodes = __commonJS({
124 "package-external:@wordpress/keycodes"(exports, module) {
125 module.exports = window.wp.keycodes;
126 }
127 });
128
129 // package-external:@wordpress/commands
130 var require_commands = __commonJS({
131 "package-external:@wordpress/commands"(exports, module) {
132 module.exports = window.wp.commands;
133 }
134 });
135
136 // package-external:@wordpress/url
137 var require_url = __commonJS({
138 "package-external:@wordpress/url"(exports, module) {
139 module.exports = window.wp.url;
140 }
141 });
142
143 // package-external:@wordpress/editor
144 var require_editor = __commonJS({
145 "package-external:@wordpress/editor"(exports, module) {
146 module.exports = window.wp.editor;
147 }
148 });
149
150 // package-external:@wordpress/keyboard-shortcuts
151 var require_keyboard_shortcuts = __commonJS({
152 "package-external:@wordpress/keyboard-shortcuts"(exports, module) {
153 module.exports = window.wp.keyboardShortcuts;
154 }
155 });
156
157 // packages/boot/build-module/components/app/index.mjs
158 var import_element17 = __toESM(require_element(), 1);
159 var import_data12 = __toESM(require_data(), 1);
160
161 // packages/boot/build-module/components/app/router.mjs
162 var import_i18n12 = __toESM(require_i18n(), 1);
163 var import_element16 = __toESM(require_element(), 1);
164
165 // node_modules/clsx/dist/clsx.mjs
166 function r(e) {
167 var t, f, n = "";
168 if ("string" == typeof e || "number" == typeof e) n += e;
169 else if ("object" == typeof e) if (Array.isArray(e)) {
170 var o = e.length;
171 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
172 } else for (f in e) e[f] && (n && (n += " "), n += f);
173 return n;
174 }
175 function clsx() {
176 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
177 return n;
178 }
179 var clsx_default = clsx;
180
181 // node_modules/@base-ui/utils/esm/useRefWithInit.js
182 var React = __toESM(require_react(), 1);
183 var UNINITIALIZED = {};
184 function useRefWithInit(init2, initArg) {
185 const ref = React.useRef(UNINITIALIZED);
186 if (ref.current === UNINITIALIZED) {
187 ref.current = init2(initArg);
188 }
189 return ref;
190 }
191
192 // node_modules/@base-ui/utils/esm/warn.js
193 var set;
194 if (true) {
195 set = /* @__PURE__ */ new Set();
196 }
197 function warn(...messages) {
198 if (true) {
199 const messageKey = messages.join(" ");
200 if (!set.has(messageKey)) {
201 set.add(messageKey);
202 console.warn(`Base UI: ${messageKey}`);
203 }
204 }
205 }
206
207 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
208 var React4 = __toESM(require_react(), 1);
209
210 // node_modules/@base-ui/utils/esm/useMergedRefs.js
211 function useMergedRefs(a, b, c, d) {
212 const forkRef = useRefWithInit(createForkRef).current;
213 if (didChange(forkRef, a, b, c, d)) {
214 update(forkRef, [a, b, c, d]);
215 }
216 return forkRef.callback;
217 }
218 function useMergedRefsN(refs) {
219 const forkRef = useRefWithInit(createForkRef).current;
220 if (didChangeN(forkRef, refs)) {
221 update(forkRef, refs);
222 }
223 return forkRef.callback;
224 }
225 function createForkRef() {
226 return {
227 callback: null,
228 cleanup: null,
229 refs: []
230 };
231 }
232 function didChange(forkRef, a, b, c, d) {
233 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
234 }
235 function didChangeN(forkRef, newRefs) {
236 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
237 }
238 function update(forkRef, refs) {
239 forkRef.refs = refs;
240 if (refs.every((ref) => ref == null)) {
241 forkRef.callback = null;
242 return;
243 }
244 forkRef.callback = (instance) => {
245 if (forkRef.cleanup) {
246 forkRef.cleanup();
247 forkRef.cleanup = null;
248 }
249 if (instance != null) {
250 const cleanupCallbacks = Array(refs.length).fill(null);
251 for (let i = 0; i < refs.length; i += 1) {
252 const ref = refs[i];
253 if (ref == null) {
254 continue;
255 }
256 switch (typeof ref) {
257 case "function": {
258 const refCleanup = ref(instance);
259 if (typeof refCleanup === "function") {
260 cleanupCallbacks[i] = refCleanup;
261 }
262 break;
263 }
264 case "object": {
265 ref.current = instance;
266 break;
267 }
268 default:
269 }
270 }
271 forkRef.cleanup = () => {
272 for (let i = 0; i < refs.length; i += 1) {
273 const ref = refs[i];
274 if (ref == null) {
275 continue;
276 }
277 switch (typeof ref) {
278 case "function": {
279 const cleanupCallback = cleanupCallbacks[i];
280 if (typeof cleanupCallback === "function") {
281 cleanupCallback();
282 } else {
283 ref(null);
284 }
285 break;
286 }
287 case "object": {
288 ref.current = null;
289 break;
290 }
291 default:
292 }
293 }
294 };
295 }
296 };
297 }
298
299 // node_modules/@base-ui/utils/esm/getReactElementRef.js
300 var React3 = __toESM(require_react(), 1);
301
302 // node_modules/@base-ui/utils/esm/reactVersion.js
303 var React2 = __toESM(require_react(), 1);
304 var majorVersion = parseInt(React2.version, 10);
305 function isReactVersionAtLeast(reactVersionToCheck) {
306 return majorVersion >= reactVersionToCheck;
307 }
308
309 // node_modules/@base-ui/utils/esm/getReactElementRef.js
310 function getReactElementRef(element) {
311 if (!/* @__PURE__ */ React3.isValidElement(element)) {
312 return null;
313 }
314 const reactElement = element;
315 const propsWithRef = reactElement.props;
316 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
317 }
318
319 // node_modules/@base-ui/utils/esm/mergeObjects.js
320 function mergeObjects(a, b) {
321 if (a && !b) {
322 return a;
323 }
324 if (!a && b) {
325 return b;
326 }
327 if (a || b) {
328 return {
329 ...a,
330 ...b
331 };
332 }
333 return void 0;
334 }
335
336 // node_modules/@base-ui/utils/esm/empty.js
337 var EMPTY_ARRAY = Object.freeze([]);
338 var EMPTY_OBJECT = Object.freeze({});
339
340 // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
341 function getStateAttributesProps(state, customMapping) {
342 const props = {};
343 for (const key in state) {
344 const value = state[key];
345 if (customMapping?.hasOwnProperty(key)) {
346 const customProps = customMapping[key](value);
347 if (customProps != null) {
348 Object.assign(props, customProps);
349 }
350 continue;
351 }
352 if (value === true) {
353 props[`data-${key.toLowerCase()}`] = "";
354 } else if (value) {
355 props[`data-${key.toLowerCase()}`] = value.toString();
356 }
357 }
358 return props;
359 }
360
361 // node_modules/@base-ui/react/esm/utils/resolveClassName.js
362 function resolveClassName(className, state) {
363 return typeof className === "function" ? className(state) : className;
364 }
365
366 // node_modules/@base-ui/react/esm/utils/resolveStyle.js
367 function resolveStyle(style, state) {
368 return typeof style === "function" ? style(state) : style;
369 }
370
371 // node_modules/@base-ui/react/esm/merge-props/mergeProps.js
372 var EMPTY_PROPS = {};
373 function mergeProps(a, b, c, d, e) {
374 if (!c && !d && !e && !a) {
375 return createInitialMergedProps(b);
376 }
377 let merged = createInitialMergedProps(a);
378 if (b) {
379 merged = mergeInto(merged, b);
380 }
381 if (c) {
382 merged = mergeInto(merged, c);
383 }
384 if (d) {
385 merged = mergeInto(merged, d);
386 }
387 if (e) {
388 merged = mergeInto(merged, e);
389 }
390 return merged;
391 }
392 function mergePropsN(props) {
393 if (props.length === 0) {
394 return EMPTY_PROPS;
395 }
396 if (props.length === 1) {
397 return createInitialMergedProps(props[0]);
398 }
399 let merged = createInitialMergedProps(props[0]);
400 for (let i = 1; i < props.length; i += 1) {
401 merged = mergeInto(merged, props[i]);
402 }
403 return merged;
404 }
405 function createInitialMergedProps(inputProps) {
406 if (isPropsGetter(inputProps)) {
407 return {
408 ...resolvePropsGetter(inputProps, EMPTY_PROPS)
409 };
410 }
411 return copyInitialProps(inputProps);
412 }
413 function mergeInto(merged, inputProps) {
414 if (isPropsGetter(inputProps)) {
415 return resolvePropsGetter(inputProps, merged);
416 }
417 return mutablyMergeInto(merged, inputProps);
418 }
419 function copyInitialProps(inputProps) {
420 const copiedProps = {
421 ...inputProps
422 };
423 for (const propName in copiedProps) {
424 const propValue = copiedProps[propName];
425 if (isEventHandler(propName, propValue)) {
426 copiedProps[propName] = wrapEventHandler(propValue);
427 }
428 }
429 return copiedProps;
430 }
431 function mutablyMergeInto(mergedProps, externalProps) {
432 if (!externalProps) {
433 return mergedProps;
434 }
435 for (const propName in externalProps) {
436 const externalPropValue = externalProps[propName];
437 switch (propName) {
438 case "style": {
439 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
440 break;
441 }
442 case "className": {
443 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
444 break;
445 }
446 default: {
447 if (isEventHandler(propName, externalPropValue)) {
448 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
449 } else {
450 mergedProps[propName] = externalPropValue;
451 }
452 }
453 }
454 }
455 return mergedProps;
456 }
457 function isEventHandler(key, value) {
458 const code0 = key.charCodeAt(0);
459 const code1 = key.charCodeAt(1);
460 const code2 = key.charCodeAt(2);
461 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
462 }
463 function isPropsGetter(inputProps) {
464 return typeof inputProps === "function";
465 }
466 function resolvePropsGetter(inputProps, previousProps) {
467 if (isPropsGetter(inputProps)) {
468 return inputProps(previousProps);
469 }
470 return inputProps ?? EMPTY_PROPS;
471 }
472 function mergeEventHandlers(ourHandler, theirHandler) {
473 if (!theirHandler) {
474 return ourHandler;
475 }
476 if (!ourHandler) {
477 return wrapEventHandler(theirHandler);
478 }
479 return (...args) => {
480 const event = args[0];
481 if (isSyntheticEvent(event)) {
482 const baseUIEvent = event;
483 makeEventPreventable(baseUIEvent);
484 const result2 = theirHandler(...args);
485 if (!baseUIEvent.baseUIHandlerPrevented) {
486 ourHandler?.(...args);
487 }
488 return result2;
489 }
490 const result = theirHandler(...args);
491 ourHandler?.(...args);
492 return result;
493 };
494 }
495 function wrapEventHandler(handler) {
496 if (!handler) {
497 return handler;
498 }
499 return (...args) => {
500 const event = args[0];
501 if (isSyntheticEvent(event)) {
502 makeEventPreventable(event);
503 }
504 return handler(...args);
505 };
506 }
507 function makeEventPreventable(event) {
508 event.preventBaseUIHandler = () => {
509 event.baseUIHandlerPrevented = true;
510 };
511 return event;
512 }
513 function mergeClassNames(ourClassName, theirClassName) {
514 if (theirClassName) {
515 if (ourClassName) {
516 return theirClassName + " " + ourClassName;
517 }
518 return theirClassName;
519 }
520 return ourClassName;
521 }
522 function isSyntheticEvent(event) {
523 return event != null && typeof event === "object" && "nativeEvent" in event;
524 }
525
526 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
527 var import_react = __toESM(require_react(), 1);
528 function useRenderElement(element, componentProps, params = {}) {
529 const renderProp = componentProps.render;
530 const outProps = useRenderElementProps(componentProps, params);
531 if (params.enabled === false) {
532 return null;
533 }
534 const state = params.state ?? EMPTY_OBJECT;
535 return evaluateRenderProp(element, renderProp, outProps, state);
536 }
537 function useRenderElementProps(componentProps, params = {}) {
538 const {
539 className: classNameProp,
540 style: styleProp,
541 render: renderProp
542 } = componentProps;
543 const {
544 state = EMPTY_OBJECT,
545 ref,
546 props,
547 stateAttributesMapping,
548 enabled = true
549 } = params;
550 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
551 const style = enabled ? resolveStyle(styleProp, state) : void 0;
552 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
553 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
554 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
555 if (typeof document !== "undefined") {
556 if (!enabled) {
557 useMergedRefs(null, null);
558 } else if (Array.isArray(ref)) {
559 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
560 } else {
561 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
562 }
563 }
564 if (!enabled) {
565 return EMPTY_OBJECT;
566 }
567 if (className !== void 0) {
568 outProps.className = mergeClassNames(outProps.className, className);
569 }
570 if (style !== void 0) {
571 outProps.style = mergeObjects(outProps.style, style);
572 }
573 return outProps;
574 }
575 function resolveRenderFunctionProps(props) {
576 if (Array.isArray(props)) {
577 return mergePropsN(props);
578 }
579 return mergeProps(void 0, props);
580 }
581 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
582 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
583 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
584 function evaluateRenderProp(element, render, props, state) {
585 if (render) {
586 if (typeof render === "function") {
587 if (true) {
588 warnIfRenderPropLooksLikeComponent(render);
589 }
590 return render(props, state);
591 }
592 const mergedProps = mergeProps(props, render.props);
593 mergedProps.ref = props.ref;
594 let newElement = render;
595 if (newElement?.$$typeof === REACT_LAZY_TYPE) {
596 const children = React4.Children.toArray(render);
597 newElement = children[0];
598 }
599 if (true) {
600 if (!/* @__PURE__ */ React4.isValidElement(newElement)) {
601 throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
602 }
603 }
604 return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps);
605 }
606 if (element) {
607 if (typeof element === "string") {
608 return renderTag(element, props);
609 }
610 }
611 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
612 }
613 function warnIfRenderPropLooksLikeComponent(renderFn) {
614 const functionName = renderFn.name;
615 if (functionName.length === 0) {
616 return;
617 }
618 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
619 return;
620 }
621 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
622 return;
623 }
624 warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
625 }
626 function renderTag(Tag, props) {
627 if (Tag === "button") {
628 return /* @__PURE__ */ (0, import_react.createElement)("button", {
629 type: "button",
630 ...props,
631 key: props.key
632 });
633 }
634 if (Tag === "img") {
635 return /* @__PURE__ */ (0, import_react.createElement)("img", {
636 alt: "",
637 ...props,
638 key: props.key
639 });
640 }
641 return /* @__PURE__ */ React4.createElement(Tag, props);
642 }
643
644 // node_modules/@base-ui/react/esm/use-render/useRender.js
645 function useRender(params) {
646 return useRenderElement(params.defaultTagName ?? "div", params, params);
647 }
648
649 // packages/ui/build-module/text/text.mjs
650 var import_element = __toESM(require_element(), 1);
651 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
652 function getRuntime() {
653 const globalScope = globalThis;
654 if (globalScope.__wpStyleRuntime) {
655 return globalScope.__wpStyleRuntime;
656 }
657 globalScope.__wpStyleRuntime = {
658 documents: /* @__PURE__ */ new Map(),
659 styles: /* @__PURE__ */ new Map(),
660 injectedStyles: /* @__PURE__ */ new WeakMap()
661 };
662 if (typeof document !== "undefined") {
663 registerDocument(document);
664 }
665 return globalScope.__wpStyleRuntime;
666 }
667 function documentContainsStyleHash(targetDocument, hash) {
668 if (!targetDocument.head) {
669 return false;
670 }
671 for (const style of targetDocument.head.querySelectorAll(
672 `style[${STYLE_HASH_ATTRIBUTE}]`
673 )) {
674 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
675 return true;
676 }
677 }
678 return false;
679 }
680 function injectStyle(targetDocument, hash, css) {
681 if (!targetDocument.head) {
682 return;
683 }
684 const runtime = getRuntime();
685 let injectedStyles = runtime.injectedStyles.get(targetDocument);
686 if (!injectedStyles) {
687 injectedStyles = /* @__PURE__ */ new Set();
688 runtime.injectedStyles.set(targetDocument, injectedStyles);
689 }
690 if (injectedStyles.has(hash)) {
691 return;
692 }
693 if (documentContainsStyleHash(targetDocument, hash)) {
694 injectedStyles.add(hash);
695 return;
696 }
697 const style = targetDocument.createElement("style");
698 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
699 style.appendChild(targetDocument.createTextNode(css));
700 targetDocument.head.appendChild(style);
701 injectedStyles.add(hash);
702 }
703 function registerDocument(targetDocument) {
704 const runtime = getRuntime();
705 runtime.documents.set(
706 targetDocument,
707 (runtime.documents.get(targetDocument) ?? 0) + 1
708 );
709 for (const [hash, css] of runtime.styles) {
710 injectStyle(targetDocument, hash, css);
711 }
712 return () => {
713 const count = runtime.documents.get(targetDocument);
714 if (count === void 0) {
715 return;
716 }
717 if (count <= 1) {
718 runtime.documents.delete(targetDocument);
719 return;
720 }
721 runtime.documents.set(targetDocument, count - 1);
722 };
723 }
724 function registerStyle(hash, css) {
725 const runtime = getRuntime();
726 runtime.styles.set(hash, css);
727 for (const targetDocument of runtime.documents.keys()) {
728 injectStyle(targetDocument, hash, css);
729 }
730 }
731 if (typeof process === "undefined" || true) {
732 registerStyle("0c8601dd83", '@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}');
733 }
734 var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" };
735 if (typeof process === "undefined" || true) {
736 registerStyle("1fb29d3a3c", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,#0000);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 #0000);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,#0000);border-color:var(--_gcd-input-border-color-disabled,#0000);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid #0000)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid #0000);transition:var(--_gcd-a-transition,none)}");
737 }
738 var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" };
739 var Text = (0, import_element.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) {
740 const element = useRender({
741 render,
742 defaultTagName: "span",
743 ref,
744 props: mergeProps(props, {
745 className: clsx_default(
746 style_default.text,
747 global_css_defense_default.heading,
748 global_css_defense_default.p,
749 style_default[variant],
750 className
751 )
752 })
753 });
754 return element;
755 });
756
757 // packages/icons/build-module/icon/index.mjs
758 var import_element2 = __toESM(require_element(), 1);
759 var icon_default = (0, import_element2.forwardRef)(
760 ({ icon, size = 24, ...props }, ref) => {
761 return (0, import_element2.cloneElement)(icon, {
762 width: size,
763 height: size,
764 ...props,
765 ref
766 });
767 }
768 );
769
770 // packages/icons/build-module/library/arrow-up-left.mjs
771 var import_primitives = __toESM(require_primitives(), 1);
772 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
773 var arrow_up_left_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" }) });
774
775 // packages/icons/build-module/library/arrow-up-right.mjs
776 var import_primitives2 = __toESM(require_primitives(), 1);
777 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
778 var arrow_up_right_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" }) });
779
780 // packages/icons/build-module/library/check.mjs
781 var import_primitives3 = __toESM(require_primitives(), 1);
782 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
783 var check_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
784
785 // packages/icons/build-module/library/chevron-down-small.mjs
786 var import_primitives4 = __toESM(require_primitives(), 1);
787 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
788 var chevron_down_small_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "m15.99 10.889-3.988 3.418-3.988-3.418.976-1.14 3.012 2.582 3.012-2.581.976 1.139Z" }) });
789
790 // packages/icons/build-module/library/chevron-left-small.mjs
791 var import_primitives5 = __toESM(require_primitives(), 1);
792 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
793 var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) });
794
795 // packages/icons/build-module/library/chevron-left.mjs
796 var import_primitives6 = __toESM(require_primitives(), 1);
797 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
798 var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
799
800 // packages/icons/build-module/library/chevron-right-small.mjs
801 var import_primitives7 = __toESM(require_primitives(), 1);
802 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
803 var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) });
804
805 // packages/icons/build-module/library/chevron-right.mjs
806 var import_primitives8 = __toESM(require_primitives(), 1);
807 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
808 var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
809
810 // packages/icons/build-module/library/menu.mjs
811 var import_primitives9 = __toESM(require_primitives(), 1);
812 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
813 var menu_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) });
814
815 // packages/icons/build-module/library/search.mjs
816 var import_primitives10 = __toESM(require_primitives(), 1);
817 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
818 var search_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
819
820 // packages/icons/build-module/library/wordpress.mjs
821 var import_primitives11 = __toESM(require_primitives(), 1);
822 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
823 var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) });
824
825 // packages/ui/build-module/stack/stack.mjs
826 var import_element3 = __toESM(require_element(), 1);
827 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
828 function getRuntime2() {
829 const globalScope = globalThis;
830 if (globalScope.__wpStyleRuntime) {
831 return globalScope.__wpStyleRuntime;
832 }
833 globalScope.__wpStyleRuntime = {
834 documents: /* @__PURE__ */ new Map(),
835 styles: /* @__PURE__ */ new Map(),
836 injectedStyles: /* @__PURE__ */ new WeakMap()
837 };
838 if (typeof document !== "undefined") {
839 registerDocument2(document);
840 }
841 return globalScope.__wpStyleRuntime;
842 }
843 function documentContainsStyleHash2(targetDocument, hash) {
844 if (!targetDocument.head) {
845 return false;
846 }
847 for (const style of targetDocument.head.querySelectorAll(
848 `style[${STYLE_HASH_ATTRIBUTE2}]`
849 )) {
850 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
851 return true;
852 }
853 }
854 return false;
855 }
856 function injectStyle2(targetDocument, hash, css) {
857 if (!targetDocument.head) {
858 return;
859 }
860 const runtime = getRuntime2();
861 let injectedStyles = runtime.injectedStyles.get(targetDocument);
862 if (!injectedStyles) {
863 injectedStyles = /* @__PURE__ */ new Set();
864 runtime.injectedStyles.set(targetDocument, injectedStyles);
865 }
866 if (injectedStyles.has(hash)) {
867 return;
868 }
869 if (documentContainsStyleHash2(targetDocument, hash)) {
870 injectedStyles.add(hash);
871 return;
872 }
873 const style = targetDocument.createElement("style");
874 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
875 style.appendChild(targetDocument.createTextNode(css));
876 targetDocument.head.appendChild(style);
877 injectedStyles.add(hash);
878 }
879 function registerDocument2(targetDocument) {
880 const runtime = getRuntime2();
881 runtime.documents.set(
882 targetDocument,
883 (runtime.documents.get(targetDocument) ?? 0) + 1
884 );
885 for (const [hash, css] of runtime.styles) {
886 injectStyle2(targetDocument, hash, css);
887 }
888 return () => {
889 const count = runtime.documents.get(targetDocument);
890 if (count === void 0) {
891 return;
892 }
893 if (count <= 1) {
894 runtime.documents.delete(targetDocument);
895 return;
896 }
897 runtime.documents.set(targetDocument, count - 1);
898 };
899 }
900 function registerStyle2(hash, css) {
901 const runtime = getRuntime2();
902 runtime.styles.set(hash, css);
903 for (const targetDocument of runtime.documents.keys()) {
904 injectStyle2(targetDocument, hash, css);
905 }
906 }
907 if (typeof process === "undefined" || true) {
908 registerStyle2("b51ff41489", "@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}");
909 }
910 var style_default2 = { "stack": "_19ce0419607e1896__stack" };
911 var gapTokens = {
912 xs: "var(--wpds-dimension-gap-xs, 4px)",
913 sm: "var(--wpds-dimension-gap-sm, 8px)",
914 md: "var(--wpds-dimension-gap-md, 12px)",
915 lg: "var(--wpds-dimension-gap-lg, 16px)",
916 xl: "var(--wpds-dimension-gap-xl, 24px)",
917 "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
918 "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
919 };
920 var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
921 const style = {
922 gap: gap && gapTokens[gap],
923 alignItems: align,
924 justifyContent: justify,
925 flexDirection: direction,
926 flexWrap: wrap
927 };
928 const element = useRender({
929 render,
930 ref,
931 props: mergeProps(props, { style, className: style_default2.stack })
932 });
933 return element;
934 });
935
936 // packages/admin-ui/build-module/navigable-region/index.mjs
937 var import_element4 = __toESM(require_element(), 1);
938 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
939 var NavigableRegion = (0, import_element4.forwardRef)(
940 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
941 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
942 Tag,
943 {
944 ref,
945 className: clsx_default("admin-ui-navigable-region", className),
946 "aria-label": ariaLabel,
947 role: "region",
948 tabIndex: "-1",
949 ...props,
950 children
951 }
952 );
953 }
954 );
955 NavigableRegion.displayName = "NavigableRegion";
956 var navigable_region_default = NavigableRegion;
957
958 // packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs
959 var import_components = __toESM(require_components(), 1);
960 var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle");
961
962 // packages/admin-ui/build-module/page/header.mjs
963 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
964 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
965 function getRuntime3() {
966 const globalScope = globalThis;
967 if (globalScope.__wpStyleRuntime) {
968 return globalScope.__wpStyleRuntime;
969 }
970 globalScope.__wpStyleRuntime = {
971 documents: /* @__PURE__ */ new Map(),
972 styles: /* @__PURE__ */ new Map(),
973 injectedStyles: /* @__PURE__ */ new WeakMap()
974 };
975 if (typeof document !== "undefined") {
976 registerDocument3(document);
977 }
978 return globalScope.__wpStyleRuntime;
979 }
980 function documentContainsStyleHash3(targetDocument, hash) {
981 if (!targetDocument.head) {
982 return false;
983 }
984 for (const style of targetDocument.head.querySelectorAll(
985 `style[${STYLE_HASH_ATTRIBUTE3}]`
986 )) {
987 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
988 return true;
989 }
990 }
991 return false;
992 }
993 function injectStyle3(targetDocument, hash, css) {
994 if (!targetDocument.head) {
995 return;
996 }
997 const runtime = getRuntime3();
998 let injectedStyles = runtime.injectedStyles.get(targetDocument);
999 if (!injectedStyles) {
1000 injectedStyles = /* @__PURE__ */ new Set();
1001 runtime.injectedStyles.set(targetDocument, injectedStyles);
1002 }
1003 if (injectedStyles.has(hash)) {
1004 return;
1005 }
1006 if (documentContainsStyleHash3(targetDocument, hash)) {
1007 injectedStyles.add(hash);
1008 return;
1009 }
1010 const style = targetDocument.createElement("style");
1011 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
1012 style.appendChild(targetDocument.createTextNode(css));
1013 targetDocument.head.appendChild(style);
1014 injectedStyles.add(hash);
1015 }
1016 function registerDocument3(targetDocument) {
1017 const runtime = getRuntime3();
1018 runtime.documents.set(
1019 targetDocument,
1020 (runtime.documents.get(targetDocument) ?? 0) + 1
1021 );
1022 for (const [hash, css] of runtime.styles) {
1023 injectStyle3(targetDocument, hash, css);
1024 }
1025 return () => {
1026 const count = runtime.documents.get(targetDocument);
1027 if (count === void 0) {
1028 return;
1029 }
1030 if (count <= 1) {
1031 runtime.documents.delete(targetDocument);
1032 return;
1033 }
1034 runtime.documents.set(targetDocument, count - 1);
1035 };
1036 }
1037 function registerStyle3(hash, css) {
1038 const runtime = getRuntime3();
1039 runtime.styles.set(hash, css);
1040 for (const targetDocument of runtime.documents.keys()) {
1041 injectStyle3(targetDocument, hash, css);
1042 }
1043 }
1044 if (typeof process === "undefined" || true) {
1045 registerStyle3("aa9c241ccc", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral,#fcfcfc);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:calc(var(--wpds-dimension-base, 4px)*8)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:calc(var(--wpds-dimension-base, 4px)*6);width:calc(var(--wpds-dimension-base, 4px)*6);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-fg-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}");
1046 }
1047 var style_default3 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" };
1048 function Header({
1049 headingLevel = 1,
1050 breadcrumbs,
1051 badges,
1052 visual,
1053 title,
1054 subTitle,
1055 actions,
1056 showSidebarToggle = true
1057 }) {
1058 const HeadingTag = `h${headingLevel}`;
1059 return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Stack, { direction: "column", className: style_default3.header, children: [
1060 /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1061 Stack,
1062 {
1063 className: style_default3["header-content"],
1064 direction: "row",
1065 gap: "sm",
1066 justify: "space-between",
1067 children: [
1068 /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Stack, { direction: "row", gap: "sm", align: "center", justify: "start", children: [
1069 showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1070 SidebarToggleSlot,
1071 {
1072 bubblesVirtually: true,
1073 className: style_default3["sidebar-toggle-slot"]
1074 }
1075 ),
1076 visual && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1077 "div",
1078 {
1079 className: style_default3["header-visual"],
1080 "aria-hidden": "true",
1081 children: visual
1082 }
1083 ),
1084 title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1085 Text,
1086 {
1087 className: style_default3["header-title"],
1088 render: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(HeadingTag, {}),
1089 variant: "heading-lg",
1090 children: title
1091 }
1092 ),
1093 breadcrumbs,
1094 badges
1095 ] }),
1096 actions && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1097 Stack,
1098 {
1099 align: "center",
1100 className: style_default3["header-actions"],
1101 direction: "row",
1102 gap: "sm",
1103 children: actions
1104 }
1105 )
1106 ]
1107 }
1108 ),
1109 subTitle && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1110 Text,
1111 {
1112 render: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", {}),
1113 variant: "body-md",
1114 className: style_default3["header-subtitle"],
1115 children: subTitle
1116 }
1117 )
1118 ] });
1119 }
1120
1121 // packages/admin-ui/build-module/page/index.mjs
1122 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
1123 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
1124 function getRuntime4() {
1125 const globalScope = globalThis;
1126 if (globalScope.__wpStyleRuntime) {
1127 return globalScope.__wpStyleRuntime;
1128 }
1129 globalScope.__wpStyleRuntime = {
1130 documents: /* @__PURE__ */ new Map(),
1131 styles: /* @__PURE__ */ new Map(),
1132 injectedStyles: /* @__PURE__ */ new WeakMap()
1133 };
1134 if (typeof document !== "undefined") {
1135 registerDocument4(document);
1136 }
1137 return globalScope.__wpStyleRuntime;
1138 }
1139 function documentContainsStyleHash4(targetDocument, hash) {
1140 if (!targetDocument.head) {
1141 return false;
1142 }
1143 for (const style of targetDocument.head.querySelectorAll(
1144 `style[${STYLE_HASH_ATTRIBUTE4}]`
1145 )) {
1146 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
1147 return true;
1148 }
1149 }
1150 return false;
1151 }
1152 function injectStyle4(targetDocument, hash, css) {
1153 if (!targetDocument.head) {
1154 return;
1155 }
1156 const runtime = getRuntime4();
1157 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1158 if (!injectedStyles) {
1159 injectedStyles = /* @__PURE__ */ new Set();
1160 runtime.injectedStyles.set(targetDocument, injectedStyles);
1161 }
1162 if (injectedStyles.has(hash)) {
1163 return;
1164 }
1165 if (documentContainsStyleHash4(targetDocument, hash)) {
1166 injectedStyles.add(hash);
1167 return;
1168 }
1169 const style = targetDocument.createElement("style");
1170 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
1171 style.appendChild(targetDocument.createTextNode(css));
1172 targetDocument.head.appendChild(style);
1173 injectedStyles.add(hash);
1174 }
1175 function registerDocument4(targetDocument) {
1176 const runtime = getRuntime4();
1177 runtime.documents.set(
1178 targetDocument,
1179 (runtime.documents.get(targetDocument) ?? 0) + 1
1180 );
1181 for (const [hash, css] of runtime.styles) {
1182 injectStyle4(targetDocument, hash, css);
1183 }
1184 return () => {
1185 const count = runtime.documents.get(targetDocument);
1186 if (count === void 0) {
1187 return;
1188 }
1189 if (count <= 1) {
1190 runtime.documents.delete(targetDocument);
1191 return;
1192 }
1193 runtime.documents.set(targetDocument, count - 1);
1194 };
1195 }
1196 function registerStyle4(hash, css) {
1197 const runtime = getRuntime4();
1198 runtime.styles.set(hash, css);
1199 for (const targetDocument of runtime.documents.keys()) {
1200 injectStyle4(targetDocument, hash, css);
1201 }
1202 }
1203 if (typeof process === "undefined" || true) {
1204 registerStyle4("aa9c241ccc", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral,#fcfcfc);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:calc(var(--wpds-dimension-base, 4px)*8)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:calc(var(--wpds-dimension-base, 4px)*6);width:calc(var(--wpds-dimension-base, 4px)*6);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-fg-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}");
1205 }
1206 var style_default4 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" };
1207 function Page({
1208 headingLevel,
1209 breadcrumbs,
1210 badges,
1211 visual,
1212 title,
1213 subTitle,
1214 children,
1215 className,
1216 actions,
1217 ariaLabel,
1218 hasPadding = false,
1219 showSidebarToggle = true
1220 }) {
1221 const classes = clsx_default(style_default4.page, className);
1222 const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : "");
1223 return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [
1224 (title || breadcrumbs || badges || actions || visual) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1225 Header,
1226 {
1227 headingLevel,
1228 breadcrumbs,
1229 badges,
1230 visual,
1231 title,
1232 subTitle,
1233 actions,
1234 showSidebarToggle
1235 }
1236 ),
1237 hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1238 "div",
1239 {
1240 className: clsx_default(
1241 style_default4.content,
1242 style_default4["has-padding"]
1243 ),
1244 children
1245 }
1246 ) : children
1247 ] });
1248 }
1249 Page.SidebarToggleFill = SidebarToggleFill;
1250 var page_default = Page;
1251
1252 // packages/boot/build-module/components/app/router.mjs
1253 var import_data11 = __toESM(require_data(), 1);
1254 var import_core_data6 = __toESM(require_core_data(), 1);
1255 import {
1256 privateApis as routePrivateApis6
1257 } from "@wordpress/route";
1258
1259 // packages/boot/build-module/components/root/index.mjs
1260 var import_notices = __toESM(require_notices(), 1);
1261 var import_compose4 = __toESM(require_compose(), 1);
1262 var import_components15 = __toESM(require_components(), 1);
1263 import { privateApis as routePrivateApis5 } from "@wordpress/route";
1264 var import_element15 = __toESM(require_element(), 1);
1265 var import_i18n11 = __toESM(require_i18n(), 1);
1266
1267 // packages/boot/build-module/components/sidebar/index.mjs
1268 var import_components11 = __toESM(require_components(), 1);
1269 var import_data9 = __toESM(require_data(), 1);
1270 var import_i18n7 = __toESM(require_i18n(), 1);
1271
1272 // packages/boot/build-module/components/site-hub/index.mjs
1273 var import_data3 = __toESM(require_data(), 1);
1274 var import_components3 = __toESM(require_components(), 1);
1275 var import_i18n2 = __toESM(require_i18n(), 1);
1276 var import_core_data2 = __toESM(require_core_data(), 1);
1277 var import_html_entities = __toESM(require_html_entities(), 1);
1278 var import_keycodes = __toESM(require_keycodes(), 1);
1279 var import_commands = __toESM(require_commands(), 1);
1280 var import_url = __toESM(require_url(), 1);
1281
1282 // packages/boot/build-module/components/site-icon-link/index.mjs
1283 var import_components2 = __toESM(require_components(), 1);
1284 import { Link, privateApis as routePrivateApis } from "@wordpress/route";
1285
1286 // packages/boot/build-module/lock-unlock.mjs
1287 var import_private_apis = __toESM(require_private_apis(), 1);
1288 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
1289 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
1290 "@wordpress/boot"
1291 );
1292
1293 // packages/boot/build-module/components/site-icon/index.mjs
1294 var import_data = __toESM(require_data(), 1);
1295 var import_i18n = __toESM(require_i18n(), 1);
1296 var import_core_data = __toESM(require_core_data(), 1);
1297 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
1298 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='3ada0e3b8a']")) {
1299 const style = document.createElement("style");
1300 style.setAttribute("data-wp-hash", "3ada0e3b8a");
1301 style.appendChild(document.createTextNode(".boot-site-icon{display:flex}.boot-site-icon__icon{fill:var(--wpds-color-fg-content-neutral,#1e1e1e);height:32px;width:32px}.boot-site-icon__image{aspect-ratio:1/1;border-radius:var(--wpds-border-radius-md,4px);height:32px;object-fit:cover;width:32px}"));
1302 document.head.appendChild(style);
1303 }
1304 function SiteIcon({ className }) {
1305 const { isRequestingSite, siteIconUrl } = (0, import_data.useSelect)((select) => {
1306 const { getEntityRecord } = select(import_core_data.store);
1307 const siteData = getEntityRecord(
1308 "root",
1309 "__unstableBase",
1310 void 0
1311 );
1312 return {
1313 isRequestingSite: !siteData,
1314 siteIconUrl: siteData?.site_icon_url
1315 };
1316 }, []);
1317 let icon = null;
1318 if (isRequestingSite && !siteIconUrl) {
1319 icon = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "boot-site-icon__image" });
1320 } else {
1321 icon = siteIconUrl ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1322 "img",
1323 {
1324 className: "boot-site-icon__image",
1325 alt: (0, import_i18n.__)("Site Icon"),
1326 src: siteIconUrl
1327 }
1328 ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1329 icon_default,
1330 {
1331 className: "boot-site-icon__icon",
1332 icon: wordpress_default,
1333 size: 48
1334 }
1335 );
1336 }
1337 return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: clsx_default(className, "boot-site-icon"), children: icon });
1338 }
1339 var site_icon_default = SiteIcon;
1340
1341 // packages/boot/build-module/components/site-icon-link/index.mjs
1342 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
1343 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='5aacc86eea']")) {
1344 const style = document.createElement("style");
1345 style.setAttribute("data-wp-hash", "5aacc86eea");
1346 style.appendChild(document.createTextNode(".boot-site-icon-link{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);display:inline-flex;height:64px;justify-content:center;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-site-icon-link{transition:outline .1s ease-out}}.boot-site-icon-link:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}"));
1347 document.head.appendChild(style);
1348 }
1349 var { useCanGoBack, useRouter } = unlock(routePrivateApis);
1350 function SiteIconLink({
1351 to,
1352 isBackButton,
1353 ...props
1354 }) {
1355 const router = useRouter();
1356 const canGoBack = useCanGoBack();
1357 return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components2.Tooltip, { text: props["aria-label"], placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1358 Link,
1359 {
1360 to,
1361 "aria-label": props["aria-label"],
1362 className: "boot-site-icon-link",
1363 onClick: (event) => {
1364 if (canGoBack && isBackButton) {
1365 event.preventDefault();
1366 router.history.back();
1367 }
1368 },
1369 children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(site_icon_default, {})
1370 }
1371 ) });
1372 }
1373 var site_icon_link_default = SiteIconLink;
1374
1375 // packages/boot/build-module/store/index.mjs
1376 var import_data2 = __toESM(require_data(), 1);
1377
1378 // packages/boot/build-module/store/reducer.mjs
1379 var initialState = {
1380 menuItems: {},
1381 routes: [],
1382 dashboardLink: void 0
1383 };
1384 function reducer(state = initialState, action) {
1385 switch (action.type) {
1386 case "REGISTER_MENU_ITEM":
1387 return {
1388 ...state,
1389 menuItems: {
1390 ...state.menuItems,
1391 [action.id]: action.menuItem
1392 }
1393 };
1394 case "UPDATE_MENU_ITEM":
1395 return {
1396 ...state,
1397 menuItems: {
1398 ...state.menuItems,
1399 [action.id]: {
1400 ...state.menuItems[action.id],
1401 ...action.updates
1402 }
1403 }
1404 };
1405 case "REGISTER_ROUTE":
1406 return {
1407 ...state,
1408 routes: [...state.routes, action.route]
1409 };
1410 case "SET_DASHBOARD_LINK":
1411 return {
1412 ...state,
1413 dashboardLink: action.dashboardLink
1414 };
1415 }
1416 return state;
1417 }
1418
1419 // packages/boot/build-module/store/actions.mjs
1420 var actions_exports = {};
1421 __export(actions_exports, {
1422 registerMenuItem: () => registerMenuItem,
1423 registerRoute: () => registerRoute,
1424 setDashboardLink: () => setDashboardLink,
1425 updateMenuItem: () => updateMenuItem
1426 });
1427 function registerMenuItem(id, menuItem) {
1428 return {
1429 type: "REGISTER_MENU_ITEM",
1430 id,
1431 menuItem
1432 };
1433 }
1434 function updateMenuItem(id, updates) {
1435 return {
1436 type: "UPDATE_MENU_ITEM",
1437 id,
1438 updates
1439 };
1440 }
1441 function registerRoute(route) {
1442 return {
1443 type: "REGISTER_ROUTE",
1444 route
1445 };
1446 }
1447 function setDashboardLink(dashboardLink) {
1448 return {
1449 type: "SET_DASHBOARD_LINK",
1450 dashboardLink
1451 };
1452 }
1453
1454 // packages/boot/build-module/store/selectors.mjs
1455 var selectors_exports = {};
1456 __export(selectors_exports, {
1457 getDashboardLink: () => getDashboardLink,
1458 getMenuItems: () => getMenuItems,
1459 getRoutes: () => getRoutes
1460 });
1461 function getMenuItems(state) {
1462 return Object.values(state.menuItems);
1463 }
1464 function getRoutes(state) {
1465 return state.routes;
1466 }
1467 function getDashboardLink(state) {
1468 return state.dashboardLink;
1469 }
1470
1471 // packages/boot/build-module/store/index.mjs
1472 var STORE_NAME = "wordpress/boot";
1473 var store = (0, import_data2.createReduxStore)(STORE_NAME, {
1474 reducer,
1475 actions: actions_exports,
1476 selectors: selectors_exports
1477 });
1478 (0, import_data2.register)(store);
1479
1480 // packages/boot/build-module/components/site-hub/index.mjs
1481 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
1482 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='bc60675bd6']")) {
1483 const style = document.createElement("style");
1484 style.setAttribute("data-wp-hash", "bc60675bd6");
1485 style.appendChild(document.createTextNode(".boot-site-hub{align-items:center;background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);display:grid;flex-shrink:0;grid-template-columns:60px 1fr auto;padding-right:16px;position:sticky;top:0;z-index:1}.boot-site-hub__actions{flex-shrink:0}.boot-site-hub__title{align-items:center;display:flex;text-decoration:none}.boot-site-hub__title .components-external-link__contents{margin-inline-start:4px;max-width:140px;overflow:hidden;text-decoration:none}.boot-site-hub__title .components-external-link__icon{opacity:0;transition:opacity .1s ease-out}.boot-site-hub__title:hover .components-external-link__icon{opacity:1}@media not (prefers-reduced-motion){.boot-site-hub__title{transition:outline .1s ease-out}}.boot-site-hub__title:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.boot-site-hub__title-text{color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-size:13px;font-weight:499}.boot-site-hub__title-text,.boot-site-hub__url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.boot-site-hub__url{color:var(--wpds-color-fg-content-neutral-weak,#707070);font-size:12px}"));
1486 document.head.appendChild(style);
1487 }
1488 function SiteHub() {
1489 const { dashboardLink, homeUrl, siteTitle } = (0, import_data3.useSelect)((select) => {
1490 const { getEntityRecord } = select(import_core_data2.store);
1491 const _base = getEntityRecord(
1492 "root",
1493 "__unstableBase"
1494 );
1495 return {
1496 dashboardLink: select(store).getDashboardLink(),
1497 homeUrl: _base?.home,
1498 siteTitle: !_base?.name && !!_base?.url ? (0, import_url.filterURLForDisplay)(_base?.url) : _base?.name
1499 };
1500 }, []);
1501 const { open: openCommandCenter } = (0, import_data3.useDispatch)(import_commands.store);
1502 return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "boot-site-hub", children: [
1503 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1504 site_icon_link_default,
1505 {
1506 to: dashboardLink || "/",
1507 "aria-label": (0, import_i18n2.__)("Go to the Dashboard")
1508 }
1509 ),
1510 /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1511 import_components3.ExternalLink,
1512 {
1513 href: homeUrl ?? "/",
1514 className: "boot-site-hub__title",
1515 children: [
1516 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "boot-site-hub__title-text", children: siteTitle && (0, import_html_entities.decodeEntities)(siteTitle) }),
1517 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "boot-site-hub__url", children: (0, import_url.filterURLForDisplay)(homeUrl ?? "") })
1518 ]
1519 }
1520 ),
1521 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components3.__experimentalHStack, { className: "boot-site-hub__actions", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1522 import_components3.Button,
1523 {
1524 variant: "tertiary",
1525 icon: search_default,
1526 onClick: () => openCommandCenter(),
1527 size: "compact",
1528 label: (0, import_i18n2.__)("Open command palette"),
1529 shortcut: import_keycodes.displayShortcut.primary("k")
1530 }
1531 ) })
1532 ] });
1533 }
1534 var site_hub_default = SiteHub;
1535
1536 // packages/boot/build-module/components/navigation/index.mjs
1537 var import_element8 = __toESM(require_element(), 1);
1538 var import_data6 = __toESM(require_data(), 1);
1539
1540 // packages/boot/build-module/components/navigation/navigation-item/index.mjs
1541 var import_components6 = __toESM(require_components(), 1);
1542
1543 // packages/boot/build-module/components/navigation/router-link-item.mjs
1544 var import_element5 = __toESM(require_element(), 1);
1545 var import_components4 = __toESM(require_components(), 1);
1546 import { privateApis as routePrivateApis2 } from "@wordpress/route";
1547 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
1548 var { createLink } = unlock(routePrivateApis2);
1549 function AnchorOnlyItem(props, forwardedRef) {
1550 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components4.__experimentalItem, { as: "a", ref: forwardedRef, ...props });
1551 }
1552 var RouterLinkItem = createLink((0, import_element5.forwardRef)(AnchorOnlyItem));
1553 var router_link_item_default = RouterLinkItem;
1554
1555 // packages/boot/build-module/components/navigation/items.mjs
1556 var import_element6 = __toESM(require_element(), 1);
1557 var import_components5 = __toESM(require_components(), 1);
1558 var import_primitives12 = __toESM(require_primitives(), 1);
1559 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
1560 function isSvg(element) {
1561 return (0, import_element6.isValidElement)(element) && (element.type === import_primitives12.SVG || element.type === "svg");
1562 }
1563 function wrapIcon(icon, shouldShowPlaceholder = true) {
1564 if (isSvg(icon)) {
1565 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components5.Icon, { icon });
1566 }
1567 if (typeof icon === "string" && icon.startsWith("dashicons-")) {
1568 const iconKey = icon.replace(
1569 /^dashicons-/,
1570 ""
1571 );
1572 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1573 import_components5.Dashicon,
1574 {
1575 style: { padding: "2px" },
1576 icon: iconKey,
1577 "aria-hidden": "true"
1578 }
1579 );
1580 }
1581 if (typeof icon === "string" && icon.startsWith("data:")) {
1582 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1583 "img",
1584 {
1585 src: icon,
1586 alt: "",
1587 "aria-hidden": "true",
1588 style: {
1589 width: "20px",
1590 height: "20px",
1591 display: "block",
1592 padding: "2px"
1593 }
1594 }
1595 );
1596 }
1597 if (icon) {
1598 return icon;
1599 }
1600 if (shouldShowPlaceholder) {
1601 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1602 "div",
1603 {
1604 style: { width: "24px", height: "24px" },
1605 "aria-hidden": "true"
1606 }
1607 );
1608 }
1609 return null;
1610 }
1611
1612 // packages/boot/build-module/components/navigation/navigation-item/index.mjs
1613 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
1614 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='26b8e27d3f']")) {
1615 const style = document.createElement("style");
1616 style.setAttribute("data-wp-hash", "26b8e27d3f");
1617 style.appendChild(document.createTextNode('.boot-navigation-item.components-item{align-items:center;border:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.boot-dropdown-item__children .boot-navigation-item.components-item{min-height:24px}.boot-navigation-item.components-item{border-radius:var(--wpds-border-radius-sm,2px)}.boot-navigation-item.components-item.active,.boot-navigation-item.components-item:focus,.boot-navigation-item.components-item:hover,.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9))}.boot-navigation-item.components-item.active{font-weight:499}.boot-navigation-item.components-item svg:last-child{padding:4px}.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));font-weight:499}.boot-navigation-item.components-item:focus-visible{transform:translateZ(0)}.boot-navigation-item.components-item.with-suffix{padding-right:16px}'));
1618 document.head.appendChild(style);
1619 }
1620 function NavigationItem({
1621 className,
1622 icon,
1623 shouldShowPlaceholder = true,
1624 children,
1625 to
1626 }) {
1627 const isExternal = !String(
1628 new URL(to, window.location.origin)
1629 ).startsWith(window.location.origin);
1630 const content = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_components6.__experimentalHStack, { justify: "flex-start", spacing: 2, style: { flexGrow: "1" }, children: [
1631 wrapIcon(icon, shouldShowPlaceholder),
1632 /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components6.FlexBlock, { children })
1633 ] });
1634 if (isExternal) {
1635 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1636 import_components6.__experimentalItem,
1637 {
1638 as: "a",
1639 href: to,
1640 className: clsx_default("boot-navigation-item", className),
1641 children: content
1642 }
1643 );
1644 }
1645 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1646 router_link_item_default,
1647 {
1648 to,
1649 className: clsx_default("boot-navigation-item", className),
1650 children: content
1651 }
1652 );
1653 }
1654
1655 // packages/boot/build-module/components/navigation/drilldown-item/index.mjs
1656 var import_components7 = __toESM(require_components(), 1);
1657 var import_i18n3 = __toESM(require_i18n(), 1);
1658 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
1659 function DrilldownItem({
1660 className,
1661 id,
1662 icon,
1663 shouldShowPlaceholder = true,
1664 children,
1665 onNavigate
1666 }) {
1667 const handleClick = (e) => {
1668 e.preventDefault();
1669 onNavigate({ id, direction: "forward" });
1670 };
1671 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1672 import_components7.__experimentalItem,
1673 {
1674 className: clsx_default("boot-navigation-item", className),
1675 onClick: handleClick,
1676 children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1677 import_components7.__experimentalHStack,
1678 {
1679 justify: "flex-start",
1680 spacing: 2,
1681 style: { flexGrow: "1" },
1682 children: [
1683 wrapIcon(icon, shouldShowPlaceholder),
1684 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components7.FlexBlock, { children }),
1685 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1686 import_components7.Icon,
1687 {
1688 icon: (0, import_i18n3.isRTL)() ? chevron_left_small_default : chevron_right_small_default
1689 }
1690 )
1691 ]
1692 }
1693 )
1694 }
1695 );
1696 }
1697
1698 // packages/boot/build-module/components/navigation/dropdown-item/index.mjs
1699 var import_components8 = __toESM(require_components(), 1);
1700 var import_compose = __toESM(require_compose(), 1);
1701 var import_data4 = __toESM(require_data(), 1);
1702 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
1703 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='608eff82f3']")) {
1704 const style = document.createElement("style");
1705 style.setAttribute("data-wp-hash", "608eff82f3");
1706 style.appendChild(document.createTextNode(".boot-dropdown-item__children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}.boot-dropdown-item__chevron.is-up{transform:rotate(180deg)}"));
1707 document.head.appendChild(style);
1708 }
1709 var ANIMATION_DURATION = 0.2;
1710 function DropdownItem({
1711 className,
1712 id,
1713 icon,
1714 children,
1715 isExpanded,
1716 onToggle
1717 }) {
1718 const menuItems = (0, import_data4.useSelect)(
1719 (select) => (
1720 // @ts-ignore
1721 select(STORE_NAME).getMenuItems()
1722 ),
1723 []
1724 );
1725 const items = menuItems.filter((item) => item.parent === id);
1726 const disableMotion = (0, import_compose.useReducedMotion)();
1727 return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "boot-dropdown-item", children: [
1728 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1729 import_components8.__experimentalItem,
1730 {
1731 className: clsx_default("boot-navigation-item", className),
1732 onClick: (e) => {
1733 e.preventDefault();
1734 e.stopPropagation();
1735 onToggle();
1736 },
1737 onMouseDown: (e) => e.preventDefault(),
1738 children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1739 import_components8.__experimentalHStack,
1740 {
1741 justify: "flex-start",
1742 spacing: 2,
1743 style: { flexGrow: "1" },
1744 children: [
1745 wrapIcon(icon, false),
1746 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.FlexBlock, { children }),
1747 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1748 import_components8.Icon,
1749 {
1750 icon: chevron_down_small_default,
1751 className: clsx_default("boot-dropdown-item__chevron", {
1752 "is-up": isExpanded
1753 })
1754 }
1755 )
1756 ]
1757 }
1758 )
1759 }
1760 ),
1761 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.__unstableAnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1762 import_components8.__unstableMotion.div,
1763 {
1764 initial: { height: 0 },
1765 animate: { height: "auto" },
1766 exit: { height: 0 },
1767 transition: {
1768 type: "tween",
1769 duration: disableMotion ? 0 : ANIMATION_DURATION,
1770 ease: "easeOut"
1771 },
1772 className: "boot-dropdown-item__children",
1773 children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1774 NavigationItem,
1775 {
1776 to: item.to,
1777 shouldShowPlaceholder: false,
1778 children: item.label
1779 },
1780 index
1781 ))
1782 }
1783 ) })
1784 ] });
1785 }
1786
1787 // packages/boot/build-module/components/navigation/navigation-screen/index.mjs
1788 var import_components9 = __toESM(require_components(), 1);
1789 var import_i18n4 = __toESM(require_i18n(), 1);
1790 var import_compose2 = __toESM(require_compose(), 1);
1791 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
1792 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c5e42e1495']")) {
1793 const style = document.createElement("style");
1794 style.setAttribute("data-wp-hash", "c5e42e1495");
1795 style.appendChild(document.createTextNode(".boot-navigation-screen{padding-block-end:4px}.boot-navigation-screen .components-text{color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.boot-navigation-screen__title-icon{padding:12px 16px 8px;position:sticky;top:0}.boot-navigation-screen__title{flex-grow:1;overflow-wrap:break-word}.boot-navigation-screen__title.boot-navigation-screen__title,.boot-navigation-screen__title.boot-navigation-screen__title .boot-navigation-screen__title{color:var(--wpds-color-fg-content-neutral,#1e1e1e);line-height:32px}.boot-navigation-screen__actions{display:flex;flex-shrink:0}"));
1796 document.head.appendChild(style);
1797 }
1798 var ANIMATION_DURATION2 = 0.3;
1799 var slideVariants = {
1800 initial: (direction) => ({
1801 x: direction === "forward" ? 100 : -100,
1802 opacity: 0
1803 }),
1804 animate: {
1805 x: 0,
1806 opacity: 1
1807 },
1808 exit: (direction) => ({
1809 x: direction === "forward" ? 100 : -100,
1810 opacity: 0
1811 })
1812 };
1813 function NavigationScreen({
1814 isRoot,
1815 title,
1816 actions,
1817 content,
1818 description,
1819 animationDirection,
1820 backMenuItem,
1821 backButtonRef,
1822 navigationKey,
1823 onNavigate
1824 }) {
1825 const icon = (0, import_i18n4.isRTL)() ? chevron_right_default : chevron_left_default;
1826 const disableMotion = (0, import_compose2.useReducedMotion)();
1827 const handleBackClick = (e) => {
1828 e.preventDefault();
1829 onNavigate({ id: backMenuItem, direction: "backward" });
1830 };
1831 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1832 "div",
1833 {
1834 className: "boot-navigation-screen",
1835 style: {
1836 overflow: "hidden",
1837 position: "relative",
1838 display: "grid",
1839 gridTemplateColumns: "1fr",
1840 gridTemplateRows: "1fr"
1841 },
1842 children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.__unstableAnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1843 import_components9.__unstableMotion.div,
1844 {
1845 custom: animationDirection,
1846 variants: slideVariants,
1847 initial: "initial",
1848 animate: "animate",
1849 exit: "exit",
1850 transition: {
1851 type: "tween",
1852 duration: disableMotion ? 0 : ANIMATION_DURATION2,
1853 ease: [0.33, 0, 0, 1]
1854 },
1855 style: {
1856 width: "100%",
1857 gridColumn: "1",
1858 gridRow: "1"
1859 },
1860 children: [
1861 /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1862 import_components9.__experimentalHStack,
1863 {
1864 spacing: 2,
1865 className: "boot-navigation-screen__title-icon",
1866 children: [
1867 !isRoot && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1868 import_components9.Button,
1869 {
1870 ref: backButtonRef,
1871 icon,
1872 onClick: handleBackClick,
1873 label: (0, import_i18n4.__)("Back"),
1874 size: "small",
1875 variant: "tertiary"
1876 }
1877 ),
1878 /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1879 import_components9.__experimentalHeading,
1880 {
1881 className: "boot-navigation-screen__title",
1882 level: 1,
1883 size: "15px",
1884 children: title
1885 }
1886 ),
1887 actions && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "boot-navigation-screen__actions", children: actions })
1888 ]
1889 }
1890 ),
1891 description && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "boot-navigation-screen__description", children: description }),
1892 content
1893 ]
1894 },
1895 navigationKey
1896 ) })
1897 }
1898 );
1899 }
1900
1901 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs
1902 var import_element7 = __toESM(require_element(), 1);
1903 var import_data5 = __toESM(require_data(), 1);
1904 import { privateApis as routePrivateApis3 } from "@wordpress/route";
1905
1906 // packages/boot/build-module/components/navigation/path-matching.mjs
1907 var isValidParentPath = (currentPath, menuPath) => {
1908 if (!menuPath || menuPath === currentPath) {
1909 return false;
1910 }
1911 const normalizePath = (path) => {
1912 const normalized = path.startsWith("/") ? path : "/" + path;
1913 return normalized.endsWith("/") && normalized.length > 1 ? normalized.slice(0, -1) : normalized;
1914 };
1915 const normalizedCurrent = normalizePath(currentPath);
1916 const normalizedMenu = normalizePath(menuPath);
1917 return normalizedCurrent.startsWith(normalizedMenu) && (normalizedCurrent[normalizedMenu.length] === "/" || normalizedMenu === "/");
1918 };
1919 var findClosestMenuItem = (currentPath, menuItems) => {
1920 const exactMatch = menuItems.find((item) => item.to === currentPath);
1921 if (exactMatch) {
1922 return exactMatch;
1923 }
1924 let bestMatch = null;
1925 let bestPathLength = 0;
1926 for (const item of menuItems) {
1927 if (!item.to) {
1928 continue;
1929 }
1930 if (isValidParentPath(currentPath, item.to)) {
1931 if (item.to.length > bestPathLength) {
1932 bestMatch = item;
1933 bestPathLength = item.to.length;
1934 }
1935 }
1936 }
1937 return bestMatch;
1938 };
1939 var findDrilldownParent = (id, menuItems) => {
1940 if (!id) {
1941 return void 0;
1942 }
1943 const currentItem = menuItems.find((item) => item.id === id);
1944 if (!currentItem) {
1945 return void 0;
1946 }
1947 if (currentItem.parent) {
1948 const parentItem = menuItems.find(
1949 (item) => item.id === currentItem.parent
1950 );
1951 if (parentItem?.parent_type === "drilldown") {
1952 return parentItem.id;
1953 }
1954 if (parentItem) {
1955 return findDrilldownParent(parentItem.id, menuItems);
1956 }
1957 }
1958 return void 0;
1959 };
1960 var findDropdownParent = (id, menuItems) => {
1961 if (!id) {
1962 return void 0;
1963 }
1964 const currentItem = menuItems.find((item) => item.id === id);
1965 if (!currentItem) {
1966 return void 0;
1967 }
1968 if (currentItem.parent) {
1969 const parentItem = menuItems.find(
1970 (item) => item.id === currentItem.parent
1971 );
1972 if (parentItem?.parent_type === "dropdown") {
1973 return parentItem.id;
1974 }
1975 }
1976 return void 0;
1977 };
1978
1979 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs
1980 var { useRouter: useRouter2, useMatches } = unlock(routePrivateApis3);
1981 function useSidebarParent() {
1982 const matches = useMatches();
1983 const router = useRouter2();
1984 const menuItems = (0, import_data5.useSelect)(
1985 (select) => (
1986 // @ts-ignore
1987 select(STORE_NAME).getMenuItems()
1988 ),
1989 []
1990 );
1991 const currentPath = matches[matches.length - 1].pathname.slice(
1992 router.options.basepath?.length ?? 0
1993 );
1994 const currentMenuItem = findClosestMenuItem(currentPath, menuItems);
1995 const [parentId, setParentId] = (0, import_element7.useState)(
1996 findDrilldownParent(currentMenuItem?.id, menuItems)
1997 );
1998 const [parentDropdownId, setParentDropdownId] = (0, import_element7.useState)(findDropdownParent(currentMenuItem?.id, menuItems));
1999 (0, import_element7.useEffect)(() => {
2000 const matchedMenuItem = findClosestMenuItem(currentPath, menuItems);
2001 const updatedParentId = findDrilldownParent(
2002 matchedMenuItem?.id,
2003 menuItems
2004 );
2005 const updatedDropdownParent = findDropdownParent(
2006 matchedMenuItem?.id,
2007 menuItems
2008 );
2009 setParentId(updatedParentId);
2010 setParentDropdownId(updatedDropdownParent);
2011 }, [currentPath, menuItems]);
2012 return [
2013 parentId,
2014 setParentId,
2015 parentDropdownId,
2016 setParentDropdownId
2017 ];
2018 }
2019
2020 // packages/boot/build-module/components/navigation/index.mjs
2021 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
2022 function Navigation() {
2023 const backButtonRef = (0, import_element8.useRef)(null);
2024 const [animationDirection, setAnimationDirection] = (0, import_element8.useState)(null);
2025 const [parentId, setParentId, parentDropdownId, setParentDropdownId] = useSidebarParent();
2026 const menuItems = (0, import_data6.useSelect)(
2027 (select) => (
2028 // @ts-ignore
2029 select(STORE_NAME).getMenuItems()
2030 ),
2031 []
2032 );
2033 const parent = (0, import_element8.useMemo)(
2034 () => menuItems.find((item) => item.id === parentId),
2035 [menuItems, parentId]
2036 );
2037 const navigationKey = parent ? `drilldown-${parent.id}` : "root";
2038 const handleNavigate = ({
2039 id,
2040 direction
2041 }) => {
2042 setAnimationDirection(direction);
2043 setParentId(id);
2044 };
2045 const handleDropdownToggle = (dropdownId) => {
2046 setParentDropdownId(
2047 parentDropdownId === dropdownId ? void 0 : dropdownId
2048 );
2049 };
2050 const items = (0, import_element8.useMemo)(
2051 () => menuItems.filter((item) => item.parent === parentId),
2052 [menuItems, parentId]
2053 );
2054 const hasRealIcons = items.some((item) => !!item.icon);
2055 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2056 NavigationScreen,
2057 {
2058 isRoot: !parent,
2059 title: parent ? parent.label : "",
2060 backMenuItem: parent?.parent,
2061 backButtonRef,
2062 animationDirection: animationDirection || void 0,
2063 navigationKey,
2064 onNavigate: handleNavigate,
2065 content: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: items.map((item) => {
2066 if (item.parent_type === "dropdown") {
2067 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2068 DropdownItem,
2069 {
2070 id: item.id,
2071 className: "boot-navigation-item",
2072 icon: item.icon,
2073 shouldShowPlaceholder: hasRealIcons,
2074 isExpanded: parentDropdownId === item.id,
2075 onToggle: () => handleDropdownToggle(item.id),
2076 children: item.label
2077 },
2078 item.id
2079 );
2080 }
2081 if (item.parent_type === "drilldown") {
2082 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2083 DrilldownItem,
2084 {
2085 id: item.id,
2086 icon: item.icon,
2087 shouldShowPlaceholder: hasRealIcons,
2088 onNavigate: handleNavigate,
2089 children: item.label
2090 },
2091 item.id
2092 );
2093 }
2094 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2095 NavigationItem,
2096 {
2097 to: item.to,
2098 icon: item.icon,
2099 shouldShowPlaceholder: hasRealIcons,
2100 children: item.label
2101 },
2102 item.id
2103 );
2104 }) })
2105 }
2106 );
2107 }
2108 var navigation_default = Navigation;
2109
2110 // packages/boot/build-module/components/save-button/index.mjs
2111 var import_element10 = __toESM(require_element(), 1);
2112 var import_data8 = __toESM(require_data(), 1);
2113 var import_i18n6 = __toESM(require_i18n(), 1);
2114 var import_core_data4 = __toESM(require_core_data(), 1);
2115 var import_keycodes2 = __toESM(require_keycodes(), 1);
2116 var import_editor2 = __toESM(require_editor(), 1);
2117 var import_components10 = __toESM(require_components(), 1);
2118
2119 // packages/boot/build-module/components/save-panel/use-save-shortcut.mjs
2120 var import_element9 = __toESM(require_element(), 1);
2121 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
2122 var import_i18n5 = __toESM(require_i18n(), 1);
2123 var import_data7 = __toESM(require_data(), 1);
2124 var import_core_data3 = __toESM(require_core_data(), 1);
2125 var import_editor = __toESM(require_editor(), 1);
2126 var shortcutName = "core/boot/save";
2127 function useSaveShortcut({
2128 openSavePanel
2129 }) {
2130 const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0, import_data7.useSelect)(import_core_data3.store);
2131 const { hasNonPostEntityChanges, isPostSavingLocked } = (0, import_data7.useSelect)(import_editor.store);
2132 const { savePost } = (0, import_data7.useDispatch)(import_editor.store);
2133 const { registerShortcut, unregisterShortcut } = (0, import_data7.useDispatch)(
2134 import_keyboard_shortcuts.store
2135 );
2136 (0, import_element9.useEffect)(() => {
2137 registerShortcut({
2138 name: shortcutName,
2139 category: "global",
2140 description: (0, import_i18n5.__)("Save your changes."),
2141 keyCombination: {
2142 modifier: "primary",
2143 character: "s"
2144 }
2145 });
2146 return () => {
2147 unregisterShortcut(shortcutName);
2148 };
2149 }, [registerShortcut, unregisterShortcut]);
2150 (0, import_keyboard_shortcuts.useShortcut)(shortcutName, (event) => {
2151 event.preventDefault();
2152 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
2153 const hasDirtyEntities = !!dirtyEntityRecords.length;
2154 const isSaving = dirtyEntityRecords.some(
2155 (record) => isSavingEntityRecord(record.kind, record.name, record.key)
2156 );
2157 if (!hasDirtyEntities || isSaving) {
2158 return;
2159 }
2160 if (hasNonPostEntityChanges()) {
2161 openSavePanel();
2162 } else if (!isPostSavingLocked()) {
2163 savePost();
2164 }
2165 });
2166 }
2167
2168 // packages/boot/build-module/components/save-button/index.mjs
2169 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
2170 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='294e36b777']")) {
2171 const style = document.createElement("style");
2172 style.setAttribute("data-wp-hash", "294e36b777");
2173 style.appendChild(document.createTextNode(".boot-save-button{width:100%}"));
2174 document.head.appendChild(style);
2175 }
2176 function SaveButton() {
2177 const [isSaveViewOpen, setIsSaveViewOpened] = (0, import_element10.useState)(false);
2178 const { isSaving, dirtyEntityRecordsCount } = (0, import_data8.useSelect)((select) => {
2179 const { isSavingEntityRecord, __experimentalGetDirtyEntityRecords } = select(import_core_data4.store);
2180 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
2181 return {
2182 isSaving: dirtyEntityRecords.some(
2183 (record) => isSavingEntityRecord(record.kind, record.name, record.key)
2184 ),
2185 dirtyEntityRecordsCount: dirtyEntityRecords.length
2186 };
2187 }, []);
2188 const [showSavedState, setShowSavedState] = (0, import_element10.useState)(false);
2189 (0, import_element10.useEffect)(() => {
2190 if (isSaving) {
2191 setShowSavedState(true);
2192 }
2193 }, [isSaving]);
2194 const hasChanges = dirtyEntityRecordsCount > 0;
2195 (0, import_element10.useEffect)(() => {
2196 if (!isSaving && hasChanges) {
2197 setShowSavedState(false);
2198 }
2199 }, [isSaving, hasChanges]);
2200 function hideSavedState() {
2201 if (showSavedState) {
2202 setShowSavedState(false);
2203 }
2204 }
2205 const shouldShowButton = hasChanges || showSavedState;
2206 useSaveShortcut({ openSavePanel: () => setIsSaveViewOpened(true) });
2207 if (!shouldShowButton) {
2208 return null;
2209 }
2210 const isInSavedState = showSavedState && !hasChanges;
2211 const disabled = isSaving || isInSavedState;
2212 const getLabel = () => {
2213 if (isInSavedState) {
2214 return (0, import_i18n6.__)("Saved");
2215 }
2216 return (0, import_i18n6.sprintf)(
2217 // translators: %d: number of unsaved changes (number).
2218 (0, import_i18n6._n)(
2219 "Review %d change\u2026",
2220 "Review %d changes\u2026",
2221 dirtyEntityRecordsCount
2222 ),
2223 dirtyEntityRecordsCount
2224 );
2225 };
2226 const label = getLabel();
2227 return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
2228 /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2229 import_components10.Tooltip,
2230 {
2231 text: hasChanges ? label : void 0,
2232 shortcut: import_keycodes2.displayShortcut.primary("s"),
2233 children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2234 import_components10.Button,
2235 {
2236 variant: "primary",
2237 size: "compact",
2238 onClick: () => setIsSaveViewOpened(true),
2239 onBlur: hideSavedState,
2240 disabled,
2241 accessibleWhenDisabled: true,
2242 isBusy: isSaving,
2243 "aria-keyshortcuts": import_keycodes2.rawShortcut.primary("s"),
2244 className: "boot-save-button",
2245 icon: isInSavedState ? check_default : void 0,
2246 children: label
2247 }
2248 )
2249 }
2250 ),
2251 isSaveViewOpen && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2252 import_components10.Modal,
2253 {
2254 title: (0, import_i18n6.__)("Review changes"),
2255 onRequestClose: () => setIsSaveViewOpened(false),
2256 size: "small",
2257 children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2258 import_editor2.EntitiesSavedStates,
2259 {
2260 close: () => setIsSaveViewOpened(false),
2261 variant: "inline"
2262 }
2263 )
2264 }
2265 )
2266 ] });
2267 }
2268
2269 // packages/boot/build-module/components/sidebar/index.mjs
2270 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
2271 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='1f27eae1b9']")) {
2272 const style = document.createElement("style");
2273 style.setAttribute("data-wp-hash", "1f27eae1b9");
2274 style.appendChild(document.createTextNode(".boot-sidebar__scrollable{display:flex;flex-direction:column;height:100%;overflow:auto;position:relative}.boot-sidebar__content{contain:content;flex-grow:1;position:relative}.boot-sidebar__footer{padding:16px 8px 8px 16px}.boot-sidebar__back-button{margin:8px 12px}"));
2275 document.head.appendChild(style);
2276 }
2277 function DashboardBackButton() {
2278 const dashboardLink = (0, import_data9.useSelect)(
2279 (select) => select(store).getDashboardLink(),
2280 []
2281 );
2282 return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2283 import_components11.Button,
2284 {
2285 __next40pxDefaultSize: true,
2286 className: "boot-sidebar__back-button",
2287 href: dashboardLink || "/",
2288 icon: (0, import_i18n7.isRTL)() ? chevron_right_default : chevron_left_default,
2289 label: (0, import_i18n7.__)("Go to the Dashboard"),
2290 children: (0, import_i18n7.__)("Dashboard")
2291 }
2292 );
2293 }
2294 function Sidebar() {
2295 const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
2296 return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "boot-sidebar__scrollable", children: [
2297 hasAdminBarInEditor ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DashboardBackButton, {}) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(site_hub_default, {}),
2298 /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "boot-sidebar__content", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(navigation_default, {}) }),
2299 /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "boot-sidebar__footer", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SaveButton, {}) })
2300 ] });
2301 }
2302
2303 // packages/boot/build-module/components/save-panel/index.mjs
2304 var import_element11 = __toESM(require_element(), 1);
2305 var import_components12 = __toESM(require_components(), 1);
2306 var import_editor3 = __toESM(require_editor(), 1);
2307 var import_i18n8 = __toESM(require_i18n(), 1);
2308 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
2309 function SavePanel() {
2310 const [isOpen, setIsOpen] = (0, import_element11.useState)(false);
2311 useSaveShortcut({
2312 openSavePanel: () => setIsOpen(true)
2313 });
2314 if (!isOpen) {
2315 return false;
2316 }
2317 return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2318 import_components12.Modal,
2319 {
2320 className: "edit-site-save-panel__modal",
2321 onRequestClose: () => setIsOpen(false),
2322 title: (0, import_i18n8.__)("Review changes"),
2323 size: "small",
2324 children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2325 import_editor3.EntitiesSavedStates,
2326 {
2327 close: () => setIsOpen(false),
2328 variant: "inline"
2329 }
2330 )
2331 }
2332 );
2333 }
2334
2335 // packages/boot/build-module/components/canvas-renderer/index.mjs
2336 var import_element13 = __toESM(require_element(), 1);
2337
2338 // packages/boot/build-module/components/canvas/index.mjs
2339 var import_element12 = __toESM(require_element(), 1);
2340 var import_components14 = __toESM(require_components(), 1);
2341 import { useNavigate } from "@wordpress/route";
2342
2343 // packages/boot/build-module/components/canvas/back-button.mjs
2344 var import_components13 = __toESM(require_components(), 1);
2345 var import_compose3 = __toESM(require_compose(), 1);
2346 var import_i18n9 = __toESM(require_i18n(), 1);
2347 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
2348 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c8750e18d1']")) {
2349 const style = document.createElement("style");
2350 style.setAttribute("data-wp-hash", "c8750e18d1");
2351 style.appendChild(document.createTextNode(".boot-canvas-back-button{height:64px;left:0;position:absolute;top:0;width:64px;z-index:100}.boot-canvas-back-button__container{height:100%;position:relative;width:100%}.boot-canvas-back-button__link.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);border-radius:0;display:inline-flex;height:64px;justify-content:center;padding:0;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-canvas-back-button__link.components-button{transition:outline .1s ease-out}}.boot-canvas-back-button__link.components-button:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.boot-canvas-back-button__icon{align-items:center;background-color:#ccc;display:flex;height:64px;justify-content:center;left:0;pointer-events:none;position:absolute;top:0;width:64px}.boot-canvas-back-button__icon svg{fill:currentColor}.boot-canvas-back-button__icon.has-site-icon{-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px);background-color:#fff9}.interface-interface-skeleton__header{margin-top:0!important}"));
2352 document.head.appendChild(style);
2353 }
2354 var toggleHomeIconVariants = {
2355 edit: {
2356 opacity: 0,
2357 scale: 0.2
2358 },
2359 hover: {
2360 opacity: 1,
2361 scale: 1,
2362 clipPath: "inset( 22% round 2px )"
2363 }
2364 };
2365 function BootBackButton({ length }) {
2366 const disableMotion = (0, import_compose3.useReducedMotion)();
2367 const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
2368 const handleBack = () => {
2369 window.history.back();
2370 };
2371 if (length > 1) {
2372 return null;
2373 }
2374 const transition = {
2375 duration: disableMotion ? 0 : 0.3
2376 };
2377 const arrowIcon = (0, import_i18n9.isRTL)() ? arrow_up_right_default : arrow_up_left_default;
2378 return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2379 import_components13.__unstableMotion.div,
2380 {
2381 className: "boot-canvas-back-button",
2382 animate: "edit",
2383 initial: "edit",
2384 whileHover: "hover",
2385 whileTap: "tap",
2386 transition,
2387 children: [
2388 /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2389 import_components13.Button,
2390 {
2391 className: "boot-canvas-back-button__link",
2392 onClick: handleBack,
2393 "aria-label": (0, import_i18n9.__)("Go back"),
2394 __next40pxDefaultSize: true,
2395 children: !hasAdminBarInEditor && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(site_icon_default, {})
2396 }
2397 ),
2398 hasAdminBarInEditor ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "boot-canvas-back-button__icon", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Icon, { icon: arrowIcon }) }) : (
2399 /* Overlay arrow that appears on hover */
2400 /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2401 import_components13.__unstableMotion.div,
2402 {
2403 className: "boot-canvas-back-button__icon",
2404 variants: toggleHomeIconVariants,
2405 children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Icon, { icon: arrowIcon })
2406 }
2407 )
2408 )
2409 ]
2410 }
2411 );
2412 }
2413
2414 // packages/boot/build-module/components/canvas/index.mjs
2415 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
2416 function Canvas({ canvas }) {
2417 const [Editor, setEditor] = (0, import_element12.useState)(null);
2418 const navigate = useNavigate();
2419 (0, import_element12.useEffect)(() => {
2420 import("@wordpress/lazy-editor").then((module) => {
2421 setEditor(() => module.Editor);
2422 }).catch((error) => {
2423 console.error("Failed to load lazy editor:", error);
2424 });
2425 }, []);
2426 if (!Editor) {
2427 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2428 "div",
2429 {
2430 style: {
2431 display: "flex",
2432 justifyContent: "center",
2433 alignItems: "center",
2434 height: "100%",
2435 padding: "2rem"
2436 },
2437 children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components14.Spinner, {})
2438 }
2439 );
2440 }
2441 const backButton = !canvas.isPreview ? ({ length }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(BootBackButton, { length }) : void 0;
2442 return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { style: { height: "100%", position: "relative" }, children: [
2443 /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2444 "div",
2445 {
2446 style: { height: "100%" },
2447 inert: canvas.isPreview ? "true" : void 0,
2448 children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2449 Editor,
2450 {
2451 postType: canvas.postType,
2452 postId: canvas.postId,
2453 settings: {
2454 isPreviewMode: canvas.isPreview,
2455 styles: canvas.isPreview ? [{ css: "body{min-height:100vh;}" }] : []
2456 },
2457 backButton
2458 }
2459 )
2460 }
2461 ),
2462 canvas.isPreview && canvas.editLink && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2463 "div",
2464 {
2465 onClick: () => navigate({ to: canvas.editLink }),
2466 onKeyDown: (e) => {
2467 if (e.key === "Enter" || e.key === " ") {
2468 e.preventDefault();
2469 navigate({ to: canvas.editLink });
2470 }
2471 },
2472 style: {
2473 position: "absolute",
2474 inset: 0,
2475 cursor: "pointer",
2476 zIndex: 1
2477 },
2478 role: "button",
2479 tabIndex: 0,
2480 "aria-label": "Click to edit"
2481 }
2482 )
2483 ] });
2484 }
2485
2486 // packages/boot/build-module/components/canvas-renderer/index.mjs
2487 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
2488 function CanvasRenderer({
2489 canvas,
2490 routeContentModule
2491 }) {
2492 const [CustomCanvas, setCustomCanvas] = (0, import_element13.useState)(null);
2493 (0, import_element13.useEffect)(() => {
2494 if (canvas === null && routeContentModule) {
2495 import(routeContentModule).then((module) => {
2496 setCustomCanvas(() => module.canvas);
2497 }).catch((error) => {
2498 console.error("Failed to load custom canvas:", error);
2499 });
2500 } else {
2501 setCustomCanvas(null);
2502 }
2503 }, [canvas, routeContentModule]);
2504 if (canvas === void 0) {
2505 return null;
2506 }
2507 if (canvas === null) {
2508 if (!CustomCanvas) {
2509 return null;
2510 }
2511 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CustomCanvas, {});
2512 }
2513 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Canvas, { canvas });
2514 }
2515
2516 // packages/boot/build-module/components/app/use-route-title.mjs
2517 var import_element14 = __toESM(require_element(), 1);
2518 var import_data10 = __toESM(require_data(), 1);
2519 var import_core_data5 = __toESM(require_core_data(), 1);
2520 var import_i18n10 = __toESM(require_i18n(), 1);
2521 var import_html_entities2 = __toESM(require_html_entities(), 1);
2522 import { speak } from "@wordpress/a11y";
2523 import { privateApis as routePrivateApis4 } from "@wordpress/route";
2524 var { useLocation, useMatches: useMatches2 } = unlock(routePrivateApis4);
2525 function useRouteTitle() {
2526 const location = useLocation();
2527 const matches = useMatches2();
2528 const currentMatch = matches[matches.length - 1];
2529 const routeTitle = currentMatch?.loaderData?.title;
2530 const siteTitle = (0, import_data10.useSelect)(
2531 (select) => select(import_core_data5.store).getEntityRecord(
2532 "root",
2533 "__unstableBase"
2534 )?.name,
2535 []
2536 );
2537 const isInitialLocationRef = (0, import_element14.useRef)(true);
2538 (0, import_element14.useEffect)(() => {
2539 isInitialLocationRef.current = false;
2540 }, [location]);
2541 (0, import_element14.useEffect)(() => {
2542 if (isInitialLocationRef.current) {
2543 return;
2544 }
2545 if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") {
2546 const decodedRouteTitle = (0, import_html_entities2.decodeEntities)(routeTitle);
2547 const decodedSiteTitle = (0, import_html_entities2.decodeEntities)(siteTitle);
2548 const formattedTitle = (0, import_i18n10.sprintf)(
2549 /* translators: Admin document title. 1: Admin screen name, 2: Site name. */
2550 (0, import_i18n10.__)("%1$s \u2039 %2$s \u2014 WordPress"),
2551 decodedRouteTitle,
2552 decodedSiteTitle
2553 );
2554 document.title = formattedTitle;
2555 if (decodedRouteTitle) {
2556 speak(decodedRouteTitle, "assertive");
2557 }
2558 }
2559 }, [routeTitle, siteTitle, location]);
2560 }
2561
2562 // packages/boot/build-module/components/user-theme-provider/index.mjs
2563 var import_theme = __toESM(require_theme(), 1);
2564 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
2565 var ThemeProvider = unlock(import_theme.privateApis).ThemeProvider;
2566 var THEME_PRIMARY_COLORS = /* @__PURE__ */ new Map([
2567 ["light", "#0085ba"],
2568 ["modern", "#3858e9"],
2569 ["blue", "#096484"],
2570 ["coffee", "#46403c"],
2571 ["ectoplasm", "#523f6d"],
2572 ["midnight", "#e14d43"],
2573 ["ocean", "#627c83"],
2574 ["sunrise", "#dd823b"]
2575 ]);
2576 function getAdminThemePrimaryColor() {
2577 const theme = document.body.className.match(/admin-color-([a-z]+)/)?.[1];
2578 return theme && THEME_PRIMARY_COLORS.get(theme);
2579 }
2580 function UserThemeProvider({
2581 color,
2582 ...restProps
2583 }) {
2584 const primary = getAdminThemePrimaryColor();
2585 return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ThemeProvider, { ...restProps, color: { primary, ...color } });
2586 }
2587
2588 // packages/boot/build-module/components/root/index.mjs
2589 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
2590 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='be0c278a6c']")) {
2591 const style = document.createElement("style");
2592 style.setAttribute("data-wp-hash", "be0c278a6c");
2593 style.appendChild(document.createTextNode(".boot-layout{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}.boot-layout__sidebar-backdrop{background-color:#00000080;bottom:0;cursor:var(--wpds-cursor-control,pointer);left:0;position:fixed;right:0;top:0;z-index:100002}.boot-layout__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.boot-layout__sidebar.is-mobile{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px #0003;inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{left:0;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout__mobile-sidebar-drawer{top:46px}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);display:flex;justify-content:flex-start;padding:16px;z-index:3}.boot-layout__canvas.has-mobile-drawer{padding-top:65px;position:relative}.boot-layout__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.boot-layout__surfaces{margin:8px}.boot-layout--single-page .boot-layout__surfaces{margin-top:0;margin-inline-start:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width:auto}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:auto}}.boot-layout__stage{z-index:2}@media (min-width:782px){.boot-layout__stage{z-index:auto}}.boot-layout__inspector{z-index:3}@media (min-width:782px){.boot-layout__inspector{z-index:auto}}.boot-layout__canvas{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);border-radius:0;bottom:0;box-shadow:0 1px 3px #0000001a;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw;z-index:1}.boot-layout--single-page .boot-layout__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index:auto}.boot-layout--single-page .boot-layout__canvas{height:auto}.boot-layout.has-canvas .boot-layout__stage,.boot-layout__inspector{max-width:400px}}.boot-layout__canvas .interface-interface-skeleton{height:100%;left:0!important;position:relative;top:0!important}.boot-layout.has-full-canvas .boot-layout__surfaces{gap:0;margin:0}.boot-layout.has-full-canvas .boot-layout__inspector,.boot-layout.has-full-canvas .boot-layout__stage{display:none}.boot-layout.has-full-canvas .boot-layout__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;left:0;margin:0;max-width:none;overflow:hidden;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:46px}@media (min-width:782px){.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:32px}}"));
2594 document.head.appendChild(style);
2595 }
2596 var { useLocation: useLocation2, useMatches: useMatches3, Outlet } = unlock(routePrivateApis5);
2597 function Root() {
2598 const matches = useMatches3();
2599 const location = useLocation2();
2600 const currentMatch = matches[matches.length - 1];
2601 const canvas = currentMatch?.loaderData?.canvas;
2602 const routeContentModule = currentMatch?.loaderData?.routeContentModule;
2603 const isFullScreen = canvas && !canvas.isPreview;
2604 useRouteTitle();
2605 const isMobileViewport = (0, import_compose4.useViewportMatch)("medium", "<");
2606 const [isMobileSidebarOpen, setIsMobileSidebarOpen] = (0, import_element15.useState)(false);
2607 const disableMotion = (0, import_compose4.useReducedMotion)();
2608 (0, import_element15.useEffect)(() => {
2609 setIsMobileSidebarOpen(false);
2610 }, [location.pathname, isMobileViewport]);
2611 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components15.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UserThemeProvider, { isRoot: true, color: { bg: "#f8f8f8" }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UserThemeProvider, { color: { bg: "#1d2327" }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2612 "div",
2613 {
2614 className: clsx_default("boot-layout", {
2615 "has-canvas": !!canvas || canvas === null,
2616 "has-full-canvas": isFullScreen
2617 }),
2618 children: [
2619 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SavePanel, {}),
2620 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_notices.SnackbarNotices, { className: "boot-notices__snackbar" }),
2621 isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(page_default.SidebarToggleFill, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2622 import_components15.Button,
2623 {
2624 icon: menu_default,
2625 onClick: () => setIsMobileSidebarOpen(true),
2626 label: (0, import_i18n11.__)("Open navigation panel"),
2627 size: "compact"
2628 }
2629 ) }),
2630 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components15.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2631 import_components15.__unstableMotion.div,
2632 {
2633 initial: { opacity: 0 },
2634 animate: { opacity: 1 },
2635 exit: { opacity: 0 },
2636 transition: {
2637 type: "tween",
2638 duration: disableMotion ? 0 : 0.2,
2639 ease: "easeOut"
2640 },
2641 className: "boot-layout__sidebar-backdrop",
2642 onClick: () => setIsMobileSidebarOpen(false),
2643 onKeyDown: (event) => {
2644 if (event.key === "Escape") {
2645 setIsMobileSidebarOpen(false);
2646 }
2647 },
2648 role: "button",
2649 tabIndex: -1,
2650 "aria-label": (0, import_i18n11.__)(
2651 "Close navigation panel"
2652 )
2653 }
2654 ) }),
2655 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components15.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2656 import_components15.__unstableMotion.div,
2657 {
2658 initial: { x: "-100%" },
2659 animate: { x: 0 },
2660 exit: { x: "-100%" },
2661 transition: {
2662 type: "tween",
2663 duration: disableMotion ? 0 : 0.2,
2664 ease: "easeOut"
2665 },
2666 className: "boot-layout__sidebar is-mobile",
2667 children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Sidebar, {})
2668 }
2669 ) }),
2670 !isMobileViewport && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Sidebar, {}) }),
2671 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [
2672 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Outlet, {}),
2673 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2674 "div",
2675 {
2676 className: clsx_default(
2677 "boot-layout__canvas",
2678 {
2679 "has-mobile-drawer": canvas?.isPreview && isMobileViewport
2680 }
2681 ),
2682 children: [
2683 canvas?.isPreview && isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__mobile-sidebar-drawer", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2684 import_components15.Button,
2685 {
2686 icon: menu_default,
2687 onClick: () => setIsMobileSidebarOpen(
2688 true
2689 ),
2690 label: (0, import_i18n11.__)(
2691 "Open navigation panel"
2692 ),
2693 size: "compact"
2694 }
2695 ) }),
2696 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2697 CanvasRenderer,
2698 {
2699 canvas,
2700 routeContentModule
2701 }
2702 )
2703 ]
2704 }
2705 )
2706 ] }) })
2707 ]
2708 }
2709 ) }) }) });
2710 }
2711
2712 // packages/boot/build-module/components/app/router.mjs
2713 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
2714 var {
2715 createLazyRoute,
2716 createRouter,
2717 createRootRoute,
2718 createRoute,
2719 RouterProvider,
2720 createBrowserHistory,
2721 parseHref,
2722 useLoaderData
2723 } = unlock(routePrivateApis6);
2724 function NotFoundComponent() {
2725 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(page_default, { title: (0, import_i18n12.__)("Route not found"), hasPadding: true, children: (0, import_i18n12.__)("The page you're looking for does not exist") }) });
2726 }
2727 function createRouteFromDefinition(route, parentRoute) {
2728 let tanstackRoute = createRoute({
2729 getParentRoute: () => parentRoute,
2730 path: route.path,
2731 beforeLoad: async (opts) => {
2732 if (route.route_module) {
2733 const module = await import(route.route_module);
2734 const routeConfig = module.route || {};
2735 if (routeConfig.beforeLoad) {
2736 return routeConfig.beforeLoad({
2737 params: opts.params || {},
2738 search: opts.search || {}
2739 });
2740 }
2741 }
2742 },
2743 loader: async (opts) => {
2744 let routeConfig = {};
2745 if (route.route_module) {
2746 const module = await import(route.route_module);
2747 routeConfig = module.route || {};
2748 }
2749 const context = {
2750 params: opts.params || {},
2751 search: opts.deps || {}
2752 };
2753 const [, loaderData, canvasData, titleData] = await Promise.all([
2754 (0, import_data11.resolveSelect)(import_core_data6.store).getEntityRecord(
2755 "root",
2756 "__unstableBase"
2757 ),
2758 routeConfig.loader ? routeConfig.loader(context) : Promise.resolve(void 0),
2759 routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0),
2760 routeConfig.title ? routeConfig.title(context) : Promise.resolve(void 0)
2761 ]);
2762 let inspector = true;
2763 if (routeConfig.inspector) {
2764 inspector = await routeConfig.inspector(context);
2765 }
2766 return {
2767 ...loaderData,
2768 canvas: canvasData,
2769 inspector,
2770 title: titleData,
2771 routeContentModule: route.content_module
2772 };
2773 },
2774 loaderDeps: (opts) => opts.search
2775 });
2776 tanstackRoute = tanstackRoute.lazy(async () => {
2777 const module = route.content_module ? await import(route.content_module) : {};
2778 const Stage = module.stage;
2779 const Inspector = module.inspector;
2780 return createLazyRoute(route.path)({
2781 component: function RouteComponent() {
2782 const { inspector: showInspector } = useLoaderData({ from: route.path }) ?? {};
2783 return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
2784 Stage && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Stage, {}) }),
2785 Inspector && showInspector && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__inspector", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Inspector, {}) })
2786 ] });
2787 }
2788 });
2789 });
2790 return tanstackRoute;
2791 }
2792 function createRouteTree(routes, rootComponent = Root) {
2793 const rootRoute = createRootRoute({
2794 component: rootComponent,
2795 context: () => ({})
2796 });
2797 const dynamicRoutes = routes.map(
2798 (route) => createRouteFromDefinition(route, rootRoute)
2799 );
2800 return rootRoute.addChildren(dynamicRoutes);
2801 }
2802 function createPathHistory() {
2803 return createBrowserHistory({
2804 parseLocation: () => {
2805 const url = new URL(window.location.href);
2806 const path = url.searchParams.get("p") || "/";
2807 const pathHref = `${path}${url.hash}`;
2808 return parseHref(pathHref, window.history.state);
2809 },
2810 createHref: (href) => {
2811 const searchParams = new URLSearchParams(window.location.search);
2812 searchParams.set("p", href);
2813 return `${window.location.pathname}?${searchParams}`;
2814 }
2815 });
2816 }
2817 function Router({
2818 routes,
2819 rootComponent = Root
2820 }) {
2821 const router = (0, import_element16.useMemo)(() => {
2822 const history = createPathHistory();
2823 const routeTree = createRouteTree(routes, rootComponent);
2824 return createRouter({
2825 history,
2826 routeTree,
2827 defaultPreload: "intent",
2828 defaultNotFoundComponent: NotFoundComponent,
2829 defaultViewTransition: {
2830 types: ({
2831 fromLocation
2832 }) => {
2833 if (!fromLocation) {
2834 return false;
2835 }
2836 return ["navigate"];
2837 }
2838 }
2839 });
2840 }, [routes, rootComponent]);
2841 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RouterProvider, { router });
2842 }
2843
2844 // packages/boot/build-module/components/root/single-page.mjs
2845 var import_notices2 = __toESM(require_notices(), 1);
2846 var import_components16 = __toESM(require_components(), 1);
2847 import { privateApis as routePrivateApis7 } from "@wordpress/route";
2848 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
2849 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='be0c278a6c']")) {
2850 const style = document.createElement("style");
2851 style.setAttribute("data-wp-hash", "be0c278a6c");
2852 style.appendChild(document.createTextNode(".boot-layout{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}.boot-layout__sidebar-backdrop{background-color:#00000080;bottom:0;cursor:var(--wpds-cursor-control,pointer);left:0;position:fixed;right:0;top:0;z-index:100002}.boot-layout__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.boot-layout__sidebar.is-mobile{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px #0003;inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{left:0;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout__mobile-sidebar-drawer{top:46px}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);display:flex;justify-content:flex-start;padding:16px;z-index:3}.boot-layout__canvas.has-mobile-drawer{padding-top:65px;position:relative}.boot-layout__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.boot-layout__surfaces{margin:8px}.boot-layout--single-page .boot-layout__surfaces{margin-top:0;margin-inline-start:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width:auto}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:auto}}.boot-layout__stage{z-index:2}@media (min-width:782px){.boot-layout__stage{z-index:auto}}.boot-layout__inspector{z-index:3}@media (min-width:782px){.boot-layout__inspector{z-index:auto}}.boot-layout__canvas{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);border-radius:0;bottom:0;box-shadow:0 1px 3px #0000001a;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw;z-index:1}.boot-layout--single-page .boot-layout__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index:auto}.boot-layout--single-page .boot-layout__canvas{height:auto}.boot-layout.has-canvas .boot-layout__stage,.boot-layout__inspector{max-width:400px}}.boot-layout__canvas .interface-interface-skeleton{height:100%;left:0!important;position:relative;top:0!important}.boot-layout.has-full-canvas .boot-layout__surfaces{gap:0;margin:0}.boot-layout.has-full-canvas .boot-layout__inspector,.boot-layout.has-full-canvas .boot-layout__stage{display:none}.boot-layout.has-full-canvas .boot-layout__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;left:0;margin:0;max-width:none;overflow:hidden;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:46px}@media (min-width:782px){.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:32px}}"));
2853 document.head.appendChild(style);
2854 }
2855 var { useMatches: useMatches4, Outlet: Outlet2 } = unlock(routePrivateApis7);
2856 function RootSinglePage() {
2857 const matches = useMatches4();
2858 const currentMatch = matches[matches.length - 1];
2859 const canvas = currentMatch?.loaderData?.canvas;
2860 const routeContentModule = currentMatch?.loaderData?.routeContentModule;
2861 const isFullScreen = canvas && !canvas.isPreview;
2862 useRouteTitle();
2863 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components16.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(UserThemeProvider, { isRoot: true, color: { bg: "#f8f8f8" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(UserThemeProvider, { color: { bg: "#1d2327" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2864 "div",
2865 {
2866 className: clsx_default(
2867 "boot-layout boot-layout--single-page",
2868 {
2869 "has-canvas": !!canvas || canvas === null,
2870 "has-full-canvas": isFullScreen
2871 }
2872 ),
2873 children: [
2874 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SavePanel, {}),
2875 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_notices2.SnackbarNotices, { className: "boot-notices__snackbar" }),
2876 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [
2877 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Outlet2, {}),
2878 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "boot-layout__canvas", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2879 CanvasRenderer,
2880 {
2881 canvas,
2882 routeContentModule
2883 }
2884 ) })
2885 ] }) })
2886 ]
2887 }
2888 ) }) }) });
2889 }
2890
2891 // packages/boot/build-module/components/app/index.mjs
2892 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
2893 function App({ rootComponent }) {
2894 const routes = (0, import_data12.useSelect)((select) => select(store).getRoutes(), []);
2895 return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Router, { routes, rootComponent });
2896 }
2897 async function init({
2898 mountId,
2899 menuItems,
2900 routes,
2901 initModules,
2902 dashboardLink
2903 }) {
2904 (menuItems ?? []).forEach((menuItem) => {
2905 (0, import_data12.dispatch)(store).registerMenuItem(menuItem.id, menuItem);
2906 });
2907 (routes ?? []).forEach((route) => {
2908 (0, import_data12.dispatch)(store).registerRoute(route);
2909 });
2910 if (dashboardLink) {
2911 (0, import_data12.dispatch)(store).setDashboardLink(dashboardLink);
2912 }
2913 for (const moduleId of initModules ?? []) {
2914 const module = await import(moduleId);
2915 await module.init();
2916 }
2917 const rootElement = document.getElementById(mountId);
2918 if (rootElement) {
2919 const root = (0, import_element17.createRoot)(rootElement);
2920 root.render(
2921 /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_element17.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(App, {}) })
2922 );
2923 }
2924 }
2925 async function initSinglePage({
2926 mountId,
2927 routes
2928 }) {
2929 (routes ?? []).forEach((route) => {
2930 (0, import_data12.dispatch)(store).registerRoute(route);
2931 });
2932 const rootElement = document.getElementById(mountId);
2933 if (rootElement) {
2934 const root = (0, import_element17.createRoot)(rootElement);
2935 root.render(
2936 /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_element17.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(App, { rootComponent: RootSinglePage }) })
2937 );
2938 }
2939 }
2940
2941 // packages/boot/build-module/index.mjs
2942 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='9947af2e2a']")) {
2943 const style = document.createElement("style");
2944 style.setAttribute("data-wp-hash", "9947af2e2a");
2945 style.appendChild(document.createTextNode(':root{--wpds-border-radius-xs:1px;--wpds-border-radius-sm:2px;--wpds-border-radius-md:4px;--wpds-border-radius-lg:8px;--wpds-border-width-xs:1px;--wpds-border-width-sm:2px;--wpds-border-width-md:4px;--wpds-border-width-lg:8px;--wpds-border-width-focus:2px;--wpds-color-bg-surface-neutral:#fcfcfc;--wpds-color-bg-surface-neutral-strong:#fff;--wpds-color-bg-surface-neutral-weak:#f4f4f4;--wpds-color-bg-surface-brand:#ecf0fa;--wpds-color-bg-surface-success:#c6f7cd;--wpds-color-bg-surface-success-weak:#ebffed;--wpds-color-bg-surface-info:#deebfa;--wpds-color-bg-surface-info-weak:#f3f9ff;--wpds-color-bg-surface-warning:#fde6be;--wpds-color-bg-surface-warning-weak:#fff7e1;--wpds-color-bg-surface-caution:#fee995;--wpds-color-bg-surface-caution-weak:#fff9ca;--wpds-color-bg-surface-error:#f6e6e3;--wpds-color-bg-surface-error-weak:#fff6f5;--wpds-color-bg-interactive-neutral-strong:#2d2d2d;--wpds-color-bg-interactive-neutral-strong-active:#1e1e1e;--wpds-color-bg-interactive-neutral-strong-disabled:#e6e6e6;--wpds-color-bg-interactive-neutral-weak:#0000;--wpds-color-bg-interactive-neutral-weak-active:#ededed;--wpds-color-bg-interactive-neutral-weak-disabled:#0000;--wpds-color-bg-interactive-brand-strong:#3858e9;--wpds-color-bg-interactive-brand-strong-active:#2e49d9;--wpds-color-bg-interactive-brand-weak:#0000;--wpds-color-bg-interactive-brand-weak-active:#e6eaf4;--wpds-color-bg-interactive-error:#0000;--wpds-color-bg-interactive-error-active:#fff6f5;--wpds-color-bg-interactive-error-strong:#cc1818;--wpds-color-bg-interactive-error-strong-active:#b90000;--wpds-color-bg-interactive-error-weak:#0000;--wpds-color-bg-interactive-error-weak-active:#f6e6e3;--wpds-color-bg-track-neutral-weak:#e4e4e4;--wpds-color-bg-track-neutral:#dbdbdb;--wpds-color-bg-thumb-neutral-weak:#8d8d8d;--wpds-color-bg-thumb-neutral-weak-active:#6e6e6e;--wpds-color-bg-thumb-brand:#3858e9;--wpds-color-bg-thumb-brand-active:#3858e9;--wpds-color-bg-thumb-neutral-disabled:#dbdbdb;--wpds-color-fg-content-neutral:#1e1e1e;--wpds-color-fg-content-neutral-weak:#707070;--wpds-color-fg-content-success:#002900;--wpds-color-fg-content-success-weak:#008030;--wpds-color-fg-content-info:#001b4f;--wpds-color-fg-content-info-weak:#006bd7;--wpds-color-fg-content-warning:#2e1900;--wpds-color-fg-content-warning-weak:#926300;--wpds-color-fg-content-caution:#281d00;--wpds-color-fg-content-caution-weak:#826a00;--wpds-color-fg-content-error:#470000;--wpds-color-fg-content-error-weak:#cc1818;--wpds-color-fg-interactive-neutral:#1e1e1e;--wpds-color-fg-interactive-neutral-active:#1e1e1e;--wpds-color-fg-interactive-neutral-disabled:#8d8d8d;--wpds-color-fg-interactive-neutral-strong:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-active:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-disabled:#8d8d8d;--wpds-color-fg-interactive-neutral-weak:#707070;--wpds-color-fg-interactive-neutral-weak-disabled:#8d8d8d;--wpds-color-fg-interactive-brand:#3858e9;--wpds-color-fg-interactive-brand-active:#3858e9;--wpds-color-fg-interactive-brand-strong:#eff0f2;--wpds-color-fg-interactive-brand-strong-active:#eff0f2;--wpds-color-fg-interactive-error:#cc1818;--wpds-color-fg-interactive-error-active:#cc1818;--wpds-color-fg-interactive-error-strong:#f2efef;--wpds-color-fg-interactive-error-strong-active:#f2efef;--wpds-color-stroke-surface-neutral:#dbdbdb;--wpds-color-stroke-surface-neutral-weak:#e4e4e4;--wpds-color-stroke-surface-neutral-strong:#8d8d8d;--wpds-color-stroke-surface-brand:#a3b1d4;--wpds-color-stroke-surface-brand-strong:#3858e9;--wpds-color-stroke-surface-success:#8ac894;--wpds-color-stroke-surface-success-strong:#008030;--wpds-color-stroke-surface-info:#9fbcdc;--wpds-color-stroke-surface-info-strong:#006bd7;--wpds-color-stroke-surface-warning:#d0b481;--wpds-color-stroke-surface-warning-strong:#926300;--wpds-color-stroke-surface-error:#daa39b;--wpds-color-stroke-surface-error-strong:#cc1818;--wpds-color-stroke-interactive-neutral:#8d8d8d;--wpds-color-stroke-interactive-neutral-active:#6e6e6e;--wpds-color-stroke-interactive-neutral-disabled:#dbdbdb;--wpds-color-stroke-interactive-neutral-strong:#6e6e6e;--wpds-color-stroke-interactive-brand:#3858e9;--wpds-color-stroke-interactive-brand-active:#2337c8;--wpds-color-stroke-interactive-error:#cc1818;--wpds-color-stroke-interactive-error-active:#9d0000;--wpds-color-stroke-interactive-error-strong:#cc1818;--wpds-color-stroke-focus-brand:#3858e9;--wpds-cursor-control:pointer;--wpds-dimension-base:4px;--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-surface-width-xs:240px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-2xl:960px;--wpds-elevation-xs:0 1px 1px 0 #00000008,0 1px 2px 0 #00000005,0 3px 3px 0 #00000005,0 4px 4px 0 #00000003;--wpds-elevation-sm:0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005;--wpds-elevation-md:0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005;--wpds-elevation-lg:0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005;--wpds-motion-duration-xs:50ms;--wpds-motion-duration-sm:100ms;--wpds-motion-duration-md:200ms;--wpds-motion-duration-lg:300ms;--wpds-motion-duration-xl:400ms;--wpds-motion-easing-subtle:cubic-bezier(0.15,0,0.15,1);--wpds-motion-easing-balanced:cubic-bezier(0.4,0,0.2,1);--wpds-motion-easing-expressive:cubic-bezier(0.25,0,0,1);--wpds-typography-font-family-heading:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-typography-font-family-body:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-typography-font-family-mono:"Menlo","Consolas",monaco,monospace;--wpds-typography-font-size-xs:11px;--wpds-typography-font-size-sm:12px;--wpds-typography-font-size-md:13px;--wpds-typography-font-size-lg:15px;--wpds-typography-font-size-xl:20px;--wpds-typography-font-size-2xl:32px;--wpds-typography-line-height-xs:16px;--wpds-typography-line-height-sm:20px;--wpds-typography-line-height-md:24px;--wpds-typography-line-height-lg:28px;--wpds-typography-line-height-xl:32px;--wpds-typography-line-height-2xl:40px;--wpds-typography-font-weight-regular:400;--wpds-typography-font-weight-medium:499}[data-wpds-theme-provider-id][data-wpds-density=compact]{--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:4px;--wpds-dimension-padding-md:8px;--wpds-dimension-padding-lg:12px;--wpds-dimension-padding-xl:16px;--wpds-dimension-padding-2xl:20px;--wpds-dimension-padding-3xl:24px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:4px;--wpds-dimension-gap-md:8px;--wpds-dimension-gap-lg:12px;--wpds-dimension-gap-xl:20px;--wpds-dimension-gap-2xl:24px;--wpds-dimension-gap-3xl:32px}[data-wpds-theme-provider-id][data-wpds-density=comfortable]{--wpds-dimension-padding-xs:8px;--wpds-dimension-padding-sm:12px;--wpds-dimension-padding-md:16px;--wpds-dimension-padding-lg:20px;--wpds-dimension-padding-xl:24px;--wpds-dimension-padding-2xl:32px;--wpds-dimension-padding-3xl:40px;--wpds-dimension-gap-xs:8px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-lg:20px;--wpds-dimension-gap-xl:32px;--wpds-dimension-gap-2xl:40px;--wpds-dimension-gap-3xl:48px}[data-wpds-theme-provider-id][data-wpds-density=default]{--wpds-dimension-base:4px;--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-surface-width-xs:240px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-2xl:960px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wpds-border-width-focus:1.5px}}body.has-admin-bar-in-editor #wpadminbar{display:block}body.has-admin-bar-in-editor .boot-canvas-back-button__link{background:#0000}body.has-admin-bar-in-editor .boot-canvas-back-button__icon{background-color:initial}body.has-admin-bar-in-editor #site-editor-v2-app{bottom:0;height:calc(100vh - 32px)!important;left:0;position:fixed;right:0;top:32px}body.has-admin-bar-in-editor .boot-layout.has-full-canvas .boot-layout__canvas{height:calc(100vh - 32px);top:32px}@media (max-width:782px){body.has-admin-bar-in-editor #site-editor-v2-app{height:calc(100vh - 46px)!important;top:46px}body.has-admin-bar-in-editor .boot-layout.has-full-canvas .boot-layout__canvas,body.has-admin-bar-in-editor .boot-layout__canvas:not(.has-mobile-drawer),body.has-admin-bar-in-editor .boot-layout__inspector,body.has-admin-bar-in-editor .boot-layout__stage{height:calc(100vh - 46px);top:46px}body.has-admin-bar-in-editor .boot-layout__mobile-sidebar-drawer{top:46px}}@media (min-width:600px){.boot-layout-container .boot-layout{bottom:0;left:0;min-height:calc(100vh - 46px);position:absolute;right:0;top:0}}@media (min-width:782px){.boot-layout-container .boot-layout{min-height:calc(100vh - 32px)}body:has(.boot-layout.has-full-canvas) .boot-layout-container .boot-layout{min-height:100vh}}.boot-layout-container .boot-layout img{height:auto;max-width:100%}.boot-layout .boot-notices__snackbar{bottom:24px;box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.boot-layout .boot-notices__snackbar .components-snackbar{margin-inline:auto}'));
2946 document.head.appendChild(style);
2947 }
2948 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='cc217bc358']")) {
2949 const style = document.createElement("style");
2950 style.setAttribute("data-wp-hash", "cc217bc358");
2951 style.appendChild(document.createTextNode("@media (max-width:782px){*{view-transition-name:none!important}}::view-transition-new(root),::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){.boot-layout__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.boot-layout__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.boot-layout.has-full-canvas .boot-layout__canvas .boot-site-icon-link,.boot-layout:not(.has-full-canvas) .boot-site-hub .boot-site-icon-link{view-transition-name:boot--site-icon-link}.boot-layout__stage{view-transition-name:boot--stage}.boot-layout__inspector{view-transition-name:boot--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.boot-layout__stage{view-transition-name:boot-safari--stage}.boot-layout__inspector{view-transition-name:boot-safari--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot-safari--canvas}}.components-popover:first-of-type{view-transition-name:boot--components-popover}}::view-transition-group(boot--canvas),::view-transition-group(boot--canvas-header),::view-transition-group(boot--canvas-sidebar),::view-transition-group(boot-safari--canvas){z-index:1}::view-transition-group(boot--site-icon-link){z-index:2}::view-transition-new(boot--site-icon-link),::view-transition-old(boot--site-icon-link){animation:none}::view-transition-new(boot-safari--canvas),::view-transition-new(boot-safari--inspector),::view-transition-new(boot-safari--stage),::view-transition-old(boot-safari--canvas),::view-transition-old(boot-safari--inspector),::view-transition-old(boot-safari--stage){width:auto}::view-transition-new(boot--canvas),::view-transition-new(boot--inspector),::view-transition-new(boot--stage),::view-transition-old(boot--canvas),::view-transition-old(boot--inspector),::view-transition-old(boot--stage){background:#fff;border-radius:8px;height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}::view-transition-new(boot--canvas),::view-transition-old(boot--canvas){object-position:center top}::view-transition-old(boot--inspector):only-child,::view-transition-old(boot--stage):only-child,::view-transition-old(boot-safari--inspector):only-child,::view-transition-old(boot-safari--stage):only-child{animation-name:zoomOut;will-change:transform,opacity}::view-transition-new(boot--inspector):only-child,::view-transition-new(boot--stage):only-child,::view-transition-new(boot-safari--inspector):only-child,::view-transition-new(boot-safari--stage):only-child{animation-name:zoomIn;will-change:transform,opacity}@keyframes zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}::view-transition-new(boot--canvas):only-child,::view-transition-new(boot-safari--canvas):only-child{animation-name:slideFromRight;will-change:transform}::view-transition-old(boot--canvas):only-child,::view-transition-old(boot-safari--canvas):only-child{animation-name:slideToRight;will-change:transform}@keyframes slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}::view-transition-new(boot--canvas-header):only-child{animation-name:slideHeaderFromTop;will-change:transform}::view-transition-old(boot--canvas-header):only-child{animation-name:slideHeaderToTop;will-change:transform}@keyframes slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes slideHeaderToTop{to{transform:translateY(-100%)}}::view-transition-new(boot--canvas-sidebar):only-child{animation-name:slideSidebarFromRight;will-change:transform}::view-transition-old(boot--canvas-sidebar):only-child{animation-name:slideSidebarToRight;will-change:transform}@keyframes slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes slideSidebarToRight{to{transform:translateX(100%)}}"));
2952 document.head.appendChild(style);
2953 }
2954 export {
2955 init,
2956 initSinglePage,
2957 store
2958 };
2959 //# sourceMappingURL=index.js.map
2960