PluginProbe
Gutenberg / 22.7.0
Gutenberg v22.7.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 12.6.0 All 403 releases
← All changes | build/scripts/commands/index.js +1140 -516 23.6.2 → 22.7.0 View file →
@@ -100,15 +100,8 @@
100 100 module.exports = window.wp.privateApis;
101 101 }
102 102 });
103 103
104 - // package-external:@wordpress/preferences
105 - var require_preferences = __commonJS({
106 - "package-external:@wordpress/preferences"(exports, module) {
107 - module.exports = window.wp.preferences;
108 - }
109 - });
110 -
111 104 // packages/commands/build-module/index.mjs
112 105 var index_exports = {};
113 106 __export(index_exports, {
114 107 CommandMenu: () => CommandMenu,
@@ -146,11 +139,11 @@
146 139 return _ = h && h.length > 0 ? `${_ + " " + h.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {});
147 140 }
148 141
149 142 // node_modules/@radix-ui/react-dialog/dist/index.mjs
150 - var React24 = __toESM(require_react(), 1);
143 + var React37 = __toESM(require_react(), 1);
151 144
152 - // node_modules/@radix-ui/primitive/dist/index.mjs
145 + // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.mjs
153 146 var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
154 147 function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
155 148 return function handleEvent(event) {
156 149 originalEventHandler?.(event);
@@ -159,9 +152,9 @@
159 152 }
160 153 };
161 154 }
162 155
163 - // node_modules/@radix-ui/react-compose-refs/dist/index.mjs
156 + // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
164 157 var React = __toESM(require_react(), 1);
165 158 function setRef(ref, value) {
166 159 if (typeof ref === "function") {
167 160 return ref(value);
@@ -273,17 +266,17 @@
273 266 createScope.scopeName = baseScope.scopeName;
274 267 return createScope;
275 268 }
276 269
277 - // node_modules/@radix-ui/react-id/dist/index.mjs
270 + // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.mjs
278 271 var React4 = __toESM(require_react(), 1);
279 272
280 - // node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
273 + // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
281 274 var React3 = __toESM(require_react(), 1);
282 275 var useLayoutEffect2 = globalThis?.document ? React3.useLayoutEffect : () => {
283 276 };
284 277
285 - // node_modules/@radix-ui/react-id/dist/index.mjs
278 + // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.mjs
286 279 var useReactId = React4[" useId ".trim().toString()] || (() => void 0);
287 280 var count = 0;
288 281 function useId(deterministicId) {
289 282 const [id, setId] = React4.useState(useReactId());
@@ -361,35 +354,85 @@
361 354 return typeof value === "function";
362 355 }
363 356
364 357 // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
365 - var React10 = __toESM(require_react(), 1);
358 + var React11 = __toESM(require_react(), 1);
366 359
367 - // node_modules/@radix-ui/react-primitive/dist/index.mjs
360 + // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/primitive/dist/index.mjs
361 + var canUseDOM2 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
362 + function composeEventHandlers2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
363 + return function handleEvent(event) {
364 + originalEventHandler?.(event);
365 + if (checkForDefaultPrevented === false || !event.defaultPrevented) {
366 + return ourEventHandler?.(event);
367 + }
368 + };
369 + }
370 +
371 + // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive/dist/index.mjs
372 + var React8 = __toESM(require_react(), 1);
373 + var ReactDOM = __toESM(require_react_dom(), 1);
374 +
375 + // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot/dist/index.mjs
368 376 var React7 = __toESM(require_react(), 1);
369 - var ReactDOM = __toESM(require_react_dom(), 1);
370 377
371 - // node_modules/@radix-ui/react-slot/dist/index.mjs
378 + // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
372 379 var React6 = __toESM(require_react(), 1);
380 + function setRef2(ref, value) {
381 + if (typeof ref === "function") {
382 + return ref(value);
383 + } else if (ref !== null && ref !== void 0) {
384 + ref.current = value;
385 + }
386 + }
387 + function composeRefs2(...refs) {
388 + return (node) => {
389 + let hasCleanup = false;
390 + const cleanups = refs.map((ref) => {
391 + const cleanup = setRef2(ref, node);
392 + if (!hasCleanup && typeof cleanup == "function") {
393 + hasCleanup = true;
394 + }
395 + return cleanup;
396 + });
397 + if (hasCleanup) {
398 + return () => {
399 + for (let i = 0; i < cleanups.length; i++) {
400 + const cleanup = cleanups[i];
401 + if (typeof cleanup == "function") {
402 + cleanup();
403 + } else {
404 + setRef2(refs[i], null);
405 + }
406 + }
407 + };
408 + }
409 + };
410 + }
411 + function useComposedRefs2(...refs) {
412 + return React6.useCallback(composeRefs2(...refs), refs);
413 + }
414 +
415 + // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot/dist/index.mjs
373 416 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
374 417 // @__NO_SIDE_EFFECTS__
375 418 function createSlot(ownerName) {
376 419 const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
377 - const Slot2 = React6.forwardRef((props, forwardedRef) => {
420 + const Slot2 = React7.forwardRef((props, forwardedRef) => {
378 421 const { children, ...slotProps } = props;
379 - const childrenArray = React6.Children.toArray(children);
422 + const childrenArray = React7.Children.toArray(children);
380 423 const slottable = childrenArray.find(isSlottable);
381 424 if (slottable) {
382 425 const newElement = slottable.props.children;
383 426 const newChildren = childrenArray.map((child) => {
384 427 if (child === slottable) {
385 - if (React6.Children.count(newElement) > 1) return React6.Children.only(null);
386 - return React6.isValidElement(newElement) ? newElement.props.children : null;
428 + if (React7.Children.count(newElement) > 1) return React7.Children.only(null);
429 + return React7.isValidElement(newElement) ? newElement.props.children : null;
387 430 } else {
388 431 return child;
389 432 }
390 433 });
391 - return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React6.isValidElement(newElement) ? React6.cloneElement(newElement, void 0, newChildren) : null });
434 + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React7.isValidElement(newElement) ? React7.cloneElement(newElement, void 0, newChildren) : null });
392 435 }
393 436 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
394 437 });
395 438 Slot2.displayName = `${ownerName}.Slot`;
@@ -396,19 +439,19 @@
396 439 return Slot2;
397 440 }
398 441 // @__NO_SIDE_EFFECTS__
399 442 function createSlotClone(ownerName) {
400 - const SlotClone = React6.forwardRef((props, forwardedRef) => {
443 + const SlotClone = React7.forwardRef((props, forwardedRef) => {
401 444 const { children, ...slotProps } = props;
402 - if (React6.isValidElement(children)) {
445 + if (React7.isValidElement(children)) {
403 446 const childrenRef = getElementRef(children);
404 447 const props2 = mergeProps(slotProps, children.props);
405 - if (children.type !== React6.Fragment) {
406 - props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
448 + if (children.type !== React7.Fragment) {
449 + props2.ref = forwardedRef ? composeRefs2(forwardedRef, childrenRef) : childrenRef;
407 450 }
408 - return React6.cloneElement(children, props2);
451 + return React7.cloneElement(children, props2);
409 452 }
410 - return React6.Children.count(children) > 1 ? React6.Children.only(null) : null;
453 + return React7.Children.count(children) > 1 ? React7.Children.only(null) : null;
411 454 });
412 455 SlotClone.displayName = `${ownerName}.SlotClone`;
413 456 return SlotClone;
414 457 }
@@ -413,9 +456,9 @@
413 456 return SlotClone;
414 457 }
415 458 var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
416 459 function isSlottable(child) {
417 - return React6.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
460 + return React7.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
418 461 }
419 462 function mergeProps(slotProps, childProps) {
420 463 const overrideProps = { ...childProps };
421 464 for (const propName in childProps) {
@@ -453,9 +496,9 @@
453 496 }
454 497 return element.props.ref || element.ref;
455 498 }
456 499
457 - // node_modules/@radix-ui/react-primitive/dist/index.mjs
500 + // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive/dist/index.mjs
458 501 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
459 502 var NODES = [
460 503 "a",
461 504 "button",
@@ -476,9 +519,9 @@
476 519 "ul"
477 520 ];
478 521 var Primitive = NODES.reduce((primitive, node) => {
479 522 const Slot2 = createSlot(`Primitive.${node}`);
480 - const Node2 = React7.forwardRef((props, forwardedRef) => {
523 + const Node2 = React8.forwardRef((props, forwardedRef) => {
481 524 const { asChild, ...primitiveProps } = props;
482 525 const Comp = asChild ? Slot2 : node;
483 526 if (typeof window !== "undefined") {
484 527 window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
@@ -491,23 +534,23 @@
491 534 function dispatchDiscreteCustomEvent(target, event) {
492 535 if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
493 536 }
494 537
495 - // node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
496 - var React8 = __toESM(require_react(), 1);
538 + // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
539 + var React9 = __toESM(require_react(), 1);
497 540 function useCallbackRef(callback) {
498 - const callbackRef = React8.useRef(callback);
499 - React8.useEffect(() => {
541 + const callbackRef = React9.useRef(callback);
542 + React9.useEffect(() => {
500 543 callbackRef.current = callback;
501 544 });
502 - return React8.useMemo(() => (...args) => callbackRef.current?.(...args), []);
545 + return React9.useMemo(() => (...args) => callbackRef.current?.(...args), []);
503 546 }
504 547
505 548 // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
506 - var React9 = __toESM(require_react(), 1);
549 + var React10 = __toESM(require_react(), 1);
507 550 function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
508 551 const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
509 - React9.useEffect(() => {
552 + React10.useEffect(() => {
510 553 const handleKeyDown = (event) => {
511 554 if (event.key === "Escape") {
512 555 onEscapeKeyDown(event);
513 556 }
@@ -523,14 +566,14 @@
523 566 var CONTEXT_UPDATE = "dismissableLayer.update";
524 567 var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
525 568 var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
526 569 var originalBodyPointerEvents;
527 - var DismissableLayerContext = React10.createContext({
570 + var DismissableLayerContext = React11.createContext({
528 571 layers: /* @__PURE__ */ new Set(),
529 572 layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
530 573 branches: /* @__PURE__ */ new Set()
531 574 });
532 - var DismissableLayer = React10.forwardRef(
575 + var DismissableLayer = React11.forwardRef(
533 576 (props, forwardedRef) => {
534 577 const {
535 578 disableOutsidePointerEvents = false,
536 579 onEscapeKeyDown,
@@ -539,13 +582,13 @@
539 582 onInteractOutside,
540 583 onDismiss,
541 584 ...layerProps
542 585 } = props;
543 - const context2 = React10.useContext(DismissableLayerContext);
544 - const [node, setNode] = React10.useState(null);
586 + const context2 = React11.useContext(DismissableLayerContext);
587 + const [node, setNode] = React11.useState(null);
545 588 const ownerDocument = node?.ownerDocument ?? globalThis?.document;
546 - const [, force] = React10.useState({});
547 - const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
589 + const [, force] = React11.useState({});
590 + const composedRefs = useComposedRefs2(forwardedRef, (node2) => setNode(node2));
548 591 const layers = Array.from(context2.layers);
549 592 const [highestLayerWithOutsidePointerEventsDisabled] = [...context2.layersWithOutsidePointerEventsDisabled].slice(-1);
550 593 const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
551 594 const index = node ? layers.indexOf(node) : -1;
@@ -575,9 +618,9 @@
575 618 event.preventDefault();
576 619 onDismiss();
577 620 }
578 621 }, ownerDocument);
579 - React10.useEffect(() => {
622 + React11.useEffect(() => {
580 623 if (!node) return;
581 624 if (disableOutsidePointerEvents) {
582 625 if (context2.layersWithOutsidePointerEventsDisabled.size === 0) {
583 626 originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
@@ -592,9 +635,9 @@
592 635 ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
593 636 }
594 637 };
595 638 }, [node, ownerDocument, disableOutsidePointerEvents, context2]);
596 - React10.useEffect(() => {
639 + React11.useEffect(() => {
597 640 return () => {
598 641 if (!node) return;
599 642 context2.layers.delete(node);
600 643 context2.layersWithOutsidePointerEventsDisabled.delete(node);
@@ -600,9 +643,9 @@
600 643 context2.layersWithOutsidePointerEventsDisabled.delete(node);
601 644 dispatchUpdate();
602 645 };
603 646 }, [node, context2]);
604 - React10.useEffect(() => {
647 + React11.useEffect(() => {
605 648 const handleUpdate = () => force({});
606 649 document.addEventListener(CONTEXT_UPDATE, handleUpdate);
607 650 return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
608 651 }, []);
@@ -614,11 +657,11 @@
614 657 style: {
615 658 pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
616 659 ...props.style
617 660 },
618 - onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
619 - onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
620 - onPointerDownCapture: composeEventHandlers(
661 + onFocusCapture: composeEventHandlers2(props.onFocusCapture, focusOutside.onFocusCapture),
662 + onBlurCapture: composeEventHandlers2(props.onBlurCapture, focusOutside.onBlurCapture),
663 + onPointerDownCapture: composeEventHandlers2(
621 664 props.onPointerDownCapture,
622 665 pointerDownOutside.onPointerDownCapture
623 666 )
624 667 }
@@ -626,13 +669,13 @@
626 669 }
627 670 );
628 671 DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
629 672 var BRANCH_NAME = "DismissableLayerBranch";
630 - var DismissableLayerBranch = React10.forwardRef((props, forwardedRef) => {
631 - const context2 = React10.useContext(DismissableLayerContext);
632 - const ref = React10.useRef(null);
633 - const composedRefs = useComposedRefs(forwardedRef, ref);
634 - React10.useEffect(() => {
673 + var DismissableLayerBranch = React11.forwardRef((props, forwardedRef) => {
674 + const context2 = React11.useContext(DismissableLayerContext);
675 + const ref = React11.useRef(null);
676 + const composedRefs = useComposedRefs2(forwardedRef, ref);
677 + React11.useEffect(() => {
635 678 const node = ref.current;
636 679 if (node) {
637 680 context2.branches.add(node);
638 681 return () => {
@@ -644,12 +687,12 @@
644 687 });
645 688 DismissableLayerBranch.displayName = BRANCH_NAME;
646 689 function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
647 690 const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
648 - const isPointerInsideReactTreeRef = React10.useRef(false);
649 - const handleClickRef = React10.useRef(() => {
691 + const isPointerInsideReactTreeRef = React11.useRef(false);
692 + const handleClickRef = React11.useRef(() => {
650 693 });
651 - React10.useEffect(() => {
694 + React11.useEffect(() => {
652 695 const handlePointerDown = (event) => {
653 696 if (event.target && !isPointerInsideReactTreeRef.current) {
654 697 let handleAndDispatchPointerDownOutsideEvent2 = function() {
655 698 handleAndDispatchCustomEvent(
@@ -688,10 +731,10 @@
688 731 };
689 732 }
690 733 function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
691 734 const handleFocusOutside = useCallbackRef(onFocusOutside);
692 - const isFocusInsideReactTreeRef = React10.useRef(false);
693 - React10.useEffect(() => {
735 + const isFocusInsideReactTreeRef = React11.useRef(false);
736 + React11.useEffect(() => {
694 737 const handleFocus = (event) => {
695 738 if (event.target && !isFocusInsideReactTreeRef.current) {
696 739 const eventDetail = { originalEvent: event };
697 740 handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
@@ -722,15 +765,189 @@
722 765 }
723 766 }
724 767
725 768 // node_modules/@radix-ui/react-focus-scope/dist/index.mjs
726 - var React11 = __toESM(require_react(), 1);
769 + var React16 = __toESM(require_react(), 1);
770 +
771 + // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
772 + var React12 = __toESM(require_react(), 1);
773 + function setRef3(ref, value) {
774 + if (typeof ref === "function") {
775 + return ref(value);
776 + } else if (ref !== null && ref !== void 0) {
777 + ref.current = value;
778 + }
779 + }
780 + function composeRefs3(...refs) {
781 + return (node) => {
782 + let hasCleanup = false;
783 + const cleanups = refs.map((ref) => {
784 + const cleanup = setRef3(ref, node);
785 + if (!hasCleanup && typeof cleanup == "function") {
786 + hasCleanup = true;
787 + }
788 + return cleanup;
789 + });
790 + if (hasCleanup) {
791 + return () => {
792 + for (let i = 0; i < cleanups.length; i++) {
793 + const cleanup = cleanups[i];
794 + if (typeof cleanup == "function") {
795 + cleanup();
796 + } else {
797 + setRef3(refs[i], null);
798 + }
799 + }
800 + };
801 + }
802 + };
803 + }
804 + function useComposedRefs3(...refs) {
805 + return React12.useCallback(composeRefs3(...refs), refs);
806 + }
807 +
808 + // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.mjs
809 + var React14 = __toESM(require_react(), 1);
810 + var ReactDOM2 = __toESM(require_react_dom(), 1);
811 +
812 + // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-slot/dist/index.mjs
813 + var React13 = __toESM(require_react(), 1);
727 814 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
815 + // @__NO_SIDE_EFFECTS__
816 + function createSlot2(ownerName) {
817 + const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName);
818 + const Slot2 = React13.forwardRef((props, forwardedRef) => {
819 + const { children, ...slotProps } = props;
820 + const childrenArray = React13.Children.toArray(children);
821 + const slottable = childrenArray.find(isSlottable2);
822 + if (slottable) {
823 + const newElement = slottable.props.children;
824 + const newChildren = childrenArray.map((child) => {
825 + if (child === slottable) {
826 + if (React13.Children.count(newElement) > 1) return React13.Children.only(null);
827 + return React13.isValidElement(newElement) ? newElement.props.children : null;
828 + } else {
829 + return child;
830 + }
831 + });
832 + return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React13.isValidElement(newElement) ? React13.cloneElement(newElement, void 0, newChildren) : null });
833 + }
834 + return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
835 + });
836 + Slot2.displayName = `${ownerName}.Slot`;
837 + return Slot2;
838 + }
839 + // @__NO_SIDE_EFFECTS__
840 + function createSlotClone2(ownerName) {
841 + const SlotClone = React13.forwardRef((props, forwardedRef) => {
842 + const { children, ...slotProps } = props;
843 + if (React13.isValidElement(children)) {
844 + const childrenRef = getElementRef2(children);
845 + const props2 = mergeProps2(slotProps, children.props);
846 + if (children.type !== React13.Fragment) {
847 + props2.ref = forwardedRef ? composeRefs3(forwardedRef, childrenRef) : childrenRef;
848 + }
849 + return React13.cloneElement(children, props2);
850 + }
851 + return React13.Children.count(children) > 1 ? React13.Children.only(null) : null;
852 + });
853 + SlotClone.displayName = `${ownerName}.SlotClone`;
854 + return SlotClone;
855 + }
856 + var SLOTTABLE_IDENTIFIER2 = /* @__PURE__ */ Symbol("radix.slottable");
857 + function isSlottable2(child) {
858 + return React13.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
859 + }
860 + function mergeProps2(slotProps, childProps) {
861 + const overrideProps = { ...childProps };
862 + for (const propName in childProps) {
863 + const slotPropValue = slotProps[propName];
864 + const childPropValue = childProps[propName];
865 + const isHandler = /^on[A-Z]/.test(propName);
866 + if (isHandler) {
867 + if (slotPropValue && childPropValue) {
868 + overrideProps[propName] = (...args) => {
869 + const result = childPropValue(...args);
870 + slotPropValue(...args);
871 + return result;
872 + };
873 + } else if (slotPropValue) {
874 + overrideProps[propName] = slotPropValue;
875 + }
876 + } else if (propName === "style") {
877 + overrideProps[propName] = { ...slotPropValue, ...childPropValue };
878 + } else if (propName === "className") {
879 + overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
880 + }
881 + }
882 + return { ...slotProps, ...overrideProps };
883 + }
884 + function getElementRef2(element) {
885 + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
886 + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
887 + if (mayWarn) {
888 + return element.ref;
889 + }
890 + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
891 + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
892 + if (mayWarn) {
893 + return element.props.ref;
894 + }
895 + return element.props.ref || element.ref;
896 + }
897 +
898 + // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.mjs
899 + var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
900 + var NODES2 = [
901 + "a",
902 + "button",
903 + "div",
904 + "form",
905 + "h2",
906 + "h3",
907 + "img",
908 + "input",
909 + "label",
910 + "li",
911 + "nav",
912 + "ol",
913 + "p",
914 + "select",
915 + "span",
916 + "svg",
917 + "ul"
918 + ];
919 + var Primitive2 = NODES2.reduce((primitive, node) => {
920 + const Slot2 = createSlot2(`Primitive.${node}`);
921 + const Node2 = React14.forwardRef((props, forwardedRef) => {
922 + const { asChild, ...primitiveProps } = props;
923 + const Comp = asChild ? Slot2 : node;
924 + if (typeof window !== "undefined") {
925 + window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
926 + }
927 + return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
928 + });
929 + Node2.displayName = `Primitive.${node}`;
930 + return { ...primitive, [node]: Node2 };
931 + }, {});
932 +
933 + // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
934 + var React15 = __toESM(require_react(), 1);
935 + function useCallbackRef2(callback) {
936 + const callbackRef = React15.useRef(callback);
937 + React15.useEffect(() => {
938 + callbackRef.current = callback;
939 + });
940 + return React15.useMemo(() => (...args) => callbackRef.current?.(...args), []);
941 + }
942 +
943 + // node_modules/@radix-ui/react-focus-scope/dist/index.mjs
944 + var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
728 945 var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
729 946 var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
730 947 var EVENT_OPTIONS = { bubbles: false, cancelable: true };
731 948 var FOCUS_SCOPE_NAME = "FocusScope";
732 - var FocusScope = React11.forwardRef((props, forwardedRef) => {
949 + var FocusScope = React16.forwardRef((props, forwardedRef) => {
733 950 const {
734 951 loop = false,
735 952 trapped = false,
736 953 onMountAutoFocus: onMountAutoFocusProp,
@@ -736,14 +953,14 @@
736 953 onMountAutoFocus: onMountAutoFocusProp,
737 954 onUnmountAutoFocus: onUnmountAutoFocusProp,
738 955 ...scopeProps
739 956 } = props;
740 - const [container, setContainer] = React11.useState(null);
741 - const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
742 - const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
743 - const lastFocusedElementRef = React11.useRef(null);
744 - const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
745 - const focusScope = React11.useRef({
957 + const [container, setContainer] = React16.useState(null);
958 + const onMountAutoFocus = useCallbackRef2(onMountAutoFocusProp);
959 + const onUnmountAutoFocus = useCallbackRef2(onUnmountAutoFocusProp);
960 + const lastFocusedElementRef = React16.useRef(null);
961 + const composedRefs = useComposedRefs3(forwardedRef, (node) => setContainer(node));
962 + const focusScope = React16.useRef({
746 963 paused: false,
747 964 pause() {
748 965 this.paused = true;
749 966 },
@@ -750,9 +967,9 @@
750 967 resume() {
751 968 this.paused = false;
752 969 }
753 970 }).current;
754 - React11.useEffect(() => {
971 + React16.useEffect(() => {
755 972 if (trapped) {
756 973 let handleFocusIn2 = function(event) {
757 974 if (focusScope.paused || !container) return;
758 975 const target = event.target;
@@ -786,9 +1003,9 @@
786 1003 mutationObserver.disconnect();
787 1004 };
788 1005 }
789 1006 }, [trapped, container, focusScope.paused]);
790 - React11.useEffect(() => {
1007 + React16.useEffect(() => {
791 1008 if (container) {
792 1009 focusScopesStack.add(focusScope);
793 1010 const previouslyFocusedElement = document.activeElement;
794 1011 const hasFocusedCandidate = container.contains(previouslyFocusedElement);
@@ -817,9 +1034,9 @@
817 1034 }, 0);
818 1035 };
819 1036 }
820 1037 }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
821 - const handleKeyDown = React11.useCallback(
1038 + const handleKeyDown = React16.useCallback(
822 1039 (event) => {
823 1040 if (!loop && !trapped) return;
824 1041 if (focusScope.paused) return;
825 1042 const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
@@ -842,9 +1059,9 @@
842 1059 }
843 1060 },
844 1061 [loop, trapped, focusScope.paused]
845 1062 );
846 - return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
1063 + return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Primitive2.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
847 1064 });
848 1065 FocusScope.displayName = FOCUS_SCOPE_NAME;
849 1066 function focusFirst(candidates, { select = false } = {}) {
850 1067 const previouslyFocusedElement = document.activeElement;
@@ -926,26 +1143,238 @@
926 1143 return items.filter((item) => item.tagName !== "A");
927 1144 }
928 1145
929 1146 // node_modules/@radix-ui/react-portal/dist/index.mjs
930 - var React12 = __toESM(require_react(), 1);
1147 + var React21 = __toESM(require_react(), 1);
931 1148 var import_react_dom = __toESM(require_react_dom(), 1);
932 - var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
1149 +
1150 + // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-primitive/dist/index.mjs
1151 + var React19 = __toESM(require_react(), 1);
1152 + var ReactDOM3 = __toESM(require_react_dom(), 1);
1153 +
1154 + // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-slot/dist/index.mjs
1155 + var React18 = __toESM(require_react(), 1);
1156 +
1157 + // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
1158 + var React17 = __toESM(require_react(), 1);
1159 + function setRef4(ref, value) {
1160 + if (typeof ref === "function") {
1161 + return ref(value);
1162 + } else if (ref !== null && ref !== void 0) {
1163 + ref.current = value;
1164 + }
1165 + }
1166 + function composeRefs4(...refs) {
1167 + return (node) => {
1168 + let hasCleanup = false;
1169 + const cleanups = refs.map((ref) => {
1170 + const cleanup = setRef4(ref, node);
1171 + if (!hasCleanup && typeof cleanup == "function") {
1172 + hasCleanup = true;
1173 + }
1174 + return cleanup;
1175 + });
1176 + if (hasCleanup) {
1177 + return () => {
1178 + for (let i = 0; i < cleanups.length; i++) {
1179 + const cleanup = cleanups[i];
1180 + if (typeof cleanup == "function") {
1181 + cleanup();
1182 + } else {
1183 + setRef4(refs[i], null);
1184 + }
1185 + }
1186 + };
1187 + }
1188 + };
1189 + }
1190 +
1191 + // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-slot/dist/index.mjs
1192 + var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
1193 + // @__NO_SIDE_EFFECTS__
1194 + function createSlot3(ownerName) {
1195 + const SlotClone = /* @__PURE__ */ createSlotClone3(ownerName);
1196 + const Slot2 = React18.forwardRef((props, forwardedRef) => {
1197 + const { children, ...slotProps } = props;
1198 + const childrenArray = React18.Children.toArray(children);
1199 + const slottable = childrenArray.find(isSlottable3);
1200 + if (slottable) {
1201 + const newElement = slottable.props.children;
1202 + const newChildren = childrenArray.map((child) => {
1203 + if (child === slottable) {
1204 + if (React18.Children.count(newElement) > 1) return React18.Children.only(null);
1205 + return React18.isValidElement(newElement) ? newElement.props.children : null;
1206 + } else {
1207 + return child;
1208 + }
1209 + });
1210 + return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React18.isValidElement(newElement) ? React18.cloneElement(newElement, void 0, newChildren) : null });
1211 + }
1212 + return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
1213 + });
1214 + Slot2.displayName = `${ownerName}.Slot`;
1215 + return Slot2;
1216 + }
1217 + // @__NO_SIDE_EFFECTS__
1218 + function createSlotClone3(ownerName) {
1219 + const SlotClone = React18.forwardRef((props, forwardedRef) => {
1220 + const { children, ...slotProps } = props;
1221 + if (React18.isValidElement(children)) {
1222 + const childrenRef = getElementRef3(children);
1223 + const props2 = mergeProps3(slotProps, children.props);
1224 + if (children.type !== React18.Fragment) {
1225 + props2.ref = forwardedRef ? composeRefs4(forwardedRef, childrenRef) : childrenRef;
1226 + }
1227 + return React18.cloneElement(children, props2);
1228 + }
1229 + return React18.Children.count(children) > 1 ? React18.Children.only(null) : null;
1230 + });
1231 + SlotClone.displayName = `${ownerName}.SlotClone`;
1232 + return SlotClone;
1233 + }
1234 + var SLOTTABLE_IDENTIFIER3 = /* @__PURE__ */ Symbol("radix.slottable");
1235 + function isSlottable3(child) {
1236 + return React18.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER3;
1237 + }
1238 + function mergeProps3(slotProps, childProps) {
1239 + const overrideProps = { ...childProps };
1240 + for (const propName in childProps) {
1241 + const slotPropValue = slotProps[propName];
1242 + const childPropValue = childProps[propName];
1243 + const isHandler = /^on[A-Z]/.test(propName);
1244 + if (isHandler) {
1245 + if (slotPropValue && childPropValue) {
1246 + overrideProps[propName] = (...args) => {
1247 + const result = childPropValue(...args);
1248 + slotPropValue(...args);
1249 + return result;
1250 + };
1251 + } else if (slotPropValue) {
1252 + overrideProps[propName] = slotPropValue;
1253 + }
1254 + } else if (propName === "style") {
1255 + overrideProps[propName] = { ...slotPropValue, ...childPropValue };
1256 + } else if (propName === "className") {
1257 + overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
1258 + }
1259 + }
1260 + return { ...slotProps, ...overrideProps };
1261 + }
1262 + function getElementRef3(element) {
1263 + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
1264 + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1265 + if (mayWarn) {
1266 + return element.ref;
1267 + }
1268 + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
1269 + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1270 + if (mayWarn) {
1271 + return element.props.ref;
1272 + }
1273 + return element.props.ref || element.ref;
1274 + }
1275 +
1276 + // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-primitive/dist/index.mjs
1277 + var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
1278 + var NODES3 = [
1279 + "a",
1280 + "button",
1281 + "div",
1282 + "form",
1283 + "h2",
1284 + "h3",
1285 + "img",
1286 + "input",
1287 + "label",
1288 + "li",
1289 + "nav",
1290 + "ol",
1291 + "p",
1292 + "select",
1293 + "span",
1294 + "svg",
1295 + "ul"
1296 + ];
1297 + var Primitive3 = NODES3.reduce((primitive, node) => {
1298 + const Slot2 = createSlot3(`Primitive.${node}`);
1299 + const Node2 = React19.forwardRef((props, forwardedRef) => {
1300 + const { asChild, ...primitiveProps } = props;
1301 + const Comp = asChild ? Slot2 : node;
1302 + if (typeof window !== "undefined") {
1303 + window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
1304 + }
1305 + return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
1306 + });
1307 + Node2.displayName = `Primitive.${node}`;
1308 + return { ...primitive, [node]: Node2 };
1309 + }, {});
1310 +
1311 + // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
1312 + var React20 = __toESM(require_react(), 1);
1313 + var useLayoutEffect22 = globalThis?.document ? React20.useLayoutEffect : () => {
1314 + };
1315 +
1316 + // node_modules/@radix-ui/react-portal/dist/index.mjs
1317 + var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
933 1318 var PORTAL_NAME = "Portal";
934 - var Portal = React12.forwardRef((props, forwardedRef) => {
1319 + var Portal = React21.forwardRef((props, forwardedRef) => {
935 1320 const { container: containerProp, ...portalProps } = props;
936 - const [mounted, setMounted] = React12.useState(false);
937 - useLayoutEffect2(() => setMounted(true), []);
1321 + const [mounted, setMounted] = React21.useState(false);
1322 + useLayoutEffect22(() => setMounted(true), []);
938 1323 const container = containerProp || mounted && globalThis?.document?.body;
939 - return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
1324 + return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Primitive3.div, { ...portalProps, ref: forwardedRef }), container) : null;
940 1325 });
941 1326 Portal.displayName = PORTAL_NAME;
942 1327
943 1328 // node_modules/@radix-ui/react-presence/dist/index.mjs
1329 + var React25 = __toESM(require_react(), 1);
1330 +
1331 + // node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
944 1332 var React23 = __toESM(require_react(), 1);
945 - var React13 = __toESM(require_react(), 1);
1333 + function setRef5(ref, value) {
1334 + if (typeof ref === "function") {
1335 + return ref(value);
1336 + } else if (ref !== null && ref !== void 0) {
1337 + ref.current = value;
1338 + }
1339 + }
1340 + function composeRefs5(...refs) {
1341 + return (node) => {
1342 + let hasCleanup = false;
1343 + const cleanups = refs.map((ref) => {
1344 + const cleanup = setRef5(ref, node);
1345 + if (!hasCleanup && typeof cleanup == "function") {
1346 + hasCleanup = true;
1347 + }
1348 + return cleanup;
1349 + });
1350 + if (hasCleanup) {
1351 + return () => {
1352 + for (let i = 0; i < cleanups.length; i++) {
1353 + const cleanup = cleanups[i];
1354 + if (typeof cleanup == "function") {
1355 + cleanup();
1356 + } else {
1357 + setRef5(refs[i], null);
1358 + }
1359 + }
1360 + };
1361 + }
1362 + };
1363 + }
1364 + function useComposedRefs4(...refs) {
1365 + return React23.useCallback(composeRefs5(...refs), refs);
1366 + }
1367 +
1368 + // node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
1369 + var React24 = __toESM(require_react(), 1);
1370 + var useLayoutEffect23 = globalThis?.document ? React24.useLayoutEffect : () => {
1371 + };
1372 +
1373 + // node_modules/@radix-ui/react-presence/dist/index.mjs
1374 + var React26 = __toESM(require_react(), 1);
946 1375 function useStateMachine(initialState, machine) {
947 - return React13.useReducer((state, event) => {
1376 + return React26.useReducer((state, event) => {
948 1377 const nextState = machine[state][event];
949 1378 return nextState ?? state;
950 1379 }, initialState);
951 1380 }
@@ -951,19 +1380,19 @@
951 1380 }
952 1381 var Presence = (props) => {
953 1382 const { present, children } = props;
954 1383 const presence = usePresence(present);
955 - const child = typeof children === "function" ? children({ present: presence.isPresent }) : React23.Children.only(children);
956 - const ref = useComposedRefs(presence.ref, getElementRef2(child));
1384 + const child = typeof children === "function" ? children({ present: presence.isPresent }) : React25.Children.only(children);
1385 + const ref = useComposedRefs4(presence.ref, getElementRef4(child));
957 1386 const forceMount = typeof children === "function";
958 - return forceMount || presence.isPresent ? React23.cloneElement(child, { ref }) : null;
1387 + return forceMount || presence.isPresent ? React25.cloneElement(child, { ref }) : null;
959 1388 };
960 1389 Presence.displayName = "Presence";
961 1390 function usePresence(present) {
962 - const [node, setNode] = React23.useState();
963 - const stylesRef = React23.useRef(null);
964 - const prevPresentRef = React23.useRef(present);
965 - const prevAnimationNameRef = React23.useRef("none");
1391 + const [node, setNode] = React25.useState();
1392 + const stylesRef = React25.useRef(null);
1393 + const prevPresentRef = React25.useRef(present);
1394 + const prevAnimationNameRef = React25.useRef("none");
966 1395 const initialState = present ? "mounted" : "unmounted";
967 1396 const [state, send] = useStateMachine(initialState, {
968 1397 mounted: {
969 1398 UNMOUNT: "unmounted",
@@ -976,13 +1405,13 @@
976 1405 unmounted: {
977 1406 MOUNT: "mounted"
978 1407 }
979 1408 });
980 - React23.useEffect(() => {
1409 + React25.useEffect(() => {
981 1410 const currentAnimationName = getAnimationName(stylesRef.current);
982 1411 prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
983 1412 }, [state]);
984 - useLayoutEffect2(() => {
1413 + useLayoutEffect23(() => {
985 1414 const styles = stylesRef.current;
986 1415 const wasPresent = prevPresentRef.current;
987 1416 const hasPresentChanged = wasPresent !== present;
988 1417 if (hasPresentChanged) {
@@ -1002,9 +1431,9 @@
1002 1431 }
1003 1432 prevPresentRef.current = present;
1004 1433 }
1005 1434 }, [present, send]);
1006 - useLayoutEffect2(() => {
1435 + useLayoutEffect23(() => {
1007 1436 if (node) {
1008 1437 let timeoutId;
1009 1438 const ownerWindow = node.ownerDocument.defaultView ?? window;
1010 1439 const handleAnimationEnd = (event) => {
@@ -1042,9 +1471,9 @@
1042 1471 }
1043 1472 }, [node, send]);
1044 1473 return {
1045 1474 isPresent: ["mounted", "unmountSuspended"].includes(state),
1046 - ref: React23.useCallback((node2) => {
1475 + ref: React25.useCallback((node2) => {
1047 1476 stylesRef.current = node2 ? getComputedStyle(node2) : null;
1048 1477 setNode(node2);
1049 1478 }, [])
1050 1479 };
@@ -1051,9 +1480,9 @@
1051 1480 }
1052 1481 function getAnimationName(styles) {
1053 1482 return styles?.animationName || "none";
1054 1483 }
1055 - function getElementRef2(element) {
1484 + function getElementRef4(element) {
1056 1485 let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
1057 1486 let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1058 1487 if (mayWarn) {
1059 1488 return element.ref;
@@ -1065,13 +1494,138 @@
1065 1494 }
1066 1495 return element.props.ref || element.ref;
1067 1496 }
1068 1497
1498 + // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.mjs
1499 + var React28 = __toESM(require_react(), 1);
1500 + var ReactDOM5 = __toESM(require_react_dom(), 1);
1501 +
1502 + // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs
1503 + var React27 = __toESM(require_react(), 1);
1504 + var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
1505 + // @__NO_SIDE_EFFECTS__
1506 + function createSlot4(ownerName) {
1507 + const SlotClone = /* @__PURE__ */ createSlotClone4(ownerName);
1508 + const Slot2 = React27.forwardRef((props, forwardedRef) => {
1509 + const { children, ...slotProps } = props;
1510 + const childrenArray = React27.Children.toArray(children);
1511 + const slottable = childrenArray.find(isSlottable4);
1512 + if (slottable) {
1513 + const newElement = slottable.props.children;
1514 + const newChildren = childrenArray.map((child) => {
1515 + if (child === slottable) {
1516 + if (React27.Children.count(newElement) > 1) return React27.Children.only(null);
1517 + return React27.isValidElement(newElement) ? newElement.props.children : null;
1518 + } else {
1519 + return child;
1520 + }
1521 + });
1522 + return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React27.isValidElement(newElement) ? React27.cloneElement(newElement, void 0, newChildren) : null });
1523 + }
1524 + return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
1525 + });
1526 + Slot2.displayName = `${ownerName}.Slot`;
1527 + return Slot2;
1528 + }
1529 + // @__NO_SIDE_EFFECTS__
1530 + function createSlotClone4(ownerName) {
1531 + const SlotClone = React27.forwardRef((props, forwardedRef) => {
1532 + const { children, ...slotProps } = props;
1533 + if (React27.isValidElement(children)) {
1534 + const childrenRef = getElementRef5(children);
1535 + const props2 = mergeProps4(slotProps, children.props);
1536 + if (children.type !== React27.Fragment) {
1537 + props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
1538 + }
1539 + return React27.cloneElement(children, props2);
1540 + }
1541 + return React27.Children.count(children) > 1 ? React27.Children.only(null) : null;
1542 + });
1543 + SlotClone.displayName = `${ownerName}.SlotClone`;
1544 + return SlotClone;
1545 + }
1546 + var SLOTTABLE_IDENTIFIER4 = /* @__PURE__ */ Symbol("radix.slottable");
1547 + function isSlottable4(child) {
1548 + return React27.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER4;
1549 + }
1550 + function mergeProps4(slotProps, childProps) {
1551 + const overrideProps = { ...childProps };
1552 + for (const propName in childProps) {
1553 + const slotPropValue = slotProps[propName];
1554 + const childPropValue = childProps[propName];
1555 + const isHandler = /^on[A-Z]/.test(propName);
1556 + if (isHandler) {
1557 + if (slotPropValue && childPropValue) {
1558 + overrideProps[propName] = (...args) => {
1559 + const result = childPropValue(...args);
1560 + slotPropValue(...args);
1561 + return result;
1562 + };
1563 + } else if (slotPropValue) {
1564 + overrideProps[propName] = slotPropValue;
1565 + }
1566 + } else if (propName === "style") {
1567 + overrideProps[propName] = { ...slotPropValue, ...childPropValue };
1568 + } else if (propName === "className") {
1569 + overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
1570 + }
1571 + }
1572 + return { ...slotProps, ...overrideProps };
1573 + }
1574 + function getElementRef5(element) {
1575 + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
1576 + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1577 + if (mayWarn) {
1578 + return element.ref;
1579 + }
1580 + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
1581 + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1582 + if (mayWarn) {
1583 + return element.props.ref;
1584 + }
1585 + return element.props.ref || element.ref;
1586 + }
1587 +
1588 + // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.mjs
1589 + var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
1590 + var NODES4 = [
1591 + "a",
1592 + "button",
1593 + "div",
1594 + "form",
1595 + "h2",
1596 + "h3",
1597 + "img",
1598 + "input",
1599 + "label",
1600 + "li",
1601 + "nav",
1602 + "ol",
1603 + "p",
1604 + "select",
1605 + "span",
1606 + "svg",
1607 + "ul"
1608 + ];
1609 + var Primitive4 = NODES4.reduce((primitive, node) => {
1610 + const Slot2 = createSlot4(`Primitive.${node}`);
1611 + const Node2 = React28.forwardRef((props, forwardedRef) => {
1612 + const { asChild, ...primitiveProps } = props;
1613 + const Comp = asChild ? Slot2 : node;
1614 + if (typeof window !== "undefined") {
1615 + window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
1616 + }
1617 + return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
1618 + });
1619 + Node2.displayName = `Primitive.${node}`;
1620 + return { ...primitive, [node]: Node2 };
1621 + }, {});
1622 +
1069 1623 // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
1070 - var React14 = __toESM(require_react(), 1);
1624 + var React29 = __toESM(require_react(), 1);
1071 1625 var count2 = 0;
1072 1626 function useFocusGuards() {
1073 - React14.useEffect(() => {
1627 + React29.useEffect(() => {
1074 1628 const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
1075 1629 document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
1076 1630 document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
1077 1631 count2++;
@@ -1126,12 +1680,12 @@
1126 1680 return to.concat(ar || Array.prototype.slice.call(from));
1127 1681 }
1128 1682
1129 1683 // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/Combination.js
1130 - var React21 = __toESM(require_react());
1684 + var React36 = __toESM(require_react());
1131 1685
1132 1686 // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/UI.js
1133 - var React17 = __toESM(require_react());
1687 + var React32 = __toESM(require_react());
1134 1688
1135 1689 // node_modules/react-remove-scroll-bar/dist/es2015/constants.js
1136 1690 var zeroRightClassName = "right-scroll-bar-position";
1137 1691 var fullWidthClassName = "width-before-scroll-bar";
@@ -1149,9 +1703,9 @@
1149 1703 }
1150 1704
1151 1705 // node_modules/use-callback-ref/dist/es2015/useRef.js
1152 1706 var import_react = __toESM(require_react());
1153 - function useCallbackRef2(initialValue, callback) {
1707 + function useCallbackRef3(initialValue, callback) {
1154 1708 var ref = (0, import_react.useState)(function() {
1155 1709 return {
1156 1710 // value
1157 1711 value: initialValue,
@@ -1176,13 +1730,13 @@
1176 1730 return ref.facade;
1177 1731 }
1178 1732
1179 1733 // node_modules/use-callback-ref/dist/es2015/useMergeRef.js
1180 - var React15 = __toESM(require_react());
1181 - var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React15.useLayoutEffect : React15.useEffect;
1734 + var React30 = __toESM(require_react());
1735 + var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React30.useLayoutEffect : React30.useEffect;
1182 1736 var currentValues = /* @__PURE__ */ new WeakMap();
1183 1737 function useMergeRefs(refs, defaultValue) {
1184 - var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
1738 + var callbackRef = useCallbackRef3(defaultValue || null, function(newValue) {
1185 1739 return refs.forEach(function(ref) {
1186 1740 return assignRef(ref, newValue);
1187 1741 });
1188 1742 });
@@ -1294,9 +1848,9 @@
1294 1848 return medium;
1295 1849 }
1296 1850
1297 1851 // node_modules/use-sidecar/dist/es2015/exports.js
1298 - var React16 = __toESM(require_react());
1852 + var React31 = __toESM(require_react());
1299 1853 var SideCar = function(_a) {
1300 1854 var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
1301 1855 if (!sideCar) {
1302 1856 throw new Error("Sidecar: please provide `sideCar` property to import the right car");
@@ -1304,9 +1858,9 @@
1304 1858 var Target = sideCar.read();
1305 1859 if (!Target) {
1306 1860 throw new Error("Sidecar medium not found");
1307 1861 }
1308 - return React16.createElement(Target, __assign({}, rest));
1862 + return React31.createElement(Target, __assign({}, rest));
1309 1863 };
1310 1864 SideCar.isSideCarExport = true;
1311 1865 function exportSidecar(medium, exported) {
1312 1866 medium.useMedium(exported);
@@ -1319,11 +1873,11 @@
1319 1873 // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/UI.js
1320 1874 var nothing = function() {
1321 1875 return;
1322 1876 };
1323 - var RemoveScroll = React17.forwardRef(function(props, parentRef) {
1324 - var ref = React17.useRef(null);
1325 - var _a = React17.useState({
1877 + var RemoveScroll = React32.forwardRef(function(props, parentRef) {
1878 + var ref = React32.useRef(null);
1879 + var _a = React32.useState({
1326 1880 onScrollCapture: nothing,
1327 1881 onWheelCapture: nothing,
1328 1882 onTouchMoveCapture: nothing
1329 1883 }), callbacks = _a[0], setCallbacks = _a[1];
@@ -1330,13 +1884,13 @@
1330 1884 var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
1331 1885 var SideCar2 = sideCar;
1332 1886 var containerRef = useMergeRefs([ref, parentRef]);
1333 1887 var containerProps = __assign(__assign({}, rest), callbacks);
1334 - return React17.createElement(
1335 - React17.Fragment,
1888 + return React32.createElement(
1889 + React32.Fragment,
1336 1890 null,
1337 - enabled && React17.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
1338 - forwardProps ? React17.cloneElement(React17.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React17.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
1891 + enabled && React32.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
1892 + forwardProps ? React32.cloneElement(React32.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React32.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
1339 1893 );
1340 1894 });
1341 1895 RemoveScroll.defaultProps = {
1342 1896 enabled: true,
@@ -1348,15 +1902,15 @@
1348 1902 zeroRight: zeroRightClassName
1349 1903 };
1350 1904
1351 1905 // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
1352 - var React20 = __toESM(require_react());
1906 + var React35 = __toESM(require_react());
1353 1907
1354 1908 // node_modules/react-remove-scroll-bar/dist/es2015/component.js
1355 - var React19 = __toESM(require_react());
1909 + var React34 = __toESM(require_react());
1356 1910
1357 1911 // node_modules/react-style-singleton/dist/es2015/hook.js
1358 - var React18 = __toESM(require_react());
1912 + var React33 = __toESM(require_react());
1359 1913
1360 1914 // node_modules/get-nonce/dist/es2015/index.js
1361 1915 var currentNonce;
1362 1916 var getNonce = function() {
@@ -1418,9 +1972,9 @@
1418 1972 // node_modules/react-style-singleton/dist/es2015/hook.js
1419 1973 var styleHookSingleton = function() {
1420 1974 var sheet = stylesheetSingleton();
1421 1975 return function(styles, isDynamic) {
1422 - React18.useEffect(function() {
1976 + React33.useEffect(function() {
1423 1977 sheet.add(styles);
1424 1978 return function() {
1425 1979 sheet.remove();
1426 1980 };
@@ -1492,9 +2046,9 @@
1492 2046 var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
1493 2047 return isFinite(counter) ? counter : 0;
1494 2048 };
1495 2049 var useLockAttribute = function() {
1496 - React19.useEffect(function() {
2050 + React34.useEffect(function() {
1497 2051 document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
1498 2052 return function() {
1499 2053 var newCounter = getCurrentUseCounter() - 1;
1500 2054 if (newCounter <= 0) {
@@ -1507,12 +2061,12 @@
1507 2061 };
1508 2062 var RemoveScrollBar = function(_a) {
1509 2063 var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
1510 2064 useLockAttribute();
1511 - var gap = React19.useMemo(function() {
2065 + var gap = React34.useMemo(function() {
1512 2066 return getGapWidth(gapMode);
1513 2067 }, [gapMode]);
1514 - return React19.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
2068 + return React34.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
1515 2069 };
1516 2070
1517 2071 // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
1518 2072 var passiveSupported = false;
@@ -1651,18 +2205,18 @@
1651 2205 };
1652 2206 var idCounter = 0;
1653 2207 var lockStack = [];
1654 2208 function RemoveScrollSideCar(props) {
1655 - var shouldPreventQueue = React20.useRef([]);
1656 - var touchStartRef = React20.useRef([0, 0]);
1657 - var activeAxis = React20.useRef();
1658 - var id = React20.useState(idCounter++)[0];
1659 - var Style2 = React20.useState(styleSingleton)[0];
1660 - var lastProps = React20.useRef(props);
1661 - React20.useEffect(function() {
2209 + var shouldPreventQueue = React35.useRef([]);
2210 + var touchStartRef = React35.useRef([0, 0]);
2211 + var activeAxis = React35.useRef();
2212 + var id = React35.useState(idCounter++)[0];
2213 + var Style2 = React35.useState(styleSingleton)[0];
2214 + var lastProps = React35.useRef(props);
2215 + React35.useEffect(function() {
1662 2216 lastProps.current = props;
1663 2217 }, [props]);
1664 - React20.useEffect(function() {
2218 + React35.useEffect(function() {
1665 2219 if (props.inert) {
1666 2220 document.body.classList.add("block-interactivity-".concat(id));
1667 2221 var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
1668 2222 allow_1.forEach(function(el) {
@@ -1676,9 +2230,9 @@
1676 2230 };
1677 2231 }
1678 2232 return;
1679 2233 }, [props.inert, props.lockRef.current, props.shards]);
1680 - var shouldCancelEvent = React20.useCallback(function(event, parent) {
2234 + var shouldCancelEvent = React35.useCallback(function(event, parent) {
1681 2235 if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
1682 2236 return !lastProps.current.allowPinchZoom;
1683 2237 }
1684 2238 var touch = getTouchXY(event);
@@ -1712,9 +2266,9 @@
1712 2266 }
1713 2267 var cancelingAxis = activeAxis.current || currentAxis;
1714 2268 return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
1715 2269 }, []);
1716 - var shouldPrevent = React20.useCallback(function(_event) {
2270 + var shouldPrevent = React35.useCallback(function(_event) {
1717 2271 var event = _event;
1718 2272 if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
1719 2273 return;
1720 2274 }
@@ -1739,9 +2293,9 @@
1739 2293 }
1740 2294 }
1741 2295 }
1742 2296 }, []);
1743 - var shouldCancel = React20.useCallback(function(name, delta, target, should) {
2297 + var shouldCancel = React35.useCallback(function(name, delta, target, should) {
1744 2298 var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
1745 2299 shouldPreventQueue.current.push(event);
1746 2300 setTimeout(function() {
1747 2301 shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
@@ -1748,19 +2302,19 @@
1748 2302 return e !== event;
1749 2303 });
1750 2304 }, 1);
1751 2305 }, []);
1752 - var scrollTouchStart = React20.useCallback(function(event) {
2306 + var scrollTouchStart = React35.useCallback(function(event) {
1753 2307 touchStartRef.current = getTouchXY(event);
1754 2308 activeAxis.current = void 0;
1755 2309 }, []);
1756 - var scrollWheel = React20.useCallback(function(event) {
2310 + var scrollWheel = React35.useCallback(function(event) {
1757 2311 shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1758 2312 }, []);
1759 - var scrollTouchMove = React20.useCallback(function(event) {
2313 + var scrollTouchMove = React35.useCallback(function(event) {
1760 2314 shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1761 2315 }, []);
1762 - React20.useEffect(function() {
2316 + React35.useEffect(function() {
1763 2317 lockStack.push(Style2);
1764 2318 props.setCallbacks({
1765 2319 onScrollCapture: scrollWheel,
1766 2320 onWheelCapture: scrollWheel,
@@ -1778,13 +2332,13 @@
1778 2332 document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
1779 2333 };
1780 2334 }, []);
1781 2335 var removeScrollBar = props.removeScrollBar, inert = props.inert;
1782 - return React20.createElement(
1783 - React20.Fragment,
2336 + return React35.createElement(
2337 + React35.Fragment,
1784 2338 null,
1785 - inert ? React20.createElement(Style2, { styles: generateStyle(id) }) : null,
1786 - removeScrollBar ? React20.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
2339 + inert ? React35.createElement(Style2, { styles: generateStyle(id) }) : null,
2340 + removeScrollBar ? React35.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
1787 2341 );
1788 2342 }
1789 2343 function getOutermostShadowParent(node) {
1790 2344 var shadowParent = null;
@@ -1801,10 +2355,10 @@
1801 2355 // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/sidecar.js
1802 2356 var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
1803 2357
1804 2358 // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/Combination.js
1805 - var ReactRemoveScroll = React21.forwardRef(function(props, ref) {
1806 - return React21.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
2359 + var ReactRemoveScroll = React36.forwardRef(function(props, ref) {
2360 + return React36.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
1807 2361 });
1808 2362 ReactRemoveScroll.classNames = RemoveScroll.classNames;
1809 2363 var Combination_default = ReactRemoveScroll;
1810 2364
@@ -1929,9 +2483,9 @@
1929 2483 return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
1930 2484 };
1931 2485
1932 2486 // node_modules/@radix-ui/react-dialog/dist/index.mjs
1933 - var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
2487 + var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
1934 2488 var DIALOG_NAME = "Dialog";
1935 2489 var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
1936 2490 var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
1937 2491 var Dialog = (props) => {
@@ -1942,10 +2496,10 @@
1942 2496 defaultOpen,
1943 2497 onOpenChange,
1944 2498 modal = true
1945 2499 } = props;
1946 - const triggerRef = React24.useRef(null);
1947 - const contentRef = React24.useRef(null);
2500 + const triggerRef = React37.useRef(null);
2501 + const contentRef = React37.useRef(null);
1948 2502 const [open2, setOpen] = useControllableState({
1949 2503 prop: openProp,
1950 2504 defaultProp: defaultOpen ?? false,
1951 2505 onChange: onOpenChange,
@@ -1950,9 +2504,9 @@
1950 2504 defaultProp: defaultOpen ?? false,
1951 2505 onChange: onOpenChange,
1952 2506 caller: DIALOG_NAME
1953 2507 });
1954 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2508 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1955 2509 DialogProvider,
1956 2510 {
1957 2511 scope: __scopeDialog,
1958 2512 triggerRef,
@@ -1961,9 +2515,9 @@
1961 2515 titleId: useId(),
1962 2516 descriptionId: useId(),
1963 2517 open: open2,
1964 2518 onOpenChange: setOpen,
1965 - onOpenToggle: React24.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
2519 + onOpenToggle: React37.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
1966 2520 modal,
1967 2521 children
1968 2522 }
1969 2523 );
@@ -1969,15 +2523,15 @@
1969 2523 );
1970 2524 };
1971 2525 Dialog.displayName = DIALOG_NAME;
1972 2526 var TRIGGER_NAME = "DialogTrigger";
1973 - var DialogTrigger = React24.forwardRef(
2527 + var DialogTrigger = React37.forwardRef(
1974 2528 (props, forwardedRef) => {
1975 2529 const { __scopeDialog, ...triggerProps } = props;
1976 2530 const context2 = useDialogContext(TRIGGER_NAME, __scopeDialog);
1977 2531 const composedTriggerRef = useComposedRefs(forwardedRef, context2.triggerRef);
1978 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1979 - Primitive.button,
2532 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2533 + Primitive4.button,
1980 2534 {
1981 2535 type: "button",
1982 2536 "aria-haspopup": "dialog",
1983 2537 "aria-expanded": context2.open,
@@ -1997,23 +2551,23 @@
1997 2551 });
1998 2552 var DialogPortal = (props) => {
1999 2553 const { __scopeDialog, forceMount, children, container } = props;
2000 2554 const context2 = useDialogContext(PORTAL_NAME2, __scopeDialog);
2001 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React24.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Presence, { present: forceMount || context2.open, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Portal, { asChild: true, container, children: child }) })) });
2555 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React37.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Presence, { present: forceMount || context2.open, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Portal, { asChild: true, container, children: child }) })) });
2002 2556 };
2003 2557 DialogPortal.displayName = PORTAL_NAME2;
2004 2558 var OVERLAY_NAME = "DialogOverlay";
2005 - var DialogOverlay = React24.forwardRef(
2559 + var DialogOverlay = React37.forwardRef(
2006 2560 (props, forwardedRef) => {
2007 2561 const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
2008 2562 const { forceMount = portalContext.forceMount, ...overlayProps } = props;
2009 2563 const context2 = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
2010 - return context2.modal ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Presence, { present: forceMount || context2.open, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
2564 + return context2.modal ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Presence, { present: forceMount || context2.open, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
2011 2565 }
2012 2566 );
2013 2567 DialogOverlay.displayName = OVERLAY_NAME;
2014 - var Slot = createSlot("DialogOverlay.RemoveScroll");
2015 - var DialogOverlayImpl = React24.forwardRef(
2568 + var Slot = createSlot4("DialogOverlay.RemoveScroll");
2569 + var DialogOverlayImpl = React37.forwardRef(
2016 2570 (props, forwardedRef) => {
2017 2571 const { __scopeDialog, ...overlayProps } = props;
2018 2572 const context2 = useDialogContext(OVERLAY_NAME, __scopeDialog);
2019 2573 return (
@@ -2018,10 +2572,10 @@
2018 2572 const context2 = useDialogContext(OVERLAY_NAME, __scopeDialog);
2019 2573 return (
2020 2574 // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
2021 2575 // ie. when `Overlay` and `Content` are siblings
2022 - /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Combination_default, { as: Slot, allowPinchZoom: true, shards: [context2.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2023 - Primitive.div,
2576 + /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Combination_default, { as: Slot, allowPinchZoom: true, shards: [context2.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2577 + Primitive4.div,
2024 2578 {
2025 2579 "data-state": getState(context2.open),
2026 2580 ...overlayProps,
2027 2581 ref: forwardedRef,
@@ -2031,27 +2585,27 @@
2031 2585 );
2032 2586 }
2033 2587 );
2034 2588 var CONTENT_NAME = "DialogContent";
2035 - var DialogContent = React24.forwardRef(
2589 + var DialogContent = React37.forwardRef(
2036 2590 (props, forwardedRef) => {
2037 2591 const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
2038 2592 const { forceMount = portalContext.forceMount, ...contentProps } = props;
2039 2593 const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog);
2040 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Presence, { present: forceMount || context2.open, children: context2.modal ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
2594 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Presence, { present: forceMount || context2.open, children: context2.modal ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
2041 2595 }
2042 2596 );
2043 2597 DialogContent.displayName = CONTENT_NAME;
2044 - var DialogContentModal = React24.forwardRef(
2598 + var DialogContentModal = React37.forwardRef(
2045 2599 (props, forwardedRef) => {
2046 2600 const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog);
2047 - const contentRef = React24.useRef(null);
2601 + const contentRef = React37.useRef(null);
2048 2602 const composedRefs = useComposedRefs(forwardedRef, context2.contentRef, contentRef);
2049 - React24.useEffect(() => {
2603 + React37.useEffect(() => {
2050 2604 const content = contentRef.current;
2051 2605 if (content) return hideOthers(content);
2052 2606 }, []);
2053 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2607 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2054 2608 DialogContentImpl,
2055 2609 {
2056 2610 ...props,
2057 2611 ref: composedRefs,
@@ -2074,14 +2628,14 @@
2074 2628 }
2075 2629 );
2076 2630 }
2077 2631 );
2078 - var DialogContentNonModal = React24.forwardRef(
2632 + var DialogContentNonModal = React37.forwardRef(
2079 2633 (props, forwardedRef) => {
2080 2634 const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog);
2081 - const hasInteractedOutsideRef = React24.useRef(false);
2082 - const hasPointerDownOutsideRef = React24.useRef(false);
2083 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2635 + const hasInteractedOutsideRef = React37.useRef(false);
2636 + const hasPointerDownOutsideRef = React37.useRef(false);
2637 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2084 2638 DialogContentImpl,
2085 2639 {
2086 2640 ...props,
2087 2641 ref: forwardedRef,
@@ -2114,17 +2668,17 @@
2114 2668 }
2115 2669 );
2116 2670 }
2117 2671 );
2118 - var DialogContentImpl = React24.forwardRef(
2672 + var DialogContentImpl = React37.forwardRef(
2119 2673 (props, forwardedRef) => {
2120 2674 const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
2121 2675 const context2 = useDialogContext(CONTENT_NAME, __scopeDialog);
2122 - const contentRef = React24.useRef(null);
2676 + const contentRef = React37.useRef(null);
2123 2677 const composedRefs = useComposedRefs(forwardedRef, contentRef);
2124 2678 useFocusGuards();
2125 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2126 - /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2679 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
2680 + /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2127 2681 FocusScope,
2128 2682 {
2129 2683 asChild: true,
2130 2684 loop: true,
@@ -2130,9 +2684,9 @@
2130 2684 loop: true,
2131 2685 trapped: trapFocus,
2132 2686 onMountAutoFocus: onOpenAutoFocus,
2133 2687 onUnmountAutoFocus: onCloseAutoFocus,
2134 - children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2688 + children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2135 2689 DismissableLayer,
2136 2690 {
2137 2691 role: "dialog",
2138 2692 id: context2.contentId,
@@ -2145,40 +2699,40 @@
2145 2699 }
2146 2700 )
2147 2701 }
2148 2702 ),
2149 - /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2150 - /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TitleWarning, { titleId: context2.titleId }),
2151 - /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DescriptionWarning, { contentRef, descriptionId: context2.descriptionId })
2703 + /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
2704 + /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TitleWarning, { titleId: context2.titleId }),
2705 + /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DescriptionWarning, { contentRef, descriptionId: context2.descriptionId })
2152 2706 ] })
2153 2707 ] });
2154 2708 }
2155 2709 );
2156 2710 var TITLE_NAME = "DialogTitle";
2157 - var DialogTitle = React24.forwardRef(
2711 + var DialogTitle = React37.forwardRef(
2158 2712 (props, forwardedRef) => {
2159 2713 const { __scopeDialog, ...titleProps } = props;
2160 2714 const context2 = useDialogContext(TITLE_NAME, __scopeDialog);
2161 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Primitive.h2, { id: context2.titleId, ...titleProps, ref: forwardedRef });
2715 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Primitive4.h2, { id: context2.titleId, ...titleProps, ref: forwardedRef });
2162 2716 }
2163 2717 );
2164 2718 DialogTitle.displayName = TITLE_NAME;
2165 2719 var DESCRIPTION_NAME = "DialogDescription";
2166 - var DialogDescription = React24.forwardRef(
2720 + var DialogDescription = React37.forwardRef(
2167 2721 (props, forwardedRef) => {
2168 2722 const { __scopeDialog, ...descriptionProps } = props;
2169 2723 const context2 = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
2170 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Primitive.p, { id: context2.descriptionId, ...descriptionProps, ref: forwardedRef });
2724 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Primitive4.p, { id: context2.descriptionId, ...descriptionProps, ref: forwardedRef });
2171 2725 }
2172 2726 );
2173 2727 DialogDescription.displayName = DESCRIPTION_NAME;
2174 2728 var CLOSE_NAME = "DialogClose";
2175 - var DialogClose = React24.forwardRef(
2729 + var DialogClose = React37.forwardRef(
2176 2730 (props, forwardedRef) => {
2177 2731 const { __scopeDialog, ...closeProps } = props;
2178 2732 const context2 = useDialogContext(CLOSE_NAME, __scopeDialog);
2179 - return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2180 - Primitive.button,
2733 + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2734 + Primitive4.button,
2181 2735 {
2182 2736 type: "button",
2183 2737 ...closeProps,
2184 2738 ref: forwardedRef,
@@ -2203,9 +2757,9 @@
2203 2757
2204 2758 If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
2205 2759
2206 2760 For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
2207 - React24.useEffect(() => {
2761 + React37.useEffect(() => {
2208 2762 if (titleId) {
2209 2763 const hasTitle = document.getElementById(titleId);
2210 2764 if (!hasTitle) console.error(MESSAGE);
2211 2765 }
@@ -2215,9 +2769,9 @@
2215 2769 var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
2216 2770 var DescriptionWarning = ({ contentRef, descriptionId }) => {
2217 2771 const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
2218 2772 const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
2219 - React24.useEffect(() => {
2773 + React37.useEffect(() => {
2220 2774 const describedById = contentRef.current?.getAttribute("aria-describedby");
2221 2775 if (descriptionId && describedById) {
2222 2776 const hasDescription = document.getElementById(descriptionId);
2223 2777 if (!hasDescription) console.warn(MESSAGE);
@@ -2231,8 +2785,204 @@
2231 2785 var Content = DialogContent;
2232 2786
2233 2787 // node_modules/cmdk/dist/index.mjs
2234 2788 var t = __toESM(require_react(), 1);
2789 +
2790 + // node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.mjs
2791 + var React40 = __toESM(require_react(), 1);
2792 + var ReactDOM6 = __toESM(require_react_dom(), 1);
2793 +
2794 + // node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.mjs
2795 + var React39 = __toESM(require_react(), 1);
2796 +
2797 + // node_modules/cmdk/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
2798 + var React38 = __toESM(require_react(), 1);
2799 + function setRef6(ref, value) {
2800 + if (typeof ref === "function") {
2801 + return ref(value);
2802 + } else if (ref !== null && ref !== void 0) {
2803 + ref.current = value;
2804 + }
2805 + }
2806 + function composeRefs6(...refs) {
2807 + return (node) => {
2808 + let hasCleanup = false;
2809 + const cleanups = refs.map((ref) => {
2810 + const cleanup = setRef6(ref, node);
2811 + if (!hasCleanup && typeof cleanup == "function") {
2812 + hasCleanup = true;
2813 + }
2814 + return cleanup;
2815 + });
2816 + if (hasCleanup) {
2817 + return () => {
2818 + for (let i = 0; i < cleanups.length; i++) {
2819 + const cleanup = cleanups[i];
2820 + if (typeof cleanup == "function") {
2821 + cleanup();
2822 + } else {
2823 + setRef6(refs[i], null);
2824 + }
2825 + }
2826 + };
2827 + }
2828 + };
2829 + }
2830 +
2831 + // node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.mjs
2832 + var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
2833 + var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
2834 + var use = React39[" use ".trim().toString()];
2835 + function isPromiseLike(value) {
2836 + return typeof value === "object" && value !== null && "then" in value;
2837 + }
2838 + function isLazyComponent(element) {
2839 + return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
2840 + }
2841 + // @__NO_SIDE_EFFECTS__
2842 + function createSlot5(ownerName) {
2843 + const SlotClone = /* @__PURE__ */ createSlotClone5(ownerName);
2844 + const Slot2 = React39.forwardRef((props, forwardedRef) => {
2845 + let { children, ...slotProps } = props;
2846 + if (isLazyComponent(children) && typeof use === "function") {
2847 + children = use(children._payload);
2848 + }
2849 + const childrenArray = React39.Children.toArray(children);
2850 + const slottable = childrenArray.find(isSlottable5);
2851 + if (slottable) {
2852 + const newElement = slottable.props.children;
2853 + const newChildren = childrenArray.map((child) => {
2854 + if (child === slottable) {
2855 + if (React39.Children.count(newElement) > 1) return React39.Children.only(null);
2856 + return React39.isValidElement(newElement) ? newElement.props.children : null;
2857 + } else {
2858 + return child;
2859 + }
2860 + });
2861 + return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React39.isValidElement(newElement) ? React39.cloneElement(newElement, void 0, newChildren) : null });
2862 + }
2863 + return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
2864 + });
2865 + Slot2.displayName = `${ownerName}.Slot`;
2866 + return Slot2;
2867 + }
2868 + // @__NO_SIDE_EFFECTS__
2869 + function createSlotClone5(ownerName) {
2870 + const SlotClone = React39.forwardRef((props, forwardedRef) => {
2871 + let { children, ...slotProps } = props;
2872 + if (isLazyComponent(children) && typeof use === "function") {
2873 + children = use(children._payload);
2874 + }
2875 + if (React39.isValidElement(children)) {
2876 + const childrenRef = getElementRef6(children);
2877 + const props2 = mergeProps5(slotProps, children.props);
2878 + if (children.type !== React39.Fragment) {
2879 + props2.ref = forwardedRef ? composeRefs6(forwardedRef, childrenRef) : childrenRef;
2880 + }
2881 + return React39.cloneElement(children, props2);
2882 + }
2883 + return React39.Children.count(children) > 1 ? React39.Children.only(null) : null;
2884 + });
2885 + SlotClone.displayName = `${ownerName}.SlotClone`;
2886 + return SlotClone;
2887 + }
2888 + var SLOTTABLE_IDENTIFIER5 = /* @__PURE__ */ Symbol("radix.slottable");
2889 + function isSlottable5(child) {
2890 + return React39.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER5;
2891 + }
2892 + function mergeProps5(slotProps, childProps) {
2893 + const overrideProps = { ...childProps };
2894 + for (const propName in childProps) {
2895 + const slotPropValue = slotProps[propName];
2896 + const childPropValue = childProps[propName];
2897 + const isHandler = /^on[A-Z]/.test(propName);
2898 + if (isHandler) {
2899 + if (slotPropValue && childPropValue) {
2900 + overrideProps[propName] = (...args) => {
2901 + const result = childPropValue(...args);
2902 + slotPropValue(...args);
2903 + return result;
2904 + };
2905 + } else if (slotPropValue) {
2906 + overrideProps[propName] = slotPropValue;
2907 + }
2908 + } else if (propName === "style") {
2909 + overrideProps[propName] = { ...slotPropValue, ...childPropValue };
2910 + } else if (propName === "className") {
2911 + overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
2912 + }
2913 + }
2914 + return { ...slotProps, ...overrideProps };
2915 + }
2916 + function getElementRef6(element) {
2917 + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
2918 + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
2919 + if (mayWarn) {
2920 + return element.ref;
2921 + }
2922 + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
2923 + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
2924 + if (mayWarn) {
2925 + return element.props.ref;
2926 + }
2927 + return element.props.ref || element.ref;
2928 + }
2929 +
2930 + // node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.mjs
2931 + var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
2932 + var NODES5 = [
2933 + "a",
2934 + "button",
2935 + "div",
2936 + "form",
2937 + "h2",
2938 + "h3",
2939 + "img",
2940 + "input",
2941 + "label",
2942 + "li",
2943 + "nav",
2944 + "ol",
2945 + "p",
2946 + "select",
2947 + "span",
2948 + "svg",
2949 + "ul"
2950 + ];
2951 + var Primitive5 = NODES5.reduce((primitive, node) => {
2952 + const Slot2 = createSlot5(`Primitive.${node}`);
2953 + const Node2 = React40.forwardRef((props, forwardedRef) => {
2954 + const { asChild, ...primitiveProps } = props;
2955 + const Comp = asChild ? Slot2 : node;
2956 + if (typeof window !== "undefined") {
2957 + window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
2958 + }
2959 + return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
2960 + });
2961 + Node2.displayName = `Primitive.${node}`;
2962 + return { ...primitive, [node]: Node2 };
2963 + }, {});
2964 +
2965 + // node_modules/cmdk/node_modules/@radix-ui/react-id/dist/index.mjs
2966 + var React42 = __toESM(require_react(), 1);
2967 +
2968 + // node_modules/cmdk/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
2969 + var React41 = __toESM(require_react(), 1);
2970 + var useLayoutEffect24 = globalThis?.document ? React41.useLayoutEffect : () => {
2971 + };
2972 +
2973 + // node_modules/cmdk/node_modules/@radix-ui/react-id/dist/index.mjs
2974 + var useReactId2 = React42[" useId ".trim().toString()] || (() => void 0);
2975 + var count3 = 0;
2976 + function useId2(deterministicId) {
2977 + const [id, setId] = React42.useState(useReactId2());
2978 + useLayoutEffect24(() => {
2979 + if (!deterministicId) setId((reactId) => reactId ?? String(count3++));
2980 + }, [deterministicId]);
2981 + return deterministicId || (id ? `radix-${id}` : "");
2982 + }
2983 +
2984 + // node_modules/cmdk/dist/index.mjs
2235 2985 var N = '[cmdk-group=""]';
2236 2986 var Y2 = '[cmdk-group-items=""]';
2237 2987 var be = '[cmdk-group-heading=""]';
2238 2988 var le = '[cmdk-item=""]';
@@ -2248,9 +2998,9 @@
2248 2998 var me = t.forwardRef((r2, o) => {
2249 2999 let n = L(() => {
2250 3000 var e, a;
2251 3001 return { search: "", value: (a = (e = r2.value) != null ? e : r2.defaultValue) != null ? a : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
2252 - }), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r2), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r2, $2 = useId(), q = useId(), _ = useId(), I = t.useRef(null), v = ke();
3002 + }), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r2), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r2, $2 = useId2(), q = useId2(), _ = useId2(), I = t.useRef(null), v = ke();
2253 3003 k2(() => {
2254 3004 if (R !== void 0) {
2255 3005 let e = R.trim();
2256 3006 n.current.value = e, E.emit();
@@ -2378,9 +3128,9 @@
2378 3128 e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
2379 3129 }, se = (e) => {
2380 3130 e.preventDefault(), e.metaKey ? X2(0) : e.altKey ? re(-1) : Q(-1);
2381 3131 };
2382 - return t.createElement(Primitive.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
3132 + return t.createElement(Primitive5.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
2383 3133 var s;
2384 3134 (s = O.onKeyDown) == null || s.call(O, e);
2385 3135 let a = e.nativeEvent.isComposing || e.keyCode === 229;
2386 3136 if (!(e.defaultPrevented || a)) switch (e.key) {
@@ -2422,9 +3172,9 @@
2422 3172 } }, t.createElement("label", { "cmdk-label": "", htmlFor: U2.inputId, id: U2.labelId, style: Te }, b), B2(r2, (e) => t.createElement(de.Provider, { value: E }, t.createElement(ue.Provider, { value: U2 }, e))));
2423 3173 });
2424 3174 var he = t.forwardRef((r2, o) => {
2425 3175 var _, I;
2426 - let n = useId(), u2 = t.useRef(null), c = t.useContext(fe), d = K2(), f = pe(r2), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
3176 + let n = useId2(), u2 = t.useRef(null), c = t.useContext(fe), d = K2(), f = pe(r2), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
2427 3177 k2(() => {
2428 3178 if (!p2) return d.item(n, c == null ? void 0 : c.id);
2429 3179 }, [p2]);
2430 3180 let b = ve(n, u2, [r2.value, r2.children, u2], r2.keywords), m2 = ee(), R = P((v) => v.value && v.value === b.current), x = P((v) => p2 || d.filter() === false ? true : v.search ? v.filtered.items.get(n) > 0 : true);
@@ -2440,25 +3190,25 @@
2440 3190 m2.setState("value", b.current, true);
2441 3191 }
2442 3192 if (!x) return null;
2443 3193 let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r2;
2444 - return t.createElement(Primitive.div, { ref: composeRefs(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r2.children);
3194 + return t.createElement(Primitive5.div, { ref: composeRefs6(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r2.children);
2445 3195 });
2446 3196 var Ee = t.forwardRef((r2, o) => {
2447 - let { heading: n, children: u2, forceMount: c, ...d } = r2, f = useId(), p2 = t.useRef(null), b = t.useRef(null), m2 = useId(), R = K2(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
3197 + let { heading: n, children: u2, forceMount: c, ...d } = r2, f = useId2(), p2 = t.useRef(null), b = t.useRef(null), m2 = useId2(), R = K2(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
2448 3198 k2(() => R.group(f), []), ve(f, p2, [r2.value, r2.heading, b]);
2449 3199 let C = t.useMemo(() => ({ id: f, forceMount: c }), [c]);
2450 - return t.createElement(Primitive.div, { ref: composeRefs(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && t.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B2(r2, (S) => t.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, t.createElement(fe.Provider, { value: C }, S))));
3200 + return t.createElement(Primitive5.div, { ref: composeRefs6(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && t.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B2(r2, (S) => t.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, t.createElement(fe.Provider, { value: C }, S))));
2451 3201 });
2452 3202 var ye = t.forwardRef((r2, o) => {
2453 3203 let { alwaysRender: n, ...u2 } = r2, c = t.useRef(null), d = P((f) => !f.search);
2454 - return !n && !d ? null : t.createElement(Primitive.div, { ref: composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
3204 + return !n && !d ? null : t.createElement(Primitive5.div, { ref: composeRefs6(c, o), ...u2, "cmdk-separator": "", role: "separator" });
2455 3205 });
2456 3206 var Se = t.forwardRef((r2, o) => {
2457 3207 let { onValueChange: n, ...u2 } = r2, c = r2.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K2();
2458 3208 return t.useEffect(() => {
2459 3209 r2.value != null && d.setState("search", r2.value);
2460 - }, [r2.value]), t.createElement(Primitive.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r2.value : f, onChange: (m2) => {
3210 + }, [r2.value]), t.createElement(Primitive5.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r2.value : f, onChange: (m2) => {
2461 3211 c || d.setState("search", m2.target.value), n == null || n(m2.target.value);
2462 3212 } });
2463 3213 });
2464 3214 var Ce = t.forwardRef((r2, o) => {
@@ -2474,18 +3224,18 @@
2474 3224 return C.observe(m2), () => {
2475 3225 cancelAnimationFrame(x), C.unobserve(m2);
2476 3226 };
2477 3227 }
2478 - }, []), t.createElement(Primitive.div, { ref: composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B2(r2, (m2) => t.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
3228 + }, []), t.createElement(Primitive5.div, { ref: composeRefs6(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B2(r2, (m2) => t.createElement("div", { ref: composeRefs6(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
2479 3229 });
2480 3230 var xe = t.forwardRef((r2, o) => {
2481 3231 let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r2;
2482 3232 return t.createElement(Root, { open: n, onOpenChange: u2 }, t.createElement(Portal2, { container: f }, t.createElement(Overlay, { "cmdk-overlay": "", className: c }), t.createElement(Content, { "aria-label": r2.label, "cmdk-dialog": "", className: d }, t.createElement(me, { ref: o, ...p2 }))));
2483 3233 });
2484 - var Ie = t.forwardRef((r2, o) => P((u2) => u2.filtered.count === 0) ? t.createElement(Primitive.div, { ref: o, ...r2, "cmdk-empty": "", role: "presentation" }) : null);
3234 + var Ie = t.forwardRef((r2, o) => P((u2) => u2.filtered.count === 0) ? t.createElement(Primitive5.div, { ref: o, ...r2, "cmdk-empty": "", role: "presentation" }) : null);
2485 3235 var Pe = t.forwardRef((r2, o) => {
2486 3236 let { progress: n, children: u2, label: c = "Loading...", ...d } = r2;
2487 - return t.createElement(Primitive.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B2(r2, (f) => t.createElement("div", { "aria-hidden": true }, f)));
3237 + return t.createElement(Primitive5.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B2(r2, (f) => t.createElement("div", { "aria-hidden": true }, f)));
2488 3238 });
2489 3239 var _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
2490 3240 function we(r2, o) {
2491 3241 let n = r2.nextElementSibling;
@@ -2563,10 +3313,10 @@
2563 3313 }
2564 3314 var clsx_default = clsx;
2565 3315
2566 3316 // packages/commands/build-module/components/command-menu.mjs
2567 - var import_data5 = __toESM(require_data(), 1);
2568 - var import_element3 = __toESM(require_element(), 1);
3317 + var import_data4 = __toESM(require_data(), 1);
3318 + var import_element2 = __toESM(require_element(), 1);
2569 3319 var import_i18n = __toESM(require_i18n(), 1);
2570 3320 var import_components = __toESM(require_components(), 1);
2571 3321 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
2572 3322
@@ -2584,15 +3334,15 @@
2584 3334 );
2585 3335
2586 3336 // packages/icons/build-module/library/arrow-right.mjs
2587 3337 var import_primitives = __toESM(require_primitives(), 1);
2588 - var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
2589 - var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
3338 + var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
3339 + var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
2590 3340
2591 3341 // packages/icons/build-module/library/search.mjs
2592 3342 var import_primitives2 = __toESM(require_primitives(), 1);
2593 - var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
2594 - var search_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives2.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
3343 + var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
3344 + var search_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives2.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
2595 3345
2596 3346 // packages/commands/build-module/store/index.mjs
2597 3347 var import_data3 = __toESM(require_data(), 1);
2598 3348
@@ -2655,24 +3405,13 @@
2655 3405 return action.context;
2656 3406 }
2657 3407 return state;
2658 3408 }
2659 - function loaderStates(state = {}, action) {
2660 - switch (action.type) {
2661 - case "SET_LOADER_LOADING":
2662 - return {
2663 - ...state,
2664 - [action.name]: action.isLoading
2665 - };
2666 - }
2667 - return state;
2668 - }
2669 3409 var reducer = (0, import_data.combineReducers)({
2670 3410 commands,
2671 3411 commandLoaders,
2672 3412 isOpen,
2673 - context,
2674 - loaderStates
3413 + context
2675 3414 });
2676 3415 var reducer_default = reducer;
2677 3416
2678 3417 // packages/commands/build-module/store/actions.mjs
@@ -2768,10 +3507,9 @@
2768 3507
2769 3508 // packages/commands/build-module/store/private-actions.mjs
2770 3509 var private_actions_exports = {};
2771 3510 __export(private_actions_exports, {
2772 - setContext: () => setContext,
2773 - setLoaderLoading: () => setLoaderLoading
3511 + setContext: () => setContext
2774 3512 });
2775 3513 function setContext(context2) {
2776 3514 return {
2777 3515 type: "SET_CONTEXT",
@@ -2777,25 +3515,9 @@
2777 3515 type: "SET_CONTEXT",
2778 3516 context: context2
2779 3517 };
2780 3518 }
2781 - function setLoaderLoading(name, isLoading2) {
2782 - return {
2783 - type: "SET_LOADER_LOADING",
2784 - name,
2785 - isLoading: isLoading2
2786 - };
2787 - }
2788 3519
2789 - // packages/commands/build-module/store/private-selectors.mjs
2790 - var private_selectors_exports = {};
2791 - __export(private_selectors_exports, {
2792 - isLoading: () => isLoading
2793 - });
2794 - function isLoading(state) {
2795 - return Object.values(state.loaderStates).some(Boolean);
2796 - }
2797 -
2798 3520 // packages/commands/build-module/lock-unlock.mjs
2799 3521 var import_private_apis = __toESM(require_private_apis(), 1);
2800 3522 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
2801 3523 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
@@ -2810,106 +3532,12 @@
2810 3532 selectors: selectors_exports
2811 3533 });
2812 3534 (0, import_data3.register)(store);
2813 3535 unlock(store).registerPrivateActions(private_actions_exports);
2814 - unlock(store).registerPrivateSelectors(private_selectors_exports);
2815 3536
2816 - // packages/commands/build-module/components/use-recent-commands.mjs
2817 - var import_data4 = __toESM(require_data(), 1);
2818 - var import_preferences = __toESM(require_preferences(), 1);
2819 - var import_element2 = __toESM(require_element(), 1);
2820 - var MAX_RECENTLY_SAVED = 30;
2821 - var MAX_RECENTLY_DISPLAYED = 5;
2822 - var EMPTY_ARRAY = [];
2823 - var EMPTY_SET = /* @__PURE__ */ new Set();
2824 - function recordUsage(name) {
2825 - const current = (0, import_data4.select)(import_preferences.store).get(
2826 - "core/commands",
2827 - "recentlyUsed"
2828 - ) ?? [];
2829 - const next = [name, ...current.filter((n) => n !== name)].slice(
2830 - 0,
2831 - MAX_RECENTLY_SAVED
2832 - );
2833 - (0, import_data4.dispatch)(import_preferences.store).set("core/commands", "recentlyUsed", next);
2834 - }
2835 - function useLoaderCollector(hook, name, filterNames, onResolved) {
2836 - const { setLoaderLoading: setLoaderLoading2 } = unlock((0, import_data4.useDispatch)(store));
2837 - const { isLoading: loading, commands: commands2 = [] } = hook({ search: "" }) ?? {};
2838 - (0, import_element2.useEffect)(() => {
2839 - setLoaderLoading2(name, loading);
2840 - }, [setLoaderLoading2, name, loading]);
2841 - const filtered = filterNames ? commands2.filter((c) => filterNames.has(c.name)) : commands2;
2842 - (0, import_element2.useEffect)(() => {
2843 - onResolved(name, filtered);
2844 - }, [onResolved, name, filtered]);
2845 - (0, import_element2.useEffect)(() => {
2846 - return () => onResolved(name, []);
2847 - }, [onResolved, name]);
2848 - }
2849 - function useRecentCommands() {
2850 - const {
2851 - contextualCommands,
2852 - staticCommands,
2853 - contextualLoaders,
2854 - staticLoaders,
2855 - recentlyUsedNames = EMPTY_ARRAY
2856 - } = (0, import_data4.useSelect)((select) => {
2857 - const { getCommands: getCommands2, getCommandLoaders: getCommandLoaders2 } = select(store);
2858 - return {
2859 - contextualCommands: getCommands2(true),
2860 - staticCommands: getCommands2(false),
2861 - contextualLoaders: getCommandLoaders2(true),
2862 - staticLoaders: getCommandLoaders2(false),
2863 - recentlyUsedNames: select(import_preferences.store).get(
2864 - "core/commands",
2865 - "recentlyUsed"
2866 - )
2867 - };
2868 - }, []);
2869 - const [resolvedMap, setResolvedMap] = (0, import_element2.useState)(() => /* @__PURE__ */ new Map());
2870 - const onResolved = (0, import_element2.useCallback)((loaderName, cmds) => {
2871 - setResolvedMap((prev) => {
2872 - const prevCmds = prev.get(loaderName);
2873 - if (prevCmds && prevCmds.length === cmds.length && prevCmds.every((c, i) => c.name === cmds[i].name)) {
2874 - return prev;
2875 - }
2876 - const next = new Map(prev);
2877 - next.set(loaderName, cmds);
2878 - return next;
2879 - });
2880 - }, []);
2881 - const { recentNames, recentSet } = (0, import_element2.useMemo)(() => {
2882 - const names = recentlyUsedNames.slice(0, MAX_RECENTLY_DISPLAYED);
2883 - return { recentNames: names, recentSet: new Set(names) };
2884 - }, [recentlyUsedNames]);
2885 - if (!recentlyUsedNames.length) {
2886 - return {
2887 - commands: [],
2888 - loaders: [],
2889 - recentSet: EMPTY_SET,
2890 - onResolved
2891 - };
2892 - }
2893 - const allStaticCommands = [...contextualCommands, ...staticCommands];
2894 - const loaders = [...contextualLoaders, ...staticLoaders];
2895 - const allByName = /* @__PURE__ */ new Map();
2896 - allStaticCommands.forEach((c) => allByName.set(c.name, c));
2897 - for (const cmds of resolvedMap.values()) {
2898 - cmds.forEach((c) => {
2899 - if (!allByName.has(c.name)) {
2900 - allByName.set(c.name, c);
2901 - }
2902 - });
2903 - }
2904 - const commands2 = recentNames.map((n) => allByName.get(n)).filter(Boolean);
2905 - return { commands: commands2, loaders, recentSet, onResolved };
2906 - }
2907 -
2908 3537 // packages/commands/build-module/components/command-menu.mjs
2909 - var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
3538 + var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
2910 3539 var { withIgnoreIMEEvents } = unlock(import_components.privateApis);
2911 - var ITEM_ID_PREFIX = "command-palette-item-";
2912 3540 var inputLabel = (0, import_i18n.__)("Search commands and settings");
2913 3541 var CATEGORY_ICONS = {
2914 3542 view: arrow_right_default
2915 3543 };
@@ -2920,189 +3548,165 @@
2920 3548 action: (0, import_i18n.__)("Action"),
2921 3549 workflow: (0, import_i18n.__)("Workflow")
2922 3550 };
2923 3551 function isValidIcon(icon) {
2924 - return !!icon && (typeof icon === "string" || (0, import_element3.isValidElement)(icon) || typeof icon === "function" || icon instanceof import_element3.Component);
3552 + return !!icon && (typeof icon === "string" || (0, import_element2.isValidElement)(icon) || typeof icon === "function" || icon instanceof import_element2.Component);
2925 3553 }
2926 - function CommandItem({ command, search, category, valuePrefix }) {
2927 - const { close: close2 } = (0, import_data5.useDispatch)(store);
2928 - const commandCategory = category ?? command.category;
2929 - const label = command.searchLabel ?? command.label;
2930 - const value = valuePrefix ? `${valuePrefix}${command.name}` : label;
2931 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2932 - _e.Item,
2933 - {
2934 - id: `${ITEM_ID_PREFIX}${value.toLowerCase()}`,
2935 - value,
2936 - keywords: valuePrefix ? [...command.keywords ?? [], label] : command.keywords,
2937 - onSelect: () => {
2938 - recordUsage(command.name);
2939 - command.callback({ close: close2 });
2940 - },
2941 - children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2942 - import_components.__experimentalHStack,
2943 - {
2944 - alignment: "left",
2945 - className: clsx_default("commands-command-menu__item", {
2946 - "has-icon": CATEGORY_ICONS[commandCategory] || command.icon
2947 - }),
2948 - children: [
2949 - CATEGORY_ICONS[commandCategory] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(icon_default, { icon: CATEGORY_ICONS[commandCategory] }) : isValidIcon(command.icon) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(icon_default, { icon: command.icon }),
2950 - /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "commands-command-menu__item-label", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2951 - import_components.TextHighlight,
2952 - {
2953 - text: command.label,
2954 - highlight: search
2955 - }
2956 - ) }),
2957 - CATEGORY_LABELS[commandCategory] && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "commands-command-menu__item-category", children: CATEGORY_LABELS[commandCategory] })
2958 - ]
2959 - }
2960 - )
2961 - },
2962 - command.name
2963 - );
2964 - }
2965 - function CommandMenuLoader({ name, search, hook, category, valuePrefix }) {
2966 - const { setLoaderLoading: setLoaderLoading2 } = unlock((0, import_data5.useDispatch)(store));
2967 - const { isLoading: loading, commands: commands2 = [] } = hook({ search }) ?? {};
2968 - (0, import_element3.useEffect)(() => {
2969 - setLoaderLoading2(name, loading);
2970 - }, [setLoaderLoading2, name, loading]);
3554 + function CommandMenuLoader({
3555 + name,
3556 + search,
3557 + hook,
3558 + setLoader,
3559 + close: close2,
3560 + category
3561 + }) {
3562 + const { isLoading, commands: commands2 = [] } = hook({ search }) ?? {};
3563 + (0, import_element2.useEffect)(() => {
3564 + setLoader(name, isLoading);
3565 + }, [setLoader, name, isLoading]);
2971 3566 if (!commands2.length) {
2972 3567 return null;
2973 3568 }
2974 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: commands2.map((command) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2975 - CommandItem,
2976 - {
2977 - command,
2978 - search,
2979 - category: command.category ?? category,
2980 - valuePrefix
2981 - },
2982 - command.name
2983 - )) });
3569 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: commands2.map((command) => {
3570 + const commandCategory = command.category ?? category;
3571 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3572 + _e.Item,
3573 + {
3574 + value: command.searchLabel ?? command.label,
3575 + keywords: command.keywords,
3576 + onSelect: () => command.callback({ close: close2 }),
3577 + id: command.name,
3578 + children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3579 + import_components.__experimentalHStack,
3580 + {
3581 + alignment: "left",
3582 + className: clsx_default("commands-command-menu__item", {
3583 + "has-icon": CATEGORY_ICONS[commandCategory] || command.icon
3584 + }),
3585 + children: [
3586 + CATEGORY_ICONS[commandCategory] && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3587 + icon_default,
3588 + {
3589 + icon: CATEGORY_ICONS[commandCategory]
3590 + }
3591 + ),
3592 + !CATEGORY_ICONS[commandCategory] && isValidIcon(command.icon) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(icon_default, { icon: command.icon }),
3593 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "commands-command-menu__item-label", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3594 + import_components.TextHighlight,
3595 + {
3596 + text: command.label,
3597 + highlight: search
3598 + }
3599 + ) }),
3600 + CATEGORY_LABELS[commandCategory] && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "commands-command-menu__item-category", children: CATEGORY_LABELS[commandCategory] })
3601 + ]
3602 + }
3603 + )
3604 + },
3605 + command.name
3606 + );
3607 + }) });
2984 3608 }
2985 - function CommandMenuLoaderWrapper({ hook, ...props }) {
2986 - const currentLoaderRef = (0, import_element3.useRef)(hook);
2987 - const [key, setKey] = (0, import_element3.useState)(0);
2988 - (0, import_element3.useEffect)(() => {
3609 + function CommandMenuLoaderWrapper({
3610 + hook,
3611 + search,
3612 + setLoader,
3613 + close: close2,
3614 + category
3615 + }) {
3616 + const currentLoaderRef = (0, import_element2.useRef)(hook);
3617 + const [key, setKey] = (0, import_element2.useState)(0);
3618 + (0, import_element2.useEffect)(() => {
2989 3619 if (currentLoaderRef.current !== hook) {
2990 3620 currentLoaderRef.current = hook;
2991 3621 setKey((prevKey) => prevKey + 1);
2992 3622 }
2993 3623 }, [hook]);
2994 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3624 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2995 3625 CommandMenuLoader,
2996 3626 {
2997 3627 hook: currentLoaderRef.current,
2998 - ...props
3628 + search,
3629 + setLoader,
3630 + close: close2,
3631 + category
2999 3632 },
3000 3633 key
3001 3634 );
3002 3635 }
3003 - function CommandList({ search, commands: commands2, loaders, valuePrefix }) {
3004 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
3005 - commands2.map((command) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3006 - CommandItem,
3636 + function CommandMenuGroup({ isContextual, search, setLoader, close: close2 }) {
3637 + const { commands: commands2, loaders } = (0, import_data4.useSelect)(
3638 + (select) => {
3639 + const { getCommands: getCommands2, getCommandLoaders: getCommandLoaders2 } = select(store);
3640 + return {
3641 + commands: getCommands2(isContextual),
3642 + loaders: getCommandLoaders2(isContextual)
3643 + };
3644 + },
3645 + [isContextual]
3646 + );
3647 + if (!commands2.length && !loaders.length) {
3648 + return null;
3649 + }
3650 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(_e.Group, { children: [
3651 + commands2.map((command) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3652 + _e.Item,
3007 3653 {
3008 - command,
3009 - search,
3010 - valuePrefix
3654 + value: command.searchLabel ?? command.label,
3655 + keywords: command.keywords,
3656 + onSelect: () => command.callback({ close: close2 }),
3657 + id: command.name,
3658 + children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3659 + import_components.__experimentalHStack,
3660 + {
3661 + alignment: "left",
3662 + className: clsx_default("commands-command-menu__item", {
3663 + "has-icon": CATEGORY_ICONS[command.category] || command.icon
3664 + }),
3665 + children: [
3666 + CATEGORY_ICONS[command.category] ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(icon_default, { icon: CATEGORY_ICONS[command.category] }) : command.icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(icon_default, { icon: command.icon }),
3667 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3668 + import_components.TextHighlight,
3669 + {
3670 + text: command.label,
3671 + highlight: search
3672 + }
3673 + ) }),
3674 + CATEGORY_LABELS[command.category] && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "commands-command-menu__item-category", children: CATEGORY_LABELS[command.category] })
3675 + ]
3676 + }
3677 + )
3011 3678 },
3012 3679 command.name
3013 3680 )),
3014 - loaders.map((loader) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3681 + loaders.map((loader) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3015 3682 CommandMenuLoaderWrapper,
3016 3683 {
3017 - name: loader.name,
3684 + hook: loader.hook,
3018 3685 search,
3019 - hook: loader.hook,
3020 - category: loader.category,
3021 - valuePrefix
3686 + setLoader,
3687 + close: close2,
3688 + category: loader.category
3022 3689 },
3023 3690 loader.name
3024 3691 ))
3025 3692 ] });
3026 3693 }
3027 - function RecentLoaderRunner({ hook, name, filterNames, onResolved }) {
3028 - useLoaderCollector(hook, name, filterNames, onResolved);
3029 - return null;
3030 - }
3031 - function RecentGroup() {
3032 - const { commands: commands2, loaders, recentSet, onResolved } = useRecentCommands();
3033 - if (!commands2.length && !loaders.length) {
3034 - return null;
3035 - }
3036 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(_e.Group, { heading: (0, import_i18n.__)("Recent"), children: [
3037 - loaders.map((loader) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3038 - RecentLoaderRunner,
3039 - {
3040 - name: loader.name,
3041 - hook: loader.hook,
3042 - filterNames: recentSet,
3043 - onResolved
3044 - },
3045 - loader.name
3046 - )),
3047 - commands2.map((command) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3048 - CommandItem,
3049 - {
3050 - command,
3051 - search: "",
3052 - valuePrefix: "recent-"
3053 - },
3054 - command.name
3055 - ))
3056 - ] });
3057 - }
3058 - function SuggestionsGroup() {
3059 - const { commands: commands2, loaders } = (0, import_data5.useSelect)((select) => {
3060 - const { getCommands: getCommands2, getCommandLoaders: getCommandLoaders2 } = select(store);
3061 - return {
3062 - commands: getCommands2(true),
3063 - loaders: getCommandLoaders2(true)
3064 - };
3065 - }, []);
3066 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(_e.Group, { heading: (0, import_i18n.__)("Suggestions"), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CommandList, { search: "", commands: commands2, loaders }) });
3067 - }
3068 - function ResultsGroup({ search }) {
3069 - const { commands: commands2, contextualCommands, loaders, contextualLoaders } = (0, import_data5.useSelect)((select) => {
3070 - const { getCommands: getCommands2, getCommandLoaders: getCommandLoaders2 } = select(store);
3071 - return {
3072 - commands: getCommands2(false),
3073 - contextualCommands: getCommands2(true),
3074 - loaders: getCommandLoaders2(false),
3075 - contextualLoaders: getCommandLoaders2(true)
3076 - };
3077 - }, []);
3078 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(_e.Group, { heading: (0, import_i18n.__)("Results"), children: [
3079 - /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3080 - CommandList,
3081 - {
3082 - search,
3083 - commands: commands2,
3084 - loaders
3085 - }
3086 - ),
3087 - /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3088 - CommandList,
3089 - {
3090 - search,
3091 - commands: contextualCommands,
3092 - loaders: contextualLoaders
3093 - }
3094 - )
3095 - ] });
3096 - }
3097 - function CommandInput({ search, setSearch }) {
3098 - const commandMenuInput = (0, import_element3.useRef)();
3694 + function CommandInput({ isOpen: isOpen3, search, setSearch }) {
3695 + const commandMenuInput = (0, import_element2.useRef)();
3099 3696 const _value = P((state) => state.value);
3100 - const selectedItemId = _value ? `${ITEM_ID_PREFIX}${_value}` : null;
3101 - (0, import_element3.useEffect)(() => {
3102 - commandMenuInput.current.focus();
3103 - }, []);
3104 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3697 + const selectedItemId = (0, import_element2.useMemo)(() => {
3698 + const item = document.querySelector(
3699 + `[cmdk-item=""][data-value="${_value}"]`
3700 + );
3701 + return item?.getAttribute("id");
3702 + }, [_value]);
3703 + (0, import_element2.useEffect)(() => {
3704 + if (isOpen3) {
3705 + commandMenuInput.current.focus();
3706 + }
3707 + }, [isOpen3]);
3708 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3105 3709 _e.Input,
3106 3710 {
3107 3711 ref: commandMenuInput,
3108 3712 value: search,
@@ -3112,19 +3716,17 @@
3112 3716 }
3113 3717 );
3114 3718 }
3115 3719 function CommandMenu() {
3116 - const { registerShortcut } = (0, import_data5.useDispatch)(import_keyboard_shortcuts.store);
3117 - const [search, setSearch] = (0, import_element3.useState)("");
3118 - const { isOpen: paletteIsOpen, loadersLoading } = (0, import_data5.useSelect)(
3119 - (select) => ({
3120 - isOpen: select(store).isOpen(),
3121 - loadersLoading: unlock(select(store)).isLoading()
3122 - }),
3720 + const { registerShortcut } = (0, import_data4.useDispatch)(import_keyboard_shortcuts.store);
3721 + const [search, setSearch] = (0, import_element2.useState)("");
3722 + const isOpen3 = (0, import_data4.useSelect)(
3723 + (select) => select(store).isOpen(),
3123 3724 []
3124 3725 );
3125 - const { open: open2, close: close2 } = (0, import_data5.useDispatch)(store);
3126 - (0, import_element3.useEffect)(() => {
3726 + const { open: open2, close: close2 } = (0, import_data4.useDispatch)(store);
3727 + const [loaders, setLoaders] = (0, import_element2.useState)({});
3728 + (0, import_element2.useEffect)(() => {
3127 3729 registerShortcut({
3128 3730 name: "core/commands",
3129 3731 category: "global",
3130 3732 description: (0, import_i18n.__)("Open the command palette."),
@@ -3141,9 +3743,9 @@
3141 3743 if (event.defaultPrevented) {
3142 3744 return;
3143 3745 }
3144 3746 event.preventDefault();
3145 - if (paletteIsOpen) {
3747 + if (isOpen3) {
3146 3748 close2();
3147 3749 } else {
3148 3750 open2();
3149 3751 }
@@ -3151,16 +3753,24 @@
3151 3753 {
3152 3754 bindGlobal: true
3153 3755 }
3154 3756 );
3757 + const setLoader = (0, import_element2.useCallback)(
3758 + (name, value) => setLoaders((current) => ({
3759 + ...current,
3760 + [name]: value
3761 + })),
3762 + []
3763 + );
3155 3764 const closeAndReset = () => {
3156 3765 setSearch("");
3157 3766 close2();
3158 3767 };
3159 - if (!paletteIsOpen) {
3768 + if (!isOpen3) {
3160 3769 return false;
3161 3770 }
3162 - return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3771 + const isLoading = Object.values(loaders).some(Boolean);
3772 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3163 3773 import_components.Modal,
3164 3774 {
3165 3775 className: "commands-command-menu",
3166 3776 overlayClassName: "commands-command-menu__overlay",
@@ -3165,13 +3775,12 @@
3165 3775 className: "commands-command-menu",
3166 3776 overlayClassName: "commands-command-menu__overlay",
3167 3777 onRequestClose: closeAndReset,
3168 3778 __experimentalHideHeader: true,
3169 - size: "medium",
3170 3779 contentLabel: (0, import_i18n.__)("Command palette"),
3171 - children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "commands-command-menu__container", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(_e, { label: inputLabel, loop: true, children: [
3172 - /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "commands-command-menu__header", children: [
3173 - /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3780 + children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "commands-command-menu__container", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(_e, { label: inputLabel, children: [
3781 + /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "commands-command-menu__header", children: [
3782 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3174 3783 icon_default,
3175 3784 {
3176 3785 className: "commands-command-menu__header-search-icon",
3177 3786 icon: search_default
@@ -3176,21 +3785,36 @@
3176 3785 className: "commands-command-menu__header-search-icon",
3177 3786 icon: search_default
3178 3787 }
3179 3788 ),
3180 - /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3789 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3181 3790 CommandInput,
3182 3791 {
3183 3792 search,
3184 - setSearch
3793 + setSearch,
3794 + isOpen: isOpen3
3185 3795 }
3186 3796 )
3187 3797 ] }),
3188 - /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(_e.List, { label: (0, import_i18n.__)("Command suggestions"), children: [
3189 - search && !loadersLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(_e.Empty, { children: (0, import_i18n.__)("No results found.") }),
3190 - !search && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RecentGroup, {}),
3191 - !search && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SuggestionsGroup, {}),
3192 - search && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ResultsGroup, { search })
3798 + /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(_e.List, { label: (0, import_i18n.__)("Command suggestions"), children: [
3799 + search && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(_e.Empty, { children: (0, import_i18n.__)("No results found.") }),
3800 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3801 + CommandMenuGroup,
3802 + {
3803 + search,
3804 + setLoader,
3805 + close: closeAndReset,
3806 + isContextual: true
3807 + }
3808 + ),
3809 + search && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3810 + CommandMenuGroup,
3811 + {
3812 + search,
3813 + setLoader,
3814 + close: closeAndReset
3815 + }
3816 + )
3193 3817 ] })
3194 3818 ] }) })
3195 3819 }
3196 3820 );
@@ -3196,18 +3820,18 @@
3196 3820 );
3197 3821 }
3198 3822
3199 3823 // packages/commands/build-module/hooks/use-command-context.mjs
3200 - var import_element4 = __toESM(require_element(), 1);
3201 - var import_data6 = __toESM(require_data(), 1);
3824 + var import_element3 = __toESM(require_element(), 1);
3825 + var import_data5 = __toESM(require_data(), 1);
3202 3826 function useCommandContext(context2) {
3203 - const { getContext: getContext2 } = (0, import_data6.useSelect)(store);
3204 - const initialContext = (0, import_element4.useRef)(getContext2());
3205 - const { setContext: setContext2 } = unlock((0, import_data6.useDispatch)(store));
3206 - (0, import_element4.useEffect)(() => {
3827 + const { getContext: getContext2 } = (0, import_data5.useSelect)(store);
3828 + const initialContext = (0, import_element3.useRef)(getContext2());
3829 + const { setContext: setContext2 } = unlock((0, import_data5.useDispatch)(store));
3830 + (0, import_element3.useEffect)(() => {
3207 3831 setContext2(context2);
3208 3832 }, [context2, setContext2]);
3209 - (0, import_element4.useEffect)(() => {
3833 + (0, import_element3.useEffect)(() => {
3210 3834 const initialContextRef = initialContext.current;
3211 3835 return () => setContext2(initialContextRef);
3212 3836 }, [setContext2]);
3213 3837 }
@@ -3218,17 +3842,17 @@
3218 3842 useCommandContext
3219 3843 });
3220 3844
3221 3845 // packages/commands/build-module/hooks/use-command.mjs
3222 - var import_element5 = __toESM(require_element(), 1);
3223 - var import_data7 = __toESM(require_data(), 1);
3846 + var import_element4 = __toESM(require_element(), 1);
3847 + var import_data6 = __toESM(require_data(), 1);
3224 3848 function useCommand(command) {
3225 - const { registerCommand: registerCommand2, unregisterCommand: unregisterCommand2 } = (0, import_data7.useDispatch)(store);
3226 - const currentCallbackRef = (0, import_element5.useRef)(command.callback);
3227 - (0, import_element5.useEffect)(() => {
3849 + const { registerCommand: registerCommand2, unregisterCommand: unregisterCommand2 } = (0, import_data6.useDispatch)(store);
3850 + const currentCallbackRef = (0, import_element4.useRef)(command.callback);
3851 + (0, import_element4.useEffect)(() => {
3228 3852 currentCallbackRef.current = command.callback;
3229 3853 }, [command.callback]);
3230 - (0, import_element5.useEffect)(() => {
3854 + (0, import_element4.useEffect)(() => {
3231 3855 if (command.disabled) {
3232 3856 return;
3233 3857 }
3234 3858 registerCommand2({
@@ -3257,11 +3881,11 @@
3257 3881 unregisterCommand2
3258 3882 ]);
3259 3883 }
3260 3884 function useCommands(commands2) {
3261 - const { registerCommand: registerCommand2, unregisterCommand: unregisterCommand2 } = (0, import_data7.useDispatch)(store);
3262 - const currentCallbacksRef = (0, import_element5.useRef)({});
3263 - (0, import_element5.useEffect)(() => {
3885 + const { registerCommand: registerCommand2, unregisterCommand: unregisterCommand2 } = (0, import_data6.useDispatch)(store);
3886 + const currentCallbacksRef = (0, import_element4.useRef)({});
3887 + (0, import_element4.useEffect)(() => {
3264 3888 if (!commands2) {
3265 3889 return;
3266 3890 }
3267 3891 commands2.forEach((command) => {
@@ -3269,9 +3893,9 @@
3269 3893 currentCallbacksRef.current[command.name] = command.callback;
3270 3894 }
3271 3895 });
3272 3896 }, [commands2]);
3273 - (0, import_element5.useEffect)(() => {
3897 + (0, import_element4.useEffect)(() => {
3274 3898 if (!commands2) {
3275 3899 return;
3276 3900 }
3277 3901 commands2.forEach((command) => {
@@ -3302,13 +3926,13 @@
3302 3926 }, [commands2, registerCommand2, unregisterCommand2]);
3303 3927 }
3304 3928
3305 3929 // packages/commands/build-module/hooks/use-command-loader.mjs
3306 - var import_element6 = __toESM(require_element(), 1);
3307 - var import_data8 = __toESM(require_data(), 1);
3930 + var import_element5 = __toESM(require_element(), 1);
3931 + var import_data7 = __toESM(require_data(), 1);
3308 3932 function useCommandLoader(loader) {
3309 - const { registerCommandLoader: registerCommandLoader2, unregisterCommandLoader: unregisterCommandLoader2 } = (0, import_data8.useDispatch)(store);
3310 - (0, import_element6.useEffect)(() => {
3933 + const { registerCommandLoader: registerCommandLoader2, unregisterCommandLoader: unregisterCommandLoader2 } = (0, import_data7.useDispatch)(store);
3934 + (0, import_element5.useEffect)(() => {
3311 3935 if (loader.disabled) {
3312 3936 return;
3313 3937 }
3314 3938 registerCommandLoader2({