PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.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 All 404 releases
← All changes | build/scripts/edit-post/index.js +9538 -764 23.1.0 → trunk View file →
@@ -1,4 +1,5 @@
1 +(function() {
1 2 var wp;
2 3 (wp ||= {}).editPost = (() => {
3 4 var __create = Object.create;
4 5 var __defProp = Object.defineProperty;
@@ -86,8 +87,22 @@
86 87 module.exports = window.wp.editor;
87 88 }
88 89 });
89 90
91 + // package-external:@wordpress/core-data
92 + var require_core_data = __commonJS({
93 + "package-external:@wordpress/core-data"(exports, module) {
94 + module.exports = window.wp.coreData;
95 + }
96 + });
97 +
98 + // package-external:@wordpress/api-fetch
99 + var require_api_fetch = __commonJS({
100 + "package-external:@wordpress/api-fetch"(exports, module) {
101 + module.exports = window.wp.apiFetch;
102 + }
103 + });
104 +
90 105 // package-external:@wordpress/i18n
91 106 var require_i18n = __commonJS({
92 107 "package-external:@wordpress/i18n"(exports, module) {
93 108 module.exports = window.wp.i18n;
@@ -107,15 +122,170 @@
107 122 module.exports = window.ReactJSXRuntime;
108 123 }
109 124 });
110 125
111 - // package-external:@wordpress/primitives
112 - var require_primitives = __commonJS({
113 - "package-external:@wordpress/primitives"(exports, module) {
114 - module.exports = window.wp.primitives;
126 + // vendor-external:react-dom
127 + var require_react_dom = __commonJS({
128 + "vendor-external:react-dom"(exports, module) {
129 + module.exports = window.ReactDOM;
115 130 }
116 131 });
117 132
133 + // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
134 + var require_use_sync_external_store_shim_development = __commonJS({
135 + "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
136 + "use strict";
137 + (function() {
138 + function is(x, y) {
139 + return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
140 + }
141 + function useSyncExternalStore$2(subscribe, getSnapshot) {
142 + didWarnOld18Alpha || void 0 === React48.startTransition || (didWarnOld18Alpha = true, console.error(
143 + "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
144 + ));
145 + var value = getSnapshot();
146 + if (!didWarnUncachedGetSnapshot) {
147 + var cachedValue = getSnapshot();
148 + objectIs(value, cachedValue) || (console.error(
149 + "The result of getSnapshot should be cached to avoid an infinite loop"
150 + ), didWarnUncachedGetSnapshot = true);
151 + }
152 + cachedValue = useState16({
153 + inst: { value, getSnapshot }
154 + });
155 + var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
156 + useLayoutEffect4(
157 + function() {
158 + inst.value = value;
159 + inst.getSnapshot = getSnapshot;
160 + checkIfSnapshotChanged(inst) && forceUpdate({ inst });
161 + },
162 + [subscribe, value, getSnapshot]
163 + );
164 + useEffect17(
165 + function() {
166 + checkIfSnapshotChanged(inst) && forceUpdate({ inst });
167 + return subscribe(function() {
168 + checkIfSnapshotChanged(inst) && forceUpdate({ inst });
169 + });
170 + },
171 + [subscribe]
172 + );
173 + useDebugValue2(value);
174 + return value;
175 + }
176 + function checkIfSnapshotChanged(inst) {
177 + var latestGetSnapshot = inst.getSnapshot;
178 + inst = inst.value;
179 + try {
180 + var nextValue = latestGetSnapshot();
181 + return !objectIs(inst, nextValue);
182 + } catch (error) {
183 + return true;
184 + }
185 + }
186 + function useSyncExternalStore$1(subscribe, getSnapshot) {
187 + return getSnapshot();
188 + }
189 + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
190 + var React48 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState16 = React48.useState, useEffect17 = React48.useEffect, useLayoutEffect4 = React48.useLayoutEffect, useDebugValue2 = React48.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
191 + exports.useSyncExternalStore = void 0 !== React48.useSyncExternalStore ? React48.useSyncExternalStore : shim;
192 + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
193 + })();
194 + }
195 + });
196 +
197 + // node_modules/use-sync-external-store/shim/index.js
198 + var require_shim = __commonJS({
199 + "node_modules/use-sync-external-store/shim/index.js"(exports, module) {
200 + "use strict";
201 + if (false) {
202 + module.exports = null;
203 + } else {
204 + module.exports = require_use_sync_external_store_shim_development();
205 + }
206 + }
207 + });
208 +
209 + // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
210 + var require_with_selector_development = __commonJS({
211 + "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
212 + "use strict";
213 + (function() {
214 + function is(x, y) {
215 + return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
216 + }
217 + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
218 + var React48 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef22 = React48.useRef, useEffect17 = React48.useEffect, useMemo17 = React48.useMemo, useDebugValue2 = React48.useDebugValue;
219 + exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
220 + var instRef = useRef22(null);
221 + if (null === instRef.current) {
222 + var inst = { hasValue: false, value: null };
223 + instRef.current = inst;
224 + } else inst = instRef.current;
225 + instRef = useMemo17(
226 + function() {
227 + function memoizedSelector(nextSnapshot) {
228 + if (!hasMemo) {
229 + hasMemo = true;
230 + memoizedSnapshot = nextSnapshot;
231 + nextSnapshot = selector(nextSnapshot);
232 + if (void 0 !== isEqual && inst.hasValue) {
233 + var currentSelection = inst.value;
234 + if (isEqual(currentSelection, nextSnapshot))
235 + return memoizedSelection = currentSelection;
236 + }
237 + return memoizedSelection = nextSnapshot;
238 + }
239 + currentSelection = memoizedSelection;
240 + if (objectIs(memoizedSnapshot, nextSnapshot))
241 + return currentSelection;
242 + var nextSelection = selector(nextSnapshot);
243 + if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
244 + return memoizedSnapshot = nextSnapshot, currentSelection;
245 + memoizedSnapshot = nextSnapshot;
246 + return memoizedSelection = nextSelection;
247 + }
248 + var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
249 + return [
250 + function() {
251 + return memoizedSelector(getSnapshot());
252 + },
253 + null === maybeGetServerSnapshot ? void 0 : function() {
254 + return memoizedSelector(maybeGetServerSnapshot());
255 + }
256 + ];
257 + },
258 + [getSnapshot, getServerSnapshot, selector, isEqual]
259 + );
260 + var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]);
261 + useEffect17(
262 + function() {
263 + inst.hasValue = true;
264 + inst.value = value;
265 + },
266 + [value]
267 + );
268 + useDebugValue2(value);
269 + return value;
270 + };
271 + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
272 + })();
273 + }
274 + });
275 +
276 + // node_modules/use-sync-external-store/shim/with-selector.js
277 + var require_with_selector = __commonJS({
278 + "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) {
279 + "use strict";
280 + if (false) {
281 + module.exports = null;
282 + } else {
283 + module.exports = require_with_selector_development();
284 + }
285 + }
286 + });
287 +
118 288 // package-external:@wordpress/compose
119 289 var require_compose = __commonJS({
120 290 "package-external:@wordpress/compose"(exports, module) {
121 291 module.exports = window.wp.compose;
@@ -121,8 +291,15 @@
121 291 module.exports = window.wp.compose;
122 292 }
123 293 });
124 294
295 + // package-external:@wordpress/theme
296 + var require_theme = __commonJS({
297 + "package-external:@wordpress/theme"(exports, module) {
298 + module.exports = window.wp.theme;
299 + }
300 + });
301 +
125 302 // package-external:@wordpress/private-apis
126 303 var require_private_apis = __commonJS({
127 304 "package-external:@wordpress/private-apis"(exports, module) {
128 305 module.exports = window.wp.privateApis;
@@ -128,8 +305,15 @@
128 305 module.exports = window.wp.privateApis;
129 306 }
130 307 });
131 308
309 + // package-external:@wordpress/primitives
310 + var require_primitives = __commonJS({
311 + "package-external:@wordpress/primitives"(exports, module) {
312 + module.exports = window.wp.primitives;
313 + }
314 + });
315 +
132 316 // package-external:@wordpress/components
133 317 var require_components = __commonJS({
134 318 "package-external:@wordpress/components"(exports, module) {
135 319 module.exports = window.wp.components;
@@ -184,15 +368,8 @@
184 368 module.exports = window.wp.htmlEntities;
185 369 }
186 370 });
187 371
188 - // package-external:@wordpress/core-data
189 - var require_core_data = __commonJS({
190 - "package-external:@wordpress/core-data"(exports, module) {
191 - module.exports = window.wp.coreData;
192 - }
193 - });
194 -
195 372 // package-external:@wordpress/keyboard-shortcuts
196 373 var require_keyboard_shortcuts = __commonJS({
197 374 "package-external:@wordpress/keyboard-shortcuts"(exports, module) {
198 375 module.exports = window.wp.keyboardShortcuts;
@@ -198,15 +375,8 @@
198 375 module.exports = window.wp.keyboardShortcuts;
199 376 }
200 377 });
201 378
202 - // package-external:@wordpress/api-fetch
203 - var require_api_fetch = __commonJS({
204 - "package-external:@wordpress/api-fetch"(exports, module) {
205 - module.exports = window.wp.apiFetch;
206 - }
207 - });
208 -
209 379 // package-external:@wordpress/hooks
210 380 var require_hooks = __commonJS({
211 381 "package-external:@wordpress/hooks"(exports, module) {
212 382 module.exports = window.wp.hooks;
@@ -237,16 +407,18 @@
237 407 initializeEditor: () => initializeEditor,
238 408 reinitializeEditor: () => reinitializeEditor,
239 409 store: () => store
240 410 });
241 - var import_blocks3 = __toESM(require_blocks(), 1);
242 - var import_block_library2 = __toESM(require_block_library(), 1);
411 + var import_blocks2 = __toESM(require_blocks(), 1);
412 + var import_block_library = __toESM(require_block_library(), 1);
243 413 var import_deprecated4 = __toESM(require_deprecated(), 1);
244 - var import_element14 = __toESM(require_element(), 1);
245 - var import_data26 = __toESM(require_data(), 1);
414 + var import_element30 = __toESM(require_element(), 1);
415 + var import_data27 = __toESM(require_data(), 1);
246 416 var import_preferences11 = __toESM(require_preferences(), 1);
247 417 var import_widgets = __toESM(require_widgets(), 1);
248 - var import_editor20 = __toESM(require_editor(), 1);
418 + var import_editor21 = __toESM(require_editor(), 1);
419 + var import_core_data10 = __toESM(require_core_data(), 1);
420 + var import_api_fetch2 = __toESM(require_api_fetch(), 1);
249 421
250 422 // node_modules/clsx/dist/clsx.mjs
251 423 function r(e) {
252 424 var t, f, n = "";
@@ -262,13 +434,42 @@
262 434 return n;
263 435 }
264 436 var clsx_default = clsx;
265 437
266 - // node_modules/@base-ui/utils/esm/useRefWithInit.js
438 + // node_modules/@base-ui/utils/createLogOnce.mjs
439 + var loggedMessages;
440 + if (true) {
441 + loggedMessages = /* @__PURE__ */ new Set();
442 + }
443 + function createLogOnce(severity, prefix) {
444 + return function logOnce(...messages) {
445 + if (true) {
446 + const message = messages.join(" ");
447 + const output = prefix ? `${prefix}: ${message}` : message;
448 + const key = `${severity}:${output}`;
449 + if (!loggedMessages.has(key)) {
450 + loggedMessages.add(key);
451 + if (severity === "warn") {
452 + console.warn(output);
453 + } else {
454 + console.error(output);
455 + }
456 + }
457 + }
458 + };
459 + }
460 +
461 + // node_modules/@base-ui/utils/safeReact.mjs
267 462 var React = __toESM(require_react(), 1);
463 + var SafeReact = {
464 + ...React
465 + };
466 +
467 + // node_modules/@base-ui/utils/useRefWithInit.mjs
468 + var React2 = __toESM(require_react(), 1);
268 469 var UNINITIALIZED = {};
269 470 function useRefWithInit(init, initArg) {
270 - const ref = React.useRef(UNINITIALIZED);
471 + const ref = React2.useRef(UNINITIALIZED);
271 472 if (ref.current === UNINITIALIZED) {
272 473 ref.current = init(initArg);
273 474 }
274 475 return ref;
@@ -273,27 +474,60 @@
273 474 }
274 475 return ref;
275 476 }
276 477
277 - // node_modules/@base-ui/utils/esm/warn.js
278 - var set;
279 - if (true) {
280 - set = /* @__PURE__ */ new Set();
478 + // node_modules/@base-ui/utils/useStableCallback.mjs
479 + var useInsertionEffect = SafeReact.useInsertionEffect;
480 + var useSafeInsertionEffect = (
481 + // React 17 doesn't have useInsertionEffect.
482 + useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
483 + useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn()
484 + );
485 + function useStableCallback(callback) {
486 + const stable = useRefWithInit(createStableCallback).current;
487 + stable.next = callback;
488 + useSafeInsertionEffect(stable.effect);
489 + return stable.trampoline;
281 490 }
282 - function warn(...messages) {
491 + function createStableCallback() {
492 + const stable = {
493 + next: void 0,
494 + callback: assertNotCalled,
495 + trampoline: (...args) => stable.callback?.(...args),
496 + effect: () => {
497 + stable.callback = stable.next;
498 + }
499 + };
500 + return stable;
501 + }
502 + function assertNotCalled() {
283 503 if (true) {
284 - const messageKey = messages.join(" ");
285 - if (!set.has(messageKey)) {
286 - set.add(messageKey);
287 - console.warn(`Base UI: ${messageKey}`);
288 - }
504 + throw (
505 + /* minify-error-disabled */
506 + new Error("Base UI: Cannot call an event handler while rendering.")
507 + );
289 508 }
290 509 }
291 510
292 - // node_modules/@base-ui/react/esm/internals/useRenderElement.js
293 - var React4 = __toESM(require_react(), 1);
511 + // node_modules/@base-ui/utils/warn.mjs
512 + var warn = createLogOnce("warn", "Base UI");
294 513
295 - // node_modules/@base-ui/utils/esm/useMergedRefs.js
514 + // node_modules/@base-ui/utils/empty.mjs
515 + function NOOP() {
516 + }
517 + var EMPTY_ARRAY = Object.freeze([]);
518 + var EMPTY_OBJECT = Object.freeze({});
519 +
520 + // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
521 + var React3 = __toESM(require_react(), 1);
522 + var noop = () => {
523 + };
524 + var useIsoLayoutEffect = typeof document !== "undefined" ? React3.useLayoutEffect : noop;
525 +
526 + // node_modules/@base-ui/react/internals/useRenderElement.mjs
527 + var React6 = __toESM(require_react(), 1);
528 +
529 + // node_modules/@base-ui/utils/useMergedRefs.mjs
296 530 function useMergedRefs(a, b, c, d) {
297 531 const forkRef = useRefWithInit(createForkRef).current;
298 532 if (didChange(forkRef, a, b, c, d)) {
299 533 update(forkRef, [a, b, c, d]);
@@ -317,9 +551,9 @@
317 551 function didChange(forkRef, a, b, c, d) {
318 552 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
319 553 }
320 554 function didChangeN(forkRef, newRefs) {
321 - return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
555 + return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]);
322 556 }
323 557 function update(forkRef, refs) {
324 558 forkRef.refs = refs;
325 559 if (refs.every((ref) => ref == null)) {
@@ -364,9 +598,9 @@
364 598 const cleanupCallback = cleanupCallbacks[i];
365 599 if (typeof cleanupCallback === "function") {
366 600 cleanupCallback();
367 601 } else {
368 - ref(null);
602 + void ref(null);
369 603 }
370 604 break;
371 605 }
372 606 case "object": {
@@ -380,21 +614,21 @@
380 614 }
381 615 };
382 616 }
383 617
384 - // node_modules/@base-ui/utils/esm/getReactElementRef.js
385 - var React3 = __toESM(require_react(), 1);
618 + // node_modules/@base-ui/utils/getReactElementRef.mjs
619 + var React5 = __toESM(require_react(), 1);
386 620
387 - // node_modules/@base-ui/utils/esm/reactVersion.js
388 - var React2 = __toESM(require_react(), 1);
389 - var majorVersion = parseInt(React2.version, 10);
621 + // node_modules/@base-ui/utils/reactVersion.mjs
622 + var React4 = __toESM(require_react(), 1);
623 + var majorVersion = parseInt(React4.version, 10);
390 624 function isReactVersionAtLeast(reactVersionToCheck) {
391 625 return majorVersion >= reactVersionToCheck;
392 626 }
393 627
394 - // node_modules/@base-ui/utils/esm/getReactElementRef.js
628 + // node_modules/@base-ui/utils/getReactElementRef.mjs
395 629 function getReactElementRef(element) {
396 - if (!/* @__PURE__ */ React3.isValidElement(element)) {
630 + if (!/* @__PURE__ */ React5.isValidElement(element)) {
397 631 return null;
398 632 }
399 633 const reactElement = element;
400 634 const propsWithRef = reactElement.props;
@@ -400,9 +634,9 @@
400 634 const propsWithRef = reactElement.props;
401 635 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
402 636 }
403 637
404 - // node_modules/@base-ui/utils/esm/mergeObjects.js
638 + // node_modules/@base-ui/utils/mergeObjects.mjs
405 639 function mergeObjects(a, b) {
406 640 if (a && !b) {
407 641 return a;
408 642 }
@@ -417,13 +651,9 @@
417 651 }
418 652 return void 0;
419 653 }
420 654
421 - // node_modules/@base-ui/utils/esm/empty.js
422 - var EMPTY_ARRAY = Object.freeze([]);
423 - var EMPTY_OBJECT = Object.freeze({});
424 -
425 - // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
655 + // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
426 656 function getStateAttributesProps(state, customMapping) {
427 657 const props = {};
428 658 for (const key in state) {
429 659 const value = state[key];
@@ -442,19 +672,19 @@
442 672 }
443 673 return props;
444 674 }
445 675
446 - // node_modules/@base-ui/react/esm/utils/resolveClassName.js
676 + // node_modules/@base-ui/react/utils/resolveClassName.mjs
447 677 function resolveClassName(className, state) {
448 678 return typeof className === "function" ? className(state) : className;
449 679 }
450 680
451 - // node_modules/@base-ui/react/esm/utils/resolveStyle.js
681 + // node_modules/@base-ui/react/utils/resolveStyle.mjs
452 682 function resolveStyle(style, state) {
453 683 return typeof style === "function" ? style(state) : style;
454 684 }
455 685
456 - // node_modules/@base-ui/react/esm/merge-props/mergeProps.js
686 + // node_modules/@base-ui/react/merge-props/mergeProps.mjs
457 687 var EMPTY_PROPS = {};
458 688 function mergeProps(a, b, c, d, e) {
459 689 if (!c && !d && !e && !a) {
460 690 return createInitialMergedProps(b);
@@ -607,13 +837,16 @@
607 837 function isSyntheticEvent(event) {
608 838 return event != null && typeof event === "object" && "nativeEvent" in event;
609 839 }
610 840
611 - // node_modules/@base-ui/react/esm/internals/useRenderElement.js
841 + // node_modules/@base-ui/react/internals/useRenderElement.mjs
612 842 var import_react = __toESM(require_react(), 1);
613 843 function useRenderElement(element, componentProps, params = {}) {
614 - const renderProp = componentProps.render;
615 - const outProps = useRenderElementProps(componentProps, params);
844 + let renderProp = componentProps.render;
845 + if (params.enabled !== false) {
846 + renderProp = unwrapLazyRenderProp(renderProp);
847 + }
848 + const outProps = useRenderElementProps(componentProps, params, renderProp);
616 849 if (params.enabled === false) {
617 850 return null;
618 851 }
619 852 const state = params.state ?? EMPTY_OBJECT;
@@ -618,13 +851,12 @@
618 851 }
619 852 const state = params.state ?? EMPTY_OBJECT;
620 853 return evaluateRenderProp(element, renderProp, outProps, state);
621 854 }
622 - function useRenderElementProps(componentProps, params = {}) {
855 + function useRenderElementProps(componentProps, params, renderProp) {
623 856 const {
624 857 className: classNameProp,
625 - style: styleProp,
626 - render: renderProp
858 + style: styleProp
627 859 } = componentProps;
628 860 const {
629 861 state = EMPTY_OBJECT,
630 862 ref,
@@ -638,9 +870,9 @@
638 870 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
639 871 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
640 872 if (typeof document !== "undefined") {
641 873 if (!enabled) {
642 - useMergedRefs(null, null);
874 + void useMergedRefs(null, null);
643 875 } else if (Array.isArray(ref)) {
644 876 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
645 877 } else {
646 878 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
@@ -665,8 +897,15 @@
665 897 }
666 898 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
667 899 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
668 900 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
901 + function unwrapLazyRenderProp(render) {
902 + if (render?.$$typeof !== REACT_LAZY_TYPE) {
903 + return render;
904 + }
905 + const unwrapped = React6.Children.toArray(render)[0];
906 + return /* @__PURE__ */ React6.isValidElement(unwrapped) ? unwrapped : render;
907 + }
669 908 function evaluateRenderProp(element, render, props, state) {
670 909 if (render) {
671 910 if (typeof render === "function") {
672 911 if (true) {
@@ -675,19 +914,14 @@
675 914 return render(props, state);
676 915 }
677 916 const mergedProps = mergeProps(props, render.props);
678 917 mergedProps.ref = props.ref;
679 - let newElement = render;
680 - if (newElement?.$$typeof === REACT_LAZY_TYPE) {
681 - const children = React4.Children.toArray(render);
682 - newElement = children[0];
683 - }
684 918 if (true) {
685 - if (!/* @__PURE__ */ React4.isValidElement(newElement)) {
919 + if (!/* @__PURE__ */ React6.isValidElement(render)) {
686 920 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"));
687 921 }
688 922 }
689 - return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps);
923 + return /* @__PURE__ */ React6.cloneElement(render, mergedProps);
690 924 }
691 925 if (element) {
692 926 if (typeof element === "string") {
693 927 return renderTag(element, props);
@@ -722,57 +956,8298 @@
722 956 ...props,
723 957 key: props.key
724 958 });
725 959 }
726 - return /* @__PURE__ */ React4.createElement(Tag, props);
960 + return /* @__PURE__ */ React6.createElement(Tag, props);
727 961 }
728 962
729 - // node_modules/@base-ui/react/esm/use-render/useRender.js
963 + // node_modules/@base-ui/utils/useId.mjs
964 + var React7 = __toESM(require_react(), 1);
965 + var globalId = 0;
966 + function useGlobalId(idOverride, prefix = "mui") {
967 + const [defaultId, setDefaultId] = React7.useState(idOverride);
968 + const id = idOverride || defaultId;
969 + React7.useEffect(() => {
970 + if (defaultId == null) {
971 + globalId += 1;
972 + setDefaultId(`${prefix}-${globalId}`);
973 + }
974 + }, [defaultId, prefix]);
975 + return id;
976 + }
977 + var maybeReactUseId = SafeReact.useId;
978 + function useId(idOverride, prefix) {
979 + if (maybeReactUseId !== void 0) {
980 + const reactId = maybeReactUseId();
981 + return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
982 + }
983 + return useGlobalId(idOverride, prefix);
984 + }
985 +
986 + // node_modules/@base-ui/react/internals/useBaseUiId.mjs
987 + function useBaseUiId(idOverride) {
988 + return useId(idOverride, "base-ui");
989 + }
990 +
991 + // node_modules/@base-ui/react/internals/reason-parts.mjs
992 + var reason_parts_exports = {};
993 + __export(reason_parts_exports, {
994 + cancelOpen: () => cancelOpen,
995 + chipRemovePress: () => chipRemovePress,
996 + clearPress: () => clearPress,
997 + closePress: () => closePress,
998 + closeWatcher: () => closeWatcher,
999 + decrementPress: () => decrementPress,
1000 + disabled: () => disabled,
1001 + drag: () => drag,
1002 + escapeKey: () => escapeKey,
1003 + focusOut: () => focusOut,
1004 + imperativeAction: () => imperativeAction,
1005 + incrementPress: () => incrementPress,
1006 + initial: () => initial,
1007 + inputBlur: () => inputBlur,
1008 + inputChange: () => inputChange,
1009 + inputClear: () => inputClear,
1010 + inputPaste: () => inputPaste,
1011 + inputPress: () => inputPress,
1012 + itemPress: () => itemPress,
1013 + keyboard: () => keyboard,
1014 + linkPress: () => linkPress,
1015 + listNavigation: () => listNavigation,
1016 + missing: () => missing,
1017 + none: () => none,
1018 + outsidePress: () => outsidePress,
1019 + pointer: () => pointer,
1020 + scrub: () => scrub,
1021 + siblingOpen: () => siblingOpen,
1022 + swipe: () => swipe,
1023 + trackPress: () => trackPress,
1024 + triggerFocus: () => triggerFocus,
1025 + triggerHover: () => triggerHover,
1026 + triggerPress: () => triggerPress,
1027 + wheel: () => wheel,
1028 + windowResize: () => windowResize
1029 + });
1030 + var none = "none";
1031 + var triggerPress = "trigger-press";
1032 + var triggerHover = "trigger-hover";
1033 + var triggerFocus = "trigger-focus";
1034 + var outsidePress = "outside-press";
1035 + var itemPress = "item-press";
1036 + var closePress = "close-press";
1037 + var linkPress = "link-press";
1038 + var clearPress = "clear-press";
1039 + var chipRemovePress = "chip-remove-press";
1040 + var trackPress = "track-press";
1041 + var incrementPress = "increment-press";
1042 + var decrementPress = "decrement-press";
1043 + var inputChange = "input-change";
1044 + var inputClear = "input-clear";
1045 + var inputBlur = "input-blur";
1046 + var inputPaste = "input-paste";
1047 + var inputPress = "input-press";
1048 + var focusOut = "focus-out";
1049 + var escapeKey = "escape-key";
1050 + var closeWatcher = "close-watcher";
1051 + var listNavigation = "list-navigation";
1052 + var keyboard = "keyboard";
1053 + var pointer = "pointer";
1054 + var drag = "drag";
1055 + var wheel = "wheel";
1056 + var scrub = "scrub";
1057 + var cancelOpen = "cancel-open";
1058 + var siblingOpen = "sibling-open";
1059 + var disabled = "disabled";
1060 + var missing = "missing";
1061 + var initial = "initial";
1062 + var imperativeAction = "imperative-action";
1063 + var swipe = "swipe";
1064 + var windowResize = "window-resize";
1065 +
1066 + // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
1067 + function createChangeEventDetails(reason, event, trigger, customProperties) {
1068 + let canceled = false;
1069 + let allowPropagation = false;
1070 + const custom = customProperties ?? EMPTY_OBJECT;
1071 + const details = {
1072 + reason,
1073 + event: event ?? new Event("base-ui"),
1074 + cancel() {
1075 + canceled = true;
1076 + },
1077 + allowPropagation() {
1078 + allowPropagation = true;
1079 + },
1080 + get isCanceled() {
1081 + return canceled;
1082 + },
1083 + get isPropagationAllowed() {
1084 + return allowPropagation;
1085 + },
1086 + trigger,
1087 + ...custom
1088 + };
1089 + return details;
1090 + }
1091 +
1092 + // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1093 + var React9 = __toESM(require_react(), 1);
1094 +
1095 + // node_modules/@base-ui/utils/useOnMount.mjs
1096 + var React8 = __toESM(require_react(), 1);
1097 + function useOnMount(fn) {
1098 + React8.useEffect(fn, EMPTY_ARRAY);
1099 + }
1100 +
1101 + // node_modules/@base-ui/utils/useAnimationFrame.mjs
1102 + var EMPTY = null;
1103 + var LAST_RAF = globalThis.requestAnimationFrame;
1104 + var Scheduler = class {
1105 + /* This implementation uses an array as a backing data-structure for frame callbacks.
1106 + * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
1107 + * never calls the native `cancelAnimationFrame` if there are no frames left. This can
1108 + * be much more efficient if there is a call pattern that alterns as
1109 + * "request-cancel-request-cancel-…".
1110 + * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
1111 + * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
1112 + callbacks = [];
1113 + callbacksCount = 0;
1114 + nextId = 1;
1115 + startId = 1;
1116 + isScheduled = false;
1117 + tick = (timestamp) => {
1118 + this.isScheduled = false;
1119 + const currentCallbacks = this.callbacks;
1120 + const currentCallbacksCount = this.callbacksCount;
1121 + this.callbacks = [];
1122 + this.callbacksCount = 0;
1123 + this.startId = this.nextId;
1124 + if (currentCallbacksCount > 0) {
1125 + for (let i = 0; i < currentCallbacks.length; i += 1) {
1126 + currentCallbacks[i]?.(timestamp);
1127 + }
1128 + }
1129 + };
1130 + request(fn) {
1131 + const id = this.nextId;
1132 + this.nextId += 1;
1133 + this.callbacks.push(fn);
1134 + this.callbacksCount += 1;
1135 + const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);
1136 + if (!this.isScheduled || didRAFChange) {
1137 + requestAnimationFrame(this.tick);
1138 + this.isScheduled = true;
1139 + }
1140 + return id;
1141 + }
1142 + cancel(id) {
1143 + const index2 = id - this.startId;
1144 + if (index2 < 0 || index2 >= this.callbacks.length) {
1145 + return;
1146 + }
1147 + if (this.callbacks[index2] === null) {
1148 + return;
1149 + }
1150 + this.callbacks[index2] = null;
1151 + this.callbacksCount -= 1;
1152 + }
1153 + };
1154 + var scheduler = new Scheduler();
1155 + var AnimationFrame = class _AnimationFrame {
1156 + static create() {
1157 + return new _AnimationFrame();
1158 + }
1159 + static request(fn) {
1160 + return scheduler.request(fn);
1161 + }
1162 + static cancel(id) {
1163 + return scheduler.cancel(id);
1164 + }
1165 + currentId = EMPTY;
1166 + /**
1167 + * Executes `fn` after `delay`, clearing any previously scheduled call.
1168 + */
1169 + request(fn) {
1170 + this.cancel();
1171 + this.currentId = scheduler.request(() => {
1172 + this.currentId = EMPTY;
1173 + fn();
1174 + });
1175 + }
1176 + cancel = () => {
1177 + if (this.currentId !== EMPTY) {
1178 + scheduler.cancel(this.currentId);
1179 + this.currentId = EMPTY;
1180 + }
1181 + };
1182 + disposeEffect = () => {
1183 + return this.cancel;
1184 + };
1185 + };
1186 + function useAnimationFrame() {
1187 + const timeout = useRefWithInit(AnimationFrame.create).current;
1188 + useOnMount(timeout.disposeEffect);
1189 + return timeout;
1190 + }
1191 +
1192 + // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1193 + function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
1194 + const [transitionStatus, setTransitionStatus] = React9.useState(open2 && enableIdleState ? "idle" : void 0);
1195 + const [mounted, setMounted] = React9.useState(open2 && !animateInitialOpen);
1196 + if (open2 && !mounted) {
1197 + setMounted(true);
1198 + setTransitionStatus("starting");
1199 + }
1200 + if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) {
1201 + setTransitionStatus("ending");
1202 + }
1203 + if (!open2 && !mounted && transitionStatus === "ending") {
1204 + setTransitionStatus(void 0);
1205 + }
1206 + useIsoLayoutEffect(() => {
1207 + if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) {
1208 + const frame = AnimationFrame.request(() => {
1209 + setTransitionStatus("ending");
1210 + });
1211 + return () => {
1212 + AnimationFrame.cancel(frame);
1213 + };
1214 + }
1215 + return void 0;
1216 + }, [open2, mounted, transitionStatus, deferEndingState]);
1217 + useIsoLayoutEffect(() => {
1218 + if (!open2 || enableIdleState) {
1219 + return void 0;
1220 + }
1221 + const frame = AnimationFrame.request(() => {
1222 + setTransitionStatus(void 0);
1223 + });
1224 + return () => {
1225 + AnimationFrame.cancel(frame);
1226 + };
1227 + }, [enableIdleState, open2]);
1228 + useIsoLayoutEffect(() => {
1229 + if (!open2 || !enableIdleState) {
1230 + return void 0;
1231 + }
1232 + if (open2 && mounted && transitionStatus !== "idle") {
1233 + setTransitionStatus("starting");
1234 + }
1235 + const frame = AnimationFrame.request(() => {
1236 + setTransitionStatus("idle");
1237 + });
1238 + return () => {
1239 + AnimationFrame.cancel(frame);
1240 + };
1241 + }, [enableIdleState, open2, mounted, transitionStatus]);
1242 + return {
1243 + mounted,
1244 + setMounted,
1245 + transitionStatus
1246 + };
1247 + }
1248 +
1249 + // node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
1250 + var startingStyle = "data-starting-style";
1251 + var endingStyle = "data-ending-style";
1252 +
1253 + // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
1254 + var STARTING_HOOK = {
1255 + [startingStyle]: ""
1256 + };
1257 + var ENDING_HOOK = {
1258 + [endingStyle]: ""
1259 + };
1260 + var transitionStatusMapping = {
1261 + transitionStatus(value) {
1262 + if (value === "starting") {
1263 + return STARTING_HOOK;
1264 + }
1265 + if (value === "ending") {
1266 + return ENDING_HOOK;
1267 + }
1268 + return null;
1269 + }
1270 + };
1271 +
1272 + // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1273 + function hasWindow() {
1274 + return typeof window !== "undefined";
1275 + }
1276 + function getNodeName(node) {
1277 + if (isNode(node)) {
1278 + return (node.nodeName || "").toLowerCase();
1279 + }
1280 + return "#document";
1281 + }
1282 + function getWindow(node) {
1283 + var _node$ownerDocument;
1284 + return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1285 + }
1286 + function getDocumentElement(node) {
1287 + var _ref;
1288 + return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1289 + }
1290 + function isNode(value) {
1291 + if (!hasWindow()) {
1292 + return false;
1293 + }
1294 + return value instanceof Node || value instanceof getWindow(value).Node;
1295 + }
1296 + function isElement(value) {
1297 + if (!hasWindow()) {
1298 + return false;
1299 + }
1300 + return value instanceof Element || value instanceof getWindow(value).Element;
1301 + }
1302 + function isHTMLElement(value) {
1303 + if (!hasWindow()) {
1304 + return false;
1305 + }
1306 + return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
1307 + }
1308 + function isShadowRoot(value) {
1309 + if (!hasWindow() || typeof ShadowRoot === "undefined") {
1310 + return false;
1311 + }
1312 + return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1313 + }
1314 + function isOverflowElement(element) {
1315 + const {
1316 + overflow,
1317 + overflowX,
1318 + overflowY,
1319 + display
1320 + } = getComputedStyle2(element);
1321 + return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
1322 + }
1323 + function isTableElement(element) {
1324 + return /^(table|td|th)$/.test(getNodeName(element));
1325 + }
1326 + function isTopLayer(element) {
1327 + try {
1328 + if (element.matches(":popover-open")) {
1329 + return true;
1330 + }
1331 + } catch (_e) {
1332 + }
1333 + try {
1334 + return element.matches(":modal");
1335 + } catch (_e) {
1336 + return false;
1337 + }
1338 + }
1339 + var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
1340 + var containRe = /paint|layout|strict|content/;
1341 + var isNotNone = (value) => !!value && value !== "none";
1342 + var isWebKitValue;
1343 + function isContainingBlock(elementOrCss) {
1344 + const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
1345 + return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
1346 + }
1347 + function getContainingBlock(element) {
1348 + let currentNode = getParentNode(element);
1349 + while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1350 + if (isContainingBlock(currentNode)) {
1351 + return currentNode;
1352 + } else if (isTopLayer(currentNode)) {
1353 + return null;
1354 + }
1355 + currentNode = getParentNode(currentNode);
1356 + }
1357 + return null;
1358 + }
1359 + function isWebKit() {
1360 + if (isWebKitValue == null) {
1361 + isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
1362 + }
1363 + return isWebKitValue;
1364 + }
1365 + function isLastTraversableNode(node) {
1366 + return /^(html|body|#document)$/.test(getNodeName(node));
1367 + }
1368 + function getComputedStyle2(element) {
1369 + return getWindow(element).getComputedStyle(element);
1370 + }
1371 + function getNodeScroll(element) {
1372 + if (isElement(element)) {
1373 + return {
1374 + scrollLeft: element.scrollLeft,
1375 + scrollTop: element.scrollTop
1376 + };
1377 + }
1378 + return {
1379 + scrollLeft: element.scrollX,
1380 + scrollTop: element.scrollY
1381 + };
1382 + }
1383 + function getParentNode(node) {
1384 + if (getNodeName(node) === "html") {
1385 + return node;
1386 + }
1387 + const result = (
1388 + // Step into the shadow DOM of the parent of a slotted node.
1389 + node.assignedSlot || // DOM Element detected.
1390 + node.parentNode || // ShadowRoot detected.
1391 + isShadowRoot(node) && node.host || // Fallback.
1392 + getDocumentElement(node)
1393 + );
1394 + return isShadowRoot(result) ? result.host : result;
1395 + }
1396 + function getNearestOverflowAncestor(node) {
1397 + const parentNode = getParentNode(node);
1398 + if (isLastTraversableNode(parentNode)) {
1399 + return (node.ownerDocument || node).body;
1400 + }
1401 + if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1402 + return parentNode;
1403 + }
1404 + return getNearestOverflowAncestor(parentNode);
1405 + }
1406 + function getOverflowAncestors(node, list, traverseIframes) {
1407 + var _node$ownerDocument2;
1408 + if (list === void 0) {
1409 + list = [];
1410 + }
1411 + if (traverseIframes === void 0) {
1412 + traverseIframes = true;
1413 + }
1414 + const scrollableAncestor = getNearestOverflowAncestor(node);
1415 + const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1416 + const win = getWindow(scrollableAncestor);
1417 + if (isBody) {
1418 + const frameElement = getFrameElement(win);
1419 + return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
1420 + } else {
1421 + return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1422 + }
1423 + }
1424 + function getFrameElement(win) {
1425 + return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
1426 + }
1427 +
1428 + // node_modules/@base-ui/utils/owner.mjs
1429 + function ownerDocument(node) {
1430 + return node?.ownerDocument || document;
1431 + }
1432 +
1433 + // node_modules/@base-ui/utils/addEventListener.mjs
1434 + function addEventListener(target, type, listener, options) {
1435 + target.addEventListener(type, listener, options);
1436 + return () => {
1437 + target.removeEventListener(type, listener, options);
1438 + };
1439 + }
1440 +
1441 + // node_modules/@base-ui/utils/useValueAsRef.mjs
1442 + function useValueAsRef(value) {
1443 + const latest = useRefWithInit(createLatestRef, value).current;
1444 + latest.next = value;
1445 + useIsoLayoutEffect(latest.effect);
1446 + return latest;
1447 + }
1448 + function createLatestRef(value) {
1449 + const latest = {
1450 + current: value,
1451 + next: value,
1452 + effect: () => {
1453 + latest.current = latest.next;
1454 + }
1455 + };
1456 + return latest;
1457 + }
1458 +
1459 + // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
1460 + var React10 = __toESM(require_react(), 1);
1461 +
1462 + // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1463 + var ReactDOM = __toESM(require_react_dom(), 1);
1464 +
1465 + // node_modules/@base-ui/react/utils/resolveRef.mjs
1466 + function resolveRef(maybeRef) {
1467 + if (maybeRef == null) {
1468 + return maybeRef;
1469 + }
1470 + return "current" in maybeRef ? maybeRef.current : maybeRef;
1471 + }
1472 +
1473 + // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1474 + var pendingCallbacks = null;
1475 + function flushBeforePaint(fn) {
1476 + if (!pendingCallbacks) {
1477 + const callbacks = [];
1478 + pendingCallbacks = callbacks;
1479 + queueMicrotask(() => {
1480 + pendingCallbacks = null;
1481 + ReactDOM.flushSync(() => {
1482 + for (const callback of callbacks) {
1483 + callback();
1484 + }
1485 + });
1486 + });
1487 + }
1488 + pendingCallbacks.push(fn);
1489 + }
1490 + function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {
1491 + const frame = useAnimationFrame();
1492 + return useStableCallback((fnToExecute, signal = null) => {
1493 + frame.cancel();
1494 + const element = resolveRef(elementOrRef);
1495 + if (element == null) {
1496 + return;
1497 + }
1498 + const resolvedElement = element;
1499 + const done = () => {
1500 + if (!batch) {
1501 + ReactDOM.flushSync(fnToExecute);
1502 + return;
1503 + }
1504 + flushBeforePaint(() => {
1505 + if (!signal?.aborted) {
1506 + fnToExecute();
1507 + }
1508 + });
1509 + };
1510 + if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
1511 + fnToExecute();
1512 + return;
1513 + }
1514 + function exec() {
1515 + Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => {
1516 + if (!signal?.aborted) {
1517 + done();
1518 + }
1519 + }, () => {
1520 + if (signal?.aborted) {
1521 + return;
1522 + }
1523 + const currentAnimations = resolvedElement.getAnimations();
1524 + if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
1525 + exec();
1526 + return;
1527 + }
1528 + done();
1529 + });
1530 + }
1531 + if (waitForStartingStyleRemoved) {
1532 + const startingStyleAttribute = startingStyle;
1533 + if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
1534 + frame.request(exec);
1535 + return;
1536 + }
1537 + const attributeObserver = new MutationObserver(() => {
1538 + if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
1539 + attributeObserver.disconnect();
1540 + exec();
1541 + }
1542 + });
1543 + attributeObserver.observe(resolvedElement, {
1544 + attributes: true,
1545 + attributeFilter: [startingStyleAttribute]
1546 + });
1547 + signal?.addEventListener("abort", () => attributeObserver.disconnect(), {
1548 + once: true
1549 + });
1550 + return;
1551 + }
1552 + frame.request(exec);
1553 + });
1554 + }
1555 +
1556 + // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
1557 + function useOpenChangeComplete(parameters) {
1558 + const {
1559 + enabled = true,
1560 + open: open2,
1561 + ref,
1562 + batch = false,
1563 + onComplete: onCompleteParam
1564 + } = parameters;
1565 + const onComplete = useStableCallback(onCompleteParam);
1566 + const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch);
1567 + React10.useEffect(() => {
1568 + if (!enabled) {
1569 + return void 0;
1570 + }
1571 + const abortController = new AbortController();
1572 + runOnceAnimationsFinish(onComplete, abortController.signal);
1573 + return () => {
1574 + abortController.abort();
1575 + };
1576 + }, [enabled, open2, onComplete, runOnceAnimationsFinish]);
1577 + }
1578 +
1579 + // node_modules/@base-ui/utils/platform/parts.mjs
1580 + var parts_exports = {};
1581 + __export(parts_exports, {
1582 + engine: () => engine_exports,
1583 + env: () => env_exports,
1584 + mediaQuery: () => media_query_exports,
1585 + os: () => os_exports,
1586 + screenReader: () => screen_reader_exports
1587 + });
1588 +
1589 + // node_modules/@base-ui/utils/platform/os.mjs
1590 + var os_exports = {};
1591 + __export(os_exports, {
1592 + android: () => android,
1593 + apple: () => apple,
1594 + ios: () => ios,
1595 + linux: () => linux,
1596 + mac: () => mac,
1597 + windows: () => windows
1598 + });
1599 +
1600 + // node_modules/@base-ui/utils/platform/shared.mjs
1601 + function readRawData() {
1602 + if (typeof navigator === "undefined") {
1603 + return {
1604 + userAgent: "",
1605 + platform: "",
1606 + maxTouchPoints: 0
1607 + };
1608 + }
1609 + if (true) {
1610 + const uaData = navigator.userAgentData;
1611 + if (uaData && Array.isArray(uaData.brands)) {
1612 + return {
1613 + userAgent: uaData.brands.map(({
1614 + brand,
1615 + version: version2
1616 + }) => `${brand}/${version2}`).join(" "),
1617 + platform: uaData.platform ?? navigator.platform ?? "",
1618 + maxTouchPoints: navigator.maxTouchPoints ?? 0
1619 + };
1620 + }
1621 + }
1622 + return {
1623 + userAgent: navigator.userAgent,
1624 + platform: navigator.platform ?? "",
1625 + maxTouchPoints: navigator.maxTouchPoints ?? 0
1626 + };
1627 + }
1628 + var {
1629 + userAgent,
1630 + platform,
1631 + maxTouchPoints
1632 + } = readRawData();
1633 + var lowerUserAgent = userAgent.toLowerCase();
1634 + var lowerPlatform = platform.toLowerCase();
1635 +
1636 + // node_modules/@base-ui/utils/platform/os.mjs
1637 + var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1;
1638 + var ANDROID_STRING = "android";
1639 + var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);
1640 + var mac = !ios && lowerPlatform.startsWith("mac");
1641 + var windows = lowerPlatform.startsWith("win");
1642 + var linux = !android && /^(linux|chrome os)/.test(lowerPlatform);
1643 + var apple = mac || ios;
1644 +
1645 + // node_modules/@base-ui/utils/platform/engine.mjs
1646 + var engine_exports = {};
1647 + __export(engine_exports, {
1648 + blink: () => blink,
1649 + gecko: () => gecko,
1650 + webkit: () => webkit
1651 + });
1652 + var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none");
1653 + var gecko = !webkit && lowerUserAgent.includes("firefox");
1654 + var blink = !webkit && lowerUserAgent.includes("chrom");
1655 +
1656 + // node_modules/@base-ui/utils/platform/screen-reader.mjs
1657 + var screen_reader_exports = {};
1658 + __export(screen_reader_exports, {
1659 + voiceOver: () => voiceOver
1660 + });
1661 + var voiceOver = apple;
1662 +
1663 + // node_modules/@base-ui/utils/platform/env.mjs
1664 + var env_exports = {};
1665 + __export(env_exports, {
1666 + jsdom: () => jsdom
1667 + });
1668 + var jsdom = /jsdom|happydom/.test(lowerUserAgent);
1669 +
1670 + // node_modules/@base-ui/utils/platform/media-query.mjs
1671 + var media_query_exports = {};
1672 + __export(media_query_exports, {
1673 + iOS: () => iOS
1674 + });
1675 + var iOS = "@supports (-webkit-touch-callout: none)";
1676 +
1677 + // node_modules/@base-ui/utils/useTimeout.mjs
1678 + var EMPTY2 = 0;
1679 + var Timeout = class _Timeout {
1680 + static create() {
1681 + return new _Timeout();
1682 + }
1683 + currentId = EMPTY2;
1684 + /**
1685 + * Executes `fn` after `delay`, clearing any previously scheduled call.
1686 + */
1687 + start(delay, fn) {
1688 + this.clear();
1689 + this.currentId = setTimeout(() => {
1690 + this.currentId = EMPTY2;
1691 + fn();
1692 + }, delay);
1693 + }
1694 + isStarted() {
1695 + return this.currentId !== EMPTY2;
1696 + }
1697 + clear = () => {
1698 + if (this.currentId !== EMPTY2) {
1699 + clearTimeout(this.currentId);
1700 + this.currentId = EMPTY2;
1701 + }
1702 + };
1703 + disposeEffect = () => {
1704 + return this.clear;
1705 + };
1706 + };
1707 + function useTimeout() {
1708 + const timeout = useRefWithInit(Timeout.create).current;
1709 + useOnMount(timeout.disposeEffect);
1710 + return timeout;
1711 + }
1712 +
1713 + // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs
1714 + var React11 = __toESM(require_react(), 1);
1715 +
1716 + // node_modules/@base-ui/react/floating-ui-react/utils/event.mjs
1717 + function isReactEvent(event) {
1718 + return "nativeEvent" in event;
1719 + }
1720 + function isVirtualClick(event) {
1721 + if (event.pointerType === "" && event.isTrusted) {
1722 + return true;
1723 + }
1724 + if (parts_exports.os.android && event.pointerType) {
1725 + return event.type === "click" && event.buttons === 1;
1726 + }
1727 + return event.detail === 0 && !event.pointerType;
1728 + }
1729 + function isMouseLikePointerType(pointerType, strict) {
1730 + const values = ["mouse", "pen"];
1731 + if (!strict) {
1732 + values.push("", void 0);
1733 + }
1734 + return values.includes(pointerType);
1735 + }
1736 + function isClickLikeEvent(event) {
1737 + const type = event.type;
1738 + return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup";
1739 + }
1740 +
1741 + // node_modules/@base-ui/utils/shadowDom.mjs
1742 + function activeElement(doc) {
1743 + let element = doc.activeElement;
1744 + while (element?.shadowRoot?.activeElement != null) {
1745 + element = element.shadowRoot.activeElement;
1746 + }
1747 + return element;
1748 + }
1749 + function contains(parent, child) {
1750 + if (!parent || !child) {
1751 + return false;
1752 + }
1753 + const rootNode = child.getRootNode?.();
1754 + if (parent.contains(child)) {
1755 + return true;
1756 + }
1757 + if (rootNode && isShadowRoot(rootNode)) {
1758 + let next = child;
1759 + while (next) {
1760 + if (parent === next) {
1761 + return true;
1762 + }
1763 + next = next.parentNode || next.host;
1764 + }
1765 + }
1766 + return false;
1767 + }
1768 + function getTarget(event) {
1769 + if ("composedPath" in event) {
1770 + return event.composedPath()[0] ?? event.target;
1771 + }
1772 + return event.target;
1773 + }
1774 +
1775 + // node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs
1776 + var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable";
1777 + var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
1778 +
1779 + // node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs
1780 + var open = "data-open";
1781 + var closed = "data-closed";
1782 + var anchorHidden = "data-anchor-hidden";
1783 +
1784 + // node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs
1785 + var CommonTriggerDataAttributes_exports = {};
1786 + __export(CommonTriggerDataAttributes_exports, {
1787 + popupOpen: () => popupOpen,
1788 + pressed: () => pressed
1789 + });
1790 + var popupOpen = "data-popup-open";
1791 + var pressed = "data-pressed";
1792 +
1793 + // node_modules/@base-ui/react/utils/popupStateMapping.mjs
1794 + var TRIGGER_HOOK = {
1795 + [popupOpen]: ""
1796 + };
1797 + var PRESSABLE_TRIGGER_HOOK = {
1798 + [popupOpen]: "",
1799 + [pressed]: ""
1800 + };
1801 + var POPUP_OPEN_HOOK = {
1802 + [open]: ""
1803 + };
1804 + var POPUP_CLOSED_HOOK = {
1805 + [closed]: ""
1806 + };
1807 + var ANCHOR_HIDDEN_HOOK = {
1808 + [anchorHidden]: ""
1809 + };
1810 + var triggerOpenStateMapping = {
1811 + open(value) {
1812 + if (value) {
1813 + return TRIGGER_HOOK;
1814 + }
1815 + return null;
1816 + }
1817 + };
1818 + var popupStateMapping = {
1819 + open(value) {
1820 + if (value) {
1821 + return POPUP_OPEN_HOOK;
1822 + }
1823 + return POPUP_CLOSED_HOOK;
1824 + },
1825 + anchorHidden(value) {
1826 + if (value) {
1827 + return ANCHOR_HIDDEN_HOOK;
1828 + }
1829 + return null;
1830 + }
1831 + };
1832 + var popupTransitionStateMapping = {
1833 + ...popupStateMapping,
1834 + ...transitionStatusMapping
1835 + };
1836 +
1837 + // node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs
1838 + var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen;
1839 + var triggerDisabled = "data-trigger-disabled";
1840 +
1841 + // node_modules/@base-ui/react/floating-ui-react/utils/element.mjs
1842 + function isTargetInsideEnabledTrigger(target, triggerElements) {
1843 + if (!isElement(target)) {
1844 + return false;
1845 + }
1846 + const targetElement = target;
1847 + if (triggerElements.hasElement(targetElement)) {
1848 + return !targetElement.hasAttribute(triggerDisabled);
1849 + }
1850 + for (const [, trigger] of triggerElements.entries()) {
1851 + if (contains(trigger, targetElement)) {
1852 + return !trigger.hasAttribute(triggerDisabled);
1853 + }
1854 + }
1855 + return false;
1856 + }
1857 + function isEventTargetWithin(event, node) {
1858 + if (node == null) {
1859 + return false;
1860 + }
1861 + if ("composedPath" in event) {
1862 + return event.composedPath().includes(node);
1863 + }
1864 + const eventAgain = event;
1865 + return eventAgain.target != null && node.contains(eventAgain.target);
1866 + }
1867 + function isRootElement(element) {
1868 + return element.matches("html,body");
1869 + }
1870 + function isTypeableElement(element) {
1871 + return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
1872 + }
1873 + function isInteractiveElement(element) {
1874 + return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null;
1875 + }
1876 + function matchesFocusVisible(element) {
1877 + if (!element || parts_exports.env.jsdom) {
1878 + return true;
1879 + }
1880 + try {
1881 + return element.matches(":focus-visible");
1882 + } catch (_e) {
1883 + return true;
1884 + }
1885 + }
1886 +
1887 + // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs
1888 + function resolveValue(value, pointerType) {
1889 + if (pointerType != null && !isMouseLikePointerType(pointerType)) {
1890 + return 0;
1891 + }
1892 + if (typeof value === "function") {
1893 + return value();
1894 + }
1895 + return value;
1896 + }
1897 + function getDelay(value, prop, pointerType) {
1898 + const result = resolveValue(value, pointerType);
1899 + if (typeof result === "number") {
1900 + return result;
1901 + }
1902 + return result?.[prop];
1903 + }
1904 + function getRestMs(value) {
1905 + if (typeof value === "function") {
1906 + return value();
1907 + }
1908 + return value;
1909 + }
1910 + function isClickLikeOpenEvent(openEventType, interactedInside) {
1911 + return interactedInside || openEventType === "click" || openEventType === "mousedown";
1912 + }
1913 + function isHoverOpenEvent(openEventType) {
1914 + return openEventType?.includes("mouse") && openEventType !== "mousedown";
1915 + }
1916 +
1917 + // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs
1918 + var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
1919 + var FloatingDelayGroupContext = /* @__PURE__ */ React11.createContext({
1920 + hasProvider: false,
1921 + timeoutMs: 0,
1922 + delayRef: {
1923 + current: 0
1924 + },
1925 + initialDelayRef: {
1926 + current: 0
1927 + },
1928 + timeout: new Timeout(),
1929 + currentIdRef: {
1930 + current: null
1931 + },
1932 + currentContextRef: {
1933 + current: null
1934 + }
1935 + });
1936 + if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext";
1937 + function resetDelayRef(delayRef, initialDelayRef) {
1938 + delayRef.current = initialDelayRef.current;
1939 + }
1940 + function FloatingDelayGroup(props) {
1941 + const {
1942 + children,
1943 + delay,
1944 + timeoutMs = 0
1945 + } = props;
1946 + const delayRef = React11.useRef(delay);
1947 + const initialDelayRef = React11.useRef(delay);
1948 + const currentIdRef = React11.useRef(null);
1949 + const currentContextRef = React11.useRef(null);
1950 + const timeout = useTimeout();
1951 + useIsoLayoutEffect(() => {
1952 + initialDelayRef.current = delay;
1953 + if (!currentIdRef.current) {
1954 + delayRef.current = delay;
1955 + return;
1956 + }
1957 + delayRef.current = {
1958 + open: getDelay(delayRef.current, "open"),
1959 + close: getDelay(delay, "close")
1960 + };
1961 + }, [delay, currentIdRef, delayRef, initialDelayRef]);
1962 + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, {
1963 + value: React11.useMemo(() => ({
1964 + hasProvider: true,
1965 + delayRef,
1966 + initialDelayRef,
1967 + currentIdRef,
1968 + timeoutMs,
1969 + currentContextRef,
1970 + timeout
1971 + }), [timeoutMs, timeout]),
1972 + children
1973 + });
1974 + }
1975 + function useDelayGroup(context, options = {
1976 + open: false
1977 + }) {
1978 + const {
1979 + open: open2
1980 + } = options;
1981 + const store2 = "rootStore" in context ? context.rootStore : context;
1982 + const floatingId = store2.useState("floatingId");
1983 + const groupContext = React11.useContext(FloatingDelayGroupContext);
1984 + const {
1985 + currentIdRef,
1986 + delayRef,
1987 + timeoutMs,
1988 + initialDelayRef,
1989 + currentContextRef,
1990 + hasProvider,
1991 + timeout
1992 + } = groupContext;
1993 + const [isInstantPhase, setIsInstantPhase] = React11.useState(false);
1994 + const openRef = React11.useRef(open2);
1995 + useIsoLayoutEffect(() => {
1996 + openRef.current = open2;
1997 + }, [open2]);
1998 + useIsoLayoutEffect(() => {
1999 + function unset() {
2000 + currentContextRef.current?.setIsInstantPhase(false);
2001 + currentIdRef.current = null;
2002 + currentContextRef.current = null;
2003 + delayRef.current = initialDelayRef.current;
2004 + timeout.clear();
2005 + }
2006 + if (!currentIdRef.current) {
2007 + return void 0;
2008 + }
2009 + if (!open2 && currentIdRef.current === floatingId) {
2010 + setIsInstantPhase(false);
2011 + if (timeoutMs) {
2012 + const closingId = floatingId;
2013 + timeout.start(timeoutMs, () => {
2014 + if (store2.select("open") || currentIdRef.current && currentIdRef.current !== closingId) {
2015 + return;
2016 + }
2017 + unset();
2018 + });
2019 + return () => {
2020 + if (openRef.current || currentIdRef.current !== closingId) {
2021 + timeout.clear();
2022 + }
2023 + };
2024 + }
2025 + unset();
2026 + }
2027 + return void 0;
2028 + }, [open2, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store2]);
2029 + useIsoLayoutEffect(() => {
2030 + if (!open2) {
2031 + return;
2032 + }
2033 + const prevContext = currentContextRef.current;
2034 + const prevId = currentIdRef.current;
2035 + timeout.clear();
2036 + currentContextRef.current = {
2037 + onOpenChange: store2.setOpen,
2038 + setIsInstantPhase
2039 + };
2040 + currentIdRef.current = floatingId;
2041 + delayRef.current = {
2042 + open: 0,
2043 + close: getDelay(initialDelayRef.current, "close")
2044 + };
2045 + if (prevId !== null && prevId !== floatingId) {
2046 + setIsInstantPhase(true);
2047 + prevContext?.setIsInstantPhase(true);
2048 + prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none));
2049 + } else {
2050 + setIsInstantPhase(false);
2051 + prevContext?.setIsInstantPhase(false);
2052 + }
2053 + }, [open2, floatingId, store2, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]);
2054 + useIsoLayoutEffect(() => {
2055 + return () => {
2056 + if (currentIdRef.current === floatingId) {
2057 + currentContextRef.current = null;
2058 + if (!openRef.current) {
2059 + return;
2060 + }
2061 + currentIdRef.current = null;
2062 + resetDelayRef(delayRef, initialDelayRef);
2063 + timeout.clear();
2064 + }
2065 + };
2066 + }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]);
2067 + return React11.useMemo(() => ({
2068 + activeIdRef: currentIdRef,
2069 + hasProvider,
2070 + delayRef,
2071 + isInstantPhase
2072 + }), [currentIdRef, hasProvider, delayRef, isInstantPhase]);
2073 + }
2074 +
2075 + // node_modules/@base-ui/utils/mergeCleanups.mjs
2076 + function mergeCleanups(...cleanups) {
2077 + return () => {
2078 + for (let i = 0; i < cleanups.length; i += 1) {
2079 + const cleanup = cleanups[i];
2080 + if (cleanup) {
2081 + cleanup();
2082 + }
2083 + }
2084 + };
2085 + }
2086 +
2087 + // node_modules/@base-ui/react/utils/FocusGuard.mjs
2088 + var React12 = __toESM(require_react(), 1);
2089 +
2090 + // node_modules/@base-ui/utils/visuallyHidden.mjs
2091 + var visuallyHiddenBase = {
2092 + clipPath: "inset(50%)",
2093 + overflow: "hidden",
2094 + whiteSpace: "nowrap",
2095 + border: 0,
2096 + padding: 0,
2097 + width: 1,
2098 + height: 1,
2099 + margin: -1
2100 + };
2101 + var visuallyHidden = {
2102 + ...visuallyHiddenBase,
2103 + position: "fixed",
2104 + top: 0,
2105 + left: 0
2106 + };
2107 + var visuallyHiddenInput = {
2108 + ...visuallyHiddenBase,
2109 + position: "absolute"
2110 + };
2111 +
2112 + // node_modules/@base-ui/react/utils/FocusGuard.mjs
2113 + var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
2114 + var FocusGuard = /* @__PURE__ */ React12.forwardRef(function FocusGuard2(props, ref) {
2115 + const [role, setRole] = React12.useState();
2116 + useIsoLayoutEffect(() => {
2117 + if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) {
2118 + setRole("button");
2119 + }
2120 + }, []);
2121 + const restProps = {
2122 + tabIndex: 0,
2123 + // Role is only for VoiceOver
2124 + role
2125 + };
2126 + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
2127 + ...props,
2128 + ref,
2129 + style: visuallyHidden,
2130 + "aria-hidden": role ? void 0 : true,
2131 + ...restProps,
2132 + "data-base-ui-focus-guard": ""
2133 + });
2134 + });
2135 + if (true) FocusGuard.displayName = "FocusGuard";
2136 +
2137 + // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
2138 + var min = Math.min;
2139 + var max = Math.max;
2140 + var round = Math.round;
2141 + var floor = Math.floor;
2142 + var createCoords = (v) => ({
2143 + x: v,
2144 + y: v
2145 + });
2146 + var oppositeSideMap = {
2147 + left: "right",
2148 + right: "left",
2149 + bottom: "top",
2150 + top: "bottom"
2151 + };
2152 + function clamp(start, value, end) {
2153 + return max(start, min(value, end));
2154 + }
2155 + function evaluate(value, param) {
2156 + return typeof value === "function" ? value(param) : value;
2157 + }
2158 + function getSide(placement) {
2159 + return placement.split("-")[0];
2160 + }
2161 + function getAlignment(placement) {
2162 + return placement.split("-")[1];
2163 + }
2164 + function getOppositeAxis(axis) {
2165 + return axis === "x" ? "y" : "x";
2166 + }
2167 + function getAxisLength(axis) {
2168 + return axis === "y" ? "height" : "width";
2169 + }
2170 + function getSideAxis(placement) {
2171 + const firstChar = placement[0];
2172 + return firstChar === "t" || firstChar === "b" ? "y" : "x";
2173 + }
2174 + function getAlignmentAxis(placement) {
2175 + return getOppositeAxis(getSideAxis(placement));
2176 + }
2177 + function getAlignmentSides(placement, rects, rtl) {
2178 + if (rtl === void 0) {
2179 + rtl = false;
2180 + }
2181 + const alignment = getAlignment(placement);
2182 + const alignmentAxis = getAlignmentAxis(placement);
2183 + const length = getAxisLength(alignmentAxis);
2184 + let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
2185 + if (rects.reference[length] > rects.floating[length]) {
2186 + mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
2187 + }
2188 + return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
2189 + }
2190 + function getExpandedPlacements(placement) {
2191 + const oppositePlacement = getOppositePlacement(placement);
2192 + return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
2193 + }
2194 + function getOppositeAlignmentPlacement(placement) {
2195 + return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
2196 + }
2197 + var lrPlacement = ["left", "right"];
2198 + var rlPlacement = ["right", "left"];
2199 + var tbPlacement = ["top", "bottom"];
2200 + var btPlacement = ["bottom", "top"];
2201 + function getSideList(side, isStart, rtl) {
2202 + switch (side) {
2203 + case "top":
2204 + case "bottom":
2205 + if (rtl) return isStart ? rlPlacement : lrPlacement;
2206 + return isStart ? lrPlacement : rlPlacement;
2207 + case "left":
2208 + case "right":
2209 + return isStart ? tbPlacement : btPlacement;
2210 + default:
2211 + return [];
2212 + }
2213 + }
2214 + function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
2215 + const alignment = getAlignment(placement);
2216 + let list = getSideList(getSide(placement), direction === "start", rtl);
2217 + if (alignment) {
2218 + list = list.map((side) => side + "-" + alignment);
2219 + if (flipAlignment) {
2220 + list = list.concat(list.map(getOppositeAlignmentPlacement));
2221 + }
2222 + }
2223 + return list;
2224 + }
2225 + function getOppositePlacement(placement) {
2226 + const side = getSide(placement);
2227 + return oppositeSideMap[side] + placement.slice(side.length);
2228 + }
2229 + function expandPaddingObject(padding) {
2230 + var _padding$top, _padding$right, _padding$bottom, _padding$left;
2231 + return {
2232 + top: (_padding$top = padding.top) != null ? _padding$top : 0,
2233 + right: (_padding$right = padding.right) != null ? _padding$right : 0,
2234 + bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
2235 + left: (_padding$left = padding.left) != null ? _padding$left : 0
2236 + };
2237 + }
2238 + function getPaddingObject(padding) {
2239 + return typeof padding !== "number" ? expandPaddingObject(padding) : {
2240 + top: padding,
2241 + right: padding,
2242 + bottom: padding,
2243 + left: padding
2244 + };
2245 + }
2246 + function rectToClientRect(rect) {
2247 + const {
2248 + x,
2249 + y,
2250 + width,
2251 + height
2252 + } = rect;
2253 + return {
2254 + width,
2255 + height,
2256 + top: y,
2257 + left: x,
2258 + right: x + width,
2259 + bottom: y + height,
2260 + x,
2261 + y
2262 + };
2263 + }
2264 +
2265 + // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
2266 + function isHiddenByStyles(styles) {
2267 + return styles.visibility === "hidden" || styles.visibility === "collapse";
2268 + }
2269 + function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) {
2270 + if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {
2271 + return false;
2272 + }
2273 + if (typeof element.checkVisibility === "function") {
2274 + return element.checkVisibility();
2275 + }
2276 + return styles.display !== "none" && styles.display !== "contents";
2277 + }
2278 +
2279 + // node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs
2280 + var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';
2281 + function getParentElement(element) {
2282 + const assignedSlot = element.assignedSlot;
2283 + if (assignedSlot) {
2284 + return assignedSlot;
2285 + }
2286 + if (element.parentElement) {
2287 + return element.parentElement;
2288 + }
2289 + const rootNode = element.getRootNode();
2290 + return isShadowRoot(rootNode) ? rootNode.host : null;
2291 + }
2292 + function getDetailsSummary(details) {
2293 + for (const child of Array.from(details.children)) {
2294 + if (getNodeName(child) === "summary") {
2295 + return child;
2296 + }
2297 + }
2298 + return null;
2299 + }
2300 + function isWithinOpenDetailsSummary(element, details) {
2301 + const summary = getDetailsSummary(details);
2302 + return !!summary && (element === summary || contains(summary, element));
2303 + }
2304 + function isFocusableCandidate(element) {
2305 + const nodeName = element ? getNodeName(element) : "";
2306 + return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== "summary" || element.parentElement != null && getNodeName(element.parentElement) === "details" && getDetailsSummary(element.parentElement) === element) && (nodeName !== "details" || getDetailsSummary(element) == null) && (nodeName !== "input" || element.type !== "hidden");
2307 + }
2308 + function isFocusableElement(element) {
2309 + if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) {
2310 + return false;
2311 + }
2312 + for (let current = element; current; current = getParentElement(current)) {
2313 + const isAncestor = current !== element;
2314 + const isSlot = getNodeName(current) === "slot";
2315 + if (current.hasAttribute("inert")) {
2316 + return false;
2317 + }
2318 + if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {
2319 + return false;
2320 + }
2321 + }
2322 + return true;
2323 + }
2324 + function isVisibleInTabbableTree(element, isAncestor) {
2325 + const styles = getComputedStyle2(element);
2326 + if (!isAncestor) {
2327 + return isElementVisible(element, styles);
2328 + }
2329 + return styles.display !== "none";
2330 + }
2331 + function getTabIndex(element) {
2332 + const tabIndex = element.tabIndex;
2333 + if (tabIndex < 0) {
2334 + const nodeName = getNodeName(element);
2335 + if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) {
2336 + return 0;
2337 + }
2338 + }
2339 + return tabIndex;
2340 + }
2341 + function getNamedRadioInput(element) {
2342 + if (getNodeName(element) !== "input") {
2343 + return null;
2344 + }
2345 + const input = element;
2346 + return input.type === "radio" && input.name !== "" ? input : null;
2347 + }
2348 + function isTabbableRadio(element, candidates) {
2349 + const input = getNamedRadioInput(element);
2350 + if (!input) {
2351 + return true;
2352 + }
2353 + const checkedRadio = candidates.find((candidate) => {
2354 + const radio = getNamedRadioInput(candidate);
2355 + return radio?.name === input.name && radio.form === input.form && radio.checked;
2356 + });
2357 + if (checkedRadio) {
2358 + return checkedRadio === input;
2359 + }
2360 + return candidates.find((candidate) => {
2361 + const radio = getNamedRadioInput(candidate);
2362 + return radio?.name === input.name && radio.form === input.form;
2363 + }) === input;
2364 + }
2365 + function getComposedChildren(container) {
2366 + if (isHTMLElement(container) && getNodeName(container) === "slot") {
2367 + const assignedElements = container.assignedElements({
2368 + flatten: true
2369 + });
2370 + if (assignedElements.length > 0) {
2371 + return assignedElements;
2372 + }
2373 + }
2374 + if (isHTMLElement(container) && container.shadowRoot) {
2375 + return Array.from(container.shadowRoot.children);
2376 + }
2377 + return Array.from(container.children);
2378 + }
2379 + function appendCandidates(container, list) {
2380 + getComposedChildren(container).forEach((child) => {
2381 + if (isFocusableCandidate(child)) {
2382 + list.push(child);
2383 + }
2384 + appendCandidates(child, list);
2385 + });
2386 + }
2387 + function appendMatchingElements(container, selector, list) {
2388 + getComposedChildren(container).forEach((child) => {
2389 + if (isHTMLElement(child) && child.matches(selector)) {
2390 + list.push(child);
2391 + }
2392 + appendMatchingElements(child, selector, list);
2393 + });
2394 + }
2395 + function focusable(container) {
2396 + const candidates = [];
2397 + appendCandidates(container, candidates);
2398 + return candidates.filter(isFocusableElement);
2399 + }
2400 + function tabbable(container) {
2401 + const candidates = focusable(container);
2402 + return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));
2403 + }
2404 + function getTabbableIn(container, dir) {
2405 + const list = tabbable(container);
2406 + const len = list.length;
2407 + if (len === 0) {
2408 + return void 0;
2409 + }
2410 + const active = activeElement(ownerDocument(container));
2411 + const index2 = list.indexOf(active);
2412 + const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir;
2413 + return list[nextIndex];
2414 + }
2415 + function getNextTabbable(referenceElement) {
2416 + return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;
2417 + }
2418 + function getPreviousTabbable(referenceElement) {
2419 + return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;
2420 + }
2421 + function isOutsideEvent(event, container) {
2422 + const containerElement = container || event.currentTarget;
2423 + const relatedTarget = event.relatedTarget;
2424 + return !relatedTarget || !contains(containerElement, relatedTarget);
2425 + }
2426 + function disableFocusInside(container) {
2427 + const tabbableElements = tabbable(container);
2428 + tabbableElements.forEach((element) => {
2429 + element.dataset.tabindex = element.getAttribute("tabindex") || "";
2430 + element.setAttribute("tabindex", "-1");
2431 + });
2432 + }
2433 + function enableFocusInside(container) {
2434 + const elements = [];
2435 + appendMatchingElements(container, "[data-tabindex]", elements);
2436 + elements.forEach((element) => {
2437 + const tabindex = element.dataset.tabindex;
2438 + delete element.dataset.tabindex;
2439 + if (tabindex) {
2440 + element.setAttribute("tabindex", tabindex);
2441 + } else {
2442 + element.removeAttribute("tabindex");
2443 + }
2444 + });
2445 + }
2446 +
2447 + // node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs
2448 + function getNodeChildren(nodes, id, onlyOpenChildren = true) {
2449 + const directChildren = nodes.filter((node) => node.parentId === id);
2450 + return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);
2451 + }
2452 +
2453 + // node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs
2454 + function createAttribute(name) {
2455 + return `data-base-ui-${name}`;
2456 + }
2457 +
2458 + // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
2459 + var React13 = __toESM(require_react(), 1);
2460 + var ReactDOM2 = __toESM(require_react_dom(), 1);
2461 +
2462 + // node_modules/@base-ui/react/internals/constants.mjs
2463 + var DISABLED_TRANSITIONS_STYLE = {
2464 + style: {
2465 + transition: "none"
2466 + }
2467 + };
2468 + var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore";
2469 + var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore";
2470 + var BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;
2471 + var LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;
2472 + var POPUP_COLLISION_AVOIDANCE = {
2473 + fallbackAxisSide: "end"
2474 + };
2475 + var ownerVisuallyHidden = {
2476 + clipPath: "inset(50%)",
2477 + position: "fixed",
2478 + top: 0,
2479 + left: 0
2480 + };
2481 +
2482 + // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
2483 + var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
2484 + var PortalContext = /* @__PURE__ */ React13.createContext(null);
2485 + if (true) PortalContext.displayName = "PortalContext";
2486 + var usePortalContext = () => React13.useContext(PortalContext);
2487 + var attr = createAttribute("portal");
2488 + function useFloatingPortalNode(props = {}) {
2489 + const {
2490 + ref,
2491 + container: containerProp,
2492 + componentProps = EMPTY_OBJECT,
2493 + elementProps
2494 + } = props;
2495 + const uniqueId = useId();
2496 + const portalContext = usePortalContext();
2497 + const parentPortalNode = portalContext?.portalNode;
2498 + const [containerElement, setContainerElement] = React13.useState(null);
2499 + const [portalNode, setPortalNode] = React13.useState(null);
2500 + const setPortalNodeRef = useStableCallback((node) => {
2501 + if (node !== null) {
2502 + setPortalNode(node);
2503 + }
2504 + });
2505 + const containerRef = React13.useRef(null);
2506 + useIsoLayoutEffect(() => {
2507 + if (containerProp === null) {
2508 + if (containerRef.current) {
2509 + containerRef.current = null;
2510 + setPortalNode(null);
2511 + setContainerElement(null);
2512 + }
2513 + return;
2514 + }
2515 + const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
2516 + if (resolvedContainer == null) {
2517 + if (containerRef.current) {
2518 + containerRef.current = null;
2519 + setPortalNode(null);
2520 + setContainerElement(null);
2521 + }
2522 + return;
2523 + }
2524 + if (containerRef.current !== resolvedContainer) {
2525 + containerRef.current = resolvedContainer;
2526 + setPortalNode(null);
2527 + setContainerElement(resolvedContainer);
2528 + }
2529 + }, [containerProp, parentPortalNode]);
2530 + const portalElement = useRenderElement("div", componentProps, {
2531 + ref: [ref, setPortalNodeRef],
2532 + props: [{
2533 + id: uniqueId,
2534 + [attr]: ""
2535 + }, elementProps]
2536 + });
2537 + const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null;
2538 + return {
2539 + node: portalNode,
2540 + // `id` and `render` props can override or remove the generated ID. Use the exact
2541 + // rendered value so `aria-owns` never points at an ID absent from the DOM.
2542 + nodeId: /* @__PURE__ */ React13.isValidElement(portalElement) ? portalElement.props.id : void 0,
2543 + subtree: portalSubtree
2544 + };
2545 + }
2546 + var FloatingPortal = /* @__PURE__ */ React13.forwardRef(function FloatingPortal2(componentProps, forwardedRef) {
2547 + const {
2548 + render,
2549 + className,
2550 + style,
2551 + children,
2552 + container,
2553 + portalOwnerRole,
2554 + ...elementProps
2555 + } = componentProps;
2556 + const {
2557 + node: portalNode,
2558 + nodeId: portalNodeId,
2559 + subtree: portalSubtree
2560 + } = useFloatingPortalNode({
2561 + container,
2562 + ref: forwardedRef,
2563 + componentProps,
2564 + elementProps
2565 + });
2566 + const beforeOutsideRef = React13.useRef(null);
2567 + const afterOutsideRef = React13.useRef(null);
2568 + const beforeInsideRef = React13.useRef(null);
2569 + const afterInsideRef = React13.useRef(null);
2570 + const [focusManagerState, setFocusManagerState] = React13.useState(null);
2571 + const focusInsideDisabledRef = React13.useRef(false);
2572 + const modal = focusManagerState?.modal;
2573 + const open2 = focusManagerState?.open;
2574 + const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;
2575 + React13.useEffect(() => {
2576 + if (!portalNode || modal) {
2577 + return void 0;
2578 + }
2579 + function onFocus(event) {
2580 + if (portalNode && event.relatedTarget && isOutsideEvent(event)) {
2581 + if (event.type === "focusin") {
2582 + if (focusInsideDisabledRef.current) {
2583 + enableFocusInside(portalNode);
2584 + focusInsideDisabledRef.current = false;
2585 + }
2586 + } else {
2587 + disableFocusInside(portalNode);
2588 + focusInsideDisabledRef.current = true;
2589 + }
2590 + }
2591 + }
2592 + return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true));
2593 + }, [portalNode, modal]);
2594 + useIsoLayoutEffect(() => {
2595 + if (!portalNode || open2 !== true || !focusInsideDisabledRef.current) {
2596 + return;
2597 + }
2598 + enableFocusInside(portalNode);
2599 + focusInsideDisabledRef.current = false;
2600 + }, [open2, portalNode]);
2601 + const portalContextValue = React13.useMemo(() => ({
2602 + beforeOutsideRef,
2603 + afterOutsideRef,
2604 + beforeInsideRef,
2605 + afterInsideRef,
2606 + portalNode,
2607 + setFocusManagerState
2608 + }), [portalNode]);
2609 + return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React13.Fragment, {
2610 + children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PortalContext.Provider, {
2611 + value: portalContextValue,
2612 + children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, {
2613 + "data-type": "outside",
2614 + ref: beforeOutsideRef,
2615 + onFocus: (event) => {
2616 + if (isOutsideEvent(event, portalNode)) {
2617 + beforeInsideRef.current?.focus();
2618 + } else {
2619 + const domReference = focusManagerState ? focusManagerState.domReference : null;
2620 + const prevTabbable = getPreviousTabbable(domReference);
2621 + prevTabbable?.focus();
2622 + }
2623 + }
2624 + }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", {
2625 + role: portalOwnerRole,
2626 + "aria-owns": portalNodeId,
2627 + style: ownerVisuallyHidden
2628 + }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, {
2629 + "data-type": "outside",
2630 + ref: afterOutsideRef,
2631 + onFocus: (event) => {
2632 + if (isOutsideEvent(event, portalNode)) {
2633 + afterInsideRef.current?.focus();
2634 + } else {
2635 + const domReference = focusManagerState ? focusManagerState.domReference : null;
2636 + const nextTabbable = getNextTabbable(domReference);
2637 + nextTabbable?.focus();
2638 + if (focusManagerState?.closeOnFocusOut) {
2639 + focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent));
2640 + }
2641 + }
2642 + }
2643 + })]
2644 + })]
2645 + });
2646 + });
2647 + if (true) FloatingPortal.displayName = "FloatingPortal";
2648 +
2649 + // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
2650 + var React14 = __toESM(require_react(), 1);
2651 +
2652 + // node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs
2653 + function createEventEmitter() {
2654 + const map = /* @__PURE__ */ new Map();
2655 + return {
2656 + emit(event, data) {
2657 + map.get(event)?.forEach((listener) => listener(data));
2658 + },
2659 + on(event, listener) {
2660 + if (!map.has(event)) {
2661 + map.set(event, /* @__PURE__ */ new Set());
2662 + }
2663 + map.get(event).add(listener);
2664 + },
2665 + off(event, listener) {
2666 + map.get(event)?.delete(listener);
2667 + }
2668 + };
2669 + }
2670 +
2671 + // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
2672 + var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
2673 + var FloatingNodeContext = /* @__PURE__ */ React14.createContext(null);
2674 + if (true) FloatingNodeContext.displayName = "FloatingNodeContext";
2675 + var FloatingTreeContext = /* @__PURE__ */ React14.createContext(null);
2676 + if (true) FloatingTreeContext.displayName = "FloatingTreeContext";
2677 + var useFloatingParentNodeId = () => React14.useContext(FloatingNodeContext)?.id || null;
2678 + var useFloatingTree = (externalTree) => {
2679 + const contextTree = React14.useContext(FloatingTreeContext);
2680 + return externalTree ?? contextTree;
2681 + };
2682 +
2683 + // node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs
2684 + var React15 = __toESM(require_react(), 1);
2685 + function createVirtualElement(domElement, data) {
2686 + let offsetX = null;
2687 + let offsetY = null;
2688 + let isAutoUpdateEvent = false;
2689 + return {
2690 + contextElement: domElement || void 0,
2691 + getBoundingClientRect() {
2692 + const domRect = domElement?.getBoundingClientRect() || {
2693 + width: 0,
2694 + height: 0,
2695 + x: 0,
2696 + y: 0
2697 + };
2698 + const isXAxis = data.axis === "x" || data.axis === "both";
2699 + const isYAxis = data.axis === "y" || data.axis === "both";
2700 + const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch";
2701 + let width = domRect.width;
2702 + let height = domRect.height;
2703 + let x = domRect.x;
2704 + let y = domRect.y;
2705 + if (offsetX == null && data.x && isXAxis) {
2706 + offsetX = domRect.x - data.x;
2707 + }
2708 + if (offsetY == null && data.y && isYAxis) {
2709 + offsetY = domRect.y - data.y;
2710 + }
2711 + x -= offsetX || 0;
2712 + y -= offsetY || 0;
2713 + width = 0;
2714 + height = 0;
2715 + if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {
2716 + width = data.axis === "y" ? domRect.width : 0;
2717 + height = data.axis === "x" ? domRect.height : 0;
2718 + x = isXAxis && data.x != null ? data.x : x;
2719 + y = isYAxis && data.y != null ? data.y : y;
2720 + } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {
2721 + height = data.axis === "x" ? domRect.height : height;
2722 + width = data.axis === "y" ? domRect.width : width;
2723 + }
2724 + isAutoUpdateEvent = true;
2725 + return {
2726 + width,
2727 + height,
2728 + x,
2729 + y,
2730 + top: y,
2731 + right: x + width,
2732 + bottom: y + height,
2733 + left: x
2734 + };
2735 + }
2736 + };
2737 + }
2738 + function isMouseBasedEvent(event) {
2739 + return event != null && event.clientX != null;
2740 + }
2741 + function useClientPoint(context, props = {}) {
2742 + const {
2743 + enabled = true,
2744 + axis = "both"
2745 + } = props;
2746 + const store2 = "rootStore" in context ? context.rootStore : context;
2747 + const open2 = store2.useState("open");
2748 + const floating = store2.useState("floatingElement");
2749 + const domReference = store2.useState("domReferenceElement");
2750 + const dataRef = store2.context.dataRef;
2751 + const initialRef = React15.useRef(false);
2752 + const cleanupListenerRef = React15.useRef(null);
2753 + const [pointerType, setPointerType] = React15.useState();
2754 + const [reactive, setReactive] = React15.useState([]);
2755 + const resetReference = useStableCallback((reference2) => {
2756 + store2.set("positionReference", reference2);
2757 + });
2758 + const setReference = useStableCallback((newX, newY, referenceElement) => {
2759 + if (initialRef.current) {
2760 + return;
2761 + }
2762 + if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {
2763 + return;
2764 + }
2765 + store2.set("positionReference", createVirtualElement(referenceElement ?? domReference, {
2766 + x: newX,
2767 + y: newY,
2768 + axis,
2769 + dataRef,
2770 + pointerType
2771 + }));
2772 + });
2773 + const handleReferenceEnterOrMove = useStableCallback((event) => {
2774 + if (!open2) {
2775 + setReference(event.clientX, event.clientY, event.currentTarget);
2776 + } else if (!cleanupListenerRef.current) {
2777 + setReference(event.clientX, event.clientY, event.currentTarget);
2778 + setReactive([]);
2779 + }
2780 + });
2781 + const openCheck = isMouseLikePointerType(pointerType) ? floating : open2;
2782 + React15.useEffect(() => {
2783 + if (!enabled) {
2784 + resetReference(domReference);
2785 + return void 0;
2786 + }
2787 + if (!openCheck) {
2788 + return void 0;
2789 + }
2790 + function cleanupListener() {
2791 + cleanupListenerRef.current?.();
2792 + cleanupListenerRef.current = null;
2793 + }
2794 + const win = getWindow(floating);
2795 + function handleMouseMove(event) {
2796 + const target = getTarget(event);
2797 + if (!contains(floating, target)) {
2798 + setReference(event.clientX, event.clientY);
2799 + } else {
2800 + cleanupListener();
2801 + }
2802 + }
2803 + if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {
2804 + cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove);
2805 + } else {
2806 + resetReference(domReference);
2807 + }
2808 + return cleanupListener;
2809 + }, [openCheck, enabled, floating, dataRef, domReference, store2, setReference, resetReference, reactive]);
2810 + React15.useEffect(() => () => {
2811 + store2.set("positionReference", null);
2812 + }, [store2]);
2813 + React15.useEffect(() => {
2814 + if (enabled && !floating) {
2815 + initialRef.current = false;
2816 + }
2817 + }, [enabled, floating]);
2818 + React15.useEffect(() => {
2819 + if (!enabled && open2) {
2820 + initialRef.current = true;
2821 + }
2822 + }, [enabled, open2]);
2823 + const reference = React15.useMemo(() => {
2824 + function setPointerTypeRef(event) {
2825 + setPointerType(event.pointerType);
2826 + }
2827 + return {
2828 + onPointerDown: setPointerTypeRef,
2829 + onPointerEnter: setPointerTypeRef,
2830 + onMouseMove: handleReferenceEnterOrMove,
2831 + onMouseEnter: handleReferenceEnterOrMove
2832 + };
2833 + }, [handleReferenceEnterOrMove]);
2834 + return React15.useMemo(() => enabled ? {
2835 + reference,
2836 + trigger: reference
2837 + } : {}, [enabled, reference]);
2838 + }
2839 +
2840 + // node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs
2841 + var React16 = __toESM(require_react(), 1);
2842 + function alwaysFalse() {
2843 + return false;
2844 + }
2845 + function normalizeProp(normalizable) {
2846 + return {
2847 + escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false,
2848 + outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true
2849 + };
2850 + }
2851 + function useDismiss(context, props = {}) {
2852 + const {
2853 + enabled = true,
2854 + escapeKey: escapeKey2 = true,
2855 + outsidePress: outsidePressProp = true,
2856 + outsidePressEvent = "sloppy",
2857 + referencePress = alwaysFalse,
2858 + bubbles,
2859 + externalTree
2860 + } = props;
2861 + const store2 = "rootStore" in context ? context.rootStore : context;
2862 + const open2 = store2.useState("open");
2863 + const floatingElement = store2.useState("floatingElement");
2864 + const {
2865 + dataRef,
2866 + events
2867 + } = store2.context;
2868 + const tree = useFloatingTree(externalTree);
2869 + const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false);
2870 + const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp;
2871 + const outsidePressEnabled = outsidePress2 !== false;
2872 + const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);
2873 + const {
2874 + escapeKey: escapeKeyBubbles,
2875 + outsidePress: outsidePressBubbles
2876 + } = normalizeProp(bubbles);
2877 + const pressStartedInsideRef = React16.useRef(false);
2878 + const pressStartPreventedRef = React16.useRef(false);
2879 + const suppressNextOutsideClickRef = React16.useRef(false);
2880 + const sawPressWhileOpenRef = React16.useRef(false);
2881 + const isComposingRef = React16.useRef(false);
2882 + const currentPointerTypeRef = React16.useRef("");
2883 + const touchStateRef = React16.useRef(null);
2884 + const cancelDismissOnEndTimeout = useTimeout();
2885 + const clearInsideReactTreeTimeout = useTimeout();
2886 + const clearInsideReactTree = useStableCallback(() => {
2887 + clearInsideReactTreeTimeout.clear();
2888 + dataRef.current.insideReactTree = false;
2889 + });
2890 + const hasBlockingChild = useStableCallback((bubbleKey) => {
2891 + const nodeId = dataRef.current.floatingContext?.nodeId;
2892 + const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
2893 + return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]);
2894 + });
2895 + const isEventWithinOwnElements = useStableCallback((event) => {
2896 + return isEventTargetWithin(event, store2.select("floatingElement")) || isEventTargetWithin(event, store2.select("domReferenceElement"));
2897 + });
2898 + const closeOnReferencePress = useStableCallback((event) => {
2899 + if (!referencePress()) {
2900 + return;
2901 + }
2902 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent));
2903 + });
2904 + const closeOnEscapeKeyDown = useStableCallback((event) => {
2905 + if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") {
2906 + return;
2907 + }
2908 + if (isComposingRef.current) {
2909 + return;
2910 + }
2911 + if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) {
2912 + return;
2913 + }
2914 + const native = isReactEvent(event) ? event.nativeEvent : event;
2915 + const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native);
2916 + store2.setOpen(false, eventDetails);
2917 + if (!eventDetails.isCanceled) {
2918 + event.preventDefault();
2919 + }
2920 + if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {
2921 + event.stopPropagation();
2922 + }
2923 + });
2924 + const markInsideReactTree = useStableCallback(() => {
2925 + dataRef.current.insideReactTree = true;
2926 + clearInsideReactTreeTimeout.start(0, clearInsideReactTree);
2927 + });
2928 + const markPressStartedInsideReactTree = useStableCallback((event) => {
2929 + if (!open2 || !enabled || event.button !== 0) {
2930 + return;
2931 + }
2932 + const target = getTarget(event.nativeEvent);
2933 + if (!contains(store2.select("floatingElement"), target)) {
2934 + return;
2935 + }
2936 + if (!pressStartedInsideRef.current) {
2937 + pressStartedInsideRef.current = true;
2938 + pressStartPreventedRef.current = false;
2939 + }
2940 + });
2941 + const markInsidePressStartPrevented = useStableCallback((event) => {
2942 + if (!open2 || !enabled) {
2943 + return;
2944 + }
2945 + if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {
2946 + return;
2947 + }
2948 + if (pressStartedInsideRef.current) {
2949 + pressStartPreventedRef.current = true;
2950 + }
2951 + });
2952 + React16.useEffect(() => {
2953 + function handleOpenChange(details) {
2954 + if (!details.open) {
2955 + sawPressWhileOpenRef.current = false;
2956 + }
2957 + }
2958 + events.on("openchange", handleOpenChange);
2959 + return () => {
2960 + events.off("openchange", handleOpenChange);
2961 + };
2962 + }, [events]);
2963 + React16.useEffect(() => {
2964 + if (!open2 || !enabled) {
2965 + if (!open2) {
2966 + sawPressWhileOpenRef.current = false;
2967 + }
2968 + return clearInsideReactTree;
2969 + }
2970 + dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
2971 + dataRef.current.__outsidePressBubbles = outsidePressBubbles;
2972 + const compositionTimeout = new Timeout();
2973 + const preventedPressSuppressionTimeout = new Timeout();
2974 + const doc = ownerDocument(floatingElement);
2975 + function handleCompositionStart() {
2976 + compositionTimeout.clear();
2977 + isComposingRef.current = true;
2978 + }
2979 + function handleCompositionEnd() {
2980 + compositionTimeout.start(
2981 + // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
2982 + // Only apply to WebKit for the test to remain 0ms.
2983 + parts_exports.engine.webkit ? 5 : 0,
2984 + () => {
2985 + isComposingRef.current = false;
2986 + }
2987 + );
2988 + }
2989 + function suppressImmediateOutsideClickAfterPreventedStart() {
2990 + suppressNextOutsideClickRef.current = true;
2991 + preventedPressSuppressionTimeout.start(0, () => {
2992 + suppressNextOutsideClickRef.current = false;
2993 + });
2994 + }
2995 + function resetPressStartState() {
2996 + pressStartedInsideRef.current = false;
2997 + pressStartPreventedRef.current = false;
2998 + }
2999 + function getOutsidePressEvent() {
3000 + const type = currentPointerTypeRef.current;
3001 + const computedType = type === "pen" || !type ? "mouse" : type;
3002 + const outsidePressEventValue = getOutsidePressEventProp();
3003 + const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue;
3004 + if (typeof resolved === "string") {
3005 + return resolved;
3006 + }
3007 + return resolved[computedType];
3008 + }
3009 + function shouldIgnoreEvent(event) {
3010 + const computedOutsidePressEvent = getOutsidePressEvent();
3011 + return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click";
3012 + }
3013 + function isEventWithinFloatingTree(event) {
3014 + const nodeId = dataRef.current.floatingContext?.nodeId;
3015 + const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating));
3016 + return isEventWithinOwnElements(event) || targetIsInsideChildren;
3017 + }
3018 + function closeOnPressOutside(event) {
3019 + if (shouldIgnoreEvent(event)) {
3020 + if (event.type !== "click" && !isEventWithinOwnElements(event)) {
3021 + preventedPressSuppressionTimeout.clear();
3022 + suppressNextOutsideClickRef.current = false;
3023 + }
3024 + clearInsideReactTree();
3025 + return;
3026 + }
3027 + if (dataRef.current.insideReactTree) {
3028 + clearInsideReactTree();
3029 + return;
3030 + }
3031 + const target = getTarget(event);
3032 + const inertSelector = `[${createAttribute("inert")}]`;
3033 + const targetRoot = isElement(target) ? target.getRootNode() : null;
3034 + const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store2.select("floatingElement"))).querySelectorAll(inertSelector));
3035 + const triggers = store2.context.triggerElements;
3036 + if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) {
3037 + return;
3038 + }
3039 + let targetRootAncestor = isElement(target) ? target : null;
3040 + while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
3041 + const nextParent = getParentNode(targetRootAncestor);
3042 + if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {
3043 + break;
3044 + }
3045 + targetRootAncestor = nextParent;
3046 + }
3047 + if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
3048 + !contains(target, store2.select("floatingElement")) && // If the target root element contains none of the markers, then the
3049 + // element was injected after the floating element rendered.
3050 + markers.every((marker) => !contains(targetRootAncestor, marker))) {
3051 + return;
3052 + }
3053 + if (isHTMLElement(target) && !("touches" in event)) {
3054 + const lastTraversableNode = isLastTraversableNode(target);
3055 + const style = getComputedStyle2(target);
3056 + const scrollRe = /auto|scroll/;
3057 + const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
3058 + const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
3059 + const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
3060 + const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
3061 + const isRTL4 = style.direction === "rtl";
3062 + const pressedVerticalScrollbar = canScrollY && (isRTL4 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
3063 + const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
3064 + if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {
3065 + return;
3066 + }
3067 + }
3068 + if (isEventWithinFloatingTree(event)) {
3069 + return;
3070 + }
3071 + if (getOutsidePressEvent() === "intentional") {
3072 + if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) {
3073 + return;
3074 + }
3075 + if (suppressNextOutsideClickRef.current) {
3076 + preventedPressSuppressionTimeout.clear();
3077 + suppressNextOutsideClickRef.current = false;
3078 + return;
3079 + }
3080 + }
3081 + if (typeof outsidePress2 === "function" && !outsidePress2(event)) {
3082 + return;
3083 + }
3084 + if (hasBlockingChild("__outsidePressBubbles")) {
3085 + return;
3086 + }
3087 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event));
3088 + clearInsideReactTree();
3089 + }
3090 + function handlePointerDown(event) {
3091 + if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store2.select("open") || !enabled || isEventWithinOwnElements(event)) {
3092 + return;
3093 + }
3094 + closeOnPressOutside(event);
3095 + }
3096 + function handleTouchStart(event) {
3097 + if (getOutsidePressEvent() !== "sloppy" || !store2.select("open") || !enabled || isEventWithinOwnElements(event)) {
3098 + return;
3099 + }
3100 + const touch = event.touches[0];
3101 + if (touch) {
3102 + touchStateRef.current = {
3103 + startTime: Date.now(),
3104 + startX: touch.clientX,
3105 + startY: touch.clientY,
3106 + dismissOnTouchEnd: false,
3107 + dismissOnMouseDown: true
3108 + };
3109 + cancelDismissOnEndTimeout.start(1e3, () => {
3110 + if (touchStateRef.current) {
3111 + touchStateRef.current.dismissOnTouchEnd = false;
3112 + touchStateRef.current.dismissOnMouseDown = false;
3113 + }
3114 + });
3115 + }
3116 + }
3117 + function addTargetEventListenerOnce(event, listener) {
3118 + const target = getTarget(event);
3119 + if (!target) {
3120 + return;
3121 + }
3122 + const unsubscribe2 = addEventListener(target, event.type, () => {
3123 + listener(event);
3124 + unsubscribe2();
3125 + });
3126 + }
3127 + function handleTouchStartCapture(event) {
3128 + currentPointerTypeRef.current = "touch";
3129 + addTargetEventListenerOnce(event, handleTouchStart);
3130 + }
3131 + function closeOnPressOutsideCapture(event) {
3132 + cancelDismissOnEndTimeout.clear();
3133 + if (event.type === "pointerdown") {
3134 + if (event.button === 0) {
3135 + sawPressWhileOpenRef.current = true;
3136 + }
3137 + currentPointerTypeRef.current = event.pointerType;
3138 + }
3139 + if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {
3140 + return;
3141 + }
3142 + addTargetEventListenerOnce(event, (targetEvent) => {
3143 + if (targetEvent.type === "pointerdown") {
3144 + handlePointerDown(targetEvent);
3145 + } else {
3146 + closeOnPressOutside(targetEvent);
3147 + }
3148 + });
3149 + }
3150 + function handlePressEndCapture(event) {
3151 + if (event.type === "pointercancel") {
3152 + sawPressWhileOpenRef.current = false;
3153 + }
3154 + if (!pressStartedInsideRef.current) {
3155 + return;
3156 + }
3157 + const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;
3158 + resetPressStartState();
3159 + if (getOutsidePressEvent() !== "intentional") {
3160 + return;
3161 + }
3162 + if (event.type === "pointercancel") {
3163 + if (pressStartedInsideDefaultPrevented) {
3164 + suppressImmediateOutsideClickAfterPreventedStart();
3165 + }
3166 + return;
3167 + }
3168 + if (isEventWithinFloatingTree(event)) {
3169 + return;
3170 + }
3171 + if (pressStartedInsideDefaultPrevented) {
3172 + suppressImmediateOutsideClickAfterPreventedStart();
3173 + return;
3174 + }
3175 + if (typeof outsidePress2 === "function" && !outsidePress2(event)) {
3176 + return;
3177 + }
3178 + preventedPressSuppressionTimeout.clear();
3179 + suppressNextOutsideClickRef.current = true;
3180 + clearInsideReactTree();
3181 + }
3182 + function handleTouchMove(event) {
3183 + if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) {
3184 + return;
3185 + }
3186 + const touch = event.touches[0];
3187 + if (!touch) {
3188 + return;
3189 + }
3190 + const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);
3191 + const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);
3192 + const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
3193 + if (distance > 5) {
3194 + touchStateRef.current.dismissOnTouchEnd = true;
3195 + }
3196 + if (distance > 10) {
3197 + closeOnPressOutside(event);
3198 + cancelDismissOnEndTimeout.clear();
3199 + touchStateRef.current = null;
3200 + }
3201 + }
3202 + function handleTouchMoveCapture(event) {
3203 + addTargetEventListenerOnce(event, handleTouchMove);
3204 + }
3205 + function handleTouchEnd(event) {
3206 + if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) {
3207 + return;
3208 + }
3209 + if (touchStateRef.current.dismissOnTouchEnd) {
3210 + closeOnPressOutside(event);
3211 + }
3212 + cancelDismissOnEndTimeout.clear();
3213 + touchStateRef.current = null;
3214 + }
3215 + function handleTouchEndCapture(event) {
3216 + addTargetEventListenerOnce(event, handleTouchEnd);
3217 + }
3218 + const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, {
3219 + capture: true,
3220 + passive: true
3221 + }), addEventListener(doc, "touchmove", handleTouchMoveCapture, {
3222 + capture: true,
3223 + passive: true
3224 + }), addEventListener(doc, "touchend", handleTouchEndCapture, {
3225 + capture: true,
3226 + passive: true
3227 + })));
3228 + return () => {
3229 + unsubscribe();
3230 + compositionTimeout.clear();
3231 + preventedPressSuppressionTimeout.clear();
3232 + resetPressStartState();
3233 + suppressNextOutsideClickRef.current = false;
3234 + clearInsideReactTree();
3235 + };
3236 + }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout]);
3237 + const reference = React16.useMemo(() => ({
3238 + onKeyDown: closeOnEscapeKeyDown,
3239 + onPointerDown: closeOnReferencePress,
3240 + onClick: closeOnReferencePress
3241 + }), [closeOnEscapeKeyDown, closeOnReferencePress]);
3242 + const floating = React16.useMemo(() => ({
3243 + onKeyDown: closeOnEscapeKeyDown,
3244 + // `onMouseDown` may be blocked if `event.preventDefault()` is called in
3245 + // `onPointerDown`, such as with <NumberField.ScrubArea>.
3246 + // See https://github.com/mui/base-ui/pull/3379
3247 + onPointerDown: markInsidePressStartPrevented,
3248 + onMouseDown: markInsidePressStartPrevented,
3249 + onClickCapture: markInsideReactTree,
3250 + onMouseDownCapture(event) {
3251 + markInsideReactTree();
3252 + markPressStartedInsideReactTree(event);
3253 + },
3254 + onPointerDownCapture(event) {
3255 + markInsideReactTree();
3256 + markPressStartedInsideReactTree(event);
3257 + },
3258 + onMouseUpCapture: markInsideReactTree,
3259 + onTouchEndCapture: markInsideReactTree,
3260 + onTouchMoveCapture: markInsideReactTree
3261 + }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);
3262 + return React16.useMemo(() => enabled ? {
3263 + reference,
3264 + floating,
3265 + trigger: reference
3266 + } : {}, [enabled, reference, floating]);
3267 + }
3268 +
3269 + // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs
3270 + var React24 = __toESM(require_react(), 1);
3271 +
3272 + // node_modules/@floating-ui/core/dist/floating-ui.core.mjs
3273 + function computeCoordsFromPlacement(_ref, placement, rtl) {
3274 + let {
3275 + reference,
3276 + floating
3277 + } = _ref;
3278 + const sideAxis = getSideAxis(placement);
3279 + const alignmentAxis = getAlignmentAxis(placement);
3280 + const alignLength = getAxisLength(alignmentAxis);
3281 + const side = getSide(placement);
3282 + const isVertical = sideAxis === "y";
3283 + const commonX = reference.x + reference.width / 2 - floating.width / 2;
3284 + const commonY = reference.y + reference.height / 2 - floating.height / 2;
3285 + const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
3286 + let coords;
3287 + switch (side) {
3288 + case "top":
3289 + coords = {
3290 + x: commonX,
3291 + y: reference.y - floating.height
3292 + };
3293 + break;
3294 + case "bottom":
3295 + coords = {
3296 + x: commonX,
3297 + y: reference.y + reference.height
3298 + };
3299 + break;
3300 + case "right":
3301 + coords = {
3302 + x: reference.x + reference.width,
3303 + y: commonY
3304 + };
3305 + break;
3306 + case "left":
3307 + coords = {
3308 + x: reference.x - floating.width,
3309 + y: commonY
3310 + };
3311 + break;
3312 + default:
3313 + coords = {
3314 + x: reference.x,
3315 + y: reference.y
3316 + };
3317 + }
3318 + const alignment = getAlignment(placement);
3319 + if (alignment) {
3320 + coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
3321 + }
3322 + return coords;
3323 + }
3324 + async function detectOverflow(state, options) {
3325 + var _await$platform$isEle;
3326 + if (options === void 0) {
3327 + options = {};
3328 + }
3329 + const {
3330 + x,
3331 + y,
3332 + platform: platform3,
3333 + rects,
3334 + elements,
3335 + strategy
3336 + } = state;
3337 + const {
3338 + boundary = "clippingAncestors",
3339 + rootBoundary = "viewport",
3340 + elementContext = "floating",
3341 + altBoundary = false,
3342 + padding = 0
3343 + } = evaluate(options, state);
3344 + const paddingObject = getPaddingObject(padding);
3345 + const altContext = elementContext === "floating" ? "reference" : "floating";
3346 + const element = elements[altBoundary ? altContext : elementContext];
3347 + const clippingClientRect = rectToClientRect(await platform3.getClippingRect({
3348 + element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements.floating)),
3349 + boundary,
3350 + rootBoundary,
3351 + strategy
3352 + }));
3353 + const rect = elementContext === "floating" ? {
3354 + x,
3355 + y,
3356 + width: rects.floating.width,
3357 + height: rects.floating.height
3358 + } : rects.reference;
3359 + const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating));
3360 + const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || {
3361 + x: 1,
3362 + y: 1
3363 + };
3364 + const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({
3365 + elements,
3366 + rect,
3367 + offsetParent,
3368 + strategy
3369 + }) : rect);
3370 + return {
3371 + top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
3372 + bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
3373 + left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
3374 + right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
3375 + };
3376 + }
3377 + var MAX_RESET_COUNT = 50;
3378 + var computePosition = async (reference, floating, config) => {
3379 + const {
3380 + placement = "bottom",
3381 + strategy = "absolute",
3382 + middleware = [],
3383 + platform: platform3
3384 + } = config;
3385 + const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : {
3386 + ...platform3,
3387 + detectOverflow
3388 + };
3389 + const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating));
3390 + let rects = await platform3.getElementRects({
3391 + reference,
3392 + floating,
3393 + strategy
3394 + });
3395 + let {
3396 + x,
3397 + y
3398 + } = computeCoordsFromPlacement(rects, placement, rtl);
3399 + let statefulPlacement = placement;
3400 + let resetCount = 0;
3401 + const middlewareData = {};
3402 + for (let i = 0; i < middleware.length; i++) {
3403 + const currentMiddleware = middleware[i];
3404 + if (!currentMiddleware) {
3405 + continue;
3406 + }
3407 + const {
3408 + name,
3409 + fn
3410 + } = currentMiddleware;
3411 + const {
3412 + x: nextX,
3413 + y: nextY,
3414 + data,
3415 + reset
3416 + } = await fn({
3417 + x,
3418 + y,
3419 + initialPlacement: placement,
3420 + placement: statefulPlacement,
3421 + strategy,
3422 + middlewareData,
3423 + rects,
3424 + platform: platformWithDetectOverflow,
3425 + elements: {
3426 + reference,
3427 + floating
3428 + }
3429 + });
3430 + x = nextX != null ? nextX : x;
3431 + y = nextY != null ? nextY : y;
3432 + middlewareData[name] = {
3433 + ...middlewareData[name],
3434 + ...data
3435 + };
3436 + if (reset && resetCount < MAX_RESET_COUNT) {
3437 + resetCount++;
3438 + if (typeof reset === "object") {
3439 + if (reset.placement) {
3440 + statefulPlacement = reset.placement;
3441 + }
3442 + if (reset.rects) {
3443 + rects = reset.rects === true ? await platform3.getElementRects({
3444 + reference,
3445 + floating,
3446 + strategy
3447 + }) : reset.rects;
3448 + }
3449 + ({
3450 + x,
3451 + y
3452 + } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
3453 + }
3454 + i = -1;
3455 + }
3456 + }
3457 + return {
3458 + x,
3459 + y,
3460 + placement: statefulPlacement,
3461 + strategy,
3462 + middlewareData
3463 + };
3464 + };
3465 + var flip = function(options) {
3466 + if (options === void 0) {
3467 + options = {};
3468 + }
3469 + return {
3470 + name: "flip",
3471 + options,
3472 + async fn(state) {
3473 + var _middlewareData$arrow, _middlewareData$flip;
3474 + const {
3475 + placement,
3476 + middlewareData,
3477 + rects,
3478 + initialPlacement,
3479 + platform: platform3,
3480 + elements
3481 + } = state;
3482 + const {
3483 + mainAxis: checkMainAxis = true,
3484 + crossAxis: checkCrossAxis = true,
3485 + fallbackPlacements: specifiedFallbackPlacements,
3486 + fallbackStrategy = "bestFit",
3487 + fallbackAxisSideDirection = "none",
3488 + flipAlignment = true,
3489 + ...detectOverflowOptions
3490 + } = evaluate(options, state);
3491 + if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
3492 + return {};
3493 + }
3494 + const side = getSide(placement);
3495 + const initialSideAxis = getSideAxis(initialPlacement);
3496 + const isBasePlacement = getSide(initialPlacement) === initialPlacement;
3497 + const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating));
3498 + const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
3499 + const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
3500 + if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
3501 + fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
3502 + }
3503 + const placements2 = [initialPlacement, ...fallbackPlacements];
3504 + const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
3505 + const overflows = [];
3506 + let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
3507 + if (checkMainAxis) {
3508 + overflows.push(overflow[side]);
3509 + }
3510 + if (checkCrossAxis) {
3511 + const sides2 = getAlignmentSides(placement, rects, rtl);
3512 + overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
3513 + }
3514 + overflowsData = [...overflowsData, {
3515 + placement,
3516 + overflows
3517 + }];
3518 + if (!overflows.every((side2) => side2 <= 0)) {
3519 + var _middlewareData$flip2, _overflowsData$filter;
3520 + const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
3521 + const nextPlacement = placements2[nextIndex];
3522 + if (nextPlacement) {
3523 + const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
3524 + if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
3525 + // overflows the main axis.
3526 + overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
3527 + return {
3528 + data: {
3529 + index: nextIndex,
3530 + overflows: overflowsData
3531 + },
3532 + reset: {
3533 + placement: nextPlacement
3534 + }
3535 + };
3536 + }
3537 + }
3538 + let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
3539 + if (!resetPlacement) {
3540 + switch (fallbackStrategy) {
3541 + case "bestFit": {
3542 + var _overflowsData$filter2;
3543 + const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
3544 + if (hasFallbackAxisSideDirection) {
3545 + const currentSideAxis = getSideAxis(d.placement);
3546 + return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
3547 + // reading directions favoring greater width.
3548 + currentSideAxis === "y";
3549 + }
3550 + return true;
3551 + }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
3552 + if (placement2) {
3553 + resetPlacement = placement2;
3554 + }
3555 + break;
3556 + }
3557 + case "initialPlacement":
3558 + resetPlacement = initialPlacement;
3559 + break;
3560 + }
3561 + }
3562 + if (placement !== resetPlacement) {
3563 + return {
3564 + reset: {
3565 + placement: resetPlacement
3566 + }
3567 + };
3568 + }
3569 + }
3570 + return {};
3571 + }
3572 + };
3573 + };
3574 + var originSides = /* @__PURE__ */ new Set(["left", "top"]);
3575 + async function convertValueToCoords(state, options) {
3576 + const {
3577 + placement,
3578 + platform: platform3,
3579 + elements
3580 + } = state;
3581 + const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating));
3582 + const side = getSide(placement);
3583 + const alignment = getAlignment(placement);
3584 + const isVertical = getSideAxis(placement) === "y";
3585 + const mainAxisMulti = originSides.has(side) ? -1 : 1;
3586 + const crossAxisMulti = rtl && isVertical ? -1 : 1;
3587 + const rawValue = evaluate(options, state);
3588 + let {
3589 + mainAxis,
3590 + crossAxis,
3591 + alignmentAxis
3592 + } = typeof rawValue === "number" ? {
3593 + mainAxis: rawValue,
3594 + crossAxis: 0,
3595 + alignmentAxis: null
3596 + } : {
3597 + mainAxis: rawValue.mainAxis || 0,
3598 + crossAxis: rawValue.crossAxis || 0,
3599 + alignmentAxis: rawValue.alignmentAxis
3600 + };
3601 + if (alignment && typeof alignmentAxis === "number") {
3602 + crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
3603 + }
3604 + return isVertical ? {
3605 + x: crossAxis * crossAxisMulti,
3606 + y: mainAxis * mainAxisMulti
3607 + } : {
3608 + x: mainAxis * mainAxisMulti,
3609 + y: crossAxis * crossAxisMulti
3610 + };
3611 + }
3612 + var offset = function(options) {
3613 + if (options === void 0) {
3614 + options = 0;
3615 + }
3616 + return {
3617 + name: "offset",
3618 + options,
3619 + async fn(state) {
3620 + var _middlewareData$offse, _middlewareData$arrow;
3621 + const {
3622 + x,
3623 + y,
3624 + placement,
3625 + middlewareData
3626 + } = state;
3627 + const diffCoords = await convertValueToCoords(state, options);
3628 + if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
3629 + return {};
3630 + }
3631 + return {
3632 + x: x + diffCoords.x,
3633 + y: y + diffCoords.y,
3634 + data: {
3635 + ...diffCoords,
3636 + placement
3637 + }
3638 + };
3639 + }
3640 + };
3641 + };
3642 + var shift = function(options) {
3643 + if (options === void 0) {
3644 + options = {};
3645 + }
3646 + return {
3647 + name: "shift",
3648 + options,
3649 + async fn(state) {
3650 + const {
3651 + x,
3652 + y,
3653 + placement,
3654 + platform: platform3
3655 + } = state;
3656 + const {
3657 + mainAxis: checkMainAxis = true,
3658 + crossAxis: checkCrossAxis = false,
3659 + limiter = {
3660 + fn: (_ref) => {
3661 + let {
3662 + x: x2,
3663 + y: y2
3664 + } = _ref;
3665 + return {
3666 + x: x2,
3667 + y: y2
3668 + };
3669 + }
3670 + },
3671 + ...detectOverflowOptions
3672 + } = evaluate(options, state);
3673 + const coords = {
3674 + x,
3675 + y
3676 + };
3677 + const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
3678 + const crossAxis = getSideAxis(placement);
3679 + const mainAxis = getOppositeAxis(crossAxis);
3680 + let mainAxisCoord = coords[mainAxis];
3681 + let crossAxisCoord = coords[crossAxis];
3682 + const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
3683 + if (checkMainAxis) {
3684 + mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
3685 + }
3686 + if (checkCrossAxis) {
3687 + crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
3688 + }
3689 + const limitedCoords = limiter.fn({
3690 + ...state,
3691 + [mainAxis]: mainAxisCoord,
3692 + [crossAxis]: crossAxisCoord
3693 + });
3694 + return {
3695 + ...limitedCoords,
3696 + data: {
3697 + x: limitedCoords.x - x,
3698 + y: limitedCoords.y - y,
3699 + enabled: {
3700 + [mainAxis]: checkMainAxis,
3701 + [crossAxis]: checkCrossAxis
3702 + }
3703 + }
3704 + };
3705 + }
3706 + };
3707 + };
3708 + var limitShift = function(options) {
3709 + if (options === void 0) {
3710 + options = {};
3711 + }
3712 + return {
3713 + options,
3714 + fn(state) {
3715 + var _rawOffset$mainAxis, _rawOffset$crossAxis;
3716 + const {
3717 + x,
3718 + y,
3719 + placement,
3720 + rects,
3721 + middlewareData
3722 + } = state;
3723 + const {
3724 + offset: offset4 = 0,
3725 + mainAxis: checkMainAxis = true,
3726 + crossAxis: checkCrossAxis = true
3727 + } = evaluate(options, state);
3728 + const coords = {
3729 + x,
3730 + y
3731 + };
3732 + const crossAxis = getSideAxis(placement);
3733 + const mainAxis = getOppositeAxis(crossAxis);
3734 + let mainAxisCoord = coords[mainAxis];
3735 + let crossAxisCoord = coords[crossAxis];
3736 + const rawOffset = evaluate(offset4, state);
3737 + const computedOffset = typeof rawOffset === "number" ? {
3738 + mainAxis: rawOffset,
3739 + crossAxis: 0
3740 + } : {
3741 + mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
3742 + crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
3743 + };
3744 + if (checkMainAxis) {
3745 + const len = mainAxis === "y" ? "height" : "width";
3746 + const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
3747 + const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
3748 + if (mainAxisCoord < limitMin) {
3749 + mainAxisCoord = limitMin;
3750 + } else if (mainAxisCoord > limitMax) {
3751 + mainAxisCoord = limitMax;
3752 + }
3753 + }
3754 + if (checkCrossAxis) {
3755 + var _middlewareData$offse, _middlewareData$offse2;
3756 + const len = mainAxis === "y" ? "width" : "height";
3757 + const isOriginSide = originSides.has(getSide(placement));
3758 + const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
3759 + const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
3760 + if (crossAxisCoord < limitMin) {
3761 + crossAxisCoord = limitMin;
3762 + } else if (crossAxisCoord > limitMax) {
3763 + crossAxisCoord = limitMax;
3764 + }
3765 + }
3766 + return {
3767 + [mainAxis]: mainAxisCoord,
3768 + [crossAxis]: crossAxisCoord
3769 + };
3770 + }
3771 + };
3772 + };
3773 + var size = function(options) {
3774 + if (options === void 0) {
3775 + options = {};
3776 + }
3777 + return {
3778 + name: "size",
3779 + options,
3780 + async fn(state) {
3781 + const {
3782 + placement,
3783 + rects,
3784 + platform: platform3,
3785 + elements
3786 + } = state;
3787 + const {
3788 + apply = () => {
3789 + },
3790 + ...detectOverflowOptions
3791 + } = evaluate(options, state);
3792 + const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
3793 + const side = getSide(placement);
3794 + const alignment = getAlignment(placement);
3795 + const isYAxis = getSideAxis(placement) === "y";
3796 + const {
3797 + width,
3798 + height
3799 + } = rects.floating;
3800 + let heightSide;
3801 + let widthSide;
3802 + if (side === "top" || side === "bottom") {
3803 + heightSide = side;
3804 + widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
3805 + } else {
3806 + widthSide = side;
3807 + heightSide = alignment === "end" ? "top" : "bottom";
3808 + }
3809 + const maximumClippingHeight = height - overflow.top - overflow.bottom;
3810 + const maximumClippingWidth = width - overflow.left - overflow.right;
3811 + const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
3812 + const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
3813 + const shiftData = state.middlewareData.shift;
3814 + const noShift = !shiftData;
3815 + let availableHeight2 = overflowAvailableHeight;
3816 + let availableWidth2 = overflowAvailableWidth;
3817 + if (shiftData != null && shiftData.enabled.x) {
3818 + availableWidth2 = maximumClippingWidth;
3819 + }
3820 + if (shiftData != null && shiftData.enabled.y) {
3821 + availableHeight2 = maximumClippingHeight;
3822 + }
3823 + if (noShift && !alignment) {
3824 + if (isYAxis) {
3825 + availableWidth2 = width - 2 * max(overflow.left, overflow.right);
3826 + } else {
3827 + availableHeight2 = height - 2 * max(overflow.top, overflow.bottom);
3828 + }
3829 + }
3830 + await apply({
3831 + ...state,
3832 + availableWidth: availableWidth2,
3833 + availableHeight: availableHeight2
3834 + });
3835 + const nextDimensions = await platform3.getDimensions(elements.floating);
3836 + if (width !== nextDimensions.width || height !== nextDimensions.height) {
3837 + return {
3838 + reset: {
3839 + rects: true
3840 + }
3841 + };
3842 + }
3843 + return {};
3844 + }
3845 + };
3846 + };
3847 +
3848 + // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
3849 + function getCssDimensions(element) {
3850 + const css = getComputedStyle2(element);
3851 + let width = parseFloat(css.width) || 0;
3852 + let height = parseFloat(css.height) || 0;
3853 + const hasOffset = isHTMLElement(element);
3854 + const offsetWidth = hasOffset ? element.offsetWidth : width;
3855 + const offsetHeight = hasOffset ? element.offsetHeight : height;
3856 + const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
3857 + if (shouldFallback) {
3858 + width = offsetWidth;
3859 + height = offsetHeight;
3860 + }
3861 + return {
3862 + width,
3863 + height,
3864 + $: shouldFallback
3865 + };
3866 + }
3867 + function unwrapElement(element) {
3868 + return !isElement(element) ? element.contextElement : element;
3869 + }
3870 + function getScale(element) {
3871 + const domElement = unwrapElement(element);
3872 + if (!isHTMLElement(domElement)) {
3873 + return createCoords(1);
3874 + }
3875 + const rect = domElement.getBoundingClientRect();
3876 + const {
3877 + width,
3878 + height,
3879 + $
3880 + } = getCssDimensions(domElement);
3881 + let x = ($ ? round(rect.width) : rect.width) / width;
3882 + let y = ($ ? round(rect.height) : rect.height) / height;
3883 + if (!x || !Number.isFinite(x)) {
3884 + x = 1;
3885 + }
3886 + if (!y || !Number.isFinite(y)) {
3887 + y = 1;
3888 + }
3889 + return {
3890 + x,
3891 + y
3892 + };
3893 + }
3894 + var noOffsets = /* @__PURE__ */ createCoords(0);
3895 + function getVisualOffsets(element) {
3896 + const win = getWindow(element);
3897 + if (!isWebKit() || !win.visualViewport) {
3898 + return noOffsets;
3899 + }
3900 + return {
3901 + x: win.visualViewport.offsetLeft,
3902 + y: win.visualViewport.offsetTop
3903 + };
3904 + }
3905 + function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
3906 + if (isFixed === void 0) {
3907 + isFixed = false;
3908 + }
3909 + return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
3910 + }
3911 + function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
3912 + if (includeScale === void 0) {
3913 + includeScale = false;
3914 + }
3915 + if (isFixedStrategy === void 0) {
3916 + isFixedStrategy = false;
3917 + }
3918 + const clientRect = element.getBoundingClientRect();
3919 + const domElement = unwrapElement(element);
3920 + let scale = createCoords(1);
3921 + if (includeScale) {
3922 + if (offsetParent) {
3923 + if (isElement(offsetParent)) {
3924 + scale = getScale(offsetParent);
3925 + }
3926 + } else {
3927 + scale = getScale(element);
3928 + }
3929 + }
3930 + const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
3931 + let x = (clientRect.left + visualOffsets.x) / scale.x;
3932 + let y = (clientRect.top + visualOffsets.y) / scale.y;
3933 + let width = clientRect.width / scale.x;
3934 + let height = clientRect.height / scale.y;
3935 + if (domElement && offsetParent) {
3936 + const win = getWindow(domElement);
3937 + const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
3938 + let currentWin = win;
3939 + let currentIFrame = getFrameElement(currentWin);
3940 + while (currentIFrame && offsetWin !== currentWin) {
3941 + const iframeScale = getScale(currentIFrame);
3942 + const iframeRect = currentIFrame.getBoundingClientRect();
3943 + const css = getComputedStyle2(currentIFrame);
3944 + const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
3945 + const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
3946 + x *= iframeScale.x;
3947 + y *= iframeScale.y;
3948 + width *= iframeScale.x;
3949 + height *= iframeScale.y;
3950 + x += left;
3951 + y += top;
3952 + currentWin = getWindow(currentIFrame);
3953 + currentIFrame = getFrameElement(currentWin);
3954 + }
3955 + }
3956 + return rectToClientRect({
3957 + width,
3958 + height,
3959 + x,
3960 + y
3961 + });
3962 + }
3963 + function getWindowScrollBarX(element, rect) {
3964 + const leftScroll = getNodeScroll(element).scrollLeft;
3965 + if (!rect) {
3966 + return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
3967 + }
3968 + return rect.left + leftScroll;
3969 + }
3970 + function getHTMLOffset(documentElement, scroll) {
3971 + const htmlRect = documentElement.getBoundingClientRect();
3972 + const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
3973 + const y = htmlRect.top + scroll.scrollTop;
3974 + return {
3975 + x,
3976 + y
3977 + };
3978 + }
3979 + function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
3980 + let {
3981 + elements,
3982 + rect,
3983 + offsetParent,
3984 + strategy
3985 + } = _ref;
3986 + const isFixed = strategy === "fixed";
3987 + const documentElement = getDocumentElement(offsetParent);
3988 + const topLayer = elements ? isTopLayer(elements.floating) : false;
3989 + if (offsetParent === documentElement || topLayer && isFixed) {
3990 + return rect;
3991 + }
3992 + let scroll = {
3993 + scrollLeft: 0,
3994 + scrollTop: 0
3995 + };
3996 + let scale = createCoords(1);
3997 + const offsets = createCoords(0);
3998 + const isOffsetParentAnElement = isHTMLElement(offsetParent);
3999 + if (isOffsetParentAnElement || !isFixed) {
4000 + if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
4001 + scroll = getNodeScroll(offsetParent);
4002 + }
4003 + if (isOffsetParentAnElement) {
4004 + const offsetRect = getBoundingClientRect(offsetParent);
4005 + scale = getScale(offsetParent);
4006 + offsets.x = offsetRect.x + offsetParent.clientLeft;
4007 + offsets.y = offsetRect.y + offsetParent.clientTop;
4008 + }
4009 + }
4010 + const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
4011 + return {
4012 + width: rect.width * scale.x,
4013 + height: rect.height * scale.y,
4014 + x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
4015 + y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
4016 + };
4017 + }
4018 + function getClientRects(element) {
4019 + return element.getClientRects ? Array.from(element.getClientRects()) : [];
4020 + }
4021 + function getDocumentRect(html) {
4022 + const scroll = getNodeScroll(html);
4023 + const body = html.ownerDocument.body;
4024 + const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
4025 + const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
4026 + let x = -scroll.scrollLeft + getWindowScrollBarX(html);
4027 + const y = -scroll.scrollTop;
4028 + if (getComputedStyle2(body).direction === "rtl") {
4029 + x += max(html.clientWidth, body.clientWidth) - width;
4030 + }
4031 + return {
4032 + width,
4033 + height,
4034 + x,
4035 + y
4036 + };
4037 + }
4038 + var SCROLLBAR_MAX = 25;
4039 + function getViewportRect(element, strategy, rootBoundary) {
4040 + if (rootBoundary === void 0) {
4041 + rootBoundary = "viewport";
4042 + }
4043 + const isLayoutViewport = rootBoundary === "layoutViewport";
4044 + const win = getWindow(element);
4045 + const html = getDocumentElement(element);
4046 + const visualViewport = win.visualViewport;
4047 + let width = html.clientWidth;
4048 + let height = html.clientHeight;
4049 + let x = 0;
4050 + let y = 0;
4051 + if (visualViewport) {
4052 + const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
4053 + if (isLayoutViewport) {
4054 + if (!layoutRelativeClientCoords) {
4055 + x = -visualViewport.offsetLeft;
4056 + y = -visualViewport.offsetTop;
4057 + }
4058 + } else {
4059 + width = visualViewport.width;
4060 + height = visualViewport.height;
4061 + if (layoutRelativeClientCoords) {
4062 + x = visualViewport.offsetLeft;
4063 + y = visualViewport.offsetTop;
4064 + }
4065 + }
4066 + }
4067 + const windowScrollbarX = getWindowScrollBarX(html);
4068 + if (windowScrollbarX <= 0) {
4069 + const doc = html.ownerDocument;
4070 + const body = doc.body;
4071 + const bodyStyles = getComputedStyle(body);
4072 + const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
4073 + const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
4074 + const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
4075 + if (gutter <= SCROLLBAR_MAX) {
4076 + width -= gutter;
4077 + }
4078 + }
4079 + return {
4080 + width,
4081 + height,
4082 + x,
4083 + y
4084 + };
4085 + }
4086 + function getInnerBoundingClientRect(element, strategy) {
4087 + const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
4088 + const top = clientRect.top + element.clientTop;
4089 + const left = clientRect.left + element.clientLeft;
4090 + const scale = getScale(element);
4091 + const width = element.clientWidth * scale.x;
4092 + const height = element.clientHeight * scale.y;
4093 + const x = left * scale.x;
4094 + const y = top * scale.y;
4095 + return {
4096 + width,
4097 + height,
4098 + x,
4099 + y
4100 + };
4101 + }
4102 + function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
4103 + let rect;
4104 + if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") {
4105 + rect = getViewportRect(element, strategy, clippingAncestor);
4106 + } else if (clippingAncestor === "document") {
4107 + rect = getDocumentRect(getDocumentElement(element));
4108 + } else if (isElement(clippingAncestor)) {
4109 + rect = getInnerBoundingClientRect(clippingAncestor, strategy);
4110 + } else {
4111 + const visualOffsets = getVisualOffsets(element);
4112 + rect = {
4113 + x: clippingAncestor.x - visualOffsets.x,
4114 + y: clippingAncestor.y - visualOffsets.y,
4115 + width: clippingAncestor.width,
4116 + height: clippingAncestor.height
4117 + };
4118 + }
4119 + return rectToClientRect(rect);
4120 + }
4121 + function getClippingElementAncestors(element, cache) {
4122 + const cachedResult = cache.get(element);
4123 + if (cachedResult) {
4124 + return cachedResult;
4125 + }
4126 + let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
4127 + let lastKeptComputedStyle = null;
4128 + const elementIsFixed = getComputedStyle2(element).position === "fixed";
4129 + let currentNode = elementIsFixed ? getParentNode(element) : element;
4130 + while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
4131 + const computedStyle = getComputedStyle2(currentNode);
4132 + const currentNodeIsContaining = isContainingBlock(currentNode);
4133 + const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
4134 + const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static");
4135 + if (shouldDropCurrentNode) {
4136 + result = result.filter((ancestor) => ancestor !== currentNode);
4137 + } else {
4138 + lastKeptComputedStyle = computedStyle;
4139 + }
4140 + currentNode = getParentNode(currentNode);
4141 + }
4142 + cache.set(element, result);
4143 + return result;
4144 + }
4145 + function getClippingRect(_ref) {
4146 + let {
4147 + element,
4148 + boundary,
4149 + rootBoundary,
4150 + strategy
4151 + } = _ref;
4152 + const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
4153 + const clippingAncestors = [...elementClippingAncestors, rootBoundary];
4154 + const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
4155 + let top = firstRect.top;
4156 + let right = firstRect.right;
4157 + let bottom = firstRect.bottom;
4158 + let left = firstRect.left;
4159 + for (let i = 1; i < clippingAncestors.length; i++) {
4160 + const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
4161 + top = max(rect.top, top);
4162 + right = min(rect.right, right);
4163 + bottom = min(rect.bottom, bottom);
4164 + left = max(rect.left, left);
4165 + }
4166 + return {
4167 + width: right - left,
4168 + height: bottom - top,
4169 + x: left,
4170 + y: top
4171 + };
4172 + }
4173 + function getDimensions(element) {
4174 + const {
4175 + width,
4176 + height
4177 + } = getCssDimensions(element);
4178 + return {
4179 + width,
4180 + height
4181 + };
4182 + }
4183 + function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
4184 + const isOffsetParentAnElement = isHTMLElement(offsetParent);
4185 + const documentElement = getDocumentElement(offsetParent);
4186 + const isFixed = strategy === "fixed";
4187 + const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
4188 + let scroll = {
4189 + scrollLeft: 0,
4190 + scrollTop: 0
4191 + };
4192 + const offsets = createCoords(0);
4193 + if (isOffsetParentAnElement || !isFixed) {
4194 + if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
4195 + scroll = getNodeScroll(offsetParent);
4196 + }
4197 + if (isOffsetParentAnElement) {
4198 + const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
4199 + offsets.x = offsetRect.x + offsetParent.clientLeft;
4200 + offsets.y = offsetRect.y + offsetParent.clientTop;
4201 + }
4202 + }
4203 + if (!isOffsetParentAnElement && documentElement) {
4204 + offsets.x = getWindowScrollBarX(documentElement);
4205 + }
4206 + const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
4207 + const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
4208 + const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
4209 + return {
4210 + x,
4211 + y,
4212 + width: rect.width,
4213 + height: rect.height
4214 + };
4215 + }
4216 + function isStaticPositioned(element) {
4217 + return getComputedStyle2(element).position === "static";
4218 + }
4219 + function getTrueOffsetParent(element, polyfill) {
4220 + if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
4221 + return null;
4222 + }
4223 + if (polyfill) {
4224 + return polyfill(element);
4225 + }
4226 + let rawOffsetParent = element.offsetParent;
4227 + if (getDocumentElement(element) === rawOffsetParent) {
4228 + rawOffsetParent = rawOffsetParent.ownerDocument.body;
4229 + }
4230 + return rawOffsetParent;
4231 + }
4232 + function getOffsetParent(element, polyfill) {
4233 + const win = getWindow(element);
4234 + if (isTopLayer(element)) {
4235 + return win;
4236 + }
4237 + if (!isHTMLElement(element)) {
4238 + let svgOffsetParent = getParentNode(element);
4239 + while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
4240 + if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
4241 + return svgOffsetParent;
4242 + }
4243 + svgOffsetParent = getParentNode(svgOffsetParent);
4244 + }
4245 + return win;
4246 + }
4247 + let offsetParent = getTrueOffsetParent(element, polyfill);
4248 + while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
4249 + offsetParent = getTrueOffsetParent(offsetParent, polyfill);
4250 + }
4251 + if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
4252 + return win;
4253 + }
4254 + return offsetParent || getContainingBlock(element) || win;
4255 + }
4256 + var getElementRects = async function(data) {
4257 + const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
4258 + const getDimensionsFn = this.getDimensions;
4259 + const floatingDimensions = await getDimensionsFn(data.floating);
4260 + return {
4261 + reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
4262 + floating: {
4263 + x: 0,
4264 + y: 0,
4265 + width: floatingDimensions.width,
4266 + height: floatingDimensions.height
4267 + }
4268 + };
4269 + };
4270 + function isRTL(element) {
4271 + return getComputedStyle2(element).direction === "rtl";
4272 + }
4273 + var platform2 = {
4274 + convertOffsetParentRelativeRectToViewportRelativeRect,
4275 + getDocumentElement,
4276 + getClippingRect,
4277 + getOffsetParent,
4278 + getElementRects,
4279 + getClientRects,
4280 + getDimensions,
4281 + getScale,
4282 + isElement,
4283 + isRTL
4284 + };
4285 + function rectsAreEqual(a, b) {
4286 + return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
4287 + }
4288 + function observeMove(element, onMove, ancestorResize) {
4289 + let io = null;
4290 + let timeoutId;
4291 + const root = getDocumentElement(element);
4292 + function cleanup() {
4293 + var _io;
4294 + clearTimeout(timeoutId);
4295 + (_io = io) == null || _io.disconnect();
4296 + io = null;
4297 + }
4298 + function refresh(skip, threshold) {
4299 + if (skip === void 0) {
4300 + skip = false;
4301 + }
4302 + if (threshold === void 0) {
4303 + threshold = 1;
4304 + }
4305 + cleanup();
4306 + const elementRectForRootMargin = element.getBoundingClientRect();
4307 + const {
4308 + left,
4309 + top,
4310 + width,
4311 + height
4312 + } = elementRectForRootMargin;
4313 + if (!skip) {
4314 + onMove();
4315 + }
4316 + if (!width || !height) {
4317 + return;
4318 + }
4319 + const insetTop = floor(top);
4320 + const insetRight = floor(root.clientWidth - (left + width));
4321 + const insetBottom = floor(root.clientHeight - (top + height));
4322 + const insetLeft = floor(left);
4323 + const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
4324 + const options = {
4325 + rootMargin,
4326 + threshold: max(0, min(1, threshold)) || 1
4327 + };
4328 + let isFirstUpdate = true;
4329 + function handleObserve(entries) {
4330 + const ratio = entries[0].intersectionRatio;
4331 + if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
4332 + return refresh();
4333 + }
4334 + if (ratio !== threshold) {
4335 + if (!isFirstUpdate) {
4336 + return refresh();
4337 + }
4338 + if (!ratio) {
4339 + timeoutId = setTimeout(() => {
4340 + refresh(false, 1e-7);
4341 + }, 1e3);
4342 + } else {
4343 + refresh(false, ratio);
4344 + }
4345 + }
4346 + isFirstUpdate = false;
4347 + }
4348 + try {
4349 + io = new IntersectionObserver(handleObserve, {
4350 + ...options,
4351 + // Handle <iframe>s
4352 + root: root.ownerDocument
4353 + });
4354 + } catch (_e) {
4355 + io = new IntersectionObserver(handleObserve, options);
4356 + }
4357 + io.observe(element);
4358 + }
4359 + const win = getWindow(element);
4360 + const handleResize = () => refresh(ancestorResize);
4361 + win.addEventListener("resize", handleResize);
4362 + refresh(true);
4363 + return () => {
4364 + win.removeEventListener("resize", handleResize);
4365 + cleanup();
4366 + };
4367 + }
4368 + function autoUpdate(reference, floating, update2, options) {
4369 + if (options === void 0) {
4370 + options = {};
4371 + }
4372 + const {
4373 + ancestorScroll = true,
4374 + ancestorResize = true,
4375 + elementResize = typeof ResizeObserver === "function",
4376 + layoutShift = typeof IntersectionObserver === "function",
4377 + animationFrame = false
4378 + } = options;
4379 + const referenceEl = unwrapElement(reference);
4380 + const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
4381 + ancestors.forEach((ancestor) => {
4382 + ancestorScroll && ancestor.addEventListener("scroll", update2);
4383 + ancestorResize && ancestor.addEventListener("resize", update2);
4384 + });
4385 + const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null;
4386 + let reobserveFrame = -1;
4387 + let resizeObserver = null;
4388 + if (elementResize) {
4389 + resizeObserver = new ResizeObserver((_ref) => {
4390 + let [firstEntry] = _ref;
4391 + if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
4392 + resizeObserver.unobserve(floating);
4393 + cancelAnimationFrame(reobserveFrame);
4394 + reobserveFrame = requestAnimationFrame(() => {
4395 + var _resizeObserver;
4396 + (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
4397 + });
4398 + }
4399 + update2();
4400 + });
4401 + if (referenceEl && !animationFrame) {
4402 + resizeObserver.observe(referenceEl);
4403 + }
4404 + if (floating) {
4405 + resizeObserver.observe(floating);
4406 + }
4407 + }
4408 + let frameId;
4409 + let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
4410 + if (animationFrame) {
4411 + frameLoop();
4412 + }
4413 + function frameLoop() {
4414 + const nextRefRect = getBoundingClientRect(reference);
4415 + if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
4416 + update2();
4417 + }
4418 + prevRefRect = nextRefRect;
4419 + frameId = requestAnimationFrame(frameLoop);
4420 + }
4421 + update2();
4422 + return () => {
4423 + var _resizeObserver2;
4424 + ancestors.forEach((ancestor) => {
4425 + ancestorScroll && ancestor.removeEventListener("scroll", update2);
4426 + ancestorResize && ancestor.removeEventListener("resize", update2);
4427 + });
4428 + cleanupIo == null || cleanupIo();
4429 + (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
4430 + resizeObserver = null;
4431 + if (animationFrame) {
4432 + cancelAnimationFrame(frameId);
4433 + }
4434 + };
4435 + }
4436 + var offset2 = offset;
4437 + var shift2 = shift;
4438 + var flip2 = flip;
4439 + var size2 = size;
4440 + var limitShift2 = limitShift;
4441 + var computePosition2 = (reference, floating, options) => {
4442 + const cache = /* @__PURE__ */ new Map();
4443 + const mergedOptions = options != null ? options : {};
4444 + const platformWithCache = {
4445 + ...platform2,
4446 + ...mergedOptions.platform,
4447 + _c: cache
4448 + };
4449 + return computePosition(reference, floating, {
4450 + ...mergedOptions,
4451 + platform: platformWithCache
4452 + });
4453 + };
4454 +
4455 + // node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
4456 + var React17 = __toESM(require_react(), 1);
4457 + var import_react2 = __toESM(require_react(), 1);
4458 + var ReactDOM3 = __toESM(require_react_dom(), 1);
4459 + var isClient = typeof document !== "undefined";
4460 + var noop2 = function noop3() {
4461 + };
4462 + var index = isClient ? import_react2.useLayoutEffect : noop2;
4463 + function deepEqual(a, b) {
4464 + if (a === b) {
4465 + return true;
4466 + }
4467 + if (typeof a !== typeof b) {
4468 + return false;
4469 + }
4470 + if (typeof a === "function" && a.toString() === b.toString()) {
4471 + return true;
4472 + }
4473 + let length;
4474 + let i;
4475 + let keys;
4476 + if (a && b && typeof a === "object") {
4477 + if (Array.isArray(a)) {
4478 + length = a.length;
4479 + if (length !== b.length) return false;
4480 + for (i = length; i-- !== 0; ) {
4481 + if (!deepEqual(a[i], b[i])) {
4482 + return false;
4483 + }
4484 + }
4485 + return true;
4486 + }
4487 + keys = Object.keys(a);
4488 + length = keys.length;
4489 + if (length !== Object.keys(b).length) {
4490 + return false;
4491 + }
4492 + for (i = length; i-- !== 0; ) {
4493 + if (!{}.hasOwnProperty.call(b, keys[i])) {
4494 + return false;
4495 + }
4496 + }
4497 + for (i = length; i-- !== 0; ) {
4498 + const key = keys[i];
4499 + if (key === "_owner" && a.$$typeof) {
4500 + continue;
4501 + }
4502 + if (!deepEqual(a[key], b[key])) {
4503 + return false;
4504 + }
4505 + }
4506 + return true;
4507 + }
4508 + return a !== a && b !== b;
4509 + }
4510 + function getDPR(element) {
4511 + if (typeof window === "undefined") {
4512 + return 1;
4513 + }
4514 + const win = element.ownerDocument.defaultView || window;
4515 + return win.devicePixelRatio || 1;
4516 + }
4517 + function roundByDPR(element, value) {
4518 + const dpr = getDPR(element);
4519 + return Math.round(value * dpr) / dpr;
4520 + }
4521 + function useLatestRef(value) {
4522 + const ref = React17.useRef(value);
4523 + index(() => {
4524 + ref.current = value;
4525 + });
4526 + return ref;
4527 + }
4528 + function useFloating(options) {
4529 + if (options === void 0) {
4530 + options = {};
4531 + }
4532 + const {
4533 + placement = "bottom",
4534 + strategy = "absolute",
4535 + middleware = [],
4536 + platform: platform3,
4537 + elements: {
4538 + reference: externalReference,
4539 + floating: externalFloating
4540 + } = {},
4541 + transform = true,
4542 + whileElementsMounted,
4543 + open: open2
4544 + } = options;
4545 + const [data, setData] = React17.useState({
4546 + x: 0,
4547 + y: 0,
4548 + strategy,
4549 + placement,
4550 + middlewareData: {},
4551 + isPositioned: false
4552 + });
4553 + const [latestMiddleware, setLatestMiddleware] = React17.useState(middleware);
4554 + if (!deepEqual(latestMiddleware, middleware)) {
4555 + setLatestMiddleware(middleware);
4556 + }
4557 + const [_reference, _setReference] = React17.useState(null);
4558 + const [_floating, _setFloating] = React17.useState(null);
4559 + const setReference = React17.useCallback((node) => {
4560 + if (node !== referenceRef.current) {
4561 + referenceRef.current = node;
4562 + _setReference(node);
4563 + }
4564 + }, []);
4565 + const setFloating = React17.useCallback((node) => {
4566 + if (node !== floatingRef.current) {
4567 + floatingRef.current = node;
4568 + _setFloating(node);
4569 + }
4570 + }, []);
4571 + const referenceEl = externalReference || _reference;
4572 + const floatingEl = externalFloating || _floating;
4573 + const referenceRef = React17.useRef(null);
4574 + const floatingRef = React17.useRef(null);
4575 + const dataRef = React17.useRef(data);
4576 + const hasWhileElementsMounted = whileElementsMounted != null;
4577 + const whileElementsMountedRef = useLatestRef(whileElementsMounted);
4578 + const platformRef = useLatestRef(platform3);
4579 + const openRef = useLatestRef(open2);
4580 + const update2 = React17.useCallback(() => {
4581 + if (!referenceRef.current || !floatingRef.current) {
4582 + return;
4583 + }
4584 + const config = {
4585 + placement,
4586 + strategy,
4587 + middleware: latestMiddleware
4588 + };
4589 + if (platformRef.current) {
4590 + config.platform = platformRef.current;
4591 + }
4592 + computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
4593 + const fullData = {
4594 + ...data2,
4595 + // The floating element's position may be recomputed while it's closed
4596 + // but still mounted (such as when transitioning out). To ensure
4597 + // `isPositioned` will be `false` initially on the next open, avoid
4598 + // setting it to `true` when `open === false` (must be specified).
4599 + isPositioned: openRef.current !== false
4600 + };
4601 + if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
4602 + dataRef.current = fullData;
4603 + ReactDOM3.flushSync(() => {
4604 + setData(fullData);
4605 + });
4606 + }
4607 + });
4608 + }, [latestMiddleware, placement, strategy, platformRef, openRef]);
4609 + index(() => {
4610 + if (open2 === false && dataRef.current.isPositioned) {
4611 + dataRef.current.isPositioned = false;
4612 + setData((data2) => ({
4613 + ...data2,
4614 + isPositioned: false
4615 + }));
4616 + }
4617 + }, [open2]);
4618 + const isMountedRef = React17.useRef(false);
4619 + index(() => {
4620 + isMountedRef.current = true;
4621 + return () => {
4622 + isMountedRef.current = false;
4623 + };
4624 + }, []);
4625 + index(() => {
4626 + if (referenceEl) referenceRef.current = referenceEl;
4627 + if (floatingEl) floatingRef.current = floatingEl;
4628 + if (referenceEl && floatingEl) {
4629 + if (whileElementsMountedRef.current) {
4630 + return whileElementsMountedRef.current(referenceEl, floatingEl, update2);
4631 + }
4632 + update2();
4633 + }
4634 + }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]);
4635 + const refs = React17.useMemo(() => ({
4636 + reference: referenceRef,
4637 + floating: floatingRef,
4638 + setReference,
4639 + setFloating
4640 + }), [setReference, setFloating]);
4641 + const elements = React17.useMemo(() => ({
4642 + reference: referenceEl,
4643 + floating: floatingEl
4644 + }), [referenceEl, floatingEl]);
4645 + const floatingStyles = React17.useMemo(() => {
4646 + const initialStyles = {
4647 + position: strategy,
4648 + left: 0,
4649 + top: 0
4650 + };
4651 + if (!elements.floating) {
4652 + return initialStyles;
4653 + }
4654 + const x = roundByDPR(elements.floating, data.x);
4655 + const y = roundByDPR(elements.floating, data.y);
4656 + if (transform) {
4657 + return {
4658 + ...initialStyles,
4659 + transform: "translate(" + x + "px, " + y + "px)",
4660 + ...getDPR(elements.floating) >= 1.5 && {
4661 + willChange: "transform"
4662 + }
4663 + };
4664 + }
4665 + return {
4666 + position: strategy,
4667 + left: x,
4668 + top: y
4669 + };
4670 + }, [strategy, transform, elements.floating, data.x, data.y]);
4671 + return React17.useMemo(() => ({
4672 + ...data,
4673 + update: update2,
4674 + refs,
4675 + elements,
4676 + floatingStyles
4677 + }), [data, update2, refs, elements, floatingStyles]);
4678 + }
4679 + var offset3 = (options, deps) => {
4680 + const result = offset2(options);
4681 + return {
4682 + name: result.name,
4683 + fn: result.fn,
4684 + options: [options, deps]
4685 + };
4686 + };
4687 + var shift3 = (options, deps) => {
4688 + const result = shift2(options);
4689 + return {
4690 + name: result.name,
4691 + fn: result.fn,
4692 + options: [options, deps]
4693 + };
4694 + };
4695 + var limitShift3 = (options, deps) => {
4696 + const result = limitShift2(options);
4697 + return {
4698 + fn: result.fn,
4699 + options: [options, deps]
4700 + };
4701 + };
4702 + var flip3 = (options, deps) => {
4703 + const result = flip2(options);
4704 + return {
4705 + name: result.name,
4706 + fn: result.fn,
4707 + options: [options, deps]
4708 + };
4709 + };
4710 + var size3 = (options, deps) => {
4711 + const result = size2(options);
4712 + return {
4713 + name: result.name,
4714 + fn: result.fn,
4715 + options: [options, deps]
4716 + };
4717 + };
4718 +
4719 + // node_modules/@base-ui/react/utils/popups/popupHandle.mjs
4720 + var BasePopupHandle = class {
4721 + /**
4722 + * Stores of every root currently using this handle, in attach order. A handle is meant to be used
4723 + * by a single mounted root, but roots can transiently overlap (e.g. during an animated route
4724 + * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of
4725 + * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.
4726 + */
4727 + attachedStores = [];
4728 + /**
4729 + * Store of the root that currently controls the handle: the most recently attached one still
4730 + * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.
4731 + */
4732 + attachedStoreValue = null;
4733 + /**
4734 + * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.
4735 + */
4736 + storeListeners = /* @__PURE__ */ new Set();
4737 + /**
4738 + * Creates a handle backed by the store used while no root is attached.
4739 + *
4740 + * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,
4741 + * so they can render and register without a mounted root. Triggers register into whichever store
4742 + * `store` currently resolves to, so while detached they live in this store's trigger map and
4743 + * migrate themselves to the root's store (and back) as it attaches/detaches.
4744 + * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces
4745 + * `MenuHandle.open()` in warning text.
4746 + * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is
4747 + * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,
4748 + * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.
4749 + */
4750 + constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {
4751 + this.fallbackStore = fallbackStore;
4752 + this.componentName = componentName;
4753 + this.throwOnMissingTrigger = throwOnMissingTrigger;
4754 + }
4755 + get attachedStore() {
4756 + return this.attachedStoreValue;
4757 + }
4758 + /**
4759 + * Store that detached triggers read from: the attached root's store, or an inert fallback store
4760 + * used while no root is attached.
4761 + * @internal
4762 + */
4763 + get store() {
4764 + return this.attachedStoreValue ?? this.fallbackStore;
4765 + }
4766 + /**
4767 + * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on
4768 + * the handle during render because a handle can be shared by concurrent server-rendered requests.
4769 + * @internal
4770 + */
4771 + get serverStore() {
4772 + return this.fallbackStore;
4773 + }
4774 + /**
4775 + * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind
4776 + * when a root attaches or detaches. Returns a function that removes the listener.
4777 + * @internal
4778 + */
4779 + subscribeStore(listener) {
4780 + this.storeListeners.add(listener);
4781 + return () => {
4782 + this.storeListeners.delete(listener);
4783 + };
4784 + }
4785 + /**
4786 + * Points the handle at a root's store and notifies subscribers so detached triggers re-render and
4787 + * re-register into it (their registration effect migrates them when the store pointer changes).
4788 + * Returns a cleanup function that detaches the store again.
4789 + * @internal
4790 + */
4791 + attachStore(newStore) {
4792 + this.attachedStores.push(newStore);
4793 + this.setActiveStore(newStore);
4794 + if (true) {
4795 + if (this.attachedStores.length > 1) {
4796 + const dev = this;
4797 + (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {
4798 + if (this.attachedStores.length > 1) {
4799 + console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle.");
4800 + }
4801 + });
4802 + }
4803 + }
4804 + return () => {
4805 + const index2 = this.attachedStores.lastIndexOf(newStore);
4806 + if (index2 !== -1) {
4807 + this.attachedStores.splice(index2, 1);
4808 + }
4809 + this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
4810 + };
4811 + }
4812 + /**
4813 + * Sets the store that currently controls the handle and notifies subscribers when it changes, so
4814 + * detached triggers re-render and migrate their registration to the new store.
4815 + */
4816 + setActiveStore(store2) {
4817 + if (this.attachedStoreValue !== store2) {
4818 + this.attachedStoreValue = store2;
4819 + this.storeListeners.forEach((listener) => {
4820 + listener();
4821 + });
4822 + }
4823 + }
4824 + /**
4825 + * Opens the attached root's store and associates it with the trigger with the given id, or a
4826 + * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public
4827 + * `open()` method, which only narrows the parameter type.
4828 + *
4829 + * When a trigger id is given but no matching trigger is registered, anchored popups throw (see
4830 + * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.
4831 + *
4832 + * This method should only be called in an event handler or an effect (not during rendering).
4833 + *
4834 + * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open
4835 + * without associating any trigger.
4836 + */
4837 + openByTrigger(triggerId) {
4838 + const attachedStore = this.attachedStore;
4839 + if (attachedStore === null) {
4840 + if (true) {
4841 + console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`);
4842 + }
4843 + return;
4844 + }
4845 + let triggerElement;
4846 + if (triggerId) {
4847 + for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {
4848 + triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
4849 + }
4850 + triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
4851 + }
4852 + if (triggerId && !triggerElement) {
4853 + if (this.throwOnMissingTrigger) {
4854 + throw new Error(true ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName));
4855 + }
4856 + if (true) {
4857 + console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`);
4858 + }
4859 + }
4860 + attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement));
4861 + }
4862 + /**
4863 + * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)
4864 + * while no root is attached. Shared by every concrete handle's public `close()` method.
4865 + *
4866 + * This method should only be called in an event handler or an effect (not during rendering).
4867 + */
4868 + closePopup() {
4869 + const attachedStore = this.attachedStore;
4870 + if (attachedStore === null) {
4871 + if (true) {
4872 + console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`);
4873 + }
4874 + return;
4875 + }
4876 + attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction));
4877 + }
4878 + };
4879 +
4880 + // node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
4881 + var React22 = __toESM(require_react(), 1);
4882 + var ReactDOM4 = __toESM(require_react_dom(), 1);
4883 +
4884 + // node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs
4885 + var React21 = __toESM(require_react(), 1);
4886 +
4887 + // node_modules/@base-ui/utils/store/useStore.mjs
4888 + var React19 = __toESM(require_react(), 1);
4889 + var import_shim = __toESM(require_shim(), 1);
4890 + var import_with_selector = __toESM(require_with_selector(), 1);
4891 +
4892 + // node_modules/@base-ui/utils/fastHooks.mjs
4893 + var React18 = __toESM(require_react(), 1);
4894 + var hooks = [];
4895 + var currentInstance = void 0;
4896 + function getInstance() {
4897 + return currentInstance;
4898 + }
4899 + function register(hook) {
4900 + hooks.push(hook);
4901 + }
4902 + function fastComponent(fn) {
4903 + const FastComponent = (props, forwardedRef) => {
4904 + const instance = useRefWithInit(createInstance).current;
4905 + let result;
4906 + try {
4907 + currentInstance = instance;
4908 + for (const hook of hooks) {
4909 + hook.before(instance);
4910 + }
4911 + result = fn(props, forwardedRef);
4912 + for (const hook of hooks) {
4913 + hook.after(instance);
4914 + }
4915 + instance.didInitialize = true;
4916 + } finally {
4917 + currentInstance = void 0;
4918 + }
4919 + return result;
4920 + };
4921 + FastComponent.displayName = fn.displayName || fn.name;
4922 + return FastComponent;
4923 + }
4924 + function fastComponentRef(fn) {
4925 + return /* @__PURE__ */ React18.forwardRef(fastComponent(fn));
4926 + }
4927 + function createInstance() {
4928 + return {
4929 + didInitialize: false
4930 + };
4931 + }
4932 +
4933 + // node_modules/@base-ui/utils/store/useStore.mjs
4934 + var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);
4935 + var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;
4936 + function useStore(store2, selector, a1, a2, a3) {
4937 + return useStoreImplementation(store2, selector, a1, a2, a3);
4938 + }
4939 + function useStoreR19(store2, selector, a1, a2, a3) {
4940 + const getSelection = React19.useCallback(() => selector(store2.getSnapshot(), a1, a2, a3), [store2, selector, a1, a2, a3]);
4941 + return (0, import_shim.useSyncExternalStore)(store2.subscribe, getSelection, getSelection);
4942 + }
4943 + register({
4944 + before(instance) {
4945 + instance.syncIndex = 0;
4946 + if (!instance.didInitialize) {
4947 + instance.syncTick = 1;
4948 + instance.syncHooks = [];
4949 + instance.didChangeStore = true;
4950 + instance.getSnapshot = () => {
4951 + let didChange2 = false;
4952 + for (let i = 0; i < instance.syncHooks.length; i += 1) {
4953 + const hook = instance.syncHooks[i];
4954 + const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
4955 + if (!Object.is(hook.value, value)) {
4956 + didChange2 = true;
4957 + hook.value = value;
4958 + }
4959 + }
4960 + if (didChange2) {
4961 + instance.syncTick += 1;
4962 + }
4963 + return instance.syncTick;
4964 + };
4965 + }
4966 + },
4967 + after(instance) {
4968 + if (instance.syncHooks.length > 0) {
4969 + if (instance.didChangeStore) {
4970 + instance.didChangeStore = false;
4971 + instance.subscribe = (onStoreChange) => {
4972 + const stores = /* @__PURE__ */ new Set();
4973 + for (const hook of instance.syncHooks) {
4974 + stores.add(hook.store);
4975 + }
4976 + const unsubscribes = [];
4977 + for (const store2 of stores) {
4978 + unsubscribes.push(store2.subscribe(onStoreChange));
4979 + }
4980 + return () => {
4981 + for (const unsubscribe of unsubscribes) {
4982 + unsubscribe();
4983 + }
4984 + };
4985 + };
4986 + }
4987 + (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot);
4988 + }
4989 + }
4990 + });
4991 + function useStoreFast(store2, selector, a1, a2, a3) {
4992 + const instance = getInstance();
4993 + if (!instance) {
4994 + return useStoreR19(store2, selector, a1, a2, a3);
4995 + }
4996 + const index2 = instance.syncIndex;
4997 + instance.syncIndex += 1;
4998 + let hook;
4999 + if (!instance.didInitialize) {
5000 + hook = {
5001 + store: store2,
5002 + selector,
5003 + a1,
5004 + a2,
5005 + a3,
5006 + value: selector(store2.getSnapshot(), a1, a2, a3)
5007 + };
5008 + instance.syncHooks.push(hook);
5009 + } else {
5010 + hook = instance.syncHooks[index2];
5011 + if (hook.store !== store2 || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {
5012 + if (hook.store !== store2) {
5013 + instance.didChangeStore = true;
5014 + }
5015 + hook.store = store2;
5016 + hook.selector = selector;
5017 + hook.a1 = a1;
5018 + hook.a2 = a2;
5019 + hook.a3 = a3;
5020 + hook.value = selector(store2.getSnapshot(), a1, a2, a3);
5021 + }
5022 + }
5023 + return hook.value;
5024 + }
5025 + function useStoreLegacy(store2, selector, a1, a2, a3) {
5026 + return (0, import_with_selector.useSyncExternalStoreWithSelector)(store2.subscribe, store2.getSnapshot, store2.getSnapshot, (state) => selector(state, a1, a2, a3));
5027 + }
5028 +
5029 + // node_modules/@base-ui/utils/store/Store.mjs
5030 + var Store = class {
5031 + /**
5032 + * Creates a store with the given initial state, constructing the class it is called on.
5033 + * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that
5034 + * class but degrades the inferred instance type to `Store`; use `new` there instead.
5035 + */
5036 + static create(state) {
5037 + return new this(state);
5038 + }
5039 + /**
5040 + * The current state of the store.
5041 + * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
5042 + * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
5043 + * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
5044 + *
5045 + * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
5046 + */
5047 + // Internal state to handle recursive `setState()` calls
5048 + constructor(state) {
5049 + this.state = state;
5050 + this.listeners = /* @__PURE__ */ new Set();
5051 + this.updateTick = 0;
5052 + }
5053 + /**
5054 + * Registers a listener that will be called whenever the store's state changes.
5055 + *
5056 + * @param fn The listener function to be called on state changes.
5057 + * @returns A function to unsubscribe the listener.
5058 + */
5059 + subscribe = (fn) => {
5060 + this.listeners.add(fn);
5061 + return () => {
5062 + this.listeners.delete(fn);
5063 + };
5064 + };
5065 + /**
5066 + * Returns the current state of the store.
5067 + */
5068 + getSnapshot = () => {
5069 + return this.state;
5070 + };
5071 + /**
5072 + * Updates the entire store's state and notifies all registered listeners.
5073 + *
5074 + * @param newState The new state to set for the store.
5075 + */
5076 + setState(newState) {
5077 + if (this.state === newState) {
5078 + return;
5079 + }
5080 + this.state = newState;
5081 + this.updateTick += 1;
5082 + const currentTick = this.updateTick;
5083 + for (const listener of this.listeners) {
5084 + if (currentTick !== this.updateTick) {
5085 + return;
5086 + }
5087 + listener(newState);
5088 + }
5089 + }
5090 + /**
5091 + * Merges the provided changes into the current state and notifies listeners if there are changes.
5092 + * Each value must match its state key. Pass an exact known subset rather than a broad
5093 + * `Partial<State>`, which may contain `undefined` for required state fields.
5094 + *
5095 + * @param changes An object containing the changes to apply to the current state.
5096 + */
5097 + update(changes) {
5098 + for (const key in changes) {
5099 + if (!Object.is(this.state[key], changes[key])) {
5100 + this.setState({
5101 + ...this.state,
5102 + ...changes
5103 + });
5104 + return;
5105 + }
5106 + }
5107 + }
5108 + /**
5109 + * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
5110 + *
5111 + * @param key The key in the store's state to update.
5112 + * @param value The new value to set for the specified key.
5113 + */
5114 + set(key, value) {
5115 + if (!Object.is(this.state[key], value)) {
5116 + this.setState({
5117 + ...this.state,
5118 + [key]: value
5119 + });
5120 + }
5121 + }
5122 + /**
5123 + * Gives the state a new reference and updates all registered listeners.
5124 + */
5125 + notifyAll() {
5126 + const newState = {
5127 + ...this.state
5128 + };
5129 + this.setState(newState);
5130 + }
5131 + use(selector, a1, a2, a3) {
5132 + return useStore(this, selector, a1, a2, a3);
5133 + }
5134 + };
5135 +
5136 + // node_modules/@base-ui/utils/store/ReactStore.mjs
5137 + var React20 = __toESM(require_react(), 1);
5138 + var ReactStore = class extends Store {
5139 + /**
5140 + * Creates a new ReactStore instance.
5141 + *
5142 + * @param state Initial state of the store.
5143 + * @param context Non-reactive context values.
5144 + * @param selectors Optional selectors for use with `useState`.
5145 + */
5146 + constructor(state, context = {}, selectors3) {
5147 + super(state);
5148 + this.context = context;
5149 + this.selectors = selectors3;
5150 + }
5151 + /**
5152 + * Non-reactive values such as refs, callbacks, etc.
5153 + */
5154 + /**
5155 + * Synchronizes a single external value into the store.
5156 + *
5157 + * Note that the while the value in `state` is updated immediately, the value returned
5158 + * by `useState` is updated before the next render (similarly to React's `useState`).
5159 + */
5160 + useSyncedValue(key, value) {
5161 + React20.useDebugValue(key);
5162 + const store2 = this;
5163 + useIsoLayoutEffect(() => {
5164 + if (store2.state[key] !== value) {
5165 + store2.set(key, value);
5166 + }
5167 + }, [store2, key, value]);
5168 + }
5169 + /**
5170 + * Synchronizes a single external value into the store and
5171 + * cleans it up (sets to `undefined`) on unmount.
5172 + *
5173 + * Note that the while the value in `state` is updated immediately, the value returned
5174 + * by `useState` is updated before the next render (similarly to React's `useState`).
5175 + */
5176 + useSyncedValueWithCleanup(key, value) {
5177 + const store2 = this;
5178 + useIsoLayoutEffect(() => {
5179 + if (store2.state[key] !== value) {
5180 + store2.set(key, value);
5181 + }
5182 + return () => {
5183 + store2.set(key, void 0);
5184 + };
5185 + }, [store2, key, value]);
5186 + }
5187 + /**
5188 + * Synchronizes multiple external values into the store.
5189 + * Each value must match its state key. Pass an exact known subset rather than a broad
5190 + * `Partial<State>`, which may contain `undefined` for required state fields.
5191 + *
5192 + * Note that the while the values in `state` are updated immediately, the values returned
5193 + * by `useState` are updated before the next render (similarly to React's `useState`).
5194 + *
5195 + * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted.
5196 + */
5197 + useSyncedValues(statePart) {
5198 + const store2 = this;
5199 + if (true) {
5200 + React20.useDebugValue(statePart, (p) => Object.keys(p));
5201 + const keys = React20.useRef(Object.keys(statePart)).current;
5202 + const nextKeys = Object.keys(statePart);
5203 + if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) {
5204 + console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
5205 + }
5206 + }
5207 + const dependencies = Object.values(statePart);
5208 + useIsoLayoutEffect(() => {
5209 + store2.update(statePart);
5210 + }, [store2, ...dependencies]);
5211 + }
5212 + /**
5213 + * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
5214 + * is non-undefined, the store's state at `key` is updated to match `controlled`.
5215 + */
5216 + useControlledProp(key, controlled) {
5217 + React20.useDebugValue(key);
5218 + const store2 = this;
5219 + const isControlled = controlled !== void 0;
5220 + useIsoLayoutEffect(() => {
5221 + if (isControlled && !Object.is(store2.state[key], controlled)) {
5222 + store2.setState({
5223 + ...store2.state,
5224 + [key]: controlled
5225 + });
5226 + }
5227 + }, [store2, key, controlled, isControlled]);
5228 + if (true) {
5229 + const cache = this.controlledValues ??= /* @__PURE__ */ new Map();
5230 + if (!cache.has(key)) {
5231 + cache.set(key, isControlled);
5232 + }
5233 + const previouslyControlled = cache.get(key);
5234 + if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) {
5235 + console.error(`A component is changing the ${isControlled ? "" : "un"}controlled state of ${key.toString()} to be ${isControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
5236 + }
5237 + }
5238 + }
5239 + /** Gets the current value from the store using a selector with the provided key.
5240 + *
5241 + * @param key Key of the selector to use.
5242 + */
5243 + select(key, a1, a2, a3) {
5244 + const selector = this.selectors[key];
5245 + return selector(this.state, a1, a2, a3);
5246 + }
5247 + /**
5248 + * Returns a value from the store's state using a selector function.
5249 + * Used to subscribe to specific parts of the state.
5250 + * This methods causes a rerender whenever the selected state changes.
5251 + *
5252 + * @param key Key of the selector to use.
5253 + */
5254 + useState(key, a1, a2, a3) {
5255 + React20.useDebugValue(key);
5256 + return useStore(this, this.selectors[key], a1, a2, a3);
5257 + }
5258 + /**
5259 + * Wraps a function with `useStableCallback` to ensure it has a stable reference
5260 + * and assigns it to the context.
5261 + *
5262 + * @param key Key of the event callback. Must be a function in the context.
5263 + * @param fn Function to assign.
5264 + */
5265 + useContextCallback(key, fn) {
5266 + React20.useDebugValue(key);
5267 + const stableFunction = useStableCallback(fn ?? NOOP);
5268 + this.context[key] = stableFunction;
5269 + }
5270 + /**
5271 + * Returns a stable setter function for a specific key in the store's state.
5272 + * It's commonly used to pass as a ref callback to React elements.
5273 + *
5274 + * @param key Key of the state to set.
5275 + */
5276 + useStateSetter(key) {
5277 + const ref = React20.useRef(void 0);
5278 + if (ref.current === void 0) {
5279 + ref.current = (value) => {
5280 + this.set(key, value);
5281 + };
5282 + }
5283 + return ref.current;
5284 + }
5285 + /**
5286 + * Observes changes derived from the store's selectors and calls the listener when the selected value changes.
5287 + *
5288 + * @param key Key of the selector to observe.
5289 + * @param listener Listener function called when the selector result changes.
5290 + */
5291 + observe(selector, listener) {
5292 + let selectFn;
5293 + if (typeof selector === "function") {
5294 + selectFn = selector;
5295 + } else {
5296 + selectFn = this.selectors[selector];
5297 + }
5298 + let prevValue = selectFn(this.state);
5299 + listener(prevValue, prevValue, this);
5300 + return this.subscribe((nextState) => {
5301 + const nextValue = selectFn(nextState);
5302 + if (!Object.is(prevValue, nextValue)) {
5303 + const oldValue = prevValue;
5304 + prevValue = nextValue;
5305 + listener(nextValue, oldValue, this);
5306 + }
5307 + });
5308 + }
5309 + };
5310 +
5311 + // node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs
5312 + var selectors = {
5313 + open: (state) => state.open,
5314 + transitionStatus: (state) => state.transitionStatus,
5315 + domReferenceElement: (state) => state.domReferenceElement,
5316 + referenceElement: (state) => state.positionReference ?? state.referenceElement,
5317 + floatingElement: (state) => state.floatingElement,
5318 + floatingId: (state) => state.floatingId
5319 + };
5320 + var FloatingRootStore = class extends ReactStore {
5321 + constructor(options) {
5322 + const {
5323 + syncOnly,
5324 + nested,
5325 + onOpenChange,
5326 + triggerElements,
5327 + ...initialState
5328 + } = options;
5329 + super({
5330 + ...initialState,
5331 + positionReference: initialState.referenceElement,
5332 + domReferenceElement: initialState.referenceElement
5333 + }, {
5334 + onOpenChange,
5335 + dataRef: {
5336 + current: {}
5337 + },
5338 + events: createEventEmitter(),
5339 + nested,
5340 + triggerElements
5341 + }, selectors);
5342 + this.syncOnly = syncOnly;
5343 + }
5344 + /**
5345 + * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
5346 + */
5347 + syncOpenEvent = (newOpen, event) => {
5348 + if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing
5349 + // click events to upgrade a hover-open.
5350 + event != null && isClickLikeEvent(event)) {
5351 + this.context.dataRef.current.openEvent = newOpen ? event : void 0;
5352 + }
5353 + };
5354 + /**
5355 + * Runs the root-owned side effects for an open state change.
5356 + */
5357 + dispatchOpenChange = (newOpen, eventDetails) => {
5358 + this.syncOpenEvent(newOpen, eventDetails.event);
5359 + const details = {
5360 + open: newOpen,
5361 + reason: eventDetails.reason,
5362 + nativeEvent: eventDetails.event,
5363 + nested: this.context.nested,
5364 + triggerElement: eventDetails.trigger
5365 + };
5366 + this.context.events.emit("openchange", details);
5367 + };
5368 + /**
5369 + * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
5370 + *
5371 + * @param newOpen The new open state.
5372 + * @param eventDetails Details about the event that triggered the open state change.
5373 + */
5374 + setOpen = (newOpen, eventDetails) => {
5375 + if (this.syncOnly) {
5376 + this.context.onOpenChange?.(newOpen, eventDetails);
5377 + return;
5378 + }
5379 + this.dispatchOpenChange(newOpen, eventDetails);
5380 + this.context.onOpenChange?.(newOpen, eventDetails);
5381 + };
5382 + };
5383 +
5384 + // node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs
5385 + function useSyncedFloatingRootContext(options) {
5386 + const {
5387 + popupStore,
5388 + treatPopupAsFloatingElement = false,
5389 + floatingRootContext: floatingRootContextProp,
5390 + floatingId,
5391 + nested,
5392 + onOpenChange
5393 + } = options;
5394 + const open2 = popupStore.useState("open");
5395 + const referenceElement = popupStore.useState("activeTriggerElement");
5396 + const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement");
5397 + const triggerElements = popupStore.context.triggerElements;
5398 + const handleOpenChange = onOpenChange;
5399 + const internalStoreRef = React21.useRef(null);
5400 + if (floatingRootContextProp === void 0 && internalStoreRef.current === null) {
5401 + internalStoreRef.current = new FloatingRootStore({
5402 + open: open2,
5403 + transitionStatus: void 0,
5404 + referenceElement,
5405 + floatingElement,
5406 + triggerElements,
5407 + onOpenChange: handleOpenChange,
5408 + floatingId,
5409 + syncOnly: true,
5410 + nested
5411 + });
5412 + }
5413 + const store2 = floatingRootContextProp ?? internalStoreRef.current;
5414 + popupStore.useSyncedValue("floatingId", floatingId);
5415 + useIsoLayoutEffect(() => {
5416 + const valuesToSync = {
5417 + open: open2,
5418 + floatingId,
5419 + referenceElement,
5420 + floatingElement
5421 + };
5422 + if (isElement(referenceElement)) {
5423 + valuesToSync.domReferenceElement = referenceElement;
5424 + }
5425 + if (store2.state.positionReference === store2.state.referenceElement) {
5426 + valuesToSync.positionReference = referenceElement;
5427 + }
5428 + store2.update(valuesToSync);
5429 + }, [open2, floatingId, referenceElement, floatingElement, store2]);
5430 + store2.context.onOpenChange = handleOpenChange;
5431 + store2.context.nested = nested;
5432 + return store2;
5433 + }
5434 +
5435 + // node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
5436 + var FOCUSABLE_POPUP_PROPS = {
5437 + tabIndex: -1,
5438 + [FOCUSABLE_ATTRIBUTE]: ""
5439 + };
5440 + function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) {
5441 + const floatingId = useId();
5442 + const nested = useFloatingParentNodeId() != null;
5443 + const store2 = useRefWithInit(() => createStore(floatingId, nested)).current;
5444 + useSyncedFloatingRootContext({
5445 + popupStore: store2,
5446 + treatPopupAsFloatingElement,
5447 + floatingRootContext: store2.state.floatingRootContext,
5448 + floatingId,
5449 + nested,
5450 + onOpenChange: store2.setOpen
5451 + });
5452 + return store2;
5453 + }
5454 + function PopupHandleAttachment({
5455 + handle,
5456 + store: store2
5457 + }) {
5458 + useIsoLayoutEffect(() => {
5459 + return handle.attachStore(store2);
5460 + }, [handle, store2]);
5461 + return null;
5462 + }
5463 + function syncTriggerCount(store2) {
5464 + const triggerCount = store2.context.triggerElements.size;
5465 + if (store2.select("open") && store2.state.triggerCount !== triggerCount) {
5466 + store2.set("triggerCount", triggerCount);
5467 + }
5468 + }
5469 + function useTriggerRegistration(id, store2) {
5470 + const registrationRef = React22.useRef(null);
5471 + return useStableCallback((element) => {
5472 + const registration = registrationRef.current;
5473 + if (registration !== null) {
5474 + if (registration.element === element && registration.store === store2 && registration.id === id) {
5475 + return;
5476 + }
5477 + registrationRef.current = null;
5478 + const registeredStore = registration.store;
5479 + if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {
5480 + registeredStore.context.triggerElements.delete(registration.id);
5481 + syncTriggerCount(registeredStore);
5482 + }
5483 + }
5484 + if (element !== null && id !== void 0) {
5485 + registrationRef.current = {
5486 + store: store2,
5487 + id,
5488 + element
5489 + };
5490 + store2.context.triggerElements.add(id, element);
5491 + syncTriggerCount(store2);
5492 + }
5493 + });
5494 + }
5495 + function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) {
5496 + let preventUnmountingOnClose = state.preventUnmountingOnClose;
5497 + if (open2) {
5498 + preventUnmountingOnClose = false;
5499 + } else if (preventUnmountOnClose) {
5500 + preventUnmountingOnClose = true;
5501 + }
5502 + const triggerId = trigger?.id ?? null;
5503 + let activeTriggerId = state.activeTriggerId;
5504 + let activeTriggerElement = state.activeTriggerElement;
5505 + if (triggerId || open2) {
5506 + activeTriggerId = triggerId;
5507 + activeTriggerElement = trigger ?? null;
5508 + }
5509 + return {
5510 + open: open2,
5511 + preventUnmountingOnClose,
5512 + activeTriggerId,
5513 + activeTriggerElement
5514 + };
5515 + }
5516 + function attachPreventUnmountOnClose(eventDetails) {
5517 + let preventUnmountOnClose = false;
5518 + eventDetails.preventUnmountOnClose = () => {
5519 + preventUnmountOnClose = true;
5520 + };
5521 + return () => preventUnmountOnClose;
5522 + }
5523 + function applyPopupOpenChange(store2, nextOpen, eventDetails, options = {}) {
5524 + const reason = eventDetails.reason;
5525 + const isHover = reason === reason_parts_exports.triggerHover;
5526 + const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus;
5527 + const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey);
5528 + const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);
5529 + store2.context.onOpenChange?.(nextOpen, eventDetails);
5530 + if (eventDetails.isCanceled) {
5531 + return;
5532 + }
5533 + options.onBeforeDispatch?.();
5534 + store2.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
5535 + const changeState = () => {
5536 + const popupOpenState = createPopupOpenState(store2.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
5537 + const updatedState = {
5538 + ...options.extraState,
5539 + ...popupOpenState
5540 + };
5541 + if (isFocusOpen) {
5542 + updatedState.instantType = "focus";
5543 + } else if (isDismissClose) {
5544 + updatedState.instantType = "dismiss";
5545 + } else if (isHover) {
5546 + updatedState.instantType = void 0;
5547 + }
5548 + store2.update(updatedState);
5549 + };
5550 + if (isHover) {
5551 + ReactDOM4.flushSync(changeState);
5552 + } else {
5553 + changeState();
5554 + }
5555 + }
5556 + function useTriggerDataForwarding(triggerId, triggerElementRef, store2, stateUpdates) {
5557 + const isMountedByThisTrigger = store2.useState("isMountedByTrigger", triggerId);
5558 + const baseRegisterTrigger = useTriggerRegistration(triggerId, store2);
5559 + const applyTriggerData = useStableCallback((element) => {
5560 + const open2 = store2.select("open");
5561 + const activeTriggerId = store2.select("activeTriggerId");
5562 + if (activeTriggerId === triggerId) {
5563 + const changes = {
5564 + activeTriggerElement: element,
5565 + ...open2 ? stateUpdates : null
5566 + };
5567 + store2.update(changes);
5568 + return;
5569 + }
5570 + if (activeTriggerId == null && open2) {
5571 + const changes = {
5572 + activeTriggerId: triggerId ?? null,
5573 + activeTriggerElement: element,
5574 + ...stateUpdates
5575 + };
5576 + store2.update(changes);
5577 + }
5578 + });
5579 + const registerTrigger = useStableCallback((element) => {
5580 + baseRegisterTrigger(element);
5581 + if (element) {
5582 + applyTriggerData(element);
5583 + }
5584 + });
5585 + useIsoLayoutEffect(() => {
5586 + registerTrigger(triggerElementRef.current);
5587 + return () => registerTrigger(null);
5588 + }, [registerTrigger, triggerElementRef, store2, triggerId]);
5589 + useIsoLayoutEffect(() => {
5590 + if (isMountedByThisTrigger) {
5591 + const changes = {
5592 + activeTriggerElement: triggerElementRef.current,
5593 + ...stateUpdates
5594 + };
5595 + store2.update(changes);
5596 + }
5597 + }, [isMountedByThisTrigger, store2, triggerElementRef, ...Object.values(stateUpdates)]);
5598 + return {
5599 + registerTrigger,
5600 + isMountedByThisTrigger
5601 + };
5602 + }
5603 + function useImplicitActiveTrigger(store2, options = {}) {
5604 + const {
5605 + closeOnActiveTriggerUnmount = false
5606 + } = options;
5607 + const resolvedActiveTriggerIdRef = React22.useRef(null);
5608 + const open2 = store2.useState("open");
5609 + const reactiveTriggerCount = store2.useState("triggerCount");
5610 + const activeTriggerId = store2.useState("activeTriggerId");
5611 + const reactiveActiveTriggerElement = store2.useState("activeTriggerElement");
5612 + useIsoLayoutEffect(() => {
5613 + if (!open2) {
5614 + resolvedActiveTriggerIdRef.current = null;
5615 + if (store2.state.triggerCount !== 0) {
5616 + store2.set("triggerCount", 0);
5617 + }
5618 + return;
5619 + }
5620 + const triggerCount = store2.context.triggerElements.size;
5621 + const stateUpdates = {};
5622 + if (store2.state.triggerCount !== triggerCount) {
5623 + stateUpdates.triggerCount = triggerCount;
5624 + }
5625 + const currentActiveTriggerId = store2.select("activeTriggerId");
5626 + let lostActiveTriggerId = null;
5627 + if (currentActiveTriggerId) {
5628 + const activeTriggerElement = store2.context.triggerElements.getById(currentActiveTriggerId);
5629 + if (!activeTriggerElement) {
5630 + for (const [triggerId, triggerElement] of store2.context.triggerElements.entries()) {
5631 + if (triggerElement === store2.state.activeTriggerElement) {
5632 + stateUpdates.activeTriggerId = triggerId;
5633 + stateUpdates.activeTriggerElement = triggerElement;
5634 + resolvedActiveTriggerIdRef.current = triggerId;
5635 + break;
5636 + }
5637 + }
5638 + if (stateUpdates.activeTriggerId === void 0) {
5639 + if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {
5640 + lostActiveTriggerId = currentActiveTriggerId;
5641 + } else {
5642 + resolvedActiveTriggerIdRef.current = null;
5643 + }
5644 + }
5645 + } else {
5646 + resolvedActiveTriggerIdRef.current = currentActiveTriggerId;
5647 + if (activeTriggerElement !== store2.state.activeTriggerElement) {
5648 + stateUpdates.activeTriggerElement = activeTriggerElement;
5649 + }
5650 + }
5651 + } else {
5652 + resolvedActiveTriggerIdRef.current = null;
5653 + }
5654 + if (!lostActiveTriggerId && !currentActiveTriggerId && triggerCount === 1) {
5655 + const iteratorResult = store2.context.triggerElements.entries().next();
5656 + if (!iteratorResult.done) {
5657 + const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;
5658 + stateUpdates.activeTriggerId = implicitTriggerId;
5659 + stateUpdates.activeTriggerElement = implicitTriggerElement;
5660 + resolvedActiveTriggerIdRef.current = implicitTriggerId;
5661 + }
5662 + }
5663 + if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) {
5664 + store2.update(stateUpdates);
5665 + }
5666 + if (lostActiveTriggerId) {
5667 + if (closeOnActiveTriggerUnmount) {
5668 + queueMicrotask(() => {
5669 + if (store2.select("open") && store2.select("activeTriggerId") === lostActiveTriggerId && !store2.context.triggerElements.getById(lostActiveTriggerId)) {
5670 + const eventDetails = createChangeEventDetails(reason_parts_exports.none);
5671 + store2.setOpen(false, eventDetails);
5672 + if (!eventDetails.isCanceled) {
5673 + store2.update({
5674 + activeTriggerId: null,
5675 + activeTriggerElement: null
5676 + });
5677 + }
5678 + }
5679 + });
5680 + }
5681 + }
5682 + }, [open2, store2, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);
5683 + }
5684 + function useOpenStateTransitions(open2, store2, onUnmount, animateInitialOpen) {
5685 + const {
5686 + mounted,
5687 + setMounted,
5688 + transitionStatus
5689 + } = useTransitionStatus(open2, false, false, animateInitialOpen);
5690 + const preventUnmountingOnClose = store2.useState("preventUnmountingOnClose");
5691 + const syncedPreventUnmountingOnClose = open2 ? false : preventUnmountingOnClose;
5692 + store2.useSyncedValues({
5693 + mounted,
5694 + transitionStatus,
5695 + preventUnmountingOnClose: syncedPreventUnmountingOnClose
5696 + });
5697 + const forceUnmount = useStableCallback(() => {
5698 + setMounted(false);
5699 + store2.update({
5700 + activeTriggerId: null,
5701 + activeTriggerElement: null,
5702 + mounted: false,
5703 + preventUnmountingOnClose: false
5704 + });
5705 + onUnmount?.();
5706 + store2.context.onOpenChangeComplete?.(false);
5707 + });
5708 + useOpenChangeComplete({
5709 + enabled: mounted && !open2 && !syncedPreventUnmountingOnClose,
5710 + open: open2,
5711 + ref: store2.context.popupRef,
5712 + onComplete() {
5713 + if (!open2) {
5714 + forceUnmount();
5715 + }
5716 + }
5717 + });
5718 + return {
5719 + forceUnmount,
5720 + transitionStatus
5721 + };
5722 + }
5723 + function usePopupInteractionProps(store2, statePart) {
5724 + store2.useSyncedValues(statePart);
5725 + useIsoLayoutEffect(() => () => {
5726 + store2.update({
5727 + activeTriggerProps: EMPTY_OBJECT,
5728 + inactiveTriggerProps: EMPTY_OBJECT,
5729 + popupProps: EMPTY_OBJECT
5730 + });
5731 + }, [store2]);
5732 + }
5733 +
5734 + // node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs
5735 + var devElementIdsByMap;
5736 + function getDevElementIds(map) {
5737 + devElementIdsByMap ??= /* @__PURE__ */ new WeakMap();
5738 + let elementIds = devElementIdsByMap.get(map);
5739 + if (!elementIds) {
5740 + elementIds = /* @__PURE__ */ new WeakMap();
5741 + devElementIdsByMap.set(map, elementIds);
5742 + }
5743 + return elementIds;
5744 + }
5745 + var PopupTriggerMap = class {
5746 + constructor() {
5747 + this.idMap = /* @__PURE__ */ new Map();
5748 + }
5749 + /**
5750 + * Adds a trigger element with the given ID.
5751 + *
5752 + * Note: The provided element is assumed to not be registered under multiple IDs.
5753 + */
5754 + add(id, element) {
5755 + if (true) {
5756 + const elementIds = getDevElementIds(this);
5757 + const existingId = elementIds.get(element);
5758 + if (existingId !== void 0 && existingId !== id) {
5759 + throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.");
5760 + }
5761 + const previousElement = this.idMap.get(id);
5762 + if (previousElement !== void 0 && previousElement !== element) {
5763 + elementIds.delete(previousElement);
5764 + }
5765 + elementIds.set(element, id);
5766 + }
5767 + this.idMap.set(id, element);
5768 + }
5769 + /**
5770 + * Removes the trigger element with the given ID.
5771 + */
5772 + delete(id) {
5773 + if (true) {
5774 + const element = this.idMap.get(id);
5775 + if (element !== void 0) {
5776 + devElementIdsByMap?.get(this)?.delete(element);
5777 + }
5778 + }
5779 + this.idMap.delete(id);
5780 + }
5781 + /**
5782 + * Whether the given element is registered as a trigger.
5783 + */
5784 + hasElement(element) {
5785 + for (const registered of this.idMap.values()) {
5786 + if (registered === element) {
5787 + return true;
5788 + }
5789 + }
5790 + return false;
5791 + }
5792 + /**
5793 + * Whether there is a registered trigger element matching the given predicate.
5794 + */
5795 + hasMatchingElement(predicate) {
5796 + for (const element of this.idMap.values()) {
5797 + if (predicate(element)) {
5798 + return true;
5799 + }
5800 + }
5801 + return false;
5802 + }
5803 + /**
5804 + * Returns the trigger element associated with the given ID, or undefined if no such element exists.
5805 + */
5806 + getById(id) {
5807 + return this.idMap.get(id);
5808 + }
5809 + /**
5810 + * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
5811 + */
5812 + entries() {
5813 + return this.idMap.entries();
5814 + }
5815 + /**
5816 + * Returns an iterable of all registered trigger elements.
5817 + */
5818 + elements() {
5819 + return this.idMap.values();
5820 + }
5821 + /**
5822 + * Returns the number of registered trigger elements.
5823 + */
5824 + get size() {
5825 + return this.idMap.size;
5826 + }
5827 + };
5828 +
5829 + // node_modules/@base-ui/react/utils/popups/store.mjs
5830 + function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {
5831 + return {
5832 + open: false,
5833 + openProp: void 0,
5834 + mounted: false,
5835 + transitionStatus: void 0,
5836 + floatingRootContext: new FloatingRootStore({
5837 + open: false,
5838 + transitionStatus: void 0,
5839 + floatingElement: null,
5840 + referenceElement: null,
5841 + triggerElements,
5842 + floatingId,
5843 + syncOnly: true,
5844 + nested,
5845 + onOpenChange: void 0
5846 + }),
5847 + floatingId,
5848 + triggerCount: 0,
5849 + preventUnmountingOnClose: false,
5850 + payload: void 0,
5851 + activeTriggerId: null,
5852 + activeTriggerElement: null,
5853 + triggerIdProp: void 0,
5854 + popupElement: null,
5855 + positionerElement: null,
5856 + activeTriggerProps: EMPTY_OBJECT,
5857 + inactiveTriggerProps: EMPTY_OBJECT,
5858 + popupProps: EMPTY_OBJECT
5859 + };
5860 + }
5861 + var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId;
5862 + var openSelector = (state) => state.openProp ?? state.open;
5863 + var popupIdSelector = (state) => {
5864 + const popupId = state.popupElement?.id ?? state.floatingId;
5865 + return popupId || void 0;
5866 + };
5867 + function triggerOwnsOpenPopup(state, triggerId) {
5868 + return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId;
5869 + }
5870 + function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {
5871 + if (triggerOwnsOpenPopup(state, triggerId)) {
5872 + return true;
5873 + }
5874 + return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1;
5875 + }
5876 + var popupStoreSelectors = {
5877 + open: openSelector,
5878 + mounted: (state) => state.mounted,
5879 + transitionStatus: (state) => state.transitionStatus,
5880 + floatingRootContext: (state) => state.floatingRootContext,
5881 + triggerCount: (state) => state.triggerCount,
5882 + preventUnmountingOnClose: (state) => state.preventUnmountingOnClose,
5883 + payload: (state) => state.payload,
5884 + activeTriggerId: activeTriggerIdSelector,
5885 + activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null,
5886 + popupId: popupIdSelector,
5887 + /**
5888 + * Whether the trigger with the given ID was used to open the popup.
5889 + */
5890 + isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId,
5891 + /**
5892 + * Whether the popup is open and was activated by a trigger with the given ID.
5893 + */
5894 + isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),
5895 + /**
5896 + * Whether the popup is mounted and was activated by a trigger with the given ID.
5897 + */
5898 + isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted,
5899 + triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,
5900 + /**
5901 + * Popup id for the trigger that currently owns the open popup.
5902 + */
5903 + triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0,
5904 + popupProps: (state) => state.popupProps,
5905 + popupElement: (state) => state.popupElement,
5906 + positionerElement: (state) => state.positionerElement
5907 + };
5908 +
5909 + // node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
5910 + var React23 = __toESM(require_react(), 1);
5911 + var import_shim2 = __toESM(require_shim(), 1);
5912 + function usePopupHandleStore(handle) {
5913 + const subscribe = React23.useCallback((listener) => {
5914 + if (handle === void 0) {
5915 + return NOOP;
5916 + }
5917 + return handle.subscribeStore(listener);
5918 + }, [handle]);
5919 + const getSnapshot = React23.useCallback(() => {
5920 + return handle === void 0 ? void 0 : handle.store;
5921 + }, [handle]);
5922 + return (0, import_shim2.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore);
5923 + }
5924 +
5925 + // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs
5926 + function useBaseUIFloating(options) {
5927 + return useFloatingWithStore(options, options.rootContext);
5928 + }
5929 + function useFloatingWithStore(options, store2) {
5930 + const {
5931 + nodeId,
5932 + externalTree
5933 + } = options;
5934 + const referenceElement = store2.useState("referenceElement");
5935 + const floatingElement = store2.useState("floatingElement");
5936 + const domReferenceElement = store2.useState("domReferenceElement");
5937 + const open2 = store2.useState("open");
5938 + const floatingId = store2.useState("floatingId");
5939 + const [positionReference, setPositionReferenceRaw] = React24.useState(null);
5940 + const [localDomReference, setLocalDomReference] = React24.useState(void 0);
5941 + const [localFloatingElement, setLocalFloatingElement] = React24.useState(void 0);
5942 + const domReferenceRef = React24.useRef(null);
5943 + const tree = useFloatingTree(externalTree);
5944 + const storeElements = React24.useMemo(() => ({
5945 + reference: referenceElement,
5946 + floating: floatingElement,
5947 + domReference: domReferenceElement
5948 + }), [referenceElement, floatingElement, domReferenceElement]);
5949 + const position = useFloating({
5950 + ...options,
5951 + elements: {
5952 + ...storeElements,
5953 + ...positionReference && {
5954 + reference: positionReference
5955 + }
5956 + }
5957 + });
5958 + const localDomReferenceElement = isElement(localDomReference) ? localDomReference : null;
5959 + const syncedFloatingElement = localFloatingElement === void 0 ? store2.state.floatingElement : localFloatingElement;
5960 + store2.useSyncedValue("referenceElement", localDomReference ?? null);
5961 + store2.useSyncedValue("domReferenceElement", localDomReference === void 0 ? domReferenceElement : localDomReferenceElement);
5962 + store2.useSyncedValue("floatingElement", syncedFloatingElement);
5963 + const setPositionReference = React24.useCallback((node) => {
5964 + const computedPositionReference = isElement(node) ? {
5965 + getBoundingClientRect: () => node.getBoundingClientRect(),
5966 + getClientRects: () => node.getClientRects(),
5967 + contextElement: node
5968 + } : node;
5969 + setPositionReferenceRaw(computedPositionReference);
5970 + position.refs.setReference(computedPositionReference);
5971 + }, [position.refs]);
5972 + const setReference = React24.useCallback((node) => {
5973 + if (isElement(node) || node === null) {
5974 + domReferenceRef.current = node;
5975 + setLocalDomReference(node);
5976 + }
5977 + if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
5978 + // `null` to support `positionReference` + an unstable `reference`
5979 + // callback ref.
5980 + node !== null && !isElement(node)) {
5981 + position.refs.setReference(node);
5982 + }
5983 + }, [position.refs, setLocalDomReference]);
5984 + const setFloating = React24.useCallback((node) => {
5985 + setLocalFloatingElement(node);
5986 + position.refs.setFloating(node);
5987 + }, [position.refs]);
5988 + const refs = React24.useMemo(() => ({
5989 + ...position.refs,
5990 + setReference,
5991 + setFloating,
5992 + setPositionReference,
5993 + domReference: domReferenceRef
5994 + }), [position.refs, setReference, setFloating, setPositionReference]);
5995 + const elements = React24.useMemo(() => ({
5996 + ...position.elements,
5997 + domReference: domReferenceElement
5998 + }), [position.elements, domReferenceElement]);
5999 + const context = React24.useMemo(() => ({
6000 + ...position,
6001 + dataRef: store2.context.dataRef,
6002 + open: open2,
6003 + onOpenChange: store2.setOpen,
6004 + events: store2.context.events,
6005 + floatingId,
6006 + refs,
6007 + elements,
6008 + nodeId,
6009 + rootStore: store2
6010 + }), [position, refs, elements, nodeId, store2, open2, floatingId]);
6011 + useIsoLayoutEffect(() => {
6012 + if (domReferenceElement) {
6013 + domReferenceRef.current = domReferenceElement;
6014 + }
6015 + }, [domReferenceElement]);
6016 + useIsoLayoutEffect(() => {
6017 + store2.context.dataRef.current.floatingContext = context;
6018 + const node = tree?.nodesRef.current.find((n) => n.id === nodeId);
6019 + if (node) {
6020 + node.context = context;
6021 + }
6022 + });
6023 + return React24.useMemo(() => ({
6024 + ...position,
6025 + context,
6026 + refs,
6027 + elements,
6028 + rootStore: store2
6029 + }), [position, refs, elements, context, store2]);
6030 + }
6031 +
6032 + // node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs
6033 + var React25 = __toESM(require_react(), 1);
6034 + var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit;
6035 + function useFocus(context, props = {}) {
6036 + const {
6037 + enabled = true,
6038 + delay
6039 + } = props;
6040 + const store2 = "rootStore" in context ? context.rootStore : context;
6041 + const {
6042 + events,
6043 + dataRef
6044 + } = store2.context;
6045 + const blockFocusRef = React25.useRef(false);
6046 + const blockedReferenceRef = React25.useRef(null);
6047 + const keyboardModalityRef = React25.useRef(true);
6048 + const timeout = useTimeout();
6049 + React25.useEffect(() => {
6050 + const domReference = store2.select("domReferenceElement");
6051 + if (!enabled) {
6052 + return void 0;
6053 + }
6054 + const win = getWindow(domReference);
6055 + function onBlur() {
6056 + const currentDomReference = store2.select("domReferenceElement");
6057 + if (!store2.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {
6058 + blockFocusRef.current = true;
6059 + blockedReferenceRef.current = currentDomReference;
6060 + }
6061 + }
6062 + function onKeyDown() {
6063 + keyboardModalityRef.current = true;
6064 + }
6065 + function onPointerDown() {
6066 + keyboardModalityRef.current = false;
6067 + }
6068 + return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true));
6069 + }, [store2, enabled]);
6070 + React25.useEffect(() => {
6071 + if (!enabled) {
6072 + return void 0;
6073 + }
6074 + function onOpenChangeLocal(details) {
6075 + if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) {
6076 + const referenceElement = store2.select("domReferenceElement");
6077 + if (isElement(referenceElement)) {
6078 + blockedReferenceRef.current = referenceElement;
6079 + blockFocusRef.current = true;
6080 + }
6081 + }
6082 + }
6083 + events.on("openchange", onOpenChangeLocal);
6084 + return () => {
6085 + events.off("openchange", onOpenChangeLocal);
6086 + };
6087 + }, [events, enabled, store2]);
6088 + const reference = React25.useMemo(() => {
6089 + function resetBlockedFocus() {
6090 + blockFocusRef.current = false;
6091 + blockedReferenceRef.current = null;
6092 + }
6093 + return {
6094 + onMouseLeave() {
6095 + resetBlockedFocus();
6096 + },
6097 + onFocus(event) {
6098 + const focusTarget = event.currentTarget;
6099 + if (blockFocusRef.current) {
6100 + if (blockedReferenceRef.current === focusTarget) {
6101 + return;
6102 + }
6103 + resetBlockedFocus();
6104 + }
6105 + const target = getTarget(event.nativeEvent);
6106 + if (isElement(target)) {
6107 + if (isMacSafari && !event.relatedTarget) {
6108 + if (!keyboardModalityRef.current && !isTypeableElement(target)) {
6109 + return;
6110 + }
6111 + } else if (!matchesFocusVisible(target)) {
6112 + return;
6113 + }
6114 + }
6115 + const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements);
6116 + const {
6117 + nativeEvent,
6118 + currentTarget
6119 + } = event;
6120 + const delayValue = typeof delay === "function" ? delay() : delay;
6121 + if (store2.select("open") && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === void 0) {
6122 + store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget));
6123 + return;
6124 + }
6125 + timeout.start(delayValue, () => {
6126 + if (blockFocusRef.current) {
6127 + return;
6128 + }
6129 + store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget));
6130 + });
6131 + },
6132 + onBlur(event) {
6133 + resetBlockedFocus();
6134 + const relatedTarget = event.relatedTarget;
6135 + const nativeEvent = event.nativeEvent;
6136 + const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
6137 + timeout.start(0, () => {
6138 + const domReference = store2.select("domReferenceElement");
6139 + const activeEl = activeElement(ownerDocument(domReference));
6140 + if (!relatedTarget && activeEl === domReference) {
6141 + return;
6142 + }
6143 + if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {
6144 + return;
6145 + }
6146 + const nextFocusedElement = relatedTarget ?? activeEl;
6147 + if (isTargetInsideEnabledTrigger(nextFocusedElement, store2.context.triggerElements)) {
6148 + return;
6149 + }
6150 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent));
6151 + });
6152 + }
6153 + };
6154 + }, [dataRef, delay, store2, timeout]);
6155 + return React25.useMemo(() => enabled ? {
6156 + reference,
6157 + trigger: reference
6158 + } : {}, [enabled, reference]);
6159 + }
6160 +
6161 + // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
6162 + var React26 = __toESM(require_react(), 1);
6163 +
6164 + // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs
6165 + var HoverInteraction = class _HoverInteraction {
6166 + constructor() {
6167 + this.pointerType = void 0;
6168 + this.interactedInside = false;
6169 + this.handler = void 0;
6170 + this.blockMouseMove = true;
6171 + this.performedPointerEventsMutation = false;
6172 + this.pointerEventsScopeElement = null;
6173 + this.pointerEventsReferenceElement = null;
6174 + this.pointerEventsFloatingElement = null;
6175 + this.restTimeoutPending = false;
6176 + this.openChangeTimeout = new Timeout();
6177 + this.restTimeout = new Timeout();
6178 + this.handleCloseOptions = void 0;
6179 + }
6180 + static create() {
6181 + return new _HoverInteraction();
6182 + }
6183 + dispose = () => {
6184 + this.openChangeTimeout.clear();
6185 + this.restTimeout.clear();
6186 + };
6187 + disposeEffect = () => {
6188 + return this.dispose;
6189 + };
6190 + };
6191 + var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap();
6192 + function clearSafePolygonPointerEventsMutation(instance) {
6193 + if (!instance.performedPointerEventsMutation) {
6194 + return;
6195 + }
6196 + const scopeElement = instance.pointerEventsScopeElement;
6197 + if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) {
6198 + instance.pointerEventsScopeElement?.style.removeProperty("pointer-events");
6199 + instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events");
6200 + instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events");
6201 + pointerEventsMutationOwnerByScopeElement.delete(scopeElement);
6202 + }
6203 + instance.performedPointerEventsMutation = false;
6204 + instance.pointerEventsScopeElement = null;
6205 + instance.pointerEventsReferenceElement = null;
6206 + instance.pointerEventsFloatingElement = null;
6207 + }
6208 + function applySafePolygonPointerEventsMutation(instance, options) {
6209 + const {
6210 + scopeElement,
6211 + referenceElement,
6212 + floatingElement
6213 + } = options;
6214 + const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement);
6215 + if (existingOwner && existingOwner !== instance) {
6216 + clearSafePolygonPointerEventsMutation(existingOwner);
6217 + }
6218 + clearSafePolygonPointerEventsMutation(instance);
6219 + instance.performedPointerEventsMutation = true;
6220 + instance.pointerEventsScopeElement = scopeElement;
6221 + instance.pointerEventsReferenceElement = referenceElement;
6222 + instance.pointerEventsFloatingElement = floatingElement;
6223 + pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance);
6224 + scopeElement.style.pointerEvents = "none";
6225 + referenceElement.style.pointerEvents = "auto";
6226 + floatingElement.style.pointerEvents = "auto";
6227 + }
6228 + function useHoverInteractionSharedState(store2) {
6229 + const data = store2.context.dataRef.current;
6230 + const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current;
6231 + if (!data.hoverInteractionState) {
6232 + data.hoverInteractionState = instance;
6233 + }
6234 + useOnMount(data.hoverInteractionState.disposeEffect);
6235 + return data.hoverInteractionState;
6236 + }
6237 +
6238 + // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
6239 + function useHoverFloatingInteraction(context, parameters = {}) {
6240 + const {
6241 + enabled = true,
6242 + closeDelay: closeDelayProp = 0,
6243 + nodeId: nodeIdProp
6244 + } = parameters;
6245 + const store2 = "rootStore" in context ? context.rootStore : context;
6246 + const open2 = store2.useState("open");
6247 + const floatingElement = store2.useState("floatingElement");
6248 + const domReferenceElement = store2.useState("domReferenceElement");
6249 + const {
6250 + dataRef
6251 + } = store2.context;
6252 + const tree = useFloatingTree();
6253 + const parentId = useFloatingParentNodeId();
6254 + const instance = useHoverInteractionSharedState(store2);
6255 + const childClosedTimeout = useTimeout();
6256 + const isClickLikeOpenEvent2 = useStableCallback(() => {
6257 + return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside);
6258 + });
6259 + const isHoverOpen = useStableCallback(() => {
6260 + return isHoverOpenEvent(dataRef.current.openEvent?.type);
6261 + });
6262 + const clearPointerEvents = useStableCallback(() => {
6263 + clearSafePolygonPointerEventsMutation(instance);
6264 + });
6265 + useIsoLayoutEffect(() => {
6266 + if (!open2) {
6267 + instance.pointerType = void 0;
6268 + instance.restTimeoutPending = false;
6269 + instance.interactedInside = false;
6270 + clearPointerEvents();
6271 + }
6272 + }, [open2, instance, clearPointerEvents]);
6273 + React26.useEffect(() => {
6274 + return clearPointerEvents;
6275 + }, [clearPointerEvents]);
6276 + useIsoLayoutEffect(() => {
6277 + if (!enabled) {
6278 + return void 0;
6279 + }
6280 + if (open2 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) {
6281 + const ref = domReferenceElement;
6282 + const floatingEl = floatingElement;
6283 + const doc = ownerDocument(floatingElement);
6284 + const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating;
6285 + if (parentFloating) {
6286 + parentFloating.style.pointerEvents = "";
6287 + }
6288 + const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null;
6289 + const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null;
6290 + const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? ref.closest("[data-rootownerid]") ?? doc.body;
6291 + applySafePolygonPointerEventsMutation(instance, {
6292 + scopeElement,
6293 + referenceElement: ref,
6294 + floatingElement: floatingEl
6295 + });
6296 + return () => {
6297 + clearPointerEvents();
6298 + };
6299 + }
6300 + return void 0;
6301 + }, [enabled, open2, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]);
6302 + React26.useEffect(() => {
6303 + if (!enabled) {
6304 + return void 0;
6305 + }
6306 + function hasParentChildren() {
6307 + return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0);
6308 + }
6309 + function closeWithDelay(event) {
6310 + const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType);
6311 + const close = () => {
6312 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
6313 + tree?.events.emit("floating.closed", event);
6314 + };
6315 + if (closeDelay) {
6316 + instance.openChangeTimeout.start(closeDelay, close);
6317 + } else {
6318 + instance.openChangeTimeout.clear();
6319 + close();
6320 + }
6321 + }
6322 + function handleInteractInside(event) {
6323 + const target = getTarget(event);
6324 + if (!isInteractiveElement(target)) {
6325 + instance.interactedInside = false;
6326 + return;
6327 + }
6328 + instance.interactedInside = target?.closest("[aria-haspopup]") != null;
6329 + }
6330 + function onFloatingMouseEnter() {
6331 + instance.openChangeTimeout.clear();
6332 + childClosedTimeout.clear();
6333 + tree?.events.off("floating.closed", onNodeClosed);
6334 + clearPointerEvents();
6335 + }
6336 + function onFloatingMouseLeave(event) {
6337 + if (hasParentChildren() && tree) {
6338 + tree.events.on("floating.closed", onNodeClosed);
6339 + return;
6340 + }
6341 + if (isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements)) {
6342 + return;
6343 + }
6344 + const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp;
6345 + const relatedTarget = event.relatedTarget;
6346 + const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget));
6347 + if (isMovingIntoDescendantFloating) {
6348 + return;
6349 + }
6350 + if (instance.handler) {
6351 + instance.handler(event);
6352 + return;
6353 + }
6354 + clearPointerEvents();
6355 + if (isHoverOpen() && !isClickLikeOpenEvent2()) {
6356 + closeWithDelay(event);
6357 + }
6358 + }
6359 + function onNodeClosed(event) {
6360 + if (!tree || !parentId || hasParentChildren()) {
6361 + return;
6362 + }
6363 + childClosedTimeout.start(0, () => {
6364 + tree.events.off("floating.closed", onNodeClosed);
6365 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
6366 + tree.events.emit("floating.closed", event);
6367 + });
6368 + }
6369 + const floating = floatingElement;
6370 + return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => {
6371 + tree?.events.off("floating.closed", onNodeClosed);
6372 + });
6373 + }, [enabled, floatingElement, store2, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]);
6374 + }
6375 +
6376 + // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs
6377 + var React27 = __toESM(require_react(), 1);
6378 + var ReactDOM5 = __toESM(require_react_dom(), 1);
6379 + var EMPTY_REF = {
6380 + current: null
6381 + };
6382 + function useHoverReferenceInteraction(context, props = {}) {
6383 + const {
6384 + enabled = true,
6385 + delay = 0,
6386 + handleClose = null,
6387 + mouseOnly = false,
6388 + restMs = 0,
6389 + move: move2 = true,
6390 + triggerElementRef = EMPTY_REF,
6391 + externalTree,
6392 + isActiveTrigger = true,
6393 + getHandleCloseContext,
6394 + isClosing,
6395 + shouldOpen: shouldOpenProp,
6396 + guardStaleOpen = false
6397 + } = props;
6398 + const store2 = "rootStore" in context ? context.rootStore : context;
6399 + const {
6400 + dataRef,
6401 + events
6402 + } = store2.context;
6403 + const tree = useFloatingTree(externalTree);
6404 + const instance = useHoverInteractionSharedState(store2);
6405 + const isHoverCloseActiveRef = React27.useRef(false);
6406 + const handleCloseRef = useValueAsRef(handleClose);
6407 + const delayRef = useValueAsRef(delay);
6408 + const restMsRef = useValueAsRef(restMs);
6409 + const enabledRef = useValueAsRef(enabled);
6410 + const shouldOpenRef = useValueAsRef(shouldOpenProp);
6411 + const isClosingRef = useValueAsRef(isClosing);
6412 + const isClickLikeOpenEvent2 = useStableCallback(() => {
6413 + return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside);
6414 + });
6415 + const checkShouldOpen = useStableCallback(() => {
6416 + return shouldOpenRef.current?.() !== false;
6417 + });
6418 + const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => {
6419 + const allTriggers = store2.context.triggerElements;
6420 + if (allTriggers.hasElement(currentTarget)) {
6421 + return !currentDomReference || !contains(currentDomReference, currentTarget);
6422 + }
6423 + if (!isElement(target)) {
6424 + return false;
6425 + }
6426 + const targetElement = target;
6427 + return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement));
6428 + });
6429 + const cleanupMouseMoveHandler = useStableCallback(() => {
6430 + if (!instance.handler) {
6431 + return;
6432 + }
6433 + const doc = ownerDocument(store2.select("domReferenceElement"));
6434 + doc.removeEventListener("mousemove", instance.handler);
6435 + instance.handler = void 0;
6436 + });
6437 + const clearPointerEvents = useStableCallback(() => {
6438 + clearSafePolygonPointerEventsMutation(instance);
6439 + });
6440 + if (isActiveTrigger) {
6441 + instance.handleCloseOptions = handleClose?.__options;
6442 + }
6443 + React27.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]);
6444 + React27.useEffect(() => {
6445 + if (!enabled) {
6446 + return void 0;
6447 + }
6448 + function onOpenChangeLocal(details) {
6449 + if (!details.open) {
6450 + isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover;
6451 + cleanupMouseMoveHandler();
6452 + instance.openChangeTimeout.clear();
6453 + instance.restTimeout.clear();
6454 + instance.blockMouseMove = true;
6455 + instance.restTimeoutPending = false;
6456 + } else {
6457 + isHoverCloseActiveRef.current = false;
6458 + }
6459 + }
6460 + events.on("openchange", onOpenChangeLocal);
6461 + return () => {
6462 + events.off("openchange", onOpenChangeLocal);
6463 + };
6464 + }, [enabled, events, instance, cleanupMouseMoveHandler]);
6465 + React27.useEffect(() => {
6466 + if (!enabled) {
6467 + return void 0;
6468 + }
6469 + function closeWithDelay(event, runElseBranch = true) {
6470 + const closeDelay = getDelay(delayRef.current, "close", instance.pointerType);
6471 + if (closeDelay) {
6472 + instance.openChangeTimeout.start(closeDelay, () => {
6473 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
6474 + tree?.events.emit("floating.closed", event);
6475 + });
6476 + } else if (runElseBranch) {
6477 + instance.openChangeTimeout.clear();
6478 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
6479 + tree?.events.emit("floating.closed", event);
6480 + }
6481 + }
6482 + const trigger = triggerElementRef.current ?? (isActiveTrigger ? store2.select("domReferenceElement") : null);
6483 + if (!isElement(trigger)) {
6484 + return void 0;
6485 + }
6486 + function onMouseEnter(event) {
6487 + instance.openChangeTimeout.clear();
6488 + instance.blockMouseMove = false;
6489 + if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {
6490 + return;
6491 + }
6492 + const restMsValue = getRestMs(restMsRef.current);
6493 + const openDelay = getDelay(delayRef.current, "open", instance.pointerType);
6494 + const eventTarget = getTarget(event);
6495 + const currentTarget = event.currentTarget ?? null;
6496 + const currentDomReference = store2.select("domReferenceElement");
6497 + let triggerNode = currentTarget;
6498 + if (isElement(eventTarget) && !store2.context.triggerElements.hasElement(eventTarget)) {
6499 + for (const triggerElement of store2.context.triggerElements.elements()) {
6500 + if (contains(triggerElement, eventTarget)) {
6501 + triggerNode = triggerElement;
6502 + break;
6503 + }
6504 + }
6505 + }
6506 + if (isElement(currentTarget) && isElement(currentDomReference) && !store2.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) {
6507 + triggerNode = currentDomReference;
6508 + }
6509 + const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget);
6510 + const isOpen = store2.select("open");
6511 + const isInClosingTransition = isClosingRef.current?.() ?? store2.select("transitionStatus") === "ending";
6512 + const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current;
6513 + const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition;
6514 + const isRestOnlyDelay = restMsValue > 0 && !openDelay;
6515 + const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition;
6516 + const shouldOpen = !isOpen || isOverInactive;
6517 + if (shouldOpenImmediately) {
6518 + if (checkShouldOpen()) {
6519 + store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
6520 + }
6521 + return;
6522 + }
6523 + if (isRestOnlyDelay) {
6524 + return;
6525 + }
6526 + if (openDelay) {
6527 + instance.openChangeTimeout.start(openDelay, () => {
6528 + if (shouldOpen && checkShouldOpen()) {
6529 + store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
6530 + }
6531 + });
6532 + } else if (shouldOpen) {
6533 + if (checkShouldOpen()) {
6534 + store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
6535 + }
6536 + }
6537 + }
6538 + function onMouseLeave(event) {
6539 + if (isClickLikeOpenEvent2()) {
6540 + clearPointerEvents();
6541 + return;
6542 + }
6543 + cleanupMouseMoveHandler();
6544 + const domReferenceElement = store2.select("domReferenceElement");
6545 + const doc = ownerDocument(domReferenceElement);
6546 + instance.restTimeout.clear();
6547 + instance.restTimeoutPending = false;
6548 + const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.();
6549 + if (isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements)) {
6550 + return;
6551 + }
6552 + if (handleCloseRef.current && handleCloseContextBase) {
6553 + if (!store2.select("open")) {
6554 + instance.openChangeTimeout.clear();
6555 + }
6556 + const currentTrigger = triggerElementRef.current;
6557 + instance.handler = handleCloseRef.current({
6558 + ...handleCloseContextBase,
6559 + tree,
6560 + x: event.clientX,
6561 + y: event.clientY,
6562 + onClose() {
6563 + clearPointerEvents();
6564 + cleanupMouseMoveHandler();
6565 + if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store2.select("domReferenceElement")) {
6566 + closeWithDelay(event, true);
6567 + }
6568 + }
6569 + });
6570 + doc.addEventListener("mousemove", instance.handler);
6571 + instance.handler(event);
6572 + return;
6573 + }
6574 + const shouldClose = instance.pointerType === "touch" ? !contains(store2.select("floatingElement"), event.relatedTarget) : true;
6575 + if (shouldClose) {
6576 + closeWithDelay(event);
6577 + }
6578 + }
6579 + function onMouseOut(event) {
6580 + if (contains(trigger, event.relatedTarget)) {
6581 + return;
6582 + }
6583 + instance.openChangeTimeout.clear();
6584 + instance.restTimeout.clear();
6585 + instance.restTimeoutPending = false;
6586 + }
6587 + const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0;
6588 + if (move2) {
6589 + return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, {
6590 + once: true
6591 + }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard);
6592 + }
6593 + return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard);
6594 + }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store2, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move2, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]);
6595 + return React27.useMemo(() => {
6596 + if (!enabled) {
6597 + return void 0;
6598 + }
6599 + function setPointerRef(event) {
6600 + instance.pointerType = event.pointerType;
6601 + }
6602 + return {
6603 + onPointerDown: setPointerRef,
6604 + onPointerEnter: setPointerRef,
6605 + onMouseMove(event) {
6606 + const {
6607 + nativeEvent
6608 + } = event;
6609 + const trigger = event.currentTarget;
6610 + const currentDomReference = store2.select("domReferenceElement");
6611 + const currentOpen = store2.select("open");
6612 + const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target);
6613 + if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {
6614 + return;
6615 + }
6616 + if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) {
6617 + const floatingElement = store2.select("floatingElement");
6618 + if (floatingElement) {
6619 + const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body;
6620 + applySafePolygonPointerEventsMutation(instance, {
6621 + scopeElement,
6622 + referenceElement: trigger,
6623 + floatingElement
6624 + });
6625 + }
6626 + }
6627 + const restMsValue = getRestMs(restMsRef.current);
6628 + if (currentOpen && !isOverInactive || restMsValue === 0) {
6629 + return;
6630 + }
6631 + if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) {
6632 + return;
6633 + }
6634 + instance.restTimeout.clear();
6635 + function handleMouseMove() {
6636 + instance.restTimeoutPending = false;
6637 + if (isClickLikeOpenEvent2()) {
6638 + return;
6639 + }
6640 + const latestOpen = store2.select("open");
6641 + if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) {
6642 + store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger));
6643 + }
6644 + }
6645 + if (instance.pointerType === "touch") {
6646 + ReactDOM5.flushSync(() => {
6647 + handleMouseMove();
6648 + });
6649 + } else if (isOverInactive && currentOpen) {
6650 + handleMouseMove();
6651 + } else {
6652 + instance.restTimeoutPending = true;
6653 + instance.restTimeout.start(restMsValue, handleMouseMove);
6654 + }
6655 + }
6656 + };
6657 + }, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store2, restMsRef, checkShouldOpen]);
6658 + }
6659 +
6660 + // node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs
6661 + var CURSOR_SPEED_THRESHOLD = 0.1;
6662 + var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD;
6663 + var POLYGON_BUFFER = 0.5;
6664 + function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) {
6665 + return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi;
6666 + }
6667 + function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) {
6668 + let isInsideValue = false;
6669 + if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) {
6670 + isInsideValue = !isInsideValue;
6671 + }
6672 + if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) {
6673 + isInsideValue = !isInsideValue;
6674 + }
6675 + if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) {
6676 + isInsideValue = !isInsideValue;
6677 + }
6678 + if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) {
6679 + isInsideValue = !isInsideValue;
6680 + }
6681 + return isInsideValue;
6682 + }
6683 + function isInsideRect(pointX, pointY, rect) {
6684 + return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height;
6685 + }
6686 + function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) {
6687 + const minX = Math.min(x1, x2);
6688 + const maxX = Math.max(x1, x2);
6689 + const minY = Math.min(y1, y2);
6690 + const maxY = Math.max(y1, y2);
6691 + return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY;
6692 + }
6693 + function safePolygon(options = {}) {
6694 + const {
6695 + blockPointerEvents = false
6696 + } = options;
6697 + const timeout = new Timeout();
6698 + const fn = ({
6699 + x,
6700 + y,
6701 + placement,
6702 + elements,
6703 + onClose,
6704 + nodeId,
6705 + tree
6706 + }) => {
6707 + const side = placement?.split("-")[0];
6708 + let hasLanded = false;
6709 + let lastX = null;
6710 + let lastY = null;
6711 + let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0;
6712 + function isCursorMovingSlowly(nextX, nextY) {
6713 + const currentTime = performance.now();
6714 + const elapsedTime = currentTime - lastCursorTime;
6715 + if (lastX === null || lastY === null || elapsedTime === 0) {
6716 + lastX = nextX;
6717 + lastY = nextY;
6718 + lastCursorTime = currentTime;
6719 + return false;
6720 + }
6721 + const deltaX = nextX - lastX;
6722 + const deltaY = nextY - lastY;
6723 + const distanceSquared = deltaX * deltaX + deltaY * deltaY;
6724 + const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED;
6725 + lastX = nextX;
6726 + lastY = nextY;
6727 + lastCursorTime = currentTime;
6728 + return distanceSquared < thresholdSquared;
6729 + }
6730 + function close() {
6731 + timeout.clear();
6732 + onClose();
6733 + }
6734 + return function onMouseMove(event) {
6735 + timeout.clear();
6736 + const domReference = elements.domReference;
6737 + const floating = elements.floating;
6738 + if (!domReference || !floating || side == null || x == null || y == null) {
6739 + return void 0;
6740 + }
6741 + const {
6742 + clientX,
6743 + clientY
6744 + } = event;
6745 + const target = getTarget(event);
6746 + const isLeave = event.type === "mouseleave";
6747 + const isOverFloatingEl = contains(floating, target);
6748 + const isOverReferenceEl = contains(domReference, target);
6749 + if (isOverFloatingEl) {
6750 + hasLanded = true;
6751 + if (!isLeave) {
6752 + return void 0;
6753 + }
6754 + }
6755 + if (isOverReferenceEl) {
6756 + hasLanded = false;
6757 + if (!isLeave) {
6758 + hasLanded = true;
6759 + return void 0;
6760 + }
6761 + }
6762 + if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) {
6763 + return void 0;
6764 + }
6765 + function hasOpenChildNode() {
6766 + return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0);
6767 + }
6768 + function closeIfNoOpenChild() {
6769 + if (!hasOpenChildNode()) {
6770 + close();
6771 + }
6772 + }
6773 + if (hasOpenChildNode()) {
6774 + return void 0;
6775 + }
6776 + const refRect = domReference.getBoundingClientRect();
6777 + const rect = floating.getBoundingClientRect();
6778 + const cursorLeaveFromRight = x > rect.right - rect.width / 2;
6779 + const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;
6780 + const isFloatingWider = rect.width > refRect.width;
6781 + const isFloatingTaller = rect.height > refRect.height;
6782 + const left = (isFloatingWider ? refRect : rect).left;
6783 + const right = (isFloatingWider ? refRect : rect).right;
6784 + const top = (isFloatingTaller ? refRect : rect).top;
6785 + const bottom = (isFloatingTaller ? refRect : rect).bottom;
6786 + if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) {
6787 + closeIfNoOpenChild();
6788 + return void 0;
6789 + }
6790 + let isInsideTroughRect = false;
6791 + switch (side) {
6792 + case "top":
6793 + isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1);
6794 + break;
6795 + case "bottom":
6796 + isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1);
6797 + break;
6798 + case "left":
6799 + isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top);
6800 + break;
6801 + case "right":
6802 + isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top);
6803 + break;
6804 + default:
6805 + }
6806 + if (isInsideTroughRect) {
6807 + return void 0;
6808 + }
6809 + if (hasLanded && !isInsideRect(clientX, clientY, refRect)) {
6810 + closeIfNoOpenChild();
6811 + return void 0;
6812 + }
6813 + if (!isLeave && isCursorMovingSlowly(clientX, clientY)) {
6814 + closeIfNoOpenChild();
6815 + return void 0;
6816 + }
6817 + let isInsidePolygon = false;
6818 + switch (side) {
6819 + case "top": {
6820 + const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
6821 + const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
6822 + const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
6823 + const cursorPointY = y + POLYGON_BUFFER + 1;
6824 + const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top;
6825 + const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER;
6826 + isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);
6827 + break;
6828 + }
6829 + case "bottom": {
6830 + const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
6831 + const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
6832 + const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
6833 + const cursorPointY = y - POLYGON_BUFFER;
6834 + const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom;
6835 + const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER;
6836 + isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);
6837 + break;
6838 + }
6839 + case "left": {
6840 + const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
6841 + const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
6842 + const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
6843 + const cursorPointX = x + POLYGON_BUFFER + 1;
6844 + const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left;
6845 + const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER;
6846 + isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY);
6847 + break;
6848 + }
6849 + case "right": {
6850 + const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
6851 + const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
6852 + const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
6853 + const cursorPointX = x - POLYGON_BUFFER;
6854 + const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right;
6855 + const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER;
6856 + isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom);
6857 + break;
6858 + }
6859 + default:
6860 + }
6861 + if (!isInsidePolygon) {
6862 + closeIfNoOpenChild();
6863 + } else if (!hasLanded) {
6864 + timeout.start(40, closeIfNoOpenChild);
6865 + }
6866 + return void 0;
6867 + };
6868 + };
6869 + fn.__options = {
6870 + ...options,
6871 + blockPointerEvents
6872 + };
6873 + return fn;
6874 + }
6875 +
6876 + // node_modules/@base-ui/react/utils/NullStore.mjs
6877 + var NullStore = class extends ReactStore {
6878 + // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding
6879 + // `setState` alone would neutralize them today. They are overridden explicitly so the store stays
6880 + // inert even if a future base-class change stops routing a mutator through `setState`.
6881 + setState(_newState) {
6882 + }
6883 + update(_changes) {
6884 + }
6885 + set(_key, _value) {
6886 + }
6887 + notifyAll() {
6888 + }
6889 + };
6890 +
6891 + // node_modules/@base-ui/utils/inertValue.mjs
6892 + function inertValue(value) {
6893 + if (isReactVersionAtLeast(19)) {
6894 + return value;
6895 + }
6896 + return value ? "true" : void 0;
6897 + }
6898 +
6899 + // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
6900 + var React28 = __toESM(require_react(), 1);
6901 + var DirectionContext = /* @__PURE__ */ React28.createContext(void 0);
6902 + if (true) DirectionContext.displayName = "DirectionContext";
6903 + function useDirection() {
6904 + const context = React28.useContext(DirectionContext);
6905 + return context?.direction ?? "ltr";
6906 + }
6907 +
6908 + // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
6909 + var React29 = __toESM(require_react(), 1);
6910 +
6911 + // node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs
6912 + var baseArrow = (options) => ({
6913 + name: "arrow",
6914 + options,
6915 + async fn(state) {
6916 + const {
6917 + x,
6918 + y,
6919 + placement,
6920 + rects,
6921 + platform: platform3,
6922 + elements,
6923 + middlewareData
6924 + } = state;
6925 + const {
6926 + element,
6927 + padding = 0,
6928 + offsetParent = "real"
6929 + } = evaluate(options, state) || {};
6930 + if (element == null) {
6931 + return {};
6932 + }
6933 + const paddingObject = getPaddingObject(padding);
6934 + const coords = {
6935 + x,
6936 + y
6937 + };
6938 + const axis = getAlignmentAxis(placement);
6939 + const length = getAxisLength(axis);
6940 + const arrowDimensions = await platform3.getDimensions(element);
6941 + const isYAxis = axis === "y";
6942 + const minProp = isYAxis ? "top" : "left";
6943 + const maxProp = isYAxis ? "bottom" : "right";
6944 + const clientProp = isYAxis ? "clientHeight" : "clientWidth";
6945 + const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
6946 + const startDiff = coords[axis] - rects.reference[axis];
6947 + const arrowOffsetParent = offsetParent === "real" ? await platform3.getOffsetParent?.(element) : elements.floating;
6948 + let clientSize = elements.floating[clientProp] || rects.floating[length];
6949 + if (!clientSize || !await platform3.isElement?.(arrowOffsetParent)) {
6950 + clientSize = elements.floating[clientProp] || rects.floating[length];
6951 + }
6952 + const centerToReference = endDiff / 2 - startDiff / 2;
6953 + const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
6954 + const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding);
6955 + const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding);
6956 + const min2 = minPadding;
6957 + const max2 = clientSize - arrowDimensions[length] - maxPadding;
6958 + const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
6959 + const offset4 = clamp(min2, center, max2);
6960 + const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
6961 + const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0;
6962 + return {
6963 + [axis]: coords[axis] + alignmentOffset,
6964 + data: {
6965 + [axis]: offset4,
6966 + centerOffset: center - offset4 - alignmentOffset,
6967 + ...shouldAddOffset && {
6968 + alignmentOffset
6969 + }
6970 + },
6971 + reset: shouldAddOffset
6972 + };
6973 + }
6974 + });
6975 + var arrow4 = (options, deps) => {
6976 + const {
6977 + name,
6978 + fn
6979 + } = baseArrow(options);
6980 + return {
6981 + name,
6982 + fn,
6983 + options: [options, deps]
6984 + };
6985 + };
6986 +
6987 + // node_modules/@base-ui/react/utils/hideMiddleware.mjs
6988 + var hide4 = {
6989 + name: "hide",
6990 + async fn(state) {
6991 + const {
6992 + width,
6993 + height,
6994 + x,
6995 + y
6996 + } = state.rects.reference;
6997 + const anchorHidden2 = width === 0 && height === 0 && x === 0 && y === 0;
6998 + const overflow = await state.platform.detectOverflow(state, {
6999 + elementContext: "reference"
7000 + });
7001 + const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0;
7002 + return {
7003 + data: {
7004 + referenceHidden: referenceHidden || anchorHidden2
7005 + }
7006 + };
7007 + }
7008 + };
7009 +
7010 + // node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs
7011 + var DEFAULT_SIDES = {
7012 + sideX: "left",
7013 + sideY: "top"
7014 + };
7015 +
7016 + // node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs
7017 + var availableWidth = "--available-width";
7018 + var availableHeight = "--available-height";
7019 + var anchorWidth = "--anchor-width";
7020 + var anchorHeight = "--anchor-height";
7021 + var transformOrigin = "--transform-origin";
7022 + var positionerWidth = "--positioner-width";
7023 + var positionerHeight = "--positioner-height";
7024 +
7025 + // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
7026 + var AVAILABLE_WIDTH_VAR = availableWidth;
7027 + var AVAILABLE_HEIGHT_VAR = availableHeight;
7028 + function getLogicalSide(sideParam, renderedSide, isRtl) {
7029 + const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end";
7030 + const logicalRight = isRtl ? "inline-start" : "inline-end";
7031 + const logicalLeft = isRtl ? "inline-end" : "inline-start";
7032 + return {
7033 + top: "top",
7034 + right: isLogicalSideParam ? logicalRight : "right",
7035 + bottom: "bottom",
7036 + left: isLogicalSideParam ? logicalLeft : "left"
7037 + }[renderedSide];
7038 + }
7039 + function getOffsetData(state, sideParam, isRtl) {
7040 + const {
7041 + rects,
7042 + placement
7043 + } = state;
7044 + const data = {
7045 + side: getLogicalSide(sideParam, getSide(placement), isRtl),
7046 + align: getAlignment(placement) || "center",
7047 + anchor: {
7048 + width: rects.reference.width,
7049 + height: rects.reference.height
7050 + },
7051 + positioner: {
7052 + width: rects.floating.width,
7053 + height: rects.floating.height
7054 + }
7055 + };
7056 + return data;
7057 + }
7058 + function useAnchorPositioning(params) {
7059 + return useAnchorPositioningWithHook(params, useBaseUIFloating);
7060 + }
7061 + function useAnchorPositioningWithHook(params, useFloatingHook) {
7062 + const {
7063 + // Public parameters
7064 + anchor,
7065 + positionMethod = "absolute",
7066 + side: sideParam = "bottom",
7067 + sideOffset = 0,
7068 + align = "center",
7069 + alignOffset = 0,
7070 + collisionBoundary,
7071 + collisionPadding: collisionPaddingParam = 5,
7072 + sticky = false,
7073 + arrowPadding = 5,
7074 + disableAnchorTracking = false,
7075 + inline: inlineMiddleware,
7076 + // Private parameters
7077 + keepMounted = false,
7078 + floatingRootContext,
7079 + mounted,
7080 + collisionAvoidance,
7081 + shift: shift4,
7082 + nodeId,
7083 + adaptiveOrigin: adaptiveOrigin2,
7084 + lazyFlip = false,
7085 + externalTree
7086 + } = params;
7087 + const [mountSide, setMountSide] = React29.useState(null);
7088 + if (!mounted && mountSide !== null) {
7089 + setMountSide(null);
7090 + }
7091 + const collisionAvoidanceSide = collisionAvoidance.side || "flip";
7092 + const collisionAvoidanceAlign = collisionAvoidance.align || "flip";
7093 + const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end";
7094 + const shiftCrossAxis = shift4?.crossAxis ?? false;
7095 + const shiftRootBoundary = shift4?.rootBoundary;
7096 + const anchorFn = typeof anchor === "function" ? anchor : void 0;
7097 + const anchorFnCallback = useStableCallback(anchorFn);
7098 + const anchorDep = anchorFn ? anchorFnCallback : anchor;
7099 + const anchorValueRef = useValueAsRef(anchor);
7100 + const mountedRef = useValueAsRef(mounted);
7101 + const direction = useDirection();
7102 + const isRtl = direction === "rtl";
7103 + const side = mountSide || {
7104 + top: "top",
7105 + right: "right",
7106 + bottom: "bottom",
7107 + left: "left",
7108 + "inline-end": isRtl ? "left" : "right",
7109 + "inline-start": isRtl ? "right" : "left"
7110 + }[sideParam];
7111 + const placement = align === "center" ? side : `${side}-${align}`;
7112 + let collisionPadding = collisionPaddingParam;
7113 + if (typeof collisionPadding === "number") {
7114 + collisionPadding = {
7115 + top: collisionPadding,
7116 + right: collisionPadding,
7117 + bottom: collisionPadding,
7118 + left: collisionPadding
7119 + };
7120 + } else if (collisionPadding) {
7121 + collisionPadding = {
7122 + top: collisionPadding.top || 0,
7123 + right: collisionPadding.right || 0,
7124 + bottom: collisionPadding.bottom || 0,
7125 + left: collisionPadding.left || 0
7126 + };
7127 + }
7128 + const bias = 1;
7129 + const biasTop = sideParam === "bottom" ? bias : 0;
7130 + const biasBottom = sideParam === "top" ? bias : 0;
7131 + const biasLeft = sideParam === "right" ? bias : 0;
7132 + const biasRight = sideParam === "left" ? bias : 0;
7133 + const commonCollisionProps = {
7134 + boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary,
7135 + padding: collisionPadding
7136 + };
7137 + const arrowRef = React29.useRef(null);
7138 + const sideOffsetRef = useValueAsRef(sideOffset);
7139 + const alignOffsetRef = useValueAsRef(alignOffset);
7140 + const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0;
7141 + const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0;
7142 + const middleware = [];
7143 + if (inlineMiddleware) {
7144 + middleware.push(inlineMiddleware);
7145 + }
7146 + middleware.push(offset3((state) => {
7147 + const data = getOffsetData(state, sideParam, isRtl);
7148 + const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current;
7149 + const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current;
7150 + return {
7151 + mainAxis: sideAxis,
7152 + crossAxis: alignAxis,
7153 + alignmentAxis: alignAxis
7154 + };
7155 + }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam]));
7156 + const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift";
7157 + const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift");
7158 + const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({
7159 + ...commonCollisionProps,
7160 + // Ensure the popup flips if it's been limited by its --available-height and it resizes.
7161 + // Since the size() padding is smaller than the flip() padding, flip() will take precedence.
7162 + padding: {
7163 + top: collisionPadding.top + bias + biasTop,
7164 + right: collisionPadding.right + bias + biasRight,
7165 + bottom: collisionPadding.bottom + bias + biasBottom,
7166 + left: collisionPadding.left + bias + biasLeft
7167 + },
7168 + mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip",
7169 + crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false,
7170 + fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide
7171 + });
7172 + const shiftMiddleware = shiftDisabled ? null : shift3({
7173 + ...commonCollisionProps,
7174 + // Use the Layout Viewport to avoid shifting around when pinch-zooming.
7175 + rootBoundary: shiftRootBoundary,
7176 + mainAxis: collisionAvoidanceAlign !== "none",
7177 + crossAxis: crossAxisShiftEnabled,
7178 + limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => {
7179 + if (!arrowRef.current) {
7180 + return {};
7181 + }
7182 + const {
7183 + width,
7184 + height
7185 + } = arrowRef.current.getBoundingClientRect();
7186 + const sideAxis = getSideAxis(getSide(limitData.placement));
7187 + const arrowSize = sideAxis === "y" ? width : height;
7188 + const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;
7189 + return {
7190 + offset: arrowSize / 2 + offsetAmount / 2
7191 + };
7192 + })
7193 + }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]);
7194 + if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || align === "center") {
7195 + middleware.push(shiftMiddleware, flipMiddleware);
7196 + } else {
7197 + middleware.push(flipMiddleware, shiftMiddleware);
7198 + }
7199 + middleware.push(size3({
7200 + ...commonCollisionProps,
7201 + apply({
7202 + elements: {
7203 + floating
7204 + },
7205 + availableWidth: availableWidth2,
7206 + availableHeight: availableHeight2,
7207 + rects
7208 + }) {
7209 + if (!mountedRef.current) {
7210 + return;
7211 + }
7212 + const floatingStyle = floating.style;
7213 + floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth2}px`);
7214 + floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight2}px`);
7215 + const dpr = getWindow(floating).devicePixelRatio || 1;
7216 + const {
7217 + x: x2,
7218 + y: y2,
7219 + width,
7220 + height
7221 + } = rects.reference;
7222 + const anchorWidth2 = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr;
7223 + const anchorHeight2 = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr;
7224 + floatingStyle.setProperty(anchorWidth, `${anchorWidth2}px`);
7225 + floatingStyle.setProperty(anchorHeight, `${anchorHeight2}px`);
7226 + }
7227 + }), arrow4((state) => ({
7228 + // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,
7229 + // we'll create a fake element.
7230 + element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"),
7231 + // No padding for the fake arrow: it would displace aligned popups on narrow anchors.
7232 + padding: arrowRef.current ? arrowPadding : 0,
7233 + offsetParent: "floating"
7234 + }), [arrowPadding]), {
7235 + name: "transformOrigin",
7236 + fn(state) {
7237 + const {
7238 + elements: {
7239 + floating
7240 + },
7241 + middlewareData: middlewareData2,
7242 + placement: renderedPlacement2,
7243 + platform: platform3,
7244 + rects,
7245 + y: y2
7246 + } = state;
7247 + const renderedSide2 = getSide(renderedPlacement2);
7248 + const renderedAlign2 = getAlignment(renderedPlacement2);
7249 + const isVertical = getSideAxis(renderedSide2) === "y";
7250 + const arrowEl = arrowRef.current;
7251 + const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset;
7252 + let crossOrigin;
7253 + if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) {
7254 + crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%";
7255 + } else {
7256 + const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0;
7257 + const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0;
7258 + crossOrigin = `${arrowOffset + arrowSize / 2}px`;
7259 + }
7260 + let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + ${sideOffsetValue}px)` : `${-sideOffsetValue}px`;
7261 + if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) {
7262 + sideOrigin = `${rects.reference.y + rects.reference.height / 2 - y2}px`;
7263 + }
7264 + floating.style.setProperty(transformOrigin, isVertical ? `${crossOrigin} ${sideOrigin}` : `${sideOrigin} ${crossOrigin}`);
7265 + return {};
7266 + }
7267 + }, hide4, adaptiveOrigin2);
7268 + useIsoLayoutEffect(() => {
7269 + if (!mounted && floatingRootContext) {
7270 + floatingRootContext.update({
7271 + referenceElement: null,
7272 + floatingElement: null,
7273 + domReferenceElement: null,
7274 + positionReference: null
7275 + });
7276 + }
7277 + }, [mounted, floatingRootContext]);
7278 + const autoUpdateOptions = React29.useMemo(() => ({
7279 + ancestorScroll: !disableAnchorTracking,
7280 + elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined",
7281 + layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined"
7282 + }), [disableAnchorTracking]);
7283 + const {
7284 + refs,
7285 + elements,
7286 + x,
7287 + y,
7288 + middlewareData,
7289 + update: update2,
7290 + placement: renderedPlacement,
7291 + context,
7292 + isPositioned,
7293 + floatingStyles: originalFloatingStyles
7294 + } = useFloatingHook({
7295 + rootContext: floatingRootContext,
7296 + open: keepMounted ? mounted : void 0,
7297 + placement,
7298 + middleware,
7299 + strategy: positionMethod,
7300 + whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions),
7301 + nodeId,
7302 + externalTree
7303 + });
7304 + const {
7305 + sideX,
7306 + sideY
7307 + } = middlewareData.adaptiveOrigin || DEFAULT_SIDES;
7308 + const resolvedPosition = isPositioned ? positionMethod : "fixed";
7309 + const floatingStyles = React29.useMemo(() => {
7310 + let base;
7311 + if (!isPositioned) {
7312 + base = {
7313 + position: resolvedPosition,
7314 + top: 0,
7315 + left: 0
7316 + };
7317 + } else if (adaptiveOrigin2) {
7318 + base = {
7319 + position: resolvedPosition,
7320 + [sideX]: x,
7321 + [sideY]: y
7322 + };
7323 + } else {
7324 + base = {
7325 + ...originalFloatingStyles,
7326 + position: resolvedPosition
7327 + };
7328 + }
7329 + base[AVAILABLE_WIDTH_VAR] = "100vw";
7330 + base[AVAILABLE_HEIGHT_VAR] = "100vh";
7331 + if (!isPositioned) {
7332 + base.opacity = 0;
7333 + }
7334 + return base;
7335 + }, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]);
7336 + const registeredPositionReferenceRef = React29.useRef(null);
7337 + useIsoLayoutEffect(() => {
7338 + if (!mounted) {
7339 + return;
7340 + }
7341 + const anchorValue = anchorValueRef.current;
7342 + const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue;
7343 + const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null;
7344 + const finalAnchor = unwrappedElement || null;
7345 + if (finalAnchor !== registeredPositionReferenceRef.current) {
7346 + refs.setPositionReference(finalAnchor);
7347 + registeredPositionReferenceRef.current = finalAnchor;
7348 + }
7349 + }, [mounted, refs, anchorDep, anchorValueRef]);
7350 + React29.useEffect(() => {
7351 + if (!mounted) {
7352 + return;
7353 + }
7354 + const anchorValue = anchorValueRef.current;
7355 + if (typeof anchorValue === "function") {
7356 + return;
7357 + }
7358 + if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) {
7359 + refs.setPositionReference(anchorValue.current);
7360 + registeredPositionReferenceRef.current = anchorValue.current;
7361 + }
7362 + }, [mounted, refs, anchorDep, anchorValueRef]);
7363 + React29.useEffect(() => {
7364 + if (keepMounted && mounted && elements.reference && elements.floating) {
7365 + return autoUpdate(elements.reference, elements.floating, update2, autoUpdateOptions);
7366 + }
7367 + return void 0;
7368 + }, [keepMounted, mounted, elements, update2, autoUpdateOptions]);
7369 + const renderedSide = getSide(renderedPlacement);
7370 + const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);
7371 + const renderedAlign = getAlignment(renderedPlacement) || "center";
7372 + const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden);
7373 + useIsoLayoutEffect(() => {
7374 + if (lazyFlip && mounted && isPositioned && renderedSide !== side) {
7375 + setMountSide(renderedSide);
7376 + }
7377 + }, [lazyFlip, mounted, isPositioned, renderedSide, side]);
7378 + const arrowStyles = React29.useMemo(() => ({
7379 + position: "absolute",
7380 + top: middlewareData.arrow?.y,
7381 + left: middlewareData.arrow?.x
7382 + }), [middlewareData.arrow]);
7383 + const arrowUncentered = middlewareData.arrow?.centerOffset !== 0;
7384 + return React29.useMemo(() => ({
7385 + positionerStyles: floatingStyles,
7386 + arrowStyles,
7387 + arrowRef,
7388 + arrowUncentered,
7389 + side: logicalRenderedSide,
7390 + align: renderedAlign,
7391 + physicalSide: renderedSide,
7392 + anchorHidden: anchorHidden2,
7393 + refs,
7394 + context,
7395 + isPositioned,
7396 + update: update2
7397 + }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]);
7398 + }
7399 + function isRef(param) {
7400 + return param != null && "current" in param;
7401 + }
7402 +
7403 + // node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs
7404 + function getDisabledMountTransitionStyles(transitionStatus) {
7405 + return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;
7406 + }
7407 +
7408 + // node_modules/@base-ui/react/utils/usePositioner.mjs
7409 + function usePositioner(componentProps, state, {
7410 + styles,
7411 + transitionStatus,
7412 + props,
7413 + refs,
7414 + hidden,
7415 + inert = false
7416 + }) {
7417 + const style = {
7418 + ...styles
7419 + };
7420 + if (inert) {
7421 + style.pointerEvents = "none";
7422 + }
7423 + return useRenderElement("div", componentProps, {
7424 + state,
7425 + ref: refs,
7426 + props: [{
7427 + role: "presentation",
7428 + hidden,
7429 + style
7430 + }, getDisabledMountTransitionStyles(transitionStatus), props],
7431 + stateAttributesMapping: popupStateMapping
7432 + });
7433 + }
7434 +
7435 + // node_modules/@base-ui/react/utils/usePopupViewport.mjs
7436 + var React33 = __toESM(require_react(), 1);
7437 + var ReactDOM6 = __toESM(require_react_dom(), 1);
7438 +
7439 + // node_modules/@base-ui/utils/usePreviousValue.mjs
7440 + var React30 = __toESM(require_react(), 1);
7441 + function usePreviousValue(value) {
7442 + const [state, setState] = React30.useState({
7443 + current: value,
7444 + previous: null
7445 + });
7446 + if (!Object.is(value, state.current)) {
7447 + setState({
7448 + current: value,
7449 + previous: state.current
7450 + });
7451 + }
7452 + return state.previous;
7453 + }
7454 +
7455 + // node_modules/@base-ui/react/utils/usePopupAutoResize.mjs
7456 + var React31 = __toESM(require_react(), 1);
7457 +
7458 + // node_modules/@base-ui/react/utils/getCssDimensions.mjs
7459 + function getCssDimensions2(element) {
7460 + const css = getComputedStyle2(element);
7461 + let width = parseFloat(css.width) || 0;
7462 + let height = parseFloat(css.height) || 0;
7463 + const hasOffset = isHTMLElement(element);
7464 + const offsetWidth = hasOffset ? element.offsetWidth : width;
7465 + const offsetHeight = hasOffset ? element.offsetHeight : height;
7466 + const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
7467 + if (shouldFallback) {
7468 + width = offsetWidth;
7469 + height = offsetHeight;
7470 + }
7471 + return {
7472 + width,
7473 + height
7474 + };
7475 + }
7476 +
7477 + // node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs
7478 + var popupWidth = "--popup-width";
7479 + var popupHeight = "--popup-height";
7480 +
7481 + // node_modules/@base-ui/react/utils/usePopupAutoResize.mjs
7482 + function usePopupAutoResize(parameters) {
7483 + const {
7484 + popupElement,
7485 + positionerElement,
7486 + content,
7487 + mounted,
7488 + onMeasureLayout: onMeasureLayoutParam,
7489 + onMeasureLayoutComplete: onMeasureLayoutCompleteParam,
7490 + side,
7491 + direction
7492 + } = parameters;
7493 + const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true);
7494 + const animationFrame = useAnimationFrame();
7495 + const committedDimensionsRef = React31.useRef(null);
7496 + const isInitialRenderRef = React31.useRef(true);
7497 + const restoreAnchoringStylesRef = React31.useRef(NOOP);
7498 + const onMeasureLayout = useStableCallback(onMeasureLayoutParam);
7499 + const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam);
7500 + const anchoringStyles = React31.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]);
7501 + useIsoLayoutEffect(() => {
7502 + if (!mounted) {
7503 + restoreAnchoringStylesRef.current = NOOP;
7504 + isInitialRenderRef.current = true;
7505 + committedDimensionsRef.current = null;
7506 + return void 0;
7507 + }
7508 + if (!popupElement || !positionerElement) {
7509 + return void 0;
7510 + }
7511 + restoreAnchoringStylesRef.current = applyElementStyles(popupElement, anchoringStyles);
7512 + setPopupCssSize(popupElement, "auto");
7513 + const restorePopupPosition = overrideElementStyle(popupElement, "position", "static");
7514 + const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none");
7515 + const restorePopupScale = overrideElementStyle(popupElement, "scale", "1");
7516 + const restorePositionerAvailableSize = applyElementStyles(positionerElement, {
7517 + [availableWidth]: "max-content",
7518 + [availableHeight]: "max-content"
7519 + });
7520 + function restoreMeasurementOverrides() {
7521 + restorePopupPosition();
7522 + restorePopupTransform();
7523 + restorePositionerAvailableSize();
7524 + }
7525 + function restoreMeasurementOverridesIncludingScale() {
7526 + restoreMeasurementOverrides();
7527 + restorePopupScale();
7528 + }
7529 + onMeasureLayout?.();
7530 + if (isInitialRenderRef.current || committedDimensionsRef.current === null) {
7531 + setPositionerCssSize(positionerElement, "max-content");
7532 + const dimensions = getCssDimensions2(popupElement);
7533 + committedDimensionsRef.current = dimensions;
7534 + setPositionerCssSize(positionerElement, dimensions);
7535 + restoreMeasurementOverridesIncludingScale();
7536 + onMeasureLayoutComplete?.(null, dimensions);
7537 + isInitialRenderRef.current = false;
7538 + return () => {
7539 + restoreAnchoringStylesRef.current();
7540 + restoreAnchoringStylesRef.current = NOOP;
7541 + };
7542 + }
7543 + setPositionerCssSize(positionerElement, "max-content");
7544 + const previousDimensions = committedDimensionsRef.current;
7545 + const newDimensions = getCssDimensions2(popupElement);
7546 + committedDimensionsRef.current = newDimensions;
7547 + setPopupCssSize(popupElement, previousDimensions);
7548 + restoreMeasurementOverridesIncludingScale();
7549 + onMeasureLayoutComplete?.(previousDimensions, newDimensions);
7550 + setPositionerCssSize(positionerElement, newDimensions);
7551 + const abortController = new AbortController();
7552 + animationFrame.request(() => {
7553 + setPopupCssSize(popupElement, newDimensions);
7554 + runOnceAnimationsFinish(() => {
7555 + popupElement.style.setProperty(popupWidth, "auto");
7556 + popupElement.style.setProperty(popupHeight, "auto");
7557 + }, abortController.signal);
7558 + });
7559 + return () => {
7560 + abortController.abort();
7561 + animationFrame.cancel();
7562 + restoreAnchoringStylesRef.current();
7563 + restoreAnchoringStylesRef.current = NOOP;
7564 + };
7565 + }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]);
7566 + }
7567 + function getPopupAnchoringStyles(side, direction) {
7568 + const isPhysicalTop = side === "top";
7569 + const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start");
7570 + if (!isPhysicalTop && !isPhysicalLeft) {
7571 + return EMPTY_OBJECT;
7572 + }
7573 + return {
7574 + position: "absolute",
7575 + [isPhysicalTop ? "bottom" : "top"]: "0",
7576 + [isPhysicalLeft ? "right" : "left"]: "0"
7577 + };
7578 + }
7579 + function overrideElementStyle(element, property, value) {
7580 + const originalValue = element.style.getPropertyValue(property);
7581 + element.style.setProperty(property, value);
7582 + return () => {
7583 + element.style.setProperty(property, originalValue);
7584 + };
7585 + }
7586 + function applyElementStyles(element, styles) {
7587 + const restorers = [];
7588 + for (const [key, value] of Object.entries(styles)) {
7589 + restorers.push(overrideElementStyle(element, key, value));
7590 + }
7591 + return restorers.length ? () => {
7592 + restorers.forEach((restore) => restore());
7593 + } : NOOP;
7594 + }
7595 + function setPopupCssSize(popupElement, size4) {
7596 + const width = size4 === "auto" ? "auto" : `${size4.width}px`;
7597 + const height = size4 === "auto" ? "auto" : `${size4.height}px`;
7598 + popupElement.style.setProperty(popupWidth, width);
7599 + popupElement.style.setProperty(popupHeight, height);
7600 + }
7601 + function setPositionerCssSize(positionerElement, size4) {
7602 + const width = size4 === "max-content" ? "max-content" : `${size4.width}px`;
7603 + const height = size4 === "max-content" ? "max-content" : `${size4.height}px`;
7604 + positionerElement.style.setProperty(positionerWidth, width);
7605 + positionerElement.style.setProperty(positionerHeight, height);
7606 + }
7607 +
7608 + // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs
7609 + var React32 = __toESM(require_react(), 1);
7610 + var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
7611 + var DirectionProvider = function DirectionProvider2(props) {
7612 + const {
7613 + direction = "ltr"
7614 + } = props;
7615 + const contextValue = React32.useMemo(() => ({
7616 + direction
7617 + }), [direction]);
7618 + return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DirectionContext.Provider, {
7619 + value: contextValue,
7620 + children: props.children
7621 + });
7622 + };
7623 + if (true) DirectionProvider.displayName = "DirectionProvider";
7624 +
7625 + // node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs
7626 + var adaptiveOrigin = {
7627 + name: "adaptiveOrigin",
7628 + async fn(state) {
7629 + const {
7630 + x: rawX,
7631 + y: rawY,
7632 + rects: {
7633 + floating: floatRect
7634 + },
7635 + elements: {
7636 + floating
7637 + },
7638 + platform: platform3,
7639 + strategy,
7640 + placement
7641 + } = state;
7642 + const win = getWindow(floating);
7643 + const styles = win.getComputedStyle(floating);
7644 + const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== "";
7645 + if (!hasTransition) {
7646 + return {
7647 + x: rawX,
7648 + y: rawY,
7649 + data: DEFAULT_SIDES
7650 + };
7651 + }
7652 + const offsetParent = await platform3.getOffsetParent?.(floating);
7653 + let offsetDimensions = {
7654 + width: 0,
7655 + height: 0
7656 + };
7657 + if (strategy === "fixed" && win?.visualViewport) {
7658 + offsetDimensions = {
7659 + width: win.visualViewport.width,
7660 + height: win.visualViewport.height
7661 + };
7662 + } else if (offsetParent === win) {
7663 + const doc = ownerDocument(floating);
7664 + offsetDimensions = {
7665 + width: doc.documentElement.clientWidth,
7666 + height: doc.documentElement.clientHeight
7667 + };
7668 + } else if (await platform3.isElement?.(offsetParent)) {
7669 + offsetDimensions = await platform3.getDimensions(offsetParent);
7670 + }
7671 + const currentSide = getSide(placement);
7672 + let x = rawX;
7673 + let y = rawY;
7674 + if (currentSide === "left") {
7675 + x = offsetDimensions.width - (rawX + floatRect.width);
7676 + }
7677 + if (currentSide === "top") {
7678 + y = offsetDimensions.height - (rawY + floatRect.height);
7679 + }
7680 + const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX;
7681 + const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY;
7682 + return {
7683 + x,
7684 + y,
7685 + data: {
7686 + sideX,
7687 + sideY
7688 + }
7689 + };
7690 + }
7691 + };
7692 +
7693 + // node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs
7694 + var activationDirection = "data-activation-direction";
7695 +
7696 + // node_modules/@base-ui/react/utils/usePopupViewport.mjs
7697 + var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
7698 + var popupViewportStateMapping = {
7699 + activationDirection: (value) => value ? {
7700 + [activationDirection]: value
7701 + } : null
7702 + };
7703 + function usePopupViewport(parameters) {
7704 + const {
7705 + store: store2,
7706 + side,
7707 + children
7708 + } = parameters;
7709 + const direction = useDirection();
7710 + const activeTrigger = store2.useState("activeTriggerElement");
7711 + const activeTriggerId = store2.useState("activeTriggerId");
7712 + const open2 = store2.useState("open");
7713 + const payload = store2.useState("payload");
7714 + const mounted = store2.useState("mounted");
7715 + const popupElement = store2.useState("popupElement");
7716 + const positionerElement = store2.useState("positionerElement");
7717 + const previousActiveTrigger = usePreviousValue(open2 ? activeTrigger : null);
7718 + const currentContentKey = usePopupContentKey(activeTriggerId, payload);
7719 + const capturedNodeRef = React33.useRef(null);
7720 + const [previousContentNode, setPreviousContentNode] = React33.useState(null);
7721 + const [newTriggerOffset, setNewTriggerOffset] = React33.useState(null);
7722 + const currentContainerRef = React33.useRef(null);
7723 + const previousContainerRef = React33.useRef(null);
7724 + const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true);
7725 + const cleanupFrame = useAnimationFrame();
7726 + const cleanupControllerRef = React33.useRef(null);
7727 + const [previousContentDimensions, setPreviousContentDimensions] = React33.useState(null);
7728 + const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React33.useState(false);
7729 + useIsoLayoutEffect(() => {
7730 + store2.set("adaptiveOrigin", adaptiveOrigin);
7731 + return () => {
7732 + store2.set("adaptiveOrigin", void 0);
7733 + };
7734 + }, [store2]);
7735 + const handleMeasureLayout = useStableCallback(() => {
7736 + currentContainerRef.current?.style.setProperty("animation", "none");
7737 + currentContainerRef.current?.style.setProperty("transition", "none");
7738 + previousContainerRef.current?.style.setProperty("display", "none");
7739 + });
7740 + const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => {
7741 + currentContainerRef.current?.style.removeProperty("animation");
7742 + currentContainerRef.current?.style.removeProperty("transition");
7743 + previousContainerRef.current?.style.removeProperty("display");
7744 + if (previousDimensions) {
7745 + setPreviousContentDimensions(previousDimensions);
7746 + }
7747 + });
7748 + const armViewportCleanup = useStableCallback(() => {
7749 + cleanupControllerRef.current?.abort();
7750 + const controller = new AbortController();
7751 + cleanupControllerRef.current = controller;
7752 + onAnimationsFinished(() => {
7753 + setPreviousContentNode(null);
7754 + setPreviousContentDimensions(null);
7755 + capturedNodeRef.current = null;
7756 + }, controller.signal);
7757 + });
7758 + const lastHandledTriggerRef = React33.useRef(null);
7759 + useIsoLayoutEffect(() => {
7760 + if (!open2 || !mounted) {
7761 + lastHandledTriggerRef.current = null;
7762 + }
7763 + }, [open2, mounted]);
7764 + useIsoLayoutEffect(() => {
7765 + if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {
7766 + setPreviousContentNode(capturedNodeRef.current);
7767 + setShowStartingStyleAttribute(true);
7768 + const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger);
7769 + setNewTriggerOffset(offset4);
7770 + lastHandledTriggerRef.current = activeTrigger;
7771 + }
7772 + }, [activeTrigger, previousActiveTrigger]);
7773 + useIsoLayoutEffect(() => {
7774 + if (previousContentNode == null) {
7775 + return;
7776 + }
7777 + cleanupControllerRef.current?.abort();
7778 + setShowStartingStyleAttribute(true);
7779 + cleanupFrame.request(() => {
7780 + ReactDOM6.flushSync(() => {
7781 + setShowStartingStyleAttribute(false);
7782 + });
7783 + armViewportCleanup();
7784 + });
7785 + }, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]);
7786 + useIsoLayoutEffect(() => {
7787 + const source = currentContainerRef.current;
7788 + if (!source) {
7789 + return;
7790 + }
7791 + const wrapper = ownerDocument(source).createElement("div");
7792 + for (const child of Array.from(source.childNodes)) {
7793 + wrapper.appendChild(child.cloneNode(true));
7794 + }
7795 + capturedNodeRef.current = wrapper;
7796 + });
7797 + const isTransitioning = previousContentNode != null;
7798 + let childrenToRender;
7799 + if (!isTransitioning) {
7800 + childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
7801 + "data-current": true,
7802 + ref: currentContainerRef,
7803 + children
7804 + }, currentContentKey);
7805 + } else {
7806 + childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(React33.Fragment, {
7807 + children: [/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
7808 + "data-previous": true,
7809 + inert: inertValue(true),
7810 + ref: previousContainerRef,
7811 + style: {
7812 + ...previousContentDimensions ? {
7813 + [popupWidth]: `${previousContentDimensions.width}px`,
7814 + [popupHeight]: `${previousContentDimensions.height}px`
7815 + } : null,
7816 + position: "absolute"
7817 + },
7818 + "data-ending-style": showStartingStyleAttribute ? void 0 : ""
7819 + }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
7820 + "data-current": true,
7821 + ref: currentContainerRef,
7822 + "data-starting-style": showStartingStyleAttribute ? "" : void 0,
7823 + children
7824 + }, currentContentKey)]
7825 + });
7826 + }
7827 + useIsoLayoutEffect(() => {
7828 + const container = previousContainerRef.current;
7829 + if (!container || !previousContentNode) {
7830 + return;
7831 + }
7832 + container.replaceChildren(...Array.from(previousContentNode.childNodes));
7833 + }, [previousContentNode]);
7834 + usePopupAutoResize({
7835 + popupElement,
7836 + positionerElement,
7837 + mounted,
7838 + content: payload,
7839 + onMeasureLayout: handleMeasureLayout,
7840 + onMeasureLayoutComplete: handleMeasureLayoutComplete,
7841 + side,
7842 + direction
7843 + });
7844 + const state = {
7845 + activationDirection: getActivationDirection(newTriggerOffset),
7846 + transitioning: isTransitioning
7847 + };
7848 + return {
7849 + children: childrenToRender,
7850 + state
7851 + };
7852 + }
7853 + function getActivationDirection(offset4) {
7854 + if (!offset4) {
7855 + return void 0;
7856 + }
7857 + return `${getValueWithTolerance(offset4.horizontal, 5, "right", "left")} ${getValueWithTolerance(offset4.vertical, 5, "down", "up")}`;
7858 + }
7859 + function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) {
7860 + if (value > tolerance) {
7861 + return positiveLabel;
7862 + }
7863 + if (value < -tolerance) {
7864 + return negativeLabel;
7865 + }
7866 + return "";
7867 + }
7868 + function calculateRelativePosition(from, to) {
7869 + const fromRect = from.getBoundingClientRect();
7870 + const toRect = to.getBoundingClientRect();
7871 + const fromCenter = {
7872 + x: fromRect.left + fromRect.width / 2,
7873 + y: fromRect.top + fromRect.height / 2
7874 + };
7875 + const toCenter = {
7876 + x: toRect.left + toRect.width / 2,
7877 + y: toRect.top + toRect.height / 2
7878 + };
7879 + return {
7880 + horizontal: toCenter.x - fromCenter.x,
7881 + vertical: toCenter.y - fromCenter.y
7882 + };
7883 + }
7884 + function usePopupContentKey(activeTriggerId, payload) {
7885 + const [contentKey, setContentKey] = React33.useState(0);
7886 + const previousActiveTriggerIdRef = React33.useRef(activeTriggerId);
7887 + const previousPayloadRef = React33.useRef(payload);
7888 + const pendingPayloadUpdateRef = React33.useRef(false);
7889 + useIsoLayoutEffect(() => {
7890 + const previousActiveTriggerId = previousActiveTriggerIdRef.current;
7891 + const previousPayload = previousPayloadRef.current;
7892 + const triggerIdChanged = activeTriggerId !== previousActiveTriggerId;
7893 + const payloadChanged = payload !== previousPayload;
7894 + if (triggerIdChanged) {
7895 + setContentKey((value) => value + 1);
7896 + pendingPayloadUpdateRef.current = !payloadChanged;
7897 + } else if (pendingPayloadUpdateRef.current && payloadChanged) {
7898 + setContentKey((value) => value + 1);
7899 + pendingPayloadUpdateRef.current = false;
7900 + }
7901 + previousActiveTriggerIdRef.current = activeTriggerId;
7902 + previousPayloadRef.current = payload;
7903 + }, [activeTriggerId, payload]);
7904 + return `${activeTriggerId ?? "current"}-${contentKey}`;
7905 + }
7906 +
7907 + // node_modules/@base-ui/react/utils/FloatingPortalLite.mjs
7908 + var React34 = __toESM(require_react(), 1);
7909 + var ReactDOM7 = __toESM(require_react_dom(), 1);
7910 + var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
7911 + var FloatingPortalLite = /* @__PURE__ */ React34.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) {
7912 + const {
7913 + children,
7914 + container,
7915 + className,
7916 + render,
7917 + style,
7918 + ...elementProps
7919 + } = componentProps;
7920 + const {
7921 + node: portalNode,
7922 + subtree: portalSubtree
7923 + } = useFloatingPortalNode({
7924 + container,
7925 + ref: forwardedRef,
7926 + componentProps,
7927 + elementProps
7928 + });
7929 + if (!portalSubtree && !portalNode) {
7930 + return null;
7931 + }
7932 + return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(React34.Fragment, {
7933 + children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM7.createPortal(children, portalNode)]
7934 + });
7935 + });
7936 + if (true) FloatingPortalLite.displayName = "FloatingPortalLite";
7937 +
7938 + // node_modules/@base-ui/react/tooltip/index.parts.mjs
7939 + var index_parts_exports = {};
7940 + __export(index_parts_exports, {
7941 + Arrow: () => TooltipArrow,
7942 + Handle: () => TooltipHandle,
7943 + Popup: () => TooltipPopup,
7944 + Portal: () => TooltipPortal,
7945 + Positioner: () => TooltipPositioner,
7946 + Provider: () => TooltipProvider,
7947 + Root: () => TooltipRoot,
7948 + Trigger: () => TooltipTrigger,
7949 + Viewport: () => TooltipViewport,
7950 + createHandle: () => createTooltipHandle
7951 + });
7952 +
7953 + // node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs
7954 + var React37 = __toESM(require_react(), 1);
7955 +
7956 + // node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs
7957 + var React35 = __toESM(require_react(), 1);
7958 + var TooltipRootContext = /* @__PURE__ */ React35.createContext(void 0);
7959 + if (true) TooltipRootContext.displayName = "TooltipRootContext";
7960 + function useTooltipRootContext(optional) {
7961 + const context = React35.useContext(TooltipRootContext);
7962 + if (context === void 0 && !optional) {
7963 + throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72));
7964 + }
7965 + return context;
7966 + }
7967 +
7968 + // node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs
7969 + var React36 = __toESM(require_react(), 1);
7970 + var selectors2 = {
7971 + ...popupStoreSelectors,
7972 + disabled: (state) => state.disabled,
7973 + instantType: (state) => state.instantType,
7974 + isInstantPhase: (state) => state.isInstantPhase,
7975 + trackCursorAxis: (state) => state.trackCursorAxis,
7976 + disableHoverablePopup: (state) => state.disableHoverablePopup,
7977 + lastOpenChangeReason: (state) => state.openChangeReason,
7978 + closeOnClick: (state) => state.closeOnClick,
7979 + closeDelay: (state) => state.closeDelay,
7980 + adaptiveOrigin: (state) => state.adaptiveOrigin
7981 + };
7982 + var TooltipStore = class extends ReactStore {
7983 + constructor(initialState, floatingId, nested) {
7984 + const triggerElements = new PopupTriggerMap();
7985 + super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors2);
7986 + }
7987 + setOpen = (nextOpen, eventDetails) => {
7988 + applyPopupOpenChange(this, nextOpen, eventDetails, {
7989 + extraState: {
7990 + openChangeReason: eventDetails.reason
7991 + }
7992 + });
7993 + };
7994 + // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change.
7995 + cancelPendingOpen(event) {
7996 + this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event));
7997 + }
7998 + };
7999 + function createNullTooltipStore() {
8000 + const triggerElements = new PopupTriggerMap();
8001 + const store2 = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors2);
8002 + return Object.assign(store2, {
8003 + setOpen: NOOP,
8004 + cancelPendingOpen: NOOP
8005 + });
8006 + }
8007 + function createInitialState(initialState, triggerElements, floatingId, nested = false) {
8008 + const state = {
8009 + ...createInitialPopupStoreState(triggerElements, floatingId, nested),
8010 + disabled: false,
8011 + instantType: void 0,
8012 + isInstantPhase: false,
8013 + trackCursorAxis: "none",
8014 + disableHoverablePopup: false,
8015 + openChangeReason: null,
8016 + closeOnClick: true,
8017 + closeDelay: 0,
8018 + adaptiveOrigin: void 0,
8019 + ...initialState
8020 + };
8021 + return state;
8022 + }
8023 + function createInitialContext(triggerElements) {
8024 + return {
8025 + popupRef: /* @__PURE__ */ React36.createRef(),
8026 + onOpenChange: void 0,
8027 + onOpenChangeComplete: void 0,
8028 + triggerElements
8029 + };
8030 + }
8031 +
8032 + // node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs
8033 + var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
8034 + var TooltipRoot = fastComponent(function TooltipRoot2(props) {
8035 + const {
8036 + disabled: disabled2 = false,
8037 + defaultOpen = false,
8038 + open: openProp,
8039 + disableHoverablePopup = false,
8040 + trackCursorAxis = "none",
8041 + actionsRef,
8042 + onOpenChange,
8043 + onOpenChangeComplete,
8044 + handle,
8045 + triggerId: triggerIdProp,
8046 + defaultTriggerId: defaultTriggerIdProp = null,
8047 + children
8048 + } = props;
8049 + const store2 = usePopupRootStore((floatingId, nested) => new TooltipStore({
8050 + open: defaultOpen,
8051 + openProp,
8052 + activeTriggerId: defaultTriggerIdProp,
8053 + triggerIdProp
8054 + }, floatingId, nested));
8055 + store2.useControlledProp("openProp", openProp);
8056 + store2.useControlledProp("triggerIdProp", triggerIdProp);
8057 + store2.useContextCallback("onOpenChange", onOpenChange);
8058 + store2.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
8059 + const openState = store2.useState("open");
8060 + const open2 = !disabled2 && openState;
8061 + const activeTriggerId = store2.useState("activeTriggerId");
8062 + const mounted = store2.useState("mounted");
8063 + const payload = store2.useState("payload");
8064 + store2.useSyncedValues({
8065 + trackCursorAxis,
8066 + disableHoverablePopup,
8067 + disabled: disabled2
8068 + });
8069 + useImplicitActiveTrigger(store2, {
8070 + closeOnActiveTriggerUnmount: true
8071 + });
8072 + const {
8073 + forceUnmount,
8074 + transitionStatus
8075 + } = useOpenStateTransitions(open2, store2);
8076 + const isInstantPhase = store2.useState("isInstantPhase");
8077 + const instantType = store2.useState("instantType");
8078 + const lastOpenChangeReason = store2.useState("lastOpenChangeReason");
8079 + const previousInstantTypeRef = React37.useRef(null);
8080 + useIsoLayoutEffect(() => {
8081 + if (openState && disabled2) {
8082 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled));
8083 + }
8084 + }, [openState, disabled2, store2]);
8085 + useIsoLayoutEffect(() => {
8086 + if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) {
8087 + if (instantType !== "delay") {
8088 + previousInstantTypeRef.current = instantType;
8089 + }
8090 + store2.set("instantType", "delay");
8091 + } else if (previousInstantTypeRef.current !== null) {
8092 + store2.set("instantType", previousInstantTypeRef.current);
8093 + previousInstantTypeRef.current = null;
8094 + }
8095 + }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store2]);
8096 + useIsoLayoutEffect(() => {
8097 + if (open2) {
8098 + if (activeTriggerId == null) {
8099 + store2.set("payload", void 0);
8100 + }
8101 + }
8102 + }, [store2, activeTriggerId, open2]);
8103 + React37.useImperativeHandle(actionsRef, () => ({
8104 + unmount: forceUnmount,
8105 + close: () => store2.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction))
8106 + }), [forceUnmount, store2]);
8107 + const shouldRenderInteractions = open2 || mounted || !disabled2 && trackCursorAxis !== "none";
8108 + return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(TooltipRootContext.Provider, {
8109 + value: store2,
8110 + children: [handle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PopupHandleAttachment, {
8111 + handle,
8112 + store: store2
8113 + }), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipInteractions, {
8114 + store: store2,
8115 + disabled: disabled2,
8116 + trackCursorAxis
8117 + }), typeof children === "function" ? children({
8118 + payload
8119 + }) : children]
8120 + });
8121 + });
8122 + if (true) TooltipRoot.displayName = "TooltipRoot";
8123 + function TooltipInteractions({
8124 + store: store2,
8125 + disabled: disabled2,
8126 + trackCursorAxis
8127 + }) {
8128 + const floatingRootContext = store2.useState("floatingRootContext");
8129 + const dismiss = useDismiss(floatingRootContext, {
8130 + enabled: !disabled2,
8131 + referencePress: () => store2.select("closeOnClick")
8132 + });
8133 + const clientPoint = useClientPoint(floatingRootContext, {
8134 + enabled: !disabled2 && trackCursorAxis !== "none",
8135 + axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis
8136 + });
8137 + const triggerProps = React37.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]);
8138 + usePopupInteractionProps(store2, {
8139 + activeTriggerProps: triggerProps,
8140 + inactiveTriggerProps: triggerProps,
8141 + popupProps: dismiss.floating ?? EMPTY_OBJECT
8142 + });
8143 + return null;
8144 + }
8145 +
8146 + // node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs
8147 + var React39 = __toESM(require_react(), 1);
8148 +
8149 + // node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs
8150 + var React38 = __toESM(require_react(), 1);
8151 + var TooltipProviderContext = /* @__PURE__ */ React38.createContext(void 0);
8152 + if (true) TooltipProviderContext.displayName = "TooltipProviderContext";
8153 + function useTooltipProviderContext() {
8154 + return React38.useContext(TooltipProviderContext);
8155 + }
8156 +
8157 + // node_modules/@base-ui/react/tooltip/utils/constants.mjs
8158 + var OPEN_DELAY = 600;
8159 +
8160 + // node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs
8161 + var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger";
8162 + function getTargetElement(event) {
8163 + if ("composedPath" in event) {
8164 + const path = event.composedPath();
8165 + for (let i = 0; i < path.length; i += 1) {
8166 + const element = path[i];
8167 + if (isElement(element)) {
8168 + return element;
8169 + }
8170 + }
8171 + }
8172 + const target = event.target;
8173 + if (isElement(target)) {
8174 + return target;
8175 + }
8176 + return null;
8177 + }
8178 + function closestEnabledTooltipTrigger(element) {
8179 + let current = element;
8180 + while (current) {
8181 + const trigger = current.closest(`[${TOOLTIP_TRIGGER_IDENTIFIER}]`);
8182 + if (trigger) {
8183 + return trigger;
8184 + }
8185 + const root = current.getRootNode();
8186 + current = "host" in root && isElement(root.host) ? root.host : null;
8187 + }
8188 + return null;
8189 + }
8190 + var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) {
8191 + const {
8192 + render,
8193 + className,
8194 + style,
8195 + handle,
8196 + payload,
8197 + disabled: disabledProp,
8198 + delay,
8199 + closeOnClick = true,
8200 + closeDelay,
8201 + id: idProp,
8202 + ...elementProps
8203 + } = componentProps;
8204 + const rootContext = useTooltipRootContext(true);
8205 + const handleStore = usePopupHandleStore(handle);
8206 + const store2 = handleStore ?? rootContext;
8207 + if (!store2) {
8208 + throw new Error(true ? "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle." : formatErrorMessage_default(82));
8209 + }
8210 + const thisTriggerId = useBaseUiId(idProp);
8211 + const isTriggerActive = store2.useState("isTriggerActive", thisTriggerId);
8212 + const isOpenedByThisTrigger = store2.useState("isOpenedByTrigger", thisTriggerId);
8213 + const floatingRootContext = store2.useState("floatingRootContext");
8214 + const triggerElementRef = React39.useRef(null);
8215 + const closeDelayWithDefault = closeDelay ?? 0;
8216 + const {
8217 + registerTrigger,
8218 + isMountedByThisTrigger
8219 + } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store2, {
8220 + payload,
8221 + closeOnClick,
8222 + closeDelay: closeDelayWithDefault
8223 + });
8224 + const providerDelay = useTooltipProviderContext();
8225 + const {
8226 + activeIdRef,
8227 + delayRef,
8228 + isInstantPhase,
8229 + hasProvider
8230 + } = useDelayGroup(floatingRootContext, {
8231 + open: isOpenedByThisTrigger
8232 + });
8233 + const hoverInteraction = useHoverInteractionSharedState(floatingRootContext);
8234 + store2.useSyncedValue("isInstantPhase", isInstantPhase);
8235 + const rootDisabled = store2.useState("disabled");
8236 + const disabled2 = disabledProp ?? rootDisabled;
8237 + const disabledRef = useValueAsRef(disabled2);
8238 + const trackCursorAxis = store2.useState("trackCursorAxis");
8239 + const disableHoverablePopup = store2.useState("disableHoverablePopup");
8240 + const isNestedTriggerHoveredRef = React39.useRef(false);
8241 + const nestedTriggerOpenTimeout = useTimeout();
8242 + const pointerTypeRef = React39.useRef(void 0);
8243 + function getOpenDelay() {
8244 + if (hasProvider && activeIdRef.current != null) {
8245 + return 0;
8246 + }
8247 + return delay ?? providerDelay ?? OPEN_DELAY;
8248 + }
8249 + function isEnabledNestedTriggerTarget(target) {
8250 + const triggerEl = triggerElementRef.current;
8251 + if (!triggerEl || !target) {
8252 + return false;
8253 + }
8254 + const nearestTrigger = closestEnabledTooltipTrigger(target);
8255 + return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger);
8256 + }
8257 + function detectNestedTriggerHover(target) {
8258 + const nestedTriggerHovered = isEnabledNestedTriggerTarget(target);
8259 + isNestedTriggerHoveredRef.current = nestedTriggerHovered;
8260 + if (nestedTriggerHovered) {
8261 + hoverInteraction.openChangeTimeout.clear();
8262 + hoverInteraction.restTimeout.clear();
8263 + hoverInteraction.restTimeoutPending = false;
8264 + nestedTriggerOpenTimeout.clear();
8265 + }
8266 + return nestedTriggerHovered;
8267 + }
8268 + const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
8269 + enabled: !disabled2,
8270 + mouseOnly: true,
8271 + move: false,
8272 + handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null,
8273 + restMs: getOpenDelay,
8274 + delay() {
8275 + if (closeDelay == null && hasProvider) {
8276 + return {
8277 + close: getDelay(delayRef.current, "close")
8278 + };
8279 + }
8280 + return {
8281 + close: closeDelayWithDefault
8282 + };
8283 + },
8284 + triggerElementRef,
8285 + isActiveTrigger: isTriggerActive,
8286 + isClosing: () => store2.select("transitionStatus") === "ending",
8287 + shouldOpen() {
8288 + return !isNestedTriggerHoveredRef.current;
8289 + }
8290 + });
8291 + const focusProps = useFocus(floatingRootContext, {
8292 + enabled: !disabled2
8293 + }).reference;
8294 + const handleNestedTriggerHover = (event) => {
8295 + const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current;
8296 + const target = getTargetElement(event);
8297 + const nestedTriggerHovered = detectNestedTriggerHover(target);
8298 + const triggerEl = triggerElementRef.current;
8299 + const targetInsideTrigger = triggerEl && target && contains(triggerEl, target);
8300 + if (nestedTriggerHovered && store2.select("open") && store2.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) {
8301 + store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
8302 + return;
8303 + }
8304 + if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store2.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences.
8305 + isMouseLikePointerType(pointerTypeRef.current)) {
8306 + const open2 = () => {
8307 + if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store2.select("open")) {
8308 + store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl));
8309 + }
8310 + };
8311 + const openDelay = getOpenDelay();
8312 + if (openDelay === 0) {
8313 + nestedTriggerOpenTimeout.clear();
8314 + open2();
8315 + } else {
8316 + nestedTriggerOpenTimeout.start(openDelay, open2);
8317 + }
8318 + }
8319 + };
8320 + const rootTriggerProps = store2.useState("triggerProps", isMountedByThisTrigger);
8321 + const shouldApplyRootTriggerProps = isMountedByThisTrigger || trackCursorAxis !== "none";
8322 + const state = {
8323 + open: isOpenedByThisTrigger
8324 + };
8325 + const element = useRenderElement("button", componentProps, {
8326 + state,
8327 + ref: [forwardedRef, registerTrigger, triggerElementRef],
8328 + props: [hoverProps, focusProps, shouldApplyRootTriggerProps ? rootTriggerProps : void 0, {
8329 + onMouseOver(event) {
8330 + handleNestedTriggerHover(event.nativeEvent);
8331 + },
8332 + onFocus(event) {
8333 + if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) {
8334 + event.preventBaseUIHandler();
8335 + }
8336 + },
8337 + onMouseLeave() {
8338 + isNestedTriggerHoveredRef.current = false;
8339 + nestedTriggerOpenTimeout.clear();
8340 + pointerTypeRef.current = void 0;
8341 + },
8342 + onPointerEnter(event) {
8343 + pointerTypeRef.current = event.pointerType;
8344 + },
8345 + onPointerDown(event) {
8346 + pointerTypeRef.current = event.pointerType;
8347 + store2.set("closeOnClick", closeOnClick);
8348 + if (closeOnClick && !store2.select("open")) {
8349 + store2.cancelPendingOpen(event.nativeEvent);
8350 + }
8351 + },
8352 + onClick(event) {
8353 + if (closeOnClick && !store2.select("open")) {
8354 + store2.cancelPendingOpen(event.nativeEvent);
8355 + }
8356 + },
8357 + id: thisTriggerId,
8358 + [triggerDisabled]: disabled2 ? "" : void 0,
8359 + [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : ""
8360 + }, elementProps],
8361 + stateAttributesMapping: triggerOpenStateMapping
8362 + });
8363 + return element;
8364 + });
8365 + if (true) TooltipTrigger.displayName = "TooltipTrigger";
8366 +
8367 + // node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs
8368 + var React41 = __toESM(require_react(), 1);
8369 +
8370 + // node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs
8371 + var React40 = __toESM(require_react(), 1);
8372 + var TooltipPortalContext = /* @__PURE__ */ React40.createContext(void 0);
8373 + if (true) TooltipPortalContext.displayName = "TooltipPortalContext";
8374 + function useTooltipPortalContext() {
8375 + const value = React40.useContext(TooltipPortalContext);
8376 + if (value === void 0) {
8377 + throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70));
8378 + }
8379 + return value;
8380 + }
8381 +
8382 + // node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs
8383 + var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
8384 + var TooltipPortal = /* @__PURE__ */ React41.forwardRef(function TooltipPortal2(props, forwardedRef) {
8385 + const {
8386 + keepMounted = false,
8387 + ...portalProps
8388 + } = props;
8389 + const store2 = useTooltipRootContext();
8390 + const mounted = store2.useState("mounted");
8391 + const shouldRender = mounted || keepMounted;
8392 + if (!shouldRender) {
8393 + return null;
8394 + }
8395 + return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipPortalContext.Provider, {
8396 + value: keepMounted,
8397 + children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FloatingPortalLite, {
8398 + ref: forwardedRef,
8399 + ...portalProps
8400 + })
8401 + });
8402 + });
8403 + if (true) TooltipPortal.displayName = "TooltipPortal";
8404 +
8405 + // node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs
8406 + var React43 = __toESM(require_react(), 1);
8407 +
8408 + // node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs
8409 + var React42 = __toESM(require_react(), 1);
8410 + var TooltipPositionerContext = /* @__PURE__ */ React42.createContext(void 0);
8411 + if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext";
8412 + function useTooltipPositionerContext() {
8413 + const context = React42.useContext(TooltipPositionerContext);
8414 + if (context === void 0) {
8415 + throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71));
8416 + }
8417 + return context;
8418 + }
8419 +
8420 + // node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs
8421 + var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
8422 + var TooltipPositioner = /* @__PURE__ */ React43.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) {
8423 + const {
8424 + render,
8425 + className,
8426 + anchor,
8427 + positionMethod = "absolute",
8428 + side = "top",
8429 + align = "center",
8430 + sideOffset = 0,
8431 + alignOffset = 0,
8432 + collisionBoundary = "clipping-ancestors",
8433 + collisionPadding = 5,
8434 + arrowPadding = 5,
8435 + sticky = false,
8436 + disableAnchorTracking = false,
8437 + collisionAvoidance = POPUP_COLLISION_AVOIDANCE,
8438 + style,
8439 + ...elementProps
8440 + } = componentProps;
8441 + const store2 = useTooltipRootContext();
8442 + const keepMounted = useTooltipPortalContext();
8443 + const open2 = store2.useState("open");
8444 + const mounted = store2.useState("mounted");
8445 + const trackCursorAxis = store2.useState("trackCursorAxis");
8446 + const disableHoverablePopup = store2.useState("disableHoverablePopup");
8447 + const floatingRootContext = store2.useState("floatingRootContext");
8448 + const instantType = store2.useState("instantType");
8449 + const transitionStatus = store2.useState("transitionStatus");
8450 + const adaptiveOrigin2 = store2.useState("adaptiveOrigin");
8451 + const positioning = useAnchorPositioning({
8452 + anchor,
8453 + positionMethod,
8454 + floatingRootContext,
8455 + mounted,
8456 + side,
8457 + sideOffset,
8458 + align,
8459 + alignOffset,
8460 + collisionBoundary,
8461 + collisionPadding,
8462 + sticky,
8463 + arrowPadding,
8464 + disableAnchorTracking,
8465 + keepMounted,
8466 + collisionAvoidance,
8467 + adaptiveOrigin: adaptiveOrigin2
8468 + });
8469 + const state = React43.useMemo(() => ({
8470 + open: open2,
8471 + side: positioning.side,
8472 + align: positioning.align,
8473 + anchorHidden: positioning.anchorHidden,
8474 + instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType
8475 + }), [open2, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]);
8476 + const element = usePositioner(componentProps, state, {
8477 + styles: positioning.positionerStyles,
8478 + transitionStatus,
8479 + props: elementProps,
8480 + refs: [forwardedRef, store2.useStateSetter("positionerElement")],
8481 + hidden: !mounted,
8482 + inert: !open2 || trackCursorAxis === "both" || disableHoverablePopup
8483 + });
8484 + return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipPositionerContext.Provider, {
8485 + value: positioning,
8486 + children: element
8487 + });
8488 + });
8489 + if (true) TooltipPositioner.displayName = "TooltipPositioner";
8490 +
8491 + // node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs
8492 + var React44 = __toESM(require_react(), 1);
8493 + var TooltipPopup = /* @__PURE__ */ React44.forwardRef(function TooltipPopup2(componentProps, forwardedRef) {
8494 + const {
8495 + render,
8496 + className,
8497 + style,
8498 + ...elementProps
8499 + } = componentProps;
8500 + const store2 = useTooltipRootContext();
8501 + const {
8502 + side,
8503 + align
8504 + } = useTooltipPositionerContext();
8505 + const open2 = store2.useState("open");
8506 + const instantType = store2.useState("instantType");
8507 + const transitionStatus = store2.useState("transitionStatus");
8508 + const popupProps = store2.useState("popupProps");
8509 + const floatingContext = store2.useState("floatingRootContext");
8510 + const disabled2 = store2.useState("disabled");
8511 + const closeDelay = store2.useState("closeDelay");
8512 + useOpenChangeComplete({
8513 + open: open2,
8514 + ref: store2.context.popupRef,
8515 + onComplete() {
8516 + if (open2) {
8517 + store2.context.onOpenChangeComplete?.(true);
8518 + }
8519 + }
8520 + });
8521 + useHoverFloatingInteraction(floatingContext, {
8522 + enabled: !disabled2,
8523 + closeDelay
8524 + });
8525 + const setPopupElement = store2.useStateSetter("popupElement");
8526 + const state = {
8527 + open: open2,
8528 + side,
8529 + align,
8530 + instant: instantType,
8531 + transitionStatus
8532 + };
8533 + const element = useRenderElement("div", componentProps, {
8534 + state,
8535 + ref: [forwardedRef, store2.context.popupRef, setPopupElement],
8536 + props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps],
8537 + stateAttributesMapping: popupTransitionStateMapping
8538 + });
8539 + return element;
8540 + });
8541 + if (true) TooltipPopup.displayName = "TooltipPopup";
8542 +
8543 + // node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs
8544 + var React45 = __toESM(require_react(), 1);
8545 + var TooltipArrow = /* @__PURE__ */ React45.forwardRef(function TooltipArrow2(componentProps, forwardedRef) {
8546 + const {
8547 + render,
8548 + className,
8549 + style,
8550 + ...elementProps
8551 + } = componentProps;
8552 + const store2 = useTooltipRootContext();
8553 + const {
8554 + arrowRef,
8555 + side,
8556 + align,
8557 + arrowUncentered,
8558 + arrowStyles
8559 + } = useTooltipPositionerContext();
8560 + const open2 = store2.useState("open");
8561 + const instantType = store2.useState("instantType");
8562 + const state = {
8563 + open: open2,
8564 + side,
8565 + align,
8566 + uncentered: arrowUncentered,
8567 + instant: instantType
8568 + };
8569 + const element = useRenderElement("div", componentProps, {
8570 + state,
8571 + ref: [forwardedRef, arrowRef],
8572 + props: [{
8573 + style: arrowStyles,
8574 + "aria-hidden": true
8575 + }, elementProps],
8576 + stateAttributesMapping: popupStateMapping
8577 + });
8578 + return element;
8579 + });
8580 + if (true) TooltipArrow.displayName = "TooltipArrow";
8581 +
8582 + // node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs
8583 + var React46 = __toESM(require_react(), 1);
8584 + var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
8585 + var TooltipProvider = function TooltipProvider2(props) {
8586 + const {
8587 + delay,
8588 + closeDelay,
8589 + timeout = 400
8590 + } = props;
8591 + const delayValue = React46.useMemo(() => ({
8592 + open: delay,
8593 + close: closeDelay
8594 + }), [delay, closeDelay]);
8595 + return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipProviderContext.Provider, {
8596 + value: delay,
8597 + children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FloatingDelayGroup, {
8598 + delay: delayValue,
8599 + timeoutMs: timeout,
8600 + children: props.children
8601 + })
8602 + });
8603 + };
8604 + if (true) TooltipProvider.displayName = "TooltipProvider";
8605 +
8606 + // node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs
8607 + var React47 = __toESM(require_react(), 1);
8608 + var TooltipViewport = /* @__PURE__ */ React47.forwardRef(function TooltipViewport2(componentProps, forwardedRef) {
8609 + const {
8610 + render,
8611 + className,
8612 + style,
8613 + children,
8614 + ...elementProps
8615 + } = componentProps;
8616 + const store2 = useTooltipRootContext();
8617 + const positioner = useTooltipPositionerContext();
8618 + const instantType = store2.useState("instantType");
8619 + const {
8620 + children: childrenToRender,
8621 + state: viewportState
8622 + } = usePopupViewport({
8623 + store: store2,
8624 + side: positioner.side,
8625 + children
8626 + });
8627 + const state = {
8628 + activationDirection: viewportState.activationDirection,
8629 + transitioning: viewportState.transitioning,
8630 + instant: instantType
8631 + };
8632 + return useRenderElement("div", componentProps, {
8633 + state,
8634 + ref: forwardedRef,
8635 + props: [elementProps, {
8636 + children: childrenToRender
8637 + }],
8638 + stateAttributesMapping: popupViewportStateMapping
8639 + });
8640 + });
8641 + if (true) TooltipViewport.displayName = "TooltipViewport";
8642 +
8643 + // node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs
8644 + var TooltipHandle = class extends BasePopupHandle {
8645 + constructor() {
8646 + super(createNullTooltipStore(), "Tooltip");
8647 + }
8648 + /**
8649 + * Opens the tooltip and associates it with the trigger with the given id.
8650 + *
8651 + * This method should only be called in an event handler or an effect (not during rendering).
8652 + *
8653 + * @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching
8654 + * `Tooltip.Trigger` with this handle passed as a prop.
8655 + */
8656 + open(triggerId) {
8657 + this.openByTrigger(triggerId);
8658 + }
8659 + /**
8660 + * Closes the tooltip.
8661 + *
8662 + * This method should only be called in an event handler or an effect (not during rendering).
8663 + */
8664 + close() {
8665 + this.closePopup();
8666 + }
8667 + /**
8668 + * Whether the tooltip is currently open. Returns `false` while no root is attached to the handle.
8669 + */
8670 + get isOpen() {
8671 + return this.attachedStore?.select("open") ?? false;
8672 + }
8673 + };
8674 + function createTooltipHandle() {
8675 + return new TooltipHandle();
8676 + }
8677 +
8678 + // node_modules/@base-ui/react/use-render/useRender.mjs
730 8679 function useRender(params) {
731 8680 return useRenderElement(params.defaultTagName ?? "div", params, params);
732 8681 }
733 8682
734 - // packages/icons/build-module/library/arrow-up-left.mjs
8683 + // packages/ui/build-module/tooltip/index.mjs
8684 + var tooltip_exports = {};
8685 + __export(tooltip_exports, {
8686 + Popup: () => Popup,
8687 + Portal: () => Portal,
8688 + Positioner: () => Positioner,
8689 + Provider: () => Provider,
8690 + Root: () => Root,
8691 + Trigger: () => Trigger
8692 + });
8693 +
8694 + // packages/ui/build-module/tooltip/popup.mjs
8695 + var import_element13 = __toESM(require_element(), 1);
8696 +
8697 + // packages/ui/build-module/tooltip/portal.mjs
8698 + var import_element10 = __toESM(require_element(), 1);
8699 +
8700 + // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs
8701 + var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
8702 + function getRuntime() {
8703 + const globalScope = globalThis;
8704 + if (globalScope.__wpStyleRuntime) {
8705 + return globalScope.__wpStyleRuntime;
8706 + }
8707 + globalScope.__wpStyleRuntime = {
8708 + documents: /* @__PURE__ */ new Map(),
8709 + styles: /* @__PURE__ */ new Map(),
8710 + injectedStyles: /* @__PURE__ */ new WeakMap()
8711 + };
8712 + if (typeof document !== "undefined") {
8713 + registerDocument(document);
8714 + }
8715 + return globalScope.__wpStyleRuntime;
8716 + }
8717 + function documentContainsStyleHash(targetDocument, hash) {
8718 + if (!targetDocument.head) {
8719 + return false;
8720 + }
8721 + for (const style of targetDocument.head.querySelectorAll(
8722 + `style[${STYLE_HASH_ATTRIBUTE}]`
8723 + )) {
8724 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
8725 + return true;
8726 + }
8727 + }
8728 + return false;
8729 + }
8730 + function injectStyle(targetDocument, hash, css) {
8731 + if (!targetDocument.head) {
8732 + return;
8733 + }
8734 + const runtime = getRuntime();
8735 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
8736 + if (!injectedStyles) {
8737 + injectedStyles = /* @__PURE__ */ new Set();
8738 + runtime.injectedStyles.set(targetDocument, injectedStyles);
8739 + }
8740 + if (injectedStyles.has(hash)) {
8741 + return;
8742 + }
8743 + if (documentContainsStyleHash(targetDocument, hash)) {
8744 + injectedStyles.add(hash);
8745 + return;
8746 + }
8747 + const style = targetDocument.createElement("style");
8748 + style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
8749 + style.appendChild(targetDocument.createTextNode(css));
8750 + targetDocument.head.appendChild(style);
8751 + injectedStyles.add(hash);
8752 + }
8753 + function registerDocument(targetDocument) {
8754 + const runtime = getRuntime();
8755 + runtime.documents.set(
8756 + targetDocument,
8757 + (runtime.documents.get(targetDocument) ?? 0) + 1
8758 + );
8759 + for (const [hash, css] of runtime.styles) {
8760 + injectStyle(targetDocument, hash, css);
8761 + }
8762 + return () => {
8763 + const count = runtime.documents.get(targetDocument);
8764 + if (count === void 0) {
8765 + return;
8766 + }
8767 + if (count <= 1) {
8768 + runtime.documents.delete(targetDocument);
8769 + return;
8770 + }
8771 + runtime.documents.set(targetDocument, count - 1);
8772 + };
8773 + }
8774 + function registerStyle(hash, css) {
8775 + const runtime = getRuntime();
8776 + runtime.styles.set(hash, css);
8777 + for (const targetDocument of runtime.documents.keys()) {
8778 + injectStyle(targetDocument, hash, css);
8779 + }
8780 + }
8781 + if (typeof process === "undefined" || true) {
8782 + registerStyle("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}");
8783 + }
8784 + var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" };
8785 + var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot";
8786 + function resolveOwnerDocument() {
8787 + return typeof document === "undefined" ? null : document;
8788 + }
8789 + function isInWordPressEnvironment() {
8790 + let topWp;
8791 + try {
8792 + topWp = window.top?.wp;
8793 + } catch {
8794 + }
8795 + const wp = topWp ?? window.wp;
8796 + return typeof wp?.components === "object" && wp.components !== null;
8797 + }
8798 + var cachedSlot = null;
8799 + function ensureSlotIsAccessible(element) {
8800 + element.setAttribute("aria-hidden", "false");
8801 + return element;
8802 + }
8803 + function createSlot(ownerDocument2) {
8804 + const element = ownerDocument2.createElement("div");
8805 + element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, "");
8806 + if (wp_compat_overlay_slot_default.slot) {
8807 + element.classList.add(wp_compat_overlay_slot_default.slot);
8808 + }
8809 + ownerDocument2.body.appendChild(element);
8810 + return element;
8811 + }
8812 + function getWpCompatOverlaySlot() {
8813 + if (typeof window === "undefined") {
8814 + return void 0;
8815 + }
8816 + if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) {
8817 + return void 0;
8818 + }
8819 + const ownerDocument2 = resolveOwnerDocument();
8820 + if (!ownerDocument2 || !ownerDocument2.body) {
8821 + return void 0;
8822 + }
8823 + if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) {
8824 + return ensureSlotIsAccessible(cachedSlot);
8825 + }
8826 + const existing = ownerDocument2.querySelector(
8827 + `[${WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]`
8828 + );
8829 + if (existing instanceof HTMLDivElement) {
8830 + cachedSlot = ensureSlotIsAccessible(existing);
8831 + return cachedSlot;
8832 + }
8833 + if (cachedSlot?.isConnected) {
8834 + cachedSlot.remove();
8835 + }
8836 + cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2));
8837 + return cachedSlot;
8838 + }
8839 +
8840 + // packages/ui/build-module/tooltip/portal.mjs
8841 + var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
8842 + var Portal = (0, import_element10.forwardRef)(
8843 + function TooltipPortal3({ container, ...restProps }, ref) {
8844 + return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
8845 + index_parts_exports.Portal,
8846 + {
8847 + container: container ?? getWpCompatOverlaySlot(),
8848 + ...restProps,
8849 + ref
8850 + }
8851 + );
8852 + }
8853 + );
8854 +
8855 + // packages/ui/build-module/tooltip/positioner.mjs
8856 + var import_element11 = __toESM(require_element(), 1);
8857 + var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
8858 + var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
8859 + function getRuntime2() {
8860 + const globalScope = globalThis;
8861 + if (globalScope.__wpStyleRuntime) {
8862 + return globalScope.__wpStyleRuntime;
8863 + }
8864 + globalScope.__wpStyleRuntime = {
8865 + documents: /* @__PURE__ */ new Map(),
8866 + styles: /* @__PURE__ */ new Map(),
8867 + injectedStyles: /* @__PURE__ */ new WeakMap()
8868 + };
8869 + if (typeof document !== "undefined") {
8870 + registerDocument2(document);
8871 + }
8872 + return globalScope.__wpStyleRuntime;
8873 + }
8874 + function documentContainsStyleHash2(targetDocument, hash) {
8875 + if (!targetDocument.head) {
8876 + return false;
8877 + }
8878 + for (const style of targetDocument.head.querySelectorAll(
8879 + `style[${STYLE_HASH_ATTRIBUTE2}]`
8880 + )) {
8881 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
8882 + return true;
8883 + }
8884 + }
8885 + return false;
8886 + }
8887 + function injectStyle2(targetDocument, hash, css) {
8888 + if (!targetDocument.head) {
8889 + return;
8890 + }
8891 + const runtime = getRuntime2();
8892 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
8893 + if (!injectedStyles) {
8894 + injectedStyles = /* @__PURE__ */ new Set();
8895 + runtime.injectedStyles.set(targetDocument, injectedStyles);
8896 + }
8897 + if (injectedStyles.has(hash)) {
8898 + return;
8899 + }
8900 + if (documentContainsStyleHash2(targetDocument, hash)) {
8901 + injectedStyles.add(hash);
8902 + return;
8903 + }
8904 + const style = targetDocument.createElement("style");
8905 + style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
8906 + style.appendChild(targetDocument.createTextNode(css));
8907 + targetDocument.head.appendChild(style);
8908 + injectedStyles.add(hash);
8909 + }
8910 + function registerDocument2(targetDocument) {
8911 + const runtime = getRuntime2();
8912 + runtime.documents.set(
8913 + targetDocument,
8914 + (runtime.documents.get(targetDocument) ?? 0) + 1
8915 + );
8916 + for (const [hash, css] of runtime.styles) {
8917 + injectStyle2(targetDocument, hash, css);
8918 + }
8919 + return () => {
8920 + const count = runtime.documents.get(targetDocument);
8921 + if (count === void 0) {
8922 + return;
8923 + }
8924 + if (count <= 1) {
8925 + runtime.documents.delete(targetDocument);
8926 + return;
8927 + }
8928 + runtime.documents.set(targetDocument, count - 1);
8929 + };
8930 + }
8931 + function registerStyle2(hash, css) {
8932 + const runtime = getRuntime2();
8933 + runtime.styles.set(hash, css);
8934 + for (const targetDocument of runtime.documents.keys()) {
8935 + injectStyle2(targetDocument, hash, css);
8936 + }
8937 + }
8938 + if (typeof process === "undefined" || true) {
8939 + registerStyle2("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
8940 + }
8941 + var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
8942 + if (typeof process === "undefined" || true) {
8943 + registerStyle2("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);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(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
8944 + }
8945 + var style_default = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
8946 + var Positioner = (0, import_element11.forwardRef)(
8947 + function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) {
8948 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8949 + index_parts_exports.Positioner,
8950 + {
8951 + ref,
8952 + align,
8953 + side,
8954 + sideOffset,
8955 + ...props,
8956 + className: clsx_default(
8957 + resets_default["box-sizing"],
8958 + style_default.positioner,
8959 + className
8960 + )
8961 + }
8962 + );
8963 + }
8964 + );
8965 +
8966 + // packages/ui/build-module/utils/render-slot-with-children.mjs
8967 + var import_element12 = __toESM(require_element(), 1);
8968 + function renderSlotWithChildren(slot, defaultSlot, children) {
8969 + return (0, import_element12.cloneElement)(slot ?? defaultSlot, { children });
8970 + }
8971 +
8972 + // packages/ui/build-module/utils/theme-provider.mjs
8973 + var theme = __toESM(require_theme(), 1);
8974 +
8975 + // packages/ui/build-module/lock-unlock.mjs
8976 + var import_private_apis = __toESM(require_private_apis(), 1);
8977 + var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
8978 + "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
8979 + "@wordpress/ui"
8980 + );
8981 +
8982 + // packages/ui/build-module/utils/theme-provider.mjs
8983 + function getThemeProvider() {
8984 + const themePackage = theme;
8985 + if (themePackage.ThemeProvider) {
8986 + return themePackage.ThemeProvider;
8987 + }
8988 + if (!themePackage.privateApis) {
8989 + throw new Error(
8990 + "@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`."
8991 + );
8992 + }
8993 + return unlock(
8994 + themePackage.privateApis
8995 + ).ThemeProvider;
8996 + }
8997 + var ThemeProvider = getThemeProvider();
8998 +
8999 + // packages/ui/build-module/tooltip/popup.mjs
9000 + var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
9001 + var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
9002 + function getRuntime3() {
9003 + const globalScope = globalThis;
9004 + if (globalScope.__wpStyleRuntime) {
9005 + return globalScope.__wpStyleRuntime;
9006 + }
9007 + globalScope.__wpStyleRuntime = {
9008 + documents: /* @__PURE__ */ new Map(),
9009 + styles: /* @__PURE__ */ new Map(),
9010 + injectedStyles: /* @__PURE__ */ new WeakMap()
9011 + };
9012 + if (typeof document !== "undefined") {
9013 + registerDocument3(document);
9014 + }
9015 + return globalScope.__wpStyleRuntime;
9016 + }
9017 + function documentContainsStyleHash3(targetDocument, hash) {
9018 + if (!targetDocument.head) {
9019 + return false;
9020 + }
9021 + for (const style of targetDocument.head.querySelectorAll(
9022 + `style[${STYLE_HASH_ATTRIBUTE3}]`
9023 + )) {
9024 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
9025 + return true;
9026 + }
9027 + }
9028 + return false;
9029 + }
9030 + function injectStyle3(targetDocument, hash, css) {
9031 + if (!targetDocument.head) {
9032 + return;
9033 + }
9034 + const runtime = getRuntime3();
9035 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
9036 + if (!injectedStyles) {
9037 + injectedStyles = /* @__PURE__ */ new Set();
9038 + runtime.injectedStyles.set(targetDocument, injectedStyles);
9039 + }
9040 + if (injectedStyles.has(hash)) {
9041 + return;
9042 + }
9043 + if (documentContainsStyleHash3(targetDocument, hash)) {
9044 + injectedStyles.add(hash);
9045 + return;
9046 + }
9047 + const style = targetDocument.createElement("style");
9048 + style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
9049 + style.appendChild(targetDocument.createTextNode(css));
9050 + targetDocument.head.appendChild(style);
9051 + injectedStyles.add(hash);
9052 + }
9053 + function registerDocument3(targetDocument) {
9054 + const runtime = getRuntime3();
9055 + runtime.documents.set(
9056 + targetDocument,
9057 + (runtime.documents.get(targetDocument) ?? 0) + 1
9058 + );
9059 + for (const [hash, css] of runtime.styles) {
9060 + injectStyle3(targetDocument, hash, css);
9061 + }
9062 + return () => {
9063 + const count = runtime.documents.get(targetDocument);
9064 + if (count === void 0) {
9065 + return;
9066 + }
9067 + if (count <= 1) {
9068 + runtime.documents.delete(targetDocument);
9069 + return;
9070 + }
9071 + runtime.documents.set(targetDocument, count - 1);
9072 + };
9073 + }
9074 + function registerStyle3(hash, css) {
9075 + const runtime = getRuntime3();
9076 + runtime.styles.set(hash, css);
9077 + for (const targetDocument of runtime.documents.keys()) {
9078 + injectStyle3(targetDocument, hash, css);
9079 + }
9080 + }
9081 + if (typeof process === "undefined" || true) {
9082 + registerStyle3("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);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(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
9083 + }
9084 + var style_default2 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
9085 + var POPUP_COLOR = { background: "#1e1e1e" };
9086 + var Popup = (0, import_element13.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) {
9087 + const popupContent = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9088 + index_parts_exports.Popup,
9089 + {
9090 + ref,
9091 + className: clsx_default(style_default2.popup, className),
9092 + ...props,
9093 + children
9094 + }
9095 + ) });
9096 + const positionedPopup = renderSlotWithChildren(
9097 + positioner,
9098 + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Positioner, {}),
9099 + popupContent
9100 + );
9101 + return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Portal, {}), positionedPopup);
9102 + });
9103 +
9104 + // packages/ui/build-module/tooltip/trigger.mjs
9105 + var import_element14 = __toESM(require_element(), 1);
9106 + var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
9107 + var Trigger = (0, import_element14.forwardRef)(
9108 + function TooltipTrigger3(props, ref) {
9109 + return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(index_parts_exports.Trigger, { ref, ...props });
9110 + }
9111 + );
9112 +
9113 + // packages/ui/build-module/utils/direction-provider.mjs
9114 + var import_i18n = __toESM(require_i18n(), 1);
9115 + var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
9116 + function DirectionProvider3({ children }) {
9117 + return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DirectionProvider, { direction: (0, import_i18n.isRTL)() ? "rtl" : "ltr", children });
9118 + }
9119 +
9120 + // packages/ui/build-module/tooltip/root.mjs
9121 + var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
9122 + function Root(props) {
9123 + return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(index_parts_exports.Root, { ...props }) });
9124 + }
9125 +
9126 + // packages/ui/build-module/tooltip/provider.mjs
9127 + var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
9128 + function Provider({ ...props }) {
9129 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(index_parts_exports.Provider, { ...props });
9130 + }
9131 +
9132 + // packages/icons/build-module/library/chevron-down.mjs
735 9133 var import_primitives = __toESM(require_primitives(), 1);
736 - var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
737 - 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" }) });
9134 + var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
9135 + var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives.Path, { d: "M7 11L12 15L17 11", vectorEffect: "non-scaling-stroke" }) });
738 9136
739 - // packages/icons/build-module/library/chevron-down.mjs
9137 + // packages/icons/build-module/library/chevron-left.mjs
740 9138 var import_primitives2 = __toESM(require_primitives(), 1);
741 - var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
742 - var chevron_down_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: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) });
9139 + var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
9140 + var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives2.Path, { d: "M14 6.5L9 12L14 17.5", vectorEffect: "non-scaling-stroke" }) });
743 9141
744 - // packages/icons/build-module/library/chevron-up.mjs
9142 + // packages/icons/build-module/library/chevron-right.mjs
745 9143 var import_primitives3 = __toESM(require_primitives(), 1);
746 - var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
747 - var chevron_up_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: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) });
9144 + var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
9145 + var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives3.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) });
748 9146
749 - // packages/icons/build-module/library/fullscreen.mjs
9147 + // packages/icons/build-module/library/chevron-up.mjs
750 9148 var import_primitives4 = __toESM(require_primitives(), 1);
751 - var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
752 - var fullscreen_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: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) });
9149 + var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
9150 + var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives4.Path, { d: "M7 13L12 9L17 13", vectorEffect: "non-scaling-stroke" }) });
753 9151
754 - // packages/icons/build-module/library/wordpress.mjs
9152 + // packages/icons/build-module/library/fullscreen.mjs
755 9153 var import_primitives5 = __toESM(require_primitives(), 1);
756 - var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
757 - var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.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" }) });
9154 + var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
9155 + var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives5.Path, { d: "M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14", vectorEffect: "non-scaling-stroke" }) });
758 9156
759 9157 // packages/ui/build-module/visually-hidden/visually-hidden.mjs
760 - var import_element = __toESM(require_element(), 1);
761 - if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c46e8cb841']")) {
762 - const style = document.createElement("style");
763 - style.setAttribute("data-wp-hash", "c46e8cb841");
764 - style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}"));
765 - document.head.appendChild(style);
9158 + var import_element15 = __toESM(require_element(), 1);
9159 + var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
9160 + function getRuntime4() {
9161 + const globalScope = globalThis;
9162 + if (globalScope.__wpStyleRuntime) {
9163 + return globalScope.__wpStyleRuntime;
9164 + }
9165 + globalScope.__wpStyleRuntime = {
9166 + documents: /* @__PURE__ */ new Map(),
9167 + styles: /* @__PURE__ */ new Map(),
9168 + injectedStyles: /* @__PURE__ */ new WeakMap()
9169 + };
9170 + if (typeof document !== "undefined") {
9171 + registerDocument4(document);
9172 + }
9173 + return globalScope.__wpStyleRuntime;
766 9174 }
767 - var style_default = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
768 - var VisuallyHidden = (0, import_element.forwardRef)(
9175 + function documentContainsStyleHash4(targetDocument, hash) {
9176 + if (!targetDocument.head) {
9177 + return false;
9178 + }
9179 + for (const style of targetDocument.head.querySelectorAll(
9180 + `style[${STYLE_HASH_ATTRIBUTE4}]`
9181 + )) {
9182 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
9183 + return true;
9184 + }
9185 + }
9186 + return false;
9187 + }
9188 + function injectStyle4(targetDocument, hash, css) {
9189 + if (!targetDocument.head) {
9190 + return;
9191 + }
9192 + const runtime = getRuntime4();
9193 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
9194 + if (!injectedStyles) {
9195 + injectedStyles = /* @__PURE__ */ new Set();
9196 + runtime.injectedStyles.set(targetDocument, injectedStyles);
9197 + }
9198 + if (injectedStyles.has(hash)) {
9199 + return;
9200 + }
9201 + if (documentContainsStyleHash4(targetDocument, hash)) {
9202 + injectedStyles.add(hash);
9203 + return;
9204 + }
9205 + const style = targetDocument.createElement("style");
9206 + style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
9207 + style.appendChild(targetDocument.createTextNode(css));
9208 + targetDocument.head.appendChild(style);
9209 + injectedStyles.add(hash);
9210 + }
9211 + function registerDocument4(targetDocument) {
9212 + const runtime = getRuntime4();
9213 + runtime.documents.set(
9214 + targetDocument,
9215 + (runtime.documents.get(targetDocument) ?? 0) + 1
9216 + );
9217 + for (const [hash, css] of runtime.styles) {
9218 + injectStyle4(targetDocument, hash, css);
9219 + }
9220 + return () => {
9221 + const count = runtime.documents.get(targetDocument);
9222 + if (count === void 0) {
9223 + return;
9224 + }
9225 + if (count <= 1) {
9226 + runtime.documents.delete(targetDocument);
9227 + return;
9228 + }
9229 + runtime.documents.set(targetDocument, count - 1);
9230 + };
9231 + }
9232 + function registerStyle4(hash, css) {
9233 + const runtime = getRuntime4();
9234 + runtime.styles.set(hash, css);
9235 + for (const targetDocument of runtime.documents.keys()) {
9236 + injectStyle4(targetDocument, hash, css);
9237 + }
9238 + }
9239 + if (typeof process === "undefined" || true) {
9240 + registerStyle4("f4df7461e9", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}}}");
9241 + }
9242 + var style_default3 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
9243 + var VisuallyHidden = (0, import_element15.forwardRef)(
769 9244 function VisuallyHidden2({ render, ...restProps }, ref) {
770 9245 const element = useRender({
771 9246 render,
772 9247 ref,
773 9248 props: mergeProps(
774 - { className: style_default["visually-hidden"] },
9249 + { className: style_default3["visually-hidden"] },
775 9250 restProps,
776 9251 {
777 9252 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
778 9253 "data-visually-hidden": ""
@@ -782,14 +9257,125 @@
782 9257 return element;
783 9258 }
784 9259 );
785 9260
9261 + // packages/ui/build-module/stack/stack.mjs
9262 + var import_element16 = __toESM(require_element(), 1);
9263 + var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
9264 + function getRuntime5() {
9265 + const globalScope = globalThis;
9266 + if (globalScope.__wpStyleRuntime) {
9267 + return globalScope.__wpStyleRuntime;
9268 + }
9269 + globalScope.__wpStyleRuntime = {
9270 + documents: /* @__PURE__ */ new Map(),
9271 + styles: /* @__PURE__ */ new Map(),
9272 + injectedStyles: /* @__PURE__ */ new WeakMap()
9273 + };
9274 + if (typeof document !== "undefined") {
9275 + registerDocument5(document);
9276 + }
9277 + return globalScope.__wpStyleRuntime;
9278 + }
9279 + function documentContainsStyleHash5(targetDocument, hash) {
9280 + if (!targetDocument.head) {
9281 + return false;
9282 + }
9283 + for (const style of targetDocument.head.querySelectorAll(
9284 + `style[${STYLE_HASH_ATTRIBUTE5}]`
9285 + )) {
9286 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
9287 + return true;
9288 + }
9289 + }
9290 + return false;
9291 + }
9292 + function injectStyle5(targetDocument, hash, css) {
9293 + if (!targetDocument.head) {
9294 + return;
9295 + }
9296 + const runtime = getRuntime5();
9297 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
9298 + if (!injectedStyles) {
9299 + injectedStyles = /* @__PURE__ */ new Set();
9300 + runtime.injectedStyles.set(targetDocument, injectedStyles);
9301 + }
9302 + if (injectedStyles.has(hash)) {
9303 + return;
9304 + }
9305 + if (documentContainsStyleHash5(targetDocument, hash)) {
9306 + injectedStyles.add(hash);
9307 + return;
9308 + }
9309 + const style = targetDocument.createElement("style");
9310 + style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
9311 + style.appendChild(targetDocument.createTextNode(css));
9312 + targetDocument.head.appendChild(style);
9313 + injectedStyles.add(hash);
9314 + }
9315 + function registerDocument5(targetDocument) {
9316 + const runtime = getRuntime5();
9317 + runtime.documents.set(
9318 + targetDocument,
9319 + (runtime.documents.get(targetDocument) ?? 0) + 1
9320 + );
9321 + for (const [hash, css] of runtime.styles) {
9322 + injectStyle5(targetDocument, hash, css);
9323 + }
9324 + return () => {
9325 + const count = runtime.documents.get(targetDocument);
9326 + if (count === void 0) {
9327 + return;
9328 + }
9329 + if (count <= 1) {
9330 + runtime.documents.delete(targetDocument);
9331 + return;
9332 + }
9333 + runtime.documents.set(targetDocument, count - 1);
9334 + };
9335 + }
9336 + function registerStyle5(hash, css) {
9337 + const runtime = getRuntime5();
9338 + runtime.styles.set(hash, css);
9339 + for (const targetDocument of runtime.documents.keys()) {
9340 + injectStyle5(targetDocument, hash, css);
9341 + }
9342 + }
9343 + if (typeof process === "undefined" || true) {
9344 + registerStyle5("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
9345 + }
9346 + var style_default4 = { "stack": "_19ce0419607e1896__stack" };
9347 + var gapTokens = {
9348 + xs: "var(--wpds-dimension-gap-xs, 4px)",
9349 + sm: "var(--wpds-dimension-gap-sm, 8px)",
9350 + md: "var(--wpds-dimension-gap-md, 12px)",
9351 + lg: "var(--wpds-dimension-gap-lg, 16px)",
9352 + xl: "var(--wpds-dimension-gap-xl, 24px)",
9353 + "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
9354 + "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
9355 + };
9356 + var Stack = (0, import_element16.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
9357 + const style = {
9358 + gap: gap && gapTokens[gap],
9359 + alignItems: align,
9360 + justifyContent: justify,
9361 + flexDirection: direction,
9362 + flexWrap: wrap
9363 + };
9364 + const element = useRender({
9365 + render,
9366 + ref,
9367 + props: mergeProps(props, { style, className: style_default4.stack })
9368 + });
9369 + return element;
9370 + });
9371 +
786 9372 // packages/admin-ui/build-module/navigable-region/index.mjs
787 - var import_element2 = __toESM(require_element(), 1);
788 - var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
789 - var NavigableRegion = (0, import_element2.forwardRef)(
9373 + var import_element17 = __toESM(require_element(), 1);
9374 + var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
9375 + var NavigableRegion = (0, import_element17.forwardRef)(
790 9376 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
791 - return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
9377 + return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
792 9378 Tag,
793 9379 {
794 9380 ref,
795 9381 className: clsx_default("admin-ui-navigable-region", className),
@@ -804,11 +9390,32 @@
804 9390 );
805 9391 NavigableRegion.displayName = "NavigableRegion";
806 9392 var navigable_region_default = NavigableRegion;
807 9393
9394 + // packages/admin-ui/build-module/admin-theme-colors/index.mjs
9395 + var DEFAULT_THEME_COLORS = {
9396 + primary: "#3858e9",
9397 + background: "#222524"
9398 + };
9399 + var ADMIN_THEME_COLORS = /* @__PURE__ */ new Map([
9400 + ["modern", DEFAULT_THEME_COLORS],
9401 + ["fresh", { primary: "#007cba", background: "#25292b" }],
9402 + ["midnight", { primary: "#cf4339", background: "#3d4042" }],
9403 + ["coffee", { primary: "#916745", background: "#5b534d" }],
9404 + ["ocean", { primary: "#567958", background: "#5f787f" }],
9405 + ["blue", { primary: "#437aa8", background: "#3876a8" }],
9406 + ["ectoplasm", { primary: "#646c3e", background: "#4f386e" }],
9407 + ["sunrise", { primary: "#ad631e", background: "#cc4541" }],
9408 + ["light", { primary: "#007cba", background: "#eaeeed" }]
9409 + ]);
9410 + function getAdminThemeColors() {
9411 + const scheme = document.body.className.match(/admin-color-([\w-]+)/)?.[1] ?? "modern";
9412 + return ADMIN_THEME_COLORS.get(scheme) ?? DEFAULT_THEME_COLORS;
9413 + }
9414 +
808 9415 // packages/edit-post/build-module/components/layout/index.mjs
809 - var import_editor18 = __toESM(require_editor(), 1);
810 - var import_data25 = __toESM(require_data(), 1);
9416 + var import_editor19 = __toESM(require_editor(), 1);
9417 + var import_data26 = __toESM(require_data(), 1);
811 9418 var import_block_editor2 = __toESM(require_block_editor(), 1);
812 9419
813 9420 // packages/global-styles-engine/build-module/utils/common.mjs
814 9421 var import_style_engine = __toESM(require_style_engine(), 1);
@@ -1035,9 +9642,10 @@
1035 9642 hasFallbackGapSupport,
1036 9643 fallbackGapValue
1037 9644 }) {
1038 9645 let ruleset = "";
1039 - let gapValue = hasBlockGapSupport ? getGapCSSValue(style?.spacing?.blockGap) : "";
9646 + const blockGapValue = style?.spacing?.blockGap;
9647 + let gapValue = hasBlockGapSupport ? getGapCSSValue(blockGapValue) : "";
1040 9648 if (hasFallbackGapSupport) {
1041 9649 if (selector === ROOT_BLOCK_SELECTOR) {
1042 9650 gapValue = !gapValue ? "0.5em" : gapValue;
1043 9651 } else if (!hasBlockGapSupport && fallbackGapValue) {
@@ -1043,8 +9651,9 @@
1043 9651 } else if (!hasBlockGapSupport && fallbackGapValue) {
1044 9652 gapValue = fallbackGapValue;
1045 9653 }
1046 9654 }
9655 + const rowGapValue = hasBlockGapSupport && blockGapValue && typeof blockGapValue !== "string" ? getGapCSSValue(blockGapValue.top) : gapValue;
1047 9656 if (gapValue && layoutDefinitions) {
1048 9657 Object.values(layoutDefinitions).forEach(
1049 9658 ({ className, name, spacingStyles }) => {
1050 9659 if (!hasBlockGapSupport && "flex" !== name && "grid" !== name) {
@@ -1049,8 +9658,11 @@
1049 9658 ({ className, name, spacingStyles }) => {
1050 9659 if (!hasBlockGapSupport && "flex" !== name && "grid" !== name) {
1051 9660 return;
1052 9661 }
9662 + const layoutGapValue = ["default", "constrained"].includes(
9663 + name
9664 + ) ? rowGapValue : gapValue;
1053 9665 if (spacingStyles?.length) {
1054 9666 spacingStyles.forEach((spacingStyle) => {
1055 9667 const declarations = [];
1056 9668 if (spacingStyle.rules) {
@@ -1056,9 +9668,9 @@
1056 9668 if (spacingStyle.rules) {
1057 9669 Object.entries(spacingStyle.rules).forEach(
1058 9670 ([cssProperty, cssValue]) => {
1059 9671 declarations.push(
1060 - `${cssProperty}: ${cssValue ? cssValue : gapValue}`
9672 + `${cssProperty}: ${cssValue ? cssValue : layoutGapValue}`
1061 9673 );
1062 9674 }
1063 9675 );
1064 9676 }
@@ -1115,147 +9727,59 @@
1115 9727 }
1116 9728
1117 9729 // packages/edit-post/build-module/components/layout/index.mjs
1118 9730 var import_plugins = __toESM(require_plugins(), 1);
1119 - var import_i18n14 = __toESM(require_i18n(), 1);
1120 - var import_element13 = __toESM(require_element(), 1);
9731 + var import_i18n15 = __toESM(require_i18n(), 1);
9732 + var import_element29 = __toESM(require_element(), 1);
1121 9733 var import_notices3 = __toESM(require_notices(), 1);
1122 9734 var import_preferences10 = __toESM(require_preferences(), 1);
1123 9735 var import_commands2 = __toESM(require_commands(), 1);
1124 - var import_block_library = __toESM(require_block_library(), 1);
1125 - var import_url5 = __toESM(require_url(), 1);
9736 + var import_url6 = __toESM(require_url(), 1);
1126 9737 var import_html_entities = __toESM(require_html_entities(), 1);
1127 - var import_core_data8 = __toESM(require_core_data(), 1);
1128 - var import_components9 = __toESM(require_components(), 1);
1129 - var import_compose3 = __toESM(require_compose(), 1);
9738 + var import_core_data9 = __toESM(require_core_data(), 1);
9739 + var import_components8 = __toESM(require_components(), 1);
9740 + var import_compose2 = __toESM(require_compose(), 1);
9741 + var import_theme = __toESM(require_theme(), 1);
1130 9742
1131 9743 // packages/edit-post/build-module/components/back-button/index.mjs
1132 9744 var import_editor2 = __toESM(require_editor(), 1);
1133 9745 var import_components2 = __toESM(require_components(), 1);
9746 + var import_preferences = __toESM(require_preferences(), 1);
9747 + var import_data3 = __toESM(require_data(), 1);
1134 9748
1135 9749 // packages/edit-post/build-module/components/back-button/fullscreen-mode-close.mjs
1136 9750 var import_data2 = __toESM(require_data(), 1);
1137 9751 var import_components = __toESM(require_components(), 1);
1138 - var import_i18n = __toESM(require_i18n(), 1);
9752 + var import_i18n2 = __toESM(require_i18n(), 1);
1139 9753 var import_url = __toESM(require_url(), 1);
1140 9754 var import_editor = __toESM(require_editor(), 1);
1141 9755 var import_core_data = __toESM(require_core_data(), 1);
1142 - var import_compose = __toESM(require_compose(), 1);
1143 - var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
1144 - var siteIconVariants = {
1145 - edit: {
1146 - clipPath: "inset(0% round 0px)"
1147 - },
1148 - hover: {
1149 - clipPath: "inset( 22% round 2px )"
1150 - },
1151 - tap: {
1152 - clipPath: "inset(0% round 0px)"
1153 - }
1154 - };
1155 - var toggleHomeIconVariants = {
1156 - edit: {
1157 - opacity: 0,
1158 - scale: 0.2
1159 - },
1160 - hover: {
1161 - opacity: 1,
1162 - scale: 1,
1163 - clipPath: "inset( 22% round 2px )"
1164 - }
1165 - };
9756 + var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
1166 9757 function FullscreenModeClose({ showTooltip, icon, href, initialPost }) {
1167 - const { isRequestingSiteIcon, postType, siteIconUrl } = (0, import_data2.useSelect)(
9758 + const postType = (0, import_data2.useSelect)(
1168 9759 (select3) => {
1169 9760 const { getCurrentPostType } = select3(import_editor.store);
1170 - const { getEntityRecord, getPostType, isResolving } = select3(import_core_data.store);
1171 - const siteData = getEntityRecord("root", "__unstableBase", void 0) || {};
1172 - const _postType = initialPost?.type || getCurrentPostType();
1173 - return {
1174 - isRequestingSiteIcon: isResolving("getEntityRecord", [
1175 - "root",
1176 - "__unstableBase",
1177 - void 0
1178 - ]),
1179 - postType: getPostType(_postType),
1180 - siteIconUrl: siteData.site_icon_url
1181 - };
9761 + const { getPostType } = select3(import_core_data.store);
9762 + return getPostType(initialPost?.type || getCurrentPostType());
1182 9763 },
1183 9764 [initialPost?.type]
1184 9765 );
1185 - const disableMotion = (0, import_compose.useReducedMotion)();
1186 - const transition = {
1187 - duration: disableMotion ? 0 : 0.2
1188 - };
1189 9766 if (!postType) {
1190 9767 return null;
1191 9768 }
1192 - let siteIconContent;
1193 - if (isRequestingSiteIcon && !siteIconUrl) {
1194 - siteIconContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "edit-post-fullscreen-mode-close-site-icon__image" });
1195 - } else if (siteIconUrl) {
1196 - siteIconContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1197 - "img",
1198 - {
1199 - className: "edit-post-fullscreen-mode-close-site-icon__image",
1200 - alt: (0, import_i18n.__)("Site Icon"),
1201 - src: siteIconUrl
1202 - }
1203 - );
1204 - } else {
1205 - siteIconContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1206 - import_components.Icon,
1207 - {
1208 - className: "edit-post-fullscreen-mode-close-site-icon__icon",
1209 - icon: wordpress_default,
1210 - size: 48
1211 - }
1212 - );
1213 - }
1214 - const buttonIcon = icon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components.Icon, { size: "36px", icon }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "edit-post-fullscreen-mode-close-site-icon", children: siteIconContent });
1215 - const classes = clsx_default("edit-post-fullscreen-mode-close", {
1216 - "has-icon": siteIconUrl
1217 - });
1218 9769 const buttonHref = href ?? (0, import_url.addQueryArgs)("edit.php", {
1219 9770 post_type: postType.slug
1220 9771 });
1221 - const buttonLabel = postType?.labels?.view_items ?? (0, import_i18n.__)("Back");
1222 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1223 - import_components.__unstableMotion.div,
9772 + const buttonLabel = postType?.labels?.view_items ?? (0, import_i18n2.__)("Back");
9773 + return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
9774 + import_components.Button,
1224 9775 {
1225 - className: "edit-post-fullscreen-mode-close__view-mode-toggle",
1226 - animate: "edit",
1227 - initial: "edit",
1228 - whileHover: "hover",
1229 - whileTap: "tap",
1230 - transition,
1231 - children: [
1232 - /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1233 - import_components.Button,
1234 - {
1235 - __next40pxDefaultSize: true,
1236 - className: classes,
1237 - href: buttonHref,
1238 - label: buttonLabel,
1239 - showTooltip,
1240 - tooltipPosition: "bottom",
1241 - children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components.__unstableMotion.div, { variants: !disableMotion && siteIconVariants, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "edit-post-fullscreen-mode-close__view-mode-toggle-icon", children: buttonIcon }) })
1242 - }
1243 - ),
1244 - /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1245 - import_components.__unstableMotion.div,
1246 - {
1247 - className: clsx_default(
1248 - "edit-post-fullscreen-mode-close__back-icon",
1249 - {
1250 - "has-site-icon": siteIconUrl
1251 - }
1252 - ),
1253 - variants: !disableMotion && toggleHomeIconVariants,
1254 - children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components.Icon, { icon: arrow_up_left_default })
1255 - }
1256 - )
1257 - ]
9776 + size: "compact",
9777 + href: buttonHref,
9778 + label: buttonLabel,
9779 + showTooltip,
9780 + tooltipPosition: "bottom",
9781 + icon: icon ?? ((0, import_i18n2.isRTL)() ? chevron_right_default : chevron_left_default)
1258 9782 }
1259 9783 );
1260 9784 }
1261 9785 var fullscreen_mode_close_default = FullscreenModeClose;
@@ -1260,17 +9784,17 @@
1260 9784 }
1261 9785 var fullscreen_mode_close_default = FullscreenModeClose;
1262 9786
1263 9787 // packages/edit-post/build-module/lock-unlock.mjs
1264 - var import_private_apis = __toESM(require_private_apis(), 1);
1265 - var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
9788 + var import_private_apis2 = __toESM(require_private_apis(), 1);
9789 + var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
1266 9790 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
1267 9791 "@wordpress/edit-post"
1268 9792 );
1269 9793
1270 9794 // packages/edit-post/build-module/components/back-button/index.mjs
1271 - var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
1272 - var { BackButton: BackButtonFill } = unlock(import_editor2.privateApis);
9795 + var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
9796 + var { BackButton: BackButtonFill } = unlock2(import_editor2.privateApis);
1273 9797 var slideX = {
1274 9798 hidden: { x: "-100%" },
1275 9799 distractionFreeInactive: { x: 0 },
1276 9800 hover: { x: 0, transition: { type: "tween", delay: 0.2 } }
@@ -1275,17 +9799,20 @@
1275 9799 distractionFreeInactive: { x: 0 },
1276 9800 hover: { x: 0, transition: { type: "tween", delay: 0.2 } }
1277 9801 };
1278 9802 function BackButton({ initialPost }) {
1279 - return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BackButtonFill, { children: ({ length }) => length <= 1 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
9803 + const showIconLabels = (0, import_data3.useSelect)((select3) => {
9804 + return select3(import_preferences.store).get("core", "showIconLabels");
9805 + }, []);
9806 + return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BackButtonFill, { children: ({ length }) => length <= 1 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1280 9807 import_components2.__unstableMotion.div,
1281 9808 {
1282 9809 variants: slideX,
1283 9810 transition: { type: "tween", delay: 0.8 },
1284 - children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
9811 + children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1285 9812 fullscreen_mode_close_default,
1286 9813 {
1287 - showTooltip: true,
9814 + showTooltip: !showIconLabels,
1288 9815 initialPost
1289 9816 }
1290 9817 )
1291 9818 }
@@ -1293,10 +9820,10 @@
1293 9820 }
1294 9821 var back_button_default = BackButton;
1295 9822
1296 9823 // packages/edit-post/build-module/components/editor-initialization/listener-hooks.mjs
1297 - var import_data3 = __toESM(require_data(), 1);
1298 - var import_element3 = __toESM(require_element(), 1);
9824 + var import_data4 = __toESM(require_data(), 1);
9825 + var import_element18 = __toESM(require_element(), 1);
1299 9826 var import_editor3 = __toESM(require_editor(), 1);
1300 9827 var import_core_data2 = __toESM(require_core_data(), 1);
1301 9828
1302 9829 // packages/edit-post/build-module/store/constants.mjs
@@ -1305,9 +9832,9 @@
1305 9832 var VIEW_AS_PREVIEW_LINK_SELECTOR = "#wp-admin-bar-preview a";
1306 9833
1307 9834 // packages/edit-post/build-module/components/editor-initialization/listener-hooks.mjs
1308 9835 var useUpdatePostLinkListener = () => {
1309 - const { isViewable, newPermalink } = (0, import_data3.useSelect)((select3) => {
9836 + const { isViewable, newPermalink } = (0, import_data4.useSelect)((select3) => {
1310 9837 const { getPostType } = select3(import_core_data2.store);
1311 9838 const { getCurrentPost, getEditedPostAttribute } = select3(import_editor3.store);
1312 9839 const postType = getPostType(getEditedPostAttribute("type"));
1313 9840 return {
@@ -1314,13 +9841,13 @@
1314 9841 isViewable: postType?.viewable,
1315 9842 newPermalink: getCurrentPost().link
1316 9843 };
1317 9844 }, []);
1318 - const nodeToUpdateRef = (0, import_element3.useRef)();
1319 - (0, import_element3.useEffect)(() => {
9845 + const nodeToUpdateRef = (0, import_element18.useRef)();
9846 + (0, import_element18.useEffect)(() => {
1320 9847 nodeToUpdateRef.current = document.querySelector(VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(VIEW_AS_LINK_SELECTOR);
1321 9848 }, []);
1322 - (0, import_element3.useEffect)(() => {
9849 + (0, import_element18.useEffect)(() => {
1323 9850 if (!newPermalink || !nodeToUpdateRef.current) {
1324 9851 return;
1325 9852 }
1326 9853 if (!isViewable) {
@@ -1338,18 +9865,18 @@
1338 9865 return null;
1339 9866 }
1340 9867
1341 9868 // packages/edit-post/build-module/components/keyboard-shortcuts/index.mjs
1342 - var import_element4 = __toESM(require_element(), 1);
1343 - var import_data7 = __toESM(require_data(), 1);
9869 + var import_element19 = __toESM(require_element(), 1);
9870 + var import_data8 = __toESM(require_data(), 1);
1344 9871 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
1345 - var import_i18n3 = __toESM(require_i18n(), 1);
9872 + var import_i18n4 = __toESM(require_i18n(), 1);
1346 9873
1347 9874 // packages/edit-post/build-module/store/index.mjs
1348 - var import_data6 = __toESM(require_data(), 1);
9875 + var import_data7 = __toESM(require_data(), 1);
1349 9876
1350 9877 // packages/edit-post/build-module/store/reducer.mjs
1351 - var import_data4 = __toESM(require_data(), 1);
9878 + var import_data5 = __toESM(require_data(), 1);
1352 9879 function isSavingMetaBoxes(state = false, action) {
1353 9880 switch (action.type) {
1354 9881 case "REQUEST_META_BOX_UPDATES":
1355 9882 return true;
@@ -1400,14 +9927,14 @@
1400 9927 return true;
1401 9928 }
1402 9929 return state;
1403 9930 }
1404 - var metaBoxes = (0, import_data4.combineReducers)({
9931 + var metaBoxes = (0, import_data5.combineReducers)({
1405 9932 isSaving: isSavingMetaBoxes,
1406 9933 locations: metaBoxLocations,
1407 9934 initialized: metaBoxesInitialized
1408 9935 });
1409 - var reducer_default = (0, import_data4.combineReducers)({
9936 + var reducer_default = (0, import_data5.combineReducers)({
1410 9937 metaBoxes
1411 9938 });
1412 9939
1413 9940 // packages/edit-post/build-module/store/actions.mjs
@@ -1442,15 +9969,15 @@
1442 9969 togglePublishSidebar: () => togglePublishSidebar,
1443 9970 updatePreferredStyleVariations: () => updatePreferredStyleVariations
1444 9971 });
1445 9972 var import_api_fetch = __toESM(require_api_fetch(), 1);
1446 - var import_preferences = __toESM(require_preferences(), 1);
9973 + var import_preferences2 = __toESM(require_preferences(), 1);
1447 9974 var import_editor4 = __toESM(require_editor(), 1);
1448 9975 var import_deprecated = __toESM(require_deprecated(), 1);
1449 9976 var import_hooks = __toESM(require_hooks(), 1);
1450 9977 var import_core_data3 = __toESM(require_core_data(), 1);
1451 9978 var import_notices = __toESM(require_notices(), 1);
1452 - var import_i18n2 = __toESM(require_i18n(), 1);
9979 + var import_i18n3 = __toESM(require_i18n(), 1);
1453 9980
1454 9981 // packages/edit-post/build-module/utils/meta-boxes.mjs
1455 9982 var getMetaBoxContainer = (location) => {
1456 9983 const area = document.querySelector(
@@ -1462,9 +9989,9 @@
1462 9989 return document.querySelector("#metaboxes .metabox-location-" + location);
1463 9990 };
1464 9991
1465 9992 // packages/edit-post/build-module/store/actions.mjs
1466 - var { interfaceStore } = unlock(import_editor4.privateApis);
9993 + var { interfaceStore } = unlock2(import_editor4.privateApis);
1467 9994 var openGeneralSidebar = (name) => ({ registry }) => {
1468 9995 registry.dispatch(interfaceStore).enableComplementaryArea("core", name);
1469 9996 };
1470 9997 var closeGeneralSidebar = () => ({ registry }) => registry.dispatch(interfaceStore).disableComplementaryArea("core");
@@ -1523,9 +10050,9 @@
1523 10050 alternative: "dispatch( 'core/editor').removeEditorPanel"
1524 10051 });
1525 10052 registry.dispatch(import_editor4.store).removeEditorPanel(panelName);
1526 10053 };
1527 - var toggleFeature = (feature) => ({ registry }) => registry.dispatch(import_preferences.store).toggle("core/edit-post", feature);
10054 + var toggleFeature = (feature) => ({ registry }) => registry.dispatch(import_preferences2.store).toggle("core/edit-post", feature);
1528 10055 var switchEditorMode = (mode) => ({ registry }) => {
1529 10056 (0, import_deprecated.default)("dispatch( 'core/edit-post' ).switchEditorMode", {
1530 10057 since: "6.6",
1531 10058 alternative: "dispatch( 'core/editor').switchEditorMode"
@@ -1543,12 +10070,12 @@
1543 10070 });
1544 10071 return { type: "NOTHING" };
1545 10072 }
1546 10073 var showBlockTypes = (blockNames) => ({ registry }) => {
1547 - unlock(registry.dispatch(import_editor4.store)).showBlockTypes(blockNames);
10074 + unlock2(registry.dispatch(import_editor4.store)).showBlockTypes(blockNames);
1548 10075 };
1549 10076 var hideBlockTypes = (blockNames) => ({ registry }) => {
1550 - unlock(registry.dispatch(import_editor4.store)).hideBlockTypes(blockNames);
10077 + unlock2(registry.dispatch(import_editor4.store)).hideBlockTypes(blockNames);
1551 10078 };
1552 10079 function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
1553 10080 return {
1554 10081 type: "SET_META_BOXES_PER_LOCATIONS",
@@ -1684,20 +10211,20 @@
1684 10211 });
1685 10212 registry.dispatch(import_editor4.store).toggleDistractionFree();
1686 10213 };
1687 10214 var toggleFullscreenMode = () => ({ registry }) => {
1688 - const isFullscreen = registry.select(import_preferences.store).get("core/edit-post", "fullscreenMode");
1689 - registry.dispatch(import_preferences.store).toggle("core/edit-post", "fullscreenMode");
10215 + const isFullscreen = registry.select(import_preferences2.store).get("core/edit-post", "fullscreenMode");
10216 + registry.dispatch(import_preferences2.store).toggle("core/edit-post", "fullscreenMode");
1690 10217 registry.dispatch(import_notices.store).createInfoNotice(
1691 - isFullscreen ? (0, import_i18n2.__)("Fullscreen mode deactivated.") : (0, import_i18n2.__)("Fullscreen mode activated."),
10218 + isFullscreen ? (0, import_i18n3.__)("Fullscreen mode deactivated.") : (0, import_i18n3.__)("Fullscreen mode activated."),
1692 10219 {
1693 10220 id: "core/edit-post/toggle-fullscreen-mode/notice",
1694 10221 type: "snackbar",
1695 10222 actions: [
1696 10223 {
1697 - label: (0, import_i18n2.__)("Undo"),
10224 + label: (0, import_i18n3.__)("Undo"),
1698 10225 onClick: () => {
1699 - registry.dispatch(import_preferences.store).toggle(
10226 + registry.dispatch(import_preferences2.store).toggle(
1700 10227 "core/edit-post",
1701 10228 "fullscreenMode"
1702 10229 );
1703 10230 }
@@ -1738,20 +10265,20 @@
1738 10265 isPluginSidebarOpened: () => isPluginSidebarOpened,
1739 10266 isPublishSidebarOpened: () => isPublishSidebarOpened,
1740 10267 isSavingMetaBoxes: () => isSavingMetaBoxes2
1741 10268 });
1742 - var import_data5 = __toESM(require_data(), 1);
1743 - var import_preferences2 = __toESM(require_preferences(), 1);
10269 + var import_data6 = __toESM(require_data(), 1);
10270 + var import_preferences3 = __toESM(require_preferences(), 1);
1744 10271 var import_core_data4 = __toESM(require_core_data(), 1);
1745 10272 var import_editor5 = __toESM(require_editor(), 1);
1746 10273 var import_deprecated2 = __toESM(require_deprecated(), 1);
1747 - var { interfaceStore: interfaceStore2 } = unlock(import_editor5.privateApis);
10274 + var { interfaceStore: interfaceStore2 } = unlock2(import_editor5.privateApis);
1748 10275 var EMPTY_ARRAY2 = [];
1749 10276 var EMPTY_OBJECT2 = {};
1750 - var getEditorMode = (0, import_data5.createRegistrySelector)(
1751 - (select3) => () => select3(import_preferences2.store).get("core", "editorMode") ?? "visual"
10277 + var getEditorMode = (0, import_data6.createRegistrySelector)(
10278 + (select3) => () => select3(import_preferences3.store).get("core", "editorMode") ?? "visual"
1752 10279 );
1753 - var isEditorSidebarOpened = (0, import_data5.createRegistrySelector)(
10280 + var isEditorSidebarOpened = (0, import_data6.createRegistrySelector)(
1754 10281 (select3) => () => {
1755 10282 const activeGeneralSidebar = select3(interfaceStore2).getActiveComplementaryArea("core");
1756 10283 return ["edit-post/document", "edit-post/block"].includes(
1757 10284 activeGeneralSidebar
@@ -1757,9 +10284,9 @@
1757 10284 activeGeneralSidebar
1758 10285 );
1759 10286 }
1760 10287 );
1761 - var isPluginSidebarOpened = (0, import_data5.createRegistrySelector)(
10288 + var isPluginSidebarOpened = (0, import_data6.createRegistrySelector)(
1762 10289 (select3) => () => {
1763 10290 const activeGeneralSidebar = select3(interfaceStore2).getActiveComplementaryArea("core");
1764 10291 return !!activeGeneralSidebar && !["edit-post/document", "edit-post/block"].includes(
1765 10292 activeGeneralSidebar
@@ -1765,9 +10292,9 @@
1765 10292 activeGeneralSidebar
1766 10293 );
1767 10294 }
1768 10295 );
1769 - var getActiveGeneralSidebarName = (0, import_data5.createRegistrySelector)(
10296 + var getActiveGeneralSidebarName = (0, import_data6.createRegistrySelector)(
1770 10297 (select3) => () => {
1771 10298 return select3(interfaceStore2).getActiveComplementaryArea("core");
1772 10299 }
1773 10300 );
@@ -1792,9 +10319,9 @@
1792 10319 };
1793 10320 }, panelsWithEnabledState ?? {});
1794 10321 return panels ?? panelsWithEnabledState ?? EMPTY_OBJECT2;
1795 10322 }
1796 - var getPreferences = (0, import_data5.createRegistrySelector)((select3) => () => {
10323 + var getPreferences = (0, import_data6.createRegistrySelector)((select3) => () => {
1797 10324 (0, import_deprecated2.default)(`select( 'core/edit-post' ).getPreferences`, {
1798 10325 since: "6.0",
1799 10326 alternative: `select( 'core/preferences' ).get`
1800 10327 });
@@ -1799,9 +10326,9 @@
1799 10326 alternative: `select( 'core/preferences' ).get`
1800 10327 });
1801 10328 const corePreferences = ["editorMode", "hiddenBlockTypes"].reduce(
1802 10329 (accumulatedPrefs, preferenceKey) => {
1803 - const value = select3(import_preferences2.store).get(
10330 + const value = select3(import_preferences3.store).get(
1804 10331 "core",
1805 10332 preferenceKey
1806 10333 );
1807 10334 return {
@@ -1810,13 +10337,13 @@
1810 10337 };
1811 10338 },
1812 10339 {}
1813 10340 );
1814 - const inactivePanels = select3(import_preferences2.store).get(
10341 + const inactivePanels = select3(import_preferences3.store).get(
1815 10342 "core",
1816 10343 "inactivePanels"
1817 10344 );
1818 - const openPanels = select3(import_preferences2.store).get("core", "openPanels");
10345 + const openPanels = select3(import_preferences3.store).get("core", "openPanels");
1819 10346 const panels = convertPanelsToOldFormat(inactivePanels, openPanels);
1820 10347 return {
1821 10348 ...corePreferences,
1822 10349 panels
@@ -1830,12 +10357,12 @@
1830 10357 const preferences = getPreferences(state);
1831 10358 const value = preferences[preferenceKey];
1832 10359 return value === void 0 ? defaultValue : value;
1833 10360 }
1834 - var getHiddenBlockTypes = (0, import_data5.createRegistrySelector)((select3) => () => {
1835 - return select3(import_preferences2.store).get("core", "hiddenBlockTypes") ?? EMPTY_ARRAY2;
10361 + var getHiddenBlockTypes = (0, import_data6.createRegistrySelector)((select3) => () => {
10362 + return select3(import_preferences3.store).get("core", "hiddenBlockTypes") ?? EMPTY_ARRAY2;
1836 10363 });
1837 - var isPublishSidebarOpened = (0, import_data5.createRegistrySelector)(
10364 + var isPublishSidebarOpened = (0, import_data6.createRegistrySelector)(
1838 10365 (select3) => () => {
1839 10366 (0, import_deprecated2.default)(`select( 'core/edit-post' ).isPublishSidebarOpened`, {
1840 10367 since: "6.6",
1841 10368 alternative: `select( 'core/editor' ).isPublishSidebarOpened`
@@ -1842,9 +10369,9 @@
1842 10369 });
1843 10370 return select3(import_editor5.store).isPublishSidebarOpened();
1844 10371 }
1845 10372 );
1846 - var isEditorPanelRemoved = (0, import_data5.createRegistrySelector)(
10373 + var isEditorPanelRemoved = (0, import_data6.createRegistrySelector)(
1847 10374 (select3) => (state, panelName) => {
1848 10375 (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelRemoved`, {
1849 10376 since: "6.5",
1850 10377 alternative: `select( 'core/editor' ).isEditorPanelRemoved`
@@ -1851,9 +10378,9 @@
1851 10378 });
1852 10379 return select3(import_editor5.store).isEditorPanelRemoved(panelName);
1853 10380 }
1854 10381 );
1855 - var isEditorPanelEnabled = (0, import_data5.createRegistrySelector)(
10382 + var isEditorPanelEnabled = (0, import_data6.createRegistrySelector)(
1856 10383 (select3) => (state, panelName) => {
1857 10384 (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelEnabled`, {
1858 10385 since: "6.5",
1859 10386 alternative: `select( 'core/editor' ).isEditorPanelEnabled`
@@ -1860,9 +10387,9 @@
1860 10387 });
1861 10388 return select3(import_editor5.store).isEditorPanelEnabled(panelName);
1862 10389 }
1863 10390 );
1864 - var isEditorPanelOpened = (0, import_data5.createRegistrySelector)(
10391 + var isEditorPanelOpened = (0, import_data6.createRegistrySelector)(
1865 10392 (select3) => (state, panelName) => {
1866 10393 (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelOpened`, {
1867 10394 since: "6.5",
1868 10395 alternative: `select( 'core/editor' ).isEditorPanelOpened`
@@ -1869,9 +10396,9 @@
1869 10396 });
1870 10397 return select3(import_editor5.store).isEditorPanelOpened(panelName);
1871 10398 }
1872 10399 );
1873 - var isModalActive = (0, import_data5.createRegistrySelector)(
10400 + var isModalActive = (0, import_data6.createRegistrySelector)(
1874 10401 (select3) => (state, modalName) => {
1875 10402 (0, import_deprecated2.default)(`select( 'core/edit-post' ).isModalActive`, {
1876 10403 since: "6.3",
1877 10404 alternative: `select( 'core/interface' ).isModalActive`
@@ -1878,19 +10405,19 @@
1878 10405 });
1879 10406 return !!select3(interfaceStore2).isModalActive(modalName);
1880 10407 }
1881 10408 );
1882 - var isFeatureActive = (0, import_data5.createRegistrySelector)(
10409 + var isFeatureActive = (0, import_data6.createRegistrySelector)(
1883 10410 (select3) => (state, feature) => {
1884 - return !!select3(import_preferences2.store).get("core/edit-post", feature);
10411 + return !!select3(import_preferences3.store).get("core/edit-post", feature);
1885 10412 }
1886 10413 );
1887 - var isPluginItemPinned = (0, import_data5.createRegistrySelector)(
10414 + var isPluginItemPinned = (0, import_data6.createRegistrySelector)(
1888 10415 (select3) => (state, pluginName) => {
1889 10416 return select3(interfaceStore2).isItemPinned("core", pluginName);
1890 10417 }
1891 10418 );
1892 - var getActiveMetaBoxLocations = (0, import_data5.createSelector)(
10419 + var getActiveMetaBoxLocations = (0, import_data6.createSelector)(
1893 10420 (state) => {
1894 10421 return Object.keys(state.metaBoxes.locations).filter(
1895 10422 (location) => isMetaBoxLocationActive(state, location)
1896 10423 );
@@ -1896,9 +10423,9 @@
1896 10423 );
1897 10424 },
1898 10425 (state) => [state.metaBoxes.locations]
1899 10426 );
1900 - var isMetaBoxLocationVisible = (0, import_data5.createRegistrySelector)(
10427 + var isMetaBoxLocationVisible = (0, import_data6.createRegistrySelector)(
1901 10428 (select3) => (state, location) => {
1902 10429 return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ id }) => {
1903 10430 return select3(import_editor5.store).isEditorPanelEnabled(
1904 10431 `meta-box-${id}`
@@ -1912,9 +10439,9 @@
1912 10439 }
1913 10440 function getMetaBoxesPerLocation(state, location) {
1914 10441 return state.metaBoxes.locations[location];
1915 10442 }
1916 - var getAllMetaBoxes = (0, import_data5.createSelector)(
10443 + var getAllMetaBoxes = (0, import_data6.createSelector)(
1917 10444 (state) => {
1918 10445 return Object.values(state.metaBoxes.locations).flat();
1919 10446 },
1920 10447 (state) => [state.metaBoxes.locations]
@@ -1924,9 +10451,9 @@
1924 10451 }
1925 10452 function isSavingMetaBoxes2(state) {
1926 10453 return state.metaBoxes.isSaving;
1927 10454 }
1928 - var __experimentalGetPreviewDeviceType = (0, import_data5.createRegistrySelector)(
10455 + var __experimentalGetPreviewDeviceType = (0, import_data6.createRegistrySelector)(
1929 10456 (select3) => () => {
1930 10457 (0, import_deprecated2.default)(
1931 10458 `select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,
1932 10459 {
@@ -1937,9 +10464,9 @@
1937 10464 );
1938 10465 return select3(import_editor5.store).getDeviceType();
1939 10466 }
1940 10467 );
1941 - var isInserterOpened = (0, import_data5.createRegistrySelector)((select3) => () => {
10468 + var isInserterOpened = (0, import_data6.createRegistrySelector)((select3) => () => {
1942 10469 (0, import_deprecated2.default)(`select( 'core/edit-post' ).isInserterOpened`, {
1943 10470 since: "6.5",
1944 10471 alternative: `select( 'core/editor' ).isInserterOpened`
1945 10472 });
@@ -1944,9 +10471,9 @@
1944 10471 alternative: `select( 'core/editor' ).isInserterOpened`
1945 10472 });
1946 10473 return select3(import_editor5.store).isInserterOpened();
1947 10474 });
1948 - var __experimentalGetInsertionPoint = (0, import_data5.createRegistrySelector)(
10475 + var __experimentalGetInsertionPoint = (0, import_data6.createRegistrySelector)(
1949 10476 (select3) => () => {
1950 10477 (0, import_deprecated2.default)(
1951 10478 `select( 'core/edit-post' ).__experimentalGetInsertionPoint`,
1952 10479 {
@@ -1953,12 +10480,12 @@
1953 10480 since: "6.5",
1954 10481 version: "6.7"
1955 10482 }
1956 10483 );
1957 - return unlock(select3(import_editor5.store)).getInserter();
10484 + return unlock2(select3(import_editor5.store)).getInserter();
1958 10485 }
1959 10486 );
1960 - var isListViewOpened = (0, import_data5.createRegistrySelector)((select3) => () => {
10487 + var isListViewOpened = (0, import_data6.createRegistrySelector)((select3) => () => {
1961 10488 (0, import_deprecated2.default)(`select( 'core/edit-post' ).isListViewOpened`, {
1962 10489 since: "6.5",
1963 10490 alternative: `select( 'core/editor' ).isListViewOpened`
1964 10491 });
@@ -1963,9 +10490,9 @@
1963 10490 alternative: `select( 'core/editor' ).isListViewOpened`
1964 10491 });
1965 10492 return select3(import_editor5.store).isListViewOpened();
1966 10493 });
1967 - var isEditingTemplate = (0, import_data5.createRegistrySelector)((select3) => () => {
10494 + var isEditingTemplate = (0, import_data6.createRegistrySelector)((select3) => () => {
1968 10495 (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditingTemplate`, {
1969 10496 since: "6.5",
1970 10497 alternative: `select( 'core/editor' ).getRenderingMode`
1971 10498 });
@@ -1973,12 +10500,12 @@
1973 10500 });
1974 10501 function areMetaBoxesInitialized(state) {
1975 10502 return state.metaBoxes.initialized;
1976 10503 }
1977 - var getEditedPostTemplate = (0, import_data5.createRegistrySelector)(
10504 + var getEditedPostTemplate = (0, import_data6.createRegistrySelector)(
1978 10505 (select3) => () => {
1979 10506 const { id: postId, type: postType } = select3(import_editor5.store).getCurrentPost();
1980 - const templateId = unlock(select3(import_core_data4.store)).getTemplateId(
10507 + const templateId = unlock2(select3(import_core_data4.store)).getTemplateId(
1981 10508 postType,
1982 10509 postId
1983 10510 );
1984 10511 if (!templateId) {
@@ -1992,24 +10519,24 @@
1992 10519 }
1993 10520 );
1994 10521
1995 10522 // packages/edit-post/build-module/store/index.mjs
1996 - var store = (0, import_data6.createReduxStore)(STORE_NAME, {
10523 + var store = (0, import_data7.createReduxStore)(STORE_NAME, {
1997 10524 reducer: reducer_default,
1998 10525 actions: actions_exports,
1999 10526 selectors: selectors_exports
2000 10527 });
2001 - (0, import_data6.register)(store);
10528 + (0, import_data7.register)(store);
2002 10529
2003 10530 // packages/edit-post/build-module/components/keyboard-shortcuts/index.mjs
2004 10531 function KeyboardShortcuts() {
2005 - const { toggleFullscreenMode: toggleFullscreenMode2 } = (0, import_data7.useDispatch)(store);
2006 - const { registerShortcut } = (0, import_data7.useDispatch)(import_keyboard_shortcuts.store);
2007 - (0, import_element4.useEffect)(() => {
10532 + const { toggleFullscreenMode: toggleFullscreenMode2 } = (0, import_data8.useDispatch)(store);
10533 + const { registerShortcut } = (0, import_data8.useDispatch)(import_keyboard_shortcuts.store);
10534 + (0, import_element19.useEffect)(() => {
2008 10535 registerShortcut({
2009 10536 name: "core/edit-post/toggle-fullscreen",
2010 10537 category: "global",
2011 - description: (0, import_i18n3.__)("Enable or disable fullscreen mode."),
10538 + description: (0, import_i18n4.__)("Enable or disable fullscreen mode."),
2012 10539 keyCombination: {
2013 10540 modifier: "secondary",
2014 10541 character: "f"
2015 10542 }
@@ -2022,35 +10549,32 @@
2022 10549 }
2023 10550 var keyboard_shortcuts_default = KeyboardShortcuts;
2024 10551
2025 10552 // packages/edit-post/build-module/components/init-pattern-modal/index.mjs
2026 - var import_data8 = __toESM(require_data(), 1);
2027 - var import_i18n4 = __toESM(require_i18n(), 1);
10553 + var import_data9 = __toESM(require_data(), 1);
10554 + var import_i18n5 = __toESM(require_i18n(), 1);
2028 10555 var import_components3 = __toESM(require_components(), 1);
2029 - var import_element5 = __toESM(require_element(), 1);
10556 + var import_element20 = __toESM(require_element(), 1);
2030 10557 var import_editor6 = __toESM(require_editor(), 1);
2031 - var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
10558 + var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
2032 10559 function InitPatternModal() {
2033 - const { editPost } = (0, import_data8.useDispatch)(import_editor6.store);
2034 - const [syncType, setSyncType] = (0, import_element5.useState)(void 0);
2035 - const [title, setTitle] = (0, import_element5.useState)("");
2036 - const isNewPost = (0, import_data8.useSelect)(
2037 - (select3) => select3(import_editor6.store).isCleanNewPost(),
2038 - []
2039 - );
2040 - const [isModalOpen, setIsModalOpen] = (0, import_element5.useState)(() => isNewPost);
2041 - if (!isNewPost) {
10560 + const { editPost } = (0, import_data9.useDispatch)(import_editor6.store);
10561 + const { isCleanNewPost } = (0, import_data9.useSelect)(import_editor6.store);
10562 + const [syncType, setSyncType] = (0, import_element20.useState)(void 0);
10563 + const [title, setTitle] = (0, import_element20.useState)("");
10564 + const [isModalOpen, setIsModalOpen] = (0, import_element20.useState)(() => isCleanNewPost());
10565 + if (!isModalOpen) {
2042 10566 return null;
2043 10567 }
2044 - return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
10568 + return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2045 10569 import_components3.Modal,
2046 10570 {
2047 - title: (0, import_i18n4.__)("Create pattern"),
10571 + title: (0, import_i18n5.__)("Create pattern"),
2048 10572 onRequestClose: () => {
2049 10573 setIsModalOpen(false);
2050 10574 },
2051 - overlayClassName: "reusable-blocks-menu-items__convert-modal",
2052 - children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
10575 + overlayClassName: "patterns-create-modal",
10576 + children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2053 10577 "form",
2054 10578 {
2055 10579 onSubmit: (event) => {
2056 10580 event.preventDefault();
@@ -2061,36 +10585,33 @@
2061 10585 wp_pattern_sync_status: syncType
2062 10586 }
2063 10587 });
2064 10588 },
2065 - children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_components3.__experimentalVStack, { spacing: "5", children: [
2066 - /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
10589 + children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Stack, { direction: "column", gap: "lg", children: [
10590 + /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2067 10591 import_components3.TextControl,
2068 10592 {
2069 - label: (0, import_i18n4.__)("Name"),
10593 + label: (0, import_i18n5.__)("Name"),
2070 10594 value: title,
2071 10595 onChange: setTitle,
2072 - placeholder: (0, import_i18n4.__)("My pattern"),
2073 - className: "patterns-create-modal__name-input",
2074 - __next40pxDefaultSize: true
10596 + placeholder: (0, import_i18n5.__)("My pattern"),
10597 + className: "patterns-create-modal__name-input"
2075 10598 }
2076 10599 ),
2077 - /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
10600 + /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2078 10601 import_components3.ToggleControl,
2079 10602 {
2080 - label: (0, import_i18n4._x)("Synced", "pattern (singular)"),
2081 - help: (0, import_i18n4.__)(
10603 + label: (0, import_i18n5._x)("Synced", "pattern (singular)"),
10604 + help: (0, import_i18n5.__)(
2082 10605 "Sync this pattern across multiple locations."
2083 10606 ),
2084 10607 checked: !syncType,
2085 10608 onChange: () => {
2086 - setSyncType(
2087 - !syncType ? "unsynced" : void 0
2088 - );
10609 + setSyncType(!syncType ? "unsynced" : void 0);
2089 10610 }
2090 10611 }
2091 10612 ),
2092 - /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components3.__experimentalHStack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
10613 + /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Stack, { justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2093 10614 import_components3.Button,
2094 10615 {
2095 10616 __next40pxDefaultSize: true,
2096 10617 variant: "primary",
@@ -2096,9 +10617,9 @@
2096 10617 variant: "primary",
2097 10618 type: "submit",
2098 10619 disabled: !title,
2099 10620 accessibleWhenDisabled: true,
2100 - children: (0, import_i18n4.__)("Create")
10621 + children: (0, import_i18n5.__)("Create")
2101 10622 }
2102 10623 ) })
2103 10624 ] })
2104 10625 }
@@ -2103,23 +10624,95 @@
2103 10624 ] })
2104 10625 }
2105 10626 )
2106 10627 }
2107 - ) });
10628 + );
2108 10629 }
2109 10630
2110 10631 // packages/edit-post/build-module/components/browser-url/index.mjs
2111 - var import_element6 = __toESM(require_element(), 1);
2112 - var import_data9 = __toESM(require_data(), 1);
10632 + var import_element22 = __toESM(require_element(), 1);
10633 + var import_data11 = __toESM(require_data(), 1);
10634 + var import_url3 = __toESM(require_url(), 1);
10635 + var import_editor8 = __toESM(require_editor(), 1);
10636 +
10637 + // packages/edit-post/build-module/components/browser-url/use-classic-revision-redirect.mjs
10638 + var import_data10 = __toESM(require_data(), 1);
10639 + var import_core_data5 = __toESM(require_core_data(), 1);
10640 + var import_editor7 = __toESM(require_editor(), 1);
10641 + var import_element21 = __toESM(require_element(), 1);
2113 10642 var import_url2 = __toESM(require_url(), 1);
2114 - var import_editor7 = __toESM(require_editor(), 1);
2115 - function getPostEditURL(postId) {
2116 - return (0, import_url2.addQueryArgs)("post.php", { post: postId, action: "edit" });
10643 + function useClassicRevisionRedirect() {
10644 + const registry = (0, import_data10.useRegistry)();
10645 + const { disableVisualRevisions, currentRevisionId, postType, postId } = (0, import_data10.useSelect)((select3) => {
10646 + const editor = select3(import_editor7.store);
10647 + return {
10648 + disableVisualRevisions: !!editor.getEditorSettings().disableVisualRevisions,
10649 + currentRevisionId: unlock2(editor).getCurrentRevisionId(),
10650 + postType: editor.getCurrentPostType(),
10651 + postId: editor.getCurrentPostId()
10652 + };
10653 + }, []);
10654 + const hasClassicRevisionScreen = ![
10655 + "wp_template",
10656 + "wp_template_part"
10657 + ].includes(postType);
10658 + (0, import_element21.useEffect)(() => {
10659 + if (!disableVisualRevisions || !hasClassicRevisionScreen || !currentRevisionId || !postType || !postId) {
10660 + return;
10661 + }
10662 + let cancelled = false;
10663 + registry.resolveSelect(import_core_data5.store).getRevision("postType", postType, postId, currentRevisionId, {
10664 + context: "edit",
10665 + _fields: "id"
10666 + }).then((revision) => {
10667 + if (cancelled || !revision) {
10668 + return;
10669 + }
10670 + const editor = registry.select(import_editor7.store);
10671 + const isStillSelected = !!editor.getEditorSettings().disableVisualRevisions && editor.getCurrentPostType() === postType && String(editor.getCurrentPostId()) === String(postId) && unlock2(editor).getCurrentRevisionId() === currentRevisionId;
10672 + if (!isStillSelected) {
10673 + return;
10674 + }
10675 + window.location.replace(
10676 + (0, import_url2.addQueryArgs)("revision.php", {
10677 + revision: currentRevisionId
10678 + })
10679 + );
10680 + });
10681 + return () => {
10682 + cancelled = true;
10683 + };
10684 + }, [
10685 + disableVisualRevisions,
10686 + hasClassicRevisionScreen,
10687 + currentRevisionId,
10688 + postType,
10689 + postId,
10690 + registry
10691 + ]);
2117 10692 }
10693 +
10694 + // packages/edit-post/build-module/components/browser-url/index.mjs
10695 + var URL_WRITE_DEBOUNCE_MS = 300;
10696 + function getPostEditURL(postId, revisionId) {
10697 + const args = { post: postId, action: "edit" };
10698 + if (revisionId) {
10699 + args.revision = revisionId;
10700 + }
10701 + return (0, import_url3.addQueryArgs)("post.php", args);
10702 + }
2118 10703 function BrowserURL() {
2119 - const [historyId, setHistoryId] = (0, import_element6.useState)(null);
2120 - const { postId, postStatus } = (0, import_data9.useSelect)((select3) => {
2121 - const { getCurrentPost } = select3(import_editor7.store);
10704 + useClassicRevisionRedirect();
10705 + const [initialRevisionId] = (0, import_element22.useState)(() => {
10706 + const revision = Number(
10707 + (0, import_url3.getQueryArg)(window.location.href, "revision")
10708 + );
10709 + return Number.isInteger(revision) && revision > 0 ? revision : null;
10710 + });
10711 + const hasHandledInitialRevisionRef = (0, import_element22.useRef)(false);
10712 + const { postId, postStatus, currentRevisionId } = (0, import_data11.useSelect)((select3) => {
10713 + const { getCurrentPost } = select3(import_editor8.store);
10714 + const { getCurrentRevisionId } = unlock2(select3(import_editor8.store));
2122 10715 const post = getCurrentPost();
2123 10716 let { id, status, type } = post;
2124 10717 const isTemplate = ["wp_template", "wp_template_part"].includes(
2125 10718 type
@@ -2128,57 +10721,110 @@
2128 10721 id = post.wp_id;
2129 10722 }
2130 10723 return {
2131 10724 postId: id,
2132 - postStatus: status
10725 + postStatus: status,
10726 + // `post.php` rejects templates because `show_ui` is false. Adding
10727 + // their revision ID to this URL would create a dead link.
10728 + currentRevisionId: isTemplate ? null : getCurrentRevisionId()
2133 10729 };
2134 10730 }, []);
2135 - (0, import_element6.useEffect)(() => {
2136 - if (postId && postId !== historyId && postStatus !== "auto-draft") {
2137 - window.history.replaceState(
2138 - { id: postId },
2139 - "Post " + postId,
2140 - getPostEditURL(postId)
2141 - );
2142 - setHistoryId(postId);
10731 + const { openRevision } = unlock2((0, import_data11.useDispatch)(import_editor8.store));
10732 + const lastURLWriteTimeRef = (0, import_element22.useRef)(null);
10733 + const lastPostIdRef = (0, import_element22.useRef)(null);
10734 + (0, import_element22.useEffect)(() => {
10735 + if (!postId) {
10736 + return;
2143 10737 }
2144 - }, [postId, postStatus, historyId]);
10738 + if (initialRevisionId && !hasHandledInitialRevisionRef.current) {
10739 + hasHandledInitialRevisionRef.current = true;
10740 + openRevision(initialRevisionId);
10741 + return;
10742 + }
10743 + if (postStatus === "auto-draft") {
10744 + return;
10745 + }
10746 + const previousPostId = lastPostIdRef.current;
10747 + lastPostIdRef.current = postId;
10748 + const url = getPostEditURL(postId, currentRevisionId);
10749 + const write = () => {
10750 + lastURLWriteTimeRef.current = Date.now();
10751 + try {
10752 + window.history.replaceState(
10753 + { id: postId },
10754 + "Post " + postId,
10755 + url
10756 + );
10757 + } catch {
10758 + }
10759 + };
10760 + if (previousPostId !== null && previousPostId !== postId) {
10761 + write();
10762 + return;
10763 + }
10764 + if (lastURLWriteTimeRef.current === null) {
10765 + write();
10766 + return;
10767 + }
10768 + if (Date.now() - lastURLWriteTimeRef.current >= URL_WRITE_DEBOUNCE_MS) {
10769 + write();
10770 + return;
10771 + }
10772 + const timeoutId = setTimeout(write, URL_WRITE_DEBOUNCE_MS);
10773 + return () => clearTimeout(timeoutId);
10774 + }, [
10775 + postId,
10776 + postStatus,
10777 + currentRevisionId,
10778 + initialRevisionId,
10779 + openRevision
10780 + ]);
2145 10781 return null;
2146 10782 }
2147 10783
2148 10784 // packages/edit-post/build-module/components/meta-boxes/index.mjs
2149 - var import_data12 = __toESM(require_data(), 1);
10785 + var import_data14 = __toESM(require_data(), 1);
2150 10786
2151 10787 // packages/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.mjs
2152 - var import_element7 = __toESM(require_element(), 1);
10788 + var import_element23 = __toESM(require_element(), 1);
2153 10789 var import_components4 = __toESM(require_components(), 1);
2154 - var import_data10 = __toESM(require_data(), 1);
2155 - var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
10790 + var import_data12 = __toESM(require_data(), 1);
10791 + var import_block_editor = __toESM(require_block_editor(), 1);
10792 + var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
10793 + var { useNativeUndo } = unlock2(import_block_editor.privateApis);
10794 + function move(parent, node) {
10795 + if (parent.moveBefore && parent.isConnected && node.isConnected) {
10796 + parent.moveBefore(node, null);
10797 + } else {
10798 + parent.appendChild(node);
10799 + }
10800 + }
2156 10801 function MetaBoxesArea({ location }) {
2157 - const container = (0, import_element7.useRef)(null);
2158 - const formRef = (0, import_element7.useRef)(null);
2159 - (0, import_element7.useEffect)(() => {
10802 + const container = (0, import_element23.useRef)(null);
10803 + const formRef = (0, import_element23.useRef)(null);
10804 + (0, import_element23.useLayoutEffect)(() => {
2160 10805 formRef.current = document.querySelector(
2161 10806 ".metabox-location-" + location
2162 10807 );
2163 10808 if (formRef.current) {
2164 - container.current.appendChild(formRef.current);
10809 + move(container.current, formRef.current);
2165 10810 }
2166 10811 return () => {
2167 10812 if (formRef.current) {
2168 - document.querySelector("#metaboxes").appendChild(formRef.current);
10813 + move(document.querySelector("#metaboxes"), formRef.current);
2169 10814 }
2170 10815 };
2171 10816 }, [location]);
2172 - const isSaving = (0, import_data10.useSelect)((select3) => {
10817 + const isSaving = (0, import_data12.useSelect)((select3) => {
2173 10818 return select3(store).isSavingMetaBoxes();
2174 10819 }, []);
2175 10820 const classes = clsx_default("edit-post-meta-boxes-area", `is-${location}`, {
2176 10821 "is-loading": isSaving
2177 10822 });
2178 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: classes, children: [
2179 - isSaving && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_components4.Spinner, {}),
2180 - /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10823 + const nativeUndoRef = useNativeUndo();
10824 + return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: classes, ref: nativeUndoRef, children: [
10825 + isSaving && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components4.Spinner, { className: "edit-post-meta-boxes-area__spinner" }),
10826 + /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2181 10827 "div",
2182 10828 {
2183 10829 className: "edit-post-meta-boxes-area__container",
2184 10830 ref: container
@@ -2183,27 +10829,27 @@
2183 10829 className: "edit-post-meta-boxes-area__container",
2184 10830 ref: container
2185 10831 }
2186 10832 ),
2187 - /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "edit-post-meta-boxes-area__clear" })
10833 + /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "edit-post-meta-boxes-area__clear" })
2188 10834 ] });
2189 10835 }
2190 10836 var meta_boxes_area_default = MetaBoxesArea;
2191 10837
2192 10838 // packages/edit-post/build-module/components/meta-boxes/meta-box-visibility.mjs
2193 - var import_element8 = __toESM(require_element(), 1);
2194 - var import_data11 = __toESM(require_data(), 1);
2195 - var import_editor8 = __toESM(require_editor(), 1);
10839 + var import_element24 = __toESM(require_element(), 1);
10840 + var import_data13 = __toESM(require_data(), 1);
10841 + var import_editor9 = __toESM(require_editor(), 1);
2196 10842 function MetaBoxVisibility({ id }) {
2197 - const isVisible = (0, import_data11.useSelect)(
10843 + const isVisible = (0, import_data13.useSelect)(
2198 10844 (select3) => {
2199 - return select3(import_editor8.store).isEditorPanelEnabled(
10845 + return select3(import_editor9.store).isEditorPanelEnabled(
2200 10846 `meta-box-${id}`
2201 10847 );
2202 10848 },
2203 10849 [id]
2204 10850 );
2205 - (0, import_element8.useEffect)(() => {
10851 + (0, import_element24.useEffect)(() => {
2206 10852 const element = document.getElementById(id);
2207 10853 if (!element) {
2208 10854 return;
2209 10855 }
@@ -2216,41 +10862,41 @@
2216 10862 return null;
2217 10863 }
2218 10864
2219 10865 // packages/edit-post/build-module/components/meta-boxes/index.mjs
2220 - var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
10866 + var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
2221 10867 function MetaBoxes({ location }) {
2222 - const metaBoxes2 = (0, import_data12.useSelect)(
10868 + const metaBoxes2 = (0, import_data14.useSelect)(
2223 10869 (select3) => select3(store).getMetaBoxesPerLocation(location),
2224 10870 [location]
2225 10871 );
2226 - return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
2227 - (metaBoxes2 ?? []).map(({ id }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MetaBoxVisibility, { id }, id)),
2228 - /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(meta_boxes_area_default, { location })
10872 + return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
10873 + (metaBoxes2 ?? []).map(({ id }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MetaBoxVisibility, { id }, id)),
10874 + /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(meta_boxes_area_default, { location })
2229 10875 ] });
2230 10876 }
2231 10877
2232 10878 // packages/edit-post/build-module/components/more-menu/index.mjs
2233 - var import_i18n10 = __toESM(require_i18n(), 1);
2234 - var import_compose2 = __toESM(require_compose(), 1);
2235 - var import_editor14 = __toESM(require_editor(), 1);
10879 + var import_i18n11 = __toESM(require_i18n(), 1);
10880 + var import_compose = __toESM(require_compose(), 1);
10881 + var import_editor16 = __toESM(require_editor(), 1);
2236 10882 var import_keycodes = __toESM(require_keycodes(), 1);
2237 - var import_preferences8 = __toESM(require_preferences(), 1);
2238 10883
2239 10884 // packages/edit-post/build-module/components/more-menu/manage-patterns-menu-item.mjs
2240 - var import_components5 = __toESM(require_components(), 1);
2241 - var import_core_data5 = __toESM(require_core_data(), 1);
2242 - var import_data13 = __toESM(require_data(), 1);
2243 - var import_i18n5 = __toESM(require_i18n(), 1);
2244 - var import_url3 = __toESM(require_url(), 1);
2245 - var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
10885 + var import_core_data6 = __toESM(require_core_data(), 1);
10886 + var import_data15 = __toESM(require_data(), 1);
10887 + var import_editor10 = __toESM(require_editor(), 1);
10888 + var import_i18n6 = __toESM(require_i18n(), 1);
10889 + var import_url4 = __toESM(require_url(), 1);
10890 + var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
10891 + var { MoreMenuItem } = unlock2(import_editor10.privateApis);
2246 10892 function ManagePatternsMenuItem() {
2247 - const url = (0, import_data13.useSelect)((select3) => {
2248 - const { canUser } = select3(import_core_data5.store);
2249 - const defaultUrl = (0, import_url3.addQueryArgs)("edit.php", {
10893 + const url = (0, import_data15.useSelect)((select3) => {
10894 + const { canUser } = select3(import_core_data6.store);
10895 + const defaultUrl = (0, import_url4.addQueryArgs)("edit.php", {
2250 10896 post_type: "wp_block"
2251 10897 });
2252 - const patternsUrl = (0, import_url3.addQueryArgs)("site-editor.php", {
10898 + const patternsUrl = (0, import_url4.addQueryArgs)("site-editor.php", {
2253 10899 p: "/pattern"
2254 10900 });
2255 10901 return canUser("create", {
2256 10902 kind: "postType",
@@ -2256,69 +10902,74 @@
2256 10902 kind: "postType",
2257 10903 name: "wp_template"
2258 10904 }) ? patternsUrl : defaultUrl;
2259 10905 }, []);
2260 - return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_components5.MenuItem, { role: "menuitem", href: url, children: (0, import_i18n5.__)("Manage patterns") });
10906 + return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MoreMenuItem, { href: url, children: (0, import_i18n6.__)("Manage patterns") });
2261 10907 }
2262 10908 var manage_patterns_menu_item_default = ManagePatternsMenuItem;
2263 10909
2264 10910 // packages/edit-post/build-module/components/more-menu/welcome-guide-menu-item.mjs
2265 - var import_data14 = __toESM(require_data(), 1);
2266 - var import_preferences3 = __toESM(require_preferences(), 1);
2267 - var import_i18n6 = __toESM(require_i18n(), 1);
2268 - var import_editor9 = __toESM(require_editor(), 1);
2269 - var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
10911 + var import_i18n7 = __toESM(require_i18n(), 1);
10912 + var import_data16 = __toESM(require_data(), 1);
10913 + var import_editor11 = __toESM(require_editor(), 1);
10914 + var import_preferences4 = __toESM(require_preferences(), 1);
10915 + var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
10916 + var { MoreMenuItem: MoreMenuItem2 } = unlock2(import_editor11.privateApis);
2270 10917 function WelcomeGuideMenuItem() {
2271 - const isEditingTemplate2 = (0, import_data14.useSelect)(
2272 - (select3) => select3(import_editor9.store).getCurrentPostType() === "wp_template",
10918 + const isEditingTemplate2 = (0, import_data16.useSelect)(
10919 + (select3) => select3(import_editor11.store).getCurrentPostType() === "wp_template",
2273 10920 []
2274 10921 );
2275 - return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2276 - import_preferences3.PreferenceToggleMenuItem,
10922 + const { toggle } = (0, import_data16.useDispatch)(import_preferences4.store);
10923 + return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10924 + MoreMenuItem2,
2277 10925 {
2278 - scope: "core/edit-post",
2279 - name: isEditingTemplate2 ? "welcomeGuideTemplate" : "welcomeGuide",
2280 - label: (0, import_i18n6.__)("Welcome Guide")
10926 + onClick: () => toggle(
10927 + "core/edit-post",
10928 + isEditingTemplate2 ? "welcomeGuideTemplate" : "welcomeGuide"
10929 + ),
10930 + "aria-haspopup": "dialog",
10931 + children: (0, import_i18n7.__)("Welcome Guide")
2281 10932 }
2282 10933 );
2283 10934 }
2284 10935
2285 10936 // packages/edit-post/build-module/components/preferences-modal/index.mjs
10937 + var import_i18n10 = __toESM(require_i18n(), 1);
10938 + var import_preferences8 = __toESM(require_preferences(), 1);
10939 + var import_editor15 = __toESM(require_editor(), 1);
10940 +
10941 + // packages/edit-post/build-module/components/preferences-modal/meta-boxes-section.mjs
2286 10942 var import_i18n9 = __toESM(require_i18n(), 1);
10943 + var import_data19 = __toESM(require_data(), 1);
10944 + var import_editor14 = __toESM(require_editor(), 1);
2287 10945 var import_preferences7 = __toESM(require_preferences(), 1);
2288 - var import_editor13 = __toESM(require_editor(), 1);
2289 10946
2290 - // packages/edit-post/build-module/components/preferences-modal/meta-boxes-section.mjs
10947 + // packages/edit-post/build-module/components/preferences-modal/enable-custom-fields.mjs
10948 + var import_element25 = __toESM(require_element(), 1);
2291 10949 var import_i18n8 = __toESM(require_i18n(), 1);
10950 + var import_components5 = __toESM(require_components(), 1);
2292 10951 var import_data17 = __toESM(require_data(), 1);
2293 10952 var import_editor12 = __toESM(require_editor(), 1);
2294 - var import_preferences6 = __toESM(require_preferences(), 1);
2295 -
2296 - // packages/edit-post/build-module/components/preferences-modal/enable-custom-fields.mjs
2297 - var import_element9 = __toESM(require_element(), 1);
2298 - var import_i18n7 = __toESM(require_i18n(), 1);
2299 - var import_components6 = __toESM(require_components(), 1);
2300 - var import_data15 = __toESM(require_data(), 1);
2301 - var import_editor10 = __toESM(require_editor(), 1);
2302 - var import_preferences4 = __toESM(require_preferences(), 1);
2303 - var import_url4 = __toESM(require_url(), 1);
2304 - var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
2305 - var { PreferenceBaseOption } = unlock(import_preferences4.privateApis);
10953 + var import_preferences5 = __toESM(require_preferences(), 1);
10954 + var import_url5 = __toESM(require_url(), 1);
10955 + var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
10956 + var { PreferenceBaseOption } = unlock2(import_preferences5.privateApis);
2306 10957 function submitCustomFieldsForm() {
2307 10958 const customFieldsForm = document.getElementById(
2308 10959 "toggle-custom-fields-form"
2309 10960 );
2310 - customFieldsForm.querySelector('[name="_wp_http_referer"]').setAttribute("value", (0, import_url4.getPathAndQueryString)(window.location.href));
10961 + customFieldsForm.querySelector('[name="_wp_http_referer"]').setAttribute("value", (0, import_url5.getPathAndQueryString)(window.location.href));
2311 10962 customFieldsForm.submit();
2312 10963 }
2313 10964 function CustomFieldsConfirmation({ willEnable }) {
2314 - const [isReloading, setIsReloading] = (0, import_element9.useState)(false);
2315 - return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2316 - /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "edit-post-preferences-modal__custom-fields-confirmation-message", children: (0, import_i18n7.__)(
10965 + const [isReloading, setIsReloading] = (0, import_element25.useState)(false);
10966 + return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
10967 + /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "edit-post-preferences-modal__custom-fields-confirmation-message", children: (0, import_i18n8.__)(
2317 10968 "A page reload is required for this change. Make sure your content is saved before reloading."
2318 10969 ) }),
2319 - /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2320 - import_components6.Button,
10970 + /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
10971 + import_components5.Button,
2321 10972 {
2322 10973 __next40pxDefaultSize: true,
2323 10974 variant: "secondary",
2324 10975 isBusy: isReloading,
@@ -2327,40 +10978,40 @@
2327 10978 onClick: () => {
2328 10979 setIsReloading(true);
2329 10980 submitCustomFieldsForm();
2330 10981 },
2331 - children: willEnable ? (0, import_i18n7.__)("Show & Reload Page") : (0, import_i18n7.__)("Hide & Reload Page")
10982 + children: willEnable ? (0, import_i18n8.__)("Show & Reload Page") : (0, import_i18n8.__)("Hide & Reload Page")
2332 10983 }
2333 10984 )
2334 10985 ] });
2335 10986 }
2336 10987 function EnableCustomFieldsOption({ label }) {
2337 - const areCustomFieldsEnabled = (0, import_data15.useSelect)((select3) => {
2338 - return !!select3(import_editor10.store).getEditorSettings().enableCustomFields;
10988 + const areCustomFieldsEnabled = (0, import_data17.useSelect)((select3) => {
10989 + return !!select3(import_editor12.store).getEditorSettings().enableCustomFields;
2339 10990 }, []);
2340 - const [isChecked, setIsChecked] = (0, import_element9.useState)(areCustomFieldsEnabled);
2341 - return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
10991 + const [isChecked, setIsChecked] = (0, import_element25.useState)(areCustomFieldsEnabled);
10992 + return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2342 10993 PreferenceBaseOption,
2343 10994 {
2344 10995 label,
2345 10996 isChecked,
2346 10997 onChange: setIsChecked,
2347 - children: isChecked !== areCustomFieldsEnabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CustomFieldsConfirmation, { willEnable: isChecked })
10998 + children: isChecked !== areCustomFieldsEnabled && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CustomFieldsConfirmation, { willEnable: isChecked })
2348 10999 }
2349 11000 );
2350 11001 }
2351 11002
2352 11003 // packages/edit-post/build-module/components/preferences-modal/enable-panel.mjs
2353 - var import_data16 = __toESM(require_data(), 1);
2354 - var import_editor11 = __toESM(require_editor(), 1);
2355 - var import_preferences5 = __toESM(require_preferences(), 1);
2356 - var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
2357 - var { PreferenceBaseOption: PreferenceBaseOption2 } = unlock(import_preferences5.privateApis);
11004 + var import_data18 = __toESM(require_data(), 1);
11005 + var import_editor13 = __toESM(require_editor(), 1);
11006 + var import_preferences6 = __toESM(require_preferences(), 1);
11007 + var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
11008 + var { PreferenceBaseOption: PreferenceBaseOption2 } = unlock2(import_preferences6.privateApis);
2358 11009 function EnablePanelOption(props) {
2359 - const { toggleEditorPanelEnabled: toggleEditorPanelEnabled2 } = (0, import_data16.useDispatch)(import_editor11.store);
2360 - const { isChecked, isRemoved } = (0, import_data16.useSelect)(
11010 + const { toggleEditorPanelEnabled: toggleEditorPanelEnabled2 } = (0, import_data18.useDispatch)(import_editor13.store);
11011 + const { isChecked, isRemoved } = (0, import_data18.useSelect)(
2361 11012 (select3) => {
2362 - const { isEditorPanelEnabled: isEditorPanelEnabled2, isEditorPanelRemoved: isEditorPanelRemoved2 } = select3(import_editor11.store);
11013 + const { isEditorPanelEnabled: isEditorPanelEnabled2, isEditorPanelRemoved: isEditorPanelRemoved2 } = select3(import_editor13.store);
2363 11014 return {
2364 11015 isChecked: isEditorPanelEnabled2(props.panelName),
2365 11016 isRemoved: isEditorPanelRemoved2(props.panelName)
2366 11017 };
@@ -2369,9 +11020,9 @@
2369 11020 );
2370 11021 if (isRemoved) {
2371 11022 return null;
2372 11023 }
2373 - return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
11024 + return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2374 11025 PreferenceBaseOption2,
2375 11026 {
2376 11027 isChecked,
2377 11028 onChange: () => toggleEditorPanelEnabled2(props.panelName),
@@ -2380,15 +11031,19 @@
2380 11031 );
2381 11032 }
2382 11033
2383 11034 // packages/edit-post/build-module/components/preferences-modal/meta-boxes-section.mjs
2384 - var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
2385 - var { PreferencesModalSection } = unlock(import_preferences6.privateApis);
2386 - function MetaBoxesSection({
2387 - areCustomFieldsRegistered,
2388 - metaBoxes: metaBoxes2,
2389 - ...sectionProps
2390 - }) {
11035 + var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
11036 + var { PreferencesModalSection } = unlock2(import_preferences7.privateApis);
11037 + function MetaBoxesSection(sectionProps) {
11038 + const { areCustomFieldsRegistered, metaBoxes: metaBoxes2 } = (0, import_data19.useSelect)((select3) => {
11039 + const { getEditorSettings } = select3(import_editor14.store);
11040 + const { getAllMetaBoxes: getAllMetaBoxes2 } = select3(store);
11041 + return {
11042 + areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== void 0,
11043 + metaBoxes: getAllMetaBoxes2()
11044 + };
11045 + }, []);
2391 11046 const thirdPartyMetaBoxes = metaBoxes2.filter(
2392 11047 ({ id }) => id !== "postcustom"
2393 11048 );
2394 11049 if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
@@ -2393,11 +11048,11 @@
2393 11048 );
2394 11049 if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
2395 11050 return null;
2396 11051 }
2397 - return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(PreferencesModalSection, { ...sectionProps, children: [
2398 - areCustomFieldsRegistered && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(EnableCustomFieldsOption, { label: (0, import_i18n8.__)("Custom fields") }),
2399 - thirdPartyMetaBoxes.map(({ id, title }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
11052 + return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(PreferencesModalSection, { ...sectionProps, children: [
11053 + areCustomFieldsRegistered && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(EnableCustomFieldsOption, { label: (0, import_i18n9.__)("Custom fields") }),
11054 + thirdPartyMetaBoxes.map(({ id, title }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2400 11055 EnablePanelOption,
2401 11056 {
2402 11057 label: title,
2403 11058 panelName: `meta-box-${id}`
@@ -2405,81 +11060,72 @@
2405 11060 id
2406 11061 ))
2407 11062 ] });
2408 11063 }
2409 - var meta_boxes_section_default = (0, import_data17.withSelect)((select3) => {
2410 - const { getEditorSettings } = select3(import_editor12.store);
2411 - const { getAllMetaBoxes: getAllMetaBoxes2 } = select3(store);
2412 - return {
2413 - // This setting should not live in the block editor's store.
2414 - areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== void 0,
2415 - metaBoxes: getAllMetaBoxes2()
2416 - };
2417 - })(MetaBoxesSection);
2418 11064
2419 11065 // packages/edit-post/build-module/components/preferences-modal/index.mjs
2420 - var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
2421 - var { PreferenceToggleControl } = unlock(import_preferences7.privateApis);
2422 - var { PreferencesModal } = unlock(import_editor13.privateApis);
11066 + var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
11067 + var { PreferenceToggleControl } = unlock2(import_preferences8.privateApis);
11068 + var { PreferencesModal } = unlock2(import_editor15.privateApis);
2423 11069 function EditPostPreferencesModal() {
2424 11070 const extraSections = {
2425 - general: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(meta_boxes_section_default, { title: (0, import_i18n9.__)("Advanced") }),
2426 - appearance: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
11071 + general: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MetaBoxesSection, { title: (0, import_i18n10.__)("Advanced") }),
11072 + appearance: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2427 11073 PreferenceToggleControl,
2428 11074 {
2429 11075 scope: "core/edit-post",
2430 11076 featureName: "themeStyles",
2431 - help: (0, import_i18n9.__)("Make the editor look like your theme."),
2432 - label: (0, import_i18n9.__)("Use theme styles")
11077 + help: (0, import_i18n10.__)("Make the editor look like your theme."),
11078 + label: (0, import_i18n10.__)("Use theme styles")
2433 11079 }
2434 11080 )
2435 11081 };
2436 - return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PreferencesModal, { extraSections });
11082 + return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PreferencesModal, { extraSections });
2437 11083 }
2438 11084
2439 11085 // packages/edit-post/build-module/components/more-menu/index.mjs
2440 - var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
2441 - var { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock(import_editor14.privateApis);
11086 + var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
11087 + var { MoreMenuPreferenceItem, ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock2(import_editor16.privateApis);
2442 11088 var MoreMenu = () => {
2443 - const isLargeViewport = (0, import_compose2.useViewportMatch)("large");
2444 - return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
2445 - isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ViewMoreMenuGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2446 - import_preferences8.PreferenceToggleMenuItem,
11089 + const isLargeViewport = (0, import_compose.useViewportMatch)("large");
11090 + return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
11091 + isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ViewMoreMenuGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11092 + MoreMenuPreferenceItem,
2447 11093 {
2448 11094 scope: "core/edit-post",
2449 11095 name: "fullscreenMode",
2450 - label: (0, import_i18n10.__)("Fullscreen mode"),
2451 - info: (0, import_i18n10.__)("Show and hide the admin user interface"),
2452 - messageActivated: (0, import_i18n10.__)("Fullscreen mode activated."),
2453 - messageDeactivated: (0, import_i18n10.__)(
11096 + label: (0, import_i18n11.__)("Fullscreen mode"),
11097 + info: (0, import_i18n11.__)("Show and hide the admin user interface"),
11098 + messageActivated: (0, import_i18n11.__)("Fullscreen mode activated."),
11099 + messageDeactivated: (0, import_i18n11.__)(
2454 11100 "Fullscreen mode deactivated."
2455 11101 ),
2456 - shortcut: import_keycodes.displayShortcut.secondary("f")
11102 + shortcut: import_keycodes.keyboardShortcut.secondary("f")
2457 11103 }
2458 11104 ) }),
2459 - /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ToolsMoreMenuGroup, { children: [
2460 - /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(manage_patterns_menu_item_default, {}),
2461 - /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(WelcomeGuideMenuItem, {})
11105 + /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ToolsMoreMenuGroup, { children: [
11106 + /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(manage_patterns_menu_item_default, {}),
11107 + /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WelcomeGuideMenuItem, {})
2462 11108 ] }),
2463 - /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EditPostPreferencesModal, {})
11109 + /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(EditPostPreferencesModal, {})
2464 11110 ] });
2465 11111 };
2466 11112 var more_menu_default = MoreMenu;
2467 11113
2468 11114 // packages/edit-post/build-module/components/welcome-guide/index.mjs
2469 - var import_data20 = __toESM(require_data(), 1);
11115 + var import_data22 = __toESM(require_data(), 1);
2470 11116
2471 11117 // packages/edit-post/build-module/components/welcome-guide/default.mjs
2472 - var import_data18 = __toESM(require_data(), 1);
2473 - var import_components7 = __toESM(require_components(), 1);
2474 - var import_i18n11 = __toESM(require_i18n(), 1);
2475 - var import_element10 = __toESM(require_element(), 1);
11118 + var import_data20 = __toESM(require_data(), 1);
11119 + var import_components6 = __toESM(require_components(), 1);
11120 + var import_i18n12 = __toESM(require_i18n(), 1);
11121 + var import_element26 = __toESM(require_element(), 1);
2476 11122
2477 11123 // packages/edit-post/build-module/components/welcome-guide/image.mjs
2478 - var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
11124 + var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
2479 11125 function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) {
2480 - return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("picture", { className: "edit-post-welcome-guide__image", children: [
2481 - /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
11126 + return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("picture", { className: "edit-post-welcome-guide__image", children: [
11127 + /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2482 11128 "source",
2483 11129 {
2484 11130 srcSet: nonAnimatedSrc,
2485 11131 media: "(prefers-reduced-motion: reduce)"
@@ -2484,26 +11130,26 @@
2484 11130 srcSet: nonAnimatedSrc,
2485 11131 media: "(prefers-reduced-motion: reduce)"
2486 11132 }
2487 11133 ),
2488 - /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" })
11134 + /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" })
2489 11135 ] });
2490 11136 }
2491 11137
2492 11138 // packages/edit-post/build-module/components/welcome-guide/default.mjs
2493 - var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
11139 + var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
2494 11140 function WelcomeGuideDefault() {
2495 - const { toggleFeature: toggleFeature2 } = (0, import_data18.useDispatch)(store);
2496 - return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2497 - import_components7.Guide,
11141 + const { toggleFeature: toggleFeature2 } = (0, import_data20.useDispatch)(store);
11142 + return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
11143 + import_components6.Guide,
2498 11144 {
2499 11145 className: "edit-post-welcome-guide",
2500 - contentLabel: (0, import_i18n11.__)("Welcome to the editor"),
2501 - finishButtonText: (0, import_i18n11.__)("Get started"),
11146 + contentLabel: (0, import_i18n12.__)("Welcome to the editor"),
11147 + finishButtonText: (0, import_i18n12.__)("Get started"),
2502 11148 onFinish: () => toggleFeature2("welcomeGuide"),
2503 11149 pages: [
2504 11150 {
2505 - image: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11151 + image: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2506 11152 WelcomeGuideImage,
2507 11153 {
2508 11154 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
2509 11155 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
@@ -2508,17 +11154,17 @@
2508 11154 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
2509 11155 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
2510 11156 }
2511 11157 ),
2512 - content: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2513 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Welcome to the editor") }),
2514 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n11.__)(
11158 + content: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
11159 + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Welcome to the editor") }),
11160 + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n12.__)(
2515 11161 "In the WordPress editor, each paragraph, image, or video is presented as a distinct \u201Cblock\u201D of content."
2516 11162 ) })
2517 11163 ] })
2518 11164 },
2519 11165 {
2520 - image: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11166 + image: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2521 11167 WelcomeGuideImage,
2522 11168 {
2523 11169 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg",
2524 11170 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif"
@@ -2523,17 +11169,17 @@
2523 11169 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg",
2524 11170 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif"
2525 11171 }
2526 11172 ),
2527 - content: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2528 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Customize each block") }),
2529 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n11.__)(
11173 + content: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
11174 + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Customize each block") }),
11175 + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n12.__)(
2530 11176 "Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected."
2531 11177 ) })
2532 11178 ] })
2533 11179 },
2534 11180 {
2535 - image: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11181 + image: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2536 11182 WelcomeGuideImage,
2537 11183 {
2538 11184 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg",
2539 11185 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif"
@@ -2538,19 +11184,19 @@
2538 11184 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg",
2539 11185 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif"
2540 11186 }
2541 11187 ),
2542 - content: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2543 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Explore all blocks") }),
2544 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element10.createInterpolateElement)(
2545 - (0, import_i18n11.__)(
11188 + content: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
11189 + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Explore all blocks") }),
11190 + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element26.createInterpolateElement)(
11191 + (0, import_i18n12.__)(
2546 11192 "All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon."
2547 11193 ),
2548 11194 {
2549 - InserterIconImage: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11195 + InserterIconImage: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2550 11196 "img",
2551 11197 {
2552 - alt: (0, import_i18n11.__)("inserter"),
11198 + alt: (0, import_i18n12.__)("inserter"),
2553 11199 src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
2554 11200 }
2555 11201 )
2556 11202 }
@@ -2557,9 +11203,9 @@
2557 11203 ) })
2558 11204 ] })
2559 11205 },
2560 11206 {
2561 - image: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11207 + image: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2562 11208 WelcomeGuideImage,
2563 11209 {
2564 11210 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
2565 11211 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
@@ -2564,19 +11210,19 @@
2564 11210 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
2565 11211 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
2566 11212 }
2567 11213 ),
2568 - content: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2569 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Learn more") }),
2570 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element10.createInterpolateElement)(
2571 - (0, import_i18n11.__)(
11214 + content: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
11215 + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Learn more") }),
11216 + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element26.createInterpolateElement)(
11217 + (0, import_i18n12.__)(
2572 11218 "New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"
2573 11219 ),
2574 11220 {
2575 - a: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2576 - import_components7.ExternalLink,
11221 + a: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
11222 + import_components6.ExternalLink,
2577 11223 {
2578 - href: (0, import_i18n11.__)(
11224 + href: (0, import_i18n12.__)(
2579 11225 "https://wordpress.org/documentation/article/wordpress-block-editor/"
2580 11226 )
2581 11227 }
2582 11228 )
@@ -2589,24 +11235,24 @@
2589 11235 );
2590 11236 }
2591 11237
2592 11238 // packages/edit-post/build-module/components/welcome-guide/template.mjs
2593 - var import_data19 = __toESM(require_data(), 1);
2594 - var import_components8 = __toESM(require_components(), 1);
2595 - var import_i18n12 = __toESM(require_i18n(), 1);
2596 - var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
11239 + var import_data21 = __toESM(require_data(), 1);
11240 + var import_components7 = __toESM(require_components(), 1);
11241 + var import_i18n13 = __toESM(require_i18n(), 1);
11242 + var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
2597 11243 function WelcomeGuideTemplate() {
2598 - const { toggleFeature: toggleFeature2 } = (0, import_data19.useDispatch)(store);
2599 - return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2600 - import_components8.Guide,
11244 + const { toggleFeature: toggleFeature2 } = (0, import_data21.useDispatch)(store);
11245 + return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11246 + import_components7.Guide,
2601 11247 {
2602 11248 className: "edit-template-welcome-guide",
2603 - contentLabel: (0, import_i18n12.__)("Welcome to the template editor"),
2604 - finishButtonText: (0, import_i18n12.__)("Get started"),
11249 + contentLabel: (0, import_i18n13.__)("Welcome to the template editor"),
11250 + finishButtonText: (0, import_i18n13.__)("Get started"),
2605 11251 onFinish: () => toggleFeature2("welcomeGuideTemplate"),
2606 11252 pages: [
2607 11253 {
2608 - image: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11254 + image: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2609 11255 WelcomeGuideImage,
2610 11256 {
2611 11257 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg",
2612 11258 animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif"
@@ -2611,11 +11257,11 @@
2611 11257 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg",
2612 11258 animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif"
2613 11259 }
2614 11260 ),
2615 - content: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
2616 - /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Welcome to the template editor") }),
2617 - /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n12.__)(
11261 + content: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
11262 + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n13.__)("Welcome to the template editor") }),
11263 + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n13.__)(
2618 11264 "Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor."
2619 11265 ) })
2620 11266 ] })
2621 11267 }
@@ -2624,11 +11270,11 @@
2624 11270 );
2625 11271 }
2626 11272
2627 11273 // packages/edit-post/build-module/components/welcome-guide/index.mjs
2628 - var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
11274 + var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
2629 11275 function WelcomeGuide({ postType }) {
2630 - const { isActive, isEditingTemplate: isEditingTemplate2 } = (0, import_data20.useSelect)(
11276 + const { isActive, isEditingTemplate: isEditingTemplate2 } = (0, import_data22.useSelect)(
2631 11277 (select3) => {
2632 11278 const { isFeatureActive: isFeatureActive2 } = select3(store);
2633 11279 const _isEditingTemplate = postType === "wp_template";
2634 11280 const feature = _isEditingTemplate ? "welcomeGuideTemplate" : "welcomeGuide";
@@ -2641,29 +11287,29 @@
2641 11287 );
2642 11288 if (!isActive) {
2643 11289 return null;
2644 11290 }
2645 - return isEditingTemplate2 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WelcomeGuideTemplate, {}) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WelcomeGuideDefault, {});
11291 + return isEditingTemplate2 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(WelcomeGuideTemplate, {}) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(WelcomeGuideDefault, {});
2646 11292 }
2647 11293
2648 11294 // packages/edit-post/build-module/commands/use-commands.mjs
2649 - var import_data21 = __toESM(require_data(), 1);
2650 - var import_i18n13 = __toESM(require_i18n(), 1);
11295 + var import_data23 = __toESM(require_data(), 1);
11296 + var import_i18n14 = __toESM(require_i18n(), 1);
2651 11297 var import_commands = __toESM(require_commands(), 1);
2652 11298 var import_preferences9 = __toESM(require_preferences(), 1);
2653 11299 var import_notices2 = __toESM(require_notices(), 1);
2654 11300 function useCommands() {
2655 - const { isFullscreen } = (0, import_data21.useSelect)((select3) => {
11301 + const { isFullscreen } = (0, import_data23.useSelect)((select3) => {
2656 11302 const { get } = select3(import_preferences9.store);
2657 11303 return {
2658 11304 isFullscreen: get("core/edit-post", "fullscreenMode")
2659 11305 };
2660 11306 }, []);
2661 - const { toggle } = (0, import_data21.useDispatch)(import_preferences9.store);
2662 - const { createInfoNotice } = (0, import_data21.useDispatch)(import_notices2.store);
11307 + const { toggle } = (0, import_data23.useDispatch)(import_preferences9.store);
11308 + const { createInfoNotice } = (0, import_data23.useDispatch)(import_notices2.store);
2663 11309 (0, import_commands.useCommand)({
2664 11310 name: "core/toggle-fullscreen-mode",
2665 - label: isFullscreen ? (0, import_i18n13.__)("Exit fullscreen") : (0, import_i18n13.__)("Enter fullscreen"),
11311 + label: isFullscreen ? (0, import_i18n14.__)("Exit fullscreen") : (0, import_i18n14.__)("Enter fullscreen"),
2666 11312 icon: fullscreen_default,
2667 11313 category: "command",
2668 11314 callback: ({ close }) => {
2669 11315 toggle("core/edit-post", "fullscreenMode");
@@ -2668,15 +11314,15 @@
2668 11314 callback: ({ close }) => {
2669 11315 toggle("core/edit-post", "fullscreenMode");
2670 11316 close();
2671 11317 createInfoNotice(
2672 - isFullscreen ? (0, import_i18n13.__)("Fullscreen off.") : (0, import_i18n13.__)("Fullscreen on."),
11318 + isFullscreen ? (0, import_i18n14.__)("Fullscreen off.") : (0, import_i18n14.__)("Fullscreen on."),
2673 11319 {
2674 11320 id: "core/edit-post/toggle-fullscreen-mode/notice",
2675 11321 type: "snackbar",
2676 11322 actions: [
2677 11323 {
2678 - label: (0, import_i18n13.__)("Undo"),
11324 + label: (0, import_i18n14.__)("Undo"),
2679 11325 onClick: () => {
2680 11326 toggle("core/edit-post", "fullscreenMode");
2681 11327 }
2682 11328 }
@@ -2686,44 +11332,16 @@
2686 11332 }
2687 11333 });
2688 11334 }
2689 11335
2690 - // packages/edit-post/build-module/components/layout/use-should-iframe.mjs
2691 - var import_editor15 = __toESM(require_editor(), 1);
2692 - var import_data22 = __toESM(require_data(), 1);
2693 - var import_blocks2 = __toESM(require_blocks(), 1);
2694 - var import_block_editor = __toESM(require_block_editor(), 1);
2695 - var isGutenbergPlugin = true ? true : false;
2696 - function useShouldIframe() {
2697 - return (0, import_data22.useSelect)((select3) => {
2698 - const { getCurrentPostType, getDeviceType } = select3(import_editor15.store);
2699 - const { getClientIdsWithDescendants, getBlockName } = select3(import_block_editor.store);
2700 - const { getBlockType } = select3(import_blocks2.store);
2701 - return (
2702 - // If the Gutenberg plugin is active, we ALWAYS use the iframe for
2703 - // consistency across the post and site editor. We plan on enforcing
2704 - // the iframe in the future, so Gutenberg both serves as way for us
2705 - // to warn plugin developers and for plugin developers to test their
2706 - // blocks easily. Before GB v22.5, we only enforced it for
2707 - // block-based themes (classic themes used the same rules as core).
2708 - isGutenbergPlugin || // We also still want to iframe all the special
2709 - // editor features and modes such as device previews, zoom out, and
2710 - // template/pattern editing.
2711 - getDeviceType() !== "Desktop" || ["wp_template", "wp_block"].includes(getCurrentPostType()) || unlock(select3(import_block_editor.store)).isZoomOut() || // Finally, still iframe the editor if all present blocks are v3
2712 - // (which means they are marked as iframe-compatible).
2713 - [...new Set(getClientIdsWithDescendants().map(getBlockName))].map(getBlockType).filter(Boolean).every((blockType) => blockType.apiVersion >= 3)
2714 - );
2715 - }, []);
2716 - }
2717 -
2718 11336 // packages/edit-post/build-module/hooks/use-navigate-to-entity-record.mjs
2719 - var import_element11 = __toESM(require_element(), 1);
2720 - var import_data23 = __toESM(require_data(), 1);
2721 - var import_editor16 = __toESM(require_editor(), 1);
2722 - var import_core_data6 = __toESM(require_core_data(), 1);
11337 + var import_element27 = __toESM(require_element(), 1);
11338 + var import_data24 = __toESM(require_data(), 1);
11339 + var import_editor17 = __toESM(require_editor(), 1);
11340 + var import_core_data7 = __toESM(require_core_data(), 1);
2723 11341 function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) {
2724 - const registry = (0, import_data23.useRegistry)();
2725 - const [postHistory, dispatch2] = (0, import_element11.useReducer)(
11342 + const registry = (0, import_data24.useRegistry)();
11343 + const [postHistory, dispatch2] = (0, import_element27.useReducer)(
2726 11344 (historyState, { type, post: post2, previousRenderingMode: previousRenderingMode2, selectedBlockClientId }) => {
2727 11345 if (type === "push") {
2728 11346 const updatedHistory = [...historyState];
2729 11347 const currentIndex = updatedHistory.length - 1;
@@ -2746,14 +11364,14 @@
2746 11364 }
2747 11365 ]
2748 11366 );
2749 11367 const { post, previousRenderingMode } = postHistory[postHistory.length - 1];
2750 - const { getRenderingMode } = (0, import_data23.useSelect)(import_editor16.store);
2751 - const { setRenderingMode } = (0, import_data23.useDispatch)(import_editor16.store);
2752 - const { editEntityRecord } = (0, import_data23.useDispatch)(import_core_data6.store);
2753 - const onNavigateToEntityRecord = (0, import_element11.useCallback)(
11368 + const { getRenderingMode } = (0, import_data24.useSelect)(import_editor17.store);
11369 + const { setRenderingMode } = (0, import_data24.useDispatch)(import_editor17.store);
11370 + const { editEntityRecord } = (0, import_data24.useDispatch)(import_core_data7.store);
11371 + const onNavigateToEntityRecord = (0, import_element27.useCallback)(
2754 11372 (params) => {
2755 - const entityEdits = registry.select(import_core_data6.store).getEntityRecordEdits("postType", post.postType, post.postId);
11373 + const entityEdits = registry.select(import_core_data7.store).getEntityRecordEdits("postType", post.postType, post.postId);
2756 11374 const externalClientId = entityEdits?.selection?.selectionStart?.clientId ?? null;
2757 11375 dispatch2({
2758 11376 type: "push",
2759 11377 post: { postId: params.postId, postType: params.postType },
@@ -2771,9 +11389,9 @@
2771 11389 setRenderingMode,
2772 11390 defaultRenderingMode
2773 11391 ]
2774 11392 );
2775 - const onNavigateToPreviousEntityRecord = (0, import_element11.useCallback)(() => {
11393 + const onNavigateToPreviousEntityRecord = (0, import_element27.useCallback)(() => {
2776 11394 if (postHistory.length > 1) {
2777 11395 const previousItem = postHistory[postHistory.length - 2];
2778 11396 if (previousItem.selectedBlockClientId) {
2779 11397 editEntityRecord(
@@ -2813,33 +11431,45 @@
2813 11431 };
2814 11432 }
2815 11433
2816 11434 // packages/edit-post/build-module/components/meta-boxes/use-meta-box-initialization.mjs
2817 - var import_data24 = __toESM(require_data(), 1);
2818 - var import_editor17 = __toESM(require_editor(), 1);
2819 - var import_core_data7 = __toESM(require_core_data(), 1);
2820 - var import_element12 = __toESM(require_element(), 1);
11435 + var import_data25 = __toESM(require_data(), 1);
11436 + var import_editor18 = __toESM(require_editor(), 1);
11437 + var import_core_data8 = __toESM(require_core_data(), 1);
11438 + var import_element28 = __toESM(require_element(), 1);
2821 11439 var useMetaBoxInitialization = (enabled) => {
2822 11440 const {
2823 11441 isEnabledAndEditorReady,
2824 11442 isCollaborationEnabled,
2825 - hasIncompatibleMetaBoxes
2826 - } = (0, import_data24.useSelect)(
2827 - (select3) => ({
2828 - isEnabledAndEditorReady: enabled && select3(import_editor17.store).__unstableIsEditorReady(),
2829 - isCollaborationEnabled: select3(import_editor17.store).isCollaborationEnabledForCurrentPost(),
2830 - hasIncompatibleMetaBoxes: enabled ? select3(store).getAllMetaBoxes().some((metaBox) => !metaBox.__rtc_compatible) : false
2831 - }),
11443 + hasIncompatibleMetaBoxes,
11444 + hasActiveMetaBoxes
11445 + } = (0, import_data25.useSelect)(
11446 + (select3) => {
11447 + const {
11448 + __unstableIsEditorReady,
11449 + isCollaborationEnabledForCurrentPost
11450 + } = unlock2(select3(import_editor18.store));
11451 + return {
11452 + isEnabledAndEditorReady: enabled && __unstableIsEditorReady(),
11453 + isCollaborationEnabled: isCollaborationEnabledForCurrentPost(),
11454 + hasIncompatibleMetaBoxes: enabled ? select3(store).getAllMetaBoxes().some((metaBox) => !metaBox.__rtc_compatible) : false,
11455 + hasActiveMetaBoxes: enabled && select3(store).hasMetaBoxes()
11456 + };
11457 + },
2832 11458 [enabled]
2833 11459 );
2834 - const { setCollaborationSupported } = unlock((0, import_data24.useDispatch)(import_core_data7.store));
2835 - const { initializeMetaBoxes: initializeMetaBoxes2 } = (0, import_data24.useDispatch)(store);
2836 - (0, import_element12.useEffect)(() => {
11460 + const { setCollaborationSupported } = unlock2((0, import_data25.useDispatch)(import_core_data8.store));
11461 + const { updateEditorSettings } = (0, import_data25.useDispatch)(import_editor18.store);
11462 + const { initializeMetaBoxes: initializeMetaBoxes2 } = (0, import_data25.useDispatch)(store);
11463 + (0, import_element28.useEffect)(() => {
2837 11464 if (isEnabledAndEditorReady) {
2838 11465 initializeMetaBoxes2();
2839 11466 if (isCollaborationEnabled && hasIncompatibleMetaBoxes) {
2840 11467 setCollaborationSupported(false);
2841 11468 }
11469 + if (hasActiveMetaBoxes) {
11470 + updateEditorSettings({ disableVisualRevisions: true });
11471 + }
2842 11472 }
2843 11473 }, [
2844 11474 isEnabledAndEditorReady,
2845 11475 initializeMetaBoxes2,
@@ -2844,18 +11474,19 @@
2844 11474 isEnabledAndEditorReady,
2845 11475 initializeMetaBoxes2,
2846 11476 isCollaborationEnabled,
2847 11477 setCollaborationSupported,
2848 - hasIncompatibleMetaBoxes
11478 + hasIncompatibleMetaBoxes,
11479 + hasActiveMetaBoxes,
11480 + updateEditorSettings
2849 11481 ]);
2850 11482 };
2851 11483
2852 11484 // packages/edit-post/build-module/components/layout/index.mjs
2853 - var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
2854 - var { useCommandContext } = unlock(import_commands2.privateApis);
2855 - var { useDrag } = unlock(import_components9.privateApis);
2856 - var { Editor, FullscreenMode } = unlock(import_editor18.privateApis);
2857 - var { BlockKeyboardShortcuts } = unlock(import_block_library.privateApis);
11485 + var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
11486 + var { useCommandContext } = unlock2(import_commands2.privateApis);
11487 + var { useDrag } = unlock2(import_components8.privateApis);
11488 + var { Editor, FullscreenMode, UploadProgressSnackbar } = unlock2(import_editor19.privateApis);
2858 11489 var DESIGN_POST_TYPES = [
2859 11490 "wp_template",
2860 11491 "wp_template_part",
2861 11492 "wp_block",
@@ -2861,14 +11492,14 @@
2861 11492 "wp_block",
2862 11493 "wp_navigation"
2863 11494 ];
2864 11495 function useEditorStyles(settings) {
2865 - const { hasThemeStyleSupport } = (0, import_data25.useSelect)((select3) => {
11496 + const { hasThemeStyleSupport } = (0, import_data26.useSelect)((select3) => {
2866 11497 return {
2867 11498 hasThemeStyleSupport: select3(store).isFeatureActive("themeStyles")
2868 11499 };
2869 11500 }, []);
2870 - return (0, import_element13.useMemo)(() => {
11501 + return (0, import_element29.useMemo)(() => {
2871 11502 const presetStyles = settings.styles?.filter(
2872 11503 (style) => style.__unstableType && style.__unstableType !== "theme"
2873 11504 ) ?? [];
2874 11505 const defaultEditorStyles = [
@@ -2894,10 +11525,10 @@
2894 11525 settings.styles,
2895 11526 hasThemeStyleSupport
2896 11527 ]);
2897 11528 }
2898 - function MetaBoxesMain({ isLegacy }) {
2899 - const [isOpen, openHeight, hasAnyVisible] = (0, import_data25.useSelect)((select3) => {
11529 + function MetaBoxesMain() {
11530 + const [isOpen, openHeight, hasAnyVisible] = (0, import_data26.useSelect)((select3) => {
2900 11531 const { get } = select3(import_preferences10.store);
2901 11532 const { isMetaBoxLocationVisible: isMetaBoxLocationVisible2 } = select3(store);
2902 11533 return [
2903 11534 !!get("core/edit-post", "metaBoxesMainIsOpen"),
@@ -2904,12 +11535,12 @@
2904 11535 get("core/edit-post", "metaBoxesMainOpenHeight"),
2905 11536 isMetaBoxLocationVisible2("normal") || isMetaBoxLocationVisible2("advanced") || isMetaBoxLocationVisible2("side")
2906 11537 ];
2907 11538 }, []);
2908 - const { set: setPreference } = (0, import_data25.useDispatch)(import_preferences10.store);
2909 - const isShort = (0, import_compose3.useMediaQuery)("(max-height: 549px)");
2910 - const [{ min = 0, max }, setHeightConstraints] = (0, import_element13.useState)(() => ({}));
2911 - const effectSizeConstraints = (0, import_compose3.useRefEffect)((node) => {
11539 + const { set: setPreference } = (0, import_data26.useDispatch)(import_preferences10.store);
11540 + const isShort = (0, import_compose2.useMediaQuery)("(max-height: 549px)");
11541 + const [{ min: min2 = 0, max: max2 }, setHeightConstraints] = (0, import_element29.useState)(() => ({}));
11542 + const effectSizeConstraints = (0, import_compose2.useRefEffect)((node) => {
2912 11543 const container = node.closest(
2913 11544 ".interface-interface-skeleton__content"
2914 11545 );
2915 11546 if (!container) {
@@ -2914,11 +11545,9 @@
2914 11545 );
2915 11546 if (!container) {
2916 11547 return;
2917 11548 }
2918 - const noticeLists = container.querySelectorAll(
2919 - ":scope > .components-notice-list"
2920 - );
11549 + const noticeContainer = container.querySelector(".editor-notices");
2921 11550 const resizeHandle = container.querySelector(
2922 11551 ".edit-post-meta-boxes-main__presenter"
2923 11552 );
2924 11553 const deriveConstraints = () => {
@@ -2923,29 +11552,31 @@
2923 11552 );
2924 11553 const deriveConstraints = () => {
2925 11554 const fullHeight = container.offsetHeight;
2926 11555 let nextMax = fullHeight;
2927 - for (const element of noticeLists) {
2928 - nextMax -= element.offsetHeight;
11556 + if (noticeContainer) {
11557 + nextMax -= noticeContainer.offsetHeight;
2929 11558 }
2930 - const nextMin = resizeHandle.offsetHeight;
11559 + const nextMin = resizeHandle?.offsetHeight ?? 0;
2931 11560 setHeightConstraints({ min: nextMin, max: nextMax });
2932 11561 };
2933 11562 const observer = new window.ResizeObserver(deriveConstraints);
2934 11563 observer.observe(container);
2935 - for (const element of noticeLists) {
2936 - observer.observe(element);
11564 + if (noticeContainer) {
11565 + observer.observe(noticeContainer);
2937 11566 }
2938 11567 return () => observer.disconnect();
2939 11568 }, []);
2940 - const metaBoxesMainRef = (0, import_element13.useRef)();
2941 - const setMainRefs = (0, import_compose3.useMergeRefs)([
11569 + const metaBoxesMainRef = (0, import_element29.useRef)();
11570 + const setMainRefs = (0, import_compose2.useMergeRefs)([
2942 11571 metaBoxesMainRef,
2943 11572 effectSizeConstraints
2944 11573 ]);
2945 - const separatorRef = (0, import_element13.useRef)();
2946 - const separatorHelpId = (0, import_element13.useId)();
2947 - const heightRef = (0, import_element13.useRef)();
11574 + const separatorRef = (0, import_element29.useRef)();
11575 + const separatorHelpId = (0, import_element29.useId)();
11576 + const heightRef = (0, import_element29.useRef)();
11577 + const getAriaValueNow = (height) => Math.round((height - min2) / (max2 - min2) * 100);
11578 + const persistIsOpen = (to = !isOpen) => setPreference("core/edit-post", "metaBoxesMainIsOpen", to);
2948 11579 const applyHeight = (candidateHeight = "auto", isPersistent) => {
2949 11580 let styleHeight;
2950 11581 if (candidateHeight === "auto") {
2951 11582 isPersistent = false;
@@ -2950,9 +11581,9 @@
2950 11581 if (candidateHeight === "auto") {
2951 11582 isPersistent = false;
2952 11583 styleHeight = candidateHeight;
2953 11584 } else {
2954 - candidateHeight = Math.min(max, Math.max(min, candidateHeight));
11585 + candidateHeight = Math.min(max2, Math.max(min2, candidateHeight));
2955 11586 heightRef.current = candidateHeight;
2956 11587 styleHeight = `${candidateHeight}px`;
2957 11588 }
2958 11589 if (isPersistent) {
@@ -2975,13 +11606,13 @@
2975 11606 if (first) {
2976 11607 pane.classList.add("is-resizing");
2977 11608 let fromHeight = heightRef.current ?? pane.offsetHeight;
2978 11609 if (isOpen) {
2979 - if (fromHeight > max) {
2980 - fromHeight = max;
11610 + if (fromHeight > max2) {
11611 + fromHeight = max2;
2981 11612 }
2982 11613 } else {
2983 - fromHeight = min;
11614 + fromHeight = min2;
2984 11615 }
2985 11616 applyHeight(fromHeight - yMovement);
2986 11617 return { fromHeight };
2987 11618 }
@@ -2994,9 +11625,9 @@
2994 11625 const [onTap] = args;
2995 11626 onTap?.();
2996 11627 return;
2997 11628 }
2998 - const nextIsOpen = heightRef.current > min;
11629 + const nextIsOpen = heightRef.current > min2;
2999 11630 persistIsOpen(nextIsOpen);
3000 11631 applyHeight(heightRef.current, nextIsOpen);
3001 11632 },
3002 11633 { keyboardDisplacement: 20, filterTaps: true }
@@ -3003,30 +11634,25 @@
3003 11634 );
3004 11635 if (!hasAnyVisible) {
3005 11636 return;
3006 11637 }
3007 - const contents = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
11638 + const contents = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
3008 11639 "div",
3009 11640 {
3010 11641 className: "edit-post-layout__metaboxes edit-post-meta-boxes-main__liner",
3011 - hidden: !isLegacy && !isOpen,
11642 + hidden: !isOpen,
3012 11643 children: [
3013 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MetaBoxes, { location: "normal" }),
3014 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MetaBoxes, { location: "advanced" })
11644 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MetaBoxes, { location: "normal" }),
11645 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MetaBoxes, { location: "advanced" })
3015 11646 ]
3016 11647 }
3017 11648 );
3018 - if (isLegacy) {
3019 - return contents;
3020 - }
3021 11649 const isAutoHeight = openHeight === void 0;
3022 11650 const usedOpenHeight = isShort ? "auto" : openHeight;
3023 - const usedHeight = isOpen ? usedOpenHeight : min;
3024 - const getAriaValueNow = (height) => Math.round((height - min) / (max - min) * 100);
3025 - const usedAriaValueNow = max === void 0 || isAutoHeight ? 50 : getAriaValueNow(usedHeight);
3026 - const persistIsOpen = (to = !isOpen) => setPreference("core/edit-post", "metaBoxesMainIsOpen", to);
3027 - const paneLabel = (0, import_i18n14.__)("Meta Boxes");
3028 - const toggle = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
11651 + const usedHeight = isOpen ? usedOpenHeight : min2;
11652 + const usedAriaValueNow = max2 === void 0 || isAutoHeight ? 50 : getAriaValueNow(usedHeight);
11653 + const paneLabel = (0, import_i18n15.__)("Meta Boxes");
11654 + const toggle = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
3029 11655 "button",
3030 11656 {
3031 11657 "aria-expanded": isOpen,
3032 11658 onClick: ({ detail }) => {
@@ -3036,29 +11662,37 @@
3036 11662 },
3037 11663 ...!isShort && bindDragGesture(persistIsOpen),
3038 11664 children: [
3039 11665 paneLabel,
3040 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Icon, { icon: isOpen ? chevron_up_default : chevron_down_default })
11666 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components8.Icon, { icon: isOpen ? chevron_up_default : chevron_down_default })
3041 11667 ]
3042 11668 }
3043 11669 );
3044 - const separator = !isShort && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
3045 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Tooltip, { text: (0, import_i18n14.__)("Drag to resize"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3046 - "button",
3047 - {
3048 - ref: separatorRef,
3049 - role: "separator",
3050 - "aria-valuenow": usedAriaValueNow,
3051 - "aria-label": (0, import_i18n14.__)("Drag to resize"),
3052 - "aria-describedby": separatorHelpId,
3053 - ...bindDragGesture()
3054 - }
3055 - ) }),
3056 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(VisuallyHidden, { id: separatorHelpId, children: (0, import_i18n14.__)(
11670 + const separator = !isShort && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
11671 + /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(tooltip_exports.Root, { children: [
11672 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11673 + tooltip_exports.Trigger,
11674 + {
11675 + render: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11676 + "button",
11677 + {
11678 + ref: separatorRef,
11679 + role: "separator",
11680 + "aria-valuenow": usedAriaValueNow,
11681 + "aria-label": (0, import_i18n15.__)("Drag to resize"),
11682 + "aria-describedby": separatorHelpId,
11683 + ...bindDragGesture()
11684 + }
11685 + )
11686 + }
11687 + ),
11688 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(tooltip_exports.Popup, { children: (0, import_i18n15.__)("Drag to resize") })
11689 + ] }),
11690 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(VisuallyHidden, { id: separatorHelpId, children: (0, import_i18n15.__)(
3057 11691 "Use up and down arrow keys to resize the meta box pane."
3058 11692 ) })
3059 11693 ] });
3060 - return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
11694 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
3061 11695 navigable_region_default,
3062 11696 {
3063 11697 ariaLabel: paneLabel,
3064 11698 ref: setMainRefs,
@@ -3067,9 +11701,9 @@
3067 11701 !isShort && "is-resizable"
3068 11702 ),
3069 11703 style: { height: usedHeight },
3070 11704 children: [
3071 - /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "edit-post-meta-boxes-main__presenter", children: [
11705 + /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "edit-post-meta-boxes-main__presenter", children: [
3072 11706 toggle,
3073 11707 separator
3074 11708 ] }),
3075 11709 contents
@@ -3083,10 +11717,9 @@
3083 11717 settings,
3084 11718 initialEdits
3085 11719 }) {
3086 11720 useCommands();
3087 - const shouldIframe = useShouldIframe();
3088 - const { createErrorNotice } = (0, import_data25.useDispatch)(import_notices3.store);
11721 + const { createErrorNotice } = (0, import_data26.useDispatch)(import_notices3.store);
3089 11722 const {
3090 11723 currentPost: { postId: currentPostId, postType: currentPostType },
3091 11724 onNavigateToEntityRecord,
3092 11725 onNavigateToPreviousEntityRecord
@@ -3105,16 +11738,15 @@
3105 11738 showIconLabels,
3106 11739 isDistractionFree,
3107 11740 showMetaBoxes,
3108 11741 isWelcomeGuideVisible,
3109 - templateId,
3110 - isDevicePreview
3111 - } = (0, import_data25.useSelect)(
11742 + templateId
11743 + } = (0, import_data26.useSelect)(
3112 11744 (select3) => {
3113 11745 const { get } = select3(import_preferences10.store);
3114 11746 const { isFeatureActive: isFeatureActive2, hasMetaBoxes: hasMetaBoxes2 } = select3(store);
3115 - const { canUser, getPostType, getTemplateId } = unlock(
3116 - select3(import_core_data8.store)
11747 + const { canUser, getPostType, getTemplateId } = unlock2(
11748 + select3(import_core_data9.store)
3117 11749 );
3118 11750 const supportsTemplateMode = settings.supportsTemplateMode;
3119 11751 const isViewable = getPostType(currentPostType)?.viewable ?? false;
3120 11752 const canViewTemplate = canUser("read", {
@@ -3120,12 +11752,14 @@
3120 11752 const canViewTemplate = canUser("read", {
3121 11753 kind: "postType",
3122 11754 name: "wp_template"
3123 11755 });
3124 - const { getBlockSelectionStart, isZoomOut } = unlock(
11756 + const { getBlockSelectionStart, isZoomOut } = unlock2(
3125 11757 select3(import_block_editor2.store)
3126 11758 );
3127 - const { getEditorMode: getEditorMode2, getDefaultRenderingMode, getDeviceType } = unlock(select3(import_editor18.store));
11759 + const { getEditorMode: getEditorMode2, getDefaultRenderingMode } = unlock2(
11760 + select3(import_editor19.store)
11761 + );
3128 11762 const isNotDesignPostType = !DESIGN_POST_TYPES.includes(currentPostType);
3129 11763 const isDirectlyEditingPattern = currentPostType === "wp_block" && !onNavigateToPreviousEntityRecord;
3130 11764 const _templateId = getTemplateId(currentPostType, currentPostId);
3131 11765 const defaultMode = getDefaultRenderingMode(currentPostType);
@@ -3138,10 +11772,9 @@
3138 11772 showIconLabels: get("core", "showIconLabels"),
3139 11773 isDistractionFree: get("core", "distractionFree"),
3140 11774 showMetaBoxes: isNotDesignPostType && !isZoomOut() || isDirectlyEditingPattern,
3141 11775 isWelcomeGuideVisible: isFeatureActive2("welcomeGuide"),
3142 - templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate2 ? _templateId : null,
3143 - isDevicePreview: getDeviceType() !== "Desktop"
11776 + templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate2 ? _templateId : null
3144 11777 };
3145 11778 },
3146 11779 [
3147 11780 currentPostType,
@@ -3154,15 +11787,14 @@
3154 11787 useMetaBoxInitialization(hasActiveMetaboxes && hasResolvedMode);
3155 11788 const commandContext = hasBlockSelected ? "block-selection-edit" : "entity-edit";
3156 11789 useCommandContext(commandContext);
3157 11790 const styles = useEditorStyles(settings);
3158 - const editorSettings = (0, import_element13.useMemo)(
11791 + const editorSettings = (0, import_element29.useMemo)(
3159 11792 () => ({
3160 11793 ...settings,
3161 11794 styles,
3162 11795 onNavigateToEntityRecord,
3163 - onNavigateToPreviousEntityRecord,
3164 - defaultRenderingMode: "post-only"
11796 + onNavigateToPreviousEntityRecord
3165 11797 }),
3166 11798 [
3167 11799 settings,
3168 11800 styles,
@@ -3174,17 +11806,17 @@
3174 11806 document.body.classList.add("show-icon-labels");
3175 11807 } else {
3176 11808 document.body.classList.remove("show-icon-labels");
3177 11809 }
3178 - const navigateRegionsProps = (0, import_components9.__unstableUseNavigateRegions)();
11810 + const navigateRegionsProps = (0, import_components8.__unstableUseNavigateRegions)();
3179 11811 const className = clsx_default("edit-post-layout", "is-mode-" + mode, {
3180 11812 "has-metaboxes": hasActiveMetaboxes
3181 11813 });
3182 11814 function onPluginAreaError(name) {
3183 11815 createErrorNotice(
3184 - (0, import_i18n14.sprintf)(
11816 + (0, import_i18n15.sprintf)(
3185 11817 /* translators: %s: plugin name */
3186 - (0, import_i18n14.__)(
11818 + (0, import_i18n15.__)(
3187 11819 'The "%s" plugin has encountered an error and cannot be rendered.'
3188 11820 ),
3189 11821 name
3190 11822 )
@@ -3189,15 +11821,15 @@
3189 11821 name
3190 11822 )
3191 11823 );
3192 11824 }
3193 - const { createSuccessNotice } = (0, import_data25.useDispatch)(import_notices3.store);
3194 - const onActionPerformed = (0, import_element13.useCallback)(
11825 + const { createSuccessNotice } = (0, import_data26.useDispatch)(import_notices3.store);
11826 + const onActionPerformed = (0, import_element29.useCallback)(
3195 11827 (actionId, items) => {
3196 11828 switch (actionId) {
3197 11829 case "move-to-trash":
3198 11830 {
3199 - document.location.href = (0, import_url5.addQueryArgs)("edit.php", {
11831 + document.location.href = (0, import_url6.addQueryArgs)("edit.php", {
3200 11832 trashed: 1,
3201 11833 post_type: items[0].type,
3202 11834 ids: items[0].id
3203 11835 });
@@ -3207,12 +11839,12 @@
3207 11839 {
3208 11840 const newItem = items[0];
3209 11841 const title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered;
3210 11842 createSuccessNotice(
3211 - (0, import_i18n14.sprintf)(
11843 + (0, import_i18n15.sprintf)(
3212 11844 // translators: %s: Title of the created post or template, e.g: "Hello world".
3213 - (0, import_i18n14.__)('"%s" successfully created.'),
3214 - (0, import_html_entities.decodeEntities)(title) || (0, import_i18n14.__)("(no title)")
11845 + (0, import_i18n15.__)('"%s" successfully created.'),
11846 + (0, import_html_entities.decodeEntities)(title) || (0, import_i18n15.__)("(no title)")
3215 11847 ),
3216 11848 {
3217 11849 type: "snackbar",
3218 11850 id: "duplicate-post-action",
@@ -3217,12 +11849,12 @@
3217 11849 type: "snackbar",
3218 11850 id: "duplicate-post-action",
3219 11851 actions: [
3220 11852 {
3221 - label: (0, import_i18n14.__)("Edit"),
11853 + label: (0, import_i18n15.__)("Edit"),
3222 11854 onClick: () => {
3223 11855 const postId = newItem.id;
3224 - document.location.href = (0, import_url5.addQueryArgs)("post.php", {
11856 + document.location.href = (0, import_url6.addQueryArgs)("post.php", {
3225 11857 post: postId,
3226 11858 action: "edit"
3227 11859 });
3228 11860 }
@@ -3235,70 +11867,66 @@
3235 11867 }
3236 11868 },
3237 11869 [createSuccessNotice]
3238 11870 );
3239 - const initialPost = (0, import_element13.useMemo)(() => {
11871 + const initialPost = (0, import_element29.useMemo)(() => {
3240 11872 return {
3241 11873 type: initialPostType,
3242 11874 id: initialPostId
3243 11875 };
3244 11876 }, [initialPostType, initialPostId]);
3245 - const backButton = (0, import_compose3.useViewportMatch)("medium") && isFullscreenActive ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(back_button_default, { initialPost }) : null;
3246 - return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_editor18.ErrorBoundary, { canCopyContent: true, children: [
3247 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(WelcomeGuide, { postType: currentPostType }),
3248 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3249 - "div",
11877 + const backButton = (0, import_compose2.useViewportMatch)("medium") && isFullscreenActive ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(back_button_default, { initialPost }) : null;
11878 + const adminPrimary = (0, import_element29.useMemo)(() => getAdminThemeColors().primary, []);
11879 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components8.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(tooltip_exports.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_theme.ThemeProvider, { isRoot: true, color: { primary: adminPrimary }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_editor19.ErrorBoundary, { canCopyContent: true, children: [
11880 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WelcomeGuide, { postType: currentPostType }),
11881 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { ...navigateRegionsProps, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
11882 + Editor,
3250 11883 {
3251 - className: navigateRegionsProps.className,
3252 - ...navigateRegionsProps,
3253 - ref: navigateRegionsProps.ref,
3254 - children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3255 - Editor,
3256 - {
3257 - settings: editorSettings,
3258 - initialEdits,
3259 - postType: currentPostType,
3260 - postId: currentPostId,
3261 - templateId,
3262 - className,
3263 - forceIsDirty: hasActiveMetaboxes,
3264 - disableIframe: !shouldIframe,
3265 - autoFocus: !isWelcomeGuideVisible,
3266 - onActionPerformed,
3267 - extraSidebarPanels: showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MetaBoxes, { location: "side" }),
3268 - extraContent: !isDistractionFree && showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MetaBoxesMain, { isLegacy: isDevicePreview }),
3269 - children: [
3270 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.PostLockedModal, {}),
3271 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(EditorInitialization, {}),
3272 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FullscreenMode, { isActive: isFullscreenActive }),
3273 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BrowserURL, {}),
3274 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.UnsavedChangesWarning, {}),
3275 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.AutosaveMonitor, {}),
3276 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.LocalAutosaveMonitor, {}),
3277 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(keyboard_shortcuts_default, {}),
3278 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.EditorKeyboardShortcutsRegister, {}),
3279 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BlockKeyboardShortcuts, {}),
3280 - currentPostType === "wp_block" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InitPatternModal, {}),
3281 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }),
3282 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(more_menu_default, {}),
3283 - backButton,
3284 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_notices3.SnackbarNotices, { className: "edit-post-layout__snackbar" })
3285 - ]
3286 - }
3287 - )
11884 + settings: editorSettings,
11885 + initialEdits,
11886 + postType: currentPostType,
11887 + postId: currentPostId,
11888 + templateId,
11889 + className,
11890 + forceIsDirty: hasActiveMetaboxes,
11891 + autoFocus: !isWelcomeGuideVisible,
11892 + onActionPerformed,
11893 + extraSidebarPanels: showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MetaBoxes, { location: "side" }),
11894 + extraContent: !isDistractionFree && showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MetaBoxesMain, {}),
11895 + children: [
11896 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_editor19.PostLockedModal, {}),
11897 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(EditorInitialization, {}),
11898 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11899 + FullscreenMode,
11900 + {
11901 + isActive: isFullscreenActive
11902 + }
11903 + ),
11904 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(BrowserURL, {}),
11905 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_editor19.UnsavedChangesWarning, {}),
11906 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_editor19.AutosaveMonitor, {}),
11907 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_editor19.LocalAutosaveMonitor, {}),
11908 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(keyboard_shortcuts_default, {}),
11909 + currentPostType === "wp_block" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(InitPatternModal, {}),
11910 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }),
11911 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(more_menu_default, {}),
11912 + backButton,
11913 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_notices3.SnackbarNotices, { className: "edit-post-layout__snackbar" }),
11914 + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(UploadProgressSnackbar, {})
11915 + ]
3288 11916 }
3289 - )
3290 - ] }) });
11917 + ) })
11918 + ] }) }) }) });
3291 11919 }
3292 11920 var layout_default = Layout;
3293 11921
3294 11922 // packages/edit-post/build-module/deprecated.mjs
3295 - var import_editor19 = __toESM(require_editor(), 1);
3296 - var import_url6 = __toESM(require_url(), 1);
11923 + var import_editor20 = __toESM(require_editor(), 1);
11924 + var import_url7 = __toESM(require_url(), 1);
3297 11925 var import_deprecated3 = __toESM(require_deprecated(), 1);
3298 - var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
3299 - var { PluginPostExcerpt } = unlock(import_editor19.privateApis);
3300 - var isSiteEditor = (0, import_url6.getPath)(window.location.href)?.includes(
11926 + var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
11927 + var { PluginPostExcerpt } = unlock2(import_editor20.privateApis);
11928 + var isSiteEditor = (0, import_url7.getPath)(window.location.href)?.includes(
3301 11929 "site-editor.php"
3302 11930 );
3303 11931 var deprecateSlot = (name) => {
3304 11932 (0, import_deprecated3.default)(`wp.editPost.${name}`, {
@@ -3310,9 +11938,9 @@
3310 11938 if (isSiteEditor) {
3311 11939 return null;
3312 11940 }
3313 11941 deprecateSlot("PluginBlockSettingsMenuItem");
3314 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginBlockSettingsMenuItem, { ...props });
11942 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginBlockSettingsMenuItem, { ...props });
3315 11943 }
3316 11944 function PluginDocumentSettingPanel(props) {
3317 11945 if (isSiteEditor) {
3318 11946 return null;
@@ -3317,9 +11945,9 @@
3317 11945 if (isSiteEditor) {
3318 11946 return null;
3319 11947 }
3320 11948 deprecateSlot("PluginDocumentSettingPanel");
3321 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginDocumentSettingPanel, { ...props });
11949 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginDocumentSettingPanel, { ...props });
3322 11950 }
3323 11951 function PluginMoreMenuItem(props) {
3324 11952 if (isSiteEditor) {
3325 11953 return null;
@@ -3324,9 +11952,9 @@
3324 11952 if (isSiteEditor) {
3325 11953 return null;
3326 11954 }
3327 11955 deprecateSlot("PluginMoreMenuItem");
3328 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginMoreMenuItem, { ...props });
11956 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginMoreMenuItem, { ...props });
3329 11957 }
3330 11958 function PluginPrePublishPanel(props) {
3331 11959 if (isSiteEditor) {
3332 11960 return null;
@@ -3331,9 +11959,9 @@
3331 11959 if (isSiteEditor) {
3332 11960 return null;
3333 11961 }
3334 11962 deprecateSlot("PluginPrePublishPanel");
3335 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginPrePublishPanel, { ...props });
11963 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginPrePublishPanel, { ...props });
3336 11964 }
3337 11965 function PluginPostPublishPanel(props) {
3338 11966 if (isSiteEditor) {
3339 11967 return null;
@@ -3338,9 +11966,9 @@
3338 11966 if (isSiteEditor) {
3339 11967 return null;
3340 11968 }
3341 11969 deprecateSlot("PluginPostPublishPanel");
3342 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginPostPublishPanel, { ...props });
11970 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginPostPublishPanel, { ...props });
3343 11971 }
3344 11972 function PluginPostStatusInfo(props) {
3345 11973 if (isSiteEditor) {
3346 11974 return null;
@@ -3345,9 +11973,9 @@
3345 11973 if (isSiteEditor) {
3346 11974 return null;
3347 11975 }
3348 11976 deprecateSlot("PluginPostStatusInfo");
3349 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginPostStatusInfo, { ...props });
11977 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginPostStatusInfo, { ...props });
3350 11978 }
3351 11979 function PluginSidebar(props) {
3352 11980 if (isSiteEditor) {
3353 11981 return null;
@@ -3352,9 +11980,9 @@
3352 11980 if (isSiteEditor) {
3353 11981 return null;
3354 11982 }
3355 11983 deprecateSlot("PluginSidebar");
3356 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginSidebar, { ...props });
11984 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginSidebar, { ...props });
3357 11985 }
3358 11986 function PluginSidebarMoreMenuItem(props) {
3359 11987 if (isSiteEditor) {
3360 11988 return null;
@@ -3359,9 +11987,9 @@
3359 11987 if (isSiteEditor) {
3360 11988 return null;
3361 11989 }
3362 11990 deprecateSlot("PluginSidebarMoreMenuItem");
3363 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginSidebarMoreMenuItem, { ...props });
11991 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginSidebarMoreMenuItem, { ...props });
3364 11992 }
3365 11993 function __experimentalPluginPostExcerpt() {
3366 11994 if (isSiteEditor) {
3367 11995 return null;
@@ -3374,27 +12002,28 @@
3374 12002 return PluginPostExcerpt;
3375 12003 }
3376 12004
3377 12005 // packages/edit-post/build-module/index.mjs
3378 - var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
12006 + var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
3379 12007 var {
3380 12008 BackButton: __experimentalMainDashboardButton,
3381 12009 registerCoreBlockBindingsSources
3382 - } = unlock(import_editor20.privateApis);
12010 + } = unlock2(import_editor21.privateApis);
12011 + var { enablePreloadMultiUse, clearPreloadedData } = unlock2(
12012 + import_api_fetch2.default.privateApis
12013 + );
3383 12014 function initializeEditor(id, postType, postId, settings, initialEdits) {
3384 - const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches;
3385 12015 const target = document.getElementById(id);
3386 - const root = (0, import_element14.createRoot)(target);
3387 - (0, import_data26.dispatch)(import_preferences11.store).setDefaults("core/edit-post", {
12016 + const root = (0, import_element30.createRoot)(target);
12017 + (0, import_data27.dispatch)(import_preferences11.store).setDefaults("core/edit-post", {
3388 12018 fullscreenMode: true,
3389 12019 themeStyles: true,
3390 12020 welcomeGuide: true,
3391 12021 welcomeGuideTemplate: true
3392 12022 });
3393 - (0, import_data26.dispatch)(import_preferences11.store).setDefaults("core", {
12023 + (0, import_data27.dispatch)(import_preferences11.store).setDefaults("core", {
3394 12024 allowRightClickOverrides: true,
3395 12025 editorMode: "visual",
3396 - editorTool: "edit",
3397 12026 fixedToolbar: false,
3398 12027 hiddenBlockTypes: [],
3399 12028 inactivePanels: [],
3400 12029 openPanels: ["post-status"],
@@ -3403,26 +12032,25 @@
3403 12032 showListViewByDefault: false,
3404 12033 enableChoosePatternModal: true,
3405 12034 isPublishSidebarEnabled: true,
3406 12035 showCollaborationCursor: false,
3407 - showCollaborationNotifications: true
12036 + showCollaborationJoinNotifications: true,
12037 + showCollaborationLeaveNotifications: true,
12038 + showCollaborationPostSaveNotifications: true
3408 12039 });
3409 12040 if (window.__clientSideMediaProcessing) {
3410 - (0, import_data26.dispatch)(import_preferences11.store).setDefaults("core/media", {
12041 + (0, import_data27.dispatch)(import_preferences11.store).setDefaults("core/media", {
3411 12042 requireApproval: true,
3412 12043 optimizeOnUpload: true
3413 12044 });
3414 12045 }
3415 - (0, import_data26.dispatch)(import_blocks3.store).reapplyBlockTypeFilters();
3416 - if (isMediumOrBigger && (0, import_data26.select)(import_preferences11.store).get("core", "showListViewByDefault") && !(0, import_data26.select)(import_preferences11.store).get("core", "distractionFree")) {
3417 - (0, import_data26.dispatch)(import_editor20.store).setIsListViewOpened(true);
3418 - }
3419 - (0, import_block_library2.registerCoreBlocks)();
12046 + (0, import_data27.dispatch)(import_blocks2.store).reapplyBlockTypeFilters();
12047 + (0, import_block_library.registerCoreBlocks)();
3420 12048 registerCoreBlockBindingsSources();
3421 12049 (0, import_widgets.registerLegacyWidgetBlock)({ inserter: false });
3422 12050 (0, import_widgets.registerWidgetGroupBlock)({ inserter: false });
3423 12051 if (true) {
3424 - (0, import_block_library2.__experimentalRegisterExperimentalCoreBlocks)({
12052 + (0, import_block_library.__experimentalRegisterExperimentalCoreBlocks)({
3425 12053 enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks
3426 12054 });
3427 12055 }
3428 12056 const documentMode = document.compatMode === "CSS1Compat" ? "Standards" : "Quirks";
@@ -3430,39 +12058,159 @@
3430 12058 console.warn(
3431 12059 "Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins."
3432 12060 );
3433 12061 }
3434 - const isIphone = window.navigator.userAgent.indexOf("iPhone") !== -1;
3435 - if (isIphone) {
3436 - window.addEventListener("scroll", (event) => {
3437 - const editorScrollContainer = document.getElementsByClassName(
3438 - "interface-interface-skeleton__body"
3439 - )[0];
3440 - if (event.target === document) {
3441 - if (window.scrollY > 100) {
3442 - editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY;
3443 - }
3444 - if (document.getElementsByClassName("is-mode-visual")[0]) {
3445 - window.scrollTo(0, 0);
3446 - }
3447 - }
3448 - });
3449 - }
3450 12062 window.addEventListener("dragover", (e) => e.preventDefault(), false);
3451 12063 window.addEventListener("drop", (e) => e.preventDefault(), false);
3452 - root.render(
3453 - /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_element14.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3454 - layout_default,
3455 - {
3456 - settings,
3457 - postId,
12064 + enablePreloadMultiUse();
12065 + const preloadedResolutions = preloadResolutions(postType, postId);
12066 + preloadedResolutions.finally(() => {
12067 + clearPreloadedData();
12068 + if (postType && postId) {
12069 + const post = (0, import_data27.select)(import_core_data10.store).getEntityRecord(
12070 + "postType",
3458 12071 postType,
3459 - initialEdits
12072 + postId
12073 + );
12074 + if (post) {
12075 + (0, import_data27.dispatch)(import_editor21.store).setupEditor(
12076 + post,
12077 + initialEdits,
12078 + settings.template
12079 + );
3460 12080 }
3461 - ) })
3462 - );
12081 + }
12082 + root.render(
12083 + /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_element30.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12084 + layout_default,
12085 + {
12086 + settings,
12087 + postId,
12088 + postType,
12089 + initialEdits
12090 + }
12091 + ) })
12092 + );
12093 + });
3463 12094 return root;
3464 12095 }
12096 + async function preloadResolutions(postType, postId) {
12097 + const core = (0, import_data27.resolveSelect)(import_core_data10.store);
12098 + const coreSelect = (0, import_data27.select)(import_core_data10.store);
12099 + try {
12100 + await Promise.all([
12101 + core.getCurrentUser(),
12102 + core.getEntitiesConfig("postType"),
12103 + core.getEntitiesConfig("taxonomy"),
12104 + core.getEntitiesConfig("root"),
12105 + core.getEntityRecords("root", "taxonomy"),
12106 + core.getCurrentTheme(),
12107 + // Forward-resolver alias of `getCurrentTheme` with its own
12108 + // resolution metadata, so it needs a separate kick.
12109 + core.getThemeSupports(),
12110 + core.getBlockPatternCategories(),
12111 + core.__experimentalGetCurrentGlobalStylesId(),
12112 + core.__experimentalGetCurrentThemeBaseGlobalStyles(),
12113 + core.__experimentalGetCurrentThemeGlobalStylesVariations(),
12114 + core.getEntityRecord("root", "__unstableBase"),
12115 + core.canUser("read", { kind: "root", name: "site" }),
12116 + core.canUser("create", { kind: "postType", name: "attachment" }),
12117 + core.canUser("create", { kind: "postType", name: "page" }),
12118 + core.canUser("create", { kind: "postType", name: "wp_block" }),
12119 + core.canUser("create", {
12120 + kind: "postType",
12121 + name: "wp_template"
12122 + }),
12123 + // The DataForm-based inspector requests the entity form config
12124 + // when the document sidebar mounts. The args must match the
12125 + // `useViewConfig` call in `@wordpress/views` exactly for the
12126 + // resolution (and its preload entry) to be shared.
12127 + ...postType && window?.__experimentalDataFormInspector ? [
12128 + unlock2(core).getViewConfig("postType", postType, {
12129 + fields: "form"
12130 + })
12131 + ] : [],
12132 + // Per-post resolvers. `getPostType` and `getEditedEntityRecord`
12133 + // are shorthand/forward-resolver aliases with their own
12134 + // resolution metadata, so they need separate kicks.
12135 + ...postType && postId ? [
12136 + core.getPostType(postType),
12137 + core.getEntityRecord("postType", postType, postId),
12138 + core.getEditedEntityRecord(
12139 + "postType",
12140 + postType,
12141 + postId
12142 + ),
12143 + core.getAutosaves(postType, postId),
12144 + core.getDefaultTemplateId({ slug: "front-page" }),
12145 + core.canUser("create", {
12146 + kind: "postType",
12147 + name: postType
12148 + })
12149 + ] : []
12150 + ]);
12151 + const tasks = [];
12152 + if (coreSelect.canUser("read", { kind: "root", name: "site" })) {
12153 + tasks.push(core.getEntityRecord("root", "site"));
12154 + }
12155 + const globalStylesId = coreSelect.__experimentalGetCurrentGlobalStylesId();
12156 + if (globalStylesId) {
12157 + tasks.push(
12158 + core.canUser("update", {
12159 + kind: "root",
12160 + name: "globalStyles",
12161 + id: globalStylesId
12162 + })
12163 + );
12164 + }
12165 + if (postType && postId) {
12166 + const post = coreSelect.getEntityRecord(
12167 + "postType",
12168 + postType,
12169 + postId
12170 + );
12171 + if (post) {
12172 + let slug = "page" === postType ? "page" : "single-" + postType;
12173 + if (post.slug) {
12174 + slug += "-" + post.slug;
12175 + }
12176 + tasks.push(core.getDefaultTemplateId({ slug }));
12177 + if (post.author) {
12178 + tasks.push(
12179 + core.getUser(post.author, {
12180 + context: "view",
12181 + _fields: "id,name"
12182 + })
12183 + );
12184 + }
12185 + }
12186 + }
12187 + if (tasks.length) {
12188 + await Promise.all(tasks);
12189 + }
12190 + if (globalStylesId) {
12191 + if (coreSelect.canUser("update", {
12192 + kind: "root",
12193 + name: "globalStyles",
12194 + id: globalStylesId
12195 + })) {
12196 + await core.getEntityRecord(
12197 + "root",
12198 + "globalStyles",
12199 + globalStylesId
12200 + );
12201 + } else {
12202 + await core.getEntityRecord(
12203 + "root",
12204 + "globalStyles",
12205 + globalStylesId,
12206 + { context: "view" }
12207 + );
12208 + }
12209 + }
12210 + } catch {
12211 + }
12212 + }
3465 12213 function reinitializeEditor() {
3466 12214 (0, import_deprecated4.default)("wp.editPost.reinitializeEditor", {
3467 12215 since: "6.2",
3468 12216 version: "6.3"
@@ -3468,6 +12216,32 @@
3468 12216 version: "6.3"
3469 12217 });
3470 12218 }
3471 12219 return __toCommonJS(index_exports);
12220 +})();
12221 +/*! Bundled license information:
12222 +
12223 +use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
12224 + (**
12225 + * @license React
12226 + * use-sync-external-store-shim.development.js
12227 + *
12228 + * Copyright (c) Meta Platforms, Inc. and affiliates.
12229 + *
12230 + * This source code is licensed under the MIT license found in the
12231 + * LICENSE file in the root directory of this source tree.
12232 + *)
12233 +
12234 +use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js:
12235 + (**
12236 + * @license React
12237 + * use-sync-external-store-shim/with-selector.development.js
12238 + *
12239 + * Copyright (c) Meta Platforms, Inc. and affiliates.
12240 + *
12241 + * This source code is licensed under the MIT license found in the
12242 + * LICENSE file in the root directory of this source tree.
12243 + *)
12244 +*/
12245 +(window.wp ||= {}).editPost = wp.editPost;
3472 12246 })();
3473 12247 //# sourceMappingURL=index.js.map