import { $ as $8e6cc465cc68f603$export$698f465ec27e93df, a as $8e6cc465cc68f603$export$b0d3ecf7112093a7 } from "./context-DCAZLyDS.js";
import { p as $ff5963eb1fccf552$export$e08e3b67e392101e, j as $bdb11010cef70236$export$b4cc09c592e8fdb8, e as $8ae05eaa5c114e9c$export$7f54fc3180508a52, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, b as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$ef03459518577ad4, i as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, h as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "./utils-cvK1vxO7.js";
import { u as $507fabe10e71c6fb$export$630ff653c5ada6a9, b as $c87311424ea30a05$export$fedb369cb70207f1, s as $c87311424ea30a05$export$a11b0059900ceec8, g as $d4ee10de306f2510$export$cd4e5573fbe2b576, c as $431fbd86ca7dc216$export$b204af158042fbac, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-LmGemtHE.js";
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "./useLabels-Cdxi6JSa.js";
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-BifIGnVS.js";
import { v as $5671b20cf9b562b2$export$831c820ad60f9d12, w as $55f9b1ae81f22853$export$76e4e37e5339496d, x as $5671b20cf9b562b2$export$447a38995de2c711, y as $55f9b1ae81f22853$export$6c5dc7e81d2cc29a, t as $55f9b1ae81f22853$export$2b35b76d2e30e129, z as $21f1aa98acb08317$export$16792effe837dba3, A as $55f9b1ae81f22853$export$759df0d867455a91 } from "./SelectionManager-CabSdgMq.js";
import React__default, { useRef, useEffect, useCallback, useMemo, useState, createContext } from "react";
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-eaZiN2tE.js";
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "./Button-npzfSoYo.js";
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "./FieldError-B8BgFmIQ.js";
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "./Form-Cq3fu75_.js";
import { d as $2d73ec29415bd339$export$712718f7aec83d5, b as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $a049562f99e7db0e$export$f9c6924e160136d1 } from "./Input-ChJaTNa5.js";
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-DWVaNd2E.js";
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-AxKZjtFm.js";
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "./Hidden-rE6uR-lr.js";
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-D2C6R0DK.js";
var $03c9a1a10de12f06$exports = {};
$03c9a1a10de12f06$exports = {
  "Clear search": `مسح البحث`
};
var $4da0c2ffa4ba4159$exports = {};
$4da0c2ffa4ba4159$exports = {
  "Clear search": `Изчистване на търсене`
};
var $8c59fd0c2c96821b$exports = {};
$8c59fd0c2c96821b$exports = {
  "Clear search": `Vymazat hledání`
};
var $0a371f9c1df8120f$exports = {};
$0a371f9c1df8120f$exports = {
  "Clear search": `Ryd søgning`
};
var $67f4d0b0de9f8a52$exports = {};
$67f4d0b0de9f8a52$exports = {
  "Clear search": `Suche zurücksetzen`
};
var $72a312d948f0214b$exports = {};
$72a312d948f0214b$exports = {
  "Clear search": `Απαλοιφή αναζήτησης`
};
var $5012d21d933388c1$exports = {};
$5012d21d933388c1$exports = {
  "Clear search": `Clear search`
};
var $0159854399308e2e$exports = {};
$0159854399308e2e$exports = {
  "Clear search": `Borrar búsqueda`
};
var $390613981d970276$exports = {};
$390613981d970276$exports = {
  "Clear search": `Tühjenda otsing`
};
var $961ae0833f811705$exports = {};
$961ae0833f811705$exports = {
  "Clear search": `Tyhjennä haku`
};
var $26d76742decfd829$exports = {};
$26d76742decfd829$exports = {
  "Clear search": `Effacer la recherche`
};
var $92ef254c82a5c769$exports = {};
$92ef254c82a5c769$exports = {
  "Clear search": `נקה חיפוש`
};
var $e0321b43bdefb8b3$exports = {};
$e0321b43bdefb8b3$exports = {
  "Clear search": `Obriši pretragu`
};
var $0c1ee0b8d50940d9$exports = {};
$0c1ee0b8d50940d9$exports = {
  "Clear search": `Keresés törlése`
};
var $b09198915a38946f$exports = {};
$b09198915a38946f$exports = {
  "Clear search": `Cancella ricerca`
};
var $3a9a3d180c3145c0$exports = {};
$3a9a3d180c3145c0$exports = {
  "Clear search": `検索をクリア`
};
var $b7a611726449f4a3$exports = {};
$b7a611726449f4a3$exports = {
  "Clear search": `검색 지우기`
};
var $d9a3d49db610dd5c$exports = {};
$d9a3d49db610dd5c$exports = {
  "Clear search": `Išvalyti iešką`
};
var $3ab64b73ea27c23a$exports = {};
$3ab64b73ea27c23a$exports = {
  "Clear search": `Notīrīt meklēšanu`
};
var $bf5cce1b47d23baf$exports = {};
$bf5cce1b47d23baf$exports = {
  "Clear search": `Tøm søk`
};
var $4e0c9a9a010e4598$exports = {};
$4e0c9a9a010e4598$exports = {
  "Clear search": `Zoekactie wissen`
};
var $63cf4a75ec270508$exports = {};
$63cf4a75ec270508$exports = {
  "Clear search": `Wyczyść zawartość wyszukiwania`
};
var $083b0cad27fdbd06$exports = {};
$083b0cad27fdbd06$exports = {
  "Clear search": `Limpar pesquisa`
};
var $1b7f0864d830ba6d$exports = {};
$1b7f0864d830ba6d$exports = {
  "Clear search": `Limpar pesquisa`
};
var $d6d2588377fc9718$exports = {};
$d6d2588377fc9718$exports = {
  "Clear search": `Ştergeţi căutarea`
};
var $701c918a4653e946$exports = {};
$701c918a4653e946$exports = {
  "Clear search": `Очистить поиск`
};
var $7cacc29a1e5f4fbe$exports = {};
$7cacc29a1e5f4fbe$exports = {
  "Clear search": `Vymazať vyhľadávanie`
};
var $c63231bcc300d0df$exports = {};
$c63231bcc300d0df$exports = {
  "Clear search": `Počisti iskanje`
};
var $b61510478bc0e6f6$exports = {};
$b61510478bc0e6f6$exports = {
  "Clear search": `Obriši pretragu`
};
var $ce325e6dd3f9c37a$exports = {};
$ce325e6dd3f9c37a$exports = {
  "Clear search": `Rensa sökning`
};
var $1f7e1cf2285af2b2$exports = {};
$1f7e1cf2285af2b2$exports = {
  "Clear search": `Aramayı temizle`
};
var $2d999353ca652e34$exports = {};
$2d999353ca652e34$exports = {
  "Clear search": `Очистити пошук`
};
var $117b536bfb1ae554$exports = {};
$117b536bfb1ae554$exports = {
  "Clear search": `清除搜索`
};
var $525f6fa4ac26e278$exports = {};
$525f6fa4ac26e278$exports = {
  "Clear search": `清除搜尋條件`
};
var $8112f8b883c0272d$exports = {};
$8112f8b883c0272d$exports = {
  "ar-AE": $03c9a1a10de12f06$exports,
  "bg-BG": $4da0c2ffa4ba4159$exports,
  "cs-CZ": $8c59fd0c2c96821b$exports,
  "da-DK": $0a371f9c1df8120f$exports,
  "de-DE": $67f4d0b0de9f8a52$exports,
  "el-GR": $72a312d948f0214b$exports,
  "en-US": $5012d21d933388c1$exports,
  "es-ES": $0159854399308e2e$exports,
  "et-EE": $390613981d970276$exports,
  "fi-FI": $961ae0833f811705$exports,
  "fr-FR": $26d76742decfd829$exports,
  "he-IL": $92ef254c82a5c769$exports,
  "hr-HR": $e0321b43bdefb8b3$exports,
  "hu-HU": $0c1ee0b8d50940d9$exports,
  "it-IT": $b09198915a38946f$exports,
  "ja-JP": $3a9a3d180c3145c0$exports,
  "ko-KR": $b7a611726449f4a3$exports,
  "lt-LT": $d9a3d49db610dd5c$exports,
  "lv-LV": $3ab64b73ea27c23a$exports,
  "nb-NO": $bf5cce1b47d23baf$exports,
  "nl-NL": $4e0c9a9a010e4598$exports,
  "pl-PL": $63cf4a75ec270508$exports,
  "pt-BR": $083b0cad27fdbd06$exports,
  "pt-PT": $1b7f0864d830ba6d$exports,
  "ro-RO": $d6d2588377fc9718$exports,
  "ru-RU": $701c918a4653e946$exports,
  "sk-SK": $7cacc29a1e5f4fbe$exports,
  "sl-SI": $c63231bcc300d0df$exports,
  "sr-SP": $b61510478bc0e6f6$exports,
  "sv-SE": $ce325e6dd3f9c37a$exports,
  "tr-TR": $1f7e1cf2285af2b2$exports,
  "uk-UA": $2d999353ca652e34$exports,
  "zh-CN": $117b536bfb1ae554$exports,
  "zh-TW": $525f6fa4ac26e278$exports
};
function $parcel$interopDefault$1(a) {
  return a && a.__esModule ? a.default : a;
}
function $4d52238874b24f86$export$9bb30bbe003b82e0(props, state, inputRef) {
  let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault$1($8112f8b883c0272d$exports), "@react-aria/searchfield");
  let { isDisabled, isReadOnly, onSubmit, onClear, type = "search" } = props;
  let onKeyDown = (e) => {
    const key = e.key;
    if (key === "Enter" && (isDisabled || isReadOnly)) e.preventDefault();
    if (isDisabled || isReadOnly) return;
    if (key === "Enter" && onSubmit) {
      e.preventDefault();
      onSubmit(state.value);
    }
    if (key === "Escape") {
      if (state.value === "" && (!inputRef.current || inputRef.current.value === "")) e.continuePropagation();
      else {
        e.preventDefault();
        state.setValue("");
        if (onClear) onClear();
      }
    }
  };
  let onClearButtonClick = () => {
    state.setValue("");
    if (onClear) onClear();
  };
  let onPressStart = () => {
    var _inputRef_current;
    (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
  };
  let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $2d73ec29415bd339$export$712718f7aec83d5({
    ...props,
    value: state.value,
    onChange: state.setValue,
    onKeyDown: !isReadOnly ? $ff5963eb1fccf552$export$e08e3b67e392101e(onKeyDown, props.onKeyDown) : props.onKeyDown,
    type
  }, inputRef);
  return {
    labelProps,
    inputProps: {
      ...inputProps,
      // already handled by useSearchFieldState
      defaultValue: void 0
    },
    clearButtonProps: {
      "aria-label": stringFormatter.format("Clear search"),
      excludeFromTabOrder: true,
      preventFocusOnPress: true,
      isDisabled: isDisabled || isReadOnly,
      onPress: onClearButtonClick,
      onPressStart
    },
    descriptionProps,
    errorMessageProps,
    ...validation
  };
}
var $35cd24659c58727a$exports = {};
$35cd24659c58727a$exports = {
  "collectionLabel": `مقترحات`
};
var $cf76f2b22038d1dc$exports = {};
$cf76f2b22038d1dc$exports = {
  "collectionLabel": `Предложения`
};
var $d0ef36edb6b10634$exports = {};
$d0ef36edb6b10634$exports = {
  "collectionLabel": `Návrhy`
};
var $9746cad167cf365e$exports = {};
$9746cad167cf365e$exports = {
  "collectionLabel": `Forslag`
};
var $e096aa0a23f85b04$exports = {};
$e096aa0a23f85b04$exports = {
  "collectionLabel": `Empfehlungen`
};
var $0e9f1c25f5631e6c$exports = {};
$0e9f1c25f5631e6c$exports = {
  "collectionLabel": `Προτάσεις`
};
var $f195635a1f9154fe$exports = {};
$f195635a1f9154fe$exports = {
  "collectionLabel": `Suggestions`
};
var $0ab437f467150cd9$exports = {};
$0ab437f467150cd9$exports = {
  "collectionLabel": `Sugerencias`
};
var $5978f02f4e2f5026$exports = {};
$5978f02f4e2f5026$exports = {
  "collectionLabel": `Soovitused`
};
var $7ceabaf205d867a4$exports = {};
$7ceabaf205d867a4$exports = {
  "collectionLabel": `Ehdotukset`
};
var $9153fe570822488b$exports = {};
$9153fe570822488b$exports = {
  "collectionLabel": `Suggestions`
};
var $b353f6056f620327$exports = {};
$b353f6056f620327$exports = {
  "collectionLabel": `הצעות`
};
var $75f34cf3de3b71c1$exports = {};
$75f34cf3de3b71c1$exports = {
  "collectionLabel": `Prijedlozi`
};
var $315984f57113734f$exports = {};
$315984f57113734f$exports = {
  "collectionLabel": `Javaslatok`
};
var $f114a6a0dcc9e764$exports = {};
$f114a6a0dcc9e764$exports = {
  "collectionLabel": `Suggerimenti`
};
var $da9ccdb501807c66$exports = {};
$da9ccdb501807c66$exports = {
  "collectionLabel": `候補`
};
var $ee4f74cff6d185d7$exports = {};
$ee4f74cff6d185d7$exports = {
  "collectionLabel": `제안`
};
var $9f921d880c5b9f0f$exports = {};
$9f921d880c5b9f0f$exports = {
  "collectionLabel": `Pasiūlymai`
};
var $2516f8bc94df6b6f$exports = {};
$2516f8bc94df6b6f$exports = {
  "collectionLabel": `Ieteikumi`
};
var $2f701b767fa6559c$exports = {};
$2f701b767fa6559c$exports = {
  "collectionLabel": `Forslag`
};
var $1397b38c000e3e4b$exports = {};
$1397b38c000e3e4b$exports = {
  "collectionLabel": `Suggesties`
};
var $25bedea7b332a070$exports = {};
$25bedea7b332a070$exports = {
  "collectionLabel": `Sugestie`
};
var $1e398002a8be3d02$exports = {};
$1e398002a8be3d02$exports = {
  "collectionLabel": `Sugestões`
};
var $ae2286b176a3af67$exports = {};
$ae2286b176a3af67$exports = {
  "collectionLabel": `Sugestões`
};
var $42d5bcc619a7aaac$exports = {};
$42d5bcc619a7aaac$exports = {
  "collectionLabel": `Sugestii`
};
var $bafcc9870f83af97$exports = {};
$bafcc9870f83af97$exports = {
  "collectionLabel": `Предложения`
};
var $a59a67776704c670$exports = {};
$a59a67776704c670$exports = {
  "collectionLabel": `Návrhy`
};
var $070e1709fddbf199$exports = {};
$070e1709fddbf199$exports = {
  "collectionLabel": `Predlogi`
};
var $4ed19d2fc07f94be$exports = {};
$4ed19d2fc07f94be$exports = {
  "collectionLabel": `Predlozi`
};
var $bb4efe76ac2ad6af$exports = {};
$bb4efe76ac2ad6af$exports = {
  "collectionLabel": `Förslag`
};
var $ecc6dce838a94ce1$exports = {};
$ecc6dce838a94ce1$exports = {
  "collectionLabel": `Öneriler`
};
var $61d6a54fe0f4cb76$exports = {};
$61d6a54fe0f4cb76$exports = {
  "collectionLabel": `Пропозиції`
};
var $e98983e40b8886ed$exports = {};
$e98983e40b8886ed$exports = {
  "collectionLabel": `建议`
};
var $5bfd172db1a18268$exports = {};
$5bfd172db1a18268$exports = {
  "collectionLabel": `建議`
};
var $957f4f2fd749edef$exports = {};
$957f4f2fd749edef$exports = {
  "ar-AE": $35cd24659c58727a$exports,
  "bg-BG": $cf76f2b22038d1dc$exports,
  "cs-CZ": $d0ef36edb6b10634$exports,
  "da-DK": $9746cad167cf365e$exports,
  "de-DE": $e096aa0a23f85b04$exports,
  "el-GR": $0e9f1c25f5631e6c$exports,
  "en-US": $f195635a1f9154fe$exports,
  "es-ES": $0ab437f467150cd9$exports,
  "et-EE": $5978f02f4e2f5026$exports,
  "fi-FI": $7ceabaf205d867a4$exports,
  "fr-FR": $9153fe570822488b$exports,
  "he-IL": $b353f6056f620327$exports,
  "hr-HR": $75f34cf3de3b71c1$exports,
  "hu-HU": $315984f57113734f$exports,
  "it-IT": $f114a6a0dcc9e764$exports,
  "ja-JP": $da9ccdb501807c66$exports,
  "ko-KR": $ee4f74cff6d185d7$exports,
  "lt-LT": $9f921d880c5b9f0f$exports,
  "lv-LV": $2516f8bc94df6b6f$exports,
  "nb-NO": $2f701b767fa6559c$exports,
  "nl-NL": $1397b38c000e3e4b$exports,
  "pl-PL": $25bedea7b332a070$exports,
  "pt-BR": $1e398002a8be3d02$exports,
  "pt-PT": $ae2286b176a3af67$exports,
  "ro-RO": $42d5bcc619a7aaac$exports,
  "ru-RU": $bafcc9870f83af97$exports,
  "sk-SK": $a59a67776704c670$exports,
  "sl-SI": $070e1709fddbf199$exports,
  "sr-SP": $4ed19d2fc07f94be$exports,
  "sv-SE": $bb4efe76ac2ad6af$exports,
  "tr-TR": $ecc6dce838a94ce1$exports,
  "uk-UA": $61d6a54fe0f4cb76$exports,
  "zh-CN": $e98983e40b8886ed$exports,
  "zh-TW": $5bfd172db1a18268$exports
};
function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
function $48f6ba390f8c5b59$export$1e40b3ca02d92d21(props, state) {
  let { inputRef, collectionRef, filter, disableAutoFocusFirst = false, disableVirtualFocus = false } = props;
  let collectionId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
  let timeout = useRef(void 0);
  let delayNextActiveDescendant = useRef(false);
  let queuedActiveDescendant = useRef(null);
  let lastCollectionNode = useRef(null);
  let isMobileScreenReader = $507fabe10e71c6fb$export$630ff653c5ada6a9() === "virtual" && ($c87311424ea30a05$export$fedb369cb70207f1() || $c87311424ea30a05$export$a11b0059900ceec8());
  let shouldUseVirtualFocus = !isMobileScreenReader && !disableVirtualFocus;
  useEffect(() => {
    return () => clearTimeout(timeout.current);
  }, []);
  let updateActiveDescendant = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
    if (!e.isTrusted && shouldUseVirtualFocus && inputRef.current && $d4ee10de306f2510$export$cd4e5573fbe2b576($431fbd86ca7dc216$export$b204af158042fbac(inputRef.current)) !== inputRef.current) inputRef.current.focus();
    let target = e.target;
    if (e.isTrusted || !target || queuedActiveDescendant.current === target.id) return;
    clearTimeout(timeout.current);
    if (target !== collectionRef.current) {
      if (delayNextActiveDescendant.current) {
        queuedActiveDescendant.current = target.id;
        timeout.current = setTimeout(() => {
          state.setFocusedNodeId(target.id);
        }, 500);
      } else {
        queuedActiveDescendant.current = target.id;
        state.setFocusedNodeId(target.id);
      }
    } else if (queuedActiveDescendant.current && !document.getElementById(queuedActiveDescendant.current)) {
      queuedActiveDescendant.current = null;
      state.setFocusedNodeId(null);
    }
    delayNextActiveDescendant.current = false;
  });
  let callbackRef = useCallback((collectionNode) => {
    var _lastCollectionNode_current;
    if (collectionNode != null) {
      var _lastCollectionNode_current1;
      (_lastCollectionNode_current1 = lastCollectionNode.current) === null || _lastCollectionNode_current1 === void 0 ? void 0 : _lastCollectionNode_current1.removeEventListener("focusin", updateActiveDescendant);
      lastCollectionNode.current = collectionNode;
      collectionNode.addEventListener("focusin", updateActiveDescendant);
    } else (_lastCollectionNode_current = lastCollectionNode.current) === null || _lastCollectionNode_current === void 0 ? void 0 : _lastCollectionNode_current.removeEventListener("focusin", updateActiveDescendant);
  }, [
    updateActiveDescendant
  ]);
  let mergedCollectionRef = $df56164dff5785e2$export$4338b53315abf666(useMemo(() => $5dc95899b306f630$export$c9058316764c140e(collectionRef, callbackRef), [
    collectionRef,
    callbackRef
  ]));
  let focusFirstItem = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
    var _collectionRef_current;
    delayNextActiveDescendant.current = true;
    (_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dispatchEvent(new CustomEvent($5671b20cf9b562b2$export$831c820ad60f9d12, {
      cancelable: true,
      bubbles: true,
      detail: {
        focusStrategy: "first"
      }
    }));
  });
  let clearVirtualFocus = $8ae05eaa5c114e9c$export$7f54fc3180508a52((clearFocusKey) => {
    var _collectionRef_current;
    $55f9b1ae81f22853$export$76e4e37e5339496d($d4ee10de306f2510$export$cd4e5573fbe2b576());
    queuedActiveDescendant.current = null;
    state.setFocusedNodeId(null);
    let clearFocusEvent = new CustomEvent($5671b20cf9b562b2$export$447a38995de2c711, {
      cancelable: true,
      bubbles: true,
      detail: {
        clearFocusKey
      }
    });
    clearTimeout(timeout.current);
    delayNextActiveDescendant.current = false;
    (_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dispatchEvent(clearFocusEvent);
  });
  let lastInputType = useRef("");
  $e9faafb641e167db$export$90fc3a17d93f704c(inputRef, "input", (e) => {
    let { inputType } = e;
    lastInputType.current = inputType;
  });
  let onChange = (value) => {
    if (lastInputType.current === "insertText" && !disableAutoFocusFirst) focusFirstItem();
    else if (lastInputType.current && (lastInputType.current.includes("insert") || lastInputType.current.includes("delete") || lastInputType.current.includes("history"))) {
      clearVirtualFocus(true);
      if ($55f9b1ae81f22853$export$759df0d867455a91(document) === inputRef.current) $55f9b1ae81f22853$export$2b35b76d2e30e129(inputRef.current, null);
    }
    state.setInputValue(value);
  };
  let keyDownTarget = useRef(null);
  let onKeyDown = (e) => {
    keyDownTarget.current = e.target;
    if (e.nativeEvent.isComposing) return;
    let focusedNodeId = queuedActiveDescendant.current;
    switch (e.key) {
      case "a":
        if ($21f1aa98acb08317$export$16792effe837dba3(e)) return;
        break;
      case "Escape":
        if (e.isDefaultPrevented()) return;
        break;
      case " ":
        return;
      case "Tab":
        if ("continuePropagation" in e) e.continuePropagation();
        return;
      case "Home":
      case "End":
      case "PageDown":
      case "PageUp":
      case "ArrowUp":
      case "ArrowDown": {
        var _collectionRef_current;
        if ((e.key === "Home" || e.key === "End") && focusedNodeId == null && e.shiftKey) return;
        e.preventDefault();
        let focusCollection = new CustomEvent($5671b20cf9b562b2$export$831c820ad60f9d12, {
          cancelable: true,
          bubbles: true
        });
        (_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dispatchEvent(focusCollection);
        break;
      }
    }
    if (!e.isPropagationStopped()) e.stopPropagation();
    let shouldPerformDefaultAction = true;
    if (collectionRef.current !== null) {
      var _collectionRef_current1;
      if (focusedNodeId == null) shouldPerformDefaultAction = ((_collectionRef_current1 = collectionRef.current) === null || _collectionRef_current1 === void 0 ? void 0 : _collectionRef_current1.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent))) || false;
      else {
        let item = document.getElementById(focusedNodeId);
        if (item) shouldPerformDefaultAction = (item === null || item === void 0 ? void 0 : item.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent))) || false;
      }
    }
    if (shouldPerformDefaultAction) switch (e.key) {
      case "ArrowLeft":
      case "ArrowRight":
        clearVirtualFocus();
        break;
      case "Enter":
        if (focusedNodeId != null) {
          let item = document.getElementById(focusedNodeId);
          item === null || item === void 0 ? void 0 : item.click();
        }
        break;
    }
    else
      e.preventDefault();
  };
  let onKeyUpCapture = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
    if (e.target === keyDownTarget.current) {
      var _collectionRef_current;
      e.stopImmediatePropagation();
      let focusedNodeId = queuedActiveDescendant.current;
      if (focusedNodeId == null) (_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dispatchEvent(new KeyboardEvent(e.type, e));
      else {
        let item = document.getElementById(focusedNodeId);
        item === null || item === void 0 ? void 0 : item.dispatchEvent(new KeyboardEvent(e.type, e));
      }
    }
  });
  useEffect(() => {
    document.addEventListener("keyup", onKeyUpCapture, true);
    return () => {
      document.removeEventListener("keyup", onKeyUpCapture, true);
    };
  }, [
    onKeyUpCapture
  ]);
  let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($957f4f2fd749edef$exports), "@react-aria/autocomplete");
  let collectionProps = $313b98861ee5dd6c$export$d6875122194c7b44({
    id: collectionId,
    "aria-label": stringFormatter.format("collectionLabel")
  });
  let filterFn = useCallback((nodeTextValue, node) => {
    if (filter) return filter(nodeTextValue, state.inputValue, node);
    return true;
  }, [
    state.inputValue,
    filter
  ]);
  let onBlur = (e) => {
    if (!e.isTrusted) return;
    let lastFocusedNode = queuedActiveDescendant.current ? document.getElementById(queuedActiveDescendant.current) : null;
    if (lastFocusedNode) $55f9b1ae81f22853$export$6c5dc7e81d2cc29a(lastFocusedNode, e.relatedTarget);
  };
  let onFocus = (e) => {
    if (!e.isTrusted) return;
    let curFocusedNode = queuedActiveDescendant.current ? document.getElementById(queuedActiveDescendant.current) : null;
    if (curFocusedNode) {
      let target = e.target;
      queueMicrotask(() => {
        $55f9b1ae81f22853$export$6c5dc7e81d2cc29a(target, collectionRef.current);
        $55f9b1ae81f22853$export$2b35b76d2e30e129(collectionRef.current, target);
      });
    }
  };
  let inputProps = {
    value: state.inputValue,
    onChange
  };
  var _state_focusedNodeId;
  let virtualFocusProps = {
    onKeyDown,
    "aria-activedescendant": (_state_focusedNodeId = state.focusedNodeId) !== null && _state_focusedNodeId !== void 0 ? _state_focusedNodeId : void 0,
    onBlur,
    onFocus
  };
  if (collectionId) inputProps = {
    ...inputProps,
    ...shouldUseVirtualFocus && virtualFocusProps,
    enterKeyHint: "go",
    "aria-controls": collectionId,
    // TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)
    "aria-autocomplete": "list",
    // This disable's iOS's autocorrect suggestions, since the autocomplete provides its own suggestions.
    autoCorrect: "off",
    // This disable's the macOS Safari spell check auto corrections.
    spellCheck: "false",
    autoComplete: "off"
  };
  return {
    inputProps,
    collectionProps: $3ef42575df84b30b$export$9d1611c77c2fe928(collectionProps, {
      shouldUseVirtualFocus,
      disallowTypeAhead: true
    }),
    collectionRef: mergedCollectionRef,
    filter: filter != null ? filterFn : void 0
  };
}
function $94680be9a48a8f2d$export$ce1595f6e1a63433(props) {
  let { onInputChange: propsOnInputChange, inputValue: propsInputValue, defaultInputValue: propsDefaultInputValue = "" } = props;
  let onInputChange = (value) => {
    if (propsOnInputChange) propsOnInputChange(value);
  };
  let [focusedNodeId, setFocusedNodeId] = useState(null);
  let [inputValue, setInputValue] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(propsInputValue, propsDefaultInputValue, onInputChange);
  return {
    inputValue,
    setInputValue,
    focusedNodeId,
    setFocusedNodeId
  };
}
const $d2f53cda644affe3$export$36e687af51cd0967 = /* @__PURE__ */ createContext(null);
const $d2f53cda644affe3$export$68ee3368b6d68148 = /* @__PURE__ */ createContext(null);
function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
  let ctx = $64fa3d84918910a7$export$fabf2dc03a41866e($d2f53cda644affe3$export$36e687af51cd0967, props.slot);
  props = $3ef42575df84b30b$export$9d1611c77c2fe928(ctx, props);
  let { filter, disableAutoFocusFirst } = props;
  let state = $94680be9a48a8f2d$export$ce1595f6e1a63433(props);
  let inputRef = useRef(null);
  let collectionRef = useRef(null);
  let { inputProps, collectionProps, collectionRef: mergedCollectionRef, filter: filterFn } = $48f6ba390f8c5b59$export$1e40b3ca02d92d21({
    ...$64fa3d84918910a7$export$ef03459518577ad4(props),
    filter,
    disableAutoFocusFirst,
    inputRef,
    collectionRef
  }, state);
  return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $d2f53cda644affe3$export$68ee3368b6d68148,
        state
      ],
      [
        $8e6cc465cc68f603$export$698f465ec27e93df,
        {
          ...inputProps,
          ref: inputRef
        }
      ],
      [
        $8e6cc465cc68f603$export$b0d3ecf7112093a7,
        {
          ...collectionProps,
          filter: filterFn,
          ref: mergedCollectionRef
        }
      ]
    ]
  }, props.children);
}
function $0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2(props) {
  let [value, setValue] = $458b0a5536c1a7cf$export$40bfa8c7b0832715($0b2218c4e3fe7d7e$var$toString(props.value), $0b2218c4e3fe7d7e$var$toString(props.defaultValue) || "", props.onChange);
  return {
    value,
    setValue
  };
}
function $0b2218c4e3fe7d7e$var$toString(val) {
  if (val == null) return;
  return val.toString();
}
const $440f4836bcb56932$export$d1c4e4c63cb03a11 = /* @__PURE__ */ createContext(null);
const $440f4836bcb56932$export$b94867ecbd698f21 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function SearchField(props, ref) {
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $440f4836bcb56932$export$d1c4e4c63cb03a11);
  let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
  var _props_validationBehavior, _ref;
  let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
  let inputRef = useRef(null);
  [props, inputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, inputRef, $8e6cc465cc68f603$export$698f465ec27e93df);
  let [labelRef, label] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
  let state = $0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2({
    ...props,
    validationBehavior
  });
  let { labelProps, inputProps, clearButtonProps, descriptionProps, errorMessageProps, ...validation } = $4d52238874b24f86$export$9bb30bbe003b82e0({
    ...$64fa3d84918910a7$export$ef03459518577ad4(props),
    label,
    validationBehavior
  }, state, inputRef);
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    ...props,
    values: {
      isEmpty: state.value === "",
      isDisabled: props.isDisabled || false,
      isInvalid: validation.isInvalid || false,
      state
    },
    defaultClassName: "react-aria-SearchField"
  });
  let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    global: true
  });
  delete DOMProps.id;
  return /* @__PURE__ */ React__default.createElement("div", {
    ...DOMProps,
    ...renderProps,
    ref,
    slot: props.slot || void 0,
    "data-empty": state.value === "" || void 0,
    "data-disabled": props.isDisabled || void 0,
    "data-invalid": validation.isInvalid || void 0
  }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $01b77f81d0f07f68$export$75b6ee27786ba447,
        {
          ...labelProps,
          ref: labelRef
        }
      ],
      [
        $3985021b0ad6602f$export$37fb8590cf2c088c,
        {
          ...inputProps,
          ref: inputRef
        }
      ],
      [
        $d2b4bc8c273e7be6$export$24d547caef80ccd1,
        clearButtonProps
      ],
      [
        $514c0188e459b4c0$export$9afb8bc826b033ea,
        {
          slots: {
            description: descriptionProps,
            errorMessage: errorMessageProps
          }
        }
      ],
      [
        $a049562f99e7db0e$export$f9c6924e160136d1,
        {
          isInvalid: validation.isInvalid,
          isDisabled: props.isDisabled || false
        }
      ],
      [
        $ee014567cb39d3f0$export$ff05c3ac10437e03,
        validation
      ]
    ]
  }, renderProps.children));
});
export {
  $d2f53cda644affe3$export$2f2b9559550c7bbc as $,
  $440f4836bcb56932$export$b94867ecbd698f21 as a
};
