[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: widget.js
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 )); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // 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; } }); // 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(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } function useSyncExternalStore$2(subscribe, getSnapshot) { didWarnOld18Alpha || void 0 === React117.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 = useState25({ inst: { value, getSnapshot } }); var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; useLayoutEffect3( function() { inst.value = value; inst.getSnapshot = getSnapshot; checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }, [subscribe, value, getSnapshot] ); useEffect22( function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); return subscribe(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }); }, [subscribe] ); 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(subscribe, getSnapshot) { return getSnapshot(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React117 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState25 = React117.useState, useEffect22 = React117.useEffect, useLayoutEffect3 = React117.useLayoutEffect, useDebugValue2 = React117.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 !== React117.useSyncExternalStore ? React117.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(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React117 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore2 = shim.useSyncExternalStore, useRef43 = React117.useRef, useEffect22 = React117.useEffect, useMemo34 = React117.useMemo, useDebugValue2 = React117.useDebugValue; exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { var instRef = useRef43(null); if (null === instRef.current) { var inst = { hasValue: false, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo34( function() { function memoizedSelector(nextSnapshot) { if (!hasMemo) { hasMemo = true; memoizedSnapshot = nextSnapshot; nextSnapshot = selector(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 = selector(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, selector, isEqual] ); var value = useSyncExternalStore2(subscribe, instRef[0], instRef[1]); useEffect22( 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; } }); // widgets/events/widget.ts var import_i18n5 = __toESM(require_i18n()); // packages/icons/build-module/library/calendar.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var calendar_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" }) }); // packages/icons/build-module/library/close-small.mjs var import_primitives2 = __toESM(require_primitives(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); // packages/icons/build-module/library/map-marker.mjs var import_primitives3 = __toESM(require_primitives(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var map_marker_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z" }) }); // widgets/events/components/location-setting-control/location-setting-control.tsx var import_element51 = __toESM(require_element()); // widgets/events/components/location-picker/location-picker.tsx var import_element50 = __toESM(require_element()); var import_i18n4 = __toESM(require_i18n()); // 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; // node_modules/@base-ui/utils/esm/useControlled.js var React = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/error.js var set; if (true) { set = /* @__PURE__ */ new Set(); } function error(...messages) { if (true) { const messageKey = messages.join(" "); if (!set.has(messageKey)) { set.add(messageKey); console.error(`Base UI: ${messageKey}`); } } } // node_modules/@base-ui/utils/esm/useControlled.js 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 : 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: defaultValue } = React.useRef(defaultProp); React.useEffect(() => { if (!isControlled && serializeToDevModeString(defaultValue) !== 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/esm/safeReact.js var React2 = __toESM(require_react(), 1); var SafeReact = { ...React2 }; // node_modules/@base-ui/utils/esm/useRefWithInit.js var React3 = __toESM(require_react(), 1); var UNINITIALIZED = {}; function useRefWithInit(init, initArg) { const ref = React3.useRef(UNINITIALIZED); if (ref.current === UNINITIALIZED) { ref.current = init(initArg); } return ref; } // node_modules/@base-ui/utils/esm/useStableCallback.js 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/esm/useIsoLayoutEffect.js var React4 = __toESM(require_react(), 1); var noop = () => { }; var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop; // node_modules/@base-ui/utils/esm/warn.js var set2; if (true) { set2 = /* @__PURE__ */ new Set(); } function warn(...messages) { if (true) { const messageKey = messages.join(" "); if (!set2.has(messageKey)) { set2.add(messageKey); console.warn(`Base UI: ${messageKey}`); } } } // node_modules/@base-ui/react/esm/internals/composite/list/CompositeList.js var React6 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/internals/composite/list/CompositeListContext.js var React5 = __toESM(require_react(), 1); var CompositeListContext = /* @__PURE__ */ React5.createContext({ register: () => { }, unregister: () => { }, subscribeMapChange: () => { return () => { }; }, elementsRef: { current: [] }, nextIndexRef: { current: 0 } }); if (true) CompositeListContext.displayName = "CompositeListContext"; function useCompositeListContext() { return React5.useContext(CompositeListContext); } // node_modules/@base-ui/react/esm/internals/composite/list/CompositeList.js var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); function CompositeList(props) { const { children, elementsRef, labelsRef, onMapChange: onMapChangeProp } = props; const onMapChange = useStableCallback(onMapChangeProp); const nextIndexRef = React6.useRef(0); const listeners = useRefWithInit(createListeners).current; const map = useRefWithInit(createMap).current; const [mapTick, setMapTick] = React6.useState(0); const lastTickRef = React6.useRef(mapTick); const register2 = useStableCallback((node, metadata) => { map.set(node, metadata ?? null); lastTickRef.current += 1; setMapTick(lastTickRef.current); }); const unregister = useStableCallback((node) => { map.delete(node); lastTickRef.current += 1; setMapTick(lastTickRef.current); }); const sortedMap = React6.useMemo(() => { disableEslintWarning(mapTick); const newMap = /* @__PURE__ */ new Map(); const sortedNodes = Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition); sortedNodes.forEach((node, index2) => { const metadata = map.get(node) ?? {}; newMap.set(node, { ...metadata, index: index2 }); }); return newMap; }, [map, mapTick]); useIsoLayoutEffect(() => { if (typeof MutationObserver !== "function" || sortedMap.size === 0) { return void 0; } const mutationObserver = new MutationObserver((entries) => { const diff = /* @__PURE__ */ new Set(); const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node); entries.forEach((entry) => { entry.removedNodes.forEach(updateDiff); entry.addedNodes.forEach(updateDiff); }); if (diff.size === 0) { lastTickRef.current += 1; setMapTick(lastTickRef.current); } }); sortedMap.forEach((_, node) => { if (node.parentElement) { mutationObserver.observe(node.parentElement, { childList: true }); } }); return () => { mutationObserver.disconnect(); }; }, [sortedMap]); useIsoLayoutEffect(() => { const shouldUpdateLengths = lastTickRef.current === mapTick; if (shouldUpdateLengths) { if (elementsRef.current.length !== sortedMap.size) { elementsRef.current.length = sortedMap.size; } if (labelsRef && labelsRef.current.length !== sortedMap.size) { labelsRef.current.length = sortedMap.size; } nextIndexRef.current = sortedMap.size; } onMapChange(sortedMap); }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]); useIsoLayoutEffect(() => { return () => { elementsRef.current = []; }; }, [elementsRef]); useIsoLayoutEffect(() => { return () => { if (labelsRef) { labelsRef.current = []; } }; }, [labelsRef]); const subscribeMapChange = useStableCallback((fn) => { listeners.add(fn); return () => { listeners.delete(fn); }; }); useIsoLayoutEffect(() => { listeners.forEach((l) => l(sortedMap)); }, [listeners, sortedMap]); const contextValue = React6.useMemo(() => ({ register: register2, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef }), [register2, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]); return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CompositeListContext.Provider, { value: contextValue, children }); } function createMap() { return /* @__PURE__ */ new Map(); } function createListeners() { return /* @__PURE__ */ new Set(); } function sortByDocumentPosition(a, b) { const position = a.compareDocumentPosition(b); if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) { return -1; } if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) { return 1; } return 0; } function disableEslintWarning(_) { } // node_modules/@base-ui/react/esm/internals/direction-context/DirectionContext.js var React7 = __toESM(require_react(), 1); var DirectionContext = /* @__PURE__ */ React7.createContext(void 0); if (true) DirectionContext.displayName = "DirectionContext"; function useDirection() { const context = React7.useContext(DirectionContext); return context?.direction ?? "ltr"; } // node_modules/@base-ui/react/esm/internals/useRenderElement.js var React10 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/useMergedRefs.js function useMergedRefs(a, b, c, d) { const forkRef = useRefWithInit(createForkRef).current; if (didChange(forkRef, a, b, c, d)) { update(forkRef, [a, b, c, 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, c, d) { return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || 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 { ref(null); } break; } case "object": { ref.current = null; break; } default: } } }; } }; } // node_modules/@base-ui/utils/esm/getReactElementRef.js var React9 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/reactVersion.js var React8 = __toESM(require_react(), 1); var majorVersion = parseInt(React8.version, 10); function isReactVersionAtLeast(reactVersionToCheck) { return majorVersion >= reactVersionToCheck; } // node_modules/@base-ui/utils/esm/getReactElementRef.js function getReactElementRef(element) { if (!/* @__PURE__ */ React9.isValidElement(element)) { return null; } const reactElement = element; const propsWithRef = reactElement.props; return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; } // node_modules/@base-ui/utils/esm/mergeObjects.js 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/utils/esm/empty.js function NOOP() { } var EMPTY_ARRAY = Object.freeze([]); var EMPTY_OBJECT = Object.freeze({}); // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js 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/esm/utils/resolveClassName.js function resolveClassName(className, state) { return typeof className === "function" ? className(state) : className; } // node_modules/@base-ui/react/esm/utils/resolveStyle.js function resolveStyle(style, state) { return typeof style === "function" ? style(state) : style; } // node_modules/@base-ui/react/esm/merge-props/mergeProps.js var EMPTY_PROPS = {}; function mergeProps(a, b, c, d, e) { if (!c && !d && !e && !a) { return createInitialMergedProps(b); } let merged = createInitialMergedProps(a); if (b) { merged = mergeInto(merged, b); } if (c) { merged = mergeInto(merged, c); } 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/esm/internals/useRenderElement.js var import_react = __toESM(require_react(), 1); function useRenderElement(element, componentProps, params = {}) { const renderProp = componentProps.render; const outProps = useRenderElementProps(componentProps, params); if (params.enabled === false) { return null; } const state = params.state ?? EMPTY_OBJECT; return evaluateRenderProp(element, renderProp, outProps, state); } function useRenderElementProps(componentProps, params = {}) { const { className: classNameProp, style: styleProp, render: renderProp } = componentProps; const { state = EMPTY_OBJECT, ref, props, stateAttributesMapping: stateAttributesMapping7, enabled = true } = params; const className = enabled ? resolveClassName(classNameProp, state) : void 0; const style = enabled ? resolveStyle(styleProp, state) : void 0; const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping7) : EMPTY_OBJECT; const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; if (typeof document !== "undefined") { if (!enabled) { 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 evaluateRenderProp(element, render, props, state) { if (render) { if (typeof render === "function") { if (true) { warnIfRenderPropLooksLikeComponent(render); } return render(props, state); } const mergedProps = mergeProps(props, render.props); mergedProps.ref = props.ref; let newElement = render; if (newElement?.$$typeof === REACT_LAZY_TYPE) { const children = React10.Children.toArray(render); newElement = children[0]; } if (true) { if (!/* @__PURE__ */ React10.isValidElement(newElement)) { 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__ */ React10.cloneElement(newElement, 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__ */ React10.createElement(Tag, props); } // node_modules/@base-ui/react/esm/internals/reason-parts.js 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/esm/internals/createBaseUIEventDetails.js 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; } function createGenericEventDetails(reason, event, customProperties) { const custom = customProperties ?? EMPTY_OBJECT; const details = { reason, event: event ?? new Event("base-ui"), ...custom }; return details; } // node_modules/@base-ui/utils/esm/useId.js var React11 = __toESM(require_react(), 1); var globalId = 0; function useGlobalId(idOverride, prefix = "mui") { const [defaultId, setDefaultId] = React11.useState(idOverride); const id = idOverride || defaultId; React11.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/esm/internals/useBaseUiId.js function useBaseUiId(idOverride) { return useId(idOverride, "base-ui"); } // node_modules/@base-ui/react/esm/internals/useTransitionStatus.js var React13 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/useOnMount.js var React12 = __toESM(require_react(), 1); var EMPTY = []; function useOnMount(fn) { React12.useEffect(fn, EMPTY); } // node_modules/@base-ui/utils/esm/useAnimationFrame.js var EMPTY2 = 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; } 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 = EMPTY2; /** * Executes `fn` after `delay`, clearing any previously scheduled call. */ request(fn) { this.cancel(); this.currentId = scheduler.request(() => { this.currentId = EMPTY2; fn(); }); } cancel = () => { if (this.currentId !== EMPTY2) { scheduler.cancel(this.currentId); this.currentId = EMPTY2; } }; disposeEffect = () => { return this.cancel; }; }; function useAnimationFrame() { const timeout = useRefWithInit(AnimationFrame.create).current; useOnMount(timeout.disposeEffect); return timeout; } // node_modules/@base-ui/react/esm/internals/useTransitionStatus.js function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { const [transitionStatus, setTransitionStatus] = React13.useState(open && enableIdleState ? "idle" : void 0); const [mounted, setMounted] = React13.useState(open); if (open && !mounted) { setMounted(true); setTransitionStatus("starting"); } if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { setTransitionStatus("ending"); } if (!open && !mounted && transitionStatus === "ending") { setTransitionStatus(void 0); } useIsoLayoutEffect(() => { if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { const frame = AnimationFrame.request(() => { setTransitionStatus("ending"); }); return () => { AnimationFrame.cancel(frame); }; } return void 0; }, [open, mounted, transitionStatus, deferEndingState]); useIsoLayoutEffect(() => { if (!open || enableIdleState) { return void 0; } const frame = AnimationFrame.request(() => { setTransitionStatus(void 0); }); return () => { AnimationFrame.cancel(frame); }; }, [enableIdleState, open]); useIsoLayoutEffect(() => { if (!open || !enableIdleState) { return void 0; } if (open && mounted && transitionStatus !== "idle") { setTransitionStatus("starting"); } const frame = AnimationFrame.request(() => { setTransitionStatus("idle"); }); return () => { AnimationFrame.cancel(frame); }; }, [enableIdleState, open, mounted, transitionStatus]); return { mounted, setMounted, transitionStatus }; } // node_modules/@base-ui/react/esm/internals/composite/list/useCompositeListItem.js var React14 = __toESM(require_react(), 1); var IndexGuessBehavior = /* @__PURE__ */ (function(IndexGuessBehavior2) { IndexGuessBehavior2[IndexGuessBehavior2["None"] = 0] = "None"; IndexGuessBehavior2[IndexGuessBehavior2["GuessFromOrder"] = 1] = "GuessFromOrder"; return IndexGuessBehavior2; })({}); function useCompositeListItem(params = {}) { const { label, metadata, textRef, indexGuessBehavior, index: externalIndex } = params; const { register: register2, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef } = useCompositeListContext(); const indexRef = React14.useRef(-1); const [index2, setIndex] = React14.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => { if (indexRef.current === -1) { const newIndex = nextIndexRef.current; nextIndexRef.current += 1; indexRef.current = newIndex; } return indexRef.current; } : -1)); const componentRef = React14.useRef(null); const ref = React14.useCallback((node) => { componentRef.current = node; if (index2 !== -1 && node !== null) { elementsRef.current[index2] = node; if (labelsRef) { const isLabelDefined = label !== void 0; labelsRef.current[index2] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent; } } }, [index2, elementsRef, labelsRef, label, textRef]); useIsoLayoutEffect(() => { if (externalIndex != null) { return void 0; } const node = componentRef.current; if (node) { register2(node, metadata); return () => { unregister(node); }; } return void 0; }, [externalIndex, register2, unregister, metadata]); useIsoLayoutEffect(() => { if (externalIndex != null) { return void 0; } return subscribeMapChange((map) => { const i = componentRef.current ? map.get(componentRef.current)?.index : null; if (i != null) { setIndex(i); } }); }, [externalIndex, subscribeMapChange, setIndex]); return React14.useMemo(() => ({ ref, index: index2 }), [index2, ref]); } // node_modules/@base-ui/react/esm/internals/stateAttributesMapping.js var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; return TransitionStatusDataAttributes2; })({}); var STARTING_HOOK = { [TransitionStatusDataAttributes.startingStyle]: "" }; var ENDING_HOOK = { [TransitionStatusDataAttributes.endingStyle]: "" }; var transitionStatusMapping = { transitionStatus(value) { if (value === "starting") { return STARTING_HOOK; } if (value === "ending") { return ENDING_HOOK; } return null; } }; // node_modules/@base-ui/react/esm/internals/use-button/useButton.js var React17 = __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.ownerDocument.body : 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/esm/internals/composite/root/CompositeRootContext.js var React15 = __toESM(require_react(), 1); var CompositeRootContext = /* @__PURE__ */ React15.createContext(void 0); if (true) CompositeRootContext.displayName = "CompositeRootContext"; function useCompositeRootContext(optional = false) { const context = React15.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/esm/utils/useFocusableWhenDisabled.js var React16 = __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 = React16.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/react/esm/internals/use-button/useButton.js function useButton(parameters = {}) { const { disabled: disabled2 = false, focusableWhenDisabled, tabIndex = 0, native: isNativeButton = true, composite: compositeProp } = parameters; const elementRef = React17.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) { React17.useEffect(() => { if (!elementRef.current) { return; } const isButtonTag = isButtonElement(elementRef.current); if (isNativeButton) { if (!isButtonTag) { const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; const message = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`."; error(`${message}${ownerStackMessage}`); } } else if (isButtonTag) { const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; const message = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`."; error(`${message}${ownerStackMessage}`); } }, [isNativeButton]); } const updateDisabled = React17.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 = React17.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 isButton = isButtonElement(currentTarget); const isLink = !isNativeButton && isValidLinkElement(currentTarget); const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !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 (isLink || isNativeButton && isButton) { currentTarget.click(); event.preventBaseUIHandler(); } else if (shouldClick) { externalOnClick?.(event); event.preventBaseUIHandler(); } return; } if (shouldClick) { if (!isNativeButton && (isSpaceKey || isEnterKey)) { event.preventDefault(); } if (!isNativeButton && isEnterKey) { externalOnClick?.(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.key === " ") { externalOnClick?.(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 Boolean(elem?.tagName === "A" && elem?.href); } // node_modules/@base-ui/utils/esm/detectBrowser.js var hasNavigator = typeof navigator !== "undefined"; var nav = getNavigatorData(); var platform = getPlatform(); var userAgent = getUserAgent(); var isWebKit2 = typeof CSS === "undefined" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter:none"); var isIOS = ( // iPads can claim to be MacIntel nav.platform === "MacIntel" && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform) ); var isFirefox = hasNavigator && /firefox/i.test(userAgent); var isSafari = hasNavigator && /apple/i.test(navigator.vendor); var isEdge = hasNavigator && /Edg/i.test(userAgent); var isAndroid = hasNavigator && /android/i.test(platform) || /android/i.test(userAgent); var isMac = hasNavigator && platform.toLowerCase().startsWith("mac") && !navigator.maxTouchPoints; var isJSDOM = userAgent.includes("jsdom/"); function getNavigatorData() { if (!hasNavigator) { return { platform: "", maxTouchPoints: -1 }; } const uaData = navigator.userAgentData; if (uaData?.platform) { return { platform: uaData.platform, maxTouchPoints: navigator.maxTouchPoints }; } return { platform: navigator.platform ?? "", maxTouchPoints: navigator.maxTouchPoints ?? -1 }; } function getUserAgent() { if (!hasNavigator) { return ""; } const uaData = navigator.userAgentData; if (uaData && Array.isArray(uaData.brands)) { return uaData.brands.map(({ brand, version: version2 }) => `${brand}/${version2}`).join(" "); } return navigator.userAgent; } function getPlatform() { if (!hasNavigator) { return ""; } const uaData = navigator.userAgentData; if (uaData?.platform) { return uaData.platform; } return navigator.platform ?? ""; } // node_modules/@base-ui/react/esm/floating-ui-react/utils/constants.js 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/esm/internals/shadowDom.js 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]; } return event.target; } // node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js function isTargetInsideEnabledTrigger(target, triggerElements) { if (!isElement(target)) { return false; } const targetElement = target; if (triggerElements.hasElement(targetElement)) { return !targetElement.hasAttribute("data-trigger-disabled"); } for (const [, trigger] of triggerElements.entries()) { if (contains(trigger, targetElement)) { return !trigger.hasAttribute("data-trigger-disabled"); } } 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 || isJSDOM) { 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/esm/floating-ui-react/utils/nodes.js 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/esm/floating-ui-react/utils/event.js 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 (isAndroid && event.pointerType) { return event.type === "click" && event.buttons === 1; } return event.detail === 0 && !event.pointerType; } function isVirtualPointerEvent(event) { if (isJSDOM) { return false; } return !isAndroid && event.width === 0 && event.height === 0 || isAndroid && 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/@floating-ui/utils/dist/floating-ui.utils.mjs var sides = ["top", "right", "bottom", "left"]; var min = Math.min; var max = Math.max; var round = Math.round; var floor = Math.floor; var createCoords = (v) => ({ x: v, y: v }); 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) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function getPaddingObject(padding) { return typeof padding !== "number" ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function rectToClientRect(rect) { const { x, y, width, height } = rect; return { width, height, top: y, left: x, right: x + width, bottom: y + height, x, y }; } // node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js function isDifferentGridRow(index2, cols, prevRow) { return Math.floor(index2 / cols) !== prevRow; } 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 getGridNavigatedIndex(list, { event, orientation, loopFocus, onLoop, rtl, cols, disabledIndices, minIndex, maxIndex, prevIndex, stopEvent: stop = false }) { let nextIndex = prevIndex; let verticalDirection; if (event.key === ARROW_UP) { verticalDirection = "up"; } else if (event.key === ARROW_DOWN) { verticalDirection = "down"; } if (verticalDirection) { const rows = []; const rowIndexMap = []; let hasRoleRow = false; let visibleItemCount = 0; { let currentRowEl = null; let currentRowIndex = -1; list.forEach((el, idx) => { if (el == null) { return; } visibleItemCount += 1; const rowEl = el.closest('[role="row"]'); if (rowEl) { hasRoleRow = true; } if (rowEl !== currentRowEl || currentRowIndex === -1) { currentRowEl = rowEl; currentRowIndex += 1; rows[currentRowIndex] = []; } rows[currentRowIndex].push(idx); rowIndexMap[idx] = currentRowIndex; }); } let hasDomRows = false; let inferredDomCols = 0; if (hasRoleRow) { for (const row of rows) { const rowLength = row.length; if (rowLength > inferredDomCols) { inferredDomCols = rowLength; } if (rowLength !== cols) { hasDomRows = true; } } } const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length; const verticalCols = inferredDomCols || cols; const navigateVertically = (direction) => { if (!hasDomRows || prevIndex === -1) { return void 0; } const currentRow = rowIndexMap[prevIndex]; if (currentRow == null) { return void 0; } const colInRow = rows[currentRow].indexOf(prevIndex); const step = direction === "up" ? -1 : 1; for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) { if (nextRow < 0 || nextRow >= rows.length) { if (!loopFocus || hasVirtualizedGaps) { return void 0; } nextRow = nextRow < 0 ? rows.length - 1 : 0; if (onLoop) { const clampedCol = Math.min(colInRow, rows[nextRow].length - 1); const targetItemIndex = rows[nextRow][clampedCol] ?? rows[nextRow][0]; const returnedItemIndex = onLoop(event, prevIndex, targetItemIndex); nextRow = rowIndexMap[returnedItemIndex] ?? nextRow; } } const targetRow = rows[nextRow]; for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) { const candidate = targetRow[col]; if (!isListIndexDisabled(list, candidate, disabledIndices)) { return candidate; } } } return void 0; }; const navigateVerticallyWithInferredRows = (direction) => { if (!hasVirtualizedGaps || prevIndex === -1) { return void 0; } const colInRow = prevIndex % verticalCols; const rowStep = direction === "up" ? -verticalCols : verticalCols; const lastRowStart = maxIndex - maxIndex % verticalCols; const rowCount = floor(maxIndex / verticalCols) + 1; for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) { if (rowStart < 0 || rowStart > maxIndex) { if (!loopFocus) { return void 0; } rowStart = rowStart < 0 ? lastRowStart : 0; } const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex); for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) { if (!isListIndexDisabled(list, candidate, disabledIndices)) { return candidate; } } } return void 0; }; if (stop) { stopEvent(event); } const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection); if (verticalCandidate !== void 0) { nextIndex = verticalCandidate; } else if (prevIndex === -1) { nextIndex = verticalDirection === "up" ? maxIndex : minIndex; } else { nextIndex = findNonDisabledListIndex(list, { startingIndex: prevIndex, amount: verticalCols, decrement: verticalDirection === "up", disabledIndices }); if (loopFocus) { if (verticalDirection === "up" && (prevIndex - verticalCols < minIndex || nextIndex < 0)) { const col = prevIndex % verticalCols; const maxCol = maxIndex % verticalCols; const offset4 = maxIndex - (maxCol - col); if (maxCol === col) { nextIndex = maxIndex; } else { nextIndex = maxCol > col ? offset4 : offset4 - verticalCols; } if (onLoop) { nextIndex = onLoop(event, prevIndex, nextIndex); } } if (verticalDirection === "down" && prevIndex + verticalCols > maxIndex) { nextIndex = findNonDisabledListIndex(list, { startingIndex: prevIndex % verticalCols - verticalCols, amount: verticalCols, disabledIndices }); if (onLoop) { nextIndex = onLoop(event, prevIndex, nextIndex); } } } } if (isIndexOutOfListBounds(list, nextIndex)) { nextIndex = prevIndex; } } if (orientation === "both") { const prevRow = floor(prevIndex / cols); if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) { if (stop) { stopEvent(event); } if (prevIndex % cols !== cols - 1) { nextIndex = findNonDisabledListIndex(list, { startingIndex: prevIndex, disabledIndices }); if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) { nextIndex = findNonDisabledListIndex(list, { startingIndex: prevIndex - prevIndex % cols - 1, disabledIndices }); if (onLoop) { nextIndex = onLoop(event, prevIndex, nextIndex); } } } else if (loopFocus) { nextIndex = findNonDisabledListIndex(list, { startingIndex: prevIndex - prevIndex % cols - 1, disabledIndices }); if (onLoop) { nextIndex = onLoop(event, prevIndex, nextIndex); } } if (isDifferentGridRow(nextIndex, cols, prevRow)) { nextIndex = prevIndex; } } if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) { if (stop) { stopEvent(event); } if (prevIndex % cols !== 0) { nextIndex = findNonDisabledListIndex(list, { startingIndex: prevIndex, decrement: true, disabledIndices }); if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) { nextIndex = findNonDisabledListIndex(list, { startingIndex: prevIndex + (cols - prevIndex % cols), decrement: true, disabledIndices }); if (onLoop) { nextIndex = onLoop(event, prevIndex, nextIndex); } } } else if (loopFocus) { nextIndex = findNonDisabledListIndex(list, { startingIndex: prevIndex + (cols - prevIndex % cols), decrement: true, disabledIndices }); if (onLoop) { nextIndex = onLoop(event, prevIndex, nextIndex); } } if (isDifferentGridRow(nextIndex, cols, prevRow)) { nextIndex = prevIndex; } } const lastRow = floor(maxIndex / cols) === prevRow; if (isIndexOutOfListBounds(list, nextIndex)) { if (loopFocus && lastRow) { nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(list, { startingIndex: prevIndex - prevIndex % cols - 1, disabledIndices }); if (onLoop) { nextIndex = onLoop(event, prevIndex, nextIndex); } } else { nextIndex = prevIndex; } } } return nextIndex; } function createGridCellMap(sizes, cols, dense) { const cellMap = []; let startIndex = 0; sizes.forEach(({ width, height }, index2) => { if (width > cols) { if (true) { throw new Error(`[Floating UI]: Invalid grid - item width at index ${index2} is greater than grid columns`); } } let itemPlaced = false; if (dense) { startIndex = 0; } while (!itemPlaced) { const targetCells = []; for (let i = 0; i < width; i += 1) { for (let j = 0; j < height; j += 1) { targetCells.push(startIndex + i + j * cols); } } if (startIndex % cols + width <= cols && targetCells.every((cell) => cellMap[cell] == null)) { targetCells.forEach((cell) => { cellMap[cell] = index2; }); itemPlaced = true; } else { startIndex += 1; } } }); return [...cellMap]; } function getGridCellIndexOfCorner(index2, sizes, cellMap, cols, corner) { if (index2 === -1) { return -1; } const firstCellIndex = cellMap.indexOf(index2); const sizeItem = sizes[index2]; switch (corner) { case "tl": return firstCellIndex; case "tr": if (!sizeItem) { return firstCellIndex; } return firstCellIndex + sizeItem.width - 1; case "bl": if (!sizeItem) { return firstCellIndex; } return firstCellIndex + (sizeItem.height - 1) * cols; case "br": return cellMap.lastIndexOf(index2); default: return -1; } } function getGridCellIndices(indices, cellMap) { return cellMap.flatMap((index2, cellIndex) => indices.includes(index2) ? [cellIndex] : []); } 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; } 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/utils/esm/owner.js function ownerDocument(node) { return node?.ownerDocument || document; } // node_modules/@base-ui/react/esm/floating-ui-react/utils/tabbable.js 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, selector, list) { getComposedChildren(container).forEach((child) => { if (isHTMLElement(child) && child.matches(selector)) { list.push(child); } appendMatchingElements(child, selector, 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 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/utils/esm/addEventListener.js function addEventListener(target, type, listener, options) { target.addEventListener(type, listener, options); return () => { target.removeEventListener(type, listener, options); }; } // node_modules/@base-ui/utils/esm/useValueAsRef.js 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/esm/internals/useOpenChangeComplete.js var React18 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/internals/useAnimationsFinished.js var ReactDOM = __toESM(require_react_dom(), 1); // node_modules/@base-ui/react/esm/utils/resolveRef.js function resolveRef(maybeRef) { if (maybeRef == null) { return maybeRef; } return "current" in maybeRef ? maybeRef.current : maybeRef; } // node_modules/@base-ui/react/esm/internals/useAnimationsFinished.js function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) { const frame = useAnimationFrame(); return useStableCallback((fnToExecute, signal = null) => { frame.cancel(); const element = resolveRef(elementOrRef); if (element == null) { return; } const resolvedElement = element; const done = () => { ReactDOM.flushSync(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(); } }).catch(() => { if (treatAbortedAsFinished) { if (!signal?.aborted) { done(); } return; } const currentAnimations = resolvedElement.getAnimations(); if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { exec(); } }); } if (waitForStartingStyleRemoved) { const startingStyleAttribute = TransitionStatusDataAttributes.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/esm/internals/useOpenChangeComplete.js function useOpenChangeComplete(parameters) { const { enabled = true, open, ref, onComplete: onCompleteParam } = parameters; const onComplete = useStableCallback(onCompleteParam); const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false); React18.useEffect(() => { if (!enabled) { return void 0; } const abortController = new AbortController(); runOnceAnimationsFinish(onComplete, abortController.signal); return () => { abortController.abort(); }; }, [enabled, open, onComplete, runOnceAnimationsFinish]); } // node_modules/@base-ui/utils/esm/useOnFirstRender.js var React19 = __toESM(require_react(), 1); function useOnFirstRender(fn) { const ref = React19.useRef(true); if (ref.current) { ref.current = false; fn(); } } // node_modules/@base-ui/utils/esm/useTimeout.js var EMPTY3 = 0; var Timeout = class _Timeout { static create() { return new _Timeout(); } currentId = EMPTY3; /** * Executes `fn` after `delay`, clearing any previously scheduled call. */ start(delay, fn) { this.clear(); this.currentId = setTimeout(() => { this.currentId = EMPTY3; fn(); }, delay); } isStarted() { return this.currentId !== EMPTY3; } clear = () => { if (this.currentId !== EMPTY3) { clearTimeout(this.currentId); this.currentId = EMPTY3; } }; disposeEffect = () => { return this.clear; }; }; function useTimeout() { const timeout = useRefWithInit(Timeout.create).current; useOnMount(timeout.disposeEffect); return timeout; } // node_modules/@base-ui/utils/esm/useScrollLock.js var originalHtmlStyles = {}; var originalBodyStyles = {}; var originalHtmlScrollBehavior = ""; 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 = isOverflowElement(html) ? 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 = isOverflowElement(html) ? 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 (isWebKit2 && (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 = isOverflowElement(html) ? 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", overflow: "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 htmlOverflowY = getWindow(html).getComputedStyle(html).overflowY; if (htmlOverflowY === "hidden" || htmlOverflowY === "clip") { this.restore = NOOP; return; } const hasOverlayScrollbars = isIOS || !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/esm/floating-ui-react/components/FloatingDelayGroup.js var React20 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverShared.js 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/esm/floating-ui-react/components/FloatingDelayGroup.js var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); var FloatingDelayGroupContext = /* @__PURE__ */ React20.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 FloatingDelayGroup(props) { const { children, delay, timeoutMs = 0 } = props; const delayRef = React20.useRef(delay); const initialDelayRef = React20.useRef(delay); const currentIdRef = React20.useRef(null); const currentContextRef = React20.useRef(null); const timeout = useTimeout(); return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FloatingDelayGroupContext.Provider, { value: React20.useMemo(() => ({ hasProvider: true, delayRef, initialDelayRef, currentIdRef, timeoutMs, currentContextRef, timeout }), [timeoutMs, timeout]), children }); } function useDelayGroup(context, options = { open: false }) { const { open } = options; const store = "rootStore" in context ? context.rootStore : context; const floatingId = store.useState("floatingId"); const groupContext = React20.useContext(FloatingDelayGroupContext); const { currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, hasProvider, timeout } = groupContext; const [isInstantPhase, setIsInstantPhase] = React20.useState(false); useIsoLayoutEffect(() => { function unset() { setIsInstantPhase(false); currentContextRef.current?.setIsInstantPhase(false); currentIdRef.current = null; currentContextRef.current = null; delayRef.current = initialDelayRef.current; } if (!currentIdRef.current) { return void 0; } if (!open && 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 () => { timeout.clear(); }; } unset(); } return void 0; }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]); useIsoLayoutEffect(() => { if (!open) { 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); } }, [open, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); useIsoLayoutEffect(() => { return () => { currentContextRef.current = null; }; }, [currentContextRef]); return React20.useMemo(() => ({ hasProvider, delayRef, isInstantPhase }), [hasProvider, delayRef, isInstantPhase]); } // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingFocusManager.js var React24 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/mergeCleanups.js 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/esm/utils/FocusGuard.js var React21 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/visuallyHidden.js 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/esm/utils/FocusGuard.js var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var FocusGuard = /* @__PURE__ */ React21.forwardRef(function FocusGuard2(props, ref) { const [role, setRole] = React21.useState(); useIsoLayoutEffect(() => { if (isSafari) { setRole("button"); } }, []); const restProps = { tabIndex: 0, // Role is only for VoiceOver role }; return /* @__PURE__ */ (0, import_jsx_runtime6.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/@base-ui/react/esm/floating-ui-react/utils/createAttribute.js function createAttribute(name) { return `data-base-ui-${name}`; } // node_modules/@base-ui/react/esm/floating-ui-react/utils/enqueueFocus.js var rafId = 0; function enqueueFocus(el, options = {}) { const { preventScroll = false, sync = false, shouldFocus } = options; cancelAnimationFrame(rafId); function exec() { if (shouldFocus && !shouldFocus()) { return; } el?.focus({ preventScroll }); } if (sync) { exec(); return NOOP; } const currentRafId = requestAnimationFrame(exec); rafId = currentRafId; return () => { if (rafId === currentRafId) { cancelAnimationFrame(currentRafId); rafId = 0; } }; } // node_modules/@base-ui/react/esm/floating-ui-react/utils/markOthers.js 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((x) => x != 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, markerIgnoreElements = [] }) { const controlAttribute = inert ? "inert" : ariaHidden ? "aria-hidden" : null; let counterMap = null; let uncontrolledElementsSet = null; const avoidElements = correctElements(body, uncorrectedAvoidElements); const markerIgnoreTargets = mark ? correctElements(body, markerIgnoreElements) : []; const markerIgnoreSet = new Set(markerIgnoreTargets); const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)).filter((target) => !markerIgnoreSet.has(target)) : []; 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, markerIgnoreElements = [] } = options; const body = ownerDocument(avoidElements[0]).body; return applyAttributeToOthers(avoidElements, body, ariaHidden, inert, { mark, markerIgnoreElements }); } // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingPortal.js var React22 = __toESM(require_react(), 1); var ReactDOM2 = __toESM(require_react_dom(), 1); // node_modules/@base-ui/react/esm/internals/constants.js 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/esm/floating-ui-react/components/FloatingPortal.js var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var PortalContext = /* @__PURE__ */ React22.createContext(null); if (true) PortalContext.displayName = "PortalContext"; var usePortalContext = () => React22.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] = React22.useState(null); const [portalNode, setPortalNode] = React22.useState(null); const setPortalNodeRef = useStableCallback((node) => { if (node !== null) { setPortalNode(node); } }); const containerRef = React22.useRef(null); useIsoLayoutEffect(() => { if (containerProp === null) { if (containerRef.current) { containerRef.current = null; setPortalNode(null); setContainerElement(null); } return; } if (uniqueId == 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, uniqueId]); const portalElement = useRenderElement("div", componentProps, { ref: [ref, setPortalNodeRef], props: [{ id: uniqueId, [attr]: "" }, elementProps] }); const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; return { portalNode, portalSubtree }; } var FloatingPortal = /* @__PURE__ */ React22.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { const { render, className, style, children, container, renderGuards, ...elementProps } = componentProps; const { portalNode, portalSubtree } = useFloatingPortalNode({ container, ref: forwardedRef, componentProps, elementProps }); const beforeOutsideRef = React22.useRef(null); const afterOutsideRef = React22.useRef(null); const beforeInsideRef = React22.useRef(null); const afterInsideRef = React22.useRef(null); const [focusManagerState, setFocusManagerState] = React22.useState(null); const focusInsideDisabledRef = React22.useRef(false); const modal = focusManagerState?.modal; const open = focusManagerState?.open; const shouldRenderGuards = typeof renderGuards === "boolean" ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; React22.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]); React22.useEffect(() => { if (!portalNode || open !== false) { return; } enableFocusInside(portalNode); focusInsideDisabledRef.current = false; }, [open, portalNode]); const portalContextValue = React22.useMemo(() => ({ beforeOutsideRef, afterOutsideRef, beforeInsideRef, afterInsideRef, portalNode, setFocusManagerState }), [portalNode]); return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(React22.Fragment, { children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PortalContext.Provider, { value: portalContextValue, children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsx)("span", { "aria-owns": portalNode.id, style: ownerVisuallyHidden }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime7.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/esm/floating-ui-react/components/FloatingTree.js var React23 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/floating-ui-react/utils/createEventEmitter.js 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/esm/floating-ui-react/components/FloatingTree.js var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); var FloatingNodeContext = /* @__PURE__ */ React23.createContext(null); if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; var FloatingTreeContext = /* @__PURE__ */ React23.createContext(null); if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; var useFloatingParentNodeId = () => React23.useContext(FloatingNodeContext)?.id || null; var useFloatingTree = (externalTree) => { const contextTree = React23.useContext(FloatingTreeContext); return externalTree ?? contextTree; }; // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingFocusManager.js var import_jsx_runtime9 = __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, orderRef) { if (floatingFocusElement.hasAttribute("tabindex") && !floatingFocusElement.hasAttribute("data-tabindex")) { return; } if (!orderRef.current.includes("floating") && !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 (orderRef.current.includes("floating") || tabbableContent.length === 0) { if (tabIndex !== "0") { floatingFocusElement.setAttribute("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 open = 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 orderRef = React24.useRef(["content"]); const initialFocusRef = useValueAsRef(initialFocus); const returnFocusRef = useValueAsRef(returnFocus); const openInteractionTypeRef = useValueAsRef(openInteractionType); const tree = useFloatingTree(externalTree); const portalContext = usePortalContext(); const preventReturnFocusRef = React24.useRef(false); const isPointerDownRef = React24.useRef(false); const pointerDownOutsideRef = React24.useRef(false); const lastFocusedTabbableRef = React24.useRef(null); const closeTypeRef = React24.useRef(""); const lastInteractionTypeRef = React24.useRef(""); const beforeGuardRef = React24.useRef(null); const afterGuardRef = React24.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) ?? []); React24.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]); React24.useEffect(() => { if (disabled2 || !open) { 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; } } 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)); }, [disabled2, floating, domReference, floatingFocusElement, open, portalContext, getResolvedInsideElements]); React24.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); 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)) || relatedTarget != null && triggers.hasElement(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, orderRef); } 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, orderRef, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]); React24.useEffect(() => { if (disabled2 || !floating || !open) { 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((x) => x != null); const ariaHiddenCleanup = markOthers(insideElements, { ariaHidden: modal || isUntrappedTypeableCombobox, mark: false }); const markerInsideElements = [floating, ...portalNodes].filter((x) => x != null); const markerCleanup = markOthers(markerInsideElements); return () => { markerCleanup(); ariaHiddenCleanup(); }; }, [open, disabled2, domReference, floating, modal, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]); useIsoLayoutEffect(() => { if (!open || disabled2 || !isHTMLElement(floatingFocusElement)) { return; } 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)); enqueueFocus(elToFocus, { preventScroll: elToFocus === floatingFocusElement, shouldFocus() { if (hadFocusInside) { return true; } const currentActiveElement = activeElement(doc); const focusMovedInside = currentActiveElement !== elToFocus && contains(floatingFocusElement, currentActiveElement); return !focusMovedInside; } }); }); }, [disabled2, open, floatingFocusElement, getTabbableContent, initialFocusRef, openInteractionTypeRef]); useIsoLayoutEffect(() => { if (disabled2 || !floatingFocusElement) { return void 0; } const doc = ownerDocument(floatingFocusElement); const previouslyFocusedElement = activeElement(doc); addPreviouslyFocusedElement(previouslyFocusedElement); 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() { const returnFocusValueOrFn = returnFocusRef.current; let resolvedReturnFocusValue = typeof returnFocusValueOrFn === "function" ? returnFocusValueOrFn(closeTypeRef.current) : returnFocusValueOrFn; if (resolvedReturnFocusValue === void 0 || resolvedReturnFocusValue === false) { return null; } if (resolvedReturnFocusValue === null) { resolvedReturnFocusValue = true; } if (typeof resolvedReturnFocusValue === "boolean") { if (domReference?.isConnected) { return domReference; } return getPreviouslyFocusedElement() || null; } const fallback = domReference?.isConnected ? domReference : getPreviouslyFocusedElement(); return resolveRef(resolvedReturnFocusValue) || fallback || 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 returnElement = getReturnElement(); 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)) { tabbableReturnElement.focus({ preventScroll: true }); } preventReturnFocusRef.current = false; }); }; }, [disabled2, floating, floatingFocusElement, returnFocusRef, events, tree, domReference, getNodeId, getResolvedInsideElements]); useIsoLayoutEffect(() => { if (!isWebKit2 || open || !floating) { return; } const activeEl = activeElement(ownerDocument(floating)); if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) { return; } if (contains(floating, activeEl)) { activeEl.blur(); } }, [open, floating]); useIsoLayoutEffect(() => { if (disabled2 || !portalContext) { return void 0; } portalContext.setFocusManagerState({ modal, closeOnFocusOut, open, onOpenChange: store.setOpen, domReference }); return () => { portalContext.setFocusManagerState(null); }; }, [disabled2, portalContext, modal, open, store, closeOnFocusOut, domReference]); useIsoLayoutEffect(() => { if (disabled2 || !floatingFocusElement) { return void 0; } handleTabIndex(floatingFocusElement, orderRef); return () => { queueMicrotask(clearDisconnectedPreviouslyFocusedElements); }; }, [disabled2, floatingFocusElement, orderRef]); const shouldRenderGuards = !disabled2 && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal); return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(React24.Fragment, { children: [shouldRenderGuards && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FocusGuard, { "data-type": "inside", ref: mergedBeforeGuardRef, onFocus: (event) => { if (modal) { const els = getTabbableContent(); 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_runtime9.jsx)(FocusGuard, { "data-type": "inside", ref: mergedAfterGuardRef, onFocus: (event) => { if (modal) { 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/esm/floating-ui-react/hooks/useClick.js var React25 = __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 = React25.useRef(void 0); const frame = useAnimationFrame(); const touchOpenTimeout = useTimeout(); const reference = React25.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(open, currentTarget, isClickLikeOpenEvent2) { const openEvent = dataRef.current.openEvent; const hasClickedOnInactiveTrigger = store.select("domReferenceElement") !== currentTarget; if (open && hasClickedOnInactiveTrigger) { return true; } if (!open) { return true; } if (!toggle) { return true; } if (openEvent && stickIfOpen) { return !isClickLikeOpenEvent2(openEvent.type); } return false; } return { onPointerDown(event) { pointerTypeRef.current = event.pointerType; }, onMouseDown(event) { const pointerType = pointerTypeRef.current; const nativeEvent = event.nativeEvent; const open = store.select("open"); if (event.button !== 0 || eventOption === "click" || isMouseLikePointerType(pointerType, true) && ignoreMouse) { return; } const nextOpen = getNextOpen(open, 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 open = store.select("open"); const nextOpen = getNextOpen(open, 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 React25.useMemo(() => enabled ? { reference } : EMPTY_OBJECT, [enabled, reference]); } // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useClientPoint.js var React26 = __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 x = domRect.x; let y = domRect.y; if (offsetX == null && data.x && isXAxis) { offsetX = domRect.x - data.x; } if (offsetY == null && data.y && isYAxis) { offsetY = domRect.y - data.y; } x -= offsetX || 0; y -= offsetY || 0; width = 0; height = 0; if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { width = data.axis === "y" ? domRect.width : 0; height = data.axis === "x" ? domRect.height : 0; x = isXAxis && data.x != null ? data.x : x; y = isYAxis && data.y != null ? data.y : y; } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) { height = data.axis === "x" ? domRect.height : height; width = data.axis === "y" ? domRect.width : width; } isAutoUpdateEvent = true; return { width, height, x, y, top: y, right: x + width, bottom: y + height, left: x }; } }; } 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 open = store.useState("open"); const floating = store.useState("floatingElement"); const domReference = store.useState("domReferenceElement"); const dataRef = store.context.dataRef; const initialRef = React26.useRef(false); const cleanupListenerRef = React26.useRef(null); const [pointerType, setPointerType] = React26.useState(); const [reactive, setReactive] = React26.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 (!open) { setReference(event.clientX, event.clientY, event.currentTarget); } else if (!cleanupListenerRef.current) { setReference(event.clientX, event.clientY, event.currentTarget); setReactive([]); } }); const openCheck = isMouseLikePointerType(pointerType) ? floating : open; React26.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]); React26.useEffect(() => () => { store.set("positionReference", null); }, [store]); React26.useEffect(() => { if (enabled && !floating) { initialRef.current = false; } }, [enabled, floating]); React26.useEffect(() => { if (!enabled && open) { initialRef.current = true; } }, [enabled, open]); const reference = React26.useMemo(() => { function setPointerTypeRef(event) { setPointerType(event.pointerType); } return { onPointerDown: setPointerTypeRef, onPointerEnter: setPointerTypeRef, onMouseMove: handleReferenceEnterOrMove, onMouseEnter: handleReferenceEnterOrMove }; }, [handleReferenceEnterOrMove]); return React26.useMemo(() => enabled ? { reference, trigger: reference } : {}, [enabled, reference]); } // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useDismiss.js var React27 = __toESM(require_react(), 1); var bubbleHandlerKeys = { intentional: "onClick", sloppy: "onPointerDown" }; 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, referencePressEvent = "sloppy", bubbles, externalTree } = props; const store = "rootStore" in context ? context.rootStore : context; const open = store.useState("open"); const floatingElement = store.useState("floatingElement"); const { dataRef } = 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 = React27.useRef(false); const pressStartPreventedRef = React27.useRef(false); const suppressNextOutsideClickRef = React27.useRef(false); const isComposingRef = React27.useRef(false); const currentPointerTypeRef = React27.useRef(""); const touchStateRef = React27.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 (!open || !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 (!open || !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 (!open || !enabled) { return; } if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { return; } if (pressStartedInsideRef.current) { pressStartPreventedRef.current = true; } }); React27.useEffect(() => { if (!open || !enabled) { return void 0; } dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; dataRef.current.__outsidePressBubbles = outsidePressBubbles; const compositionTimeout = new Timeout(); const preventedPressSuppressionTimeout = new Timeout(); 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. isWebKit() ? 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 isRTL2 = style.direction === "rtl"; const pressedVerticalScrollbar = canScrollY && (isRTL2 ? 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" && 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") { 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 (!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 doc = ownerDocument(floatingElement); 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, true), addEventListener(doc, "touchmove", handleTouchMoveCapture, true), addEventListener(doc, "touchend", handleTouchEndCapture, true))); return () => { unsubscribe(); compositionTimeout.clear(); preventedPressSuppressionTimeout.clear(); resetPressStartState(); suppressNextOutsideClickRef.current = false; }; }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout]); React27.useEffect(clearInsideReactTree, [outsidePress2, clearInsideReactTree]); const reference = React27.useMemo(() => ({ onKeyDown: closeOnEscapeKeyDown, [bubbleHandlerKeys[referencePressEvent]]: closeOnReferencePress, ...referencePressEvent !== "intentional" && { onClick: closeOnReferencePress } }), [closeOnEscapeKeyDown, closeOnReferencePress, referencePressEvent]); const floating = React27.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 React27.useMemo(() => enabled ? { reference, floating, trigger: reference } : {}, [enabled, reference, floating]); } // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloating.js var React34 = __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 }; } switch (getAlignment(placement)) { case "start": coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); break; case "end": coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); break; } return coords; } async function detectOverflow(state, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x, y, 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, y, 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 } : { 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, y } = 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, y, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform: platformWithDetectOverflow, elements: { reference, floating } }); x = nextX != null ? nextX : x; y = nextY != null ? nextY : y; 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, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i = -1; } } return { x, y, 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 {}; } }; }; function getSideOffsets(overflow, rect) { return { top: overflow.top - rect.height, right: overflow.right - rect.width, bottom: overflow.bottom - rect.height, left: overflow.left - rect.width }; } function isAnySideFullyClipped(overflow) { return sides.some((side) => overflow[side] >= 0); } var hide = function(options) { if (options === void 0) { options = {}; } return { name: "hide", options, async fn(state) { const { rects, platform: platform3 } = state; const { strategy = "referenceHidden", ...detectOverflowOptions } = evaluate(options, state); switch (strategy) { case "referenceHidden": { const overflow = await platform3.detectOverflow(state, { ...detectOverflowOptions, elementContext: "reference" }); const offsets = getSideOffsets(overflow, rects.reference); return { data: { referenceHiddenOffsets: offsets, referenceHidden: isAnySideFullyClipped(offsets) } }; } case "escaped": { const overflow = await platform3.detectOverflow(state, { ...detectOverflowOptions, altBoundary: true }); const offsets = getSideOffsets(overflow, rects.floating); return { data: { escapedOffsets: offsets, escaped: isAnySideFullyClipped(offsets) } }; } default: { 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, y, 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: x + diffCoords.x, y: y + diffCoords.y, data: { ...diffCoords, placement } }; } }; }; var shift = function(options) { if (options === void 0) { options = {}; } return { name: "shift", options, async fn(state) { const { x, y, placement, platform: platform3 } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => { let { x: x2, y: y2 } = _ref; return { x: x2, y: y2 }; } }, ...detectOverflowOptions } = evaluate(options, state); const coords = { x, y }; const overflow = await platform3.detectOverflow(state, detectOverflowOptions); const crossAxis = getSideAxis(getSide(placement)); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; if (checkMainAxis) { const minSide = mainAxis === "y" ? "top" : "left"; const maxSide = mainAxis === "y" ? "bottom" : "right"; const min2 = mainAxisCoord + overflow[minSide]; const max2 = mainAxisCoord - overflow[maxSide]; mainAxisCoord = clamp(min2, mainAxisCoord, max2); } if (checkCrossAxis) { const minSide = crossAxis === "y" ? "top" : "left"; const maxSide = crossAxis === "y" ? "bottom" : "right"; const min2 = crossAxisCoord + overflow[minSide]; const max2 = crossAxisCoord - overflow[maxSide]; crossAxisCoord = clamp(min2, crossAxisCoord, max2); } const limitedCoords = limiter.fn({ ...state, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x, y: limitedCoords.y - y, enabled: { [mainAxis]: checkMainAxis, [crossAxis]: checkCrossAxis } } }; } }; }; var limitShift = function(options) { if (options === void 0) { options = {}; } return { options, fn(state) { const { x, y, placement, rects, middlewareData } = state; const { offset: offset4 = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = evaluate(options, state); const coords = { x, y }; 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: 0, crossAxis: 0, ...rawOffset }; 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) { var _state$middlewareData, _state$middlewareData2; 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 noShift = !state.middlewareData.shift; let availableHeight = overflowAvailableHeight; let availableWidth = overflowAvailableWidth; if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { availableWidth = maximumClippingWidth; } if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { availableHeight = maximumClippingHeight; } if (noShift && !alignment) { const xMin = max(overflow.left, 0); const xMax = max(overflow.right, 0); const yMin = max(overflow.top, 0); const yMax = max(overflow.bottom, 0); if (isYAxis) { availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); } else { availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); } } await apply({ ...state, availableWidth, availableHeight }); 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, $ } = getCssDimensions(domElement); let x = ($ ? round(rect.width) : rect.width) / width; let y = ($ ? round(rect.height) : rect.height) / height; if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } 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; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { return false; } return isFixed; } 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 x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; let currentWin = win; let currentIFrame = getFrameElement(currentWin); while (currentIFrame && offsetParent && 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; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentWin = getWindow(currentIFrame); currentIFrame = getFrameElement(currentWin); } } return rectToClientRect({ width, height, x, y }); } 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 x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); const y = htmlRect.top + scroll.scrollTop; return { x, y }; } 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 || !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 Array.from(element.getClientRects()); } function getDocumentRect(element) { const html = getDocumentElement(element); const scroll = getNodeScroll(element); const body = element.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 x = -scroll.scrollLeft + getWindowScrollBarX(element); const y = -scroll.scrollTop; if (getComputedStyle2(body).direction === "rtl") { x += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } var SCROLLBAR_MAX = 25; function getViewportRect(element, strategy) { const win = getWindow(element); const html = getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === "fixed") { x = visualViewport.offsetLeft; y = 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 clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { width -= clippingStableScrollbarWidth; } } else if (windowScrollbarX <= SCROLLBAR_MAX) { width += windowScrollbarX; } return { width, height, x, y }; } 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 = isHTMLElement(element) ? getScale(element) : createCoords(1); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === "viewport") { rect = getViewportRect(element, strategy); } 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 hasFixedPositionAncestor(element, stopNode) { const parentNode = getParentNode(element); if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); } 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 currentContainingBlockComputedStyle = 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); if (!currentNodeIsContaining && computedStyle.position === "fixed") { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); if (shouldDropCurrentNode) { result = result.filter((ancestor) => ancestor !== currentNode); } else { currentContainingBlockComputedStyle = 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); function setLeftRTLScrollbarOffset() { offsets.x = getWindowScrollBarX(documentElement); } if (isOffsetParentAnElement || !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; } else if (documentElement) { setLeftRTLScrollbarOffset(); } } if (isFixed && !isOffsetParentAnElement && documentElement) { setLeftRTLScrollbarOffset(); } const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; return { x, y, 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) { 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 (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 1e3); } else { refresh(false, ratio); } } if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { refresh(); } isFirstUpdate = false; } try { io = new IntersectionObserver(handleObserve, { ...options, // Handle <iframe>s root: root.ownerDocument }); } catch (_e) { io = new IntersectionObserver(handleObserve, options); } io.observe(element); } refresh(true); return 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, { passive: true }); ancestorResize && ancestor.addEventListener("resize", update2); }); const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : 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 hide2 = hide; var limitShift2 = limitShift; var computePosition2 = (reference, floating, options) => { const cache = /* @__PURE__ */ new Map(); const mergedOptions = { platform: platform2, ...options }; const platformWithCache = { ...mergedOptions.platform, _c: cache }; return computePosition(reference, floating, { ...mergedOptions, platform: platformWithCache }); }; // node_modules/@base-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs var React28 = __toESM(require_react(), 1); var import_react2 = __toESM(require_react(), 1); var ReactDOM3 = __toESM(require_react_dom(), 1); var isClient = typeof document !== "undefined"; var noop2 = function noop3() { }; var index = isClient ? import_react2.useLayoutEffect : noop2; 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 = React28.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 } = options; const [data, setData] = React28.useState({ x: 0, y: 0, strategy, placement, middlewareData: {}, isPositioned: false }); const [latestMiddleware, setLatestMiddleware] = React28.useState(middleware); if (!deepEqual(latestMiddleware, middleware)) { setLatestMiddleware(middleware); } const [_reference, _setReference] = React28.useState(null); const [_floating, _setFloating] = React28.useState(null); const setReference = React28.useCallback((node) => { if (node !== referenceRef.current) { referenceRef.current = node; _setReference(node); } }, []); const setFloating = React28.useCallback((node) => { if (node !== floatingRef.current) { floatingRef.current = node; _setFloating(node); } }, []); const referenceEl = externalReference || _reference; const floatingEl = externalFloating || _floating; const referenceRef = React28.useRef(null); const floatingRef = React28.useRef(null); const dataRef = React28.useRef(data); const hasWhileElementsMounted = whileElementsMounted != null; const whileElementsMountedRef = useLatestRef(whileElementsMounted); const platformRef = useLatestRef(platform3); const openRef = useLatestRef(open); const update2 = React28.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 (open === false && dataRef.current.isPositioned) { dataRef.current.isPositioned = false; setData((data2) => ({ ...data2, isPositioned: false })); } }, [open]); const isMountedRef = React28.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 = React28.useMemo(() => ({ reference: referenceRef, floating: floatingRef, setReference, setFloating }), [setReference, setFloating]); const elements = React28.useMemo(() => ({ reference: referenceEl, floating: floatingEl }), [referenceEl, floatingEl]); const floatingStyles = React28.useMemo(() => { const initialStyles = { position: strategy, left: 0, top: 0 }; if (!elements.floating) { return initialStyles; } const x = roundByDPR(elements.floating, data.x); const y = roundByDPR(elements.floating, data.y); if (transform) { return { ...initialStyles, transform: "translate(" + x + "px, " + y + "px)", ...getDPR(elements.floating) >= 1.5 && { willChange: "transform" } }; } return { position: strategy, left: x, top: y }; }, [strategy, transform, elements.floating, data.x, data.y]); return React28.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] }; }; var hide3 = (options, deps) => { const result = hide2(options); return { name: result.name, fn: result.fn, options: [options, deps] }; }; // node_modules/@base-ui/react/esm/utils/popups/popupStoreUtils.js var React33 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js var React32 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/store/createSelector.js var createSelector = (a, b, c, d, e, f, ...other) => { if (other.length > 0) { throw new Error(true ? "Unsupported number of selectors" : formatErrorMessage_default(1)); } let selector; if (a && b && c && d && e && f) { selector = (state, a1, a2, a3) => { const va = a(state, a1, a2, a3); const vb = b(state, a1, a2, a3); const vc = c(state, a1, a2, a3); const vd = d(state, a1, a2, a3); const ve = e(state, a1, a2, a3); return f(va, vb, vc, vd, ve, a1, a2, a3); }; } else if (a && b && c && d && e) { selector = (state, a1, a2, a3) => { const va = a(state, a1, a2, a3); const vb = b(state, a1, a2, a3); const vc = c(state, a1, a2, a3); const vd = d(state, a1, a2, a3); return e(va, vb, vc, vd, a1, a2, a3); }; } else if (a && b && c && d) { selector = (state, a1, a2, a3) => { const va = a(state, a1, a2, a3); const vb = b(state, a1, a2, a3); const vc = c(state, a1, a2, a3); return d(va, vb, vc, a1, a2, a3); }; } else if (a && b && c) { selector = (state, a1, a2, a3) => { const va = a(state, a1, a2, a3); const vb = b(state, a1, a2, a3); return c(va, vb, a1, a2, a3); }; } else if (a && b) { selector = (state, a1, a2, a3) => { const va = a(state, a1, a2, a3); return b(va, a1, a2, a3); }; } else if (a) { selector = a; } else { throw ( /* minify-error-disabled */ new Error("Missing arguments") ); } return selector; }; // node_modules/@base-ui/utils/esm/store/useStore.js var React30 = __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/esm/fastHooks.js var React29 = __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__ */ React29.forwardRef(fastComponent(fn)); } function createInstance() { return { didInitialize: false }; } // node_modules/@base-ui/utils/esm/store/useStore.js var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19); var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy; function useStore(store, selector, a1, a2, a3) { return useStoreImplementation(store, selector, a1, a2, a3); } function useStoreR19(store, selector, a1, a2, a3) { const getSelection = React30.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, 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 (hook.didChange || !Object.is(hook.value, value)) { didChange2 = true; hook.value = value; hook.didChange = false; } } 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, selector, a1, a2, a3) { const instance = getInstance(); if (!instance) { return useStoreR19(store, selector, a1, a2, a3); } const index2 = instance.syncIndex; instance.syncIndex += 1; let hook; if (!instance.didInitialize) { hook = { store, selector, a1, a2, a3, value: selector(store.getSnapshot(), a1, a2, a3), didChange: false }; instance.syncHooks.push(hook); } else { hook = instance.syncHooks[index2]; if (hook.store !== store || hook.selector !== selector || !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 = selector; hook.a1 = a1; hook.a2 = a2; hook.a3 = a3; hook.didChange = true; } } return hook.value; } function useStoreLegacy(store, selector, a1, a2, a3) { return (0, import_with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3)); } // node_modules/@base-ui/utils/esm/store/Store.js var Store = class { /** * 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. * * @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(selector, a1, a2, a3) { return useStore(this, selector, a1, a2, a3); } }; // node_modules/@base-ui/utils/esm/store/ReactStore.js var React31 = __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) { React31.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. * * 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`). */ useSyncedValues(statePart) { const store = this; if (true) { React31.useDebugValue(statePart, (p) => Object.keys(p)); const keys = React31.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) { React31.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 selector = this.selectors[key]; return selector(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) { React31.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) { React31.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 = React31.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(selector, listener) { let selectFn; if (typeof selector === "function") { selectFn = selector; } else { selectFn = this.selectors[selector]; } 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/esm/floating-ui-react/components/FloatingRootStore.js var selectors = { open: createSelector((state) => state.open), transitionStatus: createSelector((state) => state.transitionStatus), domReferenceElement: createSelector((state) => state.domReferenceElement), referenceElement: createSelector((state) => state.positionReference ?? state.referenceElement), floatingElement: createSelector((state) => state.floatingElement), floatingId: createSelector((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/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js function useSyncedFloatingRootContext(options) { const { popupStore, treatPopupAsFloatingElement = false, floatingRootContext: floatingRootContextProp, floatingId, nested, onOpenChange } = options; const open = 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 = React32.useRef(null); if (floatingRootContextProp === void 0 && internalStoreRef.current === null) { internalStoreRef.current = new FloatingRootStore({ open, 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, floatingId, referenceElement, floatingElement }; if (isElement(referenceElement)) { valuesToSync.domReferenceElement = referenceElement; } if (store.state.positionReference === store.state.referenceElement) { valuesToSync.positionReference = referenceElement; } store.update(valuesToSync); }, [open, floatingId, referenceElement, floatingElement, store]); store.context.onOpenChange = handleOpenChange; store.context.nested = nested; return store; } // node_modules/@base-ui/react/esm/utils/popups/popupStoreUtils.js var FOCUSABLE_POPUP_PROPS = { tabIndex: -1, [FOCUSABLE_ATTRIBUTE]: "" }; function usePopupStore(externalStore, createStore, treatPopupAsFloatingElement = false) { const floatingId = useId(); const nested = useFloatingParentNodeId() != null; const internalStoreRef = React33.useRef(null); if (externalStore === void 0 && internalStoreRef.current === null) { internalStoreRef.current = createStore(floatingId, nested); } const store = externalStore ?? internalStoreRef.current; useSyncedFloatingRootContext({ popupStore: store, treatPopupAsFloatingElement, floatingRootContext: store.state.floatingRootContext, floatingId, nested, onOpenChange: store.setOpen }); return { store, internalStore: internalStoreRef.current }; } function useTriggerRegistration(id, store) { const registeredElementIdRef = React33.useRef(null); const registeredElementRef = React33.useRef(null); return React33.useCallback((element) => { if (id === void 0) { return; } let shouldSyncTriggerCount = false; if (registeredElementIdRef.current !== null) { const registeredId = registeredElementIdRef.current; const registeredElement = registeredElementRef.current; const currentElement = store.context.triggerElements.getById(registeredId); if (registeredElement && currentElement === registeredElement) { store.context.triggerElements.delete(registeredId); shouldSyncTriggerCount = true; } registeredElementIdRef.current = null; registeredElementRef.current = null; } if (element !== null) { registeredElementIdRef.current = id; registeredElementRef.current = element; store.context.triggerElements.add(id, element); shouldSyncTriggerCount = true; } if (shouldSyncTriggerCount) { const triggerCount = store.context.triggerElements.size; if (store.select("open") && store.state.triggerCount !== triggerCount) { store.set("triggerCount", triggerCount); } } }, [store, id]); } function setOpenTriggerState(state, open, trigger) { const triggerId = trigger?.id ?? null; if (triggerId || open) { state.activeTriggerId = triggerId; state.activeTriggerElement = trigger ?? null; } } function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) { const isMountedByThisTrigger = store.useState("isMountedByTrigger", triggerId); const baseRegisterTrigger = useTriggerRegistration(triggerId, store); const registerTrigger = useStableCallback((element) => { baseRegisterTrigger(element); if (!element) { return; } const open = store.select("open"); const activeTriggerId = store.select("activeTriggerId"); if (activeTriggerId === triggerId) { store.update({ activeTriggerElement: element, ...open ? stateUpdates : null }); return; } if (activeTriggerId == null && open) { store.update({ activeTriggerId: triggerId, activeTriggerElement: element, ...stateUpdates }); } }); useIsoLayoutEffect(() => { if (isMountedByThisTrigger) { store.update({ activeTriggerElement: triggerElementRef.current, ...stateUpdates }); } }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]); return { registerTrigger, isMountedByThisTrigger }; } function useImplicitActiveTrigger(store) { const open = store.useState("open"); const reactiveTriggerCount = store.useState("triggerCount"); useIsoLayoutEffect(() => { if (!open) { 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; } if (!store.select("activeTriggerId") && triggerCount === 1) { const iteratorResult = store.context.triggerElements.entries().next(); if (!iteratorResult.done) { const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; stateUpdates.activeTriggerId = implicitTriggerId; stateUpdates.activeTriggerElement = implicitTriggerElement; } } if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0) { store.update(stateUpdates); } }, [open, store, reactiveTriggerCount]); } function useOpenStateTransitions(open, store, onUnmount) { const { mounted, setMounted, transitionStatus } = useTransitionStatus(open); store.useSyncedValues({ mounted, transitionStatus }); const forceUnmount = useStableCallback(() => { setMounted(false); store.update({ activeTriggerId: null, activeTriggerElement: null, mounted: false, preventUnmountingOnClose: false }); onUnmount?.(); store.context.onOpenChangeComplete?.(false); }); const preventUnmountingOnClose = store.useState("preventUnmountingOnClose"); useOpenChangeComplete({ enabled: mounted && !open && !preventUnmountingOnClose, open, ref: store.context.popupRef, onComplete() { if (!open) { 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/esm/utils/popups/popupTriggerMap.js var PopupTriggerMap = class { constructor() { this.elementsSet = /* @__PURE__ */ new Set(); 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) { const existingElement = this.idMap.get(id); if (existingElement === element) { return; } if (existingElement !== void 0) { this.elementsSet.delete(existingElement); } this.elementsSet.add(element); this.idMap.set(id, element); if (true) { if (this.elementsSet.size !== this.idMap.size) { throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); } } } /** * Removes the trigger element with the given ID. */ delete(id) { const element = this.idMap.get(id); if (element) { this.elementsSet.delete(element); this.idMap.delete(id); } } /** * Whether the given element is registered as a trigger. */ hasElement(element) { return this.elementsSet.has(element); } /** * Whether there is a registered trigger element matching the given predicate. */ hasMatchingElement(predicate) { for (const element of this.elementsSet) { 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.elementsSet.values(); } /** * Returns the number of registered trigger elements. */ get size() { return this.idMap.size; } }; // node_modules/@base-ui/react/esm/floating-ui-react/utils/getEmptyRootContext.js function getEmptyRootContext() { return new FloatingRootStore({ open: false, transitionStatus: void 0, floatingElement: null, referenceElement: null, triggerElements: new PopupTriggerMap(), floatingId: void 0, syncOnly: false, nested: false, onOpenChange: void 0 }); } // node_modules/@base-ui/react/esm/utils/popups/store.js function createInitialPopupStoreState() { return { open: false, openProp: void 0, mounted: false, transitionStatus: void 0, floatingRootContext: getEmptyRootContext(), floatingId: void 0, 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 }; } function createPopupFloatingRootContext(triggerElements, floatingId, nested = false) { return new FloatingRootStore({ open: false, transitionStatus: void 0, floatingElement: null, referenceElement: null, triggerElements, floatingId, syncOnly: true, nested, onOpenChange: void 0 }); } var activeTriggerIdSelector = createSelector((state) => state.triggerIdProp ?? state.activeTriggerId); var openSelector = createSelector((state) => state.openProp ?? state.open); var popupIdSelector = createSelector((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: createSelector((state) => state.mounted), transitionStatus: createSelector((state) => state.transitionStatus), floatingRootContext: createSelector((state) => state.floatingRootContext), triggerCount: createSelector((state) => state.triggerCount), preventUnmountingOnClose: createSelector((state) => state.preventUnmountingOnClose), payload: createSelector((state) => state.payload), activeTriggerId: activeTriggerIdSelector, activeTriggerElement: createSelector((state) => state.mounted ? state.activeTriggerElement : null), popupId: popupIdSelector, /** * Whether the trigger with the given ID was used to open the popup. */ isTriggerActive: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId), /** * Whether the popup is open and was activated by a trigger with the given ID. */ isOpenedByTrigger: createSelector((state, triggerId) => triggerOwnsOpenPopup(state, triggerId)), /** * Whether the popup is mounted and was activated by a trigger with the given ID. */ isMountedByTrigger: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted), triggerProps: createSelector((state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps), /** * Popup id for the trigger that currently owns the open popup. */ triggerPopupId: createSelector((state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0), popupProps: createSelector((state) => state.popupProps), popupElement: createSelector((state) => state.popupElement), positionerElement: createSelector((state) => state.positionerElement) }; // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloatingRootContext.js function useFloatingRootContext(options) { const { open = false, onOpenChange, elements = {} } = options; const floatingId = useId(); const nested = useFloatingParentNodeId() != null; if (true) { const optionDomReference = elements.reference; if (optionDomReference && !isElement(optionDomReference)) { console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead."); } } const store = useRefWithInit(() => new FloatingRootStore({ open, transitionStatus: void 0, onOpenChange, referenceElement: elements.reference ?? null, floatingElement: elements.floating ?? null, triggerElements: new PopupTriggerMap(), floatingId, syncOnly: false, nested })).current; useIsoLayoutEffect(() => { const valuesToSync = { open, floatingId }; if (elements.reference !== void 0) { valuesToSync.referenceElement = elements.reference; valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null; } if (elements.floating !== void 0) { valuesToSync.floatingElement = elements.floating; } store.update(valuesToSync); }, [open, floatingId, elements.reference, elements.floating, store]); store.context.onOpenChange = onOpenChange; store.context.nested = nested; return store; } // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloating.js function useFloating2(options = {}) { const { nodeId, externalTree } = options; const internalStore = useFloatingRootContext(options); const store = options.rootContext || internalStore; const referenceElement = store.useState("referenceElement"); const floatingElement = store.useState("floatingElement"); const domReferenceElement = store.useState("domReferenceElement"); const open = store.useState("open"); const floatingId = store.useState("floatingId"); const [positionReference, setPositionReferenceRaw] = React34.useState(null); const [localDomReference, setLocalDomReference] = React34.useState(void 0); const [localFloatingElement, setLocalFloatingElement] = React34.useState(void 0); const domReferenceRef = React34.useRef(null); const tree = useFloatingTree(externalTree); const storeElements = React34.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 = React34.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 = React34.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 = React34.useCallback((node) => { setLocalFloatingElement(node); position.refs.setFloating(node); }, [position.refs]); const refs = React34.useMemo(() => ({ ...position.refs, setReference, setFloating, setPositionReference, domReference: domReferenceRef }), [position.refs, setReference, setFloating, setPositionReference]); const elements = React34.useMemo(() => ({ ...position.elements, domReference: domReferenceElement }), [position.elements, domReferenceElement]); const context = React34.useMemo(() => ({ ...position, dataRef: store.context.dataRef, open, onOpenChange: store.setOpen, events: store.context.events, floatingId, refs, elements, nodeId, rootStore: store }), [position, refs, elements, nodeId, store, open, 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 React34.useMemo(() => ({ ...position, context, refs, elements, rootStore: store }), [position, refs, elements, context, store]); } // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFocus.js var React35 = __toESM(require_react(), 1); var isMacSafari = isMac && isSafari; function useFocus(context, props = {}) { const { enabled = true, delay } = props; const store = "rootStore" in context ? context.rootStore : context; const { events, dataRef } = store.context; const blockFocusRef = React35.useRef(false); const blockedReferenceRef = React35.useRef(null); const keyboardModalityRef = React35.useRef(true); const timeout = useTimeout(); React35.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; } } 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]); React35.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 = React35.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 React35.useMemo(() => enabled ? { reference, trigger: reference } : {}, [enabled, reference]); } // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js var React36 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js 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/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js function useHoverFloatingInteraction(context, parameters = {}) { const { enabled = true, closeDelay: closeDelayProp = 0, nodeId: nodeIdProp } = parameters; const store = "rootStore" in context ? context.rootStore : context; const open = 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 (!open) { instance.pointerType = void 0; instance.restTimeoutPending = false; instance.interactedInside = false; clearPointerEvents(); } }, [open, instance, clearPointerEvents]); React36.useEffect(() => { return clearPointerEvents; }, [clearPointerEvents]); useIsoLayoutEffect(() => { if (!enabled) { return void 0; } if (open && 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, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); React36.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 (!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, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]); } // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js var React37 = __toESM(require_react(), 1); var ReactDOM4 = __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 } = props; const store = "rootStore" in context ? context.rootStore : context; const { dataRef, events } = store.context; const tree = useFloatingTree(externalTree); const instance = useHoverInteractionSharedState(store); const isHoverCloseActiveRef = React37.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 = handleCloseRef.current?.__options; } React37.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); React37.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]); React37.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); } } if (move) { return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, { once: true }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave)); } return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave)); }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen]); return React37.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") { ReactDOM4.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/esm/floating-ui-react/hooks/useListNavigation.js var React38 = __toESM(require_react(), 1); var ESCAPE = "Escape"; 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, cols) { const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT; const horizontal = key === ARROW_UP; if (orientation === "both" || orientation === "horizontal" && cols && cols > 1) { 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, cols = 1, id, resetOnPointerLeave = true, externalTree } = props; 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" && cols > 1) { console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'); } } const store = "rootStore" in context ? context.rootStore : context; const open = 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 = React38.useRef(focusItemOnOpen); const indexRef = React38.useRef(selectedIndex ?? -1); const keyRef = React38.useRef(null); const isPointerModalityRef = React38.useRef(true); const onNavigate = useStableCallback((event) => { onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event); }); const previousOnNavigateRef = React38.useRef(onNavigate); const previousMountedRef = React38.useRef(!!floatingElement); const previousOpenRef = React38.useRef(open); const forceSyncFocusRef = React38.useRef(false); const forceScrollIntoViewRef = React38.useRef(false); const cancelQueuedFocusRef = React38.useRef(null); const disabledIndicesRef = useValueAsRef(disabledIndices); const latestOpenRef = useValueAsRef(open); 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 (open && floatingElement) { indexRef.current = selectedIndex ?? -1; if (focusItemOnOpenRef.current && selectedIndex != null) { forceScrollIntoViewRef.current = true; onNavigate(); } } else if (previousMountedRef.current) { indexRef.current = -1; previousOnNavigateRef.current(); } }, [enabled, open, floatingElement, selectedIndex, onNavigate]); useIsoLayoutEffect(() => { if (!enabled) { return; } if (!open) { 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, open, 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(floatingElement)); const treeContainsActiveEl = nodes.some((node) => node.context && contains(node.context.elements.floating, activeEl)); if (parent && !treeContainsActiveEl && isPointerModalityRef.current) { parent.focus({ preventScroll: true }); } }, [enabled, floatingElement, tree, parentId, virtual]); useIsoLayoutEffect(() => { previousOnNavigateRef.current = onNavigate; previousOpenRef.current = open; previousMountedRef.current = !!floatingElement; }); useIsoLayoutEffect(() => { if (!open) { keyRef.current = null; focusItemOnOpenRef.current = focusItemOnOpen; } }, [open, 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, cols)) { 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 (cols > 1) { const sizes = Array.from({ length: listRef.current.length }, () => ({ width: 1, height: 1 })); const cellMap = createGridCellMap(sizes, cols, false); const minGridIndex = cellMap.findIndex((index3) => index3 != null && !isListIndexDisabled(listRef.current, index3, disabledIndices)); const maxGridIndex = cellMap.reduce((foundIndex, index3, cellIndex) => index3 != null && !isListIndexDisabled(listRef.current, index3, disabledIndices) ? cellIndex : foundIndex, -1); const index2 = cellMap[getGridNavigatedIndex(cellMap.map((itemIndex) => itemIndex != null ? listRef.current[itemIndex] : null), { event, orientation, loopFocus, rtl, cols, // treat undefined (empty grid spaces) as disabled indices so we // don't end up in them disabledIndices: getGridCellIndices([...(typeof disabledIndices !== "function" ? disabledIndices : null) || listRef.current.map((_, listIndex) => isListIndexDisabled(listRef.current, listIndex, disabledIndices) ? listIndex : void 0), void 0], cellMap), minIndex: minGridIndex, maxIndex: maxGridIndex, prevIndex: getGridCellIndexOfCorner( indexRef.current > maxIndex ? minIndex : indexRef.current, sizes, cellMap, cols, // use a corner matching the edge closest to the direction // we're moving in so we don't end up in the same item. Prefer // top/left over bottom/right. // eslint-disable-next-line no-nested-ternary event.key === ARROW_DOWN ? "bl" : event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT) ? "tr" : "tl" ), stopEvent: true })]; if (index2 != null) { indexRef.current = index2; onNavigate(event); } if (orientation === "both") { return; } } if (isMainOrientationKey(event.key, orientation)) { stopEvent(event); if (open && !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 = React38.useMemo(() => { const itemProps = { onFocus(event) { forceSyncFocusRef.current = true; syncCurrentTarget(event); }, onClick: ({ currentTarget }) => currentTarget.focus({ preventScroll: true }), // Safari onMouseMove(event) { 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 = React38.useMemo(() => { return virtual && open && hasActiveIndex && { "aria-activedescendant": `${id}-${activeIndex}` }; }, [virtual, open, hasActiveIndex, id, activeIndex]); const floating = React38.useMemo(() => { return { "aria-orientation": orientation === "both" ? void 0 : orientation, ...!typeableComboboxReference ? ariaActiveDescendantProp : {}, onKeyDown(event) { if (event.key === "Tab" && event.shiftKey && open && !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() { isPointerModalityRef.current = true; } }; }, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, orientation, typeableComboboxReference, store, open, virtual, domReferenceElement]); const trigger = React38.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 = React38.useMemo(() => { return { ...ariaActiveDescendantProp, ...trigger }; }, [ariaActiveDescendantProp, trigger]); return React38.useMemo(() => enabled ? { reference, floating, item, trigger } : {}, [enabled, reference, floating, trigger, item]); } // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useTypeahead.js var React39 = __toESM(require_react(), 1); function useTypeahead(context, props) { const { listRef, elementsRef, activeIndex, onMatch: onMatchProp, onTyping, enabled = true, resetMs = 750, selectedIndex = null } = props; const store = "rootStore" in context ? context.rootStore : context; const open = store.useState("open"); const timeout = useTimeout(); const stringRef = React39.useRef(""); const prevIndexRef = React39.useRef(selectedIndex ?? activeIndex ?? -1); const matchIndexRef = React39.useRef(null); const onKeyDown = useStableCallback((event) => { function isVisible(index3) { const element = elementsRef?.current[index3]; return !element || isElementVisible(element); } function getMatchingIndex(list, string, startIndex2 = 0) { if (list.length === 0) { return -1; } const normalizedStartIndex = (startIndex2 % list.length + list.length) % list.length; const lowerString = string.toLocaleLowerCase(); for (let offset4 = 0; offset4 < list.length; offset4 += 1) { const index3 = (normalizedStartIndex + offset4) % list.length; const text = list[index3]; if (!text?.toLocaleLowerCase().startsWith(lowerString) || !isVisible(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 (open && event.key !== " ") { stopEvent(event); onTyping?.(true); } const isNewSession = stringRef.current === ""; if (isNewSession) { prevIndexRef.current = selectedIndex ?? activeIndex ?? -1; } const allowRapidSuccessionOfFirstLetter = listContent.every((text) => text ? text[0]?.toLocaleLowerCase() !== text[1]?.toLocaleLowerCase() : 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 (!open && selectedIndex !== null) { return; } timeout.clear(); matchIndexRef.current = null; if (stringRef.current !== "") { stringRef.current = ""; } }, [open, selectedIndex, timeout]); useIsoLayoutEffect(() => { if (open && stringRef.current === "") { prevIndexRef.current = selectedIndex ?? activeIndex ?? -1; } }, [open, selectedIndex, activeIndex]); const sharedProps = React39.useMemo(() => ({ onKeyDown, onBlur }), [onKeyDown, onBlur]); return React39.useMemo(() => enabled ? { reference: sharedProps, floating: sharedProps } : {}, [enabled, sharedProps]); } // node_modules/@base-ui/react/esm/floating-ui-react/safePolygon.js 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, y, 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 || x == null || y == 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 = x > rect.right - rect.width / 2; const cursorLeaveFromBottom = y > 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" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= 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 ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; const cursorPointY = y + 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 ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; const cursorPointY = y - 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 ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; const cursorPointX = x + 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 ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; const cursorPointX = x - 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/esm/utils/popupStateMapping.js var CommonPopupDataAttributes = (function(CommonPopupDataAttributes2) { CommonPopupDataAttributes2["open"] = "data-open"; CommonPopupDataAttributes2["closed"] = "data-closed"; CommonPopupDataAttributes2[CommonPopupDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; CommonPopupDataAttributes2[CommonPopupDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; CommonPopupDataAttributes2["anchorHidden"] = "data-anchor-hidden"; CommonPopupDataAttributes2["side"] = "data-side"; CommonPopupDataAttributes2["align"] = "data-align"; return CommonPopupDataAttributes2; })({}); var CommonTriggerDataAttributes = /* @__PURE__ */ (function(CommonTriggerDataAttributes2) { CommonTriggerDataAttributes2["popupOpen"] = "data-popup-open"; CommonTriggerDataAttributes2["pressed"] = "data-pressed"; return CommonTriggerDataAttributes2; })({}); var TRIGGER_HOOK = { [CommonTriggerDataAttributes.popupOpen]: "" }; var PRESSABLE_TRIGGER_HOOK = { [CommonTriggerDataAttributes.popupOpen]: "", [CommonTriggerDataAttributes.pressed]: "" }; var POPUP_OPEN_HOOK = { [CommonPopupDataAttributes.open]: "" }; var POPUP_CLOSED_HOOK = { [CommonPopupDataAttributes.closed]: "" }; var ANCHOR_HIDDEN_HOOK = { [CommonPopupDataAttributes.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; } }; // node_modules/@base-ui/utils/esm/inertValue.js function inertValue(value) { if (isReactVersionAtLeast(19)) { return value; } return value ? "true" : void 0; } // node_modules/@base-ui/react/esm/utils/InternalBackdrop.js var React40 = __toESM(require_react(), 1); var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); var InternalBackdrop = /* @__PURE__ */ React40.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_runtime10.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/esm/utils/useOpenInteractionType.js var React43 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/useEnhancedClickHandler.js var React41 = __toESM(require_react(), 1); function useEnhancedClickHandler(handler) { const lastClickInteractionTypeRef = React41.useRef(""); const handlePointerDown = React41.useCallback((event) => { if (event.defaultPrevented) { return; } lastClickInteractionTypeRef.current = event.pointerType; handler(event, event.pointerType); }, [handler]); const handleClick = React41.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/esm/internals/useValueChanged.js var React42 = __toESM(require_react(), 1); function useValueChanged(value, onChange) { const valueRef = React42.useRef(value); const onChangeCallback = useStableCallback(onChange); useIsoLayoutEffect(() => { if (valueRef.current === value) { return; } onChangeCallback(valueRef.current); }, [value, onChangeCallback]); useIsoLayoutEffect(() => { valueRef.current = value; }, [value]); } // node_modules/@base-ui/react/esm/utils/useOpenInteractionType.js function useOpenMethodTriggerProps(open, setOpenMethod) { const handleTriggerClick = useStableCallback((_, interactionType) => { const isOpen = typeof open === "function" ? open() : open; 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. (isIOS ? "touch" : "")); } }); const { onClick, onPointerDown } = useEnhancedClickHandler(handleTriggerClick); return React43.useMemo(() => ({ onClick, onPointerDown }), [onClick, onPointerDown]); } function useOpenInteractionType(open) { const [openMethod, setOpenMethod] = React43.useState(null); const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod); useValueChanged(open, (previousOpen) => { if (previousOpen && !open) { setOpenMethod(null); } }); return React43.useMemo(() => ({ openMethod, triggerProps }), [openMethod, triggerProps]); } // node_modules/@base-ui/react/esm/autocomplete/index.parts.js var index_parts_exports = {}; __export(index_parts_exports, { Arrow: () => ComboboxArrow, Backdrop: () => ComboboxBackdrop, Clear: () => ComboboxClear, Collection: () => ComboboxCollection, Empty: () => ComboboxEmpty, Group: () => ComboboxGroup, GroupLabel: () => ComboboxGroupLabel, Icon: () => ComboboxIcon, Input: () => ComboboxInput, InputGroup: () => AutocompleteInputGroup, Item: () => AutocompleteItem, List: () => ComboboxList, Popup: () => ComboboxPopup, Portal: () => ComboboxPortal, Positioner: () => ComboboxPositioner, Root: () => AutocompleteRoot, Row: () => ComboboxRow, Separator: () => Separator, Status: () => ComboboxStatus, Trigger: () => AutocompleteTrigger, Value: () => AutocompleteValue, useFilter: () => useCoreFilter, useFilteredItems: () => useFilteredItems }); // node_modules/@base-ui/react/esm/autocomplete/root/AutocompleteRoot.js var React53 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/root/AriaCombobox.js var React52 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/root/ComboboxRootContext.js var React44 = __toESM(require_react(), 1); var ComboboxRootContext = /* @__PURE__ */ React44.createContext(void 0); if (true) ComboboxRootContext.displayName = "ComboboxRootContext"; var ComboboxFloatingContext = /* @__PURE__ */ React44.createContext(void 0); if (true) ComboboxFloatingContext.displayName = "ComboboxFloatingContext"; var ComboboxDerivedItemsContext = /* @__PURE__ */ React44.createContext(void 0); if (true) ComboboxDerivedItemsContext.displayName = "ComboboxDerivedItemsContext"; var ComboboxInputValueContext = /* @__PURE__ */ React44.createContext(""); if (true) ComboboxInputValueContext.displayName = "ComboboxInputValueContext"; function useComboboxRootContext() { const context = React44.useContext(ComboboxRootContext); if (!context) { throw new Error(true ? "Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage_default(22)); } return context; } function useComboboxFloatingContext() { const context = React44.useContext(ComboboxFloatingContext); if (!context) { throw new Error(true ? "Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage_default(23)); } return context; } function useComboboxDerivedItemsContext() { const context = React44.useContext(ComboboxDerivedItemsContext); if (!context) { throw new Error(true ? "Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage_default(24)); } return context; } function useComboboxInputValueContext() { return React44.useContext(ComboboxInputValueContext); } // node_modules/@base-ui/react/esm/internals/itemEquality.js var defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue); function compareItemEquality(itemValue, selectedValue, comparer) { if (itemValue == null || selectedValue == null) { return Object.is(itemValue, selectedValue); } return comparer(itemValue, selectedValue); } function selectedValueIncludes(selectedValues, itemValue, comparer) { if (!selectedValues || selectedValues.length === 0) { return false; } return selectedValues.some((selectedValue) => { if (selectedValue === void 0) { return false; } return compareItemEquality(itemValue, selectedValue, comparer); }); } function findItemIndex(itemValues, selectedValue, comparer) { if (!itemValues || itemValues.length === 0) { return -1; } return itemValues.findIndex((itemValue) => { if (itemValue === void 0) { return false; } return compareItemEquality(itemValue, selectedValue, comparer); }); } function removeItem(selectedValues, itemValue, comparer) { return selectedValues.filter((selectedValue) => !compareItemEquality(itemValue, selectedValue, comparer)); } // node_modules/@base-ui/react/esm/internals/resolveValueLabel.js var React45 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/internals/serializeValue.js function serializeValue(value) { if (value == null) { return ""; } if (typeof value === "string") { return value; } try { return JSON.stringify(value); } catch { return String(value); } } // node_modules/@base-ui/react/esm/internals/resolveValueLabel.js var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); function isGroupedItems(items) { return items != null && items.length > 0 && typeof items[0] === "object" && items[0] != null && "items" in items[0]; } function hasNullItemLabel(items) { if (!Array.isArray(items)) { return items != null && "null" in items; } const arrayItems = items; if (isGroupedItems(arrayItems)) { for (const group of arrayItems) { for (const item of group.items) { if (item && item.value == null && item.label != null) { return true; } } } return false; } for (const item of arrayItems) { if (item && item.value == null && item.label != null) { return true; } } return false; } function stringifyAsLabel(item, itemToStringLabel) { if (itemToStringLabel && item != null) { return itemToStringLabel(item) ?? ""; } if (item && typeof item === "object") { if ("label" in item && item.label != null) { return String(item.label); } if ("value" in item) { return String(item.value); } } return serializeValue(item); } function stringifyAsValue(item, itemToStringValue) { if (itemToStringValue && item != null) { return itemToStringValue(item) ?? ""; } if (item && typeof item === "object" && "value" in item && "label" in item) { return serializeValue(item.value); } return serializeValue(item); } // node_modules/@base-ui/react/esm/combobox/store.js var selectors2 = { id: createSelector((state) => state.id), labelId: createSelector((state) => state.labelId), items: createSelector((state) => state.items), selectedValue: createSelector((state) => state.selectedValue), hasSelectionChips: createSelector((state) => { const selectedValue = state.selectedValue; return Array.isArray(selectedValue) && selectedValue.length > 0; }), hasSelectedValue: createSelector((state) => { const { selectedValue, selectionMode } = state; if (selectedValue == null) { return false; } if (selectionMode === "multiple" && Array.isArray(selectedValue)) { return selectedValue.length > 0; } return true; }), hasNullItemLabel: createSelector((state, enabled) => { return enabled ? hasNullItemLabel(state.items) : false; }), open: createSelector((state) => state.open), mounted: createSelector((state) => state.mounted), forceMounted: createSelector((state) => state.forceMounted), inline: createSelector((state) => state.inline), activeIndex: createSelector((state) => state.activeIndex), selectedIndex: createSelector((state) => state.selectedIndex), isActive: createSelector((state, index2) => state.activeIndex === index2), isSelected: createSelector((state, itemValue) => { const comparer = state.isItemEqualToValue; const selectedValue = state.selectedValue; if (Array.isArray(selectedValue)) { return selectedValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer)); } return compareItemEquality(itemValue, selectedValue, comparer); }), transitionStatus: createSelector((state) => state.transitionStatus), popupProps: createSelector((state) => state.popupProps), inputProps: createSelector((state) => state.inputProps), triggerProps: createSelector((state) => state.triggerProps), itemProps: createSelector((state) => state.itemProps), positionerElement: createSelector((state) => state.positionerElement), listElement: createSelector((state) => state.listElement), triggerElement: createSelector((state) => state.triggerElement), inputElement: createSelector((state) => state.inputElement), inputGroupElement: createSelector((state) => state.inputGroupElement), popupSide: createSelector((state) => state.popupSide), openMethod: createSelector((state) => state.openMethod), inputInsidePopup: createSelector((state) => state.inputInsidePopup), inputOwnsFormValue: createSelector((state) => state.inputOwnsFormValue), selectionMode: createSelector((state) => state.selectionMode), name: createSelector((state) => state.name), form: createSelector((state) => state.form), disabled: createSelector((state) => state.disabled), readOnly: createSelector((state) => state.readOnly), required: createSelector((state) => state.required), grid: createSelector((state) => state.grid), virtualized: createSelector((state) => state.virtualized), itemToStringLabel: createSelector((state) => state.itemToStringLabel), isItemEqualToValue: createSelector((state) => state.isItemEqualToValue), modal: createSelector((state) => state.modal), autoHighlight: createSelector((state) => state.autoHighlight), submitOnItemClick: createSelector((state) => state.submitOnItemClick) }; // node_modules/@base-ui/react/esm/internals/field-root-context/FieldRootContext.js var React46 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/field/control/FieldControlDataAttributes.js var FieldControlDataAttributes = /* @__PURE__ */ (function(FieldControlDataAttributes2) { FieldControlDataAttributes2["disabled"] = "data-disabled"; FieldControlDataAttributes2["valid"] = "data-valid"; FieldControlDataAttributes2["invalid"] = "data-invalid"; FieldControlDataAttributes2["touched"] = "data-touched"; FieldControlDataAttributes2["dirty"] = "data-dirty"; FieldControlDataAttributes2["filled"] = "data-filled"; FieldControlDataAttributes2["focused"] = "data-focused"; return FieldControlDataAttributes2; })({}); // node_modules/@base-ui/react/esm/internals/field-constants/constants.js 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 { [FieldControlDataAttributes.valid]: "" }; } return { [FieldControlDataAttributes.invalid]: "" }; } }; // node_modules/@base-ui/react/esm/internals/field-root-context/FieldRootContext.js 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, touched: DEFAULT_FIELD_STATE_ATTRIBUTES.touched, setTouched: NOOP, dirty: DEFAULT_FIELD_STATE_ATTRIBUTES.dirty, setDirty: NOOP, filled: DEFAULT_FIELD_STATE_ATTRIBUTES.filled, setFilled: NOOP, focused: DEFAULT_FIELD_STATE_ATTRIBUTES.focused, setFocused: NOOP, validate: () => null, validationMode: "onSubmit", validationDebounceTime: 0, shouldValidateOnChange: () => false, state: DEFAULT_FIELD_ROOT_STATE, markedDirtyRef: { current: false }, registerFieldControl: NOOP, validation: { getValidationProps: (props = EMPTY_OBJECT) => props, getInputValidationProps: (props = EMPTY_OBJECT) => props, inputRef: { current: null }, commit: async () => { } } }; var FieldRootContext = /* @__PURE__ */ React46.createContext(DEFAULT_FIELD_ROOT_CONTEXT); if (true) FieldRootContext.displayName = "FieldRootContext"; function useFieldRootContext(optional = true) { const context = React46.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/esm/internals/field-register-control/useRegisterFieldControl.js var React47 = __toESM(require_react(), 1); function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true) { const { registerFieldControl } = useFieldRootContext(); const sourceRef = React47.useRef(null); if (!sourceRef.current) { sourceRef.current = /* @__PURE__ */ Symbol(); } useIsoLayoutEffect(() => { const source = sourceRef.current; if (!source || !enabled) { return void 0; } const registration = { controlRef, getValue: getFormValueOverride, id, value }; registerFieldControl(source, registration); return () => { registerFieldControl(source, void 0); }; }, [controlRef, enabled, getFormValueOverride, id, registerFieldControl, value]); } // node_modules/@base-ui/react/esm/internals/form-context/FormContext.js var React48 = __toESM(require_react(), 1); var FormContext = /* @__PURE__ */ React48.createContext({ formRef: { current: { fields: /* @__PURE__ */ new Map() } }, errors: {}, clearErrors: NOOP, validationMode: "onSubmit", submitAttemptedRef: { current: false } }); if (true) FormContext.displayName = "FormContext"; function useFormContext() { return React48.useContext(FormContext); } // node_modules/@base-ui/react/esm/internals/labelable-provider/useLabelableId.js var React50 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/internals/labelable-provider/LabelableContext.js var React49 = __toESM(require_react(), 1); var LabelableContext = /* @__PURE__ */ React49.createContext({ controlId: void 0, registerControlId: NOOP, labelId: void 0, setLabelId: NOOP, messageIds: [], setMessageIds: NOOP, getDescriptionProps: (externalProps) => externalProps }); if (true) LabelableContext.displayName = "LabelableContext"; function useLabelableContext() { return React49.useContext(LabelableContext); } // node_modules/@base-ui/react/esm/internals/labelable-provider/useLabelableId.js function useLabelableId(params = {}) { const { id, implicit = false, controlRef } = params; const { controlId, registerControlId } = useLabelableContext(); const defaultId = useBaseUiId(id); const controlIdForEffect = implicit ? controlId : void 0; const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol("labelable-control")); const hasRegisteredRef = React50.useRef(false); const hadExplicitIdRef = React50.useRef(id != null); const unregisterControlId = useStableCallback(() => { if (!hasRegisteredRef.current || registerControlId === NOOP) { return; } hasRegisteredRef.current = false; registerControlId(controlSourceRef.current, void 0); }); useIsoLayoutEffect(() => { if (registerControlId === NOOP) { return void 0; } let nextId; if (implicit) { const elem = controlRef?.current; if (isElement(elem) && elem.closest("label") != null) { nextId = id ?? null; } else { nextId = controlIdForEffect ?? defaultId; } } else if (id != null) { hadExplicitIdRef.current = true; nextId = id; } else if (hadExplicitIdRef.current) { nextId = defaultId; } else { unregisterControlId(); return void 0; } if (nextId === void 0) { unregisterControlId(); return void 0; } hasRegisteredRef.current = true; registerControlId(controlSourceRef.current, nextId); return void 0; }, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]); React50.useEffect(() => { return unregisterControlId; }, [unregisterControlId]); return controlId ?? defaultId; } // node_modules/@base-ui/react/esm/combobox/root/utils/index.js function createCollatorItemFilter(collatorFilter, itemToStringLabel) { return (item, query) => { if (item == null) { return false; } const itemString = stringifyAsLabel(item, itemToStringLabel); return collatorFilter.contains(itemString, query); }; } function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue) { return (item, query) => { if (item == null) { return false; } if (!query) { return true; } const itemString = stringifyAsLabel(item, itemToStringLabel); const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, itemToStringLabel) : ""; if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) { return true; } return collatorFilter.contains(itemString, query); }; } // node_modules/@base-ui/react/esm/combobox/root/utils/useFilter.js var React51 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/internals/filter.js var filterCache = /* @__PURE__ */ new Map(); function getFilter(options = {}) { const mergedOptions = { usage: "search", sensitivity: "base", ignorePunctuation: true, ...options }; const cacheKey = `${stringifyLocale(options.locale)}|${JSON.stringify(mergedOptions)}`; const cachedFilter = filterCache.get(cacheKey); if (cachedFilter) { return cachedFilter; } const collator = new Intl.Collator(options.locale, mergedOptions); const filter = { contains(item, query, itemToString) { if (!query) { return true; } const itemString = stringifyAsLabel(item, itemToString); for (let i = 0; i <= itemString.length - query.length; i += 1) { if (collator.compare(itemString.slice(i, i + query.length), query) === 0) { return true; } } return false; }, startsWith(item, query, itemToString) { if (!query) { return true; } const itemString = stringifyAsLabel(item, itemToString); return collator.compare(itemString.slice(0, query.length), query) === 0; }, endsWith(item, query, itemToString) { if (!query) { return true; } const itemString = stringifyAsLabel(item, itemToString); const queryLength = query.length; return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0; } }; filterCache.set(cacheKey, filter); return filter; } function stringifyLocale(locale) { if (Array.isArray(locale)) { return locale.map((value) => stringifyLocale(value)).join(","); } if (locale == null) { return ""; } return String(locale); } // node_modules/@base-ui/react/esm/combobox/root/utils/useFilter.js var useCoreFilter = getFilter; // node_modules/@base-ui/react/esm/combobox/root/utils/constants.js var NO_ACTIVE_VALUE = /* @__PURE__ */ Symbol("none"); var INITIAL_LAST_HIGHLIGHT = { value: NO_ACTIVE_VALUE, index: -1 }; // node_modules/@base-ui/react/esm/combobox/root/AriaCombobox.js var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); function AriaCombobox(props) { const { id: idProp, onOpenChangeComplete: onOpenChangeCompleteProp, defaultSelectedValue = null, selectedValue: selectedValueProp, onSelectedValueChange, defaultInputValue: defaultInputValueProp, inputValue: inputValueProp, open: openProp, defaultOpen = false, selectionMode = "none", onItemHighlighted: onItemHighlightedProp, name: nameProp, form, disabled: disabledProp = false, readOnly = false, required = false, inputRef: inputRefProp, grid = false, items, filteredItems: filteredItemsProp, filter: filterProp, openOnInputClick = true, autoHighlight = false, keepHighlight = false, highlightItemOnHover = true, loopFocus = true, itemToStringLabel, itemToStringValue, isItemEqualToValue = defaultItemEquality, virtualized = false, inline: inlineProp = false, fillInputOnItemPress = true, modal = false, limit = -1, autoComplete = "list", formAutoComplete, locale, submitOnItemClick = false } = props; const { clearErrors } = useFormContext(); const { setDirty, validityData, shouldValidateOnChange, setFilled, name: fieldName, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext(); const direction = useDirection(); const id = useLabelableId({ id: idProp }); const collatorFilter = useCoreFilter({ locale }); const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React52.useState(false); const [closeQuery, setCloseQuery] = React52.useState(null); const listRef = React52.useRef([]); const labelsRef = React52.useRef([]); const popupRef = React52.useRef(null); const inputRef = React52.useRef(null); const startDismissRef = React52.useRef(null); const endDismissRef = React52.useRef(null); const emptyRef = React52.useRef(null); const keyboardActiveRef = React52.useRef(true); const hadInputClearRef = React52.useRef(false); const chipsContainerRef = React52.useRef(null); const clearRef = React52.useRef(null); const selectionEventRef = React52.useRef(null); const lastHighlightRef = React52.useRef(INITIAL_LAST_HIGHLIGHT); const pendingQueryHighlightRef = React52.useRef(null); const valuesRef = React52.useRef([]); const allValuesRef = React52.useRef([]); const disabled2 = fieldDisabled || disabledProp; const name = fieldName ?? nameProp; const multiple = selectionMode === "multiple"; const single = selectionMode === "single"; const hasInputValue = inputValueProp !== void 0 || defaultInputValueProp !== void 0; const hasItems = items !== void 0; const hasFilteredItemsProp = filteredItemsProp !== void 0; let autoHighlightMode; if (autoHighlight === "always") { autoHighlightMode = "always"; } else { autoHighlightMode = autoHighlight ? "input-change" : false; } const [selectedValue, setSelectedValueUnwrapped] = useControlled({ controlled: selectedValueProp, default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY : defaultSelectedValue, name: "Combobox", state: "selectedValue" }); const filter = React52.useMemo(() => { if (filterProp === null) { return () => true; } if (filterProp !== void 0) { return filterProp; } if (single && !queryChangedAfterOpen) { return createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue); } return createCollatorItemFilter(collatorFilter, itemToStringLabel); }, [filterProp, single, selectedValue, queryChangedAfterOpen, collatorFilter, itemToStringLabel]); const initialDefaultInputValue = useRefWithInit(() => { if (hasInputValue) { return defaultInputValueProp ?? ""; } if (single) { return stringifyAsLabel(selectedValue, itemToStringLabel); } return ""; }).current; const [inputValue, setInputValueUnwrapped] = useControlled({ controlled: inputValueProp, default: initialDefaultInputValue, name: "Combobox", state: "inputValue" }); const [open, setOpenUnwrapped] = useControlled({ controlled: openProp, default: defaultOpen, name: "Combobox", state: "open" }); const isGrouped = isGroupedItems(items); const query = closeQuery ?? (inputValue === "" ? "" : String(inputValue).trim()); const selectedLabelString = single ? stringifyAsLabel(selectedValue, itemToStringLabel) : ""; const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString !== "" && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query); const filterQuery = shouldBypassFiltering ? "" : query; const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering; const flatItems = React52.useMemo(() => { if (!items) { return EMPTY_ARRAY; } if (isGrouped) { return items.flatMap((group) => group.items); } return items; }, [items, isGrouped]); const filteredItems = React52.useMemo(() => { if (filteredItemsProp && !shouldIgnoreExternalFiltering) { return filteredItemsProp; } if (!items) { return EMPTY_ARRAY; } if (isGrouped) { const groupedItems = items; const resultingGroups = []; let currentCount = 0; for (const group of groupedItems) { if (limit > -1 && currentCount >= limit) { break; } const candidateItems = filterQuery === "" ? group.items : group.items.filter((item) => filter(item, filterQuery, itemToStringLabel)); if (candidateItems.length === 0) { continue; } const remainingLimit = limit > -1 ? limit - currentCount : Infinity; const itemsToTake = candidateItems.slice(0, remainingLimit); if (itemsToTake.length > 0) { const newGroup = { ...group, items: itemsToTake }; resultingGroups.push(newGroup); currentCount += itemsToTake.length; } } return resultingGroups; } if (filterQuery === "") { return limit > -1 ? flatItems.slice(0, limit) : ( // The cast here is done as `flatItems` is readonly. // valuesRef.current, a mutable ref, can be set to `flatFilteredItems`, which may // reference this exact readonly value, creating a mutation risk. // However, <Combobox.Item> can never mutate this value as the mutating effect // bails early when `items` is provided, and this is only ever returned // when `items` is provided due to the early return at the top of this hook. flatItems ); } const limitedItems = []; for (const item of flatItems) { if (limit > -1 && limitedItems.length >= limit) { break; } if (filter(item, filterQuery, itemToStringLabel)) { limitedItems.push(item); } } return limitedItems; }, [filteredItemsProp, shouldIgnoreExternalFiltering, items, isGrouped, filterQuery, limit, filter, itemToStringLabel, flatItems]); const flatFilteredItems = React52.useMemo(() => { if (isGrouped) { const groups = filteredItems; return groups.flatMap((g) => g.items); } return filteredItems; }, [filteredItems, isGrouped]); const store = useRefWithInit(() => new Store({ id, labelId: void 0, selectedValue, open, filter, query, items, selectionMode, listRef, labelsRef, popupRef, emptyRef, inputRef, startDismissRef, endDismissRef, keyboardActiveRef, chipsContainerRef, clearRef, valuesRef, allValuesRef, selectionEventRef, name, form, disabled: disabled2, readOnly, required, grid, isGrouped, virtualized, openOnInputClick, itemToStringLabel, isItemEqualToValue, modal, autoHighlight: autoHighlightMode, submitOnItemClick, hasInputValue, mounted: false, forceMounted: false, transitionStatus: "idle", inline: inlineProp, activeIndex: null, selectedIndex: null, popupProps: {}, inputProps: {}, triggerProps: {}, itemProps: EMPTY_OBJECT, positionerElement: null, listElement: null, triggerElement: null, inputElement: null, inputGroupElement: null, popupSide: null, openMethod: null, inputInsidePopup: true, // Avoid duplicate names in the server HTML. Popup inputs aren't rendered // until after hydration, so the hidden input takes over then if needed. inputOwnsFormValue: selectionMode === "none", onOpenChangeComplete: onOpenChangeCompleteProp || NOOP, // Placeholder callbacks replaced on first render setOpen: NOOP, setInputValue: NOOP, setSelectedValue: NOOP, setIndices: NOOP, onItemHighlighted: NOOP, handleSelection: NOOP, forceMount: NOOP, requestSubmit: NOOP })).current; const fieldRawValue = selectionMode === "none" ? inputValue : selectedValue; const fieldStringValue = React52.useMemo(() => { if (selectionMode === "none") { return fieldRawValue; } if (Array.isArray(selectedValue)) { return selectedValue.map((value) => stringifyAsValue(value, itemToStringValue)); } return stringifyAsValue(selectedValue, itemToStringValue); }, [fieldRawValue, itemToStringValue, selectionMode, selectedValue]); const onItemHighlighted = useStableCallback(onItemHighlightedProp); const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp); const activeIndex = useStore(store, selectors2.activeIndex); const selectedIndex = useStore(store, selectors2.selectedIndex); const positionerElement = useStore(store, selectors2.positionerElement); const listElement = useStore(store, selectors2.listElement); const triggerElement = useStore(store, selectors2.triggerElement); const inputElement = useStore(store, selectors2.inputElement); const inputGroupElement = useStore(store, selectors2.inputGroupElement); const inline4 = useStore(store, selectors2.inline); const inputInsidePopup = useStore(store, selectors2.inputInsidePopup); const inputOwnsFormValue = useStore(store, selectors2.inputOwnsFormValue); const triggerRef = useValueAsRef(triggerElement); const { mounted, setMounted, transitionStatus } = useTransitionStatus(open); const { openMethod, triggerProps } = useOpenInteractionType(open); const getStringifiedValueForForm = useStableCallback(() => fieldStringValue); useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm); const forceMount = useStableCallback(() => { if (items) { labelsRef.current = flatFilteredItems.map((item) => stringifyAsLabel(item, itemToStringLabel)); } else { store.set("forceMounted", true); } }); const initialSelectedValueRef = React52.useRef(selectedValue); useIsoLayoutEffect(() => { if (selectedValue !== initialSelectedValueRef.current) { forceMount(); } }, [forceMount, selectedValue]); const setIndices = useStableCallback((options) => { store.update(options); const type = options.type || "none"; if (options.activeIndex === void 0) { return; } if (options.activeIndex === null) { if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) { lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT; onItemHighlighted(void 0, createGenericEventDetails(type, void 0, { index: -1 })); } } else { const activeValue = valuesRef.current[options.activeIndex]; lastHighlightRef.current = { value: activeValue, index: options.activeIndex }; onItemHighlighted(activeValue, createGenericEventDetails(type, void 0, { index: options.activeIndex })); } }); const setInputValue = useStableCallback((next, eventDetails) => { hadInputClearRef.current = eventDetails.reason === reason_parts_exports.inputClear; props.onInputValueChange?.(next, eventDetails); if (eventDetails.isCanceled) { return; } if (eventDetails.reason === reason_parts_exports.inputChange) { const event = eventDetails.event; const inputType = event.inputType; const isTypedInput = event.type === "compositionend" || inputType != null && inputType !== "" && inputType !== "insertReplacementText"; if (isTypedInput) { const hasQuery = next.trim() !== ""; if (hasQuery) { setQueryChangedAfterOpen(true); } pendingQueryHighlightRef.current = { hasQuery }; if (hasQuery && autoHighlightMode && store.state.activeIndex == null) { store.set("activeIndex", 0); } } } setInputValueUnwrapped(next); }); const setOpen = useStableCallback((nextOpen, eventDetails) => { if (open === nextOpen) { return; } if (eventDetails.reason === "escape-key" && hasItems && flatFilteredItems.length === 0 && !store.state.emptyRef.current) { eventDetails.allowPropagation(); } props.onOpenChange?.(nextOpen, eventDetails); if (eventDetails.isCanceled) { return; } if (nextOpen && multiple && inputInsidePopup && !inline4 && closeQuery !== null) { setQueryChangedAfterOpen(false); setCloseQuery(null); if (inputValue !== "") { setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear, eventDetails.event)); } } if (!nextOpen && queryChangedAfterOpen) { if (single) { if (!inline4) { setCloseQuery(query); } if (query === "") { setQueryChangedAfterOpen(false); } } else if (multiple) { if (!inline4) { setCloseQuery(query); } if (inputInsidePopup) { setIndices({ activeIndex: null }); } if (!inputInsidePopup || inline4) { setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear, eventDetails.event)); } } } setOpenUnwrapped(nextOpen); if (!nextOpen && inputInsidePopup && (eventDetails.reason === reason_parts_exports.focusOut || eventDetails.reason === reason_parts_exports.outsidePress)) { setTouched(true); setFocused(false); if (validationMode === "onBlur") { const valueToValidate = selectionMode === "none" ? inputValue : selectedValue; validation.commit(valueToValidate); } } }); const setSelectedValue = useStableCallback((nextValue, eventDetails) => { onSelectedValueChange?.(nextValue, eventDetails); if (eventDetails.isCanceled) { return; } setSelectedValueUnwrapped(nextValue); const shouldFillInput = selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup; if (shouldFillInput) { setInputValue(stringifyAsLabel(nextValue, itemToStringLabel), createChangeEventDetails(eventDetails.reason, eventDetails.event)); } if (single && nextValue != null && eventDetails.reason !== reason_parts_exports.inputChange && queryChangedAfterOpen && !inline4) { setCloseQuery(query); } }); const handleSelection = useStableCallback((event, passedValue) => { let itemValue = passedValue; if (itemValue === void 0) { if (activeIndex === null) { return; } itemValue = valuesRef.current[activeIndex]; } const targetEl = getTarget(event); const overrideEvent = selectionEventRef.current ?? event; selectionEventRef.current = null; const eventDetails = createChangeEventDetails(reason_parts_exports.itemPress, overrideEvent); const href = targetEl?.closest("a")?.getAttribute("href"); if (href) { if (href.startsWith("#")) { setOpen(false, eventDetails); } return; } if (multiple) { const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : []; const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, store.state.isItemEqualToValue); const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, store.state.isItemEqualToValue) : [...currentSelectedValue, itemValue]; setSelectedValue(nextValue, eventDetails); const wasFiltering = inputRef.current ? inputRef.current.value.trim() !== "" : false; if (!wasFiltering) { return; } if (store.state.inputInsidePopup) { setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear, eventDetails.event)); } else { setOpen(false, eventDetails); } } else { setSelectedValue(itemValue, eventDetails); setOpen(false, eventDetails); } }); const requestSubmit = useStableCallback(() => { if (!store.state.submitOnItemClick) { return; } const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form; if (formElement && typeof formElement.requestSubmit === "function") { formElement.requestSubmit(); } }); const handleUnmount = useStableCallback(() => { setMounted(false); onOpenChangeComplete?.(false); setQueryChangedAfterOpen(false); setCloseQuery(null); if (selectionMode === "none") { setIndices({ activeIndex: null, selectedIndex: null }); } else { setIndices({ activeIndex: null }); } if (multiple && inputRef.current && inputRef.current.value !== "" && !hadInputClearRef.current) { setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear)); } if (single) { if (store.state.inputInsidePopup) { if (inputRef.current && inputRef.current.value !== "") { setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear)); } } else { const stringVal = stringifyAsLabel(selectedValue, itemToStringLabel); if (inputRef.current && inputRef.current.value !== stringVal) { const reason = stringVal === "" ? reason_parts_exports.inputClear : reason_parts_exports.none; setInputValue(stringVal, createChangeEventDetails(reason)); } } } }); const resolvedPopupRef = React52.useMemo(() => { if (inline4 && positionerElement) { return { current: positionerElement.closest('[role="dialog"]') }; } return popupRef; }, [inline4, positionerElement]); useOpenChangeComplete({ enabled: !props.actionsRef, open, ref: resolvedPopupRef, onComplete() { if (!open) { handleUnmount(); } } }); React52.useImperativeHandle(props.actionsRef, () => ({ unmount: handleUnmount }), [handleUnmount]); useIsoLayoutEffect(function syncSelectedIndex() { if (open || selectionMode === "none") { return; } const registry = items ? flatItems : allValuesRef.current; if (multiple) { const currentValue = Array.isArray(selectedValue) ? selectedValue : []; const lastValue = currentValue[currentValue.length - 1]; const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue); setIndices({ selectedIndex: lastIndex === -1 ? null : lastIndex }); } else { const index2 = findItemIndex(registry, selectedValue, isItemEqualToValue); setIndices({ selectedIndex: index2 === -1 ? null : index2 }); } }, [open, selectedValue, items, selectionMode, flatItems, multiple, isItemEqualToValue, setIndices]); useIsoLayoutEffect(() => { if (items) { valuesRef.current = flatFilteredItems; listRef.current.length = flatFilteredItems.length; } }, [items, flatFilteredItems]); useIsoLayoutEffect(() => { const pendingHighlight = pendingQueryHighlightRef.current; if (pendingHighlight) { if (pendingHighlight.hasQuery) { if (autoHighlightMode) { store.set("activeIndex", 0); } } else if (autoHighlightMode === "always") { store.set("activeIndex", 0); } pendingQueryHighlightRef.current = null; } if (!open && !inline4) { return; } const shouldUseFlatFilteredItems = hasItems || hasFilteredItemsProp; const candidateItems = shouldUseFlatFilteredItems ? flatFilteredItems : valuesRef.current; const storeActiveIndex = store.state.activeIndex; if (storeActiveIndex == null) { if (autoHighlightMode === "always" && candidateItems.length > 0) { store.set("activeIndex", 0); return; } if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) { lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT; store.state.onItemHighlighted(void 0, createGenericEventDetails(reason_parts_exports.none, void 0, { index: -1 })); } return; } if (storeActiveIndex >= candidateItems.length) { if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) { lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT; store.state.onItemHighlighted(void 0, createGenericEventDetails(reason_parts_exports.none, void 0, { index: -1 })); } store.set("activeIndex", null); return; } const itemValue = candidateItems[storeActiveIndex]; const previouslyHighlightedItemValue = lastHighlightRef.current.value; const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue); if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) { lastHighlightRef.current = { value: itemValue, index: storeActiveIndex }; store.state.onItemHighlighted(itemValue, createGenericEventDetails(reason_parts_exports.none, void 0, { index: storeActiveIndex })); } }, [activeIndex, autoHighlightMode, hasFilteredItemsProp, hasItems, flatFilteredItems, inline4, open, store]); useIsoLayoutEffect(() => { if (selectionMode === "none") { setFilled(String(inputValue) !== ""); return; } setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null); }, [setFilled, selectionMode, inputValue, selectedValue, multiple]); React52.useEffect(() => { if (hasItems && autoHighlightMode && flatFilteredItems.length === 0) { setIndices({ activeIndex: null }); } }, [hasItems, autoHighlightMode, flatFilteredItems.length, setIndices]); useValueChanged(query, () => { if (!open || query === "" || query === String(initialDefaultInputValue)) { return; } setQueryChangedAfterOpen(true); }); useValueChanged(selectedValue, () => { if (selectionMode === "none") { return; } clearErrors(name); setDirty(selectedValue !== validityData.initialValue); if (shouldValidateOnChange()) { validation.commit(selectedValue); } else { validation.commit(selectedValue, true); } if (single && !hasInputValue && !inputInsidePopup) { const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel); if (inputValue !== nextInputValue) { setInputValue(nextInputValue, createChangeEventDetails(reason_parts_exports.none)); } } }); useValueChanged(inputValue, () => { if (selectionMode !== "none") { return; } clearErrors(name); setDirty(inputValue !== validityData.initialValue); if (shouldValidateOnChange()) { validation.commit(inputValue); } else { validation.commit(inputValue, true); } }); useValueChanged(items, () => { if (!single || hasInputValue || inputInsidePopup || queryChangedAfterOpen) { return; } const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel); if (inputValue !== nextInputValue) { setInputValue(nextInputValue, createChangeEventDetails(reason_parts_exports.none)); } }); const floatingRootContext = useFloatingRootContext({ open: inline4 ? true : open, onOpenChange: setOpen, elements: { reference: inputInsidePopup ? triggerElement : inputElement, floating: positionerElement } }); let ariaHasPopup; let ariaExpanded; if (!inline4) { ariaHasPopup = grid ? "grid" : "listbox"; ariaExpanded = open ? "true" : "false"; } const role = React52.useMemo(() => { const isPlainInput = inputElement?.tagName === "INPUT"; const shouldTreatAsInput = inputElement == null || isPlainInput; const shouldApplyAria = shouldTreatAsInput || open; const reference = shouldTreatAsInput ? { autoComplete: "off", spellCheck: "false", autoCorrect: "off", autoCapitalize: "none" } : {}; if (shouldApplyAria) { reference.role = "combobox"; reference["aria-expanded"] = ariaExpanded; reference["aria-haspopup"] = ariaHasPopup; reference["aria-controls"] = open ? listElement?.id : void 0; reference["aria-autocomplete"] = autoComplete; } return { reference, floating: { role: "presentation" } }; }, [inputElement, open, ariaExpanded, ariaHasPopup, listElement?.id, autoComplete]); const click = useClick(floatingRootContext, { enabled: !readOnly && !disabled2 && openOnInputClick, event: "mousedown-only", toggle: false, // Apply a small delay for touch to let mobile viewport/keyboard positioning settle. // This avoids top-bottom flip flickers if the preferred position is "top" when first tapping. touchOpenDelay: inputInsidePopup ? 0 : 100, reason: reason_parts_exports.inputPress }); const dismiss = useDismiss(floatingRootContext, { enabled: !readOnly && !disabled2 && !inline4, outsidePressEvent: { mouse: "sloppy", // The visual viewport (affected by the mobile software keyboard) can be // somewhat small. The user may want to scroll the screen to see more of // the popup. touch: "intentional" }, // Without a popup, let the Escape key bubble the event up to other popups' handlers. bubbles: inline4 ? true : void 0, outsidePress(event) { const target = getTarget(event); return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target); } }); const listNavigation2 = useListNavigation(floatingRootContext, { enabled: !readOnly && !disabled2, id, listRef, activeIndex, selectedIndex, virtual: true, loopFocus, allowEscape: loopFocus && !autoHighlightMode, focusItemOnOpen: queryChangedAfterOpen || selectionMode === "none" && !autoHighlightMode ? false : "auto", focusItemOnHover: highlightItemOnHover, resetOnPointerLeave: !keepHighlight, // `cols` > 1 enables grid navigation. // Since <Combobox.Row> infers column sizes (and is required when building a grid), // it works correctly even with a value of `2`. // Floating UI tests don't require `role="row"` wrappers, so retains the number API. cols: grid ? 2 : 1, orientation: grid ? "horizontal" : void 0, rtl: direction === "rtl", disabledIndices: EMPTY_ARRAY, onNavigate(nextActiveIndex, event) { if (!event && !open || transitionStatus === "ending") { return; } if (!event) { setIndices({ activeIndex: nextActiveIndex }); } else { setIndices({ activeIndex: nextActiveIndex, type: keyboardActiveRef.current ? "keyboard" : "pointer" }); } } }); const inputProps = React52.useMemo(() => mergeProps(listNavigation2.reference, dismiss.reference, click.reference, role.reference), [listNavigation2.reference, dismiss.reference, click.reference, role.reference]); const popupProps = React52.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, listNavigation2.floating, dismiss.floating, role.floating), [listNavigation2.floating, dismiss.floating, role.floating]); const itemProps = React52.useMemo(() => { const listNavigationItemProps = listNavigation2.item; if (!listNavigationItemProps) { return EMPTY_OBJECT; } return { ...listNavigationItemProps, onFocus: void 0 }; }, [listNavigation2.item]); useOnFirstRender(() => { store.update({ inline: inlineProp, popupProps, inputProps, triggerProps, itemProps, setOpen, setInputValue, setSelectedValue, setIndices, onItemHighlighted, handleSelection, forceMount, requestSubmit }); }); useIsoLayoutEffect(() => { store.update({ id, selectedValue, open, mounted, transitionStatus, items, inline: inlineProp, popupProps, inputProps, triggerProps, openMethod, itemProps, selectionMode, name, form, disabled: disabled2, readOnly, required, grid, isGrouped, virtualized, onOpenChangeComplete, openOnInputClick, itemToStringLabel, modal, autoHighlight: autoHighlightMode, isItemEqualToValue, submitOnItemClick, hasInputValue, requestSubmit, inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup) }); }, [store, id, selectedValue, open, mounted, transitionStatus, items, popupProps, inputProps, itemProps, openMethod, triggerProps, selectionMode, name, disabled2, readOnly, required, validation, grid, isGrouped, virtualized, onOpenChangeComplete, openOnInputClick, itemToStringLabel, modal, isItemEqualToValue, submitOnItemClick, hasInputValue, inlineProp, requestSubmit, autoHighlightMode, form]); const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef); const itemsContextValue = React52.useMemo(() => ({ query, hasItems, filteredItems, flatFilteredItems }), [query, hasItems, filteredItems, flatFilteredItems]); const serializedValue = React52.useMemo(() => { if (Array.isArray(fieldRawValue)) { return ""; } return stringifyAsValue(fieldRawValue, itemToStringValue); }, [fieldRawValue, itemToStringValue]); const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0; const hiddenInputName = multiple || selectionMode === "none" && inputOwnsFormValue ? void 0 : name; const hiddenInputs = React52.useMemo(() => { if (!multiple || !Array.isArray(selectedValue) || !name) { return null; } return selectedValue.map((value) => { const currentSerializedValue = stringifyAsValue(value, itemToStringValue); return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "hidden", form, name, value: currentSerializedValue }, currentSerializedValue); }); }, [multiple, selectedValue, form, name, itemToStringValue]); const children = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(React52.Fragment, { children: [props.children, /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { ...validation.getInputValidationProps({ // Move focus when the hidden input is focused. onFocus() { if (inputInsidePopup) { triggerElement?.focus(); return; } (inputRef.current || triggerElement)?.focus(); }, // Handle browser autofill. onChange(event) { if (event.nativeEvent.defaultPrevented || disabled2 || readOnly) { event.preventBaseUIHandler?.(); return; } const nextValue = event.currentTarget.value; const details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent); function handleChange() { if (multiple) { return; } if (selectionMode === "none") { setDirty(nextValue !== validityData.initialValue); setInputValue(nextValue, details); if (shouldValidateOnChange()) { validation.commit(nextValue); } return; } const matchingValue = valuesRef.current.find((v) => { const candidateValue = stringifyAsValue(v, itemToStringValue); if (candidateValue.toLowerCase() === nextValue.toLowerCase()) { return true; } const candidateLabel = stringifyAsLabel(v, itemToStringLabel); if (candidateLabel.toLowerCase() === nextValue.toLowerCase()) { return true; } return false; }); if (matchingValue != null) { setDirty(matchingValue !== validityData.initialValue); setSelectedValue?.(matchingValue, details); if (shouldValidateOnChange()) { validation.commit(matchingValue); } } } if (items) { handleChange(); } else { forceMount(); queueMicrotask(handleChange); } } }), id: id && hiddenInputName == null ? `${id}-hidden-input` : void 0, form, name: hiddenInputName, autoComplete: formAutoComplete, disabled: disabled2, required: required && !hasMultipleSelection, readOnly, value: serializedValue, ref: hiddenInputRef, style: hiddenInputName ? visuallyHiddenInput : visuallyHidden, tabIndex: -1, "aria-hidden": true, suppressHydrationWarning: true }), hiddenInputs] }); return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxRootContext.Provider, { value: store, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxFloatingContext.Provider, { value: floatingRootContext, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxDerivedItemsContext.Provider, { value: itemsContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxInputValueContext.Provider, { value: inputValue, children }) }) }) }); } // node_modules/@base-ui/react/esm/autocomplete/root/AutocompleteRoot.js var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); function AutocompleteRoot(props) { const { openOnInputClick = false, value, defaultValue, onValueChange, mode = "list", itemToStringValue, ...other } = props; const enableInline = mode === "inline" || mode === "both"; const staticItems = mode === "inline" || mode === "none"; const isControlled = value !== void 0; const [internalValue, setInternalValue] = React53.useState(defaultValue ?? ""); const [inlineInputValue, setInlineInputValue] = React53.useState(""); React53.useEffect(() => { if (isControlled) { setInlineInputValue(""); } }, [value, isControlled]); let resolvedInputValue; if (enableInline && inlineInputValue !== "") { resolvedInputValue = inlineInputValue; } else if (isControlled) { resolvedInputValue = value ?? ""; } else { resolvedInputValue = internalValue; } const collator = useCoreFilter(); const baseFilter = React53.useMemo(() => { if (other.filter !== void 0) { return other.filter; } return collator.contains; }, [other.filter, collator]); const resolvedQuery = String(isControlled ? value : internalValue).trim(); const resolvedFilter = React53.useMemo(() => { if (mode !== "both") { return staticItems ? null : baseFilter; } if (baseFilter === null) { return null; } return (item, _query, toString) => { return baseFilter(item, resolvedQuery, toString); }; }, [baseFilter, mode, resolvedQuery, staticItems]); function handleValueChange(nextValue, eventDetails) { setInlineInputValue(""); if (!isControlled) { setInternalValue(nextValue); } onValueChange?.(nextValue, eventDetails); } function handleItemHighlighted(highlightedValue, eventDetails) { props.onItemHighlighted?.(highlightedValue, eventDetails); if (eventDetails.reason === reason_parts_exports.pointer) { return; } if (enableInline) { if (highlightedValue == null) { setInlineInputValue(""); } else { setInlineInputValue(stringifyAsLabel(highlightedValue, itemToStringValue)); } } else { setInlineInputValue(""); } } return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AriaCombobox, { ...other, itemToStringLabel: itemToStringValue, openOnInputClick, selectionMode: "none", fillInputOnItemPress: true, filter: resolvedFilter, autoComplete: mode, inputValue: resolvedInputValue, defaultInputValue: defaultValue, onInputValueChange: handleValueChange, onItemHighlighted: handleItemHighlighted }); } // node_modules/@base-ui/react/esm/autocomplete/value/AutocompleteValue.js var React54 = __toESM(require_react(), 1); var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); function AutocompleteValue(props) { const { children } = props; const inputValue = useComboboxInputValueContext(); let returnValue = null; if (typeof children === "function") { returnValue = children(String(inputValue)); } else if (children != null) { returnValue = children; } else { returnValue = inputValue; } return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(React54.Fragment, { children: returnValue }); } // node_modules/@base-ui/react/esm/combobox/trigger/ComboboxTrigger.js var React55 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/utils/stateAttributesMapping.js var triggerStateAttributesMapping = { ...pressableTriggerOpenStateMapping, ...fieldValidityMapping, popupSide: (side) => side ? { "data-popup-side": side } : null, listEmpty: (empty) => empty ? { "data-list-empty": "" } : null }; // node_modules/@base-ui/react/esm/utils/getPseudoElementBounds.js function getPseudoElementBounds(element) { const elementRect = element.getBoundingClientRect(); if (true) { return elementRect; } const win = getWindow(element); 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/esm/utils/resolveAriaLabelledBy.js function resolveAriaLabelledBy(fieldLabelId, localLabelId) { return fieldLabelId ?? localLabelId; } // node_modules/@base-ui/react/esm/combobox/trigger/ComboboxTrigger.js var BOUNDARY_OFFSET = 2; var ComboboxTrigger = /* @__PURE__ */ React55.forwardRef(function ComboboxTrigger2(componentProps, forwardedRef) { const { render, className, nativeButton = true, disabled: disabledProp = false, id: idProp, style, ...elementProps } = componentProps; const { state: fieldState, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext(); const { labelId: fieldLabelId } = useLabelableContext(); const store = useComboboxRootContext(); const { filteredItems } = useComboboxDerivedItemsContext(); const selectionMode = useStore(store, selectors2.selectionMode); const comboboxDisabled = useStore(store, selectors2.disabled); const readOnly = useStore(store, selectors2.readOnly); const required = useStore(store, selectors2.required); const mounted = useStore(store, selectors2.mounted); const popupSideValue = useStore(store, selectors2.popupSide); const positionerElement = useStore(store, selectors2.positionerElement); const listElement = useStore(store, selectors2.listElement); const triggerProps = useStore(store, selectors2.triggerProps); const triggerElement = useStore(store, selectors2.triggerElement); const inputInsidePopup = useStore(store, selectors2.inputInsidePopup); const rootId = useStore(store, selectors2.id); const comboboxLabelId = useStore(store, selectors2.labelId); const open = useStore(store, selectors2.open); const selectedValue = useStore(store, selectors2.selectedValue); const activeIndex = useStore(store, selectors2.activeIndex); const selectedIndex = useStore(store, selectors2.selectedIndex); const hasSelectedValue = useStore(store, selectors2.hasSelectedValue); const floatingRootContext = useComboboxFloatingContext(); const inputValue = useComboboxInputValueContext(); const focusTimeout = useTimeout(); const disabled2 = fieldDisabled || comboboxDisabled || disabledProp; const listEmpty = filteredItems.length === 0; const popupSide = mounted && positionerElement ? popupSideValue : null; useLabelableId({ id: inputInsidePopup ? idProp : void 0 }); const id = inputInsidePopup ? idProp ?? rootId : idProp; const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, comboboxLabelId); const currentPointerTypeRef = React55.useRef(""); function trackPointerType(event) { currentPointerTypeRef.current = event.pointerType; } const domReference = floatingRootContext.useState("domReferenceElement"); React55.useEffect(() => { if (!inputInsidePopup) { return; } if (triggerElement && triggerElement !== domReference) { floatingRootContext.set("domReferenceElement", triggerElement); } }, [triggerElement, domReference, floatingRootContext, inputInsidePopup]); const { reference: triggerTypeaheadProps } = useTypeahead(floatingRootContext, { enabled: !open && !readOnly && !comboboxDisabled && selectionMode === "single", listRef: store.state.labelsRef, activeIndex, selectedIndex, onMatch(index2) { const nextSelectedValue = store.state.valuesRef.current[index2]; if (nextSelectedValue !== void 0) { store.state.setSelectedValue(nextSelectedValue, createChangeEventDetails("none")); } } }); const { reference: triggerClickProps } = useClick(floatingRootContext, { enabled: !readOnly && !comboboxDisabled, event: "mousedown" }); const { buttonRef, getButtonProps } = useButton({ native: nativeButton, disabled: disabled2 }); const state = { ...fieldState, open, disabled: disabled2, popupSide, listEmpty, placeholder: selectionMode === "none" ? false : !hasSelectedValue }; const setTriggerElement = useStableCallback((element2) => { store.set("triggerElement", element2); }); const element = useRenderElement("button", componentProps, { ref: [forwardedRef, buttonRef, setTriggerElement], state, props: [triggerProps, triggerClickProps, triggerTypeaheadProps, { id, tabIndex: inputInsidePopup ? 0 : -1, role: inputInsidePopup ? "combobox" : void 0, "aria-expanded": open ? "true" : "false", "aria-haspopup": inputInsidePopup ? "dialog" : "listbox", "aria-controls": open ? listElement?.id : void 0, "aria-required": inputInsidePopup ? required || void 0 : void 0, "aria-labelledby": ariaLabelledBy, onPointerDown: trackPointerType, onPointerEnter: trackPointerType, onFocus() { setFocused(true); if (disabled2 || readOnly) { return; } focusTimeout.start(0, store.state.forceMount); }, onBlur(event) { if (contains(positionerElement, event.relatedTarget)) { return; } setTouched(true); setFocused(false); if (validationMode === "onBlur") { const valueToValidate = selectionMode === "none" ? inputValue : selectedValue; validation.commit(valueToValidate); } }, onMouseDown(event) { if (disabled2 || readOnly) { return; } if (!inputInsidePopup) { floatingRootContext.set("domReferenceElement", event.currentTarget); } store.state.forceMount(); if (currentPointerTypeRef.current !== "touch") { store.state.inputRef.current?.focus(); if (!inputInsidePopup) { event.preventDefault(); } } if (open) { return; } const doc = ownerDocument(event.currentTarget); function handleMouseUp(mouseEvent) { if (!triggerElement) { return; } const mouseUpTarget = getTarget(mouseEvent); const positioner = store.state.positionerElement; const list = store.state.listElement; if (contains(triggerElement, mouseUpTarget) || contains(positioner, mouseUpTarget) || contains(list, mouseUpTarget) || mouseUpTarget === triggerElement) { return; } const bounds = getPseudoElementBounds(triggerElement); const withinHorizontal = mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET; const withinVertical = mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET; if (withinHorizontal && withinVertical) { return; } store.state.setOpen(false, createChangeEventDetails("cancel-open", mouseEvent)); } if (inputInsidePopup) { doc.addEventListener("mouseup", handleMouseUp, { once: true }); } }, onKeyDown(event) { if (disabled2 || readOnly) { return; } if (event.key === "ArrowDown" || event.key === "ArrowUp") { stopEvent(event); store.state.setOpen(true, createChangeEventDetails(reason_parts_exports.listNavigation, event.nativeEvent)); store.state.inputRef.current?.focus(); } } }, validation ? validation.getValidationProps(elementProps) : elementProps, getButtonProps], stateAttributesMapping: triggerStateAttributesMapping }); return element; }); if (true) ComboboxTrigger.displayName = "ComboboxTrigger"; // node_modules/@base-ui/react/esm/autocomplete/trigger/AutocompleteTrigger.js var AutocompleteTrigger = ComboboxTrigger; // node_modules/@base-ui/react/esm/combobox/input/ComboboxInput.js var React59 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/chips/ComboboxChipsContext.js var React56 = __toESM(require_react(), 1); var ComboboxChipsContext = /* @__PURE__ */ React56.createContext(void 0); if (true) ComboboxChipsContext.displayName = "ComboboxChipsContext"; function useComboboxChipsContext() { return React56.useContext(ComboboxChipsContext); } // node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositionerContext.js var React57 = __toESM(require_react(), 1); var ComboboxPositionerContext = /* @__PURE__ */ React57.createContext(void 0); if (true) ComboboxPositionerContext.displayName = "ComboboxPositionerContext"; function useComboboxPositionerContext(optional) { const context = React57.useContext(ComboboxPositionerContext); if (context === void 0 && !optional) { throw new Error(true ? "Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component" : formatErrorMessage_default(21)); } return context; } // node_modules/@base-ui/react/esm/combobox/utils/ComboboxInternalDismissButton.js var React58 = __toESM(require_react(), 1); var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); var ComboboxInternalDismissButton = /* @__PURE__ */ React58.forwardRef(function ComboboxInternalDismissButton2(_, forwardedRef) { const store = useComboboxRootContext(); const { buttonRef, getButtonProps } = useButton({ native: false }); const mergedRef = useMergedRefs(forwardedRef, buttonRef); function handleDismiss(event) { store.state.setOpen(false, createChangeEventDetails(reason_parts_exports.closePress, event.nativeEvent, event.currentTarget)); } const dismissProps = getButtonProps({ onClick: handleDismiss }); return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { ref: mergedRef, ...dismissProps, "aria-label": "Dismiss", tabIndex: void 0, style: visuallyHiddenInput }); }); if (true) ComboboxInternalDismissButton.displayName = "ComboboxInternalDismissButton"; // node_modules/@base-ui/react/esm/combobox/input/ComboboxInput.js var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); var ComboboxInput = /* @__PURE__ */ React59.forwardRef(function ComboboxInput2(componentProps, forwardedRef) { const { render, className, disabled: disabledProp = false, id: idProp, style, ...elementProps } = componentProps; const { state: fieldState, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext(); const { labelId: fieldLabelId } = useLabelableContext(); const comboboxChipsContext = useComboboxChipsContext(); const positioning = useComboboxPositionerContext(true); const hasPositionerParent = Boolean(positioning); const store = useComboboxRootContext(); const { filteredItems } = useComboboxDerivedItemsContext(); const inputValue = useComboboxInputValueContext(); const direction = useDirection(); const required = useStore(store, selectors2.required); const comboboxDisabled = useStore(store, selectors2.disabled); const readOnly = useStore(store, selectors2.readOnly); const name = useStore(store, selectors2.name); const form = useStore(store, selectors2.form); const selectionMode = useStore(store, selectors2.selectionMode); const autoHighlightMode = useStore(store, selectors2.autoHighlight); const inputProps = useStore(store, selectors2.inputProps); const triggerProps = useStore(store, selectors2.triggerProps); const open = useStore(store, selectors2.open); const mounted = useStore(store, selectors2.mounted); const selectedValue = useStore(store, selectors2.selectedValue); const popupSideValue = useStore(store, selectors2.popupSide); const positionerElement = useStore(store, selectors2.positionerElement); const rootId = useStore(store, selectors2.id); const inline4 = useStore(store, selectors2.inline); const modal = useStore(store, selectors2.modal); const autoHighlightEnabled = Boolean(autoHighlightMode); const popupSide = mounted && positionerElement ? popupSideValue : null; const disabled2 = fieldDisabled || comboboxDisabled || disabledProp; const listEmpty = filteredItems.length === 0; const isInsidePopup = hasPositionerParent || inline4; const focusManagerModal = !isInsidePopup || modal; const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : void 0)); const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, void 0); const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState; const [composingValue, setComposingValue] = React59.useState(null); const isComposingRef = React59.useRef(false); const lastActiveIndexRef = React59.useRef(null); const shouldRestoreActiveIndexRef = React59.useRef(false); const inputOwnsFormValue = selectionMode === "none" && !hasPositionerParent; const setInputElement = useStableCallback((element2) => { const nextIsInsidePopup = hasPositionerParent || store.state.inline; if (nextIsInsidePopup && !store.state.hasInputValue) { store.state.setInputValue("", createChangeEventDetails(reason_parts_exports.none)); } store.update({ inputElement: element2, inputInsidePopup: nextIsInsidePopup, inputOwnsFormValue }); }); const validationProps = hasPositionerParent || !validation ? elementProps : validation.getValidationProps(elementProps); const state = { ...fieldStateForInput, open, disabled: disabled2, readOnly, popupSide, listEmpty }; function handleKeyDown(event) { if (!comboboxChipsContext) { return void 0; } let nextIndex; const { highlightedChipIndex } = comboboxChipsContext; const renderedChipsCount = comboboxChipsContext.chipsRef.current.length; const isRtl = direction === "rtl"; const previousChipKey = isRtl ? "ArrowRight" : "ArrowLeft"; const nextChipKey = isRtl ? "ArrowLeft" : "ArrowRight"; if (highlightedChipIndex !== void 0) { if (event.key === previousChipKey) { event.preventDefault(); if (highlightedChipIndex > 0) { nextIndex = highlightedChipIndex - 1; } else { nextIndex = void 0; } } else if (event.key === nextChipKey) { event.preventDefault(); if (highlightedChipIndex < renderedChipsCount - 1) { nextIndex = highlightedChipIndex + 1; } else { nextIndex = void 0; } } else if (event.key === "Backspace" || event.key === "Delete") { event.preventDefault(); const computedNextIndex = highlightedChipIndex >= selectedValue.length - 1 ? selectedValue.length - 2 : highlightedChipIndex; nextIndex = computedNextIndex >= 0 ? computedNextIndex : void 0; store.state.setIndices({ activeIndex: null, selectedIndex: null, type: "keyboard" }); } return nextIndex; } if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) { event.preventDefault(); nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : void 0; } else if (event.key === "Backspace" && event.currentTarget.value === "" && selectedValue.length > 0) { store.state.setIndices({ activeIndex: null, selectedIndex: null, type: "keyboard" }); event.preventDefault(); } return nextIndex; } const element = useRenderElement("input", componentProps, { state, ref: [forwardedRef, store.state.inputRef, setInputElement], props: [inputProps, triggerProps, { type: "text", value: componentProps.value ?? composingValue ?? inputValue, "aria-readonly": readOnly || void 0, "aria-required": required || void 0, "aria-labelledby": ariaLabelledBy, disabled: disabled2, readOnly, required: selectionMode === "none" ? required : void 0, form, ...inputOwnsFormValue && name && { name }, id, onFocus() { setFocused(true); if (!inline4 || !shouldRestoreActiveIndexRef.current) { return; } shouldRestoreActiveIndexRef.current = false; const nextActiveIndex = lastActiveIndexRef.current; if (nextActiveIndex == null || // `valuesRef` can be sparse, so guard against restoring a removed slot. !Object.hasOwn(store.state.valuesRef.current, nextActiveIndex)) { return; } store.state.setIndices({ activeIndex: nextActiveIndex }); }, onBlur() { setTouched(true); setFocused(false); const activeIndex = store.state.activeIndex; if (inline4 && activeIndex !== null && autoHighlightMode !== "always") { lastActiveIndexRef.current = activeIndex; shouldRestoreActiveIndexRef.current = true; store.state.setIndices({ activeIndex: null }); } if (validationMode === "onBlur") { const valueToValidate = selectionMode === "none" ? inputValue : selectedValue; validation.commit(valueToValidate); } }, onCompositionStart(event) { if (isAndroid) { return; } isComposingRef.current = true; setComposingValue(event.currentTarget.value); }, onCompositionEnd(event) { isComposingRef.current = false; const next = event.currentTarget.value; setComposingValue(null); store.state.setInputValue(next, createChangeEventDetails(reason_parts_exports.inputChange, event.nativeEvent)); }, onChange(event) { const inputType = event.nativeEvent.inputType; const autofillLikeInput = !inputType || inputType === "insertReplacementText"; const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput; if (isComposingRef.current) { const nextVal = event.currentTarget.value; setComposingValue(nextVal); if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) { store.state.setOpen(false, createChangeEventDetails(reason_parts_exports.inputClear, event.nativeEvent)); } const trimmed2 = nextVal.trim(); const shouldMaintainHighlight = autoHighlightEnabled && trimmed2 !== ""; if (!readOnly && !disabled2 && trimmed2) { if (shouldOpenOnInput) { store.state.setOpen(true, createChangeEventDetails(reason_parts_exports.inputChange, event.nativeEvent)); if (!autoHighlightEnabled) { store.state.setIndices({ activeIndex: null, selectedIndex: null, type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer" }); } } } if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) { store.state.setIndices({ activeIndex: null, selectedIndex: null, type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer" }); } return; } store.state.setInputValue(event.currentTarget.value, createChangeEventDetails(reason_parts_exports.inputChange, event.nativeEvent)); const empty = event.currentTarget.value === ""; const clearDetails = createChangeEventDetails(reason_parts_exports.inputClear, event.nativeEvent); if (empty && !store.state.inputInsidePopup) { if (selectionMode === "single") { store.state.setSelectedValue(null, clearDetails); } if (!store.state.openOnInputClick) { store.state.setOpen(false, clearDetails); } } const trimmed = event.currentTarget.value.trim(); if (!readOnly && !disabled2 && trimmed) { if (shouldOpenOnInput) { store.state.setOpen(true, createChangeEventDetails(reason_parts_exports.inputChange, event.nativeEvent)); if (!autoHighlightEnabled) { store.state.setIndices({ activeIndex: null, selectedIndex: null, type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer" }); } } } if (open && store.state.activeIndex !== null && !autoHighlightEnabled) { store.state.setIndices({ activeIndex: null, selectedIndex: null, type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer" }); } }, onKeyDown(event) { if (disabled2 || readOnly) { return; } if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) { return; } store.state.keyboardActiveRef.current = true; const input = event.currentTarget; const scrollAmount = input.scrollWidth - input.clientWidth; const isRTL2 = direction === "rtl"; if (event.key === "Home") { stopEvent(event); const cursor = isFirefox && isRTL2 ? input.value.length : 0; input.setSelectionRange(cursor, cursor); input.scrollLeft = 0; return; } if (event.key === "End") { stopEvent(event); const cursor = isFirefox && isRTL2 ? 0 : input.value.length; input.setSelectionRange(cursor, cursor); input.scrollLeft = isRTL2 ? -scrollAmount : scrollAmount; return; } if (!mounted && event.key === "Escape") { const isClear = selectionMode === "multiple" && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null; const details = createChangeEventDetails(reason_parts_exports.escapeKey, event.nativeEvent); const value = selectionMode === "multiple" ? [] : null; store.state.setInputValue("", details); store.state.setSelectedValue(value, details); if (!isClear && !store.state.inline && !details.isPropagationAllowed) { event.stopPropagation(); } return; } if (comboboxChipsContext && event.key === "Backspace" && input.value === "" && comboboxChipsContext.highlightedChipIndex === void 0 && Array.isArray(selectedValue) && selectedValue.length > 0) { const renderedChipsCount = comboboxChipsContext.chipsRef.current.length; const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1; const newValue = selectedValue.filter((_, index2) => index2 !== removalIndex); store.state.setIndices({ activeIndex: null, selectedIndex: null, type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer" }); store.state.setSelectedValue(newValue, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent)); return; } const hadHighlightedChip = comboboxChipsContext?.highlightedChipIndex !== void 0; const nextIndex = handleKeyDown(event); comboboxChipsContext?.setHighlightedChipIndex(nextIndex); if (nextIndex !== void 0) { comboboxChipsContext?.chipsRef.current[nextIndex]?.focus(); } else if (hadHighlightedChip) { store.state.inputRef.current?.focus(); } if (event.which === 229) { return; } if (event.key === "Enter" && open) { const activeIndex = store.state.activeIndex; const nativeEvent = event.nativeEvent; if (activeIndex === null) { if (inline4) { return; } store.state.setOpen(false, createChangeEventDetails(reason_parts_exports.none, nativeEvent)); return; } stopEvent(event); const listItem = store.state.listRef.current[activeIndex]; if (listItem) { store.state.selectionEventRef.current = nativeEvent; listItem.click(); store.state.selectionEventRef.current = null; } } }, onPointerMove() { store.state.keyboardActiveRef.current = false; }, onPointerDown() { store.state.keyboardActiveRef.current = false; } }, validationProps], stateAttributesMapping: triggerStateAttributesMapping }); const renderedInput = hasPositionerParent ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FieldRootContext.Provider, { value: DEFAULT_FIELD_ROOT_CONTEXT, children: element }) : element; return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(React59.Fragment, { children: [open && focusManagerModal && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ComboboxInternalDismissButton, { ref: store.state.startDismissRef }), renderedInput] }); }); if (true) ComboboxInput.displayName = "ComboboxInput"; // node_modules/@base-ui/react/esm/combobox/input-group/ComboboxInputGroup.js var React60 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/utils/handleInputPress.js function handleInputPress(event, store, disabled2, readOnly, shouldIgnoreTarget) { if (event.baseUIHandlerPrevented || readOnly) { return; } const target = getTarget(event.nativeEvent); const targetElement = isElement(target) ? target : null; if (targetElement !== event.currentTarget && (shouldIgnoreTarget?.(targetElement) || isInteractiveElement(targetElement))) { return; } event.preventDefault(); if (disabled2) { return; } store.state.inputRef.current?.focus(); if (store.state.openOnInputClick) { store.state.setOpen(true, createChangeEventDetails(reason_parts_exports.inputPress, event.nativeEvent)); } } // node_modules/@base-ui/react/esm/combobox/input-group/ComboboxInputGroup.js var ComboboxInputGroup = /* @__PURE__ */ React60.forwardRef(function ComboboxInputGroup2(componentProps, forwardedRef) { const { render, className, style, ...elementProps } = componentProps; const { state: fieldState } = useFieldRootContext(); const store = useComboboxRootContext(); const { filteredItems } = useComboboxDerivedItemsContext(); const open = useStore(store, selectors2.open); const mounted = useStore(store, selectors2.mounted); const popupSideValue = useStore(store, selectors2.popupSide); const positionerElement = useStore(store, selectors2.positionerElement); const comboboxDisabled = useStore(store, selectors2.disabled); const readOnly = useStore(store, selectors2.readOnly); const hasSelectedValue = useStore(store, selectors2.hasSelectedValue); const selectionMode = useStore(store, selectors2.selectionMode); const popupSide = mounted && positionerElement ? popupSideValue : null; const disabled2 = comboboxDisabled; const listEmpty = filteredItems.length === 0; const placeholder = selectionMode === "none" ? false : !hasSelectedValue; const state = { ...fieldState, open, disabled: disabled2, readOnly, popupSide, listEmpty, placeholder }; const setInputGroupElement = useStableCallback((element) => { store.set("inputGroupElement", element); }); return useRenderElement("div", componentProps, { ref: [forwardedRef, setInputGroupElement], props: [{ role: "group", onMouseDown(event) { handleInputPress(event, store, disabled2, readOnly, (target) => { return contains(store.state.chipsContainerRef.current, target); }); } }, elementProps], state, stateAttributesMapping: triggerStateAttributesMapping }); }); if (true) ComboboxInputGroup.displayName = "ComboboxInputGroup"; // node_modules/@base-ui/react/esm/autocomplete/input-group/AutocompleteInputGroup.js var AutocompleteInputGroup = ComboboxInputGroup; // node_modules/@base-ui/react/esm/combobox/icon/ComboboxIcon.js var React61 = __toESM(require_react(), 1); var ComboboxIcon = /* @__PURE__ */ React61.forwardRef(function ComboboxIcon2(componentProps, forwardedRef) { const { render, className, style, ...elementProps } = componentProps; const element = useRenderElement("span", componentProps, { ref: forwardedRef, props: [{ "aria-hidden": true, children: "\u25BC" }, elementProps] }); return element; }); if (true) ComboboxIcon.displayName = "ComboboxIcon"; // node_modules/@base-ui/react/esm/combobox/clear/ComboboxClear.js var React62 = __toESM(require_react(), 1); var stateAttributesMapping = { ...transitionStatusMapping, ...triggerOpenStateMapping }; var ComboboxClear = /* @__PURE__ */ React62.forwardRef(function ComboboxClear2(componentProps, forwardedRef) { const { render, className, disabled: disabledProp = false, nativeButton = true, keepMounted = false, style, ...elementProps } = componentProps; const { disabled: fieldDisabled } = useFieldRootContext(); const store = useComboboxRootContext(); const selectionMode = useStore(store, selectors2.selectionMode); const comboboxDisabled = useStore(store, selectors2.disabled); const readOnly = useStore(store, selectors2.readOnly); const open = useStore(store, selectors2.open); const selectedValue = useStore(store, selectors2.selectedValue); const hasSelectionChips = useStore(store, selectors2.hasSelectionChips); const inputValue = useComboboxInputValueContext(); let visible = false; if (selectionMode === "none") { visible = inputValue !== ""; } else if (selectionMode === "single") { visible = selectedValue != null; } else { visible = hasSelectionChips; } const disabled2 = fieldDisabled || comboboxDisabled || disabledProp; const { buttonRef, getButtonProps } = useButton({ native: nativeButton, disabled: disabled2 }); const { mounted, transitionStatus, setMounted } = useTransitionStatus(visible); const state = { disabled: disabled2, visible, open, transitionStatus }; useOpenChangeComplete({ open: visible, ref: store.state.clearRef, onComplete() { if (!visible) { setMounted(false); } } }); const element = useRenderElement("button", componentProps, { state, ref: [forwardedRef, buttonRef, store.state.clearRef], props: [{ tabIndex: -1, children: "x", // Avoid stealing focus from the input. onMouseDown(event) { event.preventDefault(); }, onClick(event) { if (disabled2 || readOnly) { return; } const keyboardActiveRef = store.state.keyboardActiveRef; store.state.setInputValue("", createChangeEventDetails(reason_parts_exports.clearPress, event.nativeEvent)); if (selectionMode !== "none") { store.state.setSelectedValue(Array.isArray(selectedValue) ? [] : null, createChangeEventDetails(reason_parts_exports.clearPress, event.nativeEvent)); store.state.setIndices({ activeIndex: null, selectedIndex: null, type: keyboardActiveRef.current ? "keyboard" : "pointer" }); } else { store.state.setIndices({ activeIndex: null, type: keyboardActiveRef.current ? "keyboard" : "pointer" }); } store.state.inputRef.current?.focus(); } }, elementProps, getButtonProps], stateAttributesMapping }); const shouldRender = keepMounted || mounted; if (!shouldRender) { return null; } return element; }); if (true) ComboboxClear.displayName = "ComboboxClear"; // node_modules/@base-ui/react/esm/combobox/list/ComboboxList.js var React65 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/collection/ComboboxCollection.js var React64 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/collection/GroupCollectionContext.js var React63 = __toESM(require_react(), 1); var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); var GroupCollectionContext = /* @__PURE__ */ React63.createContext(null); if (true) GroupCollectionContext.displayName = "GroupCollectionContext"; function useGroupCollectionContext() { return React63.useContext(GroupCollectionContext); } function GroupCollectionProvider(props) { const { children, items } = props; const contextValue = React63.useMemo(() => ({ items }), [items]); return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GroupCollectionContext.Provider, { value: contextValue, children }); } // node_modules/@base-ui/react/esm/combobox/collection/ComboboxCollection.js var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); function ComboboxCollection(props) { const { children } = props; const { filteredItems } = useComboboxDerivedItemsContext(); const groupContext = useGroupCollectionContext(); const itemsToRender = groupContext ? groupContext.items : filteredItems; if (!itemsToRender) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(React64.Fragment, { children: itemsToRender.map(children) }); } // node_modules/@base-ui/react/esm/combobox/list/ComboboxList.js var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); var ComboboxList = /* @__PURE__ */ React65.forwardRef(function ComboboxList2(componentProps, forwardedRef) { var _ComboboxCollection; const { render, className, style, children, ...elementProps } = componentProps; const store = useComboboxRootContext(); const floatingRootContext = useComboboxFloatingContext(); const hasPositionerContext = Boolean(useComboboxPositionerContext(true)); const { filteredItems, hasItems } = useComboboxDerivedItemsContext(); const selectionMode = useStore(store, selectors2.selectionMode); const grid = useStore(store, selectors2.grid); const popupProps = useStore(store, selectors2.popupProps); const virtualized = useStore(store, selectors2.virtualized); const multiple = selectionMode === "multiple"; const empty = filteredItems.length === 0; const setPositionerElement = useStableCallback((element2) => { store.set("positionerElement", element2); }); const setListElement = useStableCallback((element2) => { store.set("listElement", element2); }); const resolvedChildren = React65.useMemo(() => { if (typeof children === "function") { return _ComboboxCollection || (_ComboboxCollection = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ComboboxCollection, { children })); } return children; }, [children]); const state = { empty }; const floatingId = floatingRootContext.useState("floatingId"); const element = useRenderElement("div", componentProps, { state, ref: [forwardedRef, setListElement, hasPositionerContext ? null : setPositionerElement], props: [popupProps, { children: resolvedChildren, tabIndex: -1, id: floatingId, role: grid ? "grid" : "listbox", "aria-multiselectable": multiple ? "true" : void 0, onKeyDown(event) { if (store.state.disabled || store.state.readOnly) { return; } if (event.key === "Enter") { const activeIndex = store.state.activeIndex; if (activeIndex == null) { return; } stopEvent(event); const nativeEvent = event.nativeEvent; const listItem = store.state.listRef.current[activeIndex]; if (listItem) { store.state.selectionEventRef.current = nativeEvent; listItem.click(); store.state.selectionEventRef.current = null; } } }, onKeyDownCapture() { store.state.keyboardActiveRef.current = true; }, onPointerMoveCapture() { store.state.keyboardActiveRef.current = false; } }, elementProps] }); if (virtualized) { return element; } return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CompositeList, { elementsRef: store.state.listRef, labelsRef: hasItems ? void 0 : store.state.labelsRef, children: element }); }); if (true) ComboboxList.displayName = "ComboboxList"; // node_modules/@base-ui/react/esm/combobox/status/ComboboxStatus.js var React67 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/utils/useInitialLiveRegionTextMutation.js var React66 = __toESM(require_react(), 1); var LIVE_REGION_MARKER = "\u2060"; var INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY = 200; function findLastTextNode(root) { const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT); let lastTextNode = null; while (walker.nextNode()) { const textNode = walker.currentNode; if (textNode.nodeValue !== "") { lastTextNode = textNode; } } return lastTextNode; } function useInitialLiveRegionTextMutation() { const timeout = useTimeout(); const rootRef = React66.useRef(null); React66.useEffect(() => { if (isIOS) { return void 0; } const root = rootRef.current; if (root == null) { return void 0; } const textNode = findLastTextNode(root); if (textNode == null) { return void 0; } const originalValue = textNode.nodeValue ?? ""; const markedValue = `${originalValue}${LIVE_REGION_MARKER}`; textNode.nodeValue = markedValue; timeout.start(INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY, () => { if (textNode.nodeValue === markedValue) { textNode.nodeValue = originalValue; } }); return () => { timeout.clear(); if (textNode.nodeValue === markedValue) { textNode.nodeValue = originalValue; } }; }, [rootRef, timeout]); return rootRef; } // node_modules/@base-ui/react/esm/combobox/status/ComboboxStatus.js var ComboboxStatus = /* @__PURE__ */ React67.forwardRef(function ComboboxStatus2(componentProps, forwardedRef) { const { render, className, style, children: childrenProp, ...elementProps } = componentProps; const statusRef = useInitialLiveRegionTextMutation(); return useRenderElement("div", componentProps, { ref: [forwardedRef, statusRef], props: [{ children: childrenProp, role: "status", "aria-live": "polite", "aria-atomic": true }, elementProps] }); }); if (true) ComboboxStatus.displayName = "ComboboxStatus"; // node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortal.js var React69 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortalContext.js var React68 = __toESM(require_react(), 1); var ComboboxPortalContext = /* @__PURE__ */ React68.createContext(void 0); if (true) ComboboxPortalContext.displayName = "ComboboxPortalContext"; function useComboboxPortalContext() { const context = React68.useContext(ComboboxPortalContext); if (context === void 0) { throw new Error(true ? "Base UI: <Combobox.Portal> is missing." : formatErrorMessage_default(20)); } return context; } // node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortal.js var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); var ComboboxPortal = /* @__PURE__ */ React69.forwardRef(function ComboboxPortal2(props, forwardedRef) { const { keepMounted = false, ...portalProps } = props; const store = useComboboxRootContext(); const mounted = useStore(store, selectors2.mounted); const forceMounted = useStore(store, selectors2.forceMounted); const shouldRender = mounted || keepMounted || forceMounted; if (!shouldRender) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ComboboxPortalContext.Provider, { value: keepMounted, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FloatingPortal, { ref: forwardedRef, ...portalProps }) }); }); if (true) ComboboxPortal.displayName = "ComboboxPortal"; // node_modules/@base-ui/react/esm/combobox/backdrop/ComboboxBackdrop.js var React70 = __toESM(require_react(), 1); var stateAttributesMapping2 = { ...popupStateMapping, ...transitionStatusMapping }; var ComboboxBackdrop = /* @__PURE__ */ React70.forwardRef(function ComboboxBackdrop2(componentProps, forwardedRef) { const { render, className, style, ...elementProps } = componentProps; const store = useComboboxRootContext(); const open = useStore(store, selectors2.open); const mounted = useStore(store, selectors2.mounted); const transitionStatus = useStore(store, selectors2.transitionStatus); const state = { open, transitionStatus }; return useRenderElement("div", componentProps, { state, ref: forwardedRef, stateAttributesMapping: stateAttributesMapping2, props: [{ role: "presentation", hidden: !mounted, style: { userSelect: "none", WebkitUserSelect: "none" } }, elementProps] }); }); if (true) ComboboxBackdrop.displayName = "ComboboxBackdrop"; // node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositioner.js var React73 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js var React71 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/floating-ui-react/middleware/arrow.js var baseArrow = (options) => ({ name: "arrow", options, async fn(state) { const { x, y, 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, y }; 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 min2 = minPadding; const max2 = clientSize - arrowDimensions[length] - maxPadding; const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; const offset4 = clamp(min2, center, max2); const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0; return { [axis]: coords[axis] + alignmentOffset, data: { [axis]: offset4, centerOffset: center - offset4 - alignmentOffset, ...shouldAddOffset && { alignmentOffset } }, reset: shouldAddOffset }; } }); var arrow4 = (options, deps) => ({ ...baseArrow(options), options: [options, deps] }); // node_modules/@base-ui/react/esm/utils/hideMiddleware.js var hide4 = { name: "hide", async fn(state) { const { width, height, x, y } = state.rects.reference; const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0; const nativeHideResult = await hide3().fn(state); return { data: { referenceHidden: nativeHideResult.data?.referenceHidden || anchorHidden } }; } }; // node_modules/@base-ui/react/esm/utils/adaptiveOriginMiddleware.js var DEFAULT_SIDES = { sideX: "left", sideY: "top" }; 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 x = rawX; let y = rawY; if (currentSide === "left") { x = offsetDimensions.width - (rawX + floatRect.width); } if (currentSide === "top") { y = offsetDimensions.height - (rawY + floatRect.height); } const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; return { x, y, data: { sideX, sideY } }; } }; // node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js 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) { 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, shiftCrossAxis = false, nodeId, adaptiveOrigin: adaptiveOrigin2, lazyFlip = false, externalTree } = params; const [mountSide, setMountSide] = React71.useState(null); if (!mounted && mountSide !== null) { setMountSide(null); } const collisionAvoidanceSide = collisionAvoidance.side || "flip"; const collisionAvoidanceAlign = collisionAvoidance.align || "flip"; const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end"; 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; 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; if (typeof collisionPadding === "number") { collisionPadding = { top: collisionPadding + biasTop, right: collisionPadding + biasRight, bottom: collisionPadding + biasBottom, left: collisionPadding + biasLeft }; } else if (collisionPadding) { collisionPadding = { top: (collisionPadding.top || 0) + biasTop, right: (collisionPadding.right || 0) + biasRight, bottom: (collisionPadding.bottom || 0) + biasBottom, left: (collisionPadding.left || 0) + biasLeft }; } const commonCollisionProps = { boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary, padding: collisionPadding }; const arrowRef = React71.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, right: collisionPadding.right + bias, bottom: collisionPadding.bottom + bias, left: collisionPadding.left + bias }, mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip", crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false, fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide }); const shiftMiddleware = shiftDisabled ? null : shift3((data) => { const html = ownerDocument(data.elements.floating).documentElement; return { ...commonCollisionProps, // Use the Layout Viewport to avoid shifting around when pinch-zooming // for context menus. rootBoundary: shiftCrossAxis ? { x: 0, y: 0, width: html.clientWidth, height: html.clientHeight } : void 0, 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, 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, availableHeight, rects }) { if (!mountedRef.current) { return; } const floatingStyle = floating.style; floatingStyle.setProperty("--available-width", `${availableWidth}px`); floatingStyle.setProperty("--available-height", `${availableHeight}px`); const dpr = getWindow(floating).devicePixelRatio || 1; const { x: x2, y: y2, width, height } = rects.reference; const anchorWidth = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; const anchorHeight = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; floatingStyle.setProperty("--anchor-width", `${anchorWidth}px`); floatingStyle.setProperty("--anchor-height", `${anchorHeight}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"), padding: arrowPadding, offsetParent: "floating" }), [arrowPadding]), { name: "transformOrigin", fn(state) { const { elements: elements2, middlewareData: middlewareData2, placement: renderedPlacement2, rects, y: y2 } = state; const currentRenderedSide = getSide(renderedPlacement2); const currentRenderedAxis = getSideAxis(currentRenderedSide); const arrowEl = arrowRef.current; const arrowX = middlewareData2.arrow?.x || 0; const arrowY = middlewareData2.arrow?.y || 0; const arrowWidth = arrowEl?.clientWidth || 0; const arrowHeight = arrowEl?.clientHeight || 0; const transformX = arrowX + arrowWidth / 2; const transformY = arrowY + arrowHeight / 2; const shiftY = Math.abs(middlewareData2.shift?.y || 0); const halfAnchorHeight = rects.reference.height / 2; const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; const isOverlappingAnchor = shiftY > sideOffsetValue; const adjacentTransformOrigin = { top: `${transformX}px calc(100% + ${sideOffsetValue}px)`, bottom: `${transformX}px ${-sideOffsetValue}px`, left: `calc(100% + ${sideOffsetValue}px) ${transformY}px`, right: `${-sideOffsetValue}px ${transformY}px` }[currentRenderedSide]; const overlapTransformOrigin = `${transformX}px ${rects.reference.y + halfAnchorHeight - y2}px`; elements2.floating.style.setProperty("--transform-origin", crossAxisShiftEnabled && currentRenderedAxis === "y" && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin); return {}; } }, hide4, adaptiveOrigin2); useIsoLayoutEffect(() => { if (!mounted && floatingRootContext) { floatingRootContext.update({ referenceElement: null, floatingElement: null, domReferenceElement: null, positionReference: null }); } }, [mounted, floatingRootContext]); const autoUpdateOptions = React71.useMemo(() => ({ elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" }), [disableAnchorTracking]); const { refs, elements, x, y, middlewareData, update: update2, placement: renderedPlacement, context, isPositioned, floatingStyles: originalFloatingStyles } = useFloating2({ 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 = React71.useMemo(() => { const base = adaptiveOrigin2 ? { position: resolvedPosition, [sideX]: x, [sideY]: y } : { position: resolvedPosition, ...originalFloatingStyles }; if (!isPositioned) { base.opacity = 0; } return base; }, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]); const registeredPositionReferenceRef = React71.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]); React71.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]); React71.useEffect(() => { if (keepMounted && mounted && elements.domReference && elements.floating) { return autoUpdate(elements.domReference, 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 anchorHidden = Boolean(middlewareData.hide?.referenceHidden); useIsoLayoutEffect(() => { if (lazyFlip && mounted && isPositioned) { setMountSide(renderedSide); } }, [lazyFlip, mounted, isPositioned, renderedSide]); const arrowStyles = React71.useMemo(() => ({ position: "absolute", top: middlewareData.arrow?.y, left: middlewareData.arrow?.x }), [middlewareData.arrow]); const arrowUncentered = middlewareData.arrow?.centerOffset !== 0; return React71.useMemo(() => ({ positionerStyles: floatingStyles, arrowStyles, arrowRef, arrowUncentered, side: logicalRenderedSide, align: renderedAlign, physicalSide: renderedSide, anchorHidden, refs, context, isPositioned, update: update2 }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update2]); } function isRef(param) { return param != null && "current" in param; } // node_modules/@base-ui/react/esm/utils/getDisabledMountTransitionStyles.js function getDisabledMountTransitionStyles(transitionStatus) { return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT; } // node_modules/@base-ui/react/esm/utils/usePositioner.js 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/esm/utils/useAnchoredPopupScrollLock.js var React72 = __toESM(require_react(), 1); var VIEWPORT_WIDTH_TOLERANCE_PX = 20; function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) { const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React72.useState(false); useIsoLayoutEffect(() => { if (!enabled || !touchOpen || positionerElement == null) { setTouchOpenShouldLockScroll(false); return; } const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth; const popupWidth = positionerElement.offsetWidth; setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX); }, [enabled, touchOpen, positionerElement]); useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement); } // node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositioner.js var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); var ComboboxPositioner = /* @__PURE__ */ React73.forwardRef(function ComboboxPositioner2(componentProps, forwardedRef) { const { render, className, anchor, positionMethod = "absolute", side = "bottom", align = "center", sideOffset = 0, alignOffset = 0, collisionBoundary = "clipping-ancestors", collisionPadding = 5, arrowPadding = 5, sticky = false, disableAnchorTracking = false, collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE, style: styleProp, ...elementProps } = componentProps; const store = useComboboxRootContext(); const { filteredItems } = useComboboxDerivedItemsContext(); const floatingRootContext = useComboboxFloatingContext(); const keepMounted = useComboboxPortalContext(); const modal = useStore(store, selectors2.modal); const open = useStore(store, selectors2.open); const mounted = useStore(store, selectors2.mounted); const openMethod = useStore(store, selectors2.openMethod); const positionerElement = useStore(store, selectors2.positionerElement); const triggerElement = useStore(store, selectors2.triggerElement); const inputElement = useStore(store, selectors2.inputElement); const inputGroupElement = useStore(store, selectors2.inputGroupElement); const inputInsidePopup = useStore(store, selectors2.inputInsidePopup); const transitionStatus = useStore(store, selectors2.transitionStatus); const empty = filteredItems.length === 0; const resolvedAnchor = anchor ?? (inputInsidePopup ? triggerElement : inputGroupElement ?? inputElement); const positioning = useAnchorPositioning({ anchor: resolvedAnchor, floatingRootContext, positionMethod, mounted, side, sideOffset, align, alignOffset, arrowPadding, collisionBoundary, collisionPadding, sticky, disableAnchorTracking, keepMounted, collisionAvoidance, lazyFlip: true }); useAnchoredPopupScrollLock(open && modal, openMethod === "touch", positionerElement, triggerElement); const state = { open, side: positioning.side, align: positioning.align, anchorHidden: positioning.anchorHidden, empty }; useIsoLayoutEffect(() => { store.set("popupSide", positioning.side); }, [store, positioning.side]); const setPositionerElement = useStableCallback((element2) => { store.set("positionerElement", element2); }); const element = usePositioner(componentProps, state, { styles: positioning.positionerStyles, transitionStatus, props: elementProps, refs: [forwardedRef, setPositionerElement], hidden: !mounted, inert: !open }); return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(ComboboxPositionerContext.Provider, { value: positioning, children: [mounted && modal && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InternalBackdrop, { inert: inertValue(!open), cutout: inputGroupElement ?? inputElement ?? triggerElement }), element] }); }); if (true) ComboboxPositioner.displayName = "ComboboxPositioner"; // node_modules/@base-ui/react/esm/combobox/popup/ComboboxPopup.js var React74 = __toESM(require_react(), 1); var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); var stateAttributesMapping3 = { ...popupStateMapping, ...transitionStatusMapping }; var ComboboxPopup = /* @__PURE__ */ React74.forwardRef(function ComboboxPopup2(componentProps, forwardedRef) { const { render, className, style, initialFocus, finalFocus, ...elementProps } = componentProps; const store = useComboboxRootContext(); const positioning = useComboboxPositionerContext(); const floatingRootContext = useComboboxFloatingContext(); const { filteredItems } = useComboboxDerivedItemsContext(); const mounted = useStore(store, selectors2.mounted); const open = useStore(store, selectors2.open); const openMethod = useStore(store, selectors2.openMethod); const transitionStatus = useStore(store, selectors2.transitionStatus); const inputInsidePopup = useStore(store, selectors2.inputInsidePopup); const inputElement = useStore(store, selectors2.inputElement); const modal = useStore(store, selectors2.modal); const empty = filteredItems.length === 0; useOpenChangeComplete({ open, ref: store.state.popupRef, onComplete() { if (open) { store.state.onOpenChangeComplete(true); } } }); const state = { open, side: positioning.side, align: positioning.align, anchorHidden: positioning.anchorHidden, transitionStatus, empty }; const element = useRenderElement("div", componentProps, { state, ref: [forwardedRef, store.state.popupRef], props: [{ role: inputInsidePopup ? "dialog" : "presentation", tabIndex: -1, onFocus(event) { const target = getTarget(event.nativeEvent); if (openMethod !== "touch" && (contains(store.state.listElement, target) || target === event.currentTarget)) { store.state.inputRef.current?.focus(); } } }, getDisabledMountTransitionStyles(transitionStatus), elementProps], stateAttributesMapping: stateAttributesMapping3 }); const computedDefaultInitialFocus = inputInsidePopup ? (interactionType) => interactionType === "touch" ? store.state.popupRef.current : inputElement : false; const resolvedInitialFocus = initialFocus === void 0 ? computedDefaultInitialFocus : initialFocus; let resolvedFinalFocus; if (finalFocus != null) { resolvedFinalFocus = finalFocus; } else { resolvedFinalFocus = inputInsidePopup ? void 0 : false; } const focusManagerModal = !inputInsidePopup || modal; return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FloatingFocusManager, { context: floatingRootContext, disabled: !mounted, modal: focusManagerModal, openInteractionType: openMethod, initialFocus: resolvedInitialFocus, returnFocus: resolvedFinalFocus, getInsideElements: () => [store.state.startDismissRef.current, store.state.endDismissRef.current], children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(React74.Fragment, { children: [element, focusManagerModal && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ComboboxInternalDismissButton, { ref: store.state.endDismissRef })] }) }); }); if (true) ComboboxPopup.displayName = "ComboboxPopup"; // node_modules/@base-ui/react/esm/combobox/arrow/ComboboxArrow.js var React75 = __toESM(require_react(), 1); var ComboboxArrow = /* @__PURE__ */ React75.forwardRef(function ComboboxArrow2(componentProps, forwardedRef) { const { render, className, style, ...elementProps } = componentProps; const store = useComboboxRootContext(); const { arrowRef, side, align, arrowUncentered, arrowStyles } = useComboboxPositionerContext(); const open = useStore(store, selectors2.open); const state = { open, side, align, uncentered: arrowUncentered }; return useRenderElement("div", componentProps, { ref: [arrowRef, forwardedRef], stateAttributesMapping: popupStateMapping, state, props: { style: arrowStyles, "aria-hidden": true, ...elementProps } }); }); if (true) ComboboxArrow.displayName = "ComboboxArrow"; // node_modules/@base-ui/react/esm/combobox/group/ComboboxGroup.js var React77 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/combobox/group/ComboboxGroupContext.js var React76 = __toESM(require_react(), 1); var ComboboxGroupContext = /* @__PURE__ */ React76.createContext(void 0); if (true) ComboboxGroupContext.displayName = "ComboboxGroupContext"; function useComboboxGroupContext() { const context = React76.useContext(ComboboxGroupContext); if (context === void 0) { throw new Error(true ? "Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>." : formatErrorMessage_default(18)); } return context; } // node_modules/@base-ui/react/esm/combobox/group/ComboboxGroup.js var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); var ComboboxGroup = /* @__PURE__ */ React77.forwardRef(function ComboboxGroup2(componentProps, forwardedRef) { const { render, className, style, items, ...elementProps } = componentProps; const [labelId, setLabelId] = React77.useState(); const contextValue = React77.useMemo(() => ({ labelId, setLabelId, items }), [labelId, setLabelId, items]); const element = useRenderElement("div", componentProps, { ref: forwardedRef, props: [{ role: "group", "aria-labelledby": labelId }, elementProps] }); const wrappedElement = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ComboboxGroupContext.Provider, { value: contextValue, children: element }); if (items) { return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GroupCollectionProvider, { items, children: wrappedElement }); } return wrappedElement; }); if (true) ComboboxGroup.displayName = "ComboboxGroup"; // node_modules/@base-ui/react/esm/combobox/group-label/ComboboxGroupLabel.js var React78 = __toESM(require_react(), 1); var ComboboxGroupLabel = /* @__PURE__ */ React78.forwardRef(function ComboboxGroupLabel2(componentProps, forwardedRef) { const { render, className, style, id: idProp, ...elementProps } = componentProps; const { setLabelId } = useComboboxGroupContext(); const id = useBaseUiId(idProp); useIsoLayoutEffect(() => { setLabelId(id); return () => { setLabelId(void 0); }; }, [id, setLabelId]); const element = useRenderElement("div", componentProps, { ref: forwardedRef, props: [{ id }, elementProps] }); return element; }); if (true) ComboboxGroupLabel.displayName = "ComboboxGroupLabel"; // node_modules/@base-ui/react/esm/combobox/item/ComboboxItem.js var React81 = __toESM(require_react(), 1); var ReactDOM5 = __toESM(require_react_dom(), 1); // node_modules/@base-ui/react/esm/combobox/item/ComboboxItemContext.js var React79 = __toESM(require_react(), 1); var ComboboxItemContext = /* @__PURE__ */ React79.createContext(void 0); if (true) ComboboxItemContext.displayName = "ComboboxItemContext"; // node_modules/@base-ui/react/esm/combobox/row/ComboboxRowContext.js var React80 = __toESM(require_react(), 1); var ComboboxRowContext = /* @__PURE__ */ React80.createContext(false); if (true) ComboboxRowContext.displayName = "ComboboxRowContext"; function useComboboxRowContext() { return React80.useContext(ComboboxRowContext); } // node_modules/@base-ui/react/esm/combobox/item/ComboboxItem.js var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); var ComboboxItem = /* @__PURE__ */ React81.memo(/* @__PURE__ */ React81.forwardRef(function ComboboxItem2(componentProps, forwardedRef) { const { render, className, style, value: itemValue = null, index: indexProp, disabled: disabled2 = false, nativeButton = false, ...elementProps } = componentProps; const didPointerDownRef = React81.useRef(false); const textRef = React81.useRef(null); const listItem = useCompositeListItem({ index: indexProp, textRef, indexGuessBehavior: IndexGuessBehavior.GuessFromOrder }); const store = useComboboxRootContext(); const isRow = useComboboxRowContext(); const { flatFilteredItems, hasItems } = useComboboxDerivedItemsContext(); const open = useStore(store, selectors2.open); const selectionMode = useStore(store, selectors2.selectionMode); const readOnly = useStore(store, selectors2.readOnly); const virtualized = useStore(store, selectors2.virtualized); const isItemEqualToValue = useStore(store, selectors2.isItemEqualToValue); const selectable = selectionMode !== "none"; const index2 = indexProp ?? (virtualized ? findItemIndex(flatFilteredItems, itemValue, isItemEqualToValue) : listItem.index); const hasRegistered = listItem.index !== -1; const rootId = useStore(store, selectors2.id); const highlighted = useStore(store, selectors2.isActive, index2); const matchesSelectedValue = useStore(store, selectors2.isSelected, itemValue); const itemProps = useStore(store, selectors2.itemProps); const itemRef = React81.useRef(null); const id = rootId != null && hasRegistered ? `${rootId}-${index2}` : void 0; const selected = matchesSelectedValue && selectable; useIsoLayoutEffect(() => { const shouldRun = hasRegistered && (virtualized || indexProp != null); if (!shouldRun) { return void 0; } const list = store.state.listRef.current; list[index2] = itemRef.current; return () => { delete list[index2]; }; }, [hasRegistered, virtualized, index2, indexProp, store]); useIsoLayoutEffect(() => { if (!hasRegistered || hasItems) { return void 0; } const visibleMap = store.state.valuesRef.current; visibleMap[index2] = itemValue; if (selectionMode !== "none") { store.state.allValuesRef.current.push(itemValue); } return () => { delete visibleMap[index2]; }; }, [hasRegistered, hasItems, index2, itemValue, store, selectionMode]); useIsoLayoutEffect(() => { if (!open) { didPointerDownRef.current = false; return; } if (!hasRegistered || hasItems) { return; } const selectedValue = store.state.selectedValue; const lastSelectedValue = Array.isArray(selectedValue) ? selectedValue[selectedValue.length - 1] : selectedValue; if (compareItemEquality(itemValue, lastSelectedValue, isItemEqualToValue)) { store.set("selectedIndex", index2); } }, [hasRegistered, hasItems, open, store, index2, itemValue, isItemEqualToValue]); const { getButtonProps, buttonRef } = useButton({ disabled: disabled2, focusableWhenDisabled: true, native: nativeButton, composite: true }); const state = { disabled: disabled2, selected, highlighted }; function commitSelection(nativeEvent) { function selectItem() { store.state.handleSelection(nativeEvent, itemValue); } if (store.state.submitOnItemClick) { ReactDOM5.flushSync(selectItem); store.state.requestSubmit(); } else { selectItem(); } } const defaultProps = { id, role: isRow ? "gridcell" : "option", "aria-selected": selectable ? selected : void 0, // Focusable items steal focus from the input upon mouseup. // Warn if the user renders a natively focusable element like `<button>`, // as it should be a `<div>` instead. tabIndex: void 0, onPointerDownCapture(event) { didPointerDownRef.current = true; event.preventDefault(); }, onMouseDown(event) { event.preventDefault(); }, onClick(event) { if (disabled2 || readOnly) { return; } commitSelection(event.nativeEvent); }, onMouseUp(event) { const pointerStartedOnItem = didPointerDownRef.current; didPointerDownRef.current = false; if (disabled2 || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) { return; } commitSelection(event.nativeEvent); } }; const element = useRenderElement("div", componentProps, { ref: [buttonRef, forwardedRef, listItem.ref, itemRef], state, props: [itemProps, defaultProps, elementProps, getButtonProps] }); const contextValue = React81.useMemo(() => ({ selected, textRef }), [selected, textRef]); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ComboboxItemContext.Provider, { value: contextValue, children: element }); })); if (true) ComboboxItem.displayName = "ComboboxItem"; // node_modules/@base-ui/react/esm/autocomplete/item/AutocompleteItem.js var AutocompleteItem = ComboboxItem; // node_modules/@base-ui/react/esm/combobox/row/ComboboxRow.js var React82 = __toESM(require_react(), 1); var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); var ComboboxRow = /* @__PURE__ */ React82.forwardRef(function ComboboxRow2(componentProps, forwardedRef) { const { render, className, style, ...elementProps } = componentProps; const element = useRenderElement("div", componentProps, { ref: forwardedRef, props: [{ role: "row" }, elementProps] }); return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ComboboxRowContext.Provider, { value: true, children: element }); }); if (true) ComboboxRow.displayName = "ComboboxRow"; // node_modules/@base-ui/react/esm/combobox/empty/ComboboxEmpty.js var React83 = __toESM(require_react(), 1); var ComboboxEmpty = /* @__PURE__ */ React83.forwardRef(function ComboboxEmpty2(componentProps, forwardedRef) { const { render, className, style, children: childrenProp, ...elementProps } = componentProps; const { filteredItems } = useComboboxDerivedItemsContext(); const store = useComboboxRootContext(); const emptyRef = useInitialLiveRegionTextMutation(); const children = filteredItems.length === 0 ? childrenProp : null; return useRenderElement("div", componentProps, { ref: [forwardedRef, store.state.emptyRef, emptyRef], props: [{ children, role: "status", "aria-live": "polite", "aria-atomic": true }, elementProps] }); }); if (true) ComboboxEmpty.displayName = "ComboboxEmpty"; // node_modules/@base-ui/react/esm/separator/Separator.js var React84 = __toESM(require_react(), 1); var Separator = /* @__PURE__ */ React84.forwardRef(function SeparatorComponent(componentProps, forwardedRef) { const { className, render, 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/esm/combobox/root/utils/useFilteredItems.js function useFilteredItems() { const items = useComboboxDerivedItemsContext(); return items.filteredItems; } // node_modules/@base-ui/react/esm/button/Button.js var React85 = __toESM(require_react(), 1); var Button = /* @__PURE__ */ React85.forwardRef(function Button2(componentProps, forwardedRef) { const { render, 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/esm/field/item/FieldItemContext.js var React86 = __toESM(require_react(), 1); var FieldItemContext = /* @__PURE__ */ React86.createContext({ disabled: false }); if (true) FieldItemContext.displayName = "FieldItemContext"; // node_modules/@base-ui/react/esm/checkbox-group/CheckboxGroupContext.js var React87 = __toESM(require_react(), 1); var CheckboxGroupContext = /* @__PURE__ */ React87.createContext(void 0); if (true) CheckboxGroupContext.displayName = "CheckboxGroupContext"; function useCheckboxGroupContext(optional = true) { const context = React87.useContext(CheckboxGroupContext); if (context === void 0 && !optional) { throw new Error(true ? "Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>." : formatErrorMessage_default(3)); } return context; } // node_modules/@base-ui/react/esm/utils/useRegisteredLabelId.js function useRegisteredLabelId(idProp, setLabelId) { const id = useBaseUiId(idProp); useIsoLayoutEffect(() => { setLabelId(id); return () => { setLabelId(void 0); }; }, [id, setLabelId]); return id; } // node_modules/@base-ui/react/esm/internals/labelable-provider/useLabel.js 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 ?? void 0, 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/esm/utils/usePopupViewport.js var React90 = __toESM(require_react(), 1); var ReactDOM6 = __toESM(require_react_dom(), 1); // node_modules/@base-ui/utils/esm/usePreviousValue.js var React88 = __toESM(require_react(), 1); function usePreviousValue(value) { const [state, setState] = React88.useState({ current: value, previous: null }); if (value !== state.current) { setState({ current: value, previous: state.current }); } return state.previous; } // node_modules/@base-ui/react/esm/utils/usePopupAutoResize.js var React89 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/utils/getCssDimensions.js 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/esm/utils/usePopupAutoResize.js var DEFAULT_ENABLED = () => true; function usePopupAutoResize(parameters) { const { popupElement, positionerElement, content, mounted, enabled = DEFAULT_ENABLED, onMeasureLayout: onMeasureLayoutParam, onMeasureLayoutComplete: onMeasureLayoutCompleteParam, side, direction } = parameters; const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true, false); const animationFrame = useAnimationFrame(); const committedDimensionsRef = React89.useRef(null); const liveDimensionsRef = React89.useRef(null); const isInitialRenderRef = React89.useRef(true); const restoreAnchoringStylesRef = React89.useRef(NOOP); const onMeasureLayout = useStableCallback(onMeasureLayoutParam); const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam); const anchoringStyles = React89.useMemo(() => { let isOriginSide = side === "top"; let isPhysicalLeft = side === "left"; if (direction === "rtl") { isOriginSide = isOriginSide || side === "inline-end"; isPhysicalLeft = isPhysicalLeft || side === "inline-end"; } else { isOriginSide = isOriginSide || side === "inline-start"; isPhysicalLeft = isPhysicalLeft || side === "inline-start"; } return isOriginSide ? { position: "absolute", [side === "top" ? "bottom" : "top"]: "0", [isPhysicalLeft ? "right" : "left"]: "0" } : EMPTY_OBJECT; }, [side, direction]); useIsoLayoutEffect(() => { if (!mounted || !enabled() || typeof ResizeObserver !== "function") { restoreAnchoringStylesRef.current = NOOP; isInitialRenderRef.current = true; committedDimensionsRef.current = null; liveDimensionsRef.current = null; return void 0; } if (!popupElement || !positionerElement) { return void 0; } restoreAnchoringStylesRef.current = applyElementStyles(popupElement, anchoringStyles); const observer = new ResizeObserver((entries) => { const entry = entries[0]; if (entry) { liveDimensionsRef.current = { width: Math.ceil(entry.borderBoxSize[0].inlineSize), height: Math.ceil(entry.borderBoxSize[0].blockSize) }; } }); observer.observe(popupElement); 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, { "--available-width": "max-content", "--available-height": "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 () => { observer.disconnect(); restoreAnchoringStylesRef.current(); restoreAnchoringStylesRef.current = NOOP; }; } setPopupCssSize(popupElement, "auto"); setPositionerCssSize(positionerElement, "max-content"); const previousDimensions = committedDimensionsRef.current ?? liveDimensionsRef.current; const newDimensions = getCssDimensions2(popupElement); committedDimensionsRef.current = newDimensions; if (!previousDimensions) { setPositionerCssSize(positionerElement, newDimensions); restoreMeasurementOverridesIncludingScale(); onMeasureLayoutComplete?.(null, newDimensions); return () => { observer.disconnect(); animationFrame.cancel(); restoreAnchoringStylesRef.current(); restoreAnchoringStylesRef.current = NOOP; }; } setPopupCssSize(popupElement, previousDimensions); restoreMeasurementOverridesIncludingScale(); onMeasureLayoutComplete?.(previousDimensions, newDimensions); setPositionerCssSize(positionerElement, newDimensions); const abortController = new AbortController(); animationFrame.request(() => { setPopupCssSize(popupElement, newDimensions); runOnceAnimationsFinish(() => { popupElement.style.setProperty("--popup-width", "auto"); popupElement.style.setProperty("--popup-height", "auto"); }, abortController.signal); }); return () => { observer.disconnect(); abortController.abort(); animationFrame.cancel(); restoreAnchoringStylesRef.current(); restoreAnchoringStylesRef.current = NOOP; }; }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, enabled, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]); } 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("--popup-width", width); popupElement.style.setProperty("--popup-height", 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("--positioner-width", width); positionerElement.style.setProperty("--positioner-height", height); } // node_modules/@base-ui/react/esm/utils/usePopupViewport.js var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); function usePopupViewport(parameters) { const { store, side, cssVars, children } = parameters; const direction = useDirection(); const activeTrigger = store.useState("activeTriggerElement"); const activeTriggerId = store.useState("activeTriggerId"); const open = 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(open ? 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, false); const cleanupFrame = useAnimationFrame(); const [previousContentDimensions, setPreviousContentDimensions] = React90.useState(null); const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React90.useState(false); useIsoLayoutEffect(() => { store.set("hasViewport", true); return () => { store.set("hasViewport", false); }; }, [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 lastHandledTriggerRef = React90.useRef(null); useIsoLayoutEffect(() => { if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { setPreviousContentNode(capturedNodeRef.current); setShowStartingStyleAttribute(true); const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger); setNewTriggerOffset(offset4); cleanupFrame.request(() => { ReactDOM6.flushSync(() => { setShowStartingStyleAttribute(false); }); onAnimationsFinished(() => { setPreviousContentNode(null); setPreviousContentDimensions(null); capturedNodeRef.current = null; }); }); lastHandledTriggerRef.current = activeTrigger; } }, [activeTrigger, previousActiveTrigger, previousContentNode, onAnimationsFinished, 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_runtime26.jsx)("div", { "data-current": true, ref: currentContainerRef, children }, currentContentKey); } else { childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(React90.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "data-previous": true, inert: inertValue(true), ref: previousContainerRef, style: { ...previousContentDimensions ? { [cssVars.popupWidth]: `${previousContentDimensions.width}px`, [cssVars.popupHeight]: `${previousContentDimensions.height}px` } : null, position: "absolute" }, "data-ending-style": showStartingStyleAttribute ? void 0 : "" }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime26.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/esm/field/index.parts.js 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/esm/field/root/FieldRoot.js var React95 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/fieldset/root/FieldsetRootContext.js var React91 = __toESM(require_react(), 1); var FieldsetRootContext = /* @__PURE__ */ React91.createContext({ legendId: void 0, setLegendId: () => { }, disabled: void 0 }); if (true) FieldsetRootContext.displayName = "FieldsetRootContext"; function useFieldsetRootContext(optional = false) { const context = React91.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/esm/internals/labelable-provider/LabelableProvider.js var React92 = __toESM(require_react(), 1); var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); var LabelableProvider = function LabelableProvider2(props) { const defaultId = useBaseUiId(); const initialControlId = props.controlId === void 0 ? defaultId : props.controlId; const [controlId, setControlIdState] = React92.useState(initialControlId); const [labelId, setLabelId] = React92.useState(props.labelId); const [messageIds, setMessageIds] = React92.useState([]); 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); return; } registrations.set(source, nextId); setControlIdState((prev) => { if (registrations.size === 0) { return void 0; } let nextControlId; for (const id of registrations.values()) { if (prev !== void 0 && id === prev) { return prev; } if (nextControlId === void 0) { nextControlId = id; } } return nextControlId; }); }); const getDescriptionProps = React92.useCallback((externalProps) => { return mergeProps({ "aria-describedby": parentMessageIds.concat(messageIds).join(" ") || void 0 }, externalProps); }, [parentMessageIds, messageIds]); const contextValue = React92.useMemo(() => ({ controlId, registerControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps }), [controlId, registerControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]); return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LabelableContext.Provider, { value: contextValue, children: props.children }); }; if (true) LabelableProvider.displayName = "LabelableProvider"; // node_modules/@base-ui/react/esm/field/root/useFieldValidation.js var React93 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/field/utils/getCombinedFieldValidityData.js function getCombinedFieldValidityData(validityData, invalid) { return { ...validityData, state: { ...validityData.state, valid: !invalid && validityData.state.valid } }; } // node_modules/@base-ui/react/esm/field/root/useFieldValidation.js var validityKeys = Object.keys(DEFAULT_VALIDITY_STATE); function isOnlyValueMissing(state) { if (!state || state.valid || !state.valueMissing) { return false; } let onlyValueMissing = false; for (const key of validityKeys) { if (key === "valid") { continue; } if (key === "valueMissing") { onlyValueMissing = state[key]; } if (state[key]) { onlyValueMissing = false; } } return onlyValueMissing; } function useFieldValidation(params) { const { formRef, clearErrors } = useFormContext(); const { setValidityData, validate, validityData, validationDebounceTime, invalid, markedDirtyRef, state, name, shouldValidateOnChange, getRegisteredFieldId } = params; const { controlId, getDescriptionProps } = useLabelableContext(); const timeout = useTimeout(); const inputRef = React93.useRef(null); const commit = useStableCallback(async (value, revalidate = false) => { const element = inputRef.current; if (!element) { return; } function updateRegisteredFieldValidity(nextValidityData2, externalInvalid = invalid) { const fieldId = getRegisteredFieldId() ?? controlId; if (fieldId == null) { return; } const currentFieldData = formRef.current.fields.get(fieldId); if (!currentFieldData) { return; } const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData2, externalInvalid); formRef.current.fields.set(fieldId, { ...currentFieldData, validityData: validityDataWithFormErrors }); } if (revalidate) { if (state.valid !== false) { return; } const currentNativeValidity = element.validity; if (!currentNativeValidity.valueMissing) { const nextValidityData2 = { value, state: { ...DEFAULT_VALIDITY_STATE, valid: true }, error: "", errors: [], initialValue: validityData.initialValue }; element.setCustomValidity(""); updateRegisteredFieldValidity(nextValidityData2, false); setValidityData(nextValidityData2); return; } const currentNativeValidityObject = validityKeys.reduce((acc, key) => { acc[key] = currentNativeValidity[key]; return acc; }, {}); if (!currentNativeValidityObject.valid && !isOnlyValueMissing(currentNativeValidityObject)) { return; } } 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; } timeout.clear(); let result = null; let validationErrors = []; const nextState = getState(element); let defaultValidationMessage; const validateOnChange = shouldValidateOnChange(); if (element.validationMessage && !validateOnChange) { defaultValidationMessage = element.validationMessage; validationErrors = [element.validationMessage]; } else { 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); if (typeof resultOrPromise === "object" && resultOrPromise !== null && "then" in resultOrPromise) { result = await resultOrPromise; } else { result = resultOrPromise; } if (result !== null) { nextState.valid = false; nextState.customError = true; if (Array.isArray(result)) { validationErrors = result; element.setCustomValidity(result.join("\n")); } else if (result) { validationErrors = [result]; element.setCustomValidity(result); } } else if (validateOnChange) { element.setCustomValidity(""); nextState.customError = false; if (element.validationMessage) { defaultValidationMessage = element.validationMessage; validationErrors = [element.validationMessage]; } else if (element.validity.valid && !nextState.valid) { nextState.valid = true; } } } const nextValidityData = { value, state: nextState, error: defaultValidationMessage ?? (Array.isArray(result) ? result[0] : result ?? ""), errors: validationErrors, initialValue: validityData.initialValue }; updateRegisteredFieldValidity(nextValidityData); setValidityData(nextValidityData); }); const getValidationProps = React93.useCallback((externalProps = {}) => mergeProps(getDescriptionProps, state.valid === false ? { "aria-invalid": true } : EMPTY_OBJECT, externalProps), [getDescriptionProps, state.valid]); const getInputValidationProps = React93.useCallback((externalProps = {}) => mergeProps({ onChange(event) { if (event.nativeEvent.defaultPrevented) { return; } clearErrors(name); if (!shouldValidateOnChange()) { commit(event.currentTarget.value, true); return; } const element = event.currentTarget; if (element.value === "") { commit(element.value); return; } timeout.clear(); if (validationDebounceTime) { timeout.start(validationDebounceTime, () => { commit(element.value); }); } else { commit(element.value); } } }, getValidationProps(externalProps)), [getValidationProps, clearErrors, name, timeout, commit, validationDebounceTime, shouldValidateOnChange]); return React93.useMemo(() => ({ getValidationProps, getInputValidationProps, inputRef, commit }), [getValidationProps, getInputValidationProps, commit]); } // node_modules/@base-ui/react/esm/internals/field-register-control/useFieldControlRegistration.js var React94 = __toESM(require_react(), 1); function useFieldControlRegistration(params) { const { commit, invalid, markedDirtyRef, name, setRegisteredFieldId, setValidityData, validityData } = params; const { formRef } = useFormContext(); const activeFieldControlSourceRef = React94.useRef(null); const registrationRef = React94.useRef(null); const fallbackControlRef = React94.useRef(null); const getValueForForm = useStableCallback(() => { const registration = registrationRef.current; if (!registration) { return void 0; } if (registration.getValue) { return registration.getValue(); } return registration.value; }); const validate = useStableCallback(() => { const registration = registrationRef.current; if (!registration) { return; } let nextValue = registration.value; if (nextValue === void 0) { nextValue = getValueForForm(); } markedDirtyRef.current = true; commit(nextValue); }); function refreshRegistration() { const registration = registrationRef.current; if (!registration || !registration.id) { return; } formRef.current.fields.set(registration.id, { getValue: getValueForForm, name, controlRef: registration.controlRef ?? fallbackControlRef, validityData: getCombinedFieldValidityData(validityData, invalid), validate }); } function deleteRegistration(id = registrationRef.current?.id) { if (id) { formRef.current.fields.delete(id); } } function syncInitialValue() { const registration = registrationRef.current; if (!registration) { return; } let initialValue = registration.value; if (initialValue === void 0) { initialValue = getValueForForm(); } if (validityData.initialValue === null && initialValue !== null) { setValidityData((prev) => ({ ...prev, initialValue })); } } useIsoLayoutEffect(() => { const registration = registrationRef.current; if (!registration || !registration.id) { return; } formRef.current.fields.set(registration.id, { getValue: getValueForForm, name, controlRef: registration.controlRef ?? fallbackControlRef, validityData: getCombinedFieldValidityData(validityData, invalid), validate }); }, [formRef, getValueForForm, invalid, name, validate, validityData]); useIsoLayoutEffect(() => { const fields = formRef.current.fields; return () => { const id = registrationRef.current?.id; if (id) { fields.delete(id); } }; }, [formRef]); return useStableCallback((source, registration) => { if (!registration) { if (activeFieldControlSourceRef.current === source) { activeFieldControlSourceRef.current = null; deleteRegistration(); registrationRef.current = null; setRegisteredFieldId(void 0); } return; } const previousId = registrationRef.current?.id; activeFieldControlSourceRef.current = source; registrationRef.current = registration; setRegisteredFieldId(registration.id); if (previousId && previousId !== registration.id) { deleteRegistration(previousId); } syncInitialValue(); refreshRegistration(); }); } // node_modules/@base-ui/react/esm/field/root/FieldRoot.js var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); var FieldRootInner = /* @__PURE__ */ React95.forwardRef(function FieldRootInner2(componentProps, forwardedRef) { const { errors, validationMode: formValidationMode, submitAttemptedRef } = useFormContext(); const { render, className, validate: validateProp, validationDebounceTime = 0, validationMode = formValidationMode, name, disabled: disabledProp = false, invalid: invalidProp, dirty: dirtyProp, touched: touchedProp, actionsRef, style, ...elementProps } = componentProps; const { disabled: disabledFieldset } = useFieldsetRootContext(); const validate = useStableCallback(validateProp || (() => null)); const disabled2 = disabledFieldset || disabledProp; const [touchedState, setTouchedUnwrapped] = React95.useState(false); const [dirtyState, setDirtyUnwrapped] = React95.useState(false); const [filled, setFilled] = React95.useState(false); const [focused, setFocused] = React95.useState(false); const dirty = dirtyProp ?? dirtyState; const touched = touchedProp ?? touchedState; const markedDirtyRef = React95.useRef(false); const registeredFieldIdRef = React95.useRef(void 0); const getRegisteredFieldId = React95.useCallback(() => registeredFieldIdRef.current, []); const setRegisteredFieldId = React95.useCallback((id) => { registeredFieldIdRef.current = id; }, []); 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" && submitAttemptedRef.current); const hasFormError = !!name && Object.hasOwn(errors, name) && errors[name] !== void 0; const invalid = invalidProp === true || hasFormError; const [validityData, setValidityData] = React95.useState({ state: DEFAULT_VALIDITY_STATE, error: "", errors: [], value: null, initialValue: null }); const valid = !invalid && validityData.state.valid; const state = React95.useMemo(() => ({ disabled: disabled2, touched, dirty, valid, filled, focused }), [disabled2, touched, dirty, valid, filled, focused]); const validation = useFieldValidation({ setValidityData, validate, validityData, validationDebounceTime, invalid, markedDirtyRef, state, name, shouldValidateOnChange, getRegisteredFieldId }); const validityValue = validityData.value; const handleImperativeValidate = React95.useCallback(() => { markedDirtyRef.current = true; validation.commit(validityValue); }, [validation, validityValue]); const registerFieldControl = useFieldControlRegistration({ commit: validation.commit, invalid, markedDirtyRef, name, setRegisteredFieldId, setValidityData, validityData }); React95.useImperativeHandle(actionsRef, () => ({ validate: handleImperativeValidate }), [handleImperativeValidate]); const contextValue = React95.useMemo(() => ({ invalid, name, validityData, setValidityData, disabled: disabled2, touched, setTouched, dirty, setDirty, filled, setFilled, focused, setFocused, validate, validationMode, validationDebounceTime, shouldValidateOnChange, state, markedDirtyRef, registerFieldControl, validation }), [invalid, name, validityData, disabled2, touched, setTouched, dirty, setDirty, filled, setFilled, focused, setFocused, validate, validationMode, validationDebounceTime, shouldValidateOnChange, state, registerFieldControl, validation]); const element = useRenderElement("div", componentProps, { ref: forwardedRef, state, props: elementProps, stateAttributesMapping: fieldValidityMapping }); return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FieldRootContext.Provider, { value: contextValue, children: element }); }); if (true) FieldRootInner.displayName = "FieldRootInner"; var FieldRoot = /* @__PURE__ */ React95.forwardRef(function FieldRoot2(componentProps, forwardedRef) { return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LabelableProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FieldRootInner, { ...componentProps, ref: forwardedRef }) }); }); if (true) FieldRoot.displayName = "FieldRoot"; // node_modules/@base-ui/react/esm/field/label/FieldLabel.js var React96 = __toESM(require_react(), 1); var FieldLabel = /* @__PURE__ */ React96.forwardRef(function FieldLabel2(componentProps, forwardedRef) { const { render, className, style, id: idProp, nativeLabel = true, ...elementProps } = componentProps; const fieldRootContext = useFieldRootContext(false); const { labelId } = useLabelableContext(); const labelRef = React96.useRef(null); const labelProps = useLabel({ id: labelId ?? idProp, native: nativeLabel }); if (true) { React96.useEffect(() => { if (!labelRef.current) { return; } const isLabelTag = labelRef.current.tagName === "LABEL"; if (nativeLabel) { if (!isLabelTag) { const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; const message = "<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(`${message}${ownerStackMessage}`); } } else if (isLabelTag) { const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; const message = "<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(`${message}${ownerStackMessage}`); } }, [nativeLabel]); } const element = useRenderElement("label", componentProps, { ref: [forwardedRef, labelRef], state: fieldRootContext.state, props: [labelProps, elementProps], stateAttributesMapping: fieldValidityMapping }); return element; }); if (true) FieldLabel.displayName = "FieldLabel"; // node_modules/@base-ui/react/esm/field/error/FieldError.js var React97 = __toESM(require_react(), 1); var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); var stateAttributesMapping4 = { ...fieldValidityMapping, ...transitionStatusMapping }; var FieldError = /* @__PURE__ */ React97.forwardRef(function FieldError2(componentProps, forwardedRef) { const { render, id: idProp, className, match, style, ...elementProps } = componentProps; const id = useBaseUiId(idProp); const { validityData, state: fieldState, name } = useFieldRootContext(false); const { setMessageIds } = useLabelableContext(); const { errors } = useFormContext(); const formError = name ? errors[name] : null; const hasSpecificMatch = typeof match === "string"; let rendered = false; if (match === true) { rendered = true; } else if (hasSpecificMatch) { rendered = Boolean(validityData.state[match]); } else { rendered = Boolean(formError) || validityData.state.valid === false; } const { mounted, transitionStatus, setMounted } = useTransitionStatus(rendered); useIsoLayoutEffect(() => { if (!rendered || !id) { return void 0; } setMessageIds((v) => v.concat(id)); return () => { setMessageIds((v) => v.filter((item) => item !== id)); }; }, [rendered, id, setMessageIds]); const errorRef = React97.useRef(null); const [lastRenderedMessage, setLastRenderedMessage] = React97.useState(null); const [lastRenderedMessageKey, setLastRenderedMessageKey] = React97.useState(null); const clientErrorMessage = validityData.errors.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("ul", { children: validityData.errors.map((message) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("li", { children: message }, message)) }) : validityData.error; const errorMessage = hasSpecificMatch ? clientErrorMessage : formError || clientErrorMessage; let errorKey = validityData.error; if (formError != null) { errorKey = Array.isArray(formError) ? JSON.stringify(formError) : formError; } else if (validityData.errors.length > 1) { errorKey = JSON.stringify(validityData.errors); } 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: stateAttributesMapping4, enabled: mounted }); if (!mounted) { return null; } return element; }); if (true) FieldError.displayName = "FieldError"; // node_modules/@base-ui/react/esm/field/description/FieldDescription.js var React98 = __toESM(require_react(), 1); var FieldDescription = /* @__PURE__ */ React98.forwardRef(function FieldDescription2(componentProps, forwardedRef) { const { render, id: idProp, className, style, ...elementProps } = componentProps; const id = useBaseUiId(idProp); const fieldRootContext = useFieldRootContext(false); const { setMessageIds } = useLabelableContext(); useIsoLayoutEffect(() => { if (!id) { return void 0; } setMessageIds((v) => v.concat(id)); return () => { setMessageIds((v) => v.filter((item) => item !== id)); }; }, [id, setMessageIds]); const element = useRenderElement("p", componentProps, { ref: forwardedRef, state: fieldRootContext.state, props: [{ id }, elementProps], stateAttributesMapping: fieldValidityMapping }); return element; }); if (true) FieldDescription.displayName = "FieldDescription"; // node_modules/@base-ui/react/esm/field/control/FieldControl.js var React99 = __toESM(require_react(), 1); var FieldControl = /* @__PURE__ */ React99.forwardRef(function FieldControl2(componentProps, forwardedRef) { const { render, className, id: idProp, name: nameProp, value: valueProp, disabled: disabledProp = false, onValueChange, defaultValue, autoFocus = false, style, ...elementProps } = componentProps; const { state: fieldState, name: fieldName, disabled: fieldDisabled, setTouched, setDirty, validityData, setFocused, setFilled, validationMode, validation } = useFieldRootContext(); const disabled2 = fieldDisabled || disabledProp; const name = fieldName ?? nameProp; const state = { ...fieldState, disabled: disabled2 }; const { labelId } = useLabelableContext(); const id = useLabelableId({ id: idProp }); useIsoLayoutEffect(() => { const hasExternalValue = valueProp != null; if (validation.inputRef.current?.value || hasExternalValue && valueProp !== "") { setFilled(true); } else if (hasExternalValue && valueProp === "") { setFilled(false); } }, [validation.inputRef, setFilled, valueProp]); const inputRef = React99.useRef(null); useIsoLayoutEffect(() => { if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) { setFocused(true); } }, [autoFocus, setFocused]); const [valueUnwrapped] = useControlled({ controlled: valueProp, default: defaultValue, name: "FieldControl", state: "value" }); const isControlled = valueProp !== void 0; const value = isControlled ? valueUnwrapped : void 0; const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value); useRegisterFieldControl(validation.inputRef, id, value, getValueFromInput); const element = useRenderElement("input", componentProps, { ref: [forwardedRef, inputRef], state, props: [{ id, disabled: disabled2, name, ref: validation.inputRef, "aria-labelledby": labelId, autoFocus, ...isControlled ? { value } : { defaultValue }, onChange(event) { const inputValue = event.currentTarget.value; onValueChange?.(inputValue, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent)); setDirty(inputValue !== validityData.initialValue); setFilled(inputValue !== ""); }, onFocus() { setFocused(true); }, onBlur(event) { setTouched(true); setFocused(false); if (validationMode === "onBlur") { validation.commit(event.currentTarget.value); } }, onKeyDown(event) { if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") { setTouched(true); validation.commit(event.currentTarget.value); } } }, validation.getInputValidationProps(), elementProps], stateAttributesMapping: fieldValidityMapping }); return element; }); if (true) FieldControl.displayName = "FieldControl"; // node_modules/@base-ui/react/esm/field/validity/FieldValidity.js var React100 = __toESM(require_react(), 1); var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); var FieldValidity = function FieldValidity2(props) { const { children } = props; const { validityData, invalid } = useFieldRootContext(false); const combinedFieldValidityData = React100.useMemo(() => getCombinedFieldValidityData(validityData, invalid), [validityData, invalid]); const isInvalid = combinedFieldValidityData.state.valid === false; const { transitionStatus } = useTransitionStatus(isInvalid); const fieldValidityState = React100.useMemo(() => { return { ...combinedFieldValidityData, validity: combinedFieldValidityData.state, transitionStatus }; }, [combinedFieldValidityData, transitionStatus]); return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(React100.Fragment, { children: children(fieldValidityState) }); }; if (true) FieldValidity.displayName = "FieldValidity"; // node_modules/@base-ui/react/esm/field/item/FieldItem.js var React101 = __toESM(require_react(), 1); var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); var FieldItem = /* @__PURE__ */ React101.forwardRef(function FieldItem2(componentProps, forwardedRef) { const { render, className, style, disabled: disabledProp = false, ...elementProps } = componentProps; const { state, disabled: rootDisabled } = useFieldRootContext(false); const disabled2 = rootDisabled || disabledProp; const checkboxGroupContext = useCheckboxGroupContext(); const hasParentCheckbox = checkboxGroupContext?.allValues !== void 0; const controlId = hasParentCheckbox ? checkboxGroupContext?.parent.id : void 0; const fieldItemContext = React101.useMemo(() => ({ disabled: disabled2 }), [disabled2]); const element = useRenderElement("div", componentProps, { ref: forwardedRef, state, props: elementProps, stateAttributesMapping: fieldValidityMapping }); return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LabelableProvider, { controlId, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FieldItemContext.Provider, { value: fieldItemContext, children: element }) }); }); if (true) FieldItem.displayName = "FieldItem"; // node_modules/@base-ui/react/esm/input/Input.js var React102 = __toESM(require_react(), 1); var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); var Input = /* @__PURE__ */ React102.forwardRef(function Input2(props, forwardedRef) { return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(index_parts_exports2.Control, { ref: forwardedRef, ...props }); }); if (true) Input.displayName = "Input"; // node_modules/@base-ui/react/esm/utils/FloatingPortalLite.js var React103 = __toESM(require_react(), 1); var ReactDOM7 = __toESM(require_react_dom(), 1); var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); var FloatingPortalLite = /* @__PURE__ */ React103.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { const { children, container, className, render, style, ...elementProps } = componentProps; const { portalNode, portalSubtree } = useFloatingPortalNode({ container, ref: forwardedRef, componentProps, elementProps }); if (!portalSubtree && !portalNode) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(React103.Fragment, { children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM7.createPortal(children, portalNode)] }); }); if (true) FloatingPortalLite.displayName = "FloatingPortalLite"; // node_modules/@base-ui/react/esm/tooltip/index.parts.js 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/esm/tooltip/root/TooltipRoot.js var React106 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/tooltip/root/TooltipRootContext.js var React104 = __toESM(require_react(), 1); var TooltipRootContext = /* @__PURE__ */ React104.createContext(void 0); if (true) TooltipRootContext.displayName = "TooltipRootContext"; function useTooltipRootContext(optional) { const context = React104.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/esm/tooltip/store/TooltipStore.js var React105 = __toESM(require_react(), 1); var ReactDOM8 = __toESM(require_react_dom(), 1); var selectors3 = { ...popupStoreSelectors, disabled: createSelector((state) => state.disabled), instantType: createSelector((state) => state.instantType), isInstantPhase: createSelector((state) => state.isInstantPhase), trackCursorAxis: createSelector((state) => state.trackCursorAxis), disableHoverablePopup: createSelector((state) => state.disableHoverablePopup), lastOpenChangeReason: createSelector((state) => state.openChangeReason), closeOnClick: createSelector((state) => state.closeOnClick), closeDelay: createSelector((state) => state.closeDelay), hasViewport: createSelector((state) => state.hasViewport) }; var TooltipStore = class _TooltipStore extends ReactStore { constructor(initialState, floatingId, nested = false) { const triggerElements = new PopupTriggerMap(); const state = { ...createInitialState(), ...initialState }; state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested); super(state, { popupRef: /* @__PURE__ */ React105.createRef(), onOpenChange: void 0, onOpenChangeComplete: void 0, triggerElements }, selectors3); } setOpen = (nextOpen, eventDetails) => { 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); eventDetails.preventUnmountOnClose = () => { this.set("preventUnmountingOnClose", true); }; this.context.onOpenChange?.(nextOpen, eventDetails); if (eventDetails.isCanceled) { return; } this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); const changeState = () => { const updatedState = { open: nextOpen, openChangeReason: reason }; if (isFocusOpen) { updatedState.instantType = "focus"; } else if (isDismissClose) { updatedState.instantType = "dismiss"; } else if (reason === reason_parts_exports.triggerHover) { updatedState.instantType = void 0; } setOpenTriggerState(updatedState, nextOpen, eventDetails.trigger); this.update(updatedState); }; if (isHover) { ReactDOM8.flushSync(changeState); } else { changeState(); } }; // 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)); } static useStore(externalStore, initialState) { const store = usePopupStore(externalStore, (floatingId, nested) => new _TooltipStore(initialState, floatingId, nested)).store; return store; } }; function createInitialState() { return { ...createInitialPopupStoreState(), disabled: false, instantType: void 0, isInstantPhase: false, trackCursorAxis: "none", disableHoverablePopup: false, openChangeReason: null, closeOnClick: true, closeDelay: 0, hasViewport: false }; } // node_modules/@base-ui/react/esm/tooltip/root/TooltipRoot.js var import_jsx_runtime34 = __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 = TooltipStore.useStore(handle?.store, { open: defaultOpen, openProp, activeTriggerId: defaultTriggerIdProp, triggerIdProp }); useOnFirstRender(() => { if (openProp === void 0 && store.state.open === false && defaultOpen === true) { store.update({ open: true, activeTriggerId: defaultTriggerIdProp }); } }); store.useControlledProp("openProp", openProp); store.useControlledProp("triggerIdProp", triggerIdProp); store.useContextCallback("onOpenChange", onOpenChange); store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); const openState = store.useState("open"); const open = !disabled2 && openState; const activeTriggerId = store.useState("activeTriggerId"); const mounted = store.useState("mounted"); const payload = store.useState("payload"); store.useSyncedValues({ trackCursorAxis, disableHoverablePopup }); store.useSyncedValue("disabled", disabled2); useImplicitActiveTrigger(store); const { forceUnmount, transitionStatus } = useOpenStateTransitions(open, store); const isInstantPhase = store.useState("isInstantPhase"); const instantType = store.useState("instantType"); const lastOpenChangeReason = store.useState("lastOpenChangeReason"); const previousInstantTypeRef = React106.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 (open) { if (activeTriggerId == null) { store.set("payload", void 0); } } }, [store, activeTriggerId, open]); const handleImperativeClose = React106.useCallback(() => { store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); }, [store]); React106.useImperativeHandle(actionsRef, () => ({ unmount: forceUnmount, close: handleImperativeClose }), [forceUnmount, handleImperativeClose]); const shouldRenderInteractions = open || mounted || !disabled2 && trackCursorAxis !== "none"; return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(TooltipRootContext.Provider, { value: store, children: [shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime34.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 activeTriggerProps = React106.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]); const inactiveTriggerProps = React106.useMemo(() => mergeProps(clientPoint.trigger, dismiss.trigger), [clientPoint.trigger, dismiss.trigger]); const popupProps = React106.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, clientPoint.floating, dismiss.floating), [clientPoint.floating, dismiss.floating]); usePopupInteractionProps(store, { activeTriggerProps, inactiveTriggerProps, popupProps }); return null; } // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTrigger.js var React108 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/tooltip/provider/TooltipProviderContext.js var React107 = __toESM(require_react(), 1); var TooltipProviderContext = /* @__PURE__ */ React107.createContext(void 0); if (true) TooltipProviderContext.displayName = "TooltipProviderContext"; function useTooltipProviderContext() { return React107.useContext(TooltipProviderContext); } // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTriggerDataAttributes.js var TooltipTriggerDataAttributes = (function(TooltipTriggerDataAttributes2) { TooltipTriggerDataAttributes2[TooltipTriggerDataAttributes2["popupOpen"] = CommonTriggerDataAttributes.popupOpen] = "popupOpen"; TooltipTriggerDataAttributes2["triggerDisabled"] = "data-trigger-disabled"; return TooltipTriggerDataAttributes2; })({}); // node_modules/@base-ui/react/esm/tooltip/utils/constants.js var OPEN_DELAY = 600; // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTrigger.js 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) { if (current.hasAttribute(TOOLTIP_TRIGGER_IDENTIFIER)) { return current; } const parentElement = current.parentElement; if (parentElement) { current = parentElement; continue; } 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, className, style, handle, payload, disabled: disabledProp, delay, closeOnClick = true, closeDelay, id: idProp, ...elementProps } = componentProps; const rootContext = useTooltipRootContext(true); const store = handle?.store ?? 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 = React108.useRef(null); const delayWithDefault = delay ?? OPEN_DELAY; const closeDelayWithDefault = closeDelay ?? 0; const { registerTrigger, isMountedByThisTrigger } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, { payload, closeOnClick, closeDelay: closeDelayWithDefault }); const providerContext = useTooltipProviderContext(); const { 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 = React108.useRef(false); const nestedTriggerOpenTimeout = useTimeout(); const pointerTypeRef = React108.useRef(void 0); function getOpenDelay() { const providerDelay = providerContext?.delay; const groupOpenValue = typeof delayRef.current === "object" ? delayRef.current.open : void 0; let computedOpenDelay = delayWithDefault; if (hasProvider) { if (groupOpenValue !== 0) { computedOpenDelay = delay ?? providerDelay ?? delayWithDefault; } else { computedOpenDelay = 0; } } return computedOpenDelay; } 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() { const closeValue = typeof delayRef.current === "object" ? delayRef.current.close : void 0; let computedCloseDelay = closeDelayWithDefault; if (closeDelay == null && hasProvider) { computedCloseDelay = closeValue; } return { close: computedCloseDelay }; }, 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 open = () => { 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(); open(); } else { nestedTriggerOpenTimeout.start(openDelay, open); } } }; 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, [TooltipTriggerDataAttributes.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/esm/tooltip/portal/TooltipPortal.js var React110 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortalContext.js var React109 = __toESM(require_react(), 1); var TooltipPortalContext = /* @__PURE__ */ React109.createContext(void 0); if (true) TooltipPortalContext.displayName = "TooltipPortalContext"; function useTooltipPortalContext() { const value = React109.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/esm/tooltip/portal/TooltipPortal.js var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); var TooltipPortal = /* @__PURE__ */ React110.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_runtime35.jsx)(TooltipPortalContext.Provider, { value: keepMounted, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FloatingPortalLite, { ref: forwardedRef, ...portalProps }) }); }); if (true) TooltipPortal.displayName = "TooltipPortal"; // node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositioner.js var React112 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositionerContext.js var React111 = __toESM(require_react(), 1); var TooltipPositionerContext = /* @__PURE__ */ React111.createContext(void 0); if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext"; function useTooltipPositionerContext() { const context = React111.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/esm/tooltip/positioner/TooltipPositioner.js var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); var TooltipPositioner = /* @__PURE__ */ React112.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { const { render, 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 open = 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 hasViewport = store.useState("hasViewport"); const positioning = useAnchorPositioning({ anchor, positionMethod, floatingRootContext, mounted, side, sideOffset, align, alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, keepMounted, collisionAvoidance, adaptiveOrigin: hasViewport ? adaptiveOrigin : void 0 }); const state = React112.useMemo(() => ({ open, side: positioning.side, align: positioning.align, anchorHidden: positioning.anchorHidden, instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType }), [open, 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: !open || trackCursorAxis === "both" || disableHoverablePopup }); return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipPositionerContext.Provider, { value: positioning, children: element }); }); if (true) TooltipPositioner.displayName = "TooltipPositioner"; // node_modules/@base-ui/react/esm/tooltip/popup/TooltipPopup.js var React113 = __toESM(require_react(), 1); var stateAttributesMapping5 = { ...popupStateMapping, ...transitionStatusMapping }; var TooltipPopup = /* @__PURE__ */ React113.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { const { render, className, style, ...elementProps } = componentProps; const store = useTooltipRootContext(); const { side, align } = useTooltipPositionerContext(); const open = 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, ref: store.context.popupRef, onComplete() { if (open) { store.context.onOpenChangeComplete?.(true); } } }); useHoverFloatingInteraction(floatingContext, { enabled: !disabled2, closeDelay }); const setPopupElement = store.useStateSetter("popupElement"); const state = { open, side, align, instant: instantType, transitionStatus }; const element = useRenderElement("div", componentProps, { state, ref: [forwardedRef, store.context.popupRef, setPopupElement], props: [popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], stateAttributesMapping: stateAttributesMapping5 }); return element; }); if (true) TooltipPopup.displayName = "TooltipPopup"; // node_modules/@base-ui/react/esm/tooltip/arrow/TooltipArrow.js var React114 = __toESM(require_react(), 1); var TooltipArrow = /* @__PURE__ */ React114.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { const { render, className, style, ...elementProps } = componentProps; const store = useTooltipRootContext(); const { arrowRef, side, align, arrowUncentered, arrowStyles } = useTooltipPositionerContext(); const open = store.useState("open"); const instantType = store.useState("instantType"); const state = { open, 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/esm/tooltip/provider/TooltipProvider.js var React115 = __toESM(require_react(), 1); var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); var TooltipProvider = function TooltipProvider2(props) { const { delay, closeDelay, timeout = 400 } = props; const contextValue = React115.useMemo(() => ({ delay, closeDelay }), [delay, closeDelay]); const delayValue = React115.useMemo(() => ({ open: delay, close: closeDelay }), [delay, closeDelay]); return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipProviderContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FloatingDelayGroup, { delay: delayValue, timeoutMs: timeout, children: props.children }) }); }; if (true) TooltipProvider.displayName = "TooltipProvider"; // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewport.js var React116 = __toESM(require_react(), 1); // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewportCssVars.js var TooltipViewportCssVars = /* @__PURE__ */ (function(TooltipViewportCssVars2) { TooltipViewportCssVars2["popupWidth"] = "--popup-width"; TooltipViewportCssVars2["popupHeight"] = "--popup-height"; return TooltipViewportCssVars2; })({}); // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewport.js var stateAttributesMapping6 = { activationDirection: (value) => value ? { "data-activation-direction": value } : null }; var TooltipViewport = /* @__PURE__ */ React116.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { const { render, 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, cssVars: TooltipViewportCssVars, children }); const state = { activationDirection: viewportState.activationDirection, transitioning: viewportState.transitioning, instant: instantType }; return useRenderElement("div", componentProps, { state, ref: forwardedRef, props: [elementProps, { children: childrenToRender }], stateAttributesMapping: stateAttributesMapping6 }); }); if (true) TooltipViewport.displayName = "TooltipViewport"; // node_modules/@base-ui/react/esm/tooltip/store/TooltipHandle.js var TooltipHandle = class { /** * Internal store holding the tooltip state. * @internal */ constructor() { this.store = new TooltipStore(); } /** * Opens the tooltip and associates it with the trigger with the given ID. * The trigger must be a Tooltip.Trigger component with this handle passed as a prop. * * 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. */ open(triggerId) { const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : void 0; if (triggerId && !triggerElement) { throw new Error(true ? `Base UI: TooltipHandle.open: No trigger found with id "${triggerId}".` : formatErrorMessage_default(81, triggerId)); } this.store.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); } /** * Closes the tooltip. */ close() { this.store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, void 0)); } /** * Indicates whether the tooltip is currently open. */ get isOpen() { return this.store.select("open"); } }; function createTooltipHandle() { return new TooltipHandle(); } // node_modules/@base-ui/react/esm/use-render/useRender.js function useRender(params) { return useRenderElement(params.defaultTagName ?? "div", params, params); } // packages/ui/build-module/text/text.mjs var import_element16 = __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("0c5702ddca", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); } 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("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-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))}&::placeholder{color:var(--_gcd-input-placeholder-color,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-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}"); } 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" }; var Text = (0, import_element16.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) { const element = useRender({ render, 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/button/button.mjs var import_element17 = __toESM(require_element(), 1); var import_i18n = __toESM(require_i18n(), 1); var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); import { speak } from "@wordpress/a11y"; 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("4c317b0736", '@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-medium,499);--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:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:transparent;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}@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:0;--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_default2 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "icon": "_9f6fc6553aeb36fe__icon", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "loading-animation": "_5a1d53da6f830c8d__loading-animation" }; if (typeof process === "undefined" || true) { registerStyle2("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) { registerStyle2("5f8e7aa0bc", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); } var focus_default = { "outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus", "outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active", "outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible", "outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within", "outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active", "outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible" }; if (typeof process === "undefined" || true) { registerStyle2("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-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))}&::placeholder{color:var(--_gcd-input-placeholder-color,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-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}"); } 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" }; var Button3 = (0, import_element17.forwardRef)( function Button22({ tone = "brand", variant = "solid", size: size4 = "default", className, focusableWhenDisabled = true, disabled: disabled2, loading, loadingAnnouncement = (0, import_i18n.__)("Loading"), children, ...props }, ref) { const mergedClassName = clsx_default( global_css_defense_default2.button, resets_default["box-sizing"], focus_default["outset-ring--focus-except-active"], variant !== "unstyled" && style_default2.button, style_default2[`is-${tone}`], style_default2[`is-${variant}`], style_default2[`is-${size4}`], loading && style_default2["is-loading"], className ); (0, import_element17.useEffect)(() => { if (loading && loadingAnnouncement) { speak(loadingAnnouncement); } }, [loading, loadingAnnouncement]); return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( Button, { ref, className: mergedClassName, focusableWhenDisabled, disabled: disabled2 ?? loading, ...props, children } ); } ); // packages/ui/build-module/button/icon.mjs var import_element19 = __toESM(require_element(), 1); // packages/ui/build-module/icon/icon.mjs var import_element18 = __toESM(require_element(), 1); var import_primitives4 = __toESM(require_primitives(), 1); var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); var Icon = (0, import_element18.forwardRef)(function Icon2({ icon, size: size4 = 24, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( import_primitives4.SVG, { ref, ...icon.props, ...restProps, width: size4, height: size4 } ); }); // packages/ui/build-module/button/icon.mjs var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); 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("4c317b0736", '@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-medium,499);--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:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:transparent;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}@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:0;--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_default3 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "icon": "_9f6fc6553aeb36fe__icon", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "loading-animation": "_5a1d53da6f830c8d__loading-animation" }; var ButtonIcon = (0, import_element19.forwardRef)( function ButtonIcon2({ className, icon, ...props }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( Icon, { ref, icon, className: clsx_default(style_default3.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 }); // packages/ui/build-module/utils/render-slot-with-children.mjs var import_element20 = __toESM(require_element(), 1); function renderSlotWithChildren(slot, defaultSlot, children) { return (0, import_element20.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/stack/stack.mjs var import_element21 = __toESM(require_element(), 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("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); } var style_default4 = { "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_element21.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { const style = { gap: gap && gapTokens[gap], alignItems: align, justifyContent: justify, flexDirection: direction, flexWrap: wrap }; const element = useRender({ render, ref, props: mergeProps(props, { style, className: style_default4.stack }) }); return element; }); // packages/ui/build-module/icon-button/icon-button.mjs var import_element26 = __toESM(require_element(), 1); // packages/ui/build-module/tooltip/popup.mjs var import_element24 = __toESM(require_element(), 1); // packages/ui/build-module/tooltip/portal.mjs var import_element22 = __toESM(require_element(), 1); // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs 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("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 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 cachedSlot; } const existing = ownerDocument2.querySelector( `[${WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]` ); if (existing instanceof HTMLDivElement) { cachedSlot = existing; return existing; } if (cachedSlot?.isConnected) { cachedSlot.remove(); } cachedSlot = createSlot(ownerDocument2); return cachedSlot; } // packages/ui/build-module/tooltip/portal.mjs var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); var Portal = (0, import_element22.forwardRef)( function TooltipPortal3({ container, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( index_parts_exports3.Portal, { container: container ?? getWpCompatOverlaySlot(), ...restProps, ref } ); } ); // packages/ui/build-module/tooltip/positioner.mjs var import_element23 = __toESM(require_element(), 1); var import_jsx_runtime42 = __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("789467362f", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-sm,0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005);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_default5 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; var Positioner = (0, import_element23.forwardRef)( function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( index_parts_exports3.Positioner, { ref, align, side, sideOffset, ...props, className: clsx_default( resets_default2["box-sizing"], style_default5.positioner, className ) } ); } ); // packages/ui/build-module/tooltip/popup.mjs var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 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("789467362f", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-sm,0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005);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_default6 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; var POPUP_COLOR = { background: "#1e1e1e" }; var Popup = (0, import_element24.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { const popupContent = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( index_parts_exports3.Popup, { ref, className: clsx_default(style_default6.popup, className), ...props, children } ) }); const positionedPopup = renderSlotWithChildren( positioner, /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Positioner, {}), popupContent ); return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Portal, {}), positionedPopup); }); // packages/ui/build-module/tooltip/trigger.mjs var import_element25 = __toESM(require_element(), 1); var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); var Trigger = (0, import_element25.forwardRef)( function TooltipTrigger3(props, ref) { return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(index_parts_exports3.Trigger, { ref, ...props }); } ); // packages/ui/build-module/tooltip/root.mjs var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); function Root(props) { return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(index_parts_exports3.Root, { ...props }); } // packages/ui/build-module/tooltip/provider.mjs var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); function Provider({ ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(index_parts_exports3.Provider, { ...props }); } // packages/ui/build-module/icon-button/icon-button.mjs var import_jsx_runtime47 = __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("65cec4cf71", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer compositions{._28cfdc260e755391__icon-button{--wp-ui-button-aspect-ratio:1;--wp-ui-button-padding-inline:0;--wp-ui-button-min-width:unset}.f1c70d719989a85a__icon{margin:-1px}}}"); } var style_default7 = { "icon-button": "_28cfdc260e755391__icon-button", "icon": "f1c70d719989a85a__icon" }; var IconButton = (0, import_element26.forwardRef)( function IconButton2({ label, className, // Prevent accidental forwarding of `children` children: _children, disabled: disabled2, focusableWhenDisabled = true, icon, size: size4, shortcut, positioner, ...restProps }, ref) { const classes = clsx_default(style_default7["icon-button"], className); return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Provider, { delay: 0, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Root, { children: [ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)( Trigger, { ref, disabled: disabled2 && !focusableWhenDisabled, render: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)( Button4, { ...restProps, size: size4, "aria-label": label, "aria-keyshortcuts": shortcut?.ariaKeyShortcut, disabled: disabled2, focusableWhenDisabled } ), className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)( Icon, { icon, size: 24, className: style_default7.icon } ) } ), /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Popup, { positioner, children: [ label, shortcut && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [ " ", /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { "aria-hidden": "true", children: shortcut.displayShortcut }) ] }) ] }) ] }) }); } ); // packages/ui/build-module/form/primitives/autocomplete/index.mjs var autocomplete_exports = {}; __export(autocomplete_exports, { Clear: () => Clear, Collection: () => Collection, Empty: () => Empty, Group: () => Group, GroupLabel: () => GroupLabel, Input: () => Input4, InputGroup: () => InputGroup, Item: () => Item, List: () => List, ListBody: () => ListBody, Popup: () => Popup2, Portal: () => Portal2, Positioner: () => Positioner2, Root: () => Root2, Value: () => Value }); // packages/ui/build-module/form/primitives/autocomplete/clear.mjs var import_element27 = __toESM(require_element(), 1); var import_i18n2 = __toESM(require_i18n(), 1); var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); var DEFAULT_RENDER = ({ "aria-label": ariaLabel = (0, import_i18n2.__)("Clear"), ...props }, { disabled: disabled2 }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)( IconButton, { icon: close_small_default, focusableWhenDisabled: false, disabled: disabled2, "aria-hidden": disabled2 || void 0, size: "small", variant: "minimal", tone: "neutral", label: ariaLabel, ...props } ); var Clear = (0, import_element27.forwardRef)( function Clear2({ render = DEFAULT_RENDER, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)( index_parts_exports.Clear, { ref, render, ...restProps } ); } ); // packages/ui/build-module/form/primitives/autocomplete/collection.mjs var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); function Collection({ children, ...restProps }) { return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(index_parts_exports.Collection, { ...restProps, children }); } // packages/ui/build-module/form/primitives/autocomplete/empty.mjs var import_element28 = __toESM(require_element(), 1); var import_jsx_runtime50 = __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("b5813d84e6", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion{--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;transform:translate(0);&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity: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))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._234b520016b4e56f__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);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(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);display:grid;grid-template-areas:"header" "main";grid-template-rows:auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width)}.f43dc7c768d7b622__list{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:grid;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);grid-area:main;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto;line-height:var(--wpds-typography-line-height-sm,20px)}._233cd60cdb84a2ef__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}.ec4db6f0122263e7__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);._233cd60cdb84a2ef__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.b3c0d7f103fb10a2__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21b59380477c306c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-md,32px);padding-inline:var(--wpds-dimension-padding-md,12px)}._684ccb7988365b4f__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);padding-block:var(--wp-ui-popup-item-padding-block);padding-inline-end:var(--wp-ui-popup-item-padding-inline);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px));user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&.f181b98b0d33282a__is-size-compact{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px)}&._38f7faff93c61958__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){._92fbe4765dfad5ee__item-indicator-icon{opacity:0}}&[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){outline:1px 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}}}.a3adcfd0b73ffd40__item-icon{flex-shrink:0}._06c7ff39d2f685b9__empty:not(:empty){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);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-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}'); } var item_popup_default = { "popup": "_234b520016b4e56f__popup _380b81b8f79fb10f__dropdown-motion", "list": "f43dc7c768d7b622__list", "list-scrollable-container": "_233cd60cdb84a2ef__list-scrollable-container", "list-footer": "ec4db6f0122263e7__list-footer", "group": "b3c0d7f103fb10a2__group", "group-label": "_21b59380477c306c__group-label", "item": "_684ccb7988365b4f__item", "is-size-compact": "f181b98b0d33282a__is-size-compact", "is-size-small": "_38f7faff93c61958__is-size-small", "item-indicator-icon": "_92fbe4765dfad5ee__item-indicator-icon", "item-icon": "a3adcfd0b73ffd40__item-icon", "empty": "_06c7ff39d2f685b9__empty" }; var Empty = (0, import_element28.forwardRef)( function Empty2({ className, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)( index_parts_exports.Empty, { className: clsx_default(item_popup_default.empty, className), ref, ...restProps } ); } ); // packages/ui/build-module/form/primitives/autocomplete/group.mjs var import_element29 = __toESM(require_element(), 1); var import_jsx_runtime51 = __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("b5813d84e6", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion{--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;transform:translate(0);&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity: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))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._234b520016b4e56f__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);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(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);display:grid;grid-template-areas:"header" "main";grid-template-rows:auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width)}.f43dc7c768d7b622__list{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:grid;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);grid-area:main;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto;line-height:var(--wpds-typography-line-height-sm,20px)}._233cd60cdb84a2ef__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}.ec4db6f0122263e7__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);._233cd60cdb84a2ef__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.b3c0d7f103fb10a2__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21b59380477c306c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-md,32px);padding-inline:var(--wpds-dimension-padding-md,12px)}._684ccb7988365b4f__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);padding-block:var(--wp-ui-popup-item-padding-block);padding-inline-end:var(--wp-ui-popup-item-padding-inline);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px));user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&.f181b98b0d33282a__is-size-compact{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px)}&._38f7faff93c61958__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){._92fbe4765dfad5ee__item-indicator-icon{opacity:0}}&[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){outline:1px 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}}}.a3adcfd0b73ffd40__item-icon{flex-shrink:0}._06c7ff39d2f685b9__empty:not(:empty){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);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-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}'); } var item_popup_default2 = { "popup": "_234b520016b4e56f__popup _380b81b8f79fb10f__dropdown-motion", "list": "f43dc7c768d7b622__list", "list-scrollable-container": "_233cd60cdb84a2ef__list-scrollable-container", "list-footer": "ec4db6f0122263e7__list-footer", "group": "b3c0d7f103fb10a2__group", "group-label": "_21b59380477c306c__group-label", "item": "_684ccb7988365b4f__item", "is-size-compact": "f181b98b0d33282a__is-size-compact", "is-size-small": "_38f7faff93c61958__is-size-small", "item-indicator-icon": "_92fbe4765dfad5ee__item-indicator-icon", "item-icon": "a3adcfd0b73ffd40__item-icon", "empty": "_06c7ff39d2f685b9__empty" }; var Group = (0, import_element29.forwardRef)( function Group2({ className, children, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)( index_parts_exports.Group, { className: clsx_default(item_popup_default2.group, className), ref, ...restProps, children } ); } ); // packages/ui/build-module/form/primitives/autocomplete/group-label.mjs var import_element30 = __toESM(require_element(), 1); var import_jsx_runtime52 = __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("b5813d84e6", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion{--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;transform:translate(0);&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity: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))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._234b520016b4e56f__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);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(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);display:grid;grid-template-areas:"header" "main";grid-template-rows:auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width)}.f43dc7c768d7b622__list{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:grid;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);grid-area:main;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto;line-height:var(--wpds-typography-line-height-sm,20px)}._233cd60cdb84a2ef__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}.ec4db6f0122263e7__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);._233cd60cdb84a2ef__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.b3c0d7f103fb10a2__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21b59380477c306c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-md,32px);padding-inline:var(--wpds-dimension-padding-md,12px)}._684ccb7988365b4f__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);padding-block:var(--wp-ui-popup-item-padding-block);padding-inline-end:var(--wp-ui-popup-item-padding-inline);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px));user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&.f181b98b0d33282a__is-size-compact{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px)}&._38f7faff93c61958__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){._92fbe4765dfad5ee__item-indicator-icon{opacity:0}}&[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){outline:1px 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}}}.a3adcfd0b73ffd40__item-icon{flex-shrink:0}._06c7ff39d2f685b9__empty:not(:empty){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);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-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}'); } var item_popup_default3 = { "popup": "_234b520016b4e56f__popup _380b81b8f79fb10f__dropdown-motion", "list": "f43dc7c768d7b622__list", "list-scrollable-container": "_233cd60cdb84a2ef__list-scrollable-container", "list-footer": "ec4db6f0122263e7__list-footer", "group": "b3c0d7f103fb10a2__group", "group-label": "_21b59380477c306c__group-label", "item": "_684ccb7988365b4f__item", "is-size-compact": "f181b98b0d33282a__is-size-compact", "is-size-small": "_38f7faff93c61958__is-size-small", "item-indicator-icon": "_92fbe4765dfad5ee__item-indicator-icon", "item-icon": "a3adcfd0b73ffd40__item-icon", "empty": "_06c7ff39d2f685b9__empty" }; var GroupLabel = (0, import_element30.forwardRef)(function GroupLabel2({ className, children, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( Text, { variant: "heading-sm", className: clsx_default(item_popup_default3["group-label"], className), render: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(index_parts_exports.GroupLabel, { ref, ...restProps }), children } ); }); // packages/ui/build-module/form/primitives/autocomplete/input-group.mjs var import_element31 = __toESM(require_element(), 1); var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); var InputGroup = (0, import_element31.forwardRef)(function InputGroup2(props, ref) { return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(index_parts_exports.InputGroup, { ref, ...props }); }); // packages/ui/build-module/form/primitives/autocomplete/input.mjs var import_element35 = __toESM(require_element(), 1); // packages/ui/build-module/form/primitives/input/input.mjs var import_element34 = __toESM(require_element(), 1); // packages/ui/build-module/form/primitives/input-layout/input-layout.mjs var import_element32 = __toESM(require_element(), 1); var import_jsx_runtime54 = __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("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-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))}&::placeholder{color:var(--_gcd-input-placeholder-color,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-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}"); } 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" }; if (typeof process === "undefined" || true) { registerStyle12("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) { registerStyle12("bc14d8e61b", '@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-weak,#0000);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]){background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&._8097270636ca6100__is-borderless{border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}}.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_default8 = { "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_element32.forwardRef)( function InputLayout2({ className, children, visuallyDisabled, size: size4 = "default", isBorderless, prefix, suffix, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)( "div", { ref, className: clsx_default( global_css_defense_default3.div, resets_default3["box-sizing"], style_default8["input-layout"], style_default8[`is-size-${size4}`], visuallyDisabled && style_default8["is-disabled"], isBorderless && style_default8["is-borderless"], className ), ...restProps, children: [ import_element32.Children.count(prefix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)( "div", { className: style_default8["slot-wrapper"], "data-slot-type": "prefix", children: prefix } ), children, import_element32.Children.count(suffix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)( "div", { className: style_default8["slot-wrapper"], "data-slot-type": "suffix", children: suffix } ) ] } ); } ); // packages/ui/build-module/form/primitives/input-layout/slot.mjs var import_element33 = __toESM(require_element(), 1); var import_jsx_runtime55 = __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("bc14d8e61b", '@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-weak,#0000);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]){background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&._8097270636ca6100__is-borderless{border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}}.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_default9 = { "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_element33.forwardRef)(function InputLayoutSlot2({ padding = "default", className, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( "div", { ref, className: clsx_default( style_default9["input-layout-slot"], style_default9[`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_runtime56 = __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("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-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))}&::placeholder{color:var(--_gcd-input-placeholder-color,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-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}"); } 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" }; if (typeof process === "undefined" || true) { registerStyle14("5f8e7aa0bc", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); } var focus_default2 = { "outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus", "outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active", "outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible", "outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within", "outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active", "outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible" }; if (typeof process === "undefined" || true) { registerStyle14("5f69bdbcb5", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._2ae7be2fc1bb17a3__input{--_gcd-input-padding:var(--wp-ui-input-padding-block,0) var(--wp-ui-input-layout-padding-inline,0);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-disabled,#8d8d8d)}&:disabled,&[aria-disabled=true]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}&[type=email],&[type=url]{direction:ltr}}}}"); } var style_default10 = { "input": "_2ae7be2fc1bb17a3__input" }; var Input3 = (0, import_element34.forwardRef)(function Input22({ className, size: size4 = "default", prefix, suffix, style, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)( InputLayout3, { className: clsx_default( focus_default2["outset-ring--focus-within"], className ), style, size: size4, visuallyDisabled: restProps.disabled, prefix, suffix, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)( Input, { ref, className: clsx_default(global_css_defense_default4.input, style_default10.input), ...restProps } ) } ); }); // packages/ui/build-module/form/primitives/autocomplete/input.mjs var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1); var DEFAULT_RENDER2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Input3, { ...props }); var Input4 = (0, import_element35.forwardRef)( function Input23({ render = DEFAULT_RENDER2, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)( index_parts_exports.Input, { ref, render, ...restProps } ); } ); // packages/ui/build-module/form/primitives/autocomplete/item.mjs var import_element36 = __toESM(require_element(), 1); var import_jsx_runtime58 = __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("b5813d84e6", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion{--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;transform:translate(0);&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity: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))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._234b520016b4e56f__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);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(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);display:grid;grid-template-areas:"header" "main";grid-template-rows:auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width)}.f43dc7c768d7b622__list{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:grid;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);grid-area:main;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto;line-height:var(--wpds-typography-line-height-sm,20px)}._233cd60cdb84a2ef__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}.ec4db6f0122263e7__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);._233cd60cdb84a2ef__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.b3c0d7f103fb10a2__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21b59380477c306c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-md,32px);padding-inline:var(--wpds-dimension-padding-md,12px)}._684ccb7988365b4f__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);padding-block:var(--wp-ui-popup-item-padding-block);padding-inline-end:var(--wp-ui-popup-item-padding-inline);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px));user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&.f181b98b0d33282a__is-size-compact{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px)}&._38f7faff93c61958__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){._92fbe4765dfad5ee__item-indicator-icon{opacity:0}}&[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){outline:1px 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}}}.a3adcfd0b73ffd40__item-icon{flex-shrink:0}._06c7ff39d2f685b9__empty:not(:empty){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);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-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}'); } var item_popup_default4 = { "popup": "_234b520016b4e56f__popup _380b81b8f79fb10f__dropdown-motion", "list": "f43dc7c768d7b622__list", "list-scrollable-container": "_233cd60cdb84a2ef__list-scrollable-container", "list-footer": "ec4db6f0122263e7__list-footer", "group": "b3c0d7f103fb10a2__group", "group-label": "_21b59380477c306c__group-label", "item": "_684ccb7988365b4f__item", "is-size-compact": "f181b98b0d33282a__is-size-compact", "is-size-small": "_38f7faff93c61958__is-size-small", "item-indicator-icon": "_92fbe4765dfad5ee__item-indicator-icon", "item-icon": "a3adcfd0b73ffd40__item-icon", "empty": "_06c7ff39d2f685b9__empty" }; 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_default4 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; var Item = (0, import_element36.forwardRef)( function Item2({ className, children, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)( index_parts_exports.Item, { className: clsx_default( resets_default4["box-sizing"], item_popup_default4.item, className ), ref, ...restProps, children } ); } ); // packages/ui/build-module/form/primitives/autocomplete/list.mjs var import_element37 = __toESM(require_element(), 1); var import_jsx_runtime59 = __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("b5813d84e6", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion{--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;transform:translate(0);&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity: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))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._234b520016b4e56f__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);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(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);display:grid;grid-template-areas:"header" "main";grid-template-rows:auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width)}.f43dc7c768d7b622__list{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:grid;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);grid-area:main;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto;line-height:var(--wpds-typography-line-height-sm,20px)}._233cd60cdb84a2ef__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}.ec4db6f0122263e7__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);._233cd60cdb84a2ef__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.b3c0d7f103fb10a2__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21b59380477c306c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-md,32px);padding-inline:var(--wpds-dimension-padding-md,12px)}._684ccb7988365b4f__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);padding-block:var(--wp-ui-popup-item-padding-block);padding-inline-end:var(--wp-ui-popup-item-padding-inline);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px));user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&.f181b98b0d33282a__is-size-compact{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px)}&._38f7faff93c61958__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){._92fbe4765dfad5ee__item-indicator-icon{opacity:0}}&[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){outline:1px 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}}}.a3adcfd0b73ffd40__item-icon{flex-shrink:0}._06c7ff39d2f685b9__empty:not(:empty){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);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-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}'); } var item_popup_default5 = { "popup": "_234b520016b4e56f__popup _380b81b8f79fb10f__dropdown-motion", "list": "f43dc7c768d7b622__list", "list-scrollable-container": "_233cd60cdb84a2ef__list-scrollable-container", "list-footer": "ec4db6f0122263e7__list-footer", "group": "b3c0d7f103fb10a2__group", "group-label": "_21b59380477c306c__group-label", "item": "_684ccb7988365b4f__item", "is-size-compact": "f181b98b0d33282a__is-size-compact", "is-size-small": "_38f7faff93c61958__is-size-small", "item-indicator-icon": "_92fbe4765dfad5ee__item-indicator-icon", "item-icon": "a3adcfd0b73ffd40__item-icon", "empty": "_06c7ff39d2f685b9__empty" }; var List = (0, import_element37.forwardRef)( function List2({ className, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)( index_parts_exports.List, { className: clsx_default(item_popup_default5.list, className), ref, ...restProps } ); } ); // packages/ui/build-module/form/primitives/autocomplete/list-body.mjs var import_element38 = __toESM(require_element(), 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("b5813d84e6", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion{--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;transform:translate(0);&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity: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))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._234b520016b4e56f__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);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(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);display:grid;grid-template-areas:"header" "main";grid-template-rows:auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width)}.f43dc7c768d7b622__list{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:grid;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);grid-area:main;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto;line-height:var(--wpds-typography-line-height-sm,20px)}._233cd60cdb84a2ef__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}.ec4db6f0122263e7__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);._233cd60cdb84a2ef__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.b3c0d7f103fb10a2__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21b59380477c306c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-md,32px);padding-inline:var(--wpds-dimension-padding-md,12px)}._684ccb7988365b4f__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);padding-block:var(--wp-ui-popup-item-padding-block);padding-inline-end:var(--wp-ui-popup-item-padding-inline);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px));user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&.f181b98b0d33282a__is-size-compact{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px)}&._38f7faff93c61958__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){._92fbe4765dfad5ee__item-indicator-icon{opacity:0}}&[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){outline:1px 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}}}.a3adcfd0b73ffd40__item-icon{flex-shrink:0}._06c7ff39d2f685b9__empty:not(:empty){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);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-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}'); } var item_popup_default6 = { "popup": "_234b520016b4e56f__popup _380b81b8f79fb10f__dropdown-motion", "list": "f43dc7c768d7b622__list", "list-scrollable-container": "_233cd60cdb84a2ef__list-scrollable-container", "list-footer": "ec4db6f0122263e7__list-footer", "group": "b3c0d7f103fb10a2__group", "group-label": "_21b59380477c306c__group-label", "item": "_684ccb7988365b4f__item", "is-size-compact": "f181b98b0d33282a__is-size-compact", "is-size-small": "_38f7faff93c61958__is-size-small", "item-indicator-icon": "_92fbe4765dfad5ee__item-indicator-icon", "item-icon": "a3adcfd0b73ffd40__item-icon", "empty": "_06c7ff39d2f685b9__empty" }; var ListBody = (0, import_element38.forwardRef)( function ListBody2({ render, ...props }, ref) { const element = useRender({ defaultTagName: "div", render, ref, props: mergeProps( { className: item_popup_default6["list-scrollable-container"] }, props ) }); return element; } ); // packages/ui/build-module/form/primitives/autocomplete/popup.mjs var import_element41 = __toESM(require_element(), 1); // packages/ui/build-module/form/primitives/autocomplete/portal.mjs var import_element39 = __toESM(require_element(), 1); var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1); var Portal2 = (0, import_element39.forwardRef)( function AutocompletePortal({ container, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)( index_parts_exports.Portal, { container: container ?? getWpCompatOverlaySlot(), ...restProps, ref } ); } ); // packages/ui/build-module/form/primitives/autocomplete/positioner.mjs var import_element40 = __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/form/primitives/autocomplete/positioner.mjs var import_jsx_runtime61 = __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("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) { registerStyle18("e61eb95308", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._8eb0a29484225eea__positioner{z-index:var(--wp-ui-autocomplete-z-index,initial)}}}"); } var style_default11 = { "positioner": "_8eb0a29484225eea__positioner" }; var Positioner2 = (0, import_element40.forwardRef)( function AutocompletePositioner({ className, ...props }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)( index_parts_exports.Positioner, { ...ITEM_POPUP_POSITIONER_PROPS, ...props, ref, className: clsx_default( resets_default5["box-sizing"], style_default11.positioner, className ) } ); } ); // packages/ui/build-module/form/primitives/autocomplete/popup.mjs var import_jsx_runtime62 = __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("b5813d84e6", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._380b81b8f79fb10f__dropdown-motion{--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;transform:translate(0);&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity: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))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._234b520016b4e56f__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);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(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);display:grid;grid-template-areas:"header" "main";grid-template-rows:auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width)}.f43dc7c768d7b622__list{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:grid;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);grid-area:main;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto;line-height:var(--wpds-typography-line-height-sm,20px)}._233cd60cdb84a2ef__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}.ec4db6f0122263e7__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);._233cd60cdb84a2ef__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.b3c0d7f103fb10a2__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21b59380477c306c__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-md,32px);padding-inline:var(--wpds-dimension-padding-md,12px)}._684ccb7988365b4f__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);padding-block:var(--wp-ui-popup-item-padding-block);padding-inline-end:var(--wp-ui-popup-item-padding-inline);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px));user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&.f181b98b0d33282a__is-size-compact{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px)}&._38f7faff93c61958__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){._92fbe4765dfad5ee__item-indicator-icon{opacity:0}}&[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){outline:1px 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}}}.a3adcfd0b73ffd40__item-icon{flex-shrink:0}._06c7ff39d2f685b9__empty:not(:empty){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-lg,40px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);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-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}'); } var item_popup_default7 = { "popup": "_234b520016b4e56f__popup _380b81b8f79fb10f__dropdown-motion", "list": "f43dc7c768d7b622__list", "list-scrollable-container": "_233cd60cdb84a2ef__list-scrollable-container", "list-footer": "ec4db6f0122263e7__list-footer", "group": "b3c0d7f103fb10a2__group", "group-label": "_21b59380477c306c__group-label", "item": "_684ccb7988365b4f__item", "is-size-compact": "f181b98b0d33282a__is-size-compact", "is-size-small": "_38f7faff93c61958__is-size-small", "item-indicator-icon": "_92fbe4765dfad5ee__item-indicator-icon", "item-icon": "a3adcfd0b73ffd40__item-icon", "empty": "_06c7ff39d2f685b9__empty" }; var Popup2 = (0, import_element41.forwardRef)( function Popup22({ className, portal, positioner, ...restProps }, ref) { const popupContent = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)( index_parts_exports.Popup, { ref, className: clsx_default(item_popup_default7.popup, className), ...restProps } ) }); const positionedPopup = renderSlotWithChildren( positioner, /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Positioner2, {}), popupContent ); return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Portal2, {}), positionedPopup); } ); // packages/ui/build-module/form/primitives/autocomplete/root.mjs var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1); function Root2(props) { return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(index_parts_exports.Root, { ...props }); } // packages/ui/build-module/form/primitives/autocomplete/value.mjs var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1); function Value(props) { return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(index_parts_exports.Value, { ...props }); } // packages/ui/build-module/form/primitives/field/index.mjs var field_exports = {}; __export(field_exports, { Control: () => Control, Description: () => Description, Details: () => Details, Item: () => Item3, Label: () => Label, Root: () => Root3 }); // packages/ui/build-module/form/primitives/field/root.mjs var import_element42 = __toESM(require_element(), 1); var import_jsx_runtime65 = __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("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" }; var DEFAULT_RENDER3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Stack, { ...props, direction: "column", gap: "sm" }); var Root3 = (0, import_element42.forwardRef)(function Root22({ className, render = DEFAULT_RENDER3, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( index_parts_exports2.Root, { ref, className: clsx_default(resets_default6["box-sizing"], className), render, ...restProps } ); }); // packages/ui/build-module/form/primitives/field/item.mjs var import_element43 = __toESM(require_element(), 1); var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1); var Item3 = (0, import_element43.forwardRef)(function Item22(props, ref) { return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(index_parts_exports2.Item, { ref, ...props }); }); // packages/ui/build-module/form/primitives/field/label.mjs var import_element45 = __toESM(require_element(), 1); // packages/ui/build-module/visually-hidden/visually-hidden.mjs var import_element44 = __toESM(require_element(), 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("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}"); } var style_default12 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; var VisuallyHidden = (0, import_element44.forwardRef)( function VisuallyHidden2({ render, ...restProps }, ref) { const element = useRender({ render, ref, props: mergeProps( { className: style_default12["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/form/primitives/field/label.mjs var import_jsx_runtime67 = __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("4b9484aa9f", '@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-medium,499);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);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_element45.forwardRef)( function Label2({ className, hideFromVision, variant, ...restProps }, ref) { const label = /* @__PURE__ */ (0, import_jsx_runtime67.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_runtime67.jsx)(VisuallyHidden, { render: label }); } return label; } ); // packages/ui/build-module/form/primitives/field/description.mjs var import_element46 = __toESM(require_element(), 1); var import_jsx_runtime68 = __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("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-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))}&::placeholder{color:var(--_gcd-input-placeholder-color,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-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}"); } 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" }; if (typeof process === "undefined" || true) { registerStyle23("4b9484aa9f", '@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-medium,499);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);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_element46.forwardRef)(function Description2({ className, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( index_parts_exports2.Description, { ref, className: clsx_default( global_css_defense_default5.p, field_default2.description, className ), ...restProps } ); }); // packages/ui/build-module/form/primitives/field/details.mjs var import_element47 = __toESM(require_element(), 1); var import_i18n3 = __toESM(require_i18n(), 1); var import_jsx_runtime69 = __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("4b9484aa9f", '@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-medium,499);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);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_element47.forwardRef)( function Details2({ className, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(index_parts_exports2.Description, {}), children: (0, import_i18n3.__)("More details follow the field.") }), /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( "div", { ref, className: clsx_default(field_default3.description, className), ...restProps } ) ] }); } ); // packages/ui/build-module/form/primitives/field/control.mjs var import_element48 = __toESM(require_element(), 1); var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1); var Control = (0, import_element48.forwardRef)( function Control2(props, ref) { return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(index_parts_exports2.Control, { ref, ...props }); } ); // packages/ui/build-module/form/input-control/input-control.mjs var import_element49 = __toESM(require_element(), 1); var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1); var InputControl = (0, import_element49.forwardRef)( function InputControl2({ className, label, description, details, hideLabelFromVision, ...restProps }, ref) { return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(field_exports.Root, { className, children: [ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(field_exports.Label, { hideFromVision: hideLabelFromVision, children: label }), /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Input3, { ref, ...restProps }), description && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(field_exports.Description, { children: description }), details && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(field_exports.Details, { children: details }) ] }); } ); // widgets/events/components/location-picker/location-picker.module.css var location_picker_default = { locationInput: "location_picker_locationInput" }; // widgets/events/components/location-picker/location-picker.tsx var import_jsx_runtime72 = __toESM(require_jsx_runtime()); var DRAFT_DEBOUNCE_MS = 300; function LocationPicker({ onSubmit = () => { }, seedInput = "", hideLabelFromVision = true, selectButton = true, onChange }) { const locationInputId = (0, import_element50.useId)(); const [locationInput, setLocationInput] = (0, import_element50.useState)(seedInput); const [locationOptions, setLocationOptions] = (0, import_element50.useState)([]); const [isLocatingCity, setIsLocatingCity] = (0, import_element50.useState)(false); const draftTimeoutRef = (0, import_element50.useRef)( null ); (0, import_element50.useEffect)(() => { if (!selectButton || seedInput) { setLocationInput(seedInput); } }, [selectButton, seedInput]); const clearDraftTimeout = (0, import_element50.useCallback)(() => { if (draftTimeoutRef.current) { clearTimeout(draftTimeoutRef.current); draftTimeoutRef.current = null; } }, []); const tryPublishDraft = (0, import_element50.useCallback)(() => { if (selectButton || !onChange) { return; } const draft = locationInput.trim(); const saved = seedInput.trim(); if (draft === saved) { return; } onChange(locationInput); }, [selectButton, locationInput, onChange, seedInput]); const scheduleDraftPublish = (0, import_element50.useCallback)(() => { if (selectButton || !onChange) { return; } clearDraftTimeout(); draftTimeoutRef.current = setTimeout(() => { draftTimeoutRef.current = null; tryPublishDraft(); }, DRAFT_DEBOUNCE_MS); }, [clearDraftTimeout, selectButton, onChange, tryPublishDraft]); (0, import_element50.useEffect)(() => { if (selectButton || !onChange) { clearDraftTimeout(); return; } scheduleDraftPublish(); return clearDraftTimeout; }, [clearDraftTimeout, selectButton, onChange, scheduleDraftPublish]); const flushDraftPublish = (0, import_element50.useCallback)(() => { clearDraftTimeout(); tryPublishDraft(); }, [clearDraftTimeout, tryPublishDraft]); const fillCityFromGeolocation = async () => { if (!navigator.geolocation || isLocatingCity) { return; } setIsLocatingCity(true); try { const position = await new Promise( (resolve, reject) => { navigator.geolocation.getCurrentPosition(resolve, reject, { enableHighAccuracy: false, timeout: 1e4 }); } ); const { latitude, longitude } = position.coords; const response = await fetch( `https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${latitude}&lon=${longitude}` ); const data = await response.json(); const city = data.address?.city ?? data.address?.town ?? data.address?.village ?? data.address?.municipality; if (city) { setLocationInput(city); } } catch { } finally { setIsLocatingCity(false); } }; (0, import_element50.useEffect)(() => { const query = locationInput.trim(); if (query.length < 2) { setLocationOptions([]); return; } const controller = new AbortController(); const timeoutId = setTimeout(async () => { try { const params = new URLSearchParams({ q: query, featureType: "city", format: "jsonv2", addressdetails: "1", limit: "8" }); const response = await fetch( `https://nominatim.openstreetmap.org/search?${params}`, { signal: controller.signal } ); const data = await response.json(); const seen = /* @__PURE__ */ new Set(); const nextOptions = data.map((place) => { const city = place.address?.city ?? place.address?.town ?? place.address?.village ?? place.address?.municipality; const country = place.address?.country; if (!city) { return null; } const label = country ? `${city}, ${country}` : city; if (seen.has(label.toLowerCase())) { return null; } seen.add(label.toLowerCase()); return { id: String(place.place_id), value: label }; }).filter(Boolean); setLocationOptions(nextOptions); } catch (error2) { if (error2 instanceof Error && error2.name === "AbortError") { return; } setLocationOptions([]); } }, 200); return () => { clearTimeout(timeoutId); controller.abort(); }; }, [locationInput]); return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( "form", { onSubmit: (e) => { e.preventDefault(); if (selectButton) { onSubmit(locationInput); } }, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Stack, { direction: "row", align: "start", wrap: "wrap", gap: "sm", children: [ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)( autocomplete_exports.Root, { items: locationOptions, value: locationInput, onValueChange: setLocationInput, children: [ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( autocomplete_exports.Input, { id: locationInputId, className: location_picker_default.locationInput, render: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( InputControl, { autoComplete: "off", label: (0, import_i18n4.__)("City"), hideLabelFromVision, size: "compact", description: (0, import_i18n4.__)( "Select a city to view upcoming events." ), onValueChange: () => { }, onBlur: !selectButton ? flushDraftPublish : void 0, suffix: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(InputLayout3.Slot, { padding: "minimal", children: [ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.Clear, {}), /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( IconButton, { icon: map_marker_default, label: (0, import_i18n4.__)( "Use current location" ), onClick: fillCityFromGeolocation, disabled: isLocatingCity, size: "small", variant: "minimal" } ) ] }) } ), placeholder: (0, import_i18n4.__)("City, like Tokyo\u2026") } ), locationOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.Popup, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.List, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.ListBody, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( autocomplete_exports.Item, { value: item, children: item.value }, item.id ) }) }) }) }) ] } ), selectButton && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( Button4, { variant: "outline", size: "compact", type: "submit", disabled: !locationInput.trim(), children: (0, import_i18n4.__)("Select") } ) ] }) } ); } // widgets/events/components/location-setting-control/location-setting-control.tsx var import_jsx_runtime73 = __toESM(require_jsx_runtime()); function LocationSettingControl({ data, field, onChange, hideLabelFromVision }) { const value = field.getValue({ item: data }); const onLocationChange = (0, import_element51.useCallback)( (location) => { onChange( field.setValue({ item: data, value: location.trim() }) ); }, [data, field, onChange] ); return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)( LocationPicker, { seedInput: value ?? "", hideLabelFromVision, selectButton: false, onChange: onLocationChange } ); } // widgets/events/widget.ts var widget_default = { name: "core/events", title: (0, import_i18n5.__)("WordPress events"), icon: calendar_default, attributes: [ { id: "location", type: "text", label: (0, import_i18n5.__)("Event location"), description: (0, import_i18n5.__)( "City or region for nearby events. Edits apply when you save this panel." ), Edit: LocationSettingControl } ] }; export { widget_default as default }; /*! 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. *) */
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium171.web-hosting.com
Server IP: 162.0.209.115
PHP Version: 8.0.30
Server Software: LiteSpeed
System: Linux premium171.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 71.28 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: aircyknj
User ID (UID): 2056
Group ID (GID): 2052
Script Owner UID: 2056
Current Dir Owner: 2056