[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> commands.js (source)

   1  (function() {
   2  var wp;
   3  (wp ||= {}).commands = (() => {
   4    var __create = Object.create;
   5    var __defProp = Object.defineProperty;
   6    var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
   7    var __getOwnPropNames = Object.getOwnPropertyNames;
   8    var __getProtoOf = Object.getPrototypeOf;
   9    var __hasOwnProp = Object.prototype.hasOwnProperty;
  10    var __commonJS = (cb, mod) => function __require() {
  11      return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  12    };
  13    var __export = (target, all) => {
  14      for (var name in all)
  15        __defProp(target, name, { get: all[name], enumerable: true });
  16    };
  17    var __copyProps = (to, from, except, desc) => {
  18      if (from && typeof from === "object" || typeof from === "function") {
  19        for (let key of __getOwnPropNames(from))
  20          if (!__hasOwnProp.call(to, key) && key !== except)
  21            __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  22      }
  23      return to;
  24    };
  25    var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  26      // If the importer is in node compatibility mode or this is not an ESM
  27      // file that has been converted to a CommonJS file using a Babel-
  28      // compatible transform (i.e. "__esModule" has not been set), then set
  29      // "default" to the CommonJS "module.exports" for node compatibility.
  30      isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  31      mod
  32    ));
  33    var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  34  
  35    // vendor-external:react
  36    var require_react = __commonJS({
  37      "vendor-external:react"(exports, module) {
  38        module.exports = window.React;
  39      }
  40    });
  41  
  42    // vendor-external:react/jsx-runtime
  43    var require_jsx_runtime = __commonJS({
  44      "vendor-external:react/jsx-runtime"(exports, module) {
  45        module.exports = window.ReactJSXRuntime;
  46      }
  47    });
  48  
  49    // vendor-external:react-dom
  50    var require_react_dom = __commonJS({
  51      "vendor-external:react-dom"(exports, module) {
  52        module.exports = window.ReactDOM;
  53      }
  54    });
  55  
  56    // package-external:@wordpress/data
  57    var require_data = __commonJS({
  58      "package-external:@wordpress/data"(exports, module) {
  59        module.exports = window.wp.data;
  60      }
  61    });
  62  
  63    // package-external:@wordpress/element
  64    var require_element = __commonJS({
  65      "package-external:@wordpress/element"(exports, module) {
  66        module.exports = window.wp.element;
  67      }
  68    });
  69  
  70    // package-external:@wordpress/i18n
  71    var require_i18n = __commonJS({
  72      "package-external:@wordpress/i18n"(exports, module) {
  73        module.exports = window.wp.i18n;
  74      }
  75    });
  76  
  77    // package-external:@wordpress/components
  78    var require_components = __commonJS({
  79      "package-external:@wordpress/components"(exports, module) {
  80        module.exports = window.wp.components;
  81      }
  82    });
  83  
  84    // package-external:@wordpress/keyboard-shortcuts
  85    var require_keyboard_shortcuts = __commonJS({
  86      "package-external:@wordpress/keyboard-shortcuts"(exports, module) {
  87        module.exports = window.wp.keyboardShortcuts;
  88      }
  89    });
  90  
  91    // package-external:@wordpress/keycodes
  92    var require_keycodes = __commonJS({
  93      "package-external:@wordpress/keycodes"(exports, module) {
  94        module.exports = window.wp.keycodes;
  95      }
  96    });
  97  
  98    // package-external:@wordpress/primitives
  99    var require_primitives = __commonJS({
 100      "package-external:@wordpress/primitives"(exports, module) {
 101        module.exports = window.wp.primitives;
 102      }
 103    });
 104  
 105    // package-external:@wordpress/private-apis
 106    var require_private_apis = __commonJS({
 107      "package-external:@wordpress/private-apis"(exports, module) {
 108        module.exports = window.wp.privateApis;
 109      }
 110    });
 111  
 112    // package-external:@wordpress/preferences
 113    var require_preferences = __commonJS({
 114      "package-external:@wordpress/preferences"(exports, module) {
 115        module.exports = window.wp.preferences;
 116      }
 117    });
 118  
 119    // packages/commands/build-module/index.mjs
 120    var index_exports = {};
 121    __export(index_exports, {
 122      CommandMenu: () => CommandMenu,
 123      privateApis: () => privateApis,
 124      store: () => store,
 125      useCommand: () => useCommand,
 126      useCommandLoader: () => useCommandLoader,
 127      useCommands: () => useCommands
 128    });
 129  
 130    // node_modules/cmdk/dist/chunk-NZJY6EH4.mjs
 131    var U = 1;
 132    var Y = 0.9;
 133    var H = 0.8;
 134    var J = 0.17;
 135    var p = 0.1;
 136    var u = 0.999;
 137    var $ = 0.9999;
 138    var k = 0.99;
 139    var m = /[\\\/_+.#"@\[\(\{&]/;
 140    var B = /[\\\/_+.#"@\[\(\{&]/g;
 141    var K = /[\s-]/;
 142    var X = /[\s-]/g;
 143    function G(_, C, h, P2, A, f, O) {
 144      if (f === C.length) return A === _.length ? U : k;
 145      var T2 = `$A},$f}`;
 146      if (O[T2] !== void 0) return O[T2];
 147      for (var L2 = P2.charAt(f), c = h.indexOf(L2, A), S = 0, E, N2, R, M; c >= 0; ) E = G(_, C, h, P2, c + 1, f + 1, O), E > S && (c === A ? E *= U : m.test(_.charAt(c - 1)) ? (E *= H, R = _.slice(A, c - 1).match(B), R && A > 0 && (E *= Math.pow(u, R.length))) : K.test(_.charAt(c - 1)) ? (E *= Y, M = _.slice(A, c - 1).match(X), M && A > 0 && (E *= Math.pow(u, M.length))) : (E *= J, A > 0 && (E *= Math.pow(u, c - A))), _.charAt(c) !== C.charAt(f) && (E *= $)), (E < p && h.charAt(c - 1) === P2.charAt(f + 1) || P2.charAt(f + 1) === P2.charAt(f) && h.charAt(c - 1) !== P2.charAt(f)) && (N2 = G(_, C, h, P2, c + 1, f + 2, O), N2 * p > E && (E = N2 * p)), E > S && (S = E), c = h.indexOf(L2, c + 1);
 148      return O[T2] = S, S;
 149    }
 150    function D(_) {
 151      return _.toLowerCase().replace(X, " ");
 152    }
 153    function W(_, C, h) {
 154      return _ = h && h.length > 0 ? `$_ + " " + h.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {});
 155    }
 156  
 157    // node_modules/@radix-ui/react-dialog/dist/index.mjs
 158    var React24 = __toESM(require_react(), 1);
 159  
 160    // node_modules/@radix-ui/primitive/dist/index.mjs
 161    var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
 162    function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
 163      return function handleEvent(event) {
 164        originalEventHandler?.(event);
 165        if (checkForDefaultPrevented === false || !event.defaultPrevented) {
 166          return ourEventHandler?.(event);
 167        }
 168      };
 169    }
 170  
 171    // node_modules/@radix-ui/react-compose-refs/dist/index.mjs
 172    var React = __toESM(require_react(), 1);
 173    function setRef(ref, value) {
 174      if (typeof ref === "function") {
 175        return ref(value);
 176      } else if (ref !== null && ref !== void 0) {
 177        ref.current = value;
 178      }
 179    }
 180    function composeRefs(...refs) {
 181      return (node) => {
 182        let hasCleanup = false;
 183        const cleanups = refs.map((ref) => {
 184          const cleanup = setRef(ref, node);
 185          if (!hasCleanup && typeof cleanup == "function") {
 186            hasCleanup = true;
 187          }
 188          return cleanup;
 189        });
 190        if (hasCleanup) {
 191          return () => {
 192            for (let i = 0; i < cleanups.length; i++) {
 193              const cleanup = cleanups[i];
 194              if (typeof cleanup == "function") {
 195                cleanup();
 196              } else {
 197                setRef(refs[i], null);
 198              }
 199            }
 200          };
 201        }
 202      };
 203    }
 204    function useComposedRefs(...refs) {
 205      return React.useCallback(composeRefs(...refs), refs);
 206    }
 207  
 208    // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.mjs
 209    var React2 = __toESM(require_react(), 1);
 210    var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
 211    function createContext2(rootComponentName, defaultContext) {
 212      const Context = React2.createContext(defaultContext);
 213      const Provider = (props) => {
 214        const { children, ...context2 } = props;
 215        const value = React2.useMemo(() => context2, Object.values(context2));
 216        return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
 217      };
 218      Provider.displayName = rootComponentName + "Provider";
 219      function useContext22(consumerName) {
 220        const context2 = React2.useContext(Context);
 221        if (context2) return context2;
 222        if (defaultContext !== void 0) return defaultContext;
 223        throw new Error(`\`$consumerName}\` must be used within \`$rootComponentName}\``);
 224      }
 225      return [Provider, useContext22];
 226    }
 227    function createContextScope(scopeName, createContextScopeDeps = []) {
 228      let defaultContexts = [];
 229      function createContext32(rootComponentName, defaultContext) {
 230        const BaseContext = React2.createContext(defaultContext);
 231        const index = defaultContexts.length;
 232        defaultContexts = [...defaultContexts, defaultContext];
 233        const Provider = (props) => {
 234          const { scope, children, ...context2 } = props;
 235          const Context = scope?.[scopeName]?.[index] || BaseContext;
 236          const value = React2.useMemo(() => context2, Object.values(context2));
 237          return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
 238        };
 239        Provider.displayName = rootComponentName + "Provider";
 240        function useContext22(consumerName, scope) {
 241          const Context = scope?.[scopeName]?.[index] || BaseContext;
 242          const context2 = React2.useContext(Context);
 243          if (context2) return context2;
 244          if (defaultContext !== void 0) return defaultContext;
 245          throw new Error(`\`$consumerName}\` must be used within \`$rootComponentName}\``);
 246        }
 247        return [Provider, useContext22];
 248      }
 249      const createScope = () => {
 250        const scopeContexts = defaultContexts.map((defaultContext) => {
 251          return React2.createContext(defaultContext);
 252        });
 253        return function useScope(scope) {
 254          const contexts = scope?.[scopeName] || scopeContexts;
 255          return React2.useMemo(
 256            () => ({ [`__scope$scopeName}`]: { ...scope, [scopeName]: contexts } }),
 257            [scope, contexts]
 258          );
 259        };
 260      };
 261      createScope.scopeName = scopeName;
 262      return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
 263    }
 264    function composeContextScopes(...scopes) {
 265      const baseScope = scopes[0];
 266      if (scopes.length === 1) return baseScope;
 267      const createScope = () => {
 268        const scopeHooks = scopes.map((createScope2) => ({
 269          useScope: createScope2(),
 270          scopeName: createScope2.scopeName
 271        }));
 272        return function useComposedScopes(overrideScopes) {
 273          const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
 274            const scopeProps = useScope(overrideScopes);
 275            const currentScope = scopeProps[`__scope$scopeName}`];
 276            return { ...nextScopes2, ...currentScope };
 277          }, {});
 278          return React2.useMemo(() => ({ [`__scope$baseScope.scopeName}`]: nextScopes }), [nextScopes]);
 279        };
 280      };
 281      createScope.scopeName = baseScope.scopeName;
 282      return createScope;
 283    }
 284  
 285    // node_modules/@radix-ui/react-id/dist/index.mjs
 286    var React4 = __toESM(require_react(), 1);
 287  
 288    // node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
 289    var React3 = __toESM(require_react(), 1);
 290    var useLayoutEffect2 = globalThis?.document ? React3.useLayoutEffect : () => {
 291    };
 292  
 293    // node_modules/@radix-ui/react-id/dist/index.mjs
 294    var useReactId = React4[" useId ".trim().toString()] || (() => void 0);
 295    var count = 0;
 296    function useId(deterministicId) {
 297      const [id, setId] = React4.useState(useReactId());
 298      useLayoutEffect2(() => {
 299        if (!deterministicId) setId((reactId) => reactId ?? String(count++));
 300      }, [deterministicId]);
 301      return deterministicId || (id ? `radix-$id}` : "");
 302    }
 303  
 304    // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
 305    var React5 = __toESM(require_react(), 1);
 306    var React22 = __toESM(require_react(), 1);
 307    var useInsertionEffect = React5[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
 308    function useControllableState({
 309      prop,
 310      defaultProp,
 311      onChange = () => {
 312      },
 313      caller
 314    }) {
 315      const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
 316        defaultProp,
 317        onChange
 318      });
 319      const isControlled = prop !== void 0;
 320      const value = isControlled ? prop : uncontrolledProp;
 321      if (true) {
 322        const isControlledRef = React5.useRef(prop !== void 0);
 323        React5.useEffect(() => {
 324          const wasControlled = isControlledRef.current;
 325          if (wasControlled !== isControlled) {
 326            const from = wasControlled ? "controlled" : "uncontrolled";
 327            const to = isControlled ? "controlled" : "uncontrolled";
 328            console.warn(
 329              `$caller} is changing from $from} to $to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
 330            );
 331          }
 332          isControlledRef.current = isControlled;
 333        }, [isControlled, caller]);
 334      }
 335      const setValue = React5.useCallback(
 336        (nextValue) => {
 337          if (isControlled) {
 338            const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
 339            if (value2 !== prop) {
 340              onChangeRef.current?.(value2);
 341            }
 342          } else {
 343            setUncontrolledProp(nextValue);
 344          }
 345        },
 346        [isControlled, prop, setUncontrolledProp, onChangeRef]
 347      );
 348      return [value, setValue];
 349    }
 350    function useUncontrolledState({
 351      defaultProp,
 352      onChange
 353    }) {
 354      const [value, setValue] = React5.useState(defaultProp);
 355      const prevValueRef = React5.useRef(value);
 356      const onChangeRef = React5.useRef(onChange);
 357      useInsertionEffect(() => {
 358        onChangeRef.current = onChange;
 359      }, [onChange]);
 360      React5.useEffect(() => {
 361        if (prevValueRef.current !== value) {
 362          onChangeRef.current?.(value);
 363          prevValueRef.current = value;
 364        }
 365      }, [value, prevValueRef]);
 366      return [value, setValue, onChangeRef];
 367    }
 368    function isFunction(value) {
 369      return typeof value === "function";
 370    }
 371  
 372    // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
 373    var React10 = __toESM(require_react(), 1);
 374  
 375    // node_modules/@radix-ui/react-primitive/dist/index.mjs
 376    var React7 = __toESM(require_react(), 1);
 377    var ReactDOM = __toESM(require_react_dom(), 1);
 378  
 379    // node_modules/@radix-ui/react-slot/dist/index.mjs
 380    var React6 = __toESM(require_react(), 1);
 381    var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
 382    // @__NO_SIDE_EFFECTS__
 383    function createSlot(ownerName) {
 384      const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
 385      const Slot2 = React6.forwardRef((props, forwardedRef) => {
 386        const { children, ...slotProps } = props;
 387        const childrenArray = React6.Children.toArray(children);
 388        const slottable = childrenArray.find(isSlottable);
 389        if (slottable) {
 390          const newElement = slottable.props.children;
 391          const newChildren = childrenArray.map((child) => {
 392            if (child === slottable) {
 393              if (React6.Children.count(newElement) > 1) return React6.Children.only(null);
 394              return React6.isValidElement(newElement) ? newElement.props.children : null;
 395            } else {
 396              return child;
 397            }
 398          });
 399          return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React6.isValidElement(newElement) ? React6.cloneElement(newElement, void 0, newChildren) : null });
 400        }
 401        return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
 402      });
 403      Slot2.displayName = `$ownerName}.Slot`;
 404      return Slot2;
 405    }
 406    // @__NO_SIDE_EFFECTS__
 407    function createSlotClone(ownerName) {
 408      const SlotClone = React6.forwardRef((props, forwardedRef) => {
 409        const { children, ...slotProps } = props;
 410        if (React6.isValidElement(children)) {
 411          const childrenRef = getElementRef(children);
 412          const props2 = mergeProps(slotProps, children.props);
 413          if (children.type !== React6.Fragment) {
 414            props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
 415          }
 416          return React6.cloneElement(children, props2);
 417        }
 418        return React6.Children.count(children) > 1 ? React6.Children.only(null) : null;
 419      });
 420      SlotClone.displayName = `$ownerName}.SlotClone`;
 421      return SlotClone;
 422    }
 423    var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
 424    function isSlottable(child) {
 425      return React6.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
 426    }
 427    function mergeProps(slotProps, childProps) {
 428      const overrideProps = { ...childProps };
 429      for (const propName in childProps) {
 430        const slotPropValue = slotProps[propName];
 431        const childPropValue = childProps[propName];
 432        const isHandler = /^on[A-Z]/.test(propName);
 433        if (isHandler) {
 434          if (slotPropValue && childPropValue) {
 435            overrideProps[propName] = (...args) => {
 436              const result = childPropValue(...args);
 437              slotPropValue(...args);
 438              return result;
 439            };
 440          } else if (slotPropValue) {
 441            overrideProps[propName] = slotPropValue;
 442          }
 443        } else if (propName === "style") {
 444          overrideProps[propName] = { ...slotPropValue, ...childPropValue };
 445        } else if (propName === "className") {
 446          overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
 447        }
 448      }
 449      return { ...slotProps, ...overrideProps };
 450    }
 451    function getElementRef(element) {
 452      let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
 453      let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
 454      if (mayWarn) {
 455        return element.ref;
 456      }
 457      getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
 458      mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
 459      if (mayWarn) {
 460        return element.props.ref;
 461      }
 462      return element.props.ref || element.ref;
 463    }
 464  
 465    // node_modules/@radix-ui/react-primitive/dist/index.mjs
 466    var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
 467    var NODES = [
 468      "a",
 469      "button",
 470      "div",
 471      "form",
 472      "h2",
 473      "h3",
 474      "img",
 475      "input",
 476      "label",
 477      "li",
 478      "nav",
 479      "ol",
 480      "p",
 481      "select",
 482      "span",
 483      "svg",
 484      "ul"
 485    ];
 486    var Primitive = NODES.reduce((primitive, node) => {
 487      const Slot2 = createSlot(`Primitive.$node}`);
 488      const Node2 = React7.forwardRef((props, forwardedRef) => {
 489        const { asChild, ...primitiveProps } = props;
 490        const Comp = asChild ? Slot2 : node;
 491        if (typeof window !== "undefined") {
 492          window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
 493        }
 494        return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
 495      });
 496      Node2.displayName = `Primitive.$node}`;
 497      return { ...primitive, [node]: Node2 };
 498    }, {});
 499    function dispatchDiscreteCustomEvent(target, event) {
 500      if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
 501    }
 502  
 503    // node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
 504    var React8 = __toESM(require_react(), 1);
 505    function useCallbackRef(callback) {
 506      const callbackRef = React8.useRef(callback);
 507      React8.useEffect(() => {
 508        callbackRef.current = callback;
 509      });
 510      return React8.useMemo(() => (...args) => callbackRef.current?.(...args), []);
 511    }
 512  
 513    // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
 514    var React9 = __toESM(require_react(), 1);
 515    function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
 516      const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
 517      React9.useEffect(() => {
 518        const handleKeyDown = (event) => {
 519          if (event.key === "Escape") {
 520            onEscapeKeyDown(event);
 521          }
 522        };
 523        ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
 524        return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
 525      }, [onEscapeKeyDown, ownerDocument]);
 526    }
 527  
 528    // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
 529    var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
 530    var DISMISSABLE_LAYER_NAME = "DismissableLayer";
 531    var CONTEXT_UPDATE = "dismissableLayer.update";
 532    var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
 533    var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
 534    var originalBodyPointerEvents;
 535    var DismissableLayerContext = React10.createContext({
 536      layers: /* @__PURE__ */ new Set(),
 537      layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
 538      branches: /* @__PURE__ */ new Set()
 539    });
 540    var DismissableLayer = React10.forwardRef(
 541      (props, forwardedRef) => {
 542        const {
 543          disableOutsidePointerEvents = false,
 544          onEscapeKeyDown,
 545          onPointerDownOutside,
 546          onFocusOutside,
 547          onInteractOutside,
 548          onDismiss,
 549          ...layerProps
 550        } = props;
 551        const context2 = React10.useContext(DismissableLayerContext);
 552        const [node, setNode] = React10.useState(null);
 553        const ownerDocument = node?.ownerDocument ?? globalThis?.document;
 554        const [, force] = React10.useState({});
 555        const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
 556        const layers = Array.from(context2.layers);
 557        const [highestLayerWithOutsidePointerEventsDisabled] = [...context2.layersWithOutsidePointerEventsDisabled].slice(-1);
 558        const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
 559        const index = node ? layers.indexOf(node) : -1;
 560        const isBodyPointerEventsDisabled = context2.layersWithOutsidePointerEventsDisabled.size > 0;
 561        const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
 562        const pointerDownOutside = usePointerDownOutside((event) => {
 563          const target = event.target;
 564          const isPointerDownOnBranch = [...context2.branches].some((branch) => branch.contains(target));
 565          if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
 566          onPointerDownOutside?.(event);
 567          onInteractOutside?.(event);
 568          if (!event.defaultPrevented) onDismiss?.();
 569        }, ownerDocument);
 570        const focusOutside = useFocusOutside((event) => {
 571          const target = event.target;
 572          const isFocusInBranch = [...context2.branches].some((branch) => branch.contains(target));
 573          if (isFocusInBranch) return;
 574          onFocusOutside?.(event);
 575          onInteractOutside?.(event);
 576          if (!event.defaultPrevented) onDismiss?.();
 577        }, ownerDocument);
 578        useEscapeKeydown((event) => {
 579          const isHighestLayer = index === context2.layers.size - 1;
 580          if (!isHighestLayer) return;
 581          onEscapeKeyDown?.(event);
 582          if (!event.defaultPrevented && onDismiss) {
 583            event.preventDefault();
 584            onDismiss();
 585          }
 586        }, ownerDocument);
 587        React10.useEffect(() => {
 588          if (!node) return;
 589          if (disableOutsidePointerEvents) {
 590            if (context2.layersWithOutsidePointerEventsDisabled.size === 0) {
 591              originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
 592              ownerDocument.body.style.pointerEvents = "none";
 593            }
 594            context2.layersWithOutsidePointerEventsDisabled.add(node);
 595          }
 596          context2.layers.add(node);
 597          dispatchUpdate();
 598          return () => {
 599            if (disableOutsidePointerEvents && context2.layersWithOutsidePointerEventsDisabled.size === 1) {
 600              ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
 601            }
 602          };
 603        }, [node, ownerDocument, disableOutsidePointerEvents, context2]);
 604        React10.useEffect(() => {
 605          return () => {
 606            if (!node) return;
 607            context2.layers.delete(node);
 608            context2.layersWithOutsidePointerEventsDisabled.delete(node);
 609            dispatchUpdate();
 610          };
 611        }, [node, context2]);
 612        React10.useEffect(() => {
 613          const handleUpdate = () => force({});
 614          document.addEventListener(CONTEXT_UPDATE, handleUpdate);
 615          return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
 616        }, []);
 617        return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
 618          Primitive.div,
 619          {
 620            ...layerProps,
 621            ref: composedRefs,
 622            style: {
 623              pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
 624              ...props.style
 625            },
 626            onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
 627            onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
 628            onPointerDownCapture: composeEventHandlers(
 629              props.onPointerDownCapture,
 630              pointerDownOutside.onPointerDownCapture
 631            )
 632          }
 633        );
 634      }
 635    );
 636    DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
 637    var BRANCH_NAME = "DismissableLayerBranch";
 638    var DismissableLayerBranch = React10.forwardRef((props, forwardedRef) => {
 639      const context2 = React10.useContext(DismissableLayerContext);
 640      const ref = React10.useRef(null);
 641      const composedRefs = useComposedRefs(forwardedRef, ref);
 642      React10.useEffect(() => {
 643        const node = ref.current;
 644        if (node) {
 645          context2.branches.add(node);
 646          return () => {
 647            context2.branches.delete(node);
 648          };
 649        }
 650      }, [context2.branches]);
 651      return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Primitive.div, { ...props, ref: composedRefs });
 652    });
 653    DismissableLayerBranch.displayName = BRANCH_NAME;
 654    function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
 655      const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
 656      const isPointerInsideReactTreeRef = React10.useRef(false);
 657      const handleClickRef = React10.useRef(() => {
 658      });
 659      React10.useEffect(() => {
 660        const handlePointerDown = (event) => {
 661          if (event.target && !isPointerInsideReactTreeRef.current) {
 662            let handleAndDispatchPointerDownOutsideEvent2 = function() {
 663              handleAndDispatchCustomEvent(
 664                POINTER_DOWN_OUTSIDE,
 665                handlePointerDownOutside,
 666                eventDetail,
 667                { discrete: true }
 668              );
 669            };
 670            var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
 671            const eventDetail = { originalEvent: event };
 672            if (event.pointerType === "touch") {
 673              ownerDocument.removeEventListener("click", handleClickRef.current);
 674              handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
 675              ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
 676            } else {
 677              handleAndDispatchPointerDownOutsideEvent2();
 678            }
 679          } else {
 680            ownerDocument.removeEventListener("click", handleClickRef.current);
 681          }
 682          isPointerInsideReactTreeRef.current = false;
 683        };
 684        const timerId = window.setTimeout(() => {
 685          ownerDocument.addEventListener("pointerdown", handlePointerDown);
 686        }, 0);
 687        return () => {
 688          window.clearTimeout(timerId);
 689          ownerDocument.removeEventListener("pointerdown", handlePointerDown);
 690          ownerDocument.removeEventListener("click", handleClickRef.current);
 691        };
 692      }, [ownerDocument, handlePointerDownOutside]);
 693      return {
 694        // ensures we check React component tree (not just DOM tree)
 695        onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
 696      };
 697    }
 698    function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
 699      const handleFocusOutside = useCallbackRef(onFocusOutside);
 700      const isFocusInsideReactTreeRef = React10.useRef(false);
 701      React10.useEffect(() => {
 702        const handleFocus = (event) => {
 703          if (event.target && !isFocusInsideReactTreeRef.current) {
 704            const eventDetail = { originalEvent: event };
 705            handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
 706              discrete: false
 707            });
 708          }
 709        };
 710        ownerDocument.addEventListener("focusin", handleFocus);
 711        return () => ownerDocument.removeEventListener("focusin", handleFocus);
 712      }, [ownerDocument, handleFocusOutside]);
 713      return {
 714        onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
 715        onBlurCapture: () => isFocusInsideReactTreeRef.current = false
 716      };
 717    }
 718    function dispatchUpdate() {
 719      const event = new CustomEvent(CONTEXT_UPDATE);
 720      document.dispatchEvent(event);
 721    }
 722    function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
 723      const target = detail.originalEvent.target;
 724      const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
 725      if (handler) target.addEventListener(name, handler, { once: true });
 726      if (discrete) {
 727        dispatchDiscreteCustomEvent(target, event);
 728      } else {
 729        target.dispatchEvent(event);
 730      }
 731    }
 732  
 733    // node_modules/@radix-ui/react-focus-scope/dist/index.mjs
 734    var React11 = __toESM(require_react(), 1);
 735    var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
 736    var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
 737    var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
 738    var EVENT_OPTIONS = { bubbles: false, cancelable: true };
 739    var FOCUS_SCOPE_NAME = "FocusScope";
 740    var FocusScope = React11.forwardRef((props, forwardedRef) => {
 741      const {
 742        loop = false,
 743        trapped = false,
 744        onMountAutoFocus: onMountAutoFocusProp,
 745        onUnmountAutoFocus: onUnmountAutoFocusProp,
 746        ...scopeProps
 747      } = props;
 748      const [container, setContainer] = React11.useState(null);
 749      const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
 750      const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
 751      const lastFocusedElementRef = React11.useRef(null);
 752      const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
 753      const focusScope = React11.useRef({
 754        paused: false,
 755        pause() {
 756          this.paused = true;
 757        },
 758        resume() {
 759          this.paused = false;
 760        }
 761      }).current;
 762      React11.useEffect(() => {
 763        if (trapped) {
 764          let handleFocusIn2 = function(event) {
 765            if (focusScope.paused || !container) return;
 766            const target = event.target;
 767            if (container.contains(target)) {
 768              lastFocusedElementRef.current = target;
 769            } else {
 770              focus(lastFocusedElementRef.current, { select: true });
 771            }
 772          }, handleFocusOut2 = function(event) {
 773            if (focusScope.paused || !container) return;
 774            const relatedTarget = event.relatedTarget;
 775            if (relatedTarget === null) return;
 776            if (!container.contains(relatedTarget)) {
 777              focus(lastFocusedElementRef.current, { select: true });
 778            }
 779          }, handleMutations2 = function(mutations) {
 780            const focusedElement = document.activeElement;
 781            if (focusedElement !== document.body) return;
 782            for (const mutation of mutations) {
 783              if (mutation.removedNodes.length > 0) focus(container);
 784            }
 785          };
 786          var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
 787          document.addEventListener("focusin", handleFocusIn2);
 788          document.addEventListener("focusout", handleFocusOut2);
 789          const mutationObserver = new MutationObserver(handleMutations2);
 790          if (container) mutationObserver.observe(container, { childList: true, subtree: true });
 791          return () => {
 792            document.removeEventListener("focusin", handleFocusIn2);
 793            document.removeEventListener("focusout", handleFocusOut2);
 794            mutationObserver.disconnect();
 795          };
 796        }
 797      }, [trapped, container, focusScope.paused]);
 798      React11.useEffect(() => {
 799        if (container) {
 800          focusScopesStack.add(focusScope);
 801          const previouslyFocusedElement = document.activeElement;
 802          const hasFocusedCandidate = container.contains(previouslyFocusedElement);
 803          if (!hasFocusedCandidate) {
 804            const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
 805            container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
 806            container.dispatchEvent(mountEvent);
 807            if (!mountEvent.defaultPrevented) {
 808              focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
 809              if (document.activeElement === previouslyFocusedElement) {
 810                focus(container);
 811              }
 812            }
 813          }
 814          return () => {
 815            container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
 816            setTimeout(() => {
 817              const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
 818              container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
 819              container.dispatchEvent(unmountEvent);
 820              if (!unmountEvent.defaultPrevented) {
 821                focus(previouslyFocusedElement ?? document.body, { select: true });
 822              }
 823              container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
 824              focusScopesStack.remove(focusScope);
 825            }, 0);
 826          };
 827        }
 828      }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
 829      const handleKeyDown = React11.useCallback(
 830        (event) => {
 831          if (!loop && !trapped) return;
 832          if (focusScope.paused) return;
 833          const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
 834          const focusedElement = document.activeElement;
 835          if (isTabKey && focusedElement) {
 836            const container2 = event.currentTarget;
 837            const [first, last] = getTabbableEdges(container2);
 838            const hasTabbableElementsInside = first && last;
 839            if (!hasTabbableElementsInside) {
 840              if (focusedElement === container2) event.preventDefault();
 841            } else {
 842              if (!event.shiftKey && focusedElement === last) {
 843                event.preventDefault();
 844                if (loop) focus(first, { select: true });
 845              } else if (event.shiftKey && focusedElement === first) {
 846                event.preventDefault();
 847                if (loop) focus(last, { select: true });
 848              }
 849            }
 850          }
 851        },
 852        [loop, trapped, focusScope.paused]
 853      );
 854      return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
 855    });
 856    FocusScope.displayName = FOCUS_SCOPE_NAME;
 857    function focusFirst(candidates, { select = false } = {}) {
 858      const previouslyFocusedElement = document.activeElement;
 859      for (const candidate of candidates) {
 860        focus(candidate, { select });
 861        if (document.activeElement !== previouslyFocusedElement) return;
 862      }
 863    }
 864    function getTabbableEdges(container) {
 865      const candidates = getTabbableCandidates(container);
 866      const first = findVisible(candidates, container);
 867      const last = findVisible(candidates.reverse(), container);
 868      return [first, last];
 869    }
 870    function getTabbableCandidates(container) {
 871      const nodes = [];
 872      const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
 873        acceptNode: (node) => {
 874          const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
 875          if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
 876          return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
 877        }
 878      });
 879      while (walker.nextNode()) nodes.push(walker.currentNode);
 880      return nodes;
 881    }
 882    function findVisible(elements, container) {
 883      for (const element of elements) {
 884        if (!isHidden(element, { upTo: container })) return element;
 885      }
 886    }
 887    function isHidden(node, { upTo }) {
 888      if (getComputedStyle(node).visibility === "hidden") return true;
 889      while (node) {
 890        if (upTo !== void 0 && node === upTo) return false;
 891        if (getComputedStyle(node).display === "none") return true;
 892        node = node.parentElement;
 893      }
 894      return false;
 895    }
 896    function isSelectableInput(element) {
 897      return element instanceof HTMLInputElement && "select" in element;
 898    }
 899    function focus(element, { select = false } = {}) {
 900      if (element && element.focus) {
 901        const previouslyFocusedElement = document.activeElement;
 902        element.focus({ preventScroll: true });
 903        if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
 904          element.select();
 905      }
 906    }
 907    var focusScopesStack = createFocusScopesStack();
 908    function createFocusScopesStack() {
 909      let stack = [];
 910      return {
 911        add(focusScope) {
 912          const activeFocusScope = stack[0];
 913          if (focusScope !== activeFocusScope) {
 914            activeFocusScope?.pause();
 915          }
 916          stack = arrayRemove(stack, focusScope);
 917          stack.unshift(focusScope);
 918        },
 919        remove(focusScope) {
 920          stack = arrayRemove(stack, focusScope);
 921          stack[0]?.resume();
 922        }
 923      };
 924    }
 925    function arrayRemove(array, item) {
 926      const updatedArray = [...array];
 927      const index = updatedArray.indexOf(item);
 928      if (index !== -1) {
 929        updatedArray.splice(index, 1);
 930      }
 931      return updatedArray;
 932    }
 933    function removeLinks(items) {
 934      return items.filter((item) => item.tagName !== "A");
 935    }
 936  
 937    // node_modules/@radix-ui/react-portal/dist/index.mjs
 938    var React12 = __toESM(require_react(), 1);
 939    var import_react_dom = __toESM(require_react_dom(), 1);
 940    var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
 941    var PORTAL_NAME = "Portal";
 942    var Portal = React12.forwardRef((props, forwardedRef) => {
 943      const { container: containerProp, ...portalProps } = props;
 944      const [mounted, setMounted] = React12.useState(false);
 945      useLayoutEffect2(() => setMounted(true), []);
 946      const container = containerProp || mounted && globalThis?.document?.body;
 947      return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
 948    });
 949    Portal.displayName = PORTAL_NAME;
 950  
 951    // node_modules/@radix-ui/react-presence/dist/index.mjs
 952    var React23 = __toESM(require_react(), 1);
 953    var React13 = __toESM(require_react(), 1);
 954    function useStateMachine(initialState, machine) {
 955      return React13.useReducer((state, event) => {
 956        const nextState = machine[state][event];
 957        return nextState ?? state;
 958      }, initialState);
 959    }
 960    var Presence = (props) => {
 961      const { present, children } = props;
 962      const presence = usePresence(present);
 963      const child = typeof children === "function" ? children({ present: presence.isPresent }) : React23.Children.only(children);
 964      const ref = useComposedRefs(presence.ref, getElementRef2(child));
 965      const forceMount = typeof children === "function";
 966      return forceMount || presence.isPresent ? React23.cloneElement(child, { ref }) : null;
 967    };
 968    Presence.displayName = "Presence";
 969    function usePresence(present) {
 970      const [node, setNode] = React23.useState();
 971      const stylesRef = React23.useRef(null);
 972      const prevPresentRef = React23.useRef(present);
 973      const prevAnimationNameRef = React23.useRef("none");
 974      const initialState = present ? "mounted" : "unmounted";
 975      const [state, send] = useStateMachine(initialState, {
 976        mounted: {
 977          UNMOUNT: "unmounted",
 978          ANIMATION_OUT: "unmountSuspended"
 979        },
 980        unmountSuspended: {
 981          MOUNT: "mounted",
 982          ANIMATION_END: "unmounted"
 983        },
 984        unmounted: {
 985          MOUNT: "mounted"
 986        }
 987      });
 988      React23.useEffect(() => {
 989        const currentAnimationName = getAnimationName(stylesRef.current);
 990        prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
 991      }, [state]);
 992      useLayoutEffect2(() => {
 993        const styles = stylesRef.current;
 994        const wasPresent = prevPresentRef.current;
 995        const hasPresentChanged = wasPresent !== present;
 996        if (hasPresentChanged) {
 997          const prevAnimationName = prevAnimationNameRef.current;
 998          const currentAnimationName = getAnimationName(styles);
 999          if (present) {
1000            send("MOUNT");
1001          } else if (currentAnimationName === "none" || styles?.display === "none") {
1002            send("UNMOUNT");
1003          } else {
1004            const isAnimating = prevAnimationName !== currentAnimationName;
1005            if (wasPresent && isAnimating) {
1006              send("ANIMATION_OUT");
1007            } else {
1008              send("UNMOUNT");
1009            }
1010          }
1011          prevPresentRef.current = present;
1012        }
1013      }, [present, send]);
1014      useLayoutEffect2(() => {
1015        if (node) {
1016          let timeoutId;
1017          const ownerWindow = node.ownerDocument.defaultView ?? window;
1018          const handleAnimationEnd = (event) => {
1019            const currentAnimationName = getAnimationName(stylesRef.current);
1020            const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
1021            if (event.target === node && isCurrentAnimation) {
1022              send("ANIMATION_END");
1023              if (!prevPresentRef.current) {
1024                const currentFillMode = node.style.animationFillMode;
1025                node.style.animationFillMode = "forwards";
1026                timeoutId = ownerWindow.setTimeout(() => {
1027                  if (node.style.animationFillMode === "forwards") {
1028                    node.style.animationFillMode = currentFillMode;
1029                  }
1030                });
1031              }
1032            }
1033          };
1034          const handleAnimationStart = (event) => {
1035            if (event.target === node) {
1036              prevAnimationNameRef.current = getAnimationName(stylesRef.current);
1037            }
1038          };
1039          node.addEventListener("animationstart", handleAnimationStart);
1040          node.addEventListener("animationcancel", handleAnimationEnd);
1041          node.addEventListener("animationend", handleAnimationEnd);
1042          return () => {
1043            ownerWindow.clearTimeout(timeoutId);
1044            node.removeEventListener("animationstart", handleAnimationStart);
1045            node.removeEventListener("animationcancel", handleAnimationEnd);
1046            node.removeEventListener("animationend", handleAnimationEnd);
1047          };
1048        } else {
1049          send("ANIMATION_END");
1050        }
1051      }, [node, send]);
1052      return {
1053        isPresent: ["mounted", "unmountSuspended"].includes(state),
1054        ref: React23.useCallback((node2) => {
1055          stylesRef.current = node2 ? getComputedStyle(node2) : null;
1056          setNode(node2);
1057        }, [])
1058      };
1059    }
1060    function getAnimationName(styles) {
1061      return styles?.animationName || "none";
1062    }
1063    function getElementRef2(element) {
1064      let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
1065      let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1066      if (mayWarn) {
1067        return element.ref;
1068      }
1069      getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
1070      mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1071      if (mayWarn) {
1072        return element.props.ref;
1073      }
1074      return element.props.ref || element.ref;
1075    }
1076  
1077    // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
1078    var React14 = __toESM(require_react(), 1);
1079    var count2 = 0;
1080    function useFocusGuards() {
1081      React14.useEffect(() => {
1082        const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
1083        document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
1084        document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
1085        count2++;
1086        return () => {
1087          if (count2 === 1) {
1088            document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
1089          }
1090          count2--;
1091        };
1092      }, []);
1093    }
1094    function createFocusGuard() {
1095      const element = document.createElement("span");
1096      element.setAttribute("data-radix-focus-guard", "");
1097      element.tabIndex = 0;
1098      element.style.outline = "none";
1099      element.style.opacity = "0";
1100      element.style.position = "fixed";
1101      element.style.pointerEvents = "none";
1102      return element;
1103    }
1104  
1105    // node_modules/tslib/tslib.es6.mjs
1106    var __assign = function() {
1107      __assign = Object.assign || function __assign2(t2) {
1108        for (var s, i = 1, n = arguments.length; i < n; i++) {
1109          s = arguments[i];
1110          for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t2[p2] = s[p2];
1111        }
1112        return t2;
1113      };
1114      return __assign.apply(this, arguments);
1115    };
1116    function __rest(s, e) {
1117      var t2 = {};
1118      for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e.indexOf(p2) < 0)
1119        t2[p2] = s[p2];
1120      if (s != null && typeof Object.getOwnPropertySymbols === "function")
1121        for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
1122          if (e.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
1123            t2[p2[i]] = s[p2[i]];
1124        }
1125      return t2;
1126    }
1127    function __spreadArray(to, from, pack) {
1128      if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
1129        if (ar || !(i in from)) {
1130          if (!ar) ar = Array.prototype.slice.call(from, 0, i);
1131          ar[i] = from[i];
1132        }
1133      }
1134      return to.concat(ar || Array.prototype.slice.call(from));
1135    }
1136  
1137    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/Combination.js
1138    var React21 = __toESM(require_react());
1139  
1140    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/UI.js
1141    var React17 = __toESM(require_react());
1142  
1143    // node_modules/react-remove-scroll-bar/dist/es2015/constants.js
1144    var zeroRightClassName = "right-scroll-bar-position";
1145    var fullWidthClassName = "width-before-scroll-bar";
1146    var noScrollbarsClassName = "with-scroll-bars-hidden";
1147    var removedBarSizeVariable = "--removed-body-scroll-bar-size";
1148  
1149    // node_modules/use-callback-ref/dist/es2015/assignRef.js
1150    function assignRef(ref, value) {
1151      if (typeof ref === "function") {
1152        ref(value);
1153      } else if (ref) {
1154        ref.current = value;
1155      }
1156      return ref;
1157    }
1158  
1159    // node_modules/use-callback-ref/dist/es2015/useRef.js
1160    var import_react = __toESM(require_react());
1161    function useCallbackRef2(initialValue, callback) {
1162      var ref = (0, import_react.useState)(function() {
1163        return {
1164          // value
1165          value: initialValue,
1166          // last callback
1167          callback,
1168          // "memoized" public interface
1169          facade: {
1170            get current() {
1171              return ref.value;
1172            },
1173            set current(value) {
1174              var last = ref.value;
1175              if (last !== value) {
1176                ref.value = value;
1177                ref.callback(value, last);
1178              }
1179            }
1180          }
1181        };
1182      })[0];
1183      ref.callback = callback;
1184      return ref.facade;
1185    }
1186  
1187    // node_modules/use-callback-ref/dist/es2015/useMergeRef.js
1188    var React15 = __toESM(require_react());
1189    var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React15.useLayoutEffect : React15.useEffect;
1190    var currentValues = /* @__PURE__ */ new WeakMap();
1191    function useMergeRefs(refs, defaultValue) {
1192      var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
1193        return refs.forEach(function(ref) {
1194          return assignRef(ref, newValue);
1195        });
1196      });
1197      useIsomorphicLayoutEffect(function() {
1198        var oldValue = currentValues.get(callbackRef);
1199        if (oldValue) {
1200          var prevRefs_1 = new Set(oldValue);
1201          var nextRefs_1 = new Set(refs);
1202          var current_1 = callbackRef.current;
1203          prevRefs_1.forEach(function(ref) {
1204            if (!nextRefs_1.has(ref)) {
1205              assignRef(ref, null);
1206            }
1207          });
1208          nextRefs_1.forEach(function(ref) {
1209            if (!prevRefs_1.has(ref)) {
1210              assignRef(ref, current_1);
1211            }
1212          });
1213        }
1214        currentValues.set(callbackRef, refs);
1215      }, [refs]);
1216      return callbackRef;
1217    }
1218  
1219    // node_modules/use-sidecar/dist/es2015/medium.js
1220    function ItoI(a) {
1221      return a;
1222    }
1223    function innerCreateMedium(defaults, middleware) {
1224      if (middleware === void 0) {
1225        middleware = ItoI;
1226      }
1227      var buffer = [];
1228      var assigned = false;
1229      var medium = {
1230        read: function() {
1231          if (assigned) {
1232            throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
1233          }
1234          if (buffer.length) {
1235            return buffer[buffer.length - 1];
1236          }
1237          return defaults;
1238        },
1239        useMedium: function(data) {
1240          var item = middleware(data, assigned);
1241          buffer.push(item);
1242          return function() {
1243            buffer = buffer.filter(function(x) {
1244              return x !== item;
1245            });
1246          };
1247        },
1248        assignSyncMedium: function(cb) {
1249          assigned = true;
1250          while (buffer.length) {
1251            var cbs = buffer;
1252            buffer = [];
1253            cbs.forEach(cb);
1254          }
1255          buffer = {
1256            push: function(x) {
1257              return cb(x);
1258            },
1259            filter: function() {
1260              return buffer;
1261            }
1262          };
1263        },
1264        assignMedium: function(cb) {
1265          assigned = true;
1266          var pendingQueue = [];
1267          if (buffer.length) {
1268            var cbs = buffer;
1269            buffer = [];
1270            cbs.forEach(cb);
1271            pendingQueue = buffer;
1272          }
1273          var executeQueue = function() {
1274            var cbs2 = pendingQueue;
1275            pendingQueue = [];
1276            cbs2.forEach(cb);
1277          };
1278          var cycle = function() {
1279            return Promise.resolve().then(executeQueue);
1280          };
1281          cycle();
1282          buffer = {
1283            push: function(x) {
1284              pendingQueue.push(x);
1285              cycle();
1286            },
1287            filter: function(filter) {
1288              pendingQueue = pendingQueue.filter(filter);
1289              return buffer;
1290            }
1291          };
1292        }
1293      };
1294      return medium;
1295    }
1296    function createSidecarMedium(options) {
1297      if (options === void 0) {
1298        options = {};
1299      }
1300      var medium = innerCreateMedium(null);
1301      medium.options = __assign({ async: true, ssr: false }, options);
1302      return medium;
1303    }
1304  
1305    // node_modules/use-sidecar/dist/es2015/exports.js
1306    var React16 = __toESM(require_react());
1307    var SideCar = function(_a) {
1308      var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
1309      if (!sideCar) {
1310        throw new Error("Sidecar: please provide `sideCar` property to import the right car");
1311      }
1312      var Target = sideCar.read();
1313      if (!Target) {
1314        throw new Error("Sidecar medium not found");
1315      }
1316      return React16.createElement(Target, __assign({}, rest));
1317    };
1318    SideCar.isSideCarExport = true;
1319    function exportSidecar(medium, exported) {
1320      medium.useMedium(exported);
1321      return SideCar;
1322    }
1323  
1324    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/medium.js
1325    var effectCar = createSidecarMedium();
1326  
1327    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/UI.js
1328    var nothing = function() {
1329      return;
1330    };
1331    var RemoveScroll = React17.forwardRef(function(props, parentRef) {
1332      var ref = React17.useRef(null);
1333      var _a = React17.useState({
1334        onScrollCapture: nothing,
1335        onWheelCapture: nothing,
1336        onTouchMoveCapture: nothing
1337      }), callbacks = _a[0], setCallbacks = _a[1];
1338      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"]);
1339      var SideCar2 = sideCar;
1340      var containerRef = useMergeRefs([ref, parentRef]);
1341      var containerProps = __assign(__assign({}, rest), callbacks);
1342      return React17.createElement(
1343        React17.Fragment,
1344        null,
1345        enabled && React17.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
1346        forwardProps ? React17.cloneElement(React17.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React17.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
1347      );
1348    });
1349    RemoveScroll.defaultProps = {
1350      enabled: true,
1351      removeScrollBar: true,
1352      inert: false
1353    };
1354    RemoveScroll.classNames = {
1355      fullWidth: fullWidthClassName,
1356      zeroRight: zeroRightClassName
1357    };
1358  
1359    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
1360    var React20 = __toESM(require_react());
1361  
1362    // node_modules/react-remove-scroll-bar/dist/es2015/component.js
1363    var React19 = __toESM(require_react());
1364  
1365    // node_modules/react-style-singleton/dist/es2015/hook.js
1366    var React18 = __toESM(require_react());
1367  
1368    // node_modules/get-nonce/dist/es2015/index.js
1369    var currentNonce;
1370    var getNonce = function() {
1371      if (currentNonce) {
1372        return currentNonce;
1373      }
1374      if (typeof __webpack_nonce__ !== "undefined") {
1375        return __webpack_nonce__;
1376      }
1377      return void 0;
1378    };
1379  
1380    // node_modules/react-style-singleton/dist/es2015/singleton.js
1381    function makeStyleTag() {
1382      if (!document)
1383        return null;
1384      var tag = document.createElement("style");
1385      tag.type = "text/css";
1386      var nonce = getNonce();
1387      if (nonce) {
1388        tag.setAttribute("nonce", nonce);
1389      }
1390      return tag;
1391    }
1392    function injectStyles(tag, css) {
1393      if (tag.styleSheet) {
1394        tag.styleSheet.cssText = css;
1395      } else {
1396        tag.appendChild(document.createTextNode(css));
1397      }
1398    }
1399    function insertStyleTag(tag) {
1400      var head = document.head || document.getElementsByTagName("head")[0];
1401      head.appendChild(tag);
1402    }
1403    var stylesheetSingleton = function() {
1404      var counter = 0;
1405      var stylesheet = null;
1406      return {
1407        add: function(style) {
1408          if (counter == 0) {
1409            if (stylesheet = makeStyleTag()) {
1410              injectStyles(stylesheet, style);
1411              insertStyleTag(stylesheet);
1412            }
1413          }
1414          counter++;
1415        },
1416        remove: function() {
1417          counter--;
1418          if (!counter && stylesheet) {
1419            stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
1420            stylesheet = null;
1421          }
1422        }
1423      };
1424    };
1425  
1426    // node_modules/react-style-singleton/dist/es2015/hook.js
1427    var styleHookSingleton = function() {
1428      var sheet = stylesheetSingleton();
1429      return function(styles, isDynamic) {
1430        React18.useEffect(function() {
1431          sheet.add(styles);
1432          return function() {
1433            sheet.remove();
1434          };
1435        }, [styles && isDynamic]);
1436      };
1437    };
1438  
1439    // node_modules/react-style-singleton/dist/es2015/component.js
1440    var styleSingleton = function() {
1441      var useStyle = styleHookSingleton();
1442      var Sheet = function(_a) {
1443        var styles = _a.styles, dynamic = _a.dynamic;
1444        useStyle(styles, dynamic);
1445        return null;
1446      };
1447      return Sheet;
1448    };
1449  
1450    // node_modules/react-remove-scroll-bar/dist/es2015/utils.js
1451    var zeroGap = {
1452      left: 0,
1453      top: 0,
1454      right: 0,
1455      gap: 0
1456    };
1457    var parse = function(x) {
1458      return parseInt(x || "", 10) || 0;
1459    };
1460    var getOffset = function(gapMode) {
1461      var cs = window.getComputedStyle(document.body);
1462      var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
1463      var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
1464      var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
1465      return [parse(left), parse(top), parse(right)];
1466    };
1467    var getGapWidth = function(gapMode) {
1468      if (gapMode === void 0) {
1469        gapMode = "margin";
1470      }
1471      if (typeof window === "undefined") {
1472        return zeroGap;
1473      }
1474      var offsets = getOffset(gapMode);
1475      var documentWidth = document.documentElement.clientWidth;
1476      var windowWidth = window.innerWidth;
1477      return {
1478        left: offsets[0],
1479        top: offsets[1],
1480        right: offsets[2],
1481        gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
1482      };
1483    };
1484  
1485    // node_modules/react-remove-scroll-bar/dist/es2015/component.js
1486    var Style = styleSingleton();
1487    var lockAttribute = "data-scroll-locked";
1488    var getStyles = function(_a, allowRelative, gapMode, important) {
1489      var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
1490      if (gapMode === void 0) {
1491        gapMode = "margin";
1492      }
1493      return "\n  .".concat(noScrollbarsClassName, " {\n   overflow: hidden ").concat(important, ";\n   padding-right: ").concat(gap, "px ").concat(important, ";\n  }\n  body[").concat(lockAttribute, "] {\n    overflow: hidden ").concat(important, ";\n    overscroll-behavior: contain;\n    ").concat([
1494        allowRelative && "position: relative ".concat(important, ";"),
1495        gapMode === "margin" && "\n    padding-left: ".concat(left, "px;\n    padding-top: ").concat(top, "px;\n    padding-right: ").concat(right, "px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(gap, "px ").concat(important, ";\n    "),
1496        gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
1497      ].filter(Boolean).join(""), "\n  }\n  \n  .").concat(zeroRightClassName, " {\n    right: ").concat(gap, "px ").concat(important, ";\n  }\n  \n  .").concat(fullWidthClassName, " {\n    margin-right: ").concat(gap, "px ").concat(important, ";\n  }\n  \n  .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n    right: 0 ").concat(important, ";\n  }\n  \n  .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n    margin-right: 0 ").concat(important, ";\n  }\n  \n  body[").concat(lockAttribute, "] {\n    ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n  }\n");
1498    };
1499    var getCurrentUseCounter = function() {
1500      var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
1501      return isFinite(counter) ? counter : 0;
1502    };
1503    var useLockAttribute = function() {
1504      React19.useEffect(function() {
1505        document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
1506        return function() {
1507          var newCounter = getCurrentUseCounter() - 1;
1508          if (newCounter <= 0) {
1509            document.body.removeAttribute(lockAttribute);
1510          } else {
1511            document.body.setAttribute(lockAttribute, newCounter.toString());
1512          }
1513        };
1514      }, []);
1515    };
1516    var RemoveScrollBar = function(_a) {
1517      var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
1518      useLockAttribute();
1519      var gap = React19.useMemo(function() {
1520        return getGapWidth(gapMode);
1521      }, [gapMode]);
1522      return React19.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
1523    };
1524  
1525    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
1526    var passiveSupported = false;
1527    if (typeof window !== "undefined") {
1528      try {
1529        options = Object.defineProperty({}, "passive", {
1530          get: function() {
1531            passiveSupported = true;
1532            return true;
1533          }
1534        });
1535        window.addEventListener("test", options, options);
1536        window.removeEventListener("test", options, options);
1537      } catch (err) {
1538        passiveSupported = false;
1539      }
1540    }
1541    var options;
1542    var nonPassive = passiveSupported ? { passive: false } : false;
1543  
1544    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
1545    var alwaysContainsScroll = function(node) {
1546      return node.tagName === "TEXTAREA";
1547    };
1548    var elementCanBeScrolled = function(node, overflow) {
1549      if (!(node instanceof Element)) {
1550        return false;
1551      }
1552      var styles = window.getComputedStyle(node);
1553      return (
1554        // not-not-scrollable
1555        styles[overflow] !== "hidden" && // contains scroll inside self
1556        !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
1557      );
1558    };
1559    var elementCouldBeVScrolled = function(node) {
1560      return elementCanBeScrolled(node, "overflowY");
1561    };
1562    var elementCouldBeHScrolled = function(node) {
1563      return elementCanBeScrolled(node, "overflowX");
1564    };
1565    var locationCouldBeScrolled = function(axis, node) {
1566      var ownerDocument = node.ownerDocument;
1567      var current = node;
1568      do {
1569        if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
1570          current = current.host;
1571        }
1572        var isScrollable = elementCouldBeScrolled(axis, current);
1573        if (isScrollable) {
1574          var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
1575          if (scrollHeight > clientHeight) {
1576            return true;
1577          }
1578        }
1579        current = current.parentNode;
1580      } while (current && current !== ownerDocument.body);
1581      return false;
1582    };
1583    var getVScrollVariables = function(_a) {
1584      var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
1585      return [
1586        scrollTop,
1587        scrollHeight,
1588        clientHeight
1589      ];
1590    };
1591    var getHScrollVariables = function(_a) {
1592      var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
1593      return [
1594        scrollLeft,
1595        scrollWidth,
1596        clientWidth
1597      ];
1598    };
1599    var elementCouldBeScrolled = function(axis, node) {
1600      return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
1601    };
1602    var getScrollVariables = function(axis, node) {
1603      return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
1604    };
1605    var getDirectionFactor = function(axis, direction) {
1606      return axis === "h" && direction === "rtl" ? -1 : 1;
1607    };
1608    var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
1609      var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
1610      var delta = directionFactor * sourceDelta;
1611      var target = event.target;
1612      var targetInLock = endTarget.contains(target);
1613      var shouldCancelScroll = false;
1614      var isDeltaPositive = delta > 0;
1615      var availableScroll = 0;
1616      var availableScrollTop = 0;
1617      do {
1618        if (!target) {
1619          break;
1620        }
1621        var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
1622        var elementScroll = scroll_1 - capacity - directionFactor * position;
1623        if (position || elementScroll) {
1624          if (elementCouldBeScrolled(axis, target)) {
1625            availableScroll += elementScroll;
1626            availableScrollTop += position;
1627          }
1628        }
1629        var parent_1 = target.parentNode;
1630        target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
1631      } while (
1632        // portaled content
1633        !targetInLock && target !== document.body || // self content
1634        targetInLock && (endTarget.contains(target) || endTarget === target)
1635      );
1636      if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) {
1637        shouldCancelScroll = true;
1638      } else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) {
1639        shouldCancelScroll = true;
1640      }
1641      return shouldCancelScroll;
1642    };
1643  
1644    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
1645    var getTouchXY = function(event) {
1646      return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
1647    };
1648    var getDeltaXY = function(event) {
1649      return [event.deltaX, event.deltaY];
1650    };
1651    var extractRef = function(ref) {
1652      return ref && "current" in ref ? ref.current : ref;
1653    };
1654    var deltaCompare = function(x, y) {
1655      return x[0] === y[0] && x[1] === y[1];
1656    };
1657    var generateStyle = function(id) {
1658      return "\n  .block-interactivity-".concat(id, " {pointer-events: none;}\n  .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
1659    };
1660    var idCounter = 0;
1661    var lockStack = [];
1662    function RemoveScrollSideCar(props) {
1663      var shouldPreventQueue = React20.useRef([]);
1664      var touchStartRef = React20.useRef([0, 0]);
1665      var activeAxis = React20.useRef();
1666      var id = React20.useState(idCounter++)[0];
1667      var Style2 = React20.useState(styleSingleton)[0];
1668      var lastProps = React20.useRef(props);
1669      React20.useEffect(function() {
1670        lastProps.current = props;
1671      }, [props]);
1672      React20.useEffect(function() {
1673        if (props.inert) {
1674          document.body.classList.add("block-interactivity-".concat(id));
1675          var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
1676          allow_1.forEach(function(el) {
1677            return el.classList.add("allow-interactivity-".concat(id));
1678          });
1679          return function() {
1680            document.body.classList.remove("block-interactivity-".concat(id));
1681            allow_1.forEach(function(el) {
1682              return el.classList.remove("allow-interactivity-".concat(id));
1683            });
1684          };
1685        }
1686        return;
1687      }, [props.inert, props.lockRef.current, props.shards]);
1688      var shouldCancelEvent = React20.useCallback(function(event, parent) {
1689        if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
1690          return !lastProps.current.allowPinchZoom;
1691        }
1692        var touch = getTouchXY(event);
1693        var touchStart = touchStartRef.current;
1694        var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
1695        var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
1696        var currentAxis;
1697        var target = event.target;
1698        var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
1699        if ("touches" in event && moveDirection === "h" && target.type === "range") {
1700          return false;
1701        }
1702        var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
1703        if (!canBeScrolledInMainDirection) {
1704          return true;
1705        }
1706        if (canBeScrolledInMainDirection) {
1707          currentAxis = moveDirection;
1708        } else {
1709          currentAxis = moveDirection === "v" ? "h" : "v";
1710          canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
1711        }
1712        if (!canBeScrolledInMainDirection) {
1713          return false;
1714        }
1715        if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
1716          activeAxis.current = currentAxis;
1717        }
1718        if (!currentAxis) {
1719          return true;
1720        }
1721        var cancelingAxis = activeAxis.current || currentAxis;
1722        return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
1723      }, []);
1724      var shouldPrevent = React20.useCallback(function(_event) {
1725        var event = _event;
1726        if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
1727          return;
1728        }
1729        var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
1730        var sourceEvent = shouldPreventQueue.current.filter(function(e) {
1731          return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
1732        })[0];
1733        if (sourceEvent && sourceEvent.should) {
1734          if (event.cancelable) {
1735            event.preventDefault();
1736          }
1737          return;
1738        }
1739        if (!sourceEvent) {
1740          var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
1741            return node.contains(event.target);
1742          });
1743          var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
1744          if (shouldStop) {
1745            if (event.cancelable) {
1746              event.preventDefault();
1747            }
1748          }
1749        }
1750      }, []);
1751      var shouldCancel = React20.useCallback(function(name, delta, target, should) {
1752        var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
1753        shouldPreventQueue.current.push(event);
1754        setTimeout(function() {
1755          shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
1756            return e !== event;
1757          });
1758        }, 1);
1759      }, []);
1760      var scrollTouchStart = React20.useCallback(function(event) {
1761        touchStartRef.current = getTouchXY(event);
1762        activeAxis.current = void 0;
1763      }, []);
1764      var scrollWheel = React20.useCallback(function(event) {
1765        shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1766      }, []);
1767      var scrollTouchMove = React20.useCallback(function(event) {
1768        shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1769      }, []);
1770      React20.useEffect(function() {
1771        lockStack.push(Style2);
1772        props.setCallbacks({
1773          onScrollCapture: scrollWheel,
1774          onWheelCapture: scrollWheel,
1775          onTouchMoveCapture: scrollTouchMove
1776        });
1777        document.addEventListener("wheel", shouldPrevent, nonPassive);
1778        document.addEventListener("touchmove", shouldPrevent, nonPassive);
1779        document.addEventListener("touchstart", scrollTouchStart, nonPassive);
1780        return function() {
1781          lockStack = lockStack.filter(function(inst) {
1782            return inst !== Style2;
1783          });
1784          document.removeEventListener("wheel", shouldPrevent, nonPassive);
1785          document.removeEventListener("touchmove", shouldPrevent, nonPassive);
1786          document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
1787        };
1788      }, []);
1789      var removeScrollBar = props.removeScrollBar, inert = props.inert;
1790      return React20.createElement(
1791        React20.Fragment,
1792        null,
1793        inert ? React20.createElement(Style2, { styles: generateStyle(id) }) : null,
1794        removeScrollBar ? React20.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
1795      );
1796    }
1797    function getOutermostShadowParent(node) {
1798      var shadowParent = null;
1799      while (node !== null) {
1800        if (node instanceof ShadowRoot) {
1801          shadowParent = node.host;
1802          node = node.host;
1803        }
1804        node = node.parentNode;
1805      }
1806      return shadowParent;
1807    }
1808  
1809    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/sidecar.js
1810    var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
1811  
1812    // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/Combination.js
1813    var ReactRemoveScroll = React21.forwardRef(function(props, ref) {
1814      return React21.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
1815    });
1816    ReactRemoveScroll.classNames = RemoveScroll.classNames;
1817    var Combination_default = ReactRemoveScroll;
1818  
1819    // node_modules/aria-hidden/dist/es2015/index.js
1820    var getDefaultParent = function(originalTarget) {
1821      if (typeof document === "undefined") {
1822        return null;
1823      }
1824      var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
1825      return sampleTarget.ownerDocument.body;
1826    };
1827    var counterMap = /* @__PURE__ */ new WeakMap();
1828    var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
1829    var markerMap = {};
1830    var lockCount = 0;
1831    var unwrapHost = function(node) {
1832      return node && (node.host || unwrapHost(node.parentNode));
1833    };
1834    var correctTargets = function(parent, targets) {
1835      return targets.map(function(target) {
1836        if (parent.contains(target)) {
1837          return target;
1838        }
1839        var correctedTarget = unwrapHost(target);
1840        if (correctedTarget && parent.contains(correctedTarget)) {
1841          return correctedTarget;
1842        }
1843        console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
1844        return null;
1845      }).filter(function(x) {
1846        return Boolean(x);
1847      });
1848    };
1849    var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
1850      var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1851      if (!markerMap[markerName]) {
1852        markerMap[markerName] = /* @__PURE__ */ new WeakMap();
1853      }
1854      var markerCounter = markerMap[markerName];
1855      var hiddenNodes = [];
1856      var elementsToKeep = /* @__PURE__ */ new Set();
1857      var elementsToStop = new Set(targets);
1858      var keep = function(el) {
1859        if (!el || elementsToKeep.has(el)) {
1860          return;
1861        }
1862        elementsToKeep.add(el);
1863        keep(el.parentNode);
1864      };
1865      targets.forEach(keep);
1866      var deep = function(parent) {
1867        if (!parent || elementsToStop.has(parent)) {
1868          return;
1869        }
1870        Array.prototype.forEach.call(parent.children, function(node) {
1871          if (elementsToKeep.has(node)) {
1872            deep(node);
1873          } else {
1874            try {
1875              var attr = node.getAttribute(controlAttribute);
1876              var alreadyHidden = attr !== null && attr !== "false";
1877              var counterValue = (counterMap.get(node) || 0) + 1;
1878              var markerValue = (markerCounter.get(node) || 0) + 1;
1879              counterMap.set(node, counterValue);
1880              markerCounter.set(node, markerValue);
1881              hiddenNodes.push(node);
1882              if (counterValue === 1 && alreadyHidden) {
1883                uncontrolledNodes.set(node, true);
1884              }
1885              if (markerValue === 1) {
1886                node.setAttribute(markerName, "true");
1887              }
1888              if (!alreadyHidden) {
1889                node.setAttribute(controlAttribute, "true");
1890              }
1891            } catch (e) {
1892              console.error("aria-hidden: cannot operate on ", node, e);
1893            }
1894          }
1895        });
1896      };
1897      deep(parentNode);
1898      elementsToKeep.clear();
1899      lockCount++;
1900      return function() {
1901        hiddenNodes.forEach(function(node) {
1902          var counterValue = counterMap.get(node) - 1;
1903          var markerValue = markerCounter.get(node) - 1;
1904          counterMap.set(node, counterValue);
1905          markerCounter.set(node, markerValue);
1906          if (!counterValue) {
1907            if (!uncontrolledNodes.has(node)) {
1908              node.removeAttribute(controlAttribute);
1909            }
1910            uncontrolledNodes.delete(node);
1911          }
1912          if (!markerValue) {
1913            node.removeAttribute(markerName);
1914          }
1915        });
1916        lockCount--;
1917        if (!lockCount) {
1918          counterMap = /* @__PURE__ */ new WeakMap();
1919          counterMap = /* @__PURE__ */ new WeakMap();
1920          uncontrolledNodes = /* @__PURE__ */ new WeakMap();
1921          markerMap = {};
1922        }
1923      };
1924    };
1925    var hideOthers = function(originalTarget, parentNode, markerName) {
1926      if (markerName === void 0) {
1927        markerName = "data-aria-hidden";
1928      }
1929      var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1930      var activeParentNode = parentNode || getDefaultParent(originalTarget);
1931      if (!activeParentNode) {
1932        return function() {
1933          return null;
1934        };
1935      }
1936      targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
1937      return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
1938    };
1939  
1940    // node_modules/@radix-ui/react-dialog/dist/index.mjs
1941    var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
1942    var DIALOG_NAME = "Dialog";
1943    var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
1944    var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
1945    var Dialog = (props) => {
1946      const {
1947        __scopeDialog,
1948        children,
1949        open: openProp,
1950        defaultOpen,
1951        onOpenChange,
1952        modal = true
1953      } = props;
1954      const triggerRef = React24.useRef(null);
1955      const contentRef = React24.useRef(null);
1956      const [open2, setOpen] = useControllableState({
1957        prop: openProp,
1958        defaultProp: defaultOpen ?? false,
1959        onChange: onOpenChange,
1960        caller: DIALOG_NAME
1961      });
1962      return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1963        DialogProvider,
1964        {
1965          scope: __scopeDialog,
1966          triggerRef,
1967          contentRef,
1968          contentId: useId(),
1969          titleId: useId(),
1970          descriptionId: useId(),
1971          open: open2,
1972          onOpenChange: setOpen,
1973          onOpenToggle: React24.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
1974          modal,
1975          children
1976        }
1977      );
1978    };
1979    Dialog.displayName = DIALOG_NAME;
1980    var TRIGGER_NAME = "DialogTrigger";
1981    var DialogTrigger = React24.forwardRef(
1982      (props, forwardedRef) => {
1983        const { __scopeDialog, ...triggerProps } = props;
1984        const context2 = useDialogContext(TRIGGER_NAME, __scopeDialog);
1985        const composedTriggerRef = useComposedRefs(forwardedRef, context2.triggerRef);
1986        return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1987          Primitive.button,
1988          {
1989            type: "button",
1990            "aria-haspopup": "dialog",
1991            "aria-expanded": context2.open,
1992            "aria-controls": context2.contentId,
1993            "data-state": getState(context2.open),
1994            ...triggerProps,
1995            ref: composedTriggerRef,
1996            onClick: composeEventHandlers(props.onClick, context2.onOpenToggle)
1997          }
1998        );
1999      }
2000    );
2001    DialogTrigger.displayName = TRIGGER_NAME;
2002    var PORTAL_NAME2 = "DialogPortal";
2003    var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
2004      forceMount: void 0
2005    });
2006    var DialogPortal = (props) => {
2007      const { __scopeDialog, forceMount, children, container } = props;
2008      const context2 = useDialogContext(PORTAL_NAME2, __scopeDialog);
2009      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 }) })) });
2010    };
2011    DialogPortal.displayName = PORTAL_NAME2;
2012    var OVERLAY_NAME = "DialogOverlay";
2013    var DialogOverlay = React24.forwardRef(
2014      (props, forwardedRef) => {
2015        const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
2016        const { forceMount = portalContext.forceMount, ...overlayProps } = props;
2017        const context2 = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
2018        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;
2019      }
2020    );
2021    DialogOverlay.displayName = OVERLAY_NAME;
2022    var Slot = createSlot("DialogOverlay.RemoveScroll");
2023    var DialogOverlayImpl = React24.forwardRef(
2024      (props, forwardedRef) => {
2025        const { __scopeDialog, ...overlayProps } = props;
2026        const context2 = useDialogContext(OVERLAY_NAME, __scopeDialog);
2027        return (
2028          // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
2029          // ie. when `Overlay` and `Content` are siblings
2030          /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Combination_default, { as: Slot, allowPinchZoom: true, shards: [context2.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2031            Primitive.div,
2032            {
2033              "data-state": getState(context2.open),
2034              ...overlayProps,
2035              ref: forwardedRef,
2036              style: { pointerEvents: "auto", ...overlayProps.style }
2037            }
2038          ) })
2039        );
2040      }
2041    );
2042    var CONTENT_NAME = "DialogContent";
2043    var DialogContent = React24.forwardRef(
2044      (props, forwardedRef) => {
2045        const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
2046        const { forceMount = portalContext.forceMount, ...contentProps } = props;
2047        const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog);
2048        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 }) });
2049      }
2050    );
2051    DialogContent.displayName = CONTENT_NAME;
2052    var DialogContentModal = React24.forwardRef(
2053      (props, forwardedRef) => {
2054        const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog);
2055        const contentRef = React24.useRef(null);
2056        const composedRefs = useComposedRefs(forwardedRef, context2.contentRef, contentRef);
2057        React24.useEffect(() => {
2058          const content = contentRef.current;
2059          if (content) return hideOthers(content);
2060        }, []);
2061        return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2062          DialogContentImpl,
2063          {
2064            ...props,
2065            ref: composedRefs,
2066            trapFocus: context2.open,
2067            disableOutsidePointerEvents: true,
2068            onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
2069              event.preventDefault();
2070              context2.triggerRef.current?.focus();
2071            }),
2072            onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
2073              const originalEvent = event.detail.originalEvent;
2074              const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
2075              const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
2076              if (isRightClick) event.preventDefault();
2077            }),
2078            onFocusOutside: composeEventHandlers(
2079              props.onFocusOutside,
2080              (event) => event.preventDefault()
2081            )
2082          }
2083        );
2084      }
2085    );
2086    var DialogContentNonModal = React24.forwardRef(
2087      (props, forwardedRef) => {
2088        const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog);
2089        const hasInteractedOutsideRef = React24.useRef(false);
2090        const hasPointerDownOutsideRef = React24.useRef(false);
2091        return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2092          DialogContentImpl,
2093          {
2094            ...props,
2095            ref: forwardedRef,
2096            trapFocus: false,
2097            disableOutsidePointerEvents: false,
2098            onCloseAutoFocus: (event) => {
2099              props.onCloseAutoFocus?.(event);
2100              if (!event.defaultPrevented) {
2101                if (!hasInteractedOutsideRef.current) context2.triggerRef.current?.focus();
2102                event.preventDefault();
2103              }
2104              hasInteractedOutsideRef.current = false;
2105              hasPointerDownOutsideRef.current = false;
2106            },
2107            onInteractOutside: (event) => {
2108              props.onInteractOutside?.(event);
2109              if (!event.defaultPrevented) {
2110                hasInteractedOutsideRef.current = true;
2111                if (event.detail.originalEvent.type === "pointerdown") {
2112                  hasPointerDownOutsideRef.current = true;
2113                }
2114              }
2115              const target = event.target;
2116              const targetIsTrigger = context2.triggerRef.current?.contains(target);
2117              if (targetIsTrigger) event.preventDefault();
2118              if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
2119                event.preventDefault();
2120              }
2121            }
2122          }
2123        );
2124      }
2125    );
2126    var DialogContentImpl = React24.forwardRef(
2127      (props, forwardedRef) => {
2128        const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
2129        const context2 = useDialogContext(CONTENT_NAME, __scopeDialog);
2130        const contentRef = React24.useRef(null);
2131        const composedRefs = useComposedRefs(forwardedRef, contentRef);
2132        useFocusGuards();
2133        return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2134          /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2135            FocusScope,
2136            {
2137              asChild: true,
2138              loop: true,
2139              trapped: trapFocus,
2140              onMountAutoFocus: onOpenAutoFocus,
2141              onUnmountAutoFocus: onCloseAutoFocus,
2142              children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2143                DismissableLayer,
2144                {
2145                  role: "dialog",
2146                  id: context2.contentId,
2147                  "aria-describedby": context2.descriptionId,
2148                  "aria-labelledby": context2.titleId,
2149                  "data-state": getState(context2.open),
2150                  ...contentProps,
2151                  ref: composedRefs,
2152                  onDismiss: () => context2.onOpenChange(false)
2153                }
2154              )
2155            }
2156          ),
2157          /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2158            /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TitleWarning, { titleId: context2.titleId }),
2159            /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DescriptionWarning, { contentRef, descriptionId: context2.descriptionId })
2160          ] })
2161        ] });
2162      }
2163    );
2164    var TITLE_NAME = "DialogTitle";
2165    var DialogTitle = React24.forwardRef(
2166      (props, forwardedRef) => {
2167        const { __scopeDialog, ...titleProps } = props;
2168        const context2 = useDialogContext(TITLE_NAME, __scopeDialog);
2169        return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Primitive.h2, { id: context2.titleId, ...titleProps, ref: forwardedRef });
2170      }
2171    );
2172    DialogTitle.displayName = TITLE_NAME;
2173    var DESCRIPTION_NAME = "DialogDescription";
2174    var DialogDescription = React24.forwardRef(
2175      (props, forwardedRef) => {
2176        const { __scopeDialog, ...descriptionProps } = props;
2177        const context2 = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
2178        return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Primitive.p, { id: context2.descriptionId, ...descriptionProps, ref: forwardedRef });
2179      }
2180    );
2181    DialogDescription.displayName = DESCRIPTION_NAME;
2182    var CLOSE_NAME = "DialogClose";
2183    var DialogClose = React24.forwardRef(
2184      (props, forwardedRef) => {
2185        const { __scopeDialog, ...closeProps } = props;
2186        const context2 = useDialogContext(CLOSE_NAME, __scopeDialog);
2187        return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2188          Primitive.button,
2189          {
2190            type: "button",
2191            ...closeProps,
2192            ref: forwardedRef,
2193            onClick: composeEventHandlers(props.onClick, () => context2.onOpenChange(false))
2194          }
2195        );
2196      }
2197    );
2198    DialogClose.displayName = CLOSE_NAME;
2199    function getState(open2) {
2200      return open2 ? "open" : "closed";
2201    }
2202    var TITLE_WARNING_NAME = "DialogTitleWarning";
2203    var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
2204      contentName: CONTENT_NAME,
2205      titleName: TITLE_NAME,
2206      docsSlug: "dialog"
2207    });
2208    var TitleWarning = ({ titleId }) => {
2209      const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
2210      const MESSAGE = `\`$titleWarningContext.contentName}\` requires a \`$titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
2211  
2212  If you want to hide the \`$titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
2213  
2214  For more information, see https://radix-ui.com/primitives/docs/components/$titleWarningContext.docsSlug}`;
2215      React24.useEffect(() => {
2216        if (titleId) {
2217          const hasTitle = document.getElementById(titleId);
2218          if (!hasTitle) console.error(MESSAGE);
2219        }
2220      }, [MESSAGE, titleId]);
2221      return null;
2222    };
2223    var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
2224    var DescriptionWarning = ({ contentRef, descriptionId }) => {
2225      const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
2226      const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {$descriptionWarningContext.contentName}}.`;
2227      React24.useEffect(() => {
2228        const describedById = contentRef.current?.getAttribute("aria-describedby");
2229        if (descriptionId && describedById) {
2230          const hasDescription = document.getElementById(descriptionId);
2231          if (!hasDescription) console.warn(MESSAGE);
2232        }
2233      }, [MESSAGE, contentRef, descriptionId]);
2234      return null;
2235    };
2236    var Root = Dialog;
2237    var Portal2 = DialogPortal;
2238    var Overlay = DialogOverlay;
2239    var Content = DialogContent;
2240  
2241    // node_modules/cmdk/dist/index.mjs
2242    var t = __toESM(require_react(), 1);
2243    var N = '[cmdk-group=""]';
2244    var Y2 = '[cmdk-group-items=""]';
2245    var be = '[cmdk-group-heading=""]';
2246    var le = '[cmdk-item=""]';
2247    var ce = `$le}:not([aria-disabled="true"])`;
2248    var Z = "cmdk-item-select";
2249    var T = "data-value";
2250    var Re = (r2, o, n) => W(r2, o, n);
2251    var ue = t.createContext(void 0);
2252    var K2 = () => t.useContext(ue);
2253    var de = t.createContext(void 0);
2254    var ee = () => t.useContext(de);
2255    var fe = t.createContext(void 0);
2256    var me = t.forwardRef((r2, o) => {
2257      let n = L(() => {
2258        var e, a;
2259        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() } };
2260      }), 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();
2261      k2(() => {
2262        if (R !== void 0) {
2263          let e = R.trim();
2264          n.current.value = e, E.emit();
2265        }
2266      }, [R]), k2(() => {
2267        v(6, ne);
2268      }, []);
2269      let E = t.useMemo(() => ({ subscribe: (e) => (f.current.add(e), () => f.current.delete(e)), snapshot: () => n.current, setState: (e, a, s) => {
2270        var i, l, g, y;
2271        if (!Object.is(n.current[e], a)) {
2272          if (n.current[e] = a, e === "search") J2(), z(), v(1, W2);
2273          else if (e === "value") {
2274            if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
2275              let h = document.getElementById(_);
2276              h ? h.focus() : (i = document.getElementById($2)) == null || i.focus();
2277            }
2278            if (v(7, () => {
2279              var h;
2280              n.current.selectedItemId = (h = M()) == null ? void 0 : h.id, E.emit();
2281            }), s || v(5, ne), ((l = p2.current) == null ? void 0 : l.value) !== void 0) {
2282              let h = a != null ? a : "";
2283              (y = (g = p2.current).onValueChange) == null || y.call(g, h);
2284              return;
2285            }
2286          }
2287          E.emit();
2288        }
2289      }, emit: () => {
2290        f.current.forEach((e) => e());
2291      } }), []), U2 = t.useMemo(() => ({ value: (e, a, s) => {
2292        var i;
2293        a !== ((i = d.current.get(e)) == null ? void 0 : i.value) && (d.current.set(e, { value: a, keywords: s }), n.current.filtered.items.set(e, te(a, s)), v(2, () => {
2294          z(), E.emit();
2295        }));
2296      }, item: (e, a) => (u2.current.add(e), a && (c.current.has(a) ? c.current.get(a).add(e) : c.current.set(a, /* @__PURE__ */ new Set([e]))), v(3, () => {
2297        J2(), z(), n.current.value || W2(), E.emit();
2298      }), () => {
2299        d.current.delete(e), u2.current.delete(e), n.current.filtered.items.delete(e);
2300        let s = M();
2301        v(4, () => {
2302          J2(), (s == null ? void 0 : s.getAttribute("id")) === e && W2(), E.emit();
2303        });
2304      }), group: (e) => (c.current.has(e) || c.current.set(e, /* @__PURE__ */ new Set()), () => {
2305        d.current.delete(e), c.current.delete(e);
2306      }), filter: () => p2.current.shouldFilter, label: b || r2["aria-label"], getDisablePointerSelection: () => p2.current.disablePointerSelection, listId: $2, inputId: _, labelId: q, listInnerRef: I }), []);
2307      function te(e, a) {
2308        var i, l;
2309        let s = (l = (i = p2.current) == null ? void 0 : i.filter) != null ? l : Re;
2310        return e ? s(e, n.current.search, a) : 0;
2311      }
2312      function z() {
2313        if (!n.current.search || p2.current.shouldFilter === false) return;
2314        let e = n.current.filtered.items, a = [];
2315        n.current.filtered.groups.forEach((i) => {
2316          let l = c.current.get(i), g = 0;
2317          l.forEach((y) => {
2318            let h = e.get(y);
2319            g = Math.max(h, g);
2320          }), a.push([i, g]);
2321        });
2322        let s = I.current;
2323        V().sort((i, l) => {
2324          var h, F;
2325          let g = i.getAttribute("id"), y = l.getAttribute("id");
2326          return ((h = e.get(y)) != null ? h : 0) - ((F = e.get(g)) != null ? F : 0);
2327        }).forEach((i) => {
2328          let l = i.closest(Y2);
2329          l ? l.appendChild(i.parentElement === l ? i : i.closest(`$Y2} > *`)) : s.appendChild(i.parentElement === s ? i : i.closest(`$Y2} > *`));
2330        }), a.sort((i, l) => l[1] - i[1]).forEach((i) => {
2331          var g;
2332          let l = (g = I.current) == null ? void 0 : g.querySelector(`$N}[$T}="$encodeURIComponent(i[0])}"]`);
2333          l == null || l.parentElement.appendChild(l);
2334        });
2335      }
2336      function W2() {
2337        let e = V().find((s) => s.getAttribute("aria-disabled") !== "true"), a = e == null ? void 0 : e.getAttribute(T);
2338        E.setState("value", a || void 0);
2339      }
2340      function J2() {
2341        var a, s, i, l;
2342        if (!n.current.search || p2.current.shouldFilter === false) {
2343          n.current.filtered.count = u2.current.size;
2344          return;
2345        }
2346        n.current.filtered.groups = /* @__PURE__ */ new Set();
2347        let e = 0;
2348        for (let g of u2.current) {
2349          let y = (s = (a = d.current.get(g)) == null ? void 0 : a.value) != null ? s : "", h = (l = (i = d.current.get(g)) == null ? void 0 : i.keywords) != null ? l : [], F = te(y, h);
2350          n.current.filtered.items.set(g, F), F > 0 && e++;
2351        }
2352        for (let [g, y] of c.current) for (let h of y) if (n.current.filtered.items.get(h) > 0) {
2353          n.current.filtered.groups.add(g);
2354          break;
2355        }
2356        n.current.filtered.count = e;
2357      }
2358      function ne() {
2359        var a, s, i;
2360        let e = M();
2361        e && (((a = e.parentElement) == null ? void 0 : a.firstChild) === e && ((i = (s = e.closest(N)) == null ? void 0 : s.querySelector(be)) == null || i.scrollIntoView({ block: "nearest" })), e.scrollIntoView({ block: "nearest" }));
2362      }
2363      function M() {
2364        var e;
2365        return (e = I.current) == null ? void 0 : e.querySelector(`$le}[aria-selected="true"]`);
2366      }
2367      function V() {
2368        var e;
2369        return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
2370      }
2371      function X2(e) {
2372        let s = V()[e];
2373        s && E.setState("value", s.getAttribute(T));
2374      }
2375      function Q(e) {
2376        var g;
2377        let a = M(), s = V(), i = s.findIndex((y) => y === a), l = s[i + e];
2378        (g = p2.current) != null && g.loop && (l = i + e < 0 ? s[s.length - 1] : i + e === s.length ? s[0] : s[i + e]), l && E.setState("value", l.getAttribute(T));
2379      }
2380      function re(e) {
2381        let a = M(), s = a == null ? void 0 : a.closest(N), i;
2382        for (; s && !i; ) s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
2383        i ? E.setState("value", i.getAttribute(T)) : Q(e);
2384      }
2385      let oe = () => X2(V().length - 1), ie = (e) => {
2386        e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
2387      }, se = (e) => {
2388        e.preventDefault(), e.metaKey ? X2(0) : e.altKey ? re(-1) : Q(-1);
2389      };
2390      return t.createElement(Primitive.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
2391        var s;
2392        (s = O.onKeyDown) == null || s.call(O, e);
2393        let a = e.nativeEvent.isComposing || e.keyCode === 229;
2394        if (!(e.defaultPrevented || a)) switch (e.key) {
2395          case "n":
2396          case "j": {
2397            j && e.ctrlKey && ie(e);
2398            break;
2399          }
2400          case "ArrowDown": {
2401            ie(e);
2402            break;
2403          }
2404          case "p":
2405          case "k": {
2406            j && e.ctrlKey && se(e);
2407            break;
2408          }
2409          case "ArrowUp": {
2410            se(e);
2411            break;
2412          }
2413          case "Home": {
2414            e.preventDefault(), X2(0);
2415            break;
2416          }
2417          case "End": {
2418            e.preventDefault(), oe();
2419            break;
2420          }
2421          case "Enter": {
2422            e.preventDefault();
2423            let i = M();
2424            if (i) {
2425              let l = new Event(Z);
2426              i.dispatchEvent(l);
2427            }
2428          }
2429        }
2430      } }, 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))));
2431    });
2432    var he = t.forwardRef((r2, o) => {
2433      var _, I;
2434      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;
2435      k2(() => {
2436        if (!p2) return d.item(n, c == null ? void 0 : c.id);
2437      }, [p2]);
2438      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);
2439      t.useEffect(() => {
2440        let v = u2.current;
2441        if (!(!v || r2.disabled)) return v.addEventListener(Z, C), () => v.removeEventListener(Z, C);
2442      }, [x, r2.onSelect, r2.disabled]);
2443      function C() {
2444        var v, E;
2445        S(), (E = (v = f.current).onSelect) == null || E.call(v, b.current);
2446      }
2447      function S() {
2448        m2.setState("value", b.current, true);
2449      }
2450      if (!x) return null;
2451      let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r2;
2452      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);
2453    });
2454    var Ee = t.forwardRef((r2, o) => {
2455      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);
2456      k2(() => R.group(f), []), ve(f, p2, [r2.value, r2.heading, b]);
2457      let C = t.useMemo(() => ({ id: f, forceMount: c }), [c]);
2458      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))));
2459    });
2460    var ye = t.forwardRef((r2, o) => {
2461      let { alwaysRender: n, ...u2 } = r2, c = t.useRef(null), d = P((f) => !f.search);
2462      return !n && !d ? null : t.createElement(Primitive.div, { ref: composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
2463    });
2464    var Se = t.forwardRef((r2, o) => {
2465      let { onValueChange: n, ...u2 } = r2, c = r2.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K2();
2466      return t.useEffect(() => {
2467        r2.value != null && d.setState("search", r2.value);
2468      }, [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) => {
2469        c || d.setState("search", m2.target.value), n == null || n(m2.target.value);
2470      } });
2471    });
2472    var Ce = t.forwardRef((r2, o) => {
2473      let { children: n, label: u2 = "Suggestions", ...c } = r2, d = t.useRef(null), f = t.useRef(null), p2 = P((m2) => m2.selectedItemId), b = K2();
2474      return t.useEffect(() => {
2475        if (f.current && d.current) {
2476          let m2 = f.current, R = d.current, x, C = new ResizeObserver(() => {
2477            x = requestAnimationFrame(() => {
2478              let S = m2.offsetHeight;
2479              R.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
2480            });
2481          });
2482          return C.observe(m2), () => {
2483            cancelAnimationFrame(x), C.unobserve(m2);
2484          };
2485        }
2486      }, []), 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)));
2487    });
2488    var xe = t.forwardRef((r2, o) => {
2489      let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r2;
2490      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 }))));
2491    });
2492    var Ie = t.forwardRef((r2, o) => P((u2) => u2.filtered.count === 0) ? t.createElement(Primitive.div, { ref: o, ...r2, "cmdk-empty": "", role: "presentation" }) : null);
2493    var Pe = t.forwardRef((r2, o) => {
2494      let { progress: n, children: u2, label: c = "Loading...", ...d } = r2;
2495      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)));
2496    });
2497    var _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
2498    function we(r2, o) {
2499      let n = r2.nextElementSibling;
2500      for (; n; ) {
2501        if (n.matches(o)) return n;
2502        n = n.nextElementSibling;
2503      }
2504    }
2505    function De(r2, o) {
2506      let n = r2.previousElementSibling;
2507      for (; n; ) {
2508        if (n.matches(o)) return n;
2509        n = n.previousElementSibling;
2510      }
2511    }
2512    function pe(r2) {
2513      let o = t.useRef(r2);
2514      return k2(() => {
2515        o.current = r2;
2516      }), o;
2517    }
2518    var k2 = typeof window == "undefined" ? t.useEffect : t.useLayoutEffect;
2519    function L(r2) {
2520      let o = t.useRef();
2521      return o.current === void 0 && (o.current = r2()), o;
2522    }
2523    function P(r2) {
2524      let o = ee(), n = () => r2(o.snapshot());
2525      return t.useSyncExternalStore(o.subscribe, n, n);
2526    }
2527    function ve(r2, o, n, u2 = []) {
2528      let c = t.useRef(), d = K2();
2529      return k2(() => {
2530        var b;
2531        let f = (() => {
2532          var m2;
2533          for (let R of n) {
2534            if (typeof R == "string") return R.trim();
2535            if (typeof R == "object" && "current" in R) return R.current ? (m2 = R.current.textContent) == null ? void 0 : m2.trim() : c.current;
2536          }
2537        })(), p2 = u2.map((m2) => m2.trim());
2538        d.value(r2, f, p2), (b = o.current) == null || b.setAttribute(T, f), c.current = f;
2539      }), c;
2540    }
2541    var ke = () => {
2542      let [r2, o] = t.useState(), n = L(() => /* @__PURE__ */ new Map());
2543      return k2(() => {
2544        n.current.forEach((u2) => u2()), n.current = /* @__PURE__ */ new Map();
2545      }, [r2]), (u2, c) => {
2546        n.current.set(u2, c), o({});
2547      };
2548    };
2549    function Me(r2) {
2550      let o = r2.type;
2551      return typeof o == "function" ? o(r2.props) : "render" in o ? o.render(r2.props) : r2;
2552    }
2553    function B2({ asChild: r2, children: o }, n) {
2554      return r2 && t.isValidElement(o) ? t.cloneElement(Me(o), { ref: o.ref }, n(o.props.children)) : n(o);
2555    }
2556    var Te = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
2557  
2558    // node_modules/clsx/dist/clsx.mjs
2559    function r(e) {
2560      var t2, f, n = "";
2561      if ("string" == typeof e || "number" == typeof e) n += e;
2562      else if ("object" == typeof e) if (Array.isArray(e)) {
2563        var o = e.length;
2564        for (t2 = 0; t2 < o; t2++) e[t2] && (f = r(e[t2])) && (n && (n += " "), n += f);
2565      } else for (f in e) e[f] && (n && (n += " "), n += f);
2566      return n;
2567    }
2568    function clsx() {
2569      for (var e, t2, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t2 = r(e)) && (n && (n += " "), n += t2);
2570      return n;
2571    }
2572    var clsx_default = clsx;
2573  
2574    // packages/commands/build-module/components/command-menu.mjs
2575    var import_data5 = __toESM(require_data(), 1);
2576    var import_element3 = __toESM(require_element(), 1);
2577    var import_i18n = __toESM(require_i18n(), 1);
2578    var import_components = __toESM(require_components(), 1);
2579    var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
2580    var import_keycodes = __toESM(require_keycodes(), 1);
2581  
2582    // packages/icons/build-module/icon/index.mjs
2583    var import_element = __toESM(require_element(), 1);
2584    var icon_default = (0, import_element.forwardRef)(
2585      ({ icon, size = 24, style, ...props }, ref) => {
2586        const intrinsicStyle = icon.props.style;
2587        const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0;
2588        return (0, import_element.cloneElement)(icon, {
2589          width: size,
2590          height: size,
2591          ...props,
2592          // Merge styles so the icon's intrinsic style (e.g. `fill: none` on
2593          // stroke-based icons) is preserved unless the consumer overrides
2594          // the same property explicitly.
2595          ...mergedStyle ? { style: mergedStyle } : {},
2596          ref
2597        });
2598      }
2599    );
2600  
2601    // packages/icons/build-module/library/arrow-right.mjs
2602    var import_primitives = __toESM(require_primitives(), 1);
2603    var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
2604    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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives.Path, { d: "M4 12L19 12M14 17L19 12L14 7", vectorEffect: "non-scaling-stroke" }) });
2605  
2606    // packages/icons/build-module/library/search.mjs
2607    var import_primitives2 = __toESM(require_primitives(), 1);
2608    var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
2609    var search_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives2.Path, { d: "M5 19L9.28769 14.7123M18.25 11C18.25 13.8995 15.8995 16.25 13 16.25C10.1005 16.25 7.75 13.8995 7.75 11C7.75 8.10051 10.1005 5.75 13 5.75C15.8995 5.75 18.25 8.10051 18.25 11Z", vectorEffect: "non-scaling-stroke" }) });
2610  
2611    // packages/commands/build-module/store/index.mjs
2612    var import_data3 = __toESM(require_data(), 1);
2613  
2614    // packages/commands/build-module/store/reducer.mjs
2615    var import_data = __toESM(require_data(), 1);
2616    function commands(state = {}, action) {
2617      switch (action.type) {
2618        case "REGISTER_COMMAND":
2619          return {
2620            ...state,
2621            [action.name]: {
2622              name: action.name,
2623              label: action.label,
2624              searchLabel: action.searchLabel,
2625              context: action.context,
2626              category: action.category,
2627              callback: action.callback,
2628              icon: action.icon,
2629              keywords: action.keywords
2630            }
2631          };
2632        case "UNREGISTER_COMMAND": {
2633          const { [action.name]: _, ...remainingState } = state;
2634          return remainingState;
2635        }
2636      }
2637      return state;
2638    }
2639    function commandLoaders(state = {}, action) {
2640      switch (action.type) {
2641        case "REGISTER_COMMAND_LOADER":
2642          return {
2643            ...state,
2644            [action.name]: {
2645              name: action.name,
2646              context: action.context,
2647              category: action.category,
2648              hook: action.hook
2649            }
2650          };
2651        case "UNREGISTER_COMMAND_LOADER": {
2652          const { [action.name]: _, ...remainingState } = state;
2653          return remainingState;
2654        }
2655      }
2656      return state;
2657    }
2658    function isOpen(state = false, action) {
2659      switch (action.type) {
2660        case "OPEN":
2661          return true;
2662        case "CLOSE":
2663          return false;
2664      }
2665      return state;
2666    }
2667    function context(state = "root", action) {
2668      switch (action.type) {
2669        case "SET_CONTEXT":
2670          return action.context;
2671      }
2672      return state;
2673    }
2674    function loaderStates(state = {}, action) {
2675      switch (action.type) {
2676        case "SET_LOADER_LOADING":
2677          return {
2678            ...state,
2679            [action.name]: action.isLoading
2680          };
2681      }
2682      return state;
2683    }
2684    var reducer = (0, import_data.combineReducers)({
2685      commands,
2686      commandLoaders,
2687      isOpen,
2688      context,
2689      loaderStates
2690    });
2691    var reducer_default = reducer;
2692  
2693    // packages/commands/build-module/store/actions.mjs
2694    var actions_exports = {};
2695    __export(actions_exports, {
2696      close: () => close,
2697      open: () => open,
2698      registerCommand: () => registerCommand,
2699      registerCommandLoader: () => registerCommandLoader,
2700      unregisterCommand: () => unregisterCommand,
2701      unregisterCommandLoader: () => unregisterCommandLoader
2702    });
2703    var REGISTERABLE_CATEGORIES = /* @__PURE__ */ new Set([
2704      "command",
2705      "view",
2706      "edit",
2707      "action"
2708    ]);
2709    function registerCommand(config) {
2710      let { category } = config;
2711      if (!category || !REGISTERABLE_CATEGORIES.has(category)) {
2712        category = "action";
2713      }
2714      return {
2715        type: "REGISTER_COMMAND",
2716        ...config,
2717        category
2718      };
2719    }
2720    function unregisterCommand(name) {
2721      return {
2722        type: "UNREGISTER_COMMAND",
2723        name
2724      };
2725    }
2726    function registerCommandLoader(config) {
2727      let { category } = config;
2728      if (!category || !REGISTERABLE_CATEGORIES.has(category)) {
2729        category = "action";
2730      }
2731      return {
2732        type: "REGISTER_COMMAND_LOADER",
2733        ...config,
2734        category
2735      };
2736    }
2737    function unregisterCommandLoader(name) {
2738      return {
2739        type: "UNREGISTER_COMMAND_LOADER",
2740        name
2741      };
2742    }
2743    function open() {
2744      return {
2745        type: "OPEN"
2746      };
2747    }
2748    function close() {
2749      return {
2750        type: "CLOSE"
2751      };
2752    }
2753  
2754    // packages/commands/build-module/store/selectors.mjs
2755    var selectors_exports = {};
2756    __export(selectors_exports, {
2757      getCommandLoaders: () => getCommandLoaders,
2758      getCommands: () => getCommands,
2759      getContext: () => getContext,
2760      isOpen: () => isOpen2
2761    });
2762    var import_data2 = __toESM(require_data(), 1);
2763    var getCommands = (0, import_data2.createSelector)(
2764      (state, contextual = false) => Object.values(state.commands).filter((command) => {
2765        const isContextual = command.context && command.context === state.context;
2766        return contextual ? isContextual : !isContextual;
2767      }),
2768      (state) => [state.commands, state.context]
2769    );
2770    var getCommandLoaders = (0, import_data2.createSelector)(
2771      (state, contextual = false) => Object.values(state.commandLoaders).filter((loader) => {
2772        const isContextual = loader.context && loader.context === state.context;
2773        return contextual ? isContextual : !isContextual;
2774      }),
2775      (state) => [state.commandLoaders, state.context]
2776    );
2777    function isOpen2(state) {
2778      return state.isOpen;
2779    }
2780    function getContext(state) {
2781      return state.context;
2782    }
2783  
2784    // packages/commands/build-module/store/private-actions.mjs
2785    var private_actions_exports = {};
2786    __export(private_actions_exports, {
2787      setContext: () => setContext,
2788      setLoaderLoading: () => setLoaderLoading
2789    });
2790    function setContext(context2) {
2791      return {
2792        type: "SET_CONTEXT",
2793        context: context2
2794      };
2795    }
2796    function setLoaderLoading(name, isLoading2) {
2797      return {
2798        type: "SET_LOADER_LOADING",
2799        name,
2800        isLoading: isLoading2
2801      };
2802    }
2803  
2804    // packages/commands/build-module/store/private-selectors.mjs
2805    var private_selectors_exports = {};
2806    __export(private_selectors_exports, {
2807      isLoading: () => isLoading
2808    });
2809    function isLoading(state) {
2810      return Object.values(state.loaderStates).some(Boolean);
2811    }
2812  
2813    // packages/commands/build-module/lock-unlock.mjs
2814    var import_private_apis = __toESM(require_private_apis(), 1);
2815    var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
2816      "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
2817      "@wordpress/commands"
2818    );
2819  
2820    // packages/commands/build-module/store/index.mjs
2821    var STORE_NAME = "core/commands";
2822    var store = (0, import_data3.createReduxStore)(STORE_NAME, {
2823      reducer: reducer_default,
2824      actions: actions_exports,
2825      selectors: selectors_exports
2826    });
2827    (0, import_data3.register)(store);
2828    unlock(store).registerPrivateActions(private_actions_exports);
2829    unlock(store).registerPrivateSelectors(private_selectors_exports);
2830  
2831    // packages/commands/build-module/components/use-recent-commands.mjs
2832    var import_data4 = __toESM(require_data(), 1);
2833    var import_preferences = __toESM(require_preferences(), 1);
2834    var import_element2 = __toESM(require_element(), 1);
2835    var MAX_RECENTLY_SAVED = 30;
2836    var MAX_RECENTLY_DISPLAYED = 5;
2837    var EMPTY_ARRAY = [];
2838    var EMPTY_SET = /* @__PURE__ */ new Set();
2839    function recordUsage(name) {
2840      const current = (0, import_data4.select)(import_preferences.store).get(
2841        "core/commands",
2842        "recentlyUsed"
2843      ) ?? [];
2844      const next = [name, ...current.filter((n) => n !== name)].slice(
2845        0,
2846        MAX_RECENTLY_SAVED
2847      );
2848      (0, import_data4.dispatch)(import_preferences.store).set("core/commands", "recentlyUsed", next);
2849    }
2850    function useLoaderCollector(hook, name, filterNames, onResolved) {
2851      const { setLoaderLoading: setLoaderLoading2 } = unlock((0, import_data4.useDispatch)(store));
2852      const { isLoading: loading, commands: commands2 = [] } = hook({ search: "" }) ?? {};
2853      (0, import_element2.useEffect)(() => {
2854        setLoaderLoading2(name, loading);
2855      }, [setLoaderLoading2, name, loading]);
2856      const filtered = filterNames ? commands2.filter((c) => filterNames.has(c.name)) : commands2;
2857      (0, import_element2.useEffect)(() => {
2858        onResolved(name, filtered);
2859      }, [onResolved, name, filtered]);
2860      (0, import_element2.useEffect)(() => {
2861        return () => onResolved(name, []);
2862      }, [onResolved, name]);
2863    }
2864    function useRecentCommands() {
2865      const {
2866        contextualCommands,
2867        staticCommands,
2868        contextualLoaders,
2869        staticLoaders,
2870        recentlyUsedNames = EMPTY_ARRAY
2871      } = (0, import_data4.useSelect)((select) => {
2872        const { getCommands: getCommands2, getCommandLoaders: getCommandLoaders2 } = select(store);
2873        return {
2874          contextualCommands: getCommands2(true),
2875          staticCommands: getCommands2(false),
2876          contextualLoaders: getCommandLoaders2(true),
2877          staticLoaders: getCommandLoaders2(false),
2878          recentlyUsedNames: select(import_preferences.store).get(
2879            "core/commands",
2880            "recentlyUsed"
2881          )
2882        };
2883      }, []);
2884      const [resolvedMap, setResolvedMap] = (0, import_element2.useState)(() => /* @__PURE__ */ new Map());
2885      const onResolved = (0, import_element2.useCallback)((loaderName, cmds) => {
2886        setResolvedMap((prev) => {
2887          const prevCmds = prev.get(loaderName);
2888          if (prevCmds && prevCmds.length === cmds.length && prevCmds.every((c, i) => c.name === cmds[i].name)) {
2889            return prev;
2890          }
2891          const next = new Map(prev);
2892          next.set(loaderName, cmds);
2893          return next;
2894        });
2895      }, []);
2896      const { recentNames, recentSet } = (0, import_element2.useMemo)(() => {
2897        const names = recentlyUsedNames.slice(0, MAX_RECENTLY_DISPLAYED);
2898        return { recentNames: names, recentSet: new Set(names) };
2899      }, [recentlyUsedNames]);
2900      if (!recentlyUsedNames.length) {
2901        return {
2902          commands: [],
2903          loaders: [],
2904          recentSet: EMPTY_SET,
2905          onResolved
2906        };
2907      }
2908      const allStaticCommands = [...contextualCommands, ...staticCommands];
2909      const loaders = [...contextualLoaders, ...staticLoaders];
2910      const allByName = /* @__PURE__ */ new Map();
2911      allStaticCommands.forEach((c) => allByName.set(c.name, c));
2912      for (const cmds of resolvedMap.values()) {
2913        cmds.forEach((c) => {
2914          if (!allByName.has(c.name)) {
2915            allByName.set(c.name, c);
2916          }
2917        });
2918      }
2919      const commands2 = recentNames.map((n) => allByName.get(n)).filter(Boolean);
2920      return { commands: commands2, loaders, recentSet, onResolved };
2921    }
2922  
2923    // packages/commands/build-module/components/command-menu.mjs
2924    var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
2925    var ITEM_ID_PREFIX = "command-palette-item-";
2926    var inputLabel = (0, import_i18n.__)("Search commands and settings");
2927    var CATEGORY_FALLBACK_ICONS = {
2928      view: arrow_right_default
2929    };
2930    var CATEGORY_LABELS = {
2931      command: (0, import_i18n.__)("Command"),
2932      view: (0, import_i18n.__)("View"),
2933      edit: (0, import_i18n.__)("Edit"),
2934      action: (0, import_i18n.__)("Action"),
2935      workflow: (0, import_i18n.__)("Workflow")
2936    };
2937    function isValidIcon(icon) {
2938      return !!icon && (typeof icon === "string" || (0, import_element3.isValidElement)(icon) || typeof icon === "function" || icon instanceof import_element3.Component);
2939    }
2940    function CommandItem({ command, search, category, valuePrefix }) {
2941      const { close: close2 } = (0, import_data5.useDispatch)(store);
2942      const commandCategory = category ?? command.category;
2943      const icon = command.icon ?? CATEGORY_FALLBACK_ICONS[commandCategory];
2944      const label = command.searchLabel ?? command.label;
2945      const value = valuePrefix ? `$valuePrefix}$command.name}` : label;
2946      return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2947        _e.Item,
2948        {
2949          id: `$ITEM_ID_PREFIX}$value.toLowerCase()}`,
2950          value,
2951          keywords: valuePrefix ? [...command.keywords ?? [], label] : command.keywords,
2952          onSelect: () => {
2953            recordUsage(command.name);
2954            command.callback({ close: close2 });
2955          },
2956          children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2957            import_components.__experimentalHStack,
2958            {
2959              alignment: "left",
2960              className: clsx_default("commands-command-menu__item", {
2961                "has-icon": !!icon
2962              }),
2963              children: [
2964                isValidIcon(icon) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(icon_default, { icon }),
2965                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "commands-command-menu__item-label", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2966                  import_components.TextHighlight,
2967                  {
2968                    text: command.label,
2969                    highlight: search
2970                  }
2971                ) }),
2972                CATEGORY_LABELS[commandCategory] && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "commands-command-menu__item-category", children: CATEGORY_LABELS[commandCategory] })
2973              ]
2974            }
2975          )
2976        },
2977        command.name
2978      );
2979    }
2980    function CommandMenuLoader({ name, search, hook, category, valuePrefix }) {
2981      const { setLoaderLoading: setLoaderLoading2 } = unlock((0, import_data5.useDispatch)(store));
2982      const { isLoading: loading, commands: commands2 = [] } = hook({ search }) ?? {};
2983      (0, import_element3.useEffect)(() => {
2984        setLoaderLoading2(name, loading);
2985      }, [setLoaderLoading2, name, loading]);
2986      if (!commands2.length) {
2987        return null;
2988      }
2989      return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: commands2.map((command) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2990        CommandItem,
2991        {
2992          command,
2993          search,
2994          category: command.category ?? category,
2995          valuePrefix
2996        },
2997        command.name
2998      )) });
2999    }
3000    function CommandMenuLoaderWrapper({ hook, ...props }) {
3001      const currentLoaderRef = (0, import_element3.useRef)(hook);
3002      const [key, setKey] = (0, import_element3.useState)(0);
3003      (0, import_element3.useEffect)(() => {
3004        if (currentLoaderRef.current !== hook) {
3005          currentLoaderRef.current = hook;
3006          setKey((prevKey) => prevKey + 1);
3007        }
3008      }, [hook]);
3009      return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3010        CommandMenuLoader,
3011        {
3012          hook: currentLoaderRef.current,
3013          ...props
3014        },
3015        key
3016      );
3017    }
3018    function CommandList({ search, commands: commands2, loaders, valuePrefix }) {
3019      return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
3020        commands2.map((command) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3021          CommandItem,
3022          {
3023            command,
3024            search,
3025            valuePrefix
3026          },
3027          command.name
3028        )),
3029        loaders.map((loader) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3030          CommandMenuLoaderWrapper,
3031          {
3032            name: loader.name,
3033            search,
3034            hook: loader.hook,
3035            category: loader.category,
3036            valuePrefix
3037          },
3038          loader.name
3039        ))
3040      ] });
3041    }
3042    function RecentLoaderRunner({ hook, name, filterNames, onResolved }) {
3043      useLoaderCollector(hook, name, filterNames, onResolved);
3044      return null;
3045    }
3046    function RecentGroup() {
3047      const { commands: commands2, loaders, recentSet, onResolved } = useRecentCommands();
3048      if (!commands2.length && !loaders.length) {
3049        return null;
3050      }
3051      return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(_e.Group, { heading: (0, import_i18n.__)("Recent"), children: [
3052        loaders.map((loader) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3053          RecentLoaderRunner,
3054          {
3055            name: loader.name,
3056            hook: loader.hook,
3057            filterNames: recentSet,
3058            onResolved
3059          },
3060          loader.name
3061        )),
3062        commands2.map((command) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3063          CommandItem,
3064          {
3065            command,
3066            search: "",
3067            valuePrefix: "recent-"
3068          },
3069          command.name
3070        ))
3071      ] });
3072    }
3073    function SuggestionsGroup() {
3074      const { commands: commands2, loaders } = (0, import_data5.useSelect)((select) => {
3075        const { getCommands: getCommands2, getCommandLoaders: getCommandLoaders2 } = select(store);
3076        return {
3077          commands: getCommands2(true),
3078          loaders: getCommandLoaders2(true)
3079        };
3080      }, []);
3081      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 }) });
3082    }
3083    function ResultsGroup({ search }) {
3084      const { commands: commands2, contextualCommands, loaders, contextualLoaders } = (0, import_data5.useSelect)((select) => {
3085        const { getCommands: getCommands2, getCommandLoaders: getCommandLoaders2 } = select(store);
3086        return {
3087          commands: getCommands2(false),
3088          contextualCommands: getCommands2(true),
3089          loaders: getCommandLoaders2(false),
3090          contextualLoaders: getCommandLoaders2(true)
3091        };
3092      }, []);
3093      return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(_e.Group, { heading: (0, import_i18n.__)("Results"), children: [
3094        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3095          CommandList,
3096          {
3097            search,
3098            commands: commands2,
3099            loaders
3100          }
3101        ),
3102        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3103          CommandList,
3104          {
3105            search,
3106            commands: contextualCommands,
3107            loaders: contextualLoaders
3108          }
3109        )
3110      ] });
3111    }
3112    function CommandInput({ search, setSearch }) {
3113      const commandMenuInput = (0, import_element3.useRef)();
3114      const _value = P((state) => state.value);
3115      const selectedItemId = _value ? `$ITEM_ID_PREFIX}$_value}` : null;
3116      (0, import_element3.useEffect)(() => {
3117        commandMenuInput.current.focus();
3118      }, []);
3119      return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3120        _e.Input,
3121        {
3122          ref: commandMenuInput,
3123          value: search,
3124          onValueChange: setSearch,
3125          placeholder: inputLabel,
3126          "aria-activedescendant": selectedItemId
3127        }
3128      );
3129    }
3130    function CommandMenu() {
3131      const { registerShortcut } = (0, import_data5.useDispatch)(import_keyboard_shortcuts.store);
3132      const [search, setSearch] = (0, import_element3.useState)("");
3133      const { isOpen: paletteIsOpen, loadersLoading } = (0, import_data5.useSelect)(
3134        (select) => ({
3135          isOpen: select(store).isOpen(),
3136          loadersLoading: unlock(select(store)).isLoading()
3137        }),
3138        []
3139      );
3140      const { open: open2, close: close2 } = (0, import_data5.useDispatch)(store);
3141      (0, import_element3.useEffect)(() => {
3142        registerShortcut({
3143          name: "core/commands",
3144          category: "global",
3145          description: (0, import_i18n.__)("Open the command palette."),
3146          keyCombination: {
3147            modifier: "primary",
3148            character: "k"
3149          }
3150        });
3151      }, [registerShortcut]);
3152      (0, import_keyboard_shortcuts.useShortcut)(
3153        "core/commands",
3154        /** @type {React.KeyboardEventHandler} */
3155        (0, import_keycodes.withIgnoreIMEEvents)((event) => {
3156          if (event.defaultPrevented) {
3157            return;
3158          }
3159          event.preventDefault();
3160          if (paletteIsOpen) {
3161            close2();
3162          } else {
3163            open2();
3164          }
3165        }),
3166        {
3167          bindGlobal: true
3168        }
3169      );
3170      const closeAndReset = () => {
3171        setSearch("");
3172        close2();
3173      };
3174      if (!paletteIsOpen) {
3175        return false;
3176      }
3177      return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3178        import_components.Modal,
3179        {
3180          className: "commands-command-menu",
3181          overlayClassName: "commands-command-menu__overlay",
3182          onRequestClose: closeAndReset,
3183          __experimentalHideHeader: true,
3184          size: "medium",
3185          contentLabel: (0, import_i18n.__)("Command palette"),
3186          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: [
3187            /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "commands-command-menu__header", children: [
3188              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3189                icon_default,
3190                {
3191                  className: "commands-command-menu__header-search-icon",
3192                  icon: search_default
3193                }
3194              ),
3195              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3196                CommandInput,
3197                {
3198                  search,
3199                  setSearch
3200                }
3201              )
3202            ] }),
3203            /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(_e.List, { label: (0, import_i18n.__)("Command suggestions"), children: [
3204              search && !loadersLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(_e.Empty, { children: (0, import_i18n.__)("No results found.") }),
3205              !search && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RecentGroup, {}),
3206              !search && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SuggestionsGroup, {}),
3207              search && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ResultsGroup, { search })
3208            ] })
3209          ] }) })
3210        }
3211      );
3212    }
3213  
3214    // packages/commands/build-module/hooks/use-command-context.mjs
3215    var import_element4 = __toESM(require_element(), 1);
3216    var import_data6 = __toESM(require_data(), 1);
3217    function useCommandContext(context2) {
3218      const { getContext: getContext2 } = (0, import_data6.useSelect)(store);
3219      const initialContext = (0, import_element4.useRef)(getContext2());
3220      const { setContext: setContext2 } = unlock((0, import_data6.useDispatch)(store));
3221      (0, import_element4.useEffect)(() => {
3222        setContext2(context2);
3223      }, [context2, setContext2]);
3224      (0, import_element4.useEffect)(() => {
3225        const initialContextRef = initialContext.current;
3226        return () => setContext2(initialContextRef);
3227      }, [setContext2]);
3228    }
3229  
3230    // packages/commands/build-module/private-apis.mjs
3231    var privateApis = {};
3232    lock(privateApis, {
3233      useCommandContext
3234    });
3235  
3236    // packages/commands/build-module/hooks/use-command.mjs
3237    var import_element5 = __toESM(require_element(), 1);
3238    var import_data7 = __toESM(require_data(), 1);
3239    function useCommand(command) {
3240      const { registerCommand: registerCommand2, unregisterCommand: unregisterCommand2 } = (0, import_data7.useDispatch)(store);
3241      const currentCallbackRef = (0, import_element5.useRef)(command.callback);
3242      (0, import_element5.useEffect)(() => {
3243        currentCallbackRef.current = command.callback;
3244      }, [command.callback]);
3245      (0, import_element5.useEffect)(() => {
3246        if (command.disabled) {
3247          return;
3248        }
3249        registerCommand2({
3250          name: command.name,
3251          context: command.context,
3252          category: command.category,
3253          label: command.label,
3254          searchLabel: command.searchLabel,
3255          icon: command.icon,
3256          keywords: command.keywords,
3257          callback: (...args) => currentCallbackRef.current(...args)
3258        });
3259        return () => {
3260          unregisterCommand2(command.name);
3261        };
3262      }, [
3263        command.name,
3264        command.label,
3265        command.searchLabel,
3266        command.icon,
3267        command.context,
3268        command.category,
3269        command.keywords,
3270        command.disabled,
3271        registerCommand2,
3272        unregisterCommand2
3273      ]);
3274    }
3275    function useCommands(commands2) {
3276      const { registerCommand: registerCommand2, unregisterCommand: unregisterCommand2 } = (0, import_data7.useDispatch)(store);
3277      const currentCallbacksRef = (0, import_element5.useRef)({});
3278      (0, import_element5.useEffect)(() => {
3279        if (!commands2) {
3280          return;
3281        }
3282        commands2.forEach((command) => {
3283          if (command.callback) {
3284            currentCallbacksRef.current[command.name] = command.callback;
3285          }
3286        });
3287      }, [commands2]);
3288      (0, import_element5.useEffect)(() => {
3289        if (!commands2) {
3290          return;
3291        }
3292        commands2.forEach((command) => {
3293          if (command.disabled) {
3294            return;
3295          }
3296          registerCommand2({
3297            name: command.name,
3298            context: command.context,
3299            category: command.category,
3300            label: command.label,
3301            searchLabel: command.searchLabel,
3302            icon: command.icon,
3303            keywords: command.keywords,
3304            callback: (...args) => {
3305              const callback = currentCallbacksRef.current[command.name];
3306              if (callback) {
3307                callback(...args);
3308              }
3309            }
3310          });
3311        });
3312        return () => {
3313          commands2.forEach((command) => {
3314            unregisterCommand2(command.name);
3315          });
3316        };
3317      }, [commands2, registerCommand2, unregisterCommand2]);
3318    }
3319  
3320    // packages/commands/build-module/hooks/use-command-loader.mjs
3321    var import_element6 = __toESM(require_element(), 1);
3322    var import_data8 = __toESM(require_data(), 1);
3323    function useCommandLoader(loader) {
3324      const { registerCommandLoader: registerCommandLoader2, unregisterCommandLoader: unregisterCommandLoader2 } = (0, import_data8.useDispatch)(store);
3325      (0, import_element6.useEffect)(() => {
3326        if (loader.disabled) {
3327          return;
3328        }
3329        registerCommandLoader2({
3330          name: loader.name,
3331          hook: loader.hook,
3332          context: loader.context,
3333          category: loader.category
3334        });
3335        return () => {
3336          unregisterCommandLoader2(loader.name);
3337        };
3338      }, [
3339        loader.name,
3340        loader.hook,
3341        loader.context,
3342        loader.category,
3343        loader.disabled,
3344        registerCommandLoader2,
3345        unregisterCommandLoader2
3346      ]);
3347    }
3348    return __toCommonJS(index_exports);
3349  })();
3350  (window.wp ||= {}).commands = wp.commands;
3351  })();


Generated : Thu Sep 17 08:20:31 2026 Cross-referenced by PHPXref