# gutenberg/trunk/build/scripts/media-utils/index.js

Gutenberg, version trunk. 47,348 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/trunk/code/build/scripts/media-utils/index.js
- Raw: https://pluginprobe.com/plugins/gutenberg/trunk/raw/build/scripts/media-utils/index.js
- Modified: 2026-09-30T09:29:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenberg/trunk/code/build/scripts/media-utils/index.js#L10-L20`.

```javascript
(function() {
"use strict";
var wp;
(wp ||= {}).mediaUtils = (() => {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __export = (target, all) => {
    for (var name in all)
      __defProp(target, name, { get: all[name], enumerable: true });
  };
  var __copyProps = (to, from, except, desc) => {
    if (from && typeof from === "object" || typeof from === "function") {
      for (let key of __getOwnPropNames(from))
        if (!__hasOwnProp.call(to, key) && key !== except)
          __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
    }
    return to;
  };
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
    // If the importer is in node compatibility mode or this is not an ESM
    // file that has been converted to a CommonJS file using a Babel-
    // compatible transform (i.e. "__esModule" has not been set), then set
    // "default" to the CommonJS "module.exports" for node compatibility.
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
    mod
  ));
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

  // package-external:@wordpress/element
  var require_element = __commonJS({
    "package-external:@wordpress/element"(exports, module) {
      module.exports = window.wp.element;
    }
  });

  // package-external:@wordpress/i18n
  var require_i18n = __commonJS({
    "package-external:@wordpress/i18n"(exports, module) {
      module.exports = window.wp.i18n;
    }
  });

  // package-external:@wordpress/deprecated
  var require_deprecated = __commonJS({
    "package-external:@wordpress/deprecated"(exports, module) {
      module.exports = window.wp.deprecated;
    }
  });

  // package-external:@wordpress/data
  var require_data = __commonJS({
    "package-external:@wordpress/data"(exports, module) {
      module.exports = window.wp.data;
    }
  });

  // package-external:@wordpress/core-data
  var require_core_data = __commonJS({
    "package-external:@wordpress/core-data"(exports, module) {
      module.exports = window.wp.coreData;
    }
  });

  // package-external:@wordpress/blob
  var require_blob = __commonJS({
    "package-external:@wordpress/blob"(exports, module) {
      module.exports = window.wp.blob;
    }
  });

  // package-external:@wordpress/api-fetch
  var require_api_fetch = __commonJS({
    "package-external:@wordpress/api-fetch"(exports, module) {
      module.exports = window.wp.apiFetch;
    }
  });

  // package-external:@wordpress/components
  var require_components = __commonJS({
    "package-external:@wordpress/components"(exports, module) {
      module.exports = window.wp.components;
    }
  });

  // package-external:@wordpress/primitives
  var require_primitives = __commonJS({
    "package-external:@wordpress/primitives"(exports, module) {
      module.exports = window.wp.primitives;
    }
  });

  // vendor-external:react/jsx-runtime
  var require_jsx_runtime = __commonJS({
    "vendor-external:react/jsx-runtime"(exports, module) {
      module.exports = window.ReactJSXRuntime;
    }
  });

  // package-external:@wordpress/compose
  var require_compose = __commonJS({
    "package-external:@wordpress/compose"(exports, module) {
      module.exports = window.wp.compose;
    }
  });

  // vendor-external:react
  var require_react = __commonJS({
    "vendor-external:react"(exports, module) {
      module.exports = window.React;
    }
  });

  // vendor-external:react-dom
  var require_react_dom = __commonJS({
    "vendor-external:react-dom"(exports, module) {
      module.exports = window.ReactDOM;
    }
  });

  // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
  var require_use_sync_external_store_shim_development = __commonJS({
    "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
      "use strict";
      (function() {
        function is(x2, y2) {
          return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
        }
        function useSyncExternalStore$2(subscribe2, getSnapshot) {
          didWarnOld18Alpha || void 0 === React147.startTransition || (didWarnOld18Alpha = true, console.error(
            "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
          ));
          var value = getSnapshot();
          if (!didWarnUncachedGetSnapshot) {
            var cachedValue = getSnapshot();
            objectIs(value, cachedValue) || (console.error(
              "The result of getSnapshot should be cached to avoid an infinite loop"
            ), didWarnUncachedGetSnapshot = true);
          }
          cachedValue = useState58({
            inst: { value, getSnapshot }
          });
          var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
          useLayoutEffect7(
            function() {
              inst.value = value;
              inst.getSnapshot = getSnapshot;
              checkIfSnapshotChanged(inst) && forceUpdate({ inst });
            },
            [subscribe2, value, getSnapshot]
          );
          useEffect52(
            function() {
              checkIfSnapshotChanged(inst) && forceUpdate({ inst });
              return subscribe2(function() {
                checkIfSnapshotChanged(inst) && forceUpdate({ inst });
              });
            },
            [subscribe2]
          );
          useDebugValue2(value);
          return value;
        }
        function checkIfSnapshotChanged(inst) {
          var latestGetSnapshot = inst.getSnapshot;
          inst = inst.value;
          try {
            var nextValue = latestGetSnapshot();
            return !objectIs(inst, nextValue);
          } catch (error2) {
            return true;
          }
        }
        function useSyncExternalStore$1(subscribe2, getSnapshot) {
          return getSnapshot();
        }
        "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
        var React147 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState58 = React147.useState, useEffect52 = React147.useEffect, useLayoutEffect7 = React147.useLayoutEffect, useDebugValue2 = React147.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
        exports.useSyncExternalStore = void 0 !== React147.useSyncExternalStore ? React147.useSyncExternalStore : shim;
        "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
      })();
    }
  });

  // node_modules/use-sync-external-store/shim/index.js
  var require_shim = __commonJS({
    "node_modules/use-sync-external-store/shim/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_use_sync_external_store_shim_development();
      }
    }
  });

  // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
  var require_with_selector_development = __commonJS({
    "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
      "use strict";
      (function() {
        function is(x2, y2) {
          return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
        }
        "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
        var React147 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore4 = shim.useSyncExternalStore, useRef93 = React147.useRef, useEffect52 = React147.useEffect, useMemo70 = React147.useMemo, useDebugValue2 = React147.useDebugValue;
        exports.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot, getServerSnapshot, selector2, isEqual) {
          var instRef = useRef93(null);
          if (null === instRef.current) {
            var inst = { hasValue: false, value: null };
            instRef.current = inst;
          } else inst = instRef.current;
          instRef = useMemo70(
            function() {
              function memoizedSelector(nextSnapshot) {
                if (!hasMemo) {
                  hasMemo = true;
                  memoizedSnapshot = nextSnapshot;
                  nextSnapshot = selector2(nextSnapshot);
                  if (void 0 !== isEqual && inst.hasValue) {
                    var currentSelection = inst.value;
                    if (isEqual(currentSelection, nextSnapshot))
                      return memoizedSelection = currentSelection;
                  }
                  return memoizedSelection = nextSnapshot;
                }
                currentSelection = memoizedSelection;
                if (objectIs(memoizedSnapshot, nextSnapshot))
                  return currentSelection;
                var nextSelection = selector2(nextSnapshot);
                if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
                  return memoizedSnapshot = nextSnapshot, currentSelection;
                memoizedSnapshot = nextSnapshot;
                return memoizedSelection = nextSelection;
              }
              var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
              return [
                function() {
                  return memoizedSelector(getSnapshot());
                },
                null === maybeGetServerSnapshot ? void 0 : function() {
                  return memoizedSelector(maybeGetServerSnapshot());
                }
              ];
            },
            [getSnapshot, getServerSnapshot, selector2, isEqual]
          );
          var value = useSyncExternalStore4(subscribe2, instRef[0], instRef[1]);
          useEffect52(
            function() {
              inst.hasValue = true;
              inst.value = value;
            },
            [value]
          );
          useDebugValue2(value);
          return value;
        };
        "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
      })();
    }
  });

  // node_modules/use-sync-external-store/shim/with-selector.js
  var require_with_selector = __commonJS({
    "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_with_selector_development();
      }
    }
  });

  // package-external:@wordpress/theme
  var require_theme = __commonJS({
    "package-external:@wordpress/theme"(exports, module) {
      module.exports = window.wp.theme;
    }
  });

  // package-external:@wordpress/private-apis
  var require_private_apis = __commonJS({
    "package-external:@wordpress/private-apis"(exports, module) {
      module.exports = window.wp.privateApis;
    }
  });

  // package-external:@wordpress/a11y
  var require_a11y = __commonJS({
    "package-external:@wordpress/a11y"(exports, module) {
      module.exports = window.wp.a11y;
    }
  });

  // package-external:@wordpress/warning
  var require_warning = __commonJS({
    "package-external:@wordpress/warning"(exports, module) {
      module.exports = window.wp.warning;
    }
  });

  // package-external:@wordpress/keycodes
  var require_keycodes = __commonJS({
    "package-external:@wordpress/keycodes"(exports, module) {
      module.exports = window.wp.keycodes;
    }
  });

  // node_modules/remove-accents/index.js
  var require_remove_accents = __commonJS({
    "node_modules/remove-accents/index.js"(exports, module) {
      var characterMap = {
        "\xC0": "A",
        "\xC1": "A",
        "\xC2": "A",
        "\xC3": "A",
        "\xC4": "A",
        "\xC5": "A",
        "\u1EA4": "A",
        "\u1EAE": "A",
        "\u1EB2": "A",
        "\u1EB4": "A",
        "\u1EB6": "A",
        "\xC6": "AE",
        "\u1EA6": "A",
        "\u1EB0": "A",
        "\u0202": "A",
        "\u1EA2": "A",
        "\u1EA0": "A",
        "\u1EA8": "A",
        "\u1EAA": "A",
        "\u1EAC": "A",
        "\xC7": "C",
        "\u1E08": "C",
        "\xC8": "E",
        "\xC9": "E",
        "\xCA": "E",
        "\xCB": "E",
        "\u1EBE": "E",
        "\u1E16": "E",
        "\u1EC0": "E",
        "\u1E14": "E",
        "\u1E1C": "E",
        "\u0206": "E",
        "\u1EBA": "E",
        "\u1EBC": "E",
        "\u1EB8": "E",
        "\u1EC2": "E",
        "\u1EC4": "E",
        "\u1EC6": "E",
        "\xCC": "I",
        "\xCD": "I",
        "\xCE": "I",
        "\xCF": "I",
        "\u1E2E": "I",
        "\u020A": "I",
        "\u1EC8": "I",
        "\u1ECA": "I",
        "\xD0": "D",
        "\xD1": "N",
        "\xD2": "O",
        "\xD3": "O",
        "\xD4": "O",
        "\xD5": "O",
        "\xD6": "O",
        "\xD8": "O",
        "\u1ED0": "O",
        "\u1E4C": "O",
        "\u1E52": "O",
        "\u020E": "O",
        "\u1ECE": "O",
        "\u1ECC": "O",
        "\u1ED4": "O",
        "\u1ED6": "O",
        "\u1ED8": "O",
        "\u1EDC": "O",
        "\u1EDE": "O",
        "\u1EE0": "O",
        "\u1EDA": "O",
        "\u1EE2": "O",
        "\xD9": "U",
        "\xDA": "U",
        "\xDB": "U",
        "\xDC": "U",
        "\u1EE6": "U",
        "\u1EE4": "U",
        "\u1EEC": "U",
        "\u1EEE": "U",
        "\u1EF0": "U",
        "\xDD": "Y",
        "\xE0": "a",
        "\xE1": "a",
        "\xE2": "a",
        "\xE3": "a",
        "\xE4": "a",
        "\xE5": "a",
        "\u1EA5": "a",
        "\u1EAF": "a",
        "\u1EB3": "a",
        "\u1EB5": "a",
        "\u1EB7": "a",
        "\xE6": "ae",
        "\u1EA7": "a",
        "\u1EB1": "a",
        "\u0203": "a",
        "\u1EA3": "a",
        "\u1EA1": "a",
        "\u1EA9": "a",
        "\u1EAB": "a",
        "\u1EAD": "a",
        "\xE7": "c",
        "\u1E09": "c",
        "\xE8": "e",
        "\xE9": "e",
        "\xEA": "e",
        "\xEB": "e",
        "\u1EBF": "e",
        "\u1E17": "e",
        "\u1EC1": "e",
        "\u1E15": "e",
        "\u1E1D": "e",
        "\u0207": "e",
        "\u1EBB": "e",
        "\u1EBD": "e",
        "\u1EB9": "e",
        "\u1EC3": "e",
        "\u1EC5": "e",
        "\u1EC7": "e",
        "\xEC": "i",
        "\xED": "i",
        "\xEE": "i",
        "\xEF": "i",
        "\u1E2F": "i",
        "\u020B": "i",
        "\u1EC9": "i",
        "\u1ECB": "i",
        "\xF0": "d",
        "\xF1": "n",
        "\xF2": "o",
        "\xF3": "o",
        "\xF4": "o",
        "\xF5": "o",
        "\xF6": "o",
        "\xF8": "o",
        "\u1ED1": "o",
        "\u1E4D": "o",
        "\u1E53": "o",
        "\u020F": "o",
        "\u1ECF": "o",
        "\u1ECD": "o",
        "\u1ED5": "o",
        "\u1ED7": "o",
        "\u1ED9": "o",
        "\u1EDD": "o",
        "\u1EDF": "o",
        "\u1EE1": "o",
        "\u1EDB": "o",
        "\u1EE3": "o",
        "\xF9": "u",
        "\xFA": "u",
        "\xFB": "u",
        "\xFC": "u",
        "\u1EE7": "u",
        "\u1EE5": "u",
        "\u1EED": "u",
        "\u1EEF": "u",
        "\u1EF1": "u",
        "\xFD": "y",
        "\xFF": "y",
        "\u0100": "A",
        "\u0101": "a",
        "\u0102": "A",
        "\u0103": "a",
        "\u0104": "A",
        "\u0105": "a",
        "\u0106": "C",
        "\u0107": "c",
        "\u0108": "C",
        "\u0109": "c",
        "\u010A": "C",
        "\u010B": "c",
        "\u010C": "C",
        "\u010D": "c",
        "C\u0306": "C",
        "c\u0306": "c",
        "\u010E": "D",
        "\u010F": "d",
        "\u0110": "D",
        "\u0111": "d",
        "\u0112": "E",
        "\u0113": "e",
        "\u0114": "E",
        "\u0115": "e",
        "\u0116": "E",
        "\u0117": "e",
        "\u0118": "E",
        "\u0119": "e",
        "\u011A": "E",
        "\u011B": "e",
        "\u011C": "G",
        "\u01F4": "G",
        "\u011D": "g",
        "\u01F5": "g",
        "\u011E": "G",
        "\u011F": "g",
        "\u0120": "G",
        "\u0121": "g",
        "\u0122": "G",
        "\u0123": "g",
        "\u0124": "H",
        "\u0125": "h",
        "\u0126": "H",
        "\u0127": "h",
        "\u1E2A": "H",
        "\u1E2B": "h",
        "\u0128": "I",
        "\u0129": "i",
        "\u012A": "I",
        "\u012B": "i",
        "\u012C": "I",
        "\u012D": "i",
        "\u012E": "I",
        "\u012F": "i",
        "\u0130": "I",
        "\u0131": "i",
        "\u0132": "IJ",
        "\u0133": "ij",
        "\u0134": "J",
        "\u0135": "j",
        "\u0136": "K",
        "\u0137": "k",
        "\u1E30": "K",
        "\u1E31": "k",
        "K\u0306": "K",
        "k\u0306": "k",
        "\u0139": "L",
        "\u013A": "l",
        "\u013B": "L",
        "\u013C": "l",
        "\u013D": "L",
        "\u013E": "l",
        "\u013F": "L",
        "\u0140": "l",
        "\u0141": "l",
        "\u0142": "l",
        "\u1E3E": "M",
        "\u1E3F": "m",
        "M\u0306": "M",
        "m\u0306": "m",
        "\u0143": "N",
        "\u0144": "n",
        "\u0145": "N",
        "\u0146": "n",
        "\u0147": "N",
        "\u0148": "n",
        "\u0149": "n",
        "N\u0306": "N",
        "n\u0306": "n",
        "\u014C": "O",
        "\u014D": "o",
        "\u014E": "O",
        "\u014F": "o",
        "\u0150": "O",
        "\u0151": "o",
        "\u0152": "OE",
        "\u0153": "oe",
        "P\u0306": "P",
        "p\u0306": "p",
        "\u0154": "R",
        "\u0155": "r",
        "\u0156": "R",
        "\u0157": "r",
        "\u0158": "R",
        "\u0159": "r",
        "R\u0306": "R",
        "r\u0306": "r",
        "\u0212": "R",
        "\u0213": "r",
        "\u015A": "S",
        "\u015B": "s",
        "\u015C": "S",
        "\u015D": "s",
        "\u015E": "S",
        "\u0218": "S",
        "\u0219": "s",
        "\u015F": "s",
        "\u0160": "S",
        "\u0161": "s",
        "\u0162": "T",
        "\u0163": "t",
        "\u021B": "t",
        "\u021A": "T",
        "\u0164": "T",
        "\u0165": "t",
        "\u0166": "T",
        "\u0167": "t",
        "T\u0306": "T",
        "t\u0306": "t",
        "\u0168": "U",
        "\u0169": "u",
        "\u016A": "U",
        "\u016B": "u",
        "\u016C": "U",
        "\u016D": "u",
        "\u016E": "U",
        "\u016F": "u",
        "\u0170": "U",
        "\u0171": "u",
        "\u0172": "U",
        "\u0173": "u",
        "\u0216": "U",
        "\u0217": "u",
        "V\u0306": "V",
        "v\u0306": "v",
        "\u0174": "W",
        "\u0175": "w",
        "\u1E82": "W",
        "\u1E83": "w",
        "X\u0306": "X",
        "x\u0306": "x",
        "\u0176": "Y",
        "\u0177": "y",
        "\u0178": "Y",
        "Y\u0306": "Y",
        "y\u0306": "y",
        "\u0179": "Z",
        "\u017A": "z",
        "\u017B": "Z",
        "\u017C": "z",
        "\u017D": "Z",
        "\u017E": "z",
        "\u017F": "s",
        "\u0192": "f",
        "\u01A0": "O",
        "\u01A1": "o",
        "\u01AF": "U",
        "\u01B0": "u",
        "\u01CD": "A",
        "\u01CE": "a",
        "\u01CF": "I",
        "\u01D0": "i",
        "\u01D1": "O",
        "\u01D2": "o",
        "\u01D3": "U",
        "\u01D4": "u",
        "\u01D5": "U",
        "\u01D6": "u",
        "\u01D7": "U",
        "\u01D8": "u",
        "\u01D9": "U",
        "\u01DA": "u",
        "\u01DB": "U",
        "\u01DC": "u",
        "\u1EE8": "U",
        "\u1EE9": "u",
        "\u1E78": "U",
        "\u1E79": "u",
        "\u01FA": "A",
        "\u01FB": "a",
        "\u01FC": "AE",
        "\u01FD": "ae",
        "\u01FE": "O",
        "\u01FF": "o",
        "\xDE": "TH",
        "\xFE": "th",
        "\u1E54": "P",
        "\u1E55": "p",
        "\u1E64": "S",
        "\u1E65": "s",
        "X\u0301": "X",
        "x\u0301": "x",
        "\u0403": "\u0413",
        "\u0453": "\u0433",
        "\u040C": "\u041A",
        "\u045C": "\u043A",
        "A\u030B": "A",
        "a\u030B": "a",
        "E\u030B": "E",
        "e\u030B": "e",
        "I\u030B": "I",
        "i\u030B": "i",
        "\u01F8": "N",
        "\u01F9": "n",
        "\u1ED2": "O",
        "\u1ED3": "o",
        "\u1E50": "O",
        "\u1E51": "o",
        "\u1EEA": "U",
        "\u1EEB": "u",
        "\u1E80": "W",
        "\u1E81": "w",
        "\u1EF2": "Y",
        "\u1EF3": "y",
        "\u0200": "A",
        "\u0201": "a",
        "\u0204": "E",
        "\u0205": "e",
        "\u0208": "I",
        "\u0209": "i",
        "\u020C": "O",
        "\u020D": "o",
        "\u0210": "R",
        "\u0211": "r",
        "\u0214": "U",
        "\u0215": "u",
        "B\u030C": "B",
        "b\u030C": "b",
        "\u010C\u0323": "C",
        "\u010D\u0323": "c",
        "\xCA\u030C": "E",
        "\xEA\u030C": "e",
        "F\u030C": "F",
        "f\u030C": "f",
        "\u01E6": "G",
        "\u01E7": "g",
        "\u021E": "H",
        "\u021F": "h",
        "J\u030C": "J",
        "\u01F0": "j",
        "\u01E8": "K",
        "\u01E9": "k",
        "M\u030C": "M",
        "m\u030C": "m",
        "P\u030C": "P",
        "p\u030C": "p",
        "Q\u030C": "Q",
        "q\u030C": "q",
        "\u0158\u0329": "R",
        "\u0159\u0329": "r",
        "\u1E66": "S",
        "\u1E67": "s",
        "V\u030C": "V",
        "v\u030C": "v",
        "W\u030C": "W",
        "w\u030C": "w",
        "X\u030C": "X",
        "x\u030C": "x",
        "Y\u030C": "Y",
        "y\u030C": "y",
        "A\u0327": "A",
        "a\u0327": "a",
        "B\u0327": "B",
        "b\u0327": "b",
        "\u1E10": "D",
        "\u1E11": "d",
        "\u0228": "E",
        "\u0229": "e",
        "\u0190\u0327": "E",
        "\u025B\u0327": "e",
        "\u1E28": "H",
        "\u1E29": "h",
        "I\u0327": "I",
        "i\u0327": "i",
        "\u0197\u0327": "I",
        "\u0268\u0327": "i",
        "M\u0327": "M",
        "m\u0327": "m",
        "O\u0327": "O",
        "o\u0327": "o",
        "Q\u0327": "Q",
        "q\u0327": "q",
        "U\u0327": "U",
        "u\u0327": "u",
        "X\u0327": "X",
        "x\u0327": "x",
        "Z\u0327": "Z",
        "z\u0327": "z",
        "\u0439": "\u0438",
        "\u0419": "\u0418",
        "\u0451": "\u0435",
        "\u0401": "\u0415"
      };
      var chars = Object.keys(characterMap).join("|");
      var allAccents = new RegExp(chars, "g");
      var firstAccent = new RegExp(chars, "");
      function matcher(match2) {
        return characterMap[match2];
      }
      var removeAccents2 = function(string) {
        return string.replace(allAccents, matcher);
      };
      var hasAccents = function(string) {
        return !!string.match(firstAccent);
      };
      module.exports = removeAccents2;
      module.exports.has = hasAccents;
      module.exports.remove = removeAccents2;
    }
  });

  // node_modules/fast-deep-equal/es6/index.js
  var require_es6 = __commonJS({
    "node_modules/fast-deep-equal/es6/index.js"(exports, module) {
      "use strict";
      module.exports = function equal(a, b) {
        if (a === b) return true;
        if (a && b && typeof a == "object" && typeof b == "object") {
          if (a.constructor !== b.constructor) return false;
          var length, i, keys;
          if (Array.isArray(a)) {
            length = a.length;
            if (length != b.length) return false;
            for (i = length; i-- !== 0; )
              if (!equal(a[i], b[i])) return false;
            return true;
          }
          if (a instanceof Map && b instanceof Map) {
            if (a.size !== b.size) return false;
            for (i of a.entries())
              if (!b.has(i[0])) return false;
            for (i of a.entries())
              if (!equal(i[1], b.get(i[0]))) return false;
            return true;
          }
          if (a instanceof Set && b instanceof Set) {
            if (a.size !== b.size) return false;
            for (i of a.entries())
              if (!b.has(i[0])) return false;
            return true;
          }
          if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
            length = a.length;
            if (length != b.length) return false;
            for (i = length; i-- !== 0; )
              if (a[i] !== b[i]) return false;
            return true;
          }
          if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
          if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
          if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
          keys = Object.keys(a);
          length = keys.length;
          if (length !== Object.keys(b).length) return false;
          for (i = length; i-- !== 0; )
            if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
          for (i = length; i-- !== 0; ) {
            var key = keys[i];
            if (!equal(a[key], b[key])) return false;
          }
          return true;
        }
        return a !== a && b !== b;
      };
    }
  });

  // package-external:@wordpress/date
  var require_date = __commonJS({
    "package-external:@wordpress/date"(exports, module) {
      module.exports = window.wp.date;
    }
  });

  // package-external:@wordpress/preferences
  var require_preferences = __commonJS({
    "package-external:@wordpress/preferences"(exports, module) {
      module.exports = window.wp.preferences;
    }
  });

  // package-external:@wordpress/url
  var require_url = __commonJS({
    "package-external:@wordpress/url"(exports, module) {
      module.exports = window.wp.url;
    }
  });

  // package-external:@wordpress/notices
  var require_notices = __commonJS({
    "package-external:@wordpress/notices"(exports, module) {
      module.exports = window.wp.notices;
    }
  });

  // packages/media-utils/build-module/index.mjs
  var index_exports = {};
  __export(index_exports, {
    MediaUpload: () => media_upload_default,
    privateApis: () => privateApis,
    transformAttachment: () => transformAttachment,
    uploadMedia: () => uploadMedia,
    validateFileSize: () => validateFileSize,
    validateMimeType: () => validateMimeType,
    validateMimeTypeForUser: () => validateMimeTypeForUser
  });

  // packages/media-utils/build-module/components/media-upload/index.mjs
  var import_element = __toESM(require_element(), 1);
  var import_i18n = __toESM(require_i18n(), 1);
  var import_deprecated = __toESM(require_deprecated(), 1);
  var import_data = __toESM(require_data(), 1);

  // packages/media-utils/build-module/utils/invalidate-attachment-resolutions.mjs
  var import_core_data = __toESM(require_core_data(), 1);
  function invalidateAttachmentResolutions(registry) {
    const resolvers = registry.select(import_core_data.store).getCachedResolvers();
    const entityRecordResolutions = resolvers.getEntityRecords;
    entityRecordResolutions?.forEach((_value, args) => {
      if (args[0] === "postType" && args[1] === "attachment") {
        registry.dispatch(import_core_data.store).invalidateResolution("getEntityRecords", args);
      }
    });
  }

  // packages/media-utils/build-module/components/media-upload/index.mjs
  var DEFAULT_EMPTY_GALLERY = [];
  var getFeaturedImageMediaFrame = () => {
    const { wp } = window;
    return wp.media.view.MediaFrame.Select.extend({
      /**
       * Enables the Set Featured Image Button.
       *
       * @param {Object} toolbar toolbar for featured image state
       * @return {void}
       */
      featuredImageToolbar(toolbar) {
        this.createSelectToolbar(toolbar, {
          text: wp.media.view.l10n.setFeaturedImage,
          state: this.options.state
        });
      },
      /**
       * Handle the edit state requirements of selected media item.
       *
       * @return {void}
       */
      editState() {
        const selection = this.state("featured-image").get("selection");
        const view = new wp.media.view.EditImage({
          model: selection.single(),
          controller: this
        }).render();
        this.content.set(view);
        view.loadEditor();
      },
      /**
       * Create the default states.
       *
       * @return {void}
       */
      createStates: function createStates() {
        this.on(
          "toolbar:create:featured-image",
          this.featuredImageToolbar,
          this
        );
        this.on("content:render:edit-image", this.editState, this);
        this.states.add([
          new wp.media.controller.FeaturedImage(),
          new wp.media.controller.EditImage({
            model: this.options.editImage
          })
        ]);
      }
    });
  };
  var getSingleMediaFrame = () => {
    const { wp } = window;
    return wp.media.view.MediaFrame.Select.extend({
      /**
       * Create the default states on the frame.
       */
      createStates() {
        const options = this.options;
        if (this.options.states) {
          return;
        }
        this.states.add([
          // Main states.
          new wp.media.controller.Library({
            library: wp.media.query(options.library),
            multiple: options.multiple,
            title: options.title,
            priority: 20,
            filterable: "uploaded"
            // Allow filtering by uploaded images.
          }),
          new wp.media.controller.EditImage({
            model: options.editImage
          })
        ]);
      }
    });
  };
  var getGalleryDetailsMediaFrame = () => {
    const { wp } = window;
    return wp.media.view.MediaFrame.Post.extend({
      /**
       * Set up gallery toolbar.
       *
       * @return {void}
       */
      galleryToolbar() {
        const editing = this.state().get("editing");
        this.toolbar.set(
          new wp.media.view.Toolbar({
            controller: this,
            items: {
              insert: {
                style: "primary",
                text: editing ? wp.media.view.l10n.updateGallery : wp.media.view.l10n.insertGallery,
                priority: 80,
                requires: { library: true },
                /**
                 * @fires wp.media.controller.State#update
                 */
                click() {
                  const controller = this.controller, state = controller.state();
                  controller.close();
                  state.trigger(
                    "update",
                    state.get("library")
                  );
                  controller.setState(controller.options.state);
                  controller.reset();
                }
              }
            }
          })
        );
      },
      /**
       * Handle the edit state requirements of selected media item.
       *
       * @return {void}
       */
      editState() {
        const selection = this.state("gallery").get("selection");
        const view = new wp.media.view.EditImage({
          model: selection.single(),
          controller: this
        }).render();
        this.content.set(view);
        view.loadEditor();
      },
      /**
       * Create the default states.
       *
       * @return {void}
       */
      createStates: function createStates() {
        this.on("toolbar:create:main-gallery", this.galleryToolbar, this);
        this.on("content:render:edit-image", this.editState, this);
        this.states.add([
          new wp.media.controller.Library({
            id: "gallery",
            title: wp.media.view.l10n.createGalleryTitle,
            priority: 40,
            toolbar: "main-gallery",
            filterable: "uploaded",
            multiple: "add",
            editable: false,
            library: wp.media.query({
              type: "image",
              ...this.options.library
            })
          }),
          new wp.media.controller.EditImage({
            model: this.options.editImage
          }),
          new wp.media.controller.GalleryEdit({
            library: this.options.selection,
            editing: this.options.editing,
            menu: "gallery",
            displaySettings: false,
            multiple: true
          }),
          new wp.media.controller.GalleryAdd()
        ]);
      }
    });
  };
  var slimImageObject = (img) => {
    const attrSet = [
      "sizes",
      "mime",
      "type",
      "subtype",
      "id",
      "url",
      "alt",
      "link",
      "caption"
    ];
    return attrSet.reduce((result, key) => {
      if (img?.hasOwnProperty(key)) {
        result[key] = img[key];
      }
      return result;
    }, {});
  };
  var getAttachmentsCollection = (ids) => {
    const { wp } = window;
    return wp.media.query({
      order: "ASC",
      orderby: "post__in",
      post__in: ids,
      posts_per_page: -1,
      query: true,
      type: "image"
    });
  };
  var MediaUpload = class extends import_element.Component {
    constructor() {
      super(...arguments);
      this.openModal = this.openModal.bind(this);
      this.onOpen = this.onOpen.bind(this);
      this.onSelect = this.onSelect.bind(this);
      this.onUpdate = this.onUpdate.bind(this);
      this.onClose = this.onClose.bind(this);
      this.stopUndoRedoPropagation = this.stopUndoRedoPropagation.bind(this);
    }
    stopUndoRedoPropagation(event) {
      if (!event.metaKey && !event.ctrlKey) {
        return;
      }
      const character = event.key?.toLowerCase();
      if (character !== "z" && character !== "y") {
        return;
      }
      event.stopPropagation();
    }
    initializeListeners() {
      this.frame.on("select", this.onSelect);
      this.frame.on("update", this.onUpdate);
      this.frame.on("open", this.onOpen);
      this.frame.on("close", this.onClose);
    }
    /**
     * Sets the Gallery frame and initializes listeners.
     *
     * @return {void}
     */
    buildAndSetGalleryFrame() {
      const {
        addToGallery = false,
        allowedTypes,
        multiple = false,
        value = DEFAULT_EMPTY_GALLERY
      } = this.props;
      if (value === this.lastGalleryValue) {
        return;
      }
      const { wp } = window;
      this.lastGalleryValue = value;
      if (this.frame) {
        this.frame.remove();
      }
      let currentState;
      if (addToGallery) {
        currentState = "gallery-library";
      } else {
        currentState = value && value.length ? "gallery-edit" : "gallery";
      }
      if (!this.GalleryDetailsMediaFrame) {
        this.GalleryDetailsMediaFrame = getGalleryDetailsMediaFrame();
      }
      const attachments = getAttachmentsCollection(value);
      const selection = new wp.media.model.Selection(attachments.models, {
        props: attachments.props.toJSON(),
        multiple
      });
      this.frame = new this.GalleryDetailsMediaFrame({
        mimeType: allowedTypes,
        state: currentState,
        multiple,
        selection,
        editing: !!value?.length
      });
      wp.media.frame = this.frame;
      this.initializeListeners();
    }
    /**
     * Initializes the Media Library requirements for the featured image flow.
     *
     * @return {void}
     */
    buildAndSetFeatureImageFrame() {
      const { wp } = window;
      const { value: featuredImageId, multiple, allowedTypes } = this.props;
      const featuredImageFrame = getFeaturedImageMediaFrame();
      const attachments = getAttachmentsCollection(featuredImageId);
      const selection = new wp.media.model.Selection(attachments.models, {
        props: attachments.props.toJSON()
      });
      this.frame = new featuredImageFrame({
        mimeType: allowedTypes,
        state: "featured-image",
        multiple,
        selection,
        editing: featuredImageId
      });
      wp.media.frame = this.frame;
      wp.media.view.settings.post = {
        ...wp.media.view.settings.post,
        featuredImageId: featuredImageId || -1
      };
    }
    /**
     * Initializes the Media Library requirements for the single image flow.
     *
     * @return {void}
     */
    buildAndSetSingleMediaFrame() {
      const { wp } = window;
      const {
        allowedTypes,
        multiple = false,
        title = (0, import_i18n.__)("Select or Upload Media"),
        value
      } = this.props;
      const frameConfig = {
        title,
        multiple
      };
      if (!!allowedTypes) {
        frameConfig.library = { type: allowedTypes };
      }
      if (this.frame) {
        this.frame.remove();
      }
      const singleImageFrame = getSingleMediaFrame();
      const attachments = getAttachmentsCollection(value);
      const selection = new wp.media.model.Selection(attachments.models, {
        props: attachments.props.toJSON()
      });
      this.frame = new singleImageFrame({
        mimeType: allowedTypes,
        multiple,
        selection,
        ...frameConfig
      });
      wp.media.frame = this.frame;
    }
    componentWillUnmount() {
      this.detachUndoRedoGuard();
      this.frame?.close();
      this.frame?.modal?.remove();
      this.frame?.remove();
    }
    detachUndoRedoGuard() {
      if (this.frame?.modal?.el) {
        this.frame.modal.el.removeEventListener(
          "keydown",
          this.stopUndoRedoPropagation,
          true
        );
      }
    }
    onUpdate(selections) {
      const { onSelect, multiple = false } = this.props;
      const state = this.frame.state();
      const selectedImages = selections || state.get("selection");
      if (!selectedImages || !selectedImages.models.length) {
        return;
      }
      if (multiple) {
        onSelect(
          selectedImages.models.map(
            (model) => slimImageObject(model.toJSON())
          )
        );
      } else {
        onSelect(slimImageObject(selectedImages.models[0].toJSON()));
      }
    }
    onSelect() {
      const { onSelect, multiple = false } = this.props;
      const attachment = this.frame.state().get("selection").toJSON();
      onSelect(multiple ? attachment : attachment[0]);
    }
    onOpen() {
      const { wp } = window;
      const { value } = this.props;
      this.updateCollection();
      if (this.frame?.modal?.el) {
        this.frame.modal.el.addEventListener(
          "keydown",
          this.stopUndoRedoPropagation,
          true
        );
      }
      if (this.props.mode) {
        this.frame.content.mode(this.props.mode);
      }
      const hasMedia = Array.isArray(value) ? !!value?.length : !!value;
      if (!hasMedia) {
        return;
      }
      const isGallery = this.props.gallery;
      const selection = this.frame.state().get("selection");
      const valueArray = Array.isArray(value) ? value : [value];
      if (!isGallery) {
        valueArray.forEach((id) => {
          selection.add(wp.media.attachment(id));
        });
      }
      const attachments = getAttachmentsCollection(valueArray);
      attachments.more().done(function() {
        if (isGallery && attachments?.models?.length) {
          selection.add(attachments.models);
        }
      });
    }
    onClose() {
      const { onClose } = this.props;
      this.detachUndoRedoGuard();
      if (onClose) {
        onClose();
      }
      invalidateAttachmentResolutions({ select: import_data.select, dispatch: import_data.dispatch });
      this.frame.detach();
    }
    updateCollection() {
      const frameContent = this.frame.content.get();
      if (frameContent && frameContent.collection) {
        const collection = frameContent.collection;
        collection.toArray().forEach((model) => model.trigger("destroy", model));
        collection.mirroring._hasMore = true;
        collection.more();
      }
    }
    openModal() {
      const {
        gallery = false,
        featuredImageFlow,
        unstableFeaturedImageFlow,
        modalClass
      } = this.props;
      if (unstableFeaturedImageFlow !== void 0 && featuredImageFlow === void 0) {
        (0, import_deprecated.default)(
          "wp.mediaUtils.MediaUpload unstableFeaturedImageFlow prop",
          {
            since: "7.2",
            alternative: "featuredImageFlow",
            version: "7.4"
          }
        );
      }
      if (gallery) {
        this.buildAndSetGalleryFrame();
      } else {
        this.buildAndSetSingleMediaFrame();
      }
      if (modalClass) {
        this.frame.$el.addClass(modalClass);
      }
      if (featuredImageFlow ?? unstableFeaturedImageFlow) {
        this.buildAndSetFeatureImageFrame();
      }
      this.initializeListeners();
      this.frame.open();
    }
    render() {
      return this.props.render({ open: this.openModal });
    }
  };
  var media_upload_default = MediaUpload;

  // packages/media-utils/build-module/utils/upload-media.mjs
  var import_i18n6 = __toESM(require_i18n(), 1);
  var import_blob = __toESM(require_blob(), 1);

  // packages/media-utils/build-module/utils/upload-to-server.mjs
  var import_api_fetch = __toESM(require_api_fetch(), 1);

  // packages/media-utils/build-module/utils/flatten-form-data.mjs
  function isPlainObject(data) {
    return data !== null && typeof data === "object" && Object.getPrototypeOf(data) === Object.prototype;
  }
  function flattenFormData(formData, key, data) {
    if (Array.isArray(data) || isPlainObject(data)) {
      for (const [name, value] of Object.entries(data)) {
        flattenFormData(formData, `${key}[${name}]`, value);
      }
    } else if (data !== void 0) {
      formData.append(key, String(data));
    }
  }

  // packages/media-utils/build-module/utils/transform-attachment.mjs
  function transformAttachment(attachment) {
    const { alt_text, source_url, ...savedMediaProps } = attachment;
    return {
      ...savedMediaProps,
      alt: attachment.alt_text,
      caption: attachment.caption?.raw ?? "",
      title: attachment.title.raw,
      url: attachment.source_url,
      poster: attachment._embedded?.["wp:featuredmedia"]?.[0]?.source_url || void 0
    };
  }

  // packages/media-utils/build-module/utils/upload-to-server.mjs
  async function uploadToServer(file, additionalData = {}, signal) {
    const data = new FormData();
    data.append("file", file, file.name || file.type.replace("/", "."));
    for (const [key, value] of Object.entries(additionalData)) {
      flattenFormData(data, key, value);
    }
    return transformAttachment(
      await (0, import_api_fetch.default)({
        // This allows the video block to directly get a video's poster image.
        path: "/wp/v2/media?_embed=wp:featuredmedia",
        body: data,
        method: "POST",
        signal
      })
    );
  }

  // packages/media-utils/build-module/utils/validate-mime-type.mjs
  var import_i18n2 = __toESM(require_i18n(), 1);

  // packages/media-utils/build-module/utils/upload-error.mjs
  var UploadError = class extends Error {
    code;
    file;
    constructor({ code, message: message2, file, cause }) {
      super(message2, { cause });
      Object.setPrototypeOf(this, new.target.prototype);
      this.code = code;
      this.file = file;
    }
  };

  // packages/media-utils/build-module/utils/validate-mime-type.mjs
  function validateMimeType(file, allowedTypes) {
    if (!allowedTypes || allowedTypes.includes("*")) {
      return;
    }
    const isAllowedType = allowedTypes.some((allowedType) => {
      if (allowedType.includes("/")) {
        return allowedType === file.type;
      }
      return file.type.startsWith(`${allowedType}/`);
    });
    if (file.type && !isAllowedType) {
      throw new UploadError({
        code: "MIME_TYPE_NOT_SUPPORTED",
        message: (0, import_i18n2.sprintf)(
          // translators: %s: file name.
          (0, import_i18n2.__)("%s: Sorry, this file type is not supported here."),
          file.name
        ),
        file
      });
    }
  }

  // packages/media-utils/build-module/utils/validate-mime-type-for-user.mjs
  var import_i18n3 = __toESM(require_i18n(), 1);

  // packages/media-utils/build-module/utils/get-mime-types-array.mjs
  function getMimeTypesArray(wpMimeTypesObject) {
    if (!wpMimeTypesObject) {
      return null;
    }
    return Object.entries(wpMimeTypesObject).flatMap(
      ([extensionsString, mime]) => {
        const [type] = mime.split("/");
        const extensions = extensionsString.split("|");
        return [
          mime,
          ...extensions.map(
            (extension) => `${type}/${extension}`
          )
        ];
      }
    );
  }

  // packages/media-utils/build-module/utils/validate-mime-type-for-user.mjs
  function validateMimeTypeForUser(file, wpAllowedMimeTypes) {
    const allowedMimeTypesForUser = getMimeTypesArray(wpAllowedMimeTypes);
    if (!allowedMimeTypesForUser) {
      return;
    }
    const isAllowedMimeTypeForUser = allowedMimeTypesForUser.includes(
      file.type
    );
    if (file.type && !isAllowedMimeTypeForUser) {
      throw new UploadError({
        code: "MIME_TYPE_NOT_ALLOWED_FOR_USER",
        message: (0, import_i18n3.sprintf)(
          // translators: %s: file name.
          (0, import_i18n3.__)(
            "%s: Sorry, you are not allowed to upload this file type."
          ),
          file.name
        ),
        file
      });
    }
  }

  // packages/media-utils/build-module/utils/validate-file-size.mjs
  var import_i18n4 = __toESM(require_i18n(), 1);
  function validateFileSize(file, maxUploadFileSize) {
    if (file.size <= 0) {
      throw new UploadError({
        code: "EMPTY_FILE",
        message: (0, import_i18n4.sprintf)(
          // translators: %s: file name.
          (0, import_i18n4.__)("%s: This file is empty."),
          file.name
        ),
        file
      });
    }
    if (maxUploadFileSize && file.size > maxUploadFileSize) {
      throw new UploadError({
        code: "SIZE_ABOVE_LIMIT",
        message: (0, import_i18n4.sprintf)(
          // translators: %s: file name.
          (0, import_i18n4.__)(
            "%s: This file exceeds the maximum upload size for this site."
          ),
          file.name
        ),
        file
      });
    }
  }

  // packages/media-utils/build-module/utils/get-upload-error-message.mjs
  var import_i18n5 = __toESM(require_i18n(), 1);
  var OPAQUE_ERROR_CODES = ["invalid_json", "unknown_error"];
  function getUploadErrorMessage(error2, fileName) {
    const serverError = (0, import_i18n5.sprintf)(
      /* translators: %s: file name */
      (0, import_i18n5.__)('Failed to upload "%s". Please try again.'),
      fileName
    );
    if (typeof error2 === "string") {
      return error2 || serverError;
    }
    const { code, message: message2 } = error2 ?? {};
    if (typeof code === "string" && OPAQUE_ERROR_CODES.includes(code)) {
      return serverError;
    }
    return typeof message2 === "string" && message2 ? message2 : serverError;
  }

  // packages/media-utils/build-module/utils/upload-media.mjs
  function uploadMedia({
    wpAllowedMimeTypes,
    allowedTypes,
    additionalData = {},
    filesList,
    maxUploadFileSize,
    onError,
    onFileChange,
    signal,
    multiple = true
  }) {
    if (!multiple && filesList.length > 1) {
      onError?.(new Error((0, import_i18n6.__)("Only one file can be used here.")));
      return;
    }
    const validFiles = [];
    const filesSet = [];
    const setAndUpdateFiles = (index2, value) => {
      if (!window.__clientSideMediaProcessing) {
        if (filesSet[index2]?.url) {
          (0, import_blob.revokeBlobURL)(filesSet[index2].url);
        }
      }
      filesSet[index2] = value;
      onFileChange?.(
        filesSet.filter((attachment) => attachment !== null)
      );
    };
    for (const mediaFile of filesList) {
      try {
        validateMimeTypeForUser(mediaFile, wpAllowedMimeTypes);
      } catch (error2) {
        onError?.(error2);
        continue;
      }
      try {
        validateMimeType(mediaFile, allowedTypes);
      } catch (error2) {
        onError?.(error2);
        continue;
      }
      try {
        validateFileSize(mediaFile, maxUploadFileSize);
      } catch (error2) {
        onError?.(error2);
        continue;
      }
      validFiles.push(mediaFile);
      if (!window.__clientSideMediaProcessing) {
        filesSet.push({ url: (0, import_blob.createBlobURL)(mediaFile) });
        onFileChange?.(filesSet);
      }
    }
    validFiles.map(async (file, index2) => {
      try {
        const attachment = await uploadToServer(
          file,
          additionalData,
          signal
        );
        setAndUpdateFiles(index2, attachment);
      } catch (error2) {
        setAndUpdateFiles(index2, null);
        onError?.(
          new UploadError({
            code: "GENERAL",
            message: getUploadErrorMessage(error2, file.name),
            file,
            cause: error2 instanceof Error ? error2 : void 0
          })
        );
      }
    });
  }

  // packages/media-utils/build-module/utils/sideload-to-server.mjs
  var import_api_fetch2 = __toESM(require_api_fetch(), 1);
  async function sideloadToServer(file, attachmentId, additionalData = {}, signal) {
    const data = new FormData();
    data.append("file", file, file.name || file.type.replace("/", "."));
    for (const [key, value] of Object.entries(additionalData)) {
      flattenFormData(data, key, value);
    }
    return (0, import_api_fetch2.default)({
      path: `/wp/v2/media/${attachmentId}/sideload`,
      body: data,
      method: "POST",
      signal
    });
  }

  // packages/media-utils/build-module/utils/sideload-media.mjs
  var noop = () => {
  };
  async function sideloadMedia({
    file,
    attachmentId,
    additionalData = {},
    signal,
    onSuccess,
    onError = noop
  }) {
    try {
      const subSizeData = await sideloadToServer(
        file,
        attachmentId,
        additionalData,
        signal
      );
      onSuccess?.(subSizeData);
    } catch (error2) {
      onError(
        new UploadError({
          code: "GENERAL",
          message: getUploadErrorMessage(error2, file.name),
          file,
          cause: error2 instanceof Error ? error2 : void 0
        })
      );
    }
  }

  // node_modules/clsx/dist/clsx.mjs
  function r(e) {
    var t, f, n = "";
    if ("string" == typeof e || "number" == typeof e) n += e;
    else if ("object" == typeof e) if (Array.isArray(e)) {
      var o = e.length;
      for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
    } else for (f in e) e[f] && (n && (n += " "), n += f);
    return n;
  }
  function clsx() {
    for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
    return n;
  }
  var clsx_default = clsx;

  // packages/media-utils/build-module/components/media-upload-modal/index.mjs
  var import_element150 = __toESM(require_element(), 1);
  var import_i18n79 = __toESM(require_i18n(), 1);
  var import_core_data6 = __toESM(require_core_data(), 1);
  var import_data14 = __toESM(require_data(), 1);
  var import_components54 = __toESM(require_components(), 1);

  // packages/icons/build-module/library/arrow-down.mjs
  var import_primitives = __toESM(require_primitives(), 1);
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
  var arrow_down_default = /* @__PURE__ */ (0, import_jsx_runtime.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_runtime.jsx)(import_primitives.Path, { d: "M12 4V19M7 14L12 19L17 14", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/arrow-left.mjs
  var import_primitives2 = __toESM(require_primitives(), 1);
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
  var arrow_left_default = /* @__PURE__ */ (0, import_jsx_runtime2.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_runtime2.jsx)(import_primitives2.Path, { d: "M20 12L5 12M10 7L5 12L10 17", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/arrow-right.mjs
  var import_primitives3 = __toESM(require_primitives(), 1);
  var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
  var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M4 12L19 12M14 17L19 12L14 7", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/arrow-up.mjs
  var import_primitives4 = __toESM(require_primitives(), 1);
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
  var arrow_up_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M12 20L12 5M17 10L12 5L7 10", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/audio.mjs
  var import_primitives5 = __toESM(require_primitives(), 1);
  var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
  var audio_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
    /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M13.25 16.5C13.25 18.0188 12.0188 19.25 10.5 19.25C8.98122 19.25 7.75 18.0188 7.75 16.5C7.75 14.9812 8.98122 13.75 10.5 13.75C12.0188 13.75 13.25 14.9812 13.25 16.5Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M10.5 19.25C12.0188 19.25 13.25 18.0188 13.25 16.5C13.25 14.9812 12.0188 13.75 10.5 13.75C8.98122 13.75 7.75 14.9812 7.75 16.5C7.75 18.0188 8.98122 19.25 10.5 19.25ZM10.5 19.25C13.4867 19.25 13.75 16.5 13.75 15.1379V7.99998C13.75 4.9108 16.4 5.00254 18 5.00233", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/block-table.mjs
  var import_primitives6 = __toESM(require_primitives(), 1);
  var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
  var block_table_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.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_runtime6.jsx)(import_primitives6.Path, { d: "M4.75 9.5V6C4.75 5.30964 5.30964 4.75 6 4.75L18 4.75C18.6904 4.75 19.25 5.30964 19.25 6V9.5M4.75 9.5H12M4.75 9.5V14.5M19.25 9.5H12M19.25 9.5V14.5M12 9.5V14.5M12 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V14.5M12 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V14.5M12 19.25V14.5M12 14.5H19.25M12 14.5H4.75", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/category.mjs
  var import_primitives7 = __toESM(require_primitives(), 1);
  var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
  var category_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_primitives7.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_runtime7.jsx)(import_primitives7.Path, { d: "M4.75 6C4.75 5.30964 5.30964 4.75 6 4.75H9C9.69036 4.75 10.25 5.30964 10.25 6V9C10.25 9.69036 9.69036 10.25 9 10.25H6C5.30964 10.25 4.75 9.69036 4.75 9V6Z", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M4.75 15C4.75 14.3096 5.30964 13.75 6 13.75H9C9.69036 13.75 10.25 14.3096 10.25 15V18C10.25 18.6904 9.69036 19.25 9 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15Z", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M13.75 6C13.75 5.30964 14.3096 4.75 15 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V9C19.25 9.69036 18.6904 10.25 18 10.25H15C14.3096 10.25 13.75 9.69036 13.75 9V6Z", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M13.75 15C13.75 14.3096 14.3096 13.75 15 13.75H18C18.6904 13.75 19.25 14.3096 19.25 15V18C19.25 18.6904 18.6904 19.25 18 19.25H15C14.3096 19.25 13.75 18.6904 13.75 18V15Z", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/check.mjs
  var import_primitives8 = __toESM(require_primitives(), 1);
  var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
  var check_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.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_primitives8.Path, { d: "M7 12L10 15L17 8", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/chevron-down.mjs
  var import_primitives9 = __toESM(require_primitives(), 1);
  var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
  var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.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_primitives9.Path, { d: "M7 11L12 15L17 11", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/chevron-left.mjs
  var import_primitives10 = __toESM(require_primitives(), 1);
  var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
  var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.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_runtime10.jsx)(import_primitives10.Path, { d: "M14 6.5L9 12L14 17.5", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/chevron-right-small.mjs
  var import_primitives11 = __toESM(require_primitives(), 1);
  var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
  var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.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_runtime11.jsx)(import_primitives11.Path, { d: "M10.5 8.5L13.5 12L10.5 15.5", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/chevron-right.mjs
  var import_primitives12 = __toESM(require_primitives(), 1);
  var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
  var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.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_runtime12.jsx)(import_primitives12.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/close-small.mjs
  var import_primitives13 = __toESM(require_primitives(), 1);
  var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
  var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.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_runtime13.jsx)(import_primitives13.Path, { d: "M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/cog.mjs
  var import_primitives14 = __toESM(require_primitives(), 1);
  var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
  var cog_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_primitives14.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_runtime14.jsx)(import_primitives14.Path, { d: "M5.38646 8.95505C5.36302 8.99564 5.37092 9.04706 5.40547 9.07874L6.96476 10.509C7.08306 10.1089 7.24777 9.72864 7.45264 9.37456C7.66022 9.01579 7.90904 8.68387 8.19262 8.38527L6.17287 7.74956C6.12816 7.73549 6.07968 7.75436 6.05624 7.79495L5.38646 8.95505Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12.6698 19.25C12.7167 19.25 12.7573 19.2174 12.7674 19.1717L13.2265 17.106C12.833 17.2001 12.4223 17.25 12 17.25C11.5777 17.25 11.167 17.2001 10.7736 17.106L11.2326 19.1717C11.2428 19.2174 11.2834 19.25 11.3303 19.25L12.6698 19.25Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M11.3303 4.75C11.2834 4.75 11.2428 4.78255 11.2326 4.82831L10.7736 6.89403C11.167 6.79986 11.5777 6.75 12 6.75C12.4223 6.75 12.833 6.79987 13.2265 6.89403L12.7674 4.82831C12.7573 4.78255 12.7167 4.75 12.6698 4.75L11.3303 4.75Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M17.9438 7.79495C17.9204 7.75436 17.8719 7.73549 17.8272 7.74956L15.8074 8.38528C16.091 8.68388 16.3398 9.0158 16.5474 9.37457C16.7523 9.72865 16.917 10.1089 17.0353 10.509L18.5946 9.07874C18.6291 9.04706 18.637 8.99564 18.6136 8.95505L17.9438 7.79495Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M6.05625 16.205C6.07968 16.2456 6.12816 16.2645 6.17287 16.2504L8.19262 15.6147C7.90904 15.3161 7.66022 14.9842 7.45264 14.6254C7.24777 14.2714 7.08307 13.8911 6.96476 13.491L5.40547 14.9213C5.37093 14.9529 5.36303 15.0044 5.38646 15.045L6.05625 16.205Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M18.6136 15.0449C18.637 15.0044 18.6291 14.9529 18.5946 14.9213L17.0353 13.491C16.917 13.8911 16.7523 14.2713 16.5474 14.6254C16.3398 14.9842 16.091 15.3161 15.8074 15.6147L17.8272 16.2504C17.8719 16.2645 17.9204 16.2456 17.9438 16.205L18.6136 15.0449Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12 6.75C14.8995 6.75 17.25 9.10051 17.25 12C17.25 14.8995 14.8995 17.25 12 17.25C9.10051 17.25 6.75 14.8995 6.75 12C6.75 9.10051 9.10051 6.75 12 6.75Z", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8Z", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/comment-author-avatar.mjs
  var import_primitives15 = __toESM(require_primitives(), 1);
  var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
  var comment_author_avatar_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_primitives15.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_runtime15.jsx)(import_primitives15.Path, { d: "M8 18.0476V16C8 14.8954 8.89543 14 10 14H14C15.1046 14 16 14.8954 16 16V18.0476", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M12 4.75C7.99594 4.75 4.75 7.99593 4.75 12C4.75 16.0041 7.99593 19.25 12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M13.75 10C13.75 10.9665 12.9665 11.75 12 11.75C11.0335 11.75 10.25 10.9665 10.25 10C10.25 9.0335 11.0335 8.25 12 8.25C12.9665 8.25 13.75 9.0335 13.75 10Z", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/envelope.mjs
  var import_primitives16 = __toESM(require_primitives(), 1);
  var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
  var envelope_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.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_runtime16.jsx)(import_primitives16.Path, { d: "M20.25 8.5V7C20.25 6.30964 19.6904 5.75 19 5.75H5C4.30964 5.75 3.75 6.30964 3.75 7V8.5M20.25 8.5V17C20.25 17.6904 19.6904 18.25 19 18.25H5C4.30964 18.25 3.75 17.6904 3.75 17V8.5M20.25 8.5L12 14.5L3.75 8.5", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/error.mjs
  var import_primitives17 = __toESM(require_primitives(), 1);
  var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
  var error_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.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_runtime17.jsx)(import_primitives17.Path, { d: "M12 9L12 14M12 15.5V17M11.1284 5.04947L3.83827 18.0097C3.46331 18.6763 3.94502 19.5 4.70985 19.5H19.2902C20.055 19.5 20.5367 18.6763 20.1617 18.0097L12.8716 5.04947C12.4893 4.36982 11.5107 4.36982 11.1284 5.04947Z", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/file.mjs
  var import_primitives18 = __toESM(require_primitives(), 1);
  var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
  var file_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives18.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_runtime18.jsx)(import_primitives18.Path, { d: "M3.75 6V17.5C3.75 18.1904 4.30964 18.75 5 18.75H19C19.6904 18.75 20.25 18.1904 20.25 17.5V8.5C20.25 7.80964 19.6904 7.25 19 7.25H13.3463C12.8352 7.25 12.3755 6.93881 12.1857 6.46424L11.8143 5.53576C11.6245 5.06119 11.1648 4.75 10.6537 4.75H5C4.30964 4.75 3.75 5.30964 3.75 6Z", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/format-list-bullets-rtl.mjs
  var import_primitives19 = __toESM(require_primitives(), 1);
  var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
  var format_list_bullets_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_primitives19.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
    /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M13 8H4M13 16H4", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M18 9.25C17.3096 9.25 16.75 8.69036 16.75 8C16.75 7.30964 17.3096 6.75 18 6.75C18.6904 6.75 19.25 7.30964 19.25 8C19.25 8.69036 18.6904 9.25 18 9.25Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M18 17.25C17.3096 17.25 16.75 16.6904 16.75 16C16.75 15.3096 17.3096 14.75 18 14.75C18.6904 14.75 19.25 15.3096 19.25 16C19.25 16.6904 18.6904 17.25 18 17.25Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M18 9.25C17.3096 9.25 16.75 8.69036 16.75 8C16.75 7.30964 17.3096 6.75 18 6.75C18.6904 6.75 19.25 7.30964 19.25 8C19.25 8.69036 18.6904 9.25 18 9.25Z", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M18 17.25C17.3096 17.25 16.75 16.6904 16.75 16C16.75 15.3096 17.3096 14.75 18 14.75C18.6904 14.75 19.25 15.3096 19.25 16C19.25 16.6904 18.6904 17.25 18 17.25Z", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/format-list-bullets.mjs
  var import_primitives20 = __toESM(require_primitives(), 1);
  var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
  var format_list_bullets_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
    /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M11 8H20M11 16H20", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M6 9.25C6.69036 9.25 7.25 8.69036 7.25 8C7.25 7.30964 6.69036 6.75 6 6.75C5.30964 6.75 4.75 7.30964 4.75 8C4.75 8.69036 5.30964 9.25 6 9.25Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M6 17.25C6.69036 17.25 7.25 16.6904 7.25 16C7.25 15.3096 6.69036 14.75 6 14.75C5.30964 14.75 4.75 15.3096 4.75 16C4.75 16.6904 5.30964 17.25 6 17.25Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M6 9.25C6.69036 9.25 7.25 8.69036 7.25 8C7.25 7.30964 6.69036 6.75 6 6.75C5.30964 6.75 4.75 7.30964 4.75 8C4.75 8.69036 5.30964 9.25 6 9.25Z", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M6 17.25C6.69036 17.25 7.25 16.6904 7.25 16C7.25 15.3096 6.69036 14.75 6 14.75C5.30964 14.75 4.75 15.3096 4.75 16C4.75 16.6904 5.30964 17.25 6 17.25Z", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/funnel.mjs
  var import_primitives21 = __toESM(require_primitives(), 1);
  var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
  var funnel_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives21.Path, { d: "M10 17.5H14M8 12H16M6 6.5H18", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/image.mjs
  var import_primitives22 = __toESM(require_primitives(), 1);
  var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
  var image_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives22.Path, { d: "M19.25 14.2513L16.0707 11.0707C16.0317 11.0317 15.9683 11.0317 15.9293 11.0707L12.0584 14.9416C12.0245 14.9755 11.9713 14.9806 11.9316 14.9537L8.65791 12.7392C8.62313 12.7156 8.57736 12.7163 8.54332 12.7409L4.75 15.4808M19.25 14.2513V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V15.4808M19.25 14.2513V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15.4808", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/link.mjs
  var import_primitives23 = __toESM(require_primitives(), 1);
  var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
  var link_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives23.Path, { d: "M9.5 12L14.5 12M10 7.75H8.25C5.90279 7.75 4 9.65279 4 12C4 14.3472 5.90279 16.25 8.25 16.25H10M14 16.25H15.75C18.0972 16.25 20 14.3472 20 12C20 9.65279 18.0972 7.75 15.75 7.75L14 7.75", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/mobile.mjs
  var import_primitives24 = __toESM(require_primitives(), 1);
  var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
  var mobile_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives24.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_runtime24.jsx)(import_primitives24.Path, { d: "M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/more-vertical.mjs
  var import_primitives25 = __toESM(require_primitives(), 1);
  var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
  var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_primitives25.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_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/next.mjs
  var import_primitives26 = __toESM(require_primitives(), 1);
  var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
  var next_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives26.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_runtime26.jsx)(import_primitives26.Path, { d: "M7 17.5L12 12L7 6.5M13 17.5L18 12L13 6.5", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/previous.mjs
  var import_primitives27 = __toESM(require_primitives(), 1);
  var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
  var previous_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives27.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_runtime27.jsx)(import_primitives27.Path, { d: "M17 6.5L12 12L17 17.5M11 6.5L6 12L11 17.5", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/published.mjs
  var import_primitives28 = __toESM(require_primitives(), 1);
  var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
  var published_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_primitives28.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_runtime28.jsx)(import_primitives28.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives28.Path, { d: "M9 12L11 14L15 10", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/scheduled.mjs
  var import_primitives29 = __toESM(require_primitives(), 1);
  var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
  var scheduled_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_primitives29.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_runtime29.jsx)(import_primitives29.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives29.Path, { d: "M9.5 12.25H12.25V8", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/search.mjs
  var import_primitives30 = __toESM(require_primitives(), 1);
  var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
  var search_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives30.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_runtime30.jsx)(import_primitives30.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" }) });

  // packages/icons/build-module/library/seen.mjs
  var import_primitives31 = __toESM(require_primitives(), 1);
  var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
  var seen_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_primitives31.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_runtime31.jsx)(import_primitives31.Path, { d: "M20.0645 13C18.5918 10.0366 15.5337 8 12 8C8.46631 8 5.40825 10.0366 3.93555 13", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives31.Circle, { cx: "12", cy: "12.5", r: "3", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/unseen.mjs
  var import_primitives32 = __toESM(require_primitives(), 1);
  var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
  var unseen_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_primitives32.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_runtime32.jsx)(import_primitives32.Path, { d: "M8 21L10.6587 15.1842M13.1523 9.72929L13.8553 8.19144L16 3.5M20.0645 13C19.2118 11.2841 17.8276 9.87898 16.1272 9M3.93555 13C5.40825 10.0366 8.46631 8 12 8C12.636 8 13.2566 8.06597 13.8553 8.19144M13.1523 9.72929C12.7975 9.58156 12.4083 9.5 12 9.5C10.3431 9.5 9 10.8431 9 12.5C9 13.6747 9.67519 14.6917 10.6587 15.1842M13.1523 9.72929L10.6587 15.1842M13.1755 15.261C14.2481 14.8037 15 13.7397 15 12.5C15 12.1819 14.9505 11.8753 14.8587 11.5876", vectorEffect: "non-scaling-stroke" }),
    /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives32.Path, { d: "M12 9.5C10.3431 9.5 9 10.8431 9 12.5C9 13.6747 9.67519 14.6917 10.6587 15.1842L13.1523 9.72929C12.7975 9.58156 12.4083 9.5 12 9.5Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/icons/build-module/library/upload.mjs
  var import_primitives33 = __toESM(require_primitives(), 1);
  var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
  var upload_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives33.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_runtime33.jsx)(import_primitives33.Path, { d: "M4.75 15V19.25H12M12 19.25V4.5M12 19.25H19.25V15M17.5 10L12 4.5L6.5 10", vectorEffect: "non-scaling-stroke" }) });

  // packages/icons/build-module/library/video.mjs
  var import_primitives34 = __toESM(require_primitives(), 1);
  var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
  var video_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_primitives34.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_runtime34.jsx)(import_primitives34.Path, { d: "M10 15L15 12L10 9V15Z", fill: "currentColor", stroke: "none" }),
    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives34.Path, { d: "M4.75 6C4.75 5.30964 5.30964 4.75 6 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V6Z", vectorEffect: "non-scaling-stroke" })
  ] });

  // packages/ui/build-module/badge/badge.mjs
  var import_element16 = __toESM(require_element(), 1);

  // node_modules/@base-ui/utils/useControlled.mjs
  var React = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/createLogOnce.mjs
  var loggedMessages;
  if (true) {
    loggedMessages = /* @__PURE__ */ new Set();
  }
  function createLogOnce(severity, prefix) {
    return function logOnce(...messages) {
      if (true) {
        const message2 = messages.join(" ");
        const output = prefix ? `${prefix}: ${message2}` : message2;
        const key = `${severity}:${output}`;
        if (!loggedMessages.has(key)) {
          loggedMessages.add(key);
          if (severity === "warn") {
            console.warn(output);
          } else {
            console.error(output);
          }
        }
      }
    };
  }

  // node_modules/@base-ui/utils/error.mjs
  var error = createLogOnce("error", "Base UI");

  // node_modules/@base-ui/utils/useControlled.mjs
  function useControlled({
    controlled,
    default: defaultProp,
    name,
    state = "value"
  }) {
    const {
      current: isControlled
    } = React.useRef(controlled !== void 0);
    const [valueState, setValue] = React.useState(defaultProp);
    const value = isControlled && controlled !== void 0 ? controlled : valueState;
    if (true) {
      React.useEffect(() => {
        if (isControlled !== (controlled !== void 0)) {
          error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
        }
      }, [state, name, controlled]);
      const {
        current: defaultValue2
      } = React.useRef(defaultProp);
      React.useEffect(() => {
        if (!isControlled && serializeToDevModeString(defaultValue2) !== serializeToDevModeString(defaultProp)) {
          error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n"));
        }
      }, [defaultProp]);
    }
    const setValueIfUncontrolled = React.useCallback((newValue) => {
      if (!isControlled) {
        setValue(newValue);
      }
    }, []);
    return [value, setValueIfUncontrolled];
  }
  function serializeToDevModeString(input) {
    let nextId = 0;
    const seen = /* @__PURE__ */ new WeakMap();
    try {
      const result = JSON.stringify(input, function replacer(key, value) {
        if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) {
          return void 0;
        }
        if (typeof value === "bigint") {
          return `__bigint__:${value}`;
        }
        if (value !== null && typeof value === "object") {
          const id = seen.get(value);
          if (id !== void 0) {
            return `__object__:${id}`;
          }
          seen.set(value, nextId);
          nextId += 1;
        }
        return value;
      });
      return result ?? `__top__:${typeof input}`;
    } catch {
      return "__unserializable__";
    }
  }

  // node_modules/@base-ui/utils/safeReact.mjs
  var React2 = __toESM(require_react(), 1);
  var SafeReact = {
    ...React2
  };

  // node_modules/@base-ui/utils/useRefWithInit.mjs
  var React3 = __toESM(require_react(), 1);
  var UNINITIALIZED = {};
  function useRefWithInit(init2, initArg) {
    const ref = React3.useRef(UNINITIALIZED);
    if (ref.current === UNINITIALIZED) {
      ref.current = init2(initArg);
    }
    return ref;
  }

  // node_modules/@base-ui/utils/useStableCallback.mjs
  var useInsertionEffect = SafeReact.useInsertionEffect;
  var useSafeInsertionEffect = (
    // React 17 doesn't have useInsertionEffect.
    useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
    useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn()
  );
  function useStableCallback(callback) {
    const stable = useRefWithInit(createStableCallback).current;
    stable.next = callback;
    useSafeInsertionEffect(stable.effect);
    return stable.trampoline;
  }
  function createStableCallback() {
    const stable = {
      next: void 0,
      callback: assertNotCalled,
      trampoline: (...args) => stable.callback?.(...args),
      effect: () => {
        stable.callback = stable.next;
      }
    };
    return stable;
  }
  function assertNotCalled() {
    if (true) {
      throw (
        /* minify-error-disabled */
        new Error("Base UI: Cannot call an event handler while rendering.")
      );
    }
  }

  // node_modules/@base-ui/utils/warn.mjs
  var warn = createLogOnce("warn", "Base UI");

  // node_modules/@base-ui/utils/empty.mjs
  function NOOP() {
  }
  var EMPTY_ARRAY = Object.freeze([]);
  var EMPTY_OBJECT = Object.freeze({});

  // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
  var React6 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
  var React4 = __toESM(require_react(), 1);
  var noop2 = () => {
  };
  var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop2;

  // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
  var React5 = __toESM(require_react(), 1);
  var CompositeListContext = /* @__PURE__ */ React5.createContext({
    register: () => {
    },
    unregister: () => {
    },
    subscribeMapChange: () => () => {
    },
    nextIndexRef: {
      current: 0
    }
  });
  if (true) CompositeListContext.displayName = "CompositeListContext";
  function useCompositeListContext() {
    return React5.useContext(CompositeListContext);
  }

  // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
  var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
  function CompositeList(props) {
    const {
      children,
      elementsRef,
      labelsRef,
      onMapChange: onMapChangeProp
    } = props;
    const onMapChange = useStableCallback(onMapChangeProp);
    const [, setMapTick] = React6.useState(false);
    const listeners = useRefWithInit(createListeners).current;
    const map = useRefWithInit(createMap).current;
    const nextIndexRef = React6.useRef(0);
    const isDirtyRef = React6.useRef(true);
    const itemsRef = React6.useRef(null);
    const mutationObserverRef = React6.useRef(null);
    const scheduleMapUpdate = useStableCallback(() => {
      if (isDirtyRef.current) {
        return;
      }
      isDirtyRef.current = true;
      setMapTick((tick) => !tick);
    });
    const register2 = useStableCallback((node, registration) => {
      map.set(node, registration);
      scheduleMapUpdate();
    });
    const unregister = useStableCallback((node) => {
      map.delete(node);
      scheduleMapUpdate();
    });
    const syncRefs = useStableCallback((items) => {
      const nextMap = /* @__PURE__ */ new Map();
      elementsRef.current.length = 0;
      if (labelsRef) {
        labelsRef.current.length = 0;
      }
      items.forEach((item) => {
        nextMap.set(item.element, {
          ...item.registration.metadata ?? {},
          index: item.index
        });
        elementsRef.current[item.index] = item.element;
        if (labelsRef) {
          labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;
        }
      });
      nextIndexRef.current = elementsRef.current.length;
      return nextMap;
    });
    function observe(sortedNodes) {
      mutationObserverRef.current?.disconnect();
      mutationObserverRef.current = null;
      if (typeof MutationObserver !== "function" || sortedNodes.length < 2) {
        return;
      }
      const mutationObserver = new MutationObserver((entries) => {
        if (!hasMovedNode(entries)) {
          return;
        }
        let previousConnectedNode = null;
        for (const node of sortedNodes) {
          if (!node.isConnected) {
            continue;
          }
          if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {
            mutationObserver.disconnect();
            scheduleMapUpdate();
            return;
          }
          previousConnectedNode = node;
        }
      });
      mutationObserverRef.current = mutationObserver;
      const roots = /* @__PURE__ */ new Set();
      for (let i = 1; i < sortedNodes.length; i += 1) {
        const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);
        if (root) {
          roots.add(root);
        }
      }
      roots.forEach((root) => mutationObserver.observe(root, {
        childList: true
      }));
    }
    const flush = useStableCallback(() => {
      const [items, automaticNodes] = getCompositeListSnapshot(map);
      const nextMap = syncRefs(items);
      const previousItems = itemsRef.current;
      const changed = !previousItems || previousItems.length !== items.length || items.some((item, index2) => {
        const previousItem = previousItems[index2];
        return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;
      });
      observe(automaticNodes);
      itemsRef.current = items;
      isDirtyRef.current = false;
      if (!changed) {
        return;
      }
      listeners.forEach((listener) => listener(nextMap));
      onMapChange(nextMap);
    });
    useIsoLayoutEffect(() => {
      if (!isDirtyRef.current && itemsRef.current) {
        syncRefs(itemsRef.current);
      }
      return () => {
        elementsRef.current = [];
        if (labelsRef) {
          labelsRef.current = [];
        }
      };
    }, [elementsRef, labelsRef, syncRefs]);
    useIsoLayoutEffect(() => {
      if (isDirtyRef.current) {
        flush();
      }
    });
    useIsoLayoutEffect(() => {
      return () => {
        mutationObserverRef.current?.disconnect();
        isDirtyRef.current = true;
      };
    }, []);
    const subscribeMapChange = useStableCallback((fn) => {
      listeners.add(fn);
      return () => {
        listeners.delete(fn);
      };
    });
    const contextValue = React6.useMemo(() => ({
      register: register2,
      unregister,
      subscribeMapChange,
      nextIndexRef
    }), [register2, unregister, subscribeMapChange, nextIndexRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CompositeListContext.Provider, {
      value: contextValue,
      children
    });
  }
  function createMap() {
    return /* @__PURE__ */ new Map();
  }
  function createListeners() {
    return /* @__PURE__ */ new Set();
  }
  function getCompositeListSnapshot(map) {
    const reservedIndices = /* @__PURE__ */ new Set();
    const items = [];
    const automaticItems = [];
    map.forEach((registration, node) => {
      if (!node.isConnected) {
        return;
      }
      const index2 = registration.index;
      const item = {
        index: index2 ?? -1,
        element: node,
        registration
      };
      if (index2 === null) {
        automaticItems.push(item);
      } else if (index2 >= 0) {
        reservedIndices.add(index2);
        items.push(item);
      }
    });
    let nextAutomaticIndex = 0;
    automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));
    automaticItems.forEach((item) => {
      while (reservedIndices.has(nextAutomaticIndex)) {
        nextAutomaticIndex += 1;
      }
      item.index = nextAutomaticIndex;
      items.push(item);
      nextAutomaticIndex += 1;
    });
    if (reservedIndices.size > 0) {
      items.sort((a, b) => a.index - b.index);
    }
    return [items, automaticItems.map((item) => item.element)];
  }
  function getCommonAncestor(firstNode, lastNode) {
    let ancestor = firstNode.parentElement;
    while (ancestor && !ancestor.contains(lastNode)) {
      ancestor = ancestor.parentElement;
    }
    return ancestor;
  }
  function hasMovedNode(entries) {
    for (const entry of entries) {
      for (let i = 0; i < entry.removedNodes.length; i += 1) {
        if (entry.removedNodes[i].isConnected) {
          return true;
        }
      }
    }
    return false;
  }
  function sortByDocumentPosition(a, b) {
    return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
  }

  // node_modules/@base-ui/react/internals/useRenderElement.mjs
  var React9 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/useMergedRefs.mjs
  function useMergedRefs(a, b, c2, d) {
    const forkRef = useRefWithInit(createForkRef).current;
    if (didChange(forkRef, a, b, c2, d)) {
      update(forkRef, [a, b, c2, d]);
    }
    return forkRef.callback;
  }
  function useMergedRefsN(refs) {
    const forkRef = useRefWithInit(createForkRef).current;
    if (didChangeN(forkRef, refs)) {
      update(forkRef, refs);
    }
    return forkRef.callback;
  }
  function createForkRef() {
    return {
      callback: null,
      cleanup: null,
      refs: []
    };
  }
  function didChange(forkRef, a, b, c2, d) {
    return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c2 || forkRef.refs[3] !== d;
  }
  function didChangeN(forkRef, newRefs) {
    return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]);
  }
  function update(forkRef, refs) {
    forkRef.refs = refs;
    if (refs.every((ref) => ref == null)) {
      forkRef.callback = null;
      return;
    }
    forkRef.callback = (instance) => {
      if (forkRef.cleanup) {
        forkRef.cleanup();
        forkRef.cleanup = null;
      }
      if (instance != null) {
        const cleanupCallbacks = Array(refs.length).fill(null);
        for (let i = 0; i < refs.length; i += 1) {
          const ref = refs[i];
          if (ref == null) {
            continue;
          }
          switch (typeof ref) {
            case "function": {
              const refCleanup = ref(instance);
              if (typeof refCleanup === "function") {
                cleanupCallbacks[i] = refCleanup;
              }
              break;
            }
            case "object": {
              ref.current = instance;
              break;
            }
            default:
          }
        }
        forkRef.cleanup = () => {
          for (let i = 0; i < refs.length; i += 1) {
            const ref = refs[i];
            if (ref == null) {
              continue;
            }
            switch (typeof ref) {
              case "function": {
                const cleanupCallback = cleanupCallbacks[i];
                if (typeof cleanupCallback === "function") {
                  cleanupCallback();
                } else {
                  void ref(null);
                }
                break;
              }
              case "object": {
                ref.current = null;
                break;
              }
              default:
            }
          }
        };
      }
    };
  }

  // node_modules/@base-ui/utils/getReactElementRef.mjs
  var React8 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/reactVersion.mjs
  var React7 = __toESM(require_react(), 1);
  var majorVersion = parseInt(React7.version, 10);
  function isReactVersionAtLeast(reactVersionToCheck) {
    return majorVersion >= reactVersionToCheck;
  }

  // node_modules/@base-ui/utils/getReactElementRef.mjs
  function getReactElementRef(element) {
    if (!/* @__PURE__ */ React8.isValidElement(element)) {
      return null;
    }
    const reactElement = element;
    const propsWithRef = reactElement.props;
    return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
  }

  // node_modules/@base-ui/utils/mergeObjects.mjs
  function mergeObjects(a, b) {
    if (a && !b) {
      return a;
    }
    if (!a && b) {
      return b;
    }
    if (a || b) {
      return {
        ...a,
        ...b
      };
    }
    return void 0;
  }

  // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
  function getStateAttributesProps(state, customMapping) {
    const props = {};
    for (const key in state) {
      const value = state[key];
      if (customMapping?.hasOwnProperty(key)) {
        const customProps = customMapping[key](value);
        if (customProps != null) {
          Object.assign(props, customProps);
        }
        continue;
      }
      if (value === true) {
        props[`data-${key.toLowerCase()}`] = "";
      } else if (value) {
        props[`data-${key.toLowerCase()}`] = value.toString();
      }
    }
    return props;
  }

  // node_modules/@base-ui/react/utils/resolveClassName.mjs
  function resolveClassName(className, state) {
    return typeof className === "function" ? className(state) : className;
  }

  // node_modules/@base-ui/react/utils/resolveStyle.mjs
  function resolveStyle(style, state) {
    return typeof style === "function" ? style(state) : style;
  }

  // node_modules/@base-ui/react/merge-props/mergeProps.mjs
  var EMPTY_PROPS = {};
  function mergeProps(a, b, c2, d, e) {
    if (!c2 && !d && !e && !a) {
      return createInitialMergedProps(b);
    }
    let merged = createInitialMergedProps(a);
    if (b) {
      merged = mergeInto(merged, b);
    }
    if (c2) {
      merged = mergeInto(merged, c2);
    }
    if (d) {
      merged = mergeInto(merged, d);
    }
    if (e) {
      merged = mergeInto(merged, e);
    }
    return merged;
  }
  function mergePropsN(props) {
    if (props.length === 0) {
      return EMPTY_PROPS;
    }
    if (props.length === 1) {
      return createInitialMergedProps(props[0]);
    }
    let merged = createInitialMergedProps(props[0]);
    for (let i = 1; i < props.length; i += 1) {
      merged = mergeInto(merged, props[i]);
    }
    return merged;
  }
  function createInitialMergedProps(inputProps) {
    if (isPropsGetter(inputProps)) {
      return {
        ...resolvePropsGetter(inputProps, EMPTY_PROPS)
      };
    }
    return copyInitialProps(inputProps);
  }
  function mergeInto(merged, inputProps) {
    if (isPropsGetter(inputProps)) {
      return resolvePropsGetter(inputProps, merged);
    }
    return mutablyMergeInto(merged, inputProps);
  }
  function copyInitialProps(inputProps) {
    const copiedProps = {
      ...inputProps
    };
    for (const propName in copiedProps) {
      const propValue = copiedProps[propName];
      if (isEventHandler(propName, propValue)) {
        copiedProps[propName] = wrapEventHandler(propValue);
      }
    }
    return copiedProps;
  }
  function mutablyMergeInto(mergedProps, externalProps) {
    if (!externalProps) {
      return mergedProps;
    }
    for (const propName in externalProps) {
      const externalPropValue = externalProps[propName];
      switch (propName) {
        case "style": {
          mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
          break;
        }
        case "className": {
          mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
          break;
        }
        default: {
          if (isEventHandler(propName, externalPropValue)) {
            mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
          } else {
            mergedProps[propName] = externalPropValue;
          }
        }
      }
    }
    return mergedProps;
  }
  function isEventHandler(key, value) {
    const code0 = key.charCodeAt(0);
    const code1 = key.charCodeAt(1);
    const code2 = key.charCodeAt(2);
    return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
  }
  function isPropsGetter(inputProps) {
    return typeof inputProps === "function";
  }
  function resolvePropsGetter(inputProps, previousProps) {
    if (isPropsGetter(inputProps)) {
      return inputProps(previousProps);
    }
    return inputProps ?? EMPTY_PROPS;
  }
  function mergeEventHandlers(ourHandler, theirHandler) {
    if (!theirHandler) {
      return ourHandler;
    }
    if (!ourHandler) {
      return wrapEventHandler(theirHandler);
    }
    return (...args) => {
      const event = args[0];
      if (isSyntheticEvent(event)) {
        const baseUIEvent = event;
        makeEventPreventable(baseUIEvent);
        const result2 = theirHandler(...args);
        if (!baseUIEvent.baseUIHandlerPrevented) {
          ourHandler?.(...args);
        }
        return result2;
      }
      const result = theirHandler(...args);
      ourHandler?.(...args);
      return result;
    };
  }
  function wrapEventHandler(handler) {
    if (!handler) {
      return handler;
    }
    return (...args) => {
      const event = args[0];
      if (isSyntheticEvent(event)) {
        makeEventPreventable(event);
      }
      return handler(...args);
    };
  }
  function makeEventPreventable(event) {
    event.preventBaseUIHandler = () => {
      event.baseUIHandlerPrevented = true;
    };
    return event;
  }
  function mergeClassNames(ourClassName, theirClassName) {
    if (theirClassName) {
      if (ourClassName) {
        return theirClassName + " " + ourClassName;
      }
      return theirClassName;
    }
    return ourClassName;
  }
  function isSyntheticEvent(event) {
    return event != null && typeof event === "object" && "nativeEvent" in event;
  }

  // node_modules/@base-ui/react/internals/useRenderElement.mjs
  var import_react = __toESM(require_react(), 1);
  function useRenderElement(element, componentProps, params = {}) {
    let renderProp = componentProps.render;
    if (params.enabled !== false) {
      renderProp = unwrapLazyRenderProp(renderProp);
    }
    const outProps = useRenderElementProps(componentProps, params, renderProp);
    if (params.enabled === false) {
      return null;
    }
    const state = params.state ?? EMPTY_OBJECT;
    return evaluateRenderProp(element, renderProp, outProps, state);
  }
  function useRenderElementProps(componentProps, params, renderProp) {
    const {
      className: classNameProp,
      style: styleProp
    } = componentProps;
    const {
      state = EMPTY_OBJECT,
      ref,
      props,
      stateAttributesMapping: stateAttributesMapping2,
      enabled = true
    } = params;
    const className = enabled ? resolveClassName(classNameProp, state) : void 0;
    const style = enabled ? resolveStyle(styleProp, state) : void 0;
    const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping2) : EMPTY_OBJECT;
    const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
    const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
    if (typeof document !== "undefined") {
      if (!enabled) {
        void useMergedRefs(null, null);
      } else if (Array.isArray(ref)) {
        outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
      } else {
        outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
      }
    }
    if (!enabled) {
      return EMPTY_OBJECT;
    }
    if (className !== void 0) {
      outProps.className = mergeClassNames(outProps.className, className);
    }
    if (style !== void 0) {
      outProps.style = mergeObjects(outProps.style, style);
    }
    return outProps;
  }
  function resolveRenderFunctionProps(props) {
    if (Array.isArray(props)) {
      return mergePropsN(props);
    }
    return mergeProps(void 0, props);
  }
  var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
  var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
  var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
  function unwrapLazyRenderProp(render4) {
    if (render4?.$$typeof !== REACT_LAZY_TYPE) {
      return render4;
    }
    const unwrapped = React9.Children.toArray(render4)[0];
    return /* @__PURE__ */ React9.isValidElement(unwrapped) ? unwrapped : render4;
  }
  function evaluateRenderProp(element, render4, props, state) {
    if (render4) {
      if (typeof render4 === "function") {
        if (true) {
          warnIfRenderPropLooksLikeComponent(render4);
        }
        return render4(props, state);
      }
      const mergedProps = mergeProps(props, render4.props);
      mergedProps.ref = props.ref;
      if (true) {
        if (!/* @__PURE__ */ React9.isValidElement(render4)) {
          throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
        }
      }
      return /* @__PURE__ */ React9.cloneElement(render4, mergedProps);
    }
    if (element) {
      if (typeof element === "string") {
        return renderTag(element, props);
      }
    }
    throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
  }
  function warnIfRenderPropLooksLikeComponent(renderFn) {
    const functionName = renderFn.name;
    if (functionName.length === 0) {
      return;
    }
    if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
      return;
    }
    if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
      return;
    }
    warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
  }
  function renderTag(Tag, props) {
    if (Tag === "button") {
      return /* @__PURE__ */ (0, import_react.createElement)("button", {
        type: "button",
        ...props,
        key: props.key
      });
    }
    if (Tag === "img") {
      return /* @__PURE__ */ (0, import_react.createElement)("img", {
        alt: "",
        ...props,
        key: props.key
      });
    }
    return /* @__PURE__ */ React9.createElement(Tag, props);
  }

  // node_modules/@base-ui/utils/useId.mjs
  var React10 = __toESM(require_react(), 1);
  var globalId = 0;
  function useGlobalId(idOverride, prefix = "mui") {
    const [defaultId, setDefaultId] = React10.useState(idOverride);
    const id = idOverride || defaultId;
    React10.useEffect(() => {
      if (defaultId == null) {
        globalId += 1;
        setDefaultId(`${prefix}-${globalId}`);
      }
    }, [defaultId, prefix]);
    return id;
  }
  var maybeReactUseId = SafeReact.useId;
  function useId(idOverride, prefix) {
    if (maybeReactUseId !== void 0) {
      const reactId = maybeReactUseId();
      return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
    }
    return useGlobalId(idOverride, prefix);
  }

  // node_modules/@base-ui/react/internals/useBaseUiId.mjs
  function useBaseUiId(idOverride) {
    return useId(idOverride, "base-ui");
  }

  // node_modules/@base-ui/react/internals/reason-parts.mjs
  var reason_parts_exports = {};
  __export(reason_parts_exports, {
    cancelOpen: () => cancelOpen,
    chipRemovePress: () => chipRemovePress,
    clearPress: () => clearPress,
    closePress: () => closePress,
    closeWatcher: () => closeWatcher,
    decrementPress: () => decrementPress,
    disabled: () => disabled,
    drag: () => drag,
    escapeKey: () => escapeKey,
    focusOut: () => focusOut,
    imperativeAction: () => imperativeAction,
    incrementPress: () => incrementPress,
    initial: () => initial,
    inputBlur: () => inputBlur,
    inputChange: () => inputChange,
    inputClear: () => inputClear,
    inputPaste: () => inputPaste,
    inputPress: () => inputPress,
    itemPress: () => itemPress,
    keyboard: () => keyboard,
    linkPress: () => linkPress,
    listNavigation: () => listNavigation,
    missing: () => missing,
    none: () => none,
    outsidePress: () => outsidePress,
    pointer: () => pointer,
    scrub: () => scrub,
    siblingOpen: () => siblingOpen,
    swipe: () => swipe,
    trackPress: () => trackPress,
    triggerFocus: () => triggerFocus,
    triggerHover: () => triggerHover,
    triggerPress: () => triggerPress,
    wheel: () => wheel,
    windowResize: () => windowResize
  });
  var none = "none";
  var triggerPress = "trigger-press";
  var triggerHover = "trigger-hover";
  var triggerFocus = "trigger-focus";
  var outsidePress = "outside-press";
  var itemPress = "item-press";
  var closePress = "close-press";
  var linkPress = "link-press";
  var clearPress = "clear-press";
  var chipRemovePress = "chip-remove-press";
  var trackPress = "track-press";
  var incrementPress = "increment-press";
  var decrementPress = "decrement-press";
  var inputChange = "input-change";
  var inputClear = "input-clear";
  var inputBlur = "input-blur";
  var inputPaste = "input-paste";
  var inputPress = "input-press";
  var focusOut = "focus-out";
  var escapeKey = "escape-key";
  var closeWatcher = "close-watcher";
  var listNavigation = "list-navigation";
  var keyboard = "keyboard";
  var pointer = "pointer";
  var drag = "drag";
  var wheel = "wheel";
  var scrub = "scrub";
  var cancelOpen = "cancel-open";
  var siblingOpen = "sibling-open";
  var disabled = "disabled";
  var missing = "missing";
  var initial = "initial";
  var imperativeAction = "imperative-action";
  var swipe = "swipe";
  var windowResize = "window-resize";

  // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
  function createChangeEventDetails(reason, event, trigger, customProperties) {
    let canceled = false;
    let allowPropagation = false;
    const custom = customProperties ?? EMPTY_OBJECT;
    const details = {
      reason,
      event: event ?? new Event("base-ui"),
      cancel() {
        canceled = true;
      },
      allowPropagation() {
        allowPropagation = true;
      },
      get isCanceled() {
        return canceled;
      },
      get isPropagationAllowed() {
        return allowPropagation;
      },
      trigger,
      ...custom
    };
    return details;
  }

  // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
  var React12 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/useOnMount.mjs
  var React11 = __toESM(require_react(), 1);
  function useOnMount(fn) {
    React11.useEffect(fn, EMPTY_ARRAY);
  }

  // node_modules/@base-ui/utils/useAnimationFrame.mjs
  var EMPTY = null;
  var LAST_RAF = globalThis.requestAnimationFrame;
  var Scheduler = class {
    /* This implementation uses an array as a backing data-structure for frame callbacks.
     * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
     * never calls the native `cancelAnimationFrame` if there are no frames left. This can
     * be much more efficient if there is a call pattern that alterns as
     * "request-cancel-request-cancel-…".
     * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
     * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
    callbacks = [];
    callbacksCount = 0;
    nextId = 1;
    startId = 1;
    isScheduled = false;
    tick = (timestamp) => {
      this.isScheduled = false;
      const currentCallbacks = this.callbacks;
      const currentCallbacksCount = this.callbacksCount;
      this.callbacks = [];
      this.callbacksCount = 0;
      this.startId = this.nextId;
      if (currentCallbacksCount > 0) {
        for (let i = 0; i < currentCallbacks.length; i += 1) {
          currentCallbacks[i]?.(timestamp);
        }
      }
    };
    request(fn) {
      const id = this.nextId;
      this.nextId += 1;
      this.callbacks.push(fn);
      this.callbacksCount += 1;
      const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);
      if (!this.isScheduled || didRAFChange) {
        requestAnimationFrame(this.tick);
        this.isScheduled = true;
      }
      return id;
    }
    cancel(id) {
      const index2 = id - this.startId;
      if (index2 < 0 || index2 >= this.callbacks.length) {
        return;
      }
      if (this.callbacks[index2] === null) {
        return;
      }
      this.callbacks[index2] = null;
      this.callbacksCount -= 1;
    }
  };
  var scheduler = new Scheduler();
  var AnimationFrame = class _AnimationFrame {
    static create() {
      return new _AnimationFrame();
    }
    static request(fn) {
      return scheduler.request(fn);
    }
    static cancel(id) {
      return scheduler.cancel(id);
    }
    currentId = EMPTY;
    /**
     * Executes `fn` after `delay`, clearing any previously scheduled call.
     */
    request(fn) {
      this.cancel();
      this.currentId = scheduler.request(() => {
        this.currentId = EMPTY;
        fn();
      });
    }
    cancel = () => {
      if (this.currentId !== EMPTY) {
        scheduler.cancel(this.currentId);
        this.currentId = EMPTY;
      }
    };
    disposeEffect = () => {
      return this.cancel;
    };
  };
  function useAnimationFrame() {
    const timeout = useRefWithInit(AnimationFrame.create).current;
    useOnMount(timeout.disposeEffect);
    return timeout;
  }

  // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
  function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
    const [transitionStatus, setTransitionStatus] = React12.useState(open2 && enableIdleState ? "idle" : void 0);
    const [mounted, setMounted] = React12.useState(open2 && !animateInitialOpen);
    if (open2 && !mounted) {
      setMounted(true);
      setTransitionStatus("starting");
    }
    if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) {
      setTransitionStatus("ending");
    }
    if (!open2 && !mounted && transitionStatus === "ending") {
      setTransitionStatus(void 0);
    }
    useIsoLayoutEffect(() => {
      if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) {
        const frame = AnimationFrame.request(() => {
          setTransitionStatus("ending");
        });
        return () => {
          AnimationFrame.cancel(frame);
        };
      }
      return void 0;
    }, [open2, mounted, transitionStatus, deferEndingState]);
    useIsoLayoutEffect(() => {
      if (!open2 || enableIdleState) {
        return void 0;
      }
      const frame = AnimationFrame.request(() => {
        setTransitionStatus(void 0);
      });
      return () => {
        AnimationFrame.cancel(frame);
      };
    }, [enableIdleState, open2]);
    useIsoLayoutEffect(() => {
      if (!open2 || !enableIdleState) {
        return void 0;
      }
      if (open2 && mounted && transitionStatus !== "idle") {
        setTransitionStatus("starting");
      }
      const frame = AnimationFrame.request(() => {
        setTransitionStatus("idle");
      });
      return () => {
        AnimationFrame.cancel(frame);
      };
    }, [enableIdleState, open2, mounted, transitionStatus]);
    return {
      mounted,
      setMounted,
      transitionStatus
    };
  }

  // node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
  var React13 = __toESM(require_react(), 1);
  function useCompositeListItem(params = {}) {
    const {
      guess,
      label,
      metadata,
      textRef,
      index: externalIndex
    } = params;
    const {
      register: register2,
      unregister,
      subscribeMapChange,
      nextIndexRef
    } = useCompositeListContext();
    const indexRef = React13.useRef(-1);
    const [internalIndex, setInternalIndex] = React13.useState(externalIndex == null && guess ? () => {
      if (indexRef.current === -1) {
        const newIndex = nextIndexRef.current;
        nextIndexRef.current += 1;
        indexRef.current = newIndex;
      }
      return indexRef.current;
    } : -1);
    const index2 = externalIndex ?? internalIndex;
    const componentRef = React13.useRef(null);
    const ref = React13.useCallback((node) => {
      const previousNode = componentRef.current;
      if (previousNode) {
        unregister(previousNode);
      }
      componentRef.current = node;
      if (node) {
        register2(node, {
          metadata: metadata ?? null,
          index: externalIndex ?? null,
          label,
          textRef
        });
      }
    }, [externalIndex, register2, unregister, metadata, label, textRef]);
    useIsoLayoutEffect(() => {
      if (externalIndex != null) {
        return void 0;
      }
      return subscribeMapChange((map) => {
        const i = componentRef.current ? map.get(componentRef.current)?.index : null;
        if (i != null) {
          setInternalIndex(i);
        }
      });
    }, [externalIndex, subscribeMapChange]);
    return {
      ref,
      index: index2
    };
  }

  // node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
  var startingStyle = "data-starting-style";
  var endingStyle = "data-ending-style";

  // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
  var STARTING_HOOK = {
    [startingStyle]: ""
  };
  var ENDING_HOOK = {
    [endingStyle]: ""
  };
  var transitionStatusMapping = {
    transitionStatus(value) {
      if (value === "starting") {
        return STARTING_HOOK;
      }
      if (value === "ending") {
        return ENDING_HOOK;
      }
      return null;
    }
  };

  // node_modules/@base-ui/react/internals/use-button/useButton.mjs
  var React16 = __toESM(require_react(), 1);

  // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
  function hasWindow() {
    return typeof window !== "undefined";
  }
  function getNodeName(node) {
    if (isNode(node)) {
      return (node.nodeName || "").toLowerCase();
    }
    return "#document";
  }
  function getWindow(node) {
    var _node$ownerDocument;
    return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
  }
  function getDocumentElement(node) {
    var _ref;
    return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
  }
  function isNode(value) {
    if (!hasWindow()) {
      return false;
    }
    return value instanceof Node || value instanceof getWindow(value).Node;
  }
  function isElement(value) {
    if (!hasWindow()) {
      return false;
    }
    return value instanceof Element || value instanceof getWindow(value).Element;
  }
  function isHTMLElement(value) {
    if (!hasWindow()) {
      return false;
    }
    return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
  }
  function isShadowRoot(value) {
    if (!hasWindow() || typeof ShadowRoot === "undefined") {
      return false;
    }
    return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
  }
  function isOverflowElement(element) {
    const {
      overflow,
      overflowX,
      overflowY,
      display
    } = getComputedStyle2(element);
    return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
  }
  function isTableElement(element) {
    return /^(table|td|th)$/.test(getNodeName(element));
  }
  function isTopLayer(element) {
    try {
      if (element.matches(":popover-open")) {
        return true;
      }
    } catch (_e) {
    }
    try {
      return element.matches(":modal");
    } catch (_e) {
      return false;
    }
  }
  var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
  var containRe = /paint|layout|strict|content/;
  var isNotNone = (value) => !!value && value !== "none";
  var isWebKitValue;
  function isContainingBlock(elementOrCss) {
    const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
    return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
  }
  function getContainingBlock(element) {
    let currentNode = getParentNode(element);
    while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
      if (isContainingBlock(currentNode)) {
        return currentNode;
      } else if (isTopLayer(currentNode)) {
        return null;
      }
      currentNode = getParentNode(currentNode);
    }
    return null;
  }
  function isWebKit() {
    if (isWebKitValue == null) {
      isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
    }
    return isWebKitValue;
  }
  function isLastTraversableNode(node) {
    return /^(html|body|#document)$/.test(getNodeName(node));
  }
  function getComputedStyle2(element) {
    return getWindow(element).getComputedStyle(element);
  }
  function getNodeScroll(element) {
    if (isElement(element)) {
      return {
        scrollLeft: element.scrollLeft,
        scrollTop: element.scrollTop
      };
    }
    return {
      scrollLeft: element.scrollX,
      scrollTop: element.scrollY
    };
  }
  function getParentNode(node) {
    if (getNodeName(node) === "html") {
      return node;
    }
    const result = (
      // Step into the shadow DOM of the parent of a slotted node.
      node.assignedSlot || // DOM Element detected.
      node.parentNode || // ShadowRoot detected.
      isShadowRoot(node) && node.host || // Fallback.
      getDocumentElement(node)
    );
    return isShadowRoot(result) ? result.host : result;
  }
  function getNearestOverflowAncestor(node) {
    const parentNode = getParentNode(node);
    if (isLastTraversableNode(parentNode)) {
      return (node.ownerDocument || node).body;
    }
    if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
      return parentNode;
    }
    return getNearestOverflowAncestor(parentNode);
  }
  function getOverflowAncestors(node, list, traverseIframes) {
    var _node$ownerDocument2;
    if (list === void 0) {
      list = [];
    }
    if (traverseIframes === void 0) {
      traverseIframes = true;
    }
    const scrollableAncestor = getNearestOverflowAncestor(node);
    const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
    const win = getWindow(scrollableAncestor);
    if (isBody) {
      const frameElement = getFrameElement(win);
      return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
    } else {
      return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
    }
  }
  function getFrameElement(win) {
    return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
  }

  // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
  var React14 = __toESM(require_react(), 1);
  var CompositeRootContext = /* @__PURE__ */ React14.createContext(void 0);
  if (true) CompositeRootContext.displayName = "CompositeRootContext";
  function useCompositeRootContext(optional = false) {
    const context = React14.useContext(CompositeRootContext);
    if (context === void 0 && !optional) {
      throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16));
    }
    return context;
  }

  // node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
  var React15 = __toESM(require_react(), 1);
  function useFocusableWhenDisabled(parameters) {
    const {
      focusableWhenDisabled,
      disabled: disabled2,
      composite = false,
      tabIndex: tabIndexProp = 0,
      isNativeButton
    } = parameters;
    const isFocusableComposite = composite && focusableWhenDisabled !== false;
    const isNonFocusableComposite = composite && focusableWhenDisabled === false;
    const props = React15.useMemo(() => {
      const additionalProps = {
        // allow Tabbing away from focusableWhenDisabled elements
        onKeyDown(event) {
          if (disabled2 && focusableWhenDisabled && event.key !== "Tab") {
            event.preventDefault();
          }
        }
      };
      if (!composite) {
        additionalProps.tabIndex = tabIndexProp;
        if (!isNativeButton && disabled2) {
          additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
        }
      }
      if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) {
        additionalProps["aria-disabled"] = disabled2;
      }
      if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
        additionalProps.disabled = disabled2;
      }
      return additionalProps;
    }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
    return {
      props
    };
  }

  // node_modules/@base-ui/utils/owner.mjs
  function ownerDocument(node) {
    return node?.ownerDocument || document;
  }

  // node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs
  function dispatchClickWithModifiers(target, sourceEvent, {
    detail = 0
  } = {}) {
    target.dispatchEvent(new (getWindow(target)).PointerEvent("click", {
      bubbles: true,
      cancelable: true,
      composed: true,
      detail,
      shiftKey: sourceEvent.shiftKey,
      ctrlKey: sourceEvent.ctrlKey,
      altKey: sourceEvent.altKey,
      metaKey: sourceEvent.metaKey
    }));
  }

  // node_modules/@base-ui/react/internals/use-button/useButton.mjs
  function useButton(parameters = {}) {
    const {
      disabled: disabled2 = false,
      focusableWhenDisabled,
      tabIndex = 0,
      native: isNativeButton = true,
      composite: compositeProp
    } = parameters;
    const elementRef = React16.useRef(null);
    const compositeRootContext = useCompositeRootContext(true);
    const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
    const {
      props: focusableWhenDisabledProps
    } = useFocusableWhenDisabled({
      focusableWhenDisabled,
      disabled: disabled2,
      composite: isCompositeItem,
      tabIndex,
      isNativeButton
    });
    if (true) {
      React16.useEffect(() => {
        if (!elementRef.current) {
          return;
        }
        const isButtonTag = isButtonElement(elementRef.current);
        if (isNativeButton) {
          if (!isButtonTag) {
            const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
            const message2 = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`.";
            error(`${message2}${ownerStackMessage}`);
          }
        } else if (isButtonTag) {
          const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
          const message2 = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`.";
          error(`${message2}${ownerStackMessage}`);
        }
      }, [isNativeButton]);
    }
    const updateDisabled = React16.useCallback(() => {
      const element = elementRef.current;
      if (!isButtonElement(element)) {
        return;
      }
      if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) {
        element.disabled = false;
      }
    }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]);
    useIsoLayoutEffect(updateDisabled, [updateDisabled]);
    const getButtonProps = React16.useCallback((externalProps = {}) => {
      const {
        onClick: externalOnClick,
        onMouseDown: externalOnMouseDown,
        onKeyUp: externalOnKeyUp,
        onKeyDown: externalOnKeyDown,
        onPointerDown: externalOnPointerDown,
        ...otherExternalProps
      } = externalProps;
      return mergeProps({
        onClick(event) {
          if (disabled2) {
            event.preventDefault();
            return;
          }
          externalOnClick?.(event);
        },
        onMouseDown(event) {
          if (!disabled2) {
            externalOnMouseDown?.(event);
          }
        },
        onKeyDown(event) {
          if (disabled2) {
            return;
          }
          makeEventPreventable(event);
          externalOnKeyDown?.(event);
          if (event.baseUIHandlerPrevented) {
            return;
          }
          const isCurrentTarget = event.target === event.currentTarget;
          const currentTarget = event.currentTarget;
          const isButton2 = isButtonElement(currentTarget);
          const isLink = !isNativeButton && isValidLinkElement(currentTarget);
          const shouldClick = isCurrentTarget && (isNativeButton ? isButton2 : !isLink);
          const isEnterKey = event.key === "Enter";
          const isSpaceKey = event.key === " ";
          const role = currentTarget.getAttribute("role");
          const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
          if (isCurrentTarget && isCompositeItem && isSpaceKey) {
            if (event.defaultPrevented && isTextNavigationRole) {
              return;
            }
            event.preventDefault();
            if (!isNativeButton || isButton2) {
              event.preventBaseUIHandler();
              dispatchClickWithModifiers(currentTarget, event);
            }
            return;
          }
          if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
            if (isCurrentTarget && isLink && isSpaceKey) {
              event.preventDefault();
            }
            return;
          }
          if (event.defaultPrevented) {
            return;
          }
          event.preventDefault();
          if (isEnterKey) {
            event.preventBaseUIHandler();
            dispatchClickWithModifiers(currentTarget, event);
          }
        },
        onKeyUp(event) {
          if (disabled2) {
            return;
          }
          makeEventPreventable(event);
          externalOnKeyUp?.(event);
          if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
            event.preventDefault();
            return;
          }
          if (event.baseUIHandlerPrevented) {
            return;
          }
          if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") {
            event.preventBaseUIHandler();
            dispatchClickWithModifiers(event.currentTarget, event);
          }
        },
        onPointerDown(event) {
          if (disabled2) {
            event.preventDefault();
            return;
          }
          externalOnPointerDown?.(event);
        }
      }, isNativeButton ? {
        type: "button"
      } : {
        role: "button"
      }, focusableWhenDisabledProps, otherExternalProps);
    }, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);
    const buttonRef = useStableCallback((element) => {
      elementRef.current = element;
      updateDisabled();
    });
    return {
      getButtonProps,
      buttonRef
    };
  }
  function isButtonElement(elem) {
    return isHTMLElement(elem) && elem.tagName === "BUTTON";
  }
  function isValidLinkElement(elem) {
    return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href);
  }

  // node_modules/@base-ui/utils/addEventListener.mjs
  function addEventListener(target, type, listener, options) {
    target.addEventListener(type, listener, options);
    return () => {
      target.removeEventListener(type, listener, options);
    };
  }

  // node_modules/@base-ui/utils/useValueAsRef.mjs
  function useValueAsRef(value) {
    const latest = useRefWithInit(createLatestRef, value).current;
    latest.next = value;
    useIsoLayoutEffect(latest.effect);
    return latest;
  }
  function createLatestRef(value) {
    const latest = {
      current: value,
      next: value,
      effect: () => {
        latest.current = latest.next;
      }
    };
    return latest;
  }

  // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
  var React17 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
  var ReactDOM = __toESM(require_react_dom(), 1);

  // node_modules/@base-ui/react/utils/resolveRef.mjs
  function resolveRef(maybeRef) {
    if (maybeRef == null) {
      return maybeRef;
    }
    return "current" in maybeRef ? maybeRef.current : maybeRef;
  }

  // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
  var pendingCallbacks = null;
  function flushBeforePaint(fn) {
    if (!pendingCallbacks) {
      const callbacks = [];
      pendingCallbacks = callbacks;
      queueMicrotask(() => {
        pendingCallbacks = null;
        ReactDOM.flushSync(() => {
          for (const callback of callbacks) {
            callback();
          }
        });
      });
    }
    pendingCallbacks.push(fn);
  }
  function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch2 = false) {
    const frame = useAnimationFrame();
    return useStableCallback((fnToExecute, signal = null) => {
      frame.cancel();
      const element = resolveRef(elementOrRef);
      if (element == null) {
        return;
      }
      const resolvedElement = element;
      const done = () => {
        if (!batch2) {
          ReactDOM.flushSync(fnToExecute);
          return;
        }
        flushBeforePaint(() => {
          if (!signal?.aborted) {
            fnToExecute();
          }
        });
      };
      if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
        fnToExecute();
        return;
      }
      function exec() {
        Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => {
          if (!signal?.aborted) {
            done();
          }
        }, () => {
          if (signal?.aborted) {
            return;
          }
          const currentAnimations = resolvedElement.getAnimations();
          if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
            exec();
            return;
          }
          done();
        });
      }
      if (waitForStartingStyleRemoved) {
        const startingStyleAttribute = startingStyle;
        if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
          frame.request(exec);
          return;
        }
        const attributeObserver = new MutationObserver(() => {
          if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
            attributeObserver.disconnect();
            exec();
          }
        });
        attributeObserver.observe(resolvedElement, {
          attributes: true,
          attributeFilter: [startingStyleAttribute]
        });
        signal?.addEventListener("abort", () => attributeObserver.disconnect(), {
          once: true
        });
        return;
      }
      frame.request(exec);
    });
  }

  // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
  function useOpenChangeComplete(parameters) {
    const {
      enabled = true,
      open: open2,
      ref,
      batch: batch2 = false,
      onComplete: onCompleteParam
    } = parameters;
    const onComplete = useStableCallback(onCompleteParam);
    const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch2);
    React17.useEffect(() => {
      if (!enabled) {
        return void 0;
      }
      const abortController = new AbortController();
      runOnceAnimationsFinish(onComplete, abortController.signal);
      return () => {
        abortController.abort();
      };
    }, [enabled, open2, onComplete, runOnceAnimationsFinish]);
  }

  // node_modules/@base-ui/utils/platform/parts.mjs
  var parts_exports = {};
  __export(parts_exports, {
    engine: () => engine_exports,
    env: () => env_exports,
    mediaQuery: () => media_query_exports,
    os: () => os_exports,
    screenReader: () => screen_reader_exports
  });

  // node_modules/@base-ui/utils/platform/os.mjs
  var os_exports = {};
  __export(os_exports, {
    android: () => android,
    apple: () => apple,
    ios: () => ios,
    linux: () => linux,
    mac: () => mac,
    windows: () => windows
  });

  // node_modules/@base-ui/utils/platform/shared.mjs
  function readRawData() {
    if (typeof navigator === "undefined") {
      return {
        userAgent: "",
        platform: "",
        maxTouchPoints: 0
      };
    }
    if (true) {
      const uaData = navigator.userAgentData;
      if (uaData && Array.isArray(uaData.brands)) {
        return {
          userAgent: uaData.brands.map(({
            brand,
            version: version2
          }) => `${brand}/${version2}`).join(" "),
          platform: uaData.platform ?? navigator.platform ?? "",
          maxTouchPoints: navigator.maxTouchPoints ?? 0
        };
      }
    }
    return {
      userAgent: navigator.userAgent,
      platform: navigator.platform ?? "",
      maxTouchPoints: navigator.maxTouchPoints ?? 0
    };
  }
  var {
    userAgent,
    platform,
    maxTouchPoints
  } = readRawData();
  var lowerUserAgent = userAgent.toLowerCase();
  var lowerPlatform = platform.toLowerCase();

  // node_modules/@base-ui/utils/platform/os.mjs
  var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1;
  var ANDROID_STRING = "android";
  var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);
  var mac = !ios && lowerPlatform.startsWith("mac");
  var windows = lowerPlatform.startsWith("win");
  var linux = !android && /^(linux|chrome os)/.test(lowerPlatform);
  var apple = mac || ios;

  // node_modules/@base-ui/utils/platform/engine.mjs
  var engine_exports = {};
  __export(engine_exports, {
    blink: () => blink,
    gecko: () => gecko,
    webkit: () => webkit
  });
  var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none");
  var gecko = !webkit && lowerUserAgent.includes("firefox");
  var blink = !webkit && lowerUserAgent.includes("chrom");

  // node_modules/@base-ui/utils/platform/screen-reader.mjs
  var screen_reader_exports = {};
  __export(screen_reader_exports, {
    voiceOver: () => voiceOver
  });
  var voiceOver = apple;

  // node_modules/@base-ui/utils/platform/env.mjs
  var env_exports = {};
  __export(env_exports, {
    jsdom: () => jsdom
  });
  var jsdom = /jsdom|happydom/.test(lowerUserAgent);

  // node_modules/@base-ui/utils/platform/media-query.mjs
  var media_query_exports = {};
  __export(media_query_exports, {
    iOS: () => iOS
  });
  var iOS = "@supports (-webkit-touch-callout: none)";

  // node_modules/@base-ui/utils/useTimeout.mjs
  var EMPTY2 = 0;
  var Timeout = class _Timeout {
    static create() {
      return new _Timeout();
    }
    currentId = EMPTY2;
    /**
     * Executes `fn` after `delay`, clearing any previously scheduled call.
     */
    start(delay, fn) {
      this.clear();
      this.currentId = setTimeout(() => {
        this.currentId = EMPTY2;
        fn();
      }, delay);
    }
    isStarted() {
      return this.currentId !== EMPTY2;
    }
    clear = () => {
      if (this.currentId !== EMPTY2) {
        clearTimeout(this.currentId);
        this.currentId = EMPTY2;
      }
    };
    disposeEffect = () => {
      return this.clear;
    };
  };
  function useTimeout() {
    const timeout = useRefWithInit(Timeout.create).current;
    useOnMount(timeout.disposeEffect);
    return timeout;
  }

  // node_modules/@base-ui/utils/useScrollLock.mjs
  var originalHtmlStyles = {};
  var originalBodyStyles = {};
  var originalHtmlScrollBehavior = "";
  function getViewportScroller(html, body) {
    return isOverflowElement(html) ? html : body;
  }
  function isPageScrollLocked(win, html, body) {
    return /hidden|clip/.test(win.getComputedStyle(getViewportScroller(html, body)).overflowY);
  }
  function hasInsetScrollbars(referenceElement) {
    if (typeof document === "undefined") {
      return false;
    }
    const doc = ownerDocument(referenceElement);
    const win = getWindow(doc);
    return win.innerWidth - doc.documentElement.clientWidth > 0;
  }
  function supportsStableScrollbarGutter(referenceElement) {
    const supported = typeof CSS !== "undefined" && CSS.supports && CSS.supports("scrollbar-gutter", "stable");
    if (!supported || typeof document === "undefined") {
      return false;
    }
    const doc = ownerDocument(referenceElement);
    const html = doc.documentElement;
    const body = doc.body;
    const scrollContainer = getViewportScroller(html, body);
    const originalScrollContainerOverflowY = scrollContainer.style.overflowY;
    const originalHtmlStyleGutter = html.style.scrollbarGutter;
    html.style.scrollbarGutter = "stable";
    scrollContainer.style.overflowY = "scroll";
    const before = scrollContainer.offsetWidth;
    scrollContainer.style.overflowY = "hidden";
    const after = scrollContainer.offsetWidth;
    scrollContainer.style.overflowY = originalScrollContainerOverflowY;
    html.style.scrollbarGutter = originalHtmlStyleGutter;
    return before === after;
  }
  function preventScrollOverlayScrollbars(referenceElement) {
    const doc = ownerDocument(referenceElement);
    const html = doc.documentElement;
    const body = doc.body;
    const elementToLock = getViewportScroller(html, body);
    const originalElementToLockStyles = {
      overflowY: elementToLock.style.overflowY,
      overflowX: elementToLock.style.overflowX
    };
    Object.assign(elementToLock.style, {
      overflowY: "hidden",
      overflowX: "hidden"
    });
    return () => {
      Object.assign(elementToLock.style, originalElementToLockStyles);
    };
  }
  function preventScrollInsetScrollbars(referenceElement) {
    const doc = ownerDocument(referenceElement);
    const html = doc.documentElement;
    const body = doc.body;
    const win = getWindow(html);
    let scrollTop = 0;
    let scrollLeft = 0;
    let updateGutterOnly = false;
    const resizeFrame = AnimationFrame.create();
    if (parts_exports.engine.webkit && (win.visualViewport?.scale ?? 1) !== 1) {
      return () => {
      };
    }
    function lockScroll() {
      const htmlStyles = win.getComputedStyle(html);
      const bodyStyles = win.getComputedStyle(body);
      const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || "";
      const hasBothEdges = htmlScrollbarGutterValue.includes("both-edges");
      const scrollbarGutterValue = hasBothEdges ? "stable both-edges" : "stable";
      scrollTop = html.scrollTop;
      scrollLeft = html.scrollLeft;
      originalHtmlStyles = {
        scrollbarGutter: html.style.scrollbarGutter,
        overflowY: html.style.overflowY,
        overflowX: html.style.overflowX
      };
      originalHtmlScrollBehavior = html.style.scrollBehavior;
      originalBodyStyles = {
        position: body.style.position,
        height: body.style.height,
        width: body.style.width,
        boxSizing: body.style.boxSizing,
        overflowY: body.style.overflowY,
        overflowX: body.style.overflowX,
        scrollBehavior: body.style.scrollBehavior
      };
      const isScrollableY = html.scrollHeight > html.clientHeight;
      const isScrollableX = html.scrollWidth > html.clientWidth;
      const hasConstantOverflowY = htmlStyles.overflowY === "scroll" || bodyStyles.overflowY === "scroll";
      const hasConstantOverflowX = htmlStyles.overflowX === "scroll" || bodyStyles.overflowX === "scroll";
      const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);
      const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);
      const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);
      const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);
      const elementToLock = getViewportScroller(html, body);
      updateGutterOnly = supportsStableScrollbarGutter(referenceElement);
      if (updateGutterOnly) {
        html.style.scrollbarGutter = scrollbarGutterValue;
        elementToLock.style.overflowY = "hidden";
        elementToLock.style.overflowX = "hidden";
        return;
      }
      Object.assign(html.style, {
        scrollbarGutter: scrollbarGutterValue,
        overflowY: "hidden",
        overflowX: "hidden"
      });
      if (isScrollableY || hasConstantOverflowY) {
        html.style.overflowY = "scroll";
      }
      if (isScrollableX || hasConstantOverflowX) {
        html.style.overflowX = "scroll";
      }
      Object.assign(body.style, {
        position: "relative",
        height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : "100dvh",
        width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : "100vw",
        boxSizing: "border-box",
        // Assign the longhands that `cleanup` restores, so nothing is left behind.
        overflowY: "hidden",
        overflowX: "hidden",
        scrollBehavior: "unset"
      });
      body.scrollTop = scrollTop;
      body.scrollLeft = scrollLeft;
      html.setAttribute("data-base-ui-scroll-locked", "");
      html.style.scrollBehavior = "unset";
    }
    function cleanup() {
      Object.assign(html.style, originalHtmlStyles);
      Object.assign(body.style, originalBodyStyles);
      if (!updateGutterOnly) {
        html.scrollTop = scrollTop;
        html.scrollLeft = scrollLeft;
        html.removeAttribute("data-base-ui-scroll-locked");
        html.style.scrollBehavior = originalHtmlScrollBehavior;
      }
    }
    function handleResize() {
      cleanup();
      resizeFrame.request(lockScroll);
    }
    lockScroll();
    const unsubscribeResize = addEventListener(win, "resize", handleResize);
    return () => {
      resizeFrame.cancel();
      cleanup();
      if (typeof win.removeEventListener === "function") {
        unsubscribeResize();
      }
    };
  }
  var ScrollLocker = class {
    lockCount = 0;
    restore = null;
    timeoutLock = Timeout.create();
    timeoutUnlock = Timeout.create();
    acquire(referenceElement) {
      this.lockCount += 1;
      if (this.lockCount === 1 && this.restore === null) {
        this.timeoutLock.start(0, () => this.lock(referenceElement));
      }
      return this.release;
    }
    release = () => {
      this.lockCount -= 1;
      if (this.lockCount === 0 && this.restore) {
        this.timeoutUnlock.start(0, this.unlock);
      }
    };
    unlock = () => {
      if (this.lockCount === 0 && this.restore) {
        this.restore?.();
        this.restore = null;
      }
    };
    lock(referenceElement) {
      if (this.lockCount === 0 || this.restore !== null) {
        return;
      }
      const doc = ownerDocument(referenceElement);
      const html = doc.documentElement;
      const body = doc.body;
      const win = getWindow(html);
      if (isPageScrollLocked(win, html, body)) {
        const observer = new win.MutationObserver(() => {
          if (isPageScrollLocked(win, html, body)) {
            return;
          }
          observer.disconnect();
          this.restore = null;
          this.lock(referenceElement);
        });
        const options = {
          attributes: true
        };
        observer.observe(html, options);
        observer.observe(body, options);
        this.restore = () => observer.disconnect();
        return;
      }
      const hasOverlayScrollbars = parts_exports.os.ios || !hasInsetScrollbars(referenceElement);
      this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);
    }
  };
  var SCROLL_LOCKER = new ScrollLocker();
  function useScrollLock(enabled = true, referenceElement = null) {
    useIsoLayoutEffect(() => {
      if (!enabled) {
        return void 0;
      }
      return SCROLL_LOCKER.acquire(referenceElement);
    }, [enabled, referenceElement]);
  }

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs
  var React18 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/floating-ui-react/utils/event.mjs
  function stopEvent(event) {
    event.preventDefault();
    event.stopPropagation();
  }
  function isReactEvent(event) {
    return "nativeEvent" in event;
  }
  function isVirtualClick(event) {
    if (event.pointerType === "" && event.isTrusted) {
      return true;
    }
    if (parts_exports.os.android && event.pointerType) {
      return event.type === "click" && event.buttons === 1;
    }
    return event.detail === 0 && !event.pointerType;
  }
  function isVirtualPointerEvent(event) {
    if (parts_exports.env.jsdom) {
      return false;
    }
    return !parts_exports.os.android && event.width === 0 && event.height === 0 || parts_exports.os.android && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
    event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "touch";
  }
  function isMouseLikePointerType(pointerType, strict) {
    const values = ["mouse", "pen"];
    if (!strict) {
      values.push("", void 0);
    }
    return values.includes(pointerType);
  }
  function isClickLikeEvent(event) {
    const type = event.type;
    return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup";
  }

  // node_modules/@base-ui/utils/shadowDom.mjs
  function activeElement(doc) {
    let element = doc.activeElement;
    while (element?.shadowRoot?.activeElement != null) {
      element = element.shadowRoot.activeElement;
    }
    return element;
  }
  function contains(parent, child) {
    if (!parent || !child) {
      return false;
    }
    const rootNode = child.getRootNode?.();
    if (parent.contains(child)) {
      return true;
    }
    if (rootNode && isShadowRoot(rootNode)) {
      let next = child;
      while (next) {
        if (parent === next) {
          return true;
        }
        next = next.parentNode || next.host;
      }
    }
    return false;
  }
  function getTarget(event) {
    if ("composedPath" in event) {
      return event.composedPath()[0] ?? event.target;
    }
    return event.target;
  }

  // node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs
  var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable";
  var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
  var ARROW_LEFT = "ArrowLeft";
  var ARROW_RIGHT = "ArrowRight";
  var ARROW_UP = "ArrowUp";
  var ARROW_DOWN = "ArrowDown";

  // node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs
  var open = "data-open";
  var closed = "data-closed";
  var anchorHidden = "data-anchor-hidden";

  // node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs
  var CommonTriggerDataAttributes_exports = {};
  __export(CommonTriggerDataAttributes_exports, {
    popupOpen: () => popupOpen,
    pressed: () => pressed
  });
  var popupOpen = "data-popup-open";
  var pressed = "data-pressed";

  // node_modules/@base-ui/react/utils/popupStateMapping.mjs
  var TRIGGER_HOOK = {
    [popupOpen]: ""
  };
  var PRESSABLE_TRIGGER_HOOK = {
    [popupOpen]: "",
    [pressed]: ""
  };
  var POPUP_OPEN_HOOK = {
    [open]: ""
  };
  var POPUP_CLOSED_HOOK = {
    [closed]: ""
  };
  var ANCHOR_HIDDEN_HOOK = {
    [anchorHidden]: ""
  };
  var triggerOpenStateMapping = {
    open(value) {
      if (value) {
        return TRIGGER_HOOK;
      }
      return null;
    }
  };
  var pressableTriggerOpenStateMapping = {
    open(value) {
      if (value) {
        return PRESSABLE_TRIGGER_HOOK;
      }
      return null;
    }
  };
  var popupStateMapping = {
    open(value) {
      if (value) {
        return POPUP_OPEN_HOOK;
      }
      return POPUP_CLOSED_HOOK;
    },
    anchorHidden(value) {
      if (value) {
        return ANCHOR_HIDDEN_HOOK;
      }
      return null;
    }
  };
  var popupTransitionStateMapping = {
    ...popupStateMapping,
    ...transitionStatusMapping
  };

  // node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs
  var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen;
  var triggerDisabled = "data-trigger-disabled";

  // node_modules/@base-ui/react/floating-ui-react/utils/element.mjs
  function isTargetInsideEnabledTrigger(target, triggerElements) {
    if (!isElement(target)) {
      return false;
    }
    const targetElement = target;
    if (triggerElements.hasElement(targetElement)) {
      return !targetElement.hasAttribute(triggerDisabled);
    }
    for (const [, trigger] of triggerElements.entries()) {
      if (contains(trigger, targetElement)) {
        return !trigger.hasAttribute(triggerDisabled);
      }
    }
    return false;
  }
  function isEventTargetWithin(event, node) {
    if (node == null) {
      return false;
    }
    if ("composedPath" in event) {
      return event.composedPath().includes(node);
    }
    const eventAgain = event;
    return eventAgain.target != null && node.contains(eventAgain.target);
  }
  function isRootElement(element) {
    return element.matches("html,body");
  }
  function isTypeableElement(element) {
    return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
  }
  function isInteractiveElement(element) {
    return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null;
  }
  function isTypeableCombobox(element) {
    if (!element) {
      return false;
    }
    return element.getAttribute("role") === "combobox" && isTypeableElement(element);
  }
  function matchesFocusVisible(element) {
    if (!element || parts_exports.env.jsdom) {
      return true;
    }
    try {
      return element.matches(":focus-visible");
    } catch (_e) {
      return true;
    }
  }
  function getFloatingFocusElement(floatingElement) {
    if (!floatingElement) {
      return null;
    }
    return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs
  function resolveValue(value, pointerType) {
    if (pointerType != null && !isMouseLikePointerType(pointerType)) {
      return 0;
    }
    if (typeof value === "function") {
      return value();
    }
    return value;
  }
  function getDelay(value, prop, pointerType) {
    const result = resolveValue(value, pointerType);
    if (typeof result === "number") {
      return result;
    }
    return result?.[prop];
  }
  function getRestMs(value) {
    if (typeof value === "function") {
      return value();
    }
    return value;
  }
  function isClickLikeOpenEvent(openEventType, interactedInside) {
    return interactedInside || openEventType === "click" || openEventType === "mousedown";
  }
  function isHoverOpenEvent(openEventType) {
    return openEventType?.includes("mouse") && openEventType !== "mousedown";
  }

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs
  var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
  var FloatingDelayGroupContext = /* @__PURE__ */ React18.createContext({
    hasProvider: false,
    timeoutMs: 0,
    delayRef: {
      current: 0
    },
    initialDelayRef: {
      current: 0
    },
    timeout: new Timeout(),
    currentIdRef: {
      current: null
    },
    currentContextRef: {
      current: null
    }
  });
  if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext";
  function resetDelayRef(delayRef, initialDelayRef) {
    delayRef.current = initialDelayRef.current;
  }
  function FloatingDelayGroup(props) {
    const {
      children,
      delay,
      timeoutMs = 0
    } = props;
    const delayRef = React18.useRef(delay);
    const initialDelayRef = React18.useRef(delay);
    const currentIdRef = React18.useRef(null);
    const currentContextRef = React18.useRef(null);
    const timeout = useTimeout();
    useIsoLayoutEffect(() => {
      initialDelayRef.current = delay;
      if (!currentIdRef.current) {
        delayRef.current = delay;
        return;
      }
      delayRef.current = {
        open: getDelay(delayRef.current, "open"),
        close: getDelay(delay, "close")
      };
    }, [delay, currentIdRef, delayRef, initialDelayRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FloatingDelayGroupContext.Provider, {
      value: React18.useMemo(() => ({
        hasProvider: true,
        delayRef,
        initialDelayRef,
        currentIdRef,
        timeoutMs,
        currentContextRef,
        timeout
      }), [timeoutMs, timeout]),
      children
    });
  }
  function useDelayGroup(context, options = {
    open: false
  }) {
    const {
      open: open2
    } = options;
    const store = "rootStore" in context ? context.rootStore : context;
    const floatingId = store.useState("floatingId");
    const groupContext = React18.useContext(FloatingDelayGroupContext);
    const {
      currentIdRef,
      delayRef,
      timeoutMs,
      initialDelayRef,
      currentContextRef,
      hasProvider,
      timeout
    } = groupContext;
    const [isInstantPhase, setIsInstantPhase] = React18.useState(false);
    const openRef = React18.useRef(open2);
    useIsoLayoutEffect(() => {
      openRef.current = open2;
    }, [open2]);
    useIsoLayoutEffect(() => {
      function unset() {
        currentContextRef.current?.setIsInstantPhase(false);
        currentIdRef.current = null;
        currentContextRef.current = null;
        delayRef.current = initialDelayRef.current;
        timeout.clear();
      }
      if (!currentIdRef.current) {
        return void 0;
      }
      if (!open2 && currentIdRef.current === floatingId) {
        setIsInstantPhase(false);
        if (timeoutMs) {
          const closingId = floatingId;
          timeout.start(timeoutMs, () => {
            if (store.select("open") || currentIdRef.current && currentIdRef.current !== closingId) {
              return;
            }
            unset();
          });
          return () => {
            if (openRef.current || currentIdRef.current !== closingId) {
              timeout.clear();
            }
          };
        }
        unset();
      }
      return void 0;
    }, [open2, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]);
    useIsoLayoutEffect(() => {
      if (!open2) {
        return;
      }
      const prevContext = currentContextRef.current;
      const prevId = currentIdRef.current;
      timeout.clear();
      currentContextRef.current = {
        onOpenChange: store.setOpen,
        setIsInstantPhase
      };
      currentIdRef.current = floatingId;
      delayRef.current = {
        open: 0,
        close: getDelay(initialDelayRef.current, "close")
      };
      if (prevId !== null && prevId !== floatingId) {
        setIsInstantPhase(true);
        prevContext?.setIsInstantPhase(true);
        prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none));
      } else {
        setIsInstantPhase(false);
        prevContext?.setIsInstantPhase(false);
      }
    }, [open2, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]);
    useIsoLayoutEffect(() => {
      return () => {
        if (currentIdRef.current === floatingId) {
          currentContextRef.current = null;
          if (!openRef.current) {
            return;
          }
          currentIdRef.current = null;
          resetDelayRef(delayRef, initialDelayRef);
          timeout.clear();
        }
      };
    }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]);
    return React18.useMemo(() => ({
      activeIdRef: currentIdRef,
      hasProvider,
      delayRef,
      isInstantPhase
    }), [currentIdRef, hasProvider, delayRef, isInstantPhase]);
  }

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs
  var React22 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/mergeCleanups.mjs
  function mergeCleanups(...cleanups) {
    return () => {
      for (let i = 0; i < cleanups.length; i += 1) {
        const cleanup = cleanups[i];
        if (cleanup) {
          cleanup();
        }
      }
    };
  }

  // node_modules/@base-ui/react/utils/FocusGuard.mjs
  var React19 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/visuallyHidden.mjs
  var visuallyHiddenBase = {
    clipPath: "inset(50%)",
    overflow: "hidden",
    whiteSpace: "nowrap",
    border: 0,
    padding: 0,
    width: 1,
    height: 1,
    margin: -1
  };
  var visuallyHidden = {
    ...visuallyHiddenBase,
    position: "fixed",
    top: 0,
    left: 0
  };
  var visuallyHiddenInput = {
    ...visuallyHiddenBase,
    position: "absolute"
  };

  // node_modules/@base-ui/react/utils/FocusGuard.mjs
  var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
  var FocusGuard = /* @__PURE__ */ React19.forwardRef(function FocusGuard2(props, ref) {
    const [role, setRole] = React19.useState();
    useIsoLayoutEffect(() => {
      if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) {
        setRole("button");
      }
    }, []);
    const restProps = {
      tabIndex: 0,
      // Role is only for VoiceOver
      role
    };
    return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", {
      ...props,
      ref,
      style: visuallyHidden,
      "aria-hidden": role ? void 0 : true,
      ...restProps,
      "data-base-ui-focus-guard": ""
    });
  });
  if (true) FocusGuard.displayName = "FocusGuard";

  // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
  var min = Math.min;
  var max = Math.max;
  var round = Math.round;
  var floor = Math.floor;
  var createCoords = (v2) => ({
    x: v2,
    y: v2
  });
  var oppositeSideMap = {
    left: "right",
    right: "left",
    bottom: "top",
    top: "bottom"
  };
  function clamp(start, value, end) {
    return max(start, min(value, end));
  }
  function evaluate(value, param) {
    return typeof value === "function" ? value(param) : value;
  }
  function getSide(placement) {
    return placement.split("-")[0];
  }
  function getAlignment(placement) {
    return placement.split("-")[1];
  }
  function getOppositeAxis(axis) {
    return axis === "x" ? "y" : "x";
  }
  function getAxisLength(axis) {
    return axis === "y" ? "height" : "width";
  }
  function getSideAxis(placement) {
    const firstChar = placement[0];
    return firstChar === "t" || firstChar === "b" ? "y" : "x";
  }
  function getAlignmentAxis(placement) {
    return getOppositeAxis(getSideAxis(placement));
  }
  function getAlignmentSides(placement, rects, rtl) {
    if (rtl === void 0) {
      rtl = false;
    }
    const alignment = getAlignment(placement);
    const alignmentAxis = getAlignmentAxis(placement);
    const length = getAxisLength(alignmentAxis);
    let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
    if (rects.reference[length] > rects.floating[length]) {
      mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
    }
    return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
  }
  function getExpandedPlacements(placement) {
    const oppositePlacement = getOppositePlacement(placement);
    return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
  }
  function getOppositeAlignmentPlacement(placement) {
    return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
  }
  var lrPlacement = ["left", "right"];
  var rlPlacement = ["right", "left"];
  var tbPlacement = ["top", "bottom"];
  var btPlacement = ["bottom", "top"];
  function getSideList(side, isStart, rtl) {
    switch (side) {
      case "top":
      case "bottom":
        if (rtl) return isStart ? rlPlacement : lrPlacement;
        return isStart ? lrPlacement : rlPlacement;
      case "left":
      case "right":
        return isStart ? tbPlacement : btPlacement;
      default:
        return [];
    }
  }
  function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
    const alignment = getAlignment(placement);
    let list = getSideList(getSide(placement), direction === "start", rtl);
    if (alignment) {
      list = list.map((side) => side + "-" + alignment);
      if (flipAlignment) {
        list = list.concat(list.map(getOppositeAlignmentPlacement));
      }
    }
    return list;
  }
  function getOppositePlacement(placement) {
    const side = getSide(placement);
    return oppositeSideMap[side] + placement.slice(side.length);
  }
  function expandPaddingObject(padding) {
    var _padding$top, _padding$right, _padding$bottom, _padding$left;
    return {
      top: (_padding$top = padding.top) != null ? _padding$top : 0,
      right: (_padding$right = padding.right) != null ? _padding$right : 0,
      bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
      left: (_padding$left = padding.left) != null ? _padding$left : 0
    };
  }
  function getPaddingObject(padding) {
    return typeof padding !== "number" ? expandPaddingObject(padding) : {
      top: padding,
      right: padding,
      bottom: padding,
      left: padding
    };
  }
  function rectToClientRect(rect) {
    const {
      x: x2,
      y: y2,
      width,
      height
    } = rect;
    return {
      width,
      height,
      top: y2,
      left: x2,
      right: x2 + width,
      bottom: y2 + height,
      x: x2,
      y: y2
    };
  }

  // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
  function isIndexOutOfListBounds(list, index2) {
    return index2 < 0 || index2 >= list.length;
  }
  function getMinListIndex(listRef, disabledIndices) {
    return findNonDisabledListIndex(listRef.current, {
      disabledIndices
    });
  }
  function getMaxListIndex(listRef, disabledIndices) {
    return findNonDisabledListIndex(listRef.current, {
      decrement: true,
      startingIndex: listRef.current.length,
      disabledIndices
    });
  }
  function findNonDisabledListIndex(list, {
    startingIndex = -1,
    decrement = false,
    disabledIndices,
    amount = 1
  } = {}) {
    let index2 = startingIndex;
    do {
      index2 += decrement ? -amount : amount;
    } while (index2 >= 0 && index2 <= list.length - 1 && isListIndexDisabled(list, index2, disabledIndices));
    return index2;
  }
  function isListIndexDisabled(list, index2, disabledIndices) {
    const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index2) : disabledIndices?.includes(index2) ?? false;
    if (isExplicitlyDisabled) {
      return true;
    }
    const element = list[index2];
    if (!element) {
      return false;
    }
    if (!isElementVisible(element)) {
      return true;
    }
    if (element.matches(":disabled")) {
      return true;
    }
    return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true");
  }
  function isHiddenByStyles(styles) {
    return styles.visibility === "hidden" || styles.visibility === "collapse";
  }
  function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) {
    if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {
      return false;
    }
    if (typeof element.checkVisibility === "function") {
      return element.checkVisibility();
    }
    return styles.display !== "none" && styles.display !== "contents";
  }

  // node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs
  var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';
  function getParentElement(element) {
    const assignedSlot = element.assignedSlot;
    if (assignedSlot) {
      return assignedSlot;
    }
    if (element.parentElement) {
      return element.parentElement;
    }
    const rootNode = element.getRootNode();
    return isShadowRoot(rootNode) ? rootNode.host : null;
  }
  function getDetailsSummary(details) {
    for (const child of Array.from(details.children)) {
      if (getNodeName(child) === "summary") {
        return child;
      }
    }
    return null;
  }
  function isWithinOpenDetailsSummary(element, details) {
    const summary = getDetailsSummary(details);
    return !!summary && (element === summary || contains(summary, element));
  }
  function isFocusableCandidate(element) {
    const nodeName = element ? getNodeName(element) : "";
    return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== "summary" || element.parentElement != null && getNodeName(element.parentElement) === "details" && getDetailsSummary(element.parentElement) === element) && (nodeName !== "details" || getDetailsSummary(element) == null) && (nodeName !== "input" || element.type !== "hidden");
  }
  function isFocusableElement(element) {
    if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) {
      return false;
    }
    for (let current = element; current; current = getParentElement(current)) {
      const isAncestor = current !== element;
      const isSlot = getNodeName(current) === "slot";
      if (current.hasAttribute("inert")) {
        return false;
      }
      if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {
        return false;
      }
    }
    return true;
  }
  function isVisibleInTabbableTree(element, isAncestor) {
    const styles = getComputedStyle2(element);
    if (!isAncestor) {
      return isElementVisible(element, styles);
    }
    return styles.display !== "none";
  }
  function getTabIndex(element) {
    const tabIndex = element.tabIndex;
    if (tabIndex < 0) {
      const nodeName = getNodeName(element);
      if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) {
        return 0;
      }
    }
    return tabIndex;
  }
  function getNamedRadioInput(element) {
    if (getNodeName(element) !== "input") {
      return null;
    }
    const input = element;
    return input.type === "radio" && input.name !== "" ? input : null;
  }
  function isTabbableRadio(element, candidates) {
    const input = getNamedRadioInput(element);
    if (!input) {
      return true;
    }
    const checkedRadio = candidates.find((candidate) => {
      const radio = getNamedRadioInput(candidate);
      return radio?.name === input.name && radio.form === input.form && radio.checked;
    });
    if (checkedRadio) {
      return checkedRadio === input;
    }
    return candidates.find((candidate) => {
      const radio = getNamedRadioInput(candidate);
      return radio?.name === input.name && radio.form === input.form;
    }) === input;
  }
  function getComposedChildren(container) {
    if (isHTMLElement(container) && getNodeName(container) === "slot") {
      const assignedElements = container.assignedElements({
        flatten: true
      });
      if (assignedElements.length > 0) {
        return assignedElements;
      }
    }
    if (isHTMLElement(container) && container.shadowRoot) {
      return Array.from(container.shadowRoot.children);
    }
    return Array.from(container.children);
  }
  function appendCandidates(container, list) {
    getComposedChildren(container).forEach((child) => {
      if (isFocusableCandidate(child)) {
        list.push(child);
      }
      appendCandidates(child, list);
    });
  }
  function appendMatchingElements(container, selector2, list) {
    getComposedChildren(container).forEach((child) => {
      if (isHTMLElement(child) && child.matches(selector2)) {
        list.push(child);
      }
      appendMatchingElements(child, selector2, list);
    });
  }
  function isTabbable(element) {
    return isFocusableElement(element) && getTabIndex(element) >= 0;
  }
  function focusable(container) {
    const candidates = [];
    appendCandidates(container, candidates);
    return candidates.filter(isFocusableElement);
  }
  function tabbable(container) {
    const candidates = focusable(container);
    return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));
  }
  function getTabbableIn(container, dir) {
    const list = tabbable(container);
    const len = list.length;
    if (len === 0) {
      return void 0;
    }
    const active = activeElement(ownerDocument(container));
    const index2 = list.indexOf(active);
    const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir;
    return list[nextIndex];
  }
  function getNextTabbable(referenceElement) {
    return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;
  }
  function getPreviousTabbable(referenceElement) {
    return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;
  }
  function getTabbableNearElement(referenceElement, dir) {
    if (!referenceElement) {
      return null;
    }
    const list = tabbable(ownerDocument(referenceElement).body);
    const elementCount = list.length;
    if (elementCount === 0) {
      return null;
    }
    const index2 = list.indexOf(referenceElement);
    if (index2 === -1) {
      return null;
    }
    const nextIndex = (index2 + dir + elementCount) % elementCount;
    return list[nextIndex];
  }
  function getTabbableAfterElement(referenceElement) {
    return getTabbableNearElement(referenceElement, 1);
  }
  function getTabbableBeforeElement(referenceElement) {
    return getTabbableNearElement(referenceElement, -1);
  }
  function isOutsideEvent(event, container) {
    const containerElement = container || event.currentTarget;
    const relatedTarget = event.relatedTarget;
    return !relatedTarget || !contains(containerElement, relatedTarget);
  }
  function disableFocusInside(container) {
    const tabbableElements = tabbable(container);
    tabbableElements.forEach((element) => {
      element.dataset.tabindex = element.getAttribute("tabindex") || "";
      element.setAttribute("tabindex", "-1");
    });
  }
  function enableFocusInside(container) {
    const elements = [];
    appendMatchingElements(container, "[data-tabindex]", elements);
    elements.forEach((element) => {
      const tabindex = element.dataset.tabindex;
      delete element.dataset.tabindex;
      if (tabindex) {
        element.setAttribute("tabindex", tabindex);
      } else {
        element.removeAttribute("tabindex");
      }
    });
  }

  // node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs
  function getNodeChildren(nodes, id, onlyOpenChildren = true) {
    const directChildren = nodes.filter((node) => node.parentId === id);
    return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);
  }
  function getNodeAncestors(nodes, id) {
    let allAncestors = [];
    let currentParentId = nodes.find((node) => node.id === id)?.parentId;
    while (currentParentId) {
      const currentNode = nodes.find((node) => node.id === currentParentId);
      currentParentId = currentNode?.parentId;
      if (currentNode) {
        allAncestors = allAncestors.concat(currentNode);
      }
    }
    return allAncestors;
  }

  // node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs
  function createAttribute(name) {
    return `data-base-ui-${name}`;
  }

  // node_modules/@base-ui/react/floating-ui-react/utils/enqueueFocus.mjs
  var rafId = 0;
  function enqueueFocus(el, options = {}) {
    const {
      preventScroll = false,
      sync: sync2 = false,
      shouldFocus
    } = options;
    cancelAnimationFrame(rafId);
    function exec() {
      if (shouldFocus && !shouldFocus()) {
        return;
      }
      el?.focus({
        preventScroll
      });
    }
    if (sync2) {
      exec();
      return NOOP;
    }
    const currentRafId = requestAnimationFrame(exec);
    rafId = currentRafId;
    return () => {
      if (rafId === currentRafId) {
        cancelAnimationFrame(currentRafId);
        rafId = 0;
      }
    };
  }

  // node_modules/@base-ui/react/floating-ui-react/utils/markOthers.mjs
  var counters = {
    inert: /* @__PURE__ */ new WeakMap(),
    "aria-hidden": /* @__PURE__ */ new WeakMap()
  };
  var markerName = "data-base-ui-inert";
  var uncontrolledElementsSets = {
    inert: /* @__PURE__ */ new WeakSet(),
    "aria-hidden": /* @__PURE__ */ new WeakSet()
  };
  var markerCounterMap = /* @__PURE__ */ new WeakMap();
  var lockCount = 0;
  function getUncontrolledElementsSet(controlAttribute) {
    return uncontrolledElementsSets[controlAttribute];
  }
  function unwrapHost(node) {
    if (!node) {
      return null;
    }
    return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);
  }
  var correctElements = (parent, targets) => targets.map((target) => {
    if (parent.contains(target)) {
      return target;
    }
    const correctedTarget = unwrapHost(target);
    if (parent.contains(correctedTarget)) {
      return correctedTarget;
    }
    return null;
  }).filter((x2) => x2 != null);
  var buildKeepSet = (targets) => {
    const keep = /* @__PURE__ */ new Set();
    targets.forEach((target) => {
      let node = target;
      while (node && !keep.has(node)) {
        keep.add(node);
        node = node.parentNode;
      }
    });
    return keep;
  };
  var collectOutsideElements = (root, keepElements, stopElements) => {
    const outside = [];
    const walk = (parent) => {
      if (!parent || stopElements.has(parent)) {
        return;
      }
      Array.from(parent.children).forEach((node) => {
        if (getNodeName(node) === "script") {
          return;
        }
        if (keepElements.has(node)) {
          walk(node);
        } else {
          outside.push(node);
        }
      });
    };
    walk(root);
    return outside;
  };
  function applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert, {
    mark = true
  }) {
    let controlAttribute = null;
    if (inert) {
      controlAttribute = "inert";
    } else if (ariaHidden) {
      controlAttribute = "aria-hidden";
    }
    let counterMap = null;
    let uncontrolledElementsSet = null;
    const avoidElements = correctElements(body, uncorrectedAvoidElements);
    const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)) : [];
    const hiddenElements = [];
    const markedElements = [];
    if (controlAttribute) {
      const map = counters[controlAttribute];
      const currentUncontrolledElementsSet = getUncontrolledElementsSet(controlAttribute);
      uncontrolledElementsSet = currentUncontrolledElementsSet;
      counterMap = map;
      const ariaLiveElements = correctElements(body, Array.from(body.querySelectorAll("[aria-live]")));
      const controlElements = avoidElements.concat(ariaLiveElements);
      const controlTargets = collectOutsideElements(body, buildKeepSet(controlElements), new Set(controlElements));
      controlTargets.forEach((node) => {
        const attr2 = node.getAttribute(controlAttribute);
        const alreadyHidden = attr2 !== null && attr2 !== "false";
        const counterValue = (map.get(node) || 0) + 1;
        map.set(node, counterValue);
        hiddenElements.push(node);
        if (counterValue === 1 && alreadyHidden) {
          currentUncontrolledElementsSet.add(node);
        }
        if (!alreadyHidden) {
          node.setAttribute(controlAttribute, controlAttribute === "inert" ? "" : "true");
        }
      });
    }
    if (mark) {
      markerTargets.forEach((node) => {
        const markerValue = (markerCounterMap.get(node) || 0) + 1;
        markerCounterMap.set(node, markerValue);
        markedElements.push(node);
        if (markerValue === 1) {
          node.setAttribute(markerName, "");
        }
      });
    }
    lockCount += 1;
    return () => {
      if (counterMap) {
        hiddenElements.forEach((element) => {
          const currentCounterValue = counterMap.get(element) || 0;
          const counterValue = currentCounterValue - 1;
          counterMap.set(element, counterValue);
          if (!counterValue) {
            if (!uncontrolledElementsSet?.has(element) && controlAttribute) {
              element.removeAttribute(controlAttribute);
            }
            uncontrolledElementsSet?.delete(element);
          }
        });
      }
      if (mark) {
        markedElements.forEach((element) => {
          const markerValue = (markerCounterMap.get(element) || 0) - 1;
          markerCounterMap.set(element, markerValue);
          if (!markerValue) {
            element.removeAttribute(markerName);
          }
        });
      }
      lockCount -= 1;
      if (!lockCount) {
        counters.inert = /* @__PURE__ */ new WeakMap();
        counters["aria-hidden"] = /* @__PURE__ */ new WeakMap();
        uncontrolledElementsSets.inert = /* @__PURE__ */ new WeakSet();
        uncontrolledElementsSets["aria-hidden"] = /* @__PURE__ */ new WeakSet();
        markerCounterMap = /* @__PURE__ */ new WeakMap();
      }
    };
  }
  function markOthers(avoidElements, options = {}) {
    const {
      ariaHidden = false,
      inert = false,
      mark = true
    } = options;
    const body = ownerDocument(avoidElements[0]).body;
    return applyAttributeToOthers(avoidElements, body, ariaHidden, inert, {
      mark
    });
  }

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
  var React20 = __toESM(require_react(), 1);
  var ReactDOM2 = __toESM(require_react_dom(), 1);

  // node_modules/@base-ui/react/internals/constants.mjs
  var TYPEAHEAD_RESET_MS = 500;
  var PATIENT_CLICK_THRESHOLD = 500;
  var DISABLED_TRANSITIONS_STYLE = {
    style: {
      transition: "none"
    }
  };
  var CLICK_TRIGGER_IDENTIFIER = "data-base-ui-click-trigger";
  var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore";
  var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore";
  var BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;
  var LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;
  var DROPDOWN_COLLISION_AVOIDANCE = {
    fallbackAxisSide: "none"
  };
  var POPUP_COLLISION_AVOIDANCE = {
    fallbackAxisSide: "end"
  };
  var ownerVisuallyHidden = {
    clipPath: "inset(50%)",
    position: "fixed",
    top: 0,
    left: 0
  };

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
  var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
  var PortalContext = /* @__PURE__ */ React20.createContext(null);
  if (true) PortalContext.displayName = "PortalContext";
  var usePortalContext = () => React20.useContext(PortalContext);
  var attr = createAttribute("portal");
  function useFloatingPortalNode(props = {}) {
    const {
      ref,
      container: containerProp,
      componentProps = EMPTY_OBJECT,
      elementProps
    } = props;
    const uniqueId = useId();
    const portalContext = usePortalContext();
    const parentPortalNode = portalContext?.portalNode;
    const [containerElement, setContainerElement] = React20.useState(null);
    const [portalNode, setPortalNode] = React20.useState(null);
    const setPortalNodeRef = useStableCallback((node) => {
      if (node !== null) {
        setPortalNode(node);
      }
    });
    const containerRef = React20.useRef(null);
    useIsoLayoutEffect(() => {
      if (containerProp === null) {
        if (containerRef.current) {
          containerRef.current = null;
          setPortalNode(null);
          setContainerElement(null);
        }
        return;
      }
      const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
      if (resolvedContainer == null) {
        if (containerRef.current) {
          containerRef.current = null;
          setPortalNode(null);
          setContainerElement(null);
        }
        return;
      }
      if (containerRef.current !== resolvedContainer) {
        containerRef.current = resolvedContainer;
        setPortalNode(null);
        setContainerElement(resolvedContainer);
      }
    }, [containerProp, parentPortalNode]);
    const portalElement = useRenderElement("div", componentProps, {
      ref: [ref, setPortalNodeRef],
      props: [{
        id: uniqueId,
        [attr]: ""
      }, elementProps]
    });
    const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null;
    return {
      node: portalNode,
      // `id` and `render` props can override or remove the generated ID. Use the exact
      // rendered value so `aria-owns` never points at an ID absent from the DOM.
      nodeId: /* @__PURE__ */ React20.isValidElement(portalElement) ? portalElement.props.id : void 0,
      subtree: portalSubtree
    };
  }
  var FloatingPortal = /* @__PURE__ */ React20.forwardRef(function FloatingPortal2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      children,
      container,
      portalOwnerRole,
      ...elementProps
    } = componentProps;
    const {
      node: portalNode,
      nodeId: portalNodeId,
      subtree: portalSubtree
    } = useFloatingPortalNode({
      container,
      ref: forwardedRef,
      componentProps,
      elementProps
    });
    const beforeOutsideRef = React20.useRef(null);
    const afterOutsideRef = React20.useRef(null);
    const beforeInsideRef = React20.useRef(null);
    const afterInsideRef = React20.useRef(null);
    const [focusManagerState, setFocusManagerState] = React20.useState(null);
    const focusInsideDisabledRef = React20.useRef(false);
    const modal = focusManagerState?.modal;
    const open2 = focusManagerState?.open;
    const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;
    React20.useEffect(() => {
      if (!portalNode || modal) {
        return void 0;
      }
      function onFocus(event) {
        if (portalNode && event.relatedTarget && isOutsideEvent(event)) {
          if (event.type === "focusin") {
            if (focusInsideDisabledRef.current) {
              enableFocusInside(portalNode);
              focusInsideDisabledRef.current = false;
            }
          } else {
            disableFocusInside(portalNode);
            focusInsideDisabledRef.current = true;
          }
        }
      }
      return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true));
    }, [portalNode, modal]);
    useIsoLayoutEffect(() => {
      if (!portalNode || open2 !== true || !focusInsideDisabledRef.current) {
        return;
      }
      enableFocusInside(portalNode);
      focusInsideDisabledRef.current = false;
    }, [open2, portalNode]);
    const portalContextValue = React20.useMemo(() => ({
      beforeOutsideRef,
      afterOutsideRef,
      beforeInsideRef,
      afterInsideRef,
      portalNode,
      setFocusManagerState
    }), [portalNode]);
    return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(React20.Fragment, {
      children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(PortalContext.Provider, {
        value: portalContextValue,
        children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FocusGuard, {
          "data-type": "outside",
          ref: beforeOutsideRef,
          onFocus: (event) => {
            if (isOutsideEvent(event, portalNode)) {
              beforeInsideRef.current?.focus();
            } else {
              const domReference = focusManagerState ? focusManagerState.domReference : null;
              const prevTabbable = getPreviousTabbable(domReference);
              prevTabbable?.focus();
            }
          }
        }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", {
          role: portalOwnerRole,
          "aria-owns": portalNodeId,
          style: ownerVisuallyHidden
        }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FocusGuard, {
          "data-type": "outside",
          ref: afterOutsideRef,
          onFocus: (event) => {
            if (isOutsideEvent(event, portalNode)) {
              afterInsideRef.current?.focus();
            } else {
              const domReference = focusManagerState ? focusManagerState.domReference : null;
              const nextTabbable = getNextTabbable(domReference);
              nextTabbable?.focus();
              if (focusManagerState?.closeOnFocusOut) {
                focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent));
              }
            }
          }
        })]
      })]
    });
  });
  if (true) FloatingPortal.displayName = "FloatingPortal";

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
  var React21 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs
  function createEventEmitter() {
    const map = /* @__PURE__ */ new Map();
    return {
      emit(event, data) {
        map.get(event)?.forEach((listener) => listener(data));
      },
      on(event, listener) {
        if (!map.has(event)) {
          map.set(event, /* @__PURE__ */ new Set());
        }
        map.get(event).add(listener);
      },
      off(event, listener) {
        map.get(event)?.delete(listener);
      }
    };
  }

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingTreeStore.mjs
  var FloatingTreeStore = class {
    nodesRef = {
      current: []
    };
    events = createEventEmitter();
    addNode(node) {
      this.nodesRef.current.push(node);
    }
    removeNode(node) {
      const index2 = this.nodesRef.current.findIndex((n) => n === node);
      if (index2 !== -1) {
        this.nodesRef.current.splice(index2, 1);
      }
    }
  };

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
  var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
  var FloatingNodeContext = /* @__PURE__ */ React21.createContext(null);
  if (true) FloatingNodeContext.displayName = "FloatingNodeContext";
  var FloatingTreeContext = /* @__PURE__ */ React21.createContext(null);
  if (true) FloatingTreeContext.displayName = "FloatingTreeContext";
  var useFloatingParentNodeId = () => React21.useContext(FloatingNodeContext)?.id || null;
  var useFloatingTree = (externalTree) => {
    const contextTree = React21.useContext(FloatingTreeContext);
    return externalTree ?? contextTree;
  };
  function useFloatingNodeId(externalTree) {
    const id = useId();
    const tree = useFloatingTree(externalTree);
    const parentId = useFloatingParentNodeId();
    useIsoLayoutEffect(() => {
      if (!id) {
        return void 0;
      }
      const node = {
        id,
        parentId
      };
      tree?.addNode(node);
      return () => {
        tree?.removeNode(node);
      };
    }, [tree, id, parentId]);
    return id;
  }
  function FloatingNode(props) {
    const {
      children,
      id
    } = props;
    const parentId = useFloatingParentNodeId();
    return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FloatingNodeContext.Provider, {
      value: React21.useMemo(() => ({
        id,
        parentId
      }), [id, parentId]),
      children
    });
  }
  function FloatingTree(props) {
    const {
      children,
      externalTree
    } = props;
    const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;
    return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FloatingTreeContext.Provider, {
      value: tree,
      children
    });
  }

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs
  var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
  function getEventType(event, lastInteractionType) {
    const win = getWindow(getTarget(event));
    if (event instanceof win.KeyboardEvent) {
      return "keyboard";
    }
    if (event instanceof win.FocusEvent) {
      return lastInteractionType || "keyboard";
    }
    if ("pointerType" in event) {
      return event.pointerType || "keyboard";
    }
    if ("touches" in event) {
      return "touch";
    }
    if (event instanceof win.MouseEvent) {
      return lastInteractionType || (event.detail === 0 ? "keyboard" : "mouse");
    }
    return "";
  }
  var LIST_LIMIT = 20;
  var previouslyFocusedElements = [];
  function clearDisconnectedPreviouslyFocusedElements() {
    previouslyFocusedElements = previouslyFocusedElements.filter((entry) => {
      return entry.deref()?.isConnected;
    });
  }
  function addPreviouslyFocusedElement(element) {
    clearDisconnectedPreviouslyFocusedElements();
    if (element && getNodeName(element) !== "body") {
      previouslyFocusedElements.push(new WeakRef(element));
      if (previouslyFocusedElements.length > LIST_LIMIT) {
        previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);
      }
    }
  }
  function getPreviouslyFocusedElement() {
    clearDisconnectedPreviouslyFocusedElements();
    return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();
  }
  function getFirstTabbableElement(container) {
    if (!container) {
      return null;
    }
    if (isTabbable(container)) {
      return container;
    }
    return tabbable(container)[0] || container;
  }
  function handleTabIndex(floatingFocusElement) {
    if (floatingFocusElement.hasAttribute("tabindex") && !floatingFocusElement.hasAttribute("data-tabindex")) {
      return;
    }
    if (!floatingFocusElement.getAttribute("role")?.includes("dialog")) {
      return;
    }
    const focusableElements = focusable(floatingFocusElement);
    const tabbableContent = focusableElements.filter((element) => {
      const dataTabIndex = element.getAttribute("data-tabindex") || "";
      return isTabbable(element) || element.hasAttribute("data-tabindex") && !dataTabIndex.startsWith("-");
    });
    const tabIndex = floatingFocusElement.getAttribute("tabindex");
    if (tabbableContent.length === 0) {
      if (tabIndex !== "0") {
        floatingFocusElement.setAttribute("tabindex", "0");
        floatingFocusElement.setAttribute("data-tabindex", "0");
      }
    } else if (tabIndex !== "-1" || floatingFocusElement.hasAttribute("data-tabindex") && floatingFocusElement.getAttribute("data-tabindex") !== "-1") {
      floatingFocusElement.setAttribute("tabindex", "-1");
      floatingFocusElement.setAttribute("data-tabindex", "-1");
    }
  }
  function FloatingFocusManager(props) {
    const {
      context,
      children,
      disabled: disabled2 = false,
      initialFocus = true,
      returnFocus = true,
      restoreFocus = false,
      modal = true,
      closeOnFocusOut = true,
      openInteractionType = "",
      nextFocusableElement,
      previousFocusableElement,
      beforeContentFocusGuardRef,
      externalTree,
      getInsideElements
    } = props;
    const store = "rootStore" in context ? context.rootStore : context;
    const open2 = store.useState("open");
    const domReference = store.useState("domReferenceElement");
    const floating = store.useState("floatingElement");
    const {
      events,
      dataRef
    } = store.context;
    const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);
    const ignoreInitialFocus = initialFocus === false;
    const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;
    const initialFocusRef = useValueAsRef(initialFocus);
    const returnFocusRef = useValueAsRef(returnFocus);
    const openInteractionTypeRef = useValueAsRef(openInteractionType);
    const openRef = useValueAsRef(open2);
    const tree = useFloatingTree(externalTree);
    const portalContext = usePortalContext();
    const preventReturnFocusRef = React22.useRef(false);
    const isPointerDownRef = React22.useRef(false);
    const pointerDownOutsideRef = React22.useRef(false);
    const lastFocusedTabbableRef = React22.useRef(null);
    const closeTypeRef = React22.useRef("");
    const lastInteractionTypeRef = React22.useRef("");
    const beforeGuardRef = React22.useRef(null);
    const afterGuardRef = React22.useRef(null);
    const mergedBeforeGuardRef = useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);
    const mergedAfterGuardRef = useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);
    const blurTimeout = useTimeout();
    const pointerDownTimeout = useTimeout();
    const restoreFocusFrame = useAnimationFrame();
    const isInsidePortal = portalContext != null;
    const floatingFocusElement = getFloatingFocusElement(floating);
    const getTabbableContent = useStableCallback((container = floatingFocusElement) => {
      return container ? tabbable(container) : [];
    });
    const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter((element) => element != null) ?? []);
    React22.useEffect(() => {
      if (disabled2 || !modal) {
        return void 0;
      }
      function onKeyDown(event) {
        if (event.key === "Tab") {
          if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {
            stopEvent(event);
          }
        }
      }
      const doc = ownerDocument(floatingFocusElement);
      return addEventListener(doc, "keydown", onKeyDown);
    }, [disabled2, floatingFocusElement, modal, isUntrappedTypeableCombobox, getTabbableContent]);
    React22.useEffect(() => {
      if (disabled2 || !open2) {
        return void 0;
      }
      const doc = ownerDocument(floatingFocusElement);
      function clearPointerDownOutside() {
        pointerDownOutsideRef.current = false;
      }
      function onPointerDown(event) {
        const target = getTarget(event);
        const insideElements = getResolvedInsideElements();
        const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target) || insideElements.some((element) => element === target || contains(element, target));
        pointerDownOutsideRef.current = !pointerTargetInside;
        lastInteractionTypeRef.current = event.pointerType || "keyboard";
        if (target?.closest(`[${CLICK_TRIGGER_IDENTIFIER}]`)) {
          isPointerDownRef.current = true;
          pointerDownTimeout.start(0, () => {
            isPointerDownRef.current = false;
          });
        }
      }
      function onKeyDown() {
        lastInteractionTypeRef.current = "keyboard";
      }
      return mergeCleanups(
        addEventListener(doc, "pointerdown", onPointerDown, true),
        addEventListener(doc, "pointerup", clearPointerDownOutside, true),
        addEventListener(doc, "pointercancel", clearPointerDownOutside, true),
        addEventListener(doc, "keydown", onKeyDown, true),
        // Avoid a stale `true` leaking into the next open (e.g. keep-mounted popups)
        // if the popup dismissed between pointerdown and pointerup.
        clearPointerDownOutside
      );
    }, [disabled2, floating, domReference, floatingFocusElement, open2, portalContext, pointerDownTimeout, getResolvedInsideElements]);
    React22.useEffect(() => {
      if (disabled2 || !closeOnFocusOut) {
        return void 0;
      }
      const doc = ownerDocument(floatingFocusElement);
      function handlePointerDown() {
        isPointerDownRef.current = true;
        pointerDownTimeout.start(0, () => {
          isPointerDownRef.current = false;
        });
      }
      function handleFocusIn(event) {
        const target = getTarget(event);
        if (isTabbable(target)) {
          lastFocusedTabbableRef.current = target;
        }
      }
      function handleFocusOutside(event) {
        const relatedTarget = event.relatedTarget;
        const currentTarget = event.currentTarget;
        const target = getTarget(event);
        if (modal && relatedTarget == null && target != null && contains(floating, target)) {
          addPreviouslyFocusedElement(target);
        }
        queueMicrotask(() => {
          const nodeId = getNodeId();
          const triggers = store.context.triggerElements;
          const insideElements = getResolvedInsideElements();
          const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute("focus-guard")) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement)].includes(relatedTarget);
          const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some((element) => element === relatedTarget || contains(element, relatedTarget)) || triggers.hasMatchingElement((trigger) => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find((node) => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find((node) => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));
          if (currentTarget === domReference && floatingFocusElement) {
            handleTabIndex(floatingFocusElement);
          }
          if (restoreFocus && currentTarget !== domReference && !isElementVisible(target) && activeElement(doc) === doc.body) {
            if (isHTMLElement(floatingFocusElement)) {
              floatingFocusElement.focus();
              if (restoreFocus === "popup") {
                restoreFocusFrame.request(() => {
                  floatingFocusElement.focus();
                });
                return;
              }
            }
            const tabbableContent = getTabbableContent();
            const prevTabbable = lastFocusedTabbableRef.current;
            const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;
            if (isHTMLElement(nodeToFocus)) {
              nodeToFocus.focus();
            }
          }
          if (dataRef.current.insideReactTree) {
            dataRef.current.insideReactTree = false;
            return;
          }
          if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
          // For an "untrapped" typeable combobox (input role=combobox with
          // initialFocus=false), re-opening the popup and tabbing out should still close it even
          // when the previously focused element (e.g. the next tabbable outside the popup) is
          // focused again. Otherwise, the popup remains open on the second Tab sequence:
          // click input -> Tab (closes) -> click input -> Tab.
          // Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.
          (isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {
            preventReturnFocusRef.current = true;
            store.setOpen(false, createChangeEventDetails(reason_parts_exports.focusOut, event));
          }
        });
      }
      function markInsideReactTree() {
        if (pointerDownOutsideRef.current) {
          return;
        }
        dataRef.current.insideReactTree = true;
        blurTimeout.start(0, () => {
          dataRef.current.insideReactTree = false;
        });
      }
      const domReferenceElement = isHTMLElement(domReference) ? domReference : null;
      if (!floating && !domReferenceElement) {
        return void 0;
      }
      return mergeCleanups(domReferenceElement && addEventListener(domReferenceElement, "focusout", handleFocusOutside), domReferenceElement && addEventListener(domReferenceElement, "pointerdown", handlePointerDown), floating && addEventListener(floating, "focusin", handleFocusIn), floating && addEventListener(floating, "focusout", handleFocusOutside), floating && portalContext && addEventListener(floating, "focusout", markInsideReactTree, true));
    }, [disabled2, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);
    React22.useEffect(() => {
      if (disabled2 || !floating || !open2) {
        return void 0;
      }
      const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute("portal")}]`) || []);
      const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];
      const rootAncestorComboboxDomReference = ancestors.find((node) => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;
      const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];
      const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter((x2) => x2 != null);
      const ariaHiddenCleanup = markOthers(insideElements, {
        ariaHidden: modal || isUntrappedTypeableCombobox,
        mark: false
      });
      const markerInsideElements = [floating, ...portalNodes].filter((x2) => x2 != null);
      const markerCleanup = markOthers(markerInsideElements);
      return () => {
        markerCleanup();
        ariaHiddenCleanup();
      };
    }, [open2, disabled2, domReference, floating, modal, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);
    useIsoLayoutEffect(() => {
      if (!open2 || disabled2 || !isHTMLElement(floatingFocusElement)) {
        return;
      }
      closeTypeRef.current = "";
      lastInteractionTypeRef.current = "";
      const doc = ownerDocument(floatingFocusElement);
      const previouslyFocusedElement = activeElement(doc);
      queueMicrotask(() => {
        const initialFocusValueOrFn = initialFocusRef.current;
        const resolvedInitialFocus = typeof initialFocusValueOrFn === "function" ? initialFocusValueOrFn(openInteractionTypeRef.current || "") : initialFocusValueOrFn;
        if (resolvedInitialFocus === void 0 || resolvedInitialFocus === false) {
          return;
        }
        const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);
        if (focusAlreadyInsideFloatingEl) {
          return;
        }
        let focusableElements = null;
        const getDefaultFocusElement = () => {
          if (focusableElements == null) {
            focusableElements = getTabbableContent(floatingFocusElement);
          }
          return focusableElements[0] || floatingFocusElement;
        };
        let elToFocus;
        if (resolvedInitialFocus === true || resolvedInitialFocus === null) {
          elToFocus = getDefaultFocusElement();
        } else {
          elToFocus = resolveRef(resolvedInitialFocus);
        }
        elToFocus = elToFocus || getDefaultFocusElement();
        const hadFocusInside = contains(floatingFocusElement, activeElement(doc));
        void enqueueFocus(elToFocus, {
          preventScroll: elToFocus === floatingFocusElement,
          shouldFocus() {
            if (!openRef.current) {
              return false;
            }
            if (hadFocusInside) {
              return true;
            }
            const currentActiveElement = activeElement(doc);
            const focusMovedInside = currentActiveElement !== elToFocus && contains(floatingFocusElement, currentActiveElement);
            return !focusMovedInside;
          }
        });
      });
    }, [disabled2, open2, floatingFocusElement, getTabbableContent, initialFocusRef, openInteractionTypeRef, openRef]);
    useIsoLayoutEffect(() => {
      if (disabled2 || !floatingFocusElement) {
        return void 0;
      }
      const doc = ownerDocument(floatingFocusElement);
      const elementFocusedBeforeOpen = activeElement(doc);
      const preferPreviousFocus = openInteractionTypeRef.current == null;
      addPreviouslyFocusedElement(elementFocusedBeforeOpen);
      function onOpenChangeLocal(details) {
        if (!details.open) {
          closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);
        }
        if (details.reason === reason_parts_exports.triggerHover && details.nativeEvent.type === "mouseleave") {
          preventReturnFocusRef.current = true;
        }
        if (details.reason !== reason_parts_exports.outsidePress) {
          return;
        }
        if (details.nested) {
          preventReturnFocusRef.current = false;
        } else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) {
          preventReturnFocusRef.current = false;
        } else {
          let isPreventScrollSupported = false;
          ownerDocument(floatingFocusElement).createElement("div").focus({
            get preventScroll() {
              isPreventScrollSupported = true;
              return false;
            }
          });
          if (isPreventScrollSupported) {
            preventReturnFocusRef.current = false;
          } else {
            preventReturnFocusRef.current = true;
          }
        }
      }
      events.on("openchange", onOpenChangeLocal);
      function getReturnElement(closeType) {
        const returnFocusValueOrFn = returnFocusRef.current;
        let resolvedReturnFocusValue = typeof returnFocusValueOrFn === "function" ? returnFocusValueOrFn(closeType) : returnFocusValueOrFn;
        if (resolvedReturnFocusValue === void 0 || resolvedReturnFocusValue === false) {
          return null;
        }
        if (resolvedReturnFocusValue === null) {
          resolvedReturnFocusValue = true;
        }
        const referenceReturnElement = domReference?.isConnected ? domReference : null;
        const previousReturnElement = elementFocusedBeforeOpen?.isConnected && getNodeName(elementFocusedBeforeOpen) !== "body" ? elementFocusedBeforeOpen : null;
        let defaultReturnElement = preferPreviousFocus ? previousReturnElement || referenceReturnElement : referenceReturnElement || previousReturnElement;
        if (!defaultReturnElement) {
          defaultReturnElement = getPreviouslyFocusedElement() || null;
        }
        if (typeof resolvedReturnFocusValue === "boolean") {
          return defaultReturnElement;
        }
        return resolveRef(resolvedReturnFocusValue) || defaultReturnElement || null;
      }
      return () => {
        events.off("openchange", onOpenChangeLocal);
        const activeEl = activeElement(doc);
        const insideElements = getResolvedInsideElements();
        const isFocusInsideFloatingTree = contains(floating, activeEl) || insideElements.some((element) => element === activeEl || contains(element, activeEl)) || tree && getNodeChildren(tree.nodesRef.current, getNodeId(), false).some((node) => contains(node.context?.elements.floating, activeEl));
        const returnFocusValueOrFn = returnFocusRef.current;
        const closeType = closeTypeRef.current;
        const returnElement = getReturnElement(closeType);
        queueMicrotask(() => {
          const tabbableReturnElement = getFirstTabbableElement(returnElement);
          const hasExplicitReturnFocus = typeof returnFocusValueOrFn !== "boolean";
          if (returnFocusValueOrFn && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && // If the focus moved somewhere else after mount, avoid returning focus
          // since it likely entered a different element which should be
          // respected: https://github.com/floating-ui/floating-ui/issues/2607
          (!hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {
            const focusOptions = {
              preventScroll: true
            };
            if (closeType === "keyboard") {
              focusOptions.focusVisible = true;
            }
            tabbableReturnElement.focus(focusOptions);
          }
          preventReturnFocusRef.current = false;
        });
      };
    }, [disabled2, floating, floatingFocusElement, returnFocusRef, openInteractionTypeRef, events, tree, domReference, getNodeId, getResolvedInsideElements]);
    useIsoLayoutEffect(() => {
      if (!parts_exports.engine.webkit || open2 || !floating) {
        return;
      }
      const activeEl = activeElement(ownerDocument(floating));
      if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {
        return;
      }
      if (contains(floating, activeEl)) {
        activeEl.blur();
      }
    }, [open2, floating]);
    useIsoLayoutEffect(() => {
      if (disabled2 || !portalContext) {
        return void 0;
      }
      portalContext.setFocusManagerState({
        modal,
        closeOnFocusOut,
        open: open2,
        onOpenChange: store.setOpen,
        domReference
      });
      return () => {
        portalContext.setFocusManagerState(null);
      };
    }, [disabled2, portalContext, modal, open2, store, closeOnFocusOut, domReference]);
    useIsoLayoutEffect(() => {
      if (disabled2 || !floatingFocusElement) {
        return void 0;
      }
      handleTabIndex(floatingFocusElement);
      return () => {
        queueMicrotask(clearDisconnectedPreviouslyFocusedElements);
      };
    }, [disabled2, floatingFocusElement]);
    const shouldRenderGuards = !disabled2 && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);
    return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(React22.Fragment, {
      children: [shouldRenderGuards && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FocusGuard, {
        "data-type": "inside",
        ref: mergedBeforeGuardRef,
        onFocus: (event) => {
          if (modal) {
            const els = getTabbableContent();
            void enqueueFocus(els[els.length - 1]);
          } else if (portalContext?.portalNode) {
            preventReturnFocusRef.current = false;
            if (isOutsideEvent(event, portalContext.portalNode)) {
              const nextTabbable = getNextTabbable(domReference);
              nextTabbable?.focus();
            } else {
              resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();
            }
          }
        }
      }), children, shouldRenderGuards && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FocusGuard, {
        "data-type": "inside",
        ref: mergedAfterGuardRef,
        onFocus: (event) => {
          if (modal) {
            void enqueueFocus(getTabbableContent()[0]);
          } else if (portalContext?.portalNode) {
            if (closeOnFocusOut) {
              preventReturnFocusRef.current = true;
            }
            if (isOutsideEvent(event, portalContext.portalNode)) {
              const prevTabbable = getPreviousTabbable(domReference);
              prevTabbable?.focus();
            } else {
              resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();
            }
          }
        }
      })]
    });
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs
  var React23 = __toESM(require_react(), 1);
  function useClick(context, props = {}) {
    const {
      enabled = true,
      event: eventOption = "click",
      toggle = true,
      ignoreMouse = false,
      stickIfOpen = true,
      touchOpenDelay = 0,
      reason = reason_parts_exports.triggerPress
    } = props;
    const store = "rootStore" in context ? context.rootStore : context;
    const dataRef = store.context.dataRef;
    const pointerTypeRef = React23.useRef(void 0);
    const frame = useAnimationFrame();
    const touchOpenTimeout = useTimeout();
    const reference = React23.useMemo(() => {
      function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {
        const details = createChangeEventDetails(reason, nativeEvent, target);
        if (nextOpen && pointerType === "touch" && touchOpenDelay > 0) {
          touchOpenTimeout.start(touchOpenDelay, () => {
            store.setOpen(true, details);
          });
        } else {
          store.setOpen(nextOpen, details);
        }
      }
      function getNextOpen(open2, currentTarget, isClickLikeOpenEvent2) {
        const openEvent = dataRef.current.openEvent;
        const hasClickedOnInactiveTrigger = store.select("domReferenceElement") !== currentTarget;
        if (open2 && hasClickedOnInactiveTrigger) {
          return true;
        }
        if (!open2) {
          return true;
        }
        if (!toggle) {
          return true;
        }
        if (openEvent && stickIfOpen) {
          return !isClickLikeOpenEvent2(openEvent.type);
        }
        return false;
      }
      return {
        onPointerDown(event) {
          pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? "virtual" : event.pointerType;
        },
        onMouseDown(event) {
          const pointerType = pointerTypeRef.current;
          const nativeEvent = event.nativeEvent;
          const open2 = store.select("open");
          if (event.button !== 0 || eventOption === "click" || isMouseLikePointerType(pointerType, true) && ignoreMouse) {
            return;
          }
          const nextOpen = getNextOpen(open2, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown");
          const target = getTarget(nativeEvent);
          if (isTypeableElement(target)) {
            setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType);
            return;
          }
          const eventCurrentTarget = event.currentTarget;
          frame.request(() => {
            setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);
          });
        },
        onClick(event) {
          if (eventOption === "mousedown-only") {
            return;
          }
          const pointerType = pointerTypeRef.current;
          if (eventOption === "mousedown" && pointerType) {
            pointerTypeRef.current = void 0;
            return;
          }
          if (isMouseLikePointerType(pointerType, true) && ignoreMouse) {
            return;
          }
          const open2 = store.select("open");
          const nextOpen = getNextOpen(open2, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown" || openEventType === "keydown" || openEventType === "keyup");
          setOpenWithTouchDelay(nextOpen, event.nativeEvent, event.currentTarget, pointerType);
        },
        onKeyDown() {
          pointerTypeRef.current = void 0;
        }
      };
    }, [dataRef, eventOption, ignoreMouse, reason, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay]);
    return React23.useMemo(() => enabled ? {
      reference
    } : EMPTY_OBJECT, [enabled, reference]);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs
  var React24 = __toESM(require_react(), 1);
  function createVirtualElement(domElement, data) {
    let offsetX = null;
    let offsetY = null;
    let isAutoUpdateEvent = false;
    return {
      contextElement: domElement || void 0,
      getBoundingClientRect() {
        const domRect = domElement?.getBoundingClientRect() || {
          width: 0,
          height: 0,
          x: 0,
          y: 0
        };
        const isXAxis = data.axis === "x" || data.axis === "both";
        const isYAxis = data.axis === "y" || data.axis === "both";
        const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch";
        let width = domRect.width;
        let height = domRect.height;
        let x2 = domRect.x;
        let y2 = domRect.y;
        if (offsetX == null && data.x && isXAxis) {
          offsetX = domRect.x - data.x;
        }
        if (offsetY == null && data.y && isYAxis) {
          offsetY = domRect.y - data.y;
        }
        x2 -= offsetX || 0;
        y2 -= offsetY || 0;
        width = 0;
        height = 0;
        if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {
          width = data.axis === "y" ? domRect.width : 0;
          height = data.axis === "x" ? domRect.height : 0;
          x2 = isXAxis && data.x != null ? data.x : x2;
          y2 = isYAxis && data.y != null ? data.y : y2;
        } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {
          height = data.axis === "x" ? domRect.height : height;
          width = data.axis === "y" ? domRect.width : width;
        }
        isAutoUpdateEvent = true;
        return {
          width,
          height,
          x: x2,
          y: y2,
          top: y2,
          right: x2 + width,
          bottom: y2 + height,
          left: x2
        };
      }
    };
  }
  function isMouseBasedEvent(event) {
    return event != null && event.clientX != null;
  }
  function useClientPoint(context, props = {}) {
    const {
      enabled = true,
      axis = "both"
    } = props;
    const store = "rootStore" in context ? context.rootStore : context;
    const open2 = store.useState("open");
    const floating = store.useState("floatingElement");
    const domReference = store.useState("domReferenceElement");
    const dataRef = store.context.dataRef;
    const initialRef = React24.useRef(false);
    const cleanupListenerRef = React24.useRef(null);
    const [pointerType, setPointerType] = React24.useState();
    const [reactive, setReactive] = React24.useState([]);
    const resetReference = useStableCallback((reference2) => {
      store.set("positionReference", reference2);
    });
    const setReference = useStableCallback((newX, newY, referenceElement) => {
      if (initialRef.current) {
        return;
      }
      if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {
        return;
      }
      store.set("positionReference", createVirtualElement(referenceElement ?? domReference, {
        x: newX,
        y: newY,
        axis,
        dataRef,
        pointerType
      }));
    });
    const handleReferenceEnterOrMove = useStableCallback((event) => {
      if (!open2) {
        setReference(event.clientX, event.clientY, event.currentTarget);
      } else if (!cleanupListenerRef.current) {
        setReference(event.clientX, event.clientY, event.currentTarget);
        setReactive([]);
      }
    });
    const openCheck = isMouseLikePointerType(pointerType) ? floating : open2;
    React24.useEffect(() => {
      if (!enabled) {
        resetReference(domReference);
        return void 0;
      }
      if (!openCheck) {
        return void 0;
      }
      function cleanupListener() {
        cleanupListenerRef.current?.();
        cleanupListenerRef.current = null;
      }
      const win = getWindow(floating);
      function handleMouseMove(event) {
        const target = getTarget(event);
        if (!contains(floating, target)) {
          setReference(event.clientX, event.clientY);
        } else {
          cleanupListener();
        }
      }
      if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {
        cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove);
      } else {
        resetReference(domReference);
      }
      return cleanupListener;
    }, [openCheck, enabled, floating, dataRef, domReference, store, setReference, resetReference, reactive]);
    React24.useEffect(() => () => {
      store.set("positionReference", null);
    }, [store]);
    React24.useEffect(() => {
      if (enabled && !floating) {
        initialRef.current = false;
      }
    }, [enabled, floating]);
    React24.useEffect(() => {
      if (!enabled && open2) {
        initialRef.current = true;
      }
    }, [enabled, open2]);
    const reference = React24.useMemo(() => {
      function setPointerTypeRef(event) {
        setPointerType(event.pointerType);
      }
      return {
        onPointerDown: setPointerTypeRef,
        onPointerEnter: setPointerTypeRef,
        onMouseMove: handleReferenceEnterOrMove,
        onMouseEnter: handleReferenceEnterOrMove
      };
    }, [handleReferenceEnterOrMove]);
    return React24.useMemo(() => enabled ? {
      reference,
      trigger: reference
    } : {}, [enabled, reference]);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs
  var React25 = __toESM(require_react(), 1);
  function alwaysFalse() {
    return false;
  }
  function normalizeProp(normalizable) {
    return {
      escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false,
      outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true
    };
  }
  function useDismiss(context, props = {}) {
    const {
      enabled = true,
      escapeKey: escapeKey2 = true,
      outsidePress: outsidePressProp = true,
      outsidePressEvent = "sloppy",
      referencePress = alwaysFalse,
      bubbles,
      externalTree
    } = props;
    const store = "rootStore" in context ? context.rootStore : context;
    const open2 = store.useState("open");
    const floatingElement = store.useState("floatingElement");
    const {
      dataRef,
      events
    } = store.context;
    const tree = useFloatingTree(externalTree);
    const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false);
    const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp;
    const outsidePressEnabled = outsidePress2 !== false;
    const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);
    const {
      escapeKey: escapeKeyBubbles,
      outsidePress: outsidePressBubbles
    } = normalizeProp(bubbles);
    const pressStartedInsideRef = React25.useRef(false);
    const pressStartPreventedRef = React25.useRef(false);
    const suppressNextOutsideClickRef = React25.useRef(false);
    const sawPressWhileOpenRef = React25.useRef(false);
    const isComposingRef = React25.useRef(false);
    const currentPointerTypeRef = React25.useRef("");
    const touchStateRef = React25.useRef(null);
    const cancelDismissOnEndTimeout = useTimeout();
    const clearInsideReactTreeTimeout = useTimeout();
    const clearInsideReactTree = useStableCallback(() => {
      clearInsideReactTreeTimeout.clear();
      dataRef.current.insideReactTree = false;
    });
    const hasBlockingChild = useStableCallback((bubbleKey) => {
      const nodeId = dataRef.current.floatingContext?.nodeId;
      const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
      return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]);
    });
    const isEventWithinOwnElements = useStableCallback((event) => {
      return isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement"));
    });
    const closeOnReferencePress = useStableCallback((event) => {
      if (!referencePress()) {
        return;
      }
      store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent));
    });
    const closeOnEscapeKeyDown = useStableCallback((event) => {
      if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") {
        return;
      }
      if (isComposingRef.current) {
        return;
      }
      if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) {
        return;
      }
      const native = isReactEvent(event) ? event.nativeEvent : event;
      const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native);
      store.setOpen(false, eventDetails);
      if (!eventDetails.isCanceled) {
        event.preventDefault();
      }
      if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {
        event.stopPropagation();
      }
    });
    const markInsideReactTree = useStableCallback(() => {
      dataRef.current.insideReactTree = true;
      clearInsideReactTreeTimeout.start(0, clearInsideReactTree);
    });
    const markPressStartedInsideReactTree = useStableCallback((event) => {
      if (!open2 || !enabled || event.button !== 0) {
        return;
      }
      const target = getTarget(event.nativeEvent);
      if (!contains(store.select("floatingElement"), target)) {
        return;
      }
      if (!pressStartedInsideRef.current) {
        pressStartedInsideRef.current = true;
        pressStartPreventedRef.current = false;
      }
    });
    const markInsidePressStartPrevented = useStableCallback((event) => {
      if (!open2 || !enabled) {
        return;
      }
      if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {
        return;
      }
      if (pressStartedInsideRef.current) {
        pressStartPreventedRef.current = true;
      }
    });
    React25.useEffect(() => {
      function handleOpenChange(details) {
        if (!details.open) {
          sawPressWhileOpenRef.current = false;
        }
      }
      events.on("openchange", handleOpenChange);
      return () => {
        events.off("openchange", handleOpenChange);
      };
    }, [events]);
    React25.useEffect(() => {
      if (!open2 || !enabled) {
        if (!open2) {
          sawPressWhileOpenRef.current = false;
        }
        return clearInsideReactTree;
      }
      dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
      dataRef.current.__outsidePressBubbles = outsidePressBubbles;
      const compositionTimeout = new Timeout();
      const preventedPressSuppressionTimeout = new Timeout();
      const doc = ownerDocument(floatingElement);
      function handleCompositionStart() {
        compositionTimeout.clear();
        isComposingRef.current = true;
      }
      function handleCompositionEnd() {
        compositionTimeout.start(
          // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
          // Only apply to WebKit for the test to remain 0ms.
          parts_exports.engine.webkit ? 5 : 0,
          () => {
            isComposingRef.current = false;
          }
        );
      }
      function suppressImmediateOutsideClickAfterPreventedStart() {
        suppressNextOutsideClickRef.current = true;
        preventedPressSuppressionTimeout.start(0, () => {
          suppressNextOutsideClickRef.current = false;
        });
      }
      function resetPressStartState() {
        pressStartedInsideRef.current = false;
        pressStartPreventedRef.current = false;
      }
      function getOutsidePressEvent() {
        const type = currentPointerTypeRef.current;
        const computedType = type === "pen" || !type ? "mouse" : type;
        const outsidePressEventValue = getOutsidePressEventProp();
        const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue;
        if (typeof resolved === "string") {
          return resolved;
        }
        return resolved[computedType];
      }
      function shouldIgnoreEvent(event) {
        const computedOutsidePressEvent = getOutsidePressEvent();
        return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click";
      }
      function isEventWithinFloatingTree(event) {
        const nodeId = dataRef.current.floatingContext?.nodeId;
        const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating));
        return isEventWithinOwnElements(event) || targetIsInsideChildren;
      }
      function closeOnPressOutside(event) {
        if (shouldIgnoreEvent(event)) {
          if (event.type !== "click" && !isEventWithinOwnElements(event)) {
            preventedPressSuppressionTimeout.clear();
            suppressNextOutsideClickRef.current = false;
          }
          clearInsideReactTree();
          return;
        }
        if (dataRef.current.insideReactTree) {
          clearInsideReactTree();
          return;
        }
        const target = getTarget(event);
        const inertSelector = `[${createAttribute("inert")}]`;
        const targetRoot = isElement(target) ? target.getRootNode() : null;
        const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select("floatingElement"))).querySelectorAll(inertSelector));
        const triggers = store.context.triggerElements;
        if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) {
          return;
        }
        let targetRootAncestor = isElement(target) ? target : null;
        while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
          const nextParent = getParentNode(targetRootAncestor);
          if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {
            break;
          }
          targetRootAncestor = nextParent;
        }
        if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
        !contains(target, store.select("floatingElement")) && // If the target root element contains none of the markers, then the
        // element was injected after the floating element rendered.
        markers.every((marker) => !contains(targetRootAncestor, marker))) {
          return;
        }
        if (isHTMLElement(target) && !("touches" in event)) {
          const lastTraversableNode = isLastTraversableNode(target);
          const style = getComputedStyle2(target);
          const scrollRe = /auto|scroll/;
          const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
          const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
          const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
          const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
          const isRTL11 = style.direction === "rtl";
          const pressedVerticalScrollbar = canScrollY && (isRTL11 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
          const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
          if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {
            return;
          }
        }
        if (isEventWithinFloatingTree(event)) {
          return;
        }
        if (getOutsidePressEvent() === "intentional") {
          if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) {
            return;
          }
          if (suppressNextOutsideClickRef.current) {
            preventedPressSuppressionTimeout.clear();
            suppressNextOutsideClickRef.current = false;
            return;
          }
        }
        if (typeof outsidePress2 === "function" && !outsidePress2(event)) {
          return;
        }
        if (hasBlockingChild("__outsidePressBubbles")) {
          return;
        }
        store.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event));
        clearInsideReactTree();
      }
      function handlePointerDown(event) {
        if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) {
          return;
        }
        closeOnPressOutside(event);
      }
      function handleTouchStart(event) {
        if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) {
          return;
        }
        const touch = event.touches[0];
        if (touch) {
          touchStateRef.current = {
            startTime: Date.now(),
            startX: touch.clientX,
            startY: touch.clientY,
            dismissOnTouchEnd: false,
            dismissOnMouseDown: true
          };
          cancelDismissOnEndTimeout.start(1e3, () => {
            if (touchStateRef.current) {
              touchStateRef.current.dismissOnTouchEnd = false;
              touchStateRef.current.dismissOnMouseDown = false;
            }
          });
        }
      }
      function addTargetEventListenerOnce(event, listener) {
        const target = getTarget(event);
        if (!target) {
          return;
        }
        const unsubscribe2 = addEventListener(target, event.type, () => {
          listener(event);
          unsubscribe2();
        });
      }
      function handleTouchStartCapture(event) {
        currentPointerTypeRef.current = "touch";
        addTargetEventListenerOnce(event, handleTouchStart);
      }
      function closeOnPressOutsideCapture(event) {
        cancelDismissOnEndTimeout.clear();
        if (event.type === "pointerdown") {
          if (event.button === 0) {
            sawPressWhileOpenRef.current = true;
          }
          currentPointerTypeRef.current = event.pointerType;
        }
        if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {
          return;
        }
        addTargetEventListenerOnce(event, (targetEvent) => {
          if (targetEvent.type === "pointerdown") {
            handlePointerDown(targetEvent);
          } else {
            closeOnPressOutside(targetEvent);
          }
        });
      }
      function handlePressEndCapture(event) {
        if (event.type === "pointercancel") {
          sawPressWhileOpenRef.current = false;
        }
        if (!pressStartedInsideRef.current) {
          return;
        }
        const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;
        resetPressStartState();
        if (getOutsidePressEvent() !== "intentional") {
          return;
        }
        if (event.type === "pointercancel") {
          if (pressStartedInsideDefaultPrevented) {
            suppressImmediateOutsideClickAfterPreventedStart();
          }
          return;
        }
        if (isEventWithinFloatingTree(event)) {
          return;
        }
        if (pressStartedInsideDefaultPrevented) {
          suppressImmediateOutsideClickAfterPreventedStart();
          return;
        }
        if (typeof outsidePress2 === "function" && !outsidePress2(event)) {
          return;
        }
        preventedPressSuppressionTimeout.clear();
        suppressNextOutsideClickRef.current = true;
        clearInsideReactTree();
      }
      function handleTouchMove(event) {
        if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) {
          return;
        }
        const touch = event.touches[0];
        if (!touch) {
          return;
        }
        const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);
        const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);
        const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
        if (distance > 5) {
          touchStateRef.current.dismissOnTouchEnd = true;
        }
        if (distance > 10) {
          closeOnPressOutside(event);
          cancelDismissOnEndTimeout.clear();
          touchStateRef.current = null;
        }
      }
      function handleTouchMoveCapture(event) {
        addTargetEventListenerOnce(event, handleTouchMove);
      }
      function handleTouchEnd(event) {
        if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) {
          return;
        }
        if (touchStateRef.current.dismissOnTouchEnd) {
          closeOnPressOutside(event);
        }
        cancelDismissOnEndTimeout.clear();
        touchStateRef.current = null;
      }
      function handleTouchEndCapture(event) {
        addTargetEventListenerOnce(event, handleTouchEnd);
      }
      const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, {
        capture: true,
        passive: true
      }), addEventListener(doc, "touchmove", handleTouchMoveCapture, {
        capture: true,
        passive: true
      }), addEventListener(doc, "touchend", handleTouchEndCapture, {
        capture: true,
        passive: true
      })));
      return () => {
        unsubscribe();
        compositionTimeout.clear();
        preventedPressSuppressionTimeout.clear();
        resetPressStartState();
        suppressNextOutsideClickRef.current = false;
        clearInsideReactTree();
      };
    }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout]);
    const reference = React25.useMemo(() => ({
      onKeyDown: closeOnEscapeKeyDown,
      onPointerDown: closeOnReferencePress,
      onClick: closeOnReferencePress
    }), [closeOnEscapeKeyDown, closeOnReferencePress]);
    const floating = React25.useMemo(() => ({
      onKeyDown: closeOnEscapeKeyDown,
      // `onMouseDown` may be blocked if `event.preventDefault()` is called in
      // `onPointerDown`, such as with <NumberField.ScrubArea>.
      // See https://github.com/mui/base-ui/pull/3379
      onPointerDown: markInsidePressStartPrevented,
      onMouseDown: markInsidePressStartPrevented,
      onClickCapture: markInsideReactTree,
      onMouseDownCapture(event) {
        markInsideReactTree();
        markPressStartedInsideReactTree(event);
      },
      onPointerDownCapture(event) {
        markInsideReactTree();
        markPressStartedInsideReactTree(event);
      },
      onMouseUpCapture: markInsideReactTree,
      onTouchEndCapture: markInsideReactTree,
      onTouchMoveCapture: markInsideReactTree
    }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);
    return React25.useMemo(() => enabled ? {
      reference,
      floating,
      trigger: reference
    } : {}, [enabled, reference, floating]);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs
  var React33 = __toESM(require_react(), 1);

  // node_modules/@floating-ui/core/dist/floating-ui.core.mjs
  function computeCoordsFromPlacement(_ref, placement, rtl) {
    let {
      reference,
      floating
    } = _ref;
    const sideAxis = getSideAxis(placement);
    const alignmentAxis = getAlignmentAxis(placement);
    const alignLength = getAxisLength(alignmentAxis);
    const side = getSide(placement);
    const isVertical = sideAxis === "y";
    const commonX = reference.x + reference.width / 2 - floating.width / 2;
    const commonY = reference.y + reference.height / 2 - floating.height / 2;
    const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
    let coords;
    switch (side) {
      case "top":
        coords = {
          x: commonX,
          y: reference.y - floating.height
        };
        break;
      case "bottom":
        coords = {
          x: commonX,
          y: reference.y + reference.height
        };
        break;
      case "right":
        coords = {
          x: reference.x + reference.width,
          y: commonY
        };
        break;
      case "left":
        coords = {
          x: reference.x - floating.width,
          y: commonY
        };
        break;
      default:
        coords = {
          x: reference.x,
          y: reference.y
        };
    }
    const alignment = getAlignment(placement);
    if (alignment) {
      coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
    }
    return coords;
  }
  async function detectOverflow(state, options) {
    var _await$platform$isEle;
    if (options === void 0) {
      options = {};
    }
    const {
      x: x2,
      y: y2,
      platform: platform3,
      rects,
      elements,
      strategy
    } = state;
    const {
      boundary = "clippingAncestors",
      rootBoundary = "viewport",
      elementContext = "floating",
      altBoundary = false,
      padding = 0
    } = evaluate(options, state);
    const paddingObject = getPaddingObject(padding);
    const altContext = elementContext === "floating" ? "reference" : "floating";
    const element = elements[altBoundary ? altContext : elementContext];
    const clippingClientRect = rectToClientRect(await platform3.getClippingRect({
      element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements.floating)),
      boundary,
      rootBoundary,
      strategy
    }));
    const rect = elementContext === "floating" ? {
      x: x2,
      y: y2,
      width: rects.floating.width,
      height: rects.floating.height
    } : rects.reference;
    const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating));
    const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || {
      x: 1,
      y: 1
    };
    const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({
      elements,
      rect,
      offsetParent,
      strategy
    }) : rect);
    return {
      top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
      bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
      left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
      right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
    };
  }
  var MAX_RESET_COUNT = 50;
  var computePosition = async (reference, floating, config) => {
    const {
      placement = "bottom",
      strategy = "absolute",
      middleware = [],
      platform: platform3
    } = config;
    const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : {
      ...platform3,
      detectOverflow
    };
    const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating));
    let rects = await platform3.getElementRects({
      reference,
      floating,
      strategy
    });
    let {
      x: x2,
      y: y2
    } = computeCoordsFromPlacement(rects, placement, rtl);
    let statefulPlacement = placement;
    let resetCount = 0;
    const middlewareData = {};
    for (let i = 0; i < middleware.length; i++) {
      const currentMiddleware = middleware[i];
      if (!currentMiddleware) {
        continue;
      }
      const {
        name,
        fn
      } = currentMiddleware;
      const {
        x: nextX,
        y: nextY,
        data,
        reset
      } = await fn({
        x: x2,
        y: y2,
        initialPlacement: placement,
        placement: statefulPlacement,
        strategy,
        middlewareData,
        rects,
        platform: platformWithDetectOverflow,
        elements: {
          reference,
          floating
        }
      });
      x2 = nextX != null ? nextX : x2;
      y2 = nextY != null ? nextY : y2;
      middlewareData[name] = {
        ...middlewareData[name],
        ...data
      };
      if (reset && resetCount < MAX_RESET_COUNT) {
        resetCount++;
        if (typeof reset === "object") {
          if (reset.placement) {
            statefulPlacement = reset.placement;
          }
          if (reset.rects) {
            rects = reset.rects === true ? await platform3.getElementRects({
              reference,
              floating,
              strategy
            }) : reset.rects;
          }
          ({
            x: x2,
            y: y2
          } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
        }
        i = -1;
      }
    }
    return {
      x: x2,
      y: y2,
      placement: statefulPlacement,
      strategy,
      middlewareData
    };
  };
  var flip = function(options) {
    if (options === void 0) {
      options = {};
    }
    return {
      name: "flip",
      options,
      async fn(state) {
        var _middlewareData$arrow, _middlewareData$flip;
        const {
          placement,
          middlewareData,
          rects,
          initialPlacement,
          platform: platform3,
          elements
        } = state;
        const {
          mainAxis: checkMainAxis = true,
          crossAxis: checkCrossAxis = true,
          fallbackPlacements: specifiedFallbackPlacements,
          fallbackStrategy = "bestFit",
          fallbackAxisSideDirection = "none",
          flipAlignment = true,
          ...detectOverflowOptions
        } = evaluate(options, state);
        if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
          return {};
        }
        const side = getSide(placement);
        const initialSideAxis = getSideAxis(initialPlacement);
        const isBasePlacement = getSide(initialPlacement) === initialPlacement;
        const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating));
        const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
        const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
        if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
          fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
        }
        const placements2 = [initialPlacement, ...fallbackPlacements];
        const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
        const overflows = [];
        let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
        if (checkMainAxis) {
          overflows.push(overflow[side]);
        }
        if (checkCrossAxis) {
          const sides2 = getAlignmentSides(placement, rects, rtl);
          overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
        }
        overflowsData = [...overflowsData, {
          placement,
          overflows
        }];
        if (!overflows.every((side2) => side2 <= 0)) {
          var _middlewareData$flip2, _overflowsData$filter;
          const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
          const nextPlacement = placements2[nextIndex];
          if (nextPlacement) {
            const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
            if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
            // overflows the main axis.
            overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
              return {
                data: {
                  index: nextIndex,
                  overflows: overflowsData
                },
                reset: {
                  placement: nextPlacement
                }
              };
            }
          }
          let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
          if (!resetPlacement) {
            switch (fallbackStrategy) {
              case "bestFit": {
                var _overflowsData$filter2;
                const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
                  if (hasFallbackAxisSideDirection) {
                    const currentSideAxis = getSideAxis(d.placement);
                    return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
                    // reading directions favoring greater width.
                    currentSideAxis === "y";
                  }
                  return true;
                }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
                if (placement2) {
                  resetPlacement = placement2;
                }
                break;
              }
              case "initialPlacement":
                resetPlacement = initialPlacement;
                break;
            }
          }
          if (placement !== resetPlacement) {
            return {
              reset: {
                placement: resetPlacement
              }
            };
          }
        }
        return {};
      }
    };
  };
  var originSides = /* @__PURE__ */ new Set(["left", "top"]);
  async function convertValueToCoords(state, options) {
    const {
      placement,
      platform: platform3,
      elements
    } = state;
    const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating));
    const side = getSide(placement);
    const alignment = getAlignment(placement);
    const isVertical = getSideAxis(placement) === "y";
    const mainAxisMulti = originSides.has(side) ? -1 : 1;
    const crossAxisMulti = rtl && isVertical ? -1 : 1;
    const rawValue = evaluate(options, state);
    let {
      mainAxis,
      crossAxis,
      alignmentAxis
    } = typeof rawValue === "number" ? {
      mainAxis: rawValue,
      crossAxis: 0,
      alignmentAxis: null
    } : {
      mainAxis: rawValue.mainAxis || 0,
      crossAxis: rawValue.crossAxis || 0,
      alignmentAxis: rawValue.alignmentAxis
    };
    if (alignment && typeof alignmentAxis === "number") {
      crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
    }
    return isVertical ? {
      x: crossAxis * crossAxisMulti,
      y: mainAxis * mainAxisMulti
    } : {
      x: mainAxis * mainAxisMulti,
      y: crossAxis * crossAxisMulti
    };
  }
  var offset = function(options) {
    if (options === void 0) {
      options = 0;
    }
    return {
      name: "offset",
      options,
      async fn(state) {
        var _middlewareData$offse, _middlewareData$arrow;
        const {
          x: x2,
          y: y2,
          placement,
          middlewareData
        } = state;
        const diffCoords = await convertValueToCoords(state, options);
        if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
          return {};
        }
        return {
          x: x2 + diffCoords.x,
          y: y2 + diffCoords.y,
          data: {
            ...diffCoords,
            placement
          }
        };
      }
    };
  };
  var shift = function(options) {
    if (options === void 0) {
      options = {};
    }
    return {
      name: "shift",
      options,
      async fn(state) {
        const {
          x: x2,
          y: y2,
          placement,
          platform: platform3
        } = state;
        const {
          mainAxis: checkMainAxis = true,
          crossAxis: checkCrossAxis = false,
          limiter = {
            fn: (_ref) => {
              let {
                x: x3,
                y: y3
              } = _ref;
              return {
                x: x3,
                y: y3
              };
            }
          },
          ...detectOverflowOptions
        } = evaluate(options, state);
        const coords = {
          x: x2,
          y: y2
        };
        const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
        const crossAxis = getSideAxis(placement);
        const mainAxis = getOppositeAxis(crossAxis);
        let mainAxisCoord = coords[mainAxis];
        let crossAxisCoord = coords[crossAxis];
        const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
        if (checkMainAxis) {
          mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
        }
        if (checkCrossAxis) {
          crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
        }
        const limitedCoords = limiter.fn({
          ...state,
          [mainAxis]: mainAxisCoord,
          [crossAxis]: crossAxisCoord
        });
        return {
          ...limitedCoords,
          data: {
            x: limitedCoords.x - x2,
            y: limitedCoords.y - y2,
            enabled: {
              [mainAxis]: checkMainAxis,
              [crossAxis]: checkCrossAxis
            }
          }
        };
      }
    };
  };
  var limitShift = function(options) {
    if (options === void 0) {
      options = {};
    }
    return {
      options,
      fn(state) {
        var _rawOffset$mainAxis, _rawOffset$crossAxis;
        const {
          x: x2,
          y: y2,
          placement,
          rects,
          middlewareData
        } = state;
        const {
          offset: offset4 = 0,
          mainAxis: checkMainAxis = true,
          crossAxis: checkCrossAxis = true
        } = evaluate(options, state);
        const coords = {
          x: x2,
          y: y2
        };
        const crossAxis = getSideAxis(placement);
        const mainAxis = getOppositeAxis(crossAxis);
        let mainAxisCoord = coords[mainAxis];
        let crossAxisCoord = coords[crossAxis];
        const rawOffset = evaluate(offset4, state);
        const computedOffset = typeof rawOffset === "number" ? {
          mainAxis: rawOffset,
          crossAxis: 0
        } : {
          mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
          crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
        };
        if (checkMainAxis) {
          const len = mainAxis === "y" ? "height" : "width";
          const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
          const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
          if (mainAxisCoord < limitMin) {
            mainAxisCoord = limitMin;
          } else if (mainAxisCoord > limitMax) {
            mainAxisCoord = limitMax;
          }
        }
        if (checkCrossAxis) {
          var _middlewareData$offse, _middlewareData$offse2;
          const len = mainAxis === "y" ? "width" : "height";
          const isOriginSide = originSides.has(getSide(placement));
          const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
          const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
          if (crossAxisCoord < limitMin) {
            crossAxisCoord = limitMin;
          } else if (crossAxisCoord > limitMax) {
            crossAxisCoord = limitMax;
          }
        }
        return {
          [mainAxis]: mainAxisCoord,
          [crossAxis]: crossAxisCoord
        };
      }
    };
  };
  var size = function(options) {
    if (options === void 0) {
      options = {};
    }
    return {
      name: "size",
      options,
      async fn(state) {
        const {
          placement,
          rects,
          platform: platform3,
          elements
        } = state;
        const {
          apply = () => {
          },
          ...detectOverflowOptions
        } = evaluate(options, state);
        const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
        const side = getSide(placement);
        const alignment = getAlignment(placement);
        const isYAxis = getSideAxis(placement) === "y";
        const {
          width,
          height
        } = rects.floating;
        let heightSide;
        let widthSide;
        if (side === "top" || side === "bottom") {
          heightSide = side;
          widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
        } else {
          widthSide = side;
          heightSide = alignment === "end" ? "top" : "bottom";
        }
        const maximumClippingHeight = height - overflow.top - overflow.bottom;
        const maximumClippingWidth = width - overflow.left - overflow.right;
        const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
        const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
        const shiftData = state.middlewareData.shift;
        const noShift = !shiftData;
        let availableHeight2 = overflowAvailableHeight;
        let availableWidth2 = overflowAvailableWidth;
        if (shiftData != null && shiftData.enabled.x) {
          availableWidth2 = maximumClippingWidth;
        }
        if (shiftData != null && shiftData.enabled.y) {
          availableHeight2 = maximumClippingHeight;
        }
        if (noShift && !alignment) {
          if (isYAxis) {
            availableWidth2 = width - 2 * max(overflow.left, overflow.right);
          } else {
            availableHeight2 = height - 2 * max(overflow.top, overflow.bottom);
          }
        }
        await apply({
          ...state,
          availableWidth: availableWidth2,
          availableHeight: availableHeight2
        });
        const nextDimensions = await platform3.getDimensions(elements.floating);
        if (width !== nextDimensions.width || height !== nextDimensions.height) {
          return {
            reset: {
              rects: true
            }
          };
        }
        return {};
      }
    };
  };

  // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
  function getCssDimensions(element) {
    const css = getComputedStyle2(element);
    let width = parseFloat(css.width) || 0;
    let height = parseFloat(css.height) || 0;
    const hasOffset = isHTMLElement(element);
    const offsetWidth = hasOffset ? element.offsetWidth : width;
    const offsetHeight = hasOffset ? element.offsetHeight : height;
    const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
    if (shouldFallback) {
      width = offsetWidth;
      height = offsetHeight;
    }
    return {
      width,
      height,
      $: shouldFallback
    };
  }
  function unwrapElement(element) {
    return !isElement(element) ? element.contextElement : element;
  }
  function getScale(element) {
    const domElement = unwrapElement(element);
    if (!isHTMLElement(domElement)) {
      return createCoords(1);
    }
    const rect = domElement.getBoundingClientRect();
    const {
      width,
      height,
      $: $2
    } = getCssDimensions(domElement);
    let x2 = ($2 ? round(rect.width) : rect.width) / width;
    let y2 = ($2 ? round(rect.height) : rect.height) / height;
    if (!x2 || !Number.isFinite(x2)) {
      x2 = 1;
    }
    if (!y2 || !Number.isFinite(y2)) {
      y2 = 1;
    }
    return {
      x: x2,
      y: y2
    };
  }
  var noOffsets = /* @__PURE__ */ createCoords(0);
  function getVisualOffsets(element) {
    const win = getWindow(element);
    if (!isWebKit() || !win.visualViewport) {
      return noOffsets;
    }
    return {
      x: win.visualViewport.offsetLeft,
      y: win.visualViewport.offsetTop
    };
  }
  function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
    if (isFixed === void 0) {
      isFixed = false;
    }
    return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
  }
  function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
    if (includeScale === void 0) {
      includeScale = false;
    }
    if (isFixedStrategy === void 0) {
      isFixedStrategy = false;
    }
    const clientRect = element.getBoundingClientRect();
    const domElement = unwrapElement(element);
    let scale = createCoords(1);
    if (includeScale) {
      if (offsetParent) {
        if (isElement(offsetParent)) {
          scale = getScale(offsetParent);
        }
      } else {
        scale = getScale(element);
      }
    }
    const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
    let x2 = (clientRect.left + visualOffsets.x) / scale.x;
    let y2 = (clientRect.top + visualOffsets.y) / scale.y;
    let width = clientRect.width / scale.x;
    let height = clientRect.height / scale.y;
    if (domElement && offsetParent) {
      const win = getWindow(domElement);
      const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
      let currentWin = win;
      let currentIFrame = getFrameElement(currentWin);
      while (currentIFrame && offsetWin !== currentWin) {
        const iframeScale = getScale(currentIFrame);
        const iframeRect = currentIFrame.getBoundingClientRect();
        const css = getComputedStyle2(currentIFrame);
        const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
        const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
        x2 *= iframeScale.x;
        y2 *= iframeScale.y;
        width *= iframeScale.x;
        height *= iframeScale.y;
        x2 += left;
        y2 += top;
        currentWin = getWindow(currentIFrame);
        currentIFrame = getFrameElement(currentWin);
      }
    }
    return rectToClientRect({
      width,
      height,
      x: x2,
      y: y2
    });
  }
  function getWindowScrollBarX(element, rect) {
    const leftScroll = getNodeScroll(element).scrollLeft;
    if (!rect) {
      return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
    }
    return rect.left + leftScroll;
  }
  function getHTMLOffset(documentElement, scroll) {
    const htmlRect = documentElement.getBoundingClientRect();
    const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
    const y2 = htmlRect.top + scroll.scrollTop;
    return {
      x: x2,
      y: y2
    };
  }
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
    let {
      elements,
      rect,
      offsetParent,
      strategy
    } = _ref;
    const isFixed = strategy === "fixed";
    const documentElement = getDocumentElement(offsetParent);
    const topLayer = elements ? isTopLayer(elements.floating) : false;
    if (offsetParent === documentElement || topLayer && isFixed) {
      return rect;
    }
    let scroll = {
      scrollLeft: 0,
      scrollTop: 0
    };
    let scale = createCoords(1);
    const offsets = createCoords(0);
    const isOffsetParentAnElement = isHTMLElement(offsetParent);
    if (isOffsetParentAnElement || !isFixed) {
      if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
        scroll = getNodeScroll(offsetParent);
      }
      if (isOffsetParentAnElement) {
        const offsetRect = getBoundingClientRect(offsetParent);
        scale = getScale(offsetParent);
        offsets.x = offsetRect.x + offsetParent.clientLeft;
        offsets.y = offsetRect.y + offsetParent.clientTop;
      }
    }
    const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
    return {
      width: rect.width * scale.x,
      height: rect.height * scale.y,
      x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
      y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
    };
  }
  function getClientRects(element) {
    return element.getClientRects ? Array.from(element.getClientRects()) : [];
  }
  function getDocumentRect(html) {
    const scroll = getNodeScroll(html);
    const body = html.ownerDocument.body;
    const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
    const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
    let x2 = -scroll.scrollLeft + getWindowScrollBarX(html);
    const y2 = -scroll.scrollTop;
    if (getComputedStyle2(body).direction === "rtl") {
      x2 += max(html.clientWidth, body.clientWidth) - width;
    }
    return {
      width,
      height,
      x: x2,
      y: y2
    };
  }
  var SCROLLBAR_MAX = 25;
  function getViewportRect(element, strategy, rootBoundary) {
    if (rootBoundary === void 0) {
      rootBoundary = "viewport";
    }
    const isLayoutViewport = rootBoundary === "layoutViewport";
    const win = getWindow(element);
    const html = getDocumentElement(element);
    const visualViewport = win.visualViewport;
    let width = html.clientWidth;
    let height = html.clientHeight;
    let x2 = 0;
    let y2 = 0;
    if (visualViewport) {
      const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
      if (isLayoutViewport) {
        if (!layoutRelativeClientCoords) {
          x2 = -visualViewport.offsetLeft;
          y2 = -visualViewport.offsetTop;
        }
      } else {
        width = visualViewport.width;
        height = visualViewport.height;
        if (layoutRelativeClientCoords) {
          x2 = visualViewport.offsetLeft;
          y2 = visualViewport.offsetTop;
        }
      }
    }
    const windowScrollbarX = getWindowScrollBarX(html);
    if (windowScrollbarX <= 0) {
      const doc = html.ownerDocument;
      const body = doc.body;
      const bodyStyles = getComputedStyle(body);
      const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
      const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
      const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
      if (gutter <= SCROLLBAR_MAX) {
        width -= gutter;
      }
    }
    return {
      width,
      height,
      x: x2,
      y: y2
    };
  }
  function getInnerBoundingClientRect(element, strategy) {
    const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
    const top = clientRect.top + element.clientTop;
    const left = clientRect.left + element.clientLeft;
    const scale = getScale(element);
    const width = element.clientWidth * scale.x;
    const height = element.clientHeight * scale.y;
    const x2 = left * scale.x;
    const y2 = top * scale.y;
    return {
      width,
      height,
      x: x2,
      y: y2
    };
  }
  function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
    let rect;
    if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") {
      rect = getViewportRect(element, strategy, clippingAncestor);
    } else if (clippingAncestor === "document") {
      rect = getDocumentRect(getDocumentElement(element));
    } else if (isElement(clippingAncestor)) {
      rect = getInnerBoundingClientRect(clippingAncestor, strategy);
    } else {
      const visualOffsets = getVisualOffsets(element);
      rect = {
        x: clippingAncestor.x - visualOffsets.x,
        y: clippingAncestor.y - visualOffsets.y,
        width: clippingAncestor.width,
        height: clippingAncestor.height
      };
    }
    return rectToClientRect(rect);
  }
  function getClippingElementAncestors(element, cache) {
    const cachedResult = cache.get(element);
    if (cachedResult) {
      return cachedResult;
    }
    let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
    let lastKeptComputedStyle = null;
    const elementIsFixed = getComputedStyle2(element).position === "fixed";
    let currentNode = elementIsFixed ? getParentNode(element) : element;
    while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
      const computedStyle = getComputedStyle2(currentNode);
      const currentNodeIsContaining = isContainingBlock(currentNode);
      const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
      const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static");
      if (shouldDropCurrentNode) {
        result = result.filter((ancestor) => ancestor !== currentNode);
      } else {
        lastKeptComputedStyle = computedStyle;
      }
      currentNode = getParentNode(currentNode);
    }
    cache.set(element, result);
    return result;
  }
  function getClippingRect(_ref) {
    let {
      element,
      boundary,
      rootBoundary,
      strategy
    } = _ref;
    const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
    const clippingAncestors = [...elementClippingAncestors, rootBoundary];
    const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
    let top = firstRect.top;
    let right = firstRect.right;
    let bottom = firstRect.bottom;
    let left = firstRect.left;
    for (let i = 1; i < clippingAncestors.length; i++) {
      const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
      top = max(rect.top, top);
      right = min(rect.right, right);
      bottom = min(rect.bottom, bottom);
      left = max(rect.left, left);
    }
    return {
      width: right - left,
      height: bottom - top,
      x: left,
      y: top
    };
  }
  function getDimensions(element) {
    const {
      width,
      height
    } = getCssDimensions(element);
    return {
      width,
      height
    };
  }
  function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
    const isOffsetParentAnElement = isHTMLElement(offsetParent);
    const documentElement = getDocumentElement(offsetParent);
    const isFixed = strategy === "fixed";
    const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
    let scroll = {
      scrollLeft: 0,
      scrollTop: 0
    };
    const offsets = createCoords(0);
    if (isOffsetParentAnElement || !isFixed) {
      if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
        scroll = getNodeScroll(offsetParent);
      }
      if (isOffsetParentAnElement) {
        const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
        offsets.x = offsetRect.x + offsetParent.clientLeft;
        offsets.y = offsetRect.y + offsetParent.clientTop;
      }
    }
    if (!isOffsetParentAnElement && documentElement) {
      offsets.x = getWindowScrollBarX(documentElement);
    }
    const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
    const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
    const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
    return {
      x: x2,
      y: y2,
      width: rect.width,
      height: rect.height
    };
  }
  function isStaticPositioned(element) {
    return getComputedStyle2(element).position === "static";
  }
  function getTrueOffsetParent(element, polyfill) {
    if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
      return null;
    }
    if (polyfill) {
      return polyfill(element);
    }
    let rawOffsetParent = element.offsetParent;
    if (getDocumentElement(element) === rawOffsetParent) {
      rawOffsetParent = rawOffsetParent.ownerDocument.body;
    }
    return rawOffsetParent;
  }
  function getOffsetParent(element, polyfill) {
    const win = getWindow(element);
    if (isTopLayer(element)) {
      return win;
    }
    if (!isHTMLElement(element)) {
      let svgOffsetParent = getParentNode(element);
      while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
        if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
          return svgOffsetParent;
        }
        svgOffsetParent = getParentNode(svgOffsetParent);
      }
      return win;
    }
    let offsetParent = getTrueOffsetParent(element, polyfill);
    while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
      offsetParent = getTrueOffsetParent(offsetParent, polyfill);
    }
    if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
      return win;
    }
    return offsetParent || getContainingBlock(element) || win;
  }
  var getElementRects = async function(data) {
    const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
    const getDimensionsFn = this.getDimensions;
    const floatingDimensions = await getDimensionsFn(data.floating);
    return {
      reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
      floating: {
        x: 0,
        y: 0,
        width: floatingDimensions.width,
        height: floatingDimensions.height
      }
    };
  };
  function isRTL(element) {
    return getComputedStyle2(element).direction === "rtl";
  }
  var platform2 = {
    convertOffsetParentRelativeRectToViewportRelativeRect,
    getDocumentElement,
    getClippingRect,
    getOffsetParent,
    getElementRects,
    getClientRects,
    getDimensions,
    getScale,
    isElement,
    isRTL
  };
  function rectsAreEqual(a, b) {
    return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
  }
  function observeMove(element, onMove, ancestorResize) {
    let io = null;
    let timeoutId;
    const root = getDocumentElement(element);
    function cleanup() {
      var _io;
      clearTimeout(timeoutId);
      (_io = io) == null || _io.disconnect();
      io = null;
    }
    function refresh(skip, threshold) {
      if (skip === void 0) {
        skip = false;
      }
      if (threshold === void 0) {
        threshold = 1;
      }
      cleanup();
      const elementRectForRootMargin = element.getBoundingClientRect();
      const {
        left,
        top,
        width,
        height
      } = elementRectForRootMargin;
      if (!skip) {
        onMove();
      }
      if (!width || !height) {
        return;
      }
      const insetTop = floor(top);
      const insetRight = floor(root.clientWidth - (left + width));
      const insetBottom = floor(root.clientHeight - (top + height));
      const insetLeft = floor(left);
      const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
      const options = {
        rootMargin,
        threshold: max(0, min(1, threshold)) || 1
      };
      let isFirstUpdate = true;
      function handleObserve(entries) {
        const ratio = entries[0].intersectionRatio;
        if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
          return refresh();
        }
        if (ratio !== threshold) {
          if (!isFirstUpdate) {
            return refresh();
          }
          if (!ratio) {
            timeoutId = setTimeout(() => {
              refresh(false, 1e-7);
            }, 1e3);
          } else {
            refresh(false, ratio);
          }
        }
        isFirstUpdate = false;
      }
      try {
        io = new IntersectionObserver(handleObserve, {
          ...options,
          // Handle <iframe>s
          root: root.ownerDocument
        });
      } catch (_e) {
        io = new IntersectionObserver(handleObserve, options);
      }
      io.observe(element);
    }
    const win = getWindow(element);
    const handleResize = () => refresh(ancestorResize);
    win.addEventListener("resize", handleResize);
    refresh(true);
    return () => {
      win.removeEventListener("resize", handleResize);
      cleanup();
    };
  }
  function autoUpdate(reference, floating, update2, options) {
    if (options === void 0) {
      options = {};
    }
    const {
      ancestorScroll = true,
      ancestorResize = true,
      elementResize = typeof ResizeObserver === "function",
      layoutShift = typeof IntersectionObserver === "function",
      animationFrame = false
    } = options;
    const referenceEl = unwrapElement(reference);
    const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
    ancestors.forEach((ancestor) => {
      ancestorScroll && ancestor.addEventListener("scroll", update2);
      ancestorResize && ancestor.addEventListener("resize", update2);
    });
    const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null;
    let reobserveFrame = -1;
    let resizeObserver = null;
    if (elementResize) {
      resizeObserver = new ResizeObserver((_ref) => {
        let [firstEntry] = _ref;
        if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
          resizeObserver.unobserve(floating);
          cancelAnimationFrame(reobserveFrame);
          reobserveFrame = requestAnimationFrame(() => {
            var _resizeObserver;
            (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
          });
        }
        update2();
      });
      if (referenceEl && !animationFrame) {
        resizeObserver.observe(referenceEl);
      }
      if (floating) {
        resizeObserver.observe(floating);
      }
    }
    let frameId;
    let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
    if (animationFrame) {
      frameLoop();
    }
    function frameLoop() {
      const nextRefRect = getBoundingClientRect(reference);
      if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
        update2();
      }
      prevRefRect = nextRefRect;
      frameId = requestAnimationFrame(frameLoop);
    }
    update2();
    return () => {
      var _resizeObserver2;
      ancestors.forEach((ancestor) => {
        ancestorScroll && ancestor.removeEventListener("scroll", update2);
        ancestorResize && ancestor.removeEventListener("resize", update2);
      });
      cleanupIo == null || cleanupIo();
      (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
      resizeObserver = null;
      if (animationFrame) {
        cancelAnimationFrame(frameId);
      }
    };
  }
  var offset2 = offset;
  var shift2 = shift;
  var flip2 = flip;
  var size2 = size;
  var limitShift2 = limitShift;
  var computePosition2 = (reference, floating, options) => {
    const cache = /* @__PURE__ */ new Map();
    const mergedOptions = options != null ? options : {};
    const platformWithCache = {
      ...platform2,
      ...mergedOptions.platform,
      _c: cache
    };
    return computePosition(reference, floating, {
      ...mergedOptions,
      platform: platformWithCache
    });
  };

  // node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
  var React26 = __toESM(require_react(), 1);
  var import_react2 = __toESM(require_react(), 1);
  var ReactDOM3 = __toESM(require_react_dom(), 1);
  var isClient = typeof document !== "undefined";
  var noop3 = function noop4() {
  };
  var index = isClient ? import_react2.useLayoutEffect : noop3;
  function deepEqual(a, b) {
    if (a === b) {
      return true;
    }
    if (typeof a !== typeof b) {
      return false;
    }
    if (typeof a === "function" && a.toString() === b.toString()) {
      return true;
    }
    let length;
    let i;
    let keys;
    if (a && b && typeof a === "object") {
      if (Array.isArray(a)) {
        length = a.length;
        if (length !== b.length) return false;
        for (i = length; i-- !== 0; ) {
          if (!deepEqual(a[i], b[i])) {
            return false;
          }
        }
        return true;
      }
      keys = Object.keys(a);
      length = keys.length;
      if (length !== Object.keys(b).length) {
        return false;
      }
      for (i = length; i-- !== 0; ) {
        if (!{}.hasOwnProperty.call(b, keys[i])) {
          return false;
        }
      }
      for (i = length; i-- !== 0; ) {
        const key = keys[i];
        if (key === "_owner" && a.$$typeof) {
          continue;
        }
        if (!deepEqual(a[key], b[key])) {
          return false;
        }
      }
      return true;
    }
    return a !== a && b !== b;
  }
  function getDPR(element) {
    if (typeof window === "undefined") {
      return 1;
    }
    const win = element.ownerDocument.defaultView || window;
    return win.devicePixelRatio || 1;
  }
  function roundByDPR(element, value) {
    const dpr = getDPR(element);
    return Math.round(value * dpr) / dpr;
  }
  function useLatestRef(value) {
    const ref = React26.useRef(value);
    index(() => {
      ref.current = value;
    });
    return ref;
  }
  function useFloating(options) {
    if (options === void 0) {
      options = {};
    }
    const {
      placement = "bottom",
      strategy = "absolute",
      middleware = [],
      platform: platform3,
      elements: {
        reference: externalReference,
        floating: externalFloating
      } = {},
      transform = true,
      whileElementsMounted,
      open: open2
    } = options;
    const [data, setData] = React26.useState({
      x: 0,
      y: 0,
      strategy,
      placement,
      middlewareData: {},
      isPositioned: false
    });
    const [latestMiddleware, setLatestMiddleware] = React26.useState(middleware);
    if (!deepEqual(latestMiddleware, middleware)) {
      setLatestMiddleware(middleware);
    }
    const [_reference, _setReference] = React26.useState(null);
    const [_floating, _setFloating] = React26.useState(null);
    const setReference = React26.useCallback((node) => {
      if (node !== referenceRef.current) {
        referenceRef.current = node;
        _setReference(node);
      }
    }, []);
    const setFloating = React26.useCallback((node) => {
      if (node !== floatingRef.current) {
        floatingRef.current = node;
        _setFloating(node);
      }
    }, []);
    const referenceEl = externalReference || _reference;
    const floatingEl = externalFloating || _floating;
    const referenceRef = React26.useRef(null);
    const floatingRef = React26.useRef(null);
    const dataRef = React26.useRef(data);
    const hasWhileElementsMounted = whileElementsMounted != null;
    const whileElementsMountedRef = useLatestRef(whileElementsMounted);
    const platformRef = useLatestRef(platform3);
    const openRef = useLatestRef(open2);
    const update2 = React26.useCallback(() => {
      if (!referenceRef.current || !floatingRef.current) {
        return;
      }
      const config = {
        placement,
        strategy,
        middleware: latestMiddleware
      };
      if (platformRef.current) {
        config.platform = platformRef.current;
      }
      computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
        const fullData = {
          ...data2,
          // The floating element's position may be recomputed while it's closed
          // but still mounted (such as when transitioning out). To ensure
          // `isPositioned` will be `false` initially on the next open, avoid
          // setting it to `true` when `open === false` (must be specified).
          isPositioned: openRef.current !== false
        };
        if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
          dataRef.current = fullData;
          ReactDOM3.flushSync(() => {
            setData(fullData);
          });
        }
      });
    }, [latestMiddleware, placement, strategy, platformRef, openRef]);
    index(() => {
      if (open2 === false && dataRef.current.isPositioned) {
        dataRef.current.isPositioned = false;
        setData((data2) => ({
          ...data2,
          isPositioned: false
        }));
      }
    }, [open2]);
    const isMountedRef = React26.useRef(false);
    index(() => {
      isMountedRef.current = true;
      return () => {
        isMountedRef.current = false;
      };
    }, []);
    index(() => {
      if (referenceEl) referenceRef.current = referenceEl;
      if (floatingEl) floatingRef.current = floatingEl;
      if (referenceEl && floatingEl) {
        if (whileElementsMountedRef.current) {
          return whileElementsMountedRef.current(referenceEl, floatingEl, update2);
        }
        update2();
      }
    }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]);
    const refs = React26.useMemo(() => ({
      reference: referenceRef,
      floating: floatingRef,
      setReference,
      setFloating
    }), [setReference, setFloating]);
    const elements = React26.useMemo(() => ({
      reference: referenceEl,
      floating: floatingEl
    }), [referenceEl, floatingEl]);
    const floatingStyles = React26.useMemo(() => {
      const initialStyles = {
        position: strategy,
        left: 0,
        top: 0
      };
      if (!elements.floating) {
        return initialStyles;
      }
      const x2 = roundByDPR(elements.floating, data.x);
      const y2 = roundByDPR(elements.floating, data.y);
      if (transform) {
        return {
          ...initialStyles,
          transform: "translate(" + x2 + "px, " + y2 + "px)",
          ...getDPR(elements.floating) >= 1.5 && {
            willChange: "transform"
          }
        };
      }
      return {
        position: strategy,
        left: x2,
        top: y2
      };
    }, [strategy, transform, elements.floating, data.x, data.y]);
    return React26.useMemo(() => ({
      ...data,
      update: update2,
      refs,
      elements,
      floatingStyles
    }), [data, update2, refs, elements, floatingStyles]);
  }
  var offset3 = (options, deps) => {
    const result = offset2(options);
    return {
      name: result.name,
      fn: result.fn,
      options: [options, deps]
    };
  };
  var shift3 = (options, deps) => {
    const result = shift2(options);
    return {
      name: result.name,
      fn: result.fn,
      options: [options, deps]
    };
  };
  var limitShift3 = (options, deps) => {
    const result = limitShift2(options);
    return {
      fn: result.fn,
      options: [options, deps]
    };
  };
  var flip3 = (options, deps) => {
    const result = flip2(options);
    return {
      name: result.name,
      fn: result.fn,
      options: [options, deps]
    };
  };
  var size3 = (options, deps) => {
    const result = size2(options);
    return {
      name: result.name,
      fn: result.fn,
      options: [options, deps]
    };
  };

  // node_modules/@base-ui/react/utils/popups/popupHandle.mjs
  var BasePopupHandle = class {
    /**
     * Stores of every root currently using this handle, in attach order. A handle is meant to be used
     * by a single mounted root, but roots can transiently overlap (e.g. during an animated route
     * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of
     * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.
     */
    attachedStores = [];
    /**
     * Store of the root that currently controls the handle: the most recently attached one still
     * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.
     */
    attachedStoreValue = null;
    /**
     * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.
     */
    storeListeners = /* @__PURE__ */ new Set();
    /**
     * Creates a handle backed by the store used while no root is attached.
     *
     * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,
     * so they can render and register without a mounted root. Triggers register into whichever store
     * `store` currently resolves to, so while detached they live in this store's trigger map and
     * migrate themselves to the root's store (and back) as it attaches/detaches.
     * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces
     * `MenuHandle.open()` in warning text.
     * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is
     * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,
     * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.
     */
    constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {
      this.fallbackStore = fallbackStore;
      this.componentName = componentName;
      this.throwOnMissingTrigger = throwOnMissingTrigger;
    }
    get attachedStore() {
      return this.attachedStoreValue;
    }
    /**
     * Store that detached triggers read from: the attached root's store, or an inert fallback store
     * used while no root is attached.
     * @internal
     */
    get store() {
      return this.attachedStoreValue ?? this.fallbackStore;
    }
    /**
     * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on
     * the handle during render because a handle can be shared by concurrent server-rendered requests.
     * @internal
     */
    get serverStore() {
      return this.fallbackStore;
    }
    /**
     * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind
     * when a root attaches or detaches. Returns a function that removes the listener.
     * @internal
     */
    subscribeStore(listener) {
      this.storeListeners.add(listener);
      return () => {
        this.storeListeners.delete(listener);
      };
    }
    /**
     * Points the handle at a root's store and notifies subscribers so detached triggers re-render and
     * re-register into it (their registration effect migrates them when the store pointer changes).
     * Returns a cleanup function that detaches the store again.
     * @internal
     */
    attachStore(newStore) {
      this.attachedStores.push(newStore);
      this.setActiveStore(newStore);
      if (true) {
        if (this.attachedStores.length > 1) {
          const dev = this;
          (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {
            if (this.attachedStores.length > 1) {
              console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle.");
            }
          });
        }
      }
      return () => {
        const index2 = this.attachedStores.lastIndexOf(newStore);
        if (index2 !== -1) {
          this.attachedStores.splice(index2, 1);
        }
        this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
      };
    }
    /**
     * Sets the store that currently controls the handle and notifies subscribers when it changes, so
     * detached triggers re-render and migrate their registration to the new store.
     */
    setActiveStore(store) {
      if (this.attachedStoreValue !== store) {
        this.attachedStoreValue = store;
        this.storeListeners.forEach((listener) => {
          listener();
        });
      }
    }
    /**
     * Opens the attached root's store and associates it with the trigger with the given id, or a
     * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public
     * `open()` method, which only narrows the parameter type.
     *
     * When a trigger id is given but no matching trigger is registered, anchored popups throw (see
     * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.
     *
     * This method should only be called in an event handler or an effect (not during rendering).
     *
     * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open
     * without associating any trigger.
     */
    openByTrigger(triggerId) {
      const attachedStore = this.attachedStore;
      if (attachedStore === null) {
        if (true) {
          console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`);
        }
        return;
      }
      let triggerElement;
      if (triggerId) {
        for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {
          triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
        }
        triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
      }
      if (triggerId && !triggerElement) {
        if (this.throwOnMissingTrigger) {
          throw new Error(true ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName));
        }
        if (true) {
          console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`);
        }
      }
      attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement));
    }
    /**
     * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)
     * while no root is attached. Shared by every concrete handle's public `close()` method.
     *
     * This method should only be called in an event handler or an effect (not during rendering).
     */
    closePopup() {
      const attachedStore = this.attachedStore;
      if (attachedStore === null) {
        if (true) {
          console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`);
        }
        return;
      }
      attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction));
    }
  };

  // node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
  var React31 = __toESM(require_react(), 1);
  var ReactDOM4 = __toESM(require_react_dom(), 1);

  // node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs
  var React30 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/store/useStore.mjs
  var React28 = __toESM(require_react(), 1);
  var import_shim = __toESM(require_shim(), 1);
  var import_with_selector = __toESM(require_with_selector(), 1);

  // node_modules/@base-ui/utils/fastHooks.mjs
  var React27 = __toESM(require_react(), 1);
  var hooks = [];
  var currentInstance = void 0;
  function getInstance() {
    return currentInstance;
  }
  function register(hook) {
    hooks.push(hook);
  }
  function fastComponent(fn) {
    const FastComponent = (props, forwardedRef) => {
      const instance = useRefWithInit(createInstance).current;
      let result;
      try {
        currentInstance = instance;
        for (const hook of hooks) {
          hook.before(instance);
        }
        result = fn(props, forwardedRef);
        for (const hook of hooks) {
          hook.after(instance);
        }
        instance.didInitialize = true;
      } finally {
        currentInstance = void 0;
      }
      return result;
    };
    FastComponent.displayName = fn.displayName || fn.name;
    return FastComponent;
  }
  function fastComponentRef(fn) {
    return /* @__PURE__ */ React27.forwardRef(fastComponent(fn));
  }
  function createInstance() {
    return {
      didInitialize: false
    };
  }

  // node_modules/@base-ui/utils/store/useStore.mjs
  var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);
  var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;
  function useStore(store, selector2, a1, a2, a3) {
    return useStoreImplementation(store, selector2, a1, a2, a3);
  }
  function useStoreR19(store, selector2, a1, a2, a3) {
    const getSelection = React28.useCallback(() => selector2(store.getSnapshot(), a1, a2, a3), [store, selector2, a1, a2, a3]);
    return (0, import_shim.useSyncExternalStore)(store.subscribe, getSelection, getSelection);
  }
  register({
    before(instance) {
      instance.syncIndex = 0;
      if (!instance.didInitialize) {
        instance.syncTick = 1;
        instance.syncHooks = [];
        instance.didChangeStore = true;
        instance.getSnapshot = () => {
          let didChange2 = false;
          for (let i = 0; i < instance.syncHooks.length; i += 1) {
            const hook = instance.syncHooks[i];
            const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
            if (!Object.is(hook.value, value)) {
              didChange2 = true;
              hook.value = value;
            }
          }
          if (didChange2) {
            instance.syncTick += 1;
          }
          return instance.syncTick;
        };
      }
    },
    after(instance) {
      if (instance.syncHooks.length > 0) {
        if (instance.didChangeStore) {
          instance.didChangeStore = false;
          instance.subscribe = (onStoreChange) => {
            const stores = /* @__PURE__ */ new Set();
            for (const hook of instance.syncHooks) {
              stores.add(hook.store);
            }
            const unsubscribes = [];
            for (const store of stores) {
              unsubscribes.push(store.subscribe(onStoreChange));
            }
            return () => {
              for (const unsubscribe of unsubscribes) {
                unsubscribe();
              }
            };
          };
        }
        (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot);
      }
    }
  });
  function useStoreFast(store, selector2, a1, a2, a3) {
    const instance = getInstance();
    if (!instance) {
      return useStoreR19(store, selector2, a1, a2, a3);
    }
    const index2 = instance.syncIndex;
    instance.syncIndex += 1;
    let hook;
    if (!instance.didInitialize) {
      hook = {
        store,
        selector: selector2,
        a1,
        a2,
        a3,
        value: selector2(store.getSnapshot(), a1, a2, a3)
      };
      instance.syncHooks.push(hook);
    } else {
      hook = instance.syncHooks[index2];
      if (hook.store !== store || hook.selector !== selector2 || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {
        if (hook.store !== store) {
          instance.didChangeStore = true;
        }
        hook.store = store;
        hook.selector = selector2;
        hook.a1 = a1;
        hook.a2 = a2;
        hook.a3 = a3;
        hook.value = selector2(store.getSnapshot(), a1, a2, a3);
      }
    }
    return hook.value;
  }
  function useStoreLegacy(store, selector2, a1, a2, a3) {
    return (0, import_with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector2(state, a1, a2, a3));
  }

  // node_modules/@base-ui/utils/store/Store.mjs
  var Store = class {
    /**
     * Creates a store with the given initial state, constructing the class it is called on.
     * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that
     * class but degrades the inferred instance type to `Store`; use `new` there instead.
     */
    static create(state) {
      return new this(state);
    }
    /**
     * The current state of the store.
     * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
     * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
     * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
     *
     * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
     */
    // Internal state to handle recursive `setState()` calls
    constructor(state) {
      this.state = state;
      this.listeners = /* @__PURE__ */ new Set();
      this.updateTick = 0;
    }
    /**
     * Registers a listener that will be called whenever the store's state changes.
     *
     * @param fn The listener function to be called on state changes.
     * @returns A function to unsubscribe the listener.
     */
    subscribe = (fn) => {
      this.listeners.add(fn);
      return () => {
        this.listeners.delete(fn);
      };
    };
    /**
     * Returns the current state of the store.
     */
    getSnapshot = () => {
      return this.state;
    };
    /**
     * Updates the entire store's state and notifies all registered listeners.
     *
     * @param newState The new state to set for the store.
     */
    setState(newState) {
      if (this.state === newState) {
        return;
      }
      this.state = newState;
      this.updateTick += 1;
      const currentTick = this.updateTick;
      for (const listener of this.listeners) {
        if (currentTick !== this.updateTick) {
          return;
        }
        listener(newState);
      }
    }
    /**
     * Merges the provided changes into the current state and notifies listeners if there are changes.
     * Each value must match its state key. Pass an exact known subset rather than a broad
     * `Partial<State>`, which may contain `undefined` for required state fields.
     *
     * @param changes An object containing the changes to apply to the current state.
     */
    update(changes) {
      for (const key in changes) {
        if (!Object.is(this.state[key], changes[key])) {
          this.setState({
            ...this.state,
            ...changes
          });
          return;
        }
      }
    }
    /**
     * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
     *
     * @param key The key in the store's state to update.
     * @param value The new value to set for the specified key.
     */
    set(key, value) {
      if (!Object.is(this.state[key], value)) {
        this.setState({
          ...this.state,
          [key]: value
        });
      }
    }
    /**
     * Gives the state a new reference and updates all registered listeners.
     */
    notifyAll() {
      const newState = {
        ...this.state
      };
      this.setState(newState);
    }
    use(selector2, a1, a2, a3) {
      return useStore(this, selector2, a1, a2, a3);
    }
  };

  // node_modules/@base-ui/utils/store/ReactStore.mjs
  var React29 = __toESM(require_react(), 1);
  var ReactStore = class extends Store {
    /**
     * Creates a new ReactStore instance.
     *
     * @param state Initial state of the store.
     * @param context Non-reactive context values.
     * @param selectors Optional selectors for use with `useState`.
     */
    constructor(state, context = {}, selectors4) {
      super(state);
      this.context = context;
      this.selectors = selectors4;
    }
    /**
     * Non-reactive values such as refs, callbacks, etc.
     */
    /**
     * Synchronizes a single external value into the store.
     *
     * Note that the while the value in `state` is updated immediately, the value returned
     * by `useState` is updated before the next render (similarly to React's `useState`).
     */
    useSyncedValue(key, value) {
      React29.useDebugValue(key);
      const store = this;
      useIsoLayoutEffect(() => {
        if (store.state[key] !== value) {
          store.set(key, value);
        }
      }, [store, key, value]);
    }
    /**
     * Synchronizes a single external value into the store and
     * cleans it up (sets to `undefined`) on unmount.
     *
     * Note that the while the value in `state` is updated immediately, the value returned
     * by `useState` is updated before the next render (similarly to React's `useState`).
     */
    useSyncedValueWithCleanup(key, value) {
      const store = this;
      useIsoLayoutEffect(() => {
        if (store.state[key] !== value) {
          store.set(key, value);
        }
        return () => {
          store.set(key, void 0);
        };
      }, [store, key, value]);
    }
    /**
     * Synchronizes multiple external values into the store.
     * Each value must match its state key. Pass an exact known subset rather than a broad
     * `Partial<State>`, which may contain `undefined` for required state fields.
     *
     * Note that the while the values in `state` are updated immediately, the values returned
     * by `useState` are updated before the next render (similarly to React's `useState`).
     *
     * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted.
     */
    useSyncedValues(statePart) {
      const store = this;
      if (true) {
        React29.useDebugValue(statePart, (p2) => Object.keys(p2));
        const keys = React29.useRef(Object.keys(statePart)).current;
        const nextKeys = Object.keys(statePart);
        if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) {
          console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
        }
      }
      const dependencies = Object.values(statePart);
      useIsoLayoutEffect(() => {
        store.update(statePart);
      }, [store, ...dependencies]);
    }
    /**
     * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
     * is non-undefined, the store's state at `key` is updated to match `controlled`.
     */
    useControlledProp(key, controlled) {
      React29.useDebugValue(key);
      const store = this;
      const isControlled = controlled !== void 0;
      useIsoLayoutEffect(() => {
        if (isControlled && !Object.is(store.state[key], controlled)) {
          store.setState({
            ...store.state,
            [key]: controlled
          });
        }
      }, [store, key, controlled, isControlled]);
      if (true) {
        const cache = this.controlledValues ??= /* @__PURE__ */ new Map();
        if (!cache.has(key)) {
          cache.set(key, isControlled);
        }
        const previouslyControlled = cache.get(key);
        if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) {
          console.error(`A component is changing the ${isControlled ? "" : "un"}controlled state of ${key.toString()} to be ${isControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
        }
      }
    }
    /** Gets the current value from the store using a selector with the provided key.
     *
     * @param key Key of the selector to use.
     */
    select(key, a1, a2, a3) {
      const selector2 = this.selectors[key];
      return selector2(this.state, a1, a2, a3);
    }
    /**
     * Returns a value from the store's state using a selector function.
     * Used to subscribe to specific parts of the state.
     * This methods causes a rerender whenever the selected state changes.
     *
     * @param key Key of the selector to use.
     */
    useState(key, a1, a2, a3) {
      React29.useDebugValue(key);
      return useStore(this, this.selectors[key], a1, a2, a3);
    }
    /**
     * Wraps a function with `useStableCallback` to ensure it has a stable reference
     * and assigns it to the context.
     *
     * @param key Key of the event callback. Must be a function in the context.
     * @param fn Function to assign.
     */
    useContextCallback(key, fn) {
      React29.useDebugValue(key);
      const stableFunction = useStableCallback(fn ?? NOOP);
      this.context[key] = stableFunction;
    }
    /**
     * Returns a stable setter function for a specific key in the store's state.
     * It's commonly used to pass as a ref callback to React elements.
     *
     * @param key Key of the state to set.
     */
    useStateSetter(key) {
      const ref = React29.useRef(void 0);
      if (ref.current === void 0) {
        ref.current = (value) => {
          this.set(key, value);
        };
      }
      return ref.current;
    }
    /**
     * Observes changes derived from the store's selectors and calls the listener when the selected value changes.
     *
     * @param key Key of the selector to observe.
     * @param listener Listener function called when the selector result changes.
     */
    observe(selector2, listener) {
      let selectFn;
      if (typeof selector2 === "function") {
        selectFn = selector2;
      } else {
        selectFn = this.selectors[selector2];
      }
      let prevValue = selectFn(this.state);
      listener(prevValue, prevValue, this);
      return this.subscribe((nextState) => {
        const nextValue = selectFn(nextState);
        if (!Object.is(prevValue, nextValue)) {
          const oldValue = prevValue;
          prevValue = nextValue;
          listener(nextValue, oldValue, this);
        }
      });
    }
  };

  // node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs
  var selectors = {
    open: (state) => state.open,
    transitionStatus: (state) => state.transitionStatus,
    domReferenceElement: (state) => state.domReferenceElement,
    referenceElement: (state) => state.positionReference ?? state.referenceElement,
    floatingElement: (state) => state.floatingElement,
    floatingId: (state) => state.floatingId
  };
  var FloatingRootStore = class extends ReactStore {
    constructor(options) {
      const {
        syncOnly,
        nested,
        onOpenChange,
        triggerElements,
        ...initialState
      } = options;
      super({
        ...initialState,
        positionReference: initialState.referenceElement,
        domReferenceElement: initialState.referenceElement
      }, {
        onOpenChange,
        dataRef: {
          current: {}
        },
        events: createEventEmitter(),
        nested,
        triggerElements
      }, selectors);
      this.syncOnly = syncOnly;
    }
    /**
     * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
     */
    syncOpenEvent = (newOpen, event) => {
      if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing
      // click events to upgrade a hover-open.
      event != null && isClickLikeEvent(event)) {
        this.context.dataRef.current.openEvent = newOpen ? event : void 0;
      }
    };
    /**
     * Runs the root-owned side effects for an open state change.
     */
    dispatchOpenChange = (newOpen, eventDetails) => {
      this.syncOpenEvent(newOpen, eventDetails.event);
      const details = {
        open: newOpen,
        reason: eventDetails.reason,
        nativeEvent: eventDetails.event,
        nested: this.context.nested,
        triggerElement: eventDetails.trigger
      };
      this.context.events.emit("openchange", details);
    };
    /**
     * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
     *
     * @param newOpen The new open state.
     * @param eventDetails Details about the event that triggered the open state change.
     */
    setOpen = (newOpen, eventDetails) => {
      if (this.syncOnly) {
        this.context.onOpenChange?.(newOpen, eventDetails);
        return;
      }
      this.dispatchOpenChange(newOpen, eventDetails);
      this.context.onOpenChange?.(newOpen, eventDetails);
    };
  };

  // node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs
  function useSyncedFloatingRootContext(options) {
    const {
      popupStore,
      treatPopupAsFloatingElement = false,
      floatingRootContext: floatingRootContextProp,
      floatingId,
      nested,
      onOpenChange
    } = options;
    const open2 = popupStore.useState("open");
    const referenceElement = popupStore.useState("activeTriggerElement");
    const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement");
    const triggerElements = popupStore.context.triggerElements;
    const handleOpenChange = onOpenChange;
    const internalStoreRef = React30.useRef(null);
    if (floatingRootContextProp === void 0 && internalStoreRef.current === null) {
      internalStoreRef.current = new FloatingRootStore({
        open: open2,
        transitionStatus: void 0,
        referenceElement,
        floatingElement,
        triggerElements,
        onOpenChange: handleOpenChange,
        floatingId,
        syncOnly: true,
        nested
      });
    }
    const store = floatingRootContextProp ?? internalStoreRef.current;
    popupStore.useSyncedValue("floatingId", floatingId);
    useIsoLayoutEffect(() => {
      const valuesToSync = {
        open: open2,
        floatingId,
        referenceElement,
        floatingElement
      };
      if (isElement(referenceElement)) {
        valuesToSync.domReferenceElement = referenceElement;
      }
      if (store.state.positionReference === store.state.referenceElement) {
        valuesToSync.positionReference = referenceElement;
      }
      store.update(valuesToSync);
    }, [open2, floatingId, referenceElement, floatingElement, store]);
    store.context.onOpenChange = handleOpenChange;
    store.context.nested = nested;
    return store;
  }

  // node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
  var FOCUSABLE_POPUP_PROPS = {
    tabIndex: -1,
    [FOCUSABLE_ATTRIBUTE]: ""
  };
  function usePopupRootStore(createStore2, treatPopupAsFloatingElement = false) {
    const floatingId = useId();
    const nested = useFloatingParentNodeId() != null;
    const store = useRefWithInit(() => createStore2(floatingId, nested)).current;
    useSyncedFloatingRootContext({
      popupStore: store,
      treatPopupAsFloatingElement,
      floatingRootContext: store.state.floatingRootContext,
      floatingId,
      nested,
      onOpenChange: store.setOpen
    });
    return store;
  }
  function PopupHandleAttachment({
    handle,
    store
  }) {
    useIsoLayoutEffect(() => {
      return handle.attachStore(store);
    }, [handle, store]);
    return null;
  }
  function syncTriggerCount(store) {
    const triggerCount = store.context.triggerElements.size;
    if (store.select("open") && store.state.triggerCount !== triggerCount) {
      store.set("triggerCount", triggerCount);
    }
  }
  function useTriggerRegistration(id, store) {
    const registrationRef = React31.useRef(null);
    return useStableCallback((element) => {
      const registration = registrationRef.current;
      if (registration !== null) {
        if (registration.element === element && registration.store === store && registration.id === id) {
          return;
        }
        registrationRef.current = null;
        const registeredStore = registration.store;
        if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {
          registeredStore.context.triggerElements.delete(registration.id);
          syncTriggerCount(registeredStore);
        }
      }
      if (element !== null && id !== void 0) {
        registrationRef.current = {
          store,
          id,
          element
        };
        store.context.triggerElements.add(id, element);
        syncTriggerCount(store);
      }
    });
  }
  function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) {
    let preventUnmountingOnClose = state.preventUnmountingOnClose;
    if (open2) {
      preventUnmountingOnClose = false;
    } else if (preventUnmountOnClose) {
      preventUnmountingOnClose = true;
    }
    const triggerId = trigger?.id ?? null;
    let activeTriggerId = state.activeTriggerId;
    let activeTriggerElement = state.activeTriggerElement;
    if (triggerId || open2) {
      activeTriggerId = triggerId;
      activeTriggerElement = trigger ?? null;
    }
    return {
      open: open2,
      preventUnmountingOnClose,
      activeTriggerId,
      activeTriggerElement
    };
  }
  function attachPreventUnmountOnClose(eventDetails) {
    let preventUnmountOnClose = false;
    eventDetails.preventUnmountOnClose = () => {
      preventUnmountOnClose = true;
    };
    return () => preventUnmountOnClose;
  }
  function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {
    const reason = eventDetails.reason;
    const isHover = reason === reason_parts_exports.triggerHover;
    const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus;
    const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey);
    const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);
    store.context.onOpenChange?.(nextOpen, eventDetails);
    if (eventDetails.isCanceled) {
      return;
    }
    options.onBeforeDispatch?.();
    store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
    const changeState = () => {
      const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
      const updatedState = {
        ...options.extraState,
        ...popupOpenState
      };
      if (isFocusOpen) {
        updatedState.instantType = "focus";
      } else if (isDismissClose) {
        updatedState.instantType = "dismiss";
      } else if (isHover) {
        updatedState.instantType = void 0;
      }
      store.update(updatedState);
    };
    if (isHover) {
      ReactDOM4.flushSync(changeState);
    } else {
      changeState();
    }
  }
  function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {
    const isMountedByThisTrigger = store.useState("isMountedByTrigger", triggerId);
    const baseRegisterTrigger = useTriggerRegistration(triggerId, store);
    const applyTriggerData = useStableCallback((element) => {
      const open2 = store.select("open");
      const activeTriggerId = store.select("activeTriggerId");
      if (activeTriggerId === triggerId) {
        const changes = {
          activeTriggerElement: element,
          ...open2 ? stateUpdates : null
        };
        store.update(changes);
        return;
      }
      if (activeTriggerId == null && open2) {
        const changes = {
          activeTriggerId: triggerId ?? null,
          activeTriggerElement: element,
          ...stateUpdates
        };
        store.update(changes);
      }
    });
    const registerTrigger = useStableCallback((element) => {
      baseRegisterTrigger(element);
      if (element) {
        applyTriggerData(element);
      }
    });
    useIsoLayoutEffect(() => {
      registerTrigger(triggerElementRef.current);
      return () => registerTrigger(null);
    }, [registerTrigger, triggerElementRef, store, triggerId]);
    useIsoLayoutEffect(() => {
      if (isMountedByThisTrigger) {
        const changes = {
          activeTriggerElement: triggerElementRef.current,
          ...stateUpdates
        };
        store.update(changes);
      }
    }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);
    return {
      registerTrigger,
      isMountedByThisTrigger
    };
  }
  function useImplicitActiveTrigger(store, options = {}) {
    const {
      closeOnActiveTriggerUnmount = false
    } = options;
    const resolvedActiveTriggerIdRef = React31.useRef(null);
    const open2 = store.useState("open");
    const reactiveTriggerCount = store.useState("triggerCount");
    const activeTriggerId = store.useState("activeTriggerId");
    const reactiveActiveTriggerElement = store.useState("activeTriggerElement");
    useIsoLayoutEffect(() => {
      if (!open2) {
        resolvedActiveTriggerIdRef.current = null;
        if (store.state.triggerCount !== 0) {
          store.set("triggerCount", 0);
        }
        return;
      }
      const triggerCount = store.context.triggerElements.size;
      const stateUpdates = {};
      if (store.state.triggerCount !== triggerCount) {
        stateUpdates.triggerCount = triggerCount;
      }
      const currentActiveTriggerId = store.select("activeTriggerId");
      let lostActiveTriggerId = null;
      if (currentActiveTriggerId) {
        const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId);
        if (!activeTriggerElement) {
          for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) {
            if (triggerElement === store.state.activeTriggerElement) {
              stateUpdates.activeTriggerId = triggerId;
              stateUpdates.activeTriggerElement = triggerElement;
              resolvedActiveTriggerIdRef.current = triggerId;
              break;
            }
          }
          if (stateUpdates.activeTriggerId === void 0) {
            if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {
              lostActiveTriggerId = currentActiveTriggerId;
            } else {
              resolvedActiveTriggerIdRef.current = null;
            }
          }
        } else {
          resolvedActiveTriggerIdRef.current = currentActiveTriggerId;
          if (activeTriggerElement !== store.state.activeTriggerElement) {
            stateUpdates.activeTriggerElement = activeTriggerElement;
          }
        }
      } else {
        resolvedActiveTriggerIdRef.current = null;
      }
      if (!lostActiveTriggerId && !currentActiveTriggerId && triggerCount === 1) {
        const iteratorResult = store.context.triggerElements.entries().next();
        if (!iteratorResult.done) {
          const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;
          stateUpdates.activeTriggerId = implicitTriggerId;
          stateUpdates.activeTriggerElement = implicitTriggerElement;
          resolvedActiveTriggerIdRef.current = implicitTriggerId;
        }
      }
      if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) {
        store.update(stateUpdates);
      }
      if (lostActiveTriggerId) {
        if (closeOnActiveTriggerUnmount) {
          queueMicrotask(() => {
            if (store.select("open") && store.select("activeTriggerId") === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {
              const eventDetails = createChangeEventDetails(reason_parts_exports.none);
              store.setOpen(false, eventDetails);
              if (!eventDetails.isCanceled) {
                store.update({
                  activeTriggerId: null,
                  activeTriggerElement: null
                });
              }
            }
          });
        }
      }
    }, [open2, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);
  }
  function useOpenStateTransitions(open2, store, onUnmount, animateInitialOpen) {
    const {
      mounted,
      setMounted,
      transitionStatus
    } = useTransitionStatus(open2, false, false, animateInitialOpen);
    const preventUnmountingOnClose = store.useState("preventUnmountingOnClose");
    const syncedPreventUnmountingOnClose = open2 ? false : preventUnmountingOnClose;
    store.useSyncedValues({
      mounted,
      transitionStatus,
      preventUnmountingOnClose: syncedPreventUnmountingOnClose
    });
    const forceUnmount = useStableCallback(() => {
      setMounted(false);
      store.update({
        activeTriggerId: null,
        activeTriggerElement: null,
        mounted: false,
        preventUnmountingOnClose: false
      });
      onUnmount?.();
      store.context.onOpenChangeComplete?.(false);
    });
    useOpenChangeComplete({
      enabled: mounted && !open2 && !syncedPreventUnmountingOnClose,
      open: open2,
      ref: store.context.popupRef,
      onComplete() {
        if (!open2) {
          forceUnmount();
        }
      }
    });
    return {
      forceUnmount,
      transitionStatus
    };
  }
  function usePopupInteractionProps(store, statePart) {
    store.useSyncedValues(statePart);
    useIsoLayoutEffect(() => () => {
      store.update({
        activeTriggerProps: EMPTY_OBJECT,
        inactiveTriggerProps: EMPTY_OBJECT,
        popupProps: EMPTY_OBJECT
      });
    }, [store]);
  }

  // node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs
  var devElementIdsByMap;
  function getDevElementIds(map) {
    devElementIdsByMap ??= /* @__PURE__ */ new WeakMap();
    let elementIds = devElementIdsByMap.get(map);
    if (!elementIds) {
      elementIds = /* @__PURE__ */ new WeakMap();
      devElementIdsByMap.set(map, elementIds);
    }
    return elementIds;
  }
  var PopupTriggerMap = class {
    constructor() {
      this.idMap = /* @__PURE__ */ new Map();
    }
    /**
     * Adds a trigger element with the given ID.
     *
     * Note: The provided element is assumed to not be registered under multiple IDs.
     */
    add(id, element) {
      if (true) {
        const elementIds = getDevElementIds(this);
        const existingId = elementIds.get(element);
        if (existingId !== void 0 && existingId !== id) {
          throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.");
        }
        const previousElement = this.idMap.get(id);
        if (previousElement !== void 0 && previousElement !== element) {
          elementIds.delete(previousElement);
        }
        elementIds.set(element, id);
      }
      this.idMap.set(id, element);
    }
    /**
     * Removes the trigger element with the given ID.
     */
    delete(id) {
      if (true) {
        const element = this.idMap.get(id);
        if (element !== void 0) {
          devElementIdsByMap?.get(this)?.delete(element);
        }
      }
      this.idMap.delete(id);
    }
    /**
     * Whether the given element is registered as a trigger.
     */
    hasElement(element) {
      for (const registered of this.idMap.values()) {
        if (registered === element) {
          return true;
        }
      }
      return false;
    }
    /**
     * Whether there is a registered trigger element matching the given predicate.
     */
    hasMatchingElement(predicate) {
      for (const element of this.idMap.values()) {
        if (predicate(element)) {
          return true;
        }
      }
      return false;
    }
    /**
     * Returns the trigger element associated with the given ID, or undefined if no such element exists.
     */
    getById(id) {
      return this.idMap.get(id);
    }
    /**
     * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
     */
    entries() {
      return this.idMap.entries();
    }
    /**
     * Returns an iterable of all registered trigger elements.
     */
    elements() {
      return this.idMap.values();
    }
    /**
     * Returns the number of registered trigger elements.
     */
    get size() {
      return this.idMap.size;
    }
  };

  // node_modules/@base-ui/react/utils/popups/store.mjs
  function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {
    return {
      open: false,
      openProp: void 0,
      mounted: false,
      transitionStatus: void 0,
      floatingRootContext: new FloatingRootStore({
        open: false,
        transitionStatus: void 0,
        floatingElement: null,
        referenceElement: null,
        triggerElements,
        floatingId,
        syncOnly: true,
        nested,
        onOpenChange: void 0
      }),
      floatingId,
      triggerCount: 0,
      preventUnmountingOnClose: false,
      payload: void 0,
      activeTriggerId: null,
      activeTriggerElement: null,
      triggerIdProp: void 0,
      popupElement: null,
      positionerElement: null,
      activeTriggerProps: EMPTY_OBJECT,
      inactiveTriggerProps: EMPTY_OBJECT,
      popupProps: EMPTY_OBJECT
    };
  }
  var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId;
  var openSelector = (state) => state.openProp ?? state.open;
  var popupIdSelector = (state) => {
    const popupId = state.popupElement?.id ?? state.floatingId;
    return popupId || void 0;
  };
  function triggerOwnsOpenPopup(state, triggerId) {
    return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId;
  }
  function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {
    if (triggerOwnsOpenPopup(state, triggerId)) {
      return true;
    }
    return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1;
  }
  var popupStoreSelectors = {
    open: openSelector,
    mounted: (state) => state.mounted,
    transitionStatus: (state) => state.transitionStatus,
    floatingRootContext: (state) => state.floatingRootContext,
    triggerCount: (state) => state.triggerCount,
    preventUnmountingOnClose: (state) => state.preventUnmountingOnClose,
    payload: (state) => state.payload,
    activeTriggerId: activeTriggerIdSelector,
    activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null,
    popupId: popupIdSelector,
    /**
     * Whether the trigger with the given ID was used to open the popup.
     */
    isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId,
    /**
     * Whether the popup is open and was activated by a trigger with the given ID.
     */
    isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),
    /**
     * Whether the popup is mounted and was activated by a trigger with the given ID.
     */
    isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted,
    triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,
    /**
     * Popup id for the trigger that currently owns the open popup.
     */
    triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0,
    popupProps: (state) => state.popupProps,
    popupElement: (state) => state.popupElement,
    positionerElement: (state) => state.positionerElement
  };

  // node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
  var React32 = __toESM(require_react(), 1);
  var import_shim2 = __toESM(require_shim(), 1);
  function usePopupHandleStore(handle) {
    const subscribe2 = React32.useCallback((listener) => {
      if (handle === void 0) {
        return NOOP;
      }
      return handle.subscribeStore(listener);
    }, [handle]);
    const getSnapshot = React32.useCallback(() => {
      return handle === void 0 ? void 0 : handle.store;
    }, [handle]);
    return (0, import_shim2.useSyncExternalStore)(subscribe2, getSnapshot, () => handle?.serverStore);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs
  function useBaseUIFloating(options) {
    return useFloatingWithStore(options, options.rootContext);
  }
  function useFloatingWithStore(options, store) {
    const {
      nodeId,
      externalTree
    } = options;
    const referenceElement = store.useState("referenceElement");
    const floatingElement = store.useState("floatingElement");
    const domReferenceElement = store.useState("domReferenceElement");
    const open2 = store.useState("open");
    const floatingId = store.useState("floatingId");
    const [positionReference, setPositionReferenceRaw] = React33.useState(null);
    const [localDomReference, setLocalDomReference] = React33.useState(void 0);
    const [localFloatingElement, setLocalFloatingElement] = React33.useState(void 0);
    const domReferenceRef = React33.useRef(null);
    const tree = useFloatingTree(externalTree);
    const storeElements = React33.useMemo(() => ({
      reference: referenceElement,
      floating: floatingElement,
      domReference: domReferenceElement
    }), [referenceElement, floatingElement, domReferenceElement]);
    const position = useFloating({
      ...options,
      elements: {
        ...storeElements,
        ...positionReference && {
          reference: positionReference
        }
      }
    });
    const localDomReferenceElement = isElement(localDomReference) ? localDomReference : null;
    const syncedFloatingElement = localFloatingElement === void 0 ? store.state.floatingElement : localFloatingElement;
    store.useSyncedValue("referenceElement", localDomReference ?? null);
    store.useSyncedValue("domReferenceElement", localDomReference === void 0 ? domReferenceElement : localDomReferenceElement);
    store.useSyncedValue("floatingElement", syncedFloatingElement);
    const setPositionReference = React33.useCallback((node) => {
      const computedPositionReference = isElement(node) ? {
        getBoundingClientRect: () => node.getBoundingClientRect(),
        getClientRects: () => node.getClientRects(),
        contextElement: node
      } : node;
      setPositionReferenceRaw(computedPositionReference);
      position.refs.setReference(computedPositionReference);
    }, [position.refs]);
    const setReference = React33.useCallback((node) => {
      if (isElement(node) || node === null) {
        domReferenceRef.current = node;
        setLocalDomReference(node);
      }
      if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
      // `null` to support `positionReference` + an unstable `reference`
      // callback ref.
      node !== null && !isElement(node)) {
        position.refs.setReference(node);
      }
    }, [position.refs, setLocalDomReference]);
    const setFloating = React33.useCallback((node) => {
      setLocalFloatingElement(node);
      position.refs.setFloating(node);
    }, [position.refs]);
    const refs = React33.useMemo(() => ({
      ...position.refs,
      setReference,
      setFloating,
      setPositionReference,
      domReference: domReferenceRef
    }), [position.refs, setReference, setFloating, setPositionReference]);
    const elements = React33.useMemo(() => ({
      ...position.elements,
      domReference: domReferenceElement
    }), [position.elements, domReferenceElement]);
    const context = React33.useMemo(() => ({
      ...position,
      dataRef: store.context.dataRef,
      open: open2,
      onOpenChange: store.setOpen,
      events: store.context.events,
      floatingId,
      refs,
      elements,
      nodeId,
      rootStore: store
    }), [position, refs, elements, nodeId, store, open2, floatingId]);
    useIsoLayoutEffect(() => {
      if (domReferenceElement) {
        domReferenceRef.current = domReferenceElement;
      }
    }, [domReferenceElement]);
    useIsoLayoutEffect(() => {
      store.context.dataRef.current.floatingContext = context;
      const node = tree?.nodesRef.current.find((n) => n.id === nodeId);
      if (node) {
        node.context = context;
      }
    });
    return React33.useMemo(() => ({
      ...position,
      context,
      refs,
      elements,
      rootStore: store
    }), [position, refs, elements, context, store]);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs
  var React34 = __toESM(require_react(), 1);
  var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit;
  function useFocus(context, props = {}) {
    const {
      enabled = true,
      delay
    } = props;
    const store = "rootStore" in context ? context.rootStore : context;
    const {
      events,
      dataRef
    } = store.context;
    const blockFocusRef = React34.useRef(false);
    const blockedReferenceRef = React34.useRef(null);
    const keyboardModalityRef = React34.useRef(true);
    const timeout = useTimeout();
    React34.useEffect(() => {
      const domReference = store.select("domReferenceElement");
      if (!enabled) {
        return void 0;
      }
      const win = getWindow(domReference);
      function onBlur() {
        const currentDomReference = store.select("domReferenceElement");
        if (!store.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {
          blockFocusRef.current = true;
          blockedReferenceRef.current = currentDomReference;
        }
      }
      function onKeyDown() {
        keyboardModalityRef.current = true;
      }
      function onPointerDown() {
        keyboardModalityRef.current = false;
      }
      return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true));
    }, [store, enabled]);
    React34.useEffect(() => {
      if (!enabled) {
        return void 0;
      }
      function onOpenChangeLocal(details) {
        if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) {
          const referenceElement = store.select("domReferenceElement");
          if (isElement(referenceElement)) {
            blockedReferenceRef.current = referenceElement;
            blockFocusRef.current = true;
          }
        }
      }
      events.on("openchange", onOpenChangeLocal);
      return () => {
        events.off("openchange", onOpenChangeLocal);
      };
    }, [events, enabled, store]);
    const reference = React34.useMemo(() => {
      function resetBlockedFocus() {
        blockFocusRef.current = false;
        blockedReferenceRef.current = null;
      }
      return {
        onMouseLeave() {
          resetBlockedFocus();
        },
        onFocus(event) {
          const focusTarget = event.currentTarget;
          if (blockFocusRef.current) {
            if (blockedReferenceRef.current === focusTarget) {
              return;
            }
            resetBlockedFocus();
          }
          const target = getTarget(event.nativeEvent);
          if (isElement(target)) {
            if (isMacSafari && !event.relatedTarget) {
              if (!keyboardModalityRef.current && !isTypeableElement(target)) {
                return;
              }
            } else if (!matchesFocusVisible(target)) {
              return;
            }
          }
          const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);
          const {
            nativeEvent,
            currentTarget
          } = event;
          const delayValue = typeof delay === "function" ? delay() : delay;
          if (store.select("open") && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === void 0) {
            store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget));
            return;
          }
          timeout.start(delayValue, () => {
            if (blockFocusRef.current) {
              return;
            }
            store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget));
          });
        },
        onBlur(event) {
          resetBlockedFocus();
          const relatedTarget = event.relatedTarget;
          const nativeEvent = event.nativeEvent;
          const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
          timeout.start(0, () => {
            const domReference = store.select("domReferenceElement");
            const activeEl = activeElement(ownerDocument(domReference));
            if (!relatedTarget && activeEl === domReference) {
              return;
            }
            if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {
              return;
            }
            const nextFocusedElement = relatedTarget ?? activeEl;
            if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) {
              return;
            }
            store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent));
          });
        }
      };
    }, [dataRef, delay, store, timeout]);
    return React34.useMemo(() => enabled ? {
      reference,
      trigger: reference
    } : {}, [enabled, reference]);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
  var React35 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs
  var HoverInteraction = class _HoverInteraction {
    constructor() {
      this.pointerType = void 0;
      this.interactedInside = false;
      this.handler = void 0;
      this.blockMouseMove = true;
      this.performedPointerEventsMutation = false;
      this.pointerEventsScopeElement = null;
      this.pointerEventsReferenceElement = null;
      this.pointerEventsFloatingElement = null;
      this.restTimeoutPending = false;
      this.openChangeTimeout = new Timeout();
      this.restTimeout = new Timeout();
      this.handleCloseOptions = void 0;
    }
    static create() {
      return new _HoverInteraction();
    }
    dispose = () => {
      this.openChangeTimeout.clear();
      this.restTimeout.clear();
    };
    disposeEffect = () => {
      return this.dispose;
    };
  };
  var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap();
  function clearSafePolygonPointerEventsMutation(instance) {
    if (!instance.performedPointerEventsMutation) {
      return;
    }
    const scopeElement = instance.pointerEventsScopeElement;
    if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) {
      instance.pointerEventsScopeElement?.style.removeProperty("pointer-events");
      instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events");
      instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events");
      pointerEventsMutationOwnerByScopeElement.delete(scopeElement);
    }
    instance.performedPointerEventsMutation = false;
    instance.pointerEventsScopeElement = null;
    instance.pointerEventsReferenceElement = null;
    instance.pointerEventsFloatingElement = null;
  }
  function applySafePolygonPointerEventsMutation(instance, options) {
    const {
      scopeElement,
      referenceElement,
      floatingElement
    } = options;
    const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement);
    if (existingOwner && existingOwner !== instance) {
      clearSafePolygonPointerEventsMutation(existingOwner);
    }
    clearSafePolygonPointerEventsMutation(instance);
    instance.performedPointerEventsMutation = true;
    instance.pointerEventsScopeElement = scopeElement;
    instance.pointerEventsReferenceElement = referenceElement;
    instance.pointerEventsFloatingElement = floatingElement;
    pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance);
    scopeElement.style.pointerEvents = "none";
    referenceElement.style.pointerEvents = "auto";
    floatingElement.style.pointerEvents = "auto";
  }
  function useHoverInteractionSharedState(store) {
    const data = store.context.dataRef.current;
    const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current;
    if (!data.hoverInteractionState) {
      data.hoverInteractionState = instance;
    }
    useOnMount(data.hoverInteractionState.disposeEffect);
    return data.hoverInteractionState;
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
  function useHoverFloatingInteraction(context, parameters = {}) {
    const {
      enabled = true,
      closeDelay: closeDelayProp = 0,
      nodeId: nodeIdProp
    } = parameters;
    const store = "rootStore" in context ? context.rootStore : context;
    const open2 = store.useState("open");
    const floatingElement = store.useState("floatingElement");
    const domReferenceElement = store.useState("domReferenceElement");
    const {
      dataRef
    } = store.context;
    const tree = useFloatingTree();
    const parentId = useFloatingParentNodeId();
    const instance = useHoverInteractionSharedState(store);
    const childClosedTimeout = useTimeout();
    const isClickLikeOpenEvent2 = useStableCallback(() => {
      return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside);
    });
    const isHoverOpen = useStableCallback(() => {
      return isHoverOpenEvent(dataRef.current.openEvent?.type);
    });
    const clearPointerEvents = useStableCallback(() => {
      clearSafePolygonPointerEventsMutation(instance);
    });
    useIsoLayoutEffect(() => {
      if (!open2) {
        instance.pointerType = void 0;
        instance.restTimeoutPending = false;
        instance.interactedInside = false;
        clearPointerEvents();
      }
    }, [open2, instance, clearPointerEvents]);
    React35.useEffect(() => {
      return clearPointerEvents;
    }, [clearPointerEvents]);
    useIsoLayoutEffect(() => {
      if (!enabled) {
        return void 0;
      }
      if (open2 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) {
        const ref = domReferenceElement;
        const floatingEl = floatingElement;
        const doc = ownerDocument(floatingElement);
        const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating;
        if (parentFloating) {
          parentFloating.style.pointerEvents = "";
        }
        const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null;
        const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null;
        const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? ref.closest("[data-rootownerid]") ?? doc.body;
        applySafePolygonPointerEventsMutation(instance, {
          scopeElement,
          referenceElement: ref,
          floatingElement: floatingEl
        });
        return () => {
          clearPointerEvents();
        };
      }
      return void 0;
    }, [enabled, open2, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]);
    React35.useEffect(() => {
      if (!enabled) {
        return void 0;
      }
      function hasParentChildren() {
        return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0);
      }
      function closeWithDelay(event) {
        const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType);
        const close = () => {
          store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
          tree?.events.emit("floating.closed", event);
        };
        if (closeDelay) {
          instance.openChangeTimeout.start(closeDelay, close);
        } else {
          instance.openChangeTimeout.clear();
          close();
        }
      }
      function handleInteractInside(event) {
        const target = getTarget(event);
        if (!isInteractiveElement(target)) {
          instance.interactedInside = false;
          return;
        }
        instance.interactedInside = target?.closest("[aria-haspopup]") != null;
      }
      function onFloatingMouseEnter() {
        instance.openChangeTimeout.clear();
        childClosedTimeout.clear();
        tree?.events.off("floating.closed", onNodeClosed);
        clearPointerEvents();
      }
      function onFloatingMouseLeave(event) {
        if (hasParentChildren() && tree) {
          tree.events.on("floating.closed", onNodeClosed);
          return;
        }
        if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {
          return;
        }
        const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp;
        const relatedTarget = event.relatedTarget;
        const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget));
        if (isMovingIntoDescendantFloating) {
          return;
        }
        if (instance.handler) {
          instance.handler(event);
          return;
        }
        clearPointerEvents();
        if (isHoverOpen() && !isClickLikeOpenEvent2()) {
          closeWithDelay(event);
        }
      }
      function onNodeClosed(event) {
        if (!tree || !parentId || hasParentChildren()) {
          return;
        }
        childClosedTimeout.start(0, () => {
          tree.events.off("floating.closed", onNodeClosed);
          store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
          tree.events.emit("floating.closed", event);
        });
      }
      const floating = floatingElement;
      return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => {
        tree?.events.off("floating.closed", onNodeClosed);
      });
    }, [enabled, floatingElement, store, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs
  var React36 = __toESM(require_react(), 1);
  var ReactDOM5 = __toESM(require_react_dom(), 1);
  var EMPTY_REF = {
    current: null
  };
  function useHoverReferenceInteraction(context, props = {}) {
    const {
      enabled = true,
      delay = 0,
      handleClose = null,
      mouseOnly = false,
      restMs = 0,
      move = true,
      triggerElementRef = EMPTY_REF,
      externalTree,
      isActiveTrigger = true,
      getHandleCloseContext,
      isClosing,
      shouldOpen: shouldOpenProp,
      guardStaleOpen = false
    } = props;
    const store = "rootStore" in context ? context.rootStore : context;
    const {
      dataRef,
      events
    } = store.context;
    const tree = useFloatingTree(externalTree);
    const instance = useHoverInteractionSharedState(store);
    const isHoverCloseActiveRef = React36.useRef(false);
    const handleCloseRef = useValueAsRef(handleClose);
    const delayRef = useValueAsRef(delay);
    const restMsRef = useValueAsRef(restMs);
    const enabledRef = useValueAsRef(enabled);
    const shouldOpenRef = useValueAsRef(shouldOpenProp);
    const isClosingRef = useValueAsRef(isClosing);
    const isClickLikeOpenEvent2 = useStableCallback(() => {
      return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside);
    });
    const checkShouldOpen = useStableCallback(() => {
      return shouldOpenRef.current?.() !== false;
    });
    const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => {
      const allTriggers = store.context.triggerElements;
      if (allTriggers.hasElement(currentTarget)) {
        return !currentDomReference || !contains(currentDomReference, currentTarget);
      }
      if (!isElement(target)) {
        return false;
      }
      const targetElement = target;
      return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement));
    });
    const cleanupMouseMoveHandler = useStableCallback(() => {
      if (!instance.handler) {
        return;
      }
      const doc = ownerDocument(store.select("domReferenceElement"));
      doc.removeEventListener("mousemove", instance.handler);
      instance.handler = void 0;
    });
    const clearPointerEvents = useStableCallback(() => {
      clearSafePolygonPointerEventsMutation(instance);
    });
    if (isActiveTrigger) {
      instance.handleCloseOptions = handleClose?.__options;
    }
    React36.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]);
    React36.useEffect(() => {
      if (!enabled) {
        return void 0;
      }
      function onOpenChangeLocal(details) {
        if (!details.open) {
          isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover;
          cleanupMouseMoveHandler();
          instance.openChangeTimeout.clear();
          instance.restTimeout.clear();
          instance.blockMouseMove = true;
          instance.restTimeoutPending = false;
        } else {
          isHoverCloseActiveRef.current = false;
        }
      }
      events.on("openchange", onOpenChangeLocal);
      return () => {
        events.off("openchange", onOpenChangeLocal);
      };
    }, [enabled, events, instance, cleanupMouseMoveHandler]);
    React36.useEffect(() => {
      if (!enabled) {
        return void 0;
      }
      function closeWithDelay(event, runElseBranch = true) {
        const closeDelay = getDelay(delayRef.current, "close", instance.pointerType);
        if (closeDelay) {
          instance.openChangeTimeout.start(closeDelay, () => {
            store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
            tree?.events.emit("floating.closed", event);
          });
        } else if (runElseBranch) {
          instance.openChangeTimeout.clear();
          store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
          tree?.events.emit("floating.closed", event);
        }
      }
      const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select("domReferenceElement") : null);
      if (!isElement(trigger)) {
        return void 0;
      }
      function onMouseEnter(event) {
        instance.openChangeTimeout.clear();
        instance.blockMouseMove = false;
        if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {
          return;
        }
        const restMsValue = getRestMs(restMsRef.current);
        const openDelay = getDelay(delayRef.current, "open", instance.pointerType);
        const eventTarget = getTarget(event);
        const currentTarget = event.currentTarget ?? null;
        const currentDomReference = store.select("domReferenceElement");
        let triggerNode = currentTarget;
        if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) {
          for (const triggerElement of store.context.triggerElements.elements()) {
            if (contains(triggerElement, eventTarget)) {
              triggerNode = triggerElement;
              break;
            }
          }
        }
        if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) {
          triggerNode = currentDomReference;
        }
        const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget);
        const isOpen = store.select("open");
        const isInClosingTransition = isClosingRef.current?.() ?? store.select("transitionStatus") === "ending";
        const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current;
        const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition;
        const isRestOnlyDelay = restMsValue > 0 && !openDelay;
        const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition;
        const shouldOpen = !isOpen || isOverInactive;
        if (shouldOpenImmediately) {
          if (checkShouldOpen()) {
            store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
          }
          return;
        }
        if (isRestOnlyDelay) {
          return;
        }
        if (openDelay) {
          instance.openChangeTimeout.start(openDelay, () => {
            if (shouldOpen && checkShouldOpen()) {
              store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
            }
          });
        } else if (shouldOpen) {
          if (checkShouldOpen()) {
            store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
          }
        }
      }
      function onMouseLeave(event) {
        if (isClickLikeOpenEvent2()) {
          clearPointerEvents();
          return;
        }
        cleanupMouseMoveHandler();
        const domReferenceElement = store.select("domReferenceElement");
        const doc = ownerDocument(domReferenceElement);
        instance.restTimeout.clear();
        instance.restTimeoutPending = false;
        const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.();
        if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {
          return;
        }
        if (handleCloseRef.current && handleCloseContextBase) {
          if (!store.select("open")) {
            instance.openChangeTimeout.clear();
          }
          const currentTrigger = triggerElementRef.current;
          instance.handler = handleCloseRef.current({
            ...handleCloseContextBase,
            tree,
            x: event.clientX,
            y: event.clientY,
            onClose() {
              clearPointerEvents();
              cleanupMouseMoveHandler();
              if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store.select("domReferenceElement")) {
                closeWithDelay(event, true);
              }
            }
          });
          doc.addEventListener("mousemove", instance.handler);
          instance.handler(event);
          return;
        }
        const shouldClose = instance.pointerType === "touch" ? !contains(store.select("floatingElement"), event.relatedTarget) : true;
        if (shouldClose) {
          closeWithDelay(event);
        }
      }
      function onMouseOut(event) {
        if (contains(trigger, event.relatedTarget)) {
          return;
        }
        instance.openChangeTimeout.clear();
        instance.restTimeout.clear();
        instance.restTimeoutPending = false;
      }
      const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0;
      if (move) {
        return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, {
          once: true
        }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard);
      }
      return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard);
    }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]);
    return React36.useMemo(() => {
      if (!enabled) {
        return void 0;
      }
      function setPointerRef(event) {
        instance.pointerType = event.pointerType;
      }
      return {
        onPointerDown: setPointerRef,
        onPointerEnter: setPointerRef,
        onMouseMove(event) {
          const {
            nativeEvent
          } = event;
          const trigger = event.currentTarget;
          const currentDomReference = store.select("domReferenceElement");
          const currentOpen = store.select("open");
          const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target);
          if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {
            return;
          }
          if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) {
            const floatingElement = store.select("floatingElement");
            if (floatingElement) {
              const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body;
              applySafePolygonPointerEventsMutation(instance, {
                scopeElement,
                referenceElement: trigger,
                floatingElement
              });
            }
          }
          const restMsValue = getRestMs(restMsRef.current);
          if (currentOpen && !isOverInactive || restMsValue === 0) {
            return;
          }
          if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) {
            return;
          }
          instance.restTimeout.clear();
          function handleMouseMove() {
            instance.restTimeoutPending = false;
            if (isClickLikeOpenEvent2()) {
              return;
            }
            const latestOpen = store.select("open");
            if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) {
              store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger));
            }
          }
          if (instance.pointerType === "touch") {
            ReactDOM5.flushSync(() => {
              handleMouseMove();
            });
          } else if (isOverInactive && currentOpen) {
            handleMouseMove();
          } else {
            instance.restTimeoutPending = true;
            instance.restTimeout.start(restMsValue, handleMouseMove);
          }
        }
      };
    }, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store, restMsRef, checkShouldOpen]);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs
  var React37 = __toESM(require_react(), 1);
  var ESCAPE = "Escape";
  function isStationaryWebKitPointer(event) {
    return parts_exports.engine.webkit && event.movementX === 0 && event.movementY === 0;
  }
  function doSwitch(orientation, vertical, horizontal) {
    switch (orientation) {
      case "vertical":
        return vertical;
      case "horizontal":
        return horizontal;
      default:
        return vertical || horizontal;
    }
  }
  function isMainOrientationKey(key, orientation) {
    const vertical = key === ARROW_UP || key === ARROW_DOWN;
    const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;
    return doSwitch(orientation, vertical, horizontal);
  }
  function isMainOrientationToEndKey(key, orientation, rtl) {
    const vertical = key === ARROW_DOWN;
    const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;
    return doSwitch(orientation, vertical, horizontal) || key === "Enter" || key === " " || key === "";
  }
  function isCrossOrientationOpenKey(key, orientation, rtl) {
    const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;
    const horizontal = key === ARROW_DOWN;
    return doSwitch(orientation, vertical, horizontal);
  }
  function isCrossOrientationCloseKey(key, orientation, rtl, grid) {
    const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;
    const horizontal = key === ARROW_UP;
    if (orientation === "both" || orientation === "horizontal" && grid) {
      return key === ESCAPE;
    }
    return doSwitch(orientation, vertical, horizontal);
  }
  function useListNavigation(context, props) {
    const {
      listRef,
      activeIndex,
      onNavigate: onNavigateProp = () => {
      },
      enabled = true,
      selectedIndex = null,
      allowEscape = false,
      loopFocus = false,
      nested = false,
      rtl = false,
      virtual = false,
      focusItemOnOpen = "auto",
      focusItemOnHover = true,
      openOnArrowKeyDown = true,
      disabledIndices = void 0,
      orientation = "vertical",
      parentOrientation,
      id,
      resetOnPointerLeave = true,
      externalTree,
      grid: navigateGrid
    } = props;
    const isGrid2 = navigateGrid != null;
    if (true) {
      if (allowEscape) {
        if (!loopFocus) {
          console.warn("`useListNavigation` looping must be enabled to allow escaping.");
        }
        if (!virtual) {
          console.warn("`useListNavigation` must be virtual to allow escaping.");
        }
      }
      if (orientation === "vertical" && isGrid2) {
        console.warn("In grid list navigation mode, the `orientation` should", 'be either "horizontal" or "both".');
      }
    }
    const store = "rootStore" in context ? context.rootStore : context;
    const open2 = store.useState("open");
    const floatingElement = store.useState("floatingElement");
    const domReferenceElement = store.useState("domReferenceElement");
    const dataRef = store.context.dataRef;
    const floatingFocusElement = getFloatingFocusElement(floatingElement);
    const typeableComboboxReference = isTypeableCombobox(domReferenceElement);
    const floatingFocusElementRef = useValueAsRef(floatingFocusElement);
    const parentId = useFloatingParentNodeId();
    const tree = useFloatingTree(externalTree);
    const focusItemOnOpenRef = React37.useRef(focusItemOnOpen);
    const indexRef = React37.useRef(selectedIndex ?? -1);
    const keyRef = React37.useRef(null);
    const isPointerModalityRef = React37.useRef(true);
    const onNavigate = useStableCallback((event) => {
      onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);
    });
    const previousMountedRef = React37.useRef(!!floatingElement);
    const previousOpenRef = React37.useRef(open2);
    const forceSyncFocusRef = React37.useRef(false);
    const forceScrollIntoViewRef = React37.useRef(false);
    const cancelQueuedFocusRef = React37.useRef(null);
    const disabledIndicesRef = useValueAsRef(disabledIndices);
    const latestOpenRef = useValueAsRef(open2);
    const selectedIndexRef = useValueAsRef(selectedIndex);
    const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);
    const focusFrame = useAnimationFrame();
    const waitForListPopulatedFrame = useAnimationFrame();
    const focusItem = useStableCallback(() => {
      function runFocus(item2) {
        if (virtual) {
          tree?.events.emit("virtualfocus", item2);
        } else {
          cancelQueuedFocusRef.current = enqueueFocus(item2, {
            sync: forceSyncFocusRef.current,
            preventScroll: true
          });
        }
      }
      const initialItem = listRef.current[indexRef.current];
      const forceScrollIntoView = forceScrollIntoViewRef.current;
      if (initialItem) {
        runFocus(initialItem);
      }
      const scheduler2 = forceSyncFocusRef.current ? (callback) => callback() : (callback) => focusFrame.request(callback);
      scheduler2(() => {
        const waitedItem = listRef.current[indexRef.current] || initialItem;
        if (!waitedItem) {
          return;
        }
        if (!initialItem) {
          runFocus(waitedItem);
        }
        const shouldScrollIntoView = (
          // eslint-disable-next-line @typescript-eslint/no-use-before-define
          item && (forceScrollIntoView || !isPointerModalityRef.current)
        );
        if (shouldScrollIntoView) {
          waitedItem.scrollIntoView?.({
            block: "nearest",
            inline: "nearest"
          });
        }
      });
    });
    useIsoLayoutEffect(() => {
      dataRef.current.orientation = orientation;
    }, [dataRef, orientation]);
    useIsoLayoutEffect(() => {
      if (!enabled) {
        return;
      }
      if (open2 && floatingElement) {
        indexRef.current = selectedIndex ?? -1;
        if (focusItemOnOpenRef.current && selectedIndex != null) {
          forceScrollIntoViewRef.current = true;
          onNavigate();
        }
      } else if (previousMountedRef.current) {
        indexRef.current = -1;
        onNavigate();
      }
    }, [enabled, open2, floatingElement, selectedIndex, onNavigate]);
    useIsoLayoutEffect(() => {
      if (!enabled) {
        return;
      }
      if (!open2) {
        forceSyncFocusRef.current = false;
        return;
      }
      if (!floatingElement) {
        return;
      }
      if (activeIndex == null) {
        forceSyncFocusRef.current = false;
        if (selectedIndexRef.current != null) {
          return;
        }
        if (previousMountedRef.current) {
          indexRef.current = -1;
          focusItem();
        }
        if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {
          let runs = 0;
          const waitForListPopulated = () => {
            if (listRef.current[0] == null) {
              if (runs < 2) {
                const scheduler2 = runs ? (callback) => waitForListPopulatedFrame.request(callback) : queueMicrotask;
                scheduler2(waitForListPopulated);
              }
              runs += 1;
            } else {
              indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);
              keyRef.current = null;
              onNavigate();
            }
          };
          waitForListPopulated();
        }
      } else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {
        indexRef.current = activeIndex;
        focusItem();
        forceScrollIntoViewRef.current = false;
      }
    }, [enabled, open2, floatingElement, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, waitForListPopulatedFrame]);
    useIsoLayoutEffect(() => {
      if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) {
        return;
      }
      const nodes = tree.nodesRef.current;
      const parent = nodes.find((node) => node.id === parentId)?.context?.elements.floating;
      const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));
      const treeContainsActiveEl = nodes.some((node) => node.context && contains(node.context.elements.floating, activeEl));
      if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {
        parent.focus({
          preventScroll: true
        });
      }
    }, [enabled, floatingElement, domReferenceElement, tree, parentId, virtual]);
    useIsoLayoutEffect(() => {
      previousOpenRef.current = open2;
      previousMountedRef.current = !!floatingElement;
    });
    useIsoLayoutEffect(() => {
      if (!open2) {
        keyRef.current = null;
        focusItemOnOpenRef.current = focusItemOnOpen;
      }
    }, [open2, focusItemOnOpen]);
    const hasActiveIndex = activeIndex != null;
    const syncCurrentTarget = useStableCallback((event) => {
      if (!latestOpenRef.current) {
        return;
      }
      const index2 = listRef.current.indexOf(event.currentTarget);
      if (index2 !== -1 && (indexRef.current !== index2 || activeIndex !== index2)) {
        indexRef.current = index2;
        onNavigate(event);
      }
    });
    const getParentOrientation = useStableCallback(() => {
      return parentOrientation ?? tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.dataRef?.current.orientation;
    });
    const getMinEnabledIndex = useStableCallback(() => {
      return getMinListIndex(listRef, disabledIndicesRef.current);
    });
    const commonOnKeyDown = useStableCallback((event) => {
      isPointerModalityRef.current = false;
      forceSyncFocusRef.current = true;
      if (event.which === 229) {
        return;
      }
      if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {
        return;
      }
      if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid2)) {
        if (!isMainOrientationKey(event.key, getParentOrientation())) {
          stopEvent(event);
        }
        store.setOpen(false, createChangeEventDetails(reason_parts_exports.listNavigation, event.nativeEvent));
        if (isHTMLElement(domReferenceElement)) {
          if (virtual) {
            tree?.events.emit("virtualfocus", domReferenceElement);
          } else {
            domReferenceElement.focus();
          }
        }
        return;
      }
      const currentIndex = indexRef.current;
      const minIndex = getMinListIndex(listRef, disabledIndices);
      const maxIndex = getMaxListIndex(listRef, disabledIndices);
      if (!typeableComboboxReference) {
        if (event.key === "Home") {
          stopEvent(event);
          indexRef.current = minIndex;
          onNavigate(event);
        }
        if (event.key === "End") {
          stopEvent(event);
          indexRef.current = maxIndex;
          onNavigate(event);
        }
      }
      if (navigateGrid != null) {
        const index2 = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);
        if (index2 != null) {
          indexRef.current = index2;
          onNavigate(event);
        }
        if (orientation === "both") {
          return;
        }
      }
      if (isMainOrientationKey(event.key, orientation)) {
        stopEvent(event);
        if (open2 && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {
          indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;
          onNavigate(event);
          return;
        }
        if (isMainOrientationToEndKey(event.key, orientation, rtl)) {
          if (loopFocus) {
            if (currentIndex >= maxIndex) {
              if (allowEscape && currentIndex !== listRef.current.length) {
                indexRef.current = -1;
              } else {
                forceSyncFocusRef.current = false;
                indexRef.current = minIndex;
              }
            } else {
              indexRef.current = findNonDisabledListIndex(listRef.current, {
                startingIndex: currentIndex,
                disabledIndices
              });
            }
          } else {
            indexRef.current = Math.min(maxIndex, findNonDisabledListIndex(listRef.current, {
              startingIndex: currentIndex,
              disabledIndices
            }));
          }
        } else if (loopFocus) {
          if (currentIndex <= minIndex) {
            if (allowEscape && currentIndex !== -1) {
              indexRef.current = listRef.current.length;
            } else {
              forceSyncFocusRef.current = false;
              indexRef.current = maxIndex;
            }
          } else {
            indexRef.current = findNonDisabledListIndex(listRef.current, {
              startingIndex: currentIndex,
              decrement: true,
              disabledIndices
            });
          }
        } else {
          indexRef.current = Math.max(minIndex, findNonDisabledListIndex(listRef.current, {
            startingIndex: currentIndex,
            decrement: true,
            disabledIndices
          }));
        }
        if (isIndexOutOfListBounds(listRef.current, indexRef.current)) {
          indexRef.current = -1;
        }
        onNavigate(event);
      }
    });
    const item = React37.useMemo(() => {
      const itemProps = {
        onFocus(event) {
          forceSyncFocusRef.current = true;
          syncCurrentTarget(event);
        },
        onClick: ({
          currentTarget
        }) => currentTarget.focus({
          preventScroll: true
        }),
        // Safari
        onMouseMove(event) {
          if (isStationaryWebKitPointer(event)) {
            return;
          }
          forceSyncFocusRef.current = true;
          forceScrollIntoViewRef.current = false;
          if (focusItemOnHover) {
            syncCurrentTarget(event);
          }
        },
        onPointerLeave(event) {
          if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === "touch") {
            return;
          }
          forceSyncFocusRef.current = true;
          const relatedTarget = event.relatedTarget;
          if (!focusItemOnHover || listRef.current.includes(relatedTarget)) {
            return;
          }
          if (!resetOnPointerLeaveRef.current) {
            return;
          }
          cancelQueuedFocusRef.current?.();
          cancelQueuedFocusRef.current = null;
          indexRef.current = -1;
          onNavigate(event);
          if (!virtual) {
            const floatingFocusEl = floatingFocusElementRef.current;
            const activeEl = activeElement(ownerDocument(floatingFocusEl));
            if (floatingFocusEl && contains(floatingFocusEl, activeEl)) {
              floatingFocusEl.focus({
                preventScroll: true
              });
            }
          }
        }
      };
      return itemProps;
    }, [syncCurrentTarget, latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, resetOnPointerLeaveRef, virtual]);
    const ariaActiveDescendantProp = React37.useMemo(() => {
      return virtual && open2 && hasActiveIndex && {
        "aria-activedescendant": `${id}-${activeIndex}`
      };
    }, [virtual, open2, hasActiveIndex, id, activeIndex]);
    const floating = React37.useMemo(() => {
      return {
        ...!typeableComboboxReference ? ariaActiveDescendantProp : {},
        onKeyDown(event) {
          if (event.key === "Tab" && event.shiftKey && open2 && !virtual) {
            const target = getTarget(event.nativeEvent);
            if (target && !contains(floatingFocusElementRef.current, target)) {
              return;
            }
            stopEvent(event);
            store.setOpen(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent));
            if (isHTMLElement(domReferenceElement)) {
              domReferenceElement.focus();
            }
            return;
          }
          commonOnKeyDown(event);
        },
        onPointerMove(event) {
          if (isStationaryWebKitPointer(event)) {
            return;
          }
          isPointerModalityRef.current = true;
        }
      };
    }, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, typeableComboboxReference, store, open2, virtual, domReferenceElement]);
    const trigger = React37.useMemo(() => {
      function openOnNavigationKeyDown(event) {
        store.setOpen(true, createChangeEventDetails(reason_parts_exports.listNavigation, event.nativeEvent, event.currentTarget));
      }
      function checkVirtualMouse(event) {
        if (focusItemOnOpen === "auto" && isVirtualClick(event.nativeEvent)) {
          focusItemOnOpenRef.current = !virtual;
        }
      }
      function checkVirtualPointer(event) {
        focusItemOnOpenRef.current = focusItemOnOpen;
        if (focusItemOnOpen === "auto" && isVirtualPointerEvent(event.nativeEvent)) {
          focusItemOnOpenRef.current = true;
        }
      }
      return {
        onKeyDown(event) {
          const currentOpen = store.select("open");
          isPointerModalityRef.current = false;
          const isArrowKey = event.key.startsWith("Arrow");
          const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);
          const isMainKey = isMainOrientationKey(event.key, orientation);
          const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === "Enter" || event.key.trim() === "";
          if (virtual && currentOpen) {
            return commonOnKeyDown(event);
          }
          if (!currentOpen && !openOnArrowKeyDown && isArrowKey) {
            return void 0;
          }
          if (isNavigationKey) {
            const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());
            keyRef.current = nested && isParentMainKey ? null : event.key;
          }
          if (nested) {
            if (isParentCrossOpenKey) {
              stopEvent(event);
              if (currentOpen) {
                indexRef.current = getMinEnabledIndex();
                onNavigate(event);
              } else {
                openOnNavigationKeyDown(event);
              }
            }
            return void 0;
          }
          if (isMainKey) {
            if (selectedIndexRef.current != null) {
              indexRef.current = selectedIndexRef.current;
            }
            stopEvent(event);
            if (!currentOpen && openOnArrowKeyDown) {
              openOnNavigationKeyDown(event);
            } else {
              commonOnKeyDown(event);
            }
            if (currentOpen) {
              onNavigate(event);
            }
          }
          return void 0;
        },
        onFocus(event) {
          if (store.select("open") && !virtual) {
            indexRef.current = -1;
            onNavigate(event);
          }
        },
        onPointerDown: checkVirtualPointer,
        onPointerEnter: checkVirtualPointer,
        onMouseDown: checkVirtualMouse,
        onClick: checkVirtualMouse
      };
    }, [commonOnKeyDown, focusItemOnOpen, getMinEnabledIndex, nested, onNavigate, store, openOnArrowKeyDown, orientation, getParentOrientation, rtl, selectedIndexRef, virtual]);
    const reference = React37.useMemo(() => {
      return {
        ...ariaActiveDescendantProp,
        ...trigger
      };
    }, [ariaActiveDescendantProp, trigger]);
    return React37.useMemo(() => enabled ? {
      reference,
      floating,
      item,
      trigger
    } : {}, [enabled, reference, floating, trigger, item]);
  }

  // node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs
  var React38 = __toESM(require_react(), 1);
  function useTypeahead(context, props) {
    const {
      listRef,
      elementsRef,
      activeIndex,
      onMatch: onMatchProp,
      disabledIndices,
      onTyping,
      enabled = true,
      resetMs = 750,
      selectedIndex = null
    } = props;
    const store = "rootStore" in context ? context.rootStore : context;
    const open2 = store.useState("open");
    const timeout = useTimeout();
    const stringRef = React38.useRef("");
    const prevIndexRef = React38.useRef(selectedIndex ?? activeIndex ?? -1);
    const matchIndexRef = React38.useRef(null);
    const onKeyDown = useStableCallback((event) => {
      function getElement(index3) {
        return elementsRef?.current[index3];
      }
      function isItemAvailable(index3) {
        const element = getElement(index3);
        if (element && !isElementVisible(element) || element?.matches(":disabled")) {
          return false;
        }
        return disabledIndices == null || !isListIndexDisabled(EMPTY_ARRAY, index3, disabledIndices);
      }
      function getMatchingIndex(list, string, startIndex2 = 0) {
        if (list.length === 0) {
          return -1;
        }
        const normalizedStartIndex = (startIndex2 % list.length + list.length) % list.length;
        const lowerString = string.toLowerCase();
        for (let offset4 = 0; offset4 < list.length; offset4 += 1) {
          const index3 = (normalizedStartIndex + offset4) % list.length;
          const text = list[index3];
          if (!text?.toLowerCase().startsWith(lowerString) || !isItemAvailable(index3)) {
            continue;
          }
          return index3;
        }
        return -1;
      }
      const listContent = listRef.current;
      if (stringRef.current.length > 0 && event.key === " ") {
        stopEvent(event);
        onTyping?.(true);
      }
      if (stringRef.current.length > 0 && stringRef.current[0] !== " ") {
        if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== " ") {
          onTyping?.(false);
        }
      }
      if (listContent == null || // Character key.
      event.key.length !== 1 || // Modifier key.
      event.ctrlKey || event.metaKey || event.altKey) {
        return;
      }
      if (open2 && event.key !== " ") {
        stopEvent(event);
        onTyping?.(true);
      }
      const isNewSession = stringRef.current === "";
      if (isNewSession) {
        prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;
      }
      const allowRapidSuccessionOfFirstLetter = listContent.every((text, index3) => text && isItemAvailable(index3) ? text[0]?.toLowerCase() !== text[1]?.toLowerCase() : true);
      if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {
        stringRef.current = "";
        prevIndexRef.current = matchIndexRef.current;
      }
      stringRef.current += event.key;
      timeout.start(resetMs, () => {
        stringRef.current = "";
        prevIndexRef.current = matchIndexRef.current;
        onTyping?.(false);
      });
      const prevIndex = isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current;
      const startIndex = (prevIndex ?? 0) + 1;
      const index2 = getMatchingIndex(listContent, stringRef.current, startIndex);
      if (index2 !== -1) {
        onMatchProp?.(index2);
        matchIndexRef.current = index2;
      } else if (event.key !== " ") {
        stringRef.current = "";
        onTyping?.(false);
      }
    });
    const onBlur = useStableCallback((event) => {
      const next = event.relatedTarget;
      const currentDomReferenceElement = store.select("domReferenceElement");
      const currentFloatingElement = store.select("floatingElement");
      const withinComposite = contains(currentDomReferenceElement, next) || contains(currentFloatingElement, next);
      if (withinComposite) {
        return;
      }
      timeout.clear();
      stringRef.current = "";
      prevIndexRef.current = matchIndexRef.current;
      onTyping?.(false);
    });
    useIsoLayoutEffect(() => {
      if (!open2 && selectedIndex !== null) {
        return;
      }
      timeout.clear();
      matchIndexRef.current = null;
      if (stringRef.current !== "") {
        stringRef.current = "";
      }
    }, [open2, selectedIndex, timeout]);
    const sharedProps = React38.useMemo(() => ({
      onKeyDown,
      onBlur
    }), [onKeyDown, onBlur]);
    return React38.useMemo(() => enabled ? {
      reference: sharedProps,
      floating: sharedProps
    } : {}, [enabled, sharedProps]);
  }

  // node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs
  var CURSOR_SPEED_THRESHOLD = 0.1;
  var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD;
  var POLYGON_BUFFER = 0.5;
  function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) {
    return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi;
  }
  function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) {
    let isInsideValue = false;
    if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) {
      isInsideValue = !isInsideValue;
    }
    if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) {
      isInsideValue = !isInsideValue;
    }
    if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) {
      isInsideValue = !isInsideValue;
    }
    if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) {
      isInsideValue = !isInsideValue;
    }
    return isInsideValue;
  }
  function isInsideRect(pointX, pointY, rect) {
    return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height;
  }
  function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) {
    const minX = Math.min(x1, x2);
    const maxX = Math.max(x1, x2);
    const minY = Math.min(y1, y2);
    const maxY = Math.max(y1, y2);
    return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY;
  }
  function safePolygon(options = {}) {
    const {
      blockPointerEvents = false
    } = options;
    const timeout = new Timeout();
    const fn = ({
      x: x2,
      y: y2,
      placement,
      elements,
      onClose,
      nodeId,
      tree
    }) => {
      const side = placement?.split("-")[0];
      let hasLanded = false;
      let lastX = null;
      let lastY = null;
      let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0;
      function isCursorMovingSlowly(nextX, nextY) {
        const currentTime = performance.now();
        const elapsedTime = currentTime - lastCursorTime;
        if (lastX === null || lastY === null || elapsedTime === 0) {
          lastX = nextX;
          lastY = nextY;
          lastCursorTime = currentTime;
          return false;
        }
        const deltaX = nextX - lastX;
        const deltaY = nextY - lastY;
        const distanceSquared = deltaX * deltaX + deltaY * deltaY;
        const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED;
        lastX = nextX;
        lastY = nextY;
        lastCursorTime = currentTime;
        return distanceSquared < thresholdSquared;
      }
      function close() {
        timeout.clear();
        onClose();
      }
      return function onMouseMove(event) {
        timeout.clear();
        const domReference = elements.domReference;
        const floating = elements.floating;
        if (!domReference || !floating || side == null || x2 == null || y2 == null) {
          return void 0;
        }
        const {
          clientX,
          clientY
        } = event;
        const target = getTarget(event);
        const isLeave = event.type === "mouseleave";
        const isOverFloatingEl = contains(floating, target);
        const isOverReferenceEl = contains(domReference, target);
        if (isOverFloatingEl) {
          hasLanded = true;
          if (!isLeave) {
            return void 0;
          }
        }
        if (isOverReferenceEl) {
          hasLanded = false;
          if (!isLeave) {
            hasLanded = true;
            return void 0;
          }
        }
        if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) {
          return void 0;
        }
        function hasOpenChildNode() {
          return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0);
        }
        function closeIfNoOpenChild() {
          if (!hasOpenChildNode()) {
            close();
          }
        }
        if (hasOpenChildNode()) {
          return void 0;
        }
        const refRect = domReference.getBoundingClientRect();
        const rect = floating.getBoundingClientRect();
        const cursorLeaveFromRight = x2 > rect.right - rect.width / 2;
        const cursorLeaveFromBottom = y2 > rect.bottom - rect.height / 2;
        const isFloatingWider = rect.width > refRect.width;
        const isFloatingTaller = rect.height > refRect.height;
        const left = (isFloatingWider ? refRect : rect).left;
        const right = (isFloatingWider ? refRect : rect).right;
        const top = (isFloatingTaller ? refRect : rect).top;
        const bottom = (isFloatingTaller ? refRect : rect).bottom;
        if (side === "top" && y2 >= refRect.bottom - 1 || side === "bottom" && y2 <= refRect.top + 1 || side === "left" && x2 >= refRect.right - 1 || side === "right" && x2 <= refRect.left + 1) {
          closeIfNoOpenChild();
          return void 0;
        }
        let isInsideTroughRect = false;
        switch (side) {
          case "top":
            isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1);
            break;
          case "bottom":
            isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1);
            break;
          case "left":
            isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top);
            break;
          case "right":
            isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top);
            break;
          default:
        }
        if (isInsideTroughRect) {
          return void 0;
        }
        if (hasLanded && !isInsideRect(clientX, clientY, refRect)) {
          closeIfNoOpenChild();
          return void 0;
        }
        if (!isLeave && isCursorMovingSlowly(clientX, clientY)) {
          closeIfNoOpenChild();
          return void 0;
        }
        let isInsidePolygon = false;
        switch (side) {
          case "top": {
            const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
            const cursorPointOneX = isFloatingWider ? x2 + cursorXOffset : cursorLeaveFromRight ? x2 + cursorXOffset : x2 - cursorXOffset;
            const cursorPointTwoX = isFloatingWider ? x2 - cursorXOffset : cursorLeaveFromRight ? x2 + cursorXOffset : x2 - cursorXOffset;
            const cursorPointY = y2 + POLYGON_BUFFER + 1;
            const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top;
            const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER;
            isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);
            break;
          }
          case "bottom": {
            const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
            const cursorPointOneX = isFloatingWider ? x2 + cursorXOffset : cursorLeaveFromRight ? x2 + cursorXOffset : x2 - cursorXOffset;
            const cursorPointTwoX = isFloatingWider ? x2 - cursorXOffset : cursorLeaveFromRight ? x2 + cursorXOffset : x2 - cursorXOffset;
            const cursorPointY = y2 - POLYGON_BUFFER;
            const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom;
            const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER;
            isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);
            break;
          }
          case "left": {
            const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
            const cursorPointOneY = isFloatingTaller ? y2 + cursorYOffset : cursorLeaveFromBottom ? y2 + cursorYOffset : y2 - cursorYOffset;
            const cursorPointTwoY = isFloatingTaller ? y2 - cursorYOffset : cursorLeaveFromBottom ? y2 + cursorYOffset : y2 - cursorYOffset;
            const cursorPointX = x2 + POLYGON_BUFFER + 1;
            const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left;
            const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER;
            isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY);
            break;
          }
          case "right": {
            const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
            const cursorPointOneY = isFloatingTaller ? y2 + cursorYOffset : cursorLeaveFromBottom ? y2 + cursorYOffset : y2 - cursorYOffset;
            const cursorPointTwoY = isFloatingTaller ? y2 - cursorYOffset : cursorLeaveFromBottom ? y2 + cursorYOffset : y2 - cursorYOffset;
            const cursorPointX = x2 - POLYGON_BUFFER;
            const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right;
            const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER;
            isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom);
            break;
          }
          default:
        }
        if (!isInsidePolygon) {
          closeIfNoOpenChild();
        } else if (!hasLanded) {
          timeout.start(40, closeIfNoOpenChild);
        }
        return void 0;
      };
    };
    fn.__options = {
      ...options,
      blockPointerEvents
    };
    return fn;
  }

  // node_modules/@base-ui/react/utils/NullStore.mjs
  var NullStore = class extends ReactStore {
    // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding
    // `setState` alone would neutralize them today. They are overridden explicitly so the store stays
    // inert even if a future base-class change stops routing a mutator through `setState`.
    setState(_newState) {
    }
    update(_changes) {
    }
    set(_key, _value) {
    }
    notifyAll() {
    }
  };

  // node_modules/@base-ui/react/internals/composite/composite.mjs
  var ARROW_UP2 = "ArrowUp";
  var ARROW_DOWN2 = "ArrowDown";
  var ARROW_LEFT2 = "ArrowLeft";
  var ARROW_RIGHT2 = "ArrowRight";
  var HOME = "Home";
  var END = "End";
  var COMPOSITE_KEYS = /* @__PURE__ */ new Set([ARROW_UP2, ARROW_DOWN2, ARROW_LEFT2, ARROW_RIGHT2, HOME, END]);

  // node_modules/@base-ui/utils/inertValue.mjs
  function inertValue(value) {
    if (isReactVersionAtLeast(19)) {
      return value;
    }
    return value ? "true" : void 0;
  }

  // node_modules/@base-ui/react/utils/InternalBackdrop.mjs
  var React39 = __toESM(require_react(), 1);
  var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
  var InternalBackdrop = /* @__PURE__ */ React39.forwardRef(function InternalBackdrop2(props, ref) {
    const {
      cutout,
      ...otherProps
    } = props;
    let clipPath;
    if (cutout) {
      const rect = cutout.getBoundingClientRect();
      clipPath = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", {
      ref,
      role: "presentation",
      "data-base-ui-inert": "",
      ...otherProps,
      style: {
        position: "fixed",
        inset: 0,
        userSelect: "none",
        WebkitUserSelect: "none",
        clipPath
      }
    });
  });
  if (true) InternalBackdrop.displayName = "InternalBackdrop";

  // node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
  var React42 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
  var React40 = __toESM(require_react(), 1);
  function useEnhancedClickHandler(handler) {
    const lastClickInteractionTypeRef = React40.useRef("");
    const handlePointerDown = React40.useCallback((event) => {
      if (event.defaultPrevented) {
        return;
      }
      lastClickInteractionTypeRef.current = event.pointerType;
      handler(event, event.pointerType);
    }, [handler]);
    const handleClick = React40.useCallback((event) => {
      if (event.detail === 0) {
        handler(event, "keyboard");
        return;
      }
      if ("pointerType" in event) {
        handler(event, event.pointerType);
      } else {
        handler(event, lastClickInteractionTypeRef.current);
      }
      lastClickInteractionTypeRef.current = "";
    }, [handler]);
    return {
      onClick: handleClick,
      onPointerDown: handlePointerDown
    };
  }

  // node_modules/@base-ui/react/internals/useValueChanged.mjs
  var React41 = __toESM(require_react(), 1);
  function useValueChanged(value, onChange) {
    const valueRef = React41.useRef(value);
    const onChangeCallback = useStableCallback(onChange);
    useIsoLayoutEffect(() => {
      if (valueRef.current !== value) {
        onChangeCallback(valueRef.current);
      }
      valueRef.current = value;
    }, [value, onChangeCallback]);
  }

  // node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
  function useOpenMethodTriggerProps(open2, setOpenMethod) {
    const handleTriggerClick = useStableCallback((_, interactionType) => {
      const isOpen = typeof open2 === "function" ? open2() : open2;
      if (!isOpen) {
        setOpenMethod(interactionType || // On iOS Safari, the hitslop around touch targets means tapping outside an element's
        // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`
        // will be "" in that case.
        (parts_exports.os.ios ? "touch" : ""));
      }
    });
    const {
      onClick,
      onPointerDown
    } = useEnhancedClickHandler(handleTriggerClick);
    return React42.useMemo(() => ({
      onClick,
      onPointerDown
    }), [onClick, onPointerDown]);
  }
  function useOpenInteractionType(open2) {
    const [openMethod, setOpenMethod] = React42.useState(null);
    const triggerProps = useOpenMethodTriggerProps(open2, setOpenMethod);
    useValueChanged(open2, (previousOpen) => {
      if (previousOpen && !open2) {
        setOpenMethod(null);
      }
    });
    return React42.useMemo(() => ({
      openMethod,
      triggerProps
    }), [openMethod, triggerProps]);
  }

  // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
  var React43 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
  var valid = "data-valid";
  var invalid = "data-invalid";

  // node_modules/@base-ui/react/internals/field-constants/constants.mjs
  var DEFAULT_VALIDITY_STATE = {
    badInput: false,
    customError: false,
    patternMismatch: false,
    rangeOverflow: false,
    rangeUnderflow: false,
    stepMismatch: false,
    tooLong: false,
    tooShort: false,
    typeMismatch: false,
    valid: null,
    valueMissing: false
  };
  var DEFAULT_FIELD_STATE_ATTRIBUTES = {
    valid: null,
    touched: false,
    dirty: false,
    filled: false,
    focused: false
  };
  var DEFAULT_FIELD_ROOT_STATE = {
    disabled: false,
    ...DEFAULT_FIELD_STATE_ATTRIBUTES
  };
  var fieldValidityMapping = {
    valid(value) {
      if (value === null) {
        return null;
      }
      if (value) {
        return {
          [valid]: ""
        };
      }
      return {
        [invalid]: ""
      };
    }
  };

  // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
  var DEFAULT_FIELD_ROOT_CONTEXT = {
    invalid: void 0,
    name: void 0,
    validityData: {
      state: DEFAULT_VALIDITY_STATE,
      errors: [],
      error: "",
      value: "",
      initialValue: null
    },
    setValidityData: NOOP,
    disabled: void 0,
    setTouched: NOOP,
    setDirty: NOOP,
    setFilled: NOOP,
    setFocused: NOOP,
    validationMode: "onSubmit",
    shouldValidateOnChange: () => false,
    state: DEFAULT_FIELD_ROOT_STATE,
    registerFieldControl: NOOP,
    validation: {
      getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,
      inputRef: {
        current: null
      },
      registeredInputs: /* @__PURE__ */ new Map(),
      registerInput: NOOP,
      getInputControl: () => null,
      commit: async () => {
      },
      change: NOOP
    }
  };
  var FieldRootContext = /* @__PURE__ */ React43.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
  if (true) FieldRootContext.displayName = "FieldRootContext";
  function useFieldRootContext(optional = true) {
    const context = React43.useContext(FieldRootContext);
    if (context.setValidityData === NOOP && !optional) {
      throw new Error(true ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28));
    }
    return context;
  }

  // node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
  function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {
    const {
      registerFieldControl
    } = useFieldRootContext();
    const sourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
    useIsoLayoutEffect(() => {
      const source = sourceRef.current;
      if (!enabled) {
        registerFieldControl(source, void 0);
        return;
      }
      const registration = {
        controlRef,
        getValue: getFormValueOverride,
        id,
        name,
        value
      };
      registerFieldControl(source, registration);
    }, [controlRef, enabled, getFormValueOverride, id, name, registerFieldControl, sourceRef, value]);
    useIsoLayoutEffect(() => {
      const source = sourceRef.current;
      return () => {
        registerFieldControl(source, void 0);
      };
    }, [registerFieldControl, sourceRef]);
  }

  // node_modules/@base-ui/react/internals/form-context/FormContext.mjs
  var React44 = __toESM(require_react(), 1);
  var FormContext = /* @__PURE__ */ React44.createContext({
    elementRef: {
      current: null
    },
    formRef: {
      current: {
        fields: /* @__PURE__ */ new Map()
      }
    },
    errors: {},
    clearErrors: NOOP,
    validationMode: "onSubmit",
    submitCountRef: {
      current: 0
    }
  });
  if (true) FormContext.displayName = "FormContext";
  function useFormContext() {
    return React44.useContext(FormContext);
  }

  // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
  var React46 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
  var React45 = __toESM(require_react(), 1);
  var LabelableContext = /* @__PURE__ */ React45.createContext({
    controlId: void 0,
    registerControlId: NOOP,
    resetControlId: NOOP,
    labelId: void 0,
    setLabelId: NOOP,
    messageIds: [],
    setMessageIds: NOOP,
    getDescriptionProps: (externalProps) => externalProps
  });
  if (true) LabelableContext.displayName = "LabelableContext";
  function useLabelableContext() {
    return React45.useContext(LabelableContext);
  }

  // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
  function useLabelableId(params = {}) {
    const {
      id,
      enabled = true
    } = params;
    const {
      controlId,
      registerControlId,
      resetControlId
    } = useLabelableContext();
    const defaultId = useBaseUiId();
    const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
    const hasRegisteredRef = React46.useRef(false);
    const hadExplicitIdRef = React46.useRef(false);
    const unregisterControlId = useStableCallback(() => {
      if (!hasRegisteredRef.current || registerControlId === NOOP) {
        return;
      }
      hasRegisteredRef.current = false;
      registerControlId(controlSourceRef.current, void 0);
    });
    useIsoLayoutEffect(() => {
      if (!enabled || registerControlId === NOOP) {
        unregisterControlId();
        return void 0;
      }
      let nextId;
      if (id !== void 0) {
        hadExplicitIdRef.current = true;
        nextId = id;
      } else if (hadExplicitIdRef.current) {
        nextId = defaultId;
      } else {
        resetControlId();
        return void 0;
      }
      if (nextId === void 0) {
        unregisterControlId();
        return void 0;
      }
      hasRegisteredRef.current = true;
      registerControlId(controlSourceRef.current, nextId);
      return void 0;
    }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);
    useIsoLayoutEffect(() => {
      return unregisterControlId;
    }, [unregisterControlId]);
    return (enabled ? controlId : void 0) ?? id ?? defaultId;
  }

  // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
  var React47 = __toESM(require_react(), 1);
  var DirectionContext = /* @__PURE__ */ React47.createContext(void 0);
  if (true) DirectionContext.displayName = "DirectionContext";
  function useDirection() {
    const context = React47.useContext(DirectionContext);
    return context?.direction ?? "ltr";
  }

  // node_modules/@base-ui/react/utils/getPseudoElementBounds.mjs
  var BOUNDARY_OFFSET = 5;
  function isMouseWithinBounds(event, element) {
    const bounds = getPseudoElementBounds(element);
    return event.clientX >= bounds.left - BOUNDARY_OFFSET && event.clientX <= bounds.right + BOUNDARY_OFFSET && event.clientY >= bounds.top - BOUNDARY_OFFSET && event.clientY <= bounds.bottom + BOUNDARY_OFFSET;
  }
  function getPseudoElementBounds(element) {
    const elementRect = element.getBoundingClientRect();
    const win = getWindow(element);
    if (parts_exports.env.jsdom) {
      return elementRect;
    }
    const beforeStyles = win.getComputedStyle(element, "::before");
    const afterStyles = win.getComputedStyle(element, "::after");
    const hasPseudoElements = beforeStyles.content !== "none" || afterStyles.content !== "none";
    if (!hasPseudoElements) {
      return elementRect;
    }
    const beforeWidth = parseFloat(beforeStyles.width) || 0;
    const beforeHeight = parseFloat(beforeStyles.height) || 0;
    const afterWidth = parseFloat(afterStyles.width) || 0;
    const afterHeight = parseFloat(afterStyles.height) || 0;
    const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);
    const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);
    const widthDiff = totalWidth - elementRect.width;
    const heightDiff = totalHeight - elementRect.height;
    return {
      left: elementRect.left - widthDiff / 2,
      right: elementRect.right + widthDiff / 2,
      top: elementRect.top - heightDiff / 2,
      bottom: elementRect.bottom + heightDiff / 2
    };
  }

  // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
  var React48 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs
  var baseArrow = (options) => ({
    name: "arrow",
    options,
    async fn(state) {
      const {
        x: x2,
        y: y2,
        placement,
        rects,
        platform: platform3,
        elements,
        middlewareData
      } = state;
      const {
        element,
        padding = 0,
        offsetParent = "real"
      } = evaluate(options, state) || {};
      if (element == null) {
        return {};
      }
      const paddingObject = getPaddingObject(padding);
      const coords = {
        x: x2,
        y: y2
      };
      const axis = getAlignmentAxis(placement);
      const length = getAxisLength(axis);
      const arrowDimensions = await platform3.getDimensions(element);
      const isYAxis = axis === "y";
      const minProp = isYAxis ? "top" : "left";
      const maxProp = isYAxis ? "bottom" : "right";
      const clientProp = isYAxis ? "clientHeight" : "clientWidth";
      const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
      const startDiff = coords[axis] - rects.reference[axis];
      const arrowOffsetParent = offsetParent === "real" ? await platform3.getOffsetParent?.(element) : elements.floating;
      let clientSize = elements.floating[clientProp] || rects.floating[length];
      if (!clientSize || !await platform3.isElement?.(arrowOffsetParent)) {
        clientSize = elements.floating[clientProp] || rects.floating[length];
      }
      const centerToReference = endDiff / 2 - startDiff / 2;
      const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
      const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding);
      const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding);
      const min3 = minPadding;
      const max3 = clientSize - arrowDimensions[length] - maxPadding;
      const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
      const offset4 = clamp(min3, center, max3);
      const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min3 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
      const alignmentOffset = shouldAddOffset ? center < min3 ? center - min3 : center - max3 : 0;
      return {
        [axis]: coords[axis] + alignmentOffset,
        data: {
          [axis]: offset4,
          centerOffset: center - offset4 - alignmentOffset,
          ...shouldAddOffset && {
            alignmentOffset
          }
        },
        reset: shouldAddOffset
      };
    }
  });
  var arrow4 = (options, deps) => {
    const {
      name,
      fn
    } = baseArrow(options);
    return {
      name,
      fn,
      options: [options, deps]
    };
  };

  // node_modules/@base-ui/react/utils/hideMiddleware.mjs
  var hide4 = {
    name: "hide",
    async fn(state) {
      const {
        width,
        height,
        x: x2,
        y: y2
      } = state.rects.reference;
      const anchorHidden2 = width === 0 && height === 0 && x2 === 0 && y2 === 0;
      const overflow = await state.platform.detectOverflow(state, {
        elementContext: "reference"
      });
      const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0;
      return {
        data: {
          referenceHidden: referenceHidden || anchorHidden2
        }
      };
    }
  };

  // node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs
  var DEFAULT_SIDES = {
    sideX: "left",
    sideY: "top"
  };

  // node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs
  var availableWidth = "--available-width";
  var availableHeight = "--available-height";
  var anchorWidth = "--anchor-width";
  var anchorHeight = "--anchor-height";
  var transformOrigin = "--transform-origin";
  var positionerWidth = "--positioner-width";
  var positionerHeight = "--positioner-height";

  // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
  var AVAILABLE_WIDTH_VAR = availableWidth;
  var AVAILABLE_HEIGHT_VAR = availableHeight;
  function getLogicalSide(sideParam, renderedSide, isRtl) {
    const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end";
    const logicalRight = isRtl ? "inline-start" : "inline-end";
    const logicalLeft = isRtl ? "inline-end" : "inline-start";
    return {
      top: "top",
      right: isLogicalSideParam ? logicalRight : "right",
      bottom: "bottom",
      left: isLogicalSideParam ? logicalLeft : "left"
    }[renderedSide];
  }
  function getOffsetData(state, sideParam, isRtl) {
    const {
      rects,
      placement
    } = state;
    const data = {
      side: getLogicalSide(sideParam, getSide(placement), isRtl),
      align: getAlignment(placement) || "center",
      anchor: {
        width: rects.reference.width,
        height: rects.reference.height
      },
      positioner: {
        width: rects.floating.width,
        height: rects.floating.height
      }
    };
    return data;
  }
  function useAnchorPositioning(params) {
    return useAnchorPositioningWithHook(params, useBaseUIFloating);
  }
  function useAnchorPositioningWithHook(params, useFloatingHook) {
    const {
      // Public parameters
      anchor,
      positionMethod = "absolute",
      side: sideParam = "bottom",
      sideOffset = 0,
      align = "center",
      alignOffset = 0,
      collisionBoundary,
      collisionPadding: collisionPaddingParam = 5,
      sticky = false,
      arrowPadding = 5,
      disableAnchorTracking = false,
      inline: inlineMiddleware,
      // Private parameters
      keepMounted = false,
      floatingRootContext,
      mounted,
      collisionAvoidance,
      shift: shift4,
      nodeId,
      adaptiveOrigin: adaptiveOrigin2,
      lazyFlip = false,
      externalTree
    } = params;
    const [mountSide, setMountSide] = React48.useState(null);
    if (!mounted && mountSide !== null) {
      setMountSide(null);
    }
    const collisionAvoidanceSide = collisionAvoidance.side || "flip";
    const collisionAvoidanceAlign = collisionAvoidance.align || "flip";
    const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end";
    const shiftCrossAxis = shift4?.crossAxis ?? false;
    const shiftRootBoundary = shift4?.rootBoundary;
    const anchorFn = typeof anchor === "function" ? anchor : void 0;
    const anchorFnCallback = useStableCallback(anchorFn);
    const anchorDep = anchorFn ? anchorFnCallback : anchor;
    const anchorValueRef = useValueAsRef(anchor);
    const mountedRef = useValueAsRef(mounted);
    const direction = useDirection();
    const isRtl = direction === "rtl";
    const side = mountSide || {
      top: "top",
      right: "right",
      bottom: "bottom",
      left: "left",
      "inline-end": isRtl ? "left" : "right",
      "inline-start": isRtl ? "right" : "left"
    }[sideParam];
    const placement = align === "center" ? side : `${side}-${align}`;
    let collisionPadding = collisionPaddingParam;
    if (typeof collisionPadding === "number") {
      collisionPadding = {
        top: collisionPadding,
        right: collisionPadding,
        bottom: collisionPadding,
        left: collisionPadding
      };
    } else if (collisionPadding) {
      collisionPadding = {
        top: collisionPadding.top || 0,
        right: collisionPadding.right || 0,
        bottom: collisionPadding.bottom || 0,
        left: collisionPadding.left || 0
      };
    }
    const bias = 1;
    const biasTop = sideParam === "bottom" ? bias : 0;
    const biasBottom = sideParam === "top" ? bias : 0;
    const biasLeft = sideParam === "right" ? bias : 0;
    const biasRight = sideParam === "left" ? bias : 0;
    const commonCollisionProps = {
      boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary,
      padding: collisionPadding
    };
    const arrowRef = React48.useRef(null);
    const sideOffsetRef = useValueAsRef(sideOffset);
    const alignOffsetRef = useValueAsRef(alignOffset);
    const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0;
    const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0;
    const middleware = [];
    if (inlineMiddleware) {
      middleware.push(inlineMiddleware);
    }
    middleware.push(offset3((state) => {
      const data = getOffsetData(state, sideParam, isRtl);
      const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current;
      const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current;
      return {
        mainAxis: sideAxis,
        crossAxis: alignAxis,
        alignmentAxis: alignAxis
      };
    }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam]));
    const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift";
    const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift");
    const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({
      ...commonCollisionProps,
      // Ensure the popup flips if it's been limited by its --available-height and it resizes.
      // Since the size() padding is smaller than the flip() padding, flip() will take precedence.
      padding: {
        top: collisionPadding.top + bias + biasTop,
        right: collisionPadding.right + bias + biasRight,
        bottom: collisionPadding.bottom + bias + biasBottom,
        left: collisionPadding.left + bias + biasLeft
      },
      mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip",
      crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false,
      fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide
    });
    const shiftMiddleware = shiftDisabled ? null : shift3({
      ...commonCollisionProps,
      // Use the Layout Viewport to avoid shifting around when pinch-zooming.
      rootBoundary: shiftRootBoundary,
      mainAxis: collisionAvoidanceAlign !== "none",
      crossAxis: crossAxisShiftEnabled,
      limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => {
        if (!arrowRef.current) {
          return {};
        }
        const {
          width,
          height
        } = arrowRef.current.getBoundingClientRect();
        const sideAxis = getSideAxis(getSide(limitData.placement));
        const arrowSize = sideAxis === "y" ? width : height;
        const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;
        return {
          offset: arrowSize / 2 + offsetAmount / 2
        };
      })
    }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]);
    if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || align === "center") {
      middleware.push(shiftMiddleware, flipMiddleware);
    } else {
      middleware.push(flipMiddleware, shiftMiddleware);
    }
    middleware.push(size3({
      ...commonCollisionProps,
      apply({
        elements: {
          floating
        },
        availableWidth: availableWidth2,
        availableHeight: availableHeight2,
        rects
      }) {
        if (!mountedRef.current) {
          return;
        }
        const floatingStyle = floating.style;
        floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth2}px`);
        floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight2}px`);
        const dpr = getWindow(floating).devicePixelRatio || 1;
        const {
          x: x3,
          y: y3,
          width,
          height
        } = rects.reference;
        const anchorWidth2 = (Math.round((x3 + width) * dpr) - Math.round(x3 * dpr)) / dpr;
        const anchorHeight2 = (Math.round((y3 + height) * dpr) - Math.round(y3 * dpr)) / dpr;
        floatingStyle.setProperty(anchorWidth, `${anchorWidth2}px`);
        floatingStyle.setProperty(anchorHeight, `${anchorHeight2}px`);
      }
    }), arrow4((state) => ({
      // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,
      // we'll create a fake element.
      element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"),
      // No padding for the fake arrow: it would displace aligned popups on narrow anchors.
      padding: arrowRef.current ? arrowPadding : 0,
      offsetParent: "floating"
    }), [arrowPadding]), {
      name: "transformOrigin",
      fn(state) {
        const {
          elements: {
            floating
          },
          middlewareData: middlewareData2,
          placement: renderedPlacement2,
          platform: platform3,
          rects,
          y: y3
        } = state;
        const renderedSide2 = getSide(renderedPlacement2);
        const renderedAlign2 = getAlignment(renderedPlacement2);
        const isVertical = getSideAxis(renderedSide2) === "y";
        const arrowEl = arrowRef.current;
        const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset;
        let crossOrigin;
        if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) {
          crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%";
        } else {
          const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0;
          const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0;
          crossOrigin = `${arrowOffset + arrowSize / 2}px`;
        }
        let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + ${sideOffsetValue}px)` : `${-sideOffsetValue}px`;
        if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) {
          sideOrigin = `${rects.reference.y + rects.reference.height / 2 - y3}px`;
        }
        floating.style.setProperty(transformOrigin, isVertical ? `${crossOrigin} ${sideOrigin}` : `${sideOrigin} ${crossOrigin}`);
        return {};
      }
    }, hide4, adaptiveOrigin2);
    useIsoLayoutEffect(() => {
      if (!mounted && floatingRootContext) {
        floatingRootContext.update({
          referenceElement: null,
          floatingElement: null,
          domReferenceElement: null,
          positionReference: null
        });
      }
    }, [mounted, floatingRootContext]);
    const autoUpdateOptions = React48.useMemo(() => ({
      ancestorScroll: !disableAnchorTracking,
      elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined",
      layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined"
    }), [disableAnchorTracking]);
    const {
      refs,
      elements,
      x: x2,
      y: y2,
      middlewareData,
      update: update2,
      placement: renderedPlacement,
      context,
      isPositioned,
      floatingStyles: originalFloatingStyles
    } = useFloatingHook({
      rootContext: floatingRootContext,
      open: keepMounted ? mounted : void 0,
      placement,
      middleware,
      strategy: positionMethod,
      whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions),
      nodeId,
      externalTree
    });
    const {
      sideX,
      sideY
    } = middlewareData.adaptiveOrigin || DEFAULT_SIDES;
    const resolvedPosition = isPositioned ? positionMethod : "fixed";
    const floatingStyles = React48.useMemo(() => {
      let base;
      if (!isPositioned) {
        base = {
          position: resolvedPosition,
          top: 0,
          left: 0
        };
      } else if (adaptiveOrigin2) {
        base = {
          position: resolvedPosition,
          [sideX]: x2,
          [sideY]: y2
        };
      } else {
        base = {
          ...originalFloatingStyles,
          position: resolvedPosition
        };
      }
      base[AVAILABLE_WIDTH_VAR] = "100vw";
      base[AVAILABLE_HEIGHT_VAR] = "100vh";
      if (!isPositioned) {
        base.opacity = 0;
      }
      return base;
    }, [adaptiveOrigin2, resolvedPosition, sideX, x2, sideY, y2, originalFloatingStyles, isPositioned]);
    const registeredPositionReferenceRef = React48.useRef(null);
    useIsoLayoutEffect(() => {
      if (!mounted) {
        return;
      }
      const anchorValue = anchorValueRef.current;
      const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue;
      const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null;
      const finalAnchor = unwrappedElement || null;
      if (finalAnchor !== registeredPositionReferenceRef.current) {
        refs.setPositionReference(finalAnchor);
        registeredPositionReferenceRef.current = finalAnchor;
      }
    }, [mounted, refs, anchorDep, anchorValueRef]);
    React48.useEffect(() => {
      if (!mounted) {
        return;
      }
      const anchorValue = anchorValueRef.current;
      if (typeof anchorValue === "function") {
        return;
      }
      if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) {
        refs.setPositionReference(anchorValue.current);
        registeredPositionReferenceRef.current = anchorValue.current;
      }
    }, [mounted, refs, anchorDep, anchorValueRef]);
    React48.useEffect(() => {
      if (keepMounted && mounted && elements.reference && elements.floating) {
        return autoUpdate(elements.reference, elements.floating, update2, autoUpdateOptions);
      }
      return void 0;
    }, [keepMounted, mounted, elements, update2, autoUpdateOptions]);
    const renderedSide = getSide(renderedPlacement);
    const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);
    const renderedAlign = getAlignment(renderedPlacement) || "center";
    const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden);
    useIsoLayoutEffect(() => {
      if (lazyFlip && mounted && isPositioned && renderedSide !== side) {
        setMountSide(renderedSide);
      }
    }, [lazyFlip, mounted, isPositioned, renderedSide, side]);
    const arrowStyles = React48.useMemo(() => ({
      position: "absolute",
      top: middlewareData.arrow?.y,
      left: middlewareData.arrow?.x
    }), [middlewareData.arrow]);
    const arrowUncentered = middlewareData.arrow?.centerOffset !== 0;
    return React48.useMemo(() => ({
      positionerStyles: floatingStyles,
      arrowStyles,
      arrowRef,
      arrowUncentered,
      side: logicalRenderedSide,
      align: renderedAlign,
      physicalSide: renderedSide,
      anchorHidden: anchorHidden2,
      refs,
      context,
      isPositioned,
      update: update2
    }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]);
  }
  function isRef(param) {
    return param != null && "current" in param;
  }

  // node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs
  function getDisabledMountTransitionStyles(transitionStatus) {
    return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;
  }

  // node_modules/@base-ui/react/utils/usePositioner.mjs
  function usePositioner(componentProps, state, {
    styles,
    transitionStatus,
    props,
    refs,
    hidden,
    inert = false
  }) {
    const style = {
      ...styles
    };
    if (inert) {
      style.pointerEvents = "none";
    }
    return useRenderElement("div", componentProps, {
      state,
      ref: refs,
      props: [{
        role: "presentation",
        hidden,
        style
      }, getDisabledMountTransitionStyles(transitionStatus), props],
      stateAttributesMapping: popupStateMapping
    });
  }

  // node_modules/@base-ui/react/utils/useAnchoredPopupScrollLock.mjs
  var React49 = __toESM(require_react(), 1);
  var VIEWPORT_WIDTH_TOLERANCE_PX = 20;
  function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {
    const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React49.useState(false);
    useIsoLayoutEffect(() => {
      if (!enabled || !touchOpen || positionerElement == null) {
        setTouchOpenShouldLockScroll(false);
        return;
      }
      const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;
      const popupWidth2 = positionerElement.offsetWidth;
      setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth2 > 0 && popupWidth2 >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);
    }, [enabled, touchOpen, positionerElement]);
    useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);
  }

  // node_modules/@base-ui/react/button/Button.mjs
  var React50 = __toESM(require_react(), 1);
  var Button = /* @__PURE__ */ React50.forwardRef(function Button2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      disabled: disabled2 = false,
      focusableWhenDisabled = false,
      nativeButton = true,
      style,
      ...elementProps
    } = componentProps;
    const {
      getButtonProps,
      buttonRef
    } = useButton({
      disabled: disabled2,
      focusableWhenDisabled,
      native: nativeButton
    });
    const state = {
      disabled: disabled2
    };
    return useRenderElement("button", componentProps, {
      state,
      ref: [forwardedRef, buttonRef],
      props: [elementProps, getButtonProps]
    });
  });
  if (true) Button.displayName = "Button";

  // node_modules/@base-ui/react/field/item/FieldItemContext.mjs
  var React51 = __toESM(require_react(), 1);
  var FieldItemContext = /* @__PURE__ */ React51.createContext({
    disabled: false
  });
  if (true) FieldItemContext.displayName = "FieldItemContext";
  function useFieldItemContext() {
    const context = React51.useContext(FieldItemContext);
    return context;
  }

  // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
  var React52 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/field/utils/getCombinedFieldValidityData.mjs
  function getCombinedFieldValidityData(validityData, invalid2) {
    return {
      ...validityData,
      state: {
        ...validityData.state,
        valid: !invalid2 && validityData.state.valid
      }
    };
  }

  // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
  var validityKeys = Object.keys(DEFAULT_VALIDITY_STATE);
  function isEligibleInput(input, formElement) {
    if (input.matches(":disabled")) {
      return false;
    }
    if (!formElement || input.form === formElement) {
      return true;
    }
    return input.form === null && !input.hasAttribute("form");
  }
  function findRepresentativeInput(inputs, formElement) {
    let fallback = null;
    for (const input of inputs.keys()) {
      if (!isEligibleInput(input, formElement)) {
        continue;
      }
      if (!input.validity.valid) {
        return input;
      }
      fallback ??= input;
    }
    return fallback;
  }
  function makeState(customError) {
    return {
      ...DEFAULT_VALIDITY_STATE,
      valid: !customError,
      customError
    };
  }
  function getNativeErrors(element) {
    return element && element.validationMessage ? [element.validationMessage] : [];
  }
  function useFieldValidation(params) {
    const {
      elementRef,
      formRef
    } = useFormContext();
    const {
      setValidityData,
      validate,
      validityData,
      validationDebounceTime,
      invalid: invalid2,
      markedDirtyRef,
      state,
      shouldValidateOnChange,
      validationMode,
      registeredFieldIdRef
    } = params;
    const {
      controlId,
      getDescriptionProps
    } = useLabelableContext();
    const timeout = useTimeout();
    const inputRef = React52.useRef(null);
    const registeredInputs = useRefWithInit(() => /* @__PURE__ */ new Map()).current;
    const validationCommitIdRef = React52.useRef(0);
    const customValidityRef = React52.useRef(null);
    const registerInput = React52.useCallback((element, registration) => {
      registeredInputs.set(element, registration);
      return () => {
        registeredInputs.delete(element);
      };
    }, [registeredInputs]);
    const getInputControl = useStableCallback(() => {
      const element = findRepresentativeInput(registeredInputs, elementRef.current);
      return element && registeredInputs.get(element)?.controlRef.current || null;
    });
    const commit = useStableCallback(async (value, revalidate = false) => {
      validationCommitIdRef.current += 1;
      const validationCommitId = validationCommitIdRef.current;
      function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid2) {
        const fieldId = registeredFieldIdRef.current ?? controlId;
        if (fieldId == null) {
          return;
        }
        const currentFieldData = formRef.current.fields.get(fieldId);
        if (!currentFieldData) {
          return;
        }
        const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
        formRef.current.fields.set(fieldId, {
          ...currentFieldData,
          validityData: validityDataWithFormErrors
        });
      }
      function makeValidityData(validityState, errorMessages) {
        const errors = validityState.valid === false ? errorMessages : [];
        return {
          value,
          state: validityState,
          error: errors[0] ?? "",
          errors,
          initialValue: validityData.initialValue
        };
      }
      function setCustomValidity(element2, message2) {
        const displaced = element2.validity.customError ? element2.validationMessage : "";
        const ownedMessage = message2.replace(/\r\n?/g, "\n");
        element2.setCustomValidity(ownedMessage);
        customValidityRef.current = [element2, ownedMessage, displaced];
      }
      function clearCustomValidity() {
        const record = customValidityRef.current;
        customValidityRef.current = null;
        if (record && (!record[0].willValidate || record[0].validationMessage === record[1])) {
          record[0].setCustomValidity(record[2]);
        }
      }
      function publish(validityState, errorMessages, externalInvalid) {
        const nextValidityData = makeValidityData(validityState, errorMessages);
        updateRegisteredFieldValidity(nextValidityData, externalInvalid);
        setValidityData(nextValidityData);
      }
      function getState(el) {
        const computedState = validityKeys.reduce((acc, key) => {
          acc[key] = el.validity[key];
          return acc;
        }, {});
        let hasOnlyValueMissingError = false;
        for (const key of validityKeys) {
          if (key === "valid") {
            continue;
          }
          if (key === "valueMissing" && computedState[key]) {
            hasOnlyValueMissingError = true;
          } else if (computedState[key]) {
            return computedState;
          }
        }
        if (hasOnlyValueMissingError && !markedDirtyRef.current) {
          computedState.valid = true;
          computedState.valueMissing = false;
        }
        return computedState;
      }
      function resolveRepresentativeInput() {
        return registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current;
      }
      let element = resolveRepresentativeInput();
      function refreshState() {
        element = resolveRepresentativeInput();
        return element?.willValidate ? getState(element) : makeState(false);
      }
      if (revalidate) {
        if (state.valid !== false || !element) {
          return;
        }
        if (!element.validity.valueMissing) {
          clearCustomValidity();
          const currentElement = resolveRepresentativeInput();
          const foreign = currentElement?.validity.customError ? getNativeErrors(currentElement) : [];
          publish(makeState(foreign.length > 0), foreign, false);
          return;
        }
        for (const key of validityKeys) {
          if (key !== "valid" && key !== "valueMissing" && key !== "customError" && element.validity[key]) {
            return;
          }
        }
      }
      timeout.clear();
      clearCustomValidity();
      let nextState = refreshState();
      let validationErrors = getNativeErrors(element);
      const isValidatingOnChange = shouldValidateOnChange();
      if (validationErrors.length === 0 || isValidatingOnChange) {
        const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => {
          if (field.name) {
            acc[field.name] = field.getValue();
          }
          return acc;
        }, {});
        const resultOrPromise = validate(value, formValues);
        let result;
        if (typeof resultOrPromise === "object" && resultOrPromise !== null && "then" in resultOrPromise) {
          if (nextState.valid === false) {
            publish(nextState, validationErrors);
          } else if (validationMode === "onSubmit" || !validityData.state.customError) {
            nextState.valid = null;
            publish(nextState, validationErrors);
          }
          result = await resultOrPromise;
          if (validationCommitId !== validationCommitIdRef.current) {
            return;
          }
          nextState = refreshState();
        } else {
          result = resultOrPromise;
        }
        validationErrors = result ? [].concat(result).filter(Boolean) : [];
        if (validationErrors.length > 0) {
          nextState.valid = false;
          nextState.customError = true;
          if (element?.willValidate) {
            setCustomValidity(element, validationErrors.join("\n"));
          }
        } else {
          validationErrors = getNativeErrors(element);
        }
      }
      publish(nextState, validationErrors);
    });
    const change = useStableCallback((value, cancelPending = false) => {
      timeout.clear();
      validationCommitIdRef.current += 1;
      if (cancelPending) {
        return;
      }
      const validateOnChange = shouldValidateOnChange();
      if (validateOnChange && value !== "" && validationDebounceTime) {
        timeout.start(validationDebounceTime, () => {
          commit(value);
        });
      } else {
        commit(value, !validateOnChange);
      }
    });
    const getValidationProps = React52.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? {
      "aria-invalid": true
    } : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]);
    return React52.useMemo(() => ({
      getValidationProps,
      inputRef,
      registeredInputs,
      registerInput,
      getInputControl,
      commit,
      change
    }), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]);
  }

  // node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
  function useRegisteredLabelId(idProp, setLabelId) {
    const id = useBaseUiId(idProp);
    useIsoLayoutEffect(() => {
      setLabelId(id);
      return () => {
        setLabelId((currentId) => currentId === id ? void 0 : currentId);
      };
    }, [id, setLabelId]);
    return id;
  }

  // node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
  function useLabel(params = {}) {
    const {
      id: idProp,
      fallbackControlId,
      native = false,
      setLabelId: setLabelIdProp,
      focusControl: focusControlProp
    } = params;
    const {
      controlId: contextControlId,
      setLabelId: setContextLabelId
    } = useLabelableContext();
    const syncLabelId = useStableCallback((nextLabelId) => {
      setContextLabelId(nextLabelId);
      setLabelIdProp?.(nextLabelId);
    });
    const id = useRegisteredLabelId(idProp, syncLabelId);
    const resolvedControlId = contextControlId ?? fallbackControlId;
    function focusControl(event) {
      if (focusControlProp) {
        focusControlProp(event, resolvedControlId);
        return;
      }
      if (!resolvedControlId) {
        return;
      }
      const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId);
      if (isHTMLElement(controlElement)) {
        focusElementWithVisible(controlElement);
      }
    }
    function handleInteraction(event) {
      const target = getTarget(event.nativeEvent);
      if (target?.closest("button,input,select,textarea")) {
        return;
      }
      if (!event.defaultPrevented && event.detail > 1) {
        event.preventDefault();
      }
      if (native) {
        return;
      }
      focusControl(event);
    }
    return native ? {
      id,
      htmlFor: resolvedControlId,
      onMouseDown: handleInteraction
    } : {
      id,
      onClick: handleInteraction,
      onPointerDown(event) {
        event.preventDefault();
      }
    };
  }
  function focusElementWithVisible(element) {
    element.focus({
      // Available from Chrome 144+ (January 2026).
      // Safari and Firefox already support it.
      focusVisible: true
    });
  }

  // node_modules/@base-ui/react/context-menu/root/ContextMenuRootContext.mjs
  var React53 = __toESM(require_react(), 1);
  var ContextMenuRootContext = /* @__PURE__ */ React53.createContext(void 0);
  if (true) ContextMenuRootContext.displayName = "ContextMenuRootContext";
  function useContextMenuRootContext(optional = true) {
    const context = React53.useContext(ContextMenuRootContext);
    if (context === void 0 && !optional) {
      throw new Error(true ? "Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>." : formatErrorMessage_default(25));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/index.parts.mjs
  var index_parts_exports = {};
  __export(index_parts_exports, {
    Arrow: () => MenuArrow,
    Backdrop: () => MenuBackdrop,
    CheckboxItem: () => MenuCheckboxItem,
    CheckboxItemIndicator: () => MenuCheckboxItemIndicator,
    Group: () => MenuGroup,
    GroupLabel: () => MenuGroupLabel,
    Handle: () => MenuHandle,
    Item: () => MenuItem,
    LinkItem: () => MenuLinkItem,
    Popup: () => MenuPopup,
    Portal: () => MenuPortal,
    Positioner: () => MenuPositioner,
    RadioGroup: () => MenuRadioGroup,
    RadioItem: () => MenuRadioItem,
    RadioItemIndicator: () => MenuRadioItemIndicator,
    Root: () => MenuRoot,
    Separator: () => Separator,
    SubmenuRoot: () => MenuSubmenuRoot,
    SubmenuTrigger: () => MenuSubmenuTrigger,
    Trigger: () => MenuTrigger,
    Viewport: () => MenuViewport,
    createHandle: () => createMenuHandle
  });

  // node_modules/@base-ui/react/menu/arrow/MenuArrow.mjs
  var React56 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/menu/positioner/MenuPositionerContext.mjs
  var React54 = __toESM(require_react(), 1);
  var MenuPositionerContext = /* @__PURE__ */ React54.createContext(void 0);
  if (true) MenuPositionerContext.displayName = "MenuPositionerContext";
  function useMenuPositionerContext(optional) {
    const context = React54.useContext(MenuPositionerContext);
    if (context === void 0 && !optional) {
      throw new Error(true ? "Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>." : formatErrorMessage_default(33));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/root/MenuRootContext.mjs
  var React55 = __toESM(require_react(), 1);
  var MenuRootContext = /* @__PURE__ */ React55.createContext(void 0);
  if (true) MenuRootContext.displayName = "MenuRootContext";
  function useMenuRootContext(optional) {
    const context = React55.useContext(MenuRootContext);
    if (context === void 0 && !optional) {
      throw new Error(true ? "Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>." : formatErrorMessage_default(36));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/arrow/MenuArrow.mjs
  var MenuArrow = /* @__PURE__ */ React56.forwardRef(function MenuArrow2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      ...elementProps
    } = componentProps;
    const {
      store
    } = useMenuRootContext();
    const {
      arrowRef,
      side,
      align,
      arrowUncentered,
      arrowStyles
    } = useMenuPositionerContext();
    const open2 = store.useState("open");
    const state = {
      open: open2,
      side,
      align,
      uncentered: arrowUncentered
    };
    return useRenderElement("div", componentProps, {
      ref: [arrowRef, forwardedRef],
      stateAttributesMapping: popupStateMapping,
      state,
      props: {
        style: arrowStyles,
        "aria-hidden": true,
        ...elementProps
      }
    });
  });
  if (true) MenuArrow.displayName = "MenuArrow";

  // node_modules/@base-ui/react/menu/backdrop/MenuBackdrop.mjs
  var React57 = __toESM(require_react(), 1);
  var MenuBackdrop = /* @__PURE__ */ React57.forwardRef(function MenuBackdrop2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      ...elementProps
    } = componentProps;
    const {
      store
    } = useMenuRootContext();
    const open2 = store.useState("open");
    const mounted = store.useState("mounted");
    const transitionStatus = store.useState("transitionStatus");
    const lastOpenChangeReason = store.useState("lastOpenChangeReason");
    const contextMenuContext = useContextMenuRootContext();
    const state = {
      open: open2,
      transitionStatus
    };
    return useRenderElement("div", componentProps, {
      ref: contextMenuContext?.backdropRef ? [forwardedRef, contextMenuContext.backdropRef] : forwardedRef,
      state,
      stateAttributesMapping: popupTransitionStateMapping,
      props: [{
        role: "presentation",
        hidden: !mounted,
        style: {
          pointerEvents: lastOpenChangeReason === reason_parts_exports.triggerHover ? "none" : void 0,
          userSelect: "none",
          WebkitUserSelect: "none"
        }
      }, elementProps]
    });
  });
  if (true) MenuBackdrop.displayName = "MenuBackdrop";

  // node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItem.mjs
  var React61 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItemContext.mjs
  var React58 = __toESM(require_react(), 1);
  var MenuCheckboxItemContext = /* @__PURE__ */ React58.createContext(void 0);
  if (true) MenuCheckboxItemContext.displayName = "MenuCheckboxItemContext";
  function useMenuCheckboxItemContext() {
    const context = React58.useContext(MenuCheckboxItemContext);
    if (context === void 0) {
      throw new Error(true ? "Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>." : formatErrorMessage_default(30));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/item/useMenuItem.mjs
  var React60 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/menu/item/useMenuItemCommonProps.mjs
  var React59 = __toESM(require_react(), 1);
  function useMenuItemCommonProps(params) {
    const {
      closeOnClick,
      highlighted,
      id,
      nodeId,
      store,
      typingRef,
      itemRef,
      itemMetadata
    } = params;
    const {
      events: menuEvents
    } = store.useState("floatingTreeRoot");
    const open2 = store.useState("open");
    const contextMenuContext = useContextMenuRootContext(true);
    const isContextMenu = contextMenuContext !== void 0;
    return React59.useMemo(() => ({
      id,
      role: "menuitem",
      tabIndex: open2 && highlighted ? 0 : -1,
      onKeyDown(event) {
        if (event.key === " " && typingRef?.current) {
          event.preventDefault();
        }
      },
      onMouseMove(event) {
        if (!nodeId) {
          return;
        }
        menuEvents.emit("itemhover", {
          nodeId,
          target: event.currentTarget
        });
      },
      onClick(event) {
        if (closeOnClick) {
          menuEvents.emit("close", {
            domEvent: event,
            reason: reason_parts_exports.itemPress
          });
        }
      },
      onMouseUp(event) {
        if (contextMenuContext) {
          const initialCursorPoint = contextMenuContext.initialCursorPointRef.current;
          contextMenuContext.initialCursorPointRef.current = null;
          if (isContextMenu && initialCursorPoint && Math.abs(event.clientX - initialCursorPoint.x) <= 1 && Math.abs(event.clientY - initialCursorPoint.y) <= 1) {
            return;
          }
          if (isContextMenu && !parts_exports.os.mac && event.button === 2) {
            return;
          }
        }
        if (itemRef.current && store.context.allowMouseUpTriggerRef.current && (!isContextMenu || event.button === 2)) {
          if (itemMetadata.type === "regular-item") {
            dispatchClickWithModifiers(itemRef.current, event, {
              detail: 1
            });
          }
        }
      }
    }), [closeOnClick, highlighted, id, menuEvents, nodeId, open2, store, typingRef, itemRef, contextMenuContext, isContextMenu, itemMetadata]);
  }

  // node_modules/@base-ui/react/menu/item/useMenuItem.mjs
  var REGULAR_ITEM = {
    type: "regular-item"
  };
  function useMenuItem(params) {
    const {
      closeOnClick,
      disabled: disabled2,
      highlighted,
      id,
      store,
      typingRef = store.context.typingRef,
      nativeButton,
      itemMetadata,
      nodeId
    } = params;
    const itemRef = React60.useRef(null);
    const {
      getButtonProps,
      buttonRef
    } = useButton({
      disabled: disabled2,
      focusableWhenDisabled: true,
      native: nativeButton,
      composite: true
    });
    const commonProps = useMenuItemCommonProps({
      closeOnClick,
      highlighted,
      id,
      nodeId,
      store,
      typingRef,
      itemRef,
      itemMetadata
    });
    const getItemProps = React60.useCallback((externalProps) => {
      return mergeProps(commonProps, {
        onMouseEnter() {
          if (itemMetadata.type !== "submenu-trigger") {
            return;
          }
          itemMetadata.setActive();
        }
      }, externalProps, getButtonProps);
    }, [commonProps, getButtonProps, itemMetadata]);
    const mergedRef = useMergedRefs(itemRef, buttonRef);
    return React60.useMemo(() => ({
      getItemProps,
      itemRef: mergedRef
    }), [getItemProps, mergedRef]);
  }

  // node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItemDataAttributes.mjs
  var checked = "data-checked";
  var unchecked = "data-unchecked";

  // node_modules/@base-ui/react/menu/utils/stateAttributesMapping.mjs
  var itemMapping = {
    checked(value) {
      if (value) {
        return {
          [checked]: ""
        };
      }
      return {
        [unchecked]: ""
      };
    },
    ...transitionStatusMapping
  };

  // node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItem.mjs
  var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
  var MenuCheckboxItem = /* @__PURE__ */ React61.forwardRef(function MenuCheckboxItem2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      id: idProp,
      label,
      nativeButton = false,
      disabled: disabledProp = false,
      closeOnClick = false,
      checked: checkedProp,
      defaultChecked,
      onCheckedChange,
      style,
      ...elementProps
    } = componentProps;
    const listItem = useCompositeListItem({
      guess: true,
      label
    });
    const menuPositionerContext = useMenuPositionerContext(true);
    const id = useBaseUiId(idProp);
    const {
      store
    } = useMenuRootContext();
    const rootDisabled = store.useState("disabled");
    const disabled2 = disabledProp || rootDisabled;
    const highlighted = store.useState("isActive", listItem.index);
    const itemProps = store.useState("itemProps");
    const [checked2, setChecked] = useControlled({
      controlled: checkedProp,
      default: defaultChecked ?? false,
      name: "MenuCheckboxItem",
      state: "checked"
    });
    const {
      getItemProps,
      itemRef
    } = useMenuItem({
      closeOnClick,
      disabled: disabled2,
      highlighted,
      id,
      store,
      nativeButton,
      nodeId: menuPositionerContext?.context.nodeId,
      itemMetadata: REGULAR_ITEM
    });
    const state = React61.useMemo(() => ({
      disabled: disabled2,
      highlighted,
      checked: checked2
    }), [disabled2, highlighted, checked2]);
    function handleClick(event) {
      const details = createChangeEventDetails(reason_parts_exports.itemPress, event.nativeEvent, void 0, {
        preventUnmountOnClose: NOOP
      });
      onCheckedChange?.(!checked2, details);
      if (details.isCanceled) {
        return;
      }
      setChecked((currentlyChecked) => !currentlyChecked);
    }
    const element = useRenderElement("div", componentProps, {
      state,
      stateAttributesMapping: itemMapping,
      props: [itemProps, {
        role: "menuitemcheckbox",
        "aria-checked": checked2,
        onClick: handleClick
      }, elementProps, getItemProps],
      ref: [itemRef, forwardedRef, listItem.ref]
    });
    return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(MenuCheckboxItemContext.Provider, {
      value: state,
      children: element
    });
  });
  if (true) MenuCheckboxItem.displayName = "MenuCheckboxItem";

  // node_modules/@base-ui/react/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.mjs
  var React62 = __toESM(require_react(), 1);
  var MenuCheckboxItemIndicator = /* @__PURE__ */ React62.forwardRef(function MenuCheckboxItemIndicator2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      keepMounted = false,
      ...elementProps
    } = componentProps;
    const item = useMenuCheckboxItemContext();
    const indicatorRef = React62.useRef(null);
    const {
      transitionStatus,
      mounted,
      setMounted
    } = useTransitionStatus(item.checked);
    useOpenChangeComplete({
      batch: true,
      enabled: !item.checked,
      open: item.checked,
      ref: indicatorRef,
      onComplete() {
        if (!item.checked) {
          setMounted(false);
        }
      }
    });
    const state = {
      checked: item.checked,
      disabled: item.disabled,
      highlighted: item.highlighted,
      transitionStatus
    };
    const element = useRenderElement("span", componentProps, {
      state,
      ref: [forwardedRef, indicatorRef],
      stateAttributesMapping: itemMapping,
      props: {
        "aria-hidden": true,
        ...elementProps
      },
      enabled: keepMounted || mounted
    });
    return element;
  });
  if (true) MenuCheckboxItemIndicator.displayName = "MenuCheckboxItemIndicator";

  // node_modules/@base-ui/react/menu/group/MenuGroup.mjs
  var React64 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/menu/group/MenuGroupContext.mjs
  var React63 = __toESM(require_react(), 1);
  var MenuGroupContext = /* @__PURE__ */ React63.createContext(void 0);
  if (true) MenuGroupContext.displayName = "MenuGroupContext";
  function useMenuGroupRootContext() {
    const context = React63.useContext(MenuGroupContext);
    if (context === void 0) {
      throw new Error(true ? "Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>." : formatErrorMessage_default(31));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/group/MenuGroup.mjs
  var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
  var MenuGroup = /* @__PURE__ */ React64.forwardRef(function MenuGroup2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      ...elementProps
    } = componentProps;
    const [labelId, setLabelId] = React64.useState(void 0);
    const element = useRenderElement("div", componentProps, {
      ref: forwardedRef,
      props: {
        role: "group",
        "aria-labelledby": labelId,
        ...elementProps
      }
    });
    return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MenuGroupContext.Provider, {
      value: setLabelId,
      children: element
    });
  });
  if (true) MenuGroup.displayName = "MenuGroup";

  // node_modules/@base-ui/react/menu/group-label/MenuGroupLabel.mjs
  var React65 = __toESM(require_react(), 1);
  var MenuGroupLabel = /* @__PURE__ */ React65.forwardRef(function MenuGroupLabel2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      id: idProp,
      ...elementProps
    } = componentProps;
    const id = useBaseUiId(idProp);
    const setLabelId = useMenuGroupRootContext();
    useIsoLayoutEffect(() => {
      setLabelId(id);
      return () => {
        setLabelId((currentId) => currentId === id ? void 0 : currentId);
      };
    }, [setLabelId, id]);
    return useRenderElement("div", componentProps, {
      ref: forwardedRef,
      props: {
        id,
        "aria-hidden": true,
        ...elementProps
      }
    });
  });
  if (true) MenuGroupLabel.displayName = "MenuGroupLabel";

  // node_modules/@base-ui/react/menu/item/MenuItem.mjs
  var React66 = __toESM(require_react(), 1);
  var MenuItem = /* @__PURE__ */ React66.forwardRef(function MenuItem2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      id: idProp,
      label,
      nativeButton = false,
      disabled: disabledProp = false,
      closeOnClick = true,
      style,
      ...elementProps
    } = componentProps;
    const listItem = useCompositeListItem({
      guess: true,
      label
    });
    const menuPositionerContext = useMenuPositionerContext(true);
    const id = useBaseUiId(idProp);
    const {
      store
    } = useMenuRootContext();
    const rootDisabled = store.useState("disabled");
    const disabled2 = disabledProp || rootDisabled;
    const highlighted = store.useState("isActive", listItem.index);
    const itemProps = store.useState("itemProps");
    const {
      getItemProps,
      itemRef
    } = useMenuItem({
      closeOnClick,
      disabled: disabled2,
      highlighted,
      id,
      store,
      nativeButton,
      nodeId: menuPositionerContext?.context.nodeId,
      itemMetadata: REGULAR_ITEM
    });
    const state = {
      disabled: disabled2,
      highlighted
    };
    return useRenderElement("div", componentProps, {
      state,
      props: [itemProps, elementProps, getItemProps],
      ref: [itemRef, forwardedRef, listItem.ref]
    });
  });
  if (true) MenuItem.displayName = "MenuItem";

  // node_modules/@base-ui/react/menu/link-item/MenuLinkItem.mjs
  var React67 = __toESM(require_react(), 1);
  var MenuLinkItem = /* @__PURE__ */ React67.forwardRef(function MenuLinkItem2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      id: idProp,
      label,
      closeOnClick = false,
      style,
      ...elementProps
    } = componentProps;
    const linkRef = React67.useRef(null);
    const listItem = useCompositeListItem({
      guess: true,
      label
    });
    const menuPositionerContext = useMenuPositionerContext(true);
    const nodeId = menuPositionerContext?.context.nodeId;
    const id = useBaseUiId(idProp);
    const {
      store
    } = useMenuRootContext();
    const highlighted = store.useState("isActive", listItem.index);
    const itemProps = store.useState("itemProps");
    const typingRef = store.context.typingRef;
    const {
      getButtonProps,
      buttonRef
    } = useButton({
      native: false,
      composite: true
    });
    const commonProps = useMenuItemCommonProps({
      closeOnClick,
      highlighted,
      id,
      nodeId,
      store,
      typingRef,
      itemRef: linkRef,
      itemMetadata: REGULAR_ITEM
    });
    function getItemProps(externalProps) {
      return mergeProps(commonProps, externalProps, getButtonProps);
    }
    const state = {
      highlighted
    };
    return useRenderElement("a", componentProps, {
      state,
      props: [itemProps, elementProps, getItemProps],
      ref: [linkRef, buttonRef, forwardedRef, listItem.ref]
    });
  });
  if (true) MenuLinkItem.displayName = "MenuLinkItem";

  // node_modules/@base-ui/react/menu/popup/MenuPopup.mjs
  var React69 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/toolbar/root/ToolbarRootContext.mjs
  var React68 = __toESM(require_react(), 1);
  var ToolbarRootContext = /* @__PURE__ */ React68.createContext(void 0);
  if (true) ToolbarRootContext.displayName = "ToolbarRootContext";
  function useToolbarRootContext(optional) {
    const context = React68.useContext(ToolbarRootContext);
    if (context === void 0 && !optional) {
      throw new Error(true ? "Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>." : formatErrorMessage_default(69));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/popup/MenuPopup.mjs
  var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
  var MenuPopup = /* @__PURE__ */ React69.forwardRef(function MenuPopup2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      finalFocus,
      ...elementProps
    } = componentProps;
    const {
      store
    } = useMenuRootContext();
    const {
      side,
      align
    } = useMenuPositionerContext();
    const insideToolbar = useToolbarRootContext(true) != null;
    const open2 = store.useState("open");
    const transitionStatus = store.useState("transitionStatus");
    const popupProps = store.useState("popupProps");
    const mounted = store.useState("mounted");
    const instantType = store.useState("instantType");
    const activeTriggerElement = store.useState("activeTriggerElement");
    const parent = store.useState("parent");
    const lastOpenChangeReason = store.useState("lastOpenChangeReason");
    const rootId = store.useState("rootId");
    const floatingContext = store.useState("floatingRootContext");
    const floatingTreeRoot = store.useState("floatingTreeRoot");
    const closeDelay = store.useState("closeDelay");
    const hoverEnabled = store.useState("hoverEnabled");
    const disabled2 = store.useState("disabled");
    const openMethod = store.useState("openMethod");
    const isContextMenu = parent.type === "context-menu";
    useOpenChangeComplete({
      open: open2,
      ref: store.context.popupRef,
      onComplete() {
        if (open2) {
          store.context.onOpenChangeComplete?.(true);
        }
      }
    });
    React69.useEffect(() => {
      function handleClose(event) {
        store.setOpen(false, createChangeEventDetails(event.reason, event.domEvent));
      }
      floatingTreeRoot.events.on("close", handleClose);
      return () => {
        floatingTreeRoot.events.off("close", handleClose);
      };
    }, [floatingTreeRoot.events, store]);
    useHoverFloatingInteraction(floatingContext, {
      enabled: hoverEnabled && !disabled2 && !isContextMenu && parent.type !== "menubar",
      closeDelay
    });
    const setPopupElement = store.useStateSetter("popupElement");
    const state = {
      transitionStatus,
      side,
      align,
      open: open2,
      nested: parent.type === "menu",
      instant: instantType
    };
    const element = useRenderElement("div", componentProps, {
      state,
      ref: [forwardedRef, store.context.popupRef, setPopupElement],
      stateAttributesMapping: popupTransitionStateMapping,
      props: [popupProps, {
        onKeyDown(event) {
          if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {
            event.stopPropagation();
          }
        }
      }, getDisabledMountTransitionStyles(transitionStatus), elementProps, {
        "data-rootownerid": rootId
      }]
    });
    let returnFocus = parent.type === void 0 || isContextMenu;
    if (activeTriggerElement || parent.type === "menubar" && lastOpenChangeReason !== reason_parts_exports.outsidePress) {
      returnFocus = true;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FloatingFocusManager, {
      context: floatingContext,
      openInteractionType: openMethod,
      modal: isContextMenu,
      disabled: !mounted,
      returnFocus: finalFocus === void 0 ? returnFocus : finalFocus,
      initialFocus: parent.type !== "menu",
      restoreFocus: true,
      externalTree: parent.type !== "menubar" ? floatingTreeRoot : void 0,
      previousFocusableElement: activeTriggerElement,
      nextFocusableElement: parent.type === void 0 ? store.context.triggerFocusTargetRef : void 0,
      beforeContentFocusGuardRef: parent.type === void 0 ? store.context.beforeContentFocusGuardRef : void 0,
      children: element
    });
  });
  if (true) MenuPopup.displayName = "MenuPopup";

  // node_modules/@base-ui/react/menu/portal/MenuPortal.mjs
  var React71 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/menu/portal/MenuPortalContext.mjs
  var React70 = __toESM(require_react(), 1);
  var MenuPortalContext = /* @__PURE__ */ React70.createContext(void 0);
  if (true) MenuPortalContext.displayName = "MenuPortalContext";
  function useMenuPortalContext() {
    const value = React70.useContext(MenuPortalContext);
    if (value === void 0) {
      throw new Error(true ? "Base UI: <Menu.Portal> is missing." : formatErrorMessage_default(32));
    }
    return value;
  }

  // node_modules/@base-ui/react/menu/portal/MenuPortal.mjs
  var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
  var MenuPortal = /* @__PURE__ */ React71.forwardRef(function MenuPortal2(props, forwardedRef) {
    const {
      keepMounted = false,
      ...portalProps
    } = props;
    const {
      store,
      parent
    } = useMenuRootContext();
    const mounted = store.useState("mounted");
    const shouldRender = mounted || keepMounted;
    if (!shouldRender) {
      return null;
    }
    const portalOwnerRole = parent.type === "menu" || parent.type === "menubar" ? "group" : void 0;
    return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(MenuPortalContext.Provider, {
      value: keepMounted,
      children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FloatingPortal, {
        ref: forwardedRef,
        ...portalProps,
        portalOwnerRole
      })
    });
  });
  if (true) MenuPortal.displayName = "MenuPortal";

  // node_modules/@base-ui/react/menu/positioner/MenuPositioner.mjs
  var React72 = __toESM(require_react(), 1);
  var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
  var MenuPositioner = /* @__PURE__ */ React72.forwardRef(function MenuPositioner2(componentProps, forwardedRef) {
    const {
      anchor: anchorProp,
      positionMethod: positionMethodProp = "absolute",
      className,
      render: render4,
      side,
      align: alignProp,
      sideOffset: sideOffsetProp = 0,
      alignOffset: alignOffsetProp = 0,
      collisionBoundary = "clipping-ancestors",
      collisionPadding = 5,
      arrowPadding = 5,
      sticky = false,
      disableAnchorTracking = false,
      collisionAvoidance: collisionAvoidanceProp = DROPDOWN_COLLISION_AVOIDANCE,
      style,
      ...elementProps
    } = componentProps;
    const {
      store
    } = useMenuRootContext();
    const keepMounted = useMenuPortalContext();
    const contextMenuContext = useContextMenuRootContext(true);
    const parent = store.useState("parent");
    const floatingRootContext = store.useState("floatingRootContext");
    const floatingTreeRoot = store.useState("floatingTreeRoot");
    const mounted = store.useState("mounted");
    const open2 = store.useState("open");
    const modal = store.useState("modal");
    const openMethod = store.useState("openMethod");
    const triggerElement = store.useState("activeTriggerElement");
    const transitionStatus = store.useState("transitionStatus");
    const positionerElement = store.useState("positionerElement");
    const instantType = store.useState("instantType");
    const adaptiveOrigin2 = store.useState("adaptiveOrigin");
    const lastOpenChangeReason = store.useState("lastOpenChangeReason");
    const floatingNodeId = store.useState("floatingNodeId");
    const floatingParentNodeId = store.useState("floatingParentNodeId");
    const domReference = floatingRootContext.useState("domReferenceElement");
    const previousTriggerRef = React72.useRef(null);
    const runOnceAnimationsFinish = useAnimationsFinished(positionerElement);
    let anchor = anchorProp;
    let sideOffset = sideOffsetProp;
    let alignOffset = alignOffsetProp;
    let align = alignProp;
    let collisionAvoidance = collisionAvoidanceProp;
    if (parent.type === "context-menu") {
      anchor = anchorProp ?? parent.context?.anchor;
      align = align ?? "start";
      if (!side && align !== "center") {
        alignOffset = componentProps.alignOffset ?? 2;
        sideOffset = componentProps.sideOffset ?? -5;
      }
    }
    let computedSide = side;
    let computedAlign = align;
    if (parent.type === "menu") {
      computedSide = computedSide ?? "inline-end";
      computedAlign = computedAlign ?? "start";
      collisionAvoidance = componentProps.collisionAvoidance ?? POPUP_COLLISION_AVOIDANCE;
    } else if (parent.type === "menubar") {
      computedSide = computedSide ?? (parent.context.orientation === "vertical" ? "inline-end" : "bottom");
      computedAlign = computedAlign ?? "start";
    }
    const contextMenu = parent.type === "context-menu";
    const positioner = useAnchorPositioning({
      anchor,
      floatingRootContext,
      positionMethod: contextMenuContext ? "fixed" : positionMethodProp,
      mounted,
      side: computedSide,
      sideOffset,
      align: computedAlign,
      alignOffset,
      arrowPadding: contextMenu ? 0 : arrowPadding,
      collisionBoundary,
      collisionPadding,
      sticky,
      nodeId: floatingNodeId,
      keepMounted,
      disableAnchorTracking,
      collisionAvoidance,
      shift: contextMenu ? {
        crossAxis: !("side" in collisionAvoidance && collisionAvoidance.side === "flip"),
        rootBoundary: "layoutViewport"
      } : void 0,
      externalTree: floatingTreeRoot,
      adaptiveOrigin: adaptiveOrigin2
    });
    React72.useEffect(() => {
      function onMenuOpenChange(details) {
        if (details.open) {
          if (details.parentNodeId === floatingNodeId) {
            store.set("hoverEnabled", false);
          }
          if (details.nodeId !== floatingNodeId && details.parentNodeId === store.select("floatingParentNodeId")) {
            store.setOpen(false, createChangeEventDetails(reason_parts_exports.siblingOpen));
          }
        }
      }
      floatingTreeRoot.events.on("menuopenchange", onMenuOpenChange);
      return () => {
        floatingTreeRoot.events.off("menuopenchange", onMenuOpenChange);
      };
    }, [store, floatingTreeRoot.events, floatingNodeId]);
    React72.useEffect(() => {
      if (store.select("floatingParentNodeId") == null) {
        return void 0;
      }
      function onParentClose(details) {
        if (details.open || details.nodeId !== store.select("floatingParentNodeId")) {
          return;
        }
        const reason = details.reason ?? reason_parts_exports.siblingOpen;
        store.setOpen(false, createChangeEventDetails(reason));
      }
      floatingTreeRoot.events.on("menuopenchange", onParentClose);
      return () => {
        floatingTreeRoot.events.off("menuopenchange", onParentClose);
      };
    }, [floatingTreeRoot.events, store]);
    const closeTimeout = useTimeout();
    React72.useEffect(() => {
      if (!open2) {
        closeTimeout.clear();
      }
    }, [open2, closeTimeout]);
    React72.useEffect(() => {
      function onItemHover(event) {
        if (!open2 || event.nodeId !== store.select("floatingParentNodeId")) {
          return;
        }
        if (event.target && triggerElement && triggerElement !== event.target) {
          const delay = store.select("closeDelay");
          if (delay > 0) {
            if (!closeTimeout.isStarted()) {
              closeTimeout.start(delay, () => {
                store.setOpen(false, createChangeEventDetails(reason_parts_exports.siblingOpen));
              });
            }
          } else {
            store.setOpen(false, createChangeEventDetails(reason_parts_exports.siblingOpen));
          }
        } else {
          closeTimeout.clear();
        }
      }
      floatingTreeRoot.events.on("itemhover", onItemHover);
      return () => {
        floatingTreeRoot.events.off("itemhover", onItemHover);
      };
    }, [floatingTreeRoot.events, open2, triggerElement, store, closeTimeout]);
    React72.useEffect(() => {
      const eventDetails = {
        open: open2,
        nodeId: floatingNodeId,
        parentNodeId: floatingParentNodeId,
        reason: store.select("lastOpenChangeReason")
      };
      floatingTreeRoot.events.emit("menuopenchange", eventDetails);
    }, [floatingTreeRoot.events, open2, store, floatingNodeId, floatingParentNodeId]);
    useIsoLayoutEffect(() => {
      const currentTrigger = domReference;
      const previousTrigger = previousTriggerRef.current;
      if (currentTrigger) {
        previousTriggerRef.current = currentTrigger;
      }
      if (previousTrigger && currentTrigger && currentTrigger !== previousTrigger) {
        store.set("instantType", void 0);
        const abortController = new AbortController();
        runOnceAnimationsFinish(() => {
          store.set("instantType", "trigger-change");
        }, abortController.signal);
        return () => {
          abortController.abort();
        };
      }
      return void 0;
    }, [domReference, runOnceAnimationsFinish, store]);
    const state = {
      open: open2,
      side: positioner.side,
      align: positioner.align,
      anchorHidden: positioner.anchorHidden,
      nested: parent.type === "menu",
      instant: instantType
    };
    const menubarModal = parent.type === "menubar" && parent.context.modal;
    const popupModal = modal && lastOpenChangeReason !== reason_parts_exports.triggerHover;
    useAnchoredPopupScrollLock(open2 && (menubarModal || popupModal), openMethod === "touch", positionerElement, triggerElement);
    const element = usePositioner(componentProps, state, {
      styles: positioner.positionerStyles,
      transitionStatus,
      props: elementProps,
      refs: [forwardedRef, store.useStateSetter("positionerElement")],
      hidden: !mounted,
      inert: !open2
    });
    const shouldRenderBackdrop = mounted && parent.type !== "menu" && (parent.type !== "menubar" && modal && lastOpenChangeReason !== reason_parts_exports.triggerHover || parent.type === "menubar" && parent.context.modal);
    let backdropCutout = null;
    if (parent.type === "menubar") {
      backdropCutout = parent.context.contentElement;
    } else if (parent.type === void 0) {
      backdropCutout = triggerElement;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(MenuPositionerContext.Provider, {
      value: positioner,
      children: [shouldRenderBackdrop && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(InternalBackdrop, {
        ref: parent.type === "context-menu" || parent.type === "nested-context-menu" ? parent.context.internalBackdropRef : null,
        inert: inertValue(!open2),
        cutout: backdropCutout
      }), /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FloatingNode, {
        id: floatingNodeId,
        children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CompositeList, {
          elementsRef: store.context.itemDomElements,
          labelsRef: store.context.itemLabels,
          children: element
        })
      })]
    });
  });
  if (true) MenuPositioner.displayName = "MenuPositioner";

  // node_modules/@base-ui/react/menu/radio-group/MenuRadioGroup.mjs
  var React74 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/menu/radio-group/MenuRadioGroupContext.mjs
  var React73 = __toESM(require_react(), 1);
  var MenuRadioGroupContext = /* @__PURE__ */ React73.createContext(void 0);
  if (true) MenuRadioGroupContext.displayName = "MenuRadioGroupContext";
  function useMenuRadioGroupContext() {
    const context = React73.useContext(MenuRadioGroupContext);
    if (context === void 0) {
      throw new Error(true ? "Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>." : formatErrorMessage_default(34));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/radio-group/MenuRadioGroup.mjs
  var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
  var MenuRadioGroup = /* @__PURE__ */ React74.memo(/* @__PURE__ */ React74.forwardRef(function MenuRadioGroup2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      value: valueProp,
      defaultValue: defaultValue2,
      onValueChange: onValueChangeProp,
      disabled: disabled2 = false,
      style,
      "aria-labelledby": ariaLabelledByProp,
      ...elementProps
    } = componentProps;
    const [labelId, setLabelId] = React74.useState(void 0);
    const [value, setValueUnwrapped] = useControlled({
      controlled: valueProp,
      default: defaultValue2,
      name: "MenuRadioGroup"
    });
    const setValue = useStableCallback((newValue, eventDetails) => {
      onValueChangeProp?.(newValue, eventDetails);
      if (eventDetails.isCanceled) {
        return;
      }
      setValueUnwrapped(newValue);
    });
    const state = {
      disabled: disabled2
    };
    const element = useRenderElement("div", componentProps, {
      state,
      ref: forwardedRef,
      props: {
        role: "group",
        "aria-labelledby": ariaLabelledByProp ?? labelId,
        "aria-disabled": disabled2 || void 0,
        ...elementProps
      }
    });
    const context = React74.useMemo(() => ({
      value,
      setValue,
      disabled: disabled2
    }), [value, setValue, disabled2]);
    return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MenuGroupContext.Provider, {
      value: setLabelId,
      children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MenuRadioGroupContext.Provider, {
        value: context,
        children: element
      })
    });
  }));
  if (true) MenuRadioGroup.displayName = "MenuRadioGroup";

  // node_modules/@base-ui/react/menu/radio-item/MenuRadioItem.mjs
  var React76 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/menu/radio-item/MenuRadioItemContext.mjs
  var React75 = __toESM(require_react(), 1);
  var MenuRadioItemContext = /* @__PURE__ */ React75.createContext(void 0);
  if (true) MenuRadioItemContext.displayName = "MenuRadioItemContext";
  function useMenuRadioItemContext() {
    const context = React75.useContext(MenuRadioItemContext);
    if (context === void 0) {
      throw new Error(true ? "Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>." : formatErrorMessage_default(35));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/radio-item/MenuRadioItem.mjs
  var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
  var MenuRadioItem = /* @__PURE__ */ React76.forwardRef(function MenuRadioItem2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      id: idProp,
      label,
      nativeButton = false,
      disabled: disabledProp = false,
      closeOnClick = false,
      value,
      style,
      ...elementProps
    } = componentProps;
    const listItem = useCompositeListItem({
      guess: true,
      label
    });
    const menuPositionerContext = useMenuPositionerContext(true);
    const id = useBaseUiId(idProp);
    const {
      store
    } = useMenuRootContext();
    const highlighted = store.useState("isActive", listItem.index);
    const itemProps = store.useState("itemProps");
    const {
      value: selectedValue,
      setValue: setSelectedValue,
      disabled: groupDisabled
    } = useMenuRadioGroupContext();
    const rootDisabled = store.useState("disabled");
    const disabled2 = disabledProp || groupDisabled || rootDisabled;
    const checked2 = selectedValue === value;
    const {
      getItemProps,
      itemRef
    } = useMenuItem({
      closeOnClick,
      disabled: disabled2,
      highlighted,
      id,
      store,
      nativeButton,
      nodeId: menuPositionerContext?.context.nodeId,
      itemMetadata: REGULAR_ITEM
    });
    const state = React76.useMemo(() => ({
      disabled: disabled2,
      highlighted,
      checked: checked2
    }), [disabled2, highlighted, checked2]);
    function handleClick(event) {
      const details = createChangeEventDetails(reason_parts_exports.itemPress, event.nativeEvent, void 0, {
        preventUnmountOnClose: NOOP
      });
      setSelectedValue(value, details);
    }
    const element = useRenderElement("div", componentProps, {
      state,
      stateAttributesMapping: itemMapping,
      props: [itemProps, {
        role: "menuitemradio",
        "aria-checked": checked2,
        onClick: handleClick
      }, elementProps, getItemProps],
      ref: [itemRef, forwardedRef, listItem.ref]
    });
    return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MenuRadioItemContext.Provider, {
      value: state,
      children: element
    });
  });
  if (true) MenuRadioItem.displayName = "MenuRadioItem";

  // node_modules/@base-ui/react/menu/radio-item-indicator/MenuRadioItemIndicator.mjs
  var React77 = __toESM(require_react(), 1);
  var MenuRadioItemIndicator = /* @__PURE__ */ React77.forwardRef(function MenuRadioItemIndicator2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      keepMounted = false,
      ...elementProps
    } = componentProps;
    const item = useMenuRadioItemContext();
    const indicatorRef = React77.useRef(null);
    const {
      transitionStatus,
      mounted,
      setMounted
    } = useTransitionStatus(item.checked);
    useOpenChangeComplete({
      batch: true,
      enabled: !item.checked,
      open: item.checked,
      ref: indicatorRef,
      onComplete() {
        if (!item.checked) {
          setMounted(false);
        }
      }
    });
    const state = {
      checked: item.checked,
      disabled: item.disabled,
      highlighted: item.highlighted,
      transitionStatus
    };
    const element = useRenderElement("span", componentProps, {
      state,
      stateAttributesMapping: itemMapping,
      ref: [forwardedRef, indicatorRef],
      props: {
        "aria-hidden": true,
        ...elementProps
      },
      enabled: keepMounted || mounted
    });
    return element;
  });
  if (true) MenuRadioItemIndicator.displayName = "MenuRadioItemIndicator";

  // node_modules/@base-ui/react/menu/root/MenuRoot.mjs
  var React81 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/menubar/MenubarContext.mjs
  var React78 = __toESM(require_react(), 1);
  var MenubarContext = /* @__PURE__ */ React78.createContext(null);
  if (true) MenubarContext.displayName = "MenubarContext";
  function useMenubarContext(optional) {
    const context = React78.useContext(MenubarContext);
    if (context === null && !optional) {
      throw new Error(true ? "Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>." : formatErrorMessage_default(5));
    }
    return context;
  }

  // node_modules/@base-ui/react/menu/store/MenuStore.mjs
  var React79 = __toESM(require_react(), 1);
  var selectors2 = {
    ...popupStoreSelectors,
    disabled: (state) => state.parent.type === "menubar" ? state.parent.context.disabled || state.disabled : state.disabled,
    modal: (state) => (state.parent.type === void 0 || state.parent.type === "context-menu") && (state.modal ?? true),
    openMethod: (state) => state.openMethod,
    allowMouseEnter: (state) => state.allowMouseEnter,
    highlightItemOnHover: (state) => state.highlightItemOnHover,
    parent: (state) => state.parent,
    rootId: (state) => {
      if (state.parent.type === "menu") {
        return state.parent.store.select("rootId");
      }
      return state.parent.type !== void 0 ? state.parent.context.rootId : state.rootId;
    },
    activeIndex: (state) => state.activeIndex,
    isActive: (state, itemIndex) => state.activeIndex === itemIndex,
    hoverEnabled: (state) => state.hoverEnabled,
    instantType: (state) => state.instantType,
    lastOpenChangeReason: (state) => state.openChangeReason,
    floatingTreeRoot: (state) => {
      if (state.parent.type === "menu") {
        return state.parent.store.select("floatingTreeRoot");
      }
      return state.floatingTreeRoot;
    },
    floatingNodeId: (state) => state.floatingNodeId,
    floatingParentNodeId: (state) => state.floatingParentNodeId,
    itemProps: (state) => state.itemProps,
    closeDelay: (state) => state.closeDelay,
    adaptiveOrigin: (state) => state.adaptiveOrigin,
    keyboardEventRelay: (state) => {
      if (state.keyboardEventRelay) {
        return state.keyboardEventRelay;
      }
      if (state.parent.type === "menu") {
        return state.parent.store.select("keyboardEventRelay");
      }
      return void 0;
    }
  };
  var MenuStore = class extends ReactStore {
    constructor(initialState, floatingId, nested = false) {
      const triggerElements = new PopupTriggerMap();
      const state = createInitialState(triggerElements, floatingId, nested, initialState);
      super(state, createInitialContext(triggerElements), selectors2);
      this.unsubscribeParentListener = this.observe("parent", (parent) => {
        this.unsubscribeParentListener?.();
        if (parent.type === "menu") {
          let rootId = parent.store.select("rootId");
          let floatingTreeRoot = parent.store.select("floatingTreeRoot");
          let keyboardEventRelay = parent.store.select("keyboardEventRelay");
          this.unsubscribeParentListener = parent.store.subscribe(() => {
            const nextRootId = parent.store.select("rootId");
            const nextFloatingTreeRoot = parent.store.select("floatingTreeRoot");
            const nextKeyboardEventRelay = parent.store.select("keyboardEventRelay");
            if (rootId === nextRootId && floatingTreeRoot === nextFloatingTreeRoot && keyboardEventRelay === nextKeyboardEventRelay) {
              return;
            }
            rootId = nextRootId;
            floatingTreeRoot = nextFloatingTreeRoot;
            keyboardEventRelay = nextKeyboardEventRelay;
            this.notifyAll();
          });
          this.context.allowMouseUpTriggerRef = parent.store.context.allowMouseUpTriggerRef;
          return;
        }
        if (parent.type !== void 0) {
          this.context.allowMouseUpTriggerRef = parent.context.allowMouseUpTriggerRef;
        }
        this.unsubscribeParentListener = null;
      });
    }
    setOpen(open2, eventDetails) {
      this.state.floatingRootContext.context.events.emit("setOpen", {
        open: open2,
        eventDetails
      });
    }
    unsubscribeParentListener = null;
  };
  function createNullMenuStore() {
    const triggerElements = new PopupTriggerMap();
    const store = new NullStore(Object.freeze(createInitialState(triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors2);
    return Object.assign(store, {
      setOpen: NOOP
    });
  }
  function createInitialContext(triggerElements) {
    return {
      positionerRef: /* @__PURE__ */ React79.createRef(),
      popupRef: /* @__PURE__ */ React79.createRef(),
      typingRef: {
        current: false
      },
      itemDomElements: {
        current: []
      },
      itemLabels: {
        current: []
      },
      allowMouseUpTriggerRef: {
        current: false
      },
      triggerFocusTargetRef: /* @__PURE__ */ React79.createRef(),
      beforeContentFocusGuardRef: /* @__PURE__ */ React79.createRef(),
      onOpenChangeComplete: void 0,
      triggerElements
    };
  }
  function createInitialState(triggerElements, floatingId, nested = false, initialState) {
    return {
      ...createInitialPopupStoreState(triggerElements, floatingId, nested),
      disabled: false,
      modal: true,
      openMethod: null,
      allowMouseEnter: false,
      highlightItemOnHover: true,
      parent: {
        type: void 0
      },
      rootId: void 0,
      activeIndex: null,
      hoverEnabled: true,
      instantType: void 0,
      openChangeReason: null,
      floatingTreeRoot: new FloatingTreeStore(),
      floatingNodeId: void 0,
      floatingParentNodeId: null,
      itemProps: EMPTY_OBJECT,
      keyboardEventRelay: void 0,
      closeDelay: 0,
      adaptiveOrigin: void 0,
      ...initialState
    };
  }

  // node_modules/@base-ui/react/menu/submenu-root/MenuSubmenuRootContext.mjs
  var React80 = __toESM(require_react(), 1);
  var MenuSubmenuRootContext = /* @__PURE__ */ React80.createContext(void 0);
  if (true) MenuSubmenuRootContext.displayName = "MenuSubmenuRootContext";
  function useMenuSubmenuRootContext() {
    return React80.useContext(MenuSubmenuRootContext);
  }

  // node_modules/@base-ui/react/menu/root/MenuRoot.mjs
  var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
  var MenuRoot = fastComponent(function MenuRoot2(props) {
    const {
      children,
      open: openProp,
      onOpenChange,
      onOpenChangeComplete,
      defaultOpen = false,
      disabled: disabledProp = false,
      modal: modalProp,
      loopFocus = true,
      orientation = "vertical",
      actionsRef,
      closeParentOnEsc = false,
      handle,
      triggerId: triggerIdProp,
      defaultTriggerId: defaultTriggerIdProp = null,
      highlightItemOnHover = true
    } = props;
    const contextMenuContext = useContextMenuRootContext(true);
    const parentMenuRootContext = useMenuRootContext(true);
    const menubarContext = useMenubarContext(true);
    const isSubmenu = useMenuSubmenuRootContext();
    const parentFromContext = React81.useMemo(() => {
      if (isSubmenu && parentMenuRootContext) {
        return {
          type: "menu",
          store: parentMenuRootContext.store
        };
      }
      if (menubarContext) {
        return {
          type: "menubar",
          context: menubarContext
        };
      }
      if (contextMenuContext && !parentMenuRootContext) {
        return {
          type: "context-menu",
          context: contextMenuContext
        };
      }
      return {
        type: void 0
      };
    }, [contextMenuContext, parentMenuRootContext, menubarContext, isSubmenu]);
    const rootId = useId();
    const floatingId = useId();
    const floatingParentNodeIdFromContext = useFloatingParentNodeId();
    const parentMenuStore = parentFromContext.type === "menu" ? parentFromContext.store : void 0;
    const animateInitialOpen = (openProp ?? defaultOpen) && parentMenuStore?.state.transitionStatus === "starting";
    const seededInstantType = useRefWithInit(() => animateInitialOpen ? parentMenuStore?.state.instantType : void 0).current;
    const store = useMenuRootStore({
      open: defaultOpen,
      openProp,
      activeTriggerId: defaultTriggerIdProp,
      triggerIdProp,
      parent: parentFromContext,
      disabled: disabledProp,
      highlightItemOnHover,
      modal: parentFromContext.type === void 0 ? modalProp : void 0,
      rootId,
      instantType: seededInstantType
    }, floatingId, floatingParentNodeIdFromContext != null);
    store.useControlledProp("openProp", openProp);
    store.useControlledProp("triggerIdProp", triggerIdProp);
    store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
    const floatingTreeRoot = store.useState("floatingTreeRoot");
    const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);
    const open2 = store.useState("open");
    const activeTriggerElement = store.useState("activeTriggerElement");
    const positionerElement = store.useState("positionerElement");
    const hoverEnabled = store.useState("hoverEnabled");
    const disabled2 = store.useState("disabled");
    const lastOpenChangeReason = store.useState("lastOpenChangeReason");
    const parent = store.useState("parent");
    const activeIndex = store.useState("activeIndex");
    const payload = store.useState("payload");
    const floatingParentNodeId = store.useState("floatingParentNodeId");
    const openEventRef = React81.useRef(null);
    const allowOutsidePressDismissalRef = React81.useRef(parent.type !== "context-menu");
    const allowOutsidePressDismissalTimeout = useTimeout();
    const allowTouchToCloseRef = React81.useRef(true);
    const allowTouchToCloseTimeout = useTimeout();
    const nested = floatingParentNodeId != null;
    if (true) {
      if (parent.type !== void 0 && modalProp !== void 0) {
        console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored.");
      }
    }
    const {
      openMethod,
      triggerProps: interactionTypeProps
    } = useOpenInteractionType(open2);
    store.useSyncedValues({
      disabled: disabledProp,
      highlightItemOnHover,
      modal: parent.type === void 0 ? modalProp : void 0,
      openMethod,
      rootId
    });
    useImplicitActiveTrigger(store);
    const {
      forceUnmount,
      transitionStatus
    } = useOpenStateTransitions(open2, store, () => {
      store.set("allowMouseEnter", false);
    }, animateInitialOpen);
    const runOnceAnimationsFinish = useAnimationsFinished(store.context.popupRef);
    React81.useEffect(() => {
      if (seededInstantType === void 0) {
        return void 0;
      }
      const clearSeededInstantType = () => {
        if (store.state.instantType === seededInstantType) {
          store.set("instantType", void 0);
        }
      };
      if (!open2) {
        clearSeededInstantType();
        return void 0;
      }
      if (transitionStatus !== void 0) {
        return void 0;
      }
      if (store.context.popupRef.current == null) {
        clearSeededInstantType();
        return void 0;
      }
      const abortController = new AbortController();
      runOnceAnimationsFinish(clearSeededInstantType, abortController.signal);
      return () => {
        abortController.abort();
      };
    }, [seededInstantType, open2, transitionStatus, runOnceAnimationsFinish, store]);
    useIsoLayoutEffect(() => {
      if (contextMenuContext && !parentMenuRootContext) {
        store.update({
          parent: {
            type: "context-menu",
            context: contextMenuContext
          },
          floatingNodeId: floatingNodeIdFromContext,
          floatingParentNodeId: floatingParentNodeIdFromContext
        });
      } else if (parentMenuRootContext) {
        store.update({
          floatingNodeId: floatingNodeIdFromContext,
          floatingParentNodeId: floatingParentNodeIdFromContext
        });
      }
    }, [contextMenuContext, parentMenuRootContext, floatingNodeIdFromContext, floatingParentNodeIdFromContext, store]);
    React81.useEffect(() => {
      if (!open2) {
        openEventRef.current = null;
      }
      if (parent.type !== "context-menu") {
        return;
      }
      if (!open2) {
        allowOutsidePressDismissalTimeout.clear();
        allowOutsidePressDismissalRef.current = false;
        return;
      }
      allowOutsidePressDismissalTimeout.start(500, () => {
        allowOutsidePressDismissalRef.current = true;
      });
    }, [allowOutsidePressDismissalTimeout, open2, parent.type]);
    useIsoLayoutEffect(() => {
      if (!open2 && !hoverEnabled) {
        store.set("hoverEnabled", true);
      }
    }, [open2, hoverEnabled, store]);
    const setOpen = useStableCallback((nextOpen, eventDetails) => {
      const reason = eventDetails.reason;
      if (!nextOpen && !store.select("open")) {
        return;
      }
      if (open2 === nextOpen && eventDetails.trigger === activeTriggerElement && lastOpenChangeReason === reason) {
        return;
      }
      const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);
      if (!nextOpen && eventDetails.trigger == null) {
        eventDetails.trigger = activeTriggerElement ?? void 0;
      }
      onOpenChange?.(nextOpen, eventDetails);
      if (eventDetails.isCanceled) {
        return;
      }
      store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
      const nativeEvent = eventDetails.event;
      if (nextOpen === false && nativeEvent?.type === "click" && nativeEvent.pointerType === "touch" && !allowTouchToCloseRef.current) {
        return;
      }
      if (nextOpen && reason === reason_parts_exports.triggerFocus) {
        allowTouchToCloseRef.current = false;
        allowTouchToCloseTimeout.start(300, () => {
          allowTouchToCloseRef.current = true;
        });
      } else {
        allowTouchToCloseRef.current = true;
        allowTouchToCloseTimeout.clear();
      }
      const isKeyboardClick = (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.itemPress) && nativeEvent.detail === 0;
      const isDismissClose = !nextOpen && (reason === reason_parts_exports.escapeKey || reason == null);
      openEventRef.current = eventDetails.event;
      const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
      popupOpenState.openChangeReason = reason;
      if (parent.type === "menubar" && (reason === reason_parts_exports.triggerFocus || reason === reason_parts_exports.focusOut || reason === reason_parts_exports.triggerHover || reason === reason_parts_exports.listNavigation || reason === reason_parts_exports.siblingOpen)) {
        popupOpenState.instantType = "group";
      } else if (isKeyboardClick || isDismissClose) {
        popupOpenState.instantType = isKeyboardClick ? "click" : "dismiss";
      } else {
        popupOpenState.instantType = void 0;
      }
      store.update(popupOpenState);
    });
    const floatingRootContext = useSyncedFloatingRootContext({
      popupStore: store,
      floatingRootContext: store.state.floatingRootContext,
      floatingId,
      nested: floatingParentNodeIdFromContext != null,
      onOpenChange: setOpen
    });
    const floatingEvents = floatingRootContext.context.events;
    useIsoLayoutEffect(() => {
      const handleSetOpenEvent = ({
        open: nextOpen,
        eventDetails
      }) => setOpen(nextOpen, eventDetails);
      floatingEvents.on("setOpen", handleSetOpenEvent);
      return () => {
        floatingEvents?.off("setOpen", handleSetOpenEvent);
      };
    }, [floatingEvents, setOpen]);
    const handleImperativeClose = React81.useCallback(() => {
      store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction));
    }, [store]);
    React81.useImperativeHandle(actionsRef, () => ({
      unmount: forceUnmount,
      close: handleImperativeClose
    }), [forceUnmount, handleImperativeClose]);
    let ctx8;
    if (parent.type === "context-menu") {
      ctx8 = parent.context;
    }
    React81.useImperativeHandle(ctx8?.positionerRef, () => positionerElement, [positionerElement]);
    React81.useImperativeHandle(ctx8?.actionsRef, () => ({
      setOpen
    }), [setOpen]);
    const dismiss = useDismiss(floatingRootContext, {
      enabled: !disabled2,
      bubbles: {
        escapeKey: closeParentOnEsc && parent.type === "menu"
      },
      outsidePress() {
        if (parent.type !== "context-menu" || openEventRef.current?.type === "contextmenu") {
          return true;
        }
        return allowOutsidePressDismissalRef.current;
      },
      externalTree: nested ? floatingTreeRoot : void 0
    });
    const direction = useDirection();
    const setActiveIndex = React81.useCallback((index2) => {
      if (store.select("activeIndex") === index2) {
        return;
      }
      store.set("activeIndex", index2);
    }, [store]);
    const listNavigation2 = useListNavigation(floatingRootContext, {
      enabled: !disabled2,
      listRef: store.context.itemDomElements,
      activeIndex,
      nested: parent.type !== void 0,
      loopFocus,
      orientation,
      parentOrientation: parent.type === "menubar" ? parent.context.orientation : void 0,
      rtl: direction === "rtl",
      disabledIndices: EMPTY_ARRAY,
      onNavigate: setActiveIndex,
      openOnArrowKeyDown: parent.type !== "context-menu",
      externalTree: nested ? floatingTreeRoot : void 0,
      focusItemOnHover: highlightItemOnHover
    });
    const onTyping = React81.useCallback((nextTyping) => {
      store.context.typingRef.current = nextTyping;
    }, [store]);
    const typeahead = useTypeahead(floatingRootContext, {
      enabled: !disabled2,
      listRef: store.context.itemLabels,
      elementsRef: store.context.itemDomElements,
      activeIndex,
      resetMs: TYPEAHEAD_RESET_MS,
      onMatch: (index2) => {
        if (open2 && index2 !== activeIndex) {
          store.set("activeIndex", index2);
        }
      },
      onTyping
    });
    const activeTriggerProps = React81.useMemo(() => {
      const mergedProps = mergeProps(typeahead.reference, listNavigation2.reference, dismiss.reference, {
        onMouseMove() {
          store.set("allowMouseEnter", true);
        }
      }, interactionTypeProps);
      mergedProps["aria-haspopup"] = "menu";
      mergedProps["aria-expanded"] = open2;
      return mergedProps;
    }, [store, typeahead.reference, listNavigation2.reference, dismiss.reference, interactionTypeProps, open2]);
    const inactiveTriggerProps = React81.useMemo(() => {
      const mergedProps = mergeProps(listNavigation2.trigger, dismiss.trigger, interactionTypeProps);
      mergedProps["aria-haspopup"] = "menu";
      mergedProps["aria-expanded"] = false;
      return mergedProps;
    }, [listNavigation2.trigger, dismiss.trigger, interactionTypeProps]);
    useRefWithInit(() => {
      store.update({
        inactiveTriggerProps
      });
      return null;
    });
    const popupProps = React81.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, {
      id: floatingId,
      role: "menu",
      // `menu` is implicitly vertical, so only the non-default value needs to be rendered.
      "aria-orientation": orientation === "horizontal" ? "horizontal" : void 0,
      "aria-labelledby": activeTriggerElement?.id,
      onMouseMove() {
        store.set("allowMouseEnter", true);
        if (parent.type === "menu") {
          store.set("hoverEnabled", false);
        }
      },
      onClick() {
        if (store.select("hoverEnabled")) {
          store.set("hoverEnabled", false);
        }
      },
      onKeyDown(event) {
        const relay = store.select("keyboardEventRelay");
        if (relay && !event.isPropagationStopped()) {
          relay(event);
        }
      }
    }, typeahead.floating, listNavigation2.floating, dismiss.floating), [activeTriggerElement, floatingId, orientation, parent.type, store, typeahead.floating, listNavigation2.floating, dismiss.floating]);
    const itemProps = listNavigation2.item ?? EMPTY_OBJECT;
    usePopupInteractionProps(store, {
      floatingRootContext,
      activeTriggerProps,
      inactiveTriggerProps,
      popupProps,
      itemProps
    });
    const context = React81.useMemo(() => ({
      store,
      parent: parentFromContext
    }), [store, parentFromContext]);
    const content = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(MenuRootContext.Provider, {
      value: context,
      children: [handle && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopupHandleAttachment, {
        handle,
        store
      }), typeof children === "function" ? children({
        payload
      }) : children]
    });
    if (parent.type === void 0 || parent.type === "context-menu") {
      return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FloatingTree, {
        externalTree: floatingTreeRoot,
        children: content
      });
    }
    return content;
  });
  if (true) MenuRoot.displayName = "MenuRoot";
  function useMenuRootStore(initialState, floatingId, nested) {
    const store = useRefWithInit(() => new MenuStore(initialState, floatingId, nested)).current;
    return store;
  }

  // node_modules/@base-ui/react/menu/submenu-root/MenuSubmenuRoot.mjs
  var React82 = __toESM(require_react(), 1);
  var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
  function MenuSubmenuRoot(props) {
    const parentMenu = useMenuRootContext().store;
    const contextValue = React82.useMemo(() => ({
      parentMenu
    }), [parentMenu]);
    return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MenuSubmenuRootContext.Provider, {
      value: contextValue,
      children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MenuRoot, {
        ...props
      })
    });
  }

  // node_modules/@base-ui/react/menu/trigger/MenuTrigger.mjs
  var React86 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
  var React83 = __toESM(require_react(), 1);
  function useCompositeItem(params = {}) {
    const {
      highlightItemOnHover,
      highlightedIndex,
      onHighlightedIndexChange
    } = useCompositeRootContext();
    const {
      ref,
      index: index2
    } = useCompositeListItem(params);
    const isHighlighted = highlightedIndex === index2;
    const itemRef = React83.useRef(null);
    const mergedRef = useMergedRefs(ref, itemRef);
    const compositeProps = {
      tabIndex: isHighlighted ? 0 : -1,
      onFocus() {
        onHighlightedIndexChange(index2);
      },
      onMouseMove() {
        const item = itemRef.current;
        if (!highlightItemOnHover || !item) {
          return;
        }
        const disabled2 = item.hasAttribute("disabled") || item.ariaDisabled === "true";
        if (!isHighlighted && !disabled2) {
          item.focus();
        }
      }
    };
    return {
      compositeProps,
      compositeRef: mergedRef,
      index: index2
    };
  }

  // node_modules/@base-ui/react/internals/composite/item/CompositeItem.mjs
  function CompositeItem(componentProps) {
    const {
      render: render4,
      className,
      style,
      state = EMPTY_OBJECT,
      props = EMPTY_ARRAY,
      refs = EMPTY_ARRAY,
      metadata,
      stateAttributesMapping: stateAttributesMapping2,
      tag = "div",
      ...elementProps
    } = componentProps;
    const {
      compositeProps,
      compositeRef
    } = useCompositeItem({
      metadata
    });
    return useRenderElement(tag, componentProps, {
      state,
      // The composite ref attaches first so an outer item wins when nested items share a DOM node.
      ref: [compositeRef, ...refs],
      props: [compositeProps, ...props, elementProps],
      stateAttributesMapping: stateAttributesMapping2
    });
  }

  // node_modules/@base-ui/react/menu/utils/findRootOwnerId.mjs
  function findRootOwnerId(node) {
    if (isHTMLElement(node) && node.hasAttribute("data-rootownerid")) {
      return node.getAttribute("data-rootownerid");
    }
    if (isLastTraversableNode(node)) {
      return void 0;
    }
    return findRootOwnerId(getParentNode(node));
  }

  // node_modules/@base-ui/react/utils/popups/useTriggerFocusGuards.mjs
  var React84 = __toESM(require_react(), 1);
  var ReactDOM6 = __toESM(require_react_dom(), 1);
  function useTriggerFocusGuards(store, triggerElementRef) {
    const preFocusGuardRef = React84.useRef(null);
    function handlePreFocusGuardFocus(event) {
      ReactDOM6.flushSync(() => {
        store.setOpen(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent, event.currentTarget));
      });
      const previousTabbable = getTabbableBeforeElement(preFocusGuardRef.current);
      previousTabbable?.focus();
    }
    function handleFocusTargetFocus(event) {
      const positionerElement = store.select("positionerElement");
      if (positionerElement && isOutsideEvent(event, positionerElement)) {
        store.context.beforeContentFocusGuardRef.current?.focus();
      } else {
        ReactDOM6.flushSync(() => {
          store.setOpen(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent, event.currentTarget));
        });
        let nextTabbable = getTabbableAfterElement(store.context.triggerFocusTargetRef.current || triggerElementRef.current);
        while (nextTabbable !== null && contains(positionerElement, nextTabbable)) {
          const prevTabbable = nextTabbable;
          nextTabbable = getNextTabbable(nextTabbable);
          if (nextTabbable === prevTabbable) {
            break;
          }
        }
        nextTabbable?.focus();
      }
    }
    return {
      preFocusGuardRef,
      handlePreFocusGuardFocus,
      handleFocusTargetFocus
    };
  }

  // node_modules/@base-ui/react/utils/useMixedToggleClickHandler.mjs
  var React85 = __toESM(require_react(), 1);
  function useMixedToggleClickHandler(params) {
    const {
      enabled = true,
      mouseDownAction,
      open: open2
    } = params;
    const ignoreClickRef = React85.useRef(false);
    return React85.useMemo(() => {
      if (!enabled) {
        return EMPTY_OBJECT;
      }
      return {
        onMouseDown: (event) => {
          if (mouseDownAction === "open" && !open2 || mouseDownAction === "close" && open2) {
            ignoreClickRef.current = true;
            ownerDocument(event.currentTarget).addEventListener("click", () => {
              ignoreClickRef.current = false;
            }, {
              once: true
            });
          }
        },
        onClick: (event) => {
          if (ignoreClickRef.current) {
            ignoreClickRef.current = false;
            event.preventBaseUIHandler();
          }
        }
      };
    }, [enabled, mouseDownAction, open2]);
  }

  // node_modules/@base-ui/react/menu/trigger/MenuTrigger.mjs
  var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
  var MenuTrigger = fastComponentRef(function MenuTrigger2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      disabled: disabledProp = false,
      nativeButton = true,
      id: idProp,
      openOnHover: openOnHoverProp,
      delay = 100,
      closeDelay = 0,
      handle,
      payload,
      ...elementProps
    } = componentProps;
    const rootContext = useMenuRootContext(true);
    const handleStore = usePopupHandleStore(handle);
    const store = handleStore ?? rootContext?.store;
    if (!store) {
      throw new Error(true ? "Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle." : formatErrorMessage_default(85));
    }
    const thisTriggerId = useBaseUiId(idProp);
    const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
    const floatingRootContext = store.useState("floatingRootContext");
    const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
    const popupId = store.useState("triggerPopupId", thisTriggerId);
    const triggerElementRef = React86.useRef(null);
    const parent = useMenuParent();
    const compositeRootContext = useCompositeRootContext(true);
    const floatingTreeRootFromContext = useFloatingTree();
    const floatingTreeRoot = React86.useMemo(() => {
      return floatingTreeRootFromContext ?? new FloatingTreeStore();
    }, [floatingTreeRootFromContext]);
    const floatingNodeId = useFloatingNodeId(floatingTreeRoot);
    const floatingParentNodeId = useFloatingParentNodeId();
    const {
      registerTrigger,
      isMountedByThisTrigger
    } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
      payload,
      closeDelay,
      parent,
      floatingTreeRoot,
      floatingNodeId,
      floatingParentNodeId,
      keyboardEventRelay: compositeRootContext?.relayKeyboardEvent
    });
    const isInMenubar = parent.type === "menubar";
    const rootDisabled = store.useState("disabled");
    const disabled2 = disabledProp || rootDisabled || isInMenubar && parent.context.disabled;
    const {
      getButtonProps,
      buttonRef
    } = useButton({
      disabled: disabled2,
      native: nativeButton
    });
    React86.useEffect(() => {
      if (!isOpenedByThisTrigger && parent.type === void 0) {
        store.context.allowMouseUpTriggerRef.current = false;
      }
    }, [store, isOpenedByThisTrigger, parent.type]);
    const triggerRef = React86.useRef(null);
    const allowMouseUpTriggerTimeout = useTimeout();
    const handleDocumentMouseUp = useStableCallback((mouseEvent) => {
      if (!triggerRef.current) {
        return;
      }
      allowMouseUpTriggerTimeout.clear();
      store.context.allowMouseUpTriggerRef.current = false;
      const mouseUpTarget = mouseEvent.target;
      if (contains(triggerRef.current, mouseUpTarget) || contains(store.select("positionerElement"), mouseUpTarget) || mouseUpTarget === triggerRef.current) {
        return;
      }
      if (mouseUpTarget != null && findRootOwnerId(mouseUpTarget) === store.select("rootId")) {
        return;
      }
      if (isMouseWithinBounds(mouseEvent, triggerRef.current)) {
        return;
      }
      floatingTreeRoot.events.emit("close", {
        domEvent: mouseEvent,
        reason: reason_parts_exports.cancelOpen
      });
    });
    React86.useEffect(() => {
      if (isOpenedByThisTrigger && store.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) {
        const doc = ownerDocument(triggerRef.current);
        doc.addEventListener("mouseup", handleDocumentMouseUp, {
          once: true
        });
      }
    }, [isOpenedByThisTrigger, handleDocumentMouseUp, store]);
    const parentMenubarHasSubmenuOpen = isInMenubar && parent.context.hasSubmenuOpen;
    const openOnHover = openOnHoverProp ?? parentMenubarHasSubmenuOpen;
    const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
      enabled: openOnHover && !disabled2 && (!isInMenubar || parentMenubarHasSubmenuOpen && !isMountedByThisTrigger),
      handleClose: safePolygon({
        blockPointerEvents: !isInMenubar
      }),
      mouseOnly: true,
      move: false,
      restMs: parent.type === void 0 ? delay : void 0,
      delay: {
        close: closeDelay
      },
      triggerElementRef,
      externalTree: floatingTreeRoot,
      isActiveTrigger: isTriggerActive,
      isClosing: () => store.select("transitionStatus") === "ending"
    });
    const stickIfOpen = useStickIfOpen(isOpenedByThisTrigger, store.select("lastOpenChangeReason"));
    const click = useClick(floatingRootContext, {
      enabled: !disabled2,
      event: isOpenedByThisTrigger && isInMenubar ? "click" : "mousedown",
      toggle: true,
      ignoreMouse: false,
      stickIfOpen: parent.type === void 0 ? stickIfOpen : false
    });
    const focus = useFocus(floatingRootContext, {
      enabled: !disabled2 && parentMenubarHasSubmenuOpen
    });
    const mixedToggleHandlers = useMixedToggleClickHandler({
      open: isOpenedByThisTrigger,
      enabled: isInMenubar,
      mouseDownAction: "open"
    });
    const localInteractionProps = React86.useMemo(() => mergeProps(focus.reference, click.reference), [focus.reference, click.reference]);
    const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
    const {
      preFocusGuardRef,
      handlePreFocusGuardFocus,
      handleFocusTargetFocus
    } = useTriggerFocusGuards(store, triggerElementRef);
    const state = {
      disabled: disabled2,
      open: isOpenedByThisTrigger
    };
    const ref = [triggerRef, forwardedRef, buttonRef, registerTrigger, triggerElementRef];
    const props = [localInteractionProps, hoverProps ?? EMPTY_OBJECT, rootTriggerProps, {
      "aria-haspopup": "menu",
      "aria-controls": popupId,
      id: thisTriggerId,
      onMouseDown: (event) => {
        if (store.select("open")) {
          return;
        }
        allowMouseUpTriggerTimeout.start(200, () => {
          store.context.allowMouseUpTriggerRef.current = true;
        });
        const doc = ownerDocument(event.currentTarget);
        doc.addEventListener("mouseup", handleDocumentMouseUp, {
          once: true
        });
      }
    }, isInMenubar ? {
      role: "menuitem"
    } : {}, mixedToggleHandlers, elementProps, getButtonProps];
    const element = useRenderElement("button", componentProps, {
      enabled: !isInMenubar,
      stateAttributesMapping: pressableTriggerOpenStateMapping,
      state,
      ref,
      props
    });
    if (isInMenubar) {
      return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CompositeItem, {
        tag: "button",
        render: render4,
        className,
        style,
        state,
        refs: ref,
        props,
        stateAttributesMapping: pressableTriggerOpenStateMapping
      });
    }
    if (isOpenedByThisTrigger) {
      return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(React86.Fragment, {
        children: [/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FocusGuard, {
          ref: preFocusGuardRef,
          onFocus: handlePreFocusGuardFocus
        }, `${thisTriggerId}-pre-focus-guard`), /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(React86.Fragment, {
          children: element
        }, thisTriggerId), /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FocusGuard, {
          ref: store.context.triggerFocusTargetRef,
          onFocus: handleFocusTargetFocus
        }, `${thisTriggerId}-post-focus-guard`)]
      });
    }
    return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(React86.Fragment, {
      children: element
    }, thisTriggerId);
  });
  if (true) MenuTrigger.displayName = "MenuTrigger";
  function useStickIfOpen(open2, openReason) {
    const stickIfOpenTimeout = useTimeout();
    const [stickIfOpen, setStickIfOpen] = React86.useState(false);
    useIsoLayoutEffect(() => {
      if (open2 && openReason === reason_parts_exports.triggerHover) {
        setStickIfOpen(true);
        stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {
          setStickIfOpen(false);
        });
      } else if (!open2) {
        stickIfOpenTimeout.clear();
        setStickIfOpen(false);
      }
    }, [open2, openReason, stickIfOpenTimeout]);
    return stickIfOpen;
  }
  function useMenuParent() {
    const menubarContext = useMenubarContext(true);
    const parent = React86.useMemo(() => {
      if (menubarContext) {
        return {
          type: "menubar",
          context: menubarContext
        };
      }
      return {
        type: void 0
      };
    }, [menubarContext]);
    return parent;
  }

  // node_modules/@base-ui/react/menu/viewport/MenuViewport.mjs
  var React91 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/utils/usePopupViewport.mjs
  var React90 = __toESM(require_react(), 1);
  var ReactDOM7 = __toESM(require_react_dom(), 1);

  // node_modules/@base-ui/utils/usePreviousValue.mjs
  var React87 = __toESM(require_react(), 1);
  function usePreviousValue(value) {
    const [state, setState] = React87.useState({
      current: value,
      previous: null
    });
    if (!Object.is(value, state.current)) {
      setState({
        current: value,
        previous: state.current
      });
    }
    return state.previous;
  }

  // node_modules/@base-ui/react/utils/usePopupAutoResize.mjs
  var React88 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/utils/getCssDimensions.mjs
  function getCssDimensions2(element) {
    const css = getComputedStyle2(element);
    let width = parseFloat(css.width) || 0;
    let height = parseFloat(css.height) || 0;
    const hasOffset = isHTMLElement(element);
    const offsetWidth = hasOffset ? element.offsetWidth : width;
    const offsetHeight = hasOffset ? element.offsetHeight : height;
    const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
    if (shouldFallback) {
      width = offsetWidth;
      height = offsetHeight;
    }
    return {
      width,
      height
    };
  }

  // node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs
  var popupWidth = "--popup-width";
  var popupHeight = "--popup-height";

  // node_modules/@base-ui/react/utils/usePopupAutoResize.mjs
  function usePopupAutoResize(parameters) {
    const {
      popupElement,
      positionerElement,
      content,
      mounted,
      onMeasureLayout: onMeasureLayoutParam,
      onMeasureLayoutComplete: onMeasureLayoutCompleteParam,
      side,
      direction
    } = parameters;
    const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true);
    const animationFrame = useAnimationFrame();
    const committedDimensionsRef = React88.useRef(null);
    const isInitialRenderRef = React88.useRef(true);
    const restoreAnchoringStylesRef = React88.useRef(NOOP);
    const onMeasureLayout = useStableCallback(onMeasureLayoutParam);
    const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam);
    const anchoringStyles = React88.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]);
    useIsoLayoutEffect(() => {
      if (!mounted) {
        restoreAnchoringStylesRef.current = NOOP;
        isInitialRenderRef.current = true;
        committedDimensionsRef.current = null;
        return void 0;
      }
      if (!popupElement || !positionerElement) {
        return void 0;
      }
      restoreAnchoringStylesRef.current = applyElementStyles(popupElement, anchoringStyles);
      setPopupCssSize(popupElement, "auto");
      const restorePopupPosition = overrideElementStyle(popupElement, "position", "static");
      const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none");
      const restorePopupScale = overrideElementStyle(popupElement, "scale", "1");
      const restorePositionerAvailableSize = applyElementStyles(positionerElement, {
        [availableWidth]: "max-content",
        [availableHeight]: "max-content"
      });
      function restoreMeasurementOverrides() {
        restorePopupPosition();
        restorePopupTransform();
        restorePositionerAvailableSize();
      }
      function restoreMeasurementOverridesIncludingScale() {
        restoreMeasurementOverrides();
        restorePopupScale();
      }
      onMeasureLayout?.();
      if (isInitialRenderRef.current || committedDimensionsRef.current === null) {
        setPositionerCssSize(positionerElement, "max-content");
        const dimensions = getCssDimensions2(popupElement);
        committedDimensionsRef.current = dimensions;
        setPositionerCssSize(positionerElement, dimensions);
        restoreMeasurementOverridesIncludingScale();
        onMeasureLayoutComplete?.(null, dimensions);
        isInitialRenderRef.current = false;
        return () => {
          restoreAnchoringStylesRef.current();
          restoreAnchoringStylesRef.current = NOOP;
        };
      }
      setPositionerCssSize(positionerElement, "max-content");
      const previousDimensions = committedDimensionsRef.current;
      const newDimensions = getCssDimensions2(popupElement);
      committedDimensionsRef.current = newDimensions;
      setPopupCssSize(popupElement, previousDimensions);
      restoreMeasurementOverridesIncludingScale();
      onMeasureLayoutComplete?.(previousDimensions, newDimensions);
      setPositionerCssSize(positionerElement, newDimensions);
      const abortController = new AbortController();
      animationFrame.request(() => {
        setPopupCssSize(popupElement, newDimensions);
        runOnceAnimationsFinish(() => {
          popupElement.style.setProperty(popupWidth, "auto");
          popupElement.style.setProperty(popupHeight, "auto");
        }, abortController.signal);
      });
      return () => {
        abortController.abort();
        animationFrame.cancel();
        restoreAnchoringStylesRef.current();
        restoreAnchoringStylesRef.current = NOOP;
      };
    }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]);
  }
  function getPopupAnchoringStyles(side, direction) {
    const isPhysicalTop = side === "top";
    const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start");
    if (!isPhysicalTop && !isPhysicalLeft) {
      return EMPTY_OBJECT;
    }
    return {
      position: "absolute",
      [isPhysicalTop ? "bottom" : "top"]: "0",
      [isPhysicalLeft ? "right" : "left"]: "0"
    };
  }
  function overrideElementStyle(element, property, value) {
    const originalValue = element.style.getPropertyValue(property);
    element.style.setProperty(property, value);
    return () => {
      element.style.setProperty(property, originalValue);
    };
  }
  function applyElementStyles(element, styles) {
    const restorers = [];
    for (const [key, value] of Object.entries(styles)) {
      restorers.push(overrideElementStyle(element, key, value));
    }
    return restorers.length ? () => {
      restorers.forEach((restore) => restore());
    } : NOOP;
  }
  function setPopupCssSize(popupElement, size4) {
    const width = size4 === "auto" ? "auto" : `${size4.width}px`;
    const height = size4 === "auto" ? "auto" : `${size4.height}px`;
    popupElement.style.setProperty(popupWidth, width);
    popupElement.style.setProperty(popupHeight, height);
  }
  function setPositionerCssSize(positionerElement, size4) {
    const width = size4 === "max-content" ? "max-content" : `${size4.width}px`;
    const height = size4 === "max-content" ? "max-content" : `${size4.height}px`;
    positionerElement.style.setProperty(positionerWidth, width);
    positionerElement.style.setProperty(positionerHeight, height);
  }

  // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs
  var React89 = __toESM(require_react(), 1);
  var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
  var DirectionProvider = function DirectionProvider2(props) {
    const {
      direction = "ltr"
    } = props;
    const contextValue = React89.useMemo(() => ({
      direction
    }), [direction]);
    return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(DirectionContext.Provider, {
      value: contextValue,
      children: props.children
    });
  };
  if (true) DirectionProvider.displayName = "DirectionProvider";

  // node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs
  var adaptiveOrigin = {
    name: "adaptiveOrigin",
    async fn(state) {
      const {
        x: rawX,
        y: rawY,
        rects: {
          floating: floatRect
        },
        elements: {
          floating
        },
        platform: platform3,
        strategy,
        placement
      } = state;
      const win = getWindow(floating);
      const styles = win.getComputedStyle(floating);
      const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== "";
      if (!hasTransition) {
        return {
          x: rawX,
          y: rawY,
          data: DEFAULT_SIDES
        };
      }
      const offsetParent = await platform3.getOffsetParent?.(floating);
      let offsetDimensions = {
        width: 0,
        height: 0
      };
      if (strategy === "fixed" && win?.visualViewport) {
        offsetDimensions = {
          width: win.visualViewport.width,
          height: win.visualViewport.height
        };
      } else if (offsetParent === win) {
        const doc = ownerDocument(floating);
        offsetDimensions = {
          width: doc.documentElement.clientWidth,
          height: doc.documentElement.clientHeight
        };
      } else if (await platform3.isElement?.(offsetParent)) {
        offsetDimensions = await platform3.getDimensions(offsetParent);
      }
      const currentSide = getSide(placement);
      let x2 = rawX;
      let y2 = rawY;
      if (currentSide === "left") {
        x2 = offsetDimensions.width - (rawX + floatRect.width);
      }
      if (currentSide === "top") {
        y2 = offsetDimensions.height - (rawY + floatRect.height);
      }
      const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX;
      const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY;
      return {
        x: x2,
        y: y2,
        data: {
          sideX,
          sideY
        }
      };
    }
  };

  // node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs
  var activationDirection = "data-activation-direction";

  // node_modules/@base-ui/react/utils/usePopupViewport.mjs
  var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
  var popupViewportStateMapping = {
    activationDirection: (value) => value ? {
      [activationDirection]: value
    } : null
  };
  function usePopupViewport(parameters) {
    const {
      store,
      side,
      children
    } = parameters;
    const direction = useDirection();
    const activeTrigger = store.useState("activeTriggerElement");
    const activeTriggerId = store.useState("activeTriggerId");
    const open2 = store.useState("open");
    const payload = store.useState("payload");
    const mounted = store.useState("mounted");
    const popupElement = store.useState("popupElement");
    const positionerElement = store.useState("positionerElement");
    const previousActiveTrigger = usePreviousValue(open2 ? activeTrigger : null);
    const currentContentKey = usePopupContentKey(activeTriggerId, payload);
    const capturedNodeRef = React90.useRef(null);
    const [previousContentNode, setPreviousContentNode] = React90.useState(null);
    const [newTriggerOffset, setNewTriggerOffset] = React90.useState(null);
    const currentContainerRef = React90.useRef(null);
    const previousContainerRef = React90.useRef(null);
    const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true);
    const cleanupFrame = useAnimationFrame();
    const cleanupControllerRef = React90.useRef(null);
    const [previousContentDimensions, setPreviousContentDimensions] = React90.useState(null);
    const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React90.useState(false);
    useIsoLayoutEffect(() => {
      store.set("adaptiveOrigin", adaptiveOrigin);
      return () => {
        store.set("adaptiveOrigin", void 0);
      };
    }, [store]);
    const handleMeasureLayout = useStableCallback(() => {
      currentContainerRef.current?.style.setProperty("animation", "none");
      currentContainerRef.current?.style.setProperty("transition", "none");
      previousContainerRef.current?.style.setProperty("display", "none");
    });
    const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => {
      currentContainerRef.current?.style.removeProperty("animation");
      currentContainerRef.current?.style.removeProperty("transition");
      previousContainerRef.current?.style.removeProperty("display");
      if (previousDimensions) {
        setPreviousContentDimensions(previousDimensions);
      }
    });
    const armViewportCleanup = useStableCallback(() => {
      cleanupControllerRef.current?.abort();
      const controller = new AbortController();
      cleanupControllerRef.current = controller;
      onAnimationsFinished(() => {
        setPreviousContentNode(null);
        setPreviousContentDimensions(null);
        capturedNodeRef.current = null;
      }, controller.signal);
    });
    const lastHandledTriggerRef = React90.useRef(null);
    useIsoLayoutEffect(() => {
      if (!open2 || !mounted) {
        lastHandledTriggerRef.current = null;
      }
    }, [open2, mounted]);
    useIsoLayoutEffect(() => {
      if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {
        setPreviousContentNode(capturedNodeRef.current);
        setShowStartingStyleAttribute(true);
        const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger);
        setNewTriggerOffset(offset4);
        lastHandledTriggerRef.current = activeTrigger;
      }
    }, [activeTrigger, previousActiveTrigger]);
    useIsoLayoutEffect(() => {
      if (previousContentNode == null) {
        return;
      }
      cleanupControllerRef.current?.abort();
      setShowStartingStyleAttribute(true);
      cleanupFrame.request(() => {
        ReactDOM7.flushSync(() => {
          setShowStartingStyleAttribute(false);
        });
        armViewportCleanup();
      });
    }, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]);
    useIsoLayoutEffect(() => {
      const source = currentContainerRef.current;
      if (!source) {
        return;
      }
      const wrapper = ownerDocument(source).createElement("div");
      for (const child of Array.from(source.childNodes)) {
        wrapper.appendChild(child.cloneNode(true));
      }
      capturedNodeRef.current = wrapper;
    });
    const isTransitioning = previousContentNode != null;
    let childrenToRender;
    if (!isTransitioning) {
      childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {
        "data-current": true,
        ref: currentContainerRef,
        children
      }, currentContentKey);
    } else {
      childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(React90.Fragment, {
        children: [/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {
          "data-previous": true,
          inert: inertValue(true),
          ref: previousContainerRef,
          style: {
            ...previousContentDimensions ? {
              [popupWidth]: `${previousContentDimensions.width}px`,
              [popupHeight]: `${previousContentDimensions.height}px`
            } : null,
            position: "absolute"
          },
          "data-ending-style": showStartingStyleAttribute ? void 0 : ""
        }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {
          "data-current": true,
          ref: currentContainerRef,
          "data-starting-style": showStartingStyleAttribute ? "" : void 0,
          children
        }, currentContentKey)]
      });
    }
    useIsoLayoutEffect(() => {
      const container = previousContainerRef.current;
      if (!container || !previousContentNode) {
        return;
      }
      container.replaceChildren(...Array.from(previousContentNode.childNodes));
    }, [previousContentNode]);
    usePopupAutoResize({
      popupElement,
      positionerElement,
      mounted,
      content: payload,
      onMeasureLayout: handleMeasureLayout,
      onMeasureLayoutComplete: handleMeasureLayoutComplete,
      side,
      direction
    });
    const state = {
      activationDirection: getActivationDirection(newTriggerOffset),
      transitioning: isTransitioning
    };
    return {
      children: childrenToRender,
      state
    };
  }
  function getActivationDirection(offset4) {
    if (!offset4) {
      return void 0;
    }
    return `${getValueWithTolerance(offset4.horizontal, 5, "right", "left")} ${getValueWithTolerance(offset4.vertical, 5, "down", "up")}`;
  }
  function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) {
    if (value > tolerance) {
      return positiveLabel;
    }
    if (value < -tolerance) {
      return negativeLabel;
    }
    return "";
  }
  function calculateRelativePosition(from, to) {
    const fromRect = from.getBoundingClientRect();
    const toRect = to.getBoundingClientRect();
    const fromCenter = {
      x: fromRect.left + fromRect.width / 2,
      y: fromRect.top + fromRect.height / 2
    };
    const toCenter = {
      x: toRect.left + toRect.width / 2,
      y: toRect.top + toRect.height / 2
    };
    return {
      horizontal: toCenter.x - fromCenter.x,
      vertical: toCenter.y - fromCenter.y
    };
  }
  function usePopupContentKey(activeTriggerId, payload) {
    const [contentKey, setContentKey] = React90.useState(0);
    const previousActiveTriggerIdRef = React90.useRef(activeTriggerId);
    const previousPayloadRef = React90.useRef(payload);
    const pendingPayloadUpdateRef = React90.useRef(false);
    useIsoLayoutEffect(() => {
      const previousActiveTriggerId = previousActiveTriggerIdRef.current;
      const previousPayload = previousPayloadRef.current;
      const triggerIdChanged = activeTriggerId !== previousActiveTriggerId;
      const payloadChanged = payload !== previousPayload;
      if (triggerIdChanged) {
        setContentKey((value) => value + 1);
        pendingPayloadUpdateRef.current = !payloadChanged;
      } else if (pendingPayloadUpdateRef.current && payloadChanged) {
        setContentKey((value) => value + 1);
        pendingPayloadUpdateRef.current = false;
      }
      previousActiveTriggerIdRef.current = activeTriggerId;
      previousPayloadRef.current = payload;
    }, [activeTriggerId, payload]);
    return `${activeTriggerId ?? "current"}-${contentKey}`;
  }

  // node_modules/@base-ui/react/menu/viewport/MenuViewport.mjs
  var MenuViewport = /* @__PURE__ */ React91.forwardRef(function MenuViewport2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      children,
      ...elementProps
    } = componentProps;
    const {
      store
    } = useMenuRootContext();
    const {
      side
    } = useMenuPositionerContext();
    const instantType = store.useState("instantType");
    const {
      children: childrenToRender,
      state: viewportState
    } = usePopupViewport({
      store,
      side,
      children
    });
    const state = {
      activationDirection: viewportState.activationDirection,
      transitioning: viewportState.transitioning,
      instant: instantType
    };
    return useRenderElement("div", componentProps, {
      state,
      ref: forwardedRef,
      props: [elementProps, {
        children: childrenToRender
      }],
      stateAttributesMapping: popupViewportStateMapping
    });
  });
  if (true) MenuViewport.displayName = "MenuViewport";

  // node_modules/@base-ui/react/separator/Separator.mjs
  var React92 = __toESM(require_react(), 1);
  var Separator = /* @__PURE__ */ React92.forwardRef(function SeparatorComponent(componentProps, forwardedRef) {
    const {
      className,
      render: render4,
      orientation = "horizontal",
      style,
      ...elementProps
    } = componentProps;
    const state = {
      orientation
    };
    const element = useRenderElement("div", componentProps, {
      state,
      ref: forwardedRef,
      props: [{
        role: "separator",
        "aria-orientation": orientation
      }, elementProps]
    });
    return element;
  });
  if (true) Separator.displayName = "Separator";

  // node_modules/@base-ui/react/menu/submenu-trigger/MenuSubmenuTrigger.mjs
  var React93 = __toESM(require_react(), 1);

  // node_modules/@base-ui/utils/isElementDisabled.mjs
  function isElementDisabled(element) {
    return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
  }

  // node_modules/@base-ui/react/menu/submenu-trigger/MenuSubmenuTrigger.mjs
  var VOICE_OVER_EXPANDED_PROPS = {
    "aria-expanded": void 0
  };
  var MenuSubmenuTrigger = /* @__PURE__ */ React93.forwardRef(function MenuSubmenuTrigger2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      label,
      id: idProp,
      nativeButton = false,
      openOnHover = true,
      delay = 100,
      closeDelay = 0,
      disabled: disabledProp = false,
      ...elementProps
    } = componentProps;
    const submenuRootContext = useMenuSubmenuRootContext();
    if (!submenuRootContext?.parentMenu) {
      throw new Error(true ? "Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>." : formatErrorMessage_default(37));
    }
    const listItem = useCompositeListItem({
      guess: true,
      label
    });
    const menuPositionerContext = useMenuPositionerContext();
    const {
      store
    } = useMenuRootContext();
    const thisTriggerId = useBaseUiId(idProp);
    const open2 = store.useState("open");
    const floatingRootContext = store.useState("floatingRootContext");
    const floatingTreeRoot = store.useState("floatingTreeRoot");
    const popupId = store.useState("triggerPopupId", thisTriggerId);
    const baseRegisterTrigger = useTriggerRegistration(thisTriggerId, store);
    const registerTrigger = useStableCallback((element2) => {
      baseRegisterTrigger(element2);
      if (element2 !== null && store.select("open") && store.select("activeTriggerId") == null) {
        store.update({
          activeTriggerId: thisTriggerId ?? null,
          activeTriggerElement: element2,
          closeDelay
        });
      }
    });
    const triggerElementRef = React93.useRef(null);
    const handleTriggerElementRef = React93.useCallback((el) => {
      triggerElementRef.current = el;
      store.set("activeTriggerElement", el);
    }, [store]);
    useIsoLayoutEffect(() => {
      registerTrigger(triggerElementRef.current);
      return () => registerTrigger(null);
    }, [registerTrigger, thisTriggerId, store]);
    store.useSyncedValue("closeDelay", closeDelay);
    const parentMenuStore = submenuRootContext.parentMenu;
    const rootDisabled = store.useState("disabled");
    const parentDisabled = parentMenuStore.useState("disabled");
    const disabled2 = disabledProp || rootDisabled || parentDisabled;
    if (true) {
      React93.useEffect(() => {
        const element2 = triggerElementRef.current;
        if (element2 && isElementDisabled(element2) && !disabled2) {
          const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
          warn(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${ownerStackMessage}`);
        }
      });
    }
    const itemProps = parentMenuStore.useState("itemProps");
    const highlighted = parentMenuStore.useState("isActive", listItem.index);
    const itemMetadata = React93.useMemo(() => ({
      type: "submenu-trigger",
      setActive() {
        if (parentMenuStore.select("highlightItemOnHover")) {
          parentMenuStore.set("activeIndex", listItem.index);
        }
      }
    }), [parentMenuStore, listItem.index]);
    const {
      getItemProps,
      itemRef
    } = useMenuItem({
      closeOnClick: false,
      disabled: disabled2,
      highlighted,
      id: thisTriggerId,
      store,
      typingRef: parentMenuStore.context.typingRef,
      nativeButton,
      itemMetadata,
      nodeId: menuPositionerContext?.context.nodeId
    });
    const hoverEnabled = store.useState("hoverEnabled");
    const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
      enabled: hoverEnabled && openOnHover && !disabled2,
      handleClose: safePolygon({
        blockPointerEvents: true
      }),
      mouseOnly: true,
      move: true,
      restMs: delay,
      delay: {
        open: delay,
        close: closeDelay
      },
      shouldOpen: delay > 0 ? () => parentMenuStore.select("allowMouseEnter") : void 0,
      triggerElementRef,
      externalTree: floatingTreeRoot,
      isClosing: () => store.select("transitionStatus") === "ending",
      // Chrome can drop the trigger's `mouseleave` during a fast pointer sweep,
      // leaving a stale submenu open (see #5152) — cancel from `mouseout` too.
      guardStaleOpen: true
    });
    const click = useClick(floatingRootContext, {
      enabled: !disabled2,
      event: "mousedown",
      toggle: !openOnHover,
      ignoreMouse: openOnHover,
      stickIfOpen: false
    });
    const localInteractionProps = click.reference ?? EMPTY_OBJECT;
    const rootTriggerProps = store.useState("triggerProps", true);
    delete rootTriggerProps.id;
    const state = {
      disabled: disabled2,
      highlighted,
      open: open2
    };
    const openMethod = store.useState("openMethod");
    const lastOpenChangeReason = store.useState("lastOpenChangeReason");
    const openedByKeyboard = lastOpenChangeReason === reason_parts_exports.listNavigation || openMethod === "keyboard";
    const shouldOmitExpanded = open2 && openedByKeyboard && parts_exports.screenReader.voiceOver;
    const element = useRenderElement("div", componentProps, {
      state,
      stateAttributesMapping: triggerOpenStateMapping,
      props: [
        localInteractionProps,
        hoverProps,
        rootTriggerProps,
        itemProps,
        // Opening a submenu changes the trigger's expanded state while the trigger still holds
        // focus, and VoiceOver announces that state change instead of the submenu item that focus
        // moves to a moment later, so the first item is never announced. Dropping the state while
        // the submenu is open avoids the announcement without claiming the submenu is collapsed;
        // `aria-haspopup` still conveys that the item opens a submenu.
        shouldOmitExpanded ? VOICE_OVER_EXPANDED_PROPS : void 0,
        {
          "aria-controls": popupId,
          tabIndex: open2 || highlighted ? 0 : -1,
          onBlur() {
            if (highlighted) {
              parentMenuStore.set("activeIndex", null);
            }
          }
        },
        elementProps,
        getItemProps
      ],
      ref: [forwardedRef, listItem.ref, itemRef, registerTrigger, handleTriggerElementRef]
    });
    return element;
  });
  if (true) MenuSubmenuTrigger.displayName = "MenuSubmenuTrigger";

  // node_modules/@base-ui/react/menu/store/MenuHandle.mjs
  var MenuHandle = class extends BasePopupHandle {
    constructor() {
      super(createNullMenuStore(), "Menu");
    }
    /**
     * Opens the menu and associates it with the trigger with the given id.
     *
     * This method should only be called in an event handler or an effect (not during rendering).
     *
     * @param triggerId ID of the trigger to associate with the menu. The trigger must be a matching
     * `Menu.Trigger` with this handle passed as a prop.
     */
    open(triggerId) {
      this.openByTrigger(triggerId);
    }
    /**
     * Closes the menu.
     *
     * This method should only be called in an event handler or an effect (not during rendering).
     */
    close() {
      this.closePopup();
    }
    /**
     * Whether the menu is currently open. Returns `false` while no root is attached to the handle.
     */
    get isOpen() {
      return this.attachedStore?.select("open") ?? false;
    }
  };
  function createMenuHandle() {
    return new MenuHandle();
  }

  // node_modules/@base-ui/react/field/index.parts.mjs
  var index_parts_exports2 = {};
  __export(index_parts_exports2, {
    Control: () => FieldControl,
    Description: () => FieldDescription,
    Error: () => FieldError,
    Item: () => FieldItem,
    Label: () => FieldLabel,
    Root: () => FieldRoot,
    Validity: () => FieldValidity
  });

  // node_modules/@base-ui/react/field/root/FieldRoot.mjs
  var React97 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/fieldset/root/FieldsetRootContext.mjs
  var React94 = __toESM(require_react(), 1);
  var FieldsetRootContext = /* @__PURE__ */ React94.createContext(void 0);
  if (true) FieldsetRootContext.displayName = "FieldsetRootContext";
  function useFieldsetRootContext(optional = false) {
    const context = React94.useContext(FieldsetRootContext);
    if (!context && !optional) {
      throw new Error(true ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : formatErrorMessage_default(86));
    }
    return context;
  }

  // node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs
  var React95 = __toESM(require_react(), 1);
  var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
  var LabelableProvider = function LabelableProvider2(props) {
    const defaultId = useBaseUiId();
    const [controlIdState, setControlIdState] = React95.useState(defaultId);
    const [labelId, setLabelId] = React95.useState();
    const [messageIds, setMessageIds] = React95.useState([]);
    const controlId = controlIdState === void 0 ? defaultId : controlIdState;
    const registrationsRef = useRefWithInit(() => /* @__PURE__ */ new Map());
    const {
      messageIds: parentMessageIds
    } = useLabelableContext();
    const registerControlId = useStableCallback((source, nextId) => {
      const registrations = registrationsRef.current;
      if (nextId === void 0) {
        registrations.delete(source);
      } else {
        registrations.set(source, nextId);
      }
      setControlIdState((prev) => {
        if (registrations.size === 0) {
          return prev;
        }
        let nextControlId;
        for (const id of registrations.values()) {
          if (id === prev) {
            return prev;
          }
          if (nextControlId === void 0) {
            nextControlId = id;
          }
        }
        return nextControlId;
      });
    });
    const resetControlId = useStableCallback(() => {
      if (registrationsRef.current.size === 0) {
        setControlIdState(defaultId);
      }
    });
    const getDescriptionProps = React95.useCallback((externalProps) => {
      const ids = externalProps["aria-describedby"] ? externalProps["aria-describedby"].split(" ") : [];
      ids.push(...parentMessageIds, ...messageIds);
      return {
        ...externalProps,
        "aria-describedby": Array.from(new Set(ids)).join(" ") || void 0
      };
    }, [parentMessageIds, messageIds]);
    const contextValue = React95.useMemo(() => ({
      controlId,
      registerControlId,
      resetControlId,
      labelId,
      setLabelId,
      messageIds,
      setMessageIds,
      getDescriptionProps
    }), [controlId, registerControlId, resetControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]);
    return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LabelableContext.Provider, {
      value: contextValue,
      children: props.children
    });
  };
  if (true) LabelableProvider.displayName = "LabelableProvider";

  // node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs
  var React96 = __toESM(require_react(), 1);
  function useFieldControlRegistration(params) {
    const {
      change,
      commit,
      invalid: invalid2,
      markedDirtyRef,
      name,
      setRegisteredFieldName,
      registeredFieldIdRef,
      setValidityData,
      validityData
    } = params;
    const {
      formRef
    } = useFormContext();
    const activeFieldControlSourceRef = React96.useRef(null);
    const registrationRef = React96.useRef(null);
    const initialValueCapturedRef = React96.useRef(false);
    const getValueForForm = useStableCallback(() => {
      const registration = registrationRef.current;
      if (!registration) {
        return void 0;
      }
      if (registration.getValue) {
        return registration.getValue();
      }
      return registration.value;
    });
    function getRegistrationValue(registration) {
      return registration.value === void 0 ? getValueForForm() : registration.value;
    }
    const validate = useStableCallback(() => {
      const registration = registrationRef.current;
      markedDirtyRef.current = true;
      if (!registration) {
        commit(validityData.value);
        return;
      }
      commit(getRegistrationValue(registration));
    });
    function refreshRegistration() {
      const registration = registrationRef.current;
      if (!registration || !registration.id) {
        return;
      }
      formRef.current.fields.set(registration.id, {
        getValue: getValueForForm,
        name: name ?? registration.name,
        controlRef: registration.controlRef,
        validityData: getCombinedFieldValidityData(validityData, invalid2),
        validate
      });
    }
    function deleteRegistration(id = registrationRef.current?.id) {
      if (id) {
        formRef.current.fields.delete(id);
      }
    }
    function captureInitialValue(registration) {
      if (initialValueCapturedRef.current) {
        return;
      }
      initialValueCapturedRef.current = true;
      const initialValue = getRegistrationValue(registration);
      setValidityData((prev) => prev.initialValue === initialValue ? prev : {
        ...prev,
        initialValue
      });
    }
    useIsoLayoutEffect(() => {
      const registration = registrationRef.current;
      if (!registration || !registration.id) {
        return;
      }
      setRegisteredFieldName(name ? void 0 : registration.name);
      formRef.current.fields.set(registration.id, {
        getValue: getValueForForm,
        name: name ?? registration.name,
        controlRef: registration.controlRef,
        validityData: getCombinedFieldValidityData(validityData, invalid2),
        validate
      });
    }, [formRef, getValueForForm, invalid2, name, setRegisteredFieldName, validate, validityData]);
    useIsoLayoutEffect(() => {
      const fields = formRef.current.fields;
      return () => {
        const id = registrationRef.current?.id;
        if (id) {
          fields.delete(id);
        }
      };
    }, [formRef]);
    const register2 = useStableCallback((source, registration) => {
      if (!registration) {
        if (activeFieldControlSourceRef.current === source) {
          activeFieldControlSourceRef.current = null;
          change(void 0, true);
          deleteRegistration();
          registrationRef.current = null;
          setRegisteredFieldName(void 0);
          registeredFieldIdRef.current = void 0;
        }
        return;
      }
      const previousId = registrationRef.current?.id;
      const previousSource = activeFieldControlSourceRef.current;
      if (previousSource && previousSource !== source) {
        change(void 0, true);
      }
      activeFieldControlSourceRef.current = source;
      registrationRef.current = registration;
      if (!name) {
        setRegisteredFieldName(registration.name);
      }
      registeredFieldIdRef.current = registration.id;
      if (previousId && previousId !== registration.id) {
        deleteRegistration(previousId);
      }
      captureInitialValue(registration);
      refreshRegistration();
    });
    return [validate, register2];
  }

  // node_modules/@base-ui/react/field/root/FieldRoot.mjs
  var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
  var FieldRootInner = /* @__PURE__ */ React97.forwardRef(function FieldRootInner2(componentProps, forwardedRef) {
    const {
      errors,
      validationMode: formValidationMode,
      submitCountRef
    } = useFormContext();
    const {
      render: render4,
      className,
      validate: validateProp,
      validationDebounceTime = 0,
      validationMode = formValidationMode,
      name,
      disabled: disabledProp = false,
      invalid: invalidProp,
      dirty: dirtyProp,
      touched: touchedProp,
      actionsRef,
      style,
      ...elementProps
    } = componentProps;
    const disabledFieldset = useFieldsetRootContext(true)?.disabled;
    const validate = useStableCallback(validateProp || (() => null));
    const disabled2 = disabledFieldset || disabledProp;
    const [touchedState, setTouchedUnwrapped] = React97.useState(false);
    const [dirtyState, setDirtyUnwrapped] = React97.useState(false);
    const [filled, setFilled] = React97.useState(false);
    const [focused, setFocused] = React97.useState(false);
    const dirty = dirtyProp ?? dirtyState;
    const touched = touchedProp ?? touchedState;
    const markedDirtyRef = React97.useRef(dirty);
    const registeredFieldIdRef = React97.useRef(void 0);
    const [registeredFieldName, setRegisteredFieldName] = React97.useState();
    const effectiveName = name ?? registeredFieldName;
    useIsoLayoutEffect(() => {
      if (dirtyProp !== void 0) {
        markedDirtyRef.current = dirtyProp;
      }
    }, [dirtyProp]);
    const setDirty = useStableCallback((value) => {
      if (dirtyProp !== void 0) {
        return;
      }
      if (value) {
        markedDirtyRef.current = true;
      }
      setDirtyUnwrapped(value);
    });
    const setTouched = useStableCallback((value) => {
      if (touchedProp !== void 0) {
        return;
      }
      setTouchedUnwrapped(value);
    });
    const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitCountRef.current > 0);
    const formError = effectiveName && Object.hasOwn(errors, effectiveName) ? errors[effectiveName] : null;
    const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
    const invalid2 = invalidProp === true || hasFormError;
    const [validityData, setValidityData] = React97.useState({
      state: DEFAULT_VALIDITY_STATE,
      error: "",
      errors: [],
      value: null,
      initialValue: null
    });
    const valid2 = !invalid2 && (disabled2 ? null : validityData.state.valid);
    const state = React97.useMemo(() => ({
      disabled: disabled2,
      touched,
      dirty,
      valid: valid2,
      filled,
      focused
    }), [disabled2, touched, dirty, valid2, filled, focused]);
    const validation = useFieldValidation({
      setValidityData,
      validate,
      validityData,
      validationDebounceTime,
      invalid: invalid2,
      markedDirtyRef,
      state,
      shouldValidateOnChange,
      validationMode,
      registeredFieldIdRef
    });
    const [validateFieldControl, registerFieldControl] = useFieldControlRegistration({
      change: validation.change,
      commit: validation.commit,
      invalid: invalid2,
      markedDirtyRef,
      name,
      setRegisteredFieldName,
      registeredFieldIdRef,
      setValidityData,
      validityData
    });
    React97.useImperativeHandle(actionsRef, () => ({
      validate: validateFieldControl
    }), [validateFieldControl]);
    const contextValue = React97.useMemo(() => ({
      invalid: invalid2,
      name: effectiveName,
      validityData,
      setValidityData,
      disabled: disabled2,
      setTouched,
      setDirty,
      setFilled,
      setFocused,
      validationMode,
      shouldValidateOnChange,
      state,
      registerFieldControl,
      validation
    }), [invalid2, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]);
    const element = useRenderElement("div", componentProps, {
      ref: forwardedRef,
      state,
      props: elementProps,
      stateAttributesMapping: fieldValidityMapping
    });
    return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FieldRootContext.Provider, {
      value: contextValue,
      children: element
    });
  });
  if (true) FieldRootInner.displayName = "FieldRootInner";
  var FieldRoot = /* @__PURE__ */ React97.forwardRef(function FieldRoot2(componentProps, forwardedRef) {
    return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(LabelableProvider, {
      children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FieldRootInner, {
        ...componentProps,
        ref: forwardedRef
      })
    });
  });
  if (true) FieldRoot.displayName = "FieldRoot";

  // node_modules/@base-ui/react/field/label/FieldLabel.mjs
  var React98 = __toESM(require_react(), 1);
  var FieldLabel = /* @__PURE__ */ React98.forwardRef(function FieldLabel2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      id: idProp,
      nativeLabel = true,
      ...elementProps
    } = componentProps;
    const fieldRootContext = useFieldRootContext(false);
    const fieldItemContext = useFieldItemContext();
    const {
      labelId
    } = useLabelableContext();
    const state = {
      ...fieldRootContext.state,
      disabled: fieldRootContext.disabled || fieldItemContext.disabled
    };
    const labelRef = React98.useRef(null);
    const labelProps = useLabel({
      id: labelId ?? idProp,
      native: nativeLabel
    });
    if (true) {
      React98.useEffect(() => {
        if (!labelRef.current) {
          return;
        }
        const isLabelTag = labelRef.current.tagName === "LABEL";
        if (nativeLabel) {
          if (!isLabelTag) {
            const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
            const message2 = "<Field.Label> expected a <label> element because the `nativeLabel` prop is true. Rendering a non-<label> disables native label association, so `htmlFor` will not work. Use a real <label> in the `render` prop, or set `nativeLabel` to `false`.";
            error(`${message2}${ownerStackMessage}`);
          }
        } else if (isLabelTag) {
          const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
          const message2 = "<Field.Label> expected a non-<label> element because the `nativeLabel` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the `render` prop, or set `nativeLabel` to `true`.";
          error(`${message2}${ownerStackMessage}`);
        }
      }, [nativeLabel]);
    }
    const element = useRenderElement("label", componentProps, {
      ref: [forwardedRef, labelRef],
      state,
      props: [labelProps, elementProps],
      stateAttributesMapping: fieldValidityMapping
    });
    return element;
  });
  if (true) FieldLabel.displayName = "FieldLabel";

  // node_modules/@base-ui/react/field/error/FieldError.mjs
  var React99 = __toESM(require_react(), 1);
  var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
  var stateAttributesMapping = {
    ...fieldValidityMapping,
    ...transitionStatusMapping
  };
  var FieldError = /* @__PURE__ */ React99.forwardRef(function FieldError2(componentProps, forwardedRef) {
    const {
      render: render4,
      id: idProp,
      className,
      match: match2,
      style,
      ...elementProps
    } = componentProps;
    const id = useBaseUiId(idProp);
    const {
      validityData,
      state: fieldState,
      name
    } = useFieldRootContext(false);
    const {
      setMessageIds
    } = useLabelableContext();
    const {
      errors
    } = useFormContext();
    const formError = name && Object.hasOwn(errors, name) ? errors[name] : null;
    const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
    const hasSpecificMatch = typeof match2 === "string";
    let rendered = false;
    if (match2 === true) {
      rendered = true;
    } else if (fieldState.disabled) {
      rendered = false;
    } else if (hasSpecificMatch) {
      rendered = Boolean(validityData.state[match2]);
    } else {
      rendered = hasFormError || validityData.state.valid === false;
    }
    const {
      mounted,
      transitionStatus,
      setMounted
    } = useTransitionStatus(rendered);
    useIsoLayoutEffect(() => {
      if (!rendered || !id) {
        return void 0;
      }
      setMessageIds((v2) => v2.concat(id));
      return () => {
        setMessageIds((v2) => v2.filter((item) => item !== id));
      };
    }, [rendered, id, setMessageIds]);
    const errorRef = React99.useRef(null);
    const [lastRenderedMessage, setLastRenderedMessage] = React99.useState(null);
    const [lastRenderedMessageKey, setLastRenderedMessageKey] = React99.useState(null);
    let error2 = validityData.error;
    if (!hasSpecificMatch && hasFormError) {
      error2 = formError;
    } else if (validityData.errors.length > 1) {
      error2 = validityData.errors;
    }
    let errorMessage = error2;
    if (Array.isArray(error2)) {
      errorMessage = error2.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", {
        children: error2.map((message2) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("li", {
          children: message2
        }, message2))
      }) : error2[0];
    }
    const errorKey = Array.isArray(error2) ? JSON.stringify(error2) : error2;
    if (rendered && errorKey !== lastRenderedMessageKey) {
      setLastRenderedMessageKey(errorKey);
      setLastRenderedMessage(errorMessage);
    }
    useOpenChangeComplete({
      open: rendered,
      ref: errorRef,
      onComplete() {
        if (!rendered) {
          setMounted(false);
        }
      }
    });
    const state = {
      ...fieldState,
      transitionStatus
    };
    const element = useRenderElement("div", componentProps, {
      ref: [forwardedRef, errorRef],
      state,
      props: [{
        id,
        children: rendered ? errorMessage : lastRenderedMessage
      }, elementProps],
      stateAttributesMapping,
      enabled: mounted
    });
    if (!mounted) {
      return null;
    }
    return element;
  });
  if (true) FieldError.displayName = "FieldError";

  // node_modules/@base-ui/react/field/description/FieldDescription.mjs
  var React100 = __toESM(require_react(), 1);
  var FieldDescription = /* @__PURE__ */ React100.forwardRef(function FieldDescription2(componentProps, forwardedRef) {
    const {
      render: render4,
      id: idProp,
      className,
      style,
      ...elementProps
    } = componentProps;
    const id = useBaseUiId(idProp);
    const fieldRootContext = useFieldRootContext(false);
    const fieldItemContext = useFieldItemContext();
    const {
      setMessageIds
    } = useLabelableContext();
    const state = {
      ...fieldRootContext.state,
      disabled: fieldRootContext.disabled || fieldItemContext.disabled
    };
    useIsoLayoutEffect(() => {
      if (!id) {
        return void 0;
      }
      setMessageIds((v2) => v2.concat(id));
      return () => {
        setMessageIds((v2) => v2.filter((item) => item !== id));
      };
    }, [id, setMessageIds]);
    const element = useRenderElement("p", componentProps, {
      ref: forwardedRef,
      state,
      props: [{
        id
      }, elementProps],
      stateAttributesMapping: fieldValidityMapping
    });
    return element;
  });
  if (true) FieldDescription.displayName = "FieldDescription";

  // node_modules/@base-ui/react/field/control/FieldControl.mjs
  var React101 = __toESM(require_react(), 1);
  var FieldControl = /* @__PURE__ */ React101.forwardRef(function FieldControl2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      id: idProp,
      name: nameProp,
      value: valueProp,
      disabled: disabledProp = false,
      onValueChange,
      defaultValue: defaultValue2,
      autoFocus = false,
      style,
      ...elementProps
    } = componentProps;
    const {
      state: fieldState,
      name: fieldName,
      disabled: fieldDisabled,
      setTouched,
      setDirty,
      validityData,
      setFocused,
      setFilled,
      validationMode,
      validation
    } = useFieldRootContext();
    const {
      clearErrors,
      elementRef: formElementRef,
      submitCountRef
    } = useFormContext();
    const disabled2 = fieldDisabled || disabledProp;
    const name = fieldName ?? nameProp;
    const state = {
      ...fieldState,
      disabled: disabled2
    };
    const {
      labelId
    } = useLabelableContext();
    const id = useLabelableId({
      id: idProp
    });
    const [valueUnwrapped] = useControlled({
      controlled: valueProp,
      default: defaultValue2,
      name: "FieldControl",
      state: "value"
    });
    const isControlled = valueProp !== void 0;
    const value = isControlled ? valueUnwrapped : void 0;
    const serializedValue = value == null ? void 0 : String(value);
    const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);
    useRegisterFieldControl(validation.inputRef, id, serializedValue, getValueFromInput, !disabled2, nameProp);
    useIsoLayoutEffect(() => {
      const currentValue = serializedValue ?? validation.inputRef.current?.value;
      if (currentValue !== void 0) {
        setFilled(currentValue !== "");
      }
    }, [serializedValue, validation.inputRef, setFilled]);
    useValueChanged(serializedValue, () => {
      if (serializedValue === void 0) {
        return;
      }
      clearErrors(name);
      setDirty(serializedValue !== (validityData.initialValue ?? ""));
      validation.change(serializedValue);
    });
    const inputRef = React101.useRef(null);
    const enterValidationTimeout = useTimeout();
    useIsoLayoutEffect(() => {
      if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) {
        setFocused(true);
      }
    }, [autoFocus, setFocused]);
    const element = useRenderElement("input", componentProps, {
      ref: [forwardedRef, inputRef],
      state,
      props: [{
        id,
        disabled: disabled2,
        name,
        ref: validation.inputRef,
        "aria-labelledby": labelId,
        autoFocus,
        ...isControlled ? {
          value
        } : {
          defaultValue: defaultValue2
        },
        onChange(event) {
          const inputValue = event.currentTarget.value;
          const details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
          onValueChange?.(inputValue, details);
          if (isControlled) {
            return;
          }
          setDirty(inputValue !== (validityData.initialValue ?? ""));
          setFilled(inputValue !== "");
          if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
            clearErrors(name);
            validation.change(inputValue);
          }
        },
        onFocus() {
          setFocused(true);
        },
        onBlur(event) {
          setTouched(true);
          setFocused(false);
          if (validationMode === "onBlur") {
            const inputValue = event.currentTarget.value;
            validation.commit(inputValue);
            if (isControlled) {
              queueMicrotask(() => {
                const nextValue = validation.inputRef.current?.value;
                if (nextValue !== void 0 && nextValue !== inputValue && nextValue !== (validityData.initialValue ?? "")) {
                  validation.commit(nextValue);
                }
              });
            }
          }
        },
        onKeyDown(event) {
          if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") {
            setTouched(true);
            const value2 = event.currentTarget.value;
            const form = event.currentTarget.form;
            if (form && form === formElementRef.current && !event.defaultPrevented) {
              const input = event.currentTarget;
              const submitCount = submitCountRef.current;
              enterValidationTimeout.start(0, () => {
                if (submitCountRef.current === submitCount) {
                  validation.commit(input.value);
                }
              });
            } else {
              validation.commit(value2);
            }
          }
        }
      }, elementProps, (props) => validation.getValidationProps(disabled2, props)],
      stateAttributesMapping: fieldValidityMapping
    });
    return element;
  });
  if (true) FieldControl.displayName = "FieldControl";

  // node_modules/@base-ui/react/field/validity/FieldValidity.mjs
  var React102 = __toESM(require_react(), 1);
  var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
  var FieldValidity = function FieldValidity2(props) {
    const {
      children
    } = props;
    const {
      validityData,
      invalid: invalid2
    } = useFieldRootContext(false);
    const combinedFieldValidityData = React102.useMemo(() => getCombinedFieldValidityData(validityData, invalid2), [validityData, invalid2]);
    const isInvalid = combinedFieldValidityData.state.valid === false;
    const {
      transitionStatus
    } = useTransitionStatus(isInvalid);
    const fieldValidityState = React102.useMemo(() => {
      return {
        ...combinedFieldValidityData,
        validity: combinedFieldValidityData.state,
        transitionStatus
      };
    }, [combinedFieldValidityData, transitionStatus]);
    return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(React102.Fragment, {
      children: children(fieldValidityState)
    });
  };
  if (true) FieldValidity.displayName = "FieldValidity";

  // node_modules/@base-ui/react/field/item/FieldItem.mjs
  var React103 = __toESM(require_react(), 1);
  var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
  var FieldItem = /* @__PURE__ */ React103.forwardRef(function FieldItem2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      disabled: disabledProp = false,
      ...elementProps
    } = componentProps;
    const {
      state: fieldState,
      disabled: rootDisabled
    } = useFieldRootContext(false);
    const disabled2 = rootDisabled || disabledProp;
    const state = {
      ...fieldState,
      disabled: disabled2
    };
    const fieldItemContext = React103.useMemo(() => ({
      disabled: disabled2
    }), [disabled2]);
    const element = useRenderElement("div", componentProps, {
      ref: forwardedRef,
      state,
      props: elementProps,
      stateAttributesMapping: fieldValidityMapping
    });
    return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(LabelableProvider, {
      children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FieldItemContext.Provider, {
        value: fieldItemContext,
        children: element
      })
    });
  });
  if (true) FieldItem.displayName = "FieldItem";

  // node_modules/@base-ui/react/input/Input.mjs
  var React104 = __toESM(require_react(), 1);
  var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
  var Input = /* @__PURE__ */ React104.forwardRef(function Input2(props, forwardedRef) {
    return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(index_parts_exports2.Control, {
      ref: forwardedRef,
      ...props
    });
  });
  if (true) Input.displayName = "Input";

  // node_modules/@base-ui/react/utils/FloatingPortalLite.mjs
  var React105 = __toESM(require_react(), 1);
  var ReactDOM8 = __toESM(require_react_dom(), 1);
  var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
  var FloatingPortalLite = /* @__PURE__ */ React105.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) {
    const {
      children,
      container,
      className,
      render: render4,
      style,
      ...elementProps
    } = componentProps;
    const {
      node: portalNode,
      subtree: portalSubtree
    } = useFloatingPortalNode({
      container,
      ref: forwardedRef,
      componentProps,
      elementProps
    });
    if (!portalSubtree && !portalNode) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(React105.Fragment, {
      children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM8.createPortal(children, portalNode)]
    });
  });
  if (true) FloatingPortalLite.displayName = "FloatingPortalLite";

  // node_modules/@base-ui/react/tooltip/index.parts.mjs
  var index_parts_exports3 = {};
  __export(index_parts_exports3, {
    Arrow: () => TooltipArrow,
    Handle: () => TooltipHandle,
    Popup: () => TooltipPopup,
    Portal: () => TooltipPortal,
    Positioner: () => TooltipPositioner,
    Provider: () => TooltipProvider,
    Root: () => TooltipRoot,
    Trigger: () => TooltipTrigger,
    Viewport: () => TooltipViewport,
    createHandle: () => createTooltipHandle
  });

  // node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs
  var React108 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs
  var React106 = __toESM(require_react(), 1);
  var TooltipRootContext = /* @__PURE__ */ React106.createContext(void 0);
  if (true) TooltipRootContext.displayName = "TooltipRootContext";
  function useTooltipRootContext(optional) {
    const context = React106.useContext(TooltipRootContext);
    if (context === void 0 && !optional) {
      throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72));
    }
    return context;
  }

  // node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs
  var React107 = __toESM(require_react(), 1);
  var selectors3 = {
    ...popupStoreSelectors,
    disabled: (state) => state.disabled,
    instantType: (state) => state.instantType,
    isInstantPhase: (state) => state.isInstantPhase,
    trackCursorAxis: (state) => state.trackCursorAxis,
    disableHoverablePopup: (state) => state.disableHoverablePopup,
    lastOpenChangeReason: (state) => state.openChangeReason,
    closeOnClick: (state) => state.closeOnClick,
    closeDelay: (state) => state.closeDelay,
    adaptiveOrigin: (state) => state.adaptiveOrigin
  };
  var TooltipStore = class extends ReactStore {
    constructor(initialState, floatingId, nested) {
      const triggerElements = new PopupTriggerMap();
      super(createInitialState2(initialState, triggerElements, floatingId, nested), createInitialContext2(triggerElements), selectors3);
    }
    setOpen = (nextOpen, eventDetails) => {
      applyPopupOpenChange(this, nextOpen, eventDetails, {
        extraState: {
          openChangeReason: eventDetails.reason
        }
      });
    };
    // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change.
    cancelPendingOpen(event) {
      this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event));
    }
  };
  function createNullTooltipStore() {
    const triggerElements = new PopupTriggerMap();
    const store = new NullStore(Object.freeze(createInitialState2(void 0, triggerElements)), Object.freeze(createInitialContext2(triggerElements)), selectors3);
    return Object.assign(store, {
      setOpen: NOOP,
      cancelPendingOpen: NOOP
    });
  }
  function createInitialState2(initialState, triggerElements, floatingId, nested = false) {
    const state = {
      ...createInitialPopupStoreState(triggerElements, floatingId, nested),
      disabled: false,
      instantType: void 0,
      isInstantPhase: false,
      trackCursorAxis: "none",
      disableHoverablePopup: false,
      openChangeReason: null,
      closeOnClick: true,
      closeDelay: 0,
      adaptiveOrigin: void 0,
      ...initialState
    };
    return state;
  }
  function createInitialContext2(triggerElements) {
    return {
      popupRef: /* @__PURE__ */ React107.createRef(),
      onOpenChange: void 0,
      onOpenChangeComplete: void 0,
      triggerElements
    };
  }

  // node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs
  var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
  var TooltipRoot = fastComponent(function TooltipRoot2(props) {
    const {
      disabled: disabled2 = false,
      defaultOpen = false,
      open: openProp,
      disableHoverablePopup = false,
      trackCursorAxis = "none",
      actionsRef,
      onOpenChange,
      onOpenChangeComplete,
      handle,
      triggerId: triggerIdProp,
      defaultTriggerId: defaultTriggerIdProp = null,
      children
    } = props;
    const store = usePopupRootStore((floatingId, nested) => new TooltipStore({
      open: defaultOpen,
      openProp,
      activeTriggerId: defaultTriggerIdProp,
      triggerIdProp
    }, floatingId, nested));
    store.useControlledProp("openProp", openProp);
    store.useControlledProp("triggerIdProp", triggerIdProp);
    store.useContextCallback("onOpenChange", onOpenChange);
    store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
    const openState = store.useState("open");
    const open2 = !disabled2 && openState;
    const activeTriggerId = store.useState("activeTriggerId");
    const mounted = store.useState("mounted");
    const payload = store.useState("payload");
    store.useSyncedValues({
      trackCursorAxis,
      disableHoverablePopup,
      disabled: disabled2
    });
    useImplicitActiveTrigger(store, {
      closeOnActiveTriggerUnmount: true
    });
    const {
      forceUnmount,
      transitionStatus
    } = useOpenStateTransitions(open2, store);
    const isInstantPhase = store.useState("isInstantPhase");
    const instantType = store.useState("instantType");
    const lastOpenChangeReason = store.useState("lastOpenChangeReason");
    const previousInstantTypeRef = React108.useRef(null);
    useIsoLayoutEffect(() => {
      if (openState && disabled2) {
        store.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled));
      }
    }, [openState, disabled2, store]);
    useIsoLayoutEffect(() => {
      if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) {
        if (instantType !== "delay") {
          previousInstantTypeRef.current = instantType;
        }
        store.set("instantType", "delay");
      } else if (previousInstantTypeRef.current !== null) {
        store.set("instantType", previousInstantTypeRef.current);
        previousInstantTypeRef.current = null;
      }
    }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]);
    useIsoLayoutEffect(() => {
      if (open2) {
        if (activeTriggerId == null) {
          store.set("payload", void 0);
        }
      }
    }, [store, activeTriggerId, open2]);
    React108.useImperativeHandle(actionsRef, () => ({
      unmount: forceUnmount,
      close: () => store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction))
    }), [forceUnmount, store]);
    const shouldRenderInteractions = open2 || mounted || !disabled2 && trackCursorAxis !== "none";
    return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(TooltipRootContext.Provider, {
      value: store,
      children: [handle && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(PopupHandleAttachment, {
        handle,
        store
      }), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TooltipInteractions, {
        store,
        disabled: disabled2,
        trackCursorAxis
      }), typeof children === "function" ? children({
        payload
      }) : children]
    });
  });
  if (true) TooltipRoot.displayName = "TooltipRoot";
  function TooltipInteractions({
    store,
    disabled: disabled2,
    trackCursorAxis
  }) {
    const floatingRootContext = store.useState("floatingRootContext");
    const dismiss = useDismiss(floatingRootContext, {
      enabled: !disabled2,
      referencePress: () => store.select("closeOnClick")
    });
    const clientPoint = useClientPoint(floatingRootContext, {
      enabled: !disabled2 && trackCursorAxis !== "none",
      axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis
    });
    const triggerProps = React108.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]);
    usePopupInteractionProps(store, {
      activeTriggerProps: triggerProps,
      inactiveTriggerProps: triggerProps,
      popupProps: dismiss.floating ?? EMPTY_OBJECT
    });
    return null;
  }

  // node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs
  var React110 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs
  var React109 = __toESM(require_react(), 1);
  var TooltipProviderContext = /* @__PURE__ */ React109.createContext(void 0);
  if (true) TooltipProviderContext.displayName = "TooltipProviderContext";
  function useTooltipProviderContext() {
    return React109.useContext(TooltipProviderContext);
  }

  // node_modules/@base-ui/react/tooltip/utils/constants.mjs
  var OPEN_DELAY = 600;

  // node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs
  var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger";
  function getTargetElement(event) {
    if ("composedPath" in event) {
      const path = event.composedPath();
      for (let i = 0; i < path.length; i += 1) {
        const element = path[i];
        if (isElement(element)) {
          return element;
        }
      }
    }
    const target = event.target;
    if (isElement(target)) {
      return target;
    }
    return null;
  }
  function closestEnabledTooltipTrigger(element) {
    let current = element;
    while (current) {
      const trigger = current.closest(`[${TOOLTIP_TRIGGER_IDENTIFIER}]`);
      if (trigger) {
        return trigger;
      }
      const root = current.getRootNode();
      current = "host" in root && isElement(root.host) ? root.host : null;
    }
    return null;
  }
  var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      handle,
      payload,
      disabled: disabledProp,
      delay,
      closeOnClick = true,
      closeDelay,
      id: idProp,
      ...elementProps
    } = componentProps;
    const rootContext = useTooltipRootContext(true);
    const handleStore = usePopupHandleStore(handle);
    const store = handleStore ?? rootContext;
    if (!store) {
      throw new Error(true ? "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle." : formatErrorMessage_default(82));
    }
    const thisTriggerId = useBaseUiId(idProp);
    const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
    const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
    const floatingRootContext = store.useState("floatingRootContext");
    const triggerElementRef = React110.useRef(null);
    const closeDelayWithDefault = closeDelay ?? 0;
    const {
      registerTrigger,
      isMountedByThisTrigger
    } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
      payload,
      closeOnClick,
      closeDelay: closeDelayWithDefault
    });
    const providerDelay = useTooltipProviderContext();
    const {
      activeIdRef,
      delayRef,
      isInstantPhase,
      hasProvider
    } = useDelayGroup(floatingRootContext, {
      open: isOpenedByThisTrigger
    });
    const hoverInteraction = useHoverInteractionSharedState(floatingRootContext);
    store.useSyncedValue("isInstantPhase", isInstantPhase);
    const rootDisabled = store.useState("disabled");
    const disabled2 = disabledProp ?? rootDisabled;
    const disabledRef = useValueAsRef(disabled2);
    const trackCursorAxis = store.useState("trackCursorAxis");
    const disableHoverablePopup = store.useState("disableHoverablePopup");
    const isNestedTriggerHoveredRef = React110.useRef(false);
    const nestedTriggerOpenTimeout = useTimeout();
    const pointerTypeRef = React110.useRef(void 0);
    function getOpenDelay() {
      if (hasProvider && activeIdRef.current != null) {
        return 0;
      }
      return delay ?? providerDelay ?? OPEN_DELAY;
    }
    function isEnabledNestedTriggerTarget(target) {
      const triggerEl = triggerElementRef.current;
      if (!triggerEl || !target) {
        return false;
      }
      const nearestTrigger = closestEnabledTooltipTrigger(target);
      return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger);
    }
    function detectNestedTriggerHover(target) {
      const nestedTriggerHovered = isEnabledNestedTriggerTarget(target);
      isNestedTriggerHoveredRef.current = nestedTriggerHovered;
      if (nestedTriggerHovered) {
        hoverInteraction.openChangeTimeout.clear();
        hoverInteraction.restTimeout.clear();
        hoverInteraction.restTimeoutPending = false;
        nestedTriggerOpenTimeout.clear();
      }
      return nestedTriggerHovered;
    }
    const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
      enabled: !disabled2,
      mouseOnly: true,
      move: false,
      handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null,
      restMs: getOpenDelay,
      delay() {
        if (closeDelay == null && hasProvider) {
          return {
            close: getDelay(delayRef.current, "close")
          };
        }
        return {
          close: closeDelayWithDefault
        };
      },
      triggerElementRef,
      isActiveTrigger: isTriggerActive,
      isClosing: () => store.select("transitionStatus") === "ending",
      shouldOpen() {
        return !isNestedTriggerHoveredRef.current;
      }
    });
    const focusProps = useFocus(floatingRootContext, {
      enabled: !disabled2
    }).reference;
    const handleNestedTriggerHover = (event) => {
      const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current;
      const target = getTargetElement(event);
      const nestedTriggerHovered = detectNestedTriggerHover(target);
      const triggerEl = triggerElementRef.current;
      const targetInsideTrigger = triggerEl && target && contains(triggerEl, target);
      if (nestedTriggerHovered && store.select("open") && store.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) {
        store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
        return;
      }
      if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences.
      isMouseLikePointerType(pointerTypeRef.current)) {
        const open2 = () => {
          if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store.select("open")) {
            store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl));
          }
        };
        const openDelay = getOpenDelay();
        if (openDelay === 0) {
          nestedTriggerOpenTimeout.clear();
          open2();
        } else {
          nestedTriggerOpenTimeout.start(openDelay, open2);
        }
      }
    };
    const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
    const shouldApplyRootTriggerProps = isMountedByThisTrigger || trackCursorAxis !== "none";
    const state = {
      open: isOpenedByThisTrigger
    };
    const element = useRenderElement("button", componentProps, {
      state,
      ref: [forwardedRef, registerTrigger, triggerElementRef],
      props: [hoverProps, focusProps, shouldApplyRootTriggerProps ? rootTriggerProps : void 0, {
        onMouseOver(event) {
          handleNestedTriggerHover(event.nativeEvent);
        },
        onFocus(event) {
          if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) {
            event.preventBaseUIHandler();
          }
        },
        onMouseLeave() {
          isNestedTriggerHoveredRef.current = false;
          nestedTriggerOpenTimeout.clear();
          pointerTypeRef.current = void 0;
        },
        onPointerEnter(event) {
          pointerTypeRef.current = event.pointerType;
        },
        onPointerDown(event) {
          pointerTypeRef.current = event.pointerType;
          store.set("closeOnClick", closeOnClick);
          if (closeOnClick && !store.select("open")) {
            store.cancelPendingOpen(event.nativeEvent);
          }
        },
        onClick(event) {
          if (closeOnClick && !store.select("open")) {
            store.cancelPendingOpen(event.nativeEvent);
          }
        },
        id: thisTriggerId,
        [triggerDisabled]: disabled2 ? "" : void 0,
        [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : ""
      }, elementProps],
      stateAttributesMapping: triggerOpenStateMapping
    });
    return element;
  });
  if (true) TooltipTrigger.displayName = "TooltipTrigger";

  // node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs
  var React112 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs
  var React111 = __toESM(require_react(), 1);
  var TooltipPortalContext = /* @__PURE__ */ React111.createContext(void 0);
  if (true) TooltipPortalContext.displayName = "TooltipPortalContext";
  function useTooltipPortalContext() {
    const value = React111.useContext(TooltipPortalContext);
    if (value === void 0) {
      throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70));
    }
    return value;
  }

  // node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs
  var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
  var TooltipPortal = /* @__PURE__ */ React112.forwardRef(function TooltipPortal2(props, forwardedRef) {
    const {
      keepMounted = false,
      ...portalProps
    } = props;
    const store = useTooltipRootContext();
    const mounted = store.useState("mounted");
    const shouldRender = mounted || keepMounted;
    if (!shouldRender) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(TooltipPortalContext.Provider, {
      value: keepMounted,
      children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(FloatingPortalLite, {
        ref: forwardedRef,
        ...portalProps
      })
    });
  });
  if (true) TooltipPortal.displayName = "TooltipPortal";

  // node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs
  var React114 = __toESM(require_react(), 1);

  // node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs
  var React113 = __toESM(require_react(), 1);
  var TooltipPositionerContext = /* @__PURE__ */ React113.createContext(void 0);
  if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext";
  function useTooltipPositionerContext() {
    const context = React113.useContext(TooltipPositionerContext);
    if (context === void 0) {
      throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71));
    }
    return context;
  }

  // node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs
  var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
  var TooltipPositioner = /* @__PURE__ */ React114.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      anchor,
      positionMethod = "absolute",
      side = "top",
      align = "center",
      sideOffset = 0,
      alignOffset = 0,
      collisionBoundary = "clipping-ancestors",
      collisionPadding = 5,
      arrowPadding = 5,
      sticky = false,
      disableAnchorTracking = false,
      collisionAvoidance = POPUP_COLLISION_AVOIDANCE,
      style,
      ...elementProps
    } = componentProps;
    const store = useTooltipRootContext();
    const keepMounted = useTooltipPortalContext();
    const open2 = store.useState("open");
    const mounted = store.useState("mounted");
    const trackCursorAxis = store.useState("trackCursorAxis");
    const disableHoverablePopup = store.useState("disableHoverablePopup");
    const floatingRootContext = store.useState("floatingRootContext");
    const instantType = store.useState("instantType");
    const transitionStatus = store.useState("transitionStatus");
    const adaptiveOrigin2 = store.useState("adaptiveOrigin");
    const positioning = useAnchorPositioning({
      anchor,
      positionMethod,
      floatingRootContext,
      mounted,
      side,
      sideOffset,
      align,
      alignOffset,
      collisionBoundary,
      collisionPadding,
      sticky,
      arrowPadding,
      disableAnchorTracking,
      keepMounted,
      collisionAvoidance,
      adaptiveOrigin: adaptiveOrigin2
    });
    const state = React114.useMemo(() => ({
      open: open2,
      side: positioning.side,
      align: positioning.align,
      anchorHidden: positioning.anchorHidden,
      instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType
    }), [open2, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]);
    const element = usePositioner(componentProps, state, {
      styles: positioning.positionerStyles,
      transitionStatus,
      props: elementProps,
      refs: [forwardedRef, store.useStateSetter("positionerElement")],
      hidden: !mounted,
      inert: !open2 || trackCursorAxis === "both" || disableHoverablePopup
    });
    return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TooltipPositionerContext.Provider, {
      value: positioning,
      children: element
    });
  });
  if (true) TooltipPositioner.displayName = "TooltipPositioner";

  // node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs
  var React115 = __toESM(require_react(), 1);
  var TooltipPopup = /* @__PURE__ */ React115.forwardRef(function TooltipPopup2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      ...elementProps
    } = componentProps;
    const store = useTooltipRootContext();
    const {
      side,
      align
    } = useTooltipPositionerContext();
    const open2 = store.useState("open");
    const instantType = store.useState("instantType");
    const transitionStatus = store.useState("transitionStatus");
    const popupProps = store.useState("popupProps");
    const floatingContext = store.useState("floatingRootContext");
    const disabled2 = store.useState("disabled");
    const closeDelay = store.useState("closeDelay");
    useOpenChangeComplete({
      open: open2,
      ref: store.context.popupRef,
      onComplete() {
        if (open2) {
          store.context.onOpenChangeComplete?.(true);
        }
      }
    });
    useHoverFloatingInteraction(floatingContext, {
      enabled: !disabled2,
      closeDelay
    });
    const setPopupElement = store.useStateSetter("popupElement");
    const state = {
      open: open2,
      side,
      align,
      instant: instantType,
      transitionStatus
    };
    const element = useRenderElement("div", componentProps, {
      state,
      ref: [forwardedRef, store.context.popupRef, setPopupElement],
      props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps],
      stateAttributesMapping: popupTransitionStateMapping
    });
    return element;
  });
  if (true) TooltipPopup.displayName = "TooltipPopup";

  // node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs
  var React116 = __toESM(require_react(), 1);
  var TooltipArrow = /* @__PURE__ */ React116.forwardRef(function TooltipArrow2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      ...elementProps
    } = componentProps;
    const store = useTooltipRootContext();
    const {
      arrowRef,
      side,
      align,
      arrowUncentered,
      arrowStyles
    } = useTooltipPositionerContext();
    const open2 = store.useState("open");
    const instantType = store.useState("instantType");
    const state = {
      open: open2,
      side,
      align,
      uncentered: arrowUncentered,
      instant: instantType
    };
    const element = useRenderElement("div", componentProps, {
      state,
      ref: [forwardedRef, arrowRef],
      props: [{
        style: arrowStyles,
        "aria-hidden": true
      }, elementProps],
      stateAttributesMapping: popupStateMapping
    });
    return element;
  });
  if (true) TooltipArrow.displayName = "TooltipArrow";

  // node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs
  var React117 = __toESM(require_react(), 1);
  var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
  var TooltipProvider = function TooltipProvider2(props) {
    const {
      delay,
      closeDelay,
      timeout = 400
    } = props;
    const delayValue = React117.useMemo(() => ({
      open: delay,
      close: closeDelay
    }), [delay, closeDelay]);
    return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TooltipProviderContext.Provider, {
      value: delay,
      children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(FloatingDelayGroup, {
        delay: delayValue,
        timeoutMs: timeout,
        children: props.children
      })
    });
  };
  if (true) TooltipProvider.displayName = "TooltipProvider";

  // node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs
  var React118 = __toESM(require_react(), 1);
  var TooltipViewport = /* @__PURE__ */ React118.forwardRef(function TooltipViewport2(componentProps, forwardedRef) {
    const {
      render: render4,
      className,
      style,
      children,
      ...elementProps
    } = componentProps;
    const store = useTooltipRootContext();
    const positioner = useTooltipPositionerContext();
    const instantType = store.useState("instantType");
    const {
      children: childrenToRender,
      state: viewportState
    } = usePopupViewport({
      store,
      side: positioner.side,
      children
    });
    const state = {
      activationDirection: viewportState.activationDirection,
      transitioning: viewportState.transitioning,
      instant: instantType
    };
    return useRenderElement("div", componentProps, {
      state,
      ref: forwardedRef,
      props: [elementProps, {
        children: childrenToRender
      }],
      stateAttributesMapping: popupViewportStateMapping
    });
  });
  if (true) TooltipViewport.displayName = "TooltipViewport";

  // node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs
  var TooltipHandle = class extends BasePopupHandle {
    constructor() {
      super(createNullTooltipStore(), "Tooltip");
    }
    /**
     * Opens the tooltip and associates it with the trigger with the given id.
     *
     * This method should only be called in an event handler or an effect (not during rendering).
     *
     * @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching
     * `Tooltip.Trigger` with this handle passed as a prop.
     */
    open(triggerId) {
      this.openByTrigger(triggerId);
    }
    /**
     * Closes the tooltip.
     *
     * This method should only be called in an event handler or an effect (not during rendering).
     */
    close() {
      this.closePopup();
    }
    /**
     * Whether the tooltip is currently open. Returns `false` while no root is attached to the handle.
     */
    get isOpen() {
      return this.attachedStore?.select("open") ?? false;
    }
  };
  function createTooltipHandle() {
    return new TooltipHandle();
  }

  // node_modules/@base-ui/react/use-render/useRender.mjs
  function useRender(params) {
    return useRenderElement(params.defaultTagName ?? "div", params, params);
  }

  // packages/ui/build-module/text/text.mjs
  var import_element15 = __toESM(require_element(), 1);
  var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
  function getRuntime() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument(targetDocument) {
    const runtime = getRuntime();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle(hash, css) {
    const runtime = getRuntime();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
  }
  var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" };
  if (typeof process === "undefined" || true) {
    registerStyle("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  var Text = (0, import_element15.forwardRef)(function Text2({ variant = "body-md", render: render4, className, ...props }, ref) {
    const element = useRender({
      render: render4,
      defaultTagName: "span",
      ref,
      props: mergeProps(props, {
        className: clsx_default(
          style_default.text,
          global_css_defense_default.heading,
          global_css_defense_default.p,
          style_default[variant],
          className
        )
      })
    });
    return element;
  });

  // packages/ui/build-module/badge/badge.mjs
  var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
  function getRuntime2() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument2(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash2(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE2}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle2(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime2();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash2(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument2(targetDocument) {
    const runtime = getRuntime2();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle2(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle2(hash, css) {
    const runtime = getRuntime2();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle2(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle2("40ea4a6382", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-background-surface-error,#fae5e1);color:var(--wpds-color-foreground-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-background-surface-warning,#fde6be);color:var(--wpds-color-foreground-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-background-surface-caution,#fee995);color:var(--wpds-color-foreground-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-background-surface-success,#c2f8ca);color:var(--wpds-color-foreground-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-background-surface-info,#deebfa);color:var(--wpds-color-foreground-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);padding-block:calc(var(--wpds-dimension-padding-xs, 4px) - var(--wpds-border-width-xs, 1px));padding-inline:calc(var(--wpds-dimension-padding-sm, 8px) - var(--wpds-border-width-xs, 1px))}}}");
  }
  var style_default2 = { "badge": "_96e6251aad1a6136__badge", "is-high-intent": "_99f7158cb520f750__is-high-intent", "is-medium-intent": "c20ebef2365bc8b7__is-medium-intent", "is-low-intent": "_365e1626c6202e52__is-low-intent", "is-stable-intent": "_33f8198127ddf4ef__is-stable-intent", "is-informational-intent": "_04c1aca8fc449412__is-informational-intent", "is-draft-intent": "_90726e69d495ec19__is-draft-intent", "is-none-intent": "_898f4a544993bd39__is-none-intent" };
  var Badge = (0, import_element16.forwardRef)(function Badge2({ intent = "none", className, ...props }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
      Text,
      {
        ref,
        className: clsx_default(
          style_default2.badge,
          style_default2[`is-${intent}-intent`],
          className
        ),
        ...props,
        variant: "body-sm"
      }
    );
  });

  // packages/ui/build-module/tooltip/index.mjs
  var tooltip_exports = {};
  __export(tooltip_exports, {
    Popup: () => Popup,
    Portal: () => Portal,
    Positioner: () => Positioner,
    Provider: () => Provider,
    Root: () => Root,
    Trigger: () => Trigger
  });

  // packages/ui/build-module/tooltip/popup.mjs
  var import_element20 = __toESM(require_element(), 1);

  // packages/ui/build-module/tooltip/portal.mjs
  var import_element17 = __toESM(require_element(), 1);

  // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs
  var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
  function getRuntime3() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument3(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash3(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE3}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle3(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime3();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash3(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument3(targetDocument) {
    const runtime = getRuntime3();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle3(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle3(hash, css) {
    const runtime = getRuntime3();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle3(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle3("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}");
  }
  var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" };
  var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot";
  function resolveOwnerDocument() {
    return typeof document === "undefined" ? null : document;
  }
  function isInWordPressEnvironment() {
    let topWp;
    try {
      topWp = window.top?.wp;
    } catch {
    }
    const wp = topWp ?? window.wp;
    return typeof wp?.components === "object" && wp.components !== null;
  }
  var cachedSlot = null;
  function ensureSlotIsAccessible(element) {
    element.setAttribute("aria-hidden", "false");
    return element;
  }
  function createSlot(ownerDocument2) {
    const element = ownerDocument2.createElement("div");
    element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, "");
    if (wp_compat_overlay_slot_default.slot) {
      element.classList.add(wp_compat_overlay_slot_default.slot);
    }
    ownerDocument2.body.appendChild(element);
    return element;
  }
  function getWpCompatOverlaySlot() {
    if (typeof window === "undefined") {
      return void 0;
    }
    if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) {
      return void 0;
    }
    const ownerDocument2 = resolveOwnerDocument();
    if (!ownerDocument2 || !ownerDocument2.body) {
      return void 0;
    }
    if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) {
      return ensureSlotIsAccessible(cachedSlot);
    }
    const existing = ownerDocument2.querySelector(
      `[${WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]`
    );
    if (existing instanceof HTMLDivElement) {
      cachedSlot = ensureSlotIsAccessible(existing);
      return cachedSlot;
    }
    if (cachedSlot?.isConnected) {
      cachedSlot.remove();
    }
    cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2));
    return cachedSlot;
  }

  // packages/ui/build-module/tooltip/portal.mjs
  var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
  var Portal = (0, import_element17.forwardRef)(
    function TooltipPortal3({ container, ...restProps }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
        index_parts_exports3.Portal,
        {
          container: container ?? getWpCompatOverlaySlot(),
          ...restProps,
          ref
        }
      );
    }
  );

  // packages/ui/build-module/tooltip/positioner.mjs
  var import_element18 = __toESM(require_element(), 1);
  var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
  function getRuntime4() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument4(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash4(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE4}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle4(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime4();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash4(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument4(targetDocument) {
    const runtime = getRuntime4();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle4(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle4(hash, css) {
    const runtime = getRuntime4();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle4(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle4("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle4("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
  }
  var style_default3 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
  var Positioner = (0, import_element18.forwardRef)(
    function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
        index_parts_exports3.Positioner,
        {
          ref,
          align,
          side,
          sideOffset,
          ...props,
          className: clsx_default(
            resets_default["box-sizing"],
            style_default3.positioner,
            className
          )
        }
      );
    }
  );

  // packages/ui/build-module/utils/render-slot-with-children.mjs
  var import_element19 = __toESM(require_element(), 1);
  function renderSlotWithChildren(slot, defaultSlot, children) {
    return (0, import_element19.cloneElement)(slot ?? defaultSlot, { children });
  }

  // packages/ui/build-module/utils/theme-provider.mjs
  var theme = __toESM(require_theme(), 1);

  // packages/ui/build-module/lock-unlock.mjs
  var import_private_apis = __toESM(require_private_apis(), 1);
  var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
    "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
    "@wordpress/ui"
  );

  // packages/ui/build-module/utils/theme-provider.mjs
  function getThemeProvider() {
    const themePackage = theme;
    if (themePackage.ThemeProvider) {
      return themePackage.ThemeProvider;
    }
    if (!themePackage.privateApis) {
      throw new Error(
        "@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`."
      );
    }
    return unlock(
      themePackage.privateApis
    ).ThemeProvider;
  }
  var ThemeProvider = getThemeProvider();

  // packages/ui/build-module/tooltip/popup.mjs
  var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
  function getRuntime5() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument5(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash5(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE5}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle5(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime5();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash5(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument5(targetDocument) {
    const runtime = getRuntime5();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle5(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle5(hash, css) {
    const runtime = getRuntime5();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle5(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle5("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
  }
  var style_default4 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
  var POPUP_COLOR = { background: "#1e1e1e" };
  var Popup = (0, import_element20.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) {
    const popupContent = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
      index_parts_exports3.Popup,
      {
        ref,
        className: clsx_default(style_default4.popup, className),
        ...props,
        children
      }
    ) });
    const positionedPopup = renderSlotWithChildren(
      positioner,
      /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Positioner, {}),
      popupContent
    );
    return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Portal, {}), positionedPopup);
  });

  // packages/ui/build-module/tooltip/trigger.mjs
  var import_element21 = __toESM(require_element(), 1);
  var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
  var Trigger = (0, import_element21.forwardRef)(
    function TooltipTrigger3(props, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(index_parts_exports3.Trigger, { ref, ...props });
    }
  );

  // packages/ui/build-module/utils/direction-provider.mjs
  var import_i18n7 = __toESM(require_i18n(), 1);
  var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
  function DirectionProvider3({ children }) {
    return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DirectionProvider, { direction: (0, import_i18n7.isRTL)() ? "rtl" : "ltr", children });
  }

  // packages/ui/build-module/tooltip/root.mjs
  var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
  function Root(props) {
    return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(index_parts_exports3.Root, { ...props }) });
  }

  // packages/ui/build-module/tooltip/provider.mjs
  var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
  function Provider({ ...props }) {
    return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(index_parts_exports3.Provider, { ...props });
  }

  // packages/ui/build-module/link/link.mjs
  var import_element22 = __toESM(require_element(), 1);
  var import_i18n8 = __toESM(require_i18n(), 1);
  var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
  function getRuntime6() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument6(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash6(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE6}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle6(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime6();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash6(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument6(targetDocument) {
    const runtime = getRuntime6();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle6(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle6(hash, css) {
    const runtime = getRuntime6();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle6(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle6("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle6("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
  }
  var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
  if (typeof process === "undefined" || true) {
    registerStyle6("e8e6a9be37", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}');
  }
  var style_default5 = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" };
  if (typeof process === "undefined" || true) {
    registerStyle6("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  var Link = (0, import_element22.forwardRef)(function Link2({
    children,
    variant = "default",
    tone = "brand",
    openInNewTab = false,
    target,
    render: render4,
    className,
    ...props
  }, ref) {
    const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? "");
    const element = useRender({
      render: render4,
      defaultTagName: "a",
      ref,
      props: mergeProps(props, {
        className: clsx_default(
          global_css_defense_default2.a,
          resets_default2["box-sizing"],
          focus_module_default["outset-ring--focus-except-active"],
          variant !== "unstyled" && style_default5.link,
          variant !== "unstyled" && style_default5[`is-${tone}`],
          variant === "unstyled" && style_default5["is-unstyled"],
          className
        ),
        target: target ?? (openInNewTab ? "_blank" : void 0),
        children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
          children,
          shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
            "span",
            {
              className: style_default5["link-icon"],
              role: "img",
              "aria-label": (
                /* translators: accessibility text appended to link text */
                (0, import_i18n8.__)("(opens in a new tab)")
              )
            }
          )
        ] })
      })
    });
    return element;
  });

  // packages/ui/build-module/menu/index.mjs
  var menu_exports = {};
  __export(menu_exports, {
    CheckboxItem: () => CheckboxItem,
    Group: () => Group,
    GroupLabel: () => GroupLabel,
    Item: () => Item,
    ItemDescription: () => ItemDescription,
    ItemLabel: () => ItemLabel,
    LinkItem: () => LinkItem,
    Popup: () => Popup2,
    Portal: () => Portal2,
    Positioner: () => Positioner2,
    PrefixIcon: () => PrefixIcon,
    RadioGroup: () => RadioGroup,
    RadioItem: () => RadioItem,
    Root: () => Root2,
    Separator: () => Separator2,
    SubmenuRoot: () => SubmenuRoot,
    SubmenuTrigger: () => SubmenuTrigger,
    Trigger: () => Trigger2
  });

  // packages/ui/build-module/menu/checkbox-item.mjs
  var import_element31 = __toESM(require_element(), 1);

  // packages/ui/build-module/icon/icon.mjs
  var import_element23 = __toESM(require_element(), 1);
  var import_primitives35 = __toESM(require_primitives(), 1);
  var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1);
  var Icon = (0, import_element23.forwardRef)(function Icon2({ icon, size: size4 = 24, style, ...restProps }, ref) {
    const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0;
    return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
      import_primitives35.SVG,
      {
        ref,
        ...icon.props,
        ...restProps,
        ...mergedStyle ? { style: mergedStyle } : {},
        width: size4,
        height: size4
      }
    );
  });

  // packages/ui/build-module/menu/context.mjs
  var import_element24 = __toESM(require_element(), 1);
  var MenuContext = (0, import_element24.createContext)({
    isSubmenu: false
  });
  var useMenuContext = () => (0, import_element24.useContext)(MenuContext);
  var MenuItemContentContext = (0, import_element24.createContext)(null);
  var useMenuItemContentContext = () => (0, import_element24.useContext)(MenuItemContentContext);

  // packages/ui/build-module/menu/item.mjs
  var import_element30 = __toESM(require_element(), 1);

  // packages/ui/build-module/utils/keyboard-shortcut.mjs
  var import_element26 = __toESM(require_element(), 1);
  var import_i18n9 = __toESM(require_i18n(), 1);

  // packages/ui/build-module/visually-hidden/visually-hidden.mjs
  var import_element25 = __toESM(require_element(), 1);
  var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash";
  function getRuntime7() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument7(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash7(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE7}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle7(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime7();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash7(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument7(targetDocument) {
    const runtime = getRuntime7();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle7(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle7(hash, css) {
    const runtime = getRuntime7();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle7(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle7("f4df7461e9", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}}}");
  }
  var style_default6 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
  var VisuallyHidden = (0, import_element25.forwardRef)(
    function VisuallyHidden2({ render: render4, ...restProps }, ref) {
      const element = useRender({
        render: render4,
        ref,
        props: mergeProps(
          { className: style_default6["visually-hidden"] },
          restProps,
          {
            // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
            "data-visually-hidden": ""
          }
        )
      });
      return element;
    }
  );

  // packages/ui/build-module/utils/keyboard-shortcut.mjs
  var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1);
  function useKeyboardShortcutProps({
    "aria-describedby": ariaDescribedBy,
    "aria-keyshortcuts": ariaKeyShortcuts,
    shortcut
  }) {
    const generatedDescriptionId = (0, import_element26.useId)();
    const descriptionId = shortcut ? generatedDescriptionId : void 0;
    const describedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" ");
    return {
      descriptionId,
      targetProps: {
        "aria-describedby": describedBy || void 0,
        "aria-keyshortcuts": shortcut?.ariaKeyShortcut ?? ariaKeyShortcuts
      }
    };
  }
  var KeyboardShortcutDescription = (0, import_element26.forwardRef)(function KeyboardShortcutDescription2({ descriptionId, shortcut }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
      VisuallyHidden,
      {
        id: descriptionId,
        "aria-hidden": "true",
        render: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { ref }),
        children: (0, import_i18n9.sprintf)(
          /* translators: %s: keyboard shortcut. */
          (0, import_i18n9.__)("Keyboard shortcut: %s"),
          shortcut.label ?? shortcut.ariaKeyShortcut
        )
      }
    );
  });
  var KeyboardShortcutDisplay = (0, import_element26.forwardRef)(function KeyboardShortcutDisplay2({ className, shortcut }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { ref, "aria-hidden": "true", className, dir: "ltr", children: shortcut.displayShortcut });
  });

  // packages/ui/build-module/utils/item-popup/item-content.mjs
  var import_element27 = __toESM(require_element(), 1);
  var VALIDATION_ENABLED = true;
  function parseItemContent(children, { Label: Label3, Description: Description3, validationMessage }) {
    const childArray = import_element27.Children.toArray(children);
    const [label, ...descriptions] = childArray;
    const hasLabel = (0, import_element27.isValidElement)(label) && label.type === Label3;
    const descriptionElements = descriptions.filter(
      (description) => (0, import_element27.isValidElement)(description) && description.type === Description3
    );
    if (VALIDATION_ENABLED && (!hasLabel || descriptionElements.length !== descriptions.length)) {
      throw new Error(validationMessage);
    }
    return {
      descriptionIds: descriptionElements.map(
        (description) => description.props.id
      ),
      hasLabel,
      labelId: hasLabel ? label.props.id : void 0
    };
  }
  function useItemContent(children, components, {
    "aria-describedby": ariaDescribedBy,
    "aria-label": ariaLabel,
    "aria-labelledby": ariaLabelledBy
  } = {}) {
    const generatedLabelId = (0, import_element27.useId)();
    const generatedDescriptionId = (0, import_element27.useId)();
    const { descriptionIds, hasLabel, labelId } = parseItemContent(
      children,
      components
    );
    const resolvedLabelId = hasLabel ? labelId ?? generatedLabelId : void 0;
    const resolvedDescriptionIds = descriptionIds.map(
      (descriptionId, index2) => descriptionId ?? `${generatedDescriptionId}-${index2}`
    );
    const itemDescribedBy = Array.from(
      /* @__PURE__ */ new Set([
        ...ariaDescribedBy?.split(/\s+/).filter(Boolean) ?? [],
        ...resolvedDescriptionIds
      ])
    ).join(" ");
    let descriptionIndex = 0;
    const { Label: Label3, Description: Description3, descriptionValidationToken } = components;
    const contentChildren = import_element27.Children.map(children, (child) => {
      if (!(0, import_element27.isValidElement)(child)) {
        return child;
      }
      if (child.type === Label3) {
        return child.props.id === resolvedLabelId ? child : (0, import_element27.cloneElement)(child, { id: resolvedLabelId });
      }
      if (child.type !== Description3) {
        return child;
      }
      const descriptionId = resolvedDescriptionIds[descriptionIndex++];
      if (!descriptionValidationToken && child.props.id === descriptionId) {
        return child;
      }
      return (0, import_element27.cloneElement)(child, {
        id: descriptionId,
        ...descriptionValidationToken && {
          validationToken: descriptionValidationToken
        }
      });
    });
    const labelledBy = ariaLabelledBy ?? (ariaLabel ? void 0 : resolvedLabelId);
    return {
      contentChildren,
      resolvedLabelId,
      itemAriaProps: {
        "aria-describedby": itemDescribedBy || void 0,
        "aria-label": ariaLabel,
        "aria-labelledby": labelledBy
      }
    };
  }

  // packages/ui/build-module/menu/item-description.mjs
  var import_element28 = __toESM(require_element(), 1);
  var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash";
  function getRuntime8() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument8(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash8(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE8}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle8(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime8();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash8(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument8(targetDocument) {
    const runtime = getRuntime8();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle8(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle8(hash, css) {
    const runtime = getRuntime8();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle8(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle8("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default7 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var ITEM_DESCRIPTION_DIRECT_CHILD = /* @__PURE__ */ Symbol();
  var ItemDescription = (0, import_element28.forwardRef)(
    function MenuItemDescription(props, ref) {
      const { className, id, validationToken, ...restProps } = props;
      if (validationToken !== ITEM_DESCRIPTION_DIRECT_CHILD) {
        throw new Error(
          "Menu.ItemDescription: Missing direct menu item parent. Render <Menu.ItemDescription> as a direct child of a menu item."
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
        Text,
        {
          ref,
          variant: "body-sm",
          ...restProps,
          id,
          className: clsx_default(style_default7["item-description"], className)
        }
      );
    }
  );

  // packages/ui/build-module/menu/item-label.mjs
  var import_element29 = __toESM(require_element(), 1);
  var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash";
  function getRuntime9() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument9(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash9(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE9}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle9(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime9();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash9(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument9(targetDocument) {
    const runtime = getRuntime9();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle9(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle9(hash, css) {
    const runtime = getRuntime9();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle9(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle9("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default8 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var ItemLabel = (0, import_element29.forwardRef)(
    function MenuItemLabel({ children, className, id, ...props }, ref) {
      const itemContentContext = useMenuItemContentContext();
      return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
        Text,
        {
          ref,
          variant: "body-md",
          ...props,
          id: id ?? itemContentContext?.labelId,
          className: clsx_default(style_default8["item-label"], className),
          children: [
            children,
            itemContentContext?.labelTrailing
          ]
        }
      );
    }
  );

  // packages/ui/build-module/menu/item.mjs
  var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash";
  function getRuntime10() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument10(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash10(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE10}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle10(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime10();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash10(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument10(targetDocument) {
    const runtime = getRuntime10();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle10(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle10(hash, css) {
    const runtime = getRuntime10();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle10(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle10("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default3 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle10("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default3 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle10("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default9 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var ITEM_CONTENT_COMPONENTS = {
    Label: ItemLabel,
    Description: ItemDescription,
    validationMessage: "Menu.ItemLabel must be the first direct child of every menu item, followed only by Menu.ItemDescription components.",
    descriptionValidationToken: ITEM_DESCRIPTION_DIRECT_CHILD
  };
  function useItemContent2(children, {
    "aria-describedby": ariaDescribedBy,
    "aria-keyshortcuts": ariaKeyShortcuts,
    "aria-label": ariaLabel,
    "aria-labelledby": ariaLabelledBy,
    labelTrailing,
    shortcut
  }) {
    const { contentChildren, resolvedLabelId, itemAriaProps } = useItemContent(children, ITEM_CONTENT_COMPONENTS, {
      "aria-describedby": ariaDescribedBy,
      "aria-label": ariaLabel,
      "aria-labelledby": ariaLabelledBy
    });
    const {
      descriptionId: shortcutDescriptionId,
      targetProps: shortcutAriaProps
    } = useKeyboardShortcutProps({
      "aria-describedby": itemAriaProps["aria-describedby"],
      "aria-keyshortcuts": ariaKeyShortcuts,
      shortcut
    });
    return {
      // React widens the tuple while mapping; validation preserves the item-child
      // contract and cloning changes only generated description IDs.
      contentChildren,
      contentContextValue: {
        labelId: resolvedLabelId,
        labelTrailing
      },
      itemAriaProps: {
        ...shortcutAriaProps,
        "aria-label": itemAriaProps["aria-label"],
        "aria-labelledby": itemAriaProps["aria-labelledby"]
      },
      shortcutDescriptionId
    };
  }
  function ItemContent({
    children,
    prefix,
    shortcut,
    shortcutDescriptionId,
    suffix,
    trailing
  }) {
    const hasPrefix = import_element30.Children.toArray(prefix).some(
      (child) => child !== ""
    );
    const hasSuffix = import_element30.Children.toArray(suffix).some(
      (child) => child !== ""
    );
    const hasTrailing = import_element30.Children.toArray(trailing).some(
      (child) => child !== ""
    );
    return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("span", { className: style_default9["item-content"], children: [
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: style_default9["item-children"], children }),
        hasSuffix && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: style_default9["item-suffix"], children: suffix }),
        shortcut && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: style_default9["item-shortcut"], children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(KeyboardShortcutDisplay, { shortcut }) }),
        hasTrailing && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: style_default9["item-trailing"], children: trailing })
      ] }),
      hasPrefix && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { "aria-hidden": "true", className: style_default9["item-prefix"], children: prefix }),
      shortcut && shortcutDescriptionId && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
        KeyboardShortcutDescription,
        {
          descriptionId: shortcutDescriptionId,
          shortcut
        }
      )
    ] });
  }
  var Item = (0, import_element30.forwardRef)(function MenuItem3({
    children,
    className,
    prefix,
    shortcut,
    suffix,
    "aria-describedby": ariaDescribedBy,
    "aria-keyshortcuts": ariaKeyShortcuts,
    "aria-label": ariaLabel,
    "aria-labelledby": ariaLabelledBy,
    ...props
  }, ref) {
    const {
      contentChildren,
      contentContextValue,
      itemAriaProps,
      shortcutDescriptionId
    } = useItemContent2(children, {
      "aria-describedby": ariaDescribedBy,
      "aria-keyshortcuts": ariaKeyShortcuts,
      "aria-label": ariaLabel,
      "aria-labelledby": ariaLabelledBy,
      shortcut
    });
    return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
      index_parts_exports.Item,
      {
        ref,
        ...itemAriaProps,
        className: clsx_default(
          global_css_defense_default3.div,
          resets_default3["box-sizing"],
          style_default9.item,
          className
        ),
        ...props,
        children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(MenuItemContentContext.Provider, { value: contentContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          ItemContent,
          {
            prefix,
            shortcut,
            shortcutDescriptionId,
            suffix,
            children: contentChildren
          }
        ) })
      }
    );
  });

  // packages/ui/build-module/menu/checkbox-item.mjs
  var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash";
  function getRuntime11() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument11(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash11(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE11}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle11(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime11();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash11(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument11(targetDocument) {
    const runtime = getRuntime11();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle11(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle11(hash, css) {
    const runtime = getRuntime11();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle11(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle11("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default4 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle11("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default4 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle11("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default10 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var CheckboxItem = (0, import_element31.forwardRef)(
    function MenuCheckboxItem3({
      children,
      className,
      prefix,
      shortcut,
      suffix,
      "aria-describedby": ariaDescribedBy,
      "aria-keyshortcuts": ariaKeyShortcuts,
      "aria-label": ariaLabel,
      "aria-labelledby": ariaLabelledBy,
      ...props
    }, ref) {
      const {
        contentChildren,
        contentContextValue,
        itemAriaProps,
        shortcutDescriptionId
      } = useItemContent2(children, {
        "aria-describedby": ariaDescribedBy,
        "aria-keyshortcuts": ariaKeyShortcuts,
        "aria-label": ariaLabel,
        "aria-labelledby": ariaLabelledBy,
        shortcut
      });
      return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
        index_parts_exports.CheckboxItem,
        {
          ref,
          ...itemAriaProps,
          className: clsx_default(
            global_css_defense_default4.div,
            resets_default4["box-sizing"],
            style_default10.item,
            className
          ),
          ...props,
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              index_parts_exports.CheckboxItemIndicator,
              {
                keepMounted: true,
                className: style_default10["item-selection-indicator"],
                children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                  Icon,
                  {
                    icon: check_default,
                    size: 24,
                    className: style_default10["checkbox-selection-icon"],
                    "aria-hidden": "true"
                  }
                )
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(MenuItemContentContext.Provider, { value: contentContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              ItemContent,
              {
                prefix,
                shortcut,
                shortcutDescriptionId,
                suffix,
                children: contentChildren
              }
            ) })
          ]
        }
      );
    }
  );

  // packages/ui/build-module/menu/group.mjs
  var import_element32 = __toESM(require_element(), 1);
  var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash";
  function getRuntime12() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument12(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash12(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE12}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle12(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime12();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash12(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument12(targetDocument) {
    const runtime = getRuntime12();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle12(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle12(hash, css) {
    const runtime = getRuntime12();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle12(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle12("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default11 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var Group = (0, import_element32.forwardRef)(function MenuGroup3({ className, ...props }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
      index_parts_exports.Group,
      {
        ref,
        className: clsx_default(style_default11.group, className),
        ...props
      }
    );
  });

  // packages/ui/build-module/menu/group-label.mjs
  var import_element33 = __toESM(require_element(), 1);
  var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash";
  function getRuntime13() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument13(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash13(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE13}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle13(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime13();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash13(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument13(targetDocument) {
    const runtime = getRuntime13();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle13(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle13(hash, css) {
    const runtime = getRuntime13();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle13(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle13("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default12 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var GroupLabel = (0, import_element33.forwardRef)(
    function MenuGroupLabel3({ className, ...props }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
        index_parts_exports.GroupLabel,
        {
          ref,
          className: clsx_default(style_default12["group-label"], className),
          ...props
        }
      );
    }
  );

  // packages/ui/build-module/menu/link-item.mjs
  var import_element34 = __toESM(require_element(), 1);
  var import_i18n10 = __toESM(require_i18n(), 1);
  var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash";
  function getRuntime14() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument14(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash14(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE14}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle14(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime14();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash14(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument14(targetDocument) {
    const runtime = getRuntime14();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle14(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle14(hash, css) {
    const runtime = getRuntime14();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle14(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle14("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default5 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle14("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default5 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle14("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default13 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var LinkItem = (0, import_element34.forwardRef)(function MenuLinkItem3({
    children,
    className,
    openInNewTab = false,
    target,
    prefix,
    shortcut,
    suffix,
    "aria-describedby": ariaDescribedBy,
    "aria-keyshortcuts": ariaKeyShortcuts,
    "aria-label": ariaLabel,
    "aria-labelledby": ariaLabelledBy,
    rel,
    ...props
  }, ref) {
    const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? "");
    const externalLinkIndicator = shouldShowNewTabIndicator ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
      "span",
      {
        className: style_default13["external-link-indicator"],
        role: "img",
        "aria-label": (
          /* translators: accessibility text appended to link text */
          (0, import_i18n10.__)("(opens in a new tab)")
        )
      }
    ) : null;
    const {
      contentChildren,
      contentContextValue,
      itemAriaProps,
      shortcutDescriptionId
    } = useItemContent2(children, {
      "aria-describedby": ariaDescribedBy,
      "aria-keyshortcuts": ariaKeyShortcuts,
      "aria-label": ariaLabel,
      "aria-labelledby": ariaLabelledBy,
      labelTrailing: externalLinkIndicator,
      shortcut
    });
    return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
      index_parts_exports.LinkItem,
      {
        ref,
        ...props,
        ...itemAriaProps,
        rel,
        target: target ?? (openInNewTab ? "_blank" : void 0),
        className: clsx_default(
          global_css_defense_default5.a,
          resets_default5["box-sizing"],
          style_default13.item,
          className
        ),
        children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(MenuItemContentContext.Provider, { value: contentContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
          ItemContent,
          {
            prefix,
            shortcut,
            shortcutDescriptionId,
            suffix,
            children: contentChildren
          }
        ) })
      }
    );
  });

  // packages/ui/build-module/menu/popup.mjs
  var import_element37 = __toESM(require_element(), 1);

  // packages/ui/build-module/menu/portal.mjs
  var import_element35 = __toESM(require_element(), 1);
  var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1);
  var Portal2 = (0, import_element35.forwardRef)(function MenuPortal3({ container, ...props }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
      index_parts_exports.Portal,
      {
        ref,
        container: container ?? getWpCompatOverlaySlot(),
        ...props
      }
    );
  });

  // packages/ui/build-module/menu/positioner.mjs
  var import_element36 = __toESM(require_element(), 1);

  // packages/ui/build-module/form/primitives/constants.mjs
  var ITEM_POPUP_POSITIONER_PROPS = {
    align: "start",
    sideOffset: 8,
    collisionPadding: 12
  };

  // packages/ui/build-module/menu/positioner.mjs
  var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash";
  function getRuntime15() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument15(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash15(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE15}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle15(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime15();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash15(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument15(targetDocument) {
    const runtime = getRuntime15();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle15(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle15(hash, css) {
    const runtime = getRuntime15();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle15(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle15("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default6 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle15("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default14 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var MENU_SUBMENU_POPUP_POSITIONER_PROPS = {
    side: "inline-end",
    align: "start",
    sideOffset: -4,
    collisionPadding: 12
  };
  var Positioner2 = (0, import_element36.forwardRef)(
    function MenuPositioner3({ className, ...props }, ref) {
      const { isSubmenu } = useMenuContext();
      const defaultProps = isSubmenu ? MENU_SUBMENU_POPUP_POSITIONER_PROPS : ITEM_POPUP_POSITIONER_PROPS;
      return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
        index_parts_exports.Positioner,
        {
          ...defaultProps,
          ...props,
          ref,
          className: clsx_default(
            resets_default6["box-sizing"],
            style_default14.positioner,
            className
          )
        }
      );
    }
  );

  // packages/ui/build-module/menu/popup.mjs
  var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash";
  function getRuntime16() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument16(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash16(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE16}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle16(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime16();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash16(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument16(targetDocument) {
    const runtime = getRuntime16();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle16(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle16(hash, css) {
    const runtime = getRuntime16();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle16(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle16("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default15 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var Popup2 = (0, import_element37.forwardRef)(function MenuPopup3({ children, className, portal, positioner, ...props }, ref) {
    const { isSubmenu } = useMenuContext();
    const popupContent = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
      index_parts_exports.Popup,
      {
        ref,
        className: clsx_default(
          style_default15.popup,
          isSubmenu ? style_default15["is-submenu"] : style_default15["is-root"],
          className
        ),
        ...props,
        children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
          "div",
          {
            className: style_default15.list,
            children
          }
        )
      }
    );
    const positionedPopup = renderSlotWithChildren(
      positioner,
      /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Positioner2, {}),
      popupContent
    );
    return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Portal2, {}), positionedPopup);
  });

  // packages/ui/build-module/menu/prefix-icon.mjs
  var import_element38 = __toESM(require_element(), 1);
  var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash";
  function getRuntime17() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument17(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash17(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE17}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle17(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime17();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash17(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument17(targetDocument) {
    const runtime = getRuntime17();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle17(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle17(hash, css) {
    const runtime = getRuntime17();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle17(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle17("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default16 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var PrefixIcon = (0, import_element38.forwardRef)(
    function MenuPrefixIcon({ className, size: size4 = 24, style, ...props }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
        Icon,
        {
          ...props,
          ref,
          size: size4,
          className: clsx_default(style_default16["prefix-icon"], className),
          style: {
            ...style,
            "--_wp-ui-menu-prefix-icon-size": `${size4}px`
          }
        }
      );
    }
  );
  PrefixIcon.displayName = "Menu.PrefixIcon";

  // packages/ui/build-module/menu/radio-group.mjs
  var import_element39 = __toESM(require_element(), 1);
  var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE18 = "data-wp-hash";
  function getRuntime18() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument18(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash18(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE18}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE18) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle18(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime18();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash18(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE18, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument18(targetDocument) {
    const runtime = getRuntime18();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle18(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle18(hash, css) {
    const runtime = getRuntime18();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle18(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle18("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default17 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var RadioGroup = (0, import_element39.forwardRef)(
    function MenuRadioGroup3({ className, ...props }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
        index_parts_exports.RadioGroup,
        {
          ref,
          className: clsx_default(style_default17["radio-group"], className),
          ...props
        }
      );
    }
  );

  // packages/ui/build-module/menu/radio-item.mjs
  var import_element40 = __toESM(require_element(), 1);
  var import_primitives36 = __toESM(require_primitives(), 1);
  var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE19 = "data-wp-hash";
  function getRuntime19() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument19(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash19(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE19}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE19) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle19(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime19();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash19(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE19, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument19(targetDocument) {
    const runtime = getRuntime19();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle19(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle19(hash, css) {
    const runtime = getRuntime19();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle19(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle19("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default6 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle19("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default7 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle19("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default18 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var radioCheck = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives36.Circle, { cx: 12, cy: 12, r: 3 }) });
  var RadioItem = (0, import_element40.forwardRef)(
    function MenuRadioItem3({
      children,
      className,
      prefix,
      shortcut,
      suffix,
      "aria-describedby": ariaDescribedBy,
      "aria-keyshortcuts": ariaKeyShortcuts,
      "aria-label": ariaLabel,
      "aria-labelledby": ariaLabelledBy,
      ...props
    }, ref) {
      const {
        contentChildren,
        contentContextValue,
        itemAriaProps,
        shortcutDescriptionId
      } = useItemContent2(children, {
        "aria-describedby": ariaDescribedBy,
        "aria-keyshortcuts": ariaKeyShortcuts,
        "aria-label": ariaLabel,
        "aria-labelledby": ariaLabelledBy,
        shortcut
      });
      return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
        index_parts_exports.RadioItem,
        {
          ref,
          ...itemAriaProps,
          className: clsx_default(
            global_css_defense_default6.div,
            resets_default7["box-sizing"],
            style_default18.item,
            className
          ),
          ...props,
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
              index_parts_exports.RadioItemIndicator,
              {
                keepMounted: true,
                className: style_default18["item-selection-indicator"],
                children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
                  Icon,
                  {
                    icon: radioCheck,
                    className: style_default18["radio-selection-icon"],
                    "aria-hidden": "true"
                  }
                )
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(MenuItemContentContext.Provider, { value: contentContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
              ItemContent,
              {
                prefix,
                shortcut,
                shortcutDescriptionId,
                suffix,
                children: contentChildren
              }
            ) })
          ]
        }
      );
    }
  );

  // packages/ui/build-module/menu/use-iframe-dismissal-bridge.mjs
  var import_element41 = __toESM(require_element(), 1);
  function getIframeDocument(iframe) {
    try {
      return iframe.contentDocument;
    } catch {
      return null;
    }
  }
  function forEachIframe(node, callback) {
    if (node.nodeType !== Node.ELEMENT_NODE) {
      return;
    }
    const element = node;
    if (element.tagName === "IFRAME") {
      callback(element);
    }
    element.querySelectorAll("iframe").forEach(callback);
  }
  function isInsideCurrentMenu(event, trigger) {
    const target = event.target;
    const targetElement = target?.nodeType === Node.ELEMENT_NODE ? target : target?.parentElement;
    const popupId = trigger.getAttribute("aria-controls");
    if (!targetElement || !popupId) {
      return false;
    }
    const popup = targetElement.ownerDocument.getElementById(popupId);
    if (!popup) {
      return false;
    }
    const rootOwnerId = popup.getAttribute("data-rootownerid");
    if (!rootOwnerId) {
      return popup.contains(targetElement);
    }
    return targetElement.closest("[data-rootownerid]")?.getAttribute("data-rootownerid") === rootOwnerId;
  }
  function useCloseOnIframePointerDown({
    enabled,
    onPointerDown,
    ownerDocument: ownerDocument2
  }) {
    (0, import_element41.useEffect)(() => {
      if (!enabled || !ownerDocument2) {
        return;
      }
      const observeDocument = (document2, listenForPointerDown) => {
        if (listenForPointerDown) {
          document2.addEventListener("pointerdown", onPointerDown, true);
        }
        const iframeCleanups = /* @__PURE__ */ new Map();
        const addIframe = (iframe) => {
          if (iframeCleanups.has(iframe)) {
            return;
          }
          let iframeDocument = null;
          let iframeDocumentCleanup;
          const updateIframeDocument = () => {
            const nextIframeDocument = getIframeDocument(iframe);
            if (nextIframeDocument === iframeDocument) {
              return;
            }
            iframeDocumentCleanup?.();
            iframeDocument = nextIframeDocument;
            iframeDocumentCleanup = iframeDocument ? observeDocument(iframeDocument, true) : void 0;
          };
          iframe.addEventListener("load", updateIframeDocument);
          updateIframeDocument();
          iframeCleanups.set(iframe, () => {
            iframe.removeEventListener("load", updateIframeDocument);
            iframeDocumentCleanup?.();
          });
        };
        const removeIframe = (iframe) => {
          iframeCleanups.get(iframe)?.();
          iframeCleanups.delete(iframe);
        };
        document2.querySelectorAll("iframe").forEach(addIframe);
        const MutationObserverConstructor = document2.defaultView?.MutationObserver;
        const observer = MutationObserverConstructor ? new MutationObserverConstructor((records) => {
          records.forEach((record) => {
            record.removedNodes.forEach(
              (node) => forEachIframe(node, removeIframe)
            );
            record.addedNodes.forEach(
              (node) => forEachIframe(node, addIframe)
            );
          });
        }) : null;
        observer?.observe(document2.documentElement, {
          childList: true,
          subtree: true
        });
        return () => {
          observer?.disconnect();
          iframeCleanups.forEach((cleanup) => cleanup());
          if (listenForPointerDown) {
            document2.removeEventListener(
              "pointerdown",
              onPointerDown,
              true
            );
          }
        };
      };
      return observeDocument(ownerDocument2, false);
    }, [enabled, onPointerDown, ownerDocument2]);
  }
  function useIframeDismissalBridge({
    actionsRef,
    defaultOpen,
    disabled: disabled2,
    modal,
    onOpenChange,
    open: openProp
  }) {
    const fallbackActionsRef = (0, import_element41.useRef)(null);
    const resolvedActionsRef = actionsRef ?? fallbackActionsRef;
    const [uncontrolledOpen, setUncontrolledOpen] = (0, import_element41.useState)(
      defaultOpen ?? false
    );
    const [trigger, setTrigger] = (0, import_element41.useState)(null);
    const open2 = openProp ?? uncontrolledOpen;
    const handleIframePointerDown = (0, import_element41.useCallback)(
      (event) => {
        if (trigger && !isInsideCurrentMenu(event, trigger)) {
          resolvedActionsRef.current?.close();
        }
      },
      [resolvedActionsRef, trigger]
    );
    useCloseOnIframePointerDown({
      enabled: open2 && modal === false && !disabled2 && trigger !== null,
      onPointerDown: handleIframePointerDown,
      ownerDocument: trigger?.ownerDocument ?? null
    });
    const handleOpenChange = (nextOpen, eventDetails) => {
      onOpenChange(nextOpen, eventDetails);
      if (eventDetails.isCanceled) {
        return;
      }
      setUncontrolledOpen(nextOpen);
      setTrigger(nextOpen ? eventDetails.trigger ?? null : null);
    };
    return {
      actionsRef: resolvedActionsRef,
      onOpenChange: handleOpenChange
    };
  }

  // packages/ui/build-module/menu/root.mjs
  var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1);
  function Root2(props) {
    const { onOpenChange } = props;
    const handleOpenChange = (nextOpen, eventDetails) => {
      const trigger = eventDetails.trigger;
      const TriggerElement = trigger?.ownerDocument.defaultView?.HTMLElement;
      const EventTargetElement = trigger?.ownerDocument.defaultView?.Element;
      const activeElementBeforeOpenChange = trigger?.ownerDocument.activeElement;
      const eventTarget = eventDetails.event.target;
      const menuElement = EventTargetElement && eventTarget instanceof EventTargetElement ? eventTarget.closest('[role="menu"]') : null;
      onOpenChange?.(nextOpen, eventDetails);
      if (!nextOpen && eventDetails.reason === "item-press" && !eventDetails.isCanceled && TriggerElement && trigger instanceof TriggerElement && menuElement?.contains(activeElementBeforeOpenChange ?? null) && trigger.ownerDocument.activeElement === activeElementBeforeOpenChange) {
        trigger.focus();
      }
    };
    const iframeDismissalProps = useIframeDismissalBridge({
      actionsRef: props.actionsRef,
      defaultOpen: props.defaultOpen,
      disabled: props.disabled,
      modal: props.modal,
      onOpenChange: handleOpenChange,
      open: props.open
    });
    return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(MenuContext.Provider, { value: { isSubmenu: false }, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(index_parts_exports.Root, { ...props, ...iframeDismissalProps }) }) });
  }

  // packages/ui/build-module/menu/separator.mjs
  var import_element42 = __toESM(require_element(), 1);
  var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE20 = "data-wp-hash";
  function getRuntime20() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument20(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash20(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE20}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE20) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle20(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime20();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash20(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE20, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument20(targetDocument) {
    const runtime = getRuntime20();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle20(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle20(hash, css) {
    const runtime = getRuntime20();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle20(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle20("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default19 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var Separator2 = (0, import_element42.forwardRef)(
    function MenuSeparator({ className, ...props }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
        index_parts_exports.Separator,
        {
          ref,
          className: clsx_default(style_default19.separator, className),
          ...props
        }
      );
    }
  );

  // packages/ui/build-module/menu/submenu-root.mjs
  var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1);
  function SubmenuRoot(props) {
    return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MenuContext.Provider, { value: { isSubmenu: true }, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(index_parts_exports.SubmenuRoot, { ...props }) });
  }

  // packages/ui/build-module/menu/submenu-trigger.mjs
  var import_element43 = __toESM(require_element(), 1);
  var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE21 = "data-wp-hash";
  function getRuntime21() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument21(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash21(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE21}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE21) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle21(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime21();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash21(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE21, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument21(targetDocument) {
    const runtime = getRuntime21();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle21(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle21(hash, css) {
    const runtime = getRuntime21();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle21(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle21("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default7 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle21("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default8 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle21("3be1f8dffe", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion,._7f344b94e270e039__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._380b81b8f79fb10f__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d61e2d85c0ee0699__positioner{z-index:var(--wp-ui-menu-z-index,initial)}._34e81249f419a5a5__popup{--wp-ui-menu-popup-padding:var(--wpds-dimension-padding-xs,4px);--wp-ui-menu-min-width:160px;--wp-ui-menu-max-width:var(--wpds-dimension-surface-width-md,400px);--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-group-head-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-menu-selection-indicator-track-size:0px;--wp-ui-menu-selection-indicator-size:var(--wpds-dimension-size-sm,24px);--wp-ui-menu-selection-indicator-gap:0px;--_wp-ui-menu-elevation-md:0px 2px 3px 0px #0000000d,0px 4px 5px 0px #0000000a,0px 12px 12px 0px #00000008,0px 16px 16px 0px #00000005;background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-menu-elevation-md);max-height:min(var(--available-height),480px,60dvh);max-width:min(var(--available-width),var(--wp-ui-menu-max-width));min-width:min(var(--available-width),var(--wp-ui-menu-min-width));outline:none;overflow-block:auto;overscroll-behavior:none;padding:var(--wp-ui-menu-popup-padding);scroll-padding:var(--wp-ui-menu-popup-padding);&:has(._42313b48c5459be3__item-selection-indicator){--wp-ui-menu-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-menu-selection-indicator-track-size:var(--wpds-dimension-size-2xs,16px);--wp-ui-menu-selection-indicator-gap:var(--wpds-dimension-gap-sm,8px)}}._33f07ab17005471d__list{--_wp-ui-menu-item-label-line-height:var(--wpds-typography-line-height-sm,20px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--_wp-ui-menu-item-label-line-height)}._33f07ab17005471d__list,.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{--wp-ui-menu-group-prefix-gap:0px;display:grid;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];min-width:0}.e05914e1005d7c2e__radio-group,.f11085533c0056b0__group{grid-column:1/-1}._33f07ab17005471d__list:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.e05914e1005d7c2e__radio-group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix),.f11085533c0056b0__group:has(>._5c913bce0d8bb0d6__item>._64924ecabf65a5d6__item-prefix){--wp-ui-menu-group-prefix-gap:var(--wpds-dimension-gap-xs,4px)}._4a0fd085d76fd23c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);grid-column:1/-1;line-height:var(--wpds-typography-line-height-xs,16px);min-height:var(--wpds-dimension-size-md,32px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wp-ui-menu-group-head-padding-inline);text-transform:uppercase}.bfc11368eadf3b39__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);grid-column:1/-1;height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline:var(--wp-ui-menu-group-head-padding-inline);@media (forced-colors:active){background-color:CanvasText}}._5c913bce0d8bb0d6__item{--wp-ui-menu-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-menu-item-padding-block:var(--wpds-dimension-padding-xs,4px);--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);align-content:center;align-items:start;border-radius:var(--wpds-border-radius-sm,2px);display:grid;gap:0;grid-column:1/-1;grid-template-columns:[item-padding-start] var(--wp-ui-menu-item-padding-inline) [selection-start] var(--wp-ui-menu-selection-indicator-track-size) [selection-end] var(--wp-ui-menu-selection-indicator-gap) [prefix-start] max-content [prefix-end] var(--wp-ui-menu-group-prefix-gap) [content-start] minmax(0,1fr) [content-end] var(--wp-ui-menu-item-padding-inline) [item-padding-end];justify-content:stretch;min-height:var(--wp-ui-menu-item-height);min-width:0;padding-block:var(--wp-ui-menu-item-padding-block);scroll-margin:var(--wp-ui-menu-popup-padding);text-decoration:none;user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&[href]{cursor:pointer}@supports (grid-template-columns:subgrid){grid-template-columns:subgrid}&[data-highlighted]:not([aria-disabled=true]){background-color:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);outline:none;@media (forced-colors:active){--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight;--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid Highlight}}&[aria-disabled=true]{background-color:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._42313b48c5459be3__item-selection-indicator,._64924ecabf65a5d6__item-prefix,.af879698ede76757__item-content{grid-row:1}._42313b48c5459be3__item-selection-indicator{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:selection-start/selection-end;height:var(--_wp-ui-menu-item-label-line-height);justify-content:center;justify-self:center;pointer-events:none;width:var(--wp-ui-menu-selection-indicator-size);&[data-unchecked]{opacity:0}}._99c5bd141cbf516f__checkbox-selection-icon{translate:0 1px}._59aa9b3b3a651148__radio-selection-icon{fill:currentColor;height:var(--wpds-dimension-size-xs,20px);width:var(--wpds-dimension-size-xs,20px)}._64924ecabf65a5d6__item-prefix{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:prefix-start/prefix-end;justify-content:center;min-width:0}.a836378335a4cbf1__prefix-icon{align-self:flex-start;flex-shrink:0;margin-block-start:calc((var(--_wp-ui-menu-item-label-line-height) - var(--_wp-ui-menu-prefix-icon-size))/2)}.af879698ede76757__item-content{align-items:center;align-self:stretch;box-sizing:border-box;display:grid;grid-column:content-start/content-end;grid-template-columns:[label-start] minmax(0,1fr) [label-end suffix-start] auto [suffix-end shortcut-start] auto [shortcut-end trailing-start] auto [trailing-end];min-width:0;pointer-events:none}._943a932d9f81c78c__item-children{display:inline-flex;flex-direction:column;gap:2px;grid-column:label-start/label-end;min-width:0}._5ed41da4abcf8958__item-label{--_gcd-heading-color:currentColor;--_gcd-p-line-height:var(--_wp-ui-menu-item-label-line-height);color:inherit;line-height:var(--_wp-ui-menu-item-label-line-height);min-width:0;overflow-wrap:anywhere}.fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:var(--wpds-color-foreground-content-neutral-weak,#707070);color:var(--wpds-color-foreground-content-neutral-weak,#707070);overflow-wrap:anywhere;padding-block-end:var(--wpds-dimension-padding-xs,4px)}._091406749ed93e6e__item-suffix{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);grid-column:suffix-start/suffix-end}._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin-inline-start:var(--wpds-dimension-gap-md,12px)}._23630f40071a29ff__item-shortcut{grid-column:shortcut-start/shortcut-end}._06be17a91bf434a0__item-trailing{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;grid-column:trailing-start/trailing-end;margin-inline-start:var(--wpds-dimension-gap-md,12px)}._943a932d9f81c78c__item-children+:is(._091406749ed93e6e__item-suffix,._23630f40071a29ff__item-shortcut,._06be17a91bf434a0__item-trailing){margin-inline-start:var(--wpds-dimension-gap-xl,24px)}._23630f40071a29ff__item-shortcut+._06be17a91bf434a0__item-trailing{margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.b78aec79bf93eba0__submenu-chevron{margin-inline-end:calc(var(--wpds-dimension-gap-sm, 8px)*-1)}.b78aec79bf93eba0__submenu-chevron:dir(rtl){transform:rotate(180deg)}._60da3b6f9718cf76__external-link-indicator{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);text-decoration:none}._60da3b6f9718cf76__external-link-indicator:after{content:"\\2197"}._60da3b6f9718cf76__external-link-indicator:dir(rtl):after{content:"\\2196"}._5c913bce0d8bb0d6__item[aria-disabled=true] ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[aria-disabled=true] ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[aria-disabled=true] ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[aria-disabled=true] ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[aria-disabled=true] ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[aria-disabled=true] .fa88c9f1a96a4c5a__item-description,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._06be17a91bf434a0__item-trailing,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._091406749ed93e6e__item-suffix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._23630f40071a29ff__item-shortcut,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._42313b48c5459be3__item-selection-indicator,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) ._64924ecabf65a5d6__item-prefix,._5c913bce0d8bb0d6__item[data-highlighted]:not([aria-disabled=true]) .fa88c9f1a96a4c5a__item-description{--_gcd-heading-color:currentColor;color:inherit}}}');
  }
  var style_default20 = { "positioner": "d61e2d85c0ee0699__positioner", "popup": "_34e81249f419a5a5__popup", "item-selection-indicator": "_42313b48c5459be3__item-selection-indicator", "is-root": "_087a537b24fee6a1__is-root _380b81b8f79fb10f__dropdown-motion", "is-submenu": "_6d3b567f6289bdc2__is-submenu _7f344b94e270e039__dropdown-motion--fade-only", "list": "_33f07ab17005471d__list", "group": "f11085533c0056b0__group", "radio-group": "e05914e1005d7c2e__radio-group", "item": "_5c913bce0d8bb0d6__item", "item-prefix": "_64924ecabf65a5d6__item-prefix", "group-label": "_4a0fd085d76fd23c__group-label", "separator": "bfc11368eadf3b39__separator", "item-content": "af879698ede76757__item-content", "checkbox-selection-icon": "_99c5bd141cbf516f__checkbox-selection-icon", "radio-selection-icon": "_59aa9b3b3a651148__radio-selection-icon", "prefix-icon": "a836378335a4cbf1__prefix-icon", "item-children": "_943a932d9f81c78c__item-children", "item-label": "_5ed41da4abcf8958__item-label", "item-description": "fa88c9f1a96a4c5a__item-description", "item-suffix": "_091406749ed93e6e__item-suffix", "item-shortcut": "_23630f40071a29ff__item-shortcut", "item-trailing": "_06be17a91bf434a0__item-trailing", "submenu-chevron": "b78aec79bf93eba0__submenu-chevron", "external-link-indicator": "_60da3b6f9718cf76__external-link-indicator" };
  var SubmenuTrigger = (0, import_element43.forwardRef)(
    function MenuSubmenuTrigger3({
      children,
      className,
      prefix,
      shortcut,
      suffix,
      "aria-describedby": ariaDescribedBy,
      "aria-keyshortcuts": ariaKeyShortcuts,
      "aria-label": ariaLabel,
      "aria-labelledby": ariaLabelledBy,
      ...props
    }, ref) {
      const {
        contentChildren,
        contentContextValue,
        itemAriaProps,
        shortcutDescriptionId
      } = useItemContent2(children, {
        "aria-describedby": ariaDescribedBy,
        "aria-keyshortcuts": ariaKeyShortcuts,
        "aria-label": ariaLabel,
        "aria-labelledby": ariaLabelledBy,
        shortcut
      });
      return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
        index_parts_exports.SubmenuTrigger,
        {
          ref,
          ...itemAriaProps,
          className: clsx_default(
            global_css_defense_default7.div,
            resets_default8["box-sizing"],
            style_default20.item,
            className
          ),
          ...props,
          children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(MenuItemContentContext.Provider, { value: contentContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
            ItemContent,
            {
              prefix,
              shortcut,
              shortcutDescriptionId,
              suffix,
              trailing: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
                Icon,
                {
                  className: style_default20["submenu-chevron"],
                  icon: chevron_right_small_default,
                  size: 24,
                  "aria-hidden": "true"
                }
              ),
              children: contentChildren
            }
          ) })
        }
      );
    }
  );

  // packages/ui/build-module/menu/trigger.mjs
  var import_element44 = __toESM(require_element(), 1);
  var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1);
  var Trigger2 = (0, import_element44.forwardRef)(
    function MenuTrigger3(props, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(index_parts_exports.Trigger, { ref, ...props });
    }
  );

  // packages/ui/build-module/button/button.mjs
  var import_a11y = __toESM(require_a11y(), 1);
  var import_element45 = __toESM(require_element(), 1);
  var import_i18n11 = __toESM(require_i18n(), 1);
  var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE22 = "data-wp-hash";
  function getRuntime22() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument22(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash22(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE22}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE22) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle22(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime22();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash22(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE22, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument22(targetDocument) {
    const runtime = getRuntime22();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle22(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle22(hash, css) {
    const runtime = getRuntime22();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle22(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle22("effc4e3032", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:var(--wpds-typography-font-weight-emphasis,600);--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:var(--wpds-dimension-size-lg,40px);--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:border-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:transparent;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:var(--wp-ui-button-font-size);left:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}@media (forced-colors:active){border-block-end-style:none;border-bottom-color:ButtonText;border-inline-start-style:none;border-left-color:ButtonText;border-right-color:ButtonText;border-top-color:ButtonText}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-block:0px;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:var(--wpds-dimension-size-sm,24px)}._9f6fc6553aeb36fe__icon{margin:var(--wp-ui-button-icon-margin)}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-brand-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.ad0619a3217c6a5b__is-minimal[aria-pressed=true],&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:var(--wpds-dimension-size-md,32px)}._914b42f315c0e580__is-loading:not(.abbb272e2ce49bd6__is-unstyled){color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}@media (forced-colors:active){color:ButtonFace}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}}');
  }
  var style_default21 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "icon": "_9f6fc6553aeb36fe__icon", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "loading-animation": "_5a1d53da6f830c8d__loading-animation" };
  if (typeof process === "undefined" || true) {
    registerStyle22("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default9 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle22("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
  }
  var focus_module_default2 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
  if (typeof process === "undefined" || true) {
    registerStyle22("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default8 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  var Button3 = (0, import_element45.forwardRef)(
    function Button22({
      tone = "brand",
      variant = "solid",
      size: size4 = "default",
      className,
      focusableWhenDisabled = true,
      disabled: disabled2,
      loading,
      loadingAnnouncement = (0, import_i18n11.__)("Loading"),
      children,
      ...props
    }, ref) {
      const mergedClassName = clsx_default(
        global_css_defense_default8.button,
        resets_default9["box-sizing"],
        focus_module_default2["outset-ring--focus-except-active"],
        variant !== "unstyled" && style_default21.button,
        style_default21[`is-${tone}`],
        style_default21[`is-${variant}`],
        style_default21[`is-${size4}`],
        loading && style_default21["is-loading"],
        className
      );
      (0, import_element45.useEffect)(() => {
        if (loading && loadingAnnouncement) {
          (0, import_a11y.speak)(loadingAnnouncement);
        }
      }, [loading, loadingAnnouncement]);
      return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
        Button,
        {
          ref,
          className: mergedClassName,
          focusableWhenDisabled,
          disabled: disabled2 ?? loading,
          ...props,
          children
        }
      );
    }
  );

  // packages/ui/build-module/button/icon.mjs
  var import_element46 = __toESM(require_element(), 1);
  var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE23 = "data-wp-hash";
  function getRuntime23() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument23(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash23(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE23}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE23) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle23(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime23();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash23(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE23, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument23(targetDocument) {
    const runtime = getRuntime23();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle23(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle23(hash, css) {
    const runtime = getRuntime23();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle23(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle23("effc4e3032", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:var(--wpds-typography-font-weight-emphasis,600);--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:var(--wpds-dimension-size-lg,40px);--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:border-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:transparent;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:var(--wp-ui-button-font-size);left:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}@media (forced-colors:active){border-block-end-style:none;border-bottom-color:ButtonText;border-inline-start-style:none;border-left-color:ButtonText;border-right-color:ButtonText;border-top-color:ButtonText}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-block:0px;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:var(--wpds-dimension-size-sm,24px)}._9f6fc6553aeb36fe__icon{margin:var(--wp-ui-button-icon-margin)}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-brand-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.ad0619a3217c6a5b__is-minimal[aria-pressed=true],&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:var(--wpds-dimension-size-md,32px)}._914b42f315c0e580__is-loading:not(.abbb272e2ce49bd6__is-unstyled){color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}@media (forced-colors:active){color:ButtonFace}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}}');
  }
  var style_default22 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "icon": "_9f6fc6553aeb36fe__icon", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "loading-animation": "_5a1d53da6f830c8d__loading-animation" };
  var ButtonIcon = (0, import_element46.forwardRef)(
    function ButtonIcon2({ className, icon, ...props }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
        Icon,
        {
          ref,
          icon,
          className: clsx_default(style_default22.icon, className),
          size: 24,
          ...props
        }
      );
    }
  );

  // packages/ui/build-module/button/index.mjs
  ButtonIcon.displayName = "Button.Icon";
  var Button4 = Object.assign(Button3, {
    /**
     * An icon component specifically designed to work well when rendered inside
     * a `Button` component.
     */
    Icon: ButtonIcon
  });

  // node_modules/@date-fns/tz/tzName/index.js
  function tzName(timeZone, date, format7 = "long") {
    return new Intl.DateTimeFormat("en-US", {
      // Enforces engine to render the time. Without the option JavaScriptCore omits it.
      hour: "numeric",
      timeZone,
      timeZoneName: format7
    }).format(date).split(/\s/g).slice(2).join(" ");
  }

  // node_modules/@date-fns/tz/tzOffset/index.js
  var offsetFormatCache = {};
  var offsetCache = {};
  function tzOffset(timeZone, date) {
    try {
      const format7 = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat("en-US", {
        timeZone,
        timeZoneName: "longOffset"
      }).format;
      const offsetStr = format7(date).split("GMT")[1];
      if (offsetStr in offsetCache) return offsetCache[offsetStr];
      return calcOffset(offsetStr, offsetStr.split(":"));
    } catch {
      if (timeZone in offsetCache) return offsetCache[timeZone];
      const captures = timeZone?.match(offsetRe);
      if (captures) return calcOffset(timeZone, captures.slice(1));
      return NaN;
    }
  }
  var offsetRe = /([+-]\d\d):?(\d\d)?/;
  function calcOffset(cacheStr, values) {
    const hours = +(values[0] || 0);
    const minutes = +(values[1] || 0);
    const seconds = +(values[2] || 0) / 60;
    return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
  }

  // node_modules/@date-fns/tz/date/mini.js
  var TZDateMini = class _TZDateMini extends Date {
    //#region static
    constructor(...args) {
      super();
      if (args.length > 1 && typeof args[args.length - 1] === "string") {
        this.timeZone = args.pop();
      }
      this.internal = /* @__PURE__ */ new Date();
      if (isNaN(tzOffset(this.timeZone, this))) {
        this.setTime(NaN);
      } else {
        if (!args.length) {
          this.setTime(Date.now());
        } else if (typeof args[0] === "number" && (args.length === 1 || args.length === 2 && typeof args[1] !== "number")) {
          this.setTime(args[0]);
        } else if (typeof args[0] === "string") {
          this.setTime(+new Date(args[0]));
        } else if (args[0] instanceof Date) {
          this.setTime(+args[0]);
        } else {
          this.setTime(+new Date(...args));
          adjustToSystemTZ(this, args);
        }
      }
    }
    static tz(tz, ...args) {
      return args.length ? new _TZDateMini(...args, tz) : new _TZDateMini(Date.now(), tz);
    }
    //#endregion
    //#region time zone
    withTimeZone(timeZone) {
      return new _TZDateMini(+this, timeZone);
    }
    getTimezoneOffset() {
      const offset4 = -tzOffset(this.timeZone, this);
      return offset4 > 0 ? Math.floor(offset4) : Math.ceil(offset4);
    }
    //#endregion
    //#region time
    setTime(_time) {
      Date.prototype.setTime.apply(this, arguments);
      syncToInternal(this);
      return +this;
    }
    //#endregion
    //#region date-fns integration
    [/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
      return new _TZDateMini(+new Date(date), this.timeZone);
    }
    //#endregion
  };
  var re = /^(get|set)(?!UTC)/;
  Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
    if (!re.test(method)) return;
    const utcMethod = method.replace(re, "$1UTC");
    if (!TZDateMini.prototype[utcMethod]) return;
    if (method.startsWith("get")) {
      TZDateMini.prototype[method] = function() {
        return this.internal[utcMethod]();
      };
    } else {
      TZDateMini.prototype[method] = function() {
        Date.prototype[utcMethod].apply(this.internal, arguments);
        syncFromInternal(this);
        return +this;
      };
      TZDateMini.prototype[utcMethod] = function() {
        Date.prototype[utcMethod].apply(this, arguments);
        syncToInternal(this);
        return +this;
      };
    }
  });
  function syncToInternal(date) {
    date.internal.setTime(+date);
    date.internal.setUTCSeconds(date.internal.getUTCSeconds() - // Round after converting minutes to seconds to avoid fractional offset
    // precision errors from historical offsets.
    Math.round(-tzOffset(date.timeZone, date) * 60));
  }
  function syncFromInternal(date) {
    Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());
    Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());
    adjustToSystemTZ(date);
  }
  function adjustToSystemTZ(date, constructorArgs) {
    const expectedInternalTime = Array.isArray(constructorArgs) ? constructorArgsToInternalTime(constructorArgs) : +date.internal;
    const offsetWithSeconds = tzOffset(date.timeZone, date);
    const offset4 = offsetWithSeconds > 0 ? Math.floor(offsetWithSeconds) : Math.ceil(offsetWithSeconds);
    const prevHour = /* @__PURE__ */ new Date(+date);
    prevHour.setUTCHours(prevHour.getUTCHours() - 1);
    const systemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
    const prevHourSystemOffset = -(/* @__PURE__ */ new Date(+prevHour)).getTimezoneOffset();
    const systemDSTChange = systemOffset - prevHourSystemOffset;
    let systemOffsetForDiff = systemOffset;
    if (systemDSTChange && systemOffset !== offset4) {
      const systemHour = Date.prototype.getHours.apply(date);
      const expectedHour = Array.isArray(constructorArgs) ? constructorArgs[3] || 0 : date.internal.getUTCHours();
      if (systemHour !== expectedHour) {
        const testDate = /* @__PURE__ */ new Date(+date);
        const testOffsetDiff = systemOffset - offset4;
        if (testOffsetDiff) testDate.setUTCMinutes(testDate.getUTCMinutes() + testOffsetDiff);
        const testOffsetWithSeconds = tzOffset(date.timeZone, testDate);
        const testOffset = testOffsetWithSeconds > 0 ? Math.floor(testOffsetWithSeconds) : Math.ceil(testOffsetWithSeconds);
        if (testOffset === offset4) systemOffsetForDiff = prevHourSystemOffset;
      }
    }
    const offsetDiff = systemOffsetForDiff - offset4;
    if (offsetDiff)
      Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);
    const systemDate = /* @__PURE__ */ new Date(+date);
    systemDate.setUTCSeconds(0);
    const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
    const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;
    if (secondsOffset || systemSecondsOffset)
      Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
    const postOffsetWithSeconds = tzOffset(date.timeZone, date);
    const postOffset = postOffsetWithSeconds > 0 ? Math.floor(postOffsetWithSeconds) : Math.ceil(postOffsetWithSeconds);
    const postSystemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
    const postOffsetDiff = postSystemOffset - postOffset;
    const offsetChanged = postOffset !== offset4;
    const postDiff = postOffsetDiff - offsetDiff;
    const targetDSTShift = postOffset - offset4;
    const postOffsetCandidate = expectedInternalTime - postOffset * 60 * 1e3;
    const normalizedTargetDSTGap = targetDSTShift > 0 && targetInternalTime(date) - expectedInternalTime === targetDSTShift * 60 * 1e3 && targetInternalTime(date, postOffsetCandidate) !== expectedInternalTime;
    if (offsetChanged && postDiff && !normalizedTargetDSTGap) {
      Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);
      const newOffsetWithSeconds = tzOffset(date.timeZone, date);
      const newOffset = newOffsetWithSeconds > 0 ? Math.floor(newOffsetWithSeconds) : Math.ceil(newOffsetWithSeconds);
      const offsetChange = postOffset - newOffset;
      if (offsetChange && postDiff < 0) {
        Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);
      }
    }
    syncToInternal(date);
    const expectedTime = constructorArgs ? expectedInternalTime : expectedInternalTime + secondsOffset * 1e3;
    const drift = expectedTime - +date.internal;
    if (drift && Math.abs(drift) < 30 * 60 * 1e3) {
      Date.prototype.setTime.call(date, +date + drift);
      syncToInternal(date);
    }
  }
  function constructorArgsToInternalTime(args) {
    return Date.UTC(args[0], args.length > 1 ? args[1] : 0, args.length > 2 ? args[2] : 1, ...args.slice(3));
  }
  function targetInternalTime(date, time) {
    const internal = new Date(time ?? +date);
    internal.setUTCSeconds(internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, internal) * 60));
    return +internal;
  }

  // node_modules/@date-fns/tz/date/index.js
  var TZDate = class _TZDate extends TZDateMini {
    //#region static
    static tz(tz, ...args) {
      return args.length ? new _TZDate(...args, tz) : new _TZDate(Date.now(), tz);
    }
    //#endregion
    //#region representation
    toISOString() {
      const [sign, hours, minutes] = this.tzComponents();
      const tz = `${sign}${hours}:${minutes}`;
      return this.internal.toISOString().slice(0, -1) + tz;
    }
    toString() {
      return `${this.toDateString()} ${this.toTimeString()}`;
    }
    toDateString() {
      const [day, date, month, year] = this.internal.toUTCString().split(" ");
      return `${day?.slice(0, -1)} ${month} ${date} ${year}`;
    }
    toTimeString() {
      const time = this.internal.toUTCString().split(" ")[4];
      const [sign, hours, minutes] = this.tzComponents();
      return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;
    }
    toLocaleString(locales, options) {
      return Date.prototype.toLocaleString.call(this, locales, {
        ...options,
        timeZone: options?.timeZone || this.timeZone
      });
    }
    toLocaleDateString(locales, options) {
      return Date.prototype.toLocaleDateString.call(this, locales, {
        ...options,
        timeZone: options?.timeZone || this.timeZone
      });
    }
    toLocaleTimeString(locales, options) {
      return Date.prototype.toLocaleTimeString.call(this, locales, {
        ...options,
        timeZone: options?.timeZone || this.timeZone
      });
    }
    //#endregion
    //#region private
    tzComponents() {
      const offset4 = this.getTimezoneOffset();
      const sign = offset4 > 0 ? "-" : "+";
      const hours = String(Math.floor(Math.abs(offset4) / 60)).padStart(2, "0");
      const minutes = String(Math.abs(offset4) % 60).padStart(2, "0");
      return [sign, hours, minutes];
    }
    //#endregion
    withTimeZone(timeZone) {
      return new _TZDate(+this, timeZone);
    }
    //#region date-fns integration
    [/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
      return new _TZDate(+new Date(date), this.timeZone);
    }
    //#endregion
  };

  // node_modules/date-fns/constants.js
  var daysInYear = 365.2425;
  var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
  var minTime = -maxTime;
  var millisecondsInWeek = 6048e5;
  var millisecondsInDay = 864e5;
  var millisecondsInMinute = 6e4;
  var millisecondsInHour = 36e5;
  var millisecondsInSecond = 1e3;
  var secondsInHour = 3600;
  var secondsInDay = secondsInHour * 24;
  var secondsInWeek = secondsInDay * 7;
  var secondsInYear = secondsInDay * daysInYear;
  var secondsInMonth = secondsInYear / 12;
  var secondsInQuarter = secondsInMonth * 3;
  var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");

  // node_modules/date-fns/constructFrom.js
  function constructFrom(date, value) {
    if (typeof date === "function") return date(value);
    if (date && typeof date === "object" && constructFromSymbol in date)
      return date[constructFromSymbol](value);
    if (date instanceof Date) return new date.constructor(value);
    return new Date(value);
  }

  // node_modules/date-fns/toDate.js
  function toDate(argument, context) {
    return constructFrom(context || argument, argument);
  }

  // node_modules/date-fns/addDays.js
  function addDays(date, amount, options) {
    const _date = toDate(date, options?.in);
    if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
    if (!amount) return _date;
    _date.setDate(_date.getDate() + amount);
    return _date;
  }

  // node_modules/date-fns/addMonths.js
  function addMonths(date, amount, options) {
    const _date = toDate(date, options?.in);
    if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
    if (!amount) {
      return _date;
    }
    const dayOfMonth = _date.getDate();
    const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());
    endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
    const daysInMonth = endOfDesiredMonth.getDate();
    if (dayOfMonth >= daysInMonth) {
      return endOfDesiredMonth;
    } else {
      _date.setFullYear(
        endOfDesiredMonth.getFullYear(),
        endOfDesiredMonth.getMonth(),
        dayOfMonth
      );
      return _date;
    }
  }

  // node_modules/date-fns/_lib/defaultOptions.js
  var defaultOptions = {};
  function getDefaultOptions() {
    return defaultOptions;
  }

  // node_modules/date-fns/startOfWeek.js
  function startOfWeek(date, options) {
    const defaultOptions2 = getDefaultOptions();
    const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
    const _date = toDate(date, options?.in);
    const day = _date.getDay();
    const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
    _date.setDate(_date.getDate() - diff);
    _date.setHours(0, 0, 0, 0);
    return _date;
  }

  // node_modules/date-fns/startOfISOWeek.js
  function startOfISOWeek(date, options) {
    return startOfWeek(date, { ...options, weekStartsOn: 1 });
  }

  // node_modules/date-fns/getISOWeekYear.js
  function getISOWeekYear(date, options) {
    const _date = toDate(date, options?.in);
    const year = _date.getFullYear();
    const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
    fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
    fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
    const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
    const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
    fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
    fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
    const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
    if (_date.getTime() >= startOfNextYear.getTime()) {
      return year + 1;
    } else if (_date.getTime() >= startOfThisYear.getTime()) {
      return year;
    } else {
      return year - 1;
    }
  }

  // node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
  function getTimezoneOffsetInMilliseconds(date) {
    const _date = toDate(date);
    const utcDate = new Date(
      Date.UTC(
        _date.getFullYear(),
        _date.getMonth(),
        _date.getDate(),
        _date.getHours(),
        _date.getMinutes(),
        _date.getSeconds(),
        _date.getMilliseconds()
      )
    );
    utcDate.setUTCFullYear(_date.getFullYear());
    return +date - +utcDate;
  }

  // node_modules/date-fns/_lib/normalizeDates.js
  function normalizeDates(context, ...dates) {
    const normalize = constructFrom.bind(
      null,
      context || dates.find((date) => typeof date === "object")
    );
    return dates.map(normalize);
  }

  // node_modules/date-fns/startOfDay.js
  function startOfDay(date, options) {
    const _date = toDate(date, options?.in);
    _date.setHours(0, 0, 0, 0);
    return _date;
  }

  // node_modules/date-fns/differenceInCalendarDays.js
  function differenceInCalendarDays(laterDate, earlierDate, options) {
    const [laterDate_, earlierDate_] = normalizeDates(
      options?.in,
      laterDate,
      earlierDate
    );
    const laterStartOfDay = startOfDay(laterDate_);
    const earlierStartOfDay = startOfDay(earlierDate_);
    const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
    const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
    return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
  }

  // node_modules/date-fns/startOfISOWeekYear.js
  function startOfISOWeekYear(date, options) {
    const year = getISOWeekYear(date, options);
    const fourthOfJanuary = constructFrom(options?.in || date, 0);
    fourthOfJanuary.setFullYear(year, 0, 4);
    fourthOfJanuary.setHours(0, 0, 0, 0);
    return startOfISOWeek(fourthOfJanuary);
  }

  // node_modules/date-fns/addWeeks.js
  function addWeeks(date, amount, options) {
    return addDays(date, amount * 7, options);
  }

  // node_modules/date-fns/addYears.js
  function addYears(date, amount, options) {
    return addMonths(date, amount * 12, options);
  }

  // node_modules/date-fns/areIntervalsOverlapping.js
  function areIntervalsOverlapping(intervalLeft, intervalRight, options) {
    const [leftStartTime, leftEndTime] = [
      +toDate(intervalLeft.start, options?.in),
      +toDate(intervalLeft.end, options?.in)
    ].sort((a, b) => a - b);
    const [rightStartTime, rightEndTime] = [
      +toDate(intervalRight.start, options?.in),
      +toDate(intervalRight.end, options?.in)
    ].sort((a, b) => a - b);
    if (options?.inclusive)
      return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
    return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
  }

  // node_modules/date-fns/max.js
  function max2(dates, options) {
    let result;
    let context = options?.in;
    dates.forEach((date) => {
      if (!context && typeof date === "object")
        context = constructFrom.bind(null, date);
      const date_ = toDate(date, context);
      if (!result || result < date_ || isNaN(+date_)) result = date_;
    });
    return constructFrom(context, result || NaN);
  }

  // node_modules/date-fns/min.js
  function min2(dates, options) {
    let result;
    let context = options?.in;
    dates.forEach((date) => {
      if (!context && typeof date === "object")
        context = constructFrom.bind(null, date);
      const date_ = toDate(date, context);
      if (!result || result > date_ || isNaN(+date_)) result = date_;
    });
    return constructFrom(context, result || NaN);
  }

  // node_modules/date-fns/isSameDay.js
  function isSameDay(laterDate, earlierDate, options) {
    const [dateLeft_, dateRight_] = normalizeDates(
      options?.in,
      laterDate,
      earlierDate
    );
    return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
  }

  // node_modules/date-fns/isDate.js
  function isDate(value) {
    return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
  }

  // node_modules/date-fns/isValid.js
  function isValid(date) {
    return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
  }

  // node_modules/date-fns/differenceInCalendarMonths.js
  function differenceInCalendarMonths(laterDate, earlierDate, options) {
    const [laterDate_, earlierDate_] = normalizeDates(
      options?.in,
      laterDate,
      earlierDate
    );
    const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
    const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
    return yearsDiff * 12 + monthsDiff;
  }

  // node_modules/date-fns/endOfMonth.js
  function endOfMonth(date, options) {
    const _date = toDate(date, options?.in);
    const month = _date.getMonth();
    _date.setFullYear(_date.getFullYear(), month + 1, 0);
    _date.setHours(23, 59, 59, 999);
    return _date;
  }

  // node_modules/date-fns/_lib/normalizeInterval.js
  function normalizeInterval(context, interval) {
    const [start, end] = normalizeDates(context, interval.start, interval.end);
    return { start, end };
  }

  // node_modules/date-fns/eachMonthOfInterval.js
  function eachMonthOfInterval(interval, options) {
    const { start, end } = normalizeInterval(options?.in, interval);
    let reversed = +start > +end;
    const endTime = reversed ? +start : +end;
    const date = reversed ? end : start;
    date.setHours(0, 0, 0, 0);
    date.setDate(1);
    let step = options?.step ?? 1;
    if (!step) return [];
    if (step < 0) {
      step = -step;
      reversed = !reversed;
    }
    const dates = [];
    while (+date <= endTime) {
      dates.push(constructFrom(start, date));
      date.setMonth(date.getMonth() + step);
    }
    return reversed ? dates.reverse() : dates;
  }

  // node_modules/date-fns/startOfMonth.js
  function startOfMonth(date, options) {
    const _date = toDate(date, options?.in);
    _date.setDate(1);
    _date.setHours(0, 0, 0, 0);
    return _date;
  }

  // node_modules/date-fns/endOfYear.js
  function endOfYear(date, options) {
    const _date = toDate(date, options?.in);
    const year = _date.getFullYear();
    _date.setFullYear(year + 1, 0, 0);
    _date.setHours(23, 59, 59, 999);
    return _date;
  }

  // node_modules/date-fns/startOfYear.js
  function startOfYear(date, options) {
    const date_ = toDate(date, options?.in);
    date_.setFullYear(date_.getFullYear(), 0, 1);
    date_.setHours(0, 0, 0, 0);
    return date_;
  }

  // node_modules/date-fns/eachYearOfInterval.js
  function eachYearOfInterval(interval, options) {
    const { start, end } = normalizeInterval(options?.in, interval);
    let reversed = +start > +end;
    const endTime = reversed ? +start : +end;
    const date = reversed ? end : start;
    date.setHours(0, 0, 0, 0);
    date.setMonth(0, 1);
    let step = options?.step ?? 1;
    if (!step) return [];
    if (step < 0) {
      step = -step;
      reversed = !reversed;
    }
    const dates = [];
    while (+date <= endTime) {
      dates.push(constructFrom(start, date));
      date.setFullYear(date.getFullYear() + step);
    }
    return reversed ? dates.reverse() : dates;
  }

  // node_modules/date-fns/endOfWeek.js
  function endOfWeek(date, options) {
    const defaultOptions2 = getDefaultOptions();
    const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
    const _date = toDate(date, options?.in);
    const day = _date.getDay();
    const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
    _date.setDate(_date.getDate() + diff);
    _date.setHours(23, 59, 59, 999);
    return _date;
  }

  // node_modules/date-fns/endOfISOWeek.js
  function endOfISOWeek(date, options) {
    return endOfWeek(date, { ...options, weekStartsOn: 1 });
  }

  // node_modules/date-fns/locale/en-US/_lib/formatDistance.js
  var formatDistanceLocale = {
    lessThanXSeconds: {
      one: "less than a second",
      other: "less than {{count}} seconds"
    },
    xSeconds: {
      one: "1 second",
      other: "{{count}} seconds"
    },
    halfAMinute: "half a minute",
    lessThanXMinutes: {
      one: "less than a minute",
      other: "less than {{count}} minutes"
    },
    xMinutes: {
      one: "1 minute",
      other: "{{count}} minutes"
    },
    aboutXHours: {
      one: "about 1 hour",
      other: "about {{count}} hours"
    },
    xHours: {
      one: "1 hour",
      other: "{{count}} hours"
    },
    xDays: {
      one: "1 day",
      other: "{{count}} days"
    },
    aboutXWeeks: {
      one: "about 1 week",
      other: "about {{count}} weeks"
    },
    xWeeks: {
      one: "1 week",
      other: "{{count}} weeks"
    },
    aboutXMonths: {
      one: "about 1 month",
      other: "about {{count}} months"
    },
    xMonths: {
      one: "1 month",
      other: "{{count}} months"
    },
    aboutXYears: {
      one: "about 1 year",
      other: "about {{count}} years"
    },
    xYears: {
      one: "1 year",
      other: "{{count}} years"
    },
    overXYears: {
      one: "over 1 year",
      other: "over {{count}} years"
    },
    almostXYears: {
      one: "almost 1 year",
      other: "almost {{count}} years"
    }
  };
  var formatDistance = (token, count, options) => {
    let result;
    const tokenValue = formatDistanceLocale[token];
    if (typeof tokenValue === "string") {
      result = tokenValue;
    } else if (count === 1) {
      result = tokenValue.one;
    } else {
      result = tokenValue.other.replace("{{count}}", count.toString());
    }
    if (options?.addSuffix) {
      if (options.comparison && options.comparison > 0) {
        return "in " + result;
      } else {
        return result + " ago";
      }
    }
    return result;
  };

  // node_modules/date-fns/locale/_lib/buildFormatLongFn.js
  function buildFormatLongFn(args) {
    return (options = {}) => {
      const width = options.width ? String(options.width) : args.defaultWidth;
      const format7 = args.formats[width] || args.formats[args.defaultWidth];
      return format7;
    };
  }

  // node_modules/date-fns/locale/en-US/_lib/formatLong.js
  var dateFormats = {
    full: "EEEE, MMMM do, y",
    long: "MMMM do, y",
    medium: "MMM d, y",
    short: "MM/dd/yyyy"
  };
  var timeFormats = {
    full: "h:mm:ss a zzzz",
    long: "h:mm:ss a z",
    medium: "h:mm:ss a",
    short: "h:mm a"
  };
  var dateTimeFormats = {
    full: "{{date}} 'at' {{time}}",
    long: "{{date}} 'at' {{time}}",
    medium: "{{date}}, {{time}}",
    short: "{{date}}, {{time}}"
  };
  var formatLong = {
    date: buildFormatLongFn({
      formats: dateFormats,
      defaultWidth: "full"
    }),
    time: buildFormatLongFn({
      formats: timeFormats,
      defaultWidth: "full"
    }),
    dateTime: buildFormatLongFn({
      formats: dateTimeFormats,
      defaultWidth: "full"
    })
  };

  // node_modules/date-fns/locale/en-US/_lib/formatRelative.js
  var formatRelativeLocale = {
    lastWeek: "'last' eeee 'at' p",
    yesterday: "'yesterday at' p",
    today: "'today at' p",
    tomorrow: "'tomorrow at' p",
    nextWeek: "eeee 'at' p",
    other: "P"
  };
  var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];

  // node_modules/date-fns/locale/_lib/buildLocalizeFn.js
  function buildLocalizeFn(args) {
    return (value, options) => {
      const context = options?.context ? String(options.context) : "standalone";
      let valuesArray;
      if (context === "formatting" && args.formattingValues) {
        const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
        const width = options?.width ? String(options.width) : defaultWidth;
        valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
      } else {
        const defaultWidth = args.defaultWidth;
        const width = options?.width ? String(options.width) : args.defaultWidth;
        valuesArray = args.values[width] || args.values[defaultWidth];
      }
      const index2 = args.argumentCallback ? args.argumentCallback(value) : value;
      return valuesArray[index2];
    };
  }

  // node_modules/date-fns/locale/en-US/_lib/localize.js
  var eraValues = {
    narrow: ["B", "A"],
    abbreviated: ["BC", "AD"],
    wide: ["Before Christ", "Anno Domini"]
  };
  var quarterValues = {
    narrow: ["1", "2", "3", "4"],
    abbreviated: ["Q1", "Q2", "Q3", "Q4"],
    wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
  };
  var monthValues = {
    narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
    abbreviated: [
      "Jan",
      "Feb",
      "Mar",
      "Apr",
      "May",
      "Jun",
      "Jul",
      "Aug",
      "Sep",
      "Oct",
      "Nov",
      "Dec"
    ],
    wide: [
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
      "September",
      "October",
      "November",
      "December"
    ]
  };
  var dayValues = {
    narrow: ["S", "M", "T", "W", "T", "F", "S"],
    short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
    abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    wide: [
      "Sunday",
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday",
      "Saturday"
    ]
  };
  var dayPeriodValues = {
    narrow: {
      am: "a",
      pm: "p",
      midnight: "mi",
      noon: "n",
      morning: "morning",
      afternoon: "afternoon",
      evening: "evening",
      night: "night"
    },
    abbreviated: {
      am: "AM",
      pm: "PM",
      midnight: "midnight",
      noon: "noon",
      morning: "morning",
      afternoon: "afternoon",
      evening: "evening",
      night: "night"
    },
    wide: {
      am: "a.m.",
      pm: "p.m.",
      midnight: "midnight",
      noon: "noon",
      morning: "morning",
      afternoon: "afternoon",
      evening: "evening",
      night: "night"
    }
  };
  var formattingDayPeriodValues = {
    narrow: {
      am: "a",
      pm: "p",
      midnight: "mi",
      noon: "n",
      morning: "in the morning",
      afternoon: "in the afternoon",
      evening: "in the evening",
      night: "at night"
    },
    abbreviated: {
      am: "AM",
      pm: "PM",
      midnight: "midnight",
      noon: "noon",
      morning: "in the morning",
      afternoon: "in the afternoon",
      evening: "in the evening",
      night: "at night"
    },
    wide: {
      am: "a.m.",
      pm: "p.m.",
      midnight: "midnight",
      noon: "noon",
      morning: "in the morning",
      afternoon: "in the afternoon",
      evening: "in the evening",
      night: "at night"
    }
  };
  var ordinalNumber = (dirtyNumber, _options) => {
    const number = Number(dirtyNumber);
    const rem100 = number % 100;
    if (rem100 > 20 || rem100 < 10) {
      switch (rem100 % 10) {
        case 1:
          return number + "st";
        case 2:
          return number + "nd";
        case 3:
          return number + "rd";
      }
    }
    return number + "th";
  };
  var localize = {
    ordinalNumber,
    era: buildLocalizeFn({
      values: eraValues,
      defaultWidth: "wide"
    }),
    quarter: buildLocalizeFn({
      values: quarterValues,
      defaultWidth: "wide",
      argumentCallback: (quarter) => quarter - 1
    }),
    month: buildLocalizeFn({
      values: monthValues,
      defaultWidth: "wide"
    }),
    day: buildLocalizeFn({
      values: dayValues,
      defaultWidth: "wide"
    }),
    dayPeriod: buildLocalizeFn({
      values: dayPeriodValues,
      defaultWidth: "wide",
      formattingValues: formattingDayPeriodValues,
      defaultFormattingWidth: "wide"
    })
  };

  // node_modules/date-fns/locale/_lib/buildMatchFn.js
  function buildMatchFn(args) {
    return (string, options = {}) => {
      const width = options.width;
      const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
      const matchResult = string.match(matchPattern);
      if (!matchResult) {
        return null;
      }
      const matchedString = matchResult[0];
      const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
      const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
        // [TODO] -- I challenge you to fix the type
        findKey(parsePatterns, (pattern) => pattern.test(matchedString))
      );
      let value;
      value = args.valueCallback ? args.valueCallback(key) : key;
      value = options.valueCallback ? (
        // [TODO] -- I challenge you to fix the type
        options.valueCallback(value)
      ) : value;
      const rest = string.slice(matchedString.length);
      return { value, rest };
    };
  }
  function findKey(object, predicate) {
    for (const key in object) {
      if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
        return key;
      }
    }
    return void 0;
  }
  function findIndex(array, predicate) {
    for (let key = 0; key < array.length; key++) {
      if (predicate(array[key])) {
        return key;
      }
    }
    return void 0;
  }

  // node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
  function buildMatchPatternFn(args) {
    return (string, options = {}) => {
      const matchResult = string.match(args.matchPattern);
      if (!matchResult) return null;
      const matchedString = matchResult[0];
      const parseResult = string.match(args.parsePattern);
      if (!parseResult) return null;
      let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
      value = options.valueCallback ? options.valueCallback(value) : value;
      const rest = string.slice(matchedString.length);
      return { value, rest };
    };
  }

  // node_modules/date-fns/locale/en-US/_lib/match.js
  var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
  var parseOrdinalNumberPattern = /\d+/i;
  var matchEraPatterns = {
    narrow: /^(b|a)/i,
    abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
    wide: /^(before christ|before common era|anno domini|common era)/i
  };
  var parseEraPatterns = {
    any: [/^b/i, /^(a|c)/i]
  };
  var matchQuarterPatterns = {
    narrow: /^[1234]/i,
    abbreviated: /^q[1234]/i,
    wide: /^[1234](th|st|nd|rd)? quarter/i
  };
  var parseQuarterPatterns = {
    any: [/1/i, /2/i, /3/i, /4/i]
  };
  var matchMonthPatterns = {
    narrow: /^[jfmasond]/i,
    abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
    wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
  };
  var parseMonthPatterns = {
    narrow: [
      /^j/i,
      /^f/i,
      /^m/i,
      /^a/i,
      /^m/i,
      /^j/i,
      /^j/i,
      /^a/i,
      /^s/i,
      /^o/i,
      /^n/i,
      /^d/i
    ],
    any: [
      /^ja/i,
      /^f/i,
      /^mar/i,
      /^ap/i,
      /^may/i,
      /^jun/i,
      /^jul/i,
      /^au/i,
      /^s/i,
      /^o/i,
      /^n/i,
      /^d/i
    ]
  };
  var matchDayPatterns = {
    narrow: /^[smtwf]/i,
    short: /^(su|mo|tu|we|th|fr|sa)/i,
    abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
    wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
  };
  var parseDayPatterns = {
    narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
    any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
  };
  var matchDayPeriodPatterns = {
    narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
    any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
  };
  var parseDayPeriodPatterns = {
    any: {
      am: /^a/i,
      pm: /^p/i,
      midnight: /^mi/i,
      noon: /^no/i,
      morning: /morning/i,
      afternoon: /afternoon/i,
      evening: /evening/i,
      night: /night/i
    }
  };
  var match = {
    ordinalNumber: buildMatchPatternFn({
      matchPattern: matchOrdinalNumberPattern,
      parsePattern: parseOrdinalNumberPattern,
      valueCallback: (value) => parseInt(value, 10)
    }),
    era: buildMatchFn({
      matchPatterns: matchEraPatterns,
      defaultMatchWidth: "wide",
      parsePatterns: parseEraPatterns,
      defaultParseWidth: "any"
    }),
    quarter: buildMatchFn({
      matchPatterns: matchQuarterPatterns,
      defaultMatchWidth: "wide",
      parsePatterns: parseQuarterPatterns,
      defaultParseWidth: "any",
      valueCallback: (index2) => index2 + 1
    }),
    month: buildMatchFn({
      matchPatterns: matchMonthPatterns,
      defaultMatchWidth: "wide",
      parsePatterns: parseMonthPatterns,
      defaultParseWidth: "any"
    }),
    day: buildMatchFn({
      matchPatterns: matchDayPatterns,
      defaultMatchWidth: "wide",
      parsePatterns: parseDayPatterns,
      defaultParseWidth: "any"
    }),
    dayPeriod: buildMatchFn({
      matchPatterns: matchDayPeriodPatterns,
      defaultMatchWidth: "any",
      parsePatterns: parseDayPeriodPatterns,
      defaultParseWidth: "any"
    })
  };

  // node_modules/date-fns/locale/en-US.js
  var enUS = {
    code: "en-US",
    formatDistance,
    formatLong,
    formatRelative,
    localize,
    match,
    options: {
      weekStartsOn: 0,
      firstWeekContainsDate: 1
    }
  };

  // node_modules/date-fns/getDayOfYear.js
  function getDayOfYear(date, options) {
    const _date = toDate(date, options?.in);
    const diff = differenceInCalendarDays(_date, startOfYear(_date));
    const dayOfYear = diff + 1;
    return dayOfYear;
  }

  // node_modules/date-fns/getISOWeek.js
  function getISOWeek(date, options) {
    const _date = toDate(date, options?.in);
    const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
    return Math.round(diff / millisecondsInWeek) + 1;
  }

  // node_modules/date-fns/getWeekYear.js
  function getWeekYear(date, options) {
    const _date = toDate(date, options?.in);
    const year = _date.getFullYear();
    const defaultOptions2 = getDefaultOptions();
    const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
    const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
    firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
    firstWeekOfNextYear.setHours(0, 0, 0, 0);
    const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
    const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
    firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
    firstWeekOfThisYear.setHours(0, 0, 0, 0);
    const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
    if (+_date >= +startOfNextYear) {
      return year + 1;
    } else if (+_date >= +startOfThisYear) {
      return year;
    } else {
      return year - 1;
    }
  }

  // node_modules/date-fns/startOfWeekYear.js
  function startOfWeekYear(date, options) {
    const defaultOptions2 = getDefaultOptions();
    const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
    const year = getWeekYear(date, options);
    const firstWeek = constructFrom(options?.in || date, 0);
    firstWeek.setFullYear(year, 0, firstWeekContainsDate);
    firstWeek.setHours(0, 0, 0, 0);
    const _date = startOfWeek(firstWeek, options);
    return _date;
  }

  // node_modules/date-fns/getWeek.js
  function getWeek(date, options) {
    const _date = toDate(date, options?.in);
    const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
    return Math.round(diff / millisecondsInWeek) + 1;
  }

  // node_modules/date-fns/_lib/addLeadingZeros.js
  function addLeadingZeros(number, targetLength) {
    const sign = number < 0 ? "-" : "";
    const output = Math.abs(number).toString().padStart(targetLength, "0");
    return sign + output;
  }

  // node_modules/date-fns/_lib/format/lightFormatters.js
  var lightFormatters = {
    // Year
    y(date, token) {
      const signedYear = date.getFullYear();
      const year = signedYear > 0 ? signedYear : 1 - signedYear;
      return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
    },
    // Month
    M(date, token) {
      const month = date.getMonth();
      return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
    },
    // Day of the month
    d(date, token) {
      return addLeadingZeros(date.getDate(), token.length);
    },
    // AM or PM
    a(date, token) {
      const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
      switch (token) {
        case "a":
        case "aa":
          return dayPeriodEnumValue.toUpperCase();
        case "aaa":
          return dayPeriodEnumValue;
        case "aaaaa":
          return dayPeriodEnumValue[0];
        case "aaaa":
        default:
          return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
      }
    },
    // Hour [1-12]
    h(date, token) {
      return addLeadingZeros(date.getHours() % 12 || 12, token.length);
    },
    // Hour [0-23]
    H(date, token) {
      return addLeadingZeros(date.getHours(), token.length);
    },
    // Minute
    m(date, token) {
      return addLeadingZeros(date.getMinutes(), token.length);
    },
    // Second
    s(date, token) {
      return addLeadingZeros(date.getSeconds(), token.length);
    },
    // Fraction of second
    S(date, token) {
      const numberOfDigits = token.length;
      const milliseconds = date.getMilliseconds();
      const fractionalSeconds = Math.trunc(
        milliseconds * Math.pow(10, numberOfDigits - 3)
      );
      return addLeadingZeros(fractionalSeconds, token.length);
    }
  };

  // node_modules/date-fns/_lib/format/formatters.js
  var dayPeriodEnum = {
    am: "am",
    pm: "pm",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  };
  var formatters = {
    // Era
    G: function(date, token, localize2) {
      const era = date.getFullYear() > 0 ? 1 : 0;
      switch (token) {
        // AD, BC
        case "G":
        case "GG":
        case "GGG":
          return localize2.era(era, { width: "abbreviated" });
        // A, B
        case "GGGGG":
          return localize2.era(era, { width: "narrow" });
        // Anno Domini, Before Christ
        case "GGGG":
        default:
          return localize2.era(era, { width: "wide" });
      }
    },
    // Year
    y: function(date, token, localize2) {
      if (token === "yo") {
        const signedYear = date.getFullYear();
        const year = signedYear > 0 ? signedYear : 1 - signedYear;
        return localize2.ordinalNumber(year, { unit: "year" });
      }
      return lightFormatters.y(date, token);
    },
    // Local week-numbering year
    Y: function(date, token, localize2, options) {
      const signedWeekYear = getWeekYear(date, options);
      const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
      if (token === "YY") {
        const twoDigitYear = weekYear % 100;
        return addLeadingZeros(twoDigitYear, 2);
      }
      if (token === "Yo") {
        return localize2.ordinalNumber(weekYear, { unit: "year" });
      }
      return addLeadingZeros(weekYear, token.length);
    },
    // ISO week-numbering year
    R: function(date, token) {
      const isoWeekYear = getISOWeekYear(date);
      return addLeadingZeros(isoWeekYear, token.length);
    },
    // Extended year. This is a single number designating the year of this calendar system.
    // The main difference between `y` and `u` localizers are B.C. years:
    // | Year | `y` | `u` |
    // |------|-----|-----|
    // | AC 1 |   1 |   1 |
    // | BC 1 |   1 |   0 |
    // | BC 2 |   2 |  -1 |
    // Also `yy` always returns the last two digits of a year,
    // while `uu` pads single digit years to 2 characters and returns other years unchanged.
    u: function(date, token) {
      const year = date.getFullYear();
      return addLeadingZeros(year, token.length);
    },
    // Quarter
    Q: function(date, token, localize2) {
      const quarter = Math.ceil((date.getMonth() + 1) / 3);
      switch (token) {
        // 1, 2, 3, 4
        case "Q":
          return String(quarter);
        // 01, 02, 03, 04
        case "QQ":
          return addLeadingZeros(quarter, 2);
        // 1st, 2nd, 3rd, 4th
        case "Qo":
          return localize2.ordinalNumber(quarter, { unit: "quarter" });
        // Q1, Q2, Q3, Q4
        case "QQQ":
          return localize2.quarter(quarter, {
            width: "abbreviated",
            context: "formatting"
          });
        // 1, 2, 3, 4 (narrow quarter; could be not numerical)
        case "QQQQQ":
          return localize2.quarter(quarter, {
            width: "narrow",
            context: "formatting"
          });
        // 1st quarter, 2nd quarter, ...
        case "QQQQ":
        default:
          return localize2.quarter(quarter, {
            width: "wide",
            context: "formatting"
          });
      }
    },
    // Stand-alone quarter
    q: function(date, token, localize2) {
      const quarter = Math.ceil((date.getMonth() + 1) / 3);
      switch (token) {
        // 1, 2, 3, 4
        case "q":
          return String(quarter);
        // 01, 02, 03, 04
        case "qq":
          return addLeadingZeros(quarter, 2);
        // 1st, 2nd, 3rd, 4th
        case "qo":
          return localize2.ordinalNumber(quarter, { unit: "quarter" });
        // Q1, Q2, Q3, Q4
        case "qqq":
          return localize2.quarter(quarter, {
            width: "abbreviated",
            context: "standalone"
          });
        // 1, 2, 3, 4 (narrow quarter; could be not numerical)
        case "qqqqq":
          return localize2.quarter(quarter, {
            width: "narrow",
            context: "standalone"
          });
        // 1st quarter, 2nd quarter, ...
        case "qqqq":
        default:
          return localize2.quarter(quarter, {
            width: "wide",
            context: "standalone"
          });
      }
    },
    // Month
    M: function(date, token, localize2) {
      const month = date.getMonth();
      switch (token) {
        case "M":
        case "MM":
          return lightFormatters.M(date, token);
        // 1st, 2nd, ..., 12th
        case "Mo":
          return localize2.ordinalNumber(month + 1, { unit: "month" });
        // Jan, Feb, ..., Dec
        case "MMM":
          return localize2.month(month, {
            width: "abbreviated",
            context: "formatting"
          });
        // J, F, ..., D
        case "MMMMM":
          return localize2.month(month, {
            width: "narrow",
            context: "formatting"
          });
        // January, February, ..., December
        case "MMMM":
        default:
          return localize2.month(month, { width: "wide", context: "formatting" });
      }
    },
    // Stand-alone month
    L: function(date, token, localize2) {
      const month = date.getMonth();
      switch (token) {
        // 1, 2, ..., 12
        case "L":
          return String(month + 1);
        // 01, 02, ..., 12
        case "LL":
          return addLeadingZeros(month + 1, 2);
        // 1st, 2nd, ..., 12th
        case "Lo":
          return localize2.ordinalNumber(month + 1, { unit: "month" });
        // Jan, Feb, ..., Dec
        case "LLL":
          return localize2.month(month, {
            width: "abbreviated",
            context: "standalone"
          });
        // J, F, ..., D
        case "LLLLL":
          return localize2.month(month, {
            width: "narrow",
            context: "standalone"
          });
        // January, February, ..., December
        case "LLLL":
        default:
          return localize2.month(month, { width: "wide", context: "standalone" });
      }
    },
    // Local week of year
    w: function(date, token, localize2, options) {
      const week = getWeek(date, options);
      if (token === "wo") {
        return localize2.ordinalNumber(week, { unit: "week" });
      }
      return addLeadingZeros(week, token.length);
    },
    // ISO week of year
    I: function(date, token, localize2) {
      const isoWeek = getISOWeek(date);
      if (token === "Io") {
        return localize2.ordinalNumber(isoWeek, { unit: "week" });
      }
      return addLeadingZeros(isoWeek, token.length);
    },
    // Day of the month
    d: function(date, token, localize2) {
      if (token === "do") {
        return localize2.ordinalNumber(date.getDate(), { unit: "date" });
      }
      return lightFormatters.d(date, token);
    },
    // Day of year
    D: function(date, token, localize2) {
      const dayOfYear = getDayOfYear(date);
      if (token === "Do") {
        return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
      }
      return addLeadingZeros(dayOfYear, token.length);
    },
    // Day of week
    E: function(date, token, localize2) {
      const dayOfWeek = date.getDay();
      switch (token) {
        // Tue
        case "E":
        case "EE":
        case "EEE":
          return localize2.day(dayOfWeek, {
            width: "abbreviated",
            context: "formatting"
          });
        // T
        case "EEEEE":
          return localize2.day(dayOfWeek, {
            width: "narrow",
            context: "formatting"
          });
        // Tu
        case "EEEEEE":
          return localize2.day(dayOfWeek, {
            width: "short",
            context: "formatting"
          });
        // Tuesday
        case "EEEE":
        default:
          return localize2.day(dayOfWeek, {
            width: "wide",
            context: "formatting"
          });
      }
    },
    // Local day of week
    e: function(date, token, localize2, options) {
      const dayOfWeek = date.getDay();
      const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
      switch (token) {
        // Numerical value (Nth day of week with current locale or weekStartsOn)
        case "e":
          return String(localDayOfWeek);
        // Padded numerical value
        case "ee":
          return addLeadingZeros(localDayOfWeek, 2);
        // 1st, 2nd, ..., 7th
        case "eo":
          return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
        case "eee":
          return localize2.day(dayOfWeek, {
            width: "abbreviated",
            context: "formatting"
          });
        // T
        case "eeeee":
          return localize2.day(dayOfWeek, {
            width: "narrow",
            context: "formatting"
          });
        // Tu
        case "eeeeee":
          return localize2.day(dayOfWeek, {
            width: "short",
            context: "formatting"
          });
        // Tuesday
        case "eeee":
        default:
          return localize2.day(dayOfWeek, {
            width: "wide",
            context: "formatting"
          });
      }
    },
    // Stand-alone local day of week
    c: function(date, token, localize2, options) {
      const dayOfWeek = date.getDay();
      const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
      switch (token) {
        // Numerical value (same as in `e`)
        case "c":
          return String(localDayOfWeek);
        // Padded numerical value
        case "cc":
          return addLeadingZeros(localDayOfWeek, token.length);
        // 1st, 2nd, ..., 7th
        case "co":
          return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
        case "ccc":
          return localize2.day(dayOfWeek, {
            width: "abbreviated",
            context: "standalone"
          });
        // T
        case "ccccc":
          return localize2.day(dayOfWeek, {
            width: "narrow",
            context: "standalone"
          });
        // Tu
        case "cccccc":
          return localize2.day(dayOfWeek, {
            width: "short",
            context: "standalone"
          });
        // Tuesday
        case "cccc":
        default:
          return localize2.day(dayOfWeek, {
            width: "wide",
            context: "standalone"
          });
      }
    },
    // ISO day of week
    i: function(date, token, localize2) {
      const dayOfWeek = date.getDay();
      const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
      switch (token) {
        // 2
        case "i":
          return String(isoDayOfWeek);
        // 02
        case "ii":
          return addLeadingZeros(isoDayOfWeek, token.length);
        // 2nd
        case "io":
          return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
        // Tue
        case "iii":
          return localize2.day(dayOfWeek, {
            width: "abbreviated",
            context: "formatting"
          });
        // T
        case "iiiii":
          return localize2.day(dayOfWeek, {
            width: "narrow",
            context: "formatting"
          });
        // Tu
        case "iiiiii":
          return localize2.day(dayOfWeek, {
            width: "short",
            context: "formatting"
          });
        // Tuesday
        case "iiii":
        default:
          return localize2.day(dayOfWeek, {
            width: "wide",
            context: "formatting"
          });
      }
    },
    // AM or PM
    a: function(date, token, localize2) {
      const hours = date.getHours();
      const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
      switch (token) {
        case "a":
        case "aa":
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "abbreviated",
            context: "formatting"
          });
        case "aaa":
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "abbreviated",
            context: "formatting"
          }).toLowerCase();
        case "aaaaa":
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "narrow",
            context: "formatting"
          });
        case "aaaa":
        default:
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "wide",
            context: "formatting"
          });
      }
    },
    // AM, PM, midnight, noon
    b: function(date, token, localize2) {
      const hours = date.getHours();
      let dayPeriodEnumValue;
      if (hours === 12) {
        dayPeriodEnumValue = dayPeriodEnum.noon;
      } else if (hours === 0) {
        dayPeriodEnumValue = dayPeriodEnum.midnight;
      } else {
        dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
      }
      switch (token) {
        case "b":
        case "bb":
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "abbreviated",
            context: "formatting"
          });
        case "bbb":
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "abbreviated",
            context: "formatting"
          }).toLowerCase();
        case "bbbbb":
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbb":
        default:
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "wide",
            context: "formatting"
          });
      }
    },
    // in the morning, in the afternoon, in the evening, at night
    B: function(date, token, localize2) {
      const hours = date.getHours();
      let dayPeriodEnumValue;
      if (hours >= 17) {
        dayPeriodEnumValue = dayPeriodEnum.evening;
      } else if (hours >= 12) {
        dayPeriodEnumValue = dayPeriodEnum.afternoon;
      } else if (hours >= 4) {
        dayPeriodEnumValue = dayPeriodEnum.morning;
      } else {
        dayPeriodEnumValue = dayPeriodEnum.night;
      }
      switch (token) {
        case "B":
        case "BB":
        case "BBB":
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "abbreviated",
            context: "formatting"
          });
        case "BBBBB":
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBB":
        default:
          return localize2.dayPeriod(dayPeriodEnumValue, {
            width: "wide",
            context: "formatting"
          });
      }
    },
    // Hour [1-12]
    h: function(date, token, localize2) {
      if (token === "ho") {
        let hours = date.getHours() % 12;
        if (hours === 0) hours = 12;
        return localize2.ordinalNumber(hours, { unit: "hour" });
      }
      return lightFormatters.h(date, token);
    },
    // Hour [0-23]
    H: function(date, token, localize2) {
      if (token === "Ho") {
        return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
      }
      return lightFormatters.H(date, token);
    },
    // Hour [0-11]
    K: function(date, token, localize2) {
      const hours = date.getHours() % 12;
      if (token === "Ko") {
        return localize2.ordinalNumber(hours, { unit: "hour" });
      }
      return addLeadingZeros(hours, token.length);
    },
    // Hour [1-24]
    k: function(date, token, localize2) {
      let hours = date.getHours();
      if (hours === 0) hours = 24;
      if (token === "ko") {
        return localize2.ordinalNumber(hours, { unit: "hour" });
      }
      return addLeadingZeros(hours, token.length);
    },
    // Minute
    m: function(date, token, localize2) {
      if (token === "mo") {
        return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
      }
      return lightFormatters.m(date, token);
    },
    // Second
    s: function(date, token, localize2) {
      if (token === "so") {
        return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
      }
      return lightFormatters.s(date, token);
    },
    // Fraction of second
    S: function(date, token) {
      return lightFormatters.S(date, token);
    },
    // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
    X: function(date, token, _localize) {
      const timezoneOffset = date.getTimezoneOffset();
      if (timezoneOffset === 0) {
        return "Z";
      }
      switch (token) {
        // Hours and optional minutes
        case "X":
          return formatTimezoneWithOptionalMinutes(timezoneOffset);
        // Hours, minutes and optional seconds without `:` delimiter
        // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
        // so this token always has the same output as `XX`
        case "XXXX":
        case "XX":
          return formatTimezone(timezoneOffset);
        // Hours, minutes and optional seconds with `:` delimiter
        // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
        // so this token always has the same output as `XXX`
        case "XXXXX":
        case "XXX":
        // Hours and minutes with `:` delimiter
        default:
          return formatTimezone(timezoneOffset, ":");
      }
    },
    // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
    x: function(date, token, _localize) {
      const timezoneOffset = date.getTimezoneOffset();
      switch (token) {
        // Hours and optional minutes
        case "x":
          return formatTimezoneWithOptionalMinutes(timezoneOffset);
        // Hours, minutes and optional seconds without `:` delimiter
        // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
        // so this token always has the same output as `xx`
        case "xxxx":
        case "xx":
          return formatTimezone(timezoneOffset);
        // Hours, minutes and optional seconds with `:` delimiter
        // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
        // so this token always has the same output as `xxx`
        case "xxxxx":
        case "xxx":
        // Hours and minutes with `:` delimiter
        default:
          return formatTimezone(timezoneOffset, ":");
      }
    },
    // Timezone (GMT)
    O: function(date, token, _localize) {
      const timezoneOffset = date.getTimezoneOffset();
      switch (token) {
        // Short
        case "O":
        case "OO":
        case "OOO":
          return "GMT" + formatTimezoneShort(timezoneOffset, ":");
        // Long
        case "OOOO":
        default:
          return "GMT" + formatTimezone(timezoneOffset, ":");
      }
    },
    // Timezone (specific non-location)
    z: function(date, token, _localize) {
      const timezoneOffset = date.getTimezoneOffset();
      switch (token) {
        // Short
        case "z":
        case "zz":
        case "zzz":
          return "GMT" + formatTimezoneShort(timezoneOffset, ":");
        // Long
        case "zzzz":
        default:
          return "GMT" + formatTimezone(timezoneOffset, ":");
      }
    },
    // Seconds timestamp
    t: function(date, token, _localize) {
      const timestamp = Math.trunc(+date / 1e3);
      return addLeadingZeros(timestamp, token.length);
    },
    // Milliseconds timestamp
    T: function(date, token, _localize) {
      return addLeadingZeros(+date, token.length);
    }
  };
  function formatTimezoneShort(offset4, delimiter = "") {
    const sign = offset4 > 0 ? "-" : "+";
    const absOffset = Math.abs(offset4);
    const hours = Math.trunc(absOffset / 60);
    const minutes = absOffset % 60;
    if (minutes === 0) {
      return sign + String(hours);
    }
    return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
  }
  function formatTimezoneWithOptionalMinutes(offset4, delimiter) {
    if (offset4 % 60 === 0) {
      const sign = offset4 > 0 ? "-" : "+";
      return sign + addLeadingZeros(Math.abs(offset4) / 60, 2);
    }
    return formatTimezone(offset4, delimiter);
  }
  function formatTimezone(offset4, delimiter = "") {
    const sign = offset4 > 0 ? "-" : "+";
    const absOffset = Math.abs(offset4);
    const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
    const minutes = addLeadingZeros(absOffset % 60, 2);
    return sign + hours + delimiter + minutes;
  }

  // node_modules/date-fns/_lib/format/longFormatters.js
  var dateLongFormatter = (pattern, formatLong2) => {
    switch (pattern) {
      case "P":
        return formatLong2.date({ width: "short" });
      case "PP":
        return formatLong2.date({ width: "medium" });
      case "PPP":
        return formatLong2.date({ width: "long" });
      case "PPPP":
      default:
        return formatLong2.date({ width: "full" });
    }
  };
  var timeLongFormatter = (pattern, formatLong2) => {
    switch (pattern) {
      case "p":
        return formatLong2.time({ width: "short" });
      case "pp":
        return formatLong2.time({ width: "medium" });
      case "ppp":
        return formatLong2.time({ width: "long" });
      case "pppp":
      default:
        return formatLong2.time({ width: "full" });
    }
  };
  var dateTimeLongFormatter = (pattern, formatLong2) => {
    const matchResult = pattern.match(/(P+)(p+)?/) || [];
    const datePattern = matchResult[1];
    const timePattern = matchResult[2];
    if (!timePattern) {
      return dateLongFormatter(pattern, formatLong2);
    }
    let dateTimeFormat;
    switch (datePattern) {
      case "P":
        dateTimeFormat = formatLong2.dateTime({ width: "short" });
        break;
      case "PP":
        dateTimeFormat = formatLong2.dateTime({ width: "medium" });
        break;
      case "PPP":
        dateTimeFormat = formatLong2.dateTime({ width: "long" });
        break;
      case "PPPP":
      default:
        dateTimeFormat = formatLong2.dateTime({ width: "full" });
        break;
    }
    return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
  };
  var longFormatters = {
    p: timeLongFormatter,
    P: dateTimeLongFormatter
  };

  // node_modules/date-fns/_lib/protectedTokens.js
  var dayOfYearTokenRE = /^D+$/;
  var weekYearTokenRE = /^Y+$/;
  var throwTokens = ["D", "DD", "YY", "YYYY"];
  function isProtectedDayOfYearToken(token) {
    return dayOfYearTokenRE.test(token);
  }
  function isProtectedWeekYearToken(token) {
    return weekYearTokenRE.test(token);
  }
  function warnOrThrowProtectedError(token, format7, input) {
    const _message = message(token, format7, input);
    console.warn(_message);
    if (throwTokens.includes(token)) throw new RangeError(_message);
  }
  function message(token, format7, input) {
    const subject = token[0] === "Y" ? "years" : "days of the month";
    return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format7}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
  }

  // node_modules/date-fns/format.js
  var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
  var escapedStringRegExp = /^'([^]*?)'?$/;
  var doubleQuoteRegExp = /''/g;
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
  function format(date, formatStr, options) {
    const defaultOptions2 = getDefaultOptions();
    const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
    const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
    const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
    const originalDate = toDate(date, options?.in);
    if (!isValid(originalDate)) {
      throw new RangeError("Invalid time value");
    }
    let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
      const firstCharacter = substring[0];
      if (firstCharacter === "p" || firstCharacter === "P") {
        const longFormatter = longFormatters[firstCharacter];
        return longFormatter(substring, locale.formatLong);
      }
      return substring;
    }).join("").match(formattingTokensRegExp).map((substring) => {
      if (substring === "''") {
        return { isToken: false, value: "'" };
      }
      const firstCharacter = substring[0];
      if (firstCharacter === "'") {
        return { isToken: false, value: cleanEscapedString(substring) };
      }
      if (formatters[firstCharacter]) {
        return { isToken: true, value: substring };
      }
      if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
        throw new RangeError(
          "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
        );
      }
      return { isToken: false, value: substring };
    });
    if (locale.localize.preprocessor) {
      parts = locale.localize.preprocessor(originalDate, parts);
    }
    const formatterOptions = {
      firstWeekContainsDate,
      weekStartsOn,
      locale
    };
    return parts.map((part) => {
      if (!part.isToken) return part.value;
      const token = part.value;
      if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
        warnOrThrowProtectedError(token, formatStr, String(date));
      }
      const formatter = formatters[token[0]];
      return formatter(originalDate, token, locale.localize, formatterOptions);
    }).join("");
  }
  function cleanEscapedString(input) {
    const matched = input.match(escapedStringRegExp);
    if (!matched) {
      return input;
    }
    return matched[1].replace(doubleQuoteRegExp, "'");
  }

  // node_modules/date-fns/getDaysInMonth.js
  function getDaysInMonth(date, options) {
    const _date = toDate(date, options?.in);
    const year = _date.getFullYear();
    const monthIndex = _date.getMonth();
    const lastDayOfMonth = constructFrom(_date, 0);
    lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
    lastDayOfMonth.setHours(0, 0, 0, 0);
    return lastDayOfMonth.getDate();
  }

  // node_modules/date-fns/getDefaultOptions.js
  function getDefaultOptions2() {
    return Object.assign({}, getDefaultOptions());
  }

  // node_modules/date-fns/getISODay.js
  function getISODay(date, options) {
    const day = toDate(date, options?.in).getDay();
    return day === 0 ? 7 : day;
  }

  // node_modules/date-fns/getMonth.js
  function getMonth(date, options) {
    return toDate(date, options?.in).getMonth();
  }

  // node_modules/date-fns/getYear.js
  function getYear(date, options) {
    return toDate(date, options?.in).getFullYear();
  }

  // node_modules/date-fns/isAfter.js
  function isAfter(date, dateToCompare) {
    return +toDate(date) > +toDate(dateToCompare);
  }

  // node_modules/date-fns/isBefore.js
  function isBefore(date, dateToCompare) {
    return +toDate(date) < +toDate(dateToCompare);
  }

  // node_modules/date-fns/transpose.js
  function transpose(date, constructor) {
    const date_ = isConstructor(constructor) ? new constructor(0) : constructFrom(constructor, 0);
    date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
    date_.setHours(
      date.getHours(),
      date.getMinutes(),
      date.getSeconds(),
      date.getMilliseconds()
    );
    return date_;
  }
  function isConstructor(constructor) {
    return typeof constructor === "function" && constructor.prototype?.constructor === constructor;
  }

  // node_modules/date-fns/parse/_lib/Setter.js
  var TIMEZONE_UNIT_PRIORITY = 10;
  var Setter = class {
    subPriority = 0;
    validate(_utcDate, _options) {
      return true;
    }
  };
  var ValueSetter = class extends Setter {
    constructor(value, validateValue, setValue, priority, subPriority) {
      super();
      this.value = value;
      this.validateValue = validateValue;
      this.setValue = setValue;
      this.priority = priority;
      if (subPriority) {
        this.subPriority = subPriority;
      }
    }
    validate(date, options) {
      return this.validateValue(date, this.value, options);
    }
    set(date, flags, options) {
      return this.setValue(date, flags, this.value, options);
    }
  };
  var DateTimezoneSetter = class extends Setter {
    priority = TIMEZONE_UNIT_PRIORITY;
    subPriority = -1;
    constructor(context, reference) {
      super();
      this.context = context || ((date) => constructFrom(reference, date));
    }
    set(date, flags) {
      if (flags.timestampIsSet) return date;
      return constructFrom(date, transpose(date, this.context));
    }
  };

  // node_modules/date-fns/parse/_lib/Parser.js
  var Parser = class {
    run(dateString, token, match2, options) {
      const result = this.parse(dateString, token, match2, options);
      if (!result) {
        return null;
      }
      return {
        setter: new ValueSetter(
          result.value,
          this.validate,
          this.set,
          this.priority,
          this.subPriority
        ),
        rest: result.rest
      };
    }
    validate(_utcDate, _value, _options) {
      return true;
    }
  };

  // node_modules/date-fns/parse/_lib/parsers/EraParser.js
  var EraParser = class extends Parser {
    priority = 140;
    parse(dateString, token, match2) {
      switch (token) {
        // AD, BC
        case "G":
        case "GG":
        case "GGG":
          return match2.era(dateString, { width: "abbreviated" }) || match2.era(dateString, { width: "narrow" });
        // A, B
        case "GGGGG":
          return match2.era(dateString, { width: "narrow" });
        // Anno Domini, Before Christ
        case "GGGG":
        default:
          return match2.era(dateString, { width: "wide" }) || match2.era(dateString, { width: "abbreviated" }) || match2.era(dateString, { width: "narrow" });
      }
    }
    set(date, flags, value) {
      flags.era = value;
      date.setFullYear(value, 0, 1);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = ["R", "u", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/constants.js
  var numericPatterns = {
    month: /^(1[0-2]|0?\d)/,
    // 0 to 12
    date: /^(3[0-1]|[0-2]?\d)/,
    // 0 to 31
    dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
    // 0 to 366
    week: /^(5[0-3]|[0-4]?\d)/,
    // 0 to 53
    hour23h: /^(2[0-3]|[0-1]?\d)/,
    // 0 to 23
    hour24h: /^(2[0-4]|[0-1]?\d)/,
    // 0 to 24
    hour11h: /^(1[0-1]|0?\d)/,
    // 0 to 11
    hour12h: /^(1[0-2]|0?\d)/,
    // 0 to 12
    minute: /^[0-5]?\d/,
    // 0 to 59
    second: /^[0-5]?\d/,
    // 0 to 59
    singleDigit: /^\d/,
    // 0 to 9
    twoDigits: /^\d{1,2}/,
    // 0 to 99
    threeDigits: /^\d{1,3}/,
    // 0 to 999
    fourDigits: /^\d{1,4}/,
    // 0 to 9999
    anyDigitsSigned: /^-?\d+/,
    singleDigitSigned: /^-?\d/,
    // 0 to 9, -0 to -9
    twoDigitsSigned: /^-?\d{1,2}/,
    // 0 to 99, -0 to -99
    threeDigitsSigned: /^-?\d{1,3}/,
    // 0 to 999, -0 to -999
    fourDigitsSigned: /^-?\d{1,4}/
    // 0 to 9999, -0 to -9999
  };
  var timezonePatterns = {
    basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
    basic: /^([+-])(\d{2})(\d{2})|Z/,
    basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
    extended: /^([+-])(\d{2}):(\d{2})|Z/,
    extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
  };

  // node_modules/date-fns/parse/_lib/utils.js
  function mapValue(parseFnResult, mapFn) {
    if (!parseFnResult) {
      return parseFnResult;
    }
    return {
      value: mapFn(parseFnResult.value),
      rest: parseFnResult.rest
    };
  }
  function parseNumericPattern(pattern, dateString) {
    const matchResult = dateString.match(pattern);
    if (!matchResult) {
      return null;
    }
    return {
      value: parseInt(matchResult[0], 10),
      rest: dateString.slice(matchResult[0].length)
    };
  }
  function parseTimezonePattern(pattern, dateString) {
    const matchResult = dateString.match(pattern);
    if (!matchResult) {
      return null;
    }
    if (matchResult[0] === "Z") {
      return {
        value: 0,
        rest: dateString.slice(1)
      };
    }
    const sign = matchResult[1] === "+" ? 1 : -1;
    const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
    const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
    const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
    return {
      value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
      rest: dateString.slice(matchResult[0].length)
    };
  }
  function parseAnyDigitsSigned(dateString) {
    return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
  }
  function parseNDigits(n, dateString) {
    switch (n) {
      case 1:
        return parseNumericPattern(numericPatterns.singleDigit, dateString);
      case 2:
        return parseNumericPattern(numericPatterns.twoDigits, dateString);
      case 3:
        return parseNumericPattern(numericPatterns.threeDigits, dateString);
      case 4:
        return parseNumericPattern(numericPatterns.fourDigits, dateString);
      default:
        return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString);
    }
  }
  function parseNDigitsSigned(n, dateString) {
    switch (n) {
      case 1:
        return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
      case 2:
        return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
      case 3:
        return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
      case 4:
        return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
      default:
        return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString);
    }
  }
  function dayPeriodEnumToHours(dayPeriod) {
    switch (dayPeriod) {
      case "morning":
        return 4;
      case "evening":
        return 17;
      case "pm":
      case "noon":
      case "afternoon":
        return 12;
      case "am":
      case "midnight":
      case "night":
      default:
        return 0;
    }
  }
  function normalizeTwoDigitYear(twoDigitYear, currentYear) {
    const isCommonEra = currentYear > 0;
    const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
    let result;
    if (absCurrentYear <= 50) {
      result = twoDigitYear || 100;
    } else {
      const rangeEnd = absCurrentYear + 50;
      const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;
      const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
      result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
    }
    return isCommonEra ? result : 1 - result;
  }
  function isLeapYearIndex(year) {
    return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
  }

  // node_modules/date-fns/parse/_lib/parsers/YearParser.js
  var YearParser = class extends Parser {
    priority = 130;
    incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
    parse(dateString, token, match2) {
      const valueCallback = (year) => ({
        year,
        isTwoDigitYear: token === "yy"
      });
      switch (token) {
        case "y":
          return mapValue(parseNDigits(4, dateString), valueCallback);
        case "yo":
          return mapValue(
            match2.ordinalNumber(dateString, {
              unit: "year"
            }),
            valueCallback
          );
        default:
          return mapValue(parseNDigits(token.length, dateString), valueCallback);
      }
    }
    validate(_date, value) {
      return value.isTwoDigitYear || value.year > 0;
    }
    set(date, flags, value) {
      const currentYear = date.getFullYear();
      if (value.isTwoDigitYear) {
        const normalizedTwoDigitYear = normalizeTwoDigitYear(
          value.year,
          currentYear
        );
        date.setFullYear(normalizedTwoDigitYear, 0, 1);
        date.setHours(0, 0, 0, 0);
        return date;
      }
      const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
      date.setFullYear(year, 0, 1);
      date.setHours(0, 0, 0, 0);
      return date;
    }
  };

  // node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js
  var LocalWeekYearParser = class extends Parser {
    priority = 130;
    parse(dateString, token, match2) {
      const valueCallback = (year) => ({
        year,
        isTwoDigitYear: token === "YY"
      });
      switch (token) {
        case "Y":
          return mapValue(parseNDigits(4, dateString), valueCallback);
        case "Yo":
          return mapValue(
            match2.ordinalNumber(dateString, {
              unit: "year"
            }),
            valueCallback
          );
        default:
          return mapValue(parseNDigits(token.length, dateString), valueCallback);
      }
    }
    validate(_date, value) {
      return value.isTwoDigitYear || value.year > 0;
    }
    set(date, flags, value, options) {
      const currentYear = getWeekYear(date, options);
      if (value.isTwoDigitYear) {
        const normalizedTwoDigitYear = normalizeTwoDigitYear(
          value.year,
          currentYear
        );
        date.setFullYear(
          normalizedTwoDigitYear,
          0,
          options.firstWeekContainsDate
        );
        date.setHours(0, 0, 0, 0);
        return startOfWeek(date, options);
      }
      const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
      date.setFullYear(year, 0, options.firstWeekContainsDate);
      date.setHours(0, 0, 0, 0);
      return startOfWeek(date, options);
    }
    incompatibleTokens = [
      "y",
      "R",
      "u",
      "Q",
      "q",
      "M",
      "L",
      "I",
      "d",
      "D",
      "i",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js
  var ISOWeekYearParser = class extends Parser {
    priority = 130;
    parse(dateString, token) {
      if (token === "R") {
        return parseNDigitsSigned(4, dateString);
      }
      return parseNDigitsSigned(token.length, dateString);
    }
    set(date, _flags, value) {
      const firstWeekOfYear = constructFrom(date, 0);
      firstWeekOfYear.setFullYear(value, 0, 4);
      firstWeekOfYear.setHours(0, 0, 0, 0);
      return startOfISOWeek(firstWeekOfYear);
    }
    incompatibleTokens = [
      "G",
      "y",
      "Y",
      "u",
      "Q",
      "q",
      "M",
      "L",
      "w",
      "d",
      "D",
      "e",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js
  var ExtendedYearParser = class extends Parser {
    priority = 130;
    parse(dateString, token) {
      if (token === "u") {
        return parseNDigitsSigned(4, dateString);
      }
      return parseNDigitsSigned(token.length, dateString);
    }
    set(date, _flags, value) {
      date.setFullYear(value, 0, 1);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/QuarterParser.js
  var QuarterParser = class extends Parser {
    priority = 120;
    parse(dateString, token, match2) {
      switch (token) {
        // 1, 2, 3, 4
        case "Q":
        case "QQ":
          return parseNDigits(token.length, dateString);
        // 1st, 2nd, 3rd, 4th
        case "Qo":
          return match2.ordinalNumber(dateString, { unit: "quarter" });
        // Q1, Q2, Q3, Q4
        case "QQQ":
          return match2.quarter(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
        // 1, 2, 3, 4 (narrow quarter; could be not numerical)
        case "QQQQQ":
          return match2.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
        // 1st quarter, 2nd quarter, ...
        case "QQQQ":
        default:
          return match2.quarter(dateString, {
            width: "wide",
            context: "formatting"
          }) || match2.quarter(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
    validate(_date, value) {
      return value >= 1 && value <= 4;
    }
    set(date, _flags, value) {
      date.setMonth((value - 1) * 3, 1);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = [
      "Y",
      "R",
      "q",
      "M",
      "L",
      "w",
      "I",
      "d",
      "D",
      "i",
      "e",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js
  var StandAloneQuarterParser = class extends Parser {
    priority = 120;
    parse(dateString, token, match2) {
      switch (token) {
        // 1, 2, 3, 4
        case "q":
        case "qq":
          return parseNDigits(token.length, dateString);
        // 1st, 2nd, 3rd, 4th
        case "qo":
          return match2.ordinalNumber(dateString, { unit: "quarter" });
        // Q1, Q2, Q3, Q4
        case "qqq":
          return match2.quarter(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match2.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
        // 1, 2, 3, 4 (narrow quarter; could be not numerical)
        case "qqqqq":
          return match2.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
        // 1st quarter, 2nd quarter, ...
        case "qqqq":
        default:
          return match2.quarter(dateString, {
            width: "wide",
            context: "standalone"
          }) || match2.quarter(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match2.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
    validate(_date, value) {
      return value >= 1 && value <= 4;
    }
    set(date, _flags, value) {
      date.setMonth((value - 1) * 3, 1);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = [
      "Y",
      "R",
      "Q",
      "M",
      "L",
      "w",
      "I",
      "d",
      "D",
      "i",
      "e",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/parse/_lib/parsers/MonthParser.js
  var MonthParser = class extends Parser {
    incompatibleTokens = [
      "Y",
      "R",
      "q",
      "Q",
      "L",
      "w",
      "I",
      "D",
      "i",
      "e",
      "c",
      "t",
      "T"
    ];
    priority = 110;
    parse(dateString, token, match2) {
      const valueCallback = (value) => value - 1;
      switch (token) {
        // 1, 2, ..., 12
        case "M":
          return mapValue(
            parseNumericPattern(numericPatterns.month, dateString),
            valueCallback
          );
        // 01, 02, ..., 12
        case "MM":
          return mapValue(parseNDigits(2, dateString), valueCallback);
        // 1st, 2nd, ..., 12th
        case "Mo":
          return mapValue(
            match2.ordinalNumber(dateString, {
              unit: "month"
            }),
            valueCallback
          );
        // Jan, Feb, ..., Dec
        case "MMM":
          return match2.month(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.month(dateString, { width: "narrow", context: "formatting" });
        // J, F, ..., D
        case "MMMMM":
          return match2.month(dateString, {
            width: "narrow",
            context: "formatting"
          });
        // January, February, ..., December
        case "MMMM":
        default:
          return match2.month(dateString, { width: "wide", context: "formatting" }) || match2.month(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.month(dateString, { width: "narrow", context: "formatting" });
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 11;
    }
    set(date, _flags, value) {
      date.setMonth(value, 1);
      date.setHours(0, 0, 0, 0);
      return date;
    }
  };

  // node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js
  var StandAloneMonthParser = class extends Parser {
    priority = 110;
    parse(dateString, token, match2) {
      const valueCallback = (value) => value - 1;
      switch (token) {
        // 1, 2, ..., 12
        case "L":
          return mapValue(
            parseNumericPattern(numericPatterns.month, dateString),
            valueCallback
          );
        // 01, 02, ..., 12
        case "LL":
          return mapValue(parseNDigits(2, dateString), valueCallback);
        // 1st, 2nd, ..., 12th
        case "Lo":
          return mapValue(
            match2.ordinalNumber(dateString, {
              unit: "month"
            }),
            valueCallback
          );
        // Jan, Feb, ..., Dec
        case "LLL":
          return match2.month(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match2.month(dateString, { width: "narrow", context: "standalone" });
        // J, F, ..., D
        case "LLLLL":
          return match2.month(dateString, {
            width: "narrow",
            context: "standalone"
          });
        // January, February, ..., December
        case "LLLL":
        default:
          return match2.month(dateString, { width: "wide", context: "standalone" }) || match2.month(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match2.month(dateString, { width: "narrow", context: "standalone" });
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 11;
    }
    set(date, _flags, value) {
      date.setMonth(value, 1);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = [
      "Y",
      "R",
      "q",
      "Q",
      "M",
      "w",
      "I",
      "D",
      "i",
      "e",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/setWeek.js
  function setWeek(date, week, options) {
    const date_ = toDate(date, options?.in);
    const diff = getWeek(date_, options) - week;
    date_.setDate(date_.getDate() - diff * 7);
    return toDate(date_, options?.in);
  }

  // node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js
  var LocalWeekParser = class extends Parser {
    priority = 100;
    parse(dateString, token, match2) {
      switch (token) {
        case "w":
          return parseNumericPattern(numericPatterns.week, dateString);
        case "wo":
          return match2.ordinalNumber(dateString, { unit: "week" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(_date, value) {
      return value >= 1 && value <= 53;
    }
    set(date, _flags, value, options) {
      return startOfWeek(setWeek(date, value, options), options);
    }
    incompatibleTokens = [
      "y",
      "R",
      "u",
      "q",
      "Q",
      "M",
      "L",
      "I",
      "d",
      "D",
      "i",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/setISOWeek.js
  function setISOWeek(date, week, options) {
    const _date = toDate(date, options?.in);
    const diff = getISOWeek(_date, options) - week;
    _date.setDate(_date.getDate() - diff * 7);
    return _date;
  }

  // node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js
  var ISOWeekParser = class extends Parser {
    priority = 100;
    parse(dateString, token, match2) {
      switch (token) {
        case "I":
          return parseNumericPattern(numericPatterns.week, dateString);
        case "Io":
          return match2.ordinalNumber(dateString, { unit: "week" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(_date, value) {
      return value >= 1 && value <= 53;
    }
    set(date, _flags, value) {
      return startOfISOWeek(setISOWeek(date, value));
    }
    incompatibleTokens = [
      "y",
      "Y",
      "u",
      "q",
      "Q",
      "M",
      "L",
      "w",
      "d",
      "D",
      "e",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/parse/_lib/parsers/DateParser.js
  var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  var DAYS_IN_MONTH_LEAP_YEAR = [
    31,
    29,
    31,
    30,
    31,
    30,
    31,
    31,
    30,
    31,
    30,
    31
  ];
  var DateParser = class extends Parser {
    priority = 90;
    subPriority = 1;
    parse(dateString, token, match2) {
      switch (token) {
        case "d":
          return parseNumericPattern(numericPatterns.date, dateString);
        case "do":
          return match2.ordinalNumber(dateString, { unit: "date" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(date, value) {
      const year = date.getFullYear();
      const isLeapYear = isLeapYearIndex(year);
      const month = date.getMonth();
      if (isLeapYear) {
        return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
      } else {
        return value >= 1 && value <= DAYS_IN_MONTH[month];
      }
    }
    set(date, _flags, value) {
      date.setDate(value);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = [
      "Y",
      "R",
      "q",
      "Q",
      "w",
      "I",
      "D",
      "i",
      "e",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js
  var DayOfYearParser = class extends Parser {
    priority = 90;
    subpriority = 1;
    parse(dateString, token, match2) {
      switch (token) {
        case "D":
        case "DD":
          return parseNumericPattern(numericPatterns.dayOfYear, dateString);
        case "Do":
          return match2.ordinalNumber(dateString, { unit: "date" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(date, value) {
      const year = date.getFullYear();
      const isLeapYear = isLeapYearIndex(year);
      if (isLeapYear) {
        return value >= 1 && value <= 366;
      } else {
        return value >= 1 && value <= 365;
      }
    }
    set(date, _flags, value) {
      date.setMonth(0, value);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = [
      "Y",
      "R",
      "q",
      "Q",
      "M",
      "L",
      "w",
      "I",
      "d",
      "E",
      "i",
      "e",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/setDay.js
  function setDay(date, day, options) {
    const defaultOptions2 = getDefaultOptions();
    const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
    const date_ = toDate(date, options?.in);
    const currentDay = date_.getDay();
    const remainder = day % 7;
    const dayIndex = (remainder + 7) % 7;
    const delta = 7 - weekStartsOn;
    const diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;
    return addDays(date_, diff, options);
  }

  // node_modules/date-fns/parse/_lib/parsers/DayParser.js
  var DayParser = class extends Parser {
    priority = 90;
    parse(dateString, token, match2) {
      switch (token) {
        // Tue
        case "E":
        case "EE":
        case "EEE":
          return match2.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
        // T
        case "EEEEE":
          return match2.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        // Tu
        case "EEEEEE":
          return match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
        // Tuesday
        case "EEEE":
        default:
          return match2.day(dateString, { width: "wide", context: "formatting" }) || match2.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 6;
    }
    set(date, _flags, value, options) {
      date = setDay(date, value, options);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js
  var LocalDayParser = class extends Parser {
    priority = 90;
    parse(dateString, token, match2, options) {
      const valueCallback = (value) => {
        const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
        return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
      };
      switch (token) {
        // 3
        case "e":
        case "ee":
          return mapValue(parseNDigits(token.length, dateString), valueCallback);
        // 3rd
        case "eo":
          return mapValue(
            match2.ordinalNumber(dateString, {
              unit: "day"
            }),
            valueCallback
          );
        // Tue
        case "eee":
          return match2.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
        // T
        case "eeeee":
          return match2.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        // Tu
        case "eeeeee":
          return match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
        // Tuesday
        case "eeee":
        default:
          return match2.day(dateString, { width: "wide", context: "formatting" }) || match2.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 6;
    }
    set(date, _flags, value, options) {
      date = setDay(date, value, options);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = [
      "y",
      "R",
      "u",
      "q",
      "Q",
      "M",
      "L",
      "I",
      "d",
      "D",
      "E",
      "i",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js
  var StandAloneLocalDayParser = class extends Parser {
    priority = 90;
    parse(dateString, token, match2, options) {
      const valueCallback = (value) => {
        const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
        return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
      };
      switch (token) {
        // 3
        case "c":
        case "cc":
          return mapValue(parseNDigits(token.length, dateString), valueCallback);
        // 3rd
        case "co":
          return mapValue(
            match2.ordinalNumber(dateString, {
              unit: "day"
            }),
            valueCallback
          );
        // Tue
        case "ccc":
          return match2.day(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" });
        // T
        case "ccccc":
          return match2.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
        // Tu
        case "cccccc":
          return match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" });
        // Tuesday
        case "cccc":
        default:
          return match2.day(dateString, { width: "wide", context: "standalone" }) || match2.day(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" });
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 6;
    }
    set(date, _flags, value, options) {
      date = setDay(date, value, options);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = [
      "y",
      "R",
      "u",
      "q",
      "Q",
      "M",
      "L",
      "I",
      "d",
      "D",
      "E",
      "i",
      "e",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/setISODay.js
  function setISODay(date, day, options) {
    const date_ = toDate(date, options?.in);
    const currentDay = getISODay(date_, options);
    const diff = day - currentDay;
    return addDays(date_, diff, options);
  }

  // node_modules/date-fns/parse/_lib/parsers/ISODayParser.js
  var ISODayParser = class extends Parser {
    priority = 90;
    parse(dateString, token, match2) {
      const valueCallback = (value) => {
        if (value === 0) {
          return 7;
        }
        return value;
      };
      switch (token) {
        // 2
        case "i":
        case "ii":
          return parseNDigits(token.length, dateString);
        // 2nd
        case "io":
          return match2.ordinalNumber(dateString, { unit: "day" });
        // Tue
        case "iii":
          return mapValue(
            match2.day(dateString, {
              width: "abbreviated",
              context: "formatting"
            }) || match2.day(dateString, {
              width: "short",
              context: "formatting"
            }) || match2.day(dateString, {
              width: "narrow",
              context: "formatting"
            }),
            valueCallback
          );
        // T
        case "iiiii":
          return mapValue(
            match2.day(dateString, {
              width: "narrow",
              context: "formatting"
            }),
            valueCallback
          );
        // Tu
        case "iiiiii":
          return mapValue(
            match2.day(dateString, {
              width: "short",
              context: "formatting"
            }) || match2.day(dateString, {
              width: "narrow",
              context: "formatting"
            }),
            valueCallback
          );
        // Tuesday
        case "iiii":
        default:
          return mapValue(
            match2.day(dateString, {
              width: "wide",
              context: "formatting"
            }) || match2.day(dateString, {
              width: "abbreviated",
              context: "formatting"
            }) || match2.day(dateString, {
              width: "short",
              context: "formatting"
            }) || match2.day(dateString, {
              width: "narrow",
              context: "formatting"
            }),
            valueCallback
          );
      }
    }
    validate(_date, value) {
      return value >= 1 && value <= 7;
    }
    set(date, _flags, value) {
      date = setISODay(date, value);
      date.setHours(0, 0, 0, 0);
      return date;
    }
    incompatibleTokens = [
      "y",
      "Y",
      "u",
      "q",
      "Q",
      "M",
      "L",
      "w",
      "d",
      "D",
      "E",
      "e",
      "c",
      "t",
      "T"
    ];
  };

  // node_modules/date-fns/parse/_lib/parsers/AMPMParser.js
  var AMPMParser = class extends Parser {
    priority = 80;
    parse(dateString, token, match2) {
      switch (token) {
        case "a":
        case "aa":
        case "aaa":
          return match2.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "aaaaa":
          return match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "aaaa":
        default:
          return match2.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
    set(date, _flags, value) {
      date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
      return date;
    }
    incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js
  var AMPMMidnightParser = class extends Parser {
    priority = 80;
    parse(dateString, token, match2) {
      switch (token) {
        case "b":
        case "bb":
        case "bbb":
          return match2.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbbb":
          return match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbb":
        default:
          return match2.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
    set(date, _flags, value) {
      date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
      return date;
    }
    incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js
  var DayPeriodParser = class extends Parser {
    priority = 80;
    parse(dateString, token, match2) {
      switch (token) {
        case "B":
        case "BB":
        case "BBB":
          return match2.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBBB":
          return match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBB":
        default:
          return match2.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match2.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
    set(date, _flags, value) {
      date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
      return date;
    }
    incompatibleTokens = ["a", "b", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js
  var Hour1to12Parser = class extends Parser {
    priority = 70;
    parse(dateString, token, match2) {
      switch (token) {
        case "h":
          return parseNumericPattern(numericPatterns.hour12h, dateString);
        case "ho":
          return match2.ordinalNumber(dateString, { unit: "hour" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(_date, value) {
      return value >= 1 && value <= 12;
    }
    set(date, _flags, value) {
      const isPM = date.getHours() >= 12;
      if (isPM && value < 12) {
        date.setHours(value + 12, 0, 0, 0);
      } else if (!isPM && value === 12) {
        date.setHours(0, 0, 0, 0);
      } else {
        date.setHours(value, 0, 0, 0);
      }
      return date;
    }
    incompatibleTokens = ["H", "K", "k", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js
  var Hour0to23Parser = class extends Parser {
    priority = 70;
    parse(dateString, token, match2) {
      switch (token) {
        case "H":
          return parseNumericPattern(numericPatterns.hour23h, dateString);
        case "Ho":
          return match2.ordinalNumber(dateString, { unit: "hour" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 23;
    }
    set(date, _flags, value) {
      date.setHours(value, 0, 0, 0);
      return date;
    }
    incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js
  var Hour0To11Parser = class extends Parser {
    priority = 70;
    parse(dateString, token, match2) {
      switch (token) {
        case "K":
          return parseNumericPattern(numericPatterns.hour11h, dateString);
        case "Ko":
          return match2.ordinalNumber(dateString, { unit: "hour" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 11;
    }
    set(date, _flags, value) {
      const isPM = date.getHours() >= 12;
      if (isPM && value < 12) {
        date.setHours(value + 12, 0, 0, 0);
      } else {
        date.setHours(value, 0, 0, 0);
      }
      return date;
    }
    incompatibleTokens = ["h", "H", "k", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js
  var Hour1To24Parser = class extends Parser {
    priority = 70;
    parse(dateString, token, match2) {
      switch (token) {
        case "k":
          return parseNumericPattern(numericPatterns.hour24h, dateString);
        case "ko":
          return match2.ordinalNumber(dateString, { unit: "hour" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(_date, value) {
      return value >= 1 && value <= 24;
    }
    set(date, _flags, value) {
      const hours = value <= 24 ? value % 24 : value;
      date.setHours(hours, 0, 0, 0);
      return date;
    }
    incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/MinuteParser.js
  var MinuteParser = class extends Parser {
    priority = 60;
    parse(dateString, token, match2) {
      switch (token) {
        case "m":
          return parseNumericPattern(numericPatterns.minute, dateString);
        case "mo":
          return match2.ordinalNumber(dateString, { unit: "minute" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 59;
    }
    set(date, _flags, value) {
      date.setMinutes(value, 0, 0);
      return date;
    }
    incompatibleTokens = ["t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/SecondParser.js
  var SecondParser = class extends Parser {
    priority = 50;
    parse(dateString, token, match2) {
      switch (token) {
        case "s":
          return parseNumericPattern(numericPatterns.second, dateString);
        case "so":
          return match2.ordinalNumber(dateString, { unit: "second" });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
    validate(_date, value) {
      return value >= 0 && value <= 59;
    }
    set(date, _flags, value) {
      date.setSeconds(value, 0);
      return date;
    }
    incompatibleTokens = ["t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js
  var FractionOfSecondParser = class extends Parser {
    priority = 30;
    parse(dateString, token) {
      const valueCallback = (value) => Math.trunc(value * Math.pow(10, -token.length + 3));
      return mapValue(parseNDigits(token.length, dateString), valueCallback);
    }
    set(date, _flags, value) {
      date.setMilliseconds(value);
      return date;
    }
    incompatibleTokens = ["t", "T"];
  };

  // node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js
  var ISOTimezoneWithZParser = class extends Parser {
    priority = 10;
    parse(dateString, token) {
      switch (token) {
        case "X":
          return parseTimezonePattern(
            timezonePatterns.basicOptionalMinutes,
            dateString
          );
        case "XX":
          return parseTimezonePattern(timezonePatterns.basic, dateString);
        case "XXXX":
          return parseTimezonePattern(
            timezonePatterns.basicOptionalSeconds,
            dateString
          );
        case "XXXXX":
          return parseTimezonePattern(
            timezonePatterns.extendedOptionalSeconds,
            dateString
          );
        case "XXX":
        default:
          return parseTimezonePattern(timezonePatterns.extended, dateString);
      }
    }
    set(date, flags, value) {
      if (flags.timestampIsSet) return date;
      return constructFrom(
        date,
        date.getTime() - getTimezoneOffsetInMilliseconds(date) - value
      );
    }
    incompatibleTokens = ["t", "T", "x"];
  };

  // node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js
  var ISOTimezoneParser = class extends Parser {
    priority = 10;
    parse(dateString, token) {
      switch (token) {
        case "x":
          return parseTimezonePattern(
            timezonePatterns.basicOptionalMinutes,
            dateString
          );
        case "xx":
          return parseTimezonePattern(timezonePatterns.basic, dateString);
        case "xxxx":
          return parseTimezonePattern(
            timezonePatterns.basicOptionalSeconds,
            dateString
          );
        case "xxxxx":
          return parseTimezonePattern(
            timezonePatterns.extendedOptionalSeconds,
            dateString
          );
        case "xxx":
        default:
          return parseTimezonePattern(timezonePatterns.extended, dateString);
      }
    }
    set(date, flags, value) {
      if (flags.timestampIsSet) return date;
      return constructFrom(
        date,
        date.getTime() - getTimezoneOffsetInMilliseconds(date) - value
      );
    }
    incompatibleTokens = ["t", "T", "X"];
  };

  // node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js
  var TimestampSecondsParser = class extends Parser {
    priority = 40;
    parse(dateString) {
      return parseAnyDigitsSigned(dateString);
    }
    set(date, _flags, value) {
      return [constructFrom(date, value * 1e3), { timestampIsSet: true }];
    }
    incompatibleTokens = "*";
  };

  // node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js
  var TimestampMillisecondsParser = class extends Parser {
    priority = 20;
    parse(dateString) {
      return parseAnyDigitsSigned(dateString);
    }
    set(date, _flags, value) {
      return [constructFrom(date, value), { timestampIsSet: true }];
    }
    incompatibleTokens = "*";
  };

  // node_modules/date-fns/parse/_lib/parsers.js
  var parsers = {
    G: new EraParser(),
    y: new YearParser(),
    Y: new LocalWeekYearParser(),
    R: new ISOWeekYearParser(),
    u: new ExtendedYearParser(),
    Q: new QuarterParser(),
    q: new StandAloneQuarterParser(),
    M: new MonthParser(),
    L: new StandAloneMonthParser(),
    w: new LocalWeekParser(),
    I: new ISOWeekParser(),
    d: new DateParser(),
    D: new DayOfYearParser(),
    E: new DayParser(),
    e: new LocalDayParser(),
    c: new StandAloneLocalDayParser(),
    i: new ISODayParser(),
    a: new AMPMParser(),
    b: new AMPMMidnightParser(),
    B: new DayPeriodParser(),
    h: new Hour1to12Parser(),
    H: new Hour0to23Parser(),
    K: new Hour0To11Parser(),
    k: new Hour1To24Parser(),
    m: new MinuteParser(),
    s: new SecondParser(),
    S: new FractionOfSecondParser(),
    X: new ISOTimezoneWithZParser(),
    x: new ISOTimezoneParser(),
    t: new TimestampSecondsParser(),
    T: new TimestampMillisecondsParser()
  };

  // node_modules/date-fns/parse.js
  var formattingTokensRegExp2 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
  var longFormattingTokensRegExp2 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
  var escapedStringRegExp2 = /^'([^]*?)'?$/;
  var doubleQuoteRegExp2 = /''/g;
  var notWhitespaceRegExp = /\S/;
  var unescapedLatinCharacterRegExp2 = /[a-zA-Z]/;
  function parse(dateStr, formatStr, referenceDate, options) {
    const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
    const defaultOptions2 = getDefaultOptions2();
    const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
    const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
    const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
    if (!formatStr)
      return dateStr ? invalidDate() : toDate(referenceDate, options?.in);
    const subFnOptions = {
      firstWeekContainsDate,
      weekStartsOn,
      locale
    };
    const setters = [new DateTimezoneSetter(options?.in, referenceDate)];
    const tokens = formatStr.match(longFormattingTokensRegExp2).map((substring) => {
      const firstCharacter = substring[0];
      if (firstCharacter in longFormatters) {
        const longFormatter = longFormatters[firstCharacter];
        return longFormatter(substring, locale.formatLong);
      }
      return substring;
    }).join("").match(formattingTokensRegExp2);
    const usedTokens = [];
    for (let token of tokens) {
      if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {
        warnOrThrowProtectedError(token, formatStr, dateStr);
      }
      if (!options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
        warnOrThrowProtectedError(token, formatStr, dateStr);
      }
      const firstCharacter = token[0];
      const parser = parsers[firstCharacter];
      if (parser) {
        const { incompatibleTokens } = parser;
        if (Array.isArray(incompatibleTokens)) {
          const incompatibleToken = usedTokens.find(
            (usedToken) => incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter
          );
          if (incompatibleToken) {
            throw new RangeError(
              `The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`
            );
          }
        } else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) {
          throw new RangeError(
            `The format string mustn't contain \`${token}\` and any other token at the same time`
          );
        }
        usedTokens.push({ token: firstCharacter, fullToken: token });
        const parseResult = parser.run(
          dateStr,
          token,
          locale.match,
          subFnOptions
        );
        if (!parseResult) {
          return invalidDate();
        }
        setters.push(parseResult.setter);
        dateStr = parseResult.rest;
      } else {
        if (firstCharacter.match(unescapedLatinCharacterRegExp2)) {
          throw new RangeError(
            "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
          );
        }
        if (token === "''") {
          token = "'";
        } else if (firstCharacter === "'") {
          token = cleanEscapedString2(token);
        }
        if (dateStr.indexOf(token) === 0) {
          dateStr = dateStr.slice(token.length);
        } else {
          return invalidDate();
        }
      }
    }
    if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {
      return invalidDate();
    }
    const uniquePrioritySetters = setters.map((setter) => setter.priority).sort((a, b) => b - a).filter((priority, index2, array) => array.indexOf(priority) === index2).map(
      (priority) => setters.filter((setter) => setter.priority === priority).sort((a, b) => b.subPriority - a.subPriority)
    ).map((setterArray) => setterArray[0]);
    let date = toDate(referenceDate, options?.in);
    if (isNaN(+date)) return invalidDate();
    const flags = {};
    for (const setter of uniquePrioritySetters) {
      if (!setter.validate(date, subFnOptions)) {
        return invalidDate();
      }
      const result = setter.set(date, flags, subFnOptions);
      if (Array.isArray(result)) {
        date = result[0];
        Object.assign(flags, result[1]);
      } else {
        date = result;
      }
    }
    return date;
  }
  function cleanEscapedString2(input) {
    return input.match(escapedStringRegExp2)[1].replace(doubleQuoteRegExp2, "'");
  }

  // node_modules/date-fns/isSameMonth.js
  function isSameMonth(laterDate, earlierDate, options) {
    const [laterDate_, earlierDate_] = normalizeDates(
      options?.in,
      laterDate,
      earlierDate
    );
    return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth();
  }

  // node_modules/date-fns/isSameYear.js
  function isSameYear(laterDate, earlierDate, options) {
    const [laterDate_, earlierDate_] = normalizeDates(
      options?.in,
      laterDate,
      earlierDate
    );
    return laterDate_.getFullYear() === earlierDate_.getFullYear();
  }

  // node_modules/date-fns/subDays.js
  function subDays(date, amount, options) {
    return addDays(date, -amount, options);
  }

  // node_modules/date-fns/parseISO.js
  function parseISO(argument, options) {
    const invalidDate = () => constructFrom(options?.in, NaN);
    const additionalDigits = options?.additionalDigits ?? 2;
    const dateStrings = splitDateString(argument);
    let date;
    if (dateStrings.date) {
      const parseYearResult = parseYear(dateStrings.date, additionalDigits);
      date = parseDate(parseYearResult.restDateString, parseYearResult.year);
    }
    if (!date || isNaN(+date)) return invalidDate();
    const timestamp = +date;
    let time = 0;
    let offset4;
    if (dateStrings.time) {
      time = parseTime(dateStrings.time);
      if (isNaN(time)) return invalidDate();
    }
    if (dateStrings.timezone) {
      offset4 = parseTimezone(dateStrings.timezone);
      if (isNaN(offset4)) return invalidDate();
    } else {
      const tmpDate = new Date(timestamp + time);
      const result = toDate(0, options?.in);
      result.setFullYear(
        tmpDate.getUTCFullYear(),
        tmpDate.getUTCMonth(),
        tmpDate.getUTCDate()
      );
      result.setHours(
        tmpDate.getUTCHours(),
        tmpDate.getUTCMinutes(),
        tmpDate.getUTCSeconds(),
        tmpDate.getUTCMilliseconds()
      );
      return result;
    }
    return toDate(timestamp + time + offset4, options?.in);
  }
  var patterns = {
    dateTimeDelimiter: /[T ]/,
    timeZoneDelimiter: /[Z ]/i,
    timezone: /([Z+-].*)$/
  };
  var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
  var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
  var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
  function splitDateString(dateString) {
    const dateStrings = {};
    const array = dateString.split(patterns.dateTimeDelimiter);
    let timeString;
    if (array.length > 2) {
      return dateStrings;
    }
    if (/:/.test(array[0])) {
      timeString = array[0];
    } else {
      dateStrings.date = array[0];
      timeString = array[1];
      if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
        dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
        timeString = dateString.substr(
          dateStrings.date.length,
          dateString.length
        );
      }
    }
    if (timeString) {
      const token = patterns.timezone.exec(timeString);
      if (token) {
        dateStrings.time = timeString.replace(token[1], "");
        dateStrings.timezone = token[1];
      } else {
        dateStrings.time = timeString;
      }
    }
    return dateStrings;
  }
  function parseYear(dateString, additionalDigits) {
    const regex = new RegExp(
      "^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)"
    );
    const captures = dateString.match(regex);
    if (!captures) return { year: NaN, restDateString: "" };
    const year = captures[1] ? parseInt(captures[1]) : null;
    const century = captures[2] ? parseInt(captures[2]) : null;
    return {
      year: century === null ? year : century * 100,
      restDateString: dateString.slice((captures[1] || captures[2]).length)
    };
  }
  function parseDate(dateString, year) {
    if (year === null) return /* @__PURE__ */ new Date(NaN);
    const captures = dateString.match(dateRegex);
    if (!captures) return /* @__PURE__ */ new Date(NaN);
    const isWeekDate = !!captures[4];
    const dayOfYear = parseDateUnit(captures[1]);
    const month = parseDateUnit(captures[2]) - 1;
    const day = parseDateUnit(captures[3]);
    const week = parseDateUnit(captures[4]);
    const dayOfWeek = parseDateUnit(captures[5]) - 1;
    if (isWeekDate) {
      if (!validateWeekDate(year, week, dayOfWeek)) {
        return /* @__PURE__ */ new Date(NaN);
      }
      return dayOfISOWeekYear(year, week, dayOfWeek);
    } else {
      const date = /* @__PURE__ */ new Date(0);
      if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
        return /* @__PURE__ */ new Date(NaN);
      }
      date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
      return date;
    }
  }
  function parseDateUnit(value) {
    return value ? parseInt(value) : 1;
  }
  function parseTime(timeString) {
    const captures = timeString.match(timeRegex);
    if (!captures) return NaN;
    const hours = parseTimeUnit(captures[1]);
    const minutes = parseTimeUnit(captures[2]);
    const seconds = parseTimeUnit(captures[3]);
    if (!validateTime(hours, minutes, seconds)) {
      return NaN;
    }
    return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3;
  }
  function parseTimeUnit(value) {
    return value && parseFloat(value.replace(",", ".")) || 0;
  }
  function parseTimezone(timezoneString) {
    if (timezoneString === "Z") return 0;
    const captures = timezoneString.match(timezoneRegex);
    if (!captures) return 0;
    const sign = captures[1] === "+" ? -1 : 1;
    const hours = parseInt(captures[2]);
    const minutes = captures[3] && parseInt(captures[3]) || 0;
    if (!validateTimezone(hours, minutes)) {
      return NaN;
    }
    return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
  }
  function dayOfISOWeekYear(isoWeekYear, week, day) {
    const date = /* @__PURE__ */ new Date(0);
    date.setUTCFullYear(isoWeekYear, 0, 4);
    const fourthOfJanuaryDay = date.getUTCDay() || 7;
    const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
    date.setUTCDate(date.getUTCDate() + diff);
    return date;
  }
  var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  function isLeapYearIndex2(year) {
    return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
  }
  function validateDate(year, month, date) {
    return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex2(year) ? 29 : 28));
  }
  function validateDayOfYearDate(year, dayOfYear) {
    return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex2(year) ? 366 : 365);
  }
  function validateWeekDate(_year, week, day) {
    return week >= 1 && week <= 53 && day >= 0 && day <= 6;
  }
  function validateTime(hours, minutes, seconds) {
    if (hours === 24) {
      return minutes === 0 && seconds === 0;
    }
    return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
  }
  function validateTimezone(_hours, minutes) {
    return minutes >= 0 && minutes <= 59;
  }

  // node_modules/date-fns/setMonth.js
  function setMonth(date, month, options) {
    const _date = toDate(date, options?.in);
    const year = _date.getFullYear();
    const day = _date.getDate();
    const midMonth = constructFrom(options?.in || date, 0);
    midMonth.setFullYear(year, month, 15);
    midMonth.setHours(0, 0, 0, 0);
    const daysInMonth = getDaysInMonth(midMonth);
    _date.setMonth(month, Math.min(day, daysInMonth));
    return _date;
  }

  // node_modules/date-fns/setYear.js
  function setYear(date, year, options) {
    const date_ = toDate(date, options?.in);
    if (isNaN(+date_)) return constructFrom(options?.in || date, NaN);
    date_.setFullYear(year);
    return date_;
  }

  // node_modules/date-fns/subMonths.js
  function subMonths(date, amount, options) {
    return addMonths(date, -amount, options);
  }

  // node_modules/date-fns/subWeeks.js
  function subWeeks(date, amount, options) {
    return addWeeks(date, -amount, options);
  }

  // node_modules/date-fns/subYears.js
  function subYears(date, amount, options) {
    return addYears(date, -amount, options);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js
  var FIVE_WEEKS = 5;
  var FOUR_WEEKS = 4;
  function getBroadcastWeeksInMonth(month, dateLib) {
    const firstDayOfMonth = dateLib.startOfMonth(month);
    const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;
    const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);
    const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);
    const numberOfWeeks = dateLib.getMonth(month) === dateLib.getMonth(lastDateOfLastWeek) ? FIVE_WEEKS : FOUR_WEEKS;
    return numberOfWeeks;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js
  function startOfBroadcastWeek(date, dateLib) {
    const firstOfMonth = dateLib.startOfMonth(date);
    const dayOfWeek = firstOfMonth.getDay();
    if (dayOfWeek === 1) {
      return firstOfMonth;
    } else if (dayOfWeek === 0) {
      return dateLib.addDays(firstOfMonth, -1 * 6);
    } else {
      return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));
    }
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js
  function endOfBroadcastWeek(date, dateLib) {
    const startDate = startOfBroadcastWeek(date, dateLib);
    const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);
    const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
    return endDate;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/locale/en-US.js
  var enUS2 = {
    ...enUS,
    labels: {
      labelDayButton: (date, modifiers, options, dateLib) => {
        let formatDate2;
        if (dateLib && typeof dateLib.format === "function") {
          formatDate2 = dateLib.format.bind(dateLib);
        } else {
          formatDate2 = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
        }
        let label = formatDate2(date, "PPPP");
        if (modifiers.today)
          label = `Today, ${label}`;
        if (modifiers.selected)
          label = `${label}, selected`;
        return label;
      },
      labelMonthDropdown: "Choose the Month",
      labelNext: "Go to the Next Month",
      labelPrevious: "Go to the Previous Month",
      labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
      labelYearDropdown: "Choose the Year",
      labelGrid: (date, options, dateLib) => {
        let formatDate2;
        if (dateLib && typeof dateLib.format === "function") {
          formatDate2 = dateLib.format.bind(dateLib);
        } else {
          formatDate2 = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
        }
        return formatDate2(date, "LLLL yyyy");
      },
      labelGridcell: (date, modifiers, options, dateLib) => {
        let formatDate2;
        if (dateLib && typeof dateLib.format === "function") {
          formatDate2 = dateLib.format.bind(dateLib);
        } else {
          formatDate2 = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
        }
        let label = formatDate2(date, "PPPP");
        if (modifiers?.today) {
          label = `Today, ${label}`;
        }
        return label;
      },
      labelNav: "Navigation bar",
      labelWeekNumberHeader: "Week Number",
      labelWeekday: (date, options, dateLib) => {
        let formatDate2;
        if (dateLib && typeof dateLib.format === "function") {
          formatDate2 = dateLib.format.bind(dateLib);
        } else {
          formatDate2 = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
        }
        return formatDate2(date, "cccc");
      }
    }
  };

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/classes/DateLib.js
  var DateLib = class _DateLib {
    /**
     * Creates an instance of `DateLib`.
     *
     * @param options Configuration options for the date library.
     * @param overrides Custom overrides for the date library functions.
     */
    constructor(options, overrides) {
      this.today = () => {
        if (this.overrides?.today) {
          return this.overrides.today();
        }
        if (this.options.timeZone) {
          return TZDate.tz(this.options.timeZone);
        }
        const DateCtor = this.options.Date ?? Date;
        return new DateCtor();
      };
      this.newDate = (year, monthIndex, date) => {
        if (this.overrides?.newDate) {
          return this.overrides.newDate(year, monthIndex, date);
        }
        if (this.options.timeZone) {
          return new TZDate(year, monthIndex, date, this.options.timeZone);
        }
        return new Date(year, monthIndex, date);
      };
      this.addDays = (date, amount) => {
        return this.overrides?.addDays ? this.overrides.addDays(date, amount) : addDays(date, amount);
      };
      this.addMonths = (date, amount) => {
        return this.overrides?.addMonths ? this.overrides.addMonths(date, amount) : addMonths(date, amount);
      };
      this.addWeeks = (date, amount) => {
        return this.overrides?.addWeeks ? this.overrides.addWeeks(date, amount) : addWeeks(date, amount);
      };
      this.addYears = (date, amount) => {
        return this.overrides?.addYears ? this.overrides.addYears(date, amount) : addYears(date, amount);
      };
      this.differenceInCalendarDays = (dateLeft, dateRight) => {
        return this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(dateLeft, dateRight) : differenceInCalendarDays(dateLeft, dateRight);
      };
      this.differenceInCalendarMonths = (dateLeft, dateRight) => {
        return this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(dateLeft, dateRight) : differenceInCalendarMonths(dateLeft, dateRight);
      };
      this.eachMonthOfInterval = (interval) => {
        return this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(interval) : eachMonthOfInterval(interval);
      };
      this.eachYearOfInterval = (interval) => {
        const years = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(interval) : eachYearOfInterval(interval);
        const uniqueYears = new Set(years.map((d) => this.getYear(d)));
        if (uniqueYears.size === years.length) {
          return years;
        }
        const yearsArray = [];
        uniqueYears.forEach((y2) => {
          yearsArray.push(new Date(y2, 0, 1));
        });
        return yearsArray;
      };
      this.endOfBroadcastWeek = (date) => {
        return this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(date) : endOfBroadcastWeek(date, this);
      };
      this.endOfISOWeek = (date) => {
        return this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(date) : endOfISOWeek(date);
      };
      this.endOfMonth = (date) => {
        return this.overrides?.endOfMonth ? this.overrides.endOfMonth(date) : endOfMonth(date);
      };
      this.endOfWeek = (date, options2) => {
        return this.overrides?.endOfWeek ? this.overrides.endOfWeek(date, options2) : endOfWeek(date, this.options);
      };
      this.endOfYear = (date) => {
        return this.overrides?.endOfYear ? this.overrides.endOfYear(date) : endOfYear(date);
      };
      this.format = (date, formatStr, _options) => {
        const formatted = this.overrides?.format ? this.overrides.format(date, formatStr, this.options) : format(date, formatStr, this.options);
        if (this.options.numerals && this.options.numerals !== "latn") {
          return this.replaceDigits(formatted);
        }
        return formatted;
      };
      this.getISOWeek = (date) => {
        return this.overrides?.getISOWeek ? this.overrides.getISOWeek(date) : getISOWeek(date);
      };
      this.getMonth = (date, _options) => {
        return this.overrides?.getMonth ? this.overrides.getMonth(date, this.options) : getMonth(date, this.options);
      };
      this.getYear = (date, _options) => {
        return this.overrides?.getYear ? this.overrides.getYear(date, this.options) : getYear(date, this.options);
      };
      this.getWeek = (date, _options) => {
        return this.overrides?.getWeek ? this.overrides.getWeek(date, this.options) : getWeek(date, this.options);
      };
      this.isAfter = (date, dateToCompare) => {
        return this.overrides?.isAfter ? this.overrides.isAfter(date, dateToCompare) : isAfter(date, dateToCompare);
      };
      this.isBefore = (date, dateToCompare) => {
        return this.overrides?.isBefore ? this.overrides.isBefore(date, dateToCompare) : isBefore(date, dateToCompare);
      };
      this.isDate = (value) => {
        return this.overrides?.isDate ? this.overrides.isDate(value) : isDate(value);
      };
      this.isSameDay = (dateLeft, dateRight) => {
        return this.overrides?.isSameDay ? this.overrides.isSameDay(dateLeft, dateRight) : isSameDay(dateLeft, dateRight);
      };
      this.isSameMonth = (dateLeft, dateRight) => {
        return this.overrides?.isSameMonth ? this.overrides.isSameMonth(dateLeft, dateRight) : isSameMonth(dateLeft, dateRight);
      };
      this.isSameYear = (dateLeft, dateRight) => {
        return this.overrides?.isSameYear ? this.overrides.isSameYear(dateLeft, dateRight) : isSameYear(dateLeft, dateRight);
      };
      this.max = (dates) => {
        return this.overrides?.max ? this.overrides.max(dates) : max2(dates);
      };
      this.min = (dates) => {
        return this.overrides?.min ? this.overrides.min(dates) : min2(dates);
      };
      this.setMonth = (date, month) => {
        return this.overrides?.setMonth ? this.overrides.setMonth(date, month) : setMonth(date, month);
      };
      this.setYear = (date, year) => {
        return this.overrides?.setYear ? this.overrides.setYear(date, year) : setYear(date, year);
      };
      this.startOfBroadcastWeek = (date, _dateLib) => {
        return this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(date, this) : startOfBroadcastWeek(date, this);
      };
      this.startOfDay = (date) => {
        return this.overrides?.startOfDay ? this.overrides.startOfDay(date) : startOfDay(date);
      };
      this.startOfISOWeek = (date) => {
        return this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(date) : startOfISOWeek(date);
      };
      this.startOfMonth = (date) => {
        return this.overrides?.startOfMonth ? this.overrides.startOfMonth(date) : startOfMonth(date);
      };
      this.startOfWeek = (date, _options) => {
        return this.overrides?.startOfWeek ? this.overrides.startOfWeek(date, this.options) : startOfWeek(date, this.options);
      };
      this.startOfYear = (date) => {
        return this.overrides?.startOfYear ? this.overrides.startOfYear(date) : startOfYear(date);
      };
      this.options = { locale: enUS2, ...options };
      this.overrides = overrides;
    }
    /**
     * Generates a mapping of Arabic digits (0-9) to the target numbering system
     * digits.
     *
     * @since 9.5.0
     * @returns A record mapping Arabic digits to the target numerals.
     */
    getDigitMap() {
      const { numerals = "latn" } = this.options;
      const formatter = new Intl.NumberFormat("en-US", {
        numberingSystem: numerals
      });
      const digitMap = {};
      for (let i = 0; i < 10; i++) {
        digitMap[i.toString()] = formatter.format(i);
      }
      return digitMap;
    }
    /**
     * Replaces Arabic digits in a string with the target numbering system digits.
     *
     * @since 9.5.0
     * @param input The string containing Arabic digits.
     * @returns The string with digits replaced.
     */
    replaceDigits(input) {
      const digitMap = this.getDigitMap();
      return input.replace(/\d/g, (digit) => digitMap[digit] || digit);
    }
    /**
     * Formats a number using the configured numbering system.
     *
     * @since 9.5.0
     * @param value The number to format.
     * @returns The formatted number as a string.
     */
    formatNumber(value) {
      return this.replaceDigits(value.toString());
    }
    /**
     * Returns the preferred ordering for month and year labels for the current
     * locale.
     */
    getMonthYearOrder() {
      const code = this.options.locale?.code;
      if (!code) {
        return "month-first";
      }
      return _DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
    }
    /**
     * Formats the month/year pair respecting locale conventions.
     *
     * @since 9.11.0
     */
    formatMonthYear(date) {
      const { locale, timeZone, numerals } = this.options;
      const localeCode = locale?.code;
      if (localeCode && _DateLib.yearFirstLocales.has(localeCode)) {
        try {
          const intl = new Intl.DateTimeFormat(localeCode, {
            month: "long",
            year: "numeric",
            timeZone,
            numberingSystem: numerals
          });
          const formatted = intl.format(date);
          return formatted;
        } catch {
        }
      }
      const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
      return this.format(date, pattern);
    }
  };
  DateLib.yearFirstLocales = /* @__PURE__ */ new Set([
    "eu",
    "hu",
    "ja",
    "ja-Hira",
    "ja-JP",
    "ko",
    "ko-KR",
    "lt",
    "lt-LT",
    "lv",
    "lv-LV",
    "mn",
    "mn-MN",
    "zh",
    "zh-CN",
    "zh-HK",
    "zh-TW"
  ]);
  var defaultDateLib = new DateLib();

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js
  var CalendarDay = class {
    constructor(date, displayMonth, dateLib = defaultDateLib) {
      this.date = date;
      this.displayMonth = displayMonth;
      this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
      this.dateLib = dateLib;
      this.isoDate = dateLib.format(date, "yyyy-MM-dd");
      this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
      this.dateMonthId = dateLib.format(date, "yyyy-MM");
    }
    /**
     * Checks if this day is equal to another `CalendarDay`, considering both the
     * date and the displayed month.
     *
     * @param day The `CalendarDay` to compare with.
     * @returns `true` if the days are equal, otherwise `false`.
     */
    isEqualTo(day) {
      return this.dateLib.isSameDay(day.date, this.date) && this.dateLib.isSameMonth(day.displayMonth, this.displayMonth);
    }
  };

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js
  var CalendarMonth = class {
    constructor(month, weeks) {
      this.date = month;
      this.weeks = weeks;
    }
  };

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js
  var CalendarWeek = class {
    constructor(weekNumber, days) {
      this.days = days;
      this.weekNumber = weekNumber;
    }
  };

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/custom-components.js
  var custom_components_exports = {};
  __export(custom_components_exports, {
    CaptionLabel: () => CaptionLabel,
    Chevron: () => Chevron,
    Day: () => Day,
    DayButton: () => DayButton,
    Dropdown: () => Dropdown,
    DropdownNav: () => DropdownNav,
    Footer: () => Footer,
    Month: () => Month,
    MonthCaption: () => MonthCaption,
    MonthGrid: () => MonthGrid,
    Months: () => Months,
    MonthsDropdown: () => MonthsDropdown,
    Nav: () => Nav,
    NextMonthButton: () => NextMonthButton,
    Option: () => Option,
    PreviousMonthButton: () => PreviousMonthButton,
    Root: () => Root3,
    Select: () => Select,
    Week: () => Week,
    WeekNumber: () => WeekNumber,
    WeekNumberHeader: () => WeekNumberHeader,
    Weekday: () => Weekday,
    Weekdays: () => Weekdays,
    Weeks: () => Weeks,
    YearsDropdown: () => YearsDropdown
  });

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js
  var import_react6 = __toESM(require_react(), 1);
  function CaptionLabel(props) {
    return import_react6.default.createElement("span", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Chevron.js
  var import_react7 = __toESM(require_react(), 1);
  function Chevron(props) {
    const { size: size4 = 24, orientation = "left", className, style } = props;
    return import_react7.default.createElement(
      "svg",
      { className, style, width: size4, height: size4, viewBox: "0 0 24 24" },
      orientation === "up" && import_react7.default.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
      orientation === "down" && import_react7.default.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
      orientation === "left" && import_react7.default.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
      orientation === "right" && import_react7.default.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
    );
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Day.js
  var import_react8 = __toESM(require_react(), 1);
  function Day(props) {
    const { day, modifiers, ...tdProps } = props;
    return import_react8.default.createElement("td", { ...tdProps });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/DayButton.js
  var import_react9 = __toESM(require_react(), 1);
  function DayButton(props) {
    const { day, modifiers, ...buttonProps } = props;
    const ref = import_react9.default.useRef(null);
    import_react9.default.useEffect(() => {
      if (modifiers.focused)
        ref.current?.focus();
    }, [modifiers.focused]);
    return import_react9.default.createElement("button", { ref, ...buttonProps });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Dropdown.js
  var import_react11 = __toESM(require_react(), 1);

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/UI.js
  var UI;
  (function(UI2) {
    UI2["Root"] = "root";
    UI2["Chevron"] = "chevron";
    UI2["Day"] = "day";
    UI2["DayButton"] = "day_button";
    UI2["CaptionLabel"] = "caption_label";
    UI2["Dropdowns"] = "dropdowns";
    UI2["Dropdown"] = "dropdown";
    UI2["DropdownRoot"] = "dropdown_root";
    UI2["Footer"] = "footer";
    UI2["MonthGrid"] = "month_grid";
    UI2["MonthCaption"] = "month_caption";
    UI2["MonthsDropdown"] = "months_dropdown";
    UI2["Month"] = "month";
    UI2["Months"] = "months";
    UI2["Nav"] = "nav";
    UI2["NextMonthButton"] = "button_next";
    UI2["PreviousMonthButton"] = "button_previous";
    UI2["Week"] = "week";
    UI2["Weeks"] = "weeks";
    UI2["Weekday"] = "weekday";
    UI2["Weekdays"] = "weekdays";
    UI2["WeekNumber"] = "week_number";
    UI2["WeekNumberHeader"] = "week_number_header";
    UI2["YearsDropdown"] = "years_dropdown";
  })(UI || (UI = {}));
  var DayFlag;
  (function(DayFlag2) {
    DayFlag2["disabled"] = "disabled";
    DayFlag2["hidden"] = "hidden";
    DayFlag2["outside"] = "outside";
    DayFlag2["focused"] = "focused";
    DayFlag2["today"] = "today";
  })(DayFlag || (DayFlag = {}));
  var SelectionState;
  (function(SelectionState2) {
    SelectionState2["range_end"] = "range_end";
    SelectionState2["range_middle"] = "range_middle";
    SelectionState2["range_start"] = "range_start";
    SelectionState2["selected"] = "selected";
  })(SelectionState || (SelectionState = {}));
  var Animation;
  (function(Animation2) {
    Animation2["weeks_before_enter"] = "weeks_before_enter";
    Animation2["weeks_before_exit"] = "weeks_before_exit";
    Animation2["weeks_after_enter"] = "weeks_after_enter";
    Animation2["weeks_after_exit"] = "weeks_after_exit";
    Animation2["caption_after_enter"] = "caption_after_enter";
    Animation2["caption_after_exit"] = "caption_after_exit";
    Animation2["caption_before_enter"] = "caption_before_enter";
    Animation2["caption_before_exit"] = "caption_before_exit";
  })(Animation || (Animation = {}));

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/useDayPicker.js
  var import_react10 = __toESM(require_react(), 1);
  var dayPickerContext = (0, import_react10.createContext)(void 0);
  function useDayPicker() {
    const context = (0, import_react10.useContext)(dayPickerContext);
    if (context === void 0) {
      throw new Error("useDayPicker() must be used within a custom component.");
    }
    return context;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Dropdown.js
  function Dropdown(props) {
    const { options, className, ...selectProps } = props;
    const { classNames, components, styles } = useDayPicker();
    const cssClassSelect = [classNames[UI.Dropdown], className].join(" ");
    const selectedOption = options?.find(({ value }) => value === selectProps.value);
    return import_react11.default.createElement(
      "span",
      { "data-disabled": selectProps.disabled, className: classNames[UI.DropdownRoot], style: styles?.[UI.DropdownRoot] },
      import_react11.default.createElement(components.Select, { className: cssClassSelect, ...selectProps }, options?.map(({ value, label, disabled: disabled2 }) => import_react11.default.createElement(components.Option, { key: value, value, disabled: disabled2 }, label))),
      import_react11.default.createElement(
        "span",
        { className: classNames[UI.CaptionLabel], style: styles?.[UI.CaptionLabel], "aria-hidden": true },
        selectedOption?.label,
        import_react11.default.createElement(components.Chevron, { orientation: "down", size: 18, className: classNames[UI.Chevron], style: styles?.[UI.Chevron] })
      )
    );
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/DropdownNav.js
  var import_react12 = __toESM(require_react(), 1);
  function DropdownNav(props) {
    return import_react12.default.createElement("div", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Footer.js
  var import_react13 = __toESM(require_react(), 1);
  function Footer(props) {
    return import_react13.default.createElement("div", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Month.js
  var import_react14 = __toESM(require_react(), 1);
  function Month(props) {
    const { calendarMonth, displayIndex, ...divProps } = props;
    return import_react14.default.createElement("div", { ...divProps }, props.children);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/MonthCaption.js
  var import_react15 = __toESM(require_react(), 1);
  function MonthCaption(props) {
    const { calendarMonth, displayIndex, ...divProps } = props;
    return import_react15.default.createElement("div", { ...divProps });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/MonthGrid.js
  var import_react16 = __toESM(require_react(), 1);
  function MonthGrid(props) {
    return import_react16.default.createElement("table", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Months.js
  var import_react17 = __toESM(require_react(), 1);
  function Months(props) {
    return import_react17.default.createElement("div", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js
  var import_react18 = __toESM(require_react(), 1);
  function MonthsDropdown(props) {
    const { components } = useDayPicker();
    return import_react18.default.createElement(components.Dropdown, { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Nav.js
  var import_react19 = __toESM(require_react(), 1);
  function Nav(props) {
    const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;
    const { components, classNames, styles, labels: { labelPrevious: labelPrevious2, labelNext: labelNext2 } } = useDayPicker();
    const handleNextClick = (0, import_react19.useCallback)((e) => {
      if (nextMonth) {
        onNextClick?.(e);
      }
    }, [nextMonth, onNextClick]);
    const handlePreviousClick = (0, import_react19.useCallback)((e) => {
      if (previousMonth) {
        onPreviousClick?.(e);
      }
    }, [previousMonth, onPreviousClick]);
    return import_react19.default.createElement(
      "nav",
      { ...navProps },
      import_react19.default.createElement(
        components.PreviousMonthButton,
        { type: "button", className: classNames[UI.PreviousMonthButton], style: styles?.[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick },
        import_react19.default.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], style: styles?.[UI.Chevron], orientation: "left" })
      ),
      import_react19.default.createElement(
        components.NextMonthButton,
        { type: "button", className: classNames[UI.NextMonthButton], style: styles?.[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick },
        import_react19.default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, orientation: "right", className: classNames[UI.Chevron], style: styles?.[UI.Chevron] })
      )
    );
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js
  var import_react20 = __toESM(require_react(), 1);
  function NextMonthButton(props) {
    return import_react20.default.createElement("button", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Option.js
  var import_react21 = __toESM(require_react(), 1);
  function Option(props) {
    return import_react21.default.createElement("option", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js
  var import_react22 = __toESM(require_react(), 1);
  function PreviousMonthButton(props) {
    return import_react22.default.createElement("button", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Root.js
  var import_react23 = __toESM(require_react(), 1);
  function Root3(props) {
    const { rootRef, ...rest } = props;
    return import_react23.default.createElement("div", { ...rest, ref: rootRef });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Select.js
  var import_react24 = __toESM(require_react(), 1);
  function Select(props) {
    return import_react24.default.createElement("select", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Week.js
  var import_react25 = __toESM(require_react(), 1);
  function Week(props) {
    const { week, ...trProps } = props;
    return import_react25.default.createElement("tr", { ...trProps });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Weekday.js
  var import_react26 = __toESM(require_react(), 1);
  function Weekday(props) {
    return import_react26.default.createElement("th", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Weekdays.js
  var import_react27 = __toESM(require_react(), 1);
  function Weekdays(props) {
    return import_react27.default.createElement(
      "thead",
      { "aria-hidden": true },
      import_react27.default.createElement("tr", { ...props })
    );
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/WeekNumber.js
  var import_react28 = __toESM(require_react(), 1);
  function WeekNumber(props) {
    const { week, ...thProps } = props;
    return import_react28.default.createElement("th", { ...thProps });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js
  var import_react29 = __toESM(require_react(), 1);
  function WeekNumberHeader(props) {
    return import_react29.default.createElement("th", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/Weeks.js
  var import_react30 = __toESM(require_react(), 1);
  function Weeks(props) {
    return import_react30.default.createElement("tbody", { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js
  var import_react31 = __toESM(require_react(), 1);
  function YearsDropdown(props) {
    const { components } = useDayPicker();
    return import_react31.default.createElement(components.Dropdown, { ...props });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/DayPicker.js
  var import_react36 = __toESM(require_react(), 1);

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js
  function rangeIncludesDate(range, date, excludeEnds = false, dateLib = defaultDateLib) {
    let { from, to } = range;
    const { differenceInCalendarDays: differenceInCalendarDays2, isSameDay: isSameDay2 } = dateLib;
    if (from && to) {
      const isRangeInverted = differenceInCalendarDays2(to, from) < 0;
      if (isRangeInverted) {
        [from, to] = [to, from];
      }
      const isInRange = differenceInCalendarDays2(date, from) >= (excludeEnds ? 1 : 0) && differenceInCalendarDays2(to, date) >= (excludeEnds ? 1 : 0);
      return isInRange;
    }
    if (!excludeEnds && to) {
      return isSameDay2(to, date);
    }
    if (!excludeEnds && from) {
      return isSameDay2(from, date);
    }
    return false;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/typeguards.js
  function isDateInterval(matcher) {
    return Boolean(matcher && typeof matcher === "object" && "before" in matcher && "after" in matcher);
  }
  function isDateRange(value) {
    return Boolean(value && typeof value === "object" && "from" in value);
  }
  function isDateAfterType(value) {
    return Boolean(value && typeof value === "object" && "after" in value);
  }
  function isDateBeforeType(value) {
    return Boolean(value && typeof value === "object" && "before" in value);
  }
  function isDayOfWeekType(value) {
    return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
  }
  function isDatesArray(value, dateLib) {
    return Array.isArray(value) && value.every(dateLib.isDate);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js
  function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
    const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;
    const { isSameDay: isSameDay2, differenceInCalendarDays: differenceInCalendarDays2, isAfter: isAfter2 } = dateLib;
    return matchersArr.some((matcher) => {
      if (typeof matcher === "boolean") {
        return matcher;
      }
      if (dateLib.isDate(matcher)) {
        return isSameDay2(date, matcher);
      }
      if (isDatesArray(matcher, dateLib)) {
        return matcher.some((matcherDate) => isSameDay2(date, matcherDate));
      }
      if (isDateRange(matcher)) {
        return rangeIncludesDate(matcher, date, false, dateLib);
      }
      if (isDayOfWeekType(matcher)) {
        if (!Array.isArray(matcher.dayOfWeek)) {
          return matcher.dayOfWeek === date.getDay();
        }
        return matcher.dayOfWeek.includes(date.getDay());
      }
      if (isDateInterval(matcher)) {
        const diffBefore = differenceInCalendarDays2(matcher.before, date);
        const diffAfter = differenceInCalendarDays2(matcher.after, date);
        const isDayBefore = diffBefore > 0;
        const isDayAfter = diffAfter < 0;
        const isClosedInterval = isAfter2(matcher.before, matcher.after);
        if (isClosedInterval) {
          return isDayAfter && isDayBefore;
        } else {
          return isDayBefore || isDayAfter;
        }
      }
      if (isDateAfterType(matcher)) {
        return differenceInCalendarDays2(date, matcher.after) > 0;
      }
      if (isDateBeforeType(matcher)) {
        return differenceInCalendarDays2(matcher.before, date) > 0;
      }
      if (typeof matcher === "function") {
        return matcher(date);
      }
      return false;
    });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js
  function createGetModifiers(days, props, navStart, navEnd, dateLib) {
    const { disabled: disabled2, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today() } = props;
    const { isSameDay: isSameDay2, isSameMonth: isSameMonth2, startOfMonth: startOfMonth2, isBefore: isBefore2, endOfMonth: endOfMonth2, isAfter: isAfter2 } = dateLib;
    const computedNavStart = navStart && startOfMonth2(navStart);
    const computedNavEnd = navEnd && endOfMonth2(navEnd);
    const internalModifiersMap = {
      [DayFlag.focused]: [],
      [DayFlag.outside]: [],
      [DayFlag.disabled]: [],
      [DayFlag.hidden]: [],
      [DayFlag.today]: []
    };
    const customModifiersMap = {};
    for (const day of days) {
      const { date, displayMonth } = day;
      const isOutside = Boolean(displayMonth && !isSameMonth2(date, displayMonth));
      const isBeforeNavStart = Boolean(computedNavStart && isBefore2(date, computedNavStart));
      const isAfterNavEnd = Boolean(computedNavEnd && isAfter2(date, computedNavEnd));
      const isDisabled = Boolean(disabled2 && dateMatchModifiers(date, disabled2, dateLib));
      const isHidden2 = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) || isBeforeNavStart || isAfterNavEnd || // Broadcast calendar will show outside days as default
      !broadcastCalendar && !showOutsideDays && isOutside || broadcastCalendar && showOutsideDays === false && isOutside;
      const isToday = isSameDay2(date, today);
      if (isOutside)
        internalModifiersMap.outside.push(day);
      if (isDisabled)
        internalModifiersMap.disabled.push(day);
      if (isHidden2)
        internalModifiersMap.hidden.push(day);
      if (isToday)
        internalModifiersMap.today.push(day);
      if (modifiers) {
        Object.keys(modifiers).forEach((name) => {
          const modifierValue = modifiers?.[name];
          const isMatch = modifierValue ? dateMatchModifiers(date, modifierValue, dateLib) : false;
          if (!isMatch)
            return;
          if (customModifiersMap[name]) {
            customModifiersMap[name].push(day);
          } else {
            customModifiersMap[name] = [day];
          }
        });
      }
    }
    return (day) => {
      const dayFlags = {
        [DayFlag.focused]: false,
        [DayFlag.disabled]: false,
        [DayFlag.hidden]: false,
        [DayFlag.outside]: false,
        [DayFlag.today]: false
      };
      const customModifiers = {};
      for (const name in internalModifiersMap) {
        const days2 = internalModifiersMap[name];
        dayFlags[name] = days2.some((d) => d === day);
      }
      for (const name in customModifiersMap) {
        customModifiers[name] = customModifiersMap[name].some((d) => d === day);
      }
      return {
        ...dayFlags,
        // custom modifiers should override all the previous ones
        ...customModifiers
      };
    };
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js
  function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {
    const modifierClassNames = Object.entries(modifiers).filter(([, active]) => active === true).reduce((previousValue, [key]) => {
      if (modifiersClassNames[key]) {
        previousValue.push(modifiersClassNames[key]);
      } else if (classNames[DayFlag[key]]) {
        previousValue.push(classNames[DayFlag[key]]);
      } else if (classNames[SelectionState[key]]) {
        previousValue.push(classNames[SelectionState[key]]);
      }
      return previousValue;
    }, [classNames[UI.Day]]);
    return modifierClassNames;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getComponents.js
  function getComponents(customComponents) {
    return {
      ...custom_components_exports,
      ...customComponents
    };
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js
  function getDataAttributes(props) {
    const dataAttributes = {
      "data-mode": props.mode ?? void 0,
      "data-required": "required" in props ? props.required : void 0,
      "data-multiple-months": props.numberOfMonths && props.numberOfMonths > 1 || void 0,
      "data-week-numbers": props.showWeekNumber || void 0,
      "data-broadcast-calendar": props.broadcastCalendar || void 0,
      "data-nav-layout": props.navLayout || void 0
    };
    Object.entries(props).forEach(([key, val]) => {
      if (key.startsWith("data-")) {
        dataAttributes[key] = val;
      }
    });
    return dataAttributes;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js
  function getDefaultClassNames() {
    const classNames = {};
    for (const key in UI) {
      classNames[UI[key]] = `rdp-${UI[key]}`;
    }
    for (const key in DayFlag) {
      classNames[DayFlag[key]] = `rdp-${DayFlag[key]}`;
    }
    for (const key in SelectionState) {
      classNames[SelectionState[key]] = `rdp-${SelectionState[key]}`;
    }
    for (const key in Animation) {
      classNames[Animation[key]] = `rdp-${Animation[key]}`;
    }
    return classNames;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/formatters/index.js
  var formatters_exports = {};
  __export(formatters_exports, {
    formatCaption: () => formatCaption,
    formatDay: () => formatDay,
    formatMonthDropdown: () => formatMonthDropdown,
    formatWeekNumber: () => formatWeekNumber,
    formatWeekNumberHeader: () => formatWeekNumberHeader,
    formatWeekdayName: () => formatWeekdayName,
    formatYearDropdown: () => formatYearDropdown
  });

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js
  function formatCaption(month, options, dateLib) {
    const lib = dateLib ?? new DateLib(options);
    return lib.formatMonthYear(month);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/formatters/formatDay.js
  function formatDay(date, options, dateLib) {
    return (dateLib ?? new DateLib(options)).format(date, "d");
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js
  function formatMonthDropdown(month, dateLib = defaultDateLib) {
    return dateLib.format(month, "LLLL");
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js
  function formatWeekdayName(weekday, options, dateLib) {
    return (dateLib ?? new DateLib(options)).format(weekday, "cccccc");
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js
  function formatWeekNumber(weekNumber, dateLib = defaultDateLib) {
    if (weekNumber < 10) {
      return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);
    }
    return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js
  function formatWeekNumberHeader() {
    return ``;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js
  function formatYearDropdown(year, dateLib = defaultDateLib) {
    return dateLib.format(year, "yyyy");
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js
  function getFormatters(customFormatters) {
    return {
      ...formatters_exports,
      ...customFormatters
    };
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/index.js
  var labels_exports = {};
  __export(labels_exports, {
    labelDayButton: () => labelDayButton,
    labelGrid: () => labelGrid,
    labelGridcell: () => labelGridcell,
    labelMonthDropdown: () => labelMonthDropdown,
    labelNav: () => labelNav,
    labelNext: () => labelNext,
    labelPrevious: () => labelPrevious,
    labelWeekNumber: () => labelWeekNumber,
    labelWeekNumberHeader: () => labelWeekNumberHeader,
    labelWeekday: () => labelWeekday,
    labelYearDropdown: () => labelYearDropdown
  });

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js
  function labelDayButton(date, modifiers, options, dateLib) {
    let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
    if (modifiers.today)
      label = `Today, ${label}`;
    if (modifiers.selected)
      label = `${label}, selected`;
    return label;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelGrid.js
  function labelGrid(date, options, dateLib) {
    const lib = dateLib ?? new DateLib(options);
    return lib.formatMonthYear(date);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js
  function labelGridcell(date, modifiers, options, dateLib) {
    let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
    if (modifiers?.today) {
      label = `Today, ${label}`;
    }
    return label;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js
  function labelMonthDropdown(_options) {
    return "Choose the Month";
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelNav.js
  function labelNav() {
    return "";
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelNext.js
  var defaultLabel = "Go to the Next Month";
  function labelNext(_month, _options) {
    return defaultLabel;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js
  function labelPrevious(_month) {
    return "Go to the Previous Month";
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js
  function labelWeekday(date, options, dateLib) {
    return (dateLib ?? new DateLib(options)).format(date, "cccc");
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js
  function labelWeekNumber(weekNumber, _options) {
    return `Week ${weekNumber}`;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js
  function labelWeekNumberHeader(_options) {
    return "Week Number";
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js
  function labelYearDropdown(_options) {
    return "Choose the Year";
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getLabels.js
  var resolveLabel = (defaultLabel2, customLabel, localeLabel) => {
    if (customLabel)
      return customLabel;
    if (localeLabel) {
      return typeof localeLabel === "function" ? localeLabel : (..._args) => localeLabel;
    }
    return defaultLabel2;
  };
  function getLabels(customLabels, options) {
    const localeLabels = options.locale?.labels ?? {};
    return {
      ...labels_exports,
      ...customLabels ?? {},
      labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
      labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
      labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
      labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
      labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
      labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
      labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
      labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
      labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
      labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
      labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday)
    };
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js
  function getMonthOptions(displayMonth, navStart, navEnd, formatters2, dateLib) {
    const { startOfMonth: startOfMonth2, startOfYear: startOfYear2, endOfYear: endOfYear2, eachMonthOfInterval: eachMonthOfInterval2, getMonth: getMonth2 } = dateLib;
    const months = eachMonthOfInterval2({
      start: startOfYear2(displayMonth),
      end: endOfYear2(displayMonth)
    });
    const options = months.map((month) => {
      const label = formatters2.formatMonthDropdown(month, dateLib);
      const value = getMonth2(month);
      const disabled2 = navStart && month < startOfMonth2(navStart) || navEnd && month > startOfMonth2(navEnd) || false;
      return { value, label, disabled: disabled2 };
    });
    return options;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js
  function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
    let style = { ...styles?.[UI.Day] };
    Object.entries(dayModifiers).filter(([, active]) => active === true).forEach(([modifier]) => {
      style = {
        ...style,
        ...modifiersStyles?.[modifier]
      };
    });
    return style;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js
  function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
    const referenceToday = today ?? dateLib.today();
    const start = broadcastCalendar ? dateLib.startOfBroadcastWeek(referenceToday, dateLib) : ISOWeek ? dateLib.startOfISOWeek(referenceToday) : dateLib.startOfWeek(referenceToday);
    const days = [];
    for (let i = 0; i < 7; i++) {
      const day = dateLib.addDays(start, i);
      days.push(day);
    }
    return days;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js
  function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false) {
    if (!navStart)
      return void 0;
    if (!navEnd)
      return void 0;
    const { startOfYear: startOfYear2, endOfYear: endOfYear2, eachYearOfInterval: eachYearOfInterval2, getYear: getYear2 } = dateLib;
    const firstNavYear = startOfYear2(navStart);
    const lastNavYear = endOfYear2(navEnd);
    const years = eachYearOfInterval2({ start: firstNavYear, end: lastNavYear });
    if (reverse)
      years.reverse();
    return years.map((year) => {
      const label = formatters2.formatYearDropdown(year, dateLib);
      return {
        value: getYear2(year),
        label,
        disabled: false
      };
    });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/noonDateLib.js
  function createNoonOverrides(timeZone, options = {}) {
    const { weekStartsOn, locale } = options;
    const fallbackWeekStartsOn = weekStartsOn ?? locale?.options?.weekStartsOn ?? 0;
    const toNoonTZDate = (date) => {
      const normalizedDate = typeof date === "number" || typeof date === "string" ? new Date(date) : date;
      return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
    };
    const toCalendarDate2 = (date) => {
      const zoned = toNoonTZDate(date);
      return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
    };
    return {
      today: () => {
        return toNoonTZDate(TZDate.tz(timeZone));
      },
      newDate: (year, monthIndex, date) => {
        return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
      },
      startOfDay: (date) => {
        return toNoonTZDate(date);
      },
      startOfWeek: (date, options2) => {
        const base = toNoonTZDate(date);
        const weekStartsOnValue = options2?.weekStartsOn ?? fallbackWeekStartsOn;
        const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
        base.setDate(base.getDate() - diff);
        return base;
      },
      startOfISOWeek: (date) => {
        const base = toNoonTZDate(date);
        const diff = (base.getDay() - 1 + 7) % 7;
        base.setDate(base.getDate() - diff);
        return base;
      },
      startOfMonth: (date) => {
        const base = toNoonTZDate(date);
        base.setDate(1);
        return base;
      },
      startOfYear: (date) => {
        const base = toNoonTZDate(date);
        base.setMonth(0, 1);
        return base;
      },
      endOfWeek: (date, options2) => {
        const base = toNoonTZDate(date);
        const weekStartsOnValue = options2?.weekStartsOn ?? fallbackWeekStartsOn;
        const endDow = (weekStartsOnValue + 6) % 7;
        const diff = (endDow - base.getDay() + 7) % 7;
        base.setDate(base.getDate() + diff);
        return base;
      },
      endOfISOWeek: (date) => {
        const base = toNoonTZDate(date);
        const diff = (7 - base.getDay()) % 7;
        base.setDate(base.getDate() + diff);
        return base;
      },
      endOfMonth: (date) => {
        const base = toNoonTZDate(date);
        base.setMonth(base.getMonth() + 1, 0);
        return base;
      },
      endOfYear: (date) => {
        const base = toNoonTZDate(date);
        base.setMonth(11, 31);
        return base;
      },
      eachMonthOfInterval: (interval) => {
        const start = toNoonTZDate(interval.start);
        const end = toNoonTZDate(interval.end);
        const result = [];
        const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
        const endKey = end.getFullYear() * 12 + end.getMonth();
        while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
          result.push(new TZDate(cursor, timeZone));
          cursor.setMonth(cursor.getMonth() + 1, 1);
        }
        return result;
      },
      // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
      // mutate the same TZDate, and return it.
      addDays: (date, amount) => {
        const base = toNoonTZDate(date);
        base.setDate(base.getDate() + amount);
        return base;
      },
      addWeeks: (date, amount) => {
        const base = toNoonTZDate(date);
        base.setDate(base.getDate() + amount * 7);
        return base;
      },
      addMonths: (date, amount) => {
        const base = toNoonTZDate(date);
        base.setMonth(base.getMonth() + amount);
        return base;
      },
      addYears: (date, amount) => {
        const base = toNoonTZDate(date);
        base.setFullYear(base.getFullYear() + amount);
        return base;
      },
      eachYearOfInterval: (interval) => {
        const start = toNoonTZDate(interval.start);
        const end = toNoonTZDate(interval.end);
        const years = [];
        const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
        while (cursor.getFullYear() <= end.getFullYear()) {
          years.push(new TZDate(cursor, timeZone));
          cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
        }
        return years;
      },
      getWeek: (date, options2) => {
        const base = toCalendarDate2(date);
        return getWeek(base, {
          weekStartsOn: options2?.weekStartsOn ?? fallbackWeekStartsOn,
          firstWeekContainsDate: options2?.firstWeekContainsDate ?? locale?.options?.firstWeekContainsDate ?? 1
        });
      },
      getISOWeek: (date) => {
        const base = toCalendarDate2(date);
        return getISOWeek(base);
      },
      differenceInCalendarDays: (dateLeft, dateRight) => {
        const left = toCalendarDate2(dateLeft);
        const right = toCalendarDate2(dateRight);
        return differenceInCalendarDays(left, right);
      },
      differenceInCalendarMonths: (dateLeft, dateRight) => {
        const left = toCalendarDate2(dateLeft);
        const right = toCalendarDate2(dateRight);
        return differenceInCalendarMonths(left, right);
      }
    };
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/useAnimation.js
  var import_react32 = __toESM(require_react(), 1);
  var asHtmlElement = (element) => {
    if (element instanceof HTMLElement)
      return element;
    return null;
  };
  var queryMonthEls = (element) => [
    ...element.querySelectorAll("[data-animated-month]") ?? []
  ];
  var queryMonthEl = (element) => asHtmlElement(element.querySelector("[data-animated-month]"));
  var queryCaptionEl = (element) => asHtmlElement(element.querySelector("[data-animated-caption]"));
  var queryWeeksEl = (element) => asHtmlElement(element.querySelector("[data-animated-weeks]"));
  var queryNavEl = (element) => asHtmlElement(element.querySelector("[data-animated-nav]"));
  var queryWeekdaysEl = (element) => asHtmlElement(element.querySelector("[data-animated-weekdays]"));
  function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib }) {
    const previousRootElSnapshotRef = (0, import_react32.useRef)(null);
    const previousMonthsRef = (0, import_react32.useRef)(months);
    const animatingRef = (0, import_react32.useRef)(false);
    (0, import_react32.useLayoutEffect)(() => {
      const previousMonths = previousMonthsRef.current;
      previousMonthsRef.current = months;
      if (!enabled || !rootElRef.current || // safety check because the ref can be set to anything by consumers
      !(rootElRef.current instanceof HTMLElement) || // validation required for the animation to work as expected
      months.length === 0 || previousMonths.length === 0 || months.length !== previousMonths.length) {
        return;
      }
      const isSameMonth2 = dateLib.isSameMonth(months[0].date, previousMonths[0].date);
      const isAfterPreviousMonth = dateLib.isAfter(months[0].date, previousMonths[0].date);
      const captionAnimationClass = isAfterPreviousMonth ? classNames[Animation.caption_after_enter] : classNames[Animation.caption_before_enter];
      const weeksAnimationClass = isAfterPreviousMonth ? classNames[Animation.weeks_after_enter] : classNames[Animation.weeks_before_enter];
      const previousRootElSnapshot = previousRootElSnapshotRef.current;
      const rootElSnapshot = rootElRef.current.cloneNode(true);
      if (rootElSnapshot instanceof HTMLElement) {
        const currentMonthElsSnapshot = queryMonthEls(rootElSnapshot);
        currentMonthElsSnapshot.forEach((currentMonthElSnapshot) => {
          if (!(currentMonthElSnapshot instanceof HTMLElement))
            return;
          const previousMonthElSnapshot = queryMonthEl(currentMonthElSnapshot);
          if (previousMonthElSnapshot && currentMonthElSnapshot.contains(previousMonthElSnapshot)) {
            currentMonthElSnapshot.removeChild(previousMonthElSnapshot);
          }
          const captionEl = queryCaptionEl(currentMonthElSnapshot);
          if (captionEl) {
            captionEl.classList.remove(captionAnimationClass);
          }
          const weeksEl = queryWeeksEl(currentMonthElSnapshot);
          if (weeksEl) {
            weeksEl.classList.remove(weeksAnimationClass);
          }
        });
        previousRootElSnapshotRef.current = rootElSnapshot;
      } else {
        previousRootElSnapshotRef.current = null;
      }
      if (animatingRef.current || isSameMonth2 || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
      focused) {
        return;
      }
      const previousMonthEls = previousRootElSnapshot instanceof HTMLElement ? queryMonthEls(previousRootElSnapshot) : [];
      const currentMonthEls = queryMonthEls(rootElRef.current);
      if (currentMonthEls?.every((el) => el instanceof HTMLElement) && previousMonthEls?.every((el) => el instanceof HTMLElement)) {
        animatingRef.current = true;
        const cleanUpFunctions = [];
        rootElRef.current.style.isolation = "isolate";
        const navEl = queryNavEl(rootElRef.current);
        if (navEl) {
          navEl.style.zIndex = "1";
        }
        currentMonthEls.forEach((currentMonthEl, index2) => {
          const previousMonthEl = previousMonthEls[index2];
          if (!previousMonthEl) {
            return;
          }
          currentMonthEl.style.position = "relative";
          currentMonthEl.style.overflow = "hidden";
          const captionEl = queryCaptionEl(currentMonthEl);
          if (captionEl) {
            captionEl.classList.add(captionAnimationClass);
          }
          const weeksEl = queryWeeksEl(currentMonthEl);
          if (weeksEl) {
            weeksEl.classList.add(weeksAnimationClass);
          }
          const cleanUp = () => {
            animatingRef.current = false;
            if (rootElRef.current) {
              rootElRef.current.style.isolation = "";
            }
            if (navEl) {
              navEl.style.zIndex = "";
            }
            if (captionEl) {
              captionEl.classList.remove(captionAnimationClass);
            }
            if (weeksEl) {
              weeksEl.classList.remove(weeksAnimationClass);
            }
            currentMonthEl.style.position = "";
            currentMonthEl.style.overflow = "";
            if (currentMonthEl.contains(previousMonthEl)) {
              currentMonthEl.removeChild(previousMonthEl);
            }
          };
          cleanUpFunctions.push(cleanUp);
          previousMonthEl.style.pointerEvents = "none";
          previousMonthEl.style.position = "absolute";
          previousMonthEl.style.overflow = "hidden";
          previousMonthEl.setAttribute("aria-hidden", "true");
          const previousWeekdaysEl = queryWeekdaysEl(previousMonthEl);
          if (previousWeekdaysEl) {
            previousWeekdaysEl.style.opacity = "0";
          }
          const previousCaptionEl = queryCaptionEl(previousMonthEl);
          if (previousCaptionEl) {
            previousCaptionEl.classList.add(isAfterPreviousMonth ? classNames[Animation.caption_before_exit] : classNames[Animation.caption_after_exit]);
            previousCaptionEl.addEventListener("animationend", cleanUp);
          }
          const previousWeeksEl = queryWeeksEl(previousMonthEl);
          if (previousWeeksEl) {
            previousWeeksEl.classList.add(isAfterPreviousMonth ? classNames[Animation.weeks_before_exit] : classNames[Animation.weeks_after_exit]);
          }
          currentMonthEl.insertBefore(previousMonthEl, currentMonthEl.firstChild);
        });
      }
    });
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/useCalendar.js
  var import_react34 = __toESM(require_react(), 1);

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getDates.js
  function getDates(displayMonths, maxDate, props, dateLib) {
    const firstMonth = displayMonths[0];
    const lastMonth = displayMonths[displayMonths.length - 1];
    const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};
    const { addDays: addDays2, differenceInCalendarDays: differenceInCalendarDays2, differenceInCalendarMonths: differenceInCalendarMonths2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfMonth: endOfMonth2, endOfWeek: endOfWeek2, isAfter: isAfter2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
    const startWeekFirstDate = broadcastCalendar ? startOfBroadcastWeek2(firstMonth, dateLib) : ISOWeek ? startOfISOWeek2(firstMonth) : startOfWeek2(firstMonth);
    const displayMonthsWeekEnd = broadcastCalendar ? endOfBroadcastWeek2(lastMonth) : ISOWeek ? endOfISOWeek2(endOfMonth2(lastMonth)) : endOfWeek2(endOfMonth2(lastMonth));
    const constraintWeekEnd = maxDate && (broadcastCalendar ? endOfBroadcastWeek2(maxDate) : ISOWeek ? endOfISOWeek2(maxDate) : endOfWeek2(maxDate));
    const gridEndDate = constraintWeekEnd && isAfter2(displayMonthsWeekEnd, constraintWeekEnd) ? constraintWeekEnd : displayMonthsWeekEnd;
    const nOfDays = differenceInCalendarDays2(gridEndDate, startWeekFirstDate);
    const nOfMonths = differenceInCalendarMonths2(lastMonth, firstMonth) + 1;
    const dates = [];
    for (let i = 0; i <= nOfDays; i++) {
      const date = addDays2(startWeekFirstDate, i);
      dates.push(date);
    }
    const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;
    const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;
    if (fixedWeeks && dates.length < extraDates) {
      const daysToAdd = extraDates - dates.length;
      for (let i = 0; i < daysToAdd; i++) {
        const date = addDays2(dates[dates.length - 1], 1);
        dates.push(date);
      }
    }
    return dates;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getDays.js
  function getDays(calendarMonths) {
    const initialDays = [];
    return calendarMonths.reduce((days, month) => {
      const weekDays = month.weeks.reduce((weekDays2, week) => {
        return weekDays2.concat(week.days.slice());
      }, initialDays.slice());
      return days.concat(weekDays.slice());
    }, initialDays.slice());
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js
  function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {
    const { numberOfMonths = 1 } = props;
    const months = [];
    for (let i = 0; i < numberOfMonths; i++) {
      const month = dateLib.addMonths(firstDisplayedMonth, i);
      if (calendarEndMonth && month > calendarEndMonth) {
        break;
      }
      months.push(month);
    }
    return months;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js
  function getInitialMonth(props, navStart, navEnd, dateLib) {
    const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1 } = props;
    let initialMonth = month || defaultMonth || today;
    const { differenceInCalendarMonths: differenceInCalendarMonths2, addMonths: addMonths2, startOfMonth: startOfMonth2 } = dateLib;
    if (navEnd && differenceInCalendarMonths2(navEnd, initialMonth) < numberOfMonths - 1) {
      const offset4 = -1 * (numberOfMonths - 1);
      initialMonth = addMonths2(navEnd, offset4);
    }
    if (navStart && differenceInCalendarMonths2(initialMonth, navStart) < 0) {
      initialMonth = navStart;
    }
    return startOfMonth2(initialMonth);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getMonths.js
  function getMonths(displayMonths, dates, props, dateLib) {
    const { addDays: addDays2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfMonth: endOfMonth2, endOfWeek: endOfWeek2, getISOWeek: getISOWeek2, getWeek: getWeek2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
    const dayPickerMonths = displayMonths.reduce((months, month) => {
      const firstDateOfFirstWeek = props.broadcastCalendar ? startOfBroadcastWeek2(month, dateLib) : props.ISOWeek ? startOfISOWeek2(month) : startOfWeek2(month);
      const lastDateOfLastWeek = props.broadcastCalendar ? endOfBroadcastWeek2(month) : props.ISOWeek ? endOfISOWeek2(endOfMonth2(month)) : endOfWeek2(endOfMonth2(month));
      const monthDates = dates.filter((date) => {
        return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;
      });
      const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;
      if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {
        const extraDates = dates.filter((date) => {
          const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;
          return date > lastDateOfLastWeek && date <= addDays2(lastDateOfLastWeek, daysToAdd);
        });
        monthDates.push(...extraDates);
      }
      const weeks = monthDates.reduce((weeks2, date) => {
        const weekNumber = props.ISOWeek ? getISOWeek2(date) : getWeek2(date);
        const week = weeks2.find((week2) => week2.weekNumber === weekNumber);
        const day = new CalendarDay(date, month, dateLib);
        if (!week) {
          weeks2.push(new CalendarWeek(weekNumber, [day]));
        } else {
          week.days.push(day);
        }
        return weeks2;
      }, []);
      const dayPickerMonth = new CalendarMonth(month, weeks);
      months.push(dayPickerMonth);
      return months;
    }, []);
    if (!props.reverseMonths) {
      return dayPickerMonths;
    } else {
      return dayPickerMonths.reverse();
    }
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js
  function getNavMonths(props, dateLib) {
    let { startMonth, endMonth } = props;
    const { startOfYear: startOfYear2, startOfDay: startOfDay2, startOfMonth: startOfMonth2, endOfMonth: endOfMonth2, addYears: addYears2, endOfYear: endOfYear2, today } = dateLib;
    const hasYearDropdown = props.captionLayout === "dropdown" || props.captionLayout === "dropdown-years";
    if (startMonth) {
      startMonth = startOfMonth2(startMonth);
    } else if (!startMonth && hasYearDropdown) {
      startMonth = startOfYear2(addYears2(props.today ?? today(), -100));
    }
    if (endMonth) {
      endMonth = endOfMonth2(endMonth);
    } else if (!endMonth && hasYearDropdown) {
      endMonth = endOfYear2(props.today ?? today());
    }
    return [
      startMonth ? startOfDay2(startMonth) : startMonth,
      endMonth ? startOfDay2(endMonth) : endMonth
    ];
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js
  function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {
    if (options.disableNavigation) {
      return void 0;
    }
    const { pagedNavigation, numberOfMonths = 1 } = options;
    const { startOfMonth: startOfMonth2, addMonths: addMonths2, differenceInCalendarMonths: differenceInCalendarMonths2 } = dateLib;
    const offset4 = pagedNavigation ? numberOfMonths : 1;
    const month = startOfMonth2(firstDisplayedMonth);
    if (!calendarEndMonth) {
      return addMonths2(month, offset4);
    }
    const monthsDiff = differenceInCalendarMonths2(calendarEndMonth, firstDisplayedMonth);
    if (monthsDiff < numberOfMonths) {
      return void 0;
    }
    return addMonths2(month, offset4);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js
  function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, dateLib) {
    if (options.disableNavigation) {
      return void 0;
    }
    const { pagedNavigation, numberOfMonths } = options;
    const { startOfMonth: startOfMonth2, addMonths: addMonths2, differenceInCalendarMonths: differenceInCalendarMonths2 } = dateLib;
    const offset4 = pagedNavigation ? numberOfMonths ?? 1 : 1;
    const month = startOfMonth2(firstDisplayedMonth);
    if (!calendarStartMonth) {
      return addMonths2(month, -offset4);
    }
    const monthsDiff = differenceInCalendarMonths2(month, calendarStartMonth);
    if (monthsDiff <= 0) {
      return void 0;
    }
    return addMonths2(month, -offset4);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js
  function getWeeks(months) {
    const initialWeeks = [];
    return months.reduce((weeks, month) => {
      return weeks.concat(month.weeks.slice());
    }, initialWeeks.slice());
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js
  var import_react33 = __toESM(require_react(), 1);
  function useControlledValue(defaultValue2, controlledValue) {
    const [uncontrolledValue, setValue] = (0, import_react33.useState)(defaultValue2);
    const value = controlledValue === void 0 ? uncontrolledValue : controlledValue;
    return [value, setValue];
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/useCalendar.js
  function useCalendar(props, dateLib) {
    const [navStart, navEnd] = getNavMonths(props, dateLib);
    const { startOfMonth: startOfMonth2, endOfMonth: endOfMonth2 } = dateLib;
    const initialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
    const [firstMonth, setFirstMonth] = useControlledValue(
      initialMonth,
      // initialMonth is always computed from props.month if provided
      props.month ? initialMonth : void 0
    );
    (0, import_react34.useEffect)(() => {
      const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
      setFirstMonth(newInitialMonth);
    }, [props.timeZone]);
    const { months, weeks, days, previousMonth, nextMonth } = (0, import_react34.useMemo)(() => {
      const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
      const dates = getDates(displayMonths, props.endMonth ? endOfMonth2(props.endMonth) : void 0, {
        ISOWeek: props.ISOWeek,
        fixedWeeks: props.fixedWeeks,
        broadcastCalendar: props.broadcastCalendar
      }, dateLib);
      const months2 = getMonths(displayMonths, dates, {
        broadcastCalendar: props.broadcastCalendar,
        fixedWeeks: props.fixedWeeks,
        ISOWeek: props.ISOWeek,
        reverseMonths: props.reverseMonths
      }, dateLib);
      const weeks2 = getWeeks(months2);
      const days2 = getDays(months2);
      const previousMonth2 = getPreviousMonth(firstMonth, navStart, props, dateLib);
      const nextMonth2 = getNextMonth(firstMonth, navEnd, props, dateLib);
      return {
        months: months2,
        weeks: weeks2,
        days: days2,
        previousMonth: previousMonth2,
        nextMonth: nextMonth2
      };
    }, [
      dateLib,
      firstMonth.getTime(),
      navEnd?.getTime(),
      navStart?.getTime(),
      props.disableNavigation,
      props.broadcastCalendar,
      props.endMonth?.getTime(),
      props.fixedWeeks,
      props.ISOWeek,
      props.numberOfMonths,
      props.pagedNavigation,
      props.reverseMonths
    ]);
    const { disableNavigation, onMonthChange } = props;
    const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
    const goToMonth = (date) => {
      if (disableNavigation) {
        return;
      }
      let newMonth = startOfMonth2(date);
      if (navStart && newMonth < startOfMonth2(navStart)) {
        newMonth = startOfMonth2(navStart);
      }
      if (navEnd && newMonth > startOfMonth2(navEnd)) {
        newMonth = startOfMonth2(navEnd);
      }
      setFirstMonth(newMonth);
      onMonthChange?.(newMonth);
    };
    const goToDay = (day) => {
      if (isDayInCalendar(day)) {
        return;
      }
      goToMonth(day.date);
    };
    const calendar = {
      months,
      weeks,
      days,
      navStart,
      navEnd,
      previousMonth,
      nextMonth,
      goToMonth,
      goToDay
    };
    return calendar;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/useFocus.js
  var import_react35 = __toESM(require_react(), 1);

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js
  var FocusTargetPriority;
  (function(FocusTargetPriority2) {
    FocusTargetPriority2[FocusTargetPriority2["Today"] = 0] = "Today";
    FocusTargetPriority2[FocusTargetPriority2["Selected"] = 1] = "Selected";
    FocusTargetPriority2[FocusTargetPriority2["LastFocused"] = 2] = "LastFocused";
    FocusTargetPriority2[FocusTargetPriority2["FocusedModifier"] = 3] = "FocusedModifier";
  })(FocusTargetPriority || (FocusTargetPriority = {}));
  function isFocusableDay(modifiers) {
    return !modifiers[DayFlag.disabled] && !modifiers[DayFlag.hidden] && !modifiers[DayFlag.outside];
  }
  function calculateFocusTarget(days, getModifiers, isSelected2, lastFocused) {
    let focusTarget;
    let foundFocusTargetPriority = -1;
    for (const day of days) {
      const modifiers = getModifiers(day);
      if (isFocusableDay(modifiers)) {
        if (modifiers[DayFlag.focused] && foundFocusTargetPriority < FocusTargetPriority.FocusedModifier) {
          focusTarget = day;
          foundFocusTargetPriority = FocusTargetPriority.FocusedModifier;
        } else if (lastFocused?.isEqualTo(day) && foundFocusTargetPriority < FocusTargetPriority.LastFocused) {
          focusTarget = day;
          foundFocusTargetPriority = FocusTargetPriority.LastFocused;
        } else if (isSelected2(day.date) && foundFocusTargetPriority < FocusTargetPriority.Selected) {
          focusTarget = day;
          foundFocusTargetPriority = FocusTargetPriority.Selected;
        } else if (modifiers[DayFlag.today] && foundFocusTargetPriority < FocusTargetPriority.Today) {
          focusTarget = day;
          foundFocusTargetPriority = FocusTargetPriority.Today;
        }
      }
    }
    if (!focusTarget) {
      focusTarget = days.find((day) => isFocusableDay(getModifiers(day)));
    }
    return focusTarget;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js
  function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {
    const { ISOWeek, broadcastCalendar } = props;
    const { addDays: addDays2, addMonths: addMonths2, addWeeks: addWeeks2, addYears: addYears2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfWeek: endOfWeek2, max: max3, min: min3, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
    const moveFns = {
      day: addDays2,
      week: addWeeks2,
      month: addMonths2,
      year: addYears2,
      startOfWeek: (date) => broadcastCalendar ? startOfBroadcastWeek2(date, dateLib) : ISOWeek ? startOfISOWeek2(date) : startOfWeek2(date),
      endOfWeek: (date) => broadcastCalendar ? endOfBroadcastWeek2(date) : ISOWeek ? endOfISOWeek2(date) : endOfWeek2(date)
    };
    let focusableDate = moveFns[moveBy](refDate, moveDir === "after" ? 1 : -1);
    if (moveDir === "before" && navStart) {
      focusableDate = max3([navStart, focusableDate]);
    } else if (moveDir === "after" && navEnd) {
      focusableDate = min3([navEnd, focusableDate]);
    }
    return focusableDate;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js
  function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt = 0) {
    if (attempt > 365) {
      return void 0;
    }
    const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, calendarStartMonth, calendarEndMonth, props, dateLib);
    const isDisabled = Boolean(props.disabled && dateMatchModifiers(focusableDate, props.disabled, dateLib));
    const isHidden2 = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));
    const targetMonth = focusableDate;
    const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);
    if (!isDisabled && !isHidden2) {
      return focusDay;
    }
    return getNextFocus(moveBy, moveDir, focusDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt + 1);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/useFocus.js
  function useFocus2(props, calendar, getModifiers, isSelected2, dateLib) {
    const { autoFocus } = props;
    const [lastFocused, setLastFocused] = (0, import_react35.useState)();
    const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected2 || (() => false), lastFocused);
    const [focusedDay, setFocused] = (0, import_react35.useState)(autoFocus ? focusTarget : void 0);
    const blur = () => {
      setLastFocused(focusedDay);
      setFocused(void 0);
    };
    const moveFocus = (moveBy, moveDir) => {
      if (!focusedDay)
        return;
      const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
      if (!nextFocus)
        return;
      if (props.disableNavigation) {
        const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
        if (!isNextInCalendar) {
          return;
        }
      }
      calendar.goToDay(nextFocus);
      setFocused(nextFocus);
    };
    const isFocusTarget = (day) => {
      return Boolean(focusTarget?.isEqualTo(day));
    };
    const useFocus3 = {
      isFocusTarget,
      setFocused,
      focused: focusedDay,
      blur,
      moveFocus
    };
    return useFocus3;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/selection/useMulti.js
  function useMulti(props, dateLib) {
    const { selected: initiallySelected, required, onSelect } = props;
    const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
    const selected = !onSelect ? internallySelected : initiallySelected;
    const { isSameDay: isSameDay2 } = dateLib;
    const isSelected2 = (date) => {
      return selected?.some((d) => isSameDay2(d, date)) ?? false;
    };
    const { min: min3, max: max3 } = props;
    const select3 = (triggerDate, modifiers, e) => {
      let newDates = [...selected ?? []];
      if (isSelected2(triggerDate)) {
        if (selected?.length === min3) {
          return;
        }
        if (required && selected?.length === 1) {
          return;
        }
        newDates = selected?.filter((d) => !isSameDay2(d, triggerDate));
      } else {
        if (selected?.length === max3) {
          newDates = [triggerDate];
        } else {
          newDates = [...newDates, triggerDate];
        }
      }
      if (!onSelect) {
        setSelected(newDates);
      }
      onSelect?.(newDates, triggerDate, modifiers, e);
      return newDates;
    };
    return {
      selected,
      select: select3,
      isSelected: isSelected2
    };
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/addToRange.js
  function addToRange(date, initialRange, min3 = 0, max3 = 0, required = false, dateLib = defaultDateLib) {
    const { from, to } = initialRange || {};
    const { isSameDay: isSameDay2, isAfter: isAfter2, isBefore: isBefore2 } = dateLib;
    let range;
    if (!from && !to) {
      range = { from: date, to: min3 > 0 ? void 0 : date };
    } else if (from && !to) {
      if (isSameDay2(from, date)) {
        if (min3 === 0) {
          range = { from, to: date };
        } else if (required) {
          range = { from, to: void 0 };
        } else {
          range = void 0;
        }
      } else if (isBefore2(date, from)) {
        range = { from: date, to: from };
      } else {
        range = { from, to: date };
      }
    } else if (from && to) {
      if (isSameDay2(from, date) && isSameDay2(to, date)) {
        if (required) {
          range = { from, to };
        } else {
          range = void 0;
        }
      } else if (isSameDay2(from, date)) {
        range = { from, to: min3 > 0 ? void 0 : date };
      } else if (isSameDay2(to, date)) {
        range = { from: date, to: min3 > 0 ? void 0 : date };
      } else if (isBefore2(date, from)) {
        range = { from: date, to };
      } else if (isAfter2(date, from)) {
        range = { from, to: date };
      } else if (isAfter2(date, to)) {
        range = { from, to: date };
      } else {
        throw new Error("Invalid range");
      }
    }
    if (range?.from && range?.to) {
      const diff = dateLib.differenceInCalendarDays(range.to, range.from);
      if (max3 > 0 && diff > max3) {
        range = { from: date, to: void 0 };
      } else if (min3 > 1 && diff < min3) {
        range = { from: date, to: void 0 };
      }
    }
    return range;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js
  function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = defaultDateLib) {
    const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;
    let date = range.from;
    const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
    const totalDaysLimit = Math.min(totalDays, 6);
    for (let i = 0; i <= totalDaysLimit; i++) {
      if (dayOfWeekArr.includes(date.getDay())) {
        return true;
      }
      date = dateLib.addDays(date, 1);
    }
    return false;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js
  function rangeOverlaps(rangeLeft, rangeRight, dateLib = defaultDateLib) {
    return rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) || rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) || rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) || rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js
  function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
    const matchers = Array.isArray(modifiers) ? modifiers : [modifiers];
    const nonFunctionMatchers = matchers.filter((matcher) => typeof matcher !== "function");
    const nonFunctionMatchersResult = nonFunctionMatchers.some((matcher) => {
      if (typeof matcher === "boolean")
        return matcher;
      if (dateLib.isDate(matcher)) {
        return rangeIncludesDate(range, matcher, false, dateLib);
      }
      if (isDatesArray(matcher, dateLib)) {
        return matcher.some((date) => rangeIncludesDate(range, date, false, dateLib));
      }
      if (isDateRange(matcher)) {
        if (matcher.from && matcher.to) {
          return rangeOverlaps(range, { from: matcher.from, to: matcher.to }, dateLib);
        }
        return false;
      }
      if (isDayOfWeekType(matcher)) {
        return rangeContainsDayOfWeek(range, matcher.dayOfWeek, dateLib);
      }
      if (isDateInterval(matcher)) {
        const isClosedInterval = dateLib.isAfter(matcher.before, matcher.after);
        if (isClosedInterval) {
          return rangeOverlaps(range, {
            from: dateLib.addDays(matcher.after, 1),
            to: dateLib.addDays(matcher.before, -1)
          }, dateLib);
        }
        return dateMatchModifiers(range.from, matcher, dateLib) || dateMatchModifiers(range.to, matcher, dateLib);
      }
      if (isDateAfterType(matcher) || isDateBeforeType(matcher)) {
        return dateMatchModifiers(range.from, matcher, dateLib) || dateMatchModifiers(range.to, matcher, dateLib);
      }
      return false;
    });
    if (nonFunctionMatchersResult) {
      return true;
    }
    const functionMatchers = matchers.filter((matcher) => typeof matcher === "function");
    if (functionMatchers.length) {
      let date = range.from;
      const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
      for (let i = 0; i <= totalDays; i++) {
        if (functionMatchers.some((matcher) => matcher(date))) {
          return true;
        }
        date = dateLib.addDays(date, 1);
      }
    }
    return false;
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/selection/useRange.js
  function useRange(props, dateLib) {
    const { disabled: disabled2, excludeDisabled, resetOnSelect, selected: initiallySelected, required, onSelect } = props;
    const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
    const selected = !onSelect ? internallySelected : initiallySelected;
    const isSelected2 = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
    const select3 = (triggerDate, modifiers, e) => {
      const { min: min3, max: max3 } = props;
      let newRange;
      if (triggerDate) {
        const selectedFrom = selected?.from;
        const selectedTo = selected?.to;
        const hasFullRange = !!selectedFrom && !!selectedTo;
        const isClickingSingleDayRange = !!selectedFrom && !!selectedTo && dateLib.isSameDay(selectedFrom, selectedTo) && dateLib.isSameDay(triggerDate, selectedFrom);
        if (resetOnSelect && (hasFullRange || !selected?.from)) {
          if (!required && isClickingSingleDayRange) {
            newRange = void 0;
          } else {
            newRange = { from: triggerDate, to: void 0 };
          }
        } else {
          newRange = addToRange(triggerDate, selected, min3, max3, required, dateLib);
        }
      }
      if (excludeDisabled && disabled2 && newRange?.from && newRange.to) {
        if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled2, dateLib)) {
          newRange.from = triggerDate;
          newRange.to = void 0;
        }
      }
      if (!onSelect) {
        setSelected(newRange);
      }
      onSelect?.(newRange, triggerDate, modifiers, e);
      return newRange;
    };
    return {
      selected,
      select: select3,
      isSelected: isSelected2
    };
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/selection/useSingle.js
  function useSingle(props, dateLib) {
    const { selected: initiallySelected, required, onSelect } = props;
    const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
    const selected = !onSelect ? internallySelected : initiallySelected;
    const { isSameDay: isSameDay2 } = dateLib;
    const isSelected2 = (compareDate) => {
      return selected ? isSameDay2(selected, compareDate) : false;
    };
    const select3 = (triggerDate, modifiers, e) => {
      let newDate = triggerDate;
      if (!required && selected && selected && isSameDay2(triggerDate, selected)) {
        newDate = void 0;
      }
      if (!onSelect) {
        setSelected(newDate);
      }
      if (required) {
        onSelect?.(newDate, triggerDate, modifiers, e);
      } else {
        onSelect?.(newDate, triggerDate, modifiers, e);
      }
      return newDate;
    };
    return {
      selected,
      select: select3,
      isSelected: isSelected2
    };
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/useSelection.js
  function useSelection(props, dateLib) {
    const single = useSingle(props, dateLib);
    const multi = useMulti(props, dateLib);
    const range = useRange(props, dateLib);
    switch (props.mode) {
      case "single":
        return single;
      case "multiple":
        return multi;
      case "range":
        return range;
      default:
        return void 0;
    }
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js
  function toTimeZone(date, timeZone) {
    if (date instanceof TZDate && date.timeZone === timeZone) {
      return date;
    }
    return new TZDate(date, timeZone);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js
  function toZoneNoon(date, timeZone, noonSafe) {
    if (!noonSafe)
      return toTimeZone(date, timeZone);
    const zoned = toTimeZone(date, timeZone);
    const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
    return new Date(noonZoned.getTime());
  }
  function convertMatcher(matcher, timeZone, noonSafe) {
    if (typeof matcher === "boolean" || typeof matcher === "function") {
      return matcher;
    }
    if (matcher instanceof Date) {
      return toZoneNoon(matcher, timeZone, noonSafe);
    }
    if (Array.isArray(matcher)) {
      return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
    }
    if (isDateRange(matcher)) {
      return {
        ...matcher,
        from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
        to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to
      };
    }
    if (isDateInterval(matcher)) {
      return {
        before: toZoneNoon(matcher.before, timeZone, noonSafe),
        after: toZoneNoon(matcher.after, timeZone, noonSafe)
      };
    }
    if (isDateAfterType(matcher)) {
      return {
        after: toZoneNoon(matcher.after, timeZone, noonSafe)
      };
    }
    if (isDateBeforeType(matcher)) {
      return {
        before: toZoneNoon(matcher.before, timeZone, noonSafe)
      };
    }
    return matcher;
  }
  function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
    if (!matchers) {
      return matchers;
    }
    if (Array.isArray(matchers)) {
      return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
    }
    return convertMatcher(matchers, timeZone, noonSafe);
  }

  // node_modules/@daypicker/react/node_modules/react-day-picker/dist/esm/DayPicker.js
  function DayPicker(initialProps) {
    let props = initialProps;
    const timeZone = props.timeZone;
    if (timeZone) {
      props = {
        ...initialProps,
        timeZone
      };
      if (props.today) {
        props.today = toTimeZone(props.today, timeZone);
      }
      if (props.month) {
        props.month = toTimeZone(props.month, timeZone);
      }
      if (props.defaultMonth) {
        props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
      }
      if (props.startMonth) {
        props.startMonth = toTimeZone(props.startMonth, timeZone);
      }
      if (props.endMonth) {
        props.endMonth = toTimeZone(props.endMonth, timeZone);
      }
      if (props.mode === "single" && props.selected) {
        props.selected = toTimeZone(props.selected, timeZone);
      } else if (props.mode === "multiple" && props.selected) {
        props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
      } else if (props.mode === "range" && props.selected) {
        props.selected = {
          from: props.selected.from ? toTimeZone(props.selected.from, timeZone) : props.selected.from,
          to: props.selected.to ? toTimeZone(props.selected.to, timeZone) : props.selected.to
        };
      }
      if (props.disabled !== void 0) {
        props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
      }
      if (props.hidden !== void 0) {
        props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
      }
      if (props.modifiers) {
        const nextModifiers = {};
        Object.keys(props.modifiers).forEach((key) => {
          nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
        });
        props.modifiers = nextModifiers;
      }
    }
    const { components, formatters: formatters2, labels, dateLib, locale, classNames } = (0, import_react36.useMemo)(() => {
      const locale2 = { ...enUS2, ...props.locale };
      const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
      const noonOverrides = props.noonSafe && props.timeZone ? createNoonOverrides(props.timeZone, {
        weekStartsOn,
        locale: locale2
      }) : void 0;
      const overrides = props.dateLib && noonOverrides ? { ...noonOverrides, ...props.dateLib } : props.dateLib ?? noonOverrides;
      const dateLib2 = new DateLib({
        locale: locale2,
        weekStartsOn,
        firstWeekContainsDate: props.firstWeekContainsDate,
        useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
        useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
        timeZone: props.timeZone,
        numerals: props.numerals
      }, overrides);
      return {
        dateLib: dateLib2,
        components: getComponents(props.components),
        formatters: getFormatters(props.formatters),
        labels: getLabels(props.labels, dateLib2.options),
        locale: locale2,
        classNames: { ...getDefaultClassNames(), ...props.classNames }
      };
    }, [
      props.locale,
      props.broadcastCalendar,
      props.weekStartsOn,
      props.firstWeekContainsDate,
      props.useAdditionalWeekYearTokens,
      props.useAdditionalDayOfYearTokens,
      props.timeZone,
      props.numerals,
      props.dateLib,
      props.noonSafe,
      props.components,
      props.formatters,
      props.labels,
      props.classNames
    ]);
    if (!props.today) {
      props = { ...props, today: dateLib.today() };
    }
    const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles } = props;
    const { formatCaption: formatCaption2, formatDay: formatDay2, formatMonthDropdown: formatMonthDropdown2, formatWeekNumber: formatWeekNumber2, formatWeekNumberHeader: formatWeekNumberHeader2, formatWeekdayName: formatWeekdayName2, formatYearDropdown: formatYearDropdown2 } = formatters2;
    const calendar = useCalendar(props, dateLib);
    const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth } = calendar;
    const getModifiers = createGetModifiers(days, props, navStart, navEnd, dateLib);
    const { isSelected: isSelected2, select: select3, selected: selectedValue } = useSelection(props, dateLib) ?? {};
    const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus2(props, calendar, getModifiers, isSelected2 ?? (() => false), dateLib);
    const { labelDayButton: labelDayButton2, labelGridcell: labelGridcell2, labelGrid: labelGrid2, labelMonthDropdown: labelMonthDropdown2, labelNav: labelNav2, labelPrevious: labelPrevious2, labelNext: labelNext2, labelWeekday: labelWeekday2, labelWeekNumber: labelWeekNumber2, labelWeekNumberHeader: labelWeekNumberHeader2, labelYearDropdown: labelYearDropdown2 } = labels;
    const weekdays = (0, import_react36.useMemo)(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
    const isInteractive = mode !== void 0 || onDayClick !== void 0;
    const handlePreviousClick = (0, import_react36.useCallback)(() => {
      if (!previousMonth)
        return;
      goToMonth(previousMonth);
      onPrevClick?.(previousMonth);
    }, [previousMonth, goToMonth, onPrevClick]);
    const handleNextClick = (0, import_react36.useCallback)(() => {
      if (!nextMonth)
        return;
      goToMonth(nextMonth);
      onNextClick?.(nextMonth);
    }, [goToMonth, nextMonth, onNextClick]);
    const handleDayClick = (0, import_react36.useCallback)((day, m2) => (e) => {
      e.preventDefault();
      e.stopPropagation();
      setFocused(day);
      if (m2.disabled) {
        return;
      }
      select3?.(day.date, m2, e);
      onDayClick?.(day.date, m2, e);
    }, [select3, onDayClick, setFocused]);
    const handleDayFocus = (0, import_react36.useCallback)((day, m2) => (e) => {
      setFocused(day);
      onDayFocus?.(day.date, m2, e);
    }, [onDayFocus, setFocused]);
    const handleDayBlur = (0, import_react36.useCallback)((day, m2) => (e) => {
      blur();
      onDayBlur?.(day.date, m2, e);
    }, [blur, onDayBlur]);
    const handleDayKeyDown = (0, import_react36.useCallback)((day, modifiers) => (e) => {
      const keyMap = {
        ArrowLeft: [
          e.shiftKey ? "month" : "day",
          props.dir === "rtl" ? "after" : "before"
        ],
        ArrowRight: [
          e.shiftKey ? "month" : "day",
          props.dir === "rtl" ? "before" : "after"
        ],
        ArrowDown: [e.shiftKey ? "year" : "week", "after"],
        ArrowUp: [e.shiftKey ? "year" : "week", "before"],
        PageUp: [e.shiftKey ? "year" : "month", "before"],
        PageDown: [e.shiftKey ? "year" : "month", "after"],
        Home: ["startOfWeek", "before"],
        End: ["endOfWeek", "after"]
      };
      if (keyMap[e.key]) {
        e.preventDefault();
        e.stopPropagation();
        const [moveBy, moveDir] = keyMap[e.key];
        moveFocus(moveBy, moveDir);
      }
      onDayKeyDown?.(day.date, modifiers, e);
    }, [moveFocus, onDayKeyDown, props.dir]);
    const handleDayMouseEnter = (0, import_react36.useCallback)((day, modifiers) => (e) => {
      onDayMouseEnter?.(day.date, modifiers, e);
    }, [onDayMouseEnter]);
    const handleDayMouseLeave = (0, import_react36.useCallback)((day, modifiers) => (e) => {
      onDayMouseLeave?.(day.date, modifiers, e);
    }, [onDayMouseLeave]);
    const handleMonthChange = (0, import_react36.useCallback)((date, monthOffset) => (e) => {
      const selectedMonth = Number(e.target.value);
      const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
      goToMonth(dateLib.addMonths(month, -monthOffset));
    }, [dateLib, goToMonth]);
    const handleYearChange = (0, import_react36.useCallback)((date, monthOffset) => (e) => {
      const selectedYear = Number(e.target.value);
      const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
      goToMonth(dateLib.addMonths(month, -monthOffset));
    }, [dateLib, goToMonth]);
    const { className, style } = (0, import_react36.useMemo)(() => ({
      className: [classNames[UI.Root], props.className].filter(Boolean).join(" "),
      style: { ...styles?.[UI.Root], ...props.style }
    }), [classNames, props.className, props.style, styles]);
    const dataAttributes = getDataAttributes(props);
    const getDropdownStyle = (dropdown) => {
      const dropdownStyle = styles?.[UI.Dropdown];
      const specificDropdownStyle = styles?.[dropdown];
      if (!dropdownStyle && !specificDropdownStyle) {
        return void 0;
      }
      return {
        ...dropdownStyle,
        ...specificDropdownStyle
      };
    };
    const rootElRef = (0, import_react36.useRef)(null);
    useAnimation(rootElRef, Boolean(props.animate), {
      classNames,
      months,
      focused,
      dateLib
    });
    const contextValue = {
      dayPickerProps: props,
      selected: selectedValue,
      select: select3,
      isSelected: isSelected2,
      months,
      nextMonth,
      previousMonth,
      goToMonth,
      getModifiers,
      components,
      classNames,
      styles,
      labels,
      formatters: formatters2
    };
    return import_react36.default.createElement(
      dayPickerContext.Provider,
      { value: contextValue },
      import_react36.default.createElement(
        components.Root,
        { rootRef: props.animate ? rootElRef : void 0, className, style, dir: props.dir, id: props.id, lang: props.lang ?? locale.code, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
        import_react36.default.createElement(
          components.Months,
          { className: classNames[UI.Months], style: styles?.[UI.Months] },
          !props.hideNavigation && !navLayout && import_react36.default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
          months.map((calendarMonth, displayIndex) => {
            const monthOffset = props.reverseMonths ? months.length - 1 - displayIndex : displayIndex;
            return import_react36.default.createElement(
              components.Month,
              {
                "data-animated-month": props.animate ? "true" : void 0,
                className: classNames[UI.Month],
                style: styles?.[UI.Month],
                // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
                key: displayIndex,
                displayIndex,
                calendarMonth
              },
              navLayout === "around" && !props.hideNavigation && displayIndex === 0 && import_react36.default.createElement(
                components.PreviousMonthButton,
                { type: "button", className: classNames[UI.PreviousMonthButton], style: styles?.[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : void 0 },
                import_react36.default.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], style: styles?.[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" })
              ),
              import_react36.default.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : void 0, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth, displayIndex }, captionLayout?.startsWith("dropdown") ? import_react36.default.createElement(
                components.DropdownNav,
                { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
                (() => {
                  const monthControl = captionLayout === "dropdown" || captionLayout === "dropdown-months" ? import_react36.default.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown2(), disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date, monthOffset), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters2, dateLib), style: getDropdownStyle(UI.MonthsDropdown), value: dateLib.getMonth(calendarMonth.date) }) : import_react36.default.createElement("span", { key: "month" }, formatMonthDropdown2(calendarMonth.date, dateLib));
                  const yearControl = captionLayout === "dropdown" || captionLayout === "dropdown-years" ? import_react36.default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown2(dateLib.options), disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date, monthOffset), options: getYearOptions(navStart, navEnd, formatters2, dateLib, Boolean(props.reverseYears)), style: getDropdownStyle(UI.YearsDropdown), value: dateLib.getYear(calendarMonth.date) }) : import_react36.default.createElement("span", { key: "year" }, formatYearDropdown2(calendarMonth.date, dateLib));
                  const controls = dateLib.getMonthYearOrder() === "year-first" ? [yearControl, monthControl] : [monthControl, yearControl];
                  return controls;
                })(),
                import_react36.default.createElement("span", { role: "status", "aria-live": "polite", style: {
                  border: 0,
                  clip: "rect(0 0 0 0)",
                  height: "1px",
                  margin: "-1px",
                  overflow: "hidden",
                  padding: 0,
                  position: "absolute",
                  width: "1px",
                  whiteSpace: "nowrap",
                  wordWrap: "normal"
                } }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
              ) : import_react36.default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], style: styles?.[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))),
              navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 && import_react36.default.createElement(
                components.NextMonthButton,
                { type: "button", className: classNames[UI.NextMonthButton], style: styles?.[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : void 0 },
                import_react36.default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, className: classNames[UI.Chevron], style: styles?.[UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" })
              ),
              displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation && import_react36.default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
              import_react36.default.createElement(
                components.MonthGrid,
                { role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid2(calendarMonth.date, dateLib.options, dateLib) || void 0, className: classNames[UI.MonthGrid], style: styles?.[UI.MonthGrid] },
                !props.hideWeekdays && import_react36.default.createElement(
                  components.Weekdays,
                  { "data-animated-weekdays": props.animate ? "true" : void 0, className: classNames[UI.Weekdays], style: styles?.[UI.Weekdays] },
                  showWeekNumber && import_react36.default.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader2(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles?.[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader2()),
                  weekdays.map((weekday) => import_react36.default.createElement(components.Weekday, { "aria-label": labelWeekday2(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName2(weekday, dateLib.options, dateLib)))
                ),
                import_react36.default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : void 0, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
                  return import_react36.default.createElement(
                    components.Week,
                    { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week },
                    showWeekNumber && import_react36.default.createElement(components.WeekNumber, { week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
                      locale
                    }), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber2(week.weekNumber, dateLib)),
                    week.days.map((day) => {
                      const { date } = day;
                      const modifiers = getModifiers(day);
                      modifiers[DayFlag.focused] = !modifiers.hidden && Boolean(focused?.isEqualTo(day));
                      modifiers[SelectionState.selected] = isSelected2?.(date) || modifiers.selected;
                      if (isDateRange(selectedValue)) {
                        const { from, to } = selectedValue;
                        modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));
                        modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));
                        modifiers[SelectionState.range_middle] = rangeIncludesDate(selectedValue, date, true, dateLib);
                      }
                      const style2 = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
                      const className2 = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
                      const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell2(date, modifiers, dateLib.options, dateLib) : void 0;
                      return import_react36.default.createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day, modifiers, className: className2.join(" "), style: style2, role: "gridcell", "aria-selected": modifiers.selected || void 0, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : void 0, "data-selected": modifiers.selected || void 0, "data-disabled": modifiers.disabled || void 0, "data-hidden": modifiers.hidden || void 0, "data-outside": day.outside || void 0, "data-focused": modifiers.focused || void 0, "data-today": modifiers.today || void 0 }, !modifiers.hidden && isInteractive ? import_react36.default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day, modifiers, disabled: !modifiers.focused && modifiers.disabled || void 0, "aria-disabled": modifiers.focused && modifiers.disabled || void 0, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton2(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay2(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay2(day.date, dateLib.options, dateLib));
                    })
                  );
                }))
              )
            );
          })
        ),
        props.footer && import_react36.default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
      )
    );
  }

  // packages/ui/build-module/calendar/calendar.mjs
  var import_element53 = __toESM(require_element(), 1);

  // packages/ui/build-module/calendar/utils/components.mjs
  var import_element49 = __toESM(require_element(), 1);
  var import_compose = __toESM(require_compose(), 1);
  var import_i18n12 = __toESM(require_i18n(), 1);

  // packages/ui/build-module/icon-button/icon-button.mjs
  var import_element47 = __toESM(require_element(), 1);
  var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE24 = "data-wp-hash";
  function getRuntime24() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument24(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash24(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE24}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE24) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle24(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime24();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash24(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE24, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument24(targetDocument) {
    const runtime = getRuntime24();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle24(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle24(hash, css) {
    const runtime = getRuntime24();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle24(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle24("c5cdafb1bc", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer compositions{._28cfdc260e755391__icon-button{--wp-ui-button-aspect-ratio:1;--wp-ui-button-padding-inline:0px;--wp-ui-button-min-width:unset}.f1c70d719989a85a__icon{margin:-1px}}}");
  }
  var style_default23 = { "icon-button": "_28cfdc260e755391__icon-button", "icon": "f1c70d719989a85a__icon" };
  var IconButton = (0, import_element47.forwardRef)(
    function IconButton2({
      label,
      className,
      // Prevent accidental forwarding of `children`
      children: _children,
      disabled: disabled2,
      focusableWhenDisabled = true,
      icon,
      size: size4,
      shortcut,
      positioner,
      "aria-describedby": ariaDescribedBy,
      "aria-keyshortcuts": ariaKeyShortcuts,
      ...restProps
    }, ref) {
      const classes = clsx_default(style_default23["icon-button"], className);
      const { descriptionId, targetProps } = useKeyboardShortcutProps({
        "aria-describedby": ariaDescribedBy,
        "aria-keyshortcuts": ariaKeyShortcuts,
        shortcut
      });
      return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Root, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
          Trigger,
          {
            ref,
            ...targetProps,
            disabled: disabled2 && !focusableWhenDisabled,
            render: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
              Button4,
              {
                ...restProps,
                size: size4,
                "aria-label": label,
                disabled: disabled2,
                focusableWhenDisabled
              }
            ),
            className: classes,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Icon, { icon, size: 24, className: style_default23.icon }),
              shortcut && descriptionId && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
                KeyboardShortcutDescription,
                {
                  descriptionId,
                  shortcut
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Popup, { positioner, children: [
          label,
          shortcut && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(KeyboardShortcutDisplay, { shortcut })
          ] })
        ] })
      ] });
    }
  );

  // packages/ui/build-module/calendar/utils/root-context.mjs
  var import_element48 = __toESM(require_element(), 1);
  var RootContext = (0, import_element48.createContext)({});

  // packages/ui/build-module/calendar/utils/components.mjs
  var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1);
  var PreviewDashStartAndEnd = () => {
    return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
      "svg",
      {
        viewBox: "0 0 32 32",
        xmlns: "http://www.w3.org/2000/svg",
        fill: "none",
        stroke: "currentColor",
        strokeDasharray: "3.7677",
        strokeDashoffset: "3.2",
        strokeWidth: "1",
        children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M29.5,0.5 h-27 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h27 a2,2 0 0 0 2,-2 v-27 a2,2 0 0 0 -2,-2" })
      }
    );
  };
  var PreviewDashStart = () => {
    return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
      "svg",
      {
        viewBox: "0 0 32 32",
        xmlns: "http://www.w3.org/2000/svg",
        fill: "none",
        stroke: "currentColor",
        strokeDasharray: "3.84516",
        strokeDashoffset: "1.9226",
        strokeWidth: "1",
        children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M32,0.5 h-29.5 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h30" })
      }
    );
  };
  var PreviewDashMiddle = () => {
    return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
      "svg",
      {
        viewBox: "0 0 32 32",
        xmlns: "http://www.w3.org/2000/svg",
        fill: "none",
        stroke: "currentColor",
        strokeDasharray: "3.9 4",
        strokeDashoffset: "2",
        strokeWidth: "1",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("line", { x1: "0", y1: "0.5", x2: "100", y2: "0.5" }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("line", { x1: "0", y1: "31.5", x2: "100", y2: "31.5" })
        ]
      }
    );
  };
  var PreviewDashEnd = () => {
    return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
      "svg",
      {
        viewBox: "0 0 32 32",
        xmlns: "http://www.w3.org/2000/svg",
        fill: "none",
        stroke: "currentColor",
        strokeDasharray: "3.84516",
        strokeDashoffset: "1.9226",
        strokeWidth: "1",
        children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("path", { d: "M0,0.5 h29.5 a2,2 0 0 1 2,2 v27 a2,2 0 0 1 -2,2 h-29.5" })
      }
    );
  };
  function Day2(props) {
    const { day, modifiers, children, ...tdProps } = props;
    let PreviewDash;
    if (modifiers.preview_start && modifiers.preview_end) {
      PreviewDash = PreviewDashStartAndEnd;
    } else if (modifiers.preview_start) {
      PreviewDash = PreviewDashStart;
    } else if (modifiers.preview_end) {
      PreviewDash = PreviewDashEnd;
    } else if (modifiers.preview) {
      PreviewDash = PreviewDashMiddle;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("td", { ...tdProps, children: [
      PreviewDash && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(PreviewDash, {}),
      children
    ] });
  }
  function Root4({ rootRef, ...props }) {
    const { render: render4, ref, role, defaultAriaLabel } = (0, import_element49.useContext)(RootContext);
    const { months, labels } = useDayPicker();
    const hasExplicitLabel = props["aria-label"] !== void 0 || props["aria-labelledby"] !== void 0;
    let ariaLabel = props["aria-label"];
    if (!hasExplicitLabel && defaultAriaLabel && role === "application") {
      const currentMonth = months[0];
      ariaLabel = currentMonth ? (0, import_i18n12.sprintf)(
        // translators: 1: Calendar type. 2: Current month and year.
        (0, import_i18n12.__)("%1$s, %2$s"),
        defaultAriaLabel,
        labels.labelGrid(currentMonth.date)
      ) : defaultAriaLabel;
    }
    const mergedRef = (0, import_compose.useMergeRefs)([rootRef ?? null, ref ?? null]);
    return useRender({
      render: render4,
      defaultTagName: "div",
      ref: mergedRef,
      props: { ...props, role, "aria-label": ariaLabel }
    });
  }
  function NavButton({
    icon,
    className,
    children: _children,
    "aria-label": label,
    "aria-disabled": ariaDisabled,
    ...props
  }) {
    return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
      IconButton,
      {
        ...props,
        className,
        label,
        icon,
        variant: "minimal",
        tone: "neutral",
        size: "compact",
        disabled: ariaDisabled === true || ariaDisabled === "true",
        focusableWhenDisabled: true
      }
    );
  }
  function PreviousMonthButton2(props) {
    return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(NavButton, { ...props, icon: chevron_left_default });
  }
  function NextMonthButton2(props) {
    return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(NavButton, { ...props, icon: chevron_right_default });
  }

  // packages/ui/build-module/calendar/utils/constants.mjs
  var STYLE_HASH_ATTRIBUTE25 = "data-wp-hash";
  function getRuntime25() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument25(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash25(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE25}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE25) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle25(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime25();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash25(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE25, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument25(targetDocument) {
    const runtime = getRuntime25();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle25(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle25(hash, css) {
    const runtime = getRuntime25();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle25(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle25("9d2212290a", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._2c7ac60ba97b3411__root{--wp-ui-calendar-cell-size:var(--wpds-dimension-size-md,32px);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-block;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);position:relative;z-index:0}._172c492625235710__day{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);padding:0;position:relative;&:has(._1b64226e315835f8__day-button:disabled){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&:has(._1b64226e315835f8__day-button:focus-visible),&:has(._1b64226e315835f8__day-button:hover:not(:disabled)){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}}._1b64226e315835f8__day-button{align-items:center;background:none;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:inherit;cursor:var(--wpds-cursor-control,pointer);display:flex;font:inherit;font-variant-numeric:tabular-nums;height:var(--wp-ui-calendar-cell-size);justify-content:center;margin:0;padding:0;position:relative;width:var(--wp-ui-calendar-cell-size);&:before{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border:none;border-radius:var(--wpds-border-radius-sm,2px);z-index:-1}&:after,&:before{content:"";inset:0;position:absolute}&:after{pointer-events:none;z-index:1}&:disabled{cursor:revert;&:before{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}@media (forced-colors:active){text-decoration:line-through}}&:focus-visible:before,&:hover:not(:disabled):before{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed)}}._66b9a8120581fd4b__caption-label{align-items:center;border:0;display:inline-flex;position:relative;text-transform:capitalize;white-space:nowrap;z-index:1}._2c7ac60ba97b3411__root[dir=rtl] ._395a75bb1930f57e__nav-button{transform:rotate(180deg);transform-origin:50%}._337e5337d49b7f3d__month-caption{align-content:center;display:flex;height:var(--wp-ui-calendar-cell-size);justify-content:center;margin-bottom:var(--wpds-dimension-gap-md,12px)}._110e46230c68e498__months{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-lg,16px);justify-content:center;max-width:fit-content;position:relative}._92915239fedb1fea__month-grid{border-collapse:separate;border-spacing:0 var(--wpds-dimension-gap-xs,4px)}._66b1d4a7b488b496__nav{align-items:center;display:flex;height:var(--wp-ui-calendar-cell-size);inset-block-start:0;inset-inline-end:0;inset-inline-start:0;justify-content:space-between;position:absolute}._7207199709ca5776__weekday{color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-weight:var(--wpds-typography-font-weight-default,400);height:var(--wp-ui-calendar-cell-size);padding:0;text-align:center;text-transform:uppercase;width:var(--wp-ui-calendar-cell-size)}._058175f0f9c495e0__today:after{border:2px solid;border-radius:50%;content:"";height:0;inset-block-start:2px;inset-inline-end:2px;position:absolute;width:0;z-index:1}.acb642920fb0bef5__selected:not(._165d91a726feca9c__range-middle){&:has(._1b64226e315835f8__day-button,._1b64226e315835f8__day-button:hover:not(:disabled)){color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0)}&:has(._1b64226e315835f8__day-button:disabled){color:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}._1b64226e315835f8__day-button{&:before{background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);border:1px solid transparent}&:disabled:before{background-color:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6)}&:hover:not(:disabled):before{background-color:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e)}}}.c259c5c255fda10f__outside{color:var(--wpds-color-foreground-interactive-neutral-weak,#707070)}._4d8957a0ca4ec8f0__hidden{visibility:hidden}.f2523033db055ffe__range-start:not(.c04a453de7b11520__range-end) ._1b64226e315835f8__day-button{&,&:before{border-end-end-radius:0;border-start-end-radius:0}}._165d91a726feca9c__range-middle ._1b64226e315835f8__day-button{&:before{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-color:transparent;border-radius:0;border-style:solid;border-width:1px 0}}.c04a453de7b11520__range-end:not(.f2523033db055ffe__range-start) ._1b64226e315835f8__day-button{&,&:before{border-end-start-radius:0;border-start-start-radius:0}}._81b244e7c541d95e__preview svg{color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);inset:0;pointer-events:none;position:absolute;@media (forced-colors:active){color:inherit}}._81b244e7c541d95e__preview.acb642920fb0bef5__selected:not(._165d91a726feca9c__range-middle) svg{display:none}._2c7ac60ba97b3411__root[dir=rtl] ._81b244e7c541d95e__preview svg{transform:scaleX(-1)}._81b244e7c541d95e__preview._165d91a726feca9c__range-middle ._1b64226e315835f8__day-button:before{border:none}@keyframes _255a1a462a5377db__slide-in-left{0%{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes c21e45f616d6db39__slide-in-right{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes aed80001de9ae226__slide-out-left{0%{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes _7d4779a7f29408f2__slide-out-right{0%{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes _83ba6321b055d687__fade-in{0%{opacity:0}to{opacity:1}}@keyframes _96fbead71248d210__fade-out{0%{opacity:1}to{opacity:0}}._1563bccb09e39c30__caption-after-enter,._60ac2a7fc3208801__weeks-before-exit,._735dacf9052adecd__caption-before-exit,._7f73a6ab85101202__weeks-after-exit,._805d698b56ba4a29__weeks-after-enter,._9721326fbc23a5fb__weeks-before-enter,.c7a3082839155d29__caption-after-exit,.cb8a5ec82ad0885e__caption-before-enter{animation-duration:0s;animation-fill-mode:forwards;animation-timing-function:var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1));@media not (prefers-reduced-motion){animation-duration:var(--wpds-motion-duration-lg,.3s)}}._2c7ac60ba97b3411__root[dir=rtl] ._805d698b56ba4a29__weeks-after-enter,._9721326fbc23a5fb__weeks-before-enter{animation-name:_255a1a462a5377db__slide-in-left}._2c7ac60ba97b3411__root[dir=rtl] ._7f73a6ab85101202__weeks-after-exit,._60ac2a7fc3208801__weeks-before-exit{animation-name:aed80001de9ae226__slide-out-left}._2c7ac60ba97b3411__root[dir=rtl] ._9721326fbc23a5fb__weeks-before-enter,._805d698b56ba4a29__weeks-after-enter{animation-name:c21e45f616d6db39__slide-in-right}._2c7ac60ba97b3411__root[dir=rtl] ._60ac2a7fc3208801__weeks-before-exit,._7f73a6ab85101202__weeks-after-exit{animation-name:_7d4779a7f29408f2__slide-out-right}._1563bccb09e39c30__caption-after-enter,.cb8a5ec82ad0885e__caption-before-enter{animation-name:_83ba6321b055d687__fade-in}._735dacf9052adecd__caption-before-exit,.c7a3082839155d29__caption-after-exit{animation-name:_96fbead71248d210__fade-out}}}');
  }
  var style_default24 = { "root": "_2c7ac60ba97b3411__root", "day": "_172c492625235710__day", "day-button": "_1b64226e315835f8__day-button", "caption-label": "_66b9a8120581fd4b__caption-label", "nav-button": "_395a75bb1930f57e__nav-button", "month-caption": "_337e5337d49b7f3d__month-caption", "months": "_110e46230c68e498__months", "month-grid": "_92915239fedb1fea__month-grid", "nav": "_66b1d4a7b488b496__nav", "weekday": "_7207199709ca5776__weekday", "today": "_058175f0f9c495e0__today", "selected": "acb642920fb0bef5__selected", "range-middle": "_165d91a726feca9c__range-middle", "outside": "c259c5c255fda10f__outside", "hidden": "_4d8957a0ca4ec8f0__hidden", "range-start": "f2523033db055ffe__range-start", "range-end": "c04a453de7b11520__range-end", "preview": "_81b244e7c541d95e__preview", "weeks-before-enter": "_9721326fbc23a5fb__weeks-before-enter", "weeks-before-exit": "_60ac2a7fc3208801__weeks-before-exit", "weeks-after-enter": "_805d698b56ba4a29__weeks-after-enter", "weeks-after-exit": "_7f73a6ab85101202__weeks-after-exit", "caption-after-enter": "_1563bccb09e39c30__caption-after-enter", "caption-after-exit": "c7a3082839155d29__caption-after-exit", "caption-before-enter": "cb8a5ec82ad0885e__caption-before-enter", "caption-before-exit": "_735dacf9052adecd__caption-before-exit", "slide-in-left": "_255a1a462a5377db__slide-in-left", "slide-out-left": "aed80001de9ae226__slide-out-left", "slide-in-right": "c21e45f616d6db39__slide-in-right", "slide-out-right": "_7d4779a7f29408f2__slide-out-right", "fade-in": "_83ba6321b055d687__fade-in", "fade-out": "_96fbead71248d210__fade-out" };
  if (typeof process === "undefined" || true) {
    registerStyle25("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default10 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle25("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
  }
  var focus_module_default3 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
  if (typeof process === "undefined" || true) {
    registerStyle25("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default9 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  var CLASSNAMES = {
    root: clsx_default(style_default24.root, resets_default10["box-sizing"]),
    day: style_default24.day,
    day_button: clsx_default(
      style_default24["day-button"],
      global_css_defense_default9.button,
      focus_module_default3["outset-ring--focus-visible"]
    ),
    outside: style_default24.outside,
    caption_label: style_default24["caption-label"],
    button_next: style_default24["nav-button"],
    button_previous: style_default24["nav-button"],
    nav: style_default24.nav,
    month_caption: style_default24["month-caption"],
    months: style_default24.months,
    month_grid: style_default24["month-grid"],
    weekday: style_default24.weekday,
    today: style_default24.today,
    selected: style_default24.selected,
    /*
     * Disabled days are styled through `:has(.day-button:disabled)` rather than
     * a modifier class on the cell, because the two are not equivalent: the
     * focused day keeps its button enabled so it stays reachable. Mapped to
     * `undefined` on purpose, so `@daypicker/react` doesn't fall back to its
     * own `rdp-disabled` class for a modifier we don't style.
     */
    disabled: void 0,
    hidden: style_default24.hidden,
    range_start: style_default24["range-start"],
    range_end: style_default24["range-end"],
    range_middle: style_default24["range-middle"],
    weeks_before_enter: style_default24["weeks-before-enter"],
    weeks_before_exit: style_default24["weeks-before-exit"],
    weeks_after_enter: style_default24["weeks-after-enter"],
    weeks_after_exit: style_default24["weeks-after-exit"],
    caption_after_enter: style_default24["caption-after-enter"],
    caption_after_exit: style_default24["caption-after-exit"],
    caption_before_enter: style_default24["caption-before-enter"],
    caption_before_exit: style_default24["caption-before-exit"]
  };
  var MODIFIER_CLASSNAMES = {
    preview: style_default24.preview
  };
  var COMMON_PROPS = {
    animate: true,
    // Only show days in the current month
    showOutsideDays: false,
    // Hide week number column
    showWeekNumber: false,
    // Show weekdays row
    hideWeekdays: false,
    // Month and year caption are not interactive
    captionLayout: "label",
    // Show a variable number of weeks depending on the month
    fixedWeeks: false,
    // Show navigation buttons
    hideNavigation: false,
    // Class names
    classNames: CLASSNAMES,
    components: {
      Day: Day2,
      Root: Root4,
      PreviousMonthButton: PreviousMonthButton2,
      NextMonthButton: NextMonthButton2
    }
  };

  // packages/ui/build-module/calendar/utils/misc.mjs
  function clampNumberOfMonths(numberOfMonths) {
    return Math.min(3, Math.max(1, numberOfMonths));
  }

  // packages/ui/build-module/calendar/utils/use-controlled-value.mjs
  var import_element50 = __toESM(require_element(), 1);
  function useControlledValue2({
    defaultValue: defaultValue2,
    onChange,
    value: valueProp
  }) {
    const hasValue = typeof valueProp !== "undefined";
    const initialValue = hasValue ? valueProp : defaultValue2;
    const [state, setState] = (0, import_element50.useState)(initialValue);
    const value = hasValue ? valueProp : state;
    const uncontrolledSetValue = (0, import_element50.useCallback)(
      (nextValue, ...args) => {
        setState(nextValue);
        onChange?.(nextValue, ...args);
      },
      [onChange]
    );
    let setValue;
    if (hasValue && typeof onChange === "function") {
      setValue = onChange;
    } else if (!hasValue && typeof onChange === "function") {
      setValue = uncontrolledSetValue;
    } else {
      setValue = setState;
    }
    return [value, setValue];
  }

  // packages/ui/build-module/calendar/utils/use-localization-props.mjs
  var import_i18n13 = __toESM(require_i18n(), 1);
  var import_element51 = __toESM(require_element(), 1);
  function isLocaleRTL(locale) {
    const direction = (locale.getTextInfo?.() ?? locale.textInfo)?.direction;
    if (direction) {
      return direction === "rtl";
    }
    return [
      "ar",
      // Arabic
      "he",
      // Hebrew
      "fa",
      // Persian (Farsi)
      "ur",
      // Urdu
      "ps",
      // Pashto
      "syr",
      // Syriac
      "dv",
      // Divehi
      "ku",
      // Kurdish (Sorani)
      "ckb",
      // Central Kurdish (Sorani)
      "ug",
      // Uyghur
      "yi"
      // Yiddish
    ].includes(locale.language);
  }
  function getSupportedLocaleCode(localeCode) {
    if (!localeCode) {
      return;
    }
    let supportedLocaleCode;
    try {
      supportedLocaleCode = Intl.DateTimeFormat.supportedLocalesOf([
        localeCode
      ])[0];
    } catch {
    }
    return supportedLocaleCode;
  }
  function getWeekStartsOn(locale) {
    const firstDay = (locale.getWeekInfo?.() ?? locale.weekInfo)?.firstDay;
    if (firstDay === void 0 || firstDay < 1 || firstDay > 7) {
      return;
    }
    return firstDay % 7;
  }
  var useLocalizationProps = ({
    locale,
    timeZone,
    mode
  }) => {
    return (0, import_element51.useMemo)(() => {
      const isLocaleString = typeof locale === "string";
      const dateFnsLocale = isLocaleString || locale === void 0 ? enUS : locale;
      const supportedLocaleCode = getSupportedLocaleCode(
        isLocaleString ? locale : locale?.code
      );
      const localeCode = supportedLocaleCode ?? "en-US";
      const intlLocale = new Intl.Locale(localeCode);
      const isRightToLeft = supportedLocaleCode !== void 0 ? isLocaleRTL(intlLocale) : (0, import_i18n13.isRTL)();
      const weekStartsOn = isLocaleString || supportedLocaleCode !== void 0 ? getWeekStartsOn(intlLocale) : void 0;
      const monthNameFormatter = new Intl.DateTimeFormat(localeCode, {
        calendar: "gregory",
        year: "numeric",
        month: "long",
        timeZone
      });
      const weekdayNarrowFormatter = new Intl.DateTimeFormat(localeCode, {
        calendar: "gregory",
        weekday: "narrow",
        timeZone
      });
      const weekdayLongFormatter = new Intl.DateTimeFormat(localeCode, {
        calendar: "gregory",
        weekday: "long",
        timeZone
      });
      const fullDateFormatter = new Intl.DateTimeFormat(localeCode, {
        calendar: "gregory",
        weekday: "long",
        year: "numeric",
        month: "long",
        day: "numeric",
        timeZone
      });
      const dayNumberFormatter = new Intl.DateTimeFormat(localeCode, {
        calendar: "gregory",
        day: "numeric",
        timeZone
      });
      return {
        "aria-label": mode === "single" ? (0, import_i18n13.__)("Date calendar") : (0, import_i18n13.__)("Date range calendar"),
        labels: {
          /** The label for the navigation toolbar. */
          labelNav: () => (0, import_i18n13.__)("Navigation bar"),
          /**
           * The label for the month grid.
           * @param date
           */
          labelGrid: monthNameFormatter.format,
          /**
           * The label for the gridcell, when the calendar is not interactive.
           * @param date
           * @param modifiers
           */
          labelGridcell: (date, modifiers) => {
            const formattedDate = fullDateFormatter.format(date);
            let label = formattedDate;
            if (modifiers?.today) {
              label = (0, import_i18n13.sprintf)(
                // translators: %s is the full date (e.g. "Monday, April 29, 2025")
                (0, import_i18n13.__)("Today, %s"),
                formattedDate
              );
            }
            return label;
          },
          /** The label for the "next month" button. */
          labelNext: () => (0, import_i18n13.__)("Next month"),
          /** The label for the "previous month" button. */
          labelPrevious: () => (0, import_i18n13.__)("Previous month"),
          /**
           * The label for the day button.
           * @param date
           * @param modifiers
           */
          labelDayButton: (date, modifiers) => {
            const formattedDate = fullDateFormatter.format(date);
            let label = formattedDate;
            if (modifiers?.today && modifiers?.selected) {
              return (0, import_i18n13.sprintf)(
                // translators: %s is the full date (e.g. "Monday, April 29, 2025")
                (0, import_i18n13.__)("Today, %s, selected"),
                formattedDate
              );
            }
            if (modifiers?.today) {
              label = (0, import_i18n13.sprintf)(
                // translators: %s is the full date (e.g. "Monday, April 29, 2025")
                (0, import_i18n13.__)("Today, %s"),
                formattedDate
              );
            }
            if (modifiers?.selected) {
              label = (0, import_i18n13.sprintf)(
                // translators: %s is the full date (e.g. "Monday, April 29, 2025")
                (0, import_i18n13.__)("%s, selected"),
                formattedDate
              );
            }
            return label;
          },
          /**
           * The label for the weekday.
           * @param date
           */
          labelWeekday: weekdayLongFormatter.format
        },
        locale: dateFnsLocale,
        lang: localeCode,
        dir: isRightToLeft ? "rtl" : "ltr",
        ...weekStartsOn === void 0 ? {} : { weekStartsOn },
        formatters: {
          formatDay: dayNumberFormatter.format,
          formatWeekdayName: weekdayNarrowFormatter.format,
          formatCaption: monthNameFormatter.format
        },
        timeZone
      };
    }, [locale, timeZone, mode]);
  };

  // packages/ui/build-module/calendar/utils/use-preserve-day-focus.mjs
  var import_compose2 = __toESM(require_compose(), 1);
  var import_element52 = __toESM(require_element(), 1);
  function usePreserveDayFocus(forwardedRef, month) {
    const rootRef = (0, import_element52.useRef)(null);
    const hadDayFocusRef = (0, import_element52.useRef)(false);
    const mergedRef = (0, import_compose2.useMergeRefs)([rootRef, forwardedRef]);
    const monthIndex = month ? month.getFullYear() * 12 + month.getMonth() : void 0;
    const onDayFocus = (0, import_element52.useCallback)(() => {
      hadDayFocusRef.current = true;
    }, []);
    const onDayBlur = (0, import_element52.useCallback)(() => {
      hadDayFocusRef.current = false;
    }, []);
    (0, import_element52.useEffect)(() => {
      if (!hadDayFocusRef.current) {
        return;
      }
      const root = rootRef.current;
      if (!root) {
        return;
      }
      const { activeElement: activeElement2, body } = root.ownerDocument;
      if (activeElement2 !== body) {
        const grid = activeElement2?.closest('[role="grid"]');
        hadDayFocusRef.current = !!grid && root.contains(grid);
        return;
      }
      hadDayFocusRef.current = false;
      const focusTarget = root.querySelector(
        '[role="grid"] button[tabindex="0"]:not(:disabled)'
      );
      const enabledControl = root.querySelector(
        'button:not(:disabled):not([aria-disabled="true"])'
      );
      const focusableControl = root.querySelector(
        "button:not(:disabled)"
      );
      (focusTarget ?? enabledControl ?? focusableControl)?.focus();
    }, [monthIndex]);
    return { ref: mergedRef, onDayFocus, onDayBlur };
  }

  // packages/ui/build-module/calendar/calendar.mjs
  var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
  var Calendar = (0, import_element53.forwardRef)(
    function Calendar2({
      defaultValue: defaultValue2,
      value: valueProp,
      onValueChange,
      numberOfMonths = 1,
      locale,
      timeZone,
      month,
      render: render4,
      role = "application",
      "aria-label": ariaLabel,
      labels: customLabels,
      ...props
    }, ref) {
      const { "aria-label": defaultAriaLabel, ...localizationProps } = useLocalizationProps({
        locale,
        timeZone,
        mode: "single"
      });
      const labels = (0, import_element53.useMemo)(
        () => customLabels ? { ...localizationProps.labels, ...customLabels } : localizationProps.labels,
        [localizationProps.labels, customLabels]
      );
      const onChange = (0, import_element53.useCallback)(
        (selected2, triggerDate, modifiers, e) => {
          onValueChange?.(
            selected2 ?? null,
            triggerDate,
            modifiers,
            e
          );
        },
        [onValueChange]
      );
      const [selected, setSelected] = useControlledValue2({
        defaultValue: defaultValue2,
        value: valueProp,
        onChange
      });
      const dayFocusProps = usePreserveDayFocus(ref, month);
      const rootContextValue = (0, import_element53.useMemo)(
        () => ({
          render: render4,
          ref: dayFocusProps.ref,
          role,
          defaultAriaLabel
        }),
        [render4, dayFocusProps.ref, role, defaultAriaLabel]
      );
      return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(RootContext.Provider, { value: rootContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
        DayPicker,
        {
          ...COMMON_PROPS,
          ...localizationProps,
          ...props,
          "aria-label": ariaLabel,
          mode: "single",
          month,
          numberOfMonths: clampNumberOfMonths(numberOfMonths),
          labels,
          selected: selected ?? void 0,
          onSelect: setSelected,
          onDayFocus: dayFocusProps.onDayFocus,
          onDayBlur: dayFocusProps.onDayBlur
        }
      ) });
    }
  );

  // packages/ui/build-module/calendar/range-calendar.mjs
  var import_element54 = __toESM(require_element(), 1);
  var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1);
  function usePreviewRange({
    value,
    hoveredDate,
    excludeDisabled,
    resetOnSelect,
    min: min3,
    max: max3,
    disabled: disabled2
  }) {
    return (0, import_element54.useMemo)(() => {
      if (!hoveredDate || !value?.from) {
        return;
      }
      if (resetOnSelect && value.to) {
        return {
          from: hoveredDate,
          to: hoveredDate
        };
      }
      let previewHighlight;
      let potentialNewRange;
      if (hoveredDate < value.from) {
        previewHighlight = {
          from: hoveredDate,
          to: value.from
        };
        potentialNewRange = {
          from: hoveredDate,
          to: value.to ?? value.from
        };
      } else if (value.to && hoveredDate > value.from && hoveredDate < value.to) {
        previewHighlight = {
          from: value.from,
          to: hoveredDate
        };
        potentialNewRange = {
          from: value.from,
          to: hoveredDate
        };
      } else if (hoveredDate > value.from) {
        previewHighlight = {
          from: value.to ?? value.from,
          to: hoveredDate
        };
        potentialNewRange = {
          from: value.from,
          to: hoveredDate
        };
      }
      if (min3 !== void 0 && min3 > 0 && potentialNewRange && differenceInCalendarDays(
        potentialNewRange.to,
        potentialNewRange.from
      ) < min3) {
        previewHighlight = {
          from: hoveredDate,
          to: hoveredDate
        };
      }
      if (max3 !== void 0 && max3 > 0 && potentialNewRange && differenceInCalendarDays(
        potentialNewRange.to,
        potentialNewRange.from
      ) > max3) {
        previewHighlight = {
          from: hoveredDate,
          to: hoveredDate
        };
      }
      if (excludeDisabled && disabled2 && potentialNewRange && rangeContainsModifiers(potentialNewRange, disabled2)) {
        previewHighlight = {
          from: hoveredDate,
          to: hoveredDate
        };
      }
      return previewHighlight;
    }, [
      value,
      hoveredDate,
      excludeDisabled,
      resetOnSelect,
      min3,
      max3,
      disabled2
    ]);
  }
  var RangeCalendar = (0, import_element54.forwardRef)(
    function RangeCalendar2({
      defaultValue: defaultValue2,
      value: valueProp,
      onValueChange,
      numberOfMonths = 1,
      excludeDisabled,
      resetOnSelect = true,
      min: min3,
      max: max3,
      disabled: disabled2,
      locale,
      timeZone,
      month,
      render: render4,
      role = "application",
      "aria-label": ariaLabel,
      labels: customLabels,
      ...props
    }, ref) {
      const { "aria-label": defaultAriaLabel, ...localizationProps } = useLocalizationProps({
        locale,
        timeZone,
        mode: "range"
      });
      const labels = (0, import_element54.useMemo)(
        () => customLabels ? { ...localizationProps.labels, ...customLabels } : localizationProps.labels,
        [localizationProps.labels, customLabels]
      );
      const onChange = (0, import_element54.useCallback)(
        (selected2, triggerDate, modifiers2, e) => {
          onValueChange?.(
            selected2 ?? null,
            triggerDate,
            modifiers2,
            e
          );
        },
        [onValueChange]
      );
      const [selected, setSelected] = useControlledValue2({
        defaultValue: defaultValue2,
        value: valueProp,
        onChange
      });
      const dayFocusProps = usePreserveDayFocus(ref, month);
      const [hoveredDate, setHoveredDate] = (0, import_element54.useState)(
        void 0
      );
      const previewRange = usePreviewRange({
        value: selected,
        hoveredDate,
        excludeDisabled,
        resetOnSelect,
        min: min3,
        max: max3,
        disabled: disabled2
      });
      const modifiers = (0, import_element54.useMemo)(() => {
        return {
          preview: previewRange,
          preview_start: previewRange?.from,
          preview_end: previewRange?.to
        };
      }, [previewRange]);
      const rootContextValue = (0, import_element54.useMemo)(
        () => ({
          render: render4,
          ref: dayFocusProps.ref,
          role,
          defaultAriaLabel
        }),
        [render4, dayFocusProps.ref, role, defaultAriaLabel]
      );
      return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(RootContext.Provider, { value: rootContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
        DayPicker,
        {
          ...COMMON_PROPS,
          ...localizationProps,
          ...props,
          "aria-label": ariaLabel,
          mode: "range",
          month,
          numberOfMonths: clampNumberOfMonths(numberOfMonths),
          disabled: disabled2,
          excludeDisabled,
          resetOnSelect,
          min: min3,
          max: max3,
          labels,
          selected: selected ?? void 0,
          onSelect: setSelected,
          onDayFocus: dayFocusProps.onDayFocus,
          onDayBlur: dayFocusProps.onDayBlur,
          onDayMouseEnter: (date) => setHoveredDate(date),
          onDayMouseLeave: () => setHoveredDate(void 0),
          modifiers,
          modifiersClassNames: MODIFIER_CLASSNAMES
        }
      ) });
    }
  );

  // packages/ui/build-module/stack/stack.mjs
  var import_element55 = __toESM(require_element(), 1);
  var STYLE_HASH_ATTRIBUTE26 = "data-wp-hash";
  function getRuntime26() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument26(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash26(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE26}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE26) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle26(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime26();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash26(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE26, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument26(targetDocument) {
    const runtime = getRuntime26();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle26(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle26(hash, css) {
    const runtime = getRuntime26();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle26(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle26("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
  }
  var style_default25 = { "stack": "_19ce0419607e1896__stack" };
  var gapTokens = {
    xs: "var(--wpds-dimension-gap-xs, 4px)",
    sm: "var(--wpds-dimension-gap-sm, 8px)",
    md: "var(--wpds-dimension-gap-md, 12px)",
    lg: "var(--wpds-dimension-gap-lg, 16px)",
    xl: "var(--wpds-dimension-gap-xl, 24px)",
    "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
    "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
  };
  var Stack = (0, import_element55.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render: render4, ...props }, ref) {
    const style = {
      gap: gap && gapTokens[gap],
      alignItems: align,
      justifyContent: justify,
      flexDirection: direction,
      flexWrap: wrap
    };
    const element = useRender({
      render: render4,
      ref,
      props: mergeProps(props, { style, className: style_default25.stack })
    });
    return element;
  });

  // packages/ui/build-module/form/primitives/input/input.mjs
  var import_element58 = __toESM(require_element(), 1);

  // packages/ui/build-module/form/primitives/input-layout/input-layout.mjs
  var import_element56 = __toESM(require_element(), 1);
  var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE27 = "data-wp-hash";
  function getRuntime27() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument27(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash27(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE27}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE27) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle27(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime27();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash27(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE27, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument27(targetDocument) {
    const runtime = getRuntime27();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle27(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle27(hash, css) {
    const runtime = getRuntime27();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle27(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle27("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default10 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle27("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default11 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  if (typeof process === "undefined" || true) {
    registerStyle27("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
  }
  var style_default26 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" };
  var InputLayout = (0, import_element56.forwardRef)(
    function InputLayout2({
      className,
      children,
      visuallyDisabled,
      size: size4 = "default",
      isBorderless,
      prefix,
      suffix,
      ...restProps
    }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
        "div",
        {
          ref,
          className: clsx_default(
            global_css_defense_default10.div,
            resets_default11["box-sizing"],
            style_default26["input-layout"],
            style_default26[`is-size-${size4}`],
            visuallyDisabled && style_default26["is-disabled"],
            isBorderless && style_default26["is-borderless"],
            className
          ),
          ...restProps,
          children: [
            import_element56.Children.count(prefix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
              "div",
              {
                className: style_default26["slot-wrapper"],
                "data-slot-type": "prefix",
                children: prefix
              }
            ),
            children,
            import_element56.Children.count(suffix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
              "div",
              {
                className: style_default26["slot-wrapper"],
                "data-slot-type": "suffix",
                children: suffix
              }
            )
          ]
        }
      );
    }
  );

  // packages/ui/build-module/form/primitives/input-layout/slot.mjs
  var import_element57 = __toESM(require_element(), 1);
  var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE28 = "data-wp-hash";
  function getRuntime28() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument28(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash28(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE28}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE28) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle28(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime28();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash28(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE28, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument28(targetDocument) {
    const runtime = getRuntime28();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle28(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle28(hash, css) {
    const runtime = getRuntime28();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle28(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle28("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
  }
  var style_default27 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" };
  var InputLayoutSlot = (0, import_element57.forwardRef)(function InputLayoutSlot2({ padding = "default", className, ...restProps }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
      "div",
      {
        ref,
        className: clsx_default(
          style_default27["input-layout-slot"],
          style_default27[`is-padding-${padding}`],
          className
        ),
        ...restProps
      }
    );
  });
  InputLayoutSlot.displayName = "InputLayout.Slot";

  // packages/ui/build-module/form/primitives/input-layout/index.mjs
  var InputLayout3 = Object.assign(InputLayout, {
    Slot: InputLayoutSlot
  });

  // packages/ui/build-module/form/primitives/input/input.mjs
  var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE29 = "data-wp-hash";
  function getRuntime29() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument29(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash29(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE29}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE29) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle29(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime29();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash29(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE29, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument29(targetDocument) {
    const runtime = getRuntime29();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle29(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle29(hash, css) {
    const runtime = getRuntime29();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle29(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle29("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default11 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle29("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
  }
  var focus_module_default4 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
  if (typeof process === "undefined" || true) {
    registerStyle29("1a25f6a232", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._2ae7be2fc1bb17a3__input{--_gcd-input-padding:var(--wp-ui-input-padding-block,0px) var(--wp-ui-input-layout-padding-inline,0px);background:transparent;border:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:inherit;font-size:inherit;line-height:inherit;outline:none;padding-block:var(--wp-ui-input-padding-block,0);padding-inline:var(--wp-ui-input-layout-padding-inline,0);width:100%;&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-weak,#707070)}&:disabled,&[aria-disabled=true]{--_gcd-input-placeholder-color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}@media (forced-colors:active){color:GrayText}}&[type=email],&[type=url]{direction:ltr}&[type=number]{appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{appearance:none;margin:0}}}}}");
  }
  var style_default28 = { "input": "_2ae7be2fc1bb17a3__input" };
  var Input3 = (0, import_element58.forwardRef)(function Input22({ className, size: size4 = "default", prefix, suffix, style, ...restProps }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
      InputLayout3,
      {
        className: clsx_default(
          focus_module_default4["outset-ring--focus-within"],
          className
        ),
        style,
        size: size4,
        visuallyDisabled: restProps.disabled,
        prefix,
        suffix,
        children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
          Input,
          {
            ref,
            className: clsx_default(global_css_defense_default11.input, style_default28.input),
            ...restProps
          }
        )
      }
    );
  });

  // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs
  var import_i18n14 = __toESM(require_i18n(), 1);
  var import_element60 = __toESM(require_element(), 1);

  // packages/ui/build-module/spinner/spinner.mjs
  var import_element59 = __toESM(require_element(), 1);
  var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE30 = "data-wp-hash";
  function getRuntime30() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument30(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash30(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE30}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE30) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle30(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime30();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash30(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE30, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument30(targetDocument) {
    const runtime = getRuntime30();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle30(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle30(hash, css) {
    const runtime = getRuntime30();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle30(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle30("bbbecfe373", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.ab4d64c07c0ba587__spinner{background-color:transparent;display:inline-block;height:var(--wpds-dimension-size-2xs,16px);opacity:1;overflow:visible;position:relative;width:var(--wpds-dimension-size-2xs,16px)}.a7654e10245bb7d2__indicator,.dc51f80c84b35fe2__track{fill:transparent;stroke-width:1.5px}.dc51f80c84b35fe2__track{stroke:var(--wpds-color-background-track-neutral,#dbdbdb)}.a7654e10245bb7d2__indicator{stroke:var(--wpds-color-background-thumb-brand,var(--wp-admin-theme-color,#3858e9));stroke-linecap:round;animation:_02322d973909703c__spinner-spin 1.4s linear infinite both;transform-origin:50% 50%}@keyframes _02322d973909703c__spinner-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}}}");
  }
  var style_default29 = { "spinner": "ab4d64c07c0ba587__spinner", "track": "dc51f80c84b35fe2__track", "indicator": "a7654e10245bb7d2__indicator", "spinner-spin": "_02322d973909703c__spinner-spin" };
  var Spinner = (0, import_element59.forwardRef)(
    function Spinner2({ className, ...props }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
        "svg",
        {
          className: clsx_default(style_default29.spinner, className),
          viewBox: "0 0 100 100",
          xmlns: "http://www.w3.org/2000/svg",
          role: "presentation",
          focusable: "false",
          ...props,
          ref,
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
              "circle",
              {
                className: style_default29.track,
                cx: "50",
                cy: "50",
                r: "50",
                vectorEffect: "non-scaling-stroke"
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
              "path",
              {
                className: style_default29.indicator,
                d: "m 50 0 a 50 50 0 0 1 50 50",
                vectorEffect: "non-scaling-stroke"
              }
            )
          ]
        }
      );
    }
  );

  // packages/ui/build-module/form/primitives/validity-indicator/validity-indicator.mjs
  var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE31 = "data-wp-hash";
  function getRuntime31() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument31(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash31(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE31}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE31) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle31(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime31();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash31(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE31, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument31(targetDocument) {
    const runtime = getRuntime31();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle31(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle31(hash, css) {
    const runtime = getRuntime31();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle31(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle31("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default12 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle31("d11816833c", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7a7ac88e306348e7__indicator{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);align-items:flex-start;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);gap:var(--wpds-dimension-gap-xs,4px);line-height:var(--wpds-typography-line-height-xs,16px);@media not (prefers-reduced-motion){animation:_48722cc5dd090ce4__indicator-jump var(--wpds-motion-duration-md,.2s) cubic-bezier(.68,-.55,.27,1.55)}}._57a3bbbfbe38a5c6__is-invalid{color:var(--wpds-color-foreground-content-error-weak,#cc1818)}._9e944dc198aac10b__is-valid{color:var(--wpds-color-foreground-content-success-weak,#008030)}.e482806667437c6a__indicator-icon{flex-shrink:0}._6e46434cc23019d2__indicator-spinner{height:var(--wpds-dimension-size-3xs,12px);margin:2px;width:var(--wpds-dimension-size-3xs,12px)}@keyframes _48722cc5dd090ce4__indicator-jump{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}}}');
  }
  var style_default30 = { "indicator": "_7a7ac88e306348e7__indicator", "indicator-jump": "_48722cc5dd090ce4__indicator-jump", "is-invalid": "_57a3bbbfbe38a5c6__is-invalid", "is-valid": "_9e944dc198aac10b__is-valid", "indicator-icon": "e482806667437c6a__indicator-icon", "indicator-spinner": "_6e46434cc23019d2__indicator-spinner" };
  var ICON = {
    valid: published_default,
    invalid: error_default
  };
  function ValidityIndicator({
    id,
    type,
    message: message2
  }) {
    return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
      "p",
      {
        id,
        className: clsx_default(
          global_css_defense_default12.p,
          style_default30.indicator,
          style_default30[`is-${type}`]
        ),
        children: [
          type === "validating" ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Spinner, { className: style_default30["indicator-spinner"] }) : /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
            Icon,
            {
              className: style_default30["indicator-icon"],
              icon: ICON[type],
              size: 16,
              fill: "currentColor"
            }
          ),
          message2
        ]
      }
    );
  }

  // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs
  var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1);
  var DEFAULT_RENDER = (props) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Stack, { ...props, direction: "column", gap: "sm" });
  function appendRequiredIndicator(label, required, markWhenOptional) {
    let suffix;
    if (required && !markWhenOptional) {
      suffix = `(${(0, import_i18n14.__)("Required")})`;
    } else if (!required && markWhenOptional) {
      suffix = `(${(0, import_i18n14.__)("Optional")})`;
    }
    if (!suffix) {
      return label;
    }
    if (typeof label === "string") {
      return `${label} ${suffix}`;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
      label,
      " ",
      suffix
    ] });
  }
  var VALIDITY_VISIBLE_ATTRIBUTE = "data-validity-visible";
  var ControlWithError = (0, import_element60.forwardRef)(function ControlWithError2({
    required,
    markWhenOptional,
    customValidity,
    getValidityTarget,
    children,
    render: render4 = DEFAULT_RENDER,
    ...restProps
  }, forwardedRef) {
    const [errorMessage, setErrorMessage] = (0, import_element60.useState)();
    const [statusMessage, setStatusMessage] = (0, import_element60.useState)();
    const [showMessage, setShowMessage] = (0, import_element60.useState)(false);
    const [isTouched, setIsTouched] = (0, import_element60.useState)(false);
    const wrapperRef = (0, import_element60.useRef)(null);
    (0, import_element60.useEffect)(() => {
      const validityTarget = getValidityTarget();
      const handler = () => {
        if (customValidity?.type !== "validating") {
          setErrorMessage(validityTarget?.validationMessage);
        }
        setShowMessage(true);
        validityTarget?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, "");
      };
      validityTarget?.addEventListener("invalid", handler);
      return () => validityTarget?.removeEventListener("invalid", handler);
    }, [customValidity?.type, getValidityTarget]);
    (0, import_element60.useEffect)(() => {
      const validityTarget = getValidityTarget();
      const suppressNativePopover = (event) => {
        event.preventDefault();
        if (!event.isTrusted) {
          return;
        }
        const target = event.target;
        const firstErrorInForm = Array.from(
          target.form?.elements ?? []
        ).find((el) => !el.validity.valid);
        if (!target.form || firstErrorInForm === target) {
          target.focus();
        }
      };
      const radioSiblings = validityTarget?.type === "radio" && validityTarget?.name ? Array.from(
        wrapperRef.current?.querySelectorAll(
          `input[type="radio"][name="${validityTarget?.name}"]`
        ) ?? []
      ).filter((sibling) => sibling !== validityTarget) : [];
      validityTarget?.addEventListener("invalid", suppressNativePopover);
      radioSiblings.forEach(
        (sibling) => sibling.addEventListener("invalid", suppressNativePopover)
      );
      return () => {
        validityTarget?.removeEventListener(
          "invalid",
          suppressNativePopover
        );
        radioSiblings.forEach(
          (sibling) => sibling.removeEventListener("invalid", suppressNativePopover)
        );
      };
    }, [getValidityTarget]);
    (0, import_element60.useEffect)(() => {
      const validityTarget = getValidityTarget();
      if (!customValidity?.type) {
        validityTarget?.setCustomValidity("");
        setErrorMessage(validityTarget?.validationMessage);
        setStatusMessage(void 0);
        return;
      }
      switch (customValidity.type) {
        case "validating": {
          validityTarget?.setCustomValidity("");
          setErrorMessage(void 0);
          setStatusMessage({
            type: "validating",
            message: customValidity.message
          });
          break;
        }
        case "valid": {
          validityTarget?.setCustomValidity("");
          setErrorMessage(validityTarget?.validationMessage);
          setStatusMessage({
            type: "valid",
            message: customValidity.message
          });
          break;
        }
        case "invalid": {
          validityTarget?.setCustomValidity(
            customValidity.message ?? ""
          );
          setErrorMessage(validityTarget?.validationMessage);
          setStatusMessage(void 0);
          break;
        }
      }
    }, [customValidity, getValidityTarget]);
    (0, import_element60.useEffect)(() => {
      if (!isTouched || showMessage) {
        return;
      }
      if (customValidity?.type === "validating") {
        const timer = setTimeout(() => {
          setShowMessage(true);
        }, 1e3);
        return () => clearTimeout(timer);
      }
      setShowMessage(true);
    }, [isTouched, customValidity?.type, showMessage]);
    const onBlur = (event) => {
      if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) {
        return;
      }
      if (!isTouched) {
        setIsTouched(true);
        getValidityTarget()?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, "");
      }
      const validityTarget = getValidityTarget();
      const isValidating = customValidity?.type === "validating";
      window.queueMicrotask(() => {
        if (!isValidating) {
          setErrorMessage(validityTarget?.validationMessage);
        }
      });
    };
    const messageId = (0, import_element60.useId)();
    const message2 = (() => {
      if (errorMessage) {
        return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
          ValidityIndicator,
          {
            id: messageId,
            type: "invalid",
            message: errorMessage
          }
        );
      }
      if (statusMessage?.type) {
        return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
          ValidityIndicator,
          {
            id: messageId,
            type: statusMessage.type,
            message: statusMessage.message
          }
        );
      }
      return null;
    })();
    const visibleMessage = showMessage ? message2 : null;
    (0, import_element60.useEffect)(() => {
      const target = getValidityTarget();
      if (!target) {
        return;
      }
      function setDescribedBy(el, shouldAdd) {
        const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter((id) => id && id !== messageId);
        if (shouldAdd) {
          ids.push(messageId);
        }
        if (ids.length) {
          el.setAttribute("aria-describedby", ids.join(" "));
        } else {
          el.removeAttribute("aria-describedby");
        }
      }
      setDescribedBy(target, !!visibleMessage);
      return () => setDescribedBy(target, false);
    }, [visibleMessage, messageId, getValidityTarget]);
    return useRender({
      render: render4,
      ref: [forwardedRef, wrapperRef],
      props: mergeProps(restProps, {
        onBlur,
        children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
          (0, import_element60.cloneElement)(children, {
            label: appendRequiredIndicator(
              children.props.label,
              required,
              markWhenOptional
            ),
            required
          }),
          visibleMessage
        ] })
      })
    });
  });

  // packages/ui/build-module/form/primitives/field/index.mjs
  var field_exports = {};
  __export(field_exports, {
    Control: () => Control,
    Description: () => Description,
    Details: () => Details,
    Item: () => Item2,
    Label: () => Label,
    Root: () => Root5,
    VisualLabel: () => VisualLabel
  });

  // packages/ui/build-module/form/primitives/field/root.mjs
  var import_element61 = __toESM(require_element(), 1);
  var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE32 = "data-wp-hash";
  function getRuntime32() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument32(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash32(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE32}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE32) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle32(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime32();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash32(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE32, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument32(targetDocument) {
    const runtime = getRuntime32();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle32(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle32(hash, css) {
    const runtime = getRuntime32();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle32(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle32("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
  }
  var resets_default12 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
  var DEFAULT_RENDER2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Stack, { ...props, direction: "column", gap: "sm" });
  var Root5 = (0, import_element61.forwardRef)(function Root22({ className, render: render4 = DEFAULT_RENDER2, ...restProps }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
      index_parts_exports2.Root,
      {
        ref,
        className: clsx_default(resets_default12["box-sizing"], className),
        render: render4,
        ...restProps
      }
    );
  });

  // packages/ui/build-module/form/primitives/field/item.mjs
  var import_element62 = __toESM(require_element(), 1);
  var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
  var Item2 = (0, import_element62.forwardRef)(function Item22(props, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(index_parts_exports2.Item, { ref, ...props });
  });

  // packages/ui/build-module/form/primitives/field/label.mjs
  var import_element63 = __toESM(require_element(), 1);
  var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE33 = "data-wp-hash";
  function getRuntime33() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument33(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash33(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE33}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE33) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle33(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime33();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash33(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE33, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument33(targetDocument) {
    const runtime = getRuntime33();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle33(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle33(hash, css) {
    const runtime = getRuntime33();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle33(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle33("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
  }
  var field_default = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
  var Label = (0, import_element63.forwardRef)(
    function Label2({ className, hideFromVision, variant, ...restProps }, ref) {
      const label = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
        index_parts_exports2.Label,
        {
          ref,
          className: clsx_default(
            field_default.label,
            variant && field_default[`is-${variant}`],
            className
          ),
          ...restProps
        }
      );
      if (hideFromVision) {
        return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(VisuallyHidden, { render: label });
      }
      return label;
    }
  );

  // packages/ui/build-module/form/primitives/field/description.mjs
  var import_element64 = __toESM(require_element(), 1);
  var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE34 = "data-wp-hash";
  function getRuntime34() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument34(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash34(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE34}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE34) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle34(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime34();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash34(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE34, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument34(targetDocument) {
    const runtime = getRuntime34();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle34(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle34(hash, css) {
    const runtime = getRuntime34();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle34(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle34("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default13 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  if (typeof process === "undefined" || true) {
    registerStyle34("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
  }
  var field_default2 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
  var Description = (0, import_element64.forwardRef)(function Description2({ className, ...restProps }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
      index_parts_exports2.Description,
      {
        ref,
        className: clsx_default(
          global_css_defense_default13.p,
          field_default2.description,
          className
        ),
        ...restProps
      }
    );
  });

  // packages/ui/build-module/form/primitives/field/details.mjs
  var import_element65 = __toESM(require_element(), 1);
  var import_i18n15 = __toESM(require_i18n(), 1);
  var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE35 = "data-wp-hash";
  function getRuntime35() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument35(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash35(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE35}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE35) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle35(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime35();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash35(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE35, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument35(targetDocument) {
    const runtime = getRuntime35();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle35(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle35(hash, css) {
    const runtime = getRuntime35();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle35(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle35("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
  }
  var field_default3 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
  var Details = (0, import_element65.forwardRef)(
    function Details2({ className, ...restProps }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_jsx_runtime110.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(index_parts_exports2.Description, {}), children: (0, import_i18n15.__)("More details follow the field.") }),
        /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
          "div",
          {
            ref,
            className: clsx_default(field_default3.description, className),
            ...restProps
          }
        )
      ] });
    }
  );

  // packages/ui/build-module/form/primitives/field/control.mjs
  var import_element66 = __toESM(require_element(), 1);
  var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1);
  var Control = (0, import_element66.forwardRef)(
    function Control2(props, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(index_parts_exports2.Control, { ref, ...props });
    }
  );

  // packages/ui/build-module/form/primitives/field/visual-label.mjs
  var import_element67 = __toESM(require_element(), 1);
  var STYLE_HASH_ATTRIBUTE36 = "data-wp-hash";
  function getRuntime36() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument36(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash36(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE36}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE36) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle36(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime36();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash36(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE36, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument36(targetDocument) {
    const runtime = getRuntime36();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle36(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle36(hash, css) {
    const runtime = getRuntime36();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle36(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle36("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
  }
  var field_default4 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
  var VisualLabel = (0, import_element67.forwardRef)(
    function VisualLabel2({ className, render: render4, variant, ...restProps }, ref) {
      return useRender({
        defaultTagName: "span",
        render: render4,
        ref,
        props: mergeProps(restProps, {
          className: clsx_default(
            field_default4.label,
            variant && field_default4[`is-${variant}`],
            className
          )
        })
      });
    }
  );
  VisualLabel.displayName = "Field.VisualLabel";

  // packages/ui/build-module/form/primitives/textarea/textarea.mjs
  var import_element68 = __toESM(require_element(), 1);
  var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE37 = "data-wp-hash";
  function getRuntime37() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument37(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash37(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE37}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE37) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle37(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime37();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash37(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE37, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument37(targetDocument) {
    const runtime = getRuntime37();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle37(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle37(hash, css) {
    const runtime = getRuntime37();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle37(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle37("1540cbc709", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._1e441c22c9dc5d28__wrapper{--wp-ui-textarea-min-height:var(--wpds-dimension-size-lg,40px)}._414844876c32ecee__textarea{min-height:calc(var(--wp-ui-textarea-min-height) - 2px);resize:block}}@layer compositions{._1e441c22c9dc5d28__wrapper{--wp-ui-input-padding-block:9.9px;height:auto;line-height:1.4}}}");
  }
  var style_default31 = { "wrapper": "_1e441c22c9dc5d28__wrapper", "textarea": "_414844876c32ecee__textarea" };
  if (typeof process === "undefined" || true) {
    registerStyle37("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
  }
  var global_css_defense_default14 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
  var wrappedRender = (render4, restProps) => {
    return function textareaRender(props) {
      return typeof render4 === "function" ? render4(mergeProps(props, restProps)) : (0, import_element68.cloneElement)(render4, mergeProps(props, restProps));
    };
  };
  var Textarea = (0, import_element68.forwardRef)(
    function Textarea2({
      className,
      defaultValue: defaultValue2,
      disabled: disabled2,
      onValueChange,
      render: render4,
      rows = 4,
      style,
      value,
      ...restProps
    }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
        Input3,
        {
          className: clsx_default(style_default31.wrapper, className),
          style,
          render: wrappedRender(
            render4 || ((props) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("textarea", { ...props })),
            {
              className: clsx_default(
                global_css_defense_default14.textarea,
                style_default31.textarea
              ),
              ref,
              rows,
              ...restProps
            }
          ),
          value,
          defaultValue: defaultValue2,
          onValueChange,
          disabled: disabled2
        }
      );
    }
  );

  // packages/ui/build-module/form/input-control/input-control.mjs
  var import_element69 = __toESM(require_element(), 1);
  var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1);
  var STYLE_HASH_ATTRIBUTE38 = "data-wp-hash";
  function getRuntime38() {
    const globalScope = globalThis;
    if (globalScope.__wpStyleRuntime) {
      return globalScope.__wpStyleRuntime;
    }
    globalScope.__wpStyleRuntime = {
      documents: /* @__PURE__ */ new Map(),
      styles: /* @__PURE__ */ new Map(),
      injectedStyles: /* @__PURE__ */ new WeakMap()
    };
    if (typeof document !== "undefined") {
      registerDocument38(document);
    }
    return globalScope.__wpStyleRuntime;
  }
  function documentContainsStyleHash38(targetDocument, hash) {
    if (!targetDocument.head) {
      return false;
    }
    for (const style of targetDocument.head.querySelectorAll(
      `style[${STYLE_HASH_ATTRIBUTE38}]`
    )) {
      if (style.getAttribute(STYLE_HASH_ATTRIBUTE38) === hash) {
        return true;
      }
    }
    return false;
  }
  function injectStyle38(targetDocument, hash, css) {
    if (!targetDocument.head) {
      return;
    }
    const runtime = getRuntime38();
    let injectedStyles = runtime.injectedStyles.get(targetDocument);
    if (!injectedStyles) {
      injectedStyles = /* @__PURE__ */ new Set();
      runtime.injectedStyles.set(targetDocument, injectedStyles);
    }
    if (injectedStyles.has(hash)) {
      return;
    }
    if (documentContainsStyleHash38(targetDocument, hash)) {
      injectedStyles.add(hash);
      return;
    }
    const style = targetDocument.createElement("style");
    style.setAttribute(STYLE_HASH_ATTRIBUTE38, hash);
    style.appendChild(targetDocument.createTextNode(css));
    targetDocument.head.appendChild(style);
    injectedStyles.add(hash);
  }
  function registerDocument38(targetDocument) {
    const runtime = getRuntime38();
    runtime.documents.set(
      targetDocument,
      (runtime.documents.get(targetDocument) ?? 0) + 1
    );
    for (const [hash, css] of runtime.styles) {
      injectStyle38(targetDocument, hash, css);
    }
    return () => {
      const count = runtime.documents.get(targetDocument);
      if (count === void 0) {
        return;
      }
      if (count <= 1) {
        runtime.documents.delete(targetDocument);
        return;
      }
      runtime.documents.set(targetDocument, count - 1);
    };
  }
  function registerStyle38(hash, css) {
    const runtime = getRuntime38();
    runtime.styles.set(hash, css);
    for (const targetDocument of runtime.documents.keys()) {
      injectStyle38(targetDocument, hash, css);
    }
  }
  if (typeof process === "undefined" || true) {
    registerStyle38("0c752c3d08", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer compositions{@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.a9211a7e6af24bed__root input[type=date]:not([data-filled]):not(:focus),.a9211a7e6af24bed__root input[type=datetime-local]:not([data-filled]):not(:focus),.a9211a7e6af24bed__root input[type=time]:not([data-filled]):not(:focus){--_gcd-input-color:transparent;--_gcd-input-color-disabled:transparent;color:transparent;&:disabled::-webkit-datetime-edit-text{color:transparent}}}}}");
  }
  var style_default32 = { "root": "a9211a7e6af24bed__root" };
  var InputControl = (0, import_element69.forwardRef)(
    function InputControl2({
      className,
      label,
      description,
      details,
      hideLabelFromVision,
      ...restProps
    }, ref) {
      return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(field_exports.Root, { className: clsx_default(style_default32.root, className), children: [
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(field_exports.Label, { hideFromVision: hideLabelFromVision, children: label }),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Input3, { ref, ...restProps }),
        description && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(field_exports.Description, { children: description }),
        details && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(field_exports.Details, { children: details })
      ] });
    }
  );

  // packages/ui/build-module/form/textarea-control/textarea-control.mjs
  var import_element70 = __toESM(require_element(), 1);
  var import_jsx_runtime114 = __toESM(require_jsx_runtime(), 1);
  var TextareaControl = (0, import_element70.forwardRef)(function TextareaControl2({
    className,
    label,
    description,
    details,
    hideLabelFromVision,
    ...restProps
  }, ref) {
    return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(field_exports.Root, { className, children: [
      /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(field_exports.Label, { hideFromVision: hideLabelFromVision, children: label }),
      /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Textarea, { ref, ...restProps }),
      description && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(field_exports.Description, { children: description }),
      details && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(field_exports.Details, { children: details })
    ] });
  });

  // packages/ui/build-module/form/with-validation/validated-input-control/validated-input-control.mjs
  var import_element71 = __toESM(require_element(), 1);
  var import_compose3 = __toESM(require_compose(), 1);
  var import_jsx_runtime115 = __toESM(require_jsx_runtime(), 1);
  var ValidatedInputControl = (0, import_element71.forwardRef)(function ValidatedInputControl2({ required, markWhenOptional, customValidity, ...restProps }, forwardedRef) {
    const validityTargetRef = (0, import_element71.useRef)(null);
    const mergedRefs = (0, import_compose3.useMergeRefs)([forwardedRef, validityTargetRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
      ControlWithError,
      {
        required,
        markWhenOptional,
        customValidity,
        getValidityTarget: () => validityTargetRef.current,
        children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(InputControl, { ref: mergedRefs, ...restProps })
      }
    );
  });

  // packages/ui/build-module/form/with-validation/validated-textarea-control/validated-textarea-control.mjs
  var import_element72 = __toESM(require_element(), 1);
  var import_compose4 = __toESM(require_compose(), 1);
  var import_jsx_runtime116 = __toESM(require_jsx_runtime(), 1);
  var ValidatedTextareaControl = (0, import_element72.forwardRef)(function ValidatedTextareaControl2({ required, markWhenOptional, customValidity, ...restProps }, forwardedRef) {
    const validityTargetRef = (0, import_element72.useRef)(null);
    const mergedRefs = (0, import_compose4.useMergeRefs)([forwardedRef, validityTargetRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
      ControlWithError,
      {
        required,
        markWhenOptional,
        customValidity,
        getValidityTarget: () => validityTargetRef.current,
        children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TextareaControl, { ref: mergedRefs, ...restProps })
      }
    );
  });

  // packages/dataviews/build-module/components/dataviews-context/index.mjs
  var import_element73 = __toESM(require_element(), 1);

  // packages/dataviews/build-module/constants.mjs
  var import_i18n16 = __toESM(require_i18n(), 1);
  var OPERATOR_IS_ANY = "isAny";
  var OPERATOR_IS_NONE = "isNone";
  var OPERATOR_IS_ALL = "isAll";
  var OPERATOR_IS_NOT_ALL = "isNotAll";
  var OPERATOR_BETWEEN = "between";
  var OPERATOR_IN_THE_PAST = "inThePast";
  var OPERATOR_OVER = "over";
  var OPERATOR_IS = "is";
  var OPERATOR_IS_NOT = "isNot";
  var OPERATOR_LESS_THAN = "lessThan";
  var OPERATOR_GREATER_THAN = "greaterThan";
  var OPERATOR_LESS_THAN_OR_EQUAL = "lessThanOrEqual";
  var OPERATOR_GREATER_THAN_OR_EQUAL = "greaterThanOrEqual";
  var OPERATOR_BEFORE = "before";
  var OPERATOR_AFTER = "after";
  var OPERATOR_BEFORE_INC = "beforeInc";
  var OPERATOR_AFTER_INC = "afterInc";
  var OPERATOR_CONTAINS = "contains";
  var OPERATOR_NOT_CONTAINS = "notContains";
  var OPERATOR_STARTS_WITH = "startsWith";
  var OPERATOR_ON = "on";
  var OPERATOR_NOT_ON = "notOn";
  var SORTING_DIRECTIONS = ["asc", "desc"];
  var sortArrows = { asc: "\u2191", desc: "\u2193" };
  var sortValues = { asc: "ascending", desc: "descending" };
  var sortLabels = {
    asc: (0, import_i18n16.__)("Sort ascending"),
    desc: (0, import_i18n16.__)("Sort descending")
  };
  var sortIcons = {
    asc: arrow_up_default,
    desc: arrow_down_default
  };
  var LAYOUT_TABLE = "table";
  var LAYOUT_GRID = "grid";
  var LAYOUT_LIST = "list";
  var LAYOUT_ACTIVITY = "activity";
  var LAYOUT_PICKER_GRID = "pickerGrid";
  var LAYOUT_PICKER_TABLE = "pickerTable";
  var LAYOUT_PICKER_ACTIVITY = "pickerActivity";
  var MEDIA_ASPECT_RATIOS = [
    "1/1",
    "4/3",
    "3/4",
    "3/2",
    "2/3",
    "16/9",
    "9/16"
  ];

  // packages/dataviews/build-module/components/dataviews-context/index.mjs
  var DataViewsContext = (0, import_element73.createContext)({
    view: { type: LAYOUT_TABLE },
    onChangeView: () => {
    },
    fields: [],
    data: [],
    paginationInfo: {
      totalItems: 0,
      totalPages: 0
    },
    selection: [],
    onChangeSelection: () => {
    },
    setOpenedFilter: () => {
    },
    openedFilter: null,
    getItemId: (item) => item.id,
    isItemClickable: () => true,
    renderItemLink: void 0,
    containerWidth: 0,
    containerRef: (0, import_element73.createRef)(),
    resizeObserverRef: () => {
    },
    defaultLayouts: { list: {}, grid: {}, table: {} },
    filters: [],
    isShowingFilter: false,
    setIsShowingFilter: () => {
    },
    hasInitiallyLoaded: false,
    config: {
      perPageSizes: []
    },
    intersectionObserver: null
  });
  DataViewsContext.displayName = "DataViewsContext";
  var dataviews_context_default = DataViewsContext;

  // packages/dataviews/build-module/components/dataviews-layouts/index.mjs
  var import_i18n38 = __toESM(require_i18n(), 1);

  // packages/dataviews/build-module/components/dataviews-layouts/table/index.mjs
  var import_i18n24 = __toESM(require_i18n(), 1);
  var import_components7 = __toESM(require_components(), 1);
  var import_element82 = __toESM(require_element(), 1);
  var import_keycodes2 = __toESM(require_keycodes(), 1);

  // packages/dataviews/build-module/components/dataviews-selection-checkbox/index.mjs
  var import_components2 = __toESM(require_components(), 1);
  var import_i18n17 = __toESM(require_i18n(), 1);
  var import_jsx_runtime117 = __toESM(require_jsx_runtime(), 1);
  var SELECTION_CHECKBOX_CLASS = "dataviews-selection-checkbox";
  function DataViewsSelectionCheckbox({
    selection,
    onChangeSelection,
    item,
    getItemId,
    titleField,
    disabled: disabled2,
    ...extraProps
  }) {
    const id = getItemId(item);
    const isInSelectionArray = selection.includes(id);
    const checked2 = !disabled2 && isInSelectionArray;
    const selectionLabel = titleField?.getValue?.({ item }) || (0, import_i18n17.__)("(no title)");
    return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
      import_components2.CheckboxControl,
      {
        className: SELECTION_CHECKBOX_CLASS,
        "aria-label": selectionLabel,
        "aria-disabled": disabled2,
        checked: checked2,
        onChange: () => {
          if (disabled2) {
            return;
          }
          onChangeSelection(
            isInSelectionArray ? selection.filter((itemId) => id !== itemId) : [...selection, id]
          );
        },
        ...extraProps
      }
    );
  }

  // packages/dataviews/build-module/components/dataviews-item-actions/index.mjs
  var import_components3 = __toESM(require_components(), 1);
  var import_i18n18 = __toESM(require_i18n(), 1);
  var import_element74 = __toESM(require_element(), 1);
  var import_data2 = __toESM(require_data(), 1);
  var import_compose5 = __toESM(require_compose(), 1);

  // node_modules/tslib/tslib.es6.mjs
  var __assign = function() {
    __assign = Object.assign || function __assign2(t) {
      for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t[p2] = s[p2];
      }
      return t;
    };
    return __assign.apply(this, arguments);
  };

  // node_modules/lower-case/dist.es2015/index.js
  function lowerCase(str) {
    return str.toLowerCase();
  }

  // node_modules/no-case/dist.es2015/index.js
  var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
  var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
  function noCase(input, options) {
    if (options === void 0) {
      options = {};
    }
    var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
    var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
    var start = 0;
    var end = result.length;
    while (result.charAt(start) === "\0")
      start++;
    while (result.charAt(end - 1) === "\0")
      end--;
    return result.slice(start, end).split("\0").map(transform).join(delimiter);
  }
  function replace(input, re2, value) {
    if (re2 instanceof RegExp)
      return input.replace(re2, value);
    return re2.reduce(function(input2, re3) {
      return input2.replace(re3, value);
    }, input);
  }

  // node_modules/dot-case/dist.es2015/index.js
  function dotCase(input, options) {
    if (options === void 0) {
      options = {};
    }
    return noCase(input, __assign({ delimiter: "." }, options));
  }

  // node_modules/param-case/dist.es2015/index.js
  function paramCase(input, options) {
    if (options === void 0) {
      options = {};
    }
    return dotCase(input, __assign({ delimiter: "-" }, options));
  }

  // packages/kebab-case/build-module/index.mjs
  function kebabCase(str) {
    let input = str?.toString?.() ?? "";
    input = input.replace(/['\u2019]/, "");
    return paramCase(input, {
      splitRegexp: [
        /(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,
        // fooBar => foo-bar, 3Bar => 3-bar
        /(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,
        // 3bar => 3-bar
        /([A-Za-z])([0-9])/g,
        // Foo3 => foo-3, foo3 => foo-3
        /([A-Z])([A-Z][a-z])/g
        // FOOBar => foo-bar
      ]
    });
  }

  // packages/dataviews/build-module/components/dataviews-item-actions/index.mjs
  var import_jsx_runtime118 = __toESM(require_jsx_runtime(), 1);
  function ButtonTrigger({
    action,
    onClick,
    items,
    variant
  }) {
    const label = typeof action.label === "string" ? action.label : action.label(items);
    return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
      import_components3.Button,
      {
        disabled: !!action.disabled,
        accessibleWhenDisabled: true,
        size: "compact",
        variant,
        onClick,
        children: label
      }
    );
  }
  function MenuItemTrigger({
    action,
    onClick,
    items
  }) {
    const label = typeof action.label === "string" ? action.label : action.label(items);
    return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(menu_exports.Item, { disabled: action.disabled, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(menu_exports.ItemLabel, { children: label }) });
  }
  function ActionModal({
    action,
    items,
    closeModal
  }) {
    const label = typeof action.label === "string" ? action.label : action.label(items);
    const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
    return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
      import_components3.Modal,
      {
        title: modalHeader || label,
        __experimentalHideHeader: !!action.hideModalHeader,
        onRequestClose: closeModal,
        focusOnMount: action.modalFocusOnMount ?? true,
        size: action.modalSize || "medium",
        overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase(
          action.id
        )}`,
        children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(action.RenderModal, { items, closeModal })
      }
    );
  }
  function ActionsMenuGroup({
    actions,
    item,
    registry,
    setActiveModalAction
  }) {
    const { primaryActions, regularActions } = (0, import_element74.useMemo)(() => {
      return actions.reduce(
        (acc, action) => {
          (action.isPrimary ? acc.primaryActions : acc.regularActions).push(action);
          return acc;
        },
        {
          primaryActions: [],
          regularActions: []
        }
      );
    }, [actions]);
    const renderActionGroup = (actionList) => actionList.map((action) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
      MenuItemTrigger,
      {
        action,
        onClick: () => {
          if ("RenderModal" in action) {
            setActiveModalAction(action);
            return;
          }
          action.callback([item], { registry });
        },
        items: [item]
      },
      action.id
    ));
    return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(menu_exports.Group, { children: [
      renderActionGroup(primaryActions),
      renderActionGroup(regularActions)
    ] });
  }
  function ItemActions({
    item,
    actions,
    isCompact
  }) {
    const registry = (0, import_data2.useRegistry)();
    const { primaryActions, eligibleActions } = (0, import_element74.useMemo)(() => {
      const _eligibleActions = actions.filter(
        (action) => !action.isEligible || action.isEligible(item)
      );
      const _primaryActions = _eligibleActions.filter(
        (action) => action.isPrimary
      );
      return {
        primaryActions: _primaryActions,
        eligibleActions: _eligibleActions
      };
    }, [actions, item]);
    const isMobileViewport = (0, import_compose5.useViewportMatch)("medium", "<");
    if (isCompact) {
      return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
        CompactItemActions,
        {
          item,
          actions: eligibleActions,
          isSmall: true,
          registry
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
      Stack,
      {
        direction: "row",
        justify: "flex-end",
        className: "dataviews-item-actions",
        style: {
          flexShrink: 0,
          width: "auto"
        },
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
            PrimaryActions,
            {
              item,
              actions: primaryActions,
              registry
            }
          ),
          (primaryActions.length < eligibleActions.length || // Since we hide primary actions on mobile, we need to show the menu
          // there if there are any actions at all.
          isMobileViewport) && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
            CompactItemActions,
            {
              item,
              actions: eligibleActions,
              registry
            }
          )
        ]
      }
    );
  }
  function CompactItemActions({
    item,
    actions,
    isSmall,
    registry
  }) {
    const [activeModalAction, setActiveModalAction] = (0, import_element74.useState)(
      null
    );
    return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(menu_exports.Root, { disabled: !actions.length, children: [
        /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
          menu_exports.Trigger,
          {
            render: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
              import_components3.Button,
              {
                size: isSmall ? "small" : "compact",
                icon: more_vertical_default,
                label: (0, import_i18n18.__)("Actions"),
                accessibleWhenDisabled: true,
                disabled: !actions.length,
                className: "dataviews-all-actions-button"
              }
            )
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(menu_exports.Popup, { positioner: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(menu_exports.Positioner, { align: "end" }), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
          ActionsMenuGroup,
          {
            actions,
            item,
            registry,
            setActiveModalAction
          }
        ) })
      ] }),
      !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
        ActionModal,
        {
          action: activeModalAction,
          items: [item],
          closeModal: () => setActiveModalAction(null)
        }
      )
    ] });
  }
  function PrimaryActions({
    item,
    actions,
    registry,
    buttonVariant
  }) {
    const [activeModalAction, setActiveModalAction] = (0, import_element74.useState)(null);
    const isMobileViewport = (0, import_compose5.useViewportMatch)("medium", "<");
    if (isMobileViewport) {
      return null;
    }
    if (!Array.isArray(actions) || actions.length === 0) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
      actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
        ButtonTrigger,
        {
          action,
          onClick: () => {
            if ("RenderModal" in action) {
              setActiveModalAction(action);
              return;
            }
            action.callback([item], { registry });
          },
          items: [item],
          variant: buttonVariant
        },
        action.id
      )),
      !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
        ActionModal,
        {
          action: activeModalAction,
          items: [item],
          closeModal: () => setActiveModalAction(null)
        }
      )
    ] });
  }

  // packages/dataviews/build-module/components/dataviews-bulk-actions/index.mjs
  var import_components4 = __toESM(require_components(), 1);
  var import_i18n20 = __toESM(require_i18n(), 1);
  var import_element75 = __toESM(require_element(), 1);
  var import_data3 = __toESM(require_data(), 1);
  var import_compose6 = __toESM(require_compose(), 1);

  // packages/dataviews/build-module/utils/get-footer-message.mjs
  var import_i18n19 = __toESM(require_i18n(), 1);
  function getFooterMessage(selectionCount, itemsCount, totalItems, onlyTotalCount = false) {
    if (selectionCount > 0) {
      return (0, import_i18n19.sprintf)(
        /* translators: %d: number of items. */
        (0, import_i18n19._n)("%d Item selected", "%d Items selected", selectionCount),
        selectionCount
      );
    }
    if (onlyTotalCount || totalItems <= itemsCount) {
      return (0, import_i18n19.sprintf)(
        /* translators: %d: number of items. */
        (0, import_i18n19._n)("%d Item", "%d Items", totalItems),
        totalItems
      );
    }
    return (0, import_i18n19.sprintf)(
      /* translators: %1$d: number of items. %2$d: total number of items. */
      (0, import_i18n19._n)("%1$d of %2$d Item", "%1$d of %2$d Items", totalItems),
      itemsCount,
      totalItems
    );
  }

  // packages/dataviews/build-module/components/dataviews-bulk-actions/index.mjs
  var import_jsx_runtime119 = __toESM(require_jsx_runtime(), 1);
  function hasAPossibleBulkAction(actions, item) {
    return actions.some(
      (action) => action.supportsBulk && (!action.isEligible || action.isEligible(item))
    );
  }
  function useHasAPossibleBulkAction(actions, item) {
    return (0, import_element75.useMemo)(
      () => hasAPossibleBulkAction(actions, item),
      [actions, item]
    );
  }
  function useSomeItemHasAPossibleBulkAction(actions, data) {
    return (0, import_element75.useMemo)(
      () => data.some((item) => hasAPossibleBulkAction(actions, item)),
      [actions, data]
    );
  }
  function BulkSelectionCheckbox({
    selection,
    onChangeSelection,
    data,
    actions,
    getItemId,
    disableSelectAll = false
  }) {
    const selectableItems = (0, import_element75.useMemo)(() => {
      return data.filter((item) => {
        return actions.some(
          (action) => action.supportsBulk && (!action.isEligible || action.isEligible(item))
        );
      });
    }, [data, actions]);
    const selectedItems = data.filter(
      (item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
    );
    const hasSelection = selection.length > 0;
    const areAllSelected = selectedItems.length === selectableItems.length;
    if (disableSelectAll) {
      return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
        import_components4.CheckboxControl,
        {
          className: "dataviews-view-table-selection-checkbox",
          checked: hasSelection,
          disabled: !hasSelection,
          onChange: () => {
            onChangeSelection([]);
          },
          "aria-label": (0, import_i18n20.__)("Deselect all")
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
      import_components4.CheckboxControl,
      {
        className: "dataviews-view-table-selection-checkbox",
        checked: areAllSelected,
        indeterminate: !areAllSelected && !!selectedItems.length,
        onChange: () => {
          if (areAllSelected) {
            onChangeSelection([]);
          } else {
            onChangeSelection(
              selectableItems.map((item) => getItemId(item))
            );
          }
        },
        "aria-label": areAllSelected ? (0, import_i18n20.__)("Deselect all") : (0, import_i18n20.__)("Select all")
      }
    );
  }

  // packages/dataviews/build-module/components/dataviews-layouts/table/column-header-menu.mjs
  var import_i18n21 = __toESM(require_i18n(), 1);
  var import_components5 = __toESM(require_components(), 1);
  var import_element76 = __toESM(require_element(), 1);

  // packages/dataviews/build-module/utils/get-hideable-fields.mjs
  function getHideableFields(view, fields) {
    const togglableFields = [
      view?.titleField,
      view?.mediaField,
      view?.descriptionField
    ].filter(Boolean);
    return fields.filter(
      (f) => !togglableFields.includes(f.id) && f.type !== "media" && f.enableHiding !== false
    );
  }

  // packages/dataviews/build-module/components/dataviews-layouts/utils/get-table-columns.mjs
  function getTableColumns(view, fields) {
    return (view.fields ?? []).filter(
      (fieldId) => fields.some((field) => field.id === fieldId)
    );
  }

  // packages/dataviews/build-module/components/dataviews-layouts/table/column-header-menu.mjs
  var import_jsx_runtime120 = __toESM(require_jsx_runtime(), 1);
  function WithMenuSeparators({ children }) {
    return import_element76.Children.toArray(children).filter(Boolean).map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_element76.Fragment, { children: [
      i > 0 && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.Separator, {}),
      child
    ] }, i));
  }
  var _HeaderMenu = (0, import_element76.forwardRef)(function HeaderMenu({
    fieldId,
    view,
    fields,
    onChangeView,
    onHide,
    setOpenedFilter,
    canMove = true,
    canInsertLeft = true,
    canInsertRight = true
  }, ref) {
    const isSorted = view.sort?.field === fieldId;
    let isHidable = false;
    let isSortable = false;
    let canAddFilter = false;
    let operators = [];
    const field = fields.find((f) => f.id === fieldId);
    const { setIsShowingFilter } = (0, import_element76.useContext)(dataviews_context_default);
    if (!field) {
      return null;
    }
    isHidable = field.enableHiding !== false;
    isSortable = field.enableSorting !== false;
    const header = field.header;
    operators = !!field.filterBy && field.filterBy?.operators || [];
    canAddFilter = !view.filters?.some((_filter) => fieldId === _filter.field) && !!(field.hasElements || field.Edit) && field.filterBy !== false && !field.filterBy?.isPrimary;
    if (!isSortable && !canMove && !isHidable && !canAddFilter) {
      return header;
    }
    const visibleFieldIds = getTableColumns(view, fields);
    const index2 = visibleFieldIds.indexOf(fieldId);
    const hiddenFields = getHideableFields(view, fields).filter(
      (f) => !visibleFieldIds.includes(f.id)
    );
    const canInsert = (canInsertLeft || canInsertRight) && !!hiddenFields.length;
    const isRtl = (0, import_i18n21.isRTL)();
    return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(menu_exports.Root, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
        menu_exports.Trigger,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
            import_components5.Button,
            {
              size: "compact",
              className: "dataviews-view-table-header-button",
              ref,
              variant: "tertiary"
            }
          ),
          children: [
            header,
            view.sort && isSorted && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { "aria-hidden": "true", children: sortArrows[view.sort.direction] })
          ]
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.Popup, { style: { minWidth: "240px" }, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(WithMenuSeparators, { children: [
        isSortable && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
          menu_exports.RadioGroup,
          {
            value: isSorted && view.sort ? view.sort.direction : null,
            onValueChange: (direction) => {
              onChangeView({
                ...view,
                sort: {
                  field: fieldId,
                  direction
                },
                showLevels: false
              });
            },
            children: SORTING_DIRECTIONS.map(
              (direction) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
                menu_exports.RadioItem,
                {
                  value: direction,
                  children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: sortLabels[direction] })
                },
                direction
              )
            )
          }
        ),
        canAddFilter && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
          menu_exports.Item,
          {
            prefix: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.PrefixIcon, { icon: funnel_default }),
            onClick: () => {
              setOpenedFilter(fieldId);
              setIsShowingFilter(true);
              onChangeView({
                ...view,
                page: 1,
                filters: [
                  ...view.filters || [],
                  {
                    field: fieldId,
                    value: void 0,
                    operator: operators[0]
                  }
                ]
              });
            },
            children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: (0, import_i18n21.__)("Add filter") })
          }
        ) }),
        (canMove || isHidable || canInsert) && field && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(menu_exports.Group, { children: [
          canMove && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
            menu_exports.Item,
            {
              prefix: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.PrefixIcon, { icon: arrow_left_default }),
              disabled: isRtl ? index2 >= visibleFieldIds.length - 1 : index2 < 1,
              onClick: () => {
                const targetIndex = isRtl ? index2 + 1 : index2 - 1;
                const newFields = [
                  ...visibleFieldIds
                ];
                newFields.splice(index2, 1);
                newFields.splice(
                  targetIndex,
                  0,
                  fieldId
                );
                onChangeView({
                  ...view,
                  fields: newFields
                });
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: (0, import_i18n21.__)("Move left") })
            }
          ),
          canMove && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
            menu_exports.Item,
            {
              prefix: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.PrefixIcon, { icon: arrow_right_default }),
              disabled: isRtl ? index2 < 1 : index2 >= visibleFieldIds.length - 1,
              onClick: () => {
                const targetIndex = isRtl ? index2 - 1 : index2 + 1;
                const newFields = [
                  ...visibleFieldIds
                ];
                newFields.splice(index2, 1);
                newFields.splice(
                  targetIndex,
                  0,
                  fieldId
                );
                onChangeView({
                  ...view,
                  fields: newFields
                });
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: (0, import_i18n21.__)("Move right") })
            }
          ),
          canInsertLeft && !!hiddenFields.length && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(menu_exports.SubmenuRoot, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.SubmenuTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: (0, import_i18n21.__)("Insert left") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.Popup, { children: hiddenFields.map((hiddenField) => {
              const insertIndex = isRtl ? index2 + 1 : index2;
              return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
                menu_exports.Item,
                {
                  onClick: () => {
                    onChangeView({
                      ...view,
                      fields: [
                        ...visibleFieldIds.slice(
                          0,
                          insertIndex
                        ),
                        hiddenField.id,
                        ...visibleFieldIds.slice(
                          insertIndex
                        )
                      ]
                    });
                  },
                  children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: hiddenField.label })
                },
                hiddenField.id
              );
            }) })
          ] }),
          canInsertRight && !!hiddenFields.length && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(menu_exports.SubmenuRoot, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.SubmenuTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: (0, import_i18n21.__)("Insert right") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.Popup, { children: hiddenFields.map((hiddenField) => {
              const insertIndex = isRtl ? index2 : index2 + 1;
              return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
                menu_exports.Item,
                {
                  onClick: () => {
                    onChangeView({
                      ...view,
                      fields: [
                        ...visibleFieldIds.slice(
                          0,
                          insertIndex
                        ),
                        hiddenField.id,
                        ...visibleFieldIds.slice(
                          insertIndex
                        )
                      ]
                    });
                  },
                  children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: hiddenField.label })
                },
                hiddenField.id
              );
            }) })
          ] }),
          isHidable && field && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
            menu_exports.Item,
            {
              prefix: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.PrefixIcon, { icon: unseen_default }),
              onClick: () => {
                onHide(field);
                onChangeView({
                  ...view,
                  fields: visibleFieldIds.filter(
                    (id) => id !== fieldId
                  )
                });
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(menu_exports.ItemLabel, { children: (0, import_i18n21.__)("Hide column") })
            }
          )
        ] })
      ] }) })
    ] });
  });
  var ColumnHeaderMenu = _HeaderMenu;
  var column_header_menu_default = ColumnHeaderMenu;

  // packages/dataviews/build-module/components/dataviews-layouts/utils/item-click-wrapper.mjs
  var import_element77 = __toESM(require_element(), 1);
  var import_jsx_runtime121 = __toESM(require_jsx_runtime(), 1);
  function getClickableItemProps({
    item,
    isItemClickable: isItemClickable2,
    onClickItem,
    className
  }) {
    if (!isItemClickable2(item) || !onClickItem) {
      return { className };
    }
    return {
      className: className ? `${className} ${className}--clickable` : void 0,
      role: "button",
      tabIndex: 0,
      onClick: (event) => {
        event.stopPropagation();
        onClickItem(item);
      },
      onKeyDown: (event) => {
        if (event.key === "Enter" || event.key === "" || event.key === " ") {
          event.stopPropagation();
          onClickItem(item);
        }
      }
    };
  }
  function ItemClickWrapper({
    item,
    isItemClickable: isItemClickable2,
    onClickItem,
    renderItemLink,
    className,
    children,
    ...extraProps
  }) {
    if (!isItemClickable2(item)) {
      return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className, ...extraProps, children });
    }
    if (renderItemLink) {
      const renderedElement = renderItemLink({
        item,
        className: `${className} ${className}--clickable`,
        ...extraProps,
        children
      });
      return (0, import_element77.cloneElement)(renderedElement, {
        onClick: (event) => {
          event.stopPropagation();
          if (renderedElement.props.onClick) {
            renderedElement.props.onClick(event);
          }
        },
        onKeyDown: (event) => {
          if (event.key === "Enter" || event.key === "" || event.key === " ") {
            event.stopPropagation();
            if (renderedElement.props.onKeyDown) {
              renderedElement.props.onKeyDown(event);
            }
          }
        }
      });
    }
    const clickProps = getClickableItemProps({
      item,
      isItemClickable: isItemClickable2,
      onClickItem,
      className
    });
    return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { ...clickProps, ...extraProps, children });
  }

  // packages/dataviews/build-module/components/dataviews-layouts/table/column-primary.mjs
  var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1);
  function ColumnPrimary({
    item,
    level,
    titleField,
    mediaField,
    mediaAspectRatio,
    descriptionField: descriptionField2,
    onClickItem,
    renderItemLink,
    isItemClickable: isItemClickable2
  }) {
    let mediaSizes = "32px";
    if (mediaAspectRatio) {
      const [ratioWidth, ratioHeight] = mediaAspectRatio.split("/").map(Number);
      mediaSizes = `${Math.min(
        60,
        Math.round(32 * ratioWidth / ratioHeight)
      )}px`;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Stack, { direction: "row", gap: "md", align: "flex-start", justify: "flex-start", children: [
      mediaField && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
        ItemClickWrapper,
        {
          item,
          isItemClickable: isItemClickable2,
          onClickItem,
          renderItemLink,
          className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media",
          "aria-label": isItemClickable2(item) && (!!onClickItem || !!renderItemLink) && !!titleField ? titleField.getValue?.({ item }) : void 0,
          children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
            mediaField.render,
            {
              item,
              field: mediaField,
              config: { sizes: mediaSizes }
            }
          )
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
        Stack,
        {
          direction: "column",
          align: "flex-start",
          className: "dataviews-view-table__primary-column-content",
          children: [
            titleField && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
              ItemClickWrapper,
              {
                item,
                isItemClickable: isItemClickable2,
                onClickItem,
                renderItemLink,
                className: "dataviews-view-table__cell-content-wrapper dataviews-title-field",
                children: [
                  level !== void 0 && level > 0 && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("span", { className: "dataviews-view-table__level", children: [
                    Array(level).fill("\u2014").join(" "),
                    "\xA0"
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(titleField.render, { item, field: titleField })
                ]
              }
            ),
            descriptionField2 && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
              descriptionField2.render,
              {
                item,
                field: descriptionField2
              }
            )
          ]
        }
      )
    ] });
  }
  var column_primary_default = ColumnPrimary;

  // packages/dataviews/build-module/components/dataviews-layouts/table/use-scroll-state.mjs
  var import_element78 = __toESM(require_element(), 1);
  var import_i18n22 = __toESM(require_i18n(), 1);
  var isScrolledToEnd = (element) => {
    if ((0, import_i18n22.isRTL)()) {
      const scrollLeft = Math.abs(element.scrollLeft);
      return scrollLeft <= 1;
    }
    return element.scrollLeft + element.clientWidth >= element.scrollWidth - 1;
  };
  function useScrollState({
    scrollContainerRef,
    enabledHorizontal = false
  }) {
    const [isHorizontalScrollEnd, setIsHorizontalScrollEnd] = (0, import_element78.useState)(false);
    const [isVerticallyScrolled, setIsVerticallyScrolled] = (0, import_element78.useState)(false);
    const handleScroll = (0, import_element78.useCallback)(() => {
      const scrollContainer = scrollContainerRef.current;
      if (!scrollContainer) {
        return;
      }
      if (enabledHorizontal) {
        setIsHorizontalScrollEnd(isScrolledToEnd(scrollContainer));
      }
      setIsVerticallyScrolled(scrollContainer.scrollTop > 0);
    }, [scrollContainerRef, enabledHorizontal]);
    (0, import_element78.useEffect)(() => {
      if (typeof window === "undefined" || !scrollContainerRef.current) {
        return () => {
        };
      }
      const scrollContainer = scrollContainerRef.current;
      handleScroll();
      scrollContainer.addEventListener("scroll", handleScroll);
      window.addEventListener("resize", handleScroll);
      return () => {
        scrollContainer.removeEventListener("scroll", handleScroll);
        window.removeEventListener("resize", handleScroll);
      };
    }, [scrollContainerRef, enabledHorizontal, handleScroll]);
    return { isHorizontalScrollEnd, isVerticallyScrolled };
  }

  // packages/dataviews/build-module/components/dataviews-layouts/utils/get-data-by-group.mjs
  function getDataByGroup(data, groupByField) {
    return data.reduce((groups, item) => {
      const groupName = groupByField.getValue({ item });
      if (!groups.has(groupName)) {
        groups.set(groupName, []);
      }
      groups.get(groupName)?.push(item);
      return groups;
    }, /* @__PURE__ */ new Map());
  }

  // packages/dataviews/build-module/components/dataviews-layouts/utils/use-selection-props.mjs
  var import_element79 = __toESM(require_element(), 1);
  var import_keycodes = __toESM(require_keycodes(), 1);
  function getRange(orderedIds, fromIndex, toIndex) {
    return orderedIds.slice(
      Math.min(fromIndex, toIndex),
      Math.max(fromIndex, toIndex) + 1
    );
  }
  function getRangeSelection({
    anchorId,
    targetId,
    lastTargetId,
    orderedIds,
    selection
  }) {
    const targetIndex = orderedIds.indexOf(targetId);
    if (targetIndex === -1) {
      return selection;
    }
    const anchorIndex = anchorId === null ? -1 : orderedIds.indexOf(anchorId);
    const hasAnchor = anchorIndex !== -1;
    const rangeStart = hasAnchor ? anchorIndex : targetIndex;
    const lastTargetIndex = hasAnchor && lastTargetId !== null ? orderedIds.indexOf(lastTargetId) : -1;
    const lastRange = lastTargetIndex === -1 ? [] : getRange(orderedIds, rangeStart, lastTargetIndex);
    const base = selection.filter((id) => !lastRange.includes(id));
    return [
      .../* @__PURE__ */ new Set([
        ...base,
        ...getRange(orderedIds, rangeStart, targetIndex)
      ])
    ];
  }
  function getClosestSelectedId({
    targetId,
    orderedIds,
    selection
  }) {
    const targetIndex = orderedIds.indexOf(targetId);
    if (targetIndex === -1) {
      return null;
    }
    const selectedIds = new Set(selection);
    let closestId = null;
    let closestDistance = Infinity;
    orderedIds.forEach((id, index2) => {
      if (!selectedIds.has(id)) {
        return;
      }
      const distance = Math.abs(index2 - targetIndex);
      if (distance < closestDistance) {
        closestDistance = distance;
        closestId = id;
      }
    });
    return closestId;
  }
  function useSelectionProps({
    data,
    getItemId,
    isItemSelectable,
    selection,
    onChangeSelection,
    selectionMode,
    shouldSelectOnClick
  }) {
    const isMultiselect = selectionMode === "multi";
    const allowDeselect = selectionMode !== "single-required";
    const gestureRef = (0, import_element79.useRef)(null);
    const anchorTo = (id) => {
      gestureRef.current = { anchorId: id, lastTargetId: null };
    };
    const isTouchDeviceRef = (0, import_element79.useRef)(false);
    (0, import_element79.useEffect)(() => {
      const markTouchDevice = () => {
        isTouchDeviceRef.current = true;
      };
      document.addEventListener("touchstart", markTouchDevice, {
        once: true
      });
      return () => document.removeEventListener("touchstart", markTouchDevice);
    }, []);
    const selectableIds = data.filter(isItemSelectable).map(getItemId);
    const selectableIdSet = new Set(selectableIds);
    const hasSelectableItems = selectableIds.length > 0;
    const hasRangeGesture = hasSelectableItems && isMultiselect;
    const getSelectionProps = (id) => {
      const isSelectable = selectableIdSet.has(id);
      return {
        // When a plain click selects, that click is also what anchors the
        // range a following Shift+Click extends from. Modifier clicks never
        // reach here: `onClickCapture` stops them.
        ...shouldSelectOnClick && {
          onClick: () => {
            if (allowDeselect && selection.includes(id)) {
              onChangeSelection(
                selection.filter((itemId) => id !== itemId)
              );
            } else {
              onChangeSelection(
                isMultiselect ? [...selection, id] : [id]
              );
            }
            anchorTo(id);
          }
        },
        onMouseDown: (event) => {
          if (event.button === 0 && event.shiftKey && hasRangeGesture) {
            event.preventDefault();
          }
        },
        onClickCapture: (event) => {
          if (!hasRangeGesture) {
            return;
          }
          const isModifierKeyPressed = (0, import_keycodes.isAppleOS)() ? event.metaKey : event.ctrlKey;
          const isSelectionCheckboxClick = event.target instanceof Element && !!event.target.closest(`.${SELECTION_CHECKBOX_CLASS}`);
          if (!isModifierKeyPressed && !event.shiftKey) {
            if (isSelectable && isSelectionCheckboxClick) {
              anchorTo(id);
            }
            return;
          }
          if (isTouchDeviceRef.current || document.getSelection()?.type === "Range") {
            return;
          }
          event.stopPropagation();
          if (!isSelectionCheckboxClick) {
            event.preventDefault();
          }
          if (!isSelectable) {
            return;
          }
          if (event.shiftKey) {
            let gesture = gestureRef.current;
            if (!gesture || !selectableIdSet.has(gesture.anchorId)) {
              gesture = {
                anchorId: getClosestSelectedId({
                  targetId: id,
                  orderedIds: selectableIds,
                  selection
                }) ?? id,
                lastTargetId: null
              };
            }
            onChangeSelection(
              getRangeSelection({
                anchorId: gesture.anchorId,
                targetId: id,
                lastTargetId: gesture.lastTargetId,
                orderedIds: selectableIds,
                selection
              })
            );
            gestureRef.current = {
              anchorId: gesture.anchorId,
              lastTargetId: id
            };
          } else {
            onChangeSelection(
              selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
            );
            anchorTo(id);
          }
        }
      };
    };
    return { getSelectionProps };
  }

  // packages/dataviews/build-module/components/dataviews-view-config/properties-section.mjs
  var import_components6 = __toESM(require_components(), 1);
  var import_i18n23 = __toESM(require_i18n(), 1);
  var import_element80 = __toESM(require_element(), 1);
  var import_jsx_runtime123 = __toESM(require_jsx_runtime(), 1);
  function FieldItem3({
    field,
    isVisible: isVisible2,
    onToggleVisibility
  }) {
    return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components6.__experimentalItem, { onClick: field.enableHiding ? onToggleVisibility : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Stack, { direction: "row", gap: "sm", justify: "flex-start", align: "center", children: [
      /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { style: { height: 24, width: 24 }, children: isVisible2 && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components6.Icon, { icon: check_default }) }),
      /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "dataviews-view-config__label", children: field.label })
    ] }) });
  }
  function isDefined(item) {
    return !!item;
  }
  function PropertiesSection({
    showLabel = true
  }) {
    const { view, fields, onChangeView } = (0, import_element80.useContext)(dataviews_context_default);
    const regularFields = getHideableFields(view, fields);
    if (!regularFields?.length) {
      return null;
    }
    const titleField = fields.find((f) => f.id === view.titleField);
    const previewField = fields.find((f) => f.id === view.mediaField);
    const descriptionField2 = fields.find(
      (f) => f.id === view.descriptionField
    );
    const lockedFields = [
      {
        field: titleField,
        isVisibleFlag: "showTitle"
      },
      {
        field: previewField,
        isVisibleFlag: "showMedia"
      },
      {
        field: descriptionField2,
        isVisibleFlag: "showDescription"
      }
    ].filter(({ field }) => isDefined(field));
    const visibleFieldIds = view.fields ?? [];
    const visibleRegularFieldsCount = regularFields.filter(
      (f) => visibleFieldIds.includes(f.id)
    ).length;
    const visibleLockedFields = lockedFields.filter(
      ({ isVisibleFlag }) => view[isVisibleFlag] ?? true
    );
    const totalVisibleFields = visibleLockedFields.length + visibleRegularFieldsCount;
    const isSingleVisibleLockedField = totalVisibleFields === 1 && visibleLockedFields.length === 1;
    return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Stack, { direction: "column", className: "dataviews-field-control", children: [
      showLabel && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components6.BaseControl.VisualLabel, { children: (0, import_i18n23.__)("Properties") }),
      /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
        Stack,
        {
          direction: "column",
          className: "dataviews-view-config__properties",
          children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_components6.__experimentalItemGroup, { isBordered: true, isSeparated: true, size: "medium", children: [
            lockedFields.map(({ field, isVisibleFlag }) => {
              const isVisible2 = view[isVisibleFlag] ?? true;
              const fieldToRender = isSingleVisibleLockedField && isVisible2 ? { ...field, enableHiding: false } : field;
              return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
                FieldItem3,
                {
                  field: fieldToRender,
                  isVisible: isVisible2,
                  onToggleVisibility: () => {
                    onChangeView({
                      ...view,
                      [isVisibleFlag]: !isVisible2
                    });
                  }
                },
                field.id
              );
            }),
            regularFields.map((field) => {
              const isVisible2 = visibleFieldIds.includes(field.id);
              const fieldToRender = totalVisibleFields === 1 && isVisible2 ? { ...field, enableHiding: false } : field;
              return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
                FieldItem3,
                {
                  field: fieldToRender,
                  isVisible: isVisible2,
                  onToggleVisibility: () => {
                    onChangeView({
                      ...view,
                      fields: isVisible2 ? visibleFieldIds.filter(
                        (fieldId) => fieldId !== field.id
                      ) : [...visibleFieldIds, field.id]
                    });
                  }
                },
                field.id
              );
            })
          ] })
        }
      )
    ] });
  }

  // packages/dataviews/build-module/hooks/use-delayed-loading.mjs
  var import_element81 = __toESM(require_element(), 1);
  function useDelayedLoading(isLoading, options = { delay: 400 }) {
    const [showLoader, setShowLoader] = (0, import_element81.useState)(false);
    (0, import_element81.useEffect)(() => {
      if (!isLoading) {
        return;
      }
      const timeout = setTimeout(() => {
        setShowLoader(true);
      }, options.delay);
      return () => {
        clearTimeout(timeout);
        setShowLoader(false);
      };
    }, [isLoading, options.delay]);
    return showLoader;
  }

  // packages/dataviews/build-module/components/dataviews-layouts/table/index.mjs
  var import_jsx_runtime124 = __toESM(require_jsx_runtime(), 1);
  function getEffectiveAlign(explicitAlign, fieldType) {
    if (explicitAlign) {
      return explicitAlign;
    }
    if (fieldType === "integer" || fieldType === "number") {
      return "end";
    }
    return void 0;
  }
  function TableColumnField({
    item,
    fields,
    column,
    align
  }) {
    const field = fields.find((f) => f.id === column);
    if (!field) {
      return null;
    }
    const className = clsx_default("dataviews-view-table__cell-content-wrapper", {
      "dataviews-view-table__cell-align-end": align === "end",
      "dataviews-view-table__cell-align-center": align === "center"
    });
    return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(field.render, { item, field }) });
  }
  function TableRow({
    hasBulkActions,
    item,
    level,
    actions,
    fields,
    id,
    view,
    titleField,
    mediaField,
    mediaAspectRatio,
    descriptionField: descriptionField2,
    selection,
    getItemId,
    isItemClickable: isItemClickable2,
    onClickItem,
    renderItemLink,
    onChangeSelection,
    onMouseDown,
    onClickCapture,
    isActionsColumnSticky,
    posinset
  }) {
    const { paginationInfo } = (0, import_element82.useContext)(dataviews_context_default);
    const hasPossibleBulkAction = useHasAPossibleBulkAction(actions, item);
    const isSelected2 = hasPossibleBulkAction && selection.includes(id);
    const {
      showTitle = true,
      showMedia = true,
      showDescription = true,
      infiniteScrollEnabled
    } = view;
    const columns = getTableColumns(view, fields);
    const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField2 && showDescription;
    return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
      "tr",
      {
        className: clsx_default("dataviews-view-table__row", {
          "is-selected": hasPossibleBulkAction && isSelected2,
          "has-bulk-actions": hasPossibleBulkAction
        }),
        "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
        "aria-posinset": posinset,
        role: infiniteScrollEnabled ? "article" : void 0,
        onClickCapture,
        onMouseDown: (event) => {
          const isMetaClick = (0, import_keycodes2.isAppleOS)() ? event.metaKey : event.ctrlKey;
          if (event.button === 0 && isMetaClick && window.navigator.userAgent.toLowerCase().includes("firefox")) {
            event.preventDefault();
          }
          onMouseDown(event);
        },
        children: [
          hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("td", { className: "dataviews-view-table__checkbox-column", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
            DataViewsSelectionCheckbox,
            {
              item,
              selection,
              onChangeSelection,
              getItemId,
              titleField,
              disabled: !hasPossibleBulkAction
            }
          ) }) }),
          hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
            column_primary_default,
            {
              item,
              level,
              titleField: showTitle ? titleField : void 0,
              mediaField: showMedia ? mediaField : void 0,
              mediaAspectRatio,
              descriptionField: showDescription ? descriptionField2 : void 0,
              isItemClickable: isItemClickable2,
              onClickItem,
              renderItemLink
            }
          ) }),
          columns.map((column) => {
            const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
            const field = fields.find((f) => f.id === column);
            const effectiveAlign = getEffectiveAlign(align, field?.type);
            return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
              "td",
              {
                style: {
                  width,
                  maxWidth,
                  minWidth
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                  TableColumnField,
                  {
                    fields,
                    item,
                    column,
                    align: effectiveAlign
                  }
                )
              },
              column
            );
          }),
          !!actions?.length && // Disable reason: we are not making the element interactive,
          // but preventing any click events from bubbling up to the
          // table row. This allows us to add a click handler to the row
          // itself (to toggle row selection) without erroneously
          // intercepting click events from ItemActions.
          /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
            "td",
            {
              className: clsx_default("dataviews-view-table__actions-column", {
                "dataviews-view-table__actions-column--sticky": true,
                "dataviews-view-table__actions-column--stuck": isActionsColumnSticky
              }),
              onClick: (e) => e.stopPropagation(),
              children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ItemActions, { item, actions })
            }
          )
        ]
      }
    );
  }
  function ViewTable({
    actions,
    data,
    fields,
    getItemId,
    getItemLevel,
    isLoading = false,
    onChangeView,
    onChangeSelection,
    selection,
    setOpenedFilter,
    onClickItem,
    isItemClickable: isItemClickable2,
    renderItemLink,
    view,
    className,
    empty
  }) {
    const { containerRef } = (0, import_element82.useContext)(dataviews_context_default);
    const isDelayedLoading = useDelayedLoading(isLoading);
    const groupField = view.groupBy?.field ? fields.find((f) => f.id === view.groupBy?.field) : null;
    const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
    const orderedData = dataByGroup ? Array.from(dataByGroup.values()).flat() : data;
    const { getSelectionProps } = useSelectionProps({
      data: orderedData,
      getItemId,
      isItemSelectable: (item) => hasAPossibleBulkAction(actions, item),
      selection,
      onChangeSelection,
      selectionMode: "multi",
      shouldSelectOnClick: false
    });
    const headerMenuRefs = (0, import_element82.useRef)(/* @__PURE__ */ new Map());
    const headerMenuToFocusRef = (0, import_element82.useRef)(void 0);
    const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0, import_element82.useState)();
    const [contextMenuAnchor, setContextMenuAnchor] = (0, import_element82.useState)(null);
    (0, import_element82.useEffect)(() => {
      if (headerMenuToFocusRef.current) {
        headerMenuToFocusRef.current.focus();
        headerMenuToFocusRef.current = void 0;
      }
    });
    const tableNoticeId = (0, import_element82.useId)();
    const { isHorizontalScrollEnd, isVerticallyScrolled } = useScrollState({
      scrollContainerRef: containerRef,
      enabledHorizontal: !!actions?.length
    });
    const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data);
    if (nextHeaderMenuToFocus) {
      headerMenuToFocusRef.current = nextHeaderMenuToFocus;
      setNextHeaderMenuToFocus(void 0);
      return;
    }
    const onHide = (field) => {
      const hidden = headerMenuRefs.current.get(field.id);
      const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
      setNextHeaderMenuToFocus(fallback?.node);
    };
    const handleHeaderContextMenu = (event) => {
      event.preventDefault();
      event.stopPropagation();
      const virtualAnchor = {
        getBoundingClientRect: () => ({
          x: event.clientX,
          y: event.clientY,
          top: event.clientY,
          left: event.clientX,
          right: event.clientX,
          bottom: event.clientY,
          width: 0,
          height: 0,
          toJSON: () => ({})
        })
      };
      window.requestAnimationFrame(() => {
        setContextMenuAnchor(virtualAnchor);
      });
    };
    const hasData = !!data?.length;
    const titleField = fields.find((field) => field.id === view.titleField);
    const mediaField = fields.find((field) => field.id === view.mediaField);
    const descriptionField2 = fields.find(
      (field) => field.id === view.descriptionField
    );
    const { showTitle = true, showMedia = true, showDescription = true } = view;
    const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField2 && showDescription;
    const columns = getTableColumns(view, fields);
    const headerMenuRef = (column, index2) => (node) => {
      if (node) {
        headerMenuRefs.current.set(column, {
          node,
          fallback: columns[index2 > 0 ? index2 - 1 : 1]
        });
      } else {
        headerMenuRefs.current.delete(column);
      }
    };
    const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
    const isRtl = (0, import_i18n24.isRTL)();
    const mediaAspectRatio = view.layout?.aspectRatio && MEDIA_ASPECT_RATIOS.includes(view.layout.aspectRatio) ? view.layout.aspectRatio : void 0;
    const tableStyle = {
      "--wp-dataviews-media-aspect-ratio": mediaAspectRatio ?? "1/1"
    };
    if (!hasData) {
      return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
        "div",
        {
          className: clsx_default("dataviews-no-results", {
            "is-refreshing": isDelayedLoading
          }),
          id: tableNoticeId,
          children: empty
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
        "table",
        {
          className: clsx_default("dataviews-view-table", className, {
            [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
              view.layout.density
            ),
            "has-bulk-actions": hasBulkActions,
            "is-refreshing": !isInfiniteScroll && isDelayedLoading,
            "has-media-aspect-ratio": !!mediaAspectRatio
          }),
          style: tableStyle,
          "aria-busy": isLoading,
          "aria-describedby": tableNoticeId,
          role: isInfiniteScroll ? "feed" : void 0,
          inert: !isInfiniteScroll && isLoading ? "true" : void 0,
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("colgroup", { children: [
              hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("col", { className: "dataviews-view-table__col-checkbox" }),
              hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("col", { className: "dataviews-view-table__col-first-data" }),
              columns.map((column, index2) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                "col",
                {
                  className: clsx_default(
                    `dataviews-view-table__col-${column}`,
                    {
                      "dataviews-view-table__col-expand": !hasPrimaryColumn && index2 === columns.length - 1
                    }
                  )
                },
                `col-${column}`
              )),
              !!actions?.length && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("col", { className: "dataviews-view-table__col-actions" })
            ] }),
            contextMenuAnchor && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
              import_components7.Popover,
              {
                anchor: contextMenuAnchor,
                onClose: () => setContextMenuAnchor(null),
                placement: "bottom-start",
                children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(PropertiesSection, { showLabel: false })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
              "thead",
              {
                className: clsx_default({
                  "dataviews-view-table__thead--stuck": isVerticallyScrolled
                }),
                onContextMenu: handleHeaderContextMenu,
                children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("tr", { className: "dataviews-view-table__row", children: [
                  hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                    "th",
                    {
                      className: "dataviews-view-table__checkbox-column",
                      scope: "col",
                      onContextMenu: handleHeaderContextMenu,
                      children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                        BulkSelectionCheckbox,
                        {
                          selection,
                          onChangeSelection,
                          data,
                          actions,
                          getItemId
                        }
                      )
                    }
                  ),
                  hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("th", { scope: "col", children: titleField && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                    column_header_menu_default,
                    {
                      ref: headerMenuRef(
                        titleField.id,
                        0
                      ),
                      fieldId: titleField.id,
                      view,
                      fields,
                      onChangeView,
                      onHide,
                      setOpenedFilter,
                      canMove: false,
                      canInsertLeft: isRtl ? view.layout?.enableMoving ?? true : false,
                      canInsertRight: isRtl ? false : view.layout?.enableMoving ?? true
                    }
                  ) }),
                  columns.map((column, index2) => {
                    const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
                    const field = fields.find(
                      (f) => f.id === column
                    );
                    const effectiveAlign = getEffectiveAlign(
                      align,
                      field?.type
                    );
                    const canInsertOrMove = view.layout?.enableMoving ?? true;
                    return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                      "th",
                      {
                        style: {
                          width,
                          maxWidth,
                          minWidth,
                          textAlign: effectiveAlign
                        },
                        "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
                        scope: "col",
                        children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                          column_header_menu_default,
                          {
                            ref: headerMenuRef(column, index2),
                            fieldId: column,
                            view,
                            fields,
                            onChangeView,
                            onHide,
                            setOpenedFilter,
                            canMove: canInsertOrMove,
                            canInsertLeft: canInsertOrMove,
                            canInsertRight: canInsertOrMove
                          }
                        )
                      },
                      column
                    );
                  }),
                  !!actions?.length && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                    "th",
                    {
                      className: clsx_default(
                        "dataviews-view-table__actions-column",
                        {
                          "dataviews-view-table__actions-column--sticky": true,
                          "dataviews-view-table__actions-column--stuck": !isHorizontalScrollEnd
                        }
                      ),
                      children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "dataviews-view-table-header", children: (0, import_i18n24.__)("Actions") })
                    }
                  )
                ] })
              }
            ),
            hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
              ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("tbody", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("tr", { className: "dataviews-view-table__group-header-row", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                  "td",
                  {
                    colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + (hasBulkActions ? 1 : 0) + (actions?.length ? 1 : 0),
                    className: "dataviews-view-table__group-header-cell",
                    children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n24.sprintf)(
                      // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                      (0, import_i18n24.__)("%1$s: %2$s"),
                      groupField.label,
                      groupName
                    )
                  }
                ) }),
                groupItems.map((item, index2) => {
                  const id = getItemId(item) || index2.toString();
                  return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                    TableRow,
                    {
                      item,
                      level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
                      hasBulkActions,
                      actions,
                      fields,
                      id,
                      view,
                      titleField,
                      mediaField,
                      mediaAspectRatio,
                      descriptionField: descriptionField2,
                      selection,
                      getItemId,
                      onChangeSelection,
                      ...getSelectionProps(id),
                      onClickItem,
                      renderItemLink,
                      isItemClickable: isItemClickable2,
                      isActionsColumnSticky: !isHorizontalScrollEnd
                    },
                    getItemId(item)
                  );
                })
              ] }, `group-${groupName}`)
            ) : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("tbody", { children: hasData && data.map((item, index2) => {
              const id = getItemId(item) || index2.toString();
              return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
                TableRow,
                {
                  item,
                  level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
                  hasBulkActions,
                  actions,
                  fields,
                  id,
                  view,
                  titleField,
                  mediaField,
                  mediaAspectRatio,
                  descriptionField: descriptionField2,
                  selection,
                  getItemId,
                  onChangeSelection,
                  ...getSelectionProps(id),
                  onClickItem,
                  renderItemLink,
                  isItemClickable: isItemClickable2,
                  isActionsColumnSticky: !isHorizontalScrollEnd,
                  posinset: isInfiniteScroll ? index2 + 1 : void 0
                },
                getItemId(item)
              );
            }) })
          ]
        }
      ),
      isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "dataviews-loading", id: tableNoticeId, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_components7.Spinner, {}) }) })
    ] });
  }
  var table_default = ViewTable;

  // packages/dataviews/build-module/components/dataviews-layouts/grid/index.mjs
  var import_components10 = __toESM(require_components(), 1);
  var import_i18n27 = __toESM(require_i18n(), 1);

  // packages/dataviews/build-module/components/dataviews-layouts/grid/composite-grid.mjs
  var import_components9 = __toESM(require_components(), 1);
  var import_i18n26 = __toESM(require_i18n(), 1);
  var import_compose7 = __toESM(require_compose(), 1);
  var import_element86 = __toESM(require_element(), 1);

  // packages/dataviews/build-module/components/dataviews-layouts/grid/preview-size-picker.mjs
  var import_components8 = __toESM(require_components(), 1);
  var import_i18n25 = __toESM(require_i18n(), 1);
  var import_element83 = __toESM(require_element(), 1);
  var import_jsx_runtime125 = __toESM(require_jsx_runtime(), 1);
  var imageSizes = [
    {
      value: 120,
      breakpoint: 1
    },
    {
      value: 170,
      breakpoint: 1
    },
    {
      value: 230,
      breakpoint: 1
    },
    {
      value: 290,
      breakpoint: 1112
      // at minimum image width, 4 images display at this container size
    },
    {
      value: 350,
      breakpoint: 1636
      // at minimum image width, 6 images display at this container size
    },
    {
      value: 430,
      breakpoint: 588
      // at minimum image width, 2 images display at this container size
    }
  ];
  var DEFAULT_PREVIEW_SIZE = imageSizes[2].value;
  function useGridColumns() {
    const context = (0, import_element83.useContext)(dataviews_context_default);
    const view = context.view;
    return (0, import_element83.useMemo)(() => {
      const containerWidth = context.containerWidth;
      const gap = 32;
      const previewSize = view.layout?.previewSize ?? DEFAULT_PREVIEW_SIZE;
      const columns = Math.floor(
        (containerWidth + gap) / (previewSize + gap)
      );
      return Math.max(1, columns);
    }, [context.containerWidth, view.layout?.previewSize]);
  }

  // packages/dataviews/build-module/components/dataviews-layouts/utils/grid-items.mjs
  var import_element84 = __toESM(require_element(), 1);
  var import_jsx_runtime126 = __toESM(require_jsx_runtime(), 1);
  var GridItems = (0, import_element84.forwardRef)(({ className, previewSize, style, ...props }, ref) => {
    return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
      "div",
      {
        ref,
        className: clsx_default("dataviews-view-grid-items", className),
        style: {
          gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))`,
          ...style
        },
        ...props
      }
    );
  });

  // packages/dataviews/build-module/components/dataviews-layouts/utils/use-infinite-scroll.mjs
  var import_element85 = __toESM(require_element(), 1);
  function useIntersectionObserver(elementRef, posinset) {
    const { intersectionObserver } = (0, import_element85.useContext)(dataviews_context_default);
    (0, import_element85.useEffect)(() => {
      const element = elementRef.current;
      if (!element || posinset === void 0 || !intersectionObserver) {
        return;
      }
      intersectionObserver.observe(element);
      return () => {
        intersectionObserver.unobserve(element);
      };
    }, [elementRef, intersectionObserver, posinset]);
  }
  function usePlaceholdersNeeded(data, isInfiniteScroll, gridColumns) {
    const hasData = !!data?.length;
    const firstItemPosition = hasData && isInfiniteScroll ? data[0].position : void 0;
    return firstItemPosition && gridColumns ? (firstItemPosition - 1) % gridColumns : 0;
  }

  // packages/dataviews/build-module/components/dataviews-layouts/grid/composite-grid.mjs
  var import_jsx_runtime127 = __toESM(require_jsx_runtime(), 1);
  function chunk(array, size4) {
    const chunks = [];
    for (let i = 0, j2 = array.length; i < j2; i += size4) {
      chunks.push(array.slice(i, i + size4));
    }
    return chunks;
  }
  var GridItem = (0, import_element86.forwardRef)(
    function GridItem2({
      view,
      selection,
      onChangeSelection,
      onClickItem,
      isItemClickable: isItemClickable2,
      renderItemLink,
      getItemId,
      item,
      actions,
      mediaField,
      titleField,
      descriptionField: descriptionField2,
      regularFields,
      badgeFields,
      hasBulkActions,
      config,
      posinset,
      setsize,
      ...props
    }, forwardedRef) {
      const {
        showTitle = true,
        showMedia = true,
        showDescription = true
      } = view;
      const hasBulkAction = useHasAPossibleBulkAction(actions, item);
      const id = getItemId(item);
      const elementRef = (0, import_element86.useRef)(null);
      const setRefs = (0, import_element86.useCallback)(
        (node) => {
          elementRef.current = node;
          if (typeof forwardedRef === "function") {
            forwardedRef(node);
          } else if (forwardedRef) {
            forwardedRef.current = node;
          }
        },
        [forwardedRef]
      );
      useIntersectionObserver(elementRef, posinset);
      const instanceId = (0, import_compose7.useInstanceId)(GridItem2);
      const isSelected2 = selection.includes(id);
      const mediaPlaceholder = /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "dataviews-view-grid__media-placeholder" });
      const rendersMediaField = showMedia && mediaField?.render;
      const renderedMediaField = rendersMediaField ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
        mediaField.render,
        {
          item,
          field: mediaField,
          config
        }
      ) : mediaPlaceholder;
      const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(titleField.render, { item, field: titleField }) : null;
      let mediaA11yProps;
      let titleA11yProps;
      if (isItemClickable2(item) && onClickItem) {
        if (renderedTitleField) {
          mediaA11yProps = {
            "aria-labelledby": `dataviews-view-grid__title-field-${instanceId}`
          };
          titleA11yProps = {
            id: `dataviews-view-grid__title-field-${instanceId}`
          };
        } else {
          mediaA11yProps = {
            "aria-label": titleField?.getValueFormatted({
              item,
              field: titleField
            }) || (0, import_i18n26.__)("Navigate to item")
          };
        }
      }
      return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
        Stack,
        {
          direction: "column",
          ...props,
          ref: setRefs,
          "aria-setsize": setsize,
          "aria-posinset": posinset,
          className: clsx_default(
            props.className,
            "dataviews-view-grid__row__gridcell",
            "dataviews-view-grid__card",
            {
              "is-selected": hasBulkAction && isSelected2
            }
          ),
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
              ItemClickWrapper,
              {
                item,
                isItemClickable: isItemClickable2,
                onClickItem,
                renderItemLink,
                className: clsx_default("dataviews-view-grid__media", {
                  "dataviews-view-grid__media--placeholder": !rendersMediaField
                }),
                ...mediaA11yProps,
                children: renderedMediaField
              }
            ),
            hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
              DataViewsSelectionCheckbox,
              {
                item,
                selection,
                onChangeSelection,
                getItemId,
                titleField,
                disabled: !hasBulkAction
              }
            ),
            !!actions?.length && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "dataviews-view-grid__media-actions", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
              ItemActions,
              {
                item,
                actions,
                isCompact: true
              }
            ) }),
            showTitle && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "dataviews-view-grid__title-actions", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
              ItemClickWrapper,
              {
                item,
                isItemClickable: isItemClickable2,
                onClickItem,
                renderItemLink,
                className: "dataviews-view-grid__title-field dataviews-title-field",
                ...titleA11yProps,
                title: titleField?.getValueFormatted({
                  item,
                  field: titleField
                }) || void 0,
                children: renderedTitleField
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(Stack, { direction: "column", gap: "xs", children: [
              showDescription && descriptionField2?.render && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                descriptionField2.render,
                {
                  item,
                  field: descriptionField2
                }
              ),
              !!badgeFields?.length && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                Stack,
                {
                  direction: "row",
                  className: "dataviews-view-grid__badge-fields",
                  gap: "sm",
                  wrap: "wrap",
                  align: "top",
                  justify: "flex-start",
                  children: badgeFields.map((field) => {
                    return (
                      /* @ts-expect-error `Badge` is text-only, but a badge field renders whatever its `render` returns. */
                      /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                        Badge,
                        {
                          className: "dataviews-view-grid__field-value",
                          children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                            field.render,
                            {
                              item,
                              field
                            }
                          )
                        },
                        field.id
                      )
                    );
                  })
                }
              ),
              !!regularFields?.length && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                Stack,
                {
                  direction: "column",
                  className: "dataviews-view-grid__fields",
                  gap: "xs",
                  children: regularFields.map((field) => {
                    return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                      import_components9.Flex,
                      {
                        className: "dataviews-view-grid__field",
                        gap: 1,
                        justify: "flex-start",
                        expanded: true,
                        style: { height: "auto" },
                        direction: "row",
                        children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
                          /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(tooltip_exports.Root, { children: [
                            /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                              tooltip_exports.Trigger,
                              {
                                render: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components9.FlexItem, { className: "dataviews-view-grid__field-name", children: field.header })
                              }
                            ),
                            /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(tooltip_exports.Popup, { children: field.label })
                          ] }),
                          /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                            import_components9.FlexItem,
                            {
                              className: "dataviews-view-grid__field-value",
                              style: { maxHeight: "none" },
                              children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                                field.render,
                                {
                                  item,
                                  field
                                }
                              )
                            }
                          )
                        ] })
                      },
                      field.id
                    );
                  })
                }
              )
            ] })
          ]
        }
      );
    }
  );
  function CompositeGrid({
    data,
    isInfiniteScroll,
    className,
    inert,
    isLoading,
    view,
    fields,
    selection,
    onChangeSelection,
    onClickItem,
    isItemClickable: isItemClickable2,
    renderItemLink,
    getItemId,
    actions,
    getSelectionProps
  }) {
    const { paginationInfo, resizeObserverRef } = (0, import_element86.useContext)(dataviews_context_default);
    const gridColumns = useGridColumns();
    const gridStyle = {
      "--wp-dataviews-media-aspect-ratio": view.layout?.aspectRatio && MEDIA_ASPECT_RATIOS.includes(view.layout.aspectRatio) ? view.layout.aspectRatio : "1/1"
    };
    const isMediaContain = view.layout?.mediaFit === "contain";
    const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data);
    const titleField = fields.find(
      (field) => field.id === view?.titleField
    );
    const mediaField = fields.find(
      (field) => field.id === view?.mediaField
    );
    const descriptionField2 = fields.find(
      (field) => field.id === view?.descriptionField
    );
    const otherFields = view.fields ?? [];
    const { regularFields, badgeFields } = otherFields.reduce(
      (accumulator, fieldId) => {
        const field = fields.find((f) => f.id === fieldId);
        if (!field) {
          return accumulator;
        }
        const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
        accumulator[key].push(field);
        return accumulator;
      },
      { regularFields: [], badgeFields: [] }
    );
    const size4 = "900px";
    const totalRows = Math.ceil(data.length / gridColumns);
    const placeholdersNeeded = usePlaceholdersNeeded(
      data,
      isInfiniteScroll,
      gridColumns
    );
    return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, {
      // Render infinite scroll layout (no rows, feed semantics)
      children: [
        isInfiniteScroll && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
          import_components9.Composite,
          {
            render: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
              GridItems,
              {
                className: clsx_default(
                  "dataviews-view-grid-infinite-scroll",
                  className,
                  {
                    [`has-${view.layout?.density}-density`]: view.layout?.density && [
                      "compact",
                      "comfortable"
                    ].includes(view.layout.density),
                    "has-media-fit-contain": isMediaContain
                  }
                ),
                previewSize: view.layout?.previewSize,
                style: gridStyle,
                "aria-busy": isLoading,
                ref: resizeObserverRef
              }
            ),
            role: "feed",
            focusWrap: true,
            inert,
            children: [
              Array.from({ length: placeholdersNeeded }).map(
                (_, index2) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                  import_components9.Composite.Item,
                  {
                    render: (props) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                      Stack,
                      {
                        ...props,
                        direction: "column",
                        role: "article",
                        className: "dataviews-view-grid__row__gridcell dataviews-view-grid__card dataviews-view-grid__placeholder"
                      }
                    ),
                    "aria-hidden": true,
                    tabIndex: -1
                  },
                  `placeholder-${index2}`
                )
              ),
              data.map((item) => {
                const itemId = getItemId(item);
                const selectionProps = getSelectionProps(itemId);
                const stablePosition = item.position;
                return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                  import_components9.Composite.Item,
                  {
                    render: (props) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                      GridItem,
                      {
                        ...props,
                        id: itemId,
                        role: "article",
                        view,
                        selection,
                        onChangeSelection,
                        onClickItem,
                        isItemClickable: isItemClickable2,
                        renderItemLink,
                        getItemId,
                        item,
                        actions,
                        onMouseDown: (event) => {
                          props.onMouseDown?.(event);
                          selectionProps.onMouseDown(
                            event
                          );
                        },
                        onClickCapture: (event) => {
                          props.onClickCapture?.(event);
                          selectionProps.onClickCapture(
                            event
                          );
                        },
                        mediaField,
                        titleField,
                        descriptionField: descriptionField2,
                        regularFields,
                        badgeFields,
                        hasBulkActions,
                        posinset: stablePosition,
                        setsize: paginationInfo.totalItems,
                        config: {
                          sizes: size4
                        }
                      }
                    )
                  },
                  itemId
                );
              })
            ]
          }
        ),
        // Render standard grid layout (with rows, grid semantics)
        !isInfiniteScroll && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
          import_components9.Composite,
          {
            role: "grid",
            style: gridStyle,
            className: clsx_default("dataviews-view-grid", className, {
              [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
                view.layout.density
              ),
              "has-media-fit-contain": isMediaContain
            }),
            focusWrap: true,
            "aria-busy": isLoading,
            "aria-rowcount": totalRows,
            ref: resizeObserverRef,
            inert,
            children: chunk(data, gridColumns).map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
              import_components9.Composite.Row,
              {
                render: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                  "div",
                  {
                    role: "row",
                    "aria-rowindex": i + 1,
                    "aria-label": (0, import_i18n26.sprintf)(
                      /* translators: %d: The row number in the grid */
                      (0, import_i18n26.__)("Row %d"),
                      i + 1
                    ),
                    className: "dataviews-view-grid__row",
                    style: {
                      gridTemplateColumns: `repeat( ${gridColumns}, minmax(0, 1fr) )`
                    }
                  }
                ),
                children: row.map((item) => {
                  const itemId = getItemId(item);
                  const selectionProps = getSelectionProps(itemId);
                  return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                    import_components9.Composite.Item,
                    {
                      render: (props) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
                        GridItem,
                        {
                          ...props,
                          id: itemId,
                          role: "gridcell",
                          view,
                          selection,
                          onChangeSelection,
                          onClickItem,
                          isItemClickable: isItemClickable2,
                          renderItemLink,
                          getItemId,
                          item,
                          actions,
                          onMouseDown: (event) => {
                            props.onMouseDown?.(
                              event
                            );
                            selectionProps.onMouseDown(
                              event
                            );
                          },
                          onClickCapture: (event) => {
                            props.onClickCapture?.(
                              event
                            );
                            selectionProps.onClickCapture(
                              event
                            );
                          },
                          mediaField,
                          titleField,
                          descriptionField: descriptionField2,
                          regularFields,
                          badgeFields,
                          hasBulkActions,
                          config: {
                            sizes: size4
                          }
                        }
                      )
                    },
                    itemId
                  );
                })
              },
              i
            ))
          }
        )
      ]
    });
  }

  // packages/dataviews/build-module/components/dataviews-layouts/grid/index.mjs
  var import_jsx_runtime128 = __toESM(require_jsx_runtime(), 1);
  function ViewGrid({
    actions,
    data,
    fields,
    getItemId,
    isLoading,
    onChangeSelection,
    onClickItem,
    isItemClickable: isItemClickable2,
    renderItemLink,
    selection,
    view,
    className,
    empty
  }) {
    const isDelayedLoading = useDelayedLoading(!!isLoading);
    const hasData = !!data?.length;
    const groupField = view.groupBy?.field ? fields.find((f) => f.id === view.groupBy?.field) : null;
    const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
    const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
    const orderedData = dataByGroup ? Array.from(dataByGroup.values()).flat() : data;
    const { getSelectionProps } = useSelectionProps({
      data: orderedData,
      getItemId,
      isItemSelectable: (item) => hasAPossibleBulkAction(actions, item),
      selection,
      onChangeSelection,
      selectionMode: "multi",
      shouldSelectOnClick: false
    });
    if (!hasData) {
      return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
        "div",
        {
          className: clsx_default("dataviews-no-results", {
            "is-refreshing": isDelayedLoading
          }),
          children: empty
        }
      );
    }
    const gridProps = {
      className: clsx_default(className, {
        "is-refreshing": !isInfiniteScroll && isDelayedLoading
      }),
      inert: !isInfiniteScroll && !!isLoading ? "true" : void 0,
      isLoading,
      view,
      fields,
      selection,
      onChangeSelection,
      onClickItem,
      isItemClickable: isItemClickable2,
      renderItemLink,
      getItemId,
      actions,
      getSelectionProps
    };
    return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, {
      // Render multiple groups.
      children: [
        hasData && groupField && dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Stack, { direction: "column", gap: "lg", children: Array.from(dataByGroup.entries()).map(
          ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
            Stack,
            {
              direction: "column",
              gap: "sm",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("h3", { className: "dataviews-view-grid__group-header", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n27.sprintf)(
                  // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                  (0, import_i18n27.__)("%1$s: %2$s"),
                  groupField.label,
                  groupName
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
                  CompositeGrid,
                  {
                    ...gridProps,
                    data: groupItems,
                    isInfiniteScroll: false
                  }
                )
              ]
            },
            groupName
          )
        ) }),
        // Render a single grid with all data.
        !dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
          CompositeGrid,
          {
            ...gridProps,
            data,
            isInfiniteScroll: !!isInfiniteScroll
          }
        ),
        isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components10.Spinner, {}) })
      ]
    });
  }
  var grid_default = ViewGrid;

  // packages/dataviews/build-module/components/dataviews-layouts/list/index.mjs
  var import_compose8 = __toESM(require_compose(), 1);
  var import_components11 = __toESM(require_components(), 1);
  var import_element87 = __toESM(require_element(), 1);
  var import_i18n28 = __toESM(require_i18n(), 1);
  var import_data4 = __toESM(require_data(), 1);
  var import_jsx_runtime129 = __toESM(require_jsx_runtime(), 1);
  function generateItemWrapperCompositeId(idPrefix) {
    return `${idPrefix}-item-wrapper`;
  }
  function generatePrimaryActionCompositeId(idPrefix, primaryActionId) {
    return `${idPrefix}-primary-action-${primaryActionId}`;
  }
  function generateDropdownTriggerCompositeId(idPrefix) {
    return `${idPrefix}-dropdown`;
  }
  function PrimaryActionGridCell({
    idPrefix,
    primaryAction,
    item
  }) {
    const registry = (0, import_data4.useRegistry)();
    const [isModalOpen, setIsModalOpen] = (0, import_element87.useState)(false);
    const compositeItemId = generatePrimaryActionCompositeId(
      idPrefix,
      primaryAction.id
    );
    const label = typeof primaryAction.label === "string" ? primaryAction.label : primaryAction.label([item]);
    return "RenderModal" in primaryAction ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
      import_components11.Composite.Item,
      {
        id: compositeItemId,
        render: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
          import_components11.Button,
          {
            disabled: !!primaryAction.disabled,
            accessibleWhenDisabled: true,
            text: label,
            size: "small",
            onClick: () => setIsModalOpen(true)
          }
        ),
        children: isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
          ActionModal,
          {
            action: primaryAction,
            items: [item],
            closeModal: () => setIsModalOpen(false)
          }
        )
      }
    ) }, primaryAction.id) : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
      import_components11.Composite.Item,
      {
        id: compositeItemId,
        render: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
          import_components11.Button,
          {
            disabled: !!primaryAction.disabled,
            accessibleWhenDisabled: true,
            size: "small",
            onClick: () => {
              primaryAction.callback([item], { registry });
            },
            children: label
          }
        )
      }
    ) }, primaryAction.id);
  }
  function ListItem({
    view,
    actions,
    idPrefix,
    isSelected: isSelected2,
    item,
    titleField,
    mediaField,
    descriptionField: descriptionField2,
    selectionProps,
    otherFields,
    onDropdownTriggerKeyDown,
    posinset
  }) {
    const {
      showTitle = true,
      showMedia = true,
      showDescription = true,
      infiniteScrollEnabled
    } = view;
    const itemRef = (0, import_element87.useRef)(null);
    const labelId = `${idPrefix}-label`;
    const descriptionId = `${idPrefix}-description`;
    const registry = (0, import_data4.useRegistry)();
    const [isHovered, setIsHovered] = (0, import_element87.useState)(false);
    const [activeModalAction, setActiveModalAction] = (0, import_element87.useState)(
      null
    );
    const handleHover = ({ type }) => {
      const isHover = type === "mouseenter";
      setIsHovered(isHover);
    };
    const { paginationInfo } = (0, import_element87.useContext)(dataviews_context_default);
    (0, import_element87.useEffect)(() => {
      if (isSelected2) {
        itemRef.current?.scrollIntoView({
          behavior: "auto",
          block: "nearest",
          inline: "nearest"
        });
      }
    }, [isSelected2]);
    const { primaryAction, eligibleActions } = (0, import_element87.useMemo)(() => {
      const _eligibleActions = actions.filter(
        (action) => !action.isEligible || action.isEligible(item)
      );
      const _primaryActions = _eligibleActions.filter(
        (action) => action.isPrimary
      );
      return {
        primaryAction: _primaryActions[0],
        eligibleActions: _eligibleActions
      };
    }, [actions, item]);
    const hasOnlyOnePrimaryAction = primaryAction && actions.length === 1;
    const renderedMediaField = showMedia && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "dataviews-view-list__media-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
      mediaField.render,
      {
        item,
        field: mediaField,
        config: { sizes: "52px" }
      }
    ) }) : null;
    const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(titleField.render, { item, field: titleField }) : null;
    const renderDescription = showDescription && descriptionField2?.render;
    const hasOnlyMediaAndTitle = !!renderedMediaField && !renderDescription && !otherFields.length;
    const usedActions = eligibleActions?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
      Stack,
      {
        direction: "row",
        gap: "md",
        className: "dataviews-view-list__item-actions",
        children: [
          primaryAction && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
            PrimaryActionGridCell,
            {
              idPrefix,
              primaryAction,
              item
            }
          ),
          !hasOnlyOnePrimaryAction && /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { role: "gridcell", children: [
            /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(menu_exports.Root, { disabled: !actions.length, children: [
              /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                menu_exports.Trigger,
                {
                  render: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                    import_components11.Composite.Item,
                    {
                      id: generateDropdownTriggerCompositeId(
                        idPrefix
                      ),
                      accessibleWhenDisabled: true,
                      render: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                        import_components11.Button,
                        {
                          size: "small",
                          icon: more_vertical_default,
                          label: (0, import_i18n28.__)("Actions"),
                          accessibleWhenDisabled: true,
                          disabled: !actions.length,
                          onKeyDownCapture: onDropdownTriggerKeyDown
                        }
                      )
                    }
                  )
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                menu_exports.Popup,
                {
                  positioner: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(menu_exports.Positioner, { align: "end" }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                    ActionsMenuGroup,
                    {
                      actions: eligibleActions,
                      item,
                      registry,
                      setActiveModalAction
                    }
                  )
                }
              )
            ] }),
            !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
              ActionModal,
              {
                action: activeModalAction,
                items: [item],
                closeModal: () => setActiveModalAction(null)
              }
            )
          ] })
        ]
      }
    );
    return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
      import_components11.Composite.Row,
      {
        ref: itemRef,
        render: (
          /* aria-posinset breaks Composite.Row if passed to it directly. */
          /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
            "div",
            {
              "aria-posinset": posinset,
              "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0
            }
          )
        ),
        role: infiniteScrollEnabled ? "article" : "row",
        className: clsx_default({
          "is-selected": isSelected2,
          "is-hovered": isHovered
        }),
        onMouseEnter: handleHover,
        onMouseLeave: handleHover,
        children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
          Stack,
          {
            direction: "row",
            className: "dataviews-view-list__item-wrapper",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                import_components11.Composite.Item,
                {
                  id: generateItemWrapperCompositeId(idPrefix),
                  "aria-pressed": isSelected2,
                  "aria-labelledby": labelId,
                  "aria-describedby": descriptionId,
                  className: "dataviews-view-list__item",
                  ...selectionProps
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
                Stack,
                {
                  direction: "row",
                  gap: "md",
                  justify: "start",
                  align: hasOnlyMediaAndTitle ? "center" : "flex-start",
                  style: { flex: 1, minWidth: 0 },
                  children: [
                    renderedMediaField,
                    /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
                      Stack,
                      {
                        direction: "column",
                        gap: "xs",
                        className: "dataviews-view-list__field-wrapper",
                        children: [
                          /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(Stack, { direction: "row", align: "center", children: [
                            /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                              "div",
                              {
                                className: "dataviews-title-field dataviews-view-list__title-field",
                                id: labelId,
                                children: renderedTitleField
                              }
                            ),
                            usedActions
                          ] }),
                          renderDescription && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "dataviews-view-list__field", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                            descriptionField2.render,
                            {
                              item,
                              field: descriptionField2
                            }
                          ) }),
                          /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                            "div",
                            {
                              className: "dataviews-view-list__fields",
                              id: descriptionId,
                              children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
                                "div",
                                {
                                  className: "dataviews-view-list__field",
                                  children: [
                                    /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                                      VisuallyHidden,
                                      {
                                        className: "dataviews-view-list__field-label",
                                        render: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", {}),
                                        children: field.label
                                      }
                                    ),
                                    /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "dataviews-view-list__field-value", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                                      field.render,
                                      {
                                        item,
                                        field
                                      }
                                    ) })
                                  ]
                                },
                                field.id
                              ))
                            }
                          )
                        ]
                      }
                    )
                  ]
                }
              )
            ]
          }
        )
      }
    );
  }
  function isDefined2(item) {
    return !!item;
  }
  function ViewList(props) {
    const {
      actions,
      data,
      fields,
      getItemId,
      isLoading,
      onChangeSelection,
      selection,
      view,
      className,
      empty
    } = props;
    const baseId = (0, import_compose8.useInstanceId)(ViewList, "view-list");
    const isDelayedLoading = useDelayedLoading(!!isLoading);
    const { paginationInfo } = (0, import_element87.useContext)(dataviews_context_default);
    const selectedItem = data?.findLast(
      (item) => selection.includes(getItemId(item))
    );
    const titleField = fields.find((field) => field.id === view.titleField);
    const mediaField = fields.find((field) => field.id === view.mediaField);
    const descriptionField2 = fields.find(
      (field) => field.id === view.descriptionField
    );
    const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f) => fieldId === f.id)).filter(isDefined2);
    const { getSelectionProps } = useSelectionProps({
      data,
      getItemId,
      isItemSelectable: () => true,
      selection,
      onChangeSelection,
      selectionMode: "single-required",
      shouldSelectOnClick: true
    });
    const generateCompositeItemIdPrefix = (0, import_element87.useCallback)(
      (item) => `${baseId}-${getItemId(item)}`,
      [baseId, getItemId]
    );
    const isActiveCompositeItem = (0, import_element87.useCallback)(
      (item, idToCheck) => {
        return idToCheck.startsWith(
          generateCompositeItemIdPrefix(item)
        );
      },
      [generateCompositeItemIdPrefix]
    );
    const [activeCompositeId, setActiveCompositeId] = (0, import_element87.useState)(void 0);
    const compositeRef = (0, import_element87.useRef)(null);
    (0, import_element87.useEffect)(() => {
      if (selectedItem) {
        setActiveCompositeId(
          generateItemWrapperCompositeId(
            generateCompositeItemIdPrefix(selectedItem)
          )
        );
      }
    }, [selectedItem, generateCompositeItemIdPrefix]);
    const activeItemIndex = data.findIndex(
      (item) => isActiveCompositeItem(item, activeCompositeId ?? "")
    );
    const previousActiveItemIndex = (0, import_compose8.usePrevious)(activeItemIndex);
    const isActiveIdInList = activeItemIndex !== -1;
    const selectCompositeItem = (0, import_element87.useCallback)(
      (targetIndex, generateCompositeId) => {
        const clampedIndex = Math.min(
          data.length - 1,
          Math.max(0, targetIndex)
        );
        if (!data[clampedIndex]) {
          return;
        }
        const itemIdPrefix = generateCompositeItemIdPrefix(
          data[clampedIndex]
        );
        const targetCompositeItemId = generateCompositeId(itemIdPrefix);
        setActiveCompositeId(targetCompositeItemId);
        if (compositeRef.current?.contains(
          compositeRef.current.ownerDocument.activeElement
        )) {
          document.getElementById(targetCompositeItemId)?.focus();
        }
      },
      [data, generateCompositeItemIdPrefix]
    );
    (0, import_element87.useEffect)(() => {
      const wasActiveIdInList = previousActiveItemIndex !== void 0 && previousActiveItemIndex !== -1;
      if (!isActiveIdInList && wasActiveIdInList) {
        selectCompositeItem(
          previousActiveItemIndex,
          generateItemWrapperCompositeId
        );
      }
    }, [isActiveIdInList, selectCompositeItem, previousActiveItemIndex]);
    const onDropdownTriggerKeyDown = (0, import_element87.useCallback)(
      (event) => {
        if (event.key === "ArrowDown") {
          event.preventDefault();
          event.stopPropagation();
          selectCompositeItem(
            activeItemIndex + 1,
            generateDropdownTriggerCompositeId
          );
        }
        if (event.key === "ArrowUp") {
          event.preventDefault();
          event.stopPropagation();
          selectCompositeItem(
            activeItemIndex - 1,
            generateDropdownTriggerCompositeId
          );
        }
      },
      [selectCompositeItem, activeItemIndex]
    );
    const hasData = !!data?.length;
    const groupField = view.groupBy?.field ? fields.find((field) => field.id === view.groupBy?.field) : null;
    const dataByGroup = hasData && groupField ? getDataByGroup(data, groupField) : null;
    const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
    const hasMoreItems = isInfiniteScroll && (view.startPosition ?? 1) + (view.perPage ?? 0) < paginationInfo.totalItems;
    const listClassName = clsx_default("dataviews-view-list", className, {
      [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(view.layout.density),
      "is-refreshing": !isInfiniteScroll && isDelayedLoading
    });
    const compositeProps = {
      ref: compositeRef,
      id: baseId,
      render: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", {}),
      activeId: activeCompositeId,
      setActiveId: setActiveCompositeId,
      inert: !isInfiniteScroll && !!isLoading ? "true" : void 0
    };
    if (!hasData) {
      return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
        "div",
        {
          className: clsx_default("dataviews-no-results", {
            "is-refreshing": isDelayedLoading
          }),
          children: empty
        }
      );
    }
    if (hasData && groupField && dataByGroup) {
      return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
        import_components11.Composite,
        {
          ...compositeProps,
          className: "dataviews-view-list__group",
          role: "grid",
          children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Stack, { direction: "column", gap: "lg", className: listClassName, children: Array.from(dataByGroup.entries()).map(
            ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(Stack, { direction: "column", children: [
              /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("h3", { className: "dataviews-view-list__group-header", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n28.sprintf)(
                // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                (0, import_i18n28.__)("%1$s: %2$s"),
                groupField.label,
                groupName
              ) }),
              groupItems.map((item) => {
                const id = generateCompositeItemIdPrefix(item);
                return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
                  ListItem,
                  {
                    view,
                    idPrefix: id,
                    actions,
                    item,
                    isSelected: item === selectedItem,
                    selectionProps: getSelectionProps(
                      getItemId(item)
                    ),
                    mediaField,
                    titleField,
                    descriptionField: descriptionField2,
                    otherFields,
                    onDropdownTriggerKeyDown
                  },
                  id
                );
              })
            ] }, groupName)
          ) })
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
        import_components11.Composite,
        {
          ...compositeProps,
          className: listClassName,
          role: view.infiniteScrollEnabled ? "feed" : "grid",
          children: data.map((item, index2) => {
            const id = generateCompositeItemIdPrefix(item);
            return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
              ListItem,
              {
                view,
                idPrefix: id,
                actions,
                item,
                isSelected: item === selectedItem,
                selectionProps: getSelectionProps(
                  getItemId(item)
                ),
                mediaField,
                titleField,
                descriptionField: descriptionField2,
                otherFields,
                onDropdownTriggerKeyDown,
                posinset: view.infiniteScrollEnabled ? index2 + 1 : void 0
              },
              id
            );
          })
        }
      ),
      (hasMoreItems || isInfiniteScroll && isLoading) && // Keep the spinner's height reserved while loading more so the
      // scroll position doesn't bounce. Hidden, and silent to a11y,
      // while idle.
      /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
        "p",
        {
          className: "dataviews-loading-more",
          "aria-hidden": !isLoading,
          children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_components11.Spinner, {})
        }
      )
    ] });
  }

  // packages/dataviews/build-module/components/dataviews-layouts/activity/index.mjs
  var import_components12 = __toESM(require_components(), 1);

  // packages/dataviews/build-module/components/dataviews-layouts/activity/activity-group.mjs
  var import_i18n29 = __toESM(require_i18n(), 1);
  var import_element88 = __toESM(require_element(), 1);
  var import_jsx_runtime130 = __toESM(require_jsx_runtime(), 1);
  function ActivityGroup({
    groupName,
    groupData,
    groupField,
    showLabel = true,
    children
  }) {
    const groupHeader = showLabel ? (0, import_element88.createInterpolateElement)(
      // translators: %s: The label of the field e.g. "Status".
      (0, import_i18n29.sprintf)((0, import_i18n29.__)("%s: <groupName />"), groupField.label).trim(),
      {
        groupName: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
          groupField.render,
          {
            item: groupData[0],
            field: groupField
          }
        )
      }
    ) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(groupField.render, { item: groupData[0], field: groupField });
    return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
      Stack,
      {
        direction: "column",
        className: "dataviews-view-activity__group",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("h3", { className: "dataviews-view-activity__group-header", children: groupHeader }),
          children
        ]
      },
      groupName
    );
  }

  // packages/dataviews/build-module/components/dataviews-layouts/activity/activity-item.mjs
  var import_element89 = __toESM(require_element(), 1);
  var import_data5 = __toESM(require_data(), 1);
  var import_compose9 = __toESM(require_compose(), 1);
  var import_jsx_runtime131 = __toESM(require_jsx_runtime(), 1);
  function ActivityItem(props) {
    const {
      view,
      actions,
      item,
      titleField,
      mediaField,
      descriptionField: descriptionField2,
      otherFields,
      posinset,
      onClickItem,
      renderItemLink,
      isItemClickable: isItemClickable2
    } = props;
    const {
      showTitle = true,
      showMedia = true,
      showDescription = true,
      infiniteScrollEnabled
    } = view;
    const itemRef = (0, import_element89.useRef)(null);
    const registry = (0, import_data5.useRegistry)();
    const { paginationInfo } = (0, import_element89.useContext)(dataviews_context_default);
    const { primaryActions, eligibleActions } = (0, import_element89.useMemo)(() => {
      const _eligibleActions = actions.filter(
        (action) => !action.isEligible || action.isEligible(item)
      );
      const _primaryActions = _eligibleActions.filter(
        (action) => action.isPrimary
      );
      return {
        primaryActions: _primaryActions,
        eligibleActions: _eligibleActions
      };
    }, [actions, item]);
    const isMobileViewport = (0, import_compose9.useViewportMatch)("medium", "<");
    const density = view.layout?.density ?? "balanced";
    const mediaContent = showMedia && density !== "compact" && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
      mediaField.render,
      {
        item,
        field: mediaField,
        config: {
          sizes: density === "comfortable" ? "32px" : "24px"
        }
      }
    ) : null;
    const renderedMediaField = /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "dataviews-view-activity__item-type-icon", children: mediaContent || /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
      "span",
      {
        className: "dataviews-view-activity__item-bullet",
        "aria-hidden": "true"
      }
    ) });
    const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(titleField.render, { item, field: titleField }) : null;
    const verticalGap = (0, import_element89.useMemo)(() => {
      switch (density) {
        case "comfortable":
          return "md";
        default:
          return "sm";
      }
    }, [density]);
    return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
      "div",
      {
        ref: itemRef,
        role: infiniteScrollEnabled ? "article" : void 0,
        "aria-posinset": posinset,
        "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
        className: clsx_default(
          "dataviews-view-activity__item",
          density === "compact" && "is-compact",
          density === "balanced" && "is-balanced",
          density === "comfortable" && "is-comfortable"
        ),
        children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(Stack, { direction: "row", gap: "lg", justify: "start", align: "flex-start", children: [
          /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
            Stack,
            {
              direction: "column",
              gap: "xs",
              align: "center",
              className: "dataviews-view-activity__item-type",
              children: renderedMediaField
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
            Stack,
            {
              direction: "column",
              gap: verticalGap,
              align: "flex-start",
              className: "dataviews-view-activity__item-content",
              children: [
                renderedTitleField && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
                  ItemClickWrapper,
                  {
                    item,
                    isItemClickable: isItemClickable2,
                    onClickItem,
                    renderItemLink,
                    className: "dataviews-view-activity__item-title",
                    children: renderedTitleField
                  }
                ),
                showDescription && descriptionField2 && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "dataviews-view-activity__item-description", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
                  descriptionField2.render,
                  {
                    item,
                    field: descriptionField2
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "dataviews-view-activity__item-fields", children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
                  "div",
                  {
                    className: "dataviews-view-activity__item-field",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
                        VisuallyHidden,
                        {
                          className: "dataviews-view-activity__item-field-label",
                          render: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", {}),
                          children: field.label
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "dataviews-view-activity__item-field-value", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
                        field.render,
                        {
                          item,
                          field
                        }
                      ) })
                    ]
                  },
                  field.id
                )) }),
                !!primaryActions?.length && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
                  PrimaryActions,
                  {
                    item,
                    actions: primaryActions,
                    registry,
                    buttonVariant: "secondary"
                  }
                )
              ]
            }
          ),
          (primaryActions.length < eligibleActions.length || // Since we hide primary actions on mobile, we need to show the menu
          // there if there are any actions at all.
          isMobileViewport && // At the same time, only show the menu if there are actions to show.
          eligibleActions.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "dataviews-view-activity__item-actions", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
            ItemActions,
            {
              item,
              actions: eligibleActions,
              isCompact: true
            }
          ) })
        ] })
      }
    );
  }
  var activity_item_default = ActivityItem;

  // packages/dataviews/build-module/components/dataviews-layouts/activity/activity-items.mjs
  var import_react45 = __toESM(require_react(), 1);
  function isDefined3(item) {
    return !!item;
  }
  function ActivityItems(props) {
    const { data, fields, getItemId, view } = props;
    const titleField = fields.find((field) => field.id === view.titleField);
    const mediaField = fields.find((field) => field.id === view.mediaField);
    const descriptionField2 = fields.find(
      (field) => field.id === view.descriptionField
    );
    const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f) => fieldId === f.id)).filter(isDefined3);
    return data.map((item, index2) => {
      return /* @__PURE__ */ (0, import_react45.createElement)(
        activity_item_default,
        {
          ...props,
          key: getItemId(item),
          item,
          mediaField,
          titleField,
          descriptionField: descriptionField2,
          otherFields,
          posinset: view.infiniteScrollEnabled ? index2 + 1 : void 0
        }
      );
    });
  }

  // packages/dataviews/build-module/components/dataviews-layouts/activity/index.mjs
  var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1);
  function ViewActivity(props) {
    const { empty, data, fields, isLoading, view, className } = props;
    const isDelayedLoading = useDelayedLoading(!!isLoading);
    const hasData = !!data?.length;
    const groupField = view.groupBy?.field ? fields.find((field) => field.id === view.groupBy?.field) : null;
    const dataByGroup = hasData && groupField ? getDataByGroup(data, groupField) : null;
    const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
    if (!hasData) {
      return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
        "div",
        {
          className: clsx_default("dataviews-no-results", {
            "is-refreshing": isDelayedLoading
          }),
          children: empty
        }
      );
    }
    const isInert = !isInfiniteScroll && !!isLoading;
    const wrapperClassName = clsx_default("dataviews-view-activity", className, {
      "is-refreshing": !isInfiniteScroll && isDelayedLoading
    });
    const groupedEntries = dataByGroup ? Array.from(dataByGroup.entries()) : [];
    if (hasData && groupField && dataByGroup) {
      return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
        Stack,
        {
          direction: "column",
          gap: "sm",
          className: wrapperClassName,
          inert: isInert ? "true" : void 0,
          children: groupedEntries.map(
            ([groupName, groupData]) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
              ActivityGroup,
              {
                groupName,
                groupData,
                groupField,
                showLabel: view.groupBy?.showLabel !== false,
                children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
                  ActivityItems,
                  {
                    ...props,
                    data: groupData
                  }
                )
              },
              groupName
            )
          )
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
        "div",
        {
          className: wrapperClassName,
          role: view.infiniteScrollEnabled ? "feed" : void 0,
          inert: isInert ? "true" : void 0,
          children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(ActivityItems, { ...props })
        }
      ),
      isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components12.Spinner, {}) })
    ] });
  }

  // packages/dataviews/build-module/components/dataviews-layouts/picker-grid/index.mjs
  var import_components15 = __toESM(require_components(), 1);
  var import_i18n32 = __toESM(require_i18n(), 1);
  var import_compose10 = __toESM(require_compose(), 1);
  var import_element92 = __toESM(require_element(), 1);

  // packages/dataviews/build-module/components/dataviews-picker-footer/index.mjs
  var import_components14 = __toESM(require_components(), 1);
  var import_data6 = __toESM(require_data(), 1);
  var import_element91 = __toESM(require_element(), 1);
  var import_i18n31 = __toESM(require_i18n(), 1);

  // packages/dataviews/build-module/components/dataviews-pagination/index.mjs
  var import_components13 = __toESM(require_components(), 1);
  var import_element90 = __toESM(require_element(), 1);
  var import_i18n30 = __toESM(require_i18n(), 1);
  var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1);
  function hasPaginationControls(view, paginationInfo) {
    return !view.infiniteScrollEnabled && paginationInfo.totalItems > 0 && paginationInfo.totalPages > 1;
  }
  function DataViewsPageSelect({ className }) {
    const { view, onChangeView, paginationInfo } = (0, import_element90.useContext)(dataviews_context_default);
    if (!hasPaginationControls(view, paginationInfo)) {
      return null;
    }
    const { totalPages } = paginationInfo;
    const currentPage = view.page ?? 1;
    const pageSelectOptions = Array.from(Array(totalPages)).map(
      (_, i) => {
        const page = i + 1;
        return {
          value: page.toString(),
          label: page.toString(),
          "aria-label": currentPage === page ? (0, import_i18n30.sprintf)(
            // translators: 1: current page number. 2: total number of pages.
            (0, import_i18n30.__)("Page %1$d of %2$d"),
            currentPage,
            totalPages
          ) : page.toString()
        };
      }
    );
    return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
      Stack,
      {
        direction: "row",
        justify: "flex-start",
        align: "center",
        gap: "xs",
        className: clsx_default("dataviews-pagination__page-select", className),
        children: (0, import_element90.createInterpolateElement)(
          (0, import_i18n30.sprintf)(
            // translators: 1: Current page number, 2: Total number of pages.
            (0, import_i18n30._x)("<div>Page</div>%1$s<div>of %2$d</div>", "paging"),
            "<CurrentPage />",
            totalPages
          ),
          {
            div: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { "aria-hidden": true }),
            // @ts-expect-error — Tag injected via sprintf argument, not visible in format string.
            CurrentPage: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
              import_components13.SelectControl,
              {
                "aria-label": (0, import_i18n30.__)("Current page"),
                value: currentPage.toString(),
                options: pageSelectOptions,
                onChange: (newValue) => {
                  onChangeView({
                    ...view,
                    page: +newValue
                  });
                },
                size: "small",
                variant: "minimal"
              }
            )
          }
        )
      }
    );
  }
  function DataViewsPageNavigation({
    className
  }) {
    const { view, onChangeView, paginationInfo } = (0, import_element90.useContext)(dataviews_context_default);
    if (!hasPaginationControls(view, paginationInfo)) {
      return null;
    }
    const { totalPages } = paginationInfo;
    const currentPage = view.page ?? 1;
    return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
      Stack,
      {
        direction: "row",
        gap: "xs",
        align: "center",
        className: clsx_default(
          "dataviews-pagination__page-navigation",
          className
        ),
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
            import_components13.Button,
            {
              onClick: () => onChangeView({
                ...view,
                page: currentPage - 1
              }),
              disabled: currentPage === 1,
              accessibleWhenDisabled: true,
              label: (0, import_i18n30.__)("Previous page"),
              icon: (0, import_i18n30.isRTL)() ? next_default : previous_default,
              showTooltip: true,
              size: "compact",
              tooltipPosition: "top"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
            import_components13.Button,
            {
              onClick: () => onChangeView({ ...view, page: currentPage + 1 }),
              disabled: currentPage >= totalPages,
              accessibleWhenDisabled: true,
              label: (0, import_i18n30.__)("Next page"),
              icon: (0, import_i18n30.isRTL)() ? previous_default : next_default,
              showTooltip: true,
              size: "compact",
              tooltipPosition: "top"
            }
          )
        ]
      }
    );
  }
  function DataViewsPagination({
    children,
    className
  }) {
    const { view, paginationInfo } = (0, import_element90.useContext)(dataviews_context_default);
    if (!hasPaginationControls(view, paginationInfo)) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
      Stack,
      {
        direction: "row",
        className: clsx_default("dataviews-pagination", className),
        justify: "end",
        align: "center",
        gap: "xl",
        children: children ?? /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_jsx_runtime133.Fragment, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DataViewsPageSelect, {}),
          /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DataViewsPageNavigation, {})
        ] })
      }
    );
  }
  var dataviews_pagination_default = (0, import_element90.memo)(DataViewsPagination);

  // packages/dataviews/build-module/components/dataviews-picker-footer/index.mjs
  var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1);
  var EMPTY_ARRAY2 = [];
  function useIsMultiselectPicker(actions) {
    return (0, import_element91.useMemo)(() => {
      return !!actions?.length && actions?.every((action) => action.supportsBulk);
    }, [actions]);
  }
  function BulkSelectionCheckbox2({
    selection,
    selectedItems,
    onChangeSelection,
    data,
    getItemId,
    disableSelectAll = false
  }) {
    const hasSelection = selection.length > 0;
    const areAllSelected = selectedItems.length === data.length;
    if (disableSelectAll) {
      return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
        import_components14.CheckboxControl,
        {
          className: "dataviews-view-table-selection-checkbox",
          checked: hasSelection,
          disabled: !hasSelection,
          onChange: () => {
            onChangeSelection([]);
          },
          "aria-label": (0, import_i18n31.__)("Deselect all")
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
      import_components14.CheckboxControl,
      {
        className: "dataviews-view-table-selection-checkbox",
        checked: areAllSelected,
        indeterminate: !areAllSelected && !!selectedItems.length,
        onChange: () => {
          if (areAllSelected) {
            onChangeSelection(
              selection.filter(
                (id) => !data.some(
                  (item) => id === getItemId(item)
                )
              )
            );
          } else {
            const selectionSet = /* @__PURE__ */ new Set([
              ...selection,
              ...data.map((item) => getItemId(item))
            ]);
            onChangeSelection(Array.from(selectionSet));
          }
        },
        "aria-label": areAllSelected ? (0, import_i18n31.__)("Deselect all") : (0, import_i18n31.__)("Select all")
      }
    );
  }
  function ActionButtons({
    actions,
    items,
    selection
  }) {
    const registry = (0, import_data6.useRegistry)();
    const [actionInProgress, setActionInProgress] = (0, import_element91.useState)(
      null
    );
    return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Stack, { direction: "row", gap: "xs", children: actions.map((action) => {
      if (!("callback" in action)) {
        return null;
      }
      const { id, label, icon, isPrimary, isEligible, callback } = action;
      const eligibleItems = isEligible ? items.filter((item) => isEligible(item)) : items;
      const _label = typeof label === "string" ? label : label(items);
      const variant = isPrimary ? "primary" : "tertiary";
      const isInProgress = id === actionInProgress;
      return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
        import_components14.Button,
        {
          accessibleWhenDisabled: true,
          icon,
          disabled: isInProgress || !selection?.length || !!isEligible && !eligibleItems.length,
          isBusy: isInProgress,
          onClick: async () => {
            setActionInProgress(id);
            await callback(eligibleItems, {
              registry
            });
            setActionInProgress(null);
          },
          size: "compact",
          variant,
          children: _label
        },
        id
      );
    }) });
  }
  function PickerBulkSelectionInfo() {
    const {
      data,
      selection,
      onChangeSelection,
      getItemId,
      actions = EMPTY_ARRAY2,
      paginationInfo,
      view
    } = (0, import_element91.useContext)(dataviews_context_default);
    const isMultiselect = useIsMultiselectPicker(actions);
    const selectedItems = (0, import_element91.useMemo)(
      () => data.filter((item) => selection.includes(getItemId(item))),
      [selection, getItemId, data]
    );
    if (!actions.length) {
      return null;
    }
    const message2 = getFooterMessage(
      selection.length,
      data.length,
      paginationInfo.totalItems,
      !!view.infiniteScrollEnabled
    );
    return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
      Stack,
      {
        direction: "row",
        className: "dataviews-picker-footer__bulk-selection",
        gap: "md",
        align: "center",
        children: [
          isMultiselect && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
            BulkSelectionCheckbox2,
            {
              selection,
              selectedItems,
              onChangeSelection,
              data,
              getItemId,
              disableSelectAll: !!view.infiniteScrollEnabled
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message2 })
        ]
      }
    );
  }
  function PickerActions({ className }) {
    const {
      data,
      selection,
      getItemId,
      actions = EMPTY_ARRAY2
    } = (0, import_element91.useContext)(dataviews_context_default);
    const selectedItems = (0, import_element91.useMemo)(
      () => data.filter((item) => selection.includes(getItemId(item))),
      [selection, getItemId, data]
    );
    if (!actions.length) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
      "div",
      {
        className: clsx_default("dataviews-picker-footer__actions", className),
        children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
          ActionButtons,
          {
            actions,
            items: selectedItems,
            selection
          }
        )
      }
    );
  }
  function DataViewsPickerBulkActionToolbar({
    className
  }) {
    return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Stack, { direction: "row", gap: "md", align: "center", className, children: [
      /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(PickerBulkSelectionInfo, {}),
      /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(PickerActions, {})
    ] });
  }
  function DataViewsPickerFooter({
    children,
    className
  }) {
    const {
      actions = EMPTY_ARRAY2,
      paginationInfo,
      view
    } = (0, import_element91.useContext)(dataviews_context_default);
    const hasPagination = !view.infiniteScrollEnabled && !!paginationInfo.totalItems && paginationInfo.totalPages > 1;
    const rendersDefaultContents = children === void 0 || children === null;
    if (rendersDefaultContents && !actions.length && !hasPagination) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
      Stack,
      {
        direction: "row",
        justify: "space-between",
        align: "center",
        className: clsx_default("dataviews-footer", className),
        gap: "sm",
        children: children ?? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_jsx_runtime134.Fragment, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(PickerBulkSelectionInfo, {}),
          /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(dataviews_pagination_default, {}),
          /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(PickerActions, {})
        ] })
      }
    );
  }

  // packages/dataviews/build-module/components/dataviews-layouts/picker-grid/index.mjs
  var import_jsx_runtime135 = __toESM(require_jsx_runtime(), 1);
  function GridItem3({
    view,
    selection,
    onChangeSelection,
    selectionProps,
    getItemId,
    item,
    mediaField,
    titleField,
    descriptionField: descriptionField2,
    regularFields,
    badgeFields,
    config,
    posinset,
    setsize
  }) {
    const { showTitle = true, showMedia = true, showDescription = true } = view;
    const id = getItemId(item);
    const elementRef = (0, import_element92.useRef)(null);
    const isSelected2 = selection.includes(id);
    useIntersectionObserver(elementRef, posinset);
    const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
      mediaField.render,
      {
        item,
        field: mediaField,
        config
      }
    ) : null;
    const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(titleField.render, { item, field: titleField }) : null;
    return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
      import_components15.Composite.Item,
      {
        ref: elementRef,
        "aria-label": titleField ? titleField.getValue({ item }) || (0, import_i18n32.__)("(no title)") : void 0,
        render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Stack, { direction: "column", children, ...props }),
        role: "option",
        "aria-posinset": posinset,
        "aria-setsize": setsize,
        className: clsx_default("dataviews-view-picker-grid__card", {
          "is-selected": isSelected2
        }),
        "aria-selected": isSelected2,
        ...selectionProps,
        children: [
          showMedia && renderedMediaField && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "dataviews-view-picker-grid__media", children: renderedMediaField }),
          showMedia && renderedMediaField && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
            DataViewsSelectionCheckbox,
            {
              item,
              selection,
              onChangeSelection,
              getItemId,
              titleField,
              disabled: false,
              "aria-hidden": true,
              tabIndex: -1
            }
          ),
          showTitle && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
            Stack,
            {
              direction: "row",
              justify: "space-between",
              className: "dataviews-view-picker-grid__title-actions",
              children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "dataviews-view-picker-grid__title-field dataviews-title-field", children: renderedTitleField })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(Stack, { direction: "column", gap: "xs", children: [
            showDescription && descriptionField2?.render && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
              descriptionField2.render,
              {
                item,
                field: descriptionField2
              }
            ),
            !!badgeFields?.length && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
              Stack,
              {
                direction: "row",
                className: "dataviews-view-picker-grid__badge-fields",
                gap: "sm",
                wrap: "wrap",
                align: "top",
                justify: "flex-start",
                children: badgeFields.map((field) => {
                  return (
                    /* @ts-expect-error `Badge` is text-only, but a badge field renders whatever its `render` returns. */
                    /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                      Badge,
                      {
                        className: "dataviews-view-picker-grid__field-value",
                        children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                          field.render,
                          {
                            item,
                            field
                          }
                        )
                      },
                      field.id
                    )
                  );
                })
              }
            ),
            !!regularFields?.length && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
              Stack,
              {
                direction: "column",
                className: "dataviews-view-picker-grid__fields",
                gap: "xs",
                children: regularFields.map((field) => {
                  return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                    import_components15.Flex,
                    {
                      className: "dataviews-view-picker-grid__field",
                      gap: 1,
                      justify: "flex-start",
                      expanded: true,
                      style: { height: "auto" },
                      direction: "row",
                      children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
                        /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_components15.FlexItem, { className: "dataviews-view-picker-grid__field-name", children: field.header }),
                        /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                          import_components15.FlexItem,
                          {
                            className: "dataviews-view-picker-grid__field-value",
                            style: { maxHeight: "none" },
                            children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                              field.render,
                              {
                                item,
                                field
                              }
                            )
                          }
                        )
                      ] })
                    },
                    field.id
                  );
                })
              }
            )
          ] })
        ]
      },
      id
    );
  }
  function GridGroup({
    groupName,
    groupField,
    showLabel = true,
    children
  }) {
    const headerId = (0, import_compose10.useInstanceId)(
      GridGroup,
      "dataviews-view-picker-grid-group__header"
    );
    return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
      Stack,
      {
        direction: "column",
        gap: "sm",
        role: "group",
        "aria-labelledby": headerId,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
            "h3",
            {
              className: "dataviews-view-picker-grid-group__header",
              id: headerId,
              children: showLabel ? (0, import_i18n32.sprintf)(
                // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                (0, import_i18n32.__)("%1$s: %2$s"),
                groupField.label,
                groupName
              ) : groupName
            }
          ),
          children
        ]
      },
      groupName
    );
  }
  function ViewPickerGrid({
    actions,
    data,
    fields,
    getItemId,
    isLoading,
    onChangeSelection,
    selection,
    view,
    className,
    empty
  }) {
    const { resizeObserverRef, paginationInfo, itemListLabel } = (0, import_element92.useContext)(dataviews_context_default);
    const titleField = fields.find(
      (field) => field.id === view?.titleField
    );
    const mediaField = fields.find(
      (field) => field.id === view?.mediaField
    );
    const descriptionField2 = fields.find(
      (field) => field.id === view?.descriptionField
    );
    const otherFields = view.fields ?? [];
    const { regularFields, badgeFields } = otherFields.reduce(
      (accumulator, fieldId) => {
        const field = fields.find((f) => f.id === fieldId);
        if (!field) {
          return accumulator;
        }
        const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
        accumulator[key].push(field);
        return accumulator;
      },
      { regularFields: [], badgeFields: [] }
    );
    const hasData = !!data?.length;
    const usedPreviewSize = view.layout?.previewSize;
    const isMultiselect = useIsMultiselectPicker(actions);
    const size4 = "900px";
    const groupField = view.groupBy?.field ? fields.find((f) => f.id === view.groupBy?.field) : null;
    const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
    const isInfiniteScroll = (view.infiniteScrollEnabled && !dataByGroup) ?? false;
    const orderedData = dataByGroup ? Array.from(dataByGroup.values()).flat() : data;
    const { getSelectionProps } = useSelectionProps({
      data: orderedData,
      getItemId,
      isItemSelectable: () => true,
      selection,
      onChangeSelection,
      selectionMode: isMultiselect ? "multi" : "single-clearable",
      shouldSelectOnClick: true
    });
    const currentPage = view?.page ?? 1;
    const perPage = view?.perPage ?? 0;
    const setSize = isInfiniteScroll ? paginationInfo?.totalItems : void 0;
    const isMediaContain = view.layout?.mediaFit === "contain";
    const gridColumns = useGridColumns();
    const placeholdersNeeded = usePlaceholdersNeeded(
      data,
      isInfiniteScroll,
      gridColumns
    );
    return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, {
      // Render multiple groups.
      children: [
        hasData && groupField && dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
          import_components15.Composite,
          {
            virtualFocus: true,
            orientation: "horizontal",
            role: "listbox",
            "aria-multiselectable": isMultiselect,
            className: clsx_default(
              "dataviews-view-picker-grid",
              className,
              {
                [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
                  view.layout.density
                ),
                "has-media-fit-contain": isMediaContain
              }
            ),
            "aria-label": itemListLabel,
            render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
              Stack,
              {
                direction: "column",
                gap: "lg",
                children,
                ...props
              }
            ),
            children: Array.from(dataByGroup.entries()).map(
              ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                GridGroup,
                {
                  groupName,
                  groupField,
                  showLabel: view.groupBy?.showLabel !== false,
                  children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                    GridItems,
                    {
                      previewSize: usedPreviewSize,
                      "aria-busy": isLoading,
                      ref: resizeObserverRef,
                      children: groupItems.map((item) => {
                        const posInSet = item.position ?? (currentPage - 1) * perPage + data.indexOf(item) + 1;
                        return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                          GridItem3,
                          {
                            view,
                            selection,
                            onChangeSelection,
                            selectionProps: getSelectionProps(
                              getItemId(item)
                            ),
                            getItemId,
                            item,
                            mediaField,
                            titleField,
                            descriptionField: descriptionField2,
                            regularFields,
                            badgeFields,
                            config: {
                              sizes: size4
                            },
                            posinset: posInSet,
                            setsize: setSize
                          },
                          getItemId(item)
                        );
                      })
                    }
                  )
                },
                groupName
              )
            )
          }
        ),
        // Render a single grid with all data.
        hasData && !dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
          import_components15.Composite,
          {
            render: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
              GridItems,
              {
                className: clsx_default(
                  "dataviews-view-picker-grid",
                  className,
                  {
                    [`has-${view.layout?.density}-density`]: view.layout?.density && [
                      "compact",
                      "comfortable"
                    ].includes(view.layout.density),
                    "has-media-fit-contain": isMediaContain
                  }
                ),
                previewSize: usedPreviewSize,
                "aria-busy": isLoading,
                ref: resizeObserverRef
              }
            ),
            virtualFocus: true,
            orientation: "horizontal",
            role: "listbox",
            "aria-multiselectable": isMultiselect,
            "aria-label": itemListLabel,
            children: [
              Array.from({ length: placeholdersNeeded }).map(
                (_, index2) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                  import_components15.Composite.Item,
                  {
                    render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                      Stack,
                      {
                        direction: "column",
                        children,
                        ...props
                      }
                    ),
                    role: "option",
                    "aria-hidden": true,
                    tabIndex: -1,
                    className: "dataviews-view-picker-grid__card dataviews-view-picker-grid__placeholder"
                  },
                  `placeholder-${index2}`
                )
              ),
              data.map((item) => {
                const posinset = item.position;
                return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
                  GridItem3,
                  {
                    view,
                    selection,
                    onChangeSelection,
                    selectionProps: getSelectionProps(
                      getItemId(item)
                    ),
                    getItemId,
                    item,
                    mediaField,
                    titleField,
                    descriptionField: descriptionField2,
                    regularFields,
                    badgeFields,
                    config: {
                      sizes: size4
                    },
                    posinset,
                    setsize: setSize
                  },
                  getItemId(item)
                );
              })
            ]
          }
        ),
        // Render empty state.
        !hasData && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
          "div",
          {
            className: clsx_default({
              "dataviews-loading": isLoading,
              "dataviews-no-results": !isLoading
            }),
            children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_components15.Spinner, {}) }) : empty
          }
        ),
        hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_components15.Spinner, {}) })
      ]
    });
  }
  var picker_grid_default = ViewPickerGrid;

  // packages/dataviews/build-module/components/dataviews-layouts/picker-table/index.mjs
  var import_i18n33 = __toESM(require_i18n(), 1);
  var import_components16 = __toESM(require_components(), 1);
  var import_element93 = __toESM(require_element(), 1);
  var import_jsx_runtime136 = __toESM(require_jsx_runtime(), 1);
  function TableColumnField2({
    item,
    fields,
    column,
    align
  }) {
    const field = fields.find((f) => f.id === column);
    if (!field) {
      return null;
    }
    const className = clsx_default("dataviews-view-table__cell-content-wrapper", {
      "dataviews-view-table__cell-align-end": align === "end",
      "dataviews-view-table__cell-align-center": align === "center"
    });
    return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(field.render, { item, field }) });
  }
  function TableRow2({
    item,
    fields,
    id,
    view,
    titleField,
    mediaField,
    descriptionField: descriptionField2,
    selection,
    getItemId,
    onChangeSelection,
    selectionProps,
    posinset
  }) {
    const { paginationInfo } = (0, import_element93.useContext)(dataviews_context_default);
    const isSelected2 = selection.includes(id);
    const [isHovered, setIsHovered] = (0, import_element93.useState)(false);
    const elementRef = (0, import_element93.useRef)(null);
    useIntersectionObserver(elementRef, posinset);
    const {
      showTitle = true,
      showMedia = true,
      showDescription = true,
      infiniteScrollEnabled
    } = view;
    const handleMouseEnter = () => {
      setIsHovered(true);
    };
    const handleMouseLeave = () => {
      setIsHovered(false);
    };
    const columns = getTableColumns(view, fields);
    const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField2 && showDescription;
    return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
      import_components16.Composite.Item,
      {
        ref: elementRef,
        render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
          "tr",
          {
            className: clsx_default("dataviews-view-table__row", {
              "is-selected": isSelected2,
              "is-hovered": isHovered
            }),
            onMouseEnter: handleMouseEnter,
            onMouseLeave: handleMouseLeave,
            children,
            ...props
          }
        ),
        "aria-selected": isSelected2,
        "aria-setsize": paginationInfo.totalItems || void 0,
        "aria-posinset": posinset,
        role: infiniteScrollEnabled ? "article" : "option",
        onClickCapture: selectionProps.onClickCapture,
        onClick: selectionProps.onClick,
        onMouseDown: (event) => {
          if (event.button !== 0) {
            return;
          }
          event.currentTarget.parentElement?.focus({
            preventScroll: true
          });
          selectionProps.onMouseDown(event);
        },
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
            "td",
            {
              className: "dataviews-view-table__checkbox-column",
              role: "presentation",
              children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                DataViewsSelectionCheckbox,
                {
                  item,
                  selection,
                  onChangeSelection,
                  getItemId,
                  titleField,
                  disabled: false,
                  "aria-hidden": true,
                  tabIndex: -1
                }
              ) })
            }
          ),
          hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
            "td",
            {
              role: "presentation",
              children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                column_primary_default,
                {
                  item,
                  titleField: showTitle ? titleField : void 0,
                  mediaField: showMedia ? mediaField : void 0,
                  descriptionField: showDescription ? descriptionField2 : void 0,
                  isItemClickable: () => false
                }
              )
            }
          ),
          columns.map((column) => {
            const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
            return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
              "td",
              {
                style: {
                  width,
                  maxWidth,
                  minWidth
                },
                role: "presentation",
                children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                  TableColumnField2,
                  {
                    fields,
                    item,
                    column,
                    align
                  }
                )
              },
              column
            );
          })
        ]
      },
      id
    );
  }
  function ViewPickerTable({
    actions,
    data,
    fields,
    getItemId,
    isLoading = false,
    onChangeView,
    onChangeSelection,
    selection,
    setOpenedFilter,
    view,
    className,
    empty
  }) {
    const headerMenuRefs = (0, import_element93.useRef)(/* @__PURE__ */ new Map());
    const headerMenuToFocusRef = (0, import_element93.useRef)(void 0);
    const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0, import_element93.useState)();
    const isMultiselect = useIsMultiselectPicker(actions) ?? false;
    (0, import_element93.useEffect)(() => {
      if (headerMenuToFocusRef.current) {
        headerMenuToFocusRef.current.focus();
        headerMenuToFocusRef.current = void 0;
      }
    });
    const groupField = view.groupBy?.field ? fields.find((f) => f.id === view.groupBy?.field) : null;
    const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
    const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
    const orderedData = dataByGroup ? Array.from(dataByGroup.values()).flat() : data;
    const { getSelectionProps } = useSelectionProps({
      data: orderedData,
      getItemId,
      isItemSelectable: () => true,
      selection,
      onChangeSelection,
      selectionMode: isMultiselect ? "multi" : "single-clearable",
      shouldSelectOnClick: true
    });
    const tableNoticeId = (0, import_element93.useId)();
    if (nextHeaderMenuToFocus) {
      headerMenuToFocusRef.current = nextHeaderMenuToFocus;
      setNextHeaderMenuToFocus(void 0);
      return;
    }
    const onHide = (field) => {
      const hidden = headerMenuRefs.current.get(field.id);
      const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
      setNextHeaderMenuToFocus(fallback?.node);
    };
    const hasData = !!data?.length;
    const titleField = fields.find((field) => field.id === view.titleField);
    const mediaField = fields.find((field) => field.id === view.mediaField);
    const descriptionField2 = fields.find(
      (field) => field.id === view.descriptionField
    );
    const { showTitle = true, showMedia = true, showDescription = true } = view;
    const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField2 && showDescription;
    const columns = getTableColumns(view, fields);
    const headerMenuRef = (column, index2) => (node) => {
      if (node) {
        headerMenuRefs.current.set(column, {
          node,
          fallback: columns[index2 > 0 ? index2 - 1 : 1]
        });
      } else {
        headerMenuRefs.current.delete(column);
      }
    };
    return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
        "table",
        {
          className: clsx_default(
            "dataviews-view-table",
            "dataviews-view-picker-table",
            className,
            {
              [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
                view.layout.density
              )
            }
          ),
          "aria-busy": isLoading,
          "aria-describedby": tableNoticeId,
          role: isInfiniteScroll ? "feed" : "listbox",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("thead", { role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
              "tr",
              {
                className: "dataviews-view-table__row",
                role: "presentation",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("th", { className: "dataviews-view-table__checkbox-column", children: isMultiselect && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                    BulkSelectionCheckbox,
                    {
                      selection,
                      onChangeSelection,
                      data,
                      actions,
                      getItemId,
                      disableSelectAll: isInfiniteScroll
                    }
                  ) }),
                  hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("th", { children: titleField && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                    column_header_menu_default,
                    {
                      ref: headerMenuRef(
                        titleField.id,
                        0
                      ),
                      fieldId: titleField.id,
                      view,
                      fields,
                      onChangeView,
                      onHide,
                      setOpenedFilter,
                      canMove: false
                    }
                  ) }),
                  columns.map((column, index2) => {
                    const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
                    return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                      "th",
                      {
                        style: {
                          width,
                          maxWidth,
                          minWidth,
                          textAlign: align
                        },
                        "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
                        scope: "col",
                        children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                          column_header_menu_default,
                          {
                            ref: headerMenuRef(column, index2),
                            fieldId: column,
                            view,
                            fields,
                            onChangeView,
                            onHide,
                            setOpenedFilter,
                            canMove: view.layout?.enableMoving ?? true
                          }
                        )
                      },
                      column
                    );
                  })
                ]
              }
            ) }),
            hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
              ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
                import_components16.Composite,
                {
                  virtualFocus: true,
                  orientation: "vertical",
                  render: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("tbody", { role: "group" }),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                      "tr",
                      {
                        className: "dataviews-view-table__group-header-row",
                        role: "presentation",
                        children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                          "td",
                          {
                            colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + 1,
                            className: "dataviews-view-table__group-header-cell",
                            role: "presentation",
                            children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n33.sprintf)(
                              // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                              (0, import_i18n33.__)("%1$s: %2$s"),
                              groupField.label,
                              groupName
                            )
                          }
                        )
                      }
                    ),
                    groupItems.map((item, index2) => {
                      const id = getItemId(item) || index2.toString();
                      return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                        TableRow2,
                        {
                          item,
                          fields,
                          id,
                          view,
                          titleField,
                          mediaField,
                          descriptionField: descriptionField2,
                          selection,
                          getItemId,
                          onChangeSelection,
                          selectionProps: getSelectionProps(
                            id
                          )
                        },
                        getItemId(item)
                      );
                    })
                  ]
                },
                `group-${groupName}`
              )
            ) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
              import_components16.Composite,
              {
                render: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("tbody", { role: "presentation" }),
                virtualFocus: true,
                orientation: "vertical",
                children: hasData && data.map((item, index2) => {
                  const itemId = getItemId(item);
                  const id = itemId || index2.toString();
                  const posinset = item.position;
                  return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
                    TableRow2,
                    {
                      item,
                      fields,
                      id,
                      view,
                      titleField,
                      mediaField,
                      descriptionField: descriptionField2,
                      selection,
                      getItemId,
                      onChangeSelection,
                      selectionProps: getSelectionProps(
                        id
                      ),
                      posinset
                    },
                    itemId
                  );
                })
              }
            )
          ]
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
        "div",
        {
          className: clsx_default({
            "dataviews-loading": isLoading,
            "dataviews-no-results": !hasData && !isLoading
          }),
          id: tableNoticeId,
          children: [
            !hasData && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_components16.Spinner, {}) }) : empty),
            hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_components16.Spinner, {}) })
          ]
        }
      )
    ] });
  }
  var picker_table_default = ViewPickerTable;

  // packages/dataviews/build-module/components/dataviews-layouts/picker-activity/index.mjs
  var import_components17 = __toESM(require_components(), 1);
  var import_element94 = __toESM(require_element(), 1);
  var import_compose11 = __toESM(require_compose(), 1);
  var import_i18n34 = __toESM(require_i18n(), 1);
  var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1);
  function isDefined4(item) {
    return !!item;
  }
  function PickerActivityItem({
    view,
    selection,
    selectionProps,
    getItemId,
    item,
    titleField,
    mediaField,
    descriptionField: descriptionField2,
    otherFields,
    posinset,
    setsize
  }) {
    const elementRef = (0, import_element94.useRef)(null);
    useIntersectionObserver(elementRef, posinset);
    const { showTitle = true, showMedia = true, showDescription = true } = view;
    const id = getItemId(item);
    const isSelected2 = selection.includes(id);
    const density = view.layout?.density ?? "balanced";
    const mediaContent = showMedia && density !== "compact" && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
      mediaField.render,
      {
        item,
        field: mediaField,
        config: {
          sizes: density === "comfortable" ? "32px" : "24px"
        }
      }
    ) : null;
    const renderedMediaField = /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "dataviews-view-picker-activity__item-type-icon", children: mediaContent || /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
      "span",
      {
        className: "dataviews-view-picker-activity__item-bullet",
        "aria-hidden": "true"
      }
    ) });
    const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(titleField.render, { item, field: titleField }) : null;
    const renderedDescriptionField = showDescription && descriptionField2?.render ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(descriptionField2.render, { item, field: descriptionField2 }) : null;
    const verticalGap = (0, import_element94.useMemo)(() => {
      switch (density) {
        case "comfortable":
          return "md";
        default:
          return "sm";
      }
    }, [density]);
    return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
      import_components17.Composite.Item,
      {
        ref: elementRef,
        role: "option",
        "aria-label": titleField ? titleField.getValue({ item }) || void 0 : void 0,
        "aria-posinset": posinset,
        "aria-setsize": setsize,
        "aria-selected": isSelected2,
        className: clsx_default(
          "dataviews-view-picker-activity__item",
          density === "compact" && "is-compact",
          density === "balanced" && "is-balanced",
          density === "comfortable" && "is-comfortable",
          isSelected2 && "is-selected"
        ),
        ...selectionProps,
        render: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", {}),
        children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(Stack, { direction: "row", gap: "lg", justify: "start", align: "flex-start", children: [
          /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
            Stack,
            {
              direction: "column",
              gap: "xs",
              align: "center",
              className: "dataviews-view-picker-activity__item-type",
              children: renderedMediaField
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
            Stack,
            {
              direction: "column",
              gap: verticalGap,
              align: "flex-start",
              className: "dataviews-view-picker-activity__item-content",
              children: [
                renderedTitleField && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "dataviews-view-picker-activity__item-title", children: renderedTitleField }),
                renderedDescriptionField && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "dataviews-view-picker-activity__item-description", children: renderedDescriptionField }),
                /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "dataviews-view-picker-activity__item-fields", children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
                  "div",
                  {
                    className: "dataviews-view-picker-activity__item-field",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
                        VisuallyHidden,
                        {
                          render: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", {}),
                          className: "dataviews-view-picker-activity__item-field-label",
                          children: field.label
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "dataviews-view-picker-activity__item-field-value", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
                        field.render,
                        {
                          item,
                          field
                        }
                      ) })
                    ]
                  },
                  field.id
                )) })
              ]
            }
          )
        ] })
      }
    );
  }
  function PickerActivityGroup({
    groupName,
    groupField,
    showLabel = true,
    children
  }) {
    const headerId = (0, import_compose11.useInstanceId)(
      PickerActivityGroup,
      "dataviews-view-picker-activity-group__header"
    );
    return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
      Stack,
      {
        direction: "column",
        role: "group",
        "aria-labelledby": headerId,
        className: "dataviews-view-picker-activity-group",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
            "h3",
            {
              className: "dataviews-view-picker-activity-group__header",
              id: headerId,
              children: showLabel ? (0, import_i18n34.sprintf)(
                // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                (0, import_i18n34.__)("%1$s: %2$s"),
                groupField.label,
                groupName
              ) : groupName
            }
          ),
          children
        ]
      }
    );
  }
  function ViewPickerActivity({
    data,
    fields,
    getItemId,
    isLoading,
    onChangeSelection,
    selection,
    view,
    actions,
    className,
    empty
  }) {
    const { itemListLabel, paginationInfo } = (0, import_element94.useContext)(dataviews_context_default);
    const isMultiselect = useIsMultiselectPicker(actions);
    const titleField = fields.find(
      (field) => field.id === view?.titleField
    );
    const mediaField = fields.find(
      (field) => field.id === view?.mediaField
    );
    const descriptionField2 = fields.find(
      (field) => field.id === view?.descriptionField
    );
    const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f) => fieldId === f.id)).filter(isDefined4);
    const groupField = view.groupBy?.field ? fields.find((f) => f.id === view.groupBy?.field) : null;
    const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
    const isInfiniteScroll = (view.infiniteScrollEnabled && !dataByGroup) ?? false;
    const setsize = isInfiniteScroll ? paginationInfo?.totalItems : void 0;
    const hasData = !!data?.length;
    const isGrouped = !!(groupField && dataByGroup);
    const orderedData = dataByGroup ? Array.from(dataByGroup.values()).flat() : data;
    const { getSelectionProps } = useSelectionProps({
      data: orderedData,
      getItemId,
      isItemSelectable: () => true,
      selection,
      onChangeSelection,
      selectionMode: isMultiselect ? "multi" : "single-clearable",
      shouldSelectOnClick: true
    });
    const renderItem = (item) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
      PickerActivityItem,
      {
        view,
        selection,
        selectionProps: getSelectionProps(getItemId(item)),
        getItemId,
        item,
        titleField,
        mediaField,
        descriptionField: descriptionField2,
        otherFields,
        posinset: item.position,
        setsize
      },
      getItemId(item)
    );
    if (!hasData) {
      return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
        "div",
        {
          className: clsx_default({
            "dataviews-loading": isLoading,
            "dataviews-no-results": !isLoading
          }),
          children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components17.Spinner, {}) }) : empty
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
        import_components17.Composite,
        {
          virtualFocus: true,
          orientation: "vertical",
          role: "listbox",
          "aria-multiselectable": isMultiselect,
          "aria-label": itemListLabel,
          "aria-busy": isLoading,
          render: isGrouped ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Stack, { direction: "column", gap: "sm" }) : void 0,
          className: clsx_default(
            "dataviews-view-picker-activity",
            className
          ),
          children: isGrouped && dataByGroup ? Array.from(dataByGroup.entries()).map(
            ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
              PickerActivityGroup,
              {
                groupName,
                groupField,
                showLabel: view.groupBy?.showLabel !== false,
                children: groupItems.map(renderItem)
              },
              groupName
            )
          ) : data.map(renderItem)
        }
      ),
      isLoading && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components17.Spinner, {}) })
    ] });
  }

  // packages/dataviews/build-module/components/dataviews-layouts/utils/density-picker.mjs
  var import_components18 = __toESM(require_components(), 1);
  var import_i18n35 = __toESM(require_i18n(), 1);
  var import_element95 = __toESM(require_element(), 1);
  var import_jsx_runtime138 = __toESM(require_jsx_runtime(), 1);
  function DensityPicker() {
    const context = (0, import_element95.useContext)(dataviews_context_default);
    const view = context.view;
    return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
      import_components18.__experimentalToggleGroupControl,
      {
        label: (0, import_i18n35.__)("Density"),
        value: view.layout?.density || "balanced",
        onChange: (value) => {
          context.onChangeView({
            ...view,
            layout: {
              ...view.layout,
              density: value
            }
          });
        },
        isBlock: true,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
            import_components18.__experimentalToggleGroupControlOption,
            {
              value: "comfortable",
              label: (0, import_i18n35._x)(
                "Comfortable",
                "Density option for DataView layout"
              )
            },
            "comfortable"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
            import_components18.__experimentalToggleGroupControlOption,
            {
              value: "balanced",
              label: (0, import_i18n35._x)("Balanced", "Density option for DataView layout")
            },
            "balanced"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
            import_components18.__experimentalToggleGroupControlOption,
            {
              value: "compact",
              label: (0, import_i18n35._x)("Compact", "Density option for DataView layout")
            },
            "compact"
          )
        ]
      }
    );
  }

  // packages/dataviews/build-module/components/dataviews-layouts/utils/media-fit-control.mjs
  var import_components19 = __toESM(require_components(), 1);
  var import_i18n36 = __toESM(require_i18n(), 1);
  var import_element96 = __toESM(require_element(), 1);
  var import_jsx_runtime139 = __toESM(require_jsx_runtime(), 1);
  function MediaFitControl() {
    const context = (0, import_element96.useContext)(dataviews_context_default);
    const view = context.view;
    if (!context.config?.mediaFitControl) {
      return null;
    }
    const hasMediaField = view.showMedia !== false && context.fields.some((field) => field.id === view.mediaField);
    if (!hasMediaField) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
      import_components19.ToggleControl,
      {
        label: (0, import_i18n36.__)("Original aspect ratio"),
        checked: view.layout?.mediaFit === "contain",
        onChange: (isChecked) => {
          context.onChangeView({
            ...view,
            layout: {
              ...view.layout,
              mediaFit: isChecked ? "contain" : "cover"
            }
          });
        }
      }
    );
  }

  // packages/dataviews/build-module/components/dataviews-layouts/utils/preview-size-picker.mjs
  var import_components20 = __toESM(require_components(), 1);
  var import_i18n37 = __toESM(require_i18n(), 1);
  var import_element97 = __toESM(require_element(), 1);
  var import_jsx_runtime140 = __toESM(require_jsx_runtime(), 1);
  var imageSizes2 = [
    {
      value: 120,
      breakpoint: 1
    },
    {
      value: 170,
      breakpoint: 1
    },
    {
      value: 230,
      breakpoint: 1
    },
    {
      value: 290,
      breakpoint: 1112
      // at minimum image width, 4 images display at this container size
    },
    {
      value: 350,
      breakpoint: 1636
      // at minimum image width, 6 images display at this container size
    },
    {
      value: 430,
      breakpoint: 588
      // at minimum image width, 2 images display at this container size
    }
  ];
  function PreviewSizePicker() {
    const context = (0, import_element97.useContext)(dataviews_context_default);
    const view = context.view;
    const breakValues = imageSizes2.filter((size4) => {
      return context.containerWidth >= size4.breakpoint;
    });
    const layoutPreviewSize = view.layout?.previewSize ?? 230;
    const previewSizeToUse = breakValues.map((size4, index2) => ({ ...size4, index: index2 })).filter((size4) => size4.value <= layoutPreviewSize).sort((a, b) => b.value - a.value)[0]?.index ?? 0;
    const marks = breakValues.map((size4, index2) => {
      return {
        value: index2
      };
    });
    return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
      import_components20.RangeControl,
      {
        showTooltip: false,
        label: (0, import_i18n37.__)("Preview size"),
        value: previewSizeToUse,
        min: 0,
        max: breakValues.length - 1,
        withInputField: false,
        onChange: (value = 0) => {
          context.onChangeView({
            ...view,
            layout: {
              ...view.layout,
              previewSize: breakValues[value].value
            }
          });
        },
        step: 1,
        marks
      }
    );
  }

  // packages/dataviews/build-module/components/dataviews-layouts/utils/grid-config-options.mjs
  var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1);
  function GridConfigOptions() {
    return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(import_jsx_runtime141.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(DensityPicker, {}),
      /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(MediaFitControl, {}),
      /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(PreviewSizePicker, {})
    ] });
  }

  // packages/dataviews/build-module/components/dataviews-layouts/index.mjs
  var VIEW_LAYOUTS = [
    {
      type: LAYOUT_TABLE,
      label: (0, import_i18n38.__)("Table"),
      component: table_default,
      icon: block_table_default,
      viewConfigOptions: DensityPicker
    },
    {
      type: LAYOUT_GRID,
      label: (0, import_i18n38.__)("Grid"),
      component: grid_default,
      icon: category_default,
      viewConfigOptions: GridConfigOptions
    },
    {
      type: LAYOUT_LIST,
      label: (0, import_i18n38.__)("List"),
      component: ViewList,
      icon: (0, import_i18n38.isRTL)() ? format_list_bullets_rtl_default : format_list_bullets_default,
      viewConfigOptions: DensityPicker
    },
    {
      type: LAYOUT_ACTIVITY,
      label: (0, import_i18n38.__)("Activity"),
      component: ViewActivity,
      icon: scheduled_default,
      viewConfigOptions: DensityPicker
    },
    {
      type: LAYOUT_PICKER_GRID,
      label: (0, import_i18n38.__)("Grid"),
      component: picker_grid_default,
      icon: category_default,
      viewConfigOptions: GridConfigOptions,
      isPicker: true
    },
    {
      type: LAYOUT_PICKER_TABLE,
      label: (0, import_i18n38.__)("Table"),
      component: picker_table_default,
      icon: block_table_default,
      viewConfigOptions: DensityPicker,
      isPicker: true
    },
    {
      type: LAYOUT_PICKER_ACTIVITY,
      label: (0, import_i18n38.__)("Activity"),
      component: ViewPickerActivity,
      icon: scheduled_default,
      viewConfigOptions: DensityPicker,
      isPicker: true
    }
  ];

  // packages/dataviews/build-module/components/dataviews-filters/filters.mjs
  var import_element105 = __toESM(require_element(), 1);

  // packages/dataviews/build-module/components/dataviews-filters/filter.mjs
  var import_components23 = __toESM(require_components(), 1);
  var import_i18n41 = __toESM(require_i18n(), 1);
  var import_element102 = __toESM(require_element(), 1);

  // node_modules/@ariakit/react-components/dist/button/utils.js
  function withDefaultButtonType(props) {
    const { render: render4, type } = props;
    if (render4 || type !== void 0) return props;
    return {
      ...props,
      type: "button"
    };
  }

  // node_modules/@ariakit/react-components/dist/focusable/focusable-context.js
  var import_react46 = __toESM(require_react(), 1);
  var FocusableContext = (0, import_react46.createContext)(true);

  // node_modules/@ariakit/utils/dist/index.js
  function toArray(arg) {
    if (Array.isArray(arg)) return arg;
    return typeof arg !== "undefined" ? [arg] : [];
  }
  function flatten2DArray(array) {
    const flattened = [];
    for (const row of array) flattened.push(...row);
    return flattened;
  }
  function reverseArray(array) {
    return array.slice().reverse();
  }
  function noop5(..._) {
  }
  function applyState(argument, currentValue) {
    if (isUpdater(argument)) return argument(isLazyValue(currentValue) ? currentValue() : currentValue);
    return argument;
  }
  function isUpdater(argument) {
    return typeof argument === "function";
  }
  function isLazyValue(value) {
    return typeof value === "function";
  }
  function hasOwnProperty(object, prop) {
    if (typeof Object.hasOwn === "function") return Object.hasOwn(object, prop);
    return Object.prototype.hasOwnProperty.call(object, prop);
  }
  function chain(...fns) {
    return (...args) => {
      for (const fn of fns) if (typeof fn === "function") fn(...args);
    };
  }
  function normalizeString(str) {
    return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
  }
  function omit(object, keys) {
    const result = { ...object };
    for (const key of keys) if (hasOwnProperty(result, key)) delete result[key];
    return result;
  }
  function pick(object, paths) {
    const result = {};
    for (const key of paths) if (hasOwnProperty(object, key)) result[key] = object[key];
    return result;
  }
  function identity(value) {
    return value;
  }
  function afterPaint(cb = noop5) {
    let raf = requestAnimationFrame(() => {
      raf = requestAnimationFrame(cb);
    });
    return () => cancelAnimationFrame(raf);
  }
  var defaultWarnOnceKey = {};
  var warningMessages = /* @__PURE__ */ new WeakMap();
  function warnOnce(message2, key) {
    const warningKey = key || defaultWarnOnceKey;
    let messages = warningMessages.get(warningKey);
    if (!messages) {
      messages = /* @__PURE__ */ new Set();
      warningMessages.set(warningKey, messages);
    }
    if (messages.has(message2)) return;
    messages.add(message2);
    console.warn(message2);
  }
  function invariant(condition, message2) {
    if (condition) return;
    if (typeof message2 !== "string") throw new Error("Invariant failed");
    throw new Error(message2);
  }
  function getKeys(obj) {
    return Object.keys(obj);
  }
  function isFalsyBooleanCallback(booleanOrCallback, ...args) {
    const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
    if (result == null) return false;
    return !result;
  }
  function disabledFromProps(props) {
    return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
  }
  function removeUndefinedValues(obj) {
    const result = {};
    for (const key in obj) {
      if (!hasOwnProperty(obj, key)) continue;
      if (key === "__proto__") continue;
      if (obj[key] !== void 0) result[key] = obj[key];
    }
    return result;
  }
  function defaultValue(...values) {
    for (const value of values) if (value !== void 0) return value;
  }
  var canUseDOM = checkIsBrowser();
  function checkIsBrowser() {
    return typeof window !== "undefined" && !!window.document?.createElement;
  }
  function lookupGetter(prototype, name) {
    let target = prototype;
    while (target) {
      const descriptor = Object.getOwnPropertyDescriptor(target, name);
      if (descriptor?.get) return descriptor.get;
      target = Object.getPrototypeOf(target);
    }
  }
  var nodeTypeGetter = canUseDOM ? lookupGetter(Object.getPrototypeOf(window.document), "nodeType") : void 0;
  var activeElementGetter = canUseDOM ? lookupGetter(Object.getPrototypeOf(window.document), "activeElement") : void 0;
  function isWindow(value) {
    if (!value) return false;
    return value.window === value;
  }
  function isDocument(value) {
    if (!value) return false;
    if (!nodeTypeGetter) return value.nodeType === 9;
    try {
      return nodeTypeGetter.call(value) === 9;
    } catch {
      return false;
    }
  }
  function ownsDocument(view, ownerDocument2) {
    try {
      return view.document === ownerDocument2;
    } catch {
      return false;
    }
  }
  function getDocument(node) {
    if (!node) return document;
    if (isDocument(node)) return node;
    if (isWindow(node)) return node.document;
    const nodeDocument = node.ownerDocument;
    if (isDocument(nodeDocument)) return nodeDocument;
    return document;
  }
  function getWindow2(node) {
    if (!node) return self;
    if (isWindow(node)) return node;
    const nodeDocument = getDocument(node);
    const { defaultView: defaultView2 } = nodeDocument;
    if (isWindow(defaultView2) && ownsDocument(defaultView2, nodeDocument)) return defaultView2;
    return window;
  }
  function getActiveElement(node, { frame = true, activeDescendant = false } = {}) {
    const ownerDocument2 = getDocument(node);
    const activeElement2 = activeElementGetter ? activeElementGetter.call(ownerDocument2) : ownerDocument2.activeElement;
    if (!activeElement2?.nodeName) return null;
    if (frame && isFrame(activeElement2) && activeElement2.contentDocument?.body) return getActiveElement(activeElement2.contentDocument.body, {
      frame,
      activeDescendant
    });
    if (activeDescendant) {
      const id = activeElement2.getAttribute("aria-activedescendant");
      if (id) {
        const element = getDocument(activeElement2).getElementById(id);
        if (element) return element;
      }
    }
    return activeElement2;
  }
  function contains2(parent, child) {
    return parent === child || parent.contains(child);
  }
  function isElement2(target) {
    return target?.nodeType === 1;
  }
  function isNode2(target) {
    return typeof target?.nodeType === "number";
  }
  function isFrame(element) {
    return element.tagName === "IFRAME";
  }
  function isButton(element) {
    const tagName = element.tagName.toLowerCase();
    if (tagName === "button") return true;
    if (tagName === "input" && element.type) return buttonInputTypes.indexOf(element.type) !== -1;
    return false;
  }
  var buttonInputTypes = [
    "button",
    "color",
    "file",
    "image",
    "reset",
    "submit"
  ];
  function isVisible(element) {
    if (typeof element.checkVisibility === "function") return element.checkVisibility();
    const htmlElement = element;
    return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
  }
  function isTextField(element) {
    try {
      if (element.tagName === "TEXTAREA") return true;
      if (element.tagName !== "INPUT") return false;
      return element.selectionStart !== null;
    } catch (_error) {
      return false;
    }
  }
  function isTextbox(element) {
    return element.isContentEditable || isTextField(element);
  }
  function getTextboxValue(element) {
    if (isTextField(element)) return element.value;
    if (element.isContentEditable) {
      const range = getDocument(element).createRange();
      range.selectNodeContents(element);
      return range.toString();
    }
    return "";
  }
  function getTextboxSelection(element) {
    let start = 0;
    let end = 0;
    if (isTextField(element)) {
      start = element.selectionStart || 0;
      end = element.selectionEnd || 0;
    } else if (element.isContentEditable) {
      const selection = getDocument(element).getSelection();
      if (selection?.rangeCount && selection.anchorNode && contains2(element, selection.anchorNode) && selection.focusNode && contains2(element, selection.focusNode)) {
        const range = selection.getRangeAt(0);
        const nextRange = range.cloneRange();
        nextRange.selectNodeContents(element);
        nextRange.setEnd(range.startContainer, range.startOffset);
        start = nextRange.toString().length;
        nextRange.setEnd(range.endContainer, range.endOffset);
        end = nextRange.toString().length;
      }
    }
    return {
      start,
      end
    };
  }
  var allowedPopupRoles = [
    "dialog",
    "menu",
    "listbox",
    "tree",
    "grid"
  ];
  var itemRoleByPopupRole = {
    menu: "menuitem",
    listbox: "option",
    tree: "treeitem"
  };
  function getPopupRole(element, fallback) {
    const role = element?.getAttribute("role");
    if (role && allowedPopupRoles.indexOf(role) !== -1) return role;
    return fallback;
  }
  function getItemRoleByPopupRole(popupRole) {
    if (popupRole == null) return;
    if (!hasOwnProperty(itemRoleByPopupRole, popupRole)) return;
    return itemRoleByPopupRole[popupRole];
  }
  function getScrollingElement(element) {
    if (!element) return null;
    const isScrollableOverflow = (overflow) => {
      if (overflow === "auto") return true;
      if (overflow === "scroll") return true;
      return false;
    };
    if (element.clientHeight && element.scrollHeight > element.clientHeight) {
      const { overflowY } = getComputedStyle(element);
      if (isScrollableOverflow(overflowY)) return element;
    } else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
      const { overflowX } = getComputedStyle(element);
      if (isScrollableOverflow(overflowX)) return element;
    }
    const doc = getDocument(element);
    return getScrollingElement(element.parentElement) || doc.scrollingElement || doc.body;
  }
  function setSelectionRange(element, ...args) {
    if (/text|search|password|tel|url/i.test(element.type)) element.setSelectionRange(...args);
  }
  function sortBasedOnDOMPosition(items, getElement) {
    const pairs = items.map((item, index2) => [index2, item]);
    let isOrderDifferent = false;
    pairs.sort(([indexA, a], [indexB, b]) => {
      const elementA = getElement(a);
      const elementB = getElement(b);
      if (elementA === elementB) return 0;
      if (!elementA || !elementB) return 0;
      if (isElementPreceding(elementA, elementB)) {
        if (indexA > indexB) isOrderDifferent = true;
        return -1;
      }
      if (indexA < indexB) isOrderDifferent = true;
      return 1;
    });
    if (isOrderDifferent) return pairs.map(([_, item]) => item);
    return items;
  }
  function isElementPreceding(a, b) {
    return Boolean(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);
  }
  function isTouchDevice() {
    return canUseDOM && !!navigator.maxTouchPoints;
  }
  function isApple() {
    if (!canUseDOM) return false;
    return /mac|iphone|ipad|ipod/i.test(navigator.platform);
  }
  function isSafari() {
    return canUseDOM && isApple() && /apple/i.test(navigator.vendor);
  }
  function isFirefox() {
    return canUseDOM && /firefox\//i.test(navigator.userAgent);
  }
  function isPortalEvent(event) {
    const { currentTarget, target } = event;
    if (!currentTarget) return false;
    if (!isNode2(target)) return true;
    return !contains2(currentTarget, target);
  }
  function isSelfTarget(event) {
    return event.target === event.currentTarget;
  }
  function isActivatableNavigationTarget(element) {
    if (!isElement2(element)) return false;
    const target = element;
    const tagName = target.tagName.toLowerCase();
    if (tagName === "a") return true;
    if (tagName === "button" && target.type === "submit") return true;
    if (tagName === "input" && target.type === "submit") return true;
    return false;
  }
  function isOpeningInNewTab(event) {
    const isAppleDevice = isApple();
    if (isAppleDevice && !event.metaKey) return false;
    if (!isAppleDevice && !event.ctrlKey) return false;
    return isActivatableNavigationTarget(event.currentTarget);
  }
  function isDownloading(event) {
    if (!event.altKey) return false;
    return isActivatableNavigationTarget(event.currentTarget);
  }
  function fireBlurEvent(element, eventInit) {
    const { FocusEvent } = getWindow2(element);
    const event = new FocusEvent("blur", eventInit);
    const defaultAllowed = element.dispatchEvent(event);
    const bubbleInit = {
      ...eventInit,
      bubbles: true
    };
    element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
    return defaultAllowed;
  }
  function fireKeyboardEvent(element, type, eventInit) {
    const { KeyboardEvent } = getWindow2(element);
    const event = new KeyboardEvent(type, eventInit);
    return element.dispatchEvent(event);
  }
  var resetAttributes = {
    width: true,
    height: true,
    pressure: true,
    tangentialPressure: true,
    tiltX: true,
    tiltY: true,
    twist: true,
    altitudeAngle: true,
    azimuthAngle: true,
    isPrimary: true,
    coalescedEvents: true,
    predictedEvents: true,
    persistentDeviceId: true
  };
  function getClickEventInit(view, eventInit) {
    const init2 = eventInit ?? {};
    return new Proxy({}, { get(_target, key) {
      if (key === "view") return view;
      if (key === "composed") return true;
      if (key === "pointerId") return init2.pointerId ?? -1;
      if (key === "pointerType") return init2.pointerType ?? "";
      if (hasOwnProperty(resetAttributes, key)) return void 0;
      return Reflect.get(init2, key);
    } });
  }
  function fireClickEvent(element, eventInit) {
    const view = getWindow2(element);
    const event = new (view.PointerEvent ?? view.MouseEvent)("click", getClickEventInit(view, eventInit));
    return element.dispatchEvent(event);
  }
  function isFocusEventOutside(event, container) {
    const containerElement = container || event.currentTarget;
    const relatedTarget = event.relatedTarget;
    return !isNode2(relatedTarget) || !contains2(containerElement, relatedTarget);
  }
  function isInputEvent(event) {
    return event.type === "input";
  }
  function queueBeforeEvent(element, type, callback, timeout) {
    const createTimer = (callback2) => {
      if (timeout) {
        const timerId2 = setTimeout(callback2, timeout);
        return () => clearTimeout(timerId2);
      }
      const timerId = requestAnimationFrame(callback2);
      return () => cancelAnimationFrame(timerId);
    };
    const cancelTimer = createTimer(() => {
      element.removeEventListener(type, callSync, true);
      callback();
    });
    const callSync = () => {
      cancelTimer();
      callback();
    };
    element.addEventListener(type, callSync, {
      once: true,
      capture: true
    });
    return () => {
      cancelTimer();
      element.removeEventListener(type, callSync, true);
    };
  }
  function addGlobalEventListener(type, listener, options, scope = window) {
    const children = [];
    try {
      scope.document.addEventListener(type, listener, options);
      for (const frame of Array.from(scope.frames)) children.push(addGlobalEventListener(type, listener, options, frame));
    } catch {
    }
    const removeEventListener = () => {
      try {
        scope.document.removeEventListener(type, listener, options);
      } catch {
      }
      for (const remove of children) remove();
    };
    return removeEventListener;
  }
  var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
  function isFocusable(element) {
    if (!element.matches(selector)) return false;
    if (!isVisible(element)) return false;
    if (element.closest("[inert]")) return false;
    return true;
  }
  function hasFocus(element) {
    const activeElement2 = getActiveElement(element);
    if (!activeElement2) return false;
    if (activeElement2 === element) return true;
    const activeDescendant = activeElement2.getAttribute("aria-activedescendant");
    if (!activeDescendant) return false;
    return activeDescendant === element.id;
  }
  function hasFocusWithin(element) {
    const activeElement2 = getActiveElement(element);
    if (!activeElement2) return false;
    if (contains2(element, activeElement2)) return true;
    const activeDescendant = activeElement2.getAttribute("aria-activedescendant");
    if (!activeDescendant) return false;
    if (!("id" in element)) return false;
    if (activeDescendant === element.id) return true;
    return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
  }
  function createUndoCallback(callback) {
    return async () => {
      const redo = await callback?.();
      return createUndoCallback(async () => {
        await redo?.();
        return callback;
      });
    };
  }
  var UndoManager = createUndoManager();
  function createUndoManager({ limit = 100 } = {}) {
    const undoStack = [];
    let redoStack = [];
    let currentGroup = null;
    const canUndo = () => undoStack.length > 0;
    const canRedo = () => redoStack.length > 0;
    const undo = async () => {
      if (!canUndo()) return;
      currentGroup = null;
      redoStack.push(await undoStack.pop()?.());
    };
    const redo = async () => {
      if (!canRedo()) return;
      currentGroup = null;
      undoStack.push(await redoStack.pop()?.());
    };
    const execute = async (callback, group) => {
      if (!callback) return;
      const sameGroup = group === currentGroup;
      currentGroup = group ?? null;
      const nextIndex = sameGroup ? Math.max(0, undoStack.length - 1) : undoStack.length;
      const undoCallback = await callback();
      if (!undoCallback) return;
      redoStack = [];
      const currentUndo = undoStack[nextIndex];
      undoStack[nextIndex] = createUndoCallback(async () => {
        await undoCallback?.();
        const currentRedo = await currentUndo?.();
        return async () => {
          await currentRedo?.();
          await callback?.();
        };
      });
      while (undoStack.length > limit) undoStack.shift();
    };
    return {
      canUndo,
      canRedo,
      undo,
      redo,
      execute
    };
  }

  // node_modules/@ariakit/react-utils/dist/index.js
  var React145 = __toESM(require_react(), 1);
  var import_react47 = __toESM(require_react(), 1);
  var import_jsx_runtime142 = __toESM(require_jsx_runtime(), 1);
  function setRef(ref, value) {
    if (typeof ref === "function") {
      const cleanup = ref(value);
      if (typeof cleanup === "function") return cleanup;
    } else if (ref) ref.current = value;
  }
  function isValidElementWithRef(element) {
    if (!element) return false;
    if (!(0, import_react47.isValidElement)(element)) return false;
    if ("ref" in element.props) return true;
    if ("ref" in element) return true;
    return false;
  }
  function getRefProperty(element) {
    if (!isValidElementWithRef(element)) return null;
    return { ...element.props }.ref || element.ref;
  }
  function mergeProps2(base, overrides) {
    const props = { ...base };
    for (const key in overrides) {
      if (!hasOwnProperty(overrides, key)) continue;
      if (key === "__proto__") continue;
      if (key === "className") {
        const prop = "className";
        const baseClass = base[prop];
        const overrideClass = overrides[prop];
        if (baseClass && overrideClass) props[prop] = `${baseClass} ${overrideClass}`;
        else props[prop] = overrideClass || baseClass;
        continue;
      }
      if (key === "style") {
        const prop = "style";
        props[prop] = base[prop] ? {
          ...base[prop],
          ...overrides[prop]
        } : overrides[prop];
        continue;
      }
      const overrideValue = overrides[key];
      if (overrideValue === void 0) continue;
      if (key.startsWith("on")) {
        if (typeof overrideValue !== "function") continue;
        const baseValue = base[key];
        if (typeof baseValue === "function") {
          props[key] = (...args) => {
            overrideValue(...args);
            baseValue(...args);
          };
          continue;
        }
      }
      props[key] = overrideValue;
    }
    return props;
  }
  var _React = { ...React145 };
  var useReactId = _React.useId;
  var useReactDeferredValue = _React.useDeferredValue;
  var useEventUpdate = _React.useInsertionEffect ?? ((callback) => callback());
  var useSafeLayoutEffect = canUseDOM ? import_react47.useLayoutEffect : import_react47.useEffect;
  function useInitialValue(value) {
    const [initialValue] = (0, import_react47.useState)(value);
    return initialValue;
  }
  function useLiveRef(value) {
    const ref = (0, import_react47.useRef)(value);
    useSafeLayoutEffect(() => {
      ref.current = value;
    });
    return ref;
  }
  function useEvent(callback) {
    const ref = (0, import_react47.useRef)(() => {
      throw new Error("Cannot call an event handler while rendering.");
    });
    useEventUpdate(() => {
      ref.current = callback;
    });
    return (0, import_react47.useCallback)((...args) => ref.current?.(...args), []);
  }
  function useTransactionState(callback) {
    const [state, setState] = (0, import_react47.useState)(null);
    useSafeLayoutEffect(() => {
      if (state == null) return;
      if (!callback) return;
      let prevState = null;
      callback((prev) => {
        prevState = prev;
        return state;
      });
      return () => {
        callback(prevState);
      };
    }, [state, callback]);
    return [state, setState];
  }
  function useMergeRefs5(...refs) {
    return (0, import_react47.useMemo)(() => {
      if (!refs.some(Boolean)) return;
      return (value) => {
        const refEffects = [];
        for (const ref of refs) {
          if (!ref) continue;
          const cleanup = setRef(ref, value);
          refEffects.push({
            ref,
            cleanup: typeof cleanup === "function" ? cleanup : void 0
          });
        }
        if (!refEffects.some((effect) => effect.cleanup)) return;
        return () => {
          for (const { ref, cleanup } of refEffects) if (cleanup) cleanup();
          else setRef(ref, null);
        };
      };
    }, refs);
  }
  function useIdPolyfill(defaultId) {
    const [id, setId] = (0, import_react47.useState)(defaultId);
    useSafeLayoutEffect(() => {
      if (defaultId || id) return;
      const random = Math.random().toString(36).slice(2, 8);
      setId(`id-${random}`);
    }, [defaultId, id]);
    return defaultId || id;
  }
  function useReactIdWithDefault(defaultId) {
    const id = useReactId();
    return defaultId || id;
  }
  var useCompatibleId = useReactId ? useReactIdWithDefault : useIdPolyfill;
  function useId7(defaultId) {
    return useCompatibleId(defaultId);
  }
  function useAttribute(refOrElement, attributeName, defaultValue2) {
    const initialValue = useInitialValue(defaultValue2);
    const [attribute, setAttribute] = (0, import_react47.useState)(initialValue);
    (0, import_react47.useEffect)(() => {
      const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
      if (!element) return;
      const callback = () => {
        const value = element.getAttribute(attributeName);
        setAttribute(value == null ? initialValue : value);
      };
      const observer = new MutationObserver(callback);
      observer.observe(element, { attributeFilter: [attributeName] });
      callback();
      return () => observer.disconnect();
    }, [
      refOrElement,
      attributeName,
      initialValue
    ]);
    return attribute;
  }
  function useUpdateEffect(effect, deps) {
    const mounted = (0, import_react47.useRef)(false);
    (0, import_react47.useEffect)(() => {
      if (mounted.current) return effect();
      mounted.current = true;
    }, deps);
    (0, import_react47.useEffect)(() => () => {
      mounted.current = false;
    }, []);
  }
  function useUpdateLayoutEffect(effect, deps) {
    const mounted = (0, import_react47.useRef)(false);
    useSafeLayoutEffect(() => {
      if (mounted.current) return effect();
      mounted.current = true;
    }, deps);
    useSafeLayoutEffect(() => () => {
      mounted.current = false;
    }, []);
  }
  function useForceUpdate() {
    return (0, import_react47.useReducer)(() => [], []);
  }
  function useBooleanEvent(booleanOrCallback) {
    return useEvent(typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback);
  }
  function useWrapElement(props, callback, deps = []) {
    const wrapElement = (0, import_react47.useCallback)((element) => {
      if (props.wrapElement) element = props.wrapElement(element);
      return callback(element);
    }, [...deps, props.wrapElement]);
    return {
      ...props,
      wrapElement
    };
  }
  function useMetadataProps(props, key, value) {
    const parent = props.onLoadedMetadataCapture;
    const onLoadedMetadataCapture = (0, import_react47.useMemo)(() => {
      return Object.assign(() => {
      }, parent, ...value !== void 0 ? [{ [key]: value }] : []);
    }, [
      parent,
      key,
      value
    ]);
    return [parent?.[key], { onLoadedMetadataCapture }];
  }
  var hasInstalledGlobalEventListeners = false;
  function useIsMouseMoving() {
    (0, import_react47.useEffect)(() => {
      if (hasInstalledGlobalEventListeners) return;
      addGlobalEventListener("mousemove", setMouseMoving, true);
      addGlobalEventListener("mousedown", resetMouseMoving, true);
      addGlobalEventListener("mouseup", resetMouseMoving, true);
      addGlobalEventListener("keydown", resetMouseMoving, true);
      addGlobalEventListener("scroll", resetMouseMoving, true);
      hasInstalledGlobalEventListeners = true;
    }, []);
    return useEvent(() => mouseMoving);
  }
  var mouseMoving = false;
  var previousScreenX = 0;
  var previousScreenY = 0;
  function hasMouseMovement(event) {
    const movementX = event.movementX || event.screenX - previousScreenX;
    const movementY = event.movementY || event.screenY - previousScreenY;
    previousScreenX = event.screenX;
    previousScreenY = event.screenY;
    return movementX || movementY || false;
  }
  function setMouseMoving(event) {
    if (!hasMouseMovement(event)) return;
    mouseMoving = true;
  }
  function resetMouseMoving() {
    mouseMoving = false;
  }
  function forwardRef89(render4) {
    const Role = React145.forwardRef((props, ref) => render4(removeUndefinedValues({
      ...props,
      ref
    })));
    Role.displayName = render4.displayName || render4.name;
    return Role;
  }
  function memo4(Component2, propsAreEqual) {
    return React145.memo(Component2, propsAreEqual);
  }
  function createElement3(Type, props) {
    const { wrapElement, render: render4, ...rest } = props;
    const mergedRef = useMergeRefs5(props.ref, getRefProperty(render4));
    let element;
    if (React145.isValidElement(render4)) {
      const renderProps = {
        ...render4.props,
        ref: mergedRef
      };
      element = React145.cloneElement(render4, mergeProps2(rest, renderProps));
    } else if (render4) element = render4(rest);
    else element = /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(Type, { ...rest });
    if (wrapElement) return wrapElement(element);
    return element;
  }
  function createHook(useProps) {
    const useRole = (props = {}) => {
      return useProps(props);
    };
    useRole.displayName = useProps.name;
    return useRole;
  }
  function createStoreContext(providers = [], scopedProviders = []) {
    const context = React145.createContext(void 0);
    const scopedContext = React145.createContext(void 0);
    const useContext60 = () => React145.useContext(context);
    const useScopedContext = (onlyScoped = false) => {
      const scoped = React145.useContext(scopedContext);
      const store = useContext60();
      if (onlyScoped) return scoped;
      return scoped || store;
    };
    const useProviderContext = () => {
      const scoped = React145.useContext(scopedContext);
      const store = useContext60();
      if (scoped && scoped === store) return;
      return store;
    };
    const ContextProvider = (props) => {
      return providers.reduceRight((children, Provider2) => /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(Provider2, {
        ...props,
        children
      }), /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(context.Provider, { ...props }));
    };
    const ScopedContextProvider = (props) => {
      return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(ContextProvider, {
        ...props,
        children: scopedProviders.reduceRight((children, Provider2) => /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(Provider2, {
          ...props,
          children
        }), /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(scopedContext.Provider, { ...props }))
      });
    };
    return {
      context,
      scopedContext,
      useContext: useContext60,
      useScopedContext,
      useProviderContext,
      ContextProvider,
      ScopedContextProvider
    };
  }

  // node_modules/@ariakit/react-components/dist/__chunks/CcVRFmzE.js
  var import_react48 = __toESM(require_react(), 1);
  var accessibleWhenDisabledSymbol = /* @__PURE__ */ Symbol("accessibleWhenDisabled");
  function accessibleWhenDisabledFromProps(props) {
    return props.accessibleWhenDisabled ?? props.onLoadedMetadataCapture?.[accessibleWhenDisabledSymbol];
  }
  var trulyDisabledAttribute = "data-truly-disabled";
  function resolvedTrulyDisabledFromElement(element) {
    const value = element.getAttribute(trulyDisabledAttribute);
    if (value === "true") return true;
    if (value === "false") return false;
  }
  function isCompositeMoveKey(key) {
    return key === "ArrowUp" || key === "ArrowRight" || key === "ArrowDown" || key === "ArrowLeft" || key === "Home" || key === "End" || key === "PageUp" || key === "PageDown";
  }
  var TagName = "div";
  var isSafariBrowser = isSafari();
  var nativeTabbableMask = 1;
  var supportsDisabledMask = 2;
  var defaultElementCapabilities = 3;
  var alwaysFocusVisibleInputTypes = [
    "text",
    "search",
    "url",
    "tel",
    "email",
    "password",
    "number",
    "date",
    "month",
    "week",
    "time",
    "datetime",
    "datetime-local"
  ];
  function isAlwaysFocusVisible(element) {
    const { tagName, readOnly, type } = element;
    if (tagName === "TEXTAREA" && !readOnly) return true;
    if (tagName === "SELECT" && !readOnly) return true;
    if (tagName === "INPUT" && !readOnly) return alwaysFocusVisibleInputTypes.includes(type);
    if (element.isContentEditable) return true;
    if (element.getAttribute("role") === "combobox" && element.dataset.name) return true;
    return false;
  }
  function isNativeTabbable(tagName) {
    if (!tagName) return true;
    return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
  }
  function supportsDisabledAttribute(tagName) {
    if (!tagName) return true;
    return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
  }
  function getElementCapabilities(tagName) {
    let capabilities = 0;
    if (isNativeTabbable(tagName)) capabilities |= nativeTabbableMask;
    if (supportsDisabledAttribute(tagName)) capabilities |= supportsDisabledMask;
    return capabilities;
  }
  function isNativeSubmitControl(element) {
    if (element.tagName === "BUTTON") {
      const { type } = element;
      return type === "submit";
    }
    if (element.tagName === "INPUT") {
      const { type } = element;
      return type === "submit" || type === "image";
    }
    return false;
  }
  function getTabIndex2({ focusable: focusable2, trulyDisabled, nativeTabbable, supportsDisabled, safariTabIndex, tabIndexProp }) {
    if (!focusable2) return tabIndexProp;
    if (trulyDisabled) {
      if (nativeTabbable && !supportsDisabled) return -1;
      return;
    }
    if (nativeTabbable) {
      if (safariTabIndex && tabIndexProp == null) return 0;
      return tabIndexProp;
    }
    return tabIndexProp ?? 0;
  }
  function useDisableEvent(onEvent, disabled2) {
    return useEvent((event) => {
      onEvent?.(event);
      if (event.defaultPrevented) return;
      if (disabled2) {
        event.stopPropagation();
        event.preventDefault();
      }
    });
  }
  var hasInstalledGlobalEventListeners2 = false;
  var isKeyboardModality = true;
  function onGlobalMouseDown(event) {
    const target = event.target;
    if (isElement2(target) && !target.hasAttribute("data-focus-visible")) isKeyboardModality = false;
  }
  function onGlobalKeyDown(event) {
    if (isCompositeMoveKey(event.key)) {
      isKeyboardModality = true;
      return;
    }
    if (event.metaKey) return;
    if (event.ctrlKey) return;
    if (event.altKey) {
      if (!isSafariBrowser) return;
      if (event.key !== "Tab") return;
    }
    isKeyboardModality = true;
  }
  var useFocusable = createHook(function useFocusable2({ focusable: focusable2 = true, accessibleWhenDisabled, autoFocus, onFocusVisible, ...props }) {
    const ref = (0, import_react48.useRef)(null);
    const [parentAccessibleWhenDisabled, metadataProps] = useMetadataProps(props, accessibleWhenDisabledSymbol, accessibleWhenDisabled);
    accessibleWhenDisabled ??= parentAccessibleWhenDisabled;
    (0, import_react48.useEffect)(() => {
      if (!focusable2) return;
      if (hasInstalledGlobalEventListeners2) return;
      addGlobalEventListener("mousedown", onGlobalMouseDown, true);
      addGlobalEventListener("keydown", onGlobalKeyDown, true);
      hasInstalledGlobalEventListeners2 = true;
    }, [focusable2]);
    const disabled2 = focusable2 && disabledFromProps(props);
    const trulyDisabled = disabled2 && !accessibleWhenDisabled;
    const [focusVisible, setFocusVisible] = (0, import_react48.useState)(false);
    const focusVisibleRef = (0, import_react48.useRef)(false);
    const nativeSubmitObserverCleanupRef = (0, import_react48.useRef)(null);
    const cleanupFocusVisible = useEvent((element) => {
      nativeSubmitObserverCleanupRef.current?.();
      nativeSubmitObserverCleanupRef.current = null;
      focusVisibleRef.current = false;
      element?.removeAttribute("data-focus-visible");
    });
    (0, import_react48.useEffect)(() => {
      if (focusable2 && !trulyDisabled) return;
      cleanupFocusVisible(ref.current);
      if (focusVisible) setFocusVisible(false);
    }, [
      focusable2,
      trulyDisabled,
      focusVisible,
      cleanupFocusVisible
    ]);
    (0, import_react48.useEffect)(() => {
      if (!focusable2) return;
      if (!focusVisible) return;
      const element = ref.current;
      if (!element) return;
      if (typeof IntersectionObserver === "undefined") return;
      const observer = new IntersectionObserver(() => {
        if (!isFocusable(element)) {
          focusVisibleRef.current = false;
          setFocusVisible(false);
        }
      });
      observer.observe(element);
      return () => observer.disconnect();
    }, [focusable2, focusVisible]);
    (0, import_react48.useEffect)(() => {
      return () => nativeSubmitObserverCleanupRef.current?.();
    }, []);
    const onKeyPressCapture = useDisableEvent(props.onKeyPressCapture, disabled2);
    const onMouseDownCapture = useDisableEvent(props.onMouseDownCapture, disabled2);
    const onClickCapture = useDisableEvent(props.onClickCapture, disabled2);
    const onAuxClickCapture = useDisableEvent(props.onAuxClickCapture, disabled2);
    const handleFocusVisible = (event, currentTarget) => {
      if (currentTarget) event.currentTarget = currentTarget;
      if (!focusable2) return;
      const element = event.currentTarget;
      if (!element) return;
      if (!hasFocus(element)) return;
      onFocusVisible?.(event);
      if (event.defaultPrevented) return;
      element.dataset.focusVisible = "true";
      focusVisibleRef.current = true;
      if (isNativeSubmitControl(element)) {
        nativeSubmitObserverCleanupRef.current?.();
        nativeSubmitObserverCleanupRef.current = null;
        if (typeof IntersectionObserver !== "undefined") {
          const observer = new IntersectionObserver(() => {
            if (isFocusable(element)) return;
            cleanupFocusVisible(element);
          });
          observer.observe(element);
          nativeSubmitObserverCleanupRef.current = () => observer.disconnect();
        }
        return;
      }
      setFocusVisible(true);
    };
    const onKeyDownCaptureProp = props.onKeyDownCapture;
    const onKeyDownCapture = useEvent((event) => {
      onKeyDownCaptureProp?.(event);
      if (event.defaultPrevented) return;
      if (!focusable2) return;
      if (focusVisible) return;
      if (focusVisibleRef.current) return;
      if ((event.metaKey || event.altKey || event.ctrlKey) && !isCompositeMoveKey(event.key)) return;
      if (!isSelfTarget(event)) return;
      const element = event.currentTarget;
      const applyFocusVisible = () => handleFocusVisible(event, element);
      queueBeforeEvent(element, "focusout", applyFocusVisible);
    });
    const onFocusCaptureProp = props.onFocusCapture;
    const onFocusCapture = useEvent((event) => {
      onFocusCaptureProp?.(event);
      if (event.defaultPrevented) return;
      if (!focusable2) return;
      if (!isSelfTarget(event)) {
        setFocusVisible(false);
        return;
      }
      const element = event.currentTarget;
      const applyFocusVisible = () => handleFocusVisible(event, element);
      if (isKeyboardModality || isAlwaysFocusVisible(event.target)) queueBeforeEvent(event.target, "focusout", applyFocusVisible);
      else setFocusVisible(false);
    });
    const onBlurProp = props.onBlur;
    const onBlur = useEvent((event) => {
      onBlurProp?.(event);
      if (!focusable2) return;
      if (!isFocusEventOutside(event)) return;
      cleanupFocusVisible(event.currentTarget);
      setFocusVisible(false);
    });
    const autoFocusOnShow = (0, import_react48.useContext)(FocusableContext);
    const autoFocusRef = useEvent((element) => {
      if (!focusable2) return;
      if (!autoFocus) return;
      if (!element) return;
      if (!autoFocusOnShow) return;
      queueMicrotask(() => {
        if (hasFocus(element)) return;
        if (!isFocusable(element)) return;
        element.focus();
      });
    });
    const [elementCapabilities, setElementCapabilities] = (0, import_react48.useState)(defaultElementCapabilities);
    useSafeLayoutEffect(() => {
      const element = ref.current;
      if (!element) return;
      const nextCapabilities = getElementCapabilities(element.tagName.toLowerCase());
      if (nextCapabilities === defaultElementCapabilities) return;
      setElementCapabilities(nextCapabilities);
    }, []);
    const nativeTabbable = focusable2 && !!(elementCapabilities & nativeTabbableMask);
    const supportsDisabled = focusable2 && !!(elementCapabilities & supportsDisabledMask);
    const [safariTabIndex, setSafariTabIndex] = (0, import_react48.useState)(false);
    if (isSafariBrowser) (0, import_react48.useEffect)(() => {
      if (!focusable2) return;
      const element = ref.current;
      if (!element) return;
      const { type } = element;
      const isNativeCheckboxOrRadio = element.tagName === "INPUT" && (type === "checkbox" || type === "radio");
      setSafariTabIndex(isButton(element) || isNativeCheckboxOrRadio);
    }, [focusable2]);
    const styleProp = props.style;
    const style = (0, import_react48.useMemo)(() => {
      if (trulyDisabled) return {
        pointerEvents: "none",
        ...styleProp
      };
      return styleProp;
    }, [trulyDisabled, styleProp]);
    props = {
      "data-focus-visible": focusable2 && focusVisible || void 0,
      "data-autofocus": autoFocus || void 0,
      "aria-disabled": disabled2 || void 0,
      ...props,
      ...metadataProps,
      ref: useMergeRefs5(ref, autoFocusRef, props.ref),
      style,
      tabIndex: getTabIndex2({
        focusable: focusable2,
        trulyDisabled,
        nativeTabbable,
        supportsDisabled,
        safariTabIndex,
        tabIndexProp: props.tabIndex
      }),
      disabled: supportsDisabled && trulyDisabled ? true : void 0,
      [trulyDisabledAttribute]: disabled2 ? trulyDisabled : void 0,
      contentEditable: disabled2 ? void 0 : props.contentEditable,
      onKeyPressCapture,
      onClickCapture,
      onAuxClickCapture,
      onMouseDownCapture,
      onKeyDownCapture,
      onFocusCapture,
      onBlur
    };
    return removeUndefinedValues(props);
  });
  var Focusable = forwardRef89(function Focusable2(props) {
    const htmlProps = useFocusable(props);
    return createElement3(TagName, htmlProps);
  });

  // node_modules/@ariakit/react-components/dist/command/command.js
  var import_react49 = __toESM(require_react(), 1);
  var TagName2 = "button";
  function isNativeClick(event) {
    if (!event.isTrusted) return false;
    const element = event.currentTarget;
    if (event.key === "Enter") return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A";
    if (event.key === " ") return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
    return false;
  }
  var symbol = /* @__PURE__ */ Symbol("command");
  var useCommand = createHook(function useCommand2({ clickOnEnter = true, clickOnSpace = true, ...props }) {
    const ref = (0, import_react49.useRef)(null);
    const [isNativeButton, setIsNativeButton] = (0, import_react49.useState)(false);
    const type = props.type;
    (0, import_react49.useEffect)(() => {
      const element = ref.current;
      if (!element) return;
      const nativeButton = isButton(element);
      if (type !== void 0 && nativeButton && element.type === "button") return;
      setIsNativeButton(nativeButton);
    }, [type]);
    const [active, setActive] = (0, import_react49.useState)(false);
    const activeRef = (0, import_react49.useRef)(false);
    const disabled2 = disabledFromProps(props);
    const [isDuplicate, metadataProps] = useMetadataProps(props, symbol, true);
    useSafeLayoutEffect(() => {
      if (!disabled2) return;
      activeRef.current = false;
      setActive(false);
    }, [disabled2]);
    const onKeyDownProp = props.onKeyDown;
    const onKeyDown = useEvent((event) => {
      onKeyDownProp?.(event);
      const element = event.currentTarget;
      if (event.defaultPrevented) return;
      if (isDuplicate) return;
      if (disabled2) return;
      if (!isSelfTarget(event)) return;
      if (isTextField(element)) return;
      if (element.isContentEditable) return;
      const isEnter = clickOnEnter && event.key === "Enter";
      const isSpace = clickOnSpace && event.key === " ";
      const shouldPreventEnter = event.key === "Enter" && !clickOnEnter;
      const shouldPreventSpace = event.key === " " && !clickOnSpace;
      if (shouldPreventEnter || shouldPreventSpace) {
        event.preventDefault();
        return;
      }
      if (isEnter || isSpace) {
        const nativeClick = isNativeClick(event);
        if (isEnter) {
          if (!nativeClick) {
            event.preventDefault();
            const { view, ...eventInit } = event;
            const click = () => fireClickEvent(element, eventInit);
            if (isFirefox()) queueBeforeEvent(element, "keyup", click);
            else queueMicrotask(click);
          }
        } else if (isSpace) {
          activeRef.current = true;
          if (!nativeClick) {
            event.preventDefault();
            setActive(true);
          }
        }
      }
    });
    const onKeyUpProp = props.onKeyUp;
    const onKeyUp = useEvent((event) => {
      onKeyUpProp?.(event);
      if (isDuplicate) return;
      const isSpace = clickOnSpace && event.key === " ";
      if (!activeRef.current || !isSpace) return;
      const nativeClick = isNativeClick(event);
      activeRef.current = false;
      if (!nativeClick) setActive(false);
      if (event.defaultPrevented) return;
      if (!isSelfTarget(event)) return;
      if (disabled2) return;
      if (event.metaKey) return;
      if (nativeClick) return;
      event.preventDefault();
      const element = event.currentTarget;
      const { view, ...eventInit } = event;
      queueMicrotask(() => fireClickEvent(element, eventInit));
    });
    const onBlurProp = props.onBlur;
    const onBlur = useEvent((event) => {
      onBlurProp?.(event);
      if (!activeRef.current) return;
      activeRef.current = false;
      setActive(false);
    });
    props = {
      "data-active": active || void 0,
      type: isNativeButton ? "button" : void 0,
      ...metadataProps,
      ...props,
      ref: useMergeRefs5(ref, props.ref),
      onKeyDown,
      onKeyUp,
      onBlur
    };
    props = useFocusable(props);
    return props;
  });
  var Command = forwardRef89(function Command2(props) {
    const htmlProps = useCommand(withDefaultButtonType(props));
    return createElement3(TagName2, htmlProps);
  });

  // node_modules/@ariakit/react-components/dist/collection/collection-context.js
  var ctx = createStoreContext();
  var useCollectionContext = ctx.useContext;
  var useCollectionScopedContext = ctx.useScopedContext;
  var useCollectionProviderContext = ctx.useProviderContext;
  var CollectionContextProvider = ctx.ContextProvider;
  var CollectionScopedContextProvider = ctx.ScopedContextProvider;

  // node_modules/@ariakit/react-components/dist/collection/collection-item.js
  var import_react50 = __toESM(require_react(), 1);
  var TagName3 = "div";
  var useCollectionItem = createHook(function useCollectionItem2({ store, shouldRegisterItem = true, getItem = identity, element, ...props }) {
    const context = useCollectionContext();
    store = store || context;
    const id = useId7(props.id);
    const ref = (0, import_react50.useRef)(element);
    (0, import_react50.useEffect)(() => {
      const element2 = ref.current;
      if (!id) return;
      if (!element2) return;
      if (!shouldRegisterItem) return;
      const item = getItem({
        id,
        element: element2
      });
      return store?.renderItem(item);
    }, [
      id,
      shouldRegisterItem,
      getItem,
      store
    ]);
    props = {
      ...props,
      ref: useMergeRefs5(ref, props.ref)
    };
    return props;
  });
  var CollectionItem = forwardRef89(function CollectionItem2(props) {
    const htmlProps = useCollectionItem(props);
    return createElement3(TagName3, htmlProps);
  });

  // node_modules/@ariakit/react-components/dist/composite/composite-context.js
  var import_react51 = __toESM(require_react(), 1);
  var ctx2 = createStoreContext([CollectionContextProvider], [CollectionScopedContextProvider]);
  var useCompositeContext = ctx2.useContext;
  var useCompositeScopedContext = ctx2.useScopedContext;
  var useCompositeProviderContext = ctx2.useProviderContext;
  var CompositeContextProvider = ctx2.ContextProvider;
  var CompositeScopedContextProvider = ctx2.ScopedContextProvider;
  var CompositeItemContext = (0, import_react51.createContext)(void 0);
  var CompositeRowContext = (0, import_react51.createContext)(void 0);

  // node_modules/@ariakit/react-components/dist/composite/utils.js
  var import_react52 = __toESM(require_react(), 1);

  // node_modules/@ariakit/store/dist/index.js
  function getInternal(store, key) {
    const internals = store.__unstableInternals;
    invariant(internals, "Invalid store");
    return internals[key];
  }
  function hasUpdatedKey(keys, updatedKey) {
    if (!keys) return true;
    for (const currentKey of keys) if (updatedKey instanceof Set) {
      if (updatedKey.has(currentKey)) return true;
    } else if (isSameValue(currentKey, updatedKey)) return true;
    return false;
  }
  function isSameValue(value, other) {
    return value === other || value !== value && other !== other;
  }
  function getCleanupPrevState(prevState, state, stateBeforeCleanup, updatedKey) {
    let cleanupPrevState;
    for (const key of getKeys(state)) {
      if (isSameValue(state[key], stateBeforeCleanup[key])) continue;
      if (updatedKey !== void 0 && hasUpdatedKey([key], updatedKey)) continue;
      cleanupPrevState ??= { ...prevState };
      cleanupPrevState[key] = state[key];
    }
    return cleanupPrevState;
  }
  var MAX_REPAIR_PASSES = 100;
  function addKeyedListener(map, keys, listener) {
    if (!keys) return;
    for (const key of keys) {
      let listeners = map.get(key);
      if (!listeners) {
        listeners = /* @__PURE__ */ new Set();
        map.set(key, listeners);
      }
      listeners.add(listener);
    }
  }
  function deleteKeyedListener(map, keys, listener) {
    if (!map) return;
    if (!keys) return;
    for (const key of keys) {
      const listeners = map.get(key);
      if (!listeners) continue;
      listeners.delete(listener);
      if (!listeners.size) map.delete(key);
    }
  }
  function getFastPathNotifiedListeners(frame) {
    const notifiedListeners = /* @__PURE__ */ new Set();
    const currentListener = frame.currentListener;
    if (!currentListener) return notifiedListeners;
    for (const listener of frame.keyedListeners) {
      notifiedListeners.add(listener);
      if (listener === currentListener) return notifiedListeners;
    }
    notifiedListeners.clear();
    notifiedListeners.add(currentListener);
    return notifiedListeners;
  }
  function preserveFastPathNotifiedListeners(frame) {
    frame.notifiedListeners ??= getFastPathNotifiedListeners(frame);
  }
  function hasFastPathPassedListener(frame, listener) {
    if (!frame.currentListener) return false;
    let foundCurrentKeyedListener = false;
    for (const currentListener of frame.keyedListeners) {
      if (currentListener === frame.currentListener) {
        foundCurrentKeyedListener = true;
        continue;
      }
      if (!foundCurrentKeyedListener) continue;
      if (currentListener === listener) return false;
    }
    let foundListener = false;
    for (const currentListener of frame.group.listeners) {
      if (currentListener === frame.currentListener) return foundListener;
      if (currentListener === listener) foundListener = true;
    }
    return false;
  }
  function preserveFastPathFrames(fastPathFrames, group, listener) {
    for (const frame of fastPathFrames) {
      if (frame.group !== group) continue;
      if (frame.recovering) continue;
      if (listener && !frame.keyedListeners.has(listener)) continue;
      preserveFastPathNotifiedListeners(frame);
      for (const currentListener of frame.group.listeners) {
        if (currentListener === frame.currentListener) break;
        if (!hasFastPathPassedListener(frame, currentListener)) continue;
        frame.notifiedListeners?.add(currentListener);
      }
    }
  }
  function preserveFastPathPassedListeners(fastPathFrames, group, listener) {
    for (const frame of fastPathFrames) {
      if (frame.group !== group) continue;
      if (frame.recovering) continue;
      if (!hasFastPathPassedListener(frame, listener)) continue;
      preserveFastPathNotifiedListeners(frame);
      frame.notifiedListeners?.add(listener);
    }
  }
  function preserveFastPathPassedKeyedListeners({ fastPathFrames, group, keys, listener }) {
    const wasRegistered = group.listeners.has(listener);
    for (const frame of fastPathFrames) {
      if (frame.group !== group) continue;
      if (frame.recovering) continue;
      if (!keys.includes(frame.updatedKey)) continue;
      if (hasFastPathPassedListener(frame, listener)) {
        preserveFastPathNotifiedListeners(frame);
        frame.notifiedListeners?.add(listener);
      } else if (wasRegistered) {
        preserveFastPathNotifiedListeners(frame);
        frame.recoverToLive = true;
      }
    }
  }
  function clearFastPathNotifiedListener(fastPathFrames, group, listener) {
    for (const frame of fastPathFrames) {
      if (frame.group !== group) continue;
      frame.notifiedListeners?.delete(listener);
    }
  }
  function addFastPathKeyedListener({ fastPathFrames, group, keys, listener }) {
    for (const frame of fastPathFrames) {
      if (frame.group !== group) continue;
      if (frame.recovering) continue;
      if (!keys.includes(frame.updatedKey)) continue;
      frame.keyedListeners.add(listener);
    }
  }
  function runPendingCleanup(group, listener) {
    if (!group.disposables.size) return;
    const cleanup = group.disposables.get(listener);
    if (!cleanup) return;
    group.disposables.delete(listener);
    cleanup();
  }
  function setListenerCleanup(group, listener, cleanup) {
    const currentCleanup = group.disposables.get(listener);
    if (!currentCleanup) {
      group.disposables.set(listener, cleanup);
      return;
    }
    group.disposables.set(listener, () => {
      currentCleanup();
      cleanup();
    });
  }
  function notifyStoreListener(group, listener, state, prevState, getState, updatedKey) {
    if (group.suspendCounts?.has(listener)) return;
    const { disposables } = group;
    const cleanup = disposables.size ? disposables.get(listener) : void 0;
    if (cleanup) {
      disposables.delete(listener);
      const stateBeforeCleanup = state;
      cleanup();
      state = getState?.() ?? state;
      if (state !== stateBeforeCleanup) prevState = getCleanupPrevState(prevState, state, stateBeforeCleanup, updatedKey) ?? prevState;
    }
    const result = listener(state, prevState);
    if (result) setListenerCleanup(group, listener, result);
  }
  function runLiveListeners({ group, getState, prevState, updatedKey, notifiedListeners }) {
    const allKeysListeners = group.allKeysListeners;
    for (const listener of group.listeners) {
      if (notifiedListeners?.has(listener)) continue;
      if (!allKeysListeners?.has(listener)) {
        if (!hasUpdatedKey(group.listenerKeys.get(listener), updatedKey)) continue;
      }
      notifiedListeners?.add(listener);
      notifyStoreListener(group, listener, getState(), prevState, getState, updatedKey);
    }
  }
  function createStore(initialState, ...stores) {
    let state = initialState;
    let prevStateBatch = state;
    let destroy = noop5;
    let batchPending = false;
    let inDispatch = false;
    let updatedKeys = /* @__PURE__ */ new Set();
    const instances = /* @__PURE__ */ new Set();
    const setups = /* @__PURE__ */ new Set();
    const syncListenerGroup = {
      listeners: /* @__PURE__ */ new Set(),
      disposables: /* @__PURE__ */ new Map(),
      listenerKeys: /* @__PURE__ */ new WeakMap()
    };
    const batchListenerGroup = {
      listeners: /* @__PURE__ */ new Set(),
      disposables: /* @__PURE__ */ new Map(),
      listenerKeys: /* @__PURE__ */ new WeakMap()
    };
    const storeSetup = (callback) => {
      setups.add(callback);
      return () => setups.delete(callback);
    };
    const storeInit = () => {
      const initializedInstances = instances.size;
      const instance = /* @__PURE__ */ Symbol();
      instances.add(instance);
      const maybeDestroy = () => {
        if (!instances.delete(instance)) return;
        if (instances.size) return;
        destroy();
      };
      if (initializedInstances) return maybeDestroy;
      const stateKeys = getKeys(state);
      const desyncs = [];
      for (const store of stores) {
        const storeState = store?.getState?.();
        if (!storeState) continue;
        const keys = stateKeys.filter((key) => hasOwnProperty(storeState, key));
        if (!keys.length) continue;
        if (stores.length === 1 || keys.length === stateKeys.length) {
          for (const key of keys) desyncs.push(sync(store, [key], (state2) => {
            setState(key, state2[key], true);
          }));
          continue;
        }
        desyncs.push(subscribe(store, keys, (state2, prevState) => {
          for (const key of keys) {
            if (state2[key] === prevState[key]) continue;
            setState(key, state2[key], true);
          }
        }));
        for (const key of keys) {
          const liveState = store?.getState?.();
          if (!liveState) continue;
          setState(key, liveState[key], true);
        }
      }
      const teardowns = [];
      for (const setup2 of setups) teardowns.push(setup2());
      const cleanups = stores.map(init);
      destroy = chain(...desyncs, ...teardowns, ...cleanups);
      return maybeDestroy;
    };
    const deleteListenerIndexes = (group, listener, keys) => {
      if (keys === void 0) return;
      if (keys) deleteKeyedListener(group.listenersByKey, keys, listener);
      else group.allKeysListeners?.delete(listener);
    };
    const fastPathFrames = [];
    const registerListener = (keys, listener, group = syncListenerGroup) => {
      const listenerKeysValue = keys ? [...keys] : null;
      const wasRegistered = group.listeners.has(listener);
      if (!wasRegistered) clearFastPathNotifiedListener(fastPathFrames, group, listener);
      if (!listenerKeysValue) {
        if (wasRegistered) preserveFastPathFrames(fastPathFrames, group);
        preserveFastPathPassedListeners(fastPathFrames, group, listener);
      } else preserveFastPathPassedKeyedListeners({
        fastPathFrames,
        group,
        keys: listenerKeysValue,
        listener
      });
      if (wasRegistered) {
        preserveFastPathFrames(fastPathFrames, group, listener);
        deleteListenerIndexes(group, listener, group.listenerKeys.get(listener));
      }
      group.listeners.add(listener);
      if (listenerKeysValue) {
        group.listenersByKey ??= /* @__PURE__ */ new Map();
        addKeyedListener(group.listenersByKey, listenerKeysValue, listener);
        addFastPathKeyedListener({
          fastPathFrames,
          group,
          keys: listenerKeysValue,
          listener
        });
      } else {
        group.allKeysListeners ??= /* @__PURE__ */ new Set();
        group.allKeysListeners.add(listener);
      }
      group.listenerKeys.set(listener, listenerKeysValue);
      return () => {
        const cleanup = group.disposables.get(listener);
        group.disposables.delete(listener);
        preserveFastPathFrames(fastPathFrames, group, listener);
        const currentKeys = group.listenerKeys.get(listener);
        deleteListenerIndexes(group, listener, listenerKeysValue);
        if (currentKeys !== listenerKeysValue) deleteListenerIndexes(group, listener, currentKeys);
        group.listenerKeys.delete(listener);
        group.listeners.delete(listener);
        cleanup?.();
      };
    };
    const storeSubscribe = (keys, listener) => registerListener(keys, listener);
    const runInitialListener = (group, listener, prevState) => {
      const shouldSuspend = group.listeners.has(listener);
      if (shouldSuspend) {
        group.suspendCounts ??= /* @__PURE__ */ new Map();
        const count = group.suspendCounts.get(listener) ?? 0;
        group.suspendCounts.set(listener, count + 1);
      }
      let cleanupPrevState;
      try {
        const stateBeforeCleanups = state;
        runPendingCleanup(group, listener);
        if (state !== stateBeforeCleanups) cleanupPrevState = getCleanupPrevState(prevState, state, stateBeforeCleanups);
        const cleanup = listener(state, cleanupPrevState ?? prevState);
        if (cleanup) setListenerCleanup(group, listener, cleanup);
      } finally {
        if (shouldSuspend) {
          const suspendCounts = group.suspendCounts;
          const count = suspendCounts?.get(listener);
          if (count && count > 1) suspendCounts?.set(listener, count - 1);
          else suspendCounts?.delete(listener);
          if (!suspendCounts?.size) delete group.suspendCounts;
        }
      }
    };
    const storeSync = (keys, listener) => {
      runInitialListener(syncListenerGroup, listener, state);
      return registerListener(keys, listener);
    };
    const storeBatch = (keys, listener) => {
      if (!batchListenerGroup.listeners.size && !inDispatch) prevStateBatch = state;
      runInitialListener(batchListenerGroup, listener, prevStateBatch);
      return registerListener(keys, listener, batchListenerGroup);
    };
    const storePick = (keys) => createStore(pick(state, keys), finalStore);
    const storeOmit = (keys) => createStore(omit(state, keys), finalStore);
    const getState = () => state;
    const runListeners = (group, prevState, updatedKey) => {
      if (!(updatedKey instanceof Set) && !group.allKeysListeners?.size) {
        const keyedListeners = group.listenersByKey?.get(updatedKey);
        if (!keyedListeners) return;
        const frame = {
          group,
          keyedListeners,
          updatedKey,
          currentListener: null
        };
        fastPathFrames.push(frame);
        try {
          for (const listener of keyedListeners) {
            if (frame.notifiedListeners?.has(listener)) continue;
            frame.currentListener = listener;
            frame.notifiedListeners?.add(listener);
            notifyStoreListener(group, listener, state, prevState, getState, updatedKey);
            if (!group.allKeysListeners?.size && !frame.recoverToLive) continue;
            const notifiedListeners = frame.notifiedListeners ?? getFastPathNotifiedListeners(frame);
            frame.notifiedListeners = notifiedListeners;
            frame.recovering = true;
            runLiveListeners({
              group,
              getState,
              prevState,
              updatedKey,
              notifiedListeners
            });
            return;
          }
        } finally {
          fastPathFrames.pop();
        }
        return;
      }
      runLiveListeners({
        group,
        getState,
        prevState,
        updatedKey
      });
    };
    const setState = (key, value, fromStores = false) => {
      if (!hasOwnProperty(state, key)) return;
      const currentValue = state[key];
      const nextValue = applyState(value, () => currentValue);
      if (isSameValue(nextValue, currentValue)) return;
      const wasInDispatch = inDispatch;
      inDispatch = true;
      const prevState = state;
      const nextState = {
        ...state,
        [key]: nextValue
      };
      state = nextState;
      let superseded = false;
      try {
        if (!fromStores && stores.length) {
          for (const store of stores) {
            store?.setState?.(key, nextValue);
            if (isSameValue(state[key], nextValue)) continue;
            superseded = true;
            break;
          }
          if (superseded) {
            let pass = 0;
            for (; pass < MAX_REPAIR_PASSES; pass += 1) {
              let changed = false;
              for (const store of stores) {
                const previousValue = state[key];
                store?.setState?.(key, previousValue);
                if (!isSameValue(state[key], previousValue)) changed = true;
              }
              if (!changed) break;
            }
            if (pass === MAX_REPAIR_PASSES) console.warn("Parent stores did not converge after a superseded fan-out; a parent listener may be rewriting this key in a cycle.");
          }
        }
        if (!superseded) {
          const listenerPrevState = state === nextState ? prevState : {
            ...state,
            [key]: prevState[key]
          };
          runListeners(syncListenerGroup, listenerPrevState, key);
        }
      } finally {
        inDispatch = wasInDispatch;
      }
      if (!batchListenerGroup.listeners.size) {
        if (!inDispatch) prevStateBatch = state;
        return;
      }
      updatedKeys.add(key);
      if (batchPending) return;
      batchPending = true;
      queueMicrotask(() => {
        batchPending = false;
        const snapshot = state;
        const updatedKeysSnapshot = updatedKeys;
        updatedKeys = /* @__PURE__ */ new Set();
        const prevStateBatchBefore = prevStateBatch;
        runListeners(batchListenerGroup, prevStateBatchBefore, updatedKeysSnapshot);
        if (prevStateBatch === prevStateBatchBefore) prevStateBatch = snapshot;
      });
    };
    const finalStore = {
      getState,
      setState,
      __unstableInternals: {
        setup: storeSetup,
        init: storeInit,
        subscribe: storeSubscribe,
        sync: storeSync,
        batch: storeBatch,
        pick: storePick,
        omit: storeOmit
      }
    };
    return finalStore;
  }
  function setup(store, ...args) {
    if (!store) return;
    return getInternal(store, "setup")(...args);
  }
  function init(store, ...args) {
    if (!store) return;
    return getInternal(store, "init")(...args);
  }
  function subscribe(store, ...args) {
    if (!store) return;
    return getInternal(store, "subscribe")(...args);
  }
  function sync(store, ...args) {
    if (!store) return;
    return getInternal(store, "sync")(...args);
  }
  function batch(store, ...args) {
    if (!store) return;
    return getInternal(store, "batch")(...args);
  }
  function omit2(store, ...args) {
    if (!store) return;
    return getInternal(store, "omit")(...args);
  }
  function pick2(store, ...args) {
    if (!store) return;
    return getInternal(store, "pick")(...args);
  }
  function mergeStore(...stores) {
    const initialState = {};
    for (const store2 of stores) {
      const nextState = store2?.getState?.();
      if (nextState) Object.assign(initialState, nextState);
    }
    const store = createStore(initialState, ...stores);
    return Object.assign({}, ...stores, store);
  }
  function throwOnConflictingProps(props, store) {
    if (false) return;
    if (!store) return;
    const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
      const stateKey = key.replace("default", "");
      return `${stateKey[0]?.toLowerCase() || ""}${stateKey.slice(1)}`;
    });
    if (!defaultKeys.length) return;
    const storeState = store.getState();
    if (!defaultKeys.filter((key) => hasOwnProperty(storeState, key)).length) return;
    throw new Error(`Passing a store prop in conjunction with a default state is not supported.

const store = useSelectStore();
<SelectProvider store={store} defaultValue="Apple" />
                ^             ^

Instead, pass the default state to the topmost store:

const store = useSelectStore({ defaultValue: "Apple" });
<SelectProvider store={store} />

See https://github.com/ariakit/ariakit/pull/2745 for more details.

If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
`);
  }

  // node_modules/@ariakit/components/dist/collection/collection-store.js
  function getCommonParent(items) {
    const firstItem = items.find((item) => !!item.element);
    const lastElement = [...items].reverse().find((item) => !!item.element)?.element;
    let parentElement = firstItem?.element?.parentElement;
    if (!lastElement) return getDocument(parentElement).body;
    while (parentElement) {
      if (parentElement.contains(lastElement)) return parentElement;
      parentElement = parentElement.parentElement;
    }
    return getDocument(parentElement).body;
  }
  function getPrivateStore(store) {
    return store?.__unstablePrivateStore;
  }
  var itemIdCacheThreshold = 64;
  function getCachedItemIds(items, cache) {
    if (items.length < itemIdCacheThreshold) {
      if (cache.ids) {
        cache.items = void 0;
        cache.ids = void 0;
      }
      return;
    }
    if (cache.items === items) return cache.ids;
    const ids = /* @__PURE__ */ new Set();
    for (const item of items) ids.add(item.id);
    cache.items = items;
    cache.ids = ids;
    return ids;
  }
  function setCachedItemIds(items, cache, ids) {
    if (items.length < itemIdCacheThreshold) {
      if (cache.ids) {
        cache.items = void 0;
        cache.ids = void 0;
      }
      return;
    }
    if (!ids) {
      ids = /* @__PURE__ */ new Set();
      for (const item of items) ids.add(item.id);
    }
    cache.items = items;
    cache.ids = ids;
  }
  function createCollectionStore(props = {}) {
    throwOnConflictingProps(props, props.store);
    const syncState = props.store?.getState();
    const items = defaultValue(props.items, syncState?.items, props.defaultItems, []);
    const syncPrivateStore = getPrivateStore(props.store);
    const collectionLookup = syncPrivateStore?.__unstableCollectionLookup ?? {
      controlledItems: new Map(items.map((item) => [item.id, item])),
      registeredItems: /* @__PURE__ */ new Map(),
      controlledItemsSource: items,
      propagatedItems: items
    };
    const { controlledItems, registeredItems } = collectionLookup;
    const itemIdCache = {};
    const renderedItemIdCache = {};
    const initialState = {
      items,
      renderedItems: defaultValue(syncState?.renderedItems, [])
    };
    const collection = createStore(initialState, props.store);
    const privateStore = Object.assign(createStore({
      items,
      renderedItems: initialState.renderedItems
    }, syncPrivateStore), { __unstableCollectionLookup: collectionLookup });
    const sortItems = (renderedItems) => {
      const sortedItems = sortBasedOnDOMPosition(renderedItems, (i) => i.element);
      privateStore.setState("renderedItems", sortedItems);
      collection.setState("renderedItems", sortedItems);
    };
    const indexControlledItems = (items2) => {
      if (items2 === collectionLookup.controlledItemsSource) return;
      collectionLookup.controlledItemsSource = items2;
      controlledItems.clear();
      for (const item of items2) controlledItems.set(item.id, item);
    };
    const setState = (key, value) => {
      if (key !== "items") {
        collection.setState(key, value);
        return;
      }
      collection.setState("items", (items2) => {
        const nextItems = applyState(value, items2);
        if (nextItems === items2) return items2;
        collectionLookup.propagatedItems = nextItems;
        indexControlledItems(nextItems);
        return nextItems;
      });
    };
    setup(collection, () => init(privateStore));
    if (!syncPrivateStore) {
      subscribe(collection, ["items"], ({ items: items2 }) => {
        if (items2 === collectionLookup.propagatedItems) return;
        collectionLookup.propagatedItems = items2;
        indexControlledItems(items2);
      });
      setup(privateStore, () => {
        return batch(privateStore, ["items"], ({ items: items2 }) => {
          collectionLookup.propagatedItems = items2;
          collection.setState("items", items2);
        });
      });
    }
    setup(privateStore, () => {
      return batch(privateStore, ["renderedItems"], (state) => {
        if (state.renderedItems !== collection.getState().renderedItems) sortItems(state.renderedItems);
        if (typeof IntersectionObserver !== "function") return;
        let firstRun = true;
        let raf = 0;
        const ioCallback = () => {
          if (firstRun) {
            firstRun = false;
            return;
          }
          cancelAnimationFrame(raf);
          raf = requestAnimationFrame(() => sortItems(state.renderedItems));
        };
        const root = getCommonParent(state.renderedItems);
        const observer = new IntersectionObserver(ioCallback, { root });
        for (const item of state.renderedItems) {
          if (!item.element) continue;
          observer.observe(item.element);
        }
        return () => {
          cancelAnimationFrame(raf);
          observer.disconnect();
        };
      });
    });
    const createMergeItem = (key, cache, lookup) => {
      const registeredItems2 = lookup?.registeredItems;
      const controlledItems2 = lookup?.controlledItems;
      return (item) => {
        const previousRegisteredItem = registeredItems2?.get(item.id);
        const wasKnown = !!previousRegisteredItem || !!controlledItems2?.has(item.id);
        let prevItem;
        privateStore.setState(key, (items2) => {
          const ids = !!cache.ids || items2.length >= itemIdCacheThreshold && !wasKnown ? getCachedItemIds(items2, cache) : void 0;
          const index2 = ids && !ids.has(item.id) ? -1 : items2.findIndex(({ id }) => id === item.id);
          const nextItems = items2.slice();
          if (index2 !== -1) {
            prevItem = items2[index2];
            const nextItem = {
              ...prevItem,
              ...item
            };
            nextItems[index2] = nextItem;
            registeredItems2?.set(item.id, nextItem);
          } else {
            nextItems.push(item);
            registeredItems2?.set(item.id, item);
            ids?.add(item.id);
          }
          if (cache.ids || index2 === -1 && nextItems.length >= itemIdCacheThreshold) setCachedItemIds(nextItems, cache, ids);
          return nextItems;
        });
        const unmergeItem = () => {
          if (registeredItems2) {
            if (previousRegisteredItem) registeredItems2.set(item.id, previousRegisteredItem);
            else registeredItems2.delete(item.id);
          }
          privateStore.setState(key, (items2) => {
            const ids = cache.ids ? getCachedItemIds(items2, cache) : void 0;
            if (!prevItem) {
              const nextItems2 = items2.filter(({ id }) => id !== item.id);
              ids?.delete(item.id);
              if (cache.ids) setCachedItemIds(nextItems2, cache, ids);
              return nextItems2;
            }
            const index2 = items2.findIndex(({ id }) => id === item.id);
            if (index2 === -1) return items2;
            const nextItems = items2.slice();
            nextItems[index2] = prevItem;
            if (cache.ids) setCachedItemIds(nextItems, cache, ids);
            return nextItems;
          });
        };
        return unmergeItem;
      };
    };
    const registerItem = createMergeItem("items", itemIdCache, collectionLookup);
    const mergeRenderedItem = createMergeItem("renderedItems", renderedItemIdCache);
    return {
      ...collection,
      setState,
      registerItem,
      renderItem: (item) => chain(registerItem(item), mergeRenderedItem(item)),
      item: (id) => {
        if (!id) return null;
        if (!registeredItems.size) return controlledItems.get(id) ?? null;
        return registeredItems.get(id) ?? controlledItems.get(id) ?? null;
      },
      __unstablePrivateStore: privateStore
    };
  }

  // node_modules/@ariakit/components/dist/composite/composite-store.js
  var NULL_ITEM = { id: null };
  function findFirstEnabledItem(items, excludeId) {
    return items.find((item) => {
      if (excludeId) return !item.disabled && item.id !== excludeId;
      return !item.disabled;
    });
  }
  function findLastEnabledItem(items) {
    for (let i = items.length - 1; i >= 0; i -= 1) {
      const item = items[i];
      if (!item) continue;
      if (item.disabled) continue;
      return item;
    }
  }
  function getEnabledItems(items, excludeId) {
    return items.filter((item) => {
      if (excludeId) return !item.disabled && item.id !== excludeId;
      return !item.disabled;
    });
  }
  function getItemsInRow(items, rowId) {
    return items.filter((item) => item.rowId === rowId);
  }
  function findEnabledItemId({ items, fromIndex, step, rowId, excludeId }) {
    for (let i = fromIndex; i >= 0 && i < items.length; i += step) {
      const item = items[i];
      if (!item) continue;
      if (item.rowId !== rowId) continue;
      if (item.disabled) continue;
      const itemId = item.id;
      if (excludeId != null && itemId === excludeId) continue;
      return itemId;
    }
  }
  function flipItems(items, activeId, shouldInsertNullItem = false) {
    const index2 = items.findIndex((item) => item.id === activeId);
    return [
      ...items.slice(index2 + 1),
      ...shouldInsertNullItem ? [NULL_ITEM] : [],
      ...items.slice(0, index2)
    ];
  }
  var rowMapItemThreshold = 48;
  var rowMapRowThreshold = 4;
  function groupSmallItemsByRows(items) {
    const rows = [];
    let previousRow;
    let previousRowId;
    for (const item of items) {
      const rowId = item.rowId;
      if (previousRow && previousRowId === rowId) {
        previousRow.push(item);
        continue;
      }
      const row = rows.find((currentRow) => currentRow[0]?.rowId === rowId);
      if (row) {
        row.push(item);
        previousRow = row;
      } else {
        previousRow = [item];
        rows.push(previousRow);
      }
      previousRowId = rowId;
    }
    return rows;
  }
  function groupLargeItemsByRows(items) {
    const firstItem = items[0];
    if (!firstItem) return [];
    let itemIndex = 1;
    while (itemIndex < items.length && items[itemIndex]?.rowId === firstItem.rowId) itemIndex += 1;
    const firstRow = items.slice(0, itemIndex);
    if (itemIndex === items.length) return [firstRow];
    const rows = [firstRow];
    let rowsById;
    for (; itemIndex < items.length; itemIndex += 1) {
      const item = items[itemIndex];
      if (!item) continue;
      const row = rowsById ? rowsById.get(item.rowId) : rows.find((currentRow) => currentRow[0]?.rowId === item.rowId);
      if (row) {
        row.push(item);
        continue;
      }
      const newRow = [item];
      rows.push(newRow);
      if (rowsById) rowsById.set(item.rowId, newRow);
      else if (rows.length === rowMapRowThreshold) rowsById = new Map(rows.map((currentRow) => [currentRow[0]?.rowId, currentRow]));
    }
    return rows;
  }
  function groupItemsByRows(items) {
    if (items.length >= rowMapItemThreshold) return groupLargeItemsByRows(items);
    return groupSmallItemsByRows(items);
  }
  function getMaxRowLength(array) {
    let maxLength = 0;
    for (const { length } of array) if (length > maxLength) maxLength = length;
    return maxLength;
  }
  function createEmptyItem(rowId) {
    return {
      id: "__EMPTY_ITEM__",
      disabled: true,
      rowId
    };
  }
  function normalizeRows(rows, activeId, focusShift) {
    const maxLength = getMaxRowLength(rows);
    for (const row of rows) for (let i = 0; i < maxLength; i += 1) {
      const item = row[i];
      if (!item || focusShift && item.disabled) {
        const previousItem = i === 0 && focusShift ? findFirstEnabledItem(row) : row[i - 1];
        row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem?.rowId);
      }
    }
    return rows;
  }
  function verticalizeItems(items) {
    const rows = groupItemsByRows(items);
    const maxLength = getMaxRowLength(rows);
    const verticalized = [];
    for (let i = 0; i < maxLength; i += 1) for (const row of rows) {
      const item = row[i];
      if (item) verticalized.push({
        ...item,
        rowId: item.rowId ? `${i}` : void 0
      });
    }
    return verticalized;
  }
  function createCompositeStore(props = {}) {
    const syncState = props.store?.getState();
    const collection = createCollectionStore(props);
    const activeId = defaultValue(props.activeId, syncState?.activeId, props.defaultActiveId);
    const compositeElement = defaultValue(syncState?.compositeElement, syncState?.baseElement, null);
    const compositeElementInFocusOrder = defaultValue(props.compositeElementInFocusOrder, props.includesBaseElement, syncState?.compositeElementInFocusOrder, syncState?.includesBaseElement, activeId === null);
    const initialState = {
      ...collection.getState(),
      id: defaultValue(props.id, syncState?.id) ?? `id-${Math.random().toString(36).slice(2, 8)}`,
      activeId,
      compositeElement,
      baseElement: compositeElement,
      compositeElementInFocusOrder,
      includesBaseElement: compositeElementInFocusOrder,
      moves: defaultValue(syncState?.moves, 0),
      orientation: defaultValue(props.orientation, syncState?.orientation, "both"),
      rtl: defaultValue(props.rtl, syncState?.rtl, false),
      virtualFocus: defaultValue(props.virtualFocus, syncState?.virtualFocus, false),
      focusLoop: defaultValue(props.focusLoop, syncState?.focusLoop, false),
      focusWrap: defaultValue(props.focusWrap, syncState?.focusWrap, false),
      focusShift: defaultValue(props.focusShift, syncState?.focusShift, false)
    };
    const composite = createStore(initialState, collection, props.store);
    setup(composite, () => chain(sync(composite, ["compositeElement"], (state) => {
      composite.setState("baseElement", state.compositeElement);
    }), sync(composite, ["baseElement"], (state) => {
      composite.setState("compositeElement", state.baseElement);
    }), sync(composite, ["compositeElementInFocusOrder"], (state) => {
      composite.setState("includesBaseElement", state.compositeElementInFocusOrder);
    }), sync(composite, ["includesBaseElement"], (state) => {
      composite.setState("compositeElementInFocusOrder", state.includesBaseElement);
    })));
    setup(composite, () => sync(composite, ["renderedItems", "activeId"], (state) => {
      composite.setState("activeId", (activeId2) => {
        if (activeId2 !== void 0) return activeId2;
        return findFirstEnabledItem(state.renderedItems)?.id;
      });
    }));
    const getNextId = (direction = "next", options = {}) => {
      const defaultState = composite.getState();
      const compositeElementInFocusOrder2 = defaultValue(options.compositeElementInFocusOrder, options.includesBaseElement, defaultState.compositeElementInFocusOrder);
      const { skip = 0, activeId: activeId2 = defaultState.activeId, focusShift = defaultState.focusShift, focusLoop = defaultState.focusLoop, focusWrap = defaultState.focusWrap, renderedItems = defaultState.renderedItems, rtl = defaultState.rtl } = options;
      const isVerticalDirection = direction === "up" || direction === "down";
      const isNextDirection = direction === "next" || direction === "down";
      const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
      const canShift = focusShift && !skip;
      if (!skip && !focusWrap && !compositeElementInFocusOrder2 && activeId2 != null) {
        if (!isVerticalDirection ? true : !canShift && !renderedItems.some((item) => item.rowId != null)) {
          let activeIndex2 = -1;
          if (renderedItems === defaultState.renderedItems) {
            const firstItem = renderedItems[0];
            if (firstItem && collection.item(firstItem.id) === firstItem) {
              const registeredItem = collection.item(activeId2);
              if (registeredItem?.id === activeId2) activeIndex2 = renderedItems.indexOf(registeredItem);
            }
          }
          if (activeIndex2 === -1) activeIndex2 = renderedItems.findIndex((item) => item.id === activeId2);
          const activeItem2 = renderedItems[activeIndex2];
          if (activeItem2) {
            const step = canReverse ? -1 : 1;
            const nextId = findEnabledItemId({
              items: renderedItems,
              fromIndex: activeIndex2 + step,
              step,
              rowId: activeItem2.rowId,
              excludeId: activeId2
            });
            if (nextId !== void 0) return nextId;
            if (!(focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical"))) return void 0;
            return findEnabledItemId({
              items: renderedItems,
              fromIndex: step === 1 ? 0 : renderedItems.length - 1,
              step,
              rowId: activeItem2.rowId,
              excludeId: activeId2
            });
          }
        }
      }
      let items = !isVerticalDirection ? renderedItems : flatten2DArray(normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift));
      items = canReverse ? reverseArray(items) : items;
      items = isVerticalDirection ? verticalizeItems(items) : items;
      if (activeId2 == null) return findFirstEnabledItem(items)?.id;
      const activeItem = items.find((item) => item.id === activeId2);
      if (!activeItem) return findFirstEnabledItem(items)?.id;
      const isGrid2 = items.some((item) => item.rowId);
      const activeIndex = items.indexOf(activeItem);
      const nextItems = items.slice(activeIndex + 1);
      const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
      if (skip) {
        const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);
        return (nextEnabledItemsInRow.slice(skip)[0] || nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1])?.id;
      }
      const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
      const canWrap = isGrid2 && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
      const hasNullItem = isNextDirection ? (!isGrid2 || isVerticalDirection) && canLoop && compositeElementInFocusOrder2 : isVerticalDirection ? compositeElementInFocusOrder2 : false;
      if (canLoop) return findFirstEnabledItem(flipItems(canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId), activeId2, hasNullItem), activeId2)?.id;
      if (canWrap) {
        const nextItem2 = findFirstEnabledItem(hasNullItem ? nextItemsInRow : nextItems, activeId2);
        return hasNullItem ? nextItem2?.id || null : nextItem2?.id;
      }
      const nextItem = findFirstEnabledItem(nextItemsInRow, activeId2);
      if (!nextItem && hasNullItem) return null;
      return nextItem?.id;
    };
    const getNextIdFromOptions = (direction, options) => {
      if (typeof options === "number") return getNextId(direction, { skip: options });
      return getNextId(direction, options);
    };
    return {
      ...collection,
      ...composite,
      setCompositeElement: (element) => composite.setState("compositeElement", element),
      setBaseElement: (element) => composite.setState("compositeElement", element),
      setActiveId: (id) => composite.setState("activeId", id),
      move: (id) => {
        if (id === void 0) return;
        composite.setState("activeId", id);
        composite.setState("moves", (moves) => moves + 1);
      },
      first: () => findFirstEnabledItem(composite.getState().renderedItems)?.id,
      last: () => findLastEnabledItem(composite.getState().renderedItems)?.id,
      next: (options) => getNextIdFromOptions("next", options),
      previous: (options) => getNextIdFromOptions("previous", options),
      down: (options) => getNextIdFromOptions("down", options),
      up: (options) => getNextIdFromOptions("up", options)
    };
  }

  // node_modules/@ariakit/react-components/dist/composite/utils.js
  var findFirstEnabledItem2 = findFirstEnabledItem;
  var groupItemsByRows2 = groupItemsByRows;
  var unmountingItems = /* @__PURE__ */ new WeakSet();
  function markItemUnmounting(element) {
    if (getActiveElement(element) !== element) return;
    unmountingItems.add(element);
    queueMicrotask(() => unmountingItems.delete(element));
  }
  function markItemMounted(element) {
    unmountingItems.delete(element);
  }
  function withCompositeScrollPreserved(store, callback) {
    const { virtualFocus, compositeElement } = store.getState();
    if (!virtualFocus || !compositeElement || !isTextField(compositeElement)) {
      callback();
      return;
    }
    const savedScrollLeft = compositeElement.scrollLeft;
    const savedScrollTop = compositeElement.scrollTop;
    callback();
    compositeElement.scrollLeft = savedScrollLeft;
    compositeElement.scrollTop = savedScrollTop;
  }
  function getPopupElement(store) {
    const state = store.getState();
    if (!("contentElement" in state)) return null;
    return state.contentElement;
  }
  function ownsFocus(store) {
    const { compositeElement } = store.getState();
    const activeElement2 = getActiveElement(compositeElement);
    if (!activeElement2) return false;
    if (compositeElement?.contains(activeElement2)) return true;
    if (isItem(store, activeElement2)) return true;
    return !!getPopupElement(store)?.contains(activeElement2);
  }
  function presentItem({ store, id, focus, markedOnly, requireFocus, scrollIntoView, onConsume }) {
    let element = null;
    let resolvedId;
    let focused = false;
    let focusLeftElement = false;
    let done = false;
    let wasMounted = false;
    let wasOpen = false;
    const compositeAtStart = store.getState().compositeElement;
    const activeAtStart = getActiveElement(compositeAtStart);
    const owner = requireFocus ? activeAtStart : null;
    const startedOnComposite = !!compositeAtStart?.contains(activeAtStart);
    const stillOwnsFocus = (target) => {
      if (!owner) return true;
      const activeElement2 = getActiveElement(owner);
      if (activeElement2 === owner) return true;
      if (activeElement2 === target) return true;
      return ownsFocus(store);
    };
    const abandonedByState = (state) => {
      if ("mounted" in state) {
        if (state.mounted) wasMounted = true;
        else if (wasMounted) return true;
      }
      if ("open" in state) {
        if (state.open) wasOpen = true;
        else if (wasOpen) return true;
      }
      return id != null && state.activeId != null && state.activeId !== id;
    };
    const entersClosedPopup = (state, target) => {
      if (!("open" in state)) return false;
      if (state.open) return false;
      const popup = getPopupElement(store);
      if (!popup?.contains(target)) return false;
      const { compositeElement } = state;
      if (!compositeElement) return false;
      if (popup.contains(compositeElement)) return false;
      return isVisible(target);
    };
    const resolveElement = (state) => {
      const item = getEnabledItem(store, resolvedId ?? (id === void 0 ? state.activeId : id));
      if (!item?.element?.isConnected) return null;
      resolvedId = item.id;
      return item.element;
    };
    let removeFocusListeners;
    let unsubscribe;
    const cancel = () => {
      done = true;
      removeFocusListeners?.();
      unsubscribe?.();
    };
    let consumed = false;
    const consume = () => {
      if (consumed) return;
      consumed = true;
      onConsume?.();
    };
    const settle = () => {
      if (done) return;
      consume();
      return cancel();
    };
    const present = () => {
      if (done) return;
      const state = store.getState();
      if (abandonedByState(state)) return settle();
      let restoreFocus = false;
      if (!element) {
        element = resolveElement(state);
        if (!element) return;
      } else if (!element.isConnected) {
        restoreFocus = focused && !focusLeftElement && getActiveElement(element) === getDocument(element).body;
        element = resolveElement(state);
        if (!element) return settle();
      }
      if (restoreFocus) focused = false;
      else if (!stillOwnsFocus(element)) return settle();
      const focusWithheld = focus && startedOnComposite && entersClosedPopup(state, element);
      if (focusWithheld) {
        const { activeId } = state;
        if (activeId != null && activeId !== resolvedId) return settle();
      }
      if (focus && !focused && !focusWithheld) {
        focused = true;
        consume();
        focusLeftElement = false;
        const itemElement = element;
        removeFocusListeners?.();
        const onBlur = () => {
          focusLeftElement = !unmountingItems.has(itemElement);
        };
        const onFocus = () => {
          focusLeftElement = false;
        };
        itemElement.addEventListener("blur", onBlur);
        itemElement.addEventListener("focus", onFocus);
        removeFocusListeners = () => {
          itemElement.removeEventListener("blur", onBlur);
          itemElement.removeEventListener("focus", onFocus);
        };
        withCompositeScrollPreserved(store, () => {
          itemElement.focus({ preventScroll: true });
        });
        if (done) return;
      }
      if (markedOnly && !element.hasAttribute("data-autofocus")) {
        if (focusWithheld) return;
        return settle();
      }
      if (!isVisible(element)) return;
      if ("unstable_placing" in state && state.unstable_placing) return;
      if (!focusWithheld) settle();
      if (scrollIntoView) {
        scrollIntoView(element);
        return;
      }
      element.scrollIntoView({
        block: "nearest",
        inline: "nearest"
      });
    };
    unsubscribe = subscribe(store, [
      "activeId",
      "items",
      "mounted",
      "open",
      "unstable_placing"
    ], present);
    present();
    return Object.assign(cancel, { settle });
  }
  function usePresentItem(store) {
    const cancelRef = (0, import_react52.useRef)(null);
    const ownerRef = (0, import_react52.useRef)(store);
    const cancel = (0, import_react52.useCallback)(() => {
      cancelRef.current?.();
      cancelRef.current = null;
    }, []);
    const present = (0, import_react52.useCallback)((params) => {
      if (!store) return;
      if (ownerRef.current !== store) return;
      cancelRef.current?.settle();
      cancelRef.current = null;
      const cancelCurrent = presentItem({
        store,
        ...params
      });
      cancelRef.current = cancelCurrent;
      return cancelCurrent;
    }, [store]);
    useSafeLayoutEffect(() => {
      ownerRef.current = store;
      return () => {
        ownerRef.current = void 0;
        cancel();
      };
    }, [store, cancel]);
    return present;
  }
  function getEnabledItem(store, id) {
    if (!id) return null;
    return store.item(id) || null;
  }
  function selectTextField(element, collapseToEnd = false) {
    if (isTextField(element)) element.setSelectionRange(collapseToEnd ? element.value.length : 0, element.value.length);
    else if (element.isContentEditable) {
      const selection = getDocument(element).getSelection();
      selection?.selectAllChildren(element);
      if (collapseToEnd) selection?.collapseToEnd();
    }
  }
  var FOCUS_SILENTLY = /* @__PURE__ */ Symbol("FOCUS_SILENTLY");
  function focusSilently(element) {
    element[FOCUS_SILENTLY] = true;
    element.focus({ preventScroll: true });
  }
  function silentlyFocused(element) {
    const isSilentlyFocused = element[FOCUS_SILENTLY];
    delete element[FOCUS_SILENTLY];
    return isSilentlyFocused;
  }
  function isItem(store, element, exclude) {
    if (!element) return false;
    if (element === exclude) return false;
    const item = store.item(element.id);
    if (!item) return false;
    if (exclude && item.element === exclude) return false;
    return true;
  }

  // node_modules/@ariakit/react-components/dist/composite/composite-item.js
  var import_react53 = __toESM(require_react(), 1);
  var import_jsx_runtime143 = __toESM(require_jsx_runtime(), 1);

  // node_modules/@ariakit/react-store/dist/index.js
  var React146 = __toESM(require_react(), 1);
  var import_shim3 = __toESM(require_shim(), 1);
  var noopSubscribe = () => () => {
  };
  function isStoreKeyArray(value) {
    return Array.isArray(value);
  }
  function isSameValue2(value, other) {
    return value === other || value !== value && other !== other;
  }
  function hasSameStoreKeys(keys, otherKeys) {
    if (keys?.length !== otherKeys.length) return false;
    for (let index2 = 0; index2 < keys.length; index2 += 1) {
      const key = keys[index2];
      if (isSameValue2(key, otherKeys[index2])) continue;
      return false;
    }
    return true;
  }
  function useStableStoreKeys(keys) {
    const [stableKeys, setStableKeys] = React146.useState(() => keys === null ? null : [...keys]);
    if (keys === null) {
      if (stableKeys !== null) setStableKeys(null);
      return null;
    }
    if (hasSameStoreKeys(stableKeys, keys)) return stableKeys;
    const nextKeys = [...keys];
    setStableKeys(nextKeys);
    return nextKeys;
  }
  function useStoreState(store, keyOrKeysOrSelector = identity, selector2) {
    const subscriptionKeys = useStableStoreKeys(isStoreKeyArray(keyOrKeysOrSelector) ? keyOrKeysOrSelector : typeof keyOrKeysOrSelector === "function" ? null : [keyOrKeysOrSelector]);
    const storeSubscribe = React146.useCallback((callback) => {
      if (!store) return noopSubscribe();
      if (subscriptionKeys?.length === 0) return noopSubscribe();
      return subscribe(store, subscriptionKeys, callback);
    }, [store, subscriptionKeys]);
    const getSnapshot = () => {
      const state = store?.getState();
      if (isStoreKeyArray(keyOrKeysOrSelector)) return selector2?.(state);
      if (typeof keyOrKeysOrSelector === "function") return keyOrKeysOrSelector(state);
      if (!state) return;
      if (!hasOwnProperty(state, keyOrKeysOrSelector)) return;
      return state[keyOrKeysOrSelector];
    };
    return (0, import_shim3.useSyncExternalStore)(storeSubscribe, getSnapshot, getSnapshot);
  }
  function getStoreStateObjectKeys(object, selectorKeys) {
    const keys = [];
    let hasSelector = false;
    for (const prop in object) {
      const keyOrSelector = object[prop];
      if (keyOrSelector === void 0) continue;
      if (typeof keyOrSelector === "function") {
        hasSelector = true;
        continue;
      }
      if (keys.includes(keyOrSelector)) continue;
      keys.push(keyOrSelector);
    }
    if (!hasSelector) return keys;
    if (!selectorKeys) return null;
    for (const key of selectorKeys) {
      if (keys.includes(key)) continue;
      keys.push(key);
    }
    return keys;
  }
  function useStoreStateObject(store, objectOrKeys, object) {
    const stateObject = isStoreKeyArray(objectOrKeys) ? object ?? {} : objectOrKeys;
    const selectorKeys = isStoreKeyArray(objectOrKeys) ? objectOrKeys : void 0;
    const objRef = React146.useRef({});
    const subscriptionKeys = useStableStoreKeys(getStoreStateObjectKeys(stateObject, selectorKeys));
    const storeSubscribe = React146.useCallback((callback) => {
      if (!store) return noopSubscribe();
      if (subscriptionKeys?.length === 0) return noopSubscribe();
      return subscribe(store, subscriptionKeys, callback);
    }, [store, subscriptionKeys]);
    const getSnapshot = () => {
      const state = store?.getState();
      let updated = false;
      const obj = objRef.current;
      for (const prop in stateObject) {
        const keyOrSelector = stateObject[prop];
        if (keyOrSelector === void 0) continue;
        if (typeof keyOrSelector === "function") {
          const value2 = keyOrSelector(state);
          if (!Object.is(value2, obj[prop])) {
            obj[prop] = value2;
            updated = true;
          }
        }
        if (typeof keyOrSelector === "function") continue;
        const value = state && hasOwnProperty(state, keyOrSelector) ? state[keyOrSelector] : void 0;
        if (!Object.is(value, obj[prop])) {
          obj[prop] = value;
          updated = true;
        }
      }
      if (updated) objRef.current = { ...obj };
      return objRef.current;
    };
    return (0, import_shim3.useSyncExternalStore)(storeSubscribe, getSnapshot, getSnapshot);
  }
  function useStoreProps(store, props, key, setKey) {
    const value = hasOwnProperty(props, key) ? props[key] : void 0;
    const setValue = setKey ? props[setKey] : void 0;
    const hasSetValue = !!setValue;
    const propsRef = useLiveRef({
      value,
      setValue
    });
    useSafeLayoutEffect(() => {
      if (!hasSetValue) return;
      return subscribe(store, [key], (state, prev) => {
        const { value: value2, setValue: setValue2 } = propsRef.current;
        if (!setValue2) return;
        if (isSameValue2(state[key], prev[key])) return;
        if (isSameValue2(state[key], value2)) return;
        setValue2(state[key]);
      });
    }, [
      store,
      key,
      hasSetValue,
      propsRef
    ]);
    useSafeLayoutEffect(() => {
      if (value === void 0) return;
      store.setState(key, value);
      return batch(store, [key], () => {
        if (value === void 0) return;
        store.setState(key, value);
      });
    });
  }
  function useStore2(createStore2, props) {
    const [store, setStore] = React146.useState(() => createStore2(props));
    useSafeLayoutEffect(() => init(store), [store]);
    const useState58 = React146.useCallback((keyOrSelector) => useStoreState(store, keyOrSelector), [store]);
    return [React146.useMemo(() => ({
      ...store,
      useState: useState58
    }), [store, useState58]), useEvent(() => {
      setStore((store2) => createStore2({
        ...props,
        ...store2.getState()
      }));
    })];
  }

  // node_modules/@ariakit/react-components/dist/composite/composite-item.js
  var TagName4 = "button";
  function isEditableElement(element) {
    if (isTextbox(element)) return true;
    return element.tagName === "INPUT" && !isButton(element);
  }
  function getNextPageOffset(scrollingElement, pageUp = false) {
    const height = scrollingElement.clientHeight;
    const { top } = scrollingElement.getBoundingClientRect();
    const pageSize = Math.max(height * 0.875, height - 40) * 1.5;
    const pageOffset = pageUp ? height - pageSize + top : pageSize + top;
    if (scrollingElement.tagName === "HTML") return pageOffset + scrollingElement.scrollTop;
    return pageOffset;
  }
  function getItemOffset(itemElement, pageUp = false) {
    const { top } = itemElement.getBoundingClientRect();
    if (pageUp) return top + itemElement.clientHeight;
    return top;
  }
  function findNextPageItemId(element, store, next, pageUp = false) {
    if (!store) return;
    if (!next) return;
    const { renderedItems } = store.getState();
    const scrollingElement = getScrollingElement(element);
    if (!scrollingElement) return;
    const nextPageOffset = getNextPageOffset(scrollingElement, pageUp);
    let id;
    let prevDifference;
    for (let i = 0; i < renderedItems.length; i += 1) {
      const previousId = id;
      id = next(i);
      if (!id) break;
      if (id === previousId) continue;
      const itemElement = getEnabledItem(store, id)?.element;
      if (!itemElement) continue;
      const difference = getItemOffset(itemElement, pageUp) - nextPageOffset;
      const absDifference = Math.abs(difference);
      if (pageUp && difference <= 0 || !pageUp && difference >= 0) {
        if (prevDifference !== void 0 && prevDifference < absDifference) id = previousId;
        break;
      }
      prevDifference = absDifference;
    }
    return id;
  }
  function targetIsAnotherItem(event, store) {
    if (isSelfTarget(event)) return false;
    return isItem(store, event.target);
  }
  var useCompositeItem2 = createHook(function useCompositeItem3({ store, rowId: rowIdProp, preventScrollOnKeyDown = false, moveOnKeyPress = true, tabbable: tabbable2 = false, getItem: getItemProp, typeaheadText, "aria-setsize": ariaSetSizeProp, "aria-posinset": ariaPosInSetProp, unstable_scrollIntoView: scrollIntoView, ...props }) {
    const context = useCompositeScopedContext();
    store = store || context;
    const accessibleWhenDisabled = accessibleWhenDisabledFromProps(props);
    const id = useId7(props.id);
    const ref = (0, import_react53.useRef)(null);
    const mountedElementRef = (0, import_react53.useRef)(null);
    const markUnmountingRef = (0, import_react53.useCallback)((element) => {
      const mountedElement = mountedElementRef.current;
      if (!element && mountedElement) markItemUnmounting(mountedElement);
      if (element) markItemMounted(element);
      mountedElementRef.current = element;
    }, []);
    const row = (0, import_react53.useContext)(CompositeRowContext);
    const disabled2 = disabledFromProps(props);
    const trulyDisabled = disabled2 && !accessibleWhenDisabled;
    const inactiveDisabled = disabled2 && props.focusable === false;
    const shouldRegisterItem = props.shouldRegisterItem;
    const getRowId = (state) => {
      if (rowIdProp) return rowIdProp;
      if (!state) return;
      if (!row?.compositeElement) return;
      if (row.compositeElement !== state.compositeElement) return;
      return row.id;
    };
    const { rowId, compositeElement, ariaSetSize, ariaPosInSet } = useStoreStateObject(store, ["compositeElement", "renderedItems"], {
      rowId: getRowId,
      compositeElement(state) {
        return state?.compositeElement || void 0;
      },
      ariaSetSize(state) {
        if (ariaSetSizeProp != null) return ariaSetSizeProp;
        if (!state) return;
        if (!row?.ariaSetSize) return;
        if (row.compositeElement !== state.compositeElement) return;
        return row.ariaSetSize;
      },
      ariaPosInSet(state) {
        if (ariaPosInSetProp != null) return ariaPosInSetProp;
        if (!state) return;
        if (!row?.ariaPosInSet) return;
        if (row.compositeElement !== state.compositeElement) return;
        const rowId2 = getRowId(state);
        const itemsInRow = state.renderedItems.filter((item) => item.rowId === rowId2);
        return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id);
      }
    });
    const { isActiveItem, isTabbable: isTabbable2 } = useStoreStateObject(store, [
      "activeId",
      "compositeElement",
      "renderedItems",
      "virtualFocus",
      "items"
    ], {
      isActiveItem(state) {
        return !!state && state.activeId === id;
      },
      isTabbable(state) {
        if (!state) return true;
        if (!state.compositeElement && !state.renderedItems.length) return true;
        if (state.virtualFocus) return false;
        if (!state.renderedItems.length) return true;
        if (tabbable2) return true;
        if (state.activeId === null) return false;
        const item = store?.item(state.activeId);
        if (item?.disabled) return true;
        if (!item?.element) return true;
        return state.activeId === id;
      }
    });
    const getItem = (0, import_react53.useCallback)((item) => {
      const itemDisabled = (item.element ? resolvedTrulyDisabledFromElement(item.element) : void 0) ?? (inactiveDisabled || trulyDisabled);
      const nextItem = {
        ...item,
        id: id || item.id,
        rowId,
        disabled: itemDisabled,
        children: item.element?.textContent,
        typeaheadText
      };
      if (getItemProp) return getItemProp(nextItem);
      return nextItem;
    }, [
      id,
      rowId,
      inactiveDisabled,
      trulyDisabled,
      typeaheadText,
      getItemProp
    ]);
    const onFocusProp = props.onFocus;
    const hasFocusedComposite = (0, import_react53.useRef)(false);
    const cancelScheduledFocusRedirectRef = (0, import_react53.useRef)(null);
    const present = usePresentItem(store);
    const onFocus = useEvent((event) => {
      onFocusProp?.(event);
      if (event.defaultPrevented) return;
      if (isPortalEvent(event)) return;
      if (!id) return;
      if (!store) return;
      if (targetIsAnotherItem(event, store)) return;
      const { virtualFocus, compositeElement: compositeElement2 } = store.getState();
      store.setActiveId(id);
      if (isTextbox(event.currentTarget)) selectTextField(event.currentTarget);
      if (!virtualFocus) {
        if (isSelfTarget(event) && store.item(id)) present({
          id,
          markedOnly: true,
          requireFocus: true,
          scrollIntoView
        });
        return;
      }
      if (!isSelfTarget(event)) return;
      if (isEditableElement(event.currentTarget)) return;
      const redirectFocusToCompositeElement = (relatedTarget2, compositeElement3) => {
        if (!isFocusable(compositeElement3)) {
          if (true) warnOnce("A composite widget with `virtualFocus` enabled requires a focusable composite element. Set the `focusable` prop to `true` or the `virtualFocus` option to `false`.", compositeElement3);
          return;
        }
        const fromComposite = relatedTarget2 === compositeElement3 || isItem(store, relatedTarget2);
        if (store.item(id)) present({
          id,
          markedOnly: true,
          requireFocus: true,
          scrollIntoView
        });
        hasFocusedComposite.current = true;
        if (fromComposite) focusSilently(compositeElement3);
        else compositeElement3.focus({ preventScroll: true });
      };
      if (compositeElement2?.isConnected) {
        redirectFocusToCompositeElement(event.relatedTarget, compositeElement2);
        return;
      }
      if (shouldRegisterItem === false) return;
      const { currentTarget, relatedTarget } = event;
      const cancelScheduledFocusRedirect = () => {
        cancelScheduledFocusRedirectRef.current?.();
        cancelScheduledFocusRedirectRef.current = null;
      };
      cancelScheduledFocusRedirect();
      cancelScheduledFocusRedirectRef.current = subscribe(store, null, () => {
        if (getActiveElement(currentTarget) !== currentTarget) {
          cancelScheduledFocusRedirect();
          return;
        }
        const state = store.getState();
        const nextCompositeElement = state.compositeElement;
        if (!nextCompositeElement?.isConnected) return;
        cancelScheduledFocusRedirect();
        if (!state.virtualFocus) return;
        redirectFocusToCompositeElement(relatedTarget, nextCompositeElement);
      });
    });
    const onBlurCaptureProp = props.onBlurCapture;
    const onBlurCapture = useEvent((event) => {
      onBlurCaptureProp?.(event);
      if (event.defaultPrevented) return;
      if (store?.getState()?.virtualFocus && hasFocusedComposite.current) {
        hasFocusedComposite.current = false;
        event.preventDefault();
        event.stopPropagation();
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown);
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    const onKeyDown = useEvent((event) => {
      onKeyDownProp?.(event);
      if (event.defaultPrevented) return;
      if (!isSelfTarget(event)) return;
      if (!store) return;
      const { currentTarget } = event;
      const state = store.getState();
      const isGrid2 = !!store.item(id)?.rowId;
      const isVertical = state.orientation !== "horizontal";
      const isHorizontal = state.orientation !== "vertical";
      const canHomeEnd = () => {
        if (isGrid2) return true;
        if (isHorizontal) return true;
        if (!state.compositeElement) return true;
        if (!isTextField(state.compositeElement)) return true;
        return false;
      };
      const action = {
        ArrowUp: (isGrid2 || isVertical) && store.up,
        ArrowRight: (isGrid2 || isHorizontal) && store.next,
        ArrowDown: (isGrid2 || isVertical) && store.down,
        ArrowLeft: (isGrid2 || isHorizontal) && store.previous,
        Home: () => {
          if (!canHomeEnd()) return;
          if (!isGrid2 || event.ctrlKey) return store?.first();
          return store?.previous(-1);
        },
        End: () => {
          if (!canHomeEnd()) return;
          if (!isGrid2 || event.ctrlKey) return store?.last();
          return store?.next(-1);
        },
        PageUp: () => {
          return findNextPageItemId(currentTarget, store, store?.up, true);
        },
        PageDown: () => {
          return findNextPageItemId(currentTarget, store, store?.down);
        }
      }[event.key];
      if (action) {
        if (isTextbox(currentTarget)) {
          const selection = getTextboxSelection(currentTarget);
          const isLeft = isHorizontal && event.key === "ArrowLeft";
          const isRight = isHorizontal && event.key === "ArrowRight";
          const isUp = isVertical && event.key === "ArrowUp";
          const isDown = isVertical && event.key === "ArrowDown";
          if (isRight || isDown) {
            const { length: valueLength } = getTextboxValue(currentTarget);
            if (selection.end !== valueLength) return;
          } else if ((isLeft || isUp) && selection.start !== 0) return;
        }
        const nextId = action();
        if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
          if (!moveOnKeyPressProp(event)) return;
          event.preventDefault();
          store.move(nextId);
        }
      }
    });
    const providerValue = (0, import_react53.useMemo)(() => ({
      id,
      compositeElement
    }), [id, compositeElement]);
    props = useWrapElement(props, (element) => /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(CompositeItemContext.Provider, {
      value: providerValue,
      children: element
    }), [providerValue]);
    props = {
      "data-active-item": isActiveItem || void 0,
      ...props,
      id,
      ref: useMergeRefs5(ref, markUnmountingRef, props.ref),
      tabIndex: isTabbable2 ? props.tabIndex : -1,
      onFocus,
      onBlurCapture,
      onKeyDown
    };
    props = useCommand(props);
    props = useCollectionItem({
      store,
      ...props,
      getItem,
      shouldRegisterItem: id ? shouldRegisterItem : false
    });
    return {
      ...props,
      "aria-setsize": ariaSetSize,
      "aria-posinset": ariaPosInSet
    };
  });
  var CompositeItem2 = memo4(forwardRef89(function CompositeItem3(props) {
    const htmlProps = useCompositeItem2(withDefaultButtonType(props));
    return createElement3(TagName4, htmlProps);
  }));

  // node_modules/@ariakit/react-components/dist/__chunks/C5dZ32Pk.js
  var cancelled = /* @__PURE__ */ Symbol("cancelled");
  var moveRequests = /* @__PURE__ */ new WeakMap();
  function getMoveRequest(store) {
    const key = store.item;
    const cached = moveRequests.get(key);
    if (cached) return cached;
    const request = {
      consumedBy: null,
      targetId: store.getState().activeId
    };
    moveRequests.set(key, request);
    sync(store, ["moves", "activeId"], (state, prevState) => {
      if (state.moves !== prevState.moves) {
        request.consumedBy = null;
        request.targetId = state.activeId;
        return;
      }
      if (state.activeId !== prevState.activeId) request.targetId = cancelled;
    });
    return request;
  }

  // node_modules/@ariakit/react-components/dist/composite/composite.js
  var import_react54 = __toESM(require_react(), 1);
  var import_jsx_runtime144 = __toESM(require_jsx_runtime(), 1);
  var TagName5 = "div";
  function isGrid(items) {
    return items.some((item) => !!item.rowId);
  }
  function isPrintableKey(event) {
    const target = event.target;
    if (target && !isTextField(target)) return false;
    return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
  }
  function isModifierKey(event) {
    return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta";
  }
  function useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) {
    return useEvent((event) => {
      onKeyboardEvent?.(event);
      if (event.defaultPrevented) return;
      if (event.isPropagationStopped()) return;
      if (!isSelfTarget(event)) return;
      if (isModifierKey(event)) return;
      if (isPrintableKey(event)) return;
      const state = store.getState();
      const activeElement2 = getEnabledItem(store, state.activeId)?.element;
      if (!activeElement2) return;
      const { view, ...eventInit } = event;
      if (activeElement2 !== previousElementRef?.current) activeElement2.focus({ preventScroll: true });
      if (!fireKeyboardEvent(activeElement2, event.type, eventInit)) event.preventDefault();
      if (event.currentTarget.contains(activeElement2)) event.stopPropagation();
    });
  }
  function findFirstEnabledItemInTheLastRow(items) {
    return findFirstEnabledItem2(flatten2DArray(reverseArray(groupItemsByRows2(items))));
  }
  function mayActOnMove(store, instance) {
    const { consumedBy } = getMoveRequest(store);
    return !consumedBy || consumedBy === instance;
  }
  function consumeMove(store, instance, moves) {
    if (store.getState().moves !== moves) return;
    getMoveRequest(store).consumedBy = instance;
  }
  var CompositeFocusOnMove = memo4(function CompositeFocusOnMove2({ store, focusOnMove, previousElementRef, present, scrollIntoView }) {
    const moves = useStoreState(store, "moves");
    const compositeElement = useStoreState(store, "compositeElement");
    const instanceRef = (0, import_react54.useRef)({});
    (0, import_react54.useEffect)(() => {
      const moveRequest = getMoveRequest(store);
      if (!moves) return;
      if (!focusOnMove) return;
      const instance = instanceRef.current;
      if (!mayActOnMove(store, instance)) return;
      const { activeId } = store.getState();
      if (activeId == null) return;
      if (activeId !== moveRequest.targetId) return;
      return present({
        id: activeId,
        requireFocus: ownsFocus(store),
        focus: true,
        scrollIntoView,
        onConsume: () => consumeMove(store, instance, moves)
      });
    }, [
      store,
      moves,
      focusOnMove,
      compositeElement,
      present,
      scrollIntoView
    ]);
    useSafeLayoutEffect(() => {
      const moveRequest = getMoveRequest(store);
      if (!moves) return;
      if (!compositeElement) return;
      const instance = instanceRef.current;
      if (!mayActOnMove(store, instance)) return;
      const { activeId } = store.getState();
      if (!(activeId === null)) return;
      if (activeId !== moveRequest.targetId) return;
      consumeMove(store, instance, moves);
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (previousElement) fireBlurEvent(previousElement, { relatedTarget: compositeElement });
      if (!hasFocus(compositeElement)) {
        if (isFocusable(compositeElement)) compositeElement.scrollIntoView({
          block: "nearest",
          inline: "nearest"
        });
        compositeElement.focus({ preventScroll: true });
      }
    }, [
      store,
      moves,
      compositeElement,
      previousElementRef
    ]);
    return null;
  });
  var useComposite = createHook(function useComposite2({ store, composite = true, focusOnMove = composite, moveOnKeyPress = true, unstable_scrollIntoView: scrollIntoView, ...props }) {
    const context = useCompositeProviderContext();
    store = store || context;
    invariant(store, "Composite must receive a `store` prop or be wrapped in a CompositeProvider component.");
    const ref = (0, import_react54.useRef)(null);
    const previousElementRef = (0, import_react54.useRef)(null);
    const present = usePresentItem(store);
    const [, setCompositeElement] = useTransactionState(composite ? store.setCompositeElement : null);
    const virtualFocus = useStoreState(store, "virtualFocus");
    const activeId = useStoreState(store, composite && virtualFocus ? ["activeId"] : [], (state) => composite && virtualFocus ? state.activeId : null);
    useSafeLayoutEffect(() => {
      if (!store) return;
      if (!composite) return;
      if (!virtualFocus) return;
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (!previousElement) return;
      const relatedTarget = getEnabledItem(store, activeId)?.element || getActiveElement(previousElement);
      if (relatedTarget === previousElement) return;
      fireBlurEvent(previousElement, { relatedTarget });
    }, [
      store,
      activeId,
      virtualFocus,
      composite
    ]);
    const onKeyDownCapture = useKeyboardEventProxy(store, props.onKeyDownCapture, previousElementRef);
    const onKeyUpCapture = useKeyboardEventProxy(store, props.onKeyUpCapture, previousElementRef);
    const onFocusCaptureProp = props.onFocusCapture;
    const onFocusCapture = useEvent((event) => {
      onFocusCaptureProp?.(event);
      if (event.defaultPrevented) return;
      if (!store) return;
      const { virtualFocus: virtualFocus2 } = store.getState();
      if (!virtualFocus2) return;
      const previousActiveElement = event.relatedTarget;
      const isSilentlyFocused = silentlyFocused(event.currentTarget);
      if (isSelfTarget(event) && isSilentlyFocused) {
        event.stopPropagation();
        previousElementRef.current = previousActiveElement;
      }
    });
    const onFocusProp = props.onFocus;
    const onFocus = useEvent((event) => {
      onFocusProp?.(event);
      if (event.defaultPrevented) return;
      if (!composite) return;
      if (!store) return;
      const { relatedTarget } = event;
      const { virtualFocus: virtualFocus2 } = store.getState();
      if (virtualFocus2) {
        if (isSelfTarget(event) && !isItem(store, relatedTarget)) queueMicrotask(() => present({
          focus: true,
          markedOnly: true,
          requireFocus: true,
          scrollIntoView
        }));
      } else if (isSelfTarget(event)) {
        if (!isItem(store, relatedTarget)) {
          const { activeId: activeId2 } = store.getState();
          if (activeId2 != null) present({
            id: activeId2,
            markedOnly: true,
            requireFocus: true,
            scrollIntoView
          });
        }
        store.setActiveId(null);
      }
    });
    const onBlurCaptureProp = props.onBlurCapture;
    const onBlurCapture = useEvent((event) => {
      onBlurCaptureProp?.(event);
      if (event.defaultPrevented) return;
      if (!store) return;
      const { virtualFocus: virtualFocus2, activeId: activeId2, compositeElement } = store.getState();
      if (!virtualFocus2) return;
      if (event.currentTarget !== compositeElement) return;
      const activeElement2 = getEnabledItem(store, activeId2)?.element;
      const nextActiveElement = event.relatedTarget;
      const nextActiveElementIsItem = isItem(store, nextActiveElement);
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (isSelfTarget(event) && nextActiveElementIsItem) {
        if (nextActiveElement === activeElement2) {
          if (previousElement && previousElement !== nextActiveElement) fireBlurEvent(previousElement, event);
        } else if (activeElement2) fireBlurEvent(activeElement2, event);
        else if (previousElement) fireBlurEvent(previousElement, event);
        event.stopPropagation();
      } else if (!isItem(store, event.target) && activeElement2) fireBlurEvent(activeElement2, event);
    });
    const onKeyDownProp = props.onKeyDown;
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    const onKeyDown = useEvent((event) => {
      onKeyDownProp?.(event);
      if (event.nativeEvent.isComposing) return;
      if (event.defaultPrevented) return;
      if (!store) return;
      if (!isSelfTarget(event)) return;
      const { orientation, items, renderedItems, activeId: activeId2, rtl } = store.getState();
      const activeItem = getEnabledItem(store, activeId2);
      if (activeItem?.element?.isConnected) return;
      const elementlessActiveItem = activeItem && activeId2 != null;
      const movementItems = elementlessActiveItem ? items : renderedItems;
      const isVertical = orientation !== "horizontal";
      const isHorizontal = orientation !== "vertical";
      const grid = isGrid(movementItems);
      if ((event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End") && isTextField(event.currentTarget)) return;
      const up = () => {
        if (elementlessActiveItem) return store.up({
          activeId: activeId2,
          renderedItems: movementItems
        });
        if (grid) return findFirstEnabledItemInTheLastRow(renderedItems)?.id;
        return store?.last();
      };
      const right = () => {
        if (elementlessActiveItem) return store.next({
          activeId: activeId2,
          renderedItems: movementItems
        });
        return rtl ? store.last() : store.first();
      };
      const down = () => {
        if (elementlessActiveItem) return store.down({
          activeId: activeId2,
          renderedItems: movementItems
        });
        return store.first();
      };
      const left = () => {
        if (elementlessActiveItem) return store.previous({
          activeId: activeId2,
          renderedItems: movementItems
        });
        return rtl ? store.first() : store.last();
      };
      const action = {
        ArrowUp: (grid || isVertical) && up,
        ArrowRight: (grid || isHorizontal) && right,
        ArrowDown: (grid || isVertical) && down,
        ArrowLeft: (grid || isHorizontal) && left,
        Home: store.first,
        End: store.last,
        PageUp: store.first,
        PageDown: store.last
      }[event.key];
      if (action) {
        const id = action();
        if (id !== void 0) {
          if (!moveOnKeyPressProp(event)) return;
          event.preventDefault();
          store.move(id);
        }
      }
    });
    props = useWrapElement(props, (element) => /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(CompositeScopedContextProvider, {
      value: store,
      children: [element, composite && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(CompositeFocusOnMove, {
        store,
        focusOnMove,
        previousElementRef,
        present,
        scrollIntoView
      })]
    }), [
      store,
      composite,
      focusOnMove,
      present
    ]);
    props = {
      "aria-activedescendant": useStoreState(store, composite && virtualFocus ? ["items"] : [], () => {
        if (!store) return;
        if (!composite) return;
        if (!virtualFocus) return;
        return getEnabledItem(store, activeId)?.id;
      }),
      ...props,
      ref: useMergeRefs5(ref, setCompositeElement, props.ref),
      onKeyDownCapture,
      onKeyUpCapture,
      onFocusCapture,
      onFocus,
      onBlurCapture,
      onKeyDown
    };
    const focusable2 = useStoreState(store, composite && !virtualFocus ? ["activeId"] : [], (state) => composite && (virtualFocus || state.activeId === null));
    props = useFocusable({
      focusable: focusable2,
      ...props
    });
    return props;
  });
  var Composite6 = forwardRef89(function Composite7(props) {
    const htmlProps = useComposite(props);
    return createElement3(TagName5, htmlProps);
  });

  // node_modules/@ariakit/react-components/dist/disclosure/disclosure-context.js
  var ctx3 = createStoreContext();
  var useDisclosureContext = ctx3.useContext;
  var useDisclosureScopedContext = ctx3.useScopedContext;
  var useDisclosureProviderContext = ctx3.useProviderContext;
  var DisclosureContextProvider = ctx3.ContextProvider;
  var DisclosureScopedContextProvider = ctx3.ScopedContextProvider;

  // node_modules/@ariakit/react-components/dist/dialog/dialog-context.js
  var import_react55 = __toESM(require_react(), 1);
  var ctx4 = createStoreContext([DisclosureContextProvider], [DisclosureScopedContextProvider]);
  var useDialogContext = ctx4.useContext;
  var useDialogScopedContext = ctx4.useScopedContext;
  var useDialogProviderContext = ctx4.useProviderContext;
  var DialogContextProvider = ctx4.ContextProvider;
  var DialogScopedContextProvider = ctx4.ScopedContextProvider;
  var DialogHeadingContext = (0, import_react55.createContext)(void 0);
  var DialogDescriptionContext = (0, import_react55.createContext)(void 0);

  // node_modules/@ariakit/react-components/dist/disclosure/disclosure-content.js
  var import_react56 = __toESM(require_react(), 1);
  var import_jsx_runtime145 = __toESM(require_jsx_runtime(), 1);
  var import_react_dom3 = __toESM(require_react_dom(), 1);
  var TagName6 = "div";
  function afterTimeout(timeoutMs, cb) {
    const timeoutId = setTimeout(cb, timeoutMs);
    return () => clearTimeout(timeoutId);
  }
  function parseCSSTime(time) {
    const value = time?.trim() || "0s";
    const multiplier = value.endsWith("ms") ? 1 : 1e3;
    const parsed = Number.parseFloat(value) * multiplier;
    return Number.isNaN(parsed) ? 0 : parsed;
  }
  function getEndTime(names, delays, durations) {
    const nameList = names.split(",");
    const delayList = delays.split(",");
    const durationList = durations.split(",");
    let endTime = 0;
    for (const [index2, name] of nameList.entries()) {
      if (name.trim() === "none") continue;
      const delay = parseCSSTime(delayList[index2 % delayList.length]);
      const duration = parseCSSTime(durationList[index2 % durationList.length]);
      endTime = Math.max(endTime, delay + duration);
    }
    return endTime;
  }
  function getElementEndTime(element) {
    const { transitionProperty, transitionDuration, transitionDelay, animationName, animationDuration, animationDelay } = getComputedStyle(element);
    return Math.max(getEndTime(transitionProperty, transitionDelay, transitionDuration), getEndTime(animationName, animationDelay, animationDuration));
  }
  function isHidden(mounted, hidden, alwaysVisible) {
    return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
  }
  var useDisclosureContent = createHook(function useDisclosureContent2({ store, alwaysVisible, unstable_otherElementRef: otherElementRef, ...props }) {
    const context = useDisclosureProviderContext();
    store = store || context;
    invariant(store, "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component.");
    const ref = (0, import_react56.useRef)(null);
    const id = useId7(props.id);
    const [transition, setTransition] = (0, import_react56.useState)(null);
    const { open: open2, mounted, animated, contentElement } = useStoreStateObject(store, {
      open: "open",
      mounted: "mounted",
      animated: "animated",
      contentElement: "contentElement"
    });
    const otherElement = useStoreState(store.disclosure, "contentElement");
    const hasClosedRef = (0, import_react56.useRef)(false);
    useSafeLayoutEffect(() => {
      if (!ref.current) return;
      store?.setContentElement(ref.current);
    }, [store]);
    useSafeLayoutEffect(() => {
      let previousAnimated;
      store?.setState("animated", (animated2) => {
        previousAnimated = animated2;
        return true;
      });
      return () => {
        if (previousAnimated === void 0) return;
        store?.setState("animated", previousAnimated);
      };
    }, [store]);
    useSafeLayoutEffect(() => {
      if (!animated) {
        if (!open2) {
          hasClosedRef.current = true;
          setTransition(null);
        } else if (hasClosedRef.current) {
          hasClosedRef.current = false;
          setTransition("enter");
        }
        return;
      }
      if (!contentElement?.isConnected) {
        setTransition(null);
        return;
      }
      return afterPaint(() => {
        setTransition(open2 ? "enter" : mounted ? "leave" : null);
      });
    }, [
      animated,
      contentElement,
      open2,
      mounted
    ]);
    useSafeLayoutEffect(() => {
      if (!store) return;
      if (!animated) return;
      if (!transition) return;
      if (!contentElement) return;
      const stopAnimation = () => store?.setState("animating", false);
      const stopAnimationSync = () => (0, import_react_dom3.flushSync)(stopAnimation);
      if (transition === "leave" && open2) return;
      if (transition === "enter" && !open2) return;
      if (typeof animated === "number") return afterTimeout(animated, stopAnimationSync);
      const elements = [contentElement];
      if (otherElement) elements.push(otherElement);
      const relatedElement = otherElementRef?.current;
      if (relatedElement) elements.push(relatedElement);
      const timeout = Math.max(...elements.map(getElementEndTime));
      if (!timeout) {
        if (transition === "enter") store.setState("animated", false);
        stopAnimation();
        return;
      }
      return afterTimeout(Math.max(timeout - 1e3 / 60, 0), stopAnimationSync);
    }, [
      store,
      animated,
      contentElement,
      otherElement,
      otherElementRef,
      open2,
      transition
    ]);
    props = useWrapElement(props, (element) => /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(DialogScopedContextProvider, {
      value: store,
      children: element
    }), [store]);
    const hidden = isHidden(mounted, props.hidden, alwaysVisible);
    const styleProp = props.style;
    const style = (0, import_react56.useMemo)(() => {
      if (hidden) return {
        ...styleProp,
        display: "none"
      };
      return styleProp;
    }, [hidden, styleProp]);
    props = {
      "data-open": open2 || void 0,
      "data-enter": transition === "enter" || void 0,
      "data-leave": transition === "leave" || void 0,
      hidden,
      ...props,
      id,
      ref: useMergeRefs5(id ? store.setContentElement : null, ref, props.ref),
      style
    };
    return removeUndefinedValues(props);
  });
  var DisclosureContentImpl = forwardRef89(function DisclosureContentImpl2(props) {
    const htmlProps = useDisclosureContent(props);
    return createElement3(TagName6, htmlProps);
  });
  var DisclosureContent = forwardRef89(function DisclosureContent2({ unmountOnHide, ...props }) {
    const context = useDisclosureProviderContext();
    const store = props.store || context;
    if (useStoreState(store, ["mounted"], (state) => !unmountOnHide || state?.mounted) === false) return null;
    return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(DisclosureContentImpl, { ...props });
  });

  // node_modules/@ariakit/components/dist/disclosure/disclosure-store.js
  function createDisclosureStore(props = {}) {
    const store = props.store || props.disclosure ? mergeStore(props.store, omit2(props.disclosure, ["contentElement", "disclosureElement"])) : void 0;
    throwOnConflictingProps(props, store);
    const syncState = store?.getState();
    const open2 = defaultValue(props.open, syncState?.open, props.defaultOpen, false);
    const animated = defaultValue(props.animated, syncState?.animated, false);
    const initialState = {
      open: open2,
      animated,
      animating: !!animated && open2,
      mounted: open2,
      contentElement: defaultValue(syncState?.contentElement, null),
      disclosureElement: defaultValue(syncState?.disclosureElement, null)
    };
    const disclosure = store ? createStore(initialState, store) : createStore(initialState);
    setup(disclosure, () => sync(disclosure, ["animated", "animating"], (state) => {
      if (state.animated) return;
      disclosure.setState("animating", false);
    }));
    setup(disclosure, () => subscribe(disclosure, ["open"], () => {
      if (!disclosure.getState().animated) return;
      disclosure.setState("animating", true);
    }));
    setup(disclosure, () => sync(disclosure, ["open", "animating"], (state) => {
      disclosure.setState("mounted", state.open || state.animating);
    }));
    return {
      ...disclosure,
      disclosure: props.disclosure,
      setOpen: (value) => disclosure.setState("open", value),
      show: () => disclosure.setState("open", true),
      hide: () => disclosure.setState("open", false),
      toggle: () => disclosure.setState("open", (open3) => !open3),
      stopAnimation: () => disclosure.setState("animating", false),
      setContentElement: (value) => disclosure.setState("contentElement", value),
      setDisclosureElement: (value) => disclosure.setState("disclosureElement", value)
    };
  }

  // node_modules/@ariakit/react-components/dist/disclosure/disclosure-store.js
  function useDisclosureStoreProps(store, update2, props) {
    useUpdateEffect(update2, [
      props.store,
      props.disclosure,
      update2
    ]);
    useStoreProps(store, props, "open", "setOpen");
    useStoreProps(store, props, "mounted", "setMounted");
    useStoreProps(store, props, "animated");
    return Object.assign(store, { disclosure: props.disclosure });
  }

  // node_modules/@ariakit/react-components/dist/popover/popover-context.js
  var ctx5 = createStoreContext([DialogContextProvider], [DialogScopedContextProvider]);
  var usePopoverContext = ctx5.useContext;
  var usePopoverScopedContext = ctx5.useScopedContext;
  var usePopoverProviderContext = ctx5.useProviderContext;
  var PopoverContextProvider = ctx5.ContextProvider;
  var PopoverScopedContextProvider = ctx5.ScopedContextProvider;

  // node_modules/@ariakit/react-components/dist/combobox/combobox-context.js
  var import_react57 = __toESM(require_react(), 1);
  var ComboboxListRoleContext = (0, import_react57.createContext)(null);
  var ctx6 = createStoreContext([PopoverContextProvider, CompositeContextProvider], [PopoverScopedContextProvider, CompositeScopedContextProvider]);
  var useComboboxContext = ctx6.useContext;
  var useComboboxScopedContext = ctx6.useScopedContext;
  var useComboboxProviderContext = ctx6.useProviderContext;
  var ComboboxContextProvider = ctx6.ContextProvider;
  var ComboboxScopedContextProvider = ctx6.ScopedContextProvider;
  var ComboboxItemValueContext = (0, import_react57.createContext)(void 0);
  var ComboboxItemCheckedContext = (0, import_react57.createContext)(false);
  var ComboboxHeadingContext = (0, import_react57.createContext)(null);

  // node_modules/@ariakit/react-components/dist/collection/collection-store.js
  function useCollectionStoreProps(store, update2, props) {
    useUpdateEffect(update2, [props.store, update2]);
    useStoreProps(store, props, "items", "setItems");
    return store;
  }

  // node_modules/@ariakit/react-components/dist/composite/composite-store.js
  function useCompositeStoreOptions(props) {
    return {
      id: useId7(props.id),
      ...props
    };
  }
  function useCompositeStoreProps(store, update2, props) {
    store = useCollectionStoreProps(store, update2, props);
    getMoveRequest(store);
    useStoreProps(store, props, "activeId", "setActiveId");
    const focusOrderProps = { compositeElementInFocusOrder: props.compositeElementInFocusOrder ?? props.includesBaseElement };
    useStoreProps(store, focusOrderProps, "compositeElementInFocusOrder");
    useStoreProps(store, props, "virtualFocus");
    useStoreProps(store, props, "orientation");
    useStoreProps(store, props, "rtl");
    useStoreProps(store, props, "focusLoop");
    useStoreProps(store, props, "focusWrap");
    useStoreProps(store, props, "focusShift");
    return store;
  }

  // node_modules/@ariakit/components/dist/dialog/dialog-store.js
  function createDialogStore(props = {}) {
    return createDisclosureStore(props);
  }

  // node_modules/@ariakit/react-components/dist/dialog/dialog-store.js
  function useDialogStoreProps(store, update2, props) {
    return useDisclosureStoreProps(store, update2, props);
  }

  // node_modules/@ariakit/components/dist/popover/popover-store.js
  function createPopoverStore({ popover: otherPopover, ...props } = {}) {
    const store = mergeStore(props.store, omit2(otherPopover, [
      "arrowElement",
      "anchorElement",
      "contentElement",
      "popoverElement",
      "disclosureElement",
      "unstable_placing"
    ]));
    throwOnConflictingProps(props, store);
    const syncState = store?.getState();
    const dialog = createDialogStore({
      ...props,
      store
    });
    const placement = defaultValue(props.placement, syncState?.placement, "bottom");
    const initialState = {
      ...dialog.getState(),
      placement,
      currentPlacement: placement,
      anchorElement: defaultValue(syncState?.anchorElement, null),
      popoverElement: defaultValue(syncState?.popoverElement, null),
      arrowElement: defaultValue(syncState?.arrowElement, null),
      rendered: /* @__PURE__ */ Symbol("rendered"),
      unstable_placing: false
    };
    const popover = createStore(initialState, dialog, store);
    let syncedAnchorElement = initialState.anchorElement === initialState.disclosureElement ? initialState.anchorElement : null;
    setup(popover, () => sync(popover, ["anchorElement", "disclosureElement"], (state) => {
      if (state.anchorElement && state.anchorElement !== syncedAnchorElement) {
        syncedAnchorElement = null;
        return;
      }
      syncedAnchorElement = state.disclosureElement;
      popover.setState("anchorElement", syncedAnchorElement);
    }));
    return {
      ...dialog,
      ...popover,
      setAnchorElement: (element) => popover.setState("anchorElement", element),
      setPopoverElement: (element) => popover.setState("popoverElement", element),
      setArrowElement: (element) => popover.setState("arrowElement", element),
      render: () => popover.setState("rendered", /* @__PURE__ */ Symbol("rendered"))
    };
  }

  // node_modules/@ariakit/react-components/dist/popover/popover-store.js
  function usePopoverStoreProps(store, update2, props) {
    useUpdateEffect(update2, [props.popover, update2]);
    useStoreProps(store, props, "placement");
    return useDialogStoreProps(store, update2, props);
  }

  // node_modules/@ariakit/react-components/dist/composite/composite-hover.js
  var import_react58 = __toESM(require_react(), 1);
  var TagName7 = "div";
  function hoveringInside(event) {
    const nextElement = event.relatedTarget;
    if (!isElement2(nextElement)) return false;
    return contains2(event.currentTarget, nextElement);
  }
  var symbol2 = /* @__PURE__ */ Symbol("composite-hover");
  function movingToAnotherItem(event) {
    const { relatedTarget } = event;
    if (!isElement2(relatedTarget)) return false;
    let dest = relatedTarget;
    do {
      if (hasOwnProperty(dest, symbol2) && dest[symbol2]) return true;
      dest = dest.parentElement;
    } while (dest);
    return false;
  }
  var useCompositeHover = createHook(function useCompositeHover2({ store, focusOnHover = true, blurOnHoverEnd = !!focusOnHover, ...props }) {
    const context = useCompositeScopedContext();
    store = store || context;
    invariant(store, "CompositeHover must be wrapped in a Composite component.");
    const isMouseMoving = useIsMouseMoving();
    const onMouseMoveProp = props.onMouseMove;
    const focusOnHoverProp = useBooleanEvent(focusOnHover);
    const onMouseMove = useEvent((event) => {
      onMouseMoveProp?.(event);
      if (event.defaultPrevented) return;
      if (!isMouseMoving()) return;
      if (!focusOnHoverProp(event)) return;
      if (!hasFocusWithin(event.currentTarget)) {
        const compositeElement = store?.getState().compositeElement;
        if (compositeElement && !hasFocus(compositeElement)) compositeElement.focus({ preventScroll: true });
      }
      store?.setActiveId(event.currentTarget.id);
    });
    const onMouseLeaveProp = props.onMouseLeave;
    const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd);
    const onMouseLeave = useEvent((event) => {
      onMouseLeaveProp?.(event);
      if (event.defaultPrevented) return;
      if (!isMouseMoving()) return;
      if (hoveringInside(event)) return;
      if (movingToAnotherItem(event)) return;
      if (!focusOnHoverProp(event)) return;
      if (!blurOnHoverEndProp(event)) return;
      store?.setActiveId(null);
      store?.getState().compositeElement?.focus({ preventScroll: true });
    });
    const ref = (0, import_react58.useCallback)((element) => {
      if (!element) return;
      element[symbol2] = true;
    }, []);
    props = {
      ...props,
      ref: useMergeRefs5(ref, props.ref),
      onMouseMove,
      onMouseLeave
    };
    return props;
  });
  var CompositeHover = memo4(forwardRef89(function CompositeHover2(props) {
    const htmlProps = useCompositeHover(props);
    return createElement3(TagName7, htmlProps);
  }));

  // node_modules/@ariakit/react-components/dist/__chunks/DAieEu03.js
  var openingMovesByStore = /* @__PURE__ */ new WeakMap();
  var scrollItemIntoViewByStore = /* @__PURE__ */ new WeakMap();
  function scrollIntoViewNearest(element) {
    element.scrollIntoView({
      block: "nearest",
      inline: "nearest"
    });
  }
  function getSingleVerticalScrollport(element, popup) {
    const view = getWindow2(element);
    if (!view.getComputedStyle(popup).writingMode.startsWith("horizontal")) return null;
    let scrollport = null;
    let inlineScrollport = null;
    let current = element.parentElement;
    while (current && popup.contains(current)) {
      const style = view.getComputedStyle(current);
      if (style.overflowY !== "visible" && style.overflowY !== "clip" && current.scrollHeight > current.clientHeight) {
        if (scrollport) return null;
        scrollport = current;
      }
      if (style.overflowX !== "visible" && style.overflowX !== "clip" && current.scrollWidth > current.clientWidth) {
        if (inlineScrollport) return null;
        inlineScrollport = current;
      }
      if (current === popup) break;
      current = current.parentElement;
    }
    if (inlineScrollport && inlineScrollport !== scrollport) return null;
    return scrollport;
  }
  function centerItemInScrollport(element, scrollport) {
    const elementRect = element.getBoundingClientRect();
    const scrollportRect = scrollport.getBoundingClientRect();
    const scaleX = scrollportRect.width / scrollport.offsetWidth || 1;
    const scrollportLeft = scrollportRect.left + scrollport.clientLeft * scaleX;
    const scrollportRight = scrollportLeft + scrollport.clientWidth * scaleX;
    const scrollportWidth = scrollport.clientWidth * scaleX;
    const elementLeftOutside = elementRect.left < scrollportLeft;
    const elementRightOutside = elementRect.right > scrollportRight;
    const alignLeft = elementLeftOutside && !elementRightOutside && elementRect.width < scrollportWidth || elementRightOutside && !elementLeftOutside && elementRect.width > scrollportWidth;
    const alignRight = elementLeftOutside && !elementRightOutside && elementRect.width > scrollportWidth || elementRightOutside && !elementLeftOutside && elementRect.width < scrollportWidth;
    let left = 0;
    if (alignLeft) left = (elementRect.left - scrollportLeft) / scaleX;
    else if (alignRight) left = (elementRect.right - scrollportRight) / scaleX;
    const scaleY = scrollportRect.height / scrollport.offsetHeight || 1;
    const top = (elementRect.top + elementRect.height / 2 - (scrollportRect.top + (scrollport.clientTop + scrollport.clientHeight / 2) * scaleY)) / scaleY;
    scrollport.scrollBy({
      left,
      top
    });
  }
  function getScrollItemIntoView(store) {
    if (!store) return scrollIntoViewNearest;
    const cached = scrollItemIntoViewByStore.get(store);
    if (cached) return cached;
    const scrollItemIntoView = (element) => {
      const { contentElement, moves, selectElement } = store.getState();
      if (!selectElement) return scrollIntoViewNearest(element);
      if (moves !== openingMovesByStore.get(store)) return scrollIntoViewNearest(element);
      if (!contentElement?.contains(element)) return scrollIntoViewNearest(element);
      const scrollport = getSingleVerticalScrollport(element, contentElement);
      if (!scrollport) return scrollIntoViewNearest(element);
      centerItemInScrollport(element, scrollport);
    };
    scrollItemIntoViewByStore.set(store, scrollItemIntoView);
    return scrollItemIntoView;
  }

  // node_modules/@ariakit/react-components/dist/combobox/combobox.js
  var import_react59 = __toESM(require_react(), 1);
  var import_jsx_runtime146 = __toESM(require_jsx_runtime(), 1);
  var TagName8 = "input";
  function isFirstItemAutoSelected(items, activeValue, autoSelect) {
    if (!autoSelect) return false;
    return items.find((item) => !item.disabled && item.value)?.value === activeValue;
  }
  function hasCompletionString(value, activeValue) {
    if (!activeValue) return false;
    if (value == null) return false;
    const normalizedValue = normalizeString(value);
    const normalizedActiveValue = normalizeString(activeValue);
    if (normalizedValue.length !== value.length) return false;
    if (normalizedActiveValue.length !== activeValue.length) return false;
    return normalizedActiveValue.length > normalizedValue.length && normalizedActiveValue.toLowerCase().startsWith(normalizedValue.toLowerCase());
  }
  function isAriaAutoCompleteValue(value) {
    return value === "inline" || value === "list" || value === "both" || value === "none";
  }
  function getDefaultAutoSelectId(items) {
    return items.find((item) => {
      if (item.disabled) return false;
      return item.element?.getAttribute("role") !== "tab";
    })?.id;
  }
  var useCombobox = createHook(function useCombobox2({ store, focusable: focusable2 = true, autoSelect: autoSelectProp = false, getAutoSelectId, setValueOnChange, showMinLength = 0, showOnChange, showOnMouseDown, showOnClick = showOnMouseDown, showOnKeyDown, showOnKeyPress = showOnKeyDown, blurActiveItemOnClick, setValueOnClick = true, moveOnKeyPress = true, autoComplete = "list", name, form, disabled: disabled2, ...props }) {
    const scopedContext = useComboboxScopedContext(true);
    const context = useComboboxProviderContext();
    store = store || context || scopedContext;
    invariant(store, "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component.");
    const ref = (0, import_react59.useRef)(null);
    const [valueUpdated, forceValueUpdate] = useForceUpdate();
    const canAutoSelectRef = (0, import_react59.useRef)(false);
    const composingRef = (0, import_react59.useRef)(false);
    const compositionEndFrameRef = (0, import_react59.useRef)(null);
    const cancelCompositionEndFrame = () => {
      const frame = compositionEndFrameRef.current;
      if (frame == null) return;
      cancelAnimationFrame(frame);
      compositionEndFrameRef.current = null;
    };
    const autoSelect = useStoreState(store, ["virtualFocus"], (state) => state.virtualFocus && autoSelectProp);
    const inline4 = autoComplete === "inline" || autoComplete === "both";
    const [canInline, setCanInline] = (0, import_react59.useState)(inline4);
    useUpdateLayoutEffect(() => {
      if (!inline4) return;
      setCanInline(true);
    }, [inline4]);
    const storeInputValue = useStoreState(store, "inputValue");
    const selectedValue = useStoreState(store, ["selectedValue"], (state) => {
      if (!name) return;
      if (!Array.isArray(state.selectedValue)) return;
      return state.selectedValue;
    });
    const multiSelectable = Array.isArray(selectedValue);
    const prevSelectedValueRef = (0, import_react59.useRef)(void 0);
    (0, import_react59.useEffect)(() => {
      return sync(store, ["selectedValue", "activeId"], (_, prev) => {
        prevSelectedValueRef.current = prev.selectedValue;
      });
    }, [store]);
    const inlineActiveValue = useStoreState(store, [
      "activeValue",
      "selectedValue",
      "activeId"
    ], (state) => {
      if (!inline4) return;
      if (!canInline) return;
      if (state.activeValue && Array.isArray(state.selectedValue)) {
        if (state.selectedValue.includes(state.activeValue)) return;
        if (prevSelectedValueRef.current?.includes(state.activeValue)) return;
      }
      return state.activeValue;
    });
    const items = useStoreState(store, "renderedItems");
    const open2 = useStoreState(store, "open");
    const contentElement = useStoreState(store, "contentElement");
    const placing = useStoreState(store, "unstable_placing");
    const firstItemAutoSelected = isFirstItemAutoSelected(items, inlineActiveValue, autoSelect);
    const inputValue = (0, import_react59.useMemo)(() => {
      if (!inline4) return storeInputValue;
      if (!canInline) return storeInputValue;
      if (firstItemAutoSelected) {
        if (hasCompletionString(storeInputValue, inlineActiveValue)) {
          const slice = inlineActiveValue?.slice(storeInputValue.length) || "";
          return storeInputValue + slice;
        }
        return storeInputValue;
      }
      return inlineActiveValue || storeInputValue;
    }, [
      inline4,
      canInline,
      firstItemAutoSelected,
      inlineActiveValue,
      storeInputValue
    ]);
    (0, import_react59.useEffect)(() => {
      const element = ref.current;
      if (!element) return;
      const onCompositeItemMove = () => setCanInline(true);
      element.addEventListener("combobox-item-move", onCompositeItemMove);
      return () => {
        element.removeEventListener("combobox-item-move", onCompositeItemMove);
      };
    }, []);
    (0, import_react59.useEffect)(() => {
      if (!inline4) return;
      if (!canInline) return;
      if (!inlineActiveValue) return;
      if (!firstItemAutoSelected) return;
      if (!hasCompletionString(storeInputValue, inlineActiveValue)) return;
      let cleanup = noop5;
      queueMicrotask(() => {
        const element = ref.current;
        if (!element) return;
        const { start: prevStart, end: prevEnd } = getTextboxSelection(element);
        const nextStart = storeInputValue.length;
        const nextEnd = inlineActiveValue.length;
        setSelectionRange(element, nextStart, nextEnd);
        cleanup = () => {
          if (!hasFocus(element)) return;
          const { start, end } = getTextboxSelection(element);
          if (start !== nextStart) return;
          if (end !== nextEnd) return;
          setSelectionRange(element, prevStart, prevEnd);
        };
      });
      return () => cleanup();
    }, [
      valueUpdated,
      inline4,
      canInline,
      inlineActiveValue,
      firstItemAutoSelected,
      storeInputValue
    ]);
    const getAutoSelectIdProp = useEvent(getAutoSelectId);
    const autoSelectIdRef = (0, import_react59.useRef)(null);
    const autoSelectMovedRef = (0, import_react59.useRef)(void 0);
    const userScrolledRef = (0, import_react59.useRef)(false);
    const isAutoScrollingRef = (0, import_react59.useRef)(false);
    (0, import_react59.useEffect)(() => {
      if (!open2) return;
      if (!contentElement) return;
      const scrollingElement = getScrollingElement(contentElement);
      if (!scrollingElement) return;
      const onUserScroll = () => {
        canAutoSelectRef.current = false;
        userScrolledRef.current = true;
      };
      const onScroll = () => {
        if (!isAutoScrollingRef.current) userScrolledRef.current = true;
        if (!store) return;
        if (!canAutoSelectRef.current) return;
        const { activeId } = store.getState();
        if (activeId === null) return;
        if (activeId === autoSelectIdRef.current) return;
        canAutoSelectRef.current = false;
      };
      const options = {
        passive: true,
        capture: true
      };
      scrollingElement.addEventListener("wheel", onUserScroll, options);
      scrollingElement.addEventListener("touchmove", onUserScroll, options);
      scrollingElement.addEventListener("scroll", onScroll, options);
      return () => {
        scrollingElement.removeEventListener("wheel", onUserScroll, true);
        scrollingElement.removeEventListener("touchmove", onUserScroll, true);
        scrollingElement.removeEventListener("scroll", onScroll, true);
      };
    }, [
      open2,
      contentElement,
      store
    ]);
    useSafeLayoutEffect(() => {
      userScrolledRef.current = false;
      if (!storeInputValue) return;
      if (composingRef.current) return;
      canAutoSelectRef.current = true;
    }, [storeInputValue]);
    useSafeLayoutEffect(() => {
      if (autoSelect !== "always" && open2) return;
      canAutoSelectRef.current = open2;
    }, [autoSelect, open2]);
    useSafeLayoutEffect(() => {
      if (open2) return;
      autoSelectMovedRef.current = void 0;
    }, [open2]);
    const resetValueOnSelect = useStoreState(store, "resetValueOnSelect");
    useUpdateEffect(() => {
      const canAutoSelect = canAutoSelectRef.current;
      if (!store) return;
      if (!open2) return;
      if (composingRef.current) return;
      if (!canAutoSelect && (!resetValueOnSelect || userScrolledRef.current)) return;
      const state = store.getState();
      const { compositeElement: compositeElement2, activeId, selectElement, selectedValue: selectedValue2 } = state;
      if (compositeElement2 && !hasFocus(compositeElement2)) return;
      if (state.unstable_placing) return;
      const activeValue = store.item(activeId)?.value;
      const activeValueSelected = activeValue != null && (Array.isArray(selectedValue2) ? selectedValue2.includes(activeValue) : selectedValue2 === activeValue);
      if (autoSelect && canAutoSelect && !(!!selectElement && !storeInputValue && activeValueSelected)) {
        const userAutoSelectId = getAutoSelectIdProp(items);
        const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : getDefaultAutoSelectId(items) ?? store.first();
        autoSelectIdRef.current = autoSelectId;
        const nextActiveId = autoSelectId ?? null;
        const nextActiveValue = store.item(nextActiveId)?.value;
        const moved = autoSelectMovedRef.current;
        if (nextActiveId !== activeId || moved?.id !== nextActiveId || moved?.value !== nextActiveValue) {
          autoSelectMovedRef.current = {
            id: nextActiveId,
            value: nextActiveValue
          };
          store.move(nextActiveId);
        } else store.setState("activeValue", nextActiveValue);
      } else {
        const element = store.item(activeId || store.first())?.element;
        if (element && "scrollIntoView" in element) {
          isAutoScrollingRef.current = true;
          element.scrollIntoView({
            block: "nearest",
            inline: "nearest"
          });
          requestAnimationFrame(() => {
            isAutoScrollingRef.current = false;
          });
        }
      }
    }, [
      store,
      open2,
      placing,
      valueUpdated,
      storeInputValue,
      autoSelect,
      resetValueOnSelect,
      getAutoSelectIdProp,
      items
    ]);
    (0, import_react59.useEffect)(() => {
      if (!inline4) return;
      const combobox = ref.current;
      if (!combobox) return;
      const elements = [combobox, contentElement].filter((value) => !!value);
      const onBlur2 = (event) => {
        if (elements.every((el) => isFocusEventOutside(event, el))) store?.setInputValue(inputValue);
      };
      for (const element of elements) element.addEventListener("focusout", onBlur2);
      return () => {
        for (const element of elements) element.removeEventListener("focusout", onBlur2);
      };
    }, [
      inline4,
      contentElement,
      store,
      inputValue
    ]);
    const canShow = (event) => {
      return event.currentTarget.value.length >= showMinLength;
    };
    const onChangeProp = props.onChange;
    const showOnChangeProp = useBooleanEvent(showOnChange ?? canShow);
    const setValueOnChangeProp = useBooleanEvent(setValueOnChange ?? !store.tag);
    const onChange = useEvent((event) => {
      onChangeProp?.(event);
      if (event.defaultPrevented) return;
      if (!store) return;
      const currentTarget = event.currentTarget;
      const { value, selectionStart, selectionEnd } = currentTarget;
      const nativeEvent = event.nativeEvent;
      canAutoSelectRef.current = true;
      if (isInputEvent(nativeEvent)) {
        if (nativeEvent.isComposing) {
          canAutoSelectRef.current = false;
          composingRef.current = true;
        }
        if (inline4) {
          const textInserted = nativeEvent.inputType === "insertText" || nativeEvent.inputType === "insertCompositionText";
          const caretAtEnd = selectionStart === value.length;
          setCanInline(textInserted && caretAtEnd);
        }
      }
      if (setValueOnChangeProp(event)) {
        const isSameValue3 = value === store.getState().inputValue;
        store.setInputValue(value);
        queueMicrotask(() => {
          setSelectionRange(currentTarget, selectionStart, selectionEnd);
        });
        if (inline4 && autoSelect && isSameValue3) forceValueUpdate();
      }
      if (showOnChangeProp(event)) store.show();
      if (!autoSelect || !canAutoSelectRef.current) store.setActiveId(null);
    });
    (0, import_react59.useEffect)(() => cancelCompositionEndFrame, []);
    const onCompositionStartProp = props.onCompositionStart;
    const onCompositionStart = useEvent((event) => {
      cancelCompositionEndFrame();
      canAutoSelectRef.current = false;
      composingRef.current = true;
      onCompositionStartProp?.(event);
    });
    const onCompositionEndProp = props.onCompositionEnd;
    const onCompositionEnd = useEvent((event) => {
      canAutoSelectRef.current = true;
      composingRef.current = false;
      onCompositionEndProp?.(event);
      if (event.defaultPrevented) return;
      if (!autoSelect) return;
      cancelCompositionEndFrame();
      compositionEndFrameRef.current = requestAnimationFrame(() => {
        compositionEndFrameRef.current = null;
        if (composingRef.current) return;
        forceValueUpdate();
      });
    });
    const onMouseDownProp = props.onMouseDown;
    const blurActiveItemOnClickProp = useBooleanEvent(blurActiveItemOnClick ?? (() => store.getState().compositeElementInFocusOrder));
    const setValueOnClickProp = useBooleanEvent(setValueOnClick);
    const showOnClickProp = useBooleanEvent(showOnClick ?? canShow);
    const onMouseDown = useEvent((event) => {
      onMouseDownProp?.(event);
      if (event.defaultPrevented) return;
      if (event.button) return;
      if (event.ctrlKey) return;
      if (!store) return;
      if (blurActiveItemOnClickProp(event)) store.setActiveId(null);
      if (setValueOnClickProp(event)) store.setInputValue(inputValue);
      if (showOnClickProp(event)) queueBeforeEvent(event.currentTarget, "mouseup", store.show);
    });
    const onKeyDownProp = props.onKeyDown;
    const showOnKeyPressProp = useBooleanEvent(showOnKeyPress ?? canShow);
    const onKeyDown = useEvent((event) => {
      onKeyDownProp?.(event);
      if (!event.repeat) canAutoSelectRef.current = false;
      if (event.defaultPrevented) return;
      if (!store) return;
      const { open: open3 } = store.getState();
      if (open3 && event.key === "Enter") {
        event.preventDefault();
        return;
      }
      if (event.ctrlKey) return;
      if (event.altKey) return;
      if (event.shiftKey) return;
      if (event.metaKey) return;
      if (open3) return;
      if (event.key === "ArrowUp" || event.key === "ArrowDown") {
        if (showOnKeyPressProp(event)) {
          event.preventDefault();
          store.show();
        }
      }
    });
    const onBlurProp = props.onBlur;
    const onBlur = useEvent((event) => {
      canAutoSelectRef.current = false;
      onBlurProp?.(event);
    });
    const id = useId7(props.id);
    const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0;
    const isActiveItem = useStoreState(store, ["activeId"], (state) => state.activeId === null);
    const formDisabled = disabledFromProps({
      disabled: disabled2,
      "aria-disabled": props["aria-disabled"]
    });
    const composite = props.composite !== false;
    const [, setCompositeElement] = useTransactionState(composite ? null : store.setCompositeElement);
    const compositeElement = useStoreState(store, multiSelectable ? ["compositeElement"] : [], (state) => multiSelectable ? state.compositeElement : null);
    props = useWrapElement(props, (element) => {
      if (!name) return element;
      if (!Array.isArray(selectedValue)) return element;
      if (composite && !compositeElement) return element;
      return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [element, selectedValue.map((value, index2) => /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("input", {
        type: "hidden",
        name,
        form,
        disabled: formDisabled,
        value
      }, index2))] });
    }, [
      name,
      form,
      formDisabled,
      composite,
      compositeElement,
      selectedValue
    ]);
    props = {
      role: "combobox",
      "aria-autocomplete": ariaAutoComplete,
      "aria-haspopup": getPopupRole(contentElement, "listbox"),
      "aria-expanded": open2,
      "aria-controls": contentElement?.id,
      "data-active-item": isActiveItem || void 0,
      value: inputValue,
      ...props,
      id,
      name: multiSelectable ? void 0 : name,
      form,
      disabled: disabled2,
      ref: useMergeRefs5(ref, store.setInputElement, composite ? void 0 : setCompositeElement, props.ref),
      onChange,
      onCompositionStart,
      onCompositionEnd,
      onMouseDown,
      onKeyDown,
      onBlur
    };
    const scrollItemIntoView = getScrollItemIntoView(store);
    props = useComposite({
      store,
      unstable_scrollIntoView: scrollItemIntoView,
      focusable: focusable2,
      ...props,
      moveOnKeyPress: (event) => {
        if (isFalsyBooleanCallback(moveOnKeyPress, event)) return false;
        if (inline4) setCanInline(true);
        return true;
      }
    });
    return {
      autoComplete: "off",
      ...props
    };
  });
  var Combobox = forwardRef89(function Combobox2(props) {
    const htmlProps = useCombobox(props);
    return createElement3(TagName8, htmlProps);
  });

  // node_modules/@ariakit/react-components/dist/combobox/combobox-item.js
  var import_react60 = __toESM(require_react(), 1);
  var import_jsx_runtime147 = __toESM(require_jsx_runtime(), 1);
  var TagName9 = "div";
  function isSelected(storeValue, itemValue) {
    if (itemValue == null) return;
    if (storeValue == null) return false;
    if (Array.isArray(storeValue)) return storeValue.includes(itemValue);
    return storeValue === itemValue;
  }
  function getItemRole(popupRole) {
    return getItemRoleByPopupRole(popupRole) ?? "option";
  }
  var useComboboxItem = createHook(function useComboboxItem2({ store, value, hideOnClick, setValueOnClick, selectValueOnClick = true, resetValueOnSelect, focusOnHover, moveOnKeyPress = true, preventScrollOnKeyDown, getItem: getItemProp, ...props }) {
    const context = useComboboxScopedContext();
    store = store || context;
    invariant(store, "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component.");
    const id = useId7(props.id);
    const listRole = (0, import_react60.useContext)(ComboboxListRoleContext);
    const listRoleMatchesStore = listRole?.store === store;
    const { resetValueOnSelectState, multiSelectable, selected, autoFocusSelected, selectElement, contentElement } = useStoreStateObject(store, ["selectedValue"], {
      resetValueOnSelectState: "resetValueOnSelect",
      multiSelectable(state) {
        return Array.isArray(state.selectedValue);
      },
      selected(state) {
        return isSelected(state.selectedValue, value);
      },
      autoFocusSelected(state) {
        if (value == null) return false;
        if (!Array.isArray(state.selectedValue)) return state.selectedValue === value;
        return state.selectedValue[state.selectedValue.length - 1] === value;
      },
      selectElement: "selectElement",
      contentElement: "contentElement"
    });
    const autoFocusSelectedItem = !!selectElement;
    const selectMode = !!selectElement;
    const disabled2 = disabledFromProps(props);
    const getItem = (0, import_react60.useCallback)((item) => {
      const nextItem = {
        ...item,
        value: selectMode && disabled2 ? void 0 : value
      };
      if (getItemProp) return getItemProp(nextItem);
      return nextItem;
    }, [
      selectMode,
      disabled2,
      value,
      getItemProp
    ]);
    setValueOnClick = setValueOnClick ?? (!selectMode && !multiSelectable);
    hideOnClick = hideOnClick ?? (value != null && !multiSelectable);
    preventScrollOnKeyDown = preventScrollOnKeyDown ?? selectMode;
    const popupRole = listRoleMatchesStore ? listRole?.role : getPopupRole(contentElement);
    const role = getItemRole(typeof popupRole === "string" ? popupRole : void 0);
    const onClickProp = props.onClick;
    const setValueOnClickProp = useBooleanEvent(setValueOnClick);
    const selectValueOnClickProp = useBooleanEvent(selectValueOnClick);
    const resetValueOnSelectProp = useBooleanEvent(resetValueOnSelect ?? resetValueOnSelectState);
    const hideOnClickProp = useBooleanEvent(hideOnClick);
    const onClick = useEvent((event) => {
      onClickProp?.(event);
      if (event.defaultPrevented) return;
      if (isDownloading(event)) return;
      if (isOpeningInNewTab(event)) return;
      if (value != null) {
        if (selectValueOnClickProp(event)) {
          if (resetValueOnSelectProp(event)) store?.resetInputValue();
          store?.setSelectedValue((prevValue) => {
            if (!Array.isArray(prevValue)) return value;
            if (prevValue.includes(value)) return prevValue.filter((v2) => v2 !== value);
            return [...prevValue, value];
          });
        }
        if (setValueOnClickProp(event)) store?.setInputValue(value);
      }
      if (hideOnClickProp(event)) store?.hide();
    });
    const onKeyDownProp = props.onKeyDown;
    const onKeyDown = useEvent((event) => {
      onKeyDownProp?.(event);
      if (event.defaultPrevented) return;
      const compositeElement = store?.getState().compositeElement;
      if (!compositeElement) return;
      if (hasFocus(compositeElement)) return;
      const printable = event.key.length === 1 && !event.ctrlKey && !event.metaKey;
      const paste = (!isApple() ? event.ctrlKey : event.metaKey) && event.key.toLowerCase() === "v";
      const deleteKey = event.key === "Backspace" || event.key === "Delete";
      if (printable || paste || deleteKey) {
        if (compositeElement === selectElement) return;
        if (isTextField(compositeElement)) {
          queueMicrotask(() => compositeElement.focus());
          store?.setInputValue(compositeElement.value);
          return;
        }
        compositeElement.focus();
        if ("value" in compositeElement && typeof compositeElement.value === "string") store?.setInputValue(compositeElement.value);
      }
    });
    if ((selectMode || multiSelectable) && selected != null) props = {
      "aria-selected": selected,
      ...props
    };
    props = useWrapElement(props, (element) => /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(ComboboxItemValueContext.Provider, {
      value,
      children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(ComboboxItemCheckedContext.Provider, {
        value: selected ?? false,
        children: element
      })
    }), [value, selected]);
    const defaultAutoFocus = autoFocusSelectedItem ? autoFocusSelected : void 0;
    props = {
      role,
      children: value,
      ...props,
      id,
      onClick,
      onKeyDown
    };
    if (props.autoFocus === void 0 && defaultAutoFocus !== void 0) {
      props.autoFocus = false;
      props["data-autofocus"] = defaultAutoFocus || void 0;
    }
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    const scrollItemIntoView = getScrollItemIntoView(store);
    props = useCompositeItem2({
      store,
      unstable_scrollIntoView: scrollItemIntoView,
      ...props,
      getItem,
      preventScrollOnKeyDown,
      moveOnKeyPress: (event) => {
        if (!moveOnKeyPressProp(event)) return false;
        const moveEvent = new Event("combobox-item-move");
        store?.getState().compositeElement?.dispatchEvent(moveEvent);
        return true;
      }
    });
    const focusOnHoverProp = useBooleanEvent(focusOnHover ?? selectMode);
    props = useCompositeHover({
      store,
      ...props,
      focusOnHover(event) {
        if (!store.getState().open) return false;
        if (!focusOnHoverProp(event)) return false;
        return store.getState().open;
      }
    });
    return props;
  });
  var ComboboxItem = memo4(forwardRef89(function ComboboxItem2(props) {
    const htmlProps = useComboboxItem(props);
    return createElement3(TagName9, htmlProps);
  }));

  // node_modules/@ariakit/react-components/dist/combobox/combobox-item-value.js
  var import_react61 = __toESM(require_react(), 1);
  var import_jsx_runtime148 = __toESM(require_jsx_runtime(), 1);
  var TagName10 = "span";
  function normalizeValue(value) {
    return normalizeString(value).toLowerCase();
  }
  function getOffsets(string, values) {
    const offsets = [];
    for (const value of values) {
      if (!value) continue;
      let pos = 0;
      const length = value.length;
      let index2 = string.indexOf(value, pos);
      while (index2 !== -1) {
        offsets.push([index2, length]);
        pos = index2 + 1;
        index2 = string.indexOf(value, pos);
      }
    }
    return offsets;
  }
  function mergeOverlappingOffsets(offsets) {
    offsets.sort(([a], [b]) => a - b);
    const merged = [];
    for (const [offset4, length] of offsets) {
      const last = merged[merged.length - 1];
      if (last && offset4 < last[0] + last[1]) last[1] = Math.max(last[1], offset4 + length - last[0]);
      else merged.push([offset4, length]);
    }
    return merged;
  }
  function getNormalizedIndexes(itemValue) {
    const starts = [];
    const ends = [];
    let index2 = 0;
    for (const char of itemValue) {
      const normalizedLength = normalizeValue(char).length;
      for (let i = 0; i < normalizedLength; i += 1) {
        starts.push(i === 0 ? index2 : -1);
        ends.push(index2);
      }
      index2 += char.length;
    }
    starts.push(itemValue.length);
    ends.push(itemValue.length);
    let nextBoundary = itemValue.length;
    for (let i = starts.length - 1; i >= 0; i -= 1) {
      const start = starts[i];
      if (start == null) continue;
      if (start === -1) starts[i] = nextBoundary;
      else nextBoundary = start;
    }
    return {
      starts,
      ends
    };
  }
  function toOriginalOffsets(itemValue, normalizedOffsets) {
    if (!normalizedOffsets.length) return normalizedOffsets;
    const { starts, ends } = getNormalizedIndexes(itemValue);
    const offsets = [];
    for (const [normalizedOffset, normalizedLength] of normalizedOffsets) {
      const start = starts[normalizedOffset];
      const end = ends[normalizedOffset + normalizedLength];
      if (start == null || end == null) continue;
      if (end <= start) continue;
      offsets.push([start, end - start]);
    }
    return offsets;
  }
  function splitValue(itemValue, userValue) {
    if (!itemValue) return itemValue;
    if (!userValue) return itemValue;
    const userValues = toArray(userValue).map(normalizeValue);
    const parts = [];
    const span = (value, autocomplete = false) => /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", {
      "data-autocomplete-value": autocomplete ? "" : void 0,
      "data-user-value": autocomplete ? void 0 : "",
      children: value
    }, parts.length);
    const offsets = toOriginalOffsets(itemValue, mergeOverlappingOffsets(getOffsets(normalizeValue(itemValue), new Set(userValues))));
    const firstEntry = offsets[0];
    if (!firstEntry) {
      parts.push(span(itemValue, true));
      return parts;
    }
    const [firstOffset] = firstEntry;
    [itemValue.slice(0, firstOffset), ...offsets.flatMap(([offset4, length], i) => {
      const value = itemValue.slice(offset4, offset4 + length);
      const nextOffset = offsets[i + 1]?.[0];
      return [value, itemValue.slice(offset4 + length, nextOffset)];
    })].forEach((value, i) => {
      if (!value) return;
      parts.push(span(value, i % 2 === 0));
    });
    return parts;
  }
  var useComboboxItemValue = createHook(function useComboboxItemValue2({ store, value, userValue, ...props }) {
    const context = useComboboxScopedContext();
    store = store || context;
    const itemContext = (0, import_react61.useContext)(ComboboxItemValueContext);
    const itemValue = value ?? itemContext;
    const inputValue = useStoreState(store, ["inputValue"], (state) => userValue ?? state?.inputValue);
    props = {
      children: (0, import_react61.useMemo)(() => {
        if (!itemValue) return;
        if (!inputValue) return itemValue;
        return splitValue(itemValue, inputValue);
      }, [itemValue, inputValue]),
      ...props
    };
    return props;
  });
  var ComboboxItemValue = forwardRef89(function ComboboxItemValue2(props) {
    const htmlProps = useComboboxItemValue(props);
    return createElement3(TagName10, htmlProps);
  });

  // node_modules/@ariakit/react-components/dist/combobox/combobox-label.js
  var TagName11 = "label";
  var useComboboxLabel = createHook(function useComboboxLabel2({ store, ...props }) {
    const scopedContext = useComboboxScopedContext(true);
    const context = useComboboxProviderContext();
    store = store || context || scopedContext;
    invariant(store, "ComboboxLabel must receive a `store` prop or be wrapped in a ComboboxProvider component.");
    const inputElement = useStoreState(store, "inputElement");
    useAttribute(inputElement, "id");
    const comboboxId = inputElement?.id;
    const id = useId7(props.id);
    props = {
      htmlFor: comboboxId,
      ...props,
      id,
      ref: useMergeRefs5(store.setLabelElement, props.ref)
    };
    return props;
  });
  var ComboboxLabel = memo4(forwardRef89(function ComboboxLabel2(props) {
    const htmlProps = useComboboxLabel(props);
    return createElement3(TagName11, htmlProps);
  }));

  // node_modules/@ariakit/react-components/dist/combobox/combobox-list.js
  var import_react62 = __toESM(require_react(), 1);
  var import_jsx_runtime149 = __toESM(require_jsx_runtime(), 1);
  var TagName12 = "div";
  var useComboboxList = createHook(function useComboboxList2({ store, alwaysVisible, ...props }) {
    const scopedContext = useComboboxScopedContext(true);
    const context = useComboboxContext();
    store = store || context;
    const scopedContextSameStore = !!store && store === scopedContext;
    invariant(store, "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component.");
    const onFocusProp = props.onFocus;
    const onFocus = useEvent((event) => {
      onFocusProp?.(event);
      if (event.defaultPrevented) return;
      if (!isSelfTarget(event)) return;
      const compositeElement = store.getState().compositeElement;
      if (!compositeElement) return;
      if (!isFocusable(compositeElement)) return;
      const list = event.currentTarget;
      queueMicrotask(() => {
        if (getActiveElement(list) !== list) return;
        compositeElement.focus();
      });
    });
    const ref = (0, import_react62.useRef)(null);
    const id = useId7(props.id);
    const mounted = useStoreState(store, "mounted");
    const hidden = isHidden(mounted, props.hidden, alwaysVisible);
    const style = hidden ? {
      ...props.style,
      display: "none"
    } : props.style;
    const multiSelectable = useStoreState(store, ["selectedValue"], (state) => Array.isArray(state.selectedValue));
    const role = useAttribute(ref, "role", props.role);
    const listRole = (0, import_react62.useMemo)(() => ({
      store,
      role
    }), [store, role]);
    const ariaMultiSelectable = role === "listbox" || role === "tree" || role === "grid" ? multiSelectable || void 0 : void 0;
    const [hasNestedList, setHasNestedList] = (0, import_react62.useState)(false);
    const contentElement = useStoreState(store, "contentElement");
    const parentHeadingContext = (0, import_react62.useContext)(ComboboxHeadingContext);
    const headingState = (0, import_react62.useState)();
    const [headingId, setHeadingId] = parentHeadingContext || headingState;
    const headingContext = (0, import_react62.useMemo)(() => [headingId, setHeadingId], [headingId, setHeadingId]);
    useSafeLayoutEffect(() => {
      if (!mounted) return;
      const element = ref.current;
      if (!element) return;
      if (contentElement !== element) return;
      const update2 = () => {
        setHasNestedList(!!element.querySelector("[data-combobox-list]"));
      };
      const observer = new MutationObserver(update2);
      observer.observe(element, {
        subtree: true,
        childList: true
      });
      update2();
      return () => observer.disconnect();
    }, [mounted, contentElement]);
    if (!hasNestedList) props = {
      role: "listbox",
      "aria-multiselectable": ariaMultiSelectable,
      ...props
    };
    props = useWrapElement(props, (element) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(ComboboxScopedContextProvider, {
      value: store,
      children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(ComboboxHeadingContext.Provider, {
        value: headingContext,
        children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(DialogHeadingContext.Provider, {
          value: setHeadingId,
          children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(ComboboxListRoleContext.Provider, {
            value: listRole,
            children: element
          })
        })
      })
    }), [
      store,
      listRole,
      headingContext
    ]);
    const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store.setContentElement : null;
    const labelElement = useStoreState(store, ["labelElement", "selectLabelElement"], (state) => {
      if (headingId) return null;
      return state.selectLabelElement || state.labelElement;
    });
    useAttribute(labelElement, "id");
    const labelId = headingId || labelElement?.id;
    props = {
      "data-combobox-list": "",
      "aria-labelledby": props["aria-label"] != null ? void 0 : labelId,
      hidden,
      ...props,
      id,
      onFocus,
      ref: useMergeRefs5(setContentElement, ref, props.ref),
      style,
      tabIndex: -1
    };
    return props;
  });
  var ComboboxList = forwardRef89(function ComboboxList2(props) {
    const htmlProps = useComboboxList(props);
    return createElement3(TagName12, htmlProps);
  });

  // node_modules/@ariakit/react-components/dist/tag/tag-context.js
  var import_react63 = __toESM(require_react(), 1);
  var TagValueContext = (0, import_react63.createContext)(null);
  var TagRemoveIdContext = (0, import_react63.createContext)(null);
  var ctx7 = createStoreContext([CompositeContextProvider], [CompositeScopedContextProvider]);
  var useTagContext = ctx7.useContext;
  var useTagScopedContext = ctx7.useScopedContext;
  var useTagProviderContext = ctx7.useProviderContext;
  var TagContextProvider = ctx7.ContextProvider;
  var TagScopedContextProvider = ctx7.ScopedContextProvider;

  // node_modules/@ariakit/components/dist/combobox/combobox-store.js
  var isTouchSafari = isSafari() && isTouchDevice();
  function createComboboxStore({ tag, ...props } = {}) {
    const store = mergeStore(props.store, pick2(tag, ["value", "rtl"]));
    const defaultInputValue = defaultValue(props.defaultInputValue, props.defaultValue);
    throwOnConflictingProps({
      ...props,
      defaultInputValue,
      defaultValue: defaultInputValue
    }, store);
    const tagState = tag?.getState();
    const syncState = store?.getState();
    const activeId = defaultValue(props.activeId, syncState?.activeId, props.defaultActiveId, null);
    const composite = createCompositeStore({
      ...props,
      activeId,
      compositeElementInFocusOrder: defaultValue(props.compositeElementInFocusOrder, props.includesBaseElement, syncState?.compositeElementInFocusOrder, syncState?.includesBaseElement, true),
      orientation: defaultValue(props.orientation, syncState?.orientation, "vertical"),
      focusLoop: defaultValue(props.focusLoop, syncState?.focusLoop, true),
      focusWrap: defaultValue(props.focusWrap, syncState?.focusWrap, true),
      virtualFocus: defaultValue(props.virtualFocus, syncState?.virtualFocus, true)
    });
    const popover = createPopoverStore({
      ...props,
      placement: defaultValue(props.placement, syncState?.placement, "bottom-start")
    });
    const inputValue = defaultValue(props.inputValue, props.value, syncState?.inputValue, syncState?.value, defaultInputValue, "");
    const selectedValue = defaultValue(props.selectedValue, syncState?.selectedValue, tagState?.values, props.defaultSelectedValue, "");
    let shouldSetDefaultSelectedValue = props.selectedValue === void 0 && syncState?.selectedValue === void 0 && tagState?.values === void 0 && props.defaultSelectedValue === void 0;
    const multiSelectable = Array.isArray(selectedValue);
    const initialState = {
      ...composite.getState(),
      ...popover.getState(),
      inputValue,
      value: inputValue,
      selectedValue,
      resetValueOnSelect: defaultValue(props.resetValueOnSelect, syncState?.resetValueOnSelect, multiSelectable),
      resetValueOnHide: defaultValue(props.resetValueOnHide, syncState?.resetValueOnHide, multiSelectable && !tag),
      selectOnMove: defaultValue(props.selectOnMove, syncState?.selectOnMove, false),
      activeValue: syncState?.activeValue,
      inputElement: defaultValue(syncState?.inputElement, null),
      labelElement: defaultValue(syncState?.labelElement, null),
      selectElement: defaultValue(syncState?.selectElement, null),
      selectLabelElement: defaultValue(syncState?.selectLabelElement, null)
    };
    const combobox = createStore(initialState, composite, popover, store);
    setup(combobox, () => chain(sync(combobox, ["inputValue"], (state) => {
      combobox.setState("value", state.inputValue);
    }), sync(combobox, ["value"], (state) => {
      combobox.setState("inputValue", state.value);
    })));
    let resolveSelectedItemOnOpen = false;
    const selectDefaultOptions = /* @__PURE__ */ new Set();
    if (props.focusLoop === void 0 && syncState?.focusLoop === void 0) selectDefaultOptions.add("focusLoop");
    if (props.focusWrap === void 0 && syncState?.focusWrap === void 0) selectDefaultOptions.add("focusWrap");
    if (props.compositeElementInFocusOrder === void 0 && props.includesBaseElement === void 0 && syncState?.compositeElementInFocusOrder === void 0 && syncState?.includesBaseElement === void 0) selectDefaultOptions.add("compositeElementInFocusOrder");
    if (props.resetValueOnSelect === void 0 && syncState?.resetValueOnSelect === void 0) selectDefaultOptions.add("resetValueOnSelect");
    let syncedSelectElement = initialState.compositeElement === initialState.selectElement ? initialState.selectElement : null;
    const initialFallback = initialState.selectElement || initialState.compositeElement || initialState.disclosureElement;
    let syncedAnchorElement = initialState.anchorElement === initialFallback ? initialState.anchorElement : null;
    setup(combobox, () => sync(combobox, ["compositeElement", "selectElement"], (state) => {
      if (!state.selectElement && !syncedSelectElement) return;
      if (state.compositeElement && state.compositeElement === state.selectElement) {
        syncedSelectElement = state.selectElement;
        return;
      }
      if (state.compositeElement && state.compositeElement !== syncedSelectElement) {
        syncedSelectElement = null;
        return;
      }
      syncedSelectElement = state.selectElement;
      combobox.setState("compositeElement", syncedSelectElement);
    }));
    setup(combobox, () => sync(combobox, ["selectElement"], (state) => {
      if (!state.selectElement) return;
      const { focusLoop, focusWrap, compositeElementInFocusOrder, resetValueOnSelect } = combobox.getState();
      if (selectDefaultOptions.has("focusLoop")) composite.setState("focusLoop", false);
      if (selectDefaultOptions.has("focusWrap")) composite.setState("focusWrap", false);
      if (selectDefaultOptions.has("compositeElementInFocusOrder")) composite.setState("compositeElementInFocusOrder", false);
      if (selectDefaultOptions.has("resetValueOnSelect")) combobox.setState("resetValueOnSelect", true);
      return () => {
        const current = combobox.getState();
        if (selectDefaultOptions.has("focusLoop") && !current.focusLoop) composite.setState("focusLoop", focusLoop);
        if (selectDefaultOptions.has("focusWrap") && !current.focusWrap) composite.setState("focusWrap", focusWrap);
        if (selectDefaultOptions.has("compositeElementInFocusOrder") && !current.compositeElementInFocusOrder) composite.setState("compositeElementInFocusOrder", compositeElementInFocusOrder);
        if (selectDefaultOptions.has("resetValueOnSelect") && current.resetValueOnSelect) combobox.setState("resetValueOnSelect", resetValueOnSelect);
      };
    }));
    setup(combobox, () => sync(combobox, [
      "anchorElement",
      "compositeElement",
      "disclosureElement",
      "selectElement"
    ], (state) => {
      if (state.anchorElement && state.anchorElement !== syncedAnchorElement) {
        syncedAnchorElement = null;
        return;
      }
      syncedAnchorElement = state.selectElement || state.compositeElement || state.disclosureElement;
      combobox.setState("anchorElement", syncedAnchorElement);
    }));
    setup(combobox, () => sync(combobox, [
      "items",
      "selectedValue",
      "selectElement"
    ], (state, prevState) => {
      if (!shouldSetDefaultSelectedValue) return;
      if (state.selectedValue !== prevState.selectedValue) {
        shouldSetDefaultSelectedValue = false;
        return;
      }
      if (!state.selectElement) return;
      queueMicrotask(() => {
        if (!shouldSetDefaultSelectedValue) return;
        const state2 = combobox.getState();
        if (!state2.selectElement) return;
        const item = state2.items.find((item2) => !item2.disabled && item2.value != null);
        if (item?.value == null) return;
        shouldSetDefaultSelectedValue = false;
        combobox.setState("selectedValue", item.value);
      });
    }));
    if (isTouchSafari) setup(combobox, () => sync(combobox, ["virtualFocus"], () => {
      combobox.setState("virtualFocus", false);
    }));
    setup(combobox, () => {
      if (!tag) return;
      return chain(sync(combobox, ["selectedValue"], (state) => {
        if (!Array.isArray(state.selectedValue)) return;
        tag.setValues(state.selectedValue);
      }), sync(tag, ["values"], (state) => {
        combobox.setState("selectedValue", state.values);
      }));
    });
    setup(combobox, () => sync(combobox, ["resetValueOnHide", "mounted"], (state) => {
      if (!state.resetValueOnHide) return;
      if (state.mounted) return;
      combobox.setState("inputValue", inputValue);
    }));
    setup(combobox, () => sync(combobox, ["open"], (state) => {
      if (state.open) {
        resolveSelectedItemOnOpen = true;
        return;
      }
      resolveSelectedItemOnOpen = false;
      combobox.setState("activeId", activeId);
      combobox.setState("moves", 0);
    }));
    setup(combobox, () => sync(combobox, ["moves", "activeId"], (state, prevState) => {
      if (state.moves !== prevState.moves) resolveSelectedItemOnOpen = false;
      if (state.activeId !== prevState.activeId) resolveSelectedItemOnOpen = false;
      if (state.moves === prevState.moves) combobox.setState("activeValue", void 0);
    }));
    setup(combobox, () => batch(combobox, ["moves", "renderedItems"], (state, prev) => {
      if (state.moves === prev.moves) return;
      const { activeId: activeId2 } = combobox.getState();
      const activeItem = composite.item(activeId2);
      combobox.setState("activeValue", activeItem?.value);
    }));
    setup(combobox, () => sync(combobox, [
      "items",
      "mounted",
      "open",
      "selectedValue",
      "selectElement"
    ], (state) => {
      if (!state.selectElement) return;
      if (state.mounted && !resolveSelectedItemOnOpen) return;
      const values = Array.isArray(state.selectedValue) ? state.selectedValue : [state.selectedValue];
      const lastValue = values[values.length - 1];
      if (lastValue == null) return;
      const item = state.items.find((item2) => !item2.disabled && item2.value === lastValue);
      if (!item) return;
      resolveSelectedItemOnOpen = false;
      combobox.setState("activeId", item.id);
    }));
    setup(combobox, () => batch(combobox, ["selectOnMove", "moves"], (state) => {
      const { activeId: activeId2, open: open2, selectedValue: selectedValue2, selectElement } = combobox.getState();
      if (!selectElement) return;
      if (!state.selectOnMove && open2) return;
      if (Array.isArray(selectedValue2)) return;
      if (!state.moves) return;
      if (!activeId2) return;
      const item = composite.item(activeId2);
      if (!item || item.disabled || item.value == null) return;
      combobox.setState("selectedValue", item.value);
    }));
    const setInputValue = (value) => {
      combobox.setState("inputValue", value);
    };
    const resetInputValue = () => setInputValue(initialState.inputValue);
    const setState = (key, value) => {
      selectDefaultOptions.delete(key);
      if (key === "includesBaseElement") selectDefaultOptions.delete("compositeElementInFocusOrder");
      if (key === "selectedValue") shouldSetDefaultSelectedValue = false;
      combobox.setState(key, value);
    };
    return {
      ...popover,
      ...composite,
      ...combobox,
      setState,
      tag,
      setInputValue,
      resetInputValue,
      setValue: setInputValue,
      resetValue: resetInputValue,
      setSelectedValue: (selectedValue2) => setState("selectedValue", selectedValue2),
      setInputElement: (element) => combobox.setState("inputElement", element),
      setLabelElement: (element) => combobox.setState("labelElement", element),
      setSelectElement: (element) => combobox.setState("selectElement", element),
      setSelectLabelElement: (element) => combobox.setState("selectLabelElement", element)
    };
  }

  // node_modules/@ariakit/react-components/dist/combobox/combobox-store.js
  function useComboboxStoreOptions(props) {
    const tag = useTagContext();
    props = {
      ...props,
      tag: props.tag !== void 0 ? props.tag : tag
    };
    return useCompositeStoreOptions(props);
  }
  function useComboboxStoreProps(store, update2, props) {
    useUpdateEffect(update2, [props.tag, update2]);
    const inputValueProps = {
      inputValue: props.inputValue ?? props.value,
      setInputValue: props.setInputValue ?? props.setValue
    };
    useStoreProps(store, inputValueProps, "inputValue", "setInputValue");
    useStoreProps(store, props, "selectedValue", "setSelectedValue");
    useStoreProps(store, props, "selectOnMove");
    useStoreProps(store, props, "resetValueOnHide");
    useStoreProps(store, props, "resetValueOnSelect");
    return Object.assign(useCompositeStoreProps(usePopoverStoreProps(store, update2, props), update2, props), { tag: props.tag });
  }
  function useComboboxStore(props = {}) {
    props = useComboboxStoreOptions(props);
    const [store, update2] = useStore2(createComboboxStore, props);
    return useComboboxStoreProps(store, update2, props);
  }

  // node_modules/@ariakit/react-components/dist/combobox/combobox-provider.js
  var import_jsx_runtime150 = __toESM(require_jsx_runtime(), 1);
  function ComboboxProvider(props = {}) {
    const store = useComboboxStore(props);
    return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(ComboboxContextProvider, {
      value: store,
      children: props.children
    });
  }

  // packages/dataviews/build-module/components/dataviews-filters/search-widget.mjs
  var import_remove_accents = __toESM(require_remove_accents(), 1);
  var import_compose12 = __toESM(require_compose(), 1);
  var import_i18n39 = __toESM(require_i18n(), 1);
  var import_element99 = __toESM(require_element(), 1);
  var import_components21 = __toESM(require_components(), 1);

  // packages/dataviews/build-module/components/dataviews-filters/utils.mjs
  var EMPTY_ARRAY3 = [];
  var getCurrentValue = (filterDefinition, currentFilter) => {
    if (filterDefinition.singleSelection) {
      return currentFilter?.value;
    }
    if (Array.isArray(currentFilter?.value)) {
      return currentFilter.value;
    }
    if (!Array.isArray(currentFilter?.value) && !!currentFilter?.value) {
      return [currentFilter.value];
    }
    return EMPTY_ARRAY3;
  };

  // packages/dataviews/build-module/hooks/use-elements.mjs
  var import_element98 = __toESM(require_element(), 1);
  var EMPTY_ARRAY4 = [];
  function useElements({
    elements,
    getElements
  }) {
    const staticElements = Array.isArray(elements) && elements.length > 0 ? elements : EMPTY_ARRAY4;
    const [records, setRecords] = (0, import_element98.useState)(staticElements);
    const [isLoading, setIsLoading] = (0, import_element98.useState)(false);
    (0, import_element98.useEffect)(() => {
      if (!getElements) {
        setRecords(staticElements);
        return;
      }
      let cancelled2 = false;
      setIsLoading(true);
      getElements().then((fetchedElements) => {
        if (!cancelled2) {
          const dynamicElements = Array.isArray(fetchedElements) && fetchedElements.length > 0 ? fetchedElements : staticElements;
          setRecords(dynamicElements);
        }
      }).catch(() => {
        if (!cancelled2) {
          setRecords(staticElements);
        }
      }).finally(() => {
        if (!cancelled2) {
          setIsLoading(false);
        }
      });
      return () => {
        cancelled2 = true;
      };
    }, [getElements, staticElements]);
    return {
      elements: records,
      isLoading
    };
  }

  // packages/dataviews/build-module/components/dataviews-filters/search-widget.mjs
  var import_jsx_runtime151 = __toESM(require_jsx_runtime(), 1);
  function normalizeSearchInput(input = "") {
    return (0, import_remove_accents.default)(input.trim().toLowerCase());
  }
  var getNewValue = (filterDefinition, currentFilter, value) => {
    if (filterDefinition.singleSelection) {
      return value;
    }
    if (Array.isArray(currentFilter?.value)) {
      return currentFilter.value.includes(value) ? currentFilter.value.filter((v2) => v2 !== value) : [...currentFilter.value, value];
    }
    return [value];
  };
  function generateFilterElementCompositeItemId(prefix, filterElementValue) {
    return `${prefix}-${filterElementValue}`;
  }
  var MultiSelectionOption = ({ selected }) => {
    return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
      "span",
      {
        className: clsx_default(
          "dataviews-filters__search-widget-listitem-multi-selection",
          { "is-selected": selected }
        ),
        children: selected && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_components21.Icon, { icon: check_default })
      }
    );
  };
  var SingleSelectionOption = ({ selected }) => {
    return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
      "span",
      {
        className: clsx_default(
          "dataviews-filters__search-widget-listitem-single-selection",
          { "is-selected": selected }
        )
      }
    );
  };
  function ListBox({ view, filter, onChangeView }) {
    const baseId = (0, import_compose12.useInstanceId)(ListBox, "dataviews-filter-list-box");
    const [activeCompositeId, setActiveCompositeId] = (0, import_element99.useState)(
      // When there are one or less operators, the first item is set as active
      // (by setting the initial `activeId` to `undefined`).
      // With 2 or more operators, the focus is moved on the operators control
      // (by setting the initial `activeId` to `null`), meaning that there won't
      // be an active item initially. Focus is then managed via the
      // `onFocusVisible` callback.
      filter.operators?.length === 1 ? void 0 : null
    );
    const currentFilter = view.filters?.find(
      (f) => f.field === filter.field
    );
    const currentValue = getCurrentValue(filter, currentFilter);
    return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
      import_components21.Composite,
      {
        virtualFocus: true,
        focusLoop: true,
        activeId: activeCompositeId,
        setActiveId: setActiveCompositeId,
        role: "listbox",
        className: "dataviews-filters__search-widget-listbox",
        "aria-label": (0, import_i18n39.sprintf)(
          /* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
          (0, import_i18n39.__)("List of: %1$s"),
          filter.name
        ),
        onFocusVisible: () => {
          if (!activeCompositeId && filter.elements.length) {
            setActiveCompositeId(
              generateFilterElementCompositeItemId(
                baseId,
                filter.elements[0].value
              )
            );
          }
        },
        render: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_components21.Composite.Typeahead, {}),
        children: filter.elements.map((element) => /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
          import_components21.Composite.Hover,
          {
            render: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
              import_components21.Composite.Item,
              {
                id: generateFilterElementCompositeItemId(
                  baseId,
                  element.value
                ),
                render: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
                  "div",
                  {
                    "aria-label": element.label,
                    role: "option",
                    className: "dataviews-filters__search-widget-listitem"
                  }
                ),
                onClick: () => {
                  const newFilters = currentFilter ? [
                    ...(view.filters ?? []).map(
                      (_filter) => {
                        if (_filter.field === filter.field) {
                          return {
                            ..._filter,
                            operator: currentFilter.operator || filter.operators[0],
                            value: getNewValue(
                              filter,
                              currentFilter,
                              element.value
                            )
                          };
                        }
                        return _filter;
                      }
                    )
                  ] : [
                    ...view.filters ?? [],
                    {
                      field: filter.field,
                      operator: filter.operators[0],
                      value: getNewValue(
                        filter,
                        currentFilter,
                        element.value
                      )
                    }
                  ];
                  onChangeView({
                    ...view,
                    page: 1,
                    filters: newFilters
                  });
                }
              }
            ),
            children: [
              filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
                SingleSelectionOption,
                {
                  selected: currentValue === element.value
                }
              ),
              !filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
                MultiSelectionOption,
                {
                  selected: currentValue.includes(element.value)
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
                "span",
                {
                  className: "dataviews-filters__search-widget-listitem-value",
                  title: element.label,
                  children: element.label
                }
              )
            ]
          },
          element.value
        ))
      }
    );
  }
  function ComboboxList22({ view, filter, onChangeView }) {
    const [searchValue, setSearchValue] = (0, import_element99.useState)("");
    const deferredSearchValue = (0, import_element99.useDeferredValue)(searchValue);
    const currentFilter = view.filters?.find(
      (_filter) => _filter.field === filter.field
    );
    const currentValue = getCurrentValue(filter, currentFilter);
    const matches = (0, import_element99.useMemo)(() => {
      const normalizedSearch = normalizeSearchInput(deferredSearchValue);
      return filter.elements.filter(
        (item) => normalizeSearchInput(item.label).includes(normalizedSearch)
      );
    }, [filter.elements, deferredSearchValue]);
    return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
      ComboboxProvider,
      {
        selectedValue: currentValue,
        setSelectedValue: (value) => {
          const newFilters = currentFilter ? [
            ...(view.filters ?? []).map((_filter) => {
              if (_filter.field === filter.field) {
                return {
                  ..._filter,
                  operator: currentFilter.operator || filter.operators[0],
                  value
                };
              }
              return _filter;
            })
          ] : [
            ...view.filters ?? [],
            {
              field: filter.field,
              operator: filter.operators[0],
              value
            }
          ];
          onChangeView({
            ...view,
            page: 1,
            filters: newFilters
          });
        },
        setValue: setSearchValue,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [
            /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(ComboboxLabel, {}), children: (0, import_i18n39.__)("Search items") }),
            /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
              Combobox,
              {
                autoSelect: "always",
                placeholder: (0, import_i18n39.__)("Search"),
                className: "dataviews-filters__search-widget-filter-combobox__input"
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_components21.Icon, { icon: search_default }) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
            ComboboxList,
            {
              className: "dataviews-filters__search-widget-filter-combobox-list",
              alwaysVisible: true,
              children: [
                matches.map((element) => {
                  return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
                    ComboboxItem,
                    {
                      resetValueOnSelect: false,
                      value: element.value,
                      className: "dataviews-filters__search-widget-listitem",
                      hideOnClick: false,
                      setValueOnClick: false,
                      focusOnHover: true,
                      children: [
                        filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
                          SingleSelectionOption,
                          {
                            selected: currentValue === element.value
                          }
                        ),
                        !filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
                          MultiSelectionOption,
                          {
                            selected: currentValue.includes(
                              element.value
                            )
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
                          "span",
                          {
                            className: "dataviews-filters__search-widget-listitem-value",
                            title: element.label,
                            children: [
                              /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
                                ComboboxItemValue,
                                {
                                  className: "dataviews-filters__search-widget-filter-combobox-item-value",
                                  value: element.label
                                }
                              ),
                              !!element.description && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description })
                            ]
                          }
                        )
                      ]
                    },
                    element.value
                  );
                }),
                !matches.length && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { children: (0, import_i18n39.__)("No results found") })
              ]
            }
          )
        ]
      }
    );
  }
  function SearchWidget(props) {
    const { elements, isLoading } = useElements({
      elements: props.filter.elements,
      getElements: props.filter.getElements
    });
    if (isLoading) {
      return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_components21.Spinner, {}) });
    }
    if (elements.length === 0) {
      return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: (0, import_i18n39.__)("No elements found") });
    }
    const Widget = elements.length > 10 ? ComboboxList22 : ListBox;
    return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Widget, { ...props, filter: { ...props.filter, elements } });
  }

  // packages/dataviews/build-module/components/dataviews-filters/input-widget.mjs
  var import_es6 = __toESM(require_es6(), 1);
  var import_compose13 = __toESM(require_compose(), 1);
  var import_element100 = __toESM(require_element(), 1);
  var import_components22 = __toESM(require_components(), 1);
  var import_jsx_runtime152 = __toESM(require_jsx_runtime(), 1);
  function InputWidget({
    filter,
    view,
    onChangeView,
    fields
  }) {
    const currentFilter = view.filters?.find(
      (f) => f.field === filter.field
    );
    const currentValue = getCurrentValue(filter, currentFilter);
    const field = (0, import_element100.useMemo)(() => {
      const currentField = fields.find((f) => f.id === filter.field);
      if (currentField) {
        return {
          ...currentField,
          // Deactivate validation for filters.
          isValid: {},
          // Filter controls are always enabled.
          isDisabled: () => false,
          // Filter controls are always visible.
          isVisible: () => true,
          // Configure getValue/setValue as if Item was a plain object.
          getValue: ({ item }) => item[currentField.id],
          setValue: ({ value }) => ({
            [currentField.id]: value
          })
        };
      }
      return currentField;
    }, [fields, filter.field]);
    const data = (0, import_element100.useMemo)(() => {
      return (view.filters ?? []).reduce(
        (acc, activeFilter) => {
          acc[activeFilter.field] = activeFilter.value;
          return acc;
        },
        {}
      );
    }, [view.filters]);
    const handleChange = (0, import_compose13.useEvent)((updatedData) => {
      if (!field || !currentFilter) {
        return;
      }
      const nextValue = field.getValue({ item: updatedData });
      if ((0, import_es6.default)(nextValue, currentValue)) {
        return;
      }
      onChangeView({
        ...view,
        filters: (view.filters ?? []).map(
          (_filter) => _filter.field === filter.field ? {
            ..._filter,
            operator: currentFilter.operator || filter.operators[0],
            // Consider empty strings as undefined:
            //
            // - undefined as value means the filter is unset: the filter widget displays no value and the search returns all records
            // - empty string as value means "search empty string": returns only the records that have an empty string as value
            //
            // In practice, this means the filter will not be able to find an empty string as the value.
            value: nextValue === "" ? void 0 : nextValue
          } : _filter
        )
      });
    });
    if (!field || !field.Edit || !currentFilter) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
      import_components22.Flex,
      {
        className: "dataviews-filters__user-input-widget",
        gap: 2.5,
        direction: "column",
        children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
          field.Edit,
          {
            hideLabelFromVision: true,
            data,
            field,
            operator: currentFilter.operator,
            onChange: handleChange
          }
        )
      }
    );
  }

  // packages/dataviews/build-module/utils/operators.mjs
  var import_i18n40 = __toESM(require_i18n(), 1);
  var import_element101 = __toESM(require_element(), 1);
  var import_date2 = __toESM(require_date(), 1);

  // packages/dataviews/build-module/field-types/utils/parse-time.mjs
  var ZONE_DESIGNATOR = /(?:[Zz]|[+-](?:[01]\d|2[0-3]):?[0-5]\d)$/;
  var TIME_FORMATS = ["HH:mm", "HH:mm:ss"];
  var REFERENCE_DATE = new Date(2e3, 0, 1);
  function parseTime2(value) {
    if (typeof value !== "string") {
      return null;
    }
    const time = value.trim().replace(ZONE_DESIGNATOR, "");
    for (const timeFormat of TIME_FORMATS) {
      const parsed = parse(time, timeFormat, REFERENCE_DATE);
      if (isValid(parsed)) {
        return parsed.getHours() * 3600 + parsed.getMinutes() * 60 + parsed.getSeconds();
      }
    }
    return null;
  }

  // packages/dataviews/build-module/utils/operators.mjs
  var import_jsx_runtime153 = __toESM(require_jsx_runtime(), 1);
  var filterTextWrappers = {
    Name: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: "dataviews-filters__summary-filter-text-name" }),
    Value: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: "dataviews-filters__summary-filter-text-value" })
  };
  function toComparableTemporals(fieldValue, filterValue) {
    const filterTime = parseTime2(filterValue);
    if (filterTime !== null) {
      return [parseTime2(fieldValue) ?? NaN, filterTime];
    }
    return [
      (0, import_date2.getDate)(fieldValue).getTime(),
      (0, import_date2.getDate)(filterValue).getTime()
    ];
  }
  function getRelativeDate(value, unit) {
    switch (unit) {
      case "days":
        return subDays(/* @__PURE__ */ new Date(), value);
      case "weeks":
        return subWeeks(/* @__PURE__ */ new Date(), value);
      case "months":
        return subMonths(/* @__PURE__ */ new Date(), value);
      case "years":
        return subYears(/* @__PURE__ */ new Date(), value);
      default:
        return /* @__PURE__ */ new Date();
    }
  }
  var isNoneOperatorDefinition = {
    /* translators: DataViews operator name */
    label: (0, import_i18n40.__)("Is none of"),
    filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
      (0, import_i18n40.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is none of: Admin, Editor". */
        (0, import_i18n40.__)("<Name>%1$s is none of: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements.map((element) => element.label).join(", ")
      ),
      filterTextWrappers
    ),
    filter: ((item, field, filterValue) => {
      if (!filterValue?.length) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      if (Array.isArray(fieldValue)) {
        return !filterValue.some(
          (fv) => fieldValue.includes(fv)
        );
      } else if (typeof fieldValue === "string" || typeof fieldValue === "number") {
        return !filterValue.includes(fieldValue);
      }
      return false;
    }),
    selection: "multi"
  };
  var OPERATORS = [
    {
      name: OPERATOR_IS_ANY,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Includes"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is any: Admin, Editor". */
          (0, import_i18n40.__)("<Name>%1$s includes: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements.map((element) => element.label).join(", ")
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (!filterValue?.length) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        if (Array.isArray(fieldValue)) {
          return filterValue.some(
            (fv) => fieldValue.includes(fv)
          );
        } else if (typeof fieldValue === "string" || typeof fieldValue === "number") {
          return filterValue.includes(fieldValue);
        }
        return false;
      },
      selection: "multi"
    },
    {
      name: OPERATOR_IS_NONE,
      ...isNoneOperatorDefinition
    },
    {
      name: OPERATOR_IS_ALL,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Includes all"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author includes all: Admin, Editor". */
          (0, import_i18n40.__)("<Name>%1$s includes all: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements.map((element) => element.label).join(", ")
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (!filterValue?.length) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        if (!Array.isArray(fieldValue)) {
          return false;
        }
        return filterValue.every(
          (value) => fieldValue.includes(value)
        );
      },
      selection: "multi"
    },
    {
      name: OPERATOR_IS_NOT_ALL,
      ...isNoneOperatorDefinition
    },
    {
      name: OPERATOR_BETWEEN,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Between (inc)"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Item count"). 2: Filter value min. 3: Filter value max. e.g.: "Item count between (inc): 10 and 180". */
          (0, import_i18n40.__)(
            "<Name>%1$s between (inc): </Name><Value>%2$s and %3$s</Value>"
          ),
          filter.name,
          activeElements[0].label[0],
          activeElements[0].label[1]
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (!Array.isArray(filterValue) || filterValue.length !== 2 || // An unfilled bound is `undefined` from the controls, `''`
        // when it arrives from a persisted view, or `null` once
        // `undefined` round-trips through JSON persistence.
        filterValue.includes(void 0) || filterValue.includes("") || filterValue.includes(null)) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        const [min3, max3] = filterValue.map(parseTime2);
        if (min3 !== null && max3 !== null) {
          const value = parseTime2(fieldValue);
          return value !== null && value >= min3 && value <= max3;
        }
        if (typeof fieldValue === "number" || fieldValue instanceof Date || typeof fieldValue === "string") {
          return fieldValue >= filterValue[0] && fieldValue <= filterValue[1];
        }
        return false;
      },
      selection: "custom"
    },
    {
      name: OPERATOR_IN_THE_PAST,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("In the past"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is in the past: 7 days". */
          (0, import_i18n40.__)(
            "<Name>%1$s is in the past: </Name><Value>%2$s</Value>"
          ),
          filter.name,
          `${activeElements[0].value.value} ${activeElements[0].value.unit}`
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue?.value === void 0 || filterValue?.unit === void 0) {
          return true;
        }
        const targetDate = getRelativeDate(
          filterValue.value,
          filterValue.unit
        );
        const fieldValue = (0, import_date2.getDate)(field.getValue({ item }));
        return fieldValue >= targetDate && fieldValue <= /* @__PURE__ */ new Date();
      },
      selection: "custom"
    },
    {
      name: OPERATOR_OVER,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Over"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is over: 7 days". */
          (0, import_i18n40.__)("<Name>%1$s is over: </Name><Value>%2$s</Value>"),
          filter.name,
          `${activeElements[0].value.value} ${activeElements[0].value.unit}`
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue?.value === void 0 || filterValue?.unit === void 0) {
          return true;
        }
        const targetDate = getRelativeDate(
          filterValue.value,
          filterValue.unit
        );
        const fieldValue = (0, import_date2.getDate)(field.getValue({ item }));
        return fieldValue < targetDate;
      },
      selection: "custom"
    },
    {
      name: OPERATOR_IS,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Is"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is: Admin". */
          (0, import_i18n40.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        return filterValue === field.getValue({ item }) || filterValue === void 0;
      },
      selection: "single"
    },
    {
      name: OPERATOR_IS_NOT,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Is not"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is not: Admin". */
          (0, import_i18n40.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        return filterValue !== field.getValue({ item });
      },
      selection: "single"
    },
    {
      name: OPERATOR_LESS_THAN,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Less than"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than: 10". */
          (0, import_i18n40.__)("<Name>%1$s is less than: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        return fieldValue < filterValue;
      },
      selection: "single"
    },
    {
      name: OPERATOR_GREATER_THAN,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Greater than"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than: 10". */
          (0, import_i18n40.__)(
            "<Name>%1$s is greater than: </Name><Value>%2$s</Value>"
          ),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        return fieldValue > filterValue;
      },
      selection: "single"
    },
    {
      name: OPERATOR_LESS_THAN_OR_EQUAL,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Less than or equal"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than or equal to: 10". */
          (0, import_i18n40.__)(
            "<Name>%1$s is less than or equal to: </Name><Value>%2$s</Value>"
          ),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        return fieldValue <= filterValue;
      },
      selection: "single"
    },
    {
      name: OPERATOR_GREATER_THAN_OR_EQUAL,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Greater than or equal"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than or equal to: 10". */
          (0, import_i18n40.__)(
            "<Name>%1$s is greater than or equal to: </Name><Value>%2$s</Value>"
          ),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        return fieldValue >= filterValue;
      },
      selection: "single"
    },
    {
      name: OPERATOR_BEFORE,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Before"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is before: 2024-01-01". */
          (0, import_i18n40.__)("<Name>%1$s is before: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const [fieldTemporal, filterTemporal] = toComparableTemporals(
          field.getValue({ item }),
          filterValue
        );
        return fieldTemporal < filterTemporal;
      },
      selection: "single"
    },
    {
      name: OPERATOR_AFTER,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("After"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is after: 2024-01-01". */
          (0, import_i18n40.__)("<Name>%1$s is after: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const [fieldTemporal, filterTemporal] = toComparableTemporals(
          field.getValue({ item }),
          filterValue
        );
        return fieldTemporal > filterTemporal;
      },
      selection: "single"
    },
    {
      name: OPERATOR_BEFORE_INC,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Before (inc)"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or before: 2024-01-01". */
          (0, import_i18n40.__)(
            "<Name>%1$s is on or before: </Name><Value>%2$s</Value>"
          ),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const [fieldTemporal, filterTemporal] = toComparableTemporals(
          field.getValue({ item }),
          filterValue
        );
        return fieldTemporal <= filterTemporal;
      },
      selection: "single"
    },
    {
      name: OPERATOR_AFTER_INC,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("After (inc)"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or after: 2024-01-01". */
          (0, import_i18n40.__)(
            "<Name>%1$s is on or after: </Name><Value>%2$s</Value>"
          ),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const [fieldTemporal, filterTemporal] = toComparableTemporals(
          field.getValue({ item }),
          filterValue
        );
        return fieldTemporal >= filterTemporal;
      },
      selection: "single"
    },
    {
      name: OPERATOR_CONTAINS,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Contains"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title contains: Hello". */
          (0, import_i18n40.__)("<Name>%1$s contains: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        return typeof fieldValue === "string" && filterValue && fieldValue.toLowerCase().includes(String(filterValue).toLowerCase());
      },
      selection: "single"
    },
    {
      name: OPERATOR_NOT_CONTAINS,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Doesn't contain"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title doesn't contain: Hello". */
          (0, import_i18n40.__)(
            "<Name>%1$s doesn't contain: </Name><Value>%2$s</Value>"
          ),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        return typeof fieldValue === "string" && filterValue && !fieldValue.toLowerCase().includes(String(filterValue).toLowerCase());
      },
      selection: "single"
    },
    {
      name: OPERATOR_STARTS_WITH,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Starts with"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title starts with: Hello". */
          (0, import_i18n40.__)("<Name>%1$s starts with: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const fieldValue = field.getValue({ item });
        return typeof fieldValue === "string" && filterValue && fieldValue.toLowerCase().startsWith(String(filterValue).toLowerCase());
      },
      selection: "single"
    },
    {
      name: OPERATOR_ON,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("On"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is: 2024-01-01". */
          (0, import_i18n40.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const [fieldTemporal, filterTemporal] = toComparableTemporals(
          field.getValue({ item }),
          filterValue
        );
        return fieldTemporal === filterTemporal;
      },
      selection: "single"
    },
    {
      name: OPERATOR_NOT_ON,
      /* translators: DataViews operator name */
      label: (0, import_i18n40.__)("Not on"),
      filterText: (filter, activeElements) => (0, import_element101.createInterpolateElement)(
        (0, import_i18n40.sprintf)(
          /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is not: 2024-01-01". */
          (0, import_i18n40.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
          filter.name,
          activeElements[0].label
        ),
        filterTextWrappers
      ),
      filter(item, field, filterValue) {
        if (filterValue === void 0) {
          return true;
        }
        const [fieldTemporal, filterTemporal] = toComparableTemporals(
          field.getValue({ item }),
          filterValue
        );
        return fieldTemporal !== filterTemporal;
      },
      selection: "single"
    }
  ];
  var getOperatorByName = (name) => OPERATORS.find((op) => op.name === name);
  var getAllOperatorNames = () => OPERATORS.map((op) => op.name);
  var isSingleSelectionOperator = (name) => OPERATORS.filter((op) => op.selection === "single").some(
    (op) => op.name === name
  );
  var isRegisteredOperator = (name) => OPERATORS.some((op) => op.name === name);

  // packages/dataviews/build-module/components/dataviews-filters/filter.mjs
  var import_jsx_runtime154 = __toESM(require_jsx_runtime(), 1);
  var ENTER = "Enter";
  var SPACE = " ";
  var FilterText = ({
    activeElements,
    filterInView,
    filter
  }) => {
    if (activeElements === void 0 || activeElements.length === 0) {
      return filter.name;
    }
    const operator = getOperatorByName(filterInView?.operator);
    if (operator !== void 0) {
      return operator.filterText(filter, activeElements);
    }
    return (0, import_i18n41.sprintf)(
      /* translators: 1: Filter name e.g.: "Unknown status for Author". */
      (0, import_i18n41.__)("Unknown status for %1$s"),
      filter.name
    );
  };
  function OperatorSelector({
    filter,
    view,
    onChangeView
  }) {
    const operatorOptions = filter.operators?.map((operator) => ({
      value: operator,
      label: getOperatorByName(operator)?.label || operator
    }));
    const currentFilter = view.filters?.find(
      (_filter) => _filter.field === filter.field
    );
    const value = currentFilter?.operator || filter.operators[0];
    return operatorOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(
      Stack,
      {
        direction: "row",
        gap: "sm",
        justify: "flex-start",
        className: "dataviews-filters__summary-operators-container",
        align: "center",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(import_components23.FlexItem, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }),
          /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
            import_components23.SelectControl,
            {
              className: "dataviews-filters__summary-operators-filter-select",
              label: (0, import_i18n41.__)("Conditions"),
              value,
              options: operatorOptions,
              onChange: (newValue) => {
                const newOperator = newValue;
                const currentOperator = currentFilter?.operator;
                const newFilters = currentFilter ? [
                  ...(view.filters ?? []).map(
                    (_filter) => {
                      if (_filter.field === filter.field) {
                        const currentOpSelectionModel = getOperatorByName(
                          currentOperator
                        )?.selection;
                        const newOpSelectionModel = getOperatorByName(
                          newOperator
                        )?.selection;
                        const shouldResetValue = currentOpSelectionModel !== newOpSelectionModel || [
                          currentOpSelectionModel,
                          newOpSelectionModel
                        ].includes("custom");
                        return {
                          ..._filter,
                          value: shouldResetValue ? void 0 : _filter.value,
                          operator: newOperator
                        };
                      }
                      return _filter;
                    }
                  )
                ] : [
                  ...view.filters ?? [],
                  {
                    field: filter.field,
                    operator: newOperator,
                    value: void 0
                  }
                ];
                onChangeView({
                  ...view,
                  page: 1,
                  filters: newFilters
                });
              },
              size: "small",
              variant: "minimal",
              hideLabelFromVision: true
            }
          )
        ]
      }
    );
  }
  function Filter({
    addFilterRef,
    openedFilter,
    fields,
    ...commonProps
  }) {
    const toggleRef = (0, import_element102.useRef)(null);
    const { filter, view, onChangeView } = commonProps;
    const filterInView = view.filters?.find(
      (f) => f.field === filter.field
    );
    let activeElements = [];
    const field = (0, import_element102.useMemo)(() => {
      const currentField = fields.find((f) => f.id === filter.field);
      if (currentField) {
        return {
          ...currentField,
          // Configure getValue as if Item was a plain object.
          // See related input-widget.tsx
          getValue: ({ item }) => item[currentField.id]
        };
      }
      return currentField;
    }, [fields, filter.field]);
    const { elements } = useElements({
      elements: filter.elements,
      getElements: filter.getElements
    });
    if (elements.length > 0) {
      activeElements = elements.filter((element) => {
        if (filter.singleSelection) {
          return element.value === filterInView?.value;
        }
        return filterInView?.value?.includes(element.value);
      });
    } else if (Array.isArray(filterInView?.value)) {
      const isComplete = !filterInView.value.some(
        (v2) => v2 === void 0 || v2 === null || v2 === ""
      );
      if (isComplete) {
        const label = filterInView.value.map((v2) => {
          const formattedValue = field?.getValueFormatted({
            item: { [field.id]: v2 },
            field
          });
          return formattedValue || String(v2);
        });
        activeElements = [
          {
            value: filterInView.value,
            // @ts-expect-error `label` is a `string[]` here, but the element type expects a `string`.
            label
          }
        ];
      }
    } else if (typeof filterInView?.value === "object") {
      activeElements = [
        { value: filterInView.value, label: filterInView.value }
      ];
    } else if (filterInView?.value !== void 0) {
      const label = field !== void 0 ? field.getValueFormatted({
        item: { [field.id]: filterInView.value },
        field
      }) : String(filterInView.value);
      activeElements = [
        {
          value: filterInView.value,
          label
        }
      ];
    }
    const isPrimary = filter.isPrimary;
    const isLocked = filterInView?.isLocked;
    const hasValues = !isLocked && filterInView?.value !== void 0;
    const canResetOrRemove = !isLocked && (!isPrimary || hasValues);
    const resetOrRemoveLabel = isPrimary ? (0, import_i18n41.__)("Reset") : (0, import_i18n41.__)("Remove");
    return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
      import_components23.Dropdown,
      {
        defaultOpen: openedFilter === filter.field,
        contentClassName: "dataviews-filters__summary-popover",
        popoverProps: { placement: "bottom-start", role: "dialog" },
        onClose: () => {
          toggleRef.current?.focus();
        },
        renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)("div", { className: "dataviews-filters__summary-chip-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(tooltip_exports.Root, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
              tooltip_exports.Trigger,
              {
                render: /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
                  "div",
                  {
                    className: clsx_default(
                      "dataviews-filters__summary-chip",
                      {
                        "has-reset": canResetOrRemove,
                        "has-values": hasValues,
                        "is-not-clickable": isLocked
                      }
                    ),
                    role: "button",
                    tabIndex: isLocked ? -1 : 0,
                    onClick: () => {
                      if (!isLocked) {
                        onToggle();
                      }
                    },
                    onKeyDown: (event) => {
                      if (!isLocked && [ENTER, SPACE].includes(
                        event.key
                      )) {
                        onToggle();
                        event.preventDefault();
                      }
                    },
                    "aria-disabled": isLocked,
                    "aria-pressed": isOpen,
                    "aria-expanded": isOpen,
                    ref: toggleRef,
                    children: /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
                      FilterText,
                      {
                        activeElements,
                        filterInView,
                        filter
                      }
                    )
                  }
                )
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(tooltip_exports.Popup, { children: (0, import_i18n41.sprintf)(
              /* translators: 1: Filter name. */
              (0, import_i18n41.__)("Filter by: %1$s"),
              filter.name.toLowerCase()
            ) })
          ] }),
          canResetOrRemove && /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(tooltip_exports.Root, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
              tooltip_exports.Trigger,
              {
                render: /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
                  "button",
                  {
                    className: clsx_default(
                      "dataviews-filters__summary-chip-remove",
                      { "has-values": hasValues }
                    ),
                    "aria-label": resetOrRemoveLabel,
                    onClick: () => {
                      onChangeView({
                        ...view,
                        page: 1,
                        filters: view.filters?.filter(
                          (_filter) => _filter.field !== filter.field
                        )
                      });
                      if (!isPrimary) {
                        addFilterRef.current?.focus();
                      } else {
                        toggleRef.current?.focus();
                      }
                    },
                    children: /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(import_components23.Icon, { icon: close_small_default })
                  }
                )
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(tooltip_exports.Popup, { children: resetOrRemoveLabel })
          ] })
        ] }),
        renderContent: () => {
          return /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(Stack, { direction: "column", justify: "flex-start", children: [
            /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(OperatorSelector, { ...commonProps }),
            commonProps.filter.hasElements ? /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
              SearchWidget,
              {
                ...commonProps,
                filter: {
                  ...commonProps.filter,
                  elements
                }
              }
            ) : /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(InputWidget, { ...commonProps, fields })
          ] });
        }
      }
    );
  }

  // packages/dataviews/build-module/components/dataviews-filters/add-filter.mjs
  var import_components24 = __toESM(require_components(), 1);
  var import_i18n42 = __toESM(require_i18n(), 1);
  var import_element103 = __toESM(require_element(), 1);
  var import_jsx_runtime155 = __toESM(require_jsx_runtime(), 1);
  function AddFilterMenu({
    filters,
    view,
    onChangeView,
    setOpenedFilter,
    triggerProps
  }) {
    const inactiveFilters = filters.filter((filter) => !filter.isVisible);
    return (
      // The `disabled` prop on `Menu.Root` (rather than on the trigger)
      // keeps the menu from opening while letting the trigger button stay
      // focusable via its own `accessibleWhenDisabled`.
      /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(menu_exports.Root, { disabled: !inactiveFilters.length, children: [
        /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(menu_exports.Trigger, { ...triggerProps }),
        /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(menu_exports.Popup, { children: inactiveFilters.map((filter) => {
          return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
            menu_exports.Item,
            {
              onClick: () => {
                setOpenedFilter(filter.field);
                onChangeView({
                  ...view,
                  page: 1,
                  filters: [
                    ...view.filters || [],
                    {
                      field: filter.field,
                      value: void 0,
                      operator: filter.operators[0]
                    }
                  ]
                });
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(menu_exports.ItemLabel, { children: filter.name })
            },
            filter.field
          );
        }) })
      ] })
    );
  }
  function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) {
    if (!filters.length || filters.every(({ isPrimary }) => isPrimary)) {
      return null;
    }
    const inactiveFilters = filters.filter((filter) => !filter.isVisible);
    return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
      AddFilterMenu,
      {
        triggerProps: {
          render: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
            import_components24.Button,
            {
              accessibleWhenDisabled: true,
              size: "compact",
              className: "dataviews-filters-button",
              variant: "tertiary",
              disabled: !inactiveFilters.length,
              ref
            }
          ),
          children: (0, import_i18n42.__)("Add filter")
        },
        ...{ filters, view, onChangeView, setOpenedFilter }
      }
    );
  }
  var add_filter_default = (0, import_element103.forwardRef)(AddFilter);

  // packages/dataviews/build-module/components/dataviews-filters/reset-filters.mjs
  var import_components25 = __toESM(require_components(), 1);
  var import_i18n43 = __toESM(require_i18n(), 1);
  var import_jsx_runtime156 = __toESM(require_jsx_runtime(), 1);
  function ResetFilter({
    filters,
    view,
    onChangeView
  }) {
    const isPrimary = (field) => filters.some(
      (_filter) => _filter.field === field && _filter.isPrimary
    );
    const isDisabled = !view.search && !view.filters?.some(
      (_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field))
    );
    return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
      import_components25.Button,
      {
        disabled: isDisabled,
        accessibleWhenDisabled: true,
        size: "compact",
        variant: "tertiary",
        className: "dataviews-filters__reset-button",
        onClick: () => {
          onChangeView({
            ...view,
            page: 1,
            search: "",
            filters: view.filters?.filter((f) => !!f.isLocked) || []
          });
        },
        children: (0, import_i18n43.__)("Reset")
      }
    );
  }

  // packages/dataviews/build-module/components/dataviews-filters/use-filters.mjs
  var import_element104 = __toESM(require_element(), 1);
  function useFilters(fields, view) {
    return (0, import_element104.useMemo)(() => {
      const filters = [];
      fields.forEach((field) => {
        if (field.filterBy === false || !field.hasElements && !field.Edit) {
          return;
        }
        const operators = field.filterBy.operators;
        const isPrimary = !!field.filterBy?.isPrimary;
        const isLocked = view.filters?.some(
          (f) => f.field === field.id && !!f.isLocked
        ) ?? false;
        filters.push({
          field: field.id,
          name: field.label,
          elements: field.elements,
          getElements: field.getElements,
          hasElements: field.hasElements,
          singleSelection: operators.some(
            (op) => isSingleSelectionOperator(op)
          ),
          operators,
          isVisible: isLocked || isPrimary || !!view.filters?.some(
            (f) => f.field === field.id && isRegisteredOperator(f.operator)
          ),
          isPrimary,
          isLocked
        });
      });
      filters.sort((a, b) => {
        if (a.isLocked && !b.isLocked) {
          return -1;
        }
        if (!a.isLocked && b.isLocked) {
          return 1;
        }
        if (a.isPrimary && !b.isPrimary) {
          return -1;
        }
        if (!a.isPrimary && b.isPrimary) {
          return 1;
        }
        return a.name.localeCompare(b.name);
      });
      return filters;
    }, [fields, view]);
  }
  var use_filters_default = useFilters;

  // packages/dataviews/build-module/components/dataviews-filters/filters.mjs
  var import_jsx_runtime157 = __toESM(require_jsx_runtime(), 1);
  function Filters({ className }) {
    const { fields, view, onChangeView, openedFilter, setOpenedFilter } = (0, import_element105.useContext)(dataviews_context_default);
    const addFilterRef = (0, import_element105.useRef)(null);
    const filters = use_filters_default(fields, view);
    const addFilter = /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
      add_filter_default,
      {
        filters,
        view,
        onChangeView,
        ref: addFilterRef,
        setOpenedFilter
      },
      "add-filter"
    );
    const visibleFilters = filters.filter((filter) => filter.isVisible);
    if (visibleFilters.length === 0) {
      return null;
    }
    const filterComponents = [
      ...visibleFilters.map((filter) => {
        return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
          Filter,
          {
            filter,
            view,
            fields,
            onChangeView,
            addFilterRef,
            openedFilter
          },
          filter.field
        );
      }),
      addFilter
    ];
    filterComponents.push(
      /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
        ResetFilter,
        {
          filters,
          view,
          onChangeView
        },
        "reset-filters"
      )
    );
    return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
      Stack,
      {
        direction: "row",
        justify: "flex-start",
        gap: "sm",
        style: { width: "fit-content" },
        wrap: "wrap",
        className,
        children: filterComponents
      }
    );
  }
  var filters_default = (0, import_element105.memo)(Filters);

  // packages/dataviews/build-module/components/dataviews-filters/toggle.mjs
  var import_element106 = __toESM(require_element(), 1);
  var import_components26 = __toESM(require_components(), 1);
  var import_i18n44 = __toESM(require_i18n(), 1);
  var import_jsx_runtime158 = __toESM(require_jsx_runtime(), 1);
  function FiltersToggle() {
    const {
      filters,
      view,
      onChangeView,
      setOpenedFilter,
      isShowingFilter,
      setIsShowingFilter
    } = (0, import_element106.useContext)(dataviews_context_default);
    const buttonRef = (0, import_element106.useRef)(null);
    const onChangeViewWithFilterVisibility = (0, import_element106.useCallback)(
      (_view) => {
        onChangeView(_view);
        setIsShowingFilter(true);
      },
      [onChangeView, setIsShowingFilter]
    );
    if (filters.length === 0) {
      return null;
    }
    const hasVisibleFilters = filters.some((filter) => filter.isVisible);
    const addFilterButtonProps = {
      label: (0, import_i18n44.__)("Add filter"),
      "aria-expanded": false,
      isPressed: false
    };
    const toggleFiltersButtonProps = {
      label: (0, import_i18n44._x)("Filter", "verb"),
      "aria-expanded": isShowingFilter,
      isPressed: isShowingFilter,
      onClick: () => {
        if (!isShowingFilter) {
          setOpenedFilter(null);
        }
        setIsShowingFilter(!isShowingFilter);
      }
    };
    const hasPrimaryOrLockedFilters = filters.some(
      (filter) => filter.isPrimary || filter.isLocked
    );
    const buttonComponent = /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
      import_components26.Button,
      {
        ref: buttonRef,
        className: "dataviews-filters__visibility-toggle",
        size: "compact",
        icon: funnel_default,
        disabled: hasPrimaryOrLockedFilters,
        accessibleWhenDisabled: true,
        ...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps
      }
    );
    return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
      AddFilterMenu,
      {
        filters,
        view,
        onChangeView: onChangeViewWithFilterVisibility,
        setOpenedFilter,
        triggerProps: { render: buttonComponent }
      }
    ) : /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
      FilterVisibilityToggle,
      {
        buttonRef,
        filtersCount: view.filters?.length,
        children: buttonComponent
      }
    ) });
  }
  function FilterVisibilityToggle({
    buttonRef,
    filtersCount,
    children
  }) {
    (0, import_element106.useEffect)(
      () => () => {
        buttonRef.current?.focus();
      },
      [buttonRef]
    );
    return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
      children,
      !!filtersCount && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "dataviews-filters-toggle__count", children: filtersCount })
    ] });
  }
  var toggle_default = FiltersToggle;

  // packages/dataviews/build-module/components/dataviews-filters/filters-toggled.mjs
  var import_element107 = __toESM(require_element(), 1);
  var import_jsx_runtime159 = __toESM(require_jsx_runtime(), 1);
  function FiltersToggled(props) {
    const { isShowingFilter } = (0, import_element107.useContext)(dataviews_context_default);
    if (!isShowingFilter) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(filters_default, { ...props });
  }
  var filters_toggled_default = FiltersToggled;

  // packages/dataviews/build-module/components/dataviews-layout/index.mjs
  var import_element108 = __toESM(require_element(), 1);
  var import_components27 = __toESM(require_components(), 1);
  var import_i18n45 = __toESM(require_i18n(), 1);
  var import_jsx_runtime160 = __toESM(require_jsx_runtime(), 1);
  function DataViewsLayout({ className }) {
    const {
      actions = [],
      data,
      fields,
      getItemId,
      getItemLevel,
      hasInitiallyLoaded,
      isLoading,
      view,
      onChangeView,
      selection,
      onChangeSelection,
      setOpenedFilter,
      onClickItem,
      isItemClickable: isItemClickable2,
      renderItemLink,
      defaultLayouts: defaultLayouts2,
      containerRef,
      empty = /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { children: (0, import_i18n45.__)("No results") })
    } = (0, import_element108.useContext)(dataviews_context_default);
    const isDelayedInitialLoading = useDelayedLoading(!hasInitiallyLoaded, {
      delay: 200
    });
    if (!hasInitiallyLoaded) {
      if (!isDelayedInitialLoading) {
        return null;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "dataviews-loading", children: /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(import_components27.Spinner, {}) }) });
    }
    const ViewComponent = VIEW_LAYOUTS.find(
      (v2) => v2.type === view.type && defaultLayouts2[v2.type]
    )?.component;
    return /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "dataviews-layout__container", ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
      ViewComponent,
      {
        className,
        actions,
        data,
        fields,
        getItemId,
        getItemLevel,
        isLoading,
        onChangeView,
        onChangeSelection,
        selection,
        setOpenedFilter,
        onClickItem,
        renderItemLink,
        isItemClickable: isItemClickable2,
        view,
        empty
      }
    ) });
  }

  // packages/dataviews/build-module/components/dataviews-search/index.mjs
  var import_i18n46 = __toESM(require_i18n(), 1);
  var import_element109 = __toESM(require_element(), 1);
  var import_components28 = __toESM(require_components(), 1);
  var import_compose14 = __toESM(require_compose(), 1);
  var import_jsx_runtime161 = __toESM(require_jsx_runtime(), 1);
  var DataViewsSearch = (0, import_element109.memo)(function Search({ label }) {
    const { view, onChangeView } = (0, import_element109.useContext)(dataviews_context_default);
    const [search, setSearch, debouncedSearch] = (0, import_compose14.useDebouncedInput)(
      view.search
    );
    (0, import_element109.useEffect)(() => {
      if (view.search !== debouncedSearch) {
        setSearch(view.search ?? "");
      }
    }, [view.search, setSearch]);
    const onChangeViewRef = (0, import_element109.useRef)(onChangeView);
    const viewRef = (0, import_element109.useRef)(view);
    (0, import_element109.useEffect)(() => {
      onChangeViewRef.current = onChangeView;
      viewRef.current = view;
    }, [onChangeView, view]);
    (0, import_element109.useEffect)(() => {
      if (debouncedSearch !== viewRef.current?.search) {
        onChangeViewRef.current({
          ...viewRef.current,
          page: view.page ? 1 : void 0,
          startPosition: view.startPosition ? 1 : void 0,
          search: debouncedSearch
        });
      }
    }, [debouncedSearch]);
    const searchLabel = label || (0, import_i18n46.__)("Search");
    return /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
      import_components28.SearchControl,
      {
        className: "dataviews-search",
        onChange: setSearch,
        value: search,
        label: searchLabel,
        placeholder: searchLabel,
        size: "compact"
      }
    );
  });
  var dataviews_search_default = DataViewsSearch;

  // packages/dataviews/build-module/components/dataviews-view-config/index.mjs
  var import_components29 = __toESM(require_components(), 1);
  var import_i18n47 = __toESM(require_i18n(), 1);
  var import_element110 = __toESM(require_element(), 1);
  var import_warning = __toESM(require_warning(), 1);
  var import_compose15 = __toESM(require_compose(), 1);
  var import_jsx_runtime162 = __toESM(require_jsx_runtime(), 1);
  var DATAVIEWS_CONFIG_POPOVER_PROPS = {
    className: "dataviews-config__popover",
    placement: "bottom-end",
    offset: 9
  };
  function ViewTypeMenu() {
    const { view, onChangeView, defaultLayouts: defaultLayouts2 } = (0, import_element110.useContext)(dataviews_context_default);
    const availableLayouts = Object.keys(defaultLayouts2);
    if (availableLayouts.length <= 1) {
      return null;
    }
    const activeView = VIEW_LAYOUTS.find((v2) => view.type === v2.type);
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(menu_exports.Root, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
        menu_exports.Trigger,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
            import_components29.Button,
            {
              size: "compact",
              icon: activeView?.icon,
              label: (0, import_i18n47.__)("Layout")
            }
          )
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(menu_exports.Popup, { children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
        menu_exports.RadioGroup,
        {
          value: view.type,
          onValueChange: (value) => {
            switch (value) {
              case "list":
              case "grid":
              case "table":
              case "pickerGrid":
              case "pickerTable":
              case "pickerActivity":
              case "activity":
                const viewWithoutLayout = { ...view };
                if ("layout" in viewWithoutLayout) {
                  delete viewWithoutLayout.layout;
                }
                return onChangeView({
                  ...viewWithoutLayout,
                  type: value,
                  ...defaultLayouts2[value]
                });
            }
            (0, import_warning.default)("Invalid dataview");
          },
          children: availableLayouts.map((layout) => {
            const config = VIEW_LAYOUTS.find(
              (v2) => v2.type === layout
            );
            if (!config) {
              return null;
            }
            return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
              menu_exports.RadioItem,
              {
                value: layout,
                closeOnClick: true,
                children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(menu_exports.ItemLabel, { children: config.label })
              },
              layout
            );
          })
        }
      ) })
    ] });
  }
  function SortFieldControl() {
    const { view, fields, onChangeView } = (0, import_element110.useContext)(dataviews_context_default);
    const orderOptions = (0, import_element110.useMemo)(() => {
      const sortableFields = fields.filter(
        (field) => field.enableSorting !== false
      );
      return sortableFields.map((field) => {
        return {
          label: field.label,
          value: field.id
        };
      });
    }, [fields]);
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
      import_components29.SelectControl,
      {
        label: (0, import_i18n47.__)("Sort by"),
        value: view.sort?.field,
        options: orderOptions,
        onChange: (value) => {
          onChangeView({
            ...view,
            sort: {
              direction: view?.sort?.direction || "desc",
              field: value
            },
            showLevels: false
          });
        }
      }
    );
  }
  function SortDirectionControl() {
    const { view, fields, onChangeView } = (0, import_element110.useContext)(dataviews_context_default);
    const sortableFields = fields.filter(
      (field) => field.enableSorting !== false
    );
    if (sortableFields.length === 0) {
      return null;
    }
    let value = view.sort?.direction;
    if (!value && view.sort?.field) {
      value = "desc";
    }
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
      import_components29.__experimentalToggleGroupControl,
      {
        className: "dataviews-view-config__sort-direction",
        isBlock: true,
        label: (0, import_i18n47.__)("Order"),
        value,
        onChange: (newDirection) => {
          if (newDirection === "asc" || newDirection === "desc") {
            onChangeView({
              ...view,
              sort: {
                direction: newDirection,
                field: view.sort?.field || // If there is no field assigned as the sorting field assign the first sortable field.
                fields.find(
                  (field) => field.enableSorting !== false
                )?.id || ""
              },
              showLevels: false
            });
            return;
          }
          (0, import_warning.default)("Invalid direction");
        },
        children: SORTING_DIRECTIONS.map((direction) => {
          return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
            import_components29.__experimentalToggleGroupControlOptionIcon,
            {
              value: direction,
              icon: sortIcons[direction],
              label: sortLabels[direction]
            },
            direction
          );
        })
      }
    );
  }
  function ItemsPerPageControl() {
    const { view, config, onChangeView } = (0, import_element110.useContext)(dataviews_context_default);
    const { infiniteScrollEnabled } = view;
    if (!config || !config.perPageSizes || config.perPageSizes.length < 2 || config.perPageSizes.length > 6 || infiniteScrollEnabled) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
      import_components29.__experimentalToggleGroupControl,
      {
        isBlock: true,
        label: (0, import_i18n47.__)("Items per page"),
        value: view.perPage || 10,
        disabled: !view?.sort?.field,
        onChange: (newItemsPerPage) => {
          const newItemsPerPageNumber = typeof newItemsPerPage === "number" || newItemsPerPage === void 0 ? newItemsPerPage : parseInt(newItemsPerPage, 10);
          onChangeView({
            ...view,
            perPage: newItemsPerPageNumber,
            page: 1
          });
        },
        children: config.perPageSizes.map((value) => {
          return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
            import_components29.__experimentalToggleGroupControlOption,
            {
              value,
              label: value.toString()
            },
            value
          );
        })
      }
    );
  }
  function ResetViewButton() {
    const { onReset } = (0, import_element110.useContext)(dataviews_context_default);
    if (onReset === void 0) {
      return null;
    }
    const isDisabled = onReset === false;
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
      import_components29.Button,
      {
        variant: "tertiary",
        size: "compact",
        disabled: isDisabled,
        accessibleWhenDisabled: true,
        className: "dataviews-view-config__reset-button",
        onClick: () => {
          if (typeof onReset === "function") {
            onReset();
          }
        },
        children: (0, import_i18n47.__)("Reset view")
      }
    );
  }
  function DataviewsViewConfigDropdown() {
    const { view, onReset } = (0, import_element110.useContext)(dataviews_context_default);
    const popoverId = (0, import_compose15.useInstanceId)(
      _DataViewsViewConfig,
      "dataviews-view-config-dropdown"
    );
    const activeLayout = VIEW_LAYOUTS.find(
      (layout) => layout.type === view.type
    );
    const isModified = typeof onReset === "function";
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
      import_components29.Dropdown,
      {
        expandOnMobile: true,
        popoverProps: {
          ...DATAVIEWS_CONFIG_POPOVER_PROPS,
          id: popoverId
        },
        renderToggle: ({ onToggle, isOpen }) => {
          return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "dataviews-view-config__toggle-wrapper", children: [
            /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
              import_components29.Button,
              {
                size: "compact",
                icon: cog_default,
                label: (0, import_i18n47._x)(
                  "View options",
                  "View is used as a noun"
                ),
                onClick: onToggle,
                "aria-expanded": isOpen ? "true" : "false",
                "aria-controls": popoverId
              }
            ),
            isModified && /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "dataviews-view-config__modified-indicator" })
          ] });
        },
        renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
          import_components29.__experimentalDropdownContentWrapper,
          {
            paddingSize: "medium",
            className: "dataviews-config__popover-content-wrapper",
            children: /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
              Stack,
              {
                direction: "column",
                className: "dataviews-view-config",
                gap: "xl",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
                    Stack,
                    {
                      direction: "row",
                      justify: "space-between",
                      align: "center",
                      className: "dataviews-view-config__header",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
                          import_components29.__experimentalHeading,
                          {
                            level: 2,
                            className: "dataviews-settings-section__title",
                            children: (0, import_i18n47.__)("Appearance")
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(ResetViewButton, {})
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(Stack, { direction: "column", gap: "lg", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
                      Stack,
                      {
                        direction: "row",
                        gap: "sm",
                        className: "dataviews-view-config__sort-controls",
                        children: [
                          /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(SortFieldControl, {}),
                          /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(SortDirectionControl, {})
                        ]
                      }
                    ),
                    !!activeLayout?.viewConfigOptions && /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(activeLayout.viewConfigOptions, {}),
                    /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(ItemsPerPageControl, {}),
                    /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(PropertiesSection, {})
                  ] })
                ]
              }
            )
          }
        )
      }
    );
  }
  function _DataViewsViewConfig() {
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(import_jsx_runtime162.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(ViewTypeMenu, {}),
      /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(DataviewsViewConfigDropdown, {})
    ] });
  }
  var DataViewsViewConfig = (0, import_element110.memo)(_DataViewsViewConfig);
  var dataviews_view_config_default = DataViewsViewConfig;

  // packages/dataviews/build-module/components/dataform-controls/checkbox.mjs
  var import_element119 = __toESM(require_element(), 1);

  // packages/dataviews/build-module/components/validated-form-controls/checkbox-control.mjs
  var import_element111 = __toESM(require_element(), 1);
  var import_compose16 = __toESM(require_compose(), 1);
  var import_components30 = __toESM(require_components(), 1);
  var import_jsx_runtime163 = __toESM(require_jsx_runtime(), 1);
  var UnforwardedValidatedCheckboxControl = ({
    required,
    customValidity,
    markWhenOptional,
    ...restProps
  }, forwardedRef) => {
    const validityTargetRef = (0, import_element111.useRef)(null);
    const mergedRefs = (0, import_compose16.useMergeRefs)([forwardedRef, validityTargetRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
      ControlWithError,
      {
        className: "dataviews-validated-control",
        required,
        markWhenOptional,
        ref: mergedRefs,
        customValidity,
        getValidityTarget: () => validityTargetRef.current?.querySelector(
          'input[type="checkbox"]'
        ),
        children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
          import_components30.CheckboxControl,
          {
            ...restProps
          }
        )
      }
    );
  };
  var ValidatedCheckboxControl = (0, import_element111.forwardRef)(UnforwardedValidatedCheckboxControl);
  ValidatedCheckboxControl.displayName = "ValidatedCheckboxControl";

  // packages/dataviews/build-module/components/validated-form-controls/combobox-control.mjs
  var import_element112 = __toESM(require_element(), 1);
  var import_compose17 = __toESM(require_compose(), 1);
  var import_components31 = __toESM(require_components(), 1);
  var import_jsx_runtime164 = __toESM(require_jsx_runtime(), 1);
  var UnforwardedValidatedComboboxControl = ({
    required,
    customValidity,
    markWhenOptional,
    ...restProps
  }, forwardedRef) => {
    const validityTargetRef = (0, import_element112.useRef)(null);
    const mergedRefs = (0, import_compose17.useMergeRefs)([forwardedRef, validityTargetRef]);
    (0, import_element112.useEffect)(() => {
      const input = validityTargetRef.current?.querySelector(
        'input[role="combobox"]'
      );
      if (input) {
        input.required = required ?? false;
      }
    }, [required]);
    return (
      // TODO: Bug - Missing value error is not cleared immediately on change, waits for blur.
      /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
        ControlWithError,
        {
          className: "dataviews-validated-control",
          required,
          markWhenOptional,
          ref: mergedRefs,
          customValidity,
          getValidityTarget: () => validityTargetRef.current?.querySelector(
            'input[role="combobox"]'
          ),
          children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_components31.ComboboxControl, { ...restProps })
        }
      )
    );
  };
  var ValidatedComboboxControl = (0, import_element112.forwardRef)(UnforwardedValidatedComboboxControl);
  ValidatedComboboxControl.displayName = "ValidatedComboboxControl";

  // packages/dataviews/build-module/components/validated-form-controls/form-token-field.mjs
  var import_element113 = __toESM(require_element(), 1);
  var import_components32 = __toESM(require_components(), 1);
  var import_jsx_runtime165 = __toESM(require_jsx_runtime(), 1);
  var UnforwardedValidatedFormTokenField = ({
    required,
    customValidity,
    markWhenOptional,
    ...restProps
  }, forwardedRef) => {
    const validityTargetRef = (0, import_element113.useRef)(null);
    return /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)(
      "div",
      {
        className: "dataviews-validated-control__wrapper-with-error-delegate",
        ref: forwardedRef,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(
            ControlWithError,
            {
              className: "dataviews-validated-control",
              required,
              markWhenOptional,
              customValidity,
              getValidityTarget: () => validityTargetRef.current,
              children: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components32.FormTokenField, { ...restProps })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(
            "input",
            {
              className: "dataviews-validated-control__error-delegate",
              type: "text",
              ref: validityTargetRef,
              required,
              value: restProps.value && restProps.value.length > 0 ? "hasvalue" : "",
              tabIndex: -1,
              onChange: () => {
              },
              onFocus: (e) => {
                e.target.previousElementSibling?.querySelector(
                  'input[type="text"]'
                )?.focus();
              }
            }
          )
        ]
      }
    );
  };
  var ValidatedFormTokenField = (0, import_element113.forwardRef)(UnforwardedValidatedFormTokenField);
  ValidatedFormTokenField.displayName = "ValidatedFormTokenField";

  // packages/dataviews/build-module/components/validated-form-controls/number-control.mjs
  var import_element114 = __toESM(require_element(), 1);
  var import_compose18 = __toESM(require_compose(), 1);
  var import_components33 = __toESM(require_components(), 1);
  var import_jsx_runtime166 = __toESM(require_jsx_runtime(), 1);
  var UnforwardedValidatedNumberControl = ({
    required,
    customValidity,
    markWhenOptional,
    ...restProps
  }, forwardedRef) => {
    const validityTargetRef = (0, import_element114.useRef)(null);
    const mergedRefs = (0, import_compose18.useMergeRefs)([forwardedRef, validityTargetRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
      ControlWithError,
      {
        className: "dataviews-validated-control",
        required,
        markWhenOptional,
        customValidity,
        getValidityTarget: () => validityTargetRef.current,
        children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(import_components33.__experimentalNumberControl, { ref: mergedRefs, ...restProps })
      }
    );
  };
  var ValidatedNumberControl = (0, import_element114.forwardRef)(UnforwardedValidatedNumberControl);
  ValidatedNumberControl.displayName = "ValidatedNumberControl";

  // packages/dataviews/build-module/components/validated-form-controls/radio-control.mjs
  var import_element115 = __toESM(require_element(), 1);
  var import_compose19 = __toESM(require_compose(), 1);
  var import_components34 = __toESM(require_components(), 1);
  var import_jsx_runtime167 = __toESM(require_jsx_runtime(), 1);
  var UnforwardedValidatedRadioControl = ({
    required,
    customValidity,
    markWhenOptional,
    ...restProps
  }, forwardedRef) => {
    const validityTargetRef = (0, import_element115.useRef)(null);
    const mergedRefs = (0, import_compose19.useMergeRefs)([forwardedRef, validityTargetRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(
      ControlWithError,
      {
        className: "dataviews-validated-control",
        required,
        markWhenOptional,
        ref: mergedRefs,
        customValidity,
        getValidityTarget: () => validityTargetRef.current?.querySelector(
          'input[type="radio"]'
        ),
        children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(import_components34.RadioControl, { ...restProps })
      }
    );
  };
  var ValidatedRadioControl = (0, import_element115.forwardRef)(UnforwardedValidatedRadioControl);
  ValidatedRadioControl.displayName = "ValidatedRadioControl";

  // packages/dataviews/build-module/components/validated-form-controls/select-control.mjs
  var import_element116 = __toESM(require_element(), 1);
  var import_compose20 = __toESM(require_compose(), 1);
  var import_components35 = __toESM(require_components(), 1);
  var import_jsx_runtime168 = __toESM(require_jsx_runtime(), 1);
  var UnforwardedValidatedSelectControl = ({
    required,
    customValidity,
    markWhenOptional,
    ...restProps
  }, forwardedRef) => {
    const validityTargetRef = (0, import_element116.useRef)(null);
    const mergedRefs = (0, import_compose20.useMergeRefs)([forwardedRef, validityTargetRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
      ControlWithError,
      {
        className: "dataviews-validated-control",
        required,
        markWhenOptional,
        customValidity,
        getValidityTarget: () => validityTargetRef.current,
        children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
          import_components35.SelectControl,
          {
            ref: mergedRefs,
            // A runtime boolean cannot statically discriminate
            // SelectControl's single/multiple props union.
            ...restProps
          }
        )
      }
    );
  };
  var ValidatedSelectControl = (0, import_element116.forwardRef)(UnforwardedValidatedSelectControl);
  ValidatedSelectControl.displayName = "ValidatedSelectControl";

  // packages/dataviews/build-module/components/validated-form-controls/toggle-control.mjs
  var import_element117 = __toESM(require_element(), 1);
  var import_compose21 = __toESM(require_compose(), 1);
  var import_components36 = __toESM(require_components(), 1);
  var import_jsx_runtime169 = __toESM(require_jsx_runtime(), 1);
  var UnforwardedValidatedToggleControl = ({
    required,
    customValidity,
    markWhenOptional,
    ...restProps
  }, forwardedRef) => {
    const validityTargetRef = (0, import_element117.useRef)(null);
    const mergedRefs = (0, import_compose21.useMergeRefs)([forwardedRef, validityTargetRef]);
    return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
      ControlWithError,
      {
        className: "dataviews-validated-control",
        required,
        markWhenOptional,
        customValidity,
        getValidityTarget: () => validityTargetRef.current,
        children: /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
          import_components36.ToggleControl,
          {
            ref: mergedRefs,
            required,
            ...restProps
          }
        )
      }
    );
  };
  var ValidatedToggleControl = (0, import_element117.forwardRef)(UnforwardedValidatedToggleControl);
  ValidatedToggleControl.displayName = "ValidatedToggleControl";

  // packages/dataviews/build-module/components/validated-form-controls/toggle-group-control.mjs
  var import_element118 = __toESM(require_element(), 1);
  var import_components37 = __toESM(require_components(), 1);
  var import_jsx_runtime170 = __toESM(require_jsx_runtime(), 1);
  var UnforwardedValidatedToggleGroupControl = ({
    required,
    customValidity,
    markWhenOptional,
    ...restProps
  }, forwardedRef) => {
    const validityTargetRef = (0, import_element118.useRef)(null);
    const nameAttr = (0, import_element118.useId)();
    return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)("div", { className: "dataviews-validated-control__wrapper-with-error-delegate", children: [
      /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
        ControlWithError,
        {
          className: "dataviews-validated-control",
          required,
          markWhenOptional,
          customValidity,
          getValidityTarget: () => validityTargetRef.current,
          children: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_components37.__experimentalToggleGroupControl, { ref: forwardedRef, ...restProps })
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
        "input",
        {
          className: "dataviews-validated-control__error-delegate",
          type: "radio",
          ref: validityTargetRef,
          required,
          checked: restProps.value !== void 0,
          tabIndex: -1,
          name: nameAttr,
          onChange: () => {
          },
          onFocus: (e) => {
            e.target.previousElementSibling?.querySelector(
              '[data-active-item="true"]'
            )?.focus();
          }
        }
      )
    ] });
  };
  var ValidatedToggleGroupControl = (0, import_element118.forwardRef)(UnforwardedValidatedToggleGroupControl);
  ValidatedToggleGroupControl.displayName = "ValidatedToggleGroupControl";

  // packages/dataviews/build-module/components/dataform-controls/utils/get-custom-validity.mjs
  function getCustomValidity(isValid2, validity) {
    let customValidity;
    if (isValid2?.required && validity?.required) {
      customValidity = validity.required.message ? {
        type: validity.required.type,
        message: validity.required.message
      } : void 0;
    } else if (isValid2?.pattern && validity?.pattern) {
      customValidity = validity.pattern;
    } else if (isValid2?.min && validity?.min) {
      customValidity = validity.min;
    } else if (isValid2?.max && validity?.max) {
      customValidity = validity.max;
    } else if (isValid2?.minLength && validity?.minLength) {
      customValidity = validity.minLength;
    } else if (isValid2?.maxLength && validity?.maxLength) {
      customValidity = validity.maxLength;
    } else if (isValid2?.elements && validity?.elements) {
      customValidity = validity.elements;
    } else if (validity?.custom) {
      customValidity = validity.custom;
    }
    return customValidity;
  }

  // packages/dataviews/build-module/components/dataform-controls/checkbox.mjs
  var import_jsx_runtime171 = __toESM(require_jsx_runtime(), 1);
  function Checkbox({
    field,
    onChange,
    data,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const { getValue, setValue, label, description, isValid: isValid2 } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const onChangeControl = (0, import_element119.useCallback)(() => {
      onChange(
        setValue({ item: data, value: !getValue({ item: data }) })
      );
    }, [data, getValue, onChange, setValue]);
    return /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
      ValidatedCheckboxControl,
      {
        required: !!field.isValid?.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        hidden: hideLabelFromVision,
        label,
        help: description,
        checked: getValue({ item: data }),
        onChange: onChangeControl,
        disabled: disabled2
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/combobox.mjs
  var import_components38 = __toESM(require_components(), 1);
  var import_element120 = __toESM(require_element(), 1);
  var import_jsx_runtime172 = __toESM(require_jsx_runtime(), 1);
  function Combobox3({
    data,
    field,
    onChange,
    hideLabelFromVision,
    validity
  }) {
    const { label, description, placeholder, getValue, setValue, isValid: isValid2 } = field;
    const value = getValue({ item: data }) ?? "";
    const onChangeControl = (0, import_element120.useCallback)(
      (newValue) => onChange(setValue({ item: data, value: newValue ?? "" })),
      [data, onChange, setValue]
    );
    const { elements, isLoading } = useElements({
      elements: field.elements,
      getElements: field.getElements
    });
    if (isLoading) {
      return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components38.Spinner, {});
    }
    return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
      ValidatedComboboxControl,
      {
        required: !!field.isValid?.required,
        customValidity: getCustomValidity(isValid2, validity),
        label,
        value,
        help: description,
        placeholder,
        options: elements,
        onChange: onChangeControl,
        hideLabelFromVision,
        allowReset: true,
        expandOnFocus: true
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/datetime.mjs
  var import_components40 = __toESM(require_components(), 1);
  var import_element123 = __toESM(require_element(), 1);
  var import_i18n50 = __toESM(require_i18n(), 1);
  var import_a11y2 = __toESM(require_a11y(), 1);
  var import_date5 = __toESM(require_date(), 1);

  // packages/dataviews/build-module/components/dataform-controls/utils/relative-date-control.mjs
  var import_components39 = __toESM(require_components(), 1);
  var import_element121 = __toESM(require_element(), 1);
  var import_i18n48 = __toESM(require_i18n(), 1);
  var import_jsx_runtime173 = __toESM(require_jsx_runtime(), 1);
  var TIME_UNITS_OPTIONS = {
    [OPERATOR_IN_THE_PAST]: [
      { value: "days", label: (0, import_i18n48.__)("Days") },
      { value: "weeks", label: (0, import_i18n48.__)("Weeks") },
      { value: "months", label: (0, import_i18n48.__)("Months") },
      { value: "years", label: (0, import_i18n48.__)("Years") }
    ],
    [OPERATOR_OVER]: [
      { value: "days", label: (0, import_i18n48.__)("Days ago") },
      { value: "weeks", label: (0, import_i18n48.__)("Weeks ago") },
      { value: "months", label: (0, import_i18n48.__)("Months ago") },
      { value: "years", label: (0, import_i18n48.__)("Years ago") }
    ]
  };
  function RelativeDateControl({
    className,
    data,
    field,
    onChange,
    hideLabelFromVision,
    operator
  }) {
    const options = TIME_UNITS_OPTIONS[operator === OPERATOR_IN_THE_PAST ? "inThePast" : "over"];
    const { id, label, description, getValue, setValue } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const fieldValue = getValue({ item: data });
    const { value: relValue = "", unit = options[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {};
    const onChangeValue = (0, import_element121.useCallback)(
      (newValue) => onChange(
        setValue({
          item: data,
          value: { value: Number(newValue), unit }
        })
      ),
      [onChange, setValue, data, unit]
    );
    const onChangeUnit = (0, import_element121.useCallback)(
      (newUnit) => onChange(
        setValue({
          item: data,
          value: { value: relValue, unit: newUnit }
        })
      ),
      [onChange, setValue, data, relValue]
    );
    return /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(
      import_components39.BaseControl,
      {
        id,
        className: clsx_default(className, "dataviews-controls__relative-date"),
        label,
        hideLabelFromVision,
        help: description,
        children: /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(Stack, { direction: "row", gap: "sm", children: [
          /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(
            import_components39.__experimentalNumberControl,
            {
              className: "dataviews-controls__relative-date-number",
              spinControls: "none",
              min: 1,
              step: 1,
              value: relValue,
              onChange: onChangeValue,
              disabled: disabled2
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(
            import_components39.SelectControl,
            {
              className: "dataviews-controls__relative-date-unit",
              label: (0, import_i18n48.__)("Unit"),
              value: unit,
              options,
              onChange: onChangeUnit,
              hideLabelFromVision: true,
              disabled: disabled2
            }
          )
        ] })
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/utils/to-calendar-date.mjs
  function toCalendarDate(date, timeZone) {
    return timeZone ? new TZDate(date, timeZone) : date;
  }

  // packages/dataviews/build-module/components/dataform-controls/utils/use-disabled-date-matchers.mjs
  var import_element122 = __toESM(require_element(), 1);
  function useDisabledDateMatchers(isValid2, parseDateFn) {
    const minConstraint = typeof isValid2.min?.constraint === "string" ? isValid2.min.constraint : void 0;
    const maxConstraint = typeof isValid2.max?.constraint === "string" ? isValid2.max.constraint : void 0;
    const disabledMatchers = (0, import_element122.useMemo)(() => {
      const matchers = [];
      if (minConstraint) {
        const minDate = parseDateFn(minConstraint);
        if (minDate) {
          matchers.push({ before: minDate });
        }
      }
      if (maxConstraint) {
        const maxDate = parseDateFn(maxConstraint);
        if (maxDate) {
          matchers.push({ after: maxDate });
        }
      }
      return matchers.length > 0 ? matchers : void 0;
    }, [minConstraint, maxConstraint, parseDateFn]);
    return { minConstraint, maxConstraint, disabledMatchers };
  }

  // packages/dataviews/build-module/components/dataform-controls/utils/get-calendar-locale.mjs
  var LANGUAGE_ALIASES = {
    ary: "ar-MA",
    // Moroccan Arabic.
    haz: "fa"
    // Hazaragi, a variety of Persian.
  };
  function getCalendarLocale(wpLocale) {
    const subtags = wpLocale?.trim().split(/[_-]/) ?? [];
    const language = subtags.shift()?.toLowerCase();
    if (!language) {
      return void 0;
    }
    const normalized = [LANGUAGE_ALIASES[language] ?? language];
    for (const subtag of subtags) {
      if (/^[a-z]{4}$/i.test(subtag) || /^([a-z]{2}|\d{3})$/i.test(subtag)) {
        normalized.push(subtag);
      }
    }
    return normalized.join("-");
  }

  // packages/dataviews/build-module/components/dataform-controls/utils/get-timezone-description.mjs
  var import_date3 = __toESM(require_date(), 1);
  var import_i18n49 = __toESM(require_i18n(), 1);
  function getTimezoneDescription() {
    const { timezone } = (0, import_date3.getSettings)();
    const userTimezoneOffset = -1 * ((/* @__PURE__ */ new Date()).getTimezoneOffset() / 60);
    if (Number(timezone.offset) === userTimezoneOffset) {
      return void 0;
    }
    const offsetSymbol = Number(timezone.offset) >= 0 ? "+" : "";
    const zoneAbbr = "" !== timezone.abbr && isNaN(Number(timezone.abbr)) ? timezone.abbr : `UTC${offsetSymbol}${timezone.offsetFormatted}`;
    const prettyTimezoneString = timezone.string.replaceAll("_", " ");
    let timezoneDetail = zoneAbbr;
    if ("UTC" === timezone.string) {
      timezoneDetail = (0, import_i18n49.__)("Coordinated Universal Time");
    } else if (prettyTimezoneString.trim().length > 0) {
      timezoneDetail = `(${zoneAbbr}) ${prettyTimezoneString}`;
    }
    return (0, import_i18n49.sprintf)(
      /* translators: %s: timezone detail, e.g. "(CEST) Europe/Madrid" or "UTC+3". */
      (0, import_i18n49.__)("Timezone: %s"),
      timezoneDetail
    );
  }

  // packages/dataviews/build-module/field-types/utils/parse-date-time.mjs
  var import_date4 = __toESM(require_date(), 1);
  function parseDateTime(dateTimeString) {
    if (!dateTimeString) {
      return null;
    }
    const parsed = (0, import_date4.getDate)(dateTimeString);
    return parsed && isValid(parsed) ? parsed : null;
  }

  // packages/dataviews/build-module/components/dataform-controls/datetime.mjs
  var import_jsx_runtime174 = __toESM(require_jsx_runtime(), 1);
  var formatDateTime = (value) => {
    if (!value) {
      return "";
    }
    return (0, import_date5.dateI18n)("Y-m-d\\TH:i", (0, import_date5.getDate)(value));
  };
  function CalendarDateTimeControl({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity,
    config
  }) {
    const { compact } = config || {};
    const { id, label, description, setValue, getValue, isValid: isValid2 } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const fieldValue = getValue({ item: data });
    const value = typeof fieldValue === "string" ? fieldValue : void 0;
    const { timezone } = (0, import_date5.getSettings)();
    const timeZone = timezone.string || (0, import_date5.dateI18n)("P");
    const [calendarMonth, setCalendarMonth] = (0, import_element123.useState)(() => {
      const parsedDate = parseDateTime(value);
      return toCalendarDate(parsedDate || /* @__PURE__ */ new Date(), timeZone);
    });
    (0, import_element123.useEffect)(() => {
      const parsedDate = parseDateTime(value);
      if (parsedDate) {
        const targetMonth = toCalendarDate(parsedDate, timeZone);
        setCalendarMonth(
          (currentMonth) => isSameMonth(
            targetMonth,
            toCalendarDate(currentMonth, timeZone)
          ) ? currentMonth : targetMonth
        );
      }
    }, [timeZone, value]);
    const inputControlRef = (0, import_element123.useRef)(null);
    const validationTimeoutRef = (0, import_element123.useRef)(void 0);
    const { minConstraint, maxConstraint, disabledMatchers } = useDisabledDateMatchers(isValid2, parseDateTime);
    const onChangeCallback = (0, import_element123.useCallback)(
      (newValue) => onChange(setValue({ item: data, value: newValue })),
      [data, onChange, setValue]
    );
    (0, import_element123.useEffect)(() => {
      return () => clearTimeout(validationTimeoutRef.current);
    }, []);
    const onSelectDate = (0, import_element123.useCallback)(
      (newDate) => {
        if (newDate) {
          const wpDate = (0, import_date5.dateI18n)("Y-m-d", newDate);
          const wpTime = value ? (0, import_date5.dateI18n)("H:i", (0, import_date5.getDate)(value)) : "00:00";
          const finalDateTime = (0, import_date5.getDate)(`${wpDate}T${wpTime}`);
          onChangeCallback(finalDateTime.toISOString());
        } else {
          onChangeCallback(void 0);
        }
        clearTimeout(validationTimeoutRef.current);
        validationTimeoutRef.current = setTimeout(() => {
          const input = inputControlRef.current;
          if (!input) {
            return;
          }
          input.dispatchEvent(
            new Event("invalid", { cancelable: true })
          );
          if (input.validationMessage) {
            (0, import_a11y2.speak)(input.validationMessage);
          }
        }, 0);
      },
      [onChangeCallback, value]
    );
    const handleManualDateTimeChange = (0, import_element123.useCallback)(
      (newValue) => {
        if (newValue) {
          const dateTime = (0, import_date5.getDate)(newValue);
          onChangeCallback(dateTime.toISOString());
          const parsedDate = parseDateTime(dateTime.toISOString());
          if (parsedDate) {
            setCalendarMonth(toCalendarDate(parsedDate, timeZone));
          }
        } else {
          onChangeCallback(void 0);
        }
      },
      [onChangeCallback, timeZone]
    );
    const { format: fieldFormat } = field;
    const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date5.getSettings)().l10n.startOfWeek;
    const locale = getCalendarLocale((0, import_date5.getSettings)().l10n.locale);
    let displayLabel = label;
    if (isValid2?.required && !markWhenOptional && !hideLabelFromVision) {
      displayLabel = `${label} (${(0, import_i18n50.__)("Required")})`;
    } else if (!isValid2?.required && markWhenOptional && !hideLabelFromVision) {
      displayLabel = `${label} (${(0, import_i18n50.__)("Optional")})`;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
      import_components40.BaseControl,
      {
        id,
        label: displayLabel,
        help: description,
        hideLabelFromVision,
        children: /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(Stack, { direction: "column", gap: "lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
            ValidatedInputControl,
            {
              ref: inputControlRef,
              required: !!isValid2?.required,
              customValidity: getCustomValidity(isValid2, validity),
              type: "datetime-local",
              label: (0, import_i18n50.__)("Date time"),
              hideLabelFromVision: true,
              value: formatDateTime(value),
              onValueChange: handleManualDateTimeChange,
              disabled: disabled2,
              description: getTimezoneDescription(),
              min: minConstraint ? formatDateTime(minConstraint) : void 0,
              max: maxConstraint ? formatDateTime(maxConstraint) : void 0
            }
          ),
          !compact && /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
            Calendar,
            {
              style: { width: "100%" },
              value: value ? parseDateTime(value) : null,
              onValueChange: onSelectDate,
              month: calendarMonth,
              onMonthChange: setCalendarMonth,
              timeZone,
              locale,
              dir: (0, import_i18n50.isRTL)() ? "rtl" : "ltr",
              weekStartsOn,
              disabled: disabled2 || disabledMatchers
            }
          )
        ] })
      }
    );
  }
  function DateTime({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    operator,
    validity,
    config
  }) {
    if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
      return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
        RelativeDateControl,
        {
          className: "dataviews-controls__datetime",
          data,
          field,
          onChange,
          hideLabelFromVision,
          operator
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
      CalendarDateTimeControl,
      {
        data,
        field,
        onChange,
        hideLabelFromVision,
        markWhenOptional,
        validity,
        config
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/date.mjs
  var import_components41 = __toESM(require_components(), 1);
  var import_a11y3 = __toESM(require_a11y(), 1);
  var import_element124 = __toESM(require_element(), 1);
  var import_i18n51 = __toESM(require_i18n(), 1);
  var import_date6 = __toESM(require_date(), 1);
  var import_jsx_runtime175 = __toESM(require_jsx_runtime(), 1);
  var DATE_PRESETS = [
    {
      id: "today",
      label: (0, import_i18n51.__)("Today"),
      getValue: () => (0, import_date6.getDate)(null)
    },
    {
      id: "yesterday",
      label: (0, import_i18n51.__)("Yesterday"),
      getValue: () => {
        const today = (0, import_date6.getDate)(null);
        return subDays(today, 1);
      }
    },
    {
      id: "past-week",
      label: (0, import_i18n51.__)("Past week"),
      getValue: () => {
        const today = (0, import_date6.getDate)(null);
        return subDays(today, 7);
      }
    },
    {
      id: "past-month",
      label: (0, import_i18n51.__)("Past month"),
      getValue: () => {
        const today = (0, import_date6.getDate)(null);
        return subMonths(today, 1);
      }
    }
  ];
  var DATE_RANGE_PRESETS = [
    {
      id: "last-7-days",
      label: (0, import_i18n51.__)("Last 7 days"),
      getValue: () => {
        const today = (0, import_date6.getDate)(null);
        return [subDays(today, 7), today];
      }
    },
    {
      id: "last-30-days",
      label: (0, import_i18n51.__)("Last 30 days"),
      getValue: () => {
        const today = (0, import_date6.getDate)(null);
        return [subDays(today, 30), today];
      }
    },
    {
      id: "month-to-date",
      label: (0, import_i18n51.__)("Month to date"),
      getValue: () => {
        const today = (0, import_date6.getDate)(null);
        return [startOfMonth(today), today];
      }
    },
    {
      id: "last-year",
      label: (0, import_i18n51.__)("Last year"),
      getValue: () => {
        const today = (0, import_date6.getDate)(null);
        return [subYears(today, 1), today];
      }
    },
    {
      id: "year-to-date",
      label: (0, import_i18n51.__)("Year to date"),
      getValue: () => {
        const today = (0, import_date6.getDate)(null);
        return [startOfYear(today), today];
      }
    }
  ];
  var parseDate2 = (dateString) => {
    if (!dateString) {
      return null;
    }
    const parsed = parseISO(dateString);
    return isValid(parsed) ? parsed : null;
  };
  var formatDate = (date) => {
    if (!date) {
      return "";
    }
    return typeof date === "string" ? date : format(date, "yyyy-MM-dd");
  };
  function ValidatedDateControl({
    field,
    validity,
    inputRefs,
    isTouched,
    setIsTouched,
    children
  }) {
    const { isValid: isValid2 } = field;
    const [customValidity, setCustomValidity] = (0, import_element124.useState)(void 0);
    const validateRefs = (0, import_element124.useCallback)(() => {
      const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
      for (const ref of refs) {
        const input = ref.current;
        if (input && !input.validity.valid) {
          setCustomValidity({
            type: "invalid",
            message: input.validationMessage
          });
          return;
        }
      }
      setCustomValidity(void 0);
    }, [inputRefs]);
    (0, import_element124.useEffect)(() => {
      const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
      const result = validity ? getCustomValidity(isValid2, validity) : void 0;
      for (const ref of refs) {
        const input = ref.current;
        if (input) {
          input.setCustomValidity(
            result?.type === "invalid" && result.message ? result.message : ""
          );
        }
      }
    }, [inputRefs, isValid2, validity]);
    (0, import_element124.useEffect)(() => {
      const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
      const handleInvalid = (event) => {
        event.preventDefault();
        setIsTouched(true);
      };
      for (const ref of refs) {
        ref.current?.addEventListener("invalid", handleInvalid);
      }
      return () => {
        for (const ref of refs) {
          ref.current?.removeEventListener("invalid", handleInvalid);
        }
      };
    }, [inputRefs, setIsTouched]);
    (0, import_element124.useEffect)(() => {
      if (!isTouched) {
        return;
      }
      const result = validity ? getCustomValidity(isValid2, validity) : void 0;
      if (result) {
        setCustomValidity(result);
      } else {
        validateRefs();
      }
    }, [isTouched, isValid2, validity, validateRefs]);
    (0, import_element124.useEffect)(() => {
      if (isTouched && customValidity?.message) {
        (0, import_a11y3.speak)(customValidity.message);
      }
    }, [isTouched, customValidity?.message]);
    const onBlur = (event) => {
      if (isTouched) {
        return;
      }
      if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
        setIsTouched(true);
      }
    };
    return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(Stack, { direction: "column", gap: "sm", onBlur, children: [
      children,
      customValidity && /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
        ValidityIndicator,
        {
          type: customValidity.type,
          message: customValidity.message
        }
      )
    ] });
  }
  function CalendarDateControl({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const {
      id,
      label,
      description,
      setValue,
      getValue,
      isValid: isValid2,
      format: fieldFormat
    } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const [selectedPresetId, setSelectedPresetId] = (0, import_element124.useState)(
      null
    );
    const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date6.getSettings)().l10n.startOfWeek;
    const locale = getCalendarLocale((0, import_date6.getSettings)().l10n.locale);
    const fieldValue = getValue({ item: data });
    const value = typeof fieldValue === "string" ? fieldValue : void 0;
    const [calendarMonth, setCalendarMonth] = (0, import_element124.useState)(() => {
      const parsedDate = parseDate2(value);
      return parsedDate || /* @__PURE__ */ new Date();
    });
    (0, import_element124.useEffect)(() => {
      const parsedDate = parseDate2(value);
      if (parsedDate) {
        setCalendarMonth(
          (currentMonth) => isSameMonth(parsedDate, currentMonth) ? currentMonth : parsedDate
        );
      }
    }, [value]);
    const [isTouched, setIsTouched] = (0, import_element124.useState)(false);
    const validityTargetRef = (0, import_element124.useRef)(null);
    const { minConstraint, maxConstraint, disabledMatchers } = useDisabledDateMatchers(isValid2, parseDate2);
    const onChangeCallback = (0, import_element124.useCallback)(
      (newValue) => onChange(setValue({ item: data, value: newValue })),
      [data, onChange, setValue]
    );
    const onSelectDate = (0, import_element124.useCallback)(
      (newDate) => {
        const dateValue = newDate ? formatDate(newDate) : void 0;
        onChangeCallback(dateValue);
        setSelectedPresetId(null);
        setIsTouched(true);
      },
      [onChangeCallback]
    );
    const handlePresetClick = (0, import_element124.useCallback)(
      (preset) => {
        const presetDate = preset.getValue();
        const dateValue = formatDate(presetDate);
        setCalendarMonth(presetDate);
        onChangeCallback(dateValue);
        setSelectedPresetId(preset.id);
        setIsTouched(true);
      },
      [onChangeCallback]
    );
    const handleManualDateChange = (0, import_element124.useCallback)(
      (newValue) => {
        onChangeCallback(newValue);
        if (newValue) {
          const parsedDate = parseDate2(newValue);
          if (parsedDate) {
            setCalendarMonth(parsedDate);
          }
        }
        setSelectedPresetId(null);
        setIsTouched(true);
      },
      [onChangeCallback]
    );
    let displayLabel = label;
    if (isValid2?.required && !markWhenOptional) {
      displayLabel = `${label} (${(0, import_i18n51.__)("Required")})`;
    } else if (!isValid2?.required && markWhenOptional) {
      displayLabel = `${label} (${(0, import_i18n51.__)("Optional")})`;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
      ValidatedDateControl,
      {
        field,
        validity,
        inputRefs: validityTargetRef,
        isTouched,
        setIsTouched,
        children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
          import_components41.BaseControl,
          {
            id,
            className: "dataviews-controls__date",
            label: displayLabel,
            help: description,
            hideLabelFromVision,
            children: /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(Stack, { direction: "column", gap: "lg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(
                Stack,
                {
                  direction: "row",
                  gap: "sm",
                  wrap: "wrap",
                  justify: "flex-start",
                  children: [
                    DATE_PRESETS.map((preset) => {
                      const isSelected2 = selectedPresetId === preset.id;
                      return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                        import_components41.Button,
                        {
                          className: "dataviews-controls__date-preset",
                          variant: "tertiary",
                          isPressed: isSelected2,
                          size: "small",
                          disabled: disabled2,
                          accessibleWhenDisabled: true,
                          onClick: () => handlePresetClick(preset),
                          children: preset.label
                        },
                        preset.id
                      );
                    }),
                    /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                      import_components41.Button,
                      {
                        className: "dataviews-controls__date-preset",
                        variant: "tertiary",
                        isPressed: !selectedPresetId,
                        size: "small",
                        disabled: !!selectedPresetId || disabled2,
                        accessibleWhenDisabled: true,
                        children: (0, import_i18n51.__)("Custom")
                      }
                    )
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                import_components41.__experimentalInputControl,
                {
                  ref: validityTargetRef,
                  type: "date",
                  label: (0, import_i18n51.__)("Date"),
                  hideLabelFromVision: true,
                  value,
                  onChange: handleManualDateChange,
                  required: !!field.isValid?.required,
                  disabled: disabled2,
                  min: minConstraint,
                  max: maxConstraint
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                Calendar,
                {
                  style: { width: "100%" },
                  value: value ? parseDate2(value) : null,
                  onValueChange: onSelectDate,
                  month: calendarMonth,
                  onMonthChange: setCalendarMonth,
                  locale,
                  dir: (0, import_i18n51.isRTL)() ? "rtl" : "ltr",
                  weekStartsOn,
                  disabled: disabled2 || disabledMatchers,
                  disableNavigation: disabled2
                }
              )
            ] })
          }
        )
      }
    );
  }
  function CalendarDateRangeControl({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const {
      id,
      label,
      description,
      getValue,
      setValue,
      isValid: isValid2,
      format: fieldFormat
    } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    let value;
    const fieldValue = getValue({ item: data });
    if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) {
      value = fieldValue;
    }
    const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date6.getSettings)().l10n.startOfWeek;
    const locale = getCalendarLocale((0, import_date6.getSettings)().l10n.locale);
    const { minConstraint, maxConstraint, disabledMatchers } = useDisabledDateMatchers(isValid2, parseDate2);
    const onChangeCallback = (0, import_element124.useCallback)(
      (newValue) => {
        onChange(
          setValue({
            item: data,
            value: newValue
          })
        );
      },
      [data, onChange, setValue]
    );
    const [selectedPresetId, setSelectedPresetId] = (0, import_element124.useState)(
      null
    );
    const selectedRange = (0, import_element124.useMemo)(() => {
      if (!value) {
        return null;
      }
      const [from, to] = value;
      return {
        from: parseDate2(from) || void 0,
        to: parseDate2(to) || void 0
      };
    }, [value]);
    const [calendarMonth, setCalendarMonth] = (0, import_element124.useState)(() => {
      return selectedRange?.from || /* @__PURE__ */ new Date();
    });
    const [fromValue, toValue] = value ?? [];
    (0, import_element124.useEffect)(() => {
      setCalendarMonth((currentMonth) => {
        const from = parseDate2(fromValue);
        const to = parseDate2(toValue);
        const targetMonth = from ?? to;
        const isRangeVisible = from && to ? areIntervalsOverlapping(
          { start: from, end: to },
          {
            start: startOfMonth(currentMonth),
            end: endOfMonth(currentMonth)
          },
          { inclusive: true }
        ) : [from, to].some(
          (date) => date && isSameMonth(date, currentMonth)
        );
        return targetMonth && !isRangeVisible ? targetMonth : currentMonth;
      });
    }, [fromValue, toValue]);
    const [isTouched, setIsTouched] = (0, import_element124.useState)(false);
    const fromInputRef = (0, import_element124.useRef)(null);
    const toInputRef = (0, import_element124.useRef)(null);
    const updateDateRange = (0, import_element124.useCallback)(
      (fromDate, toDate2) => {
        if (!fromDate && !toDate2) {
          onChangeCallback(void 0);
          return;
        }
        onChangeCallback([
          formatDate(fromDate),
          formatDate(toDate2)
        ]);
      },
      [onChangeCallback]
    );
    const onSelectCalendarRange = (0, import_element124.useCallback)(
      (newRange) => {
        updateDateRange(newRange?.from, newRange?.to);
        setSelectedPresetId(null);
        setIsTouched(true);
      },
      [updateDateRange]
    );
    const handlePresetClick = (0, import_element124.useCallback)(
      (preset) => {
        const [startDate, endDate] = preset.getValue();
        setCalendarMonth(startDate);
        updateDateRange(startDate, endDate);
        setSelectedPresetId(preset.id);
        setIsTouched(true);
      },
      [updateDateRange]
    );
    const handleManualDateChange = (0, import_element124.useCallback)(
      (fromOrTo, newValue) => {
        const [currentFrom, currentTo] = value || [
          void 0,
          void 0
        ];
        const updatedFrom = fromOrTo === "from" ? newValue : currentFrom;
        const updatedTo = fromOrTo === "to" ? newValue : currentTo;
        updateDateRange(updatedFrom, updatedTo);
        if (newValue) {
          const parsedDate = parseDate2(newValue);
          if (parsedDate) {
            setCalendarMonth(parsedDate);
          }
        }
        setSelectedPresetId(null);
        setIsTouched(true);
      },
      [value, updateDateRange]
    );
    let displayLabel = label;
    if (field.isValid?.required && !markWhenOptional) {
      displayLabel = `${label} (${(0, import_i18n51.__)("Required")})`;
    } else if (!field.isValid?.required && markWhenOptional) {
      displayLabel = `${label} (${(0, import_i18n51.__)("Optional")})`;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
      ValidatedDateControl,
      {
        field,
        validity,
        inputRefs: [fromInputRef, toInputRef],
        isTouched,
        setIsTouched,
        children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
          import_components41.BaseControl,
          {
            id,
            className: "dataviews-controls__date",
            label: displayLabel,
            help: description,
            hideLabelFromVision,
            children: /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(Stack, { direction: "column", gap: "lg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(
                Stack,
                {
                  direction: "row",
                  gap: "sm",
                  wrap: "wrap",
                  justify: "flex-start",
                  children: [
                    DATE_RANGE_PRESETS.map((preset) => {
                      const isSelected2 = selectedPresetId === preset.id;
                      return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                        import_components41.Button,
                        {
                          className: "dataviews-controls__date-preset",
                          variant: "tertiary",
                          isPressed: isSelected2,
                          size: "small",
                          disabled: disabled2,
                          accessibleWhenDisabled: true,
                          onClick: () => handlePresetClick(preset),
                          children: preset.label
                        },
                        preset.id
                      );
                    }),
                    /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                      import_components41.Button,
                      {
                        className: "dataviews-controls__date-preset",
                        variant: "tertiary",
                        isPressed: !selectedPresetId,
                        size: "small",
                        accessibleWhenDisabled: true,
                        disabled: !!selectedPresetId || disabled2,
                        children: (0, import_i18n51.__)("Custom")
                      }
                    )
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(
                Stack,
                {
                  direction: "row",
                  gap: "sm",
                  justify: "space-between",
                  className: "dataviews-controls__date-range-inputs",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                      import_components41.__experimentalInputControl,
                      {
                        ref: fromInputRef,
                        type: "date",
                        label: (0, import_i18n51.__)("From"),
                        hideLabelFromVision: true,
                        value: value?.[0],
                        onChange: (newValue) => handleManualDateChange("from", newValue),
                        required: !!field.isValid?.required,
                        disabled: disabled2,
                        min: minConstraint,
                        max: maxConstraint
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                      import_components41.__experimentalInputControl,
                      {
                        ref: toInputRef,
                        type: "date",
                        label: (0, import_i18n51.__)("To"),
                        hideLabelFromVision: true,
                        value: value?.[1],
                        onChange: (newValue) => handleManualDateChange("to", newValue),
                        required: !!field.isValid?.required,
                        disabled: disabled2,
                        min: minConstraint,
                        max: maxConstraint
                      }
                    )
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
                RangeCalendar,
                {
                  style: { width: "100%" },
                  value: selectedRange,
                  onValueChange: onSelectCalendarRange,
                  month: calendarMonth,
                  onMonthChange: setCalendarMonth,
                  locale,
                  dir: (0, import_i18n51.isRTL)() ? "rtl" : "ltr",
                  weekStartsOn,
                  disabled: disabled2 || disabledMatchers
                }
              )
            ] })
          }
        )
      }
    );
  }
  function DateControl({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    operator,
    validity
  }) {
    if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
      return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
        RelativeDateControl,
        {
          className: "dataviews-controls__date",
          data,
          field,
          onChange,
          hideLabelFromVision,
          operator
        }
      );
    }
    if (operator === OPERATOR_BETWEEN) {
      return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
        CalendarDateRangeControl,
        {
          data,
          field,
          onChange,
          hideLabelFromVision,
          markWhenOptional,
          validity
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
      CalendarDateControl,
      {
        data,
        field,
        onChange,
        hideLabelFromVision,
        markWhenOptional,
        validity
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/select.mjs
  var import_components42 = __toESM(require_components(), 1);
  var import_element125 = __toESM(require_element(), 1);
  var import_jsx_runtime176 = __toESM(require_jsx_runtime(), 1);
  function Select2({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const { type, label, description, getValue, setValue, isValid: isValid2 } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const isMultiple = type === "array";
    const value = getValue({ item: data }) ?? (isMultiple ? [] : "");
    const onChangeControl = (0, import_element125.useCallback)(
      (newValue) => onChange(setValue({ item: data, value: newValue })),
      [data, onChange, setValue]
    );
    const { elements, isLoading } = useElements({
      elements: field.elements,
      getElements: field.getElements
    });
    if (isLoading) {
      return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_components42.Spinner, {});
    }
    return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
      ValidatedSelectControl,
      {
        required: !!field.isValid?.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        label,
        value,
        help: description,
        options: elements,
        onChange: onChangeControl,
        hideLabelFromVision,
        multiple: isMultiple,
        disabled: disabled2
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/adaptive-select.mjs
  var import_jsx_runtime177 = __toESM(require_jsx_runtime(), 1);
  var ELEMENTS_THRESHOLD = 10;
  function AdaptiveSelect(props) {
    const { field } = props;
    const { elements } = useElements({
      elements: field.elements,
      getElements: field.getElements
    });
    if (elements.length >= ELEMENTS_THRESHOLD) {
      return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(Combobox3, { ...props });
    }
    return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(Select2, { ...props });
  }

  // packages/dataviews/build-module/components/dataform-controls/utils/validated-input.mjs
  var import_element126 = __toESM(require_element(), 1);
  var import_jsx_runtime178 = __toESM(require_jsx_runtime(), 1);
  function ValidatedText({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    type,
    prefix,
    suffix,
    validity
  }) {
    const { label, placeholder, description, getValue, setValue, isValid: isValid2 } = field;
    const value = getValue({ item: data });
    const disabled2 = field.isDisabled({ item: data, field });
    const onValueChangeControl = (0, import_element126.useCallback)(
      (newValue) => onChange(
        setValue({
          item: data,
          value: newValue
        })
      ),
      [data, setValue, onChange]
    );
    return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
      ValidatedInputControl,
      {
        required: !!isValid2.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        label,
        placeholder,
        value: value ?? "",
        description: typeof description === "string" ? description : void 0,
        details: typeof description === "string" ? void 0 : description,
        onValueChange: onValueChangeControl,
        hideLabelFromVision,
        type,
        prefix,
        suffix,
        disabled: disabled2,
        pattern: isValid2.pattern ? isValid2.pattern.constraint : void 0,
        minLength: isValid2.minLength ? isValid2.minLength.constraint : void 0,
        maxLength: isValid2.maxLength ? isValid2.maxLength.constraint : void 0
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/email.mjs
  var import_jsx_runtime179 = __toESM(require_jsx_runtime(), 1);
  function Email({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
      ValidatedText,
      {
        ...{
          data,
          field,
          onChange,
          hideLabelFromVision,
          markWhenOptional,
          validity,
          type: "email",
          prefix: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(InputLayout3.Slot, { padding: "minimal", children: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(Icon, { icon: envelope_default }) })
        }
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/telephone.mjs
  var import_jsx_runtime180 = __toESM(require_jsx_runtime(), 1);
  function Telephone({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
      ValidatedText,
      {
        ...{
          data,
          field,
          onChange,
          hideLabelFromVision,
          markWhenOptional,
          validity,
          type: "tel",
          prefix: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(InputLayout3.Slot, { padding: "minimal", children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(Icon, { icon: mobile_default }) })
        }
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/url.mjs
  var import_jsx_runtime181 = __toESM(require_jsx_runtime(), 1);
  function Url({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
      ValidatedText,
      {
        ...{
          data,
          field,
          onChange,
          hideLabelFromVision,
          markWhenOptional,
          validity,
          type: "url",
          prefix: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(InputLayout3.Slot, { padding: "minimal", children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(Icon, { icon: link_default }) })
        }
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/utils/validated-number.mjs
  var import_components43 = __toESM(require_components(), 1);
  var import_element127 = __toESM(require_element(), 1);
  var import_i18n52 = __toESM(require_i18n(), 1);
  var import_jsx_runtime182 = __toESM(require_jsx_runtime(), 1);
  function toNumberOrEmpty(value) {
    if (value === "" || value === void 0) {
      return "";
    }
    const number = Number(value);
    return Number.isFinite(number) ? number : "";
  }
  function BetweenControls({
    value,
    onChange,
    hideLabelFromVision,
    step
  }) {
    const [min3 = "", max3 = ""] = value;
    const onChangeMin = (0, import_element127.useCallback)(
      (newValue) => onChange([toNumberOrEmpty(newValue), max3]),
      [onChange, max3]
    );
    const onChangeMax = (0, import_element127.useCallback)(
      (newValue) => onChange([min3, toNumberOrEmpty(newValue)]),
      [onChange, min3]
    );
    return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
      import_components43.BaseControl,
      {
        help: (0, import_i18n52.__)("The max. value must be greater than the min. value."),
        children: /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(import_components43.Flex, { direction: "row", gap: 4, children: [
          /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
            import_components43.__experimentalNumberControl,
            {
              label: (0, import_i18n52.__)("Min."),
              value: min3,
              max: max3 ? Number(max3) - step : void 0,
              onChange: onChangeMin,
              hideLabelFromVision,
              step
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
            import_components43.__experimentalNumberControl,
            {
              label: (0, import_i18n52.__)("Max."),
              value: max3,
              min: min3 ? Number(min3) + step : void 0,
              onChange: onChangeMax,
              hideLabelFromVision,
              step
            }
          )
        ] })
      }
    );
  }
  function ValidatedNumber({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    operator,
    validity
  }) {
    const decimals = field.format?.decimals ?? 0;
    const step = Math.pow(10, Math.abs(decimals) * -1);
    const { label, description, getValue, setValue, isValid: isValid2 } = field;
    const value = getValue({ item: data }) ?? "";
    const disabled2 = field.isDisabled({ item: data, field });
    const onChangeControl = (0, import_element127.useCallback)(
      (newValue) => {
        onChange(
          setValue({
            item: data,
            // Do not convert an empty string or undefined to a number,
            // otherwise there's a mismatch between the UI control (empty)
            // and the data relied by onChange (0).
            value: ["", void 0].includes(newValue) ? void 0 : Number(newValue)
          })
        );
      },
      [data, onChange, setValue]
    );
    const onChangeBetweenControls = (0, import_element127.useCallback)(
      (newValue) => {
        onChange(
          setValue({
            item: data,
            value: newValue
          })
        );
      },
      [data, onChange, setValue]
    );
    if (operator === OPERATOR_BETWEEN) {
      let valueBetween = ["", ""];
      if (Array.isArray(value) && value.length === 2 && value.every(
        (element) => typeof element === "number" || element === ""
      )) {
        valueBetween = value;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
        BetweenControls,
        {
          value: valueBetween,
          onChange: onChangeBetweenControls,
          hideLabelFromVision,
          step
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
      ValidatedNumberControl,
      {
        required: !!isValid2.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        label,
        help: description,
        value,
        onChange: onChangeControl,
        hideLabelFromVision,
        step,
        min: typeof isValid2.min?.constraint === "number" ? isValid2.min.constraint : void 0,
        max: typeof isValid2.max?.constraint === "number" ? isValid2.max.constraint : void 0,
        disabled: disabled2
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/integer.mjs
  var import_jsx_runtime183 = __toESM(require_jsx_runtime(), 1);
  function Integer(props) {
    return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(ValidatedNumber, { ...props });
  }

  // packages/dataviews/build-module/components/dataform-controls/number.mjs
  var import_jsx_runtime184 = __toESM(require_jsx_runtime(), 1);
  function Number2(props) {
    return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(ValidatedNumber, { ...props });
  }

  // packages/dataviews/build-module/components/dataform-controls/radio.mjs
  var import_components44 = __toESM(require_components(), 1);
  var import_element128 = __toESM(require_element(), 1);
  var import_jsx_runtime185 = __toESM(require_jsx_runtime(), 1);
  function Radio({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const { label, description, getValue, setValue, isValid: isValid2 } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const { elements, isLoading } = useElements({
      elements: field.elements,
      getElements: field.getElements
    });
    const value = getValue({ item: data });
    const onChangeControl = (0, import_element128.useCallback)(
      (newValue) => onChange(setValue({ item: data, value: newValue })),
      [data, onChange, setValue]
    );
    if (isLoading) {
      return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(import_components44.Spinner, {});
    }
    return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
      ValidatedRadioControl,
      {
        required: !!field.isValid?.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        label,
        help: description,
        onChange: onChangeControl,
        options: elements,
        selected: value,
        hideLabelFromVision,
        disabled: disabled2
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/text.mjs
  var import_element129 = __toESM(require_element(), 1);
  var import_jsx_runtime186 = __toESM(require_jsx_runtime(), 1);
  function Text3({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    config,
    validity
  }) {
    const { prefix, suffix } = config || {};
    return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
      ValidatedText,
      {
        ...{
          data,
          field,
          onChange,
          hideLabelFromVision,
          markWhenOptional,
          validity,
          prefix: prefix ? (0, import_element129.createElement)(prefix) : void 0,
          suffix: suffix ? (0, import_element129.createElement)(suffix) : void 0
        }
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/time.mjs
  var import_components45 = __toESM(require_components(), 1);
  var import_element130 = __toESM(require_element(), 1);
  var import_i18n53 = __toESM(require_i18n(), 1);
  var import_jsx_runtime187 = __toESM(require_jsx_runtime(), 1);
  function getStep(timeFormat, values) {
    const tokens = (timeFormat ?? "").replace(/\\./g, "");
    const hasSeconds = tokens.includes("s") || values.some((value) => (parseTime2(value) ?? 0) % 60 !== 0);
    return hasSeconds ? 1 : void 0;
  }
  function toInputValue(value) {
    const seconds = parseTime2(value);
    if (seconds === null) {
      return "";
    }
    const parts = [
      Math.floor(seconds / 3600),
      Math.floor(seconds % 3600 / 60)
    ];
    if (seconds % 60 !== 0) {
      parts.push(seconds % 60);
    }
    return parts.map((part) => String(part).padStart(2, "0")).join(":");
  }
  function BetweenControls2({
    value,
    onChange,
    hideLabelFromVision,
    disabled: disabled2,
    step,
    min: min3,
    max: max3
  }) {
    const [from = "", to = ""] = value;
    const onChangeFrom = (0, import_element130.useCallback)(
      (newValue) => onChange([newValue ?? "", to]),
      [onChange, to]
    );
    const onChangeTo = (0, import_element130.useCallback)(
      (newValue) => onChange([from, newValue ?? ""]),
      [onChange, from]
    );
    return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
      import_components45.BaseControl,
      {
        help: (0, import_i18n53.__)("The end time must be later than the start time."),
        children: /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(Stack, { direction: "row", gap: "sm", justify: "space-between", children: [
          /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
            ValidatedInputControl,
            {
              type: "time",
              label: (0, import_i18n53.__)("From"),
              value: from,
              onValueChange: onChangeFrom,
              hideLabelFromVision,
              disabled: disabled2,
              step,
              min: min3,
              max: to || max3
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
            ValidatedInputControl,
            {
              type: "time",
              label: (0, import_i18n53.__)("To"),
              value: to,
              onValueChange: onChangeTo,
              hideLabelFromVision,
              disabled: disabled2,
              step,
              min: from || min3,
              max: max3
            }
          )
        ] })
      }
    );
  }
  function Time({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    operator,
    validity
  }) {
    const { label, placeholder, description, getValue, setValue, isValid: isValid2 } = field;
    const value = getValue({ item: data });
    const disabled2 = field.isDisabled({ item: data, field });
    const timeFormat = field.format?.time;
    const min3 = typeof isValid2.min?.constraint === "string" ? isValid2.min.constraint : void 0;
    const max3 = typeof isValid2.max?.constraint === "string" ? isValid2.max.constraint : void 0;
    const onChangeControl = (0, import_element130.useCallback)(
      (newValue) => onChange(
        setValue({
          item: data,
          value: newValue === "" ? void 0 : newValue
        })
      ),
      [data, onChange, setValue]
    );
    const onChangeBetweenControls = (0, import_element130.useCallback)(
      ([from, to]) => onChange(
        setValue({
          item: data,
          // An unfilled bound is stored as `undefined`, which the
          // `between` operator reads as "do not apply the filter".
          value: [from || void 0, to || void 0]
        })
      ),
      [data, onChange, setValue]
    );
    if (operator === OPERATOR_BETWEEN) {
      let valueBetween = ["", ""];
      if (Array.isArray(value) && value.length === 2) {
        valueBetween = [
          toInputValue(value[0]),
          toInputValue(value[1])
        ];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
        BetweenControls2,
        {
          value: valueBetween,
          onChange: onChangeBetweenControls,
          hideLabelFromVision,
          disabled: disabled2,
          step: getStep(timeFormat, valueBetween),
          min: min3,
          max: max3
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
      ValidatedInputControl,
      {
        required: !!isValid2.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        type: "time",
        label,
        placeholder,
        description: typeof description === "string" ? description : void 0,
        details: typeof description === "string" ? void 0 : description,
        value: toInputValue(value),
        onValueChange: onChangeControl,
        hideLabelFromVision,
        disabled: disabled2,
        step: getStep(timeFormat, [value]),
        min: min3,
        max: max3
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/toggle.mjs
  var import_element131 = __toESM(require_element(), 1);
  var import_jsx_runtime188 = __toESM(require_jsx_runtime(), 1);
  function Toggle({
    field,
    onChange,
    data,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const { label, description, getValue, setValue, isValid: isValid2 } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const onChangeControl = (0, import_element131.useCallback)(() => {
      onChange(
        setValue({ item: data, value: !getValue({ item: data }) })
      );
    }, [onChange, setValue, data, getValue]);
    return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
      ValidatedToggleControl,
      {
        required: !!isValid2.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        hidden: hideLabelFromVision,
        label,
        help: description,
        checked: getValue({ item: data }),
        onChange: onChangeControl,
        disabled: disabled2
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/textarea.mjs
  var import_element132 = __toESM(require_element(), 1);
  var import_jsx_runtime189 = __toESM(require_jsx_runtime(), 1);
  function Textarea3({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    config,
    validity
  }) {
    const { rows = 4 } = config || {};
    const disabled2 = field.isDisabled({ item: data, field });
    const { label, placeholder, description, setValue, isValid: isValid2 } = field;
    const value = field.getValue({ item: data });
    const onValueChangeControl = (0, import_element132.useCallback)(
      (newValue) => onChange(setValue({ item: data, value: newValue })),
      [data, onChange, setValue]
    );
    return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(
      ValidatedTextareaControl,
      {
        required: !!isValid2.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        label,
        placeholder,
        value: value ?? "",
        description: typeof description === "string" ? description : void 0,
        details: typeof description === "string" ? void 0 : description,
        onValueChange: onValueChangeControl,
        rows,
        disabled: disabled2,
        minLength: isValid2.minLength ? isValid2.minLength.constraint : void 0,
        maxLength: isValid2.maxLength ? isValid2.maxLength.constraint : void 0,
        hideLabelFromVision
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/toggle-group.mjs
  var import_components46 = __toESM(require_components(), 1);
  var import_element133 = __toESM(require_element(), 1);
  var import_jsx_runtime190 = __toESM(require_jsx_runtime(), 1);
  function ToggleGroup({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const { getValue, setValue, isValid: isValid2 } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const value = getValue({ item: data });
    const onChangeControl = (0, import_element133.useCallback)(
      (newValue) => onChange(setValue({ item: data, value: newValue })),
      [data, onChange, setValue]
    );
    const { elements, isLoading } = useElements({
      elements: field.elements,
      getElements: field.getElements
    });
    if (isLoading) {
      return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_components46.Spinner, {});
    }
    if (elements.length === 0) {
      return null;
    }
    const selectedOption = elements.find((el) => el.value === value);
    return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
      ValidatedToggleGroupControl,
      {
        required: !!field.isValid?.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        isBlock: true,
        label: field.label,
        help: selectedOption?.description || field.description,
        onChange: onChangeControl,
        value,
        hideLabelFromVision,
        children: elements.map((el) => /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
          import_components46.__experimentalToggleGroupControlOption,
          {
            label: el.label,
            value: el.value,
            disabled: disabled2
          },
          el.value
        ))
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/array.mjs
  var import_components47 = __toESM(require_components(), 1);
  var import_element134 = __toESM(require_element(), 1);
  var import_jsx_runtime191 = __toESM(require_jsx_runtime(), 1);
  function ArrayControl({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const { label, placeholder, description, getValue, setValue, isValid: isValid2 } = field;
    const value = getValue({ item: data });
    const disabled2 = field.isDisabled({ item: data, field });
    const { elements, isLoading } = useElements({
      elements: field.elements,
      getElements: field.getElements
    });
    const arrayValueAsElements = (0, import_element134.useMemo)(
      () => Array.isArray(value) ? value.map((token) => {
        const element = elements?.find(
          (suggestion) => suggestion.value === token
        );
        return element || { value: token, label: token };
      }) : [],
      [value, elements]
    );
    const onChangeControl = (0, import_element134.useCallback)(
      (tokens) => {
        const valueTokens = tokens.map((token) => {
          if (typeof token === "object" && "value" in token) {
            return token.value;
          }
          return token;
        });
        onChange(setValue({ item: data, value: valueTokens }));
      },
      [onChange, setValue, data]
    );
    if (isLoading) {
      return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_components47.Spinner, {});
    }
    return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
      ValidatedFormTokenField,
      {
        required: !!isValid2?.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        label: hideLabelFromVision ? void 0 : label,
        value: arrayValueAsElements,
        onChange: onChangeControl,
        placeholder,
        suggestions: elements?.map((element) => element.value),
        disabled: disabled2,
        __experimentalValidateInput: (token) => {
          if (field.isValid?.elements && elements) {
            return elements.some(
              (element) => element.value === token || element.label === token
            );
          }
          return true;
        },
        __experimentalExpandOnFocus: elements && elements.length > 0,
        help: description ?? (field.isValid?.elements ? "" : void 0),
        displayTransform: (token) => {
          if (typeof token === "object" && "label" in token) {
            return token.label;
          }
          if (typeof token === "string" && elements) {
            const element = elements.find(
              (el) => el.value === token
            );
            return element?.label || token;
          }
          return token;
        },
        __experimentalRenderItem: ({ item }) => {
          if (typeof item === "string" && elements) {
            const element = elements.find(
              (el) => el.value === item
            );
            return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("span", { children: element?.label || item });
          }
          return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("span", { children: item });
        }
      }
    );
  }

  // node_modules/colord/index.mjs
  for (r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, t = function(r3) {
    return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3;
  }, n = function(r3, t2, n2) {
    return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = Math.pow(10, t2)), Math.round(n2 * r3) / n2 + 0;
  }, u = function(r3, t2, n2) {
    return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t2 ? r3 : t2;
  }, e = function(r3) {
    return (r3 = isFinite(r3) ? r3 % 360 : 0) < 0 ? r3 + 360 : r3;
  }, o = function(r3, t2) {
    return void 0 === t2 && (t2 = 0), n(r3, t2) % 360;
  }, a = function(r3) {
    return { r: u(r3.r, 0, 255), g: u(r3.g, 0, 255), b: u(r3.b, 0, 255), a: u(r3.a) };
  }, i = function(r3) {
    return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) };
  }, s = /^#([0-9a-f]{3,8})$/i, d = function(r3, t2) {
    var n2 = r3.charCodeAt(t2);
    return (15 & n2) + 9 * (n2 >> 6);
  }, h = function(r3, t2) {
    return d(r3, t2) << 4 | d(r3, t2 + 1);
  }, b = [], f = 0; f < 256; f++) b.push((f < 16 ? "0" : "") + f.toString(16));
  var r2;
  var t;
  var n;
  var u;
  var e;
  var o;
  var a;
  var i;
  var s;
  var d;
  var h;
  var b;
  var f;
  var g = function(r2) {
    return b[u(r2, 0, 255)];
  };
  var c = function(r2) {
    var t = r2.r, n = r2.g, u = r2.b, e = r2.a, o = Math.max(t, n, u), a = o - Math.min(t, n, u), i = a ? o === t ? (n - u) / a : o === n ? 2 + (u - t) / a : 4 + (t - n) / a : 0;
    return { h: 60 * (i < 0 ? i + 6 : i), s: o ? a / o * 100 : 0, v: o / 255 * 100, a: e };
  };
  var v = function(r2) {
    var t = r2.h, n = r2.s, u = r2.v, e = r2.a;
    t = t / 360 * 6, n /= 100, u /= 100;
    var o = Math.floor(t), a = u * (1 - n), i = u * (1 - (t - o) * n), s = u * (1 - (1 - t + o) * n), d = o % 6;
    return { r: 255 * [u, i, a, a, s, u][d], g: 255 * [s, u, u, i, a, a][d], b: 255 * [a, a, s, u, u, i][d], a: e };
  };
  var l = function(r2) {
    return { h: e(r2.h), s: u(r2.s, 0, 100), l: u(r2.l, 0, 100), a: u(r2.a) };
  };
  var p = function(r2) {
    return { h: o(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) };
  };
  var m = function(r2) {
    return v((n = (t = r2).s, { h: t.h, s: (n *= ((u = t.l) < 50 ? u : 100 - u) / 100) > 0 ? 2 * n / (u + n) * 100 : 0, v: u + n, a: t.a }));
    var t, n, u;
  };
  var y = function(r2) {
    return { h: (t = c(r2)).h, s: (e = (200 - (n = t.s)) * (u = t.v) / 100) > 0 && e < 200 ? n * u / 100 / (e <= 100 ? e : 200 - e) * 100 : 0, l: e / 2, a: t.a };
    var t, n, u, e;
  };
  var N = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
  var x = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s+([+-]?(?:\d*\.\d+|\d+))%\s+([+-]?(?:\d*\.\d+|\d+))%\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
  var M = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
  var H = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
  var $ = { string: [[function(r2) {
    if (!s.test(r2)) return null;
    var t = r2.length;
    return t <= 5 ? { r: 17 * d(r2, 1), g: 17 * d(r2, 2), b: 17 * d(r2, 3), a: 5 === t ? n(17 * d(r2, 4) / 255, 2) : 1 } : 7 === t || 9 === t ? { r: h(r2, 1), g: h(r2, 3), b: h(r2, 5), a: 9 === t ? n(h(r2, 7) / 255, 2) : 1 } : null;
  }, "hex"], [function(r2) {
    var t = M.exec(r2) || H.exec(r2);
    return t ? t[2] !== t[4] || t[4] !== t[6] ? null : a({ r: Number(t[1]) / (t[2] ? 100 / 255 : 1), g: Number(t[3]) / (t[4] ? 100 / 255 : 1), b: Number(t[5]) / (t[6] ? 100 / 255 : 1), a: void 0 === t[7] ? 1 : Number(t[7]) / (t[8] ? 100 : 1) }) : null;
  }, "rgb"], [function(t) {
    var n = N.exec(t) || x.exec(t);
    if (!n) return null;
    var u, e, o = l({ h: (u = n[1], e = n[2], void 0 === e && (e = "deg"), Number(u) * (r2[e] || 1)), s: Number(n[3]), l: Number(n[4]), a: void 0 === n[5] ? 1 : Number(n[5]) / (n[6] ? 100 : 1) });
    return m(o);
  }, "hsl"]], object: [[function(r2) {
    var n = r2.r, u = r2.g, e = r2.b, o = r2.a, i = void 0 === o ? 1 : o;
    return t(n) && t(u) && t(e) ? a({ r: Number(n), g: Number(u), b: Number(e), a: Number(i) }) : null;
  }, "rgb"], [function(r2) {
    var n = r2.h, u = r2.s, e = r2.l, o = r2.a, a = void 0 === o ? 1 : o;
    if (!t(n) || !t(u) || !t(e)) return null;
    var i = l({ h: Number(n), s: Number(u), l: Number(e), a: Number(a) });
    return m(i);
  }, "hsl"], [function(r2) {
    var n = r2.h, o = r2.s, a = r2.v, i = r2.a, s = void 0 === i ? 1 : i;
    if (!t(n) || !t(o) || !t(a)) return null;
    var d = (function(r3) {
      return { h: e(r3.h), s: u(r3.s, 0, 100), v: u(r3.v, 0, 100), a: u(r3.a) };
    })({ h: Number(n), s: Number(o), v: Number(a), a: Number(s) });
    return v(d);
  }, "hsv"]] };
  var j = function(r2, t) {
    for (var n = 0; n < t.length; n++) {
      var u = t[n][0](r2);
      if (u) return [u, t[n][1]];
    }
    return [null, void 0];
  };
  var w = function(r2) {
    return "string" == typeof r2 ? j(r2.trim(), $.string) : "object" == typeof r2 && null !== r2 ? j(r2, $.object) : [null, void 0];
  };
  var k = function(r2, t) {
    var n = y(r2);
    return { h: n.h, s: u(n.s + 100 * t, 0, 100), l: n.l, a: n.a };
  };
  var E = function(r2) {
    return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1e3 / 255;
  };
  var R = function(r2, t) {
    var n = y(r2);
    return { h: n.h, s: n.s, l: u(n.l + 100 * t, 0, 100), a: n.a };
  };
  var q = (function() {
    function r2(r3) {
      this.parsed = w(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
    }
    return r2.prototype.isValid = function() {
      return null !== this.parsed;
    }, r2.prototype.brightness = function() {
      return n(E(this.rgba), 2);
    }, r2.prototype.isDark = function() {
      return E(this.rgba) < 0.5;
    }, r2.prototype.isLight = function() {
      return E(this.rgba) >= 0.5;
    }, r2.prototype.toHex = function() {
      return r3 = i(this.rgba), t = r3.r, u = r3.g, e = r3.b, a = (o = r3.a) < 1 ? g(n(255 * o)) : "", "#" + g(t) + g(u) + g(e) + a;
      var r3, t, u, e, o, a;
    }, r2.prototype.toRgb = function() {
      return i(this.rgba);
    }, r2.prototype.toRgbString = function() {
      return r3 = i(this.rgba), t = r3.r, n = r3.g, u = r3.b, (e = r3.a) < 1 ? "rgba(" + t + ", " + n + ", " + u + ", " + e + ")" : "rgb(" + t + ", " + n + ", " + u + ")";
      var r3, t, n, u, e;
    }, r2.prototype.toHsl = function() {
      return p(y(this.rgba));
    }, r2.prototype.toHslString = function() {
      return r3 = p(y(this.rgba)), t = r3.h, n = r3.s, u = r3.l, (e = r3.a) < 1 ? "hsla(" + t + ", " + n + "%, " + u + "%, " + e + ")" : "hsl(" + t + ", " + n + "%, " + u + "%)";
      var r3, t, n, u, e;
    }, r2.prototype.toHsv = function() {
      return r3 = c(this.rgba), { h: o(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) };
      var r3;
    }, r2.prototype.invert = function() {
      return A({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a });
      var r3;
    }, r2.prototype.saturate = function(r3) {
      return void 0 === r3 && (r3 = 0.1), A(k(this.rgba, r3));
    }, r2.prototype.desaturate = function(r3) {
      return void 0 === r3 && (r3 = 0.1), A(k(this.rgba, -r3));
    }, r2.prototype.grayscale = function() {
      return A(k(this.rgba, -1));
    }, r2.prototype.lighten = function(r3) {
      return void 0 === r3 && (r3 = 0.1), A(R(this.rgba, r3));
    }, r2.prototype.darken = function(r3) {
      return void 0 === r3 && (r3 = 0.1), A(R(this.rgba, -r3));
    }, r2.prototype.rotate = function(r3) {
      return void 0 === r3 && (r3 = 15), this.hue(y(this.rgba).h + r3);
    }, r2.prototype.alpha = function(r3) {
      return "number" == typeof r3 ? A({ r: (t = this.rgba).r, g: t.g, b: t.b, a: r3 }) : n(this.rgba.a, 3);
      var t;
    }, r2.prototype.hue = function(r3) {
      var t = y(this.rgba);
      return "number" == typeof r3 ? A({ h: r3, s: t.s, l: t.l, a: t.a }) : o(t.h);
    }, r2.prototype.isEqual = function(r3) {
      return this.toHex() === A(r3).toHex();
    }, r2;
  })();
  var A = function(r2) {
    return r2 instanceof q ? r2 : new q(r2);
  };

  // packages/dataviews/build-module/components/dataform-controls/color.mjs
  var import_components48 = __toESM(require_components(), 1);
  var import_element135 = __toESM(require_element(), 1);
  var import_i18n54 = __toESM(require_i18n(), 1);
  var import_jsx_runtime192 = __toESM(require_jsx_runtime(), 1);
  var ColorPickerDropdown = ({
    color,
    onColorChange,
    disabled: disabled2
  }) => {
    const validColor = color && A(color).isValid() ? color : "#ffffff";
    return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
      import_components48.Dropdown,
      {
        className: "dataviews-controls__color-picker-dropdown",
        popoverProps: { resize: false },
        renderToggle: ({ onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
          import_components48.Button,
          {
            onClick: onToggle,
            "aria-label": (0, import_i18n54.__)("Open color picker"),
            size: "small",
            disabled: disabled2,
            accessibleWhenDisabled: true,
            icon: () => /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(import_components48.ColorIndicator, { colorValue: validColor })
          }
        ),
        renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(import_components48.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
          import_components48.ColorPicker,
          {
            color: validColor,
            onChange: onColorChange,
            enableAlpha: true
          }
        ) })
      }
    );
  };
  function Color({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const { label, placeholder, description, setValue, isValid: isValid2 } = field;
    const disabled2 = field.isDisabled({ item: data, field });
    const value = field.getValue({ item: data }) || "";
    const handleColorChange = (0, import_element135.useCallback)(
      (newColor) => {
        onChange(setValue({ item: data, value: newColor }));
      },
      [data, onChange, setValue]
    );
    const handleInputChange = (0, import_element135.useCallback)(
      (newValue) => {
        onChange(setValue({ item: data, value: newValue || "" }));
      },
      [data, onChange, setValue]
    );
    return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
      ValidatedInputControl,
      {
        required: !!field.isValid?.required,
        markWhenOptional,
        customValidity: getCustomValidity(isValid2, validity),
        label,
        placeholder,
        value,
        description: typeof description === "string" ? description : void 0,
        details: typeof description === "string" ? void 0 : description,
        onValueChange: handleInputChange,
        hideLabelFromVision,
        type: "text",
        disabled: disabled2,
        prefix: /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(InputLayout3.Slot, { padding: "minimal", children: /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
          ColorPickerDropdown,
          {
            color: value,
            onColorChange: handleColorChange,
            disabled: disabled2
          }
        ) })
      }
    );
  }

  // packages/dataviews/build-module/components/dataform-controls/password.mjs
  var import_components49 = __toESM(require_components(), 1);
  var import_element136 = __toESM(require_element(), 1);
  var import_i18n55 = __toESM(require_i18n(), 1);
  var import_jsx_runtime193 = __toESM(require_jsx_runtime(), 1);
  function Password({
    data,
    field,
    onChange,
    hideLabelFromVision,
    markWhenOptional,
    validity
  }) {
    const [isVisible2, setIsVisible] = (0, import_element136.useState)(false);
    const disabled2 = field.isDisabled({ item: data, field });
    const toggleVisibility = (0, import_element136.useCallback)(() => {
      setIsVisible((prev) => !prev);
    }, []);
    return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
      ValidatedText,
      {
        ...{
          data,
          field,
          onChange,
          hideLabelFromVision,
          markWhenOptional,
          validity,
          type: isVisible2 ? "text" : "password",
          suffix: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(InputLayout3.Slot, { padding: "minimal", children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
            import_components49.Button,
            {
              icon: isVisible2 ? unseen_default : seen_default,
              onClick: toggleVisibility,
              size: "small",
              label: isVisible2 ? (0, import_i18n55.__)("Hide password") : (0, import_i18n55.__)("Show password"),
              disabled: disabled2,
              accessibleWhenDisabled: true
            }
          ) })
        }
      }
    );
  }

  // packages/dataviews/build-module/field-types/utils/has-elements.mjs
  function hasElements(field) {
    return Array.isArray(field.elements) && field.elements.length > 0 || typeof field.getElements === "function";
  }

  // packages/dataviews/build-module/components/dataform-controls/index.mjs
  var import_jsx_runtime194 = __toESM(require_jsx_runtime(), 1);
  var FORM_CONTROLS = {
    adaptiveSelect: AdaptiveSelect,
    array: ArrayControl,
    checkbox: Checkbox,
    color: Color,
    combobox: Combobox3,
    datetime: DateTime,
    date: DateControl,
    email: Email,
    telephone: Telephone,
    url: Url,
    integer: Integer,
    number: Number2,
    password: Password,
    radio: Radio,
    select: Select2,
    text: Text3,
    time: Time,
    toggle: Toggle,
    textarea: Textarea3,
    toggleGroup: ToggleGroup
  };
  function isEditConfig(value) {
    return value && typeof value === "object" && typeof value.control === "string";
  }
  function createConfiguredControl(config) {
    const { control, ...controlConfig } = config;
    const BaseControlType = getControlByType(control);
    if (BaseControlType === null) {
      return null;
    }
    return function ConfiguredControl(props) {
      return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(BaseControlType, { ...props, config: controlConfig });
    };
  }
  function getControl(field, fallback) {
    if (typeof field.Edit === "function") {
      return field.Edit;
    }
    if (typeof field.Edit === "string") {
      return getControlByType(field.Edit);
    }
    if (isEditConfig(field.Edit)) {
      return createConfiguredControl(field.Edit);
    }
    if (hasElements(field) && field.type !== "array") {
      return getControlByType("adaptiveSelect");
    }
    if (fallback === null) {
      return null;
    }
    return getControlByType(fallback);
  }
  function getControlByType(type) {
    if (Object.keys(FORM_CONTROLS).includes(type)) {
      return FORM_CONTROLS[type];
    }
    return null;
  }

  // packages/dataviews/build-module/field-types/utils/get-filter-by.mjs
  function getFilterBy(field, defaultOperators, validOperators) {
    if (field.filterBy === false) {
      return false;
    }
    const operators = field.filterBy?.operators?.filter(
      (op) => validOperators.includes(op)
    ) ?? defaultOperators;
    if (operators.length === 0) {
      return false;
    }
    return {
      isPrimary: !!field.filterBy?.isPrimary,
      operators
    };
  }
  var get_filter_by_default = getFilterBy;

  // packages/dataviews/build-module/field-types/utils/get-value-from-id.mjs
  var getValueFromId = (id) => ({ item }) => {
    const path = id.split(".");
    let value = item;
    for (const segment of path) {
      if (value.hasOwnProperty(segment)) {
        value = value[segment];
      } else {
        value = void 0;
      }
    }
    return value;
  };
  var get_value_from_id_default = getValueFromId;

  // packages/dataviews/build-module/field-types/utils/set-value-from-id.mjs
  var setValueFromId = (id) => ({ value }) => {
    const path = id.split(".");
    const result = {};
    let current = result;
    for (const segment of path.slice(0, -1)) {
      current[segment] = {};
      current = current[segment];
    }
    current[path.at(-1)] = value;
    return result;
  };
  var set_value_from_id_default = setValueFromId;

  // packages/dataviews/build-module/field-types/email.mjs
  var import_i18n56 = __toESM(require_i18n(), 1);

  // packages/dataviews/build-module/field-types/utils/render-from-elements.mjs
  function RenderFromElements({
    item,
    field
  }) {
    const { elements, isLoading } = useElements({
      elements: field.elements,
      getElements: field.getElements
    });
    const value = field.getValue({ item });
    if (isLoading) {
      return value;
    }
    if (elements.length === 0) {
      return value;
    }
    return elements?.find((element) => element.value === value)?.label || field.getValue({ item });
  }

  // packages/dataviews/build-module/field-types/utils/render-default.mjs
  var import_jsx_runtime195 = __toESM(require_jsx_runtime(), 1);
  function render({
    item,
    field
  }) {
    if (field.hasElements) {
      return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(RenderFromElements, { item, field });
    }
    return field.getValueFormatted({ item, field });
  }

  // packages/dataviews/build-module/field-types/utils/sort-text.mjs
  var sort_text_default = (a, b, direction) => {
    return direction === "asc" ? a.localeCompare(b) : b.localeCompare(a);
  };

  // packages/dataviews/build-module/field-types/utils/is-valid-required.mjs
  function isValidRequired(item, field) {
    const value = field.getValue({ item });
    return ![void 0, "", null].includes(value);
  }

  // packages/dataviews/build-module/field-types/utils/is-valid-min-length.mjs
  function isValidMinLength(item, field) {
    if (typeof field.isValid.minLength?.constraint !== "number") {
      return false;
    }
    const value = field.getValue({ item });
    if ([void 0, "", null].includes(value)) {
      return true;
    }
    return String(value).length >= field.isValid.minLength.constraint;
  }

  // packages/dataviews/build-module/field-types/utils/is-valid-max-length.mjs
  function isValidMaxLength(item, field) {
    if (typeof field.isValid.maxLength?.constraint !== "number") {
      return false;
    }
    const value = field.getValue({ item });
    if ([void 0, "", null].includes(value)) {
      return true;
    }
    return String(value).length <= field.isValid.maxLength.constraint;
  }

  // packages/dataviews/build-module/field-types/utils/is-valid-pattern.mjs
  function isValidPattern(item, field) {
    if (field.isValid.pattern?.constraint === void 0) {
      return true;
    }
    try {
      const regexp = new RegExp(field.isValid.pattern.constraint);
      const value = field.getValue({ item });
      if ([void 0, "", null].includes(value)) {
        return true;
      }
      return regexp.test(String(value));
    } catch {
      return false;
    }
  }

  // packages/dataviews/build-module/field-types/utils/is-valid-elements.mjs
  function isValidElements(item, field) {
    const elements = field.elements ?? [];
    const validValues = elements.map((el) => el.value);
    if (validValues.length === 0) {
      return true;
    }
    const value = field.getValue({ item });
    return [].concat(value).every((v2) => validValues.includes(v2));
  }

  // packages/dataviews/build-module/field-types/utils/get-value-formatted-default.mjs
  function getValueFormatted({
    item,
    field
  }) {
    return field.getValue({ item });
  }
  var get_value_formatted_default_default = getValueFormatted;

  // packages/dataviews/build-module/field-types/email.mjs
  var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
  function isValidCustom(item, field) {
    const value = field.getValue({ item });
    if (![void 0, "", null].includes(value) && !emailRegex.test(value)) {
      return (0, import_i18n56.__)("Value must be a valid email address.");
    }
    return null;
  }
  var email_default = {
    type: "email",
    render,
    Edit: "email",
    sort: sort_text_default,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
    validOperators: [
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_CONTAINS,
      OPERATOR_NOT_CONTAINS,
      OPERATOR_STARTS_WITH,
      // Multiple selection
      OPERATOR_IS_ANY,
      OPERATOR_IS_NONE,
      OPERATOR_IS_NOT_ALL
    ],
    format: {},
    getValueFormatted: get_value_formatted_default_default,
    validate: {
      required: isValidRequired,
      pattern: isValidPattern,
      minLength: isValidMinLength,
      maxLength: isValidMaxLength,
      elements: isValidElements,
      custom: isValidCustom
    }
  };

  // packages/dataviews/build-module/field-types/integer.mjs
  var import_i18n57 = __toESM(require_i18n(), 1);

  // packages/dataviews/build-module/field-types/utils/sort-number.mjs
  var sort_number_default = (a, b, direction) => {
    return direction === "asc" ? a - b : b - a;
  };

  // packages/dataviews/build-module/field-types/utils/is-valid-min.mjs
  function isValidMin(item, field) {
    if (typeof field.isValid.min?.constraint !== "number") {
      return false;
    }
    const value = field.getValue({ item });
    if ([void 0, "", null].includes(value)) {
      return true;
    }
    return Number(value) >= field.isValid.min.constraint;
  }

  // packages/dataviews/build-module/field-types/utils/is-valid-max.mjs
  function isValidMax(item, field) {
    if (typeof field.isValid.max?.constraint !== "number") {
      return false;
    }
    const value = field.getValue({ item });
    if ([void 0, "", null].includes(value)) {
      return true;
    }
    return Number(value) <= field.isValid.max.constraint;
  }

  // packages/dataviews/build-module/field-types/integer.mjs
  var format2 = {
    separatorThousand: ","
  };
  function getValueFormatted2({
    item,
    field
  }) {
    let value = field.getValue({ item });
    if (value === null || value === void 0) {
      return "";
    }
    value = Number(value);
    if (!Number.isFinite(value)) {
      return String(value);
    }
    let formatInteger;
    if (field.type !== "integer") {
      formatInteger = format2;
    } else {
      formatInteger = field.format;
    }
    const { separatorThousand } = formatInteger;
    const integerValue = Math.trunc(value);
    if (!separatorThousand) {
      return String(integerValue);
    }
    return String(integerValue).replace(
      /\B(?=(\d{3})+(?!\d))/g,
      separatorThousand
    );
  }
  function isValidCustom2(item, field) {
    const value = field.getValue({ item });
    if (![void 0, "", null].includes(value) && !Number.isInteger(value)) {
      return (0, import_i18n57.__)("Value must be an integer.");
    }
    return null;
  }
  var integer_default = {
    type: "integer",
    render,
    Edit: "integer",
    sort: sort_number_default,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_LESS_THAN,
      OPERATOR_GREATER_THAN,
      OPERATOR_LESS_THAN_OR_EQUAL,
      OPERATOR_GREATER_THAN_OR_EQUAL,
      OPERATOR_BETWEEN
    ],
    validOperators: [
      // Single-selection
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_LESS_THAN,
      OPERATOR_GREATER_THAN,
      OPERATOR_LESS_THAN_OR_EQUAL,
      OPERATOR_GREATER_THAN_OR_EQUAL,
      OPERATOR_BETWEEN,
      // Multiple-selection
      OPERATOR_IS_ANY,
      OPERATOR_IS_NONE,
      OPERATOR_IS_NOT_ALL
    ],
    format: format2,
    getValueFormatted: getValueFormatted2,
    validate: {
      required: isValidRequired,
      min: isValidMin,
      max: isValidMax,
      elements: isValidElements,
      custom: isValidCustom2
    }
  };

  // packages/dataviews/build-module/field-types/number.mjs
  var import_i18n58 = __toESM(require_i18n(), 1);
  var format3 = {
    separatorThousand: ",",
    separatorDecimal: ".",
    decimals: 2
  };
  function getValueFormatted3({
    item,
    field
  }) {
    let value = field.getValue({ item });
    if (value === null || value === void 0) {
      return "";
    }
    value = Number(value);
    if (!Number.isFinite(value)) {
      return String(value);
    }
    let formatNumber;
    if (field.type !== "number") {
      formatNumber = format3;
    } else {
      formatNumber = field.format;
    }
    const { separatorThousand, separatorDecimal, decimals } = formatNumber;
    const fixedValue = value.toFixed(decimals);
    const [integerPart, decimalPart] = fixedValue.split(".");
    const formattedInteger = separatorThousand ? integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, separatorThousand) : integerPart;
    return decimals === 0 ? formattedInteger : formattedInteger + separatorDecimal + decimalPart;
  }
  function isEmpty(value) {
    return value === "" || value === void 0 || value === null;
  }
  function isValidCustom3(item, field) {
    const value = field.getValue({ item });
    if (!isEmpty(value) && !Number.isFinite(value)) {
      return (0, import_i18n58.__)("Value must be a number.");
    }
    return null;
  }
  var number_default = {
    type: "number",
    render,
    Edit: "number",
    sort: sort_number_default,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_LESS_THAN,
      OPERATOR_GREATER_THAN,
      OPERATOR_LESS_THAN_OR_EQUAL,
      OPERATOR_GREATER_THAN_OR_EQUAL,
      OPERATOR_BETWEEN
    ],
    validOperators: [
      // Single-selection
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_LESS_THAN,
      OPERATOR_GREATER_THAN,
      OPERATOR_LESS_THAN_OR_EQUAL,
      OPERATOR_GREATER_THAN_OR_EQUAL,
      OPERATOR_BETWEEN,
      // Multiple-selection
      OPERATOR_IS_ANY,
      OPERATOR_IS_NONE,
      OPERATOR_IS_NOT_ALL
    ],
    format: format3,
    getValueFormatted: getValueFormatted3,
    validate: {
      required: isValidRequired,
      min: isValidMin,
      max: isValidMax,
      elements: isValidElements,
      custom: isValidCustom3
    }
  };

  // packages/dataviews/build-module/field-types/text.mjs
  var text_default = {
    type: "text",
    render,
    Edit: "text",
    sort: sort_text_default,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
    validOperators: [
      // Single selection
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_CONTAINS,
      OPERATOR_NOT_CONTAINS,
      OPERATOR_STARTS_WITH,
      // Multiple selection
      OPERATOR_IS_ANY,
      OPERATOR_IS_NONE,
      OPERATOR_IS_NOT_ALL
    ],
    format: {},
    getValueFormatted: get_value_formatted_default_default,
    validate: {
      required: isValidRequired,
      pattern: isValidPattern,
      minLength: isValidMinLength,
      maxLength: isValidMaxLength,
      elements: isValidElements
    }
  };

  // packages/dataviews/build-module/field-types/datetime.mjs
  var import_date9 = __toESM(require_date(), 1);

  // packages/dataviews/build-module/field-types/utils/is-valid-boundary.mjs
  var import_date8 = __toESM(require_date(), 1);
  function parseDateLike(value) {
    if (!isValid(new Date(value))) {
      return null;
    }
    const parsed = (0, import_date8.getDate)(value);
    return parsed && isValid(parsed) ? parsed.getTime() : null;
  }
  function validateBoundary(item, field, boundary, parse2) {
    const constraint = field.isValid[boundary]?.constraint;
    if (typeof constraint !== "string") {
      return false;
    }
    const value = field.getValue({ item });
    const boundaryValue = Array.isArray(value) ? value[boundary === "min" ? 0 : value.length - 1] : value;
    if (boundaryValue === void 0 || boundaryValue === null || boundaryValue === "") {
      return true;
    }
    const parsedConstraint = parse2(constraint);
    const parsedValue = parse2(String(boundaryValue));
    if (parsedConstraint === null || parsedValue === null) {
      return false;
    }
    return boundary === "min" ? parsedValue >= parsedConstraint : parsedValue <= parsedConstraint;
  }
  function isValidMinDate(item, field) {
    return validateBoundary(item, field, "min", parseDateLike);
  }
  function isValidMaxDate(item, field) {
    return validateBoundary(item, field, "max", parseDateLike);
  }
  function isValidMinTime(item, field) {
    return validateBoundary(item, field, "min", parseTime2);
  }
  function isValidMaxTime(item, field) {
    return validateBoundary(item, field, "max", parseTime2);
  }

  // packages/dataviews/build-module/field-types/datetime.mjs
  var format4 = {
    datetime: (0, import_date9.getSettings)().formats.datetime,
    weekStartsOn: (0, import_date9.getSettings)().l10n.startOfWeek
  };
  function getValueFormatted4({
    item,
    field
  }) {
    const value = field.getValue({ item });
    if (["", void 0, null].includes(value)) {
      return "";
    }
    let formatDatetime;
    if (field.type !== "datetime") {
      formatDatetime = format4;
    } else {
      formatDatetime = field.format;
    }
    return (0, import_date9.dateI18n)(formatDatetime.datetime, (0, import_date9.getDate)(value));
  }
  var sort = (a, b, direction) => {
    const timeA = new Date(a).getTime();
    const timeB = new Date(b).getTime();
    return direction === "asc" ? timeA - timeB : timeB - timeA;
  };
  var datetime_default = {
    type: "datetime",
    render,
    Edit: "datetime",
    sort,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [
      OPERATOR_ON,
      OPERATOR_NOT_ON,
      OPERATOR_BEFORE,
      OPERATOR_AFTER,
      OPERATOR_BEFORE_INC,
      OPERATOR_AFTER_INC,
      OPERATOR_IN_THE_PAST,
      OPERATOR_OVER
    ],
    validOperators: [
      OPERATOR_ON,
      OPERATOR_NOT_ON,
      OPERATOR_BEFORE,
      OPERATOR_AFTER,
      OPERATOR_BEFORE_INC,
      OPERATOR_AFTER_INC,
      OPERATOR_IN_THE_PAST,
      OPERATOR_OVER
    ],
    format: format4,
    getValueFormatted: getValueFormatted4,
    validate: {
      required: isValidRequired,
      elements: isValidElements,
      min: isValidMinDate,
      max: isValidMaxDate
    }
  };

  // packages/dataviews/build-module/field-types/date.mjs
  var import_date10 = __toESM(require_date(), 1);
  var format5 = {
    date: (0, import_date10.getSettings)().formats.date,
    weekStartsOn: (0, import_date10.getSettings)().l10n.startOfWeek
  };
  function getValueFormatted5({
    item,
    field
  }) {
    const value = field.getValue({ item });
    if (["", void 0, null].includes(value)) {
      return "";
    }
    let formatDate2;
    if (field.type !== "date") {
      formatDate2 = format5;
    } else {
      formatDate2 = field.format;
    }
    return (0, import_date10.dateI18n)(formatDate2.date, (0, import_date10.getDate)(value));
  }
  var sort2 = (a, b, direction) => {
    const timeA = new Date(a).getTime();
    const timeB = new Date(b).getTime();
    return direction === "asc" ? timeA - timeB : timeB - timeA;
  };
  var date_default = {
    type: "date",
    render,
    Edit: "date",
    sort: sort2,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [
      OPERATOR_ON,
      OPERATOR_NOT_ON,
      OPERATOR_BEFORE,
      OPERATOR_AFTER,
      OPERATOR_BEFORE_INC,
      OPERATOR_AFTER_INC,
      OPERATOR_IN_THE_PAST,
      OPERATOR_OVER,
      OPERATOR_BETWEEN
    ],
    validOperators: [
      OPERATOR_ON,
      OPERATOR_NOT_ON,
      OPERATOR_BEFORE,
      OPERATOR_AFTER,
      OPERATOR_BEFORE_INC,
      OPERATOR_AFTER_INC,
      OPERATOR_IN_THE_PAST,
      OPERATOR_OVER,
      OPERATOR_BETWEEN
    ],
    format: format5,
    getValueFormatted: getValueFormatted5,
    validate: {
      required: isValidRequired,
      elements: isValidElements,
      min: isValidMinDate,
      max: isValidMaxDate
    }
  };

  // packages/dataviews/build-module/field-types/time.mjs
  var import_date11 = __toESM(require_date(), 1);
  var format6 = {
    time: (0, import_date11.getSettings)().formats.time
  };
  var ANCHOR_DATE = "2000-01-01";
  function toAnchoredDate(secondsSinceMidnight) {
    const hours = Math.floor(secondsSinceMidnight / 3600);
    const minutes = Math.floor(secondsSinceMidnight % 3600 / 60);
    const seconds = secondsSinceMidnight % 60;
    const time = [hours, minutes, seconds].map((part) => String(part).padStart(2, "0")).join(":");
    return (0, import_date11.getDate)(`${ANCHOR_DATE}T${time}`);
  }
  function getValueFormatted6({
    item,
    field
  }) {
    const secondsSinceMidnight = parseTime2(field.getValue({ item }));
    if (secondsSinceMidnight === null) {
      return "";
    }
    let formatTime;
    if (field.type !== "time") {
      formatTime = format6;
    } else {
      formatTime = field.format;
    }
    return (0, import_date11.dateI18n)(formatTime.time, toAnchoredDate(secondsSinceMidnight));
  }
  var sort3 = (a, b, direction) => {
    const timeA = parseTime2(a);
    const timeB = parseTime2(b);
    if (timeA === null || timeB === null) {
      if (timeA === timeB) {
        return 0;
      }
      return timeA === null ? 1 : -1;
    }
    return direction === "asc" ? timeA - timeB : timeB - timeA;
  };
  var time_default = {
    type: "time",
    render,
    Edit: "time",
    sort: sort3,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [
      OPERATOR_ON,
      OPERATOR_NOT_ON,
      OPERATOR_BEFORE,
      OPERATOR_AFTER,
      OPERATOR_BEFORE_INC,
      OPERATOR_AFTER_INC,
      OPERATOR_BETWEEN
    ],
    validOperators: [
      OPERATOR_ON,
      OPERATOR_NOT_ON,
      OPERATOR_BEFORE,
      OPERATOR_AFTER,
      OPERATOR_BEFORE_INC,
      OPERATOR_AFTER_INC,
      OPERATOR_BETWEEN
    ],
    format: format6,
    getValueFormatted: getValueFormatted6,
    validate: {
      required: isValidRequired,
      elements: isValidElements,
      min: isValidMinTime,
      max: isValidMaxTime
    }
  };

  // packages/dataviews/build-module/field-types/boolean.mjs
  var import_i18n59 = __toESM(require_i18n(), 1);

  // packages/dataviews/build-module/field-types/utils/is-valid-required-for-bool.mjs
  function isValidRequiredForBool(item, field) {
    const value = field.getValue({ item });
    return value === true;
  }

  // packages/dataviews/build-module/field-types/boolean.mjs
  function getValueFormatted7({
    item,
    field
  }) {
    const value = field.getValue({ item });
    if (value === true) {
      return (0, import_i18n59.__)("True");
    }
    if (value === false) {
      return (0, import_i18n59.__)("False");
    }
    return "";
  }
  function isValidCustom4(item, field) {
    const value = field.getValue({ item });
    if (![void 0, "", null].includes(value) && ![true, false].includes(value)) {
      return (0, import_i18n59.__)("Value must be true, false, or undefined");
    }
    return null;
  }
  var sort4 = (a, b, direction) => {
    const boolA = Boolean(a);
    const boolB = Boolean(b);
    if (boolA === boolB) {
      return 0;
    }
    if (direction === "asc") {
      return boolA ? 1 : -1;
    }
    return boolA ? -1 : 1;
  };
  var boolean_default = {
    type: "boolean",
    render,
    Edit: "checkbox",
    sort: sort4,
    validate: {
      required: isValidRequiredForBool,
      elements: isValidElements,
      custom: isValidCustom4
    },
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
    validOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
    format: {},
    getValueFormatted: getValueFormatted7
  };

  // packages/dataviews/build-module/field-types/media.mjs
  var media_default = {
    type: "media",
    render: () => null,
    Edit: null,
    sort: () => 0,
    enableSorting: false,
    enableGlobalSearch: false,
    defaultOperators: [],
    validOperators: [],
    format: {},
    getValueFormatted: get_value_formatted_default_default,
    // cannot validate any constraint, so
    // the only available validation for the field author
    // would be providing a custom validator.
    validate: {}
  };

  // packages/dataviews/build-module/field-types/array.mjs
  var import_i18n60 = __toESM(require_i18n(), 1);

  // packages/dataviews/build-module/field-types/utils/is-valid-required-for-array.mjs
  function isValidRequiredForArray(item, field) {
    const value = field.getValue({ item });
    return Array.isArray(value) && value.length > 0 && value.every(
      (element) => ![void 0, "", null].includes(element)
    );
  }

  // packages/dataviews/build-module/field-types/array.mjs
  function getValueFormatted8({
    item,
    field
  }) {
    const value = field.getValue({ item });
    const arr = Array.isArray(value) ? value : [];
    return arr.join(", ");
  }
  function render2({ item, field }) {
    return getValueFormatted8({ item, field });
  }
  function isValidCustom5(item, field) {
    const value = field.getValue({ item });
    if ([void 0, "", null].includes(value)) {
      return null;
    }
    if (!Array.isArray(value)) {
      return (0, import_i18n60.__)("Value must be an array.");
    }
    if (!value.every((v2) => typeof v2 === "string")) {
      return (0, import_i18n60.__)("Every value must be a string.");
    }
    return null;
  }
  var sort5 = (a, b, direction) => {
    const arrA = Array.isArray(a) ? a : [];
    const arrB = Array.isArray(b) ? b : [];
    if (arrA.length !== arrB.length) {
      return direction === "asc" ? arrA.length - arrB.length : arrB.length - arrA.length;
    }
    const joinedA = arrA.join(",");
    const joinedB = arrB.join(",");
    return direction === "asc" ? joinedA.localeCompare(joinedB) : joinedB.localeCompare(joinedA);
  };
  var array_default = {
    type: "array",
    render: render2,
    Edit: "array",
    sort: sort5,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
    validOperators: [
      OPERATOR_IS_ANY,
      OPERATOR_IS_NONE,
      OPERATOR_IS_ALL,
      OPERATOR_IS_NOT_ALL
    ],
    format: {},
    getValueFormatted: getValueFormatted8,
    validate: {
      required: isValidRequiredForArray,
      elements: isValidElements,
      custom: isValidCustom5
    }
  };

  // packages/dataviews/build-module/field-types/password.mjs
  function getValueFormatted9({
    item,
    field
  }) {
    return field.getValue({ item }) ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : "";
  }
  var password_default = {
    type: "password",
    render,
    Edit: "password",
    sort: () => 0,
    // Passwords should not be sortable for security reasons
    enableSorting: false,
    enableGlobalSearch: false,
    defaultOperators: [],
    validOperators: [],
    format: {},
    getValueFormatted: getValueFormatted9,
    validate: {
      required: isValidRequired,
      pattern: isValidPattern,
      minLength: isValidMinLength,
      maxLength: isValidMaxLength,
      elements: isValidElements
    }
  };

  // packages/dataviews/build-module/field-types/telephone.mjs
  var telephone_default = {
    type: "telephone",
    render,
    Edit: "telephone",
    sort: sort_text_default,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
    validOperators: [
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_CONTAINS,
      OPERATOR_NOT_CONTAINS,
      OPERATOR_STARTS_WITH,
      // Multiple selection
      OPERATOR_IS_ANY,
      OPERATOR_IS_NONE,
      OPERATOR_IS_NOT_ALL
    ],
    format: {},
    getValueFormatted: get_value_formatted_default_default,
    validate: {
      required: isValidRequired,
      pattern: isValidPattern,
      minLength: isValidMinLength,
      maxLength: isValidMaxLength,
      elements: isValidElements
    }
  };

  // packages/dataviews/build-module/field-types/color.mjs
  var import_i18n61 = __toESM(require_i18n(), 1);
  var import_jsx_runtime196 = __toESM(require_jsx_runtime(), 1);
  function render3({ item, field }) {
    if (field.hasElements) {
      return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(RenderFromElements, { item, field });
    }
    const value = get_value_formatted_default_default({ item, field });
    if (!value || !A(value).isValid()) {
      return value;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime196.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
      /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
        "div",
        {
          style: {
            width: "16px",
            height: "16px",
            borderRadius: "50%",
            backgroundColor: value,
            border: "1px solid #ddd",
            flexShrink: 0
          }
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime196.jsx)("span", { children: value })
    ] });
  }
  function isValidCustom6(item, field) {
    const value = field.getValue({ item });
    if (![void 0, "", null].includes(value) && !A(value).isValid()) {
      return (0, import_i18n61.__)("Value must be a valid color.");
    }
    return null;
  }
  var sort6 = (a, b, direction) => {
    const colorA = A(a);
    const colorB = A(b);
    if (!colorA.isValid() && !colorB.isValid()) {
      return 0;
    }
    if (!colorA.isValid()) {
      return direction === "asc" ? 1 : -1;
    }
    if (!colorB.isValid()) {
      return direction === "asc" ? -1 : 1;
    }
    const hslA = colorA.toHsl();
    const hslB = colorB.toHsl();
    if (hslA.h !== hslB.h) {
      return direction === "asc" ? hslA.h - hslB.h : hslB.h - hslA.h;
    }
    if (hslA.s !== hslB.s) {
      return direction === "asc" ? hslA.s - hslB.s : hslB.s - hslA.s;
    }
    return direction === "asc" ? hslA.l - hslB.l : hslB.l - hslA.l;
  };
  var color_default = {
    type: "color",
    render: render3,
    Edit: "color",
    sort: sort6,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
    validOperators: [
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_IS_ANY,
      OPERATOR_IS_NONE
    ],
    format: {},
    getValueFormatted: get_value_formatted_default_default,
    validate: {
      required: isValidRequired,
      elements: isValidElements,
      custom: isValidCustom6
    }
  };

  // packages/dataviews/build-module/field-types/url.mjs
  var url_default = {
    type: "url",
    render,
    Edit: "url",
    sort: sort_text_default,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
    validOperators: [
      OPERATOR_IS,
      OPERATOR_IS_NOT,
      OPERATOR_CONTAINS,
      OPERATOR_NOT_CONTAINS,
      OPERATOR_STARTS_WITH,
      // Multiple selection
      OPERATOR_IS_ANY,
      OPERATOR_IS_NONE,
      OPERATOR_IS_NOT_ALL
    ],
    format: {},
    getValueFormatted: get_value_formatted_default_default,
    validate: {
      required: isValidRequired,
      pattern: isValidPattern,
      minLength: isValidMinLength,
      maxLength: isValidMaxLength,
      elements: isValidElements
    }
  };

  // packages/dataviews/build-module/field-types/no-type.mjs
  var sort7 = (a, b, direction) => {
    if (typeof a === "number" && typeof b === "number") {
      return sort_number_default(a, b, direction);
    }
    return sort_text_default(a, b, direction);
  };
  var no_type_default = {
    // type: no type for this one
    render,
    Edit: null,
    sort: sort7,
    enableSorting: true,
    enableGlobalSearch: false,
    defaultOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
    validOperators: getAllOperatorNames(),
    format: {},
    getValueFormatted: get_value_formatted_default_default,
    validate: {
      required: isValidRequired,
      elements: isValidElements
    }
  };

  // packages/dataviews/build-module/field-types/utils/get-is-valid.mjs
  function supportsNumericRangeConstraint(type) {
    return type === "integer" || type === "number";
  }
  function supportsStringRangeConstraint(type) {
    return type === "date" || type === "datetime" || type === "time";
  }
  function normalizeRangeRule(value, fieldType, key) {
    const validator = fieldType.validate[key];
    if (validator && (typeof value === "number" && supportsNumericRangeConstraint(fieldType.type) || typeof value === "string" && supportsStringRangeConstraint(fieldType.type))) {
      return { constraint: value, validate: validator };
    }
    return void 0;
  }
  function getIsValid(field, fieldType) {
    const rules = field.isValid;
    let required;
    if (rules?.required === true && fieldType.validate.required !== void 0) {
      required = {
        constraint: true,
        validate: fieldType.validate.required
      };
    }
    let elements;
    if ((rules?.elements === true || // elements is enabled unless the field opts-out
    rules?.elements === void 0 && (!!field.elements || !!field.getElements)) && fieldType.validate.elements !== void 0) {
      elements = {
        constraint: true,
        validate: fieldType.validate.elements
      };
    }
    const min3 = normalizeRangeRule(rules?.min, fieldType, "min");
    const max3 = normalizeRangeRule(rules?.max, fieldType, "max");
    const minLengthValue = rules?.minLength;
    let minLength;
    if (typeof minLengthValue === "number" && fieldType.validate.minLength !== void 0) {
      minLength = {
        constraint: minLengthValue,
        validate: fieldType.validate.minLength
      };
    }
    const maxLengthValue = rules?.maxLength;
    let maxLength;
    if (typeof maxLengthValue === "number" && fieldType.validate.maxLength !== void 0) {
      maxLength = {
        constraint: maxLengthValue,
        validate: fieldType.validate.maxLength
      };
    }
    const patternValue = rules?.pattern;
    let pattern;
    if (patternValue !== void 0 && fieldType.validate.pattern !== void 0) {
      pattern = {
        constraint: patternValue,
        validate: fieldType.validate.pattern
      };
    }
    const custom = rules?.custom ?? fieldType.validate.custom;
    return {
      required,
      elements,
      min: min3,
      max: max3,
      minLength,
      maxLength,
      pattern,
      custom
    };
  }

  // packages/dataviews/build-module/field-types/utils/get-filter.mjs
  function getFilter(fieldType) {
    return fieldType.validOperators.reduce((accumulator, operator) => {
      const operatorObj = getOperatorByName(operator);
      if (operatorObj?.filter) {
        accumulator[operator] = operatorObj.filter;
      }
      return accumulator;
    }, {});
  }

  // packages/dataviews/build-module/field-types/utils/get-format.mjs
  function getFormat(field, fieldType) {
    return {
      ...fieldType.format,
      ...field.format
    };
  }
  var get_format_default = getFormat;

  // packages/dataviews/build-module/field-types/index.mjs
  function getFieldTypeByName(type) {
    const found = [
      email_default,
      integer_default,
      number_default,
      text_default,
      datetime_default,
      date_default,
      time_default,
      boolean_default,
      media_default,
      array_default,
      password_default,
      telephone_default,
      color_default,
      url_default
    ].find((fieldType) => fieldType?.type === type);
    if (!!found) {
      return found;
    }
    return no_type_default;
  }
  function normalizeFields(fields) {
    return fields.map((field) => {
      const fieldType = getFieldTypeByName(field.type);
      const getValue = field.getValue || get_value_from_id_default(field.id);
      const sort8 = function(a, b, direction) {
        const aValue = getValue({ item: a });
        const bValue = getValue({ item: b });
        return field.sort ? field.sort(aValue, bValue, direction) : fieldType.sort(aValue, bValue, direction);
      };
      return {
        id: field.id,
        label: field.label || field.id,
        header: field.header || field.label || field.id,
        description: field.description,
        placeholder: field.placeholder,
        getValue,
        setValue: field.setValue || set_value_from_id_default(field.id),
        elements: field.elements,
        getElements: field.getElements,
        hasElements: hasElements(field),
        isVisible: field.isVisible,
        isDisabled: typeof field.isDisabled === "function" ? field.isDisabled : () => !!field.isDisabled,
        enableHiding: field.enableHiding ?? true,
        readOnly: field.readOnly ?? false,
        // The type provides defaults for the following props
        type: fieldType.type,
        render: field.render ?? fieldType.render,
        Edit: getControl(field, fieldType.Edit),
        sort: sort8,
        enableSorting: field.enableSorting ?? fieldType.enableSorting,
        enableGlobalSearch: field.enableGlobalSearch ?? fieldType.enableGlobalSearch,
        isValid: getIsValid(field, fieldType),
        filterBy: get_filter_by_default(
          field,
          fieldType.defaultOperators,
          fieldType.validOperators
        ),
        filter: getFilter(fieldType),
        format: get_format_default(field, fieldType),
        getValueFormatted: field.getValueFormatted ?? fieldType.getValueFormatted
      };
    });
  }

  // packages/dataviews/build-module/hooks/use-data.mjs
  var import_element137 = __toESM(require_element(), 1);
  function useData({
    view,
    data: shownData,
    getItemId,
    isLoading,
    paginationInfo,
    selection
  }) {
    const isInfiniteScrollEnabled = view.infiniteScrollEnabled;
    const [hasInitiallyLoaded, setHasInitiallyLoaded] = (0, import_element137.useState)(!isLoading);
    (0, import_element137.useEffect)(() => {
      if (!isLoading) {
        setHasInitiallyLoaded(true);
      }
    }, [isLoading]);
    const previousDataRef = (0, import_element137.useRef)(shownData);
    const previousPaginationInfoRef = (0, import_element137.useRef)(paginationInfo);
    (0, import_element137.useEffect)(() => {
      if (!isLoading) {
        previousDataRef.current = shownData;
        previousPaginationInfoRef.current = paginationInfo;
      }
    }, [shownData, isLoading, paginationInfo]);
    const [visibleEntries, setVisibleEntries] = (0, import_element137.useState)([]);
    const positionMapRef = (0, import_element137.useRef)(/* @__PURE__ */ new Map());
    const allLoadedRecordsRef = (0, import_element137.useRef)([]);
    const prevViewParamsRef = (0, import_element137.useRef)({
      search: void 0,
      filters: void 0,
      perPage: void 0
    });
    const scrollDirectionRef = (0, import_element137.useRef)(void 0);
    const prevStartPositionRef = (0, import_element137.useRef)(void 0);
    const hasInitializedRef = (0, import_element137.useRef)(false);
    const allLoadedRecords = (0, import_element137.useMemo)(() => {
      if (view.startPosition !== void 0 && prevStartPositionRef.current !== void 0) {
        if (view.startPosition < prevStartPositionRef.current) {
          scrollDirectionRef.current = "up";
        } else if (view.startPosition > prevStartPositionRef.current) {
          scrollDirectionRef.current = "down";
        }
      }
      prevStartPositionRef.current = view.startPosition;
      const currentFiltersKey = JSON.stringify(view.filters ?? []);
      const prevFiltersKey = prevViewParamsRef.current.filters;
      const shouldReset = !hasInitializedRef.current || !view.infiniteScrollEnabled || view.search !== prevViewParamsRef.current.search || currentFiltersKey !== prevFiltersKey || view.perPage !== prevViewParamsRef.current.perPage;
      hasInitializedRef.current = true;
      prevViewParamsRef.current = {
        search: view.search,
        filters: currentFiltersKey,
        perPage: view.perPage
      };
      if (shouldReset) {
        positionMapRef.current.clear();
        scrollDirectionRef.current = void 0;
        const startPosition = view.search ? 1 : view.startPosition ?? 1;
        const records = shownData.map((record, index2) => {
          const position = startPosition + index2;
          positionMapRef.current.set(getItemId(record), position);
          return {
            ...record,
            position
          };
        });
        allLoadedRecordsRef.current = records;
        return records;
      }
      const prev = allLoadedRecordsRef.current;
      const shownDataIds = new Set(shownData.map(getItemId));
      const scrollDirection = scrollDirectionRef.current;
      const basePosition = view.search ? 1 : view.startPosition ?? 1;
      const newRecords = shownData.map((record, index2) => {
        const itemId = getItemId(record);
        const position = view.infiniteScrollEnabled ? basePosition + index2 : void 0;
        if (position !== void 0) {
          positionMapRef.current.set(itemId, position);
        }
        return {
          ...record,
          position
        };
      });
      if (newRecords.length === 0) {
        return prev;
      }
      const prevWithoutDuplicates = prev.filter(
        (record) => !shownDataIds.has(getItemId(record))
      );
      const allRecords = scrollDirection === "up" ? [...newRecords, ...prevWithoutDuplicates] : [...prevWithoutDuplicates, ...newRecords];
      allRecords.sort((a, b) => {
        const posA = a.position;
        const posB = b.position;
        return posA - posB;
      });
      let result = allRecords;
      if (visibleEntries.length > 0) {
        const visibleMin = Math.min(...visibleEntries);
        const visibleMax = Math.max(...visibleEntries);
        const buffer = 20;
        const recordPositions = allRecords.map(
          (r2) => r2.position
        );
        const minRecordPos = Math.min(...recordPositions);
        const maxRecordPos = Math.max(...recordPositions);
        const hasOverlap = !(maxRecordPos < visibleMin - buffer || minRecordPos > visibleMax + buffer);
        if (hasOverlap) {
          result = allRecords.filter((record) => {
            const itemId = getItemId(record);
            const isSelected2 = selection?.includes(itemId);
            if (isSelected2) {
              return true;
            }
            const itemPosition = record.position;
            if (scrollDirection === "up") {
              return itemPosition <= visibleMax + buffer;
            } else if (scrollDirection === "down") {
              return itemPosition >= visibleMin - buffer;
            }
            return itemPosition >= visibleMin - buffer && itemPosition <= visibleMax + buffer;
          });
        }
      }
      allLoadedRecordsRef.current = result;
      return result;
    }, [
      shownData,
      view.search,
      view.filters,
      view.perPage,
      view.startPosition,
      view.infiniteScrollEnabled,
      visibleEntries,
      selection,
      getItemId
    ]);
    if (!isInfiniteScrollEnabled) {
      const dataToReturn = isLoading && previousDataRef.current?.length ? previousDataRef.current : shownData;
      return {
        data: dataToReturn.map((item) => ({
          ...item,
          position: void 0
        })),
        paginationInfo: isLoading && previousDataRef.current?.length ? previousPaginationInfoRef.current : paginationInfo,
        hasInitiallyLoaded,
        setVisibleEntries: void 0
      };
    }
    return {
      data: allLoadedRecords,
      paginationInfo,
      hasInitiallyLoaded,
      setVisibleEntries
    };
  }

  // packages/dataviews/build-module/hooks/use-infinite-scroll.mjs
  var import_element138 = __toESM(require_element(), 1);
  var import_compose22 = __toESM(require_compose(), 1);
  function captureAnchorElement(container, anchorElementRef, direction) {
    const containerRect = container.getBoundingClientRect();
    const centerY = containerRect.top + containerRect.height / 2;
    const items = Array.from(container.querySelectorAll("[aria-posinset]"));
    if (items.length === 0) {
      return false;
    }
    const bestAnchor = items.reduce((best, item) => {
      const itemRect = item.getBoundingClientRect();
      const itemCenterY = itemRect.top + itemRect.height / 2;
      const distance = Math.abs(itemCenterY - centerY);
      const bestRect = best.getBoundingClientRect();
      const bestCenterY = bestRect.top + bestRect.height / 2;
      const bestDistance = Math.abs(bestCenterY - centerY);
      return distance < bestDistance ? item : best;
    });
    const posinset = Number(bestAnchor.getAttribute("aria-posinset"));
    const anchorRect = bestAnchor.getBoundingClientRect();
    anchorElementRef.current = {
      posinset,
      viewportOffset: anchorRect.top - containerRect.top,
      scrollTop: container.scrollTop,
      direction
    };
    return true;
  }
  function useInfiniteScroll({
    view,
    onChangeView,
    isLoading,
    paginationInfo,
    containerRef,
    setVisibleEntries
  }) {
    const anchorElementRef = (0, import_element138.useRef)(null);
    const viewRef = (0, import_element138.useRef)(view);
    const isLoadingRef = (0, import_element138.useRef)(isLoading);
    const onChangeViewRef = (0, import_element138.useRef)(onChangeView);
    const totalItemsRef = (0, import_element138.useRef)(paginationInfo.totalItems);
    (0, import_element138.useLayoutEffect)(() => {
      viewRef.current = view;
      isLoadingRef.current = isLoading;
      onChangeViewRef.current = onChangeView;
      totalItemsRef.current = paginationInfo.totalItems;
    }, [view, isLoading, onChangeView, paginationInfo.totalItems]);
    const intersectionObserverCallback = (0, import_element138.useCallback)(
      (entries) => {
        if (!setVisibleEntries) {
          return;
        }
        setVisibleEntries((prev) => {
          const newVisibleEntries = new Set(prev);
          let hasChanged = false;
          entries.forEach((entry) => {
            const posInSet = Number(
              entry.target?.attributes?.getNamedItem(
                "aria-posinset"
              )?.value
            );
            if (isNaN(posInSet)) {
              return;
            }
            if (entry.isIntersecting) {
              if (!newVisibleEntries.has(posInSet)) {
                newVisibleEntries.add(posInSet);
                hasChanged = true;
              }
            } else if (newVisibleEntries.has(posInSet)) {
              newVisibleEntries.delete(posInSet);
              hasChanged = true;
            }
          });
          return hasChanged ? Array.from(newVisibleEntries).sort() : prev;
        });
      },
      [setVisibleEntries]
    );
    (0, import_element138.useLayoutEffect)(() => {
      const container = containerRef.current;
      const anchor = anchorElementRef.current;
      if (!container || !view.infiniteScrollEnabled || !anchor || isLoading) {
        return;
      }
      const anchorElement = container.querySelector(
        `[aria-posinset="${anchor.posinset}"]`
      );
      if (anchorElement) {
        const containerRect = container.getBoundingClientRect();
        const anchorRect = anchorElement.getBoundingClientRect();
        const currentOffset = anchorRect.top - containerRect.top;
        const scrollAdjustment = currentOffset - anchor.viewportOffset + (container.scrollTop - anchor.scrollTop);
        if (Math.abs(scrollAdjustment) > 1) {
          container.scrollTop += scrollAdjustment;
        }
      }
      anchorElementRef.current = null;
    }, [containerRef, isLoading, view.infiniteScrollEnabled]);
    const intersectionObserverRef = (0, import_element138.useRef)(
      null
    );
    (0, import_element138.useEffect)(() => {
      if (!view.infiniteScrollEnabled || !intersectionObserverCallback) {
        if (intersectionObserverRef.current) {
          intersectionObserverRef.current.disconnect();
          intersectionObserverRef.current = null;
        }
        return;
      }
      intersectionObserverRef.current = new IntersectionObserver(
        intersectionObserverCallback,
        { root: null, rootMargin: "0px", threshold: 0.1 }
      );
      return () => {
        if (intersectionObserverRef.current) {
          intersectionObserverRef.current.disconnect();
          intersectionObserverRef.current = null;
        }
      };
    }, [view.infiniteScrollEnabled, intersectionObserverCallback]);
    (0, import_element138.useEffect)(() => {
      if (!view.infiniteScrollEnabled || !containerRef.current) {
        return;
      }
      let lastScrollTop = 0;
      const BOTTOM_THRESHOLD = 600;
      const TOP_THRESHOLD = 800;
      const handleScroll = (0, import_compose22.throttle)((event) => {
        const currentView = viewRef.current;
        const totalItems = totalItemsRef.current;
        const target = event.target;
        const scrollTop = target.scrollTop;
        const scrollHeight = target.scrollHeight;
        const clientHeight = target.clientHeight;
        const scrollDirection = scrollTop > lastScrollTop ? "down" : "up";
        lastScrollTop = scrollTop;
        if (isLoadingRef.current) {
          return;
        }
        const currentStartPosition = currentView.startPosition || 1;
        const batchSize = currentView.perPage || 10;
        const currentEndPosition = Math.min(
          currentStartPosition + batchSize,
          totalItems
        );
        if (scrollDirection === "down" && scrollTop + clientHeight >= scrollHeight - BOTTOM_THRESHOLD) {
          if (currentEndPosition < totalItems) {
            const newStartPosition = currentEndPosition;
            captureAnchorElement(target, anchorElementRef, "down");
            onChangeViewRef.current({
              ...currentView,
              startPosition: newStartPosition
            });
          }
        }
        if (scrollDirection === "up" && scrollTop <= TOP_THRESHOLD) {
          if (currentStartPosition > 1) {
            const calculatedStartPosition = currentStartPosition - batchSize;
            const newStartPosition = calculatedStartPosition < 6 ? 1 : calculatedStartPosition;
            captureAnchorElement(target, anchorElementRef, "up");
            onChangeViewRef.current({
              ...currentView,
              startPosition: newStartPosition
            });
          }
        }
      }, 50);
      const container = containerRef.current;
      container.addEventListener("scroll", handleScroll);
      return () => {
        container.removeEventListener("scroll", handleScroll);
        handleScroll.cancel();
      };
    }, [containerRef, view.infiniteScrollEnabled]);
    return {
      intersectionObserver: intersectionObserverRef.current
    };
  }

  // packages/dataviews/build-module/hooks/use-page-clamp.mjs
  var import_element139 = __toESM(require_element(), 1);
  var import_compose23 = __toESM(require_compose(), 1);
  function usePageClamp({
    view,
    onChangeView,
    isLoading,
    totalPages
  }) {
    const lastPage = typeof totalPages === "number" && Number.isFinite(totalPages) ? Math.max(totalPages, 1) : null;
    const page = view.page;
    const goToLastPage = (0, import_compose23.useEvent)(() => {
      if (lastPage !== null) {
        onChangeView({ ...view, page: lastPage });
      }
    });
    (0, import_element139.useEffect)(() => {
      if (isLoading || lastPage === null || !page || page <= lastPage) {
        return;
      }
      goToLastPage();
    }, [isLoading, lastPage, page, goToLastPage]);
  }

  // packages/dataviews/build-module/dataviews-picker/index.mjs
  var import_element140 = __toESM(require_element(), 1);
  var import_compose24 = __toESM(require_compose(), 1);
  var import_jsx_runtime197 = __toESM(require_jsx_runtime(), 1);
  var isItemClickable = () => false;
  var dataViewsPickerLayouts = VIEW_LAYOUTS.filter(
    (viewLayout) => viewLayout.isPicker
  );
  var defaultGetItemId = (item) => item.id;
  var EMPTY_ARRAY5 = [];
  var DEFAULT_PICKER_LAYOUTS = {
    pickerGrid: true,
    pickerTable: true
  };
  function DefaultUI({
    search = true,
    searchLabel = void 0
  }) {
    const { view } = (0, import_element140.useContext)(dataviews_context_default);
    const isInfiniteScroll = view.infiniteScrollEnabled;
    return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_jsx_runtime197.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
        Stack,
        {
          direction: "row",
          align: "top",
          justify: "space-between",
          className: clsx_default("dataviews__view-actions", {
            "dataviews__view-actions--infinite-scroll": isInfiniteScroll
          }),
          gap: "xs",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "sm",
                justify: "start",
                className: "dataviews__search",
                children: [
                  search && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(dataviews_search_default, { label: searchLabel }),
                  /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(toggle_default, {})
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Stack, { direction: "row", gap: "xs", style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(dataviews_view_config_default, {}) })
          ]
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(filters_toggled_default, { className: "dataviews-filters__container" }),
      /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(DataViewsLayout, {}),
      /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(DataViewsPickerFooter, {})
    ] });
  }
  function DataViewsPicker({
    view,
    onChangeView,
    fields,
    search = true,
    searchLabel = void 0,
    actions = EMPTY_ARRAY5,
    data,
    getItemId = defaultGetItemId,
    isLoading = false,
    paginationInfo,
    defaultLayouts: defaultLayoutsProperty = DEFAULT_PICKER_LAYOUTS,
    selection,
    onChangeSelection,
    children,
    config = { perPageSizes: [10, 20, 50, 100] },
    itemListLabel,
    empty,
    onReset
  }) {
    const { data: displayData, setVisibleEntries } = useData({
      view,
      data,
      getItemId,
      selection,
      paginationInfo
    });
    const containerRef = (0, import_element140.useRef)(null);
    const [containerWidth, setContainerWidth] = (0, import_element140.useState)(0);
    const resizeObserverRef = (0, import_compose24.useResizeObserver)(
      (resizeObserverEntries) => {
        setContainerWidth(
          resizeObserverEntries[0].borderBoxSize[0].inlineSize
        );
      },
      { box: "border-box" }
    );
    const [openedFilter, setOpenedFilter] = (0, import_element140.useState)(null);
    function setSelectionWithChange(value) {
      const newValue = typeof value === "function" ? value(selection) : value;
      if (onChangeSelection) {
        onChangeSelection(newValue);
      }
    }
    const _fields = (0, import_element140.useMemo)(() => normalizeFields(fields), [fields]);
    const filters = use_filters_default(_fields, view);
    const hasPrimaryOrLockedFilters = (0, import_element140.useMemo)(
      () => (filters || []).some(
        (filter) => filter.isPrimary || filter.isLocked
      ),
      [filters]
    );
    const [isShowingFilter, setIsShowingFilter] = (0, import_element140.useState)(
      hasPrimaryOrLockedFilters
    );
    const { intersectionObserver } = useInfiniteScroll({
      view,
      onChangeView,
      isLoading,
      paginationInfo,
      containerRef,
      setVisibleEntries
    });
    usePageClamp({
      view,
      onChangeView,
      isLoading,
      totalPages: paginationInfo.totalPages
    });
    (0, import_element140.useEffect)(() => {
      if (hasPrimaryOrLockedFilters && !isShowingFilter) {
        setIsShowingFilter(true);
      }
    }, [hasPrimaryOrLockedFilters, isShowingFilter]);
    const defaultLayouts2 = (0, import_element140.useMemo)(
      () => Object.fromEntries(
        Object.entries(defaultLayoutsProperty).filter(([layoutType]) => {
          return dataViewsPickerLayouts.some(
            (viewLayout) => viewLayout.type === layoutType
          );
        }).map(([key, value]) => [
          key,
          value === true ? {} : value
        ])
      ),
      [defaultLayoutsProperty]
    );
    if (!defaultLayouts2[view.type]) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
      dataviews_context_default.Provider,
      {
        value: {
          view,
          onChangeView,
          fields: _fields,
          actions,
          data: displayData,
          isLoading,
          paginationInfo,
          isItemClickable,
          selection,
          onChangeSelection: setSelectionWithChange,
          openedFilter,
          setOpenedFilter,
          getItemId,
          containerWidth,
          containerRef,
          resizeObserverRef,
          defaultLayouts: defaultLayouts2,
          filters,
          isShowingFilter,
          setIsShowingFilter,
          config,
          itemListLabel,
          empty,
          onReset,
          hasInitiallyLoaded: true,
          intersectionObserver
        },
        children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("div", { className: "dataviews-picker-wrapper", children: children ?? /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(DefaultUI, { search, searchLabel }) })
      }
    );
  }
  var DataViewsPickerSubComponents = DataViewsPicker;
  DataViewsPickerSubComponents.Actions = PickerActions;
  DataViewsPickerSubComponents.BulkActionToolbar = DataViewsPickerBulkActionToolbar;
  DataViewsPickerSubComponents.Footer = DataViewsPickerFooter;
  DataViewsPickerSubComponents.Filters = filters_default;
  DataViewsPickerSubComponents.FiltersToggled = filters_toggled_default;
  DataViewsPickerSubComponents.FiltersToggle = toggle_default;
  DataViewsPickerSubComponents.Layout = DataViewsLayout;
  DataViewsPickerSubComponents.LayoutSwitcher = ViewTypeMenu;
  DataViewsPickerSubComponents.PageNavigation = DataViewsPageNavigation;
  DataViewsPickerSubComponents.PageSelect = DataViewsPageSelect;
  DataViewsPickerSubComponents.Pagination = DataViewsPagination;
  DataViewsPickerSubComponents.Search = dataviews_search_default;
  DataViewsPickerSubComponents.ViewConfig = DataviewsViewConfigDropdown;
  var dataviews_picker_default = DataViewsPickerSubComponents;

  // node_modules/dequal/dist/index.mjs
  var has = Object.prototype.hasOwnProperty;
  function find(iter, tar, key) {
    for (key of iter.keys()) {
      if (dequal(key, tar)) return key;
    }
  }
  function dequal(foo, bar) {
    var ctor, len, tmp;
    if (foo === bar) return true;
    if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
      if (ctor === Date) return foo.getTime() === bar.getTime();
      if (ctor === RegExp) return foo.toString() === bar.toString();
      if (ctor === Array) {
        if ((len = foo.length) === bar.length) {
          while (len-- && dequal(foo[len], bar[len])) ;
        }
        return len === -1;
      }
      if (ctor === Set) {
        if (foo.size !== bar.size) {
          return false;
        }
        for (len of foo) {
          tmp = len;
          if (tmp && typeof tmp === "object") {
            tmp = find(bar, tmp);
            if (!tmp) return false;
          }
          if (!bar.has(tmp)) return false;
        }
        return true;
      }
      if (ctor === Map) {
        if (foo.size !== bar.size) {
          return false;
        }
        for (len of foo) {
          tmp = len[0];
          if (tmp && typeof tmp === "object") {
            tmp = find(bar, tmp);
            if (!tmp) return false;
          }
          if (!dequal(len[1], bar.get(tmp))) {
            return false;
          }
        }
        return true;
      }
      if (ctor === ArrayBuffer) {
        foo = new Uint8Array(foo);
        bar = new Uint8Array(bar);
      } else if (ctor === DataView) {
        if ((len = foo.byteLength) === bar.byteLength) {
          while (len-- && foo.getInt8(len) === bar.getInt8(len)) ;
        }
        return len === -1;
      }
      if (ArrayBuffer.isView(foo)) {
        if ((len = foo.byteLength) === bar.byteLength) {
          while (len-- && foo[len] === bar[len]) ;
        }
        return len === -1;
      }
      if (!ctor || typeof foo === "object") {
        len = 0;
        for (ctor in foo) {
          if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
          if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
        }
        return Object.keys(bar).length === len;
      }
    }
    return foo !== foo && bar !== bar;
  }

  // packages/views/build-module/use-view.mjs
  var import_element141 = __toESM(require_element(), 1);
  var import_data7 = __toESM(require_data(), 1);
  var import_preferences = __toESM(require_preferences(), 1);

  // packages/views/build-module/preference-keys.mjs
  function generatePreferenceKey(kind, name, slug) {
    return `dataviews-${kind}-${name}-${slug}`;
  }

  // packages/views/build-module/resolve-view.mjs
  var QUERY_PARAMS = ["page", "search"];
  function isPlainObject2(value) {
    return typeof value === "object" && value !== null && !Array.isArray(value);
  }
  function withoutQueryParams(layer) {
    const result = isPlainObject2(layer) ? { ...layer } : {};
    for (const key of QUERY_PARAMS) {
      delete result[key];
    }
    return result;
  }
  function mergeLayer(lower, upper) {
    const result = { ...lower };
    for (const key of Object.keys(upper)) {
      const value = upper[key];
      const current = result[key];
      result[key] = isPlainObject2(current) && isPlainObject2(value) ? mergeLayer(current, value) : value;
    }
    return result;
  }
  function diffLayer(value, base, persisted = {}) {
    const result = {};
    for (const key of Object.keys(value)) {
      const next = value[key];
      const current = base[key];
      const prev = persisted[key];
      if (next === void 0) {
        continue;
      }
      if (isPlainObject2(next) && isPlainObject2(current)) {
        const nested = diffLayer(
          next,
          current,
          isPlainObject2(prev) ? prev : {}
        );
        if (Object.keys(nested).length > 0) {
          result[key] = nested;
        }
      } else if (!dequal(next, current)) {
        result[key] = next;
      } else if (prev !== void 0 && dequal(next, prev)) {
        result[key] = prev;
      }
    }
    return result;
  }
  function getLockedFilters(overrides) {
    return (overrides?.filters ?? []).filter((filter) => filter.isLocked);
  }
  function applyLockedFilters(view, overrides) {
    const locked = getLockedFilters(overrides);
    if (locked.length === 0) {
      return view;
    }
    const rest = (view.filters ?? []).filter(
      (filter) => !locked.some((f) => f.field === filter.field)
    );
    return { ...view, filters: [...locked, ...rest] };
  }
  function getApplicablePersistedView(persistedView, defaultLayouts2) {
    if (!persistedView || persistedView.type === void 0 || !defaultLayouts2 || defaultLayouts2[persistedView.type]) {
      return persistedView;
    }
    const { type, ...rest } = persistedView;
    return Object.keys(rest).length > 0 ? rest : void 0;
  }
  function resolveBaseView(layers, effectiveType) {
    const { defaultView: defaultView2, defaultLayouts: defaultLayouts2, activeViewOverrides } = layers;
    const layoutDefaults = defaultLayouts2?.[effectiveType];
    return applyLockedFilters(
      [layoutDefaults, activeViewOverrides].reduce(
        (lower, upper) => mergeLayer(lower, withoutQueryParams(upper)),
        withoutQueryParams(defaultView2)
      ),
      activeViewOverrides
    );
  }
  function resolveView(args) {
    const { defaultView: defaultView2, defaultLayouts: defaultLayouts2, activeViewOverrides, page, search } = args;
    const persistedView = getApplicablePersistedView(
      args.persistedView,
      defaultLayouts2
    );
    const effectiveType = persistedView?.type ?? activeViewOverrides?.type ?? defaultView2?.type;
    const baseView = resolveBaseView(args, effectiveType);
    const view = {
      ...applyLockedFilters(
        mergeLayer(baseView, withoutQueryParams(persistedView)),
        activeViewOverrides
      ),
      page: Number(page ?? 1),
      search: search ?? ""
    };
    return view;
  }
  function getUserModifications(newView, layers) {
    const { defaultLayouts: defaultLayouts2, activeViewOverrides } = layers;
    const persistedView = getApplicablePersistedView(
      layers.persistedView,
      defaultLayouts2
    );
    const baseView = resolveBaseView(layers, newView.type);
    const modifications = diffLayer(
      withoutQueryParams(newView),
      withoutQueryParams(baseView),
      withoutQueryParams(persistedView)
    );
    const locked = getLockedFilters(activeViewOverrides);
    if (locked.length > 0 && Array.isArray(modifications.filters)) {
      modifications.filters = modifications.filters.filter(
        (filter) => !locked.some((f) => f.field === filter.field)
      );
    }
    return Object.keys(modifications).length > 0 ? modifications : void 0;
  }

  // packages/views/build-module/use-view.mjs
  function useView(config) {
    const {
      kind,
      name,
      slug,
      defaultView: defaultView2,
      defaultLayouts: defaultLayouts2,
      activeViewOverrides,
      queryParams,
      onChangeQueryParams
    } = config;
    const preferenceKey = generatePreferenceKey(kind, name, slug);
    const persistedView = (0, import_data7.useSelect)(
      (select3) => {
        return select3(import_preferences.store).get(
          "core/views",
          preferenceKey
        );
      },
      [preferenceKey]
    );
    const { set } = (0, import_data7.useDispatch)(import_preferences.store);
    const page = Number(queryParams?.page ?? 1);
    const search = queryParams?.search ?? "";
    const view = (0, import_element141.useMemo)(
      () => resolveView({
        defaultView: defaultView2,
        defaultLayouts: defaultLayouts2,
        activeViewOverrides,
        persistedView,
        page,
        search
      }),
      [
        defaultView2,
        defaultLayouts2,
        activeViewOverrides,
        persistedView,
        page,
        search
      ]
    );
    const applicablePersistedView = getApplicablePersistedView(
      persistedView,
      defaultLayouts2
    );
    const isModified = !!applicablePersistedView && Object.keys(applicablePersistedView).length > 0;
    const updateView = (0, import_element141.useCallback)(
      (newView) => {
        const newQueryParams = {
          page: Number(newView?.page ?? 1),
          search: newView?.search ?? ""
        };
        if (onChangeQueryParams && !dequal(newQueryParams, { page, search })) {
          onChangeQueryParams(newQueryParams);
        }
        const modifications = getUserModifications(newView, {
          defaultView: defaultView2,
          defaultLayouts: defaultLayouts2,
          activeViewOverrides,
          persistedView
        });
        if (!dequal(modifications, persistedView)) {
          set("core/views", preferenceKey, modifications);
        }
      },
      [
        onChangeQueryParams,
        page,
        search,
        defaultView2,
        defaultLayouts2,
        activeViewOverrides,
        persistedView,
        set,
        preferenceKey
      ]
    );
    const resetToDefault = (0, import_element141.useCallback)(() => {
      set("core/views", preferenceKey, void 0);
    }, [preferenceKey, set]);
    return {
      view,
      isModified,
      updateView,
      resetToDefault
    };
  }

  // packages/views/build-module/load-view.mjs
  var import_data8 = __toESM(require_data(), 1);
  var import_preferences2 = __toESM(require_preferences(), 1);

  // packages/views/build-module/use-view-config.mjs
  var import_data9 = __toESM(require_data(), 1);
  var import_core_data2 = __toESM(require_core_data(), 1);

  // packages/views/build-module/lock-unlock.mjs
  var import_private_apis2 = __toESM(require_private_apis(), 1);
  var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
    "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
    "@wordpress/views"
  );

  // packages/media-fields/build-module/alt_text/index.mjs
  var import_i18n62 = __toESM(require_i18n(), 1);
  var import_jsx_runtime198 = __toESM(require_jsx_runtime(), 1);
  var altTextField = {
    id: "alt_text",
    type: "text",
    label: (0, import_i18n62.__)("Alt text"),
    description: /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(import_jsx_runtime198.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
        Link,
        {
          href: (
            // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
            (0, import_i18n62.__)(
              "https://www.w3.org/WAI/tutorials/images/decision-tree/"
            )
          ),
          openInNewTab: true,
          children: (0, import_i18n62.__)("Describe the purpose of the image.")
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime198.jsx)("br", {}),
      (0, import_i18n62.__)("Leave empty if decorative.")
    ] }),
    isVisible: (item) => item?.media_type === "image",
    render: ({ item }) => item?.alt_text || "-",
    Edit: {
      control: "textarea",
      rows: 2
    },
    enableSorting: false,
    filterBy: false
  };
  var alt_text_default = altTextField;

  // packages/media-fields/build-module/attached_to/index.mjs
  var import_i18n65 = __toESM(require_i18n(), 1);

  // packages/media-fields/build-module/attached_to/view.mjs
  var import_element142 = __toESM(require_element(), 1);
  var import_i18n63 = __toESM(require_i18n(), 1);

  // packages/media-fields/build-module/utils/get-rendered-content.mjs
  function getRenderedContent(content) {
    if (!content) {
      return "";
    }
    if (typeof content === "string") {
      return content;
    }
    if (typeof content === "object") {
      return content.rendered || content.raw || "";
    }
    return "";
  }

  // packages/media-fields/build-module/attached_to/view.mjs
  var import_jsx_runtime199 = __toESM(require_jsx_runtime(), 1);
  function MediaAttachedToView({
    item
  }) {
    const [attachedPostTitle, setAttachedPostTitle] = (0, import_element142.useState)(null);
    const parentId = item.post;
    const embeddedPostId = item._embedded?.["wp:attached-to"]?.[0]?.id;
    const embeddedPostTitle = item._embedded?.["wp:attached-to"]?.[0]?.title;
    (0, import_element142.useEffect)(() => {
      if (!!parentId && parentId === embeddedPostId) {
        setAttachedPostTitle(
          getRenderedContent(embeddedPostTitle) || (0, import_i18n63.__)("(no title)")
        );
      }
      if (!parentId) {
        setAttachedPostTitle((0, import_i18n63.__)("(Unattached)"));
      }
    }, [parentId, embeddedPostId, embeddedPostTitle]);
    return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(import_jsx_runtime199.Fragment, { children: attachedPostTitle });
  }

  // packages/media-fields/build-module/attached_to/edit.mjs
  var import_core_data3 = __toESM(require_core_data(), 1);
  var import_components50 = __toESM(require_components(), 1);
  var import_i18n64 = __toESM(require_i18n(), 1);
  var import_element143 = __toESM(require_element(), 1);
  var import_compose25 = __toESM(require_compose(), 1);
  var import_data10 = __toESM(require_data(), 1);
  var import_jsx_runtime200 = __toESM(require_jsx_runtime(), 1);
  function MediaAttachedToEdit({
    data,
    onChange
  }) {
    const defaultPost = !!data.post && !!data?._embedded?.["wp:attached-to"]?.[0] ? [
      {
        label: getRenderedContent(
          data._embedded?.["wp:attached-to"]?.[0]?.title
        ),
        value: data.post.toString()
      }
    ] : [];
    const [options, setOptions] = (0, import_element143.useState)(defaultPost);
    const [searchResults, setSearchResults] = (0, import_element143.useState)(
      []
    );
    const [isLoading, setIsLoading] = (0, import_element143.useState)(false);
    const [value, setValue] = (0, import_element143.useState)(
      data?.post?.toString() ?? null
    );
    const postTypes = (0, import_data10.useSelect)(
      (select3) => select3(import_core_data3.store).getPostTypes(),
      []
    );
    const handleDetach = () => {
      onChange({
        post: 0,
        _embedded: { ...data?._embedded, "wp:attached-to": void 0 }
      });
      setValue(null);
    };
    const onValueChange = async (filterValue) => {
      setIsLoading(true);
      const results = await (0, import_core_data3.__experimentalFetchLinkSuggestions)(
        filterValue,
        /*
         * @TODO `fetchLinkSuggestions()` should accept `perPage` as an option argument.
         * `isInitialSuggestions` limits the result to 3, otherwise it's hardcoded to 20.
         */
        { type: "post", isInitialSuggestions: true },
        {}
      );
      setSearchResults(results);
      const suggestions = results.map((result) => {
        return {
          label: result.title,
          value: result.id.toString()
        };
      });
      const includeCurrent = !filterValue && suggestions.findIndex((s) => s.value === value) === -1;
      setOptions(suggestions.concat(includeCurrent ? defaultPost : []));
      setIsLoading(false);
    };
    const debouncedValueChange = (0, import_compose25.useDebounce)((0, import_compose25.useEvent)(onValueChange), 300);
    const handleSelectOption = (selectedPostId) => {
      if (!selectedPostId) {
        handleDetach();
        return;
      }
      setValue(selectedPostId);
      if (selectedPostId) {
        const selectedPost = searchResults.find(
          (result) => result.id === Number(selectedPostId)
        );
        if (selectedPost && postTypes) {
          const postType = postTypes.find(
            (_postType) => _postType.slug === selectedPost?.type
          );
          const attachedTo = {
            ...postType && { type: postType.slug },
            id: Number(selectedPostId),
            title: {
              raw: selectedPost.title,
              rendered: selectedPost.title
            }
          };
          onChange({
            post: Number(selectedPostId),
            _embedded: {
              ...data?._embedded,
              "wp:attached-to": [attachedTo]
            }
          });
        }
      }
    };
    return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
      import_components50.ComboboxControl,
      {
        className: "dataviews-media-field__attached-to",
        isLoading,
        label: (0, import_i18n64.__)("Attached to"),
        help: (0, import_i18n64.__)("Attach this file to a single post or page."),
        value,
        options,
        onFilterValueChange: (filterValue) => debouncedValueChange(filterValue),
        onChange: handleSelectOption,
        hideLabelFromVision: true,
        expandOnFocus: false
      }
    );
  }

  // packages/media-fields/build-module/attached_to/index.mjs
  var attachedToField = {
    id: "attached_to",
    type: "text",
    label: (0, import_i18n65.__)("Attached to"),
    Edit: MediaAttachedToEdit,
    render: MediaAttachedToView,
    enableSorting: false,
    filterBy: false
  };
  var attached_to_default = attachedToField;

  // packages/media-fields/build-module/author/index.mjs
  var import_i18n67 = __toESM(require_i18n(), 1);
  var import_data11 = __toESM(require_data(), 1);
  var import_core_data4 = __toESM(require_core_data(), 1);

  // packages/media-fields/build-module/author/view.mjs
  var import_i18n66 = __toESM(require_i18n(), 1);
  var import_element144 = __toESM(require_element(), 1);
  var import_components51 = __toESM(require_components(), 1);
  var import_jsx_runtime201 = __toESM(require_jsx_runtime(), 1);
  function AuthorView({
    item
  }) {
    const author = item?._embedded?.author?.[0];
    const text = author?.name;
    const imageUrl = author?.avatar_urls?.[48];
    const [loadingState, setLoadingState] = (0, import_element144.useState)("loading");
    (0, import_element144.useEffect)(() => {
      setLoadingState("loading");
    }, [imageUrl]);
    const imgRef = (0, import_element144.useCallback)((img) => {
      if (img?.complete) {
        setLoadingState("instant");
      }
    }, []);
    const handleLoad = () => {
      if (loadingState === "loading") {
        setLoadingState("loaded");
      }
    };
    return /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(import_components51.__experimentalHStack, { alignment: "left", spacing: 0, children: [
      !!imageUrl && /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
        "div",
        {
          className: clsx_default("media-author-field__avatar", {
            "is-loading": loadingState === "loading",
            "is-loaded": loadingState === "loaded"
          }),
          children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
            "img",
            {
              ref: imgRef,
              onLoad: handleLoad,
              alt: (0, import_i18n66.__)("Author avatar"),
              src: imageUrl
            }
          )
        }
      ),
      !imageUrl && /* @__PURE__ */ (0, import_jsx_runtime201.jsx)("div", { className: "media-author-field__icon", children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(import_components51.Icon, { icon: comment_author_avatar_default }) }),
      /* @__PURE__ */ (0, import_jsx_runtime201.jsx)("span", { className: "media-author-field__name", children: text })
    ] });
  }

  // packages/media-fields/build-module/author/index.mjs
  var authorField = {
    label: (0, import_i18n67.__)("Author"),
    id: "author",
    type: "integer",
    getElements: async () => {
      const authors = await (0, import_data11.resolveSelect)(import_core_data4.store).getEntityRecords(
        "root",
        "user",
        {
          per_page: -1,
          who: "authors",
          _fields: "id,name",
          context: "view"
        }
      ) ?? [];
      return authors.map(({ id, name }) => ({
        value: id,
        label: name
      }));
    },
    render: AuthorView,
    filterBy: {
      operators: ["isAny", "isNone"]
    },
    readOnly: true
  };
  var author_default = authorField;

  // packages/media-fields/build-module/caption/index.mjs
  var import_i18n68 = __toESM(require_i18n(), 1);

  // packages/media-fields/build-module/utils/get-raw-content.mjs
  function getRawContent(content) {
    if (!content) {
      return "";
    }
    if (typeof content === "string") {
      return content;
    }
    if (typeof content === "object" && "raw" in content) {
      return content.raw || "";
    }
    return "";
  }

  // packages/media-fields/build-module/caption/index.mjs
  var captionField = {
    id: "caption",
    type: "text",
    label: (0, import_i18n68.__)("Caption"),
    getValue: ({ item }) => getRawContent(item?.caption),
    render: ({ item }) => getRawContent(item?.caption) || "-",
    Edit: {
      control: "textarea",
      rows: 2
    },
    enableSorting: false,
    filterBy: false
  };
  var caption_default = captionField;

  // packages/media-fields/build-module/date_added/index.mjs
  var import_i18n69 = __toESM(require_i18n(), 1);
  var dateAddedField = {
    id: "date",
    type: "datetime",
    label: (0, import_i18n69.__)("Date added"),
    filterBy: {
      operators: ["before", "after"]
    },
    readOnly: true
  };
  var date_added_default = dateAddedField;

  // packages/media-fields/build-module/date_modified/index.mjs
  var import_i18n70 = __toESM(require_i18n(), 1);
  var dateModifiedField = {
    id: "modified",
    type: "datetime",
    label: (0, import_i18n70.__)("Date modified"),
    filterBy: {
      operators: ["before", "after"]
    },
    readOnly: true
  };
  var date_modified_default = dateModifiedField;

  // packages/media-fields/build-module/description/index.mjs
  var import_i18n71 = __toESM(require_i18n(), 1);
  var import_jsx_runtime202 = __toESM(require_jsx_runtime(), 1);
  var descriptionField = {
    id: "description",
    type: "text",
    label: (0, import_i18n71.__)("Description"),
    getValue: ({ item }) => getRawContent(item?.description),
    render: ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime202.jsx)("div", { children: getRawContent(item?.description) || "-" }),
    Edit: {
      control: "textarea",
      rows: 5
    },
    enableSorting: false,
    filterBy: false
  };
  var description_default = descriptionField;

  // packages/media-fields/build-module/filename/index.mjs
  var import_i18n72 = __toESM(require_i18n(), 1);
  var import_url4 = __toESM(require_url(), 1);

  // packages/media-fields/build-module/filename/view.mjs
  var import_element145 = __toESM(require_element(), 1);
  var import_url3 = __toESM(require_url(), 1);
  var import_jsx_runtime203 = __toESM(require_jsx_runtime(), 1);
  var TRUNCATE_LENGTH = 15;
  function FileNameView({
    item
  }) {
    const fileName = (0, import_element145.useMemo)(
      () => item?.source_url ? (0, import_url3.getFilename)(item.source_url) : null,
      [item?.source_url]
    );
    if (!fileName) {
      return "";
    }
    if (fileName.length <= TRUNCATE_LENGTH) {
      return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("span", { className: "dataviews-media-field__filename", children: fileName });
    }
    return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(tooltip_exports.Root, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
        tooltip_exports.Trigger,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("span", { className: "dataviews-media-field__filename", children: fileName })
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(tooltip_exports.Popup, { children: fileName })
    ] });
  }

  // packages/media-fields/build-module/filename/index.mjs
  var filenameField = {
    id: "filename",
    type: "text",
    label: (0, import_i18n72.__)("File name"),
    getValue: ({ item }) => (0, import_url4.getFilename)(item?.source_url || ""),
    render: FileNameView,
    enableSorting: false,
    filterBy: false,
    readOnly: true
  };
  var filename_default = filenameField;

  // packages/media-fields/build-module/filesize/index.mjs
  var import_i18n73 = __toESM(require_i18n(), 1);
  var KB_IN_BYTES = 1024;
  var MB_IN_BYTES = 1024 * KB_IN_BYTES;
  var GB_IN_BYTES = 1024 * MB_IN_BYTES;
  var TB_IN_BYTES = 1024 * GB_IN_BYTES;
  var PB_IN_BYTES = 1024 * TB_IN_BYTES;
  var EB_IN_BYTES = 1024 * PB_IN_BYTES;
  var ZB_IN_BYTES = 1024 * EB_IN_BYTES;
  var YB_IN_BYTES = 1024 * ZB_IN_BYTES;
  function getBytesString(bytes, unitSymbol, decimals = 2) {
    return (0, import_i18n73.sprintf)(
      // translators: 1: Actual bytes of a file. 2: The unit symbol (e.g. MB).
      (0, import_i18n73._x)("%1$s %2$s", "file size"),
      bytes.toLocaleString(void 0, {
        minimumFractionDigits: 0,
        maximumFractionDigits: decimals
      }),
      unitSymbol
    );
  }
  function formatFileSize(bytes, decimals = 2) {
    if (bytes === 0) {
      return getBytesString(0, (0, import_i18n73._x)("B", "unit symbol"), decimals);
    }
    const quant = {
      /* translators: Unit symbol for yottabyte. */
      [(0, import_i18n73._x)("YB", "unit symbol")]: YB_IN_BYTES,
      /* translators: Unit symbol for zettabyte. */
      [(0, import_i18n73._x)("ZB", "unit symbol")]: ZB_IN_BYTES,
      /* translators: Unit symbol for exabyte. */
      [(0, import_i18n73._x)("EB", "unit symbol")]: EB_IN_BYTES,
      /* translators: Unit symbol for petabyte. */
      [(0, import_i18n73._x)("PB", "unit symbol")]: PB_IN_BYTES,
      /* translators: Unit symbol for terabyte. */
      [(0, import_i18n73._x)("TB", "unit symbol")]: TB_IN_BYTES,
      /* translators: Unit symbol for gigabyte. */
      [(0, import_i18n73._x)("GB", "unit symbol")]: GB_IN_BYTES,
      /* translators: Unit symbol for megabyte. */
      [(0, import_i18n73._x)("MB", "unit symbol")]: MB_IN_BYTES,
      /* translators: Unit symbol for kilobyte. */
      [(0, import_i18n73._x)("KB", "unit symbol")]: KB_IN_BYTES,
      /* translators: Unit symbol for byte. */
      [(0, import_i18n73._x)("B", "unit symbol")]: 1
    };
    for (const [unit, mag] of Object.entries(quant)) {
      if (bytes >= mag) {
        return getBytesString(bytes / mag, unit, decimals);
      }
    }
    return "";
  }
  var filesizeField = {
    id: "filesize",
    type: "text",
    label: (0, import_i18n73.__)("File size"),
    getValue: ({ item }) => item?.media_details?.filesize ? formatFileSize(item?.media_details?.filesize) : "",
    isVisible: (item) => {
      return !!item?.media_details?.filesize;
    },
    enableSorting: false,
    filterBy: false,
    readOnly: true
  };
  var filesize_default = filesizeField;

  // packages/media-fields/build-module/media_dimensions/index.mjs
  var import_i18n74 = __toESM(require_i18n(), 1);
  var mediaDimensionsField = {
    id: "media_dimensions",
    type: "text",
    label: (0, import_i18n74.__)("Dimensions"),
    getValue: ({ item }) => item?.media_details?.width && item?.media_details?.height ? (0, import_i18n74.sprintf)(
      // translators: 1: Width. 2: Height.
      (0, import_i18n74._x)("%1$s \xD7 %2$s", "image dimensions"),
      item?.media_details?.width?.toString(),
      item?.media_details?.height?.toString()
    ) : "",
    isVisible: (item) => {
      return !!(item?.media_details?.width && item?.media_details?.height);
    },
    enableSorting: false,
    filterBy: false,
    readOnly: true
  };
  var media_dimensions_default = mediaDimensionsField;

  // packages/media-fields/build-module/media_thumbnail/index.mjs
  var import_i18n76 = __toESM(require_i18n(), 1);

  // packages/media-fields/build-module/media_thumbnail/view.mjs
  var import_data12 = __toESM(require_data(), 1);
  var import_core_data5 = __toESM(require_core_data(), 1);
  var import_components52 = __toESM(require_components(), 1);
  var import_element146 = __toESM(require_element(), 1);
  var import_url5 = __toESM(require_url(), 1);

  // packages/media-fields/build-module/utils/get-media-type-from-mime-type.mjs
  var import_i18n75 = __toESM(require_i18n(), 1);
  function getMediaTypeFromMimeType(mimeType) {
    if (mimeType.startsWith("image/")) {
      return {
        type: "image",
        label: (0, import_i18n75.__)("Image"),
        icon: image_default
      };
    }
    if (mimeType.startsWith("video/")) {
      return {
        type: "video",
        label: (0, import_i18n75.__)("Video"),
        icon: video_default
      };
    }
    if (mimeType.startsWith("audio/")) {
      return {
        type: "audio",
        label: (0, import_i18n75.__)("Audio"),
        icon: audio_default
      };
    }
    return {
      type: "application",
      label: (0, import_i18n75.__)("Application"),
      icon: file_default
    };
  }

  // packages/media-fields/build-module/media_thumbnail/view.mjs
  var import_jsx_runtime204 = __toESM(require_jsx_runtime(), 1);
  function getBestImageUrl(featuredMedia, configSizes) {
    const sizes = featuredMedia?.media_details?.sizes;
    if (!sizes) {
      return featuredMedia.source_url;
    }
    const sizeEntries = Object.values(sizes);
    if (!sizeEntries.length) {
      return featuredMedia.source_url;
    }
    const targetWidth = configSizes ? parseInt(configSizes, 10) : NaN;
    if (!Number.isNaN(targetWidth)) {
      const validEntries = sizeEntries.filter(
        (s) => typeof s.width === "number" && !Number.isNaN(s.width)
      );
      if (!validEntries.length) {
        return featuredMedia.source_url;
      }
      const sorted = [...validEntries].sort(
        (a, b) => a.width - b.width
      );
      const match2 = sorted.find((s) => s.width >= targetWidth);
      if (match2) {
        return match2.source_url;
      }
      return sorted[sorted.length - 1].source_url;
    }
    return featuredMedia.source_url;
  }
  function FallbackView({
    item,
    filename
  }) {
    return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("div", { className: "dataviews-media-field__media-thumbnail", children: /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
      import_components52.__experimentalVStack,
      {
        justify: "center",
        alignment: "center",
        className: "dataviews-media-field__media-thumbnail__stack",
        spacing: 0,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
            import_components52.Icon,
            {
              className: "dataviews-media-field__media-thumbnail--icon",
              icon: getMediaTypeFromMimeType(item.mime_type).icon,
              size: 24
            }
          ),
          !!filename && /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("div", { className: "dataviews-media-field__media-thumbnail__filename", children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_components52.__experimentalTruncate, { className: "dataviews-media-field__media-thumbnail__filename__truncate", children: filename }) })
        ]
      }
    ) });
  }
  function ImageView({
    item,
    configSizes,
    onError
  }) {
    const imageUrl = getBestImageUrl(item, configSizes);
    const imgRef = (0, import_element146.useRef)(null);
    const [loadingState, setLoadingState] = (0, import_element146.useState)("loading");
    (0, import_element146.useLayoutEffect)(() => {
      if (imgRef.current?.complete) {
        setLoadingState("instant");
      } else {
        setLoadingState("loading");
      }
    }, [imageUrl]);
    const handleLoad = () => {
      if (loadingState === "loading") {
        setLoadingState("loaded");
      }
    };
    return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
      "div",
      {
        className: clsx_default("dataviews-media-field__media-thumbnail", {
          "is-loading": loadingState === "loading",
          "is-loaded": loadingState === "loaded"
        }),
        children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
          "img",
          {
            ref: imgRef,
            className: "dataviews-media-field__media-thumbnail--image",
            src: imageUrl,
            alt: item.alt_text || item.title.raw,
            onLoad: handleLoad,
            onError,
            loading: "lazy"
          }
        )
      }
    );
  }
  function MediaThumbnailView({
    item,
    config
  }) {
    const [imageError, setImageError] = (0, import_element146.useState)(false);
    const _featuredMedia = (0, import_data12.useSelect)(
      (select3) => {
        if (!item.featured_media) {
          return;
        }
        return select3(import_core_data5.store).getEntityRecord(
          "postType",
          "attachment",
          item.featured_media
        );
      },
      [item.featured_media]
    );
    const featuredMedia = item.featured_media ? _featuredMedia : item;
    if (!featuredMedia) {
      return null;
    }
    const filename = (0, import_url5.getFilename)(featuredMedia.source_url || "");
    if (imageError || getMediaTypeFromMimeType(featuredMedia.mime_type).type !== "image") {
      return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(FallbackView, { item: featuredMedia, filename: filename || "" });
    }
    return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
      ImageView,
      {
        item: featuredMedia,
        configSizes: config?.sizes,
        onError: () => setImageError(true)
      }
    );
  }

  // packages/media-fields/build-module/media_thumbnail/index.mjs
  var mediaThumbnailField = {
    id: "media_thumbnail",
    type: "media",
    label: (0, import_i18n76.__)("Thumbnail"),
    render: MediaThumbnailView,
    enableSorting: false,
    filterBy: false
  };
  var media_thumbnail_default = mediaThumbnailField;

  // packages/media-fields/build-module/mime_type/index.mjs
  var import_i18n77 = __toESM(require_i18n(), 1);
  var mimeTypeField = {
    id: "mime_type",
    type: "text",
    label: (0, import_i18n77.__)("File type"),
    getValue: ({ item }) => item?.mime_type || "",
    render: ({ item }) => item?.mime_type || "-",
    // Disable sorting until REST API support for ordering my `mime_type` is added.
    // See: https://core.trac.wordpress.org/ticket/64073
    enableSorting: false,
    filterBy: false,
    readOnly: true
  };
  var mime_type_default = mimeTypeField;

  // packages/media-utils/build-module/components/media-upload-modal/index.mjs
  var import_notices = __toESM(require_notices(), 1);

  // packages/media-utils/build-module/lock-unlock.mjs
  var import_private_apis3 = __toESM(require_private_apis(), 1);
  var { lock: lock3, unlock: unlock3 } = (0, import_private_apis3.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
    "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
    "@wordpress/media-utils"
  );

  // packages/media-utils/build-module/components/media-upload-modal/upload-status-popover.mjs
  var import_element147 = __toESM(require_element(), 1);
  var import_i18n78 = __toESM(require_i18n(), 1);
  var import_components53 = __toESM(require_components(), 1);
  var import_jsx_runtime205 = __toESM(require_jsx_runtime(), 1);
  function UploadStatusPopover({
    uploadingFiles,
    onDismissError,
    onOpenChange
  }) {
    const [isOpen, setIsOpen] = (0, import_element147.useState)(false);
    const [prevHadErrors, setPrevHadErrors] = (0, import_element147.useState)(false);
    const triggerRef = (0, import_element147.useRef)(null);
    const updateIsOpen = (0, import_element147.useCallback)(
      (open2) => {
        setIsOpen(open2);
        onOpenChange?.(open2);
      },
      [onOpenChange]
    );
    const activeFiles = uploadingFiles.filter(
      (file) => file.status === "uploading"
    );
    const errorFiles = uploadingFiles.filter(
      (file) => file.status === "error"
    );
    const hasErrors = errorFiles.length > 0;
    const isUploading = activeFiles.length > 0;
    (0, import_element147.useEffect)(() => {
      if (hasErrors && !prevHadErrors) {
        updateIsOpen(true);
      }
      setPrevHadErrors(hasErrors);
    }, [hasErrors, prevHadErrors, updateIsOpen]);
    if (uploadingFiles.length === 0) {
      return null;
    }
    let buttonLabel, popoverHeading;
    if (isUploading) {
      buttonLabel = (0, import_i18n78.sprintf)(
        // translators: %s: number of files being uploaded
        (0, import_i18n78._n)("Uploading %s file", "Uploading %s files", activeFiles.length),
        activeFiles.length.toLocaleString()
      );
      popoverHeading = (0, import_i18n78.__)("Uploading");
    } else if (hasErrors) {
      buttonLabel = (0, import_i18n78.sprintf)(
        // translators: %s: number of upload errors
        (0, import_i18n78._n)("%s upload error", "%s upload errors", errorFiles.length),
        errorFiles.length.toLocaleString()
      );
      popoverHeading = (0, import_i18n78.__)("Upload errors");
    } else {
      buttonLabel = (0, import_i18n78.__)("Upload complete");
      popoverHeading = (0, import_i18n78.__)("Upload complete");
    }
    return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)("div", { className: "media-upload-modal__upload-status", children: [
      isUploading && /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(import_components53.Spinner, {}),
      /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
        import_components53.Button,
        {
          className: "media-upload-modal__upload-status__trigger",
          size: "compact",
          icon: chevron_down_default,
          iconPosition: "right",
          onClick: () => updateIsOpen(!isOpen),
          "aria-expanded": isOpen,
          ref: triggerRef,
          children: buttonLabel
        }
      ),
      isOpen && /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(
        import_components53.Popover,
        {
          className: "media-upload-modal__upload-status__popover",
          placement: "top-start",
          offset: 8,
          anchor: triggerRef.current,
          focusOnMount: true,
          onClose: () => {
            if (triggerRef.current?.contains(
              triggerRef.current.ownerDocument.activeElement
            )) {
              return;
            }
            updateIsOpen(false);
          },
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("div", { className: "media-upload-modal__upload-status__header", children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("h3", { children: popoverHeading }) }),
            /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("ul", { className: "media-upload-modal__upload-status__list", children: uploadingFiles.map((file) => /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(
              "li",
              {
                className: "media-upload-modal__upload-status__item",
                children: [
                  file.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(import_components53.Spinner, {}),
                  file.status === "uploaded" && /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(import_components53.Icon, { icon: check_default, size: 16 }),
                  (file.status === "uploading" || file.status === "uploaded") && /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
                    "span",
                    {
                      className: "media-upload-modal__upload-status__filename",
                      title: file.name,
                      children: file.name
                    }
                  ),
                  file.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(
                    import_components53.Notice,
                    {
                      status: "error",
                      isDismissible: !!onDismissError,
                      onRemove: () => onDismissError?.(file.id),
                      children: [
                        file.name,
                        ": ",
                        file.error
                      ]
                    }
                  )
                ]
              },
              file.id
            )) })
          ]
        }
      )
    ] });
  }

  // packages/media-utils/build-module/components/media-upload-modal/use-invalidate-attachment-resolutions.mjs
  var import_element148 = __toESM(require_element(), 1);
  var import_data13 = __toESM(require_data(), 1);
  function useInvalidateAttachmentResolutions() {
    const registry = (0, import_data13.useRegistry)();
    return (0, import_element148.useCallback)(
      () => invalidateAttachmentResolutions(registry),
      [registry]
    );
  }

  // packages/media-utils/build-module/components/media-upload-modal/use-upload-status.mjs
  var import_element149 = __toESM(require_element(), 1);
  var import_blob2 = __toESM(require_blob(), 1);
  var idCounter = 0;
  var batchIdCounter = 0;
  function useUploadStatus({
    onBatchComplete
  } = {}) {
    const [uploadingFiles, setUploadingFiles] = (0, import_element149.useState)(
      []
    );
    const clearCompleted = (0, import_element149.useCallback)(() => {
      setUploadingFiles(
        (prev) => prev.filter((item) => item.status !== "uploaded")
      );
    }, []);
    const dismissError = (0, import_element149.useCallback)((fileId) => {
      setUploadingFiles(
        (prev) => prev.filter((item) => item.id !== fileId)
      );
    }, []);
    const registerBatch = (0, import_element149.useCallback)(
      (files) => {
        const batchId = String(++batchIdCounter);
        const batchSize = files.length;
        const newEntries = files.map((file) => ({
          id: String(++idCounter),
          batchId,
          name: file.name,
          status: "uploading"
        }));
        setUploadingFiles((prev) => [...prev, ...newEntries]);
        let successCount = 0;
        let errorCount = 0;
        let batchDone = false;
        let successAttachments = [];
        const completeBatchIfDone = () => {
          if (batchDone || successCount + errorCount < batchSize) {
            return;
          }
          batchDone = true;
          setUploadingFiles(
            (prev) => prev.map(
              (item) => item.batchId === batchId && item.status === "uploading" ? {
                ...item,
                status: "uploaded"
              } : item
            )
          );
          onBatchComplete?.(successAttachments);
        };
        const onFileChange = (attachments) => {
          if (batchDone) {
            return;
          }
          const allReal = attachments.every(
            (attachment) => attachment.id && attachment.url && !(0, import_blob2.isBlobURL)(attachment.url)
          );
          if (!allReal) {
            return;
          }
          successCount = attachments.length;
          successAttachments = attachments;
          completeBatchIfDone();
        };
        const onError = (error2) => {
          const fileName = error2 instanceof UploadError ? error2.file.name : void 0;
          setUploadingFiles((prev) => {
            let matched = false;
            return prev.map((item) => {
              if (!matched && item.batchId === batchId && item.status === "uploading" && (!fileName || item.name === fileName)) {
                matched = true;
                return {
                  ...item,
                  status: "error",
                  error: error2.message
                };
              }
              return item;
            });
          });
          errorCount++;
          completeBatchIfDone();
        };
        return { onFileChange, onError };
      },
      [onBatchComplete]
    );
    const allComplete = uploadingFiles.length > 0 && uploadingFiles.every((item) => item.status !== "uploading");
    return {
      uploadingFiles,
      registerBatch,
      dismissError,
      clearCompleted,
      allComplete
    };
  }

  // packages/media-utils/build-module/components/media-upload-modal/index.mjs
  var import_jsx_runtime206 = __toESM(require_jsx_runtime(), 1);
  var { useEntityRecordsWithPermissions } = unlock3(import_core_data6.privateApis);
  var LAYOUT_PICKER_GRID2 = "pickerGrid";
  var LAYOUT_PICKER_TABLE2 = "pickerTable";
  var NOTICES_CONTEXT = "media-modal";
  var NOTICE_ID_UPLOAD_PROGRESS = "media-modal-upload-progress";
  var ATTACHED_TO_FIELD = "attached_to";
  var defaultQueryParams = {
    page: 1,
    search: ""
  };
  function getSelectionFromValue(value) {
    if (!value) {
      return [];
    }
    return Array.isArray(value) ? value.map(String) : [String(value)];
  }
  var defaultView = {
    type: LAYOUT_PICKER_GRID2,
    fields: [],
    showTitle: false,
    titleField: "title",
    mediaField: "media_thumbnail",
    perPage: 50,
    filters: [],
    layout: {
      previewSize: 170,
      density: "compact",
      // Fit each thumbnail inside its square cell rather than cropping it,
      // so the media's own orientation is visible before it's inserted.
      // Users can switch back to cropped in the view options.
      mediaFit: "contain"
    }
  };
  var defaultLayouts = {
    [LAYOUT_PICKER_GRID2]: {
      fields: [],
      showTitle: false,
      layout: {
        previewSize: 170,
        density: "compact",
        mediaFit: "contain"
      }
    },
    [LAYOUT_PICKER_TABLE2]: {
      fields: [
        "filename",
        "filesize",
        "media_dimensions",
        "author",
        "date"
      ],
      showTitle: true
    }
  };
  var dataViewsConfig = {
    // Repeats `DataViewsPicker`'s own default, which passing `config` at all
    // would otherwise replace.
    perPageSizes: [10, 20, 50, 100],
    // Seeing whether a media item is portrait or landscape before inserting
    // it matters here, so offer the crop/fit switch in the view options.
    mediaFitControl: true
  };
  function MediaUploadModal({
    allowedTypes,
    multiple = false,
    value,
    onSelect,
    onClose,
    onUpload,
    title = (0, import_i18n79.__)("Select Media"),
    isOpen,
    isDismissible = true,
    modalClass,
    search = true,
    searchLabel = (0, import_i18n79.__)("Search media"),
    postId,
    postType
  }) {
    const attachedToPostId = Number.isInteger(postId) ? postId : void 0;
    const uploadedToLabel = (0, import_data14.useSelect)(
      (select3) => attachedToPostId && postType ? select3(import_core_data6.store).getPostType(postType)?.labels?.uploaded_to_this_item : void 0,
      [attachedToPostId, postType]
    );
    const [selection, setSelection] = (0, import_element150.useState)(
      () => getSelectionFromValue(value)
    );
    const { createSuccessNotice, removeAllNotices } = (0, import_data14.useDispatch)(import_notices.store);
    const invalidateAttachmentResolutions2 = useInvalidateAttachmentResolutions();
    const [queryParams, setQueryParams] = (0, import_element150.useState)(
      () => defaultQueryParams
    );
    const {
      view: persistedView,
      updateView,
      isModified,
      resetToDefault
    } = useView({
      kind: "postType",
      name: "attachment",
      slug: "media-modal",
      defaultView,
      queryParams,
      onChangeQueryParams: setQueryParams
    });
    const [attachedToFilter, setAttachedToFilter] = (0, import_element150.useState)();
    const view = (0, import_element150.useMemo)(() => {
      const filters = (persistedView.filters ?? []).filter(
        ({ field }) => field !== ATTACHED_TO_FIELD
      );
      return {
        ...persistedView,
        filters: attachedToFilter ? [...filters, attachedToFilter] : filters
      };
    }, [persistedView, attachedToFilter]);
    const handleChangeView = (0, import_element150.useCallback)(
      (nextView) => {
        const normalizedView = { ...nextView };
        if (normalizedView.startPosition === void 0) {
          delete normalizedView.startPosition;
        }
        setAttachedToFilter(
          normalizedView.filters?.find(
            ({ field }) => field === ATTACHED_TO_FIELD
          )
        );
        updateView({
          ...normalizedView,
          filters: normalizedView.filters?.filter(
            ({ field }) => field !== ATTACHED_TO_FIELD
          )
        });
      },
      [updateView]
    );
    const handleReset = (0, import_element150.useCallback)(() => {
      setAttachedToFilter(void 0);
      resetToDefault();
    }, [resetToDefault]);
    const queryArgs = (0, import_element150.useMemo)(() => {
      const filters = {};
      view.filters?.forEach((filter) => {
        if (filter.field === "media_type") {
          filters.media_type = filter.value;
        }
        if (filter.field === "author") {
          if (filter.operator === "isAny") {
            filters.author = filter.value;
          } else if (filter.operator === "isNone") {
            filters.author_exclude = filter.value;
          }
        }
        if (filter.field === "date" || filter.field === "modified") {
          if (filter.operator === "before") {
            filters.before = filter.value;
          } else if (filter.operator === "after") {
            filters.after = filter.value;
          }
        }
        if (filter.field === "mime_type") {
          filters.mime_type = filter.value;
        }
        if (filter.field === ATTACHED_TO_FIELD && filter.operator === "isAny") {
          const parents = (Array.isArray(filter.value) ? filter.value : []).map((optionValue) => {
            if (optionValue === "unattached") {
              return 0;
            }
            return optionValue === "current" ? attachedToPostId : void 0;
          }).filter((parent) => parent !== void 0);
          if (parents.length) {
            filters.parent = parents;
          }
        }
      });
      if (!filters.media_type && !filters.mime_type && allowedTypes && !allowedTypes.includes("*")) {
        const { mediaTypes, mimeTypes } = allowedTypes.reduce(
          (acc, type) => {
            if (type.endsWith("/*")) {
              acc.mediaTypes.push(type.replace("/*", ""));
            } else if (type.includes("/")) {
              acc.mimeTypes.push(type);
            } else {
              acc.mediaTypes.push(type);
            }
            return acc;
          },
          { mediaTypes: [], mimeTypes: [] }
        );
        if (mediaTypes.length) {
          filters.media_type = mediaTypes;
        }
        if (mimeTypes.length) {
          filters.mime_type = mimeTypes;
        }
      }
      return {
        per_page: view.perPage || 20,
        page: view.page || 1,
        status: "inherit",
        order: view.sort?.direction,
        orderby: view.sort?.field,
        search: view.search,
        _embed: "author,wp:attached-to",
        ...filters
      };
    }, [view, allowedTypes, attachedToPostId]);
    const handleBatchComplete = (0, import_element150.useCallback)(
      (attachments) => {
        const uploadedIds = attachments.map((attachment) => String(attachment.id)).filter(Boolean);
        if (multiple) {
          setSelection((prev) => {
            const existing = new Set(prev);
            const newIds = uploadedIds.filter(
              (id) => !existing.has(id)
            );
            return [...prev, ...newIds];
          });
        } else {
          setSelection(uploadedIds.slice(0, 1));
        }
        invalidateAttachmentResolutions2();
      },
      [multiple, invalidateAttachmentResolutions2]
    );
    const {
      uploadingFiles,
      registerBatch,
      dismissError,
      clearCompleted,
      allComplete
    } = useUploadStatus({ onBatchComplete: handleBatchComplete });
    const isPopoverOpenRef = (0, import_element150.useRef)(false);
    const handlePopoverOpenChange = (0, import_element150.useCallback)(
      (open2) => {
        isPopoverOpenRef.current = open2;
        if (!open2) {
          clearCompleted();
        }
      },
      [clearCompleted]
    );
    const {
      records: mediaRecords,
      isResolving: isLoading,
      totalItems,
      totalPages
    } = useEntityRecordsWithPermissions("postType", "attachment", queryArgs);
    const fields = (0, import_element150.useMemo)(
      () => [
        // Media field definitions from @wordpress/media-fields
        // Cast is safe because RestAttachment has the same properties as Attachment
        {
          ...media_thumbnail_default,
          enableHiding: false
          // Within the modal, the thumbnail should always be shown.
        },
        {
          id: "title",
          type: "text",
          label: (0, import_i18n79.__)("Title"),
          getValue: ({ item }) => {
            const titleValue = item.title.raw || item.title.rendered;
            return titleValue || (0, import_i18n79.__)("(no title)");
          }
        },
        alt_text_default,
        caption_default,
        description_default,
        date_added_default,
        date_modified_default,
        author_default,
        filename_default,
        filesize_default,
        media_dimensions_default,
        mime_type_default,
        {
          ...attached_to_default,
          // The shared field definition is not filterable, because the
          // "Uploaded to this post" option only makes sense with the modal's
          // post context. Values name options, and `queryArgs` above
          // translates them to `parent`.
          elements: [
            ...attachedToPostId ? [
              {
                value: "current",
                label: uploadedToLabel ?? (0, import_i18n79.__)("Uploaded to this item")
              }
            ] : [],
            {
              value: "unattached",
              label: (0, import_i18n79._x)("Unattached", "media items")
            }
          ],
          filterBy: { operators: ["isAny"] }
        }
      ],
      [attachedToPostId, uploadedToLabel]
    );
    const actions = (0, import_element150.useMemo)(
      () => [
        {
          id: "select",
          label: (0, import_i18n79.__)("Select"),
          isPrimary: true,
          supportsBulk: multiple,
          async callback() {
            if (selection.length === 0) {
              return;
            }
            const selectedPostsQuery = {
              include: selection,
              per_page: -1
            };
            const selectedPosts = await (0, import_data14.resolveSelect)(
              import_core_data6.store
            ).getEntityRecords(
              "postType",
              "attachment",
              selectedPostsQuery
            );
            const transformedPosts = (selectedPosts ?? []).map(transformAttachment).filter(Boolean);
            const selectedItems = multiple ? transformedPosts : transformedPosts?.[0];
            removeAllNotices("snackbar", NOTICES_CONTEXT);
            onSelect(selectedItems);
          }
        }
      ],
      [multiple, onSelect, selection, removeAllNotices]
    );
    const handleModalClose = (0, import_element150.useCallback)(() => {
      removeAllNotices("snackbar", NOTICES_CONTEXT);
      onClose?.();
    }, [removeAllNotices, onClose]);
    const valueRef = (0, import_element150.useRef)(value);
    (0, import_element150.useEffect)(() => {
      valueRef.current = value;
    }, [value]);
    (0, import_element150.useEffect)(() => {
      if (isOpen) {
        setSelection(getSelectionFromValue(valueRef.current));
      } else {
        setQueryParams(defaultQueryParams);
      }
    }, [isOpen]);
    const handleUpload = onUpload || uploadMedia;
    const prevAllCompleteRef = (0, import_element150.useRef)(false);
    (0, import_element150.useEffect)(() => {
      if (allComplete && !prevAllCompleteRef.current) {
        const completeCount = uploadingFiles.filter(
          (file) => file.status === "uploaded"
        ).length;
        if (completeCount > 0) {
          createSuccessNotice(
            (0, import_i18n79.sprintf)(
              // translators: %s: number of files
              (0, import_i18n79._n)(
                "Uploaded %s file",
                "Uploaded %s files",
                completeCount
              ),
              completeCount.toLocaleString()
            ),
            {
              type: "snackbar",
              context: NOTICES_CONTEXT,
              id: NOTICE_ID_UPLOAD_PROGRESS
            }
          );
        }
        if (!isPopoverOpenRef.current) {
          clearCompleted();
        }
      }
      prevAllCompleteRef.current = allComplete;
    }, [allComplete, uploadingFiles, createSuccessNotice, clearCompleted]);
    const handleFileSelect = (0, import_element150.useCallback)(
      (event) => {
        const files = event.target.files;
        if (files && files.length > 0) {
          const filesArray = Array.from(files);
          const { onFileChange, onError } = registerBatch(filesArray);
          handleUpload({
            allowedTypes,
            filesList: filesArray,
            onFileChange,
            onError
          });
        }
      },
      [allowedTypes, handleUpload, registerBatch]
    );
    const paginationInfo = (0, import_element150.useMemo)(
      () => ({
        totalItems,
        totalPages
      }),
      [totalItems, totalPages]
    );
    const acceptTypes = (0, import_element150.useMemo)(() => {
      if (allowedTypes?.includes("*")) {
        return void 0;
      }
      return allowedTypes?.join(",");
    }, [allowedTypes]);
    if (!isOpen) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
      import_components54.Modal,
      {
        title,
        onRequestClose: handleModalClose,
        isDismissible,
        className: modalClass,
        overlayClassName: "media-upload-modal",
        size: "fill",
        headerActions: /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
          import_components54.FormFileUpload,
          {
            accept: acceptTypes,
            multiple: true,
            onChange: handleFileSelect,
            render: ({ openFileDialog }) => /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
              import_components54.Button,
              {
                onClick: openFileDialog,
                icon: upload_default,
                __next40pxDefaultSize: true,
                children: (0, import_i18n79.__)("Upload media")
              }
            )
          }
        ),
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
            import_components54.DropZone,
            {
              onFilesDrop: (files) => {
                let filteredFiles = files;
                if (allowedTypes && !allowedTypes.includes("*")) {
                  filteredFiles = files.filter(
                    (file) => allowedTypes.some((allowedType) => {
                      return file.type === allowedType || file.type.startsWith(
                        allowedType.replace("*", "")
                      );
                    })
                  );
                }
                if (filteredFiles.length > 0) {
                  const { onFileChange, onError } = registerBatch(filteredFiles);
                  handleUpload({
                    allowedTypes,
                    filesList: filteredFiles,
                    onFileChange,
                    onError
                  });
                }
              },
              label: (0, import_i18n79.__)("Drop files to upload")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
            dataviews_picker_default,
            {
              data: mediaRecords || [],
              fields,
              view,
              onChangeView: handleChangeView,
              actions,
              selection,
              onChangeSelection: setSelection,
              isLoading,
              paginationInfo,
              defaultLayouts,
              config: dataViewsConfig,
              getItemId: (item) => String(item.id),
              itemListLabel: (0, import_i18n79.__)("Media items"),
              onReset: isModified || attachedToFilter ? handleReset : false,
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
                  Stack,
                  {
                    direction: "row",
                    align: "top",
                    justify: "space-between",
                    className: "dataviews__view-actions",
                    gap: "xs",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
                        Stack,
                        {
                          direction: "row",
                          gap: "sm",
                          justify: "start",
                          className: "dataviews__search",
                          children: [
                            search && /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(dataviews_picker_default.Search, { label: searchLabel }),
                            /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(dataviews_picker_default.FiltersToggle, {})
                          ]
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(Stack, { direction: "row", gap: "xs", style: { flexShrink: 0 }, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(dataviews_picker_default.LayoutSwitcher, {}),
                        /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(dataviews_picker_default.ViewConfig, {})
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(dataviews_picker_default.FiltersToggled, { className: "dataviews-filters__container" }),
                /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(dataviews_picker_default.Layout, {}),
                /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
                  "div",
                  {
                    className: clsx_default("media-upload-modal__footer", {
                      "is-uploading": uploadingFiles.length > 0
                    }),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
                        UploadStatusPopover,
                        {
                          uploadingFiles,
                          onDismissError: dismissError,
                          onOpenChange: handlePopoverOpenChange
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(dataviews_picker_default.Footer, {})
                    ]
                  }
                )
              ]
            }
          ),
          (0, import_element150.createPortal)(
            /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
              import_notices.SnackbarNotices,
              {
                className: "media-upload-modal__snackbar",
                context: NOTICES_CONTEXT
              }
            ),
            document.body
          )
        ]
      }
    );
  }

  // packages/media-utils/build-module/private-apis.mjs
  var privateApis = {};
  lock3(privateApis, {
    sideloadMedia,
    MediaUploadModal
  });
  return __toCommonJS(index_exports);
})();
/*! Bundled license information:

use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
  (**
   * @license React
   * use-sync-external-store-shim.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)

use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js:
  (**
   * @license React
   * use-sync-external-store-shim/with-selector.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)
*/
(window.wp ||= {}).mediaUtils = wp.mediaUtils;
})();
//# sourceMappingURL=index.js.map

```
