PluginProbe
Gutenberg / 23.4.0
Gutenberg v23.4.0
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 / widgets / site-preview / render.js

render.js in Gutenberg 23.4.0, at build/widgets/site-preview/render.js

1,625 lines 83.3 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 __copyProps = (to, from, except, desc) => {
11 if (from && typeof from === "object" || typeof from === "function") {
12 for (let key of __getOwnPropNames(from))
13 if (!__hasOwnProp.call(to, key) && key !== except)
14 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15 }
16 return to;
17 };
18 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19 // If the importer is in node compatibility mode or this is not an ESM
20 // file that has been converted to a CommonJS file using a Babel-
21 // compatible transform (i.e. "__esModule" has not been set), then set
22 // "default" to the CommonJS "module.exports" for node compatibility.
23 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24 mod
25 ));
26
27 // package-external:@wordpress/element
28 var require_element = __commonJS({
29 "package-external:@wordpress/element"(exports, module) {
30 module.exports = window.wp.element;
31 }
32 });
33
34 // package-external:@wordpress/data
35 var require_data = __commonJS({
36 "package-external:@wordpress/data"(exports, module) {
37 module.exports = window.wp.data;
38 }
39 });
40
41 // package-external:@wordpress/core-data
42 var require_core_data = __commonJS({
43 "package-external:@wordpress/core-data"(exports, module) {
44 module.exports = window.wp.coreData;
45 }
46 });
47
48 // package-external:@wordpress/i18n
49 var require_i18n = __commonJS({
50 "package-external:@wordpress/i18n"(exports, module) {
51 module.exports = window.wp.i18n;
52 }
53 });
54
55 // package-external:@wordpress/primitives
56 var require_primitives = __commonJS({
57 "package-external:@wordpress/primitives"(exports, module) {
58 module.exports = window.wp.primitives;
59 }
60 });
61
62 // vendor-external:react/jsx-runtime
63 var require_jsx_runtime = __commonJS({
64 "vendor-external:react/jsx-runtime"(exports, module) {
65 module.exports = window.ReactJSXRuntime;
66 }
67 });
68
69 // package-external:@wordpress/url
70 var require_url = __commonJS({
71 "package-external:@wordpress/url"(exports, module) {
72 module.exports = window.wp.url;
73 }
74 });
75
76 // package-external:@wordpress/components
77 var require_components = __commonJS({
78 "package-external:@wordpress/components"(exports, module) {
79 module.exports = window.wp.components;
80 }
81 });
82
83 // vendor-external:react
84 var require_react = __commonJS({
85 "vendor-external:react"(exports, module) {
86 module.exports = window.React;
87 }
88 });
89
90 // widgets/site-preview/render.tsx
91 var import_element6 = __toESM(require_element());
92 var import_data = __toESM(require_data());
93 var import_core_data = __toESM(require_core_data());
94 var import_i18n2 = __toESM(require_i18n());
95
96 // packages/icons/build-module/library/wordpress.mjs
97 var import_primitives = __toESM(require_primitives(), 1);
98 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
99 var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.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" }) });
100
101 // widgets/site-preview/render.tsx
102 var import_url = __toESM(require_url());
103 var import_components = __toESM(require_components());
104
105 // node_modules/clsx/dist/clsx.mjs
106 function r(e) {
107 var t, f, n = "";
108 if ("string" == typeof e || "number" == typeof e) n += e;
109 else if ("object" == typeof e) if (Array.isArray(e)) {
110 var o = e.length;
111 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
112 } else for (f in e) e[f] && (n && (n += " "), n += f);
113 return n;
114 }
115 function clsx() {
116 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
117 return n;
118 }
119 var clsx_default = clsx;
120
121 // node_modules/@base-ui/utils/esm/error.js
122 var set;
123 if (true) {
124 set = /* @__PURE__ */ new Set();
125 }
126 function error(...messages) {
127 if (true) {
128 const messageKey = messages.join(" ");
129 if (!set.has(messageKey)) {
130 set.add(messageKey);
131 console.error(`Base UI: ${messageKey}`);
132 }
133 }
134 }
135
136 // node_modules/@base-ui/utils/esm/safeReact.js
137 var React = __toESM(require_react(), 1);
138 var SafeReact = {
139 ...React
140 };
141
142 // node_modules/@base-ui/utils/esm/useRefWithInit.js
143 var React2 = __toESM(require_react(), 1);
144 var UNINITIALIZED = {};
145 function useRefWithInit(init, initArg) {
146 const ref = React2.useRef(UNINITIALIZED);
147 if (ref.current === UNINITIALIZED) {
148 ref.current = init(initArg);
149 }
150 return ref;
151 }
152
153 // node_modules/@base-ui/utils/esm/useStableCallback.js
154 var useInsertionEffect = SafeReact.useInsertionEffect;
155 var useSafeInsertionEffect = (
156 // React 17 doesn't have useInsertionEffect.
157 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
158 useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn()
159 );
160 function useStableCallback(callback) {
161 const stable = useRefWithInit(createStableCallback).current;
162 stable.next = callback;
163 useSafeInsertionEffect(stable.effect);
164 return stable.trampoline;
165 }
166 function createStableCallback() {
167 const stable = {
168 next: void 0,
169 callback: assertNotCalled,
170 trampoline: (...args) => stable.callback?.(...args),
171 effect: () => {
172 stable.callback = stable.next;
173 }
174 };
175 return stable;
176 }
177 function assertNotCalled() {
178 if (true) {
179 throw (
180 /* minify-error-disabled */
181 new Error("Base UI: Cannot call an event handler while rendering.")
182 );
183 }
184 }
185
186 // node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js
187 var React3 = __toESM(require_react(), 1);
188 var noop = () => {
189 };
190 var useIsoLayoutEffect = typeof document !== "undefined" ? React3.useLayoutEffect : noop;
191
192 // node_modules/@base-ui/utils/esm/warn.js
193 var set2;
194 if (true) {
195 set2 = /* @__PURE__ */ new Set();
196 }
197 function warn(...messages) {
198 if (true) {
199 const messageKey = messages.join(" ");
200 if (!set2.has(messageKey)) {
201 set2.add(messageKey);
202 console.warn(`Base UI: ${messageKey}`);
203 }
204 }
205 }
206
207 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
208 var React6 = __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 React5 = __toESM(require_react(), 1);
301
302 // node_modules/@base-ui/utils/esm/reactVersion.js
303 var React4 = __toESM(require_react(), 1);
304 var majorVersion = parseInt(React4.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__ */ React5.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 = React6.Children.toArray(render);
597 newElement = children[0];
598 }
599 if (true) {
600 if (!/* @__PURE__ */ React6.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__ */ React6.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__ */ React6.createElement(Tag, props);
642 }
643
644 // node_modules/@base-ui/react/esm/internals/use-button/useButton.js
645 var React9 = __toESM(require_react(), 1);
646
647 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
648 function hasWindow() {
649 return typeof window !== "undefined";
650 }
651 function getWindow(node) {
652 var _node$ownerDocument;
653 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
654 }
655 function isHTMLElement(value) {
656 if (!hasWindow()) {
657 return false;
658 }
659 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
660 }
661
662 // node_modules/@base-ui/react/esm/internals/composite/root/CompositeRootContext.js
663 var React7 = __toESM(require_react(), 1);
664 var CompositeRootContext = /* @__PURE__ */ React7.createContext(void 0);
665 if (true) CompositeRootContext.displayName = "CompositeRootContext";
666 function useCompositeRootContext(optional = false) {
667 const context = React7.useContext(CompositeRootContext);
668 if (context === void 0 && !optional) {
669 throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16));
670 }
671 return context;
672 }
673
674 // node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js
675 var React8 = __toESM(require_react(), 1);
676 function useFocusableWhenDisabled(parameters) {
677 const {
678 focusableWhenDisabled,
679 disabled,
680 composite = false,
681 tabIndex: tabIndexProp = 0,
682 isNativeButton
683 } = parameters;
684 const isFocusableComposite = composite && focusableWhenDisabled !== false;
685 const isNonFocusableComposite = composite && focusableWhenDisabled === false;
686 const props = React8.useMemo(() => {
687 const additionalProps = {
688 // allow Tabbing away from focusableWhenDisabled elements
689 onKeyDown(event) {
690 if (disabled && focusableWhenDisabled && event.key !== "Tab") {
691 event.preventDefault();
692 }
693 }
694 };
695 if (!composite) {
696 additionalProps.tabIndex = tabIndexProp;
697 if (!isNativeButton && disabled) {
698 additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
699 }
700 }
701 if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {
702 additionalProps["aria-disabled"] = disabled;
703 }
704 if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
705 additionalProps.disabled = disabled;
706 }
707 return additionalProps;
708 }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
709 return {
710 props
711 };
712 }
713
714 // node_modules/@base-ui/react/esm/internals/use-button/useButton.js
715 function useButton(parameters = {}) {
716 const {
717 disabled = false,
718 focusableWhenDisabled,
719 tabIndex = 0,
720 native: isNativeButton = true,
721 composite: compositeProp
722 } = parameters;
723 const elementRef = React9.useRef(null);
724 const compositeRootContext = useCompositeRootContext(true);
725 const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
726 const {
727 props: focusableWhenDisabledProps
728 } = useFocusableWhenDisabled({
729 focusableWhenDisabled,
730 disabled,
731 composite: isCompositeItem,
732 tabIndex,
733 isNativeButton
734 });
735 if (true) {
736 React9.useEffect(() => {
737 if (!elementRef.current) {
738 return;
739 }
740 const isButtonTag = isButtonElement(elementRef.current);
741 if (isNativeButton) {
742 if (!isButtonTag) {
743 const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
744 const message = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`.";
745 error(`${message}${ownerStackMessage}`);
746 }
747 } else if (isButtonTag) {
748 const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
749 const message = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`.";
750 error(`${message}${ownerStackMessage}`);
751 }
752 }, [isNativeButton]);
753 }
754 const updateDisabled = React9.useCallback(() => {
755 const element = elementRef.current;
756 if (!isButtonElement(element)) {
757 return;
758 }
759 if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === void 0 && element.disabled) {
760 element.disabled = false;
761 }
762 }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);
763 useIsoLayoutEffect(updateDisabled, [updateDisabled]);
764 const getButtonProps = React9.useCallback((externalProps = {}) => {
765 const {
766 onClick: externalOnClick,
767 onMouseDown: externalOnMouseDown,
768 onKeyUp: externalOnKeyUp,
769 onKeyDown: externalOnKeyDown,
770 onPointerDown: externalOnPointerDown,
771 ...otherExternalProps
772 } = externalProps;
773 return mergeProps({
774 onClick(event) {
775 if (disabled) {
776 event.preventDefault();
777 return;
778 }
779 externalOnClick?.(event);
780 },
781 onMouseDown(event) {
782 if (!disabled) {
783 externalOnMouseDown?.(event);
784 }
785 },
786 onKeyDown(event) {
787 if (disabled) {
788 return;
789 }
790 makeEventPreventable(event);
791 externalOnKeyDown?.(event);
792 if (event.baseUIHandlerPrevented) {
793 return;
794 }
795 const isCurrentTarget = event.target === event.currentTarget;
796 const currentTarget = event.currentTarget;
797 const isButton = isButtonElement(currentTarget);
798 const isLink = !isNativeButton && isValidLinkElement(currentTarget);
799 const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);
800 const isEnterKey = event.key === "Enter";
801 const isSpaceKey = event.key === " ";
802 const role = currentTarget.getAttribute("role");
803 const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
804 if (isCurrentTarget && isCompositeItem && isSpaceKey) {
805 if (event.defaultPrevented && isTextNavigationRole) {
806 return;
807 }
808 event.preventDefault();
809 if (isLink || isNativeButton && isButton) {
810 currentTarget.click();
811 event.preventBaseUIHandler();
812 } else if (shouldClick) {
813 externalOnClick?.(event);
814 event.preventBaseUIHandler();
815 }
816 return;
817 }
818 if (shouldClick) {
819 if (!isNativeButton && (isSpaceKey || isEnterKey)) {
820 event.preventDefault();
821 }
822 if (!isNativeButton && isEnterKey) {
823 externalOnClick?.(event);
824 }
825 }
826 },
827 onKeyUp(event) {
828 if (disabled) {
829 return;
830 }
831 makeEventPreventable(event);
832 externalOnKeyUp?.(event);
833 if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
834 event.preventDefault();
835 return;
836 }
837 if (event.baseUIHandlerPrevented) {
838 return;
839 }
840 if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === " ") {
841 externalOnClick?.(event);
842 }
843 },
844 onPointerDown(event) {
845 if (disabled) {
846 event.preventDefault();
847 return;
848 }
849 externalOnPointerDown?.(event);
850 }
851 }, isNativeButton ? {
852 type: "button"
853 } : {
854 role: "button"
855 }, focusableWhenDisabledProps, otherExternalProps);
856 }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);
857 const buttonRef = useStableCallback((element) => {
858 elementRef.current = element;
859 updateDisabled();
860 });
861 return {
862 getButtonProps,
863 buttonRef
864 };
865 }
866 function isButtonElement(elem) {
867 return isHTMLElement(elem) && elem.tagName === "BUTTON";
868 }
869 function isValidLinkElement(elem) {
870 return Boolean(elem?.tagName === "A" && elem?.href);
871 }
872
873 // node_modules/@base-ui/react/esm/button/Button.js
874 var React10 = __toESM(require_react(), 1);
875 var Button = /* @__PURE__ */ React10.forwardRef(function Button2(componentProps, forwardedRef) {
876 const {
877 render,
878 className,
879 disabled = false,
880 focusableWhenDisabled = false,
881 nativeButton = true,
882 style,
883 ...elementProps
884 } = componentProps;
885 const {
886 getButtonProps,
887 buttonRef
888 } = useButton({
889 disabled,
890 focusableWhenDisabled,
891 native: nativeButton
892 });
893 const state = {
894 disabled
895 };
896 return useRenderElement("button", componentProps, {
897 state,
898 ref: [forwardedRef, buttonRef],
899 props: [elementProps, getButtonProps]
900 });
901 });
902 if (true) Button.displayName = "Button";
903
904 // node_modules/@base-ui/react/esm/use-render/useRender.js
905 function useRender(params) {
906 return useRenderElement(params.defaultTagName ?? "div", params, params);
907 }
908
909 // packages/ui/build-module/text/text.mjs
910 var import_element = __toESM(require_element(), 1);
911 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
912 function getRuntime() {
913 const globalScope = globalThis;
914 if (globalScope.__wpStyleRuntime) {
915 return globalScope.__wpStyleRuntime;
916 }
917 globalScope.__wpStyleRuntime = {
918 documents: /* @__PURE__ */ new Map(),
919 styles: /* @__PURE__ */ new Map(),
920 injectedStyles: /* @__PURE__ */ new WeakMap()
921 };
922 if (typeof document !== "undefined") {
923 registerDocument(document);
924 }
925 return globalScope.__wpStyleRuntime;
926 }
927 function documentContainsStyleHash(targetDocument, hash) {
928 if (!targetDocument.head) {
929 return false;
930 }
931 for (const style of targetDocument.head.querySelectorAll(
932 `style[${STYLE_HASH_ATTRIBUTE}]`
933 )) {
934 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
935 return true;
936 }
937 }
938 return false;
939 }
940 function injectStyle(targetDocument, hash, css) {
941 if (!targetDocument.head) {
942 return;
943 }
944 const runtime = getRuntime();
945 let injectedStyles = runtime.injectedStyles.get(targetDocument);
946 if (!injectedStyles) {
947 injectedStyles = /* @__PURE__ */ new Set();
948 runtime.injectedStyles.set(targetDocument, injectedStyles);
949 }
950 if (injectedStyles.has(hash)) {
951 return;
952 }
953 if (documentContainsStyleHash(targetDocument, hash)) {
954 injectedStyles.add(hash);
955 return;
956 }
957 const style = targetDocument.createElement("style");
958 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
959 style.appendChild(targetDocument.createTextNode(css));
960 targetDocument.head.appendChild(style);
961 injectedStyles.add(hash);
962 }
963 function registerDocument(targetDocument) {
964 const runtime = getRuntime();
965 runtime.documents.set(
966 targetDocument,
967 (runtime.documents.get(targetDocument) ?? 0) + 1
968 );
969 for (const [hash, css] of runtime.styles) {
970 injectStyle(targetDocument, hash, css);
971 }
972 return () => {
973 const count = runtime.documents.get(targetDocument);
974 if (count === void 0) {
975 return;
976 }
977 if (count <= 1) {
978 runtime.documents.delete(targetDocument);
979 return;
980 }
981 runtime.documents.set(targetDocument, count - 1);
982 };
983 }
984 function registerStyle(hash, css) {
985 const runtime = getRuntime();
986 runtime.styles.set(hash, css);
987 for (const targetDocument of runtime.documents.keys()) {
988 injectStyle(targetDocument, hash, css);
989 }
990 }
991 if (typeof process === "undefined" || true) {
992 registerStyle("0c5702ddca", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer 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)}}}');
993 }
994 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" };
995 if (typeof process === "undefined" || true) {
996 registerStyle("d5c1b736fd", "._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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);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 transparent)}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 transparent);transition:var(--_gcd-a-transition,none)}");
997 }
998 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" };
999 var Text = (0, import_element.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) {
1000 const element = useRender({
1001 render,
1002 defaultTagName: "span",
1003 ref,
1004 props: mergeProps(props, {
1005 className: clsx_default(
1006 style_default.text,
1007 global_css_defense_default.heading,
1008 global_css_defense_default.p,
1009 style_default[variant],
1010 className
1011 )
1012 })
1013 });
1014 return element;
1015 });
1016
1017 // packages/ui/build-module/button/button.mjs
1018 var import_element2 = __toESM(require_element(), 1);
1019 var import_i18n = __toESM(require_i18n(), 1);
1020 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
1021 import { speak } from "@wordpress/a11y";
1022 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
1023 function getRuntime2() {
1024 const globalScope = globalThis;
1025 if (globalScope.__wpStyleRuntime) {
1026 return globalScope.__wpStyleRuntime;
1027 }
1028 globalScope.__wpStyleRuntime = {
1029 documents: /* @__PURE__ */ new Map(),
1030 styles: /* @__PURE__ */ new Map(),
1031 injectedStyles: /* @__PURE__ */ new WeakMap()
1032 };
1033 if (typeof document !== "undefined") {
1034 registerDocument2(document);
1035 }
1036 return globalScope.__wpStyleRuntime;
1037 }
1038 function documentContainsStyleHash2(targetDocument, hash) {
1039 if (!targetDocument.head) {
1040 return false;
1041 }
1042 for (const style of targetDocument.head.querySelectorAll(
1043 `style[${STYLE_HASH_ATTRIBUTE2}]`
1044 )) {
1045 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
1046 return true;
1047 }
1048 }
1049 return false;
1050 }
1051 function injectStyle2(targetDocument, hash, css) {
1052 if (!targetDocument.head) {
1053 return;
1054 }
1055 const runtime = getRuntime2();
1056 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1057 if (!injectedStyles) {
1058 injectedStyles = /* @__PURE__ */ new Set();
1059 runtime.injectedStyles.set(targetDocument, injectedStyles);
1060 }
1061 if (injectedStyles.has(hash)) {
1062 return;
1063 }
1064 if (documentContainsStyleHash2(targetDocument, hash)) {
1065 injectedStyles.add(hash);
1066 return;
1067 }
1068 const style = targetDocument.createElement("style");
1069 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
1070 style.appendChild(targetDocument.createTextNode(css));
1071 targetDocument.head.appendChild(style);
1072 injectedStyles.add(hash);
1073 }
1074 function registerDocument2(targetDocument) {
1075 const runtime = getRuntime2();
1076 runtime.documents.set(
1077 targetDocument,
1078 (runtime.documents.get(targetDocument) ?? 0) + 1
1079 );
1080 for (const [hash, css] of runtime.styles) {
1081 injectStyle2(targetDocument, hash, css);
1082 }
1083 return () => {
1084 const count = runtime.documents.get(targetDocument);
1085 if (count === void 0) {
1086 return;
1087 }
1088 if (count <= 1) {
1089 runtime.documents.delete(targetDocument);
1090 return;
1091 }
1092 runtime.documents.set(targetDocument, count - 1);
1093 };
1094 }
1095 function registerStyle2(hash, css) {
1096 const runtime = getRuntime2();
1097 runtime.styles.set(hash, css);
1098 for (const targetDocument of runtime.documents.keys()) {
1099 injectStyle2(targetDocument, hash, css);
1100 }
1101 }
1102 if (typeof process === "undefined" || true) {
1103 registerStyle2("459f56a7b7", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:499;--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:40px;--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:-4px;--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:transparent;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-block:0;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:24px}._9f6fc6553aeb36fe__icon{margin:var(--wp-ui-button-icon-margin)}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.ad0619a3217c6a5b__is-minimal[aria-pressed=true],&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:32px}._914b42f315c0e580__is-loading{color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}}');
1104 }
1105 var style_default2 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "icon": "_9f6fc6553aeb36fe__icon", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "loading-animation": "_5a1d53da6f830c8d__loading-animation" };
1106 if (typeof process === "undefined" || true) {
1107 registerStyle2("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
1108 }
1109 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
1110 if (typeof process === "undefined" || true) {
1111 registerStyle2("693cd16544", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._08e8a2e44959f892__outset-ring--focus,._970d04df7376df67__outset-ring--focus-within-except-active,.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible,.cd83dfc2126a0846__outset-ring--focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active,.ecadb9e080e2dfa5__outset-ring--focus-parent-visible{@media not (prefers-reduced-motion){--_gcd-a-transition:outline 0.1s ease-out;transition:outline .1s ease-out}outline:0 solid transparent;outline-offset:1px}._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-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));--_gcd-div-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: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))}}}");
1112 }
1113 var focus_default = { "outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus", "outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active", "outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible", "outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within", "outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active", "outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible" };
1114 if (typeof process === "undefined" || true) {
1115 registerStyle2("d5c1b736fd", "._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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);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 transparent)}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 transparent);transition:var(--_gcd-a-transition,none)}");
1116 }
1117 var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" };
1118 var Button3 = (0, import_element2.forwardRef)(
1119 function Button22({
1120 tone = "brand",
1121 variant = "solid",
1122 size = "default",
1123 className,
1124 focusableWhenDisabled = true,
1125 disabled,
1126 loading,
1127 loadingAnnouncement = (0, import_i18n.__)("Loading"),
1128 children,
1129 ...props
1130 }, ref) {
1131 const mergedClassName = clsx_default(
1132 global_css_defense_default2.button,
1133 resets_default["box-sizing"],
1134 focus_default["outset-ring--focus-except-active"],
1135 variant !== "unstyled" && style_default2.button,
1136 style_default2[`is-${tone}`],
1137 style_default2[`is-${variant}`],
1138 style_default2[`is-${size}`],
1139 loading && style_default2["is-loading"],
1140 className
1141 );
1142 (0, import_element2.useEffect)(() => {
1143 if (loading && loadingAnnouncement) {
1144 speak(loadingAnnouncement);
1145 }
1146 }, [loading, loadingAnnouncement]);
1147 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1148 Button,
1149 {
1150 ref,
1151 className: mergedClassName,
1152 focusableWhenDisabled,
1153 disabled: disabled ?? loading,
1154 ...props,
1155 children
1156 }
1157 );
1158 }
1159 );
1160
1161 // packages/ui/build-module/button/icon.mjs
1162 var import_element4 = __toESM(require_element(), 1);
1163
1164 // packages/ui/build-module/icon/icon.mjs
1165 var import_element3 = __toESM(require_element(), 1);
1166 var import_primitives2 = __toESM(require_primitives(), 1);
1167 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
1168 var Icon = (0, import_element3.forwardRef)(function Icon2({ icon, size = 24, ...restProps }, ref) {
1169 return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1170 import_primitives2.SVG,
1171 {
1172 ref,
1173 fill: "currentColor",
1174 ...icon.props,
1175 ...restProps,
1176 width: size,
1177 height: size
1178 }
1179 );
1180 });
1181
1182 // packages/ui/build-module/button/icon.mjs
1183 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
1184 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
1185 function getRuntime3() {
1186 const globalScope = globalThis;
1187 if (globalScope.__wpStyleRuntime) {
1188 return globalScope.__wpStyleRuntime;
1189 }
1190 globalScope.__wpStyleRuntime = {
1191 documents: /* @__PURE__ */ new Map(),
1192 styles: /* @__PURE__ */ new Map(),
1193 injectedStyles: /* @__PURE__ */ new WeakMap()
1194 };
1195 if (typeof document !== "undefined") {
1196 registerDocument3(document);
1197 }
1198 return globalScope.__wpStyleRuntime;
1199 }
1200 function documentContainsStyleHash3(targetDocument, hash) {
1201 if (!targetDocument.head) {
1202 return false;
1203 }
1204 for (const style of targetDocument.head.querySelectorAll(
1205 `style[${STYLE_HASH_ATTRIBUTE3}]`
1206 )) {
1207 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
1208 return true;
1209 }
1210 }
1211 return false;
1212 }
1213 function injectStyle3(targetDocument, hash, css) {
1214 if (!targetDocument.head) {
1215 return;
1216 }
1217 const runtime = getRuntime3();
1218 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1219 if (!injectedStyles) {
1220 injectedStyles = /* @__PURE__ */ new Set();
1221 runtime.injectedStyles.set(targetDocument, injectedStyles);
1222 }
1223 if (injectedStyles.has(hash)) {
1224 return;
1225 }
1226 if (documentContainsStyleHash3(targetDocument, hash)) {
1227 injectedStyles.add(hash);
1228 return;
1229 }
1230 const style = targetDocument.createElement("style");
1231 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
1232 style.appendChild(targetDocument.createTextNode(css));
1233 targetDocument.head.appendChild(style);
1234 injectedStyles.add(hash);
1235 }
1236 function registerDocument3(targetDocument) {
1237 const runtime = getRuntime3();
1238 runtime.documents.set(
1239 targetDocument,
1240 (runtime.documents.get(targetDocument) ?? 0) + 1
1241 );
1242 for (const [hash, css] of runtime.styles) {
1243 injectStyle3(targetDocument, hash, css);
1244 }
1245 return () => {
1246 const count = runtime.documents.get(targetDocument);
1247 if (count === void 0) {
1248 return;
1249 }
1250 if (count <= 1) {
1251 runtime.documents.delete(targetDocument);
1252 return;
1253 }
1254 runtime.documents.set(targetDocument, count - 1);
1255 };
1256 }
1257 function registerStyle3(hash, css) {
1258 const runtime = getRuntime3();
1259 runtime.styles.set(hash, css);
1260 for (const targetDocument of runtime.documents.keys()) {
1261 injectStyle3(targetDocument, hash, css);
1262 }
1263 }
1264 if (typeof process === "undefined" || true) {
1265 registerStyle3("459f56a7b7", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:499;--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:40px;--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:-4px;--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:transparent;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-block:0;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:24px}._9f6fc6553aeb36fe__icon{margin:var(--wp-ui-button-icon-margin)}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.ad0619a3217c6a5b__is-minimal[aria-pressed=true],&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:32px}._914b42f315c0e580__is-loading{color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}}');
1266 }
1267 var style_default3 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "icon": "_9f6fc6553aeb36fe__icon", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "loading-animation": "_5a1d53da6f830c8d__loading-animation" };
1268 var ButtonIcon = (0, import_element4.forwardRef)(
1269 function ButtonIcon2({ className, icon, ...props }, ref) {
1270 return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1271 Icon,
1272 {
1273 ref,
1274 icon,
1275 className: clsx_default(style_default3.icon, className),
1276 size: 24,
1277 ...props
1278 }
1279 );
1280 }
1281 );
1282
1283 // packages/ui/build-module/button/index.mjs
1284 ButtonIcon.displayName = "Button.Icon";
1285 var Button4 = Object.assign(Button3, {
1286 /**
1287 * An icon component specifically designed to work well when rendered inside
1288 * a `Button` component.
1289 */
1290 Icon: ButtonIcon
1291 });
1292
1293 // packages/ui/build-module/stack/stack.mjs
1294 var import_element5 = __toESM(require_element(), 1);
1295 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
1296 function getRuntime4() {
1297 const globalScope = globalThis;
1298 if (globalScope.__wpStyleRuntime) {
1299 return globalScope.__wpStyleRuntime;
1300 }
1301 globalScope.__wpStyleRuntime = {
1302 documents: /* @__PURE__ */ new Map(),
1303 styles: /* @__PURE__ */ new Map(),
1304 injectedStyles: /* @__PURE__ */ new WeakMap()
1305 };
1306 if (typeof document !== "undefined") {
1307 registerDocument4(document);
1308 }
1309 return globalScope.__wpStyleRuntime;
1310 }
1311 function documentContainsStyleHash4(targetDocument, hash) {
1312 if (!targetDocument.head) {
1313 return false;
1314 }
1315 for (const style of targetDocument.head.querySelectorAll(
1316 `style[${STYLE_HASH_ATTRIBUTE4}]`
1317 )) {
1318 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
1319 return true;
1320 }
1321 }
1322 return false;
1323 }
1324 function injectStyle4(targetDocument, hash, css) {
1325 if (!targetDocument.head) {
1326 return;
1327 }
1328 const runtime = getRuntime4();
1329 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1330 if (!injectedStyles) {
1331 injectedStyles = /* @__PURE__ */ new Set();
1332 runtime.injectedStyles.set(targetDocument, injectedStyles);
1333 }
1334 if (injectedStyles.has(hash)) {
1335 return;
1336 }
1337 if (documentContainsStyleHash4(targetDocument, hash)) {
1338 injectedStyles.add(hash);
1339 return;
1340 }
1341 const style = targetDocument.createElement("style");
1342 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
1343 style.appendChild(targetDocument.createTextNode(css));
1344 targetDocument.head.appendChild(style);
1345 injectedStyles.add(hash);
1346 }
1347 function registerDocument4(targetDocument) {
1348 const runtime = getRuntime4();
1349 runtime.documents.set(
1350 targetDocument,
1351 (runtime.documents.get(targetDocument) ?? 0) + 1
1352 );
1353 for (const [hash, css] of runtime.styles) {
1354 injectStyle4(targetDocument, hash, css);
1355 }
1356 return () => {
1357 const count = runtime.documents.get(targetDocument);
1358 if (count === void 0) {
1359 return;
1360 }
1361 if (count <= 1) {
1362 runtime.documents.delete(targetDocument);
1363 return;
1364 }
1365 runtime.documents.set(targetDocument, count - 1);
1366 };
1367 }
1368 function registerStyle4(hash, css) {
1369 const runtime = getRuntime4();
1370 runtime.styles.set(hash, css);
1371 for (const targetDocument of runtime.documents.keys()) {
1372 injectStyle4(targetDocument, hash, css);
1373 }
1374 }
1375 if (typeof process === "undefined" || true) {
1376 registerStyle4("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
1377 }
1378 var style_default4 = { "stack": "_19ce0419607e1896__stack" };
1379 var gapTokens = {
1380 xs: "var(--wpds-dimension-gap-xs, 4px)",
1381 sm: "var(--wpds-dimension-gap-sm, 8px)",
1382 md: "var(--wpds-dimension-gap-md, 12px)",
1383 lg: "var(--wpds-dimension-gap-lg, 16px)",
1384 xl: "var(--wpds-dimension-gap-xl, 24px)",
1385 "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
1386 "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
1387 };
1388 var Stack = (0, import_element5.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
1389 const style = {
1390 gap: gap && gapTokens[gap],
1391 alignItems: align,
1392 justifyContent: justify,
1393 flexDirection: direction,
1394 flexWrap: wrap
1395 };
1396 const element = useRender({
1397 render,
1398 ref,
1399 props: mergeProps(props, { style, className: style_default4.stack })
1400 });
1401 return element;
1402 });
1403
1404 // packages/style-runtime/src/index.ts
1405 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
1406 function getRuntime5() {
1407 const globalScope = globalThis;
1408 if (globalScope.__wpStyleRuntime) {
1409 return globalScope.__wpStyleRuntime;
1410 }
1411 globalScope.__wpStyleRuntime = {
1412 documents: /* @__PURE__ */ new Map(),
1413 styles: /* @__PURE__ */ new Map(),
1414 injectedStyles: /* @__PURE__ */ new WeakMap()
1415 };
1416 if (typeof document !== "undefined") {
1417 registerDocument5(document);
1418 }
1419 return globalScope.__wpStyleRuntime;
1420 }
1421 function documentContainsStyleHash5(targetDocument, hash) {
1422 if (!targetDocument.head) {
1423 return false;
1424 }
1425 for (const style of targetDocument.head.querySelectorAll(
1426 `style[${STYLE_HASH_ATTRIBUTE5}]`
1427 )) {
1428 if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
1429 return true;
1430 }
1431 }
1432 return false;
1433 }
1434 function injectStyle5(targetDocument, hash, css) {
1435 if (!targetDocument.head) {
1436 return;
1437 }
1438 const runtime = getRuntime5();
1439 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1440 if (!injectedStyles) {
1441 injectedStyles = /* @__PURE__ */ new Set();
1442 runtime.injectedStyles.set(targetDocument, injectedStyles);
1443 }
1444 if (injectedStyles.has(hash)) {
1445 return;
1446 }
1447 if (documentContainsStyleHash5(targetDocument, hash)) {
1448 injectedStyles.add(hash);
1449 return;
1450 }
1451 const style = targetDocument.createElement("style");
1452 style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
1453 style.appendChild(targetDocument.createTextNode(css));
1454 targetDocument.head.appendChild(style);
1455 injectedStyles.add(hash);
1456 }
1457 function registerDocument5(targetDocument) {
1458 const runtime = getRuntime5();
1459 runtime.documents.set(
1460 targetDocument,
1461 (runtime.documents.get(targetDocument) ?? 0) + 1
1462 );
1463 for (const [hash, css] of runtime.styles) {
1464 injectStyle5(targetDocument, hash, css);
1465 }
1466 return () => {
1467 const count = runtime.documents.get(targetDocument);
1468 if (count === void 0) {
1469 return;
1470 }
1471 if (count <= 1) {
1472 runtime.documents.delete(targetDocument);
1473 return;
1474 }
1475 runtime.documents.set(targetDocument, count - 1);
1476 };
1477 }
1478 function registerStyle5(hash, css) {
1479 const runtime = getRuntime5();
1480 runtime.styles.set(hash, css);
1481 for (const targetDocument of runtime.documents.keys()) {
1482 injectStyle5(targetDocument, hash, css);
1483 }
1484 }
1485
1486 // widgets/site-preview/style.module.css
1487 if (typeof process === "undefined" || true) {
1488 registerStyle5("45e811b777", "._528f94b7f3c8f19c__container{aspect-ratio:3/4;height:100%;overflow:hidden;width:100%}._8b42f316c31ff9a3__urlBar{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);flex-shrink:0}._8b42f316c31ff9a3__urlBar,.dfc67cc19791df23__urlField{padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px)}.dfc67cc19791df23__urlField{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:var(--wpds-border-radius-lg,8px);min-width:0}.d5d9069549093b8f__urlFavicon{flex-shrink:0;height:var(--wpds-typography-font-size-xs,11px);object-fit:contain;width:var(--wpds-typography-font-size-xs,11px)}._058ef3456ba3e4a3__urlIcon{color:var(--wpds-color-fg-content-neutral-weak,#707070);flex-shrink:0}._89b1c819076c4701__urlText{color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;font-size:var(--wpds-typography-font-size-xs,11px);line-height:var(--wpds-typography-line-height-xs,16px);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9f1f45e96a0d2105__previewWrap{flex:1;min-height:0;position:relative}.c1322576565e9858__loading{inset:0;position:absolute;z-index:1}._80c298aa7d9d30b1__iframe{inset-block-start:0;inset-inline-start:50%;min-height:375%;position:absolute;transform:translate(-50%) scale(.4);transform-origin:center top;width:250%}._017ce5123c2e1282__overlay{backdrop-filter:blur(1px);background:color-mix(in srgb,var(--wpds-color-fg-content-neutral-weak,#707070) 20%,transparent);inset:0;opacity:0;position:absolute}._9f1f45e96a0d2105__previewWrap:focus-within ._017ce5123c2e1282__overlay,._9f1f45e96a0d2105__previewWrap:hover ._017ce5123c2e1282__overlay{opacity:1}@media not (prefers-reduced-motion){._017ce5123c2e1282__overlay{transition:opacity var(--wpds-motion-duration-lg,.3s) var(--wpds-motion-easing-expressive,cubic-bezier(.25,0,0,1))}}");
1489 }
1490 var style_default5 = { "container": "_528f94b7f3c8f19c__container", "urlBar": "_8b42f316c31ff9a3__urlBar", "urlField": "dfc67cc19791df23__urlField", "urlFavicon": "d5d9069549093b8f__urlFavicon", "urlIcon": "_058ef3456ba3e4a3__urlIcon", "urlText": "_89b1c819076c4701__urlText", "previewWrap": "_9f1f45e96a0d2105__previewWrap", "loading": "c1322576565e9858__loading", "iframe": "_80c298aa7d9d30b1__iframe", "overlay": "_017ce5123c2e1282__overlay" };
1491
1492 // widgets/site-preview/render.tsx
1493 var import_jsx_runtime5 = __toESM(require_jsx_runtime());
1494 function PreviewUrlBar({
1495 siteUrl,
1496 siteIconUrl
1497 }) {
1498 return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: style_default5.urlBar, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1499 Stack,
1500 {
1501 direction: "row",
1502 align: "center",
1503 gap: "xs",
1504 className: style_default5.urlField,
1505 children: [
1506 siteIconUrl ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1507 "img",
1508 {
1509 className: style_default5.urlFavicon,
1510 src: siteIconUrl,
1511 alt: ""
1512 }
1513 ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1514 Icon,
1515 {
1516 className: style_default5.urlIcon,
1517 icon: wordpress_default,
1518 size: 12
1519 }
1520 ),
1521 /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { className: style_default5.urlText, children: siteUrl })
1522 ]
1523 }
1524 ) });
1525 }
1526 function SitePreview() {
1527 const [isIframeLoading, setIsIframeLoading] = (0, import_element6.useState)(true);
1528 const [isVisitLoading, setIsVisitLoading] = (0, import_element6.useState)(false);
1529 const [isEditLoading, setIsEditLoading] = (0, import_element6.useState)(false);
1530 const { siteUrl, siteIconUrl } = (0, import_data.useSelect)((select) => {
1531 const site = select(import_core_data.store).getEntityRecord(
1532 "root",
1533 "site",
1534 void 0
1535 );
1536 const base = select(import_core_data.store).getEntityRecord("root", "__unstableBase", void 0);
1537 return {
1538 siteUrl: site?.url,
1539 siteIconUrl: base?.site_icon_url
1540 };
1541 }, []);
1542 const isBlockTheme = (0, import_data.useSelect)(
1543 (select) => !!select(import_core_data.store).getCurrentTheme()?.is_block_theme,
1544 []
1545 );
1546 (0, import_element6.useEffect)(() => {
1547 setIsIframeLoading(true);
1548 }, [siteUrl]);
1549 if (!siteUrl) {
1550 return null;
1551 }
1552 const src = (0, import_url.addQueryArgs)(siteUrl, {
1553 wp_site_preview: 1
1554 });
1555 const editUrl = isBlockTheme ? "site-editor.php" : "customize.php";
1556 return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Stack, { direction: "column", className: style_default5.container, children: [
1557 /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PreviewUrlBar, { siteUrl, siteIconUrl }),
1558 /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: style_default5.previewWrap, children: [
1559 isIframeLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1560 Stack,
1561 {
1562 direction: "column",
1563 align: "center",
1564 justify: "center",
1565 className: style_default5.loading,
1566 children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components.Spinner, {})
1567 }
1568 ),
1569 /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1570 "iframe",
1571 {
1572 className: style_default5.iframe,
1573 loading: "lazy",
1574 scrolling: "no",
1575 title: (0, import_i18n2.__)("Site preview"),
1576 src,
1577 onLoad: () => setIsIframeLoading(false),
1578 inert: "true"
1579 }
1580 ),
1581 !isIframeLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1582 Stack,
1583 {
1584 direction: "row",
1585 align: "center",
1586 justify: "center",
1587 gap: "sm",
1588 className: style_default5.overlay,
1589 children: [
1590 /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1591 Button4,
1592 {
1593 variant: "solid",
1594 tone: "neutral",
1595 loading: isVisitLoading,
1596 onClick: () => {
1597 setIsVisitLoading(true);
1598 window.location.href = siteUrl;
1599 },
1600 children: (0, import_i18n2.__)("Visit")
1601 }
1602 ),
1603 /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1604 Button4,
1605 {
1606 variant: "solid",
1607 tone: "brand",
1608 loading: isEditLoading,
1609 onClick: () => {
1610 setIsEditLoading(true);
1611 window.location.href = editUrl;
1612 },
1613 children: (0, import_i18n2.__)("Edit site")
1614 }
1615 )
1616 ]
1617 }
1618 )
1619 ] })
1620 ] });
1621 }
1622 export {
1623 SitePreview as default
1624 };
1625