import { jsxs, jsx, Fragment } from "react/jsx-runtime";
import { c as $319e236875307eab$export$a9b970dcc4ae71a9, a as $d2b4bc8c273e7be6$export$24d547caef80ccd1, $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-npzfSoYo.js";
import { p as $ff5963eb1fccf552$export$e08e3b67e392101e, b as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, g as $64fa3d84918910a7$export$ef03459518577ad4, h as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-cvK1vxO7.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, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-ChJaTNa5.js";
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DWVaNd2E.js";
import { e as $b1f0cad8af73213b$export$3585ede4d035bf14, f as $b1f0cad8af73213b$export$9145995848b05025, c as $eed445e0843c11d0$export$7ff8f37d2d81a48d, d as $eed445e0843c11d0$export$7c5906fe4f1f2af2, $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../ListBox-D0Stb4wr.js";
import { o as $168583247155ddda$export$dc9c12ed27dd1b49, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, p as $07b14b47974efb58$export$9b9a0cd73afb7ca4, e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-CQ8H6Noi.js";
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-AxKZjtFm.js";
import { k as $ae20dd8cbca75726$export$d6daf82dcd84e87c, q as $c5a24bc478652b5f$export$1005530eda016c13, t as $55f9b1ae81f22853$export$2b35b76d2e30e129, e as $e1995378a142960e$export$bf788dd355e3a401 } from "../../SelectionManager-CabSdgMq.js";
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, f as $9daab02d461809db$export$683480f191c0e3ea } from "../../OverlayArrow-DivvkAVb.js";
import React__default, { useRef, useEffect, useMemo, useState, useCallback, forwardRef, createContext, cloneElement } from "react";
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-C4wo8Iii.js";
import { b as $e5be200c675c3b3a$export$a763b9476acd3eb, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidation-CUtZcedF.js";
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-DattSD7d.js";
import { c as $a02d57049d202695$export$d085fb9e920b5ca7 } from "../../useListState-Xsk-aOvN.js";
import { J as $c87311424ea30a05$export$e1865c3bedcd822b, g as $d4ee10de306f2510$export$cd4e5573fbe2b576, c as $431fbd86ca7dc216$export$b204af158042fbac, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../useHover-LmGemtHE.js";
import { b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572 } from "../../usePress-CBQIDzpQ.js";
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-Cdxi6JSa.js";
import { f as $2a25aae57d74318e$export$a05409b8bb224a5a, e as $453cc9f0df89c0a5$export$77d5aafae4e095b2 } from "../../Separator-BPvqJny4.js";
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-eaZiN2tE.js";
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
import { icons } from "../../icons/icons.js";
import { c as clsx } from "../../lite-DVmmD_-j.js";
import { Spacer } from "../spacer/spacer.js";
import { Tooltip } from "../tooltip/tooltip.js";
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
import { BaseControl } from "../base-control/base-control.js";
import { RichLabel } from "../rich-label/rich-label.js";
import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66 } from "../../useAsyncList-D52mQcrH.js";
function $4f58c5f72bcf79f7$export$496315a1608d9602(effect, dependencies) {
  const isInitialMount = useRef(true);
  const lastDeps = useRef(null);
  useEffect(() => {
    isInitialMount.current = true;
    return () => {
      isInitialMount.current = false;
    };
  }, []);
  useEffect(() => {
    let prevDeps = lastDeps.current;
    if (isInitialMount.current) isInitialMount.current = false;
    else if (!prevDeps || dependencies.some((dep, i) => !Object.is(dep, prevDeps[i]))) effect();
    lastDeps.current = dependencies;
  }, dependencies);
}
var $02cb4c75c506befe$exports = {};
$02cb4c75c506befe$exports = {
  "buttonLabel": `عرض المقترحات`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} خيار`,
    other: () => `${formatter.number(args.optionCount)} خيارات`
  })} متاحة.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `المجموعة المدخلة ${args.groupTitle}, مع ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} خيار`,
      other: () => `${formatter.number(args.groupCount)} خيارات`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, محدد`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `مقترحات`,
  "selectedAnnouncement": (args) => `${args.optionText}، محدد`
};
var $568b8163f1e56faf$exports = {};
$568b8163f1e56faf$exports = {
  "buttonLabel": `Покажи предложения`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} опция`,
    other: () => `${formatter.number(args.optionCount)} опции`
  })} на разположение.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Въведена група ${args.groupTitle}, с ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} опция`,
      other: () => `${formatter.number(args.groupCount)} опции`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, избрани`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Предложения`,
  "selectedAnnouncement": (args) => `${args.optionText}, избрани`
};
var $87581c0202d106b8$exports = {};
$87581c0202d106b8$exports = {
  "buttonLabel": `Zobrazit doporučení`,
  "countAnnouncement": (args, formatter) => `K dispozici ${formatter.plural(args.optionCount, {
    one: () => `je ${formatter.number(args.optionCount)} možnost`,
    other: () => `jsou/je ${formatter.number(args.optionCount)} možnosti/-í`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Zadaná skupina „${args.groupTitle}“ ${formatter.plural(args.groupCount, {
      one: () => `s ${formatter.number(args.groupCount)} možností`,
      other: () => `se ${formatter.number(args.groupCount)} možnostmi`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: ` (vybráno)`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Návrhy`,
  "selectedAnnouncement": (args) => `${args.optionText}, vybráno`
};
var $a10a0369f5433ed1$exports = {};
$a10a0369f5433ed1$exports = {
  "buttonLabel": `Vis forslag`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} mulighed tilgængelig`,
    other: () => `${formatter.number(args.optionCount)} muligheder tilgængelige`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Angivet gruppe ${args.groupTitle}, med ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} mulighed`,
      other: () => `${formatter.number(args.groupCount)} muligheder`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, valgt`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Forslag`,
  "selectedAnnouncement": (args) => `${args.optionText}, valgt`
};
var $bfd288727d5cb166$exports = {};
$bfd288727d5cb166$exports = {
  "buttonLabel": `Empfehlungen anzeigen`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} Option`,
    other: () => `${formatter.number(args.optionCount)} Optionen`
  })} verfügbar.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Eingetretene Gruppe ${args.groupTitle}, mit ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} Option`,
      other: () => `${formatter.number(args.groupCount)} Optionen`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, ausgewählt`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Empfehlungen`,
  "selectedAnnouncement": (args) => `${args.optionText}, ausgewählt`
};
var $ca177778f9a74e3c$exports = {};
$ca177778f9a74e3c$exports = {
  "buttonLabel": `Προβολή προτάσεων`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} επιλογή`,
    other: () => `${formatter.number(args.optionCount)} επιλογές `
  })} διαθέσιμες.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Εισαγμένη ομάδα ${args.groupTitle}, με ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} επιλογή`,
      other: () => `${formatter.number(args.groupCount)} επιλογές`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, επιλεγμένο`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Προτάσεις`,
  "selectedAnnouncement": (args) => `${args.optionText}, επιλέχθηκε`
};
var $9b5aa79ef84beb6c$exports = {};
$9b5aa79ef84beb6c$exports = {
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Entered group ${args.groupTitle}, with ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} option`,
      other: () => `${formatter.number(args.groupCount)} options`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, selected`,
    other: ``
  }, args.isSelected)}`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} option`,
    other: () => `${formatter.number(args.optionCount)} options`
  })} available.`,
  "selectedAnnouncement": (args) => `${args.optionText}, selected`,
  "buttonLabel": `Show suggestions`,
  "listboxLabel": `Suggestions`
};
var $57968e8209de2557$exports = {};
$57968e8209de2557$exports = {
  "buttonLabel": `Mostrar sugerencias`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opción`,
    other: () => `${formatter.number(args.optionCount)} opciones`
  })} disponible(s).`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Se ha unido al grupo ${args.groupTitle}, con ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opción`,
      other: () => `${formatter.number(args.groupCount)} opciones`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, seleccionado`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Sugerencias`,
  "selectedAnnouncement": (args) => `${args.optionText}, seleccionado`
};
var $60690790bf4c1c6a$exports = {};
$60690790bf4c1c6a$exports = {
  "buttonLabel": `Kuva soovitused`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} valik`,
    other: () => `${formatter.number(args.optionCount)} valikud`
  })} saadaval.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Sisestatud rühm ${args.groupTitle}, valikuga ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} valik`,
      other: () => `${formatter.number(args.groupCount)} valikud`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, valitud`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Soovitused`,
  "selectedAnnouncement": (args) => `${args.optionText}, valitud`
};
var $1101246e8c7d9357$exports = {};
$1101246e8c7d9357$exports = {
  "buttonLabel": `Näytä ehdotukset`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} vaihtoehto`,
    other: () => `${formatter.number(args.optionCount)} vaihtoehdot`
  })} saatavilla.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Mentiin ryhmään ${args.groupTitle}, ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} vaihtoehdon`,
      other: () => `${formatter.number(args.groupCount)} vaihtoehdon`
    })} kanssa.`,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, valittu`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Ehdotukset`,
  "selectedAnnouncement": (args) => `${args.optionText}, valittu`
};
var $6404b5cb5b241730$exports = {};
$6404b5cb5b241730$exports = {
  "buttonLabel": `Afficher les suggestions`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} option`,
    other: () => `${formatter.number(args.optionCount)} options`
  })} disponible(s).`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Groupe ${args.groupTitle} rejoint, avec ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} option`,
      other: () => `${formatter.number(args.groupCount)} options`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, sélectionné(s)`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Suggestions`,
  "selectedAnnouncement": (args) => `${args.optionText}, sélectionné`
};
var $dfeafa702e92e31f$exports = {};
$dfeafa702e92e31f$exports = {
  "buttonLabel": `הצג הצעות`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `אפשרות ${formatter.number(args.optionCount)}`,
    other: () => `${formatter.number(args.optionCount)} אפשרויות`
  })} במצב זמין.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `נכנס לקבוצה ${args.groupTitle}, עם ${formatter.plural(args.groupCount, {
      one: () => `אפשרות ${formatter.number(args.groupCount)}`,
      other: () => `${formatter.number(args.groupCount)} אפשרויות`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, נבחר`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `הצעות`,
  "selectedAnnouncement": (args) => `${args.optionText}, נבחר`
};
var $2d125e0b34676352$exports = {};
$2d125e0b34676352$exports = {
  "buttonLabel": `Prikaži prijedloge`,
  "countAnnouncement": (args, formatter) => `Dostupno još: ${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opcija`,
    other: () => `${formatter.number(args.optionCount)} opcije/a`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Unesena skupina ${args.groupTitle}, s ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opcijom`,
      other: () => `${formatter.number(args.groupCount)} opcije/a`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, odabranih`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Prijedlozi`,
  "selectedAnnouncement": (args) => `${args.optionText}, odabrano`
};
var $ea029611d7634059$exports = {};
$ea029611d7634059$exports = {
  "buttonLabel": `Javaslatok megjelenítése`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} lehetőség`,
    other: () => `${formatter.number(args.optionCount)} lehetőség`
  })} áll rendelkezésre.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Belépett a(z) ${args.groupTitle} csoportba, amely ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} lehetőséget`,
      other: () => `${formatter.number(args.groupCount)} lehetőséget`
    })} tartalmaz. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, kijelölve`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Javaslatok`,
  "selectedAnnouncement": (args) => `${args.optionText}, kijelölve`
};
var $77f075bb86ad7091$exports = {};
$77f075bb86ad7091$exports = {
  "buttonLabel": `Mostra suggerimenti`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opzione disponibile`,
    other: () => `${formatter.number(args.optionCount)} opzioni disponibili`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Ingresso nel gruppo ${args.groupTitle}, con ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opzione`,
      other: () => `${formatter.number(args.groupCount)} opzioni`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, selezionato`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Suggerimenti`,
  "selectedAnnouncement": (args) => `${args.optionText}, selezionato`
};
var $6e87462e84907983$exports = {};
$6e87462e84907983$exports = {
  "buttonLabel": `候補を表示`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} 個のオプション`,
    other: () => `${formatter.number(args.optionCount)} 個のオプション`
  })}を利用できます。`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `入力されたグループ ${args.groupTitle}、${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} 個のオプション`,
      other: () => `${formatter.number(args.groupCount)} 個のオプション`
    })}を含む。`,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `、選択済み`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `候補`,
  "selectedAnnouncement": (args) => `${args.optionText}、選択済み`
};
var $9246f2c6edc6b232$exports = {};
$9246f2c6edc6b232$exports = {
  "buttonLabel": `제안 사항 표시`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)}개 옵션`,
    other: () => `${formatter.number(args.optionCount)}개 옵션`
  })}을 사용할 수 있습니다.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `입력한 그룹 ${args.groupTitle}, ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)}개 옵션`,
      other: () => `${formatter.number(args.groupCount)}개 옵션`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, 선택됨`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `제안`,
  "selectedAnnouncement": (args) => `${args.optionText}, 선택됨`
};
var $e587accc6c0a434c$exports = {};
$e587accc6c0a434c$exports = {
  "buttonLabel": `Rodyti pasiūlymus`,
  "countAnnouncement": (args, formatter) => `Yra ${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} parinktis`,
    other: () => `${formatter.number(args.optionCount)} parinktys (-ių)`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Įvesta grupė ${args.groupTitle}, su ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} parinktimi`,
      other: () => `${formatter.number(args.groupCount)} parinktimis (-ių)`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, pasirinkta`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Pasiūlymai`,
  "selectedAnnouncement": (args) => `${args.optionText}, pasirinkta`
};
var $03a1900e7400b5ab$exports = {};
$03a1900e7400b5ab$exports = {
  "buttonLabel": `Rādīt ieteikumus`,
  "countAnnouncement": (args, formatter) => `Pieejamo opciju skaits: ${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opcija`,
    other: () => `${formatter.number(args.optionCount)} opcijas`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Ievadīta grupa ${args.groupTitle}, ar ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opciju`,
      other: () => `${formatter.number(args.groupCount)} opcijām`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, atlasīta`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Ieteikumi`,
  "selectedAnnouncement": (args) => `${args.optionText}, atlasīta`
};
var $1387676441be6cf6$exports = {};
$1387676441be6cf6$exports = {
  "buttonLabel": `Vis forslag`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} alternativ`,
    other: () => `${formatter.number(args.optionCount)} alternativer`
  })} finnes.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Angitt gruppe ${args.groupTitle}, med ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} alternativ`,
      other: () => `${formatter.number(args.groupCount)} alternativer`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, valgt`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Forslag`,
  "selectedAnnouncement": (args) => `${args.optionText}, valgt`
};
var $17e82ebf0f8ab91f$exports = {};
$17e82ebf0f8ab91f$exports = {
  "buttonLabel": `Suggesties weergeven`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} optie`,
    other: () => `${formatter.number(args.optionCount)} opties`
  })} beschikbaar.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Groep ${args.groupTitle} ingevoerd met ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} optie`,
      other: () => `${formatter.number(args.groupCount)} opties`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, geselecteerd`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Suggesties`,
  "selectedAnnouncement": (args) => `${args.optionText}, geselecteerd`
};
var $2f5377d3471630e5$exports = {};
$2f5377d3471630e5$exports = {
  "buttonLabel": `Wyświetlaj sugestie`,
  "countAnnouncement": (args, formatter) => `dostępna/dostępne(-nych) ${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opcja`,
    other: () => `${formatter.number(args.optionCount)} opcje(-i)`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Dołączono do grupy ${args.groupTitle}, z ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opcją`,
      other: () => `${formatter.number(args.groupCount)} opcjami`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, wybrano`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Sugestie`,
  "selectedAnnouncement": (args) => `${args.optionText}, wybrano`
};
var $dee9868b6fa95ffe$exports = {};
$dee9868b6fa95ffe$exports = {
  "buttonLabel": `Mostrar sugestões`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opção`,
    other: () => `${formatter.number(args.optionCount)} opções`
  })} disponível.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Grupo inserido ${args.groupTitle}, com ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opção`,
      other: () => `${formatter.number(args.groupCount)} opções`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, selecionado`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Sugestões`,
  "selectedAnnouncement": (args) => `${args.optionText}, selecionado`
};
var $f8b2e63637cbb5a6$exports = {};
$f8b2e63637cbb5a6$exports = {
  "buttonLabel": `Apresentar sugestões`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opção`,
    other: () => `${formatter.number(args.optionCount)} opções`
  })} disponível.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Grupo introduzido ${args.groupTitle}, com ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opção`,
      other: () => `${formatter.number(args.groupCount)} opções`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, selecionado`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Sugestões`,
  "selectedAnnouncement": (args) => `${args.optionText}, selecionado`
};
var $46a885db3b44ea95$exports = {};
$46a885db3b44ea95$exports = {
  "buttonLabel": `Afișare sugestii`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opțiune`,
    other: () => `${formatter.number(args.optionCount)} opțiuni`
  })} disponibile.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Grup ${args.groupTitle} introdus, cu ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opțiune`,
      other: () => `${formatter.number(args.groupCount)} opțiuni`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, selectat`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Sugestii`,
  "selectedAnnouncement": (args) => `${args.optionText}, selectat`
};
var $50d8a8f0afa9dee5$exports = {};
$50d8a8f0afa9dee5$exports = {
  "buttonLabel": `Показать предложения`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} параметр`,
    other: () => `${formatter.number(args.optionCount)} параметров`
  })} доступно.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Введенная группа ${args.groupTitle}, с ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} параметром`,
      other: () => `${formatter.number(args.groupCount)} параметрами`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, выбранными`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Предложения`,
  "selectedAnnouncement": (args) => `${args.optionText}, выбрано`
};
var $2867ee6173245507$exports = {};
$2867ee6173245507$exports = {
  "buttonLabel": `Zobraziť návrhy`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} možnosť`,
    other: () => `${formatter.number(args.optionCount)} možnosti/-í`
  })} k dispozícii.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Zadaná skupina ${args.groupTitle}, s ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} možnosťou`,
      other: () => `${formatter.number(args.groupCount)} možnosťami`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, vybraté`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Návrhy`,
  "selectedAnnouncement": (args) => `${args.optionText}, vybraté`
};
var $0631b65beeb09b50$exports = {};
$0631b65beeb09b50$exports = {
  "buttonLabel": `Prikaži predloge`,
  "countAnnouncement": (args, formatter) => `Na voljo je ${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opcija`,
    other: () => `${formatter.number(args.optionCount)} opcije`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Vnesena skupina ${args.groupTitle}, z ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opcija`,
      other: () => `${formatter.number(args.groupCount)} opcije`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, izbrano`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Predlogi`,
  "selectedAnnouncement": (args) => `${args.optionText}, izbrano`
};
var $65fc749265dcd686$exports = {};
$65fc749265dcd686$exports = {
  "buttonLabel": `Prikaži predloge`,
  "countAnnouncement": (args, formatter) => `Dostupno još: ${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} opcija`,
    other: () => `${formatter.number(args.optionCount)} opcije/a`
  })}.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Unesena grupa ${args.groupTitle}, s ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} opcijom`,
      other: () => `${formatter.number(args.groupCount)} optione/a`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, izabranih`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Predlozi`,
  "selectedAnnouncement": (args) => `${args.optionText}, izabrano`
};
var $69ba655c7853c08e$exports = {};
$69ba655c7853c08e$exports = {
  "buttonLabel": `Visa förslag`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} alternativ`,
    other: () => `${formatter.number(args.optionCount)} alternativ`
  })} tillgängliga.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Ingick i gruppen ${args.groupTitle} med ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} alternativ`,
      other: () => `${formatter.number(args.groupCount)} alternativ`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, valda`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Förslag`,
  "selectedAnnouncement": (args) => `${args.optionText}, valda`
};
var $a79794784d61577c$exports = {};
$a79794784d61577c$exports = {
  "buttonLabel": `Önerileri göster`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} seçenek`,
    other: () => `${formatter.number(args.optionCount)} seçenekler`
  })} kullanılabilir.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Girilen grup ${args.groupTitle}, ile ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} seçenek`,
      other: () => `${formatter.number(args.groupCount)} seçenekler`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, seçildi`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Öneriler`,
  "selectedAnnouncement": (args) => `${args.optionText}, seçildi`
};
var $c2845791417ebaf4$exports = {};
$c2845791417ebaf4$exports = {
  "buttonLabel": `Показати пропозиції`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} параметр`,
    other: () => `${formatter.number(args.optionCount)} параметри(-ів)`
  })} доступно.`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `Введена група ${args.groupTitle}, з ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} параметр`,
      other: () => `${formatter.number(args.groupCount)} параметри(-ів)`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, вибрано`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `Пропозиції`,
  "selectedAnnouncement": (args) => `${args.optionText}, вибрано`
};
var $29b642d0025cc7a4$exports = {};
$29b642d0025cc7a4$exports = {
  "buttonLabel": `显示建议`,
  "countAnnouncement": (args, formatter) => `有 ${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} 个选项`,
    other: () => `${formatter.number(args.optionCount)} 个选项`
  })}可用。`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `进入了 ${args.groupTitle} 组，其中有 ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} 个选项`,
      other: () => `${formatter.number(args.groupCount)} 个选项`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, 已选择`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `建议`,
  "selectedAnnouncement": (args) => `${args.optionText}, 已选择`
};
var $cd36dd33f9d46936$exports = {};
$cd36dd33f9d46936$exports = {
  "buttonLabel": `顯示建議`,
  "countAnnouncement": (args, formatter) => `${formatter.plural(args.optionCount, {
    one: () => `${formatter.number(args.optionCount)} 選項`,
    other: () => `${formatter.number(args.optionCount)} 選項`
  })} 可用。`,
  "focusAnnouncement": (args, formatter) => `${formatter.select({
    true: () => `輸入的群組 ${args.groupTitle}, 有 ${formatter.plural(args.groupCount, {
      one: () => `${formatter.number(args.groupCount)} 選項`,
      other: () => `${formatter.number(args.groupCount)} 選項`
    })}. `,
    other: ``
  }, args.isGroupChange)}${args.optionText}${formatter.select({
    true: `, 已選取`,
    other: ``
  }, args.isSelected)}`,
  "listboxLabel": `建議`,
  "selectedAnnouncement": (args) => `${args.optionText}, 已選取`
};
var $de5926a92e8ebc5b$exports = {};
$de5926a92e8ebc5b$exports = {
  "ar-AE": $02cb4c75c506befe$exports,
  "bg-BG": $568b8163f1e56faf$exports,
  "cs-CZ": $87581c0202d106b8$exports,
  "da-DK": $a10a0369f5433ed1$exports,
  "de-DE": $bfd288727d5cb166$exports,
  "el-GR": $ca177778f9a74e3c$exports,
  "en-US": $9b5aa79ef84beb6c$exports,
  "es-ES": $57968e8209de2557$exports,
  "et-EE": $60690790bf4c1c6a$exports,
  "fi-FI": $1101246e8c7d9357$exports,
  "fr-FR": $6404b5cb5b241730$exports,
  "he-IL": $dfeafa702e92e31f$exports,
  "hr-HR": $2d125e0b34676352$exports,
  "hu-HU": $ea029611d7634059$exports,
  "it-IT": $77f075bb86ad7091$exports,
  "ja-JP": $6e87462e84907983$exports,
  "ko-KR": $9246f2c6edc6b232$exports,
  "lt-LT": $e587accc6c0a434c$exports,
  "lv-LV": $03a1900e7400b5ab$exports,
  "nb-NO": $1387676441be6cf6$exports,
  "nl-NL": $17e82ebf0f8ab91f$exports,
  "pl-PL": $2f5377d3471630e5$exports,
  "pt-BR": $dee9868b6fa95ffe$exports,
  "pt-PT": $f8b2e63637cbb5a6$exports,
  "ro-RO": $46a885db3b44ea95$exports,
  "ru-RU": $50d8a8f0afa9dee5$exports,
  "sk-SK": $2867ee6173245507$exports,
  "sl-SI": $0631b65beeb09b50$exports,
  "sr-SP": $65fc749265dcd686$exports,
  "sv-SE": $69ba655c7853c08e$exports,
  "tr-TR": $a79794784d61577c$exports,
  "uk-UA": $c2845791417ebaf4$exports,
  "zh-CN": $29b642d0025cc7a4$exports,
  "zh-TW": $cd36dd33f9d46936$exports
};
function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
function $c350ade66beef0af$export$8c18d1b4f7232bbf(props, state) {
  let { buttonRef, popoverRef, inputRef, listBoxRef, keyboardDelegate, layoutDelegate, shouldFocusWrap, isReadOnly, isDisabled } = props;
  let backupBtnRef = useRef(null);
  buttonRef = buttonRef !== null && buttonRef !== void 0 ? buttonRef : backupBtnRef;
  let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($de5926a92e8ebc5b$exports), "@react-aria/combobox");
  let { menuTriggerProps, menuProps } = $168583247155ddda$export$dc9c12ed27dd1b49({
    type: "listbox",
    isDisabled: isDisabled || isReadOnly
  }, state, buttonRef);
  $b1f0cad8af73213b$export$3585ede4d035bf14.set(state, {
    id: menuProps.id
  });
  let { collection } = state;
  let { disabledKeys } = state.selectionManager;
  let delegate = useMemo(() => keyboardDelegate || new $2a25aae57d74318e$export$a05409b8bb224a5a({
    collection,
    disabledKeys,
    ref: listBoxRef,
    layoutDelegate
  }), [
    keyboardDelegate,
    layoutDelegate,
    collection,
    disabledKeys,
    listBoxRef
  ]);
  let { collectionProps } = $ae20dd8cbca75726$export$d6daf82dcd84e87c({
    selectionManager: state.selectionManager,
    keyboardDelegate: delegate,
    disallowTypeAhead: true,
    disallowEmptySelection: true,
    shouldFocusWrap,
    ref: inputRef,
    // Prevent item scroll behavior from being applied here, should be handled in the user's Popover + ListBox component
    isVirtualized: true
  });
  let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
  let onKeyDown = (e) => {
    if (e.nativeEvent.isComposing) return;
    switch (e.key) {
      case "Enter":
      case "Tab":
        if (state.isOpen && e.key === "Enter") e.preventDefault();
        if (state.isOpen && listBoxRef.current && state.selectionManager.focusedKey != null && state.selectionManager.isLink(state.selectionManager.focusedKey)) {
          let item = listBoxRef.current.querySelector(`[data-key="${CSS.escape(state.selectionManager.focusedKey.toString())}"]`);
          if (e.key === "Enter" && item instanceof HTMLAnchorElement) {
            let collectionItem = state.collection.getItem(state.selectionManager.focusedKey);
            if (collectionItem) router.open(item, e, collectionItem.props.href, collectionItem.props.routerOptions);
          }
          state.close();
        } else state.commit();
        break;
      case "Escape":
        if (state.selectedKey !== null || state.inputValue === "" || props.allowsCustomValue) e.continuePropagation();
        state.revert();
        break;
      case "ArrowDown":
        state.open("first", "manual");
        break;
      case "ArrowUp":
        state.open("last", "manual");
        break;
      case "ArrowLeft":
      case "ArrowRight":
        state.selectionManager.setFocusedKey(null);
        break;
    }
  };
  let onBlur = (e) => {
    var _popoverRef_current;
    let blurFromButton = (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) && buttonRef.current === e.relatedTarget;
    let blurIntoPopover = (_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : _popoverRef_current.contains(e.relatedTarget);
    if (blurFromButton || blurIntoPopover) return;
    if (props.onBlur) props.onBlur(e);
    state.setFocused(false);
  };
  let onFocus = (e) => {
    if (state.isFocused) return;
    if (props.onFocus) props.onFocus(e);
    state.setFocused(true);
  };
  let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
  let { labelProps, inputProps, descriptionProps, errorMessageProps } = $2d73ec29415bd339$export$712718f7aec83d5({
    ...props,
    onChange: state.setInputValue,
    onKeyDown: !isReadOnly ? $ff5963eb1fccf552$export$e08e3b67e392101e(state.isOpen && collectionProps.onKeyDown, onKeyDown, props.onKeyDown) : props.onKeyDown,
    onBlur,
    value: state.inputValue,
    defaultValue: state.defaultInputValue,
    onFocus,
    autoComplete: "off",
    validate: void 0,
    [$e5be200c675c3b3a$export$a763b9476acd3eb]: state
  }, inputRef);
  let onPress = (e) => {
    if (e.pointerType === "touch") {
      var _inputRef_current;
      (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
      state.toggle(null, "manual");
    }
  };
  let onPressStart = (e) => {
    if (e.pointerType !== "touch") {
      var _inputRef_current;
      (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
      state.toggle(e.pointerType === "keyboard" || e.pointerType === "virtual" ? "first" : null, "manual");
    }
  };
  let triggerLabelProps = $313b98861ee5dd6c$export$d6875122194c7b44({
    id: menuTriggerProps.id,
    "aria-label": stringFormatter.format("buttonLabel"),
    "aria-labelledby": props["aria-labelledby"] || labelProps.id
  });
  let listBoxProps = $313b98861ee5dd6c$export$d6875122194c7b44({
    id: menuProps.id,
    "aria-label": stringFormatter.format("listboxLabel"),
    "aria-labelledby": props["aria-labelledby"] || labelProps.id
  });
  let lastEventTime = useRef(0);
  let onTouchEnd = (e) => {
    if (isDisabled || isReadOnly) return;
    if (e.timeStamp - lastEventTime.current < 500) {
      var _inputRef_current;
      e.preventDefault();
      (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
      return;
    }
    let rect = e.target.getBoundingClientRect();
    let touch = e.changedTouches[0];
    let centerX = Math.ceil(rect.left + 0.5 * rect.width);
    let centerY = Math.ceil(rect.top + 0.5 * rect.height);
    if (touch.clientX === centerX && touch.clientY === centerY) {
      var _inputRef_current1;
      e.preventDefault();
      (_inputRef_current1 = inputRef.current) === null || _inputRef_current1 === void 0 ? void 0 : _inputRef_current1.focus();
      state.toggle(null, "manual");
      lastEventTime.current = e.timeStamp;
    }
  };
  let focusedItem = state.selectionManager.focusedKey != null && state.isOpen ? state.collection.getItem(state.selectionManager.focusedKey) : void 0;
  var _focusedItem_parentKey;
  let sectionKey = (_focusedItem_parentKey = focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.parentKey) !== null && _focusedItem_parentKey !== void 0 ? _focusedItem_parentKey : null;
  var _state_selectionManager_focusedKey;
  let itemKey = (_state_selectionManager_focusedKey = state.selectionManager.focusedKey) !== null && _state_selectionManager_focusedKey !== void 0 ? _state_selectionManager_focusedKey : null;
  let lastSection = useRef(sectionKey);
  let lastItem = useRef(itemKey);
  useEffect(() => {
    if ($c87311424ea30a05$export$e1865c3bedcd822b() && focusedItem != null && itemKey != null && itemKey !== lastItem.current) {
      let isSelected = state.selectionManager.isSelected(itemKey);
      let section = sectionKey != null ? state.collection.getItem(sectionKey) : null;
      let sectionTitle = (section === null || section === void 0 ? void 0 : section["aria-label"]) || (typeof (section === null || section === void 0 ? void 0 : section.rendered) === "string" ? section.rendered : "") || "";
      var _ref;
      let announcement = stringFormatter.format("focusAnnouncement", {
        isGroupChange: (_ref = section && sectionKey !== lastSection.current) !== null && _ref !== void 0 ? _ref : false,
        groupTitle: sectionTitle,
        groupCount: section ? [
          ...$c5a24bc478652b5f$export$1005530eda016c13(section, state.collection)
        ].length : 0,
        optionText: focusedItem["aria-label"] || focusedItem.textValue || "",
        isSelected
      });
      $319e236875307eab$export$a9b970dcc4ae71a9(announcement);
    }
    lastSection.current = sectionKey;
    lastItem.current = itemKey;
  });
  let optionCount = $453cc9f0df89c0a5$export$77d5aafae4e095b2(state.collection);
  let lastSize = useRef(optionCount);
  let lastOpen = useRef(state.isOpen);
  useEffect(() => {
    let didOpenWithoutFocusedItem = state.isOpen !== lastOpen.current && (state.selectionManager.focusedKey == null || $c87311424ea30a05$export$e1865c3bedcd822b());
    if (state.isOpen && (didOpenWithoutFocusedItem || optionCount !== lastSize.current)) {
      let announcement = stringFormatter.format("countAnnouncement", {
        optionCount
      });
      $319e236875307eab$export$a9b970dcc4ae71a9(announcement);
    }
    lastSize.current = optionCount;
    lastOpen.current = state.isOpen;
  });
  let lastSelectedKey = useRef(state.selectedKey);
  useEffect(() => {
    if ($c87311424ea30a05$export$e1865c3bedcd822b() && state.isFocused && state.selectedItem && state.selectedKey !== lastSelectedKey.current) {
      let optionText = state.selectedItem["aria-label"] || state.selectedItem.textValue || "";
      let announcement = stringFormatter.format("selectedAnnouncement", {
        optionText
      });
      $319e236875307eab$export$a9b970dcc4ae71a9(announcement);
    }
    lastSelectedKey.current = state.selectedKey;
  });
  useEffect(() => {
    if (state.isOpen) return $5e3802645cc19319$export$1c3ebcada18427bf([
      inputRef.current,
      popoverRef.current
    ].filter((element) => element != null));
  }, [
    state.isOpen,
    inputRef,
    popoverRef
  ]);
  $4f58c5f72bcf79f7$export$496315a1608d9602(() => {
    if (!focusedItem && inputRef.current && $d4ee10de306f2510$export$cd4e5573fbe2b576($431fbd86ca7dc216$export$b204af158042fbac(inputRef.current)) === inputRef.current) $55f9b1ae81f22853$export$2b35b76d2e30e129(inputRef.current, null);
  }, [
    focusedItem
  ]);
  return {
    labelProps,
    buttonProps: {
      ...menuTriggerProps,
      ...triggerLabelProps,
      excludeFromTabOrder: true,
      preventFocusOnPress: true,
      onPress,
      onPressStart,
      isDisabled: isDisabled || isReadOnly
    },
    inputProps: $3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, {
      role: "combobox",
      "aria-expanded": menuTriggerProps["aria-expanded"],
      "aria-controls": state.isOpen ? menuProps.id : void 0,
      // TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)
      "aria-autocomplete": "list",
      "aria-activedescendant": focusedItem ? $b1f0cad8af73213b$export$9145995848b05025(state, focusedItem.key) : void 0,
      onTouchEnd,
      // This disable's iOS's autocorrect suggestions, since the combo box provides its own suggestions.
      autoCorrect: "off",
      // This disable's the macOS Safari spell check auto corrections.
      spellCheck: "false"
    }),
    listBoxProps: $3ef42575df84b30b$export$9d1611c77c2fe928(menuProps, listBoxProps, {
      autoFocus: state.focusStrategy || true,
      shouldUseVirtualFocus: true,
      shouldSelectOnPressUp: true,
      shouldFocusOnHover: true,
      linkBehavior: "selection"
    }),
    descriptionProps,
    errorMessageProps,
    isInvalid,
    validationErrors,
    validationDetails
  };
}
function $a9e7382a7d111cb5$export$b453a3bfd4a5fa9e(props) {
  var _collection_getItem;
  let { defaultFilter, menuTrigger = "input", allowsEmptyCollection = false, allowsCustomValue, shouldCloseOnBlur = true } = props;
  let [showAllItems, setShowAllItems] = useState(false);
  let [isFocused, setFocusedState] = useState(false);
  let [focusStrategy, setFocusStrategy] = useState(null);
  let onSelectionChange = (key) => {
    if (props.onSelectionChange) props.onSelectionChange(key);
    if (key === selectedKey) {
      resetInputValue();
      closeMenu();
    }
  };
  var _props_items;
  let { collection, selectionManager, selectedKey, setSelectedKey, selectedItem, disabledKeys } = $a0d645289fe9b86b$export$e7f05e985daf4b5f({
    ...props,
    onSelectionChange,
    items: (_props_items = props.items) !== null && _props_items !== void 0 ? _props_items : props.defaultItems
  });
  let [inputValue, setInputValue] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(props.inputValue, $a9e7382a7d111cb5$var$getDefaultInputValue(props.defaultInputValue, selectedKey, collection) || "", props.onInputChange);
  let [initialSelectedKey] = useState(selectedKey);
  let [initialValue] = useState(inputValue);
  let originalCollection = collection;
  let filteredCollection = useMemo(() => (
    // No default filter if items are controlled.
    props.items != null || !defaultFilter ? collection : $a9e7382a7d111cb5$var$filterCollection(collection, inputValue, defaultFilter)
  ), [
    collection,
    inputValue,
    defaultFilter,
    props.items
  ]);
  let [lastCollection, setLastCollection] = useState(filteredCollection);
  let menuOpenTrigger = useRef("focus");
  let onOpenChange = (open2) => {
    if (props.onOpenChange) props.onOpenChange(open2, open2 ? menuOpenTrigger.current : void 0);
    selectionManager.setFocused(open2);
    if (!open2) selectionManager.setFocusedKey(null);
  };
  let triggerState = $fc909762b330b746$export$61c6a8c84e605fb6({
    ...props,
    onOpenChange,
    isOpen: void 0,
    defaultOpen: void 0
  });
  let open = (focusStrategy2 = null, trigger) => {
    let displayAllItems = trigger === "manual" || trigger === "focus" && menuTrigger === "focus";
    if (allowsEmptyCollection || filteredCollection.size > 0 || displayAllItems && originalCollection.size > 0 || props.items) {
      if (displayAllItems && !triggerState.isOpen && props.items === void 0)
        setShowAllItems(true);
      menuOpenTrigger.current = trigger;
      setFocusStrategy(focusStrategy2);
      triggerState.open();
    }
  };
  let toggle = (focusStrategy2 = null, trigger) => {
    let displayAllItems = trigger === "manual" || trigger === "focus" && menuTrigger === "focus";
    if (!(allowsEmptyCollection || filteredCollection.size > 0 || displayAllItems && originalCollection.size > 0 || props.items) && !triggerState.isOpen) return;
    if (displayAllItems && !triggerState.isOpen && props.items === void 0)
      setShowAllItems(true);
    if (!triggerState.isOpen) menuOpenTrigger.current = trigger;
    toggleMenu(focusStrategy2);
  };
  let updateLastCollection = useCallback(() => {
    setLastCollection(showAllItems ? originalCollection : filteredCollection);
  }, [
    showAllItems,
    originalCollection,
    filteredCollection
  ]);
  let toggleMenu = useCallback((focusStrategy2 = null) => {
    if (triggerState.isOpen) updateLastCollection();
    setFocusStrategy(focusStrategy2);
    triggerState.toggle();
  }, [
    triggerState,
    updateLastCollection
  ]);
  let closeMenu = useCallback(() => {
    if (triggerState.isOpen) {
      updateLastCollection();
      triggerState.close();
    }
  }, [
    triggerState,
    updateLastCollection
  ]);
  let [lastValue, setLastValue] = useState(inputValue);
  let resetInputValue = () => {
    var _collection_getItem2;
    var _collection_getItem_textValue2;
    let itemText = selectedKey != null ? (_collection_getItem_textValue2 = (_collection_getItem2 = collection.getItem(selectedKey)) === null || _collection_getItem2 === void 0 ? void 0 : _collection_getItem2.textValue) !== null && _collection_getItem_textValue2 !== void 0 ? _collection_getItem_textValue2 : "" : "";
    setLastValue(itemText);
    setInputValue(itemText);
  };
  var _props_selectedKey, _ref;
  let lastSelectedKey = useRef((_ref = (_props_selectedKey = props.selectedKey) !== null && _props_selectedKey !== void 0 ? _props_selectedKey : props.defaultSelectedKey) !== null && _ref !== void 0 ? _ref : null);
  var _collection_getItem_textValue;
  let lastSelectedKeyText = useRef(selectedKey != null ? (_collection_getItem_textValue = (_collection_getItem = collection.getItem(selectedKey)) === null || _collection_getItem === void 0 ? void 0 : _collection_getItem.textValue) !== null && _collection_getItem_textValue !== void 0 ? _collection_getItem_textValue : "" : "");
  useEffect(() => {
    var _collection_getItem2;
    if (isFocused && (filteredCollection.size > 0 || allowsEmptyCollection) && !triggerState.isOpen && inputValue !== lastValue && menuTrigger !== "manual") open(null, "input");
    if (!showAllItems && !allowsEmptyCollection && triggerState.isOpen && filteredCollection.size === 0) closeMenu();
    if (selectedKey != null && selectedKey !== lastSelectedKey.current) closeMenu();
    if (inputValue !== lastValue) {
      selectionManager.setFocusedKey(null);
      setShowAllItems(false);
      if (inputValue === "" && (props.inputValue === void 0 || props.selectedKey === void 0)) setSelectedKey(null);
    }
    if (selectedKey !== lastSelectedKey.current && (props.inputValue === void 0 || props.selectedKey === void 0)) resetInputValue();
    else if (lastValue !== inputValue) setLastValue(inputValue);
    var _collection_getItem_textValue2;
    let selectedItemText = selectedKey != null ? (_collection_getItem_textValue2 = (_collection_getItem2 = collection.getItem(selectedKey)) === null || _collection_getItem2 === void 0 ? void 0 : _collection_getItem2.textValue) !== null && _collection_getItem_textValue2 !== void 0 ? _collection_getItem_textValue2 : "" : "";
    if (!isFocused && selectedKey != null && props.inputValue === void 0 && selectedKey === lastSelectedKey.current) {
      if (lastSelectedKeyText.current !== selectedItemText) {
        setLastValue(selectedItemText);
        setInputValue(selectedItemText);
      }
    }
    lastSelectedKey.current = selectedKey;
    lastSelectedKeyText.current = selectedItemText;
  });
  let validation = $e5be200c675c3b3a$export$fc1a364ae1f3ff10({
    ...props,
    value: useMemo(() => ({
      inputValue,
      selectedKey
    }), [
      inputValue,
      selectedKey
    ])
  });
  let revert = () => {
    if (allowsCustomValue && selectedKey == null) commitCustomValue();
    else commitSelection();
  };
  let commitCustomValue = () => {
    lastSelectedKey.current = null;
    setSelectedKey(null);
    closeMenu();
  };
  let commitSelection = () => {
    if (props.selectedKey !== void 0 && props.inputValue !== void 0) {
      var _props_onSelectionChange, _collection_getItem2;
      (_props_onSelectionChange = props.onSelectionChange) === null || _props_onSelectionChange === void 0 ? void 0 : _props_onSelectionChange.call(props, selectedKey);
      var _collection_getItem_textValue2;
      let itemText = selectedKey != null ? (_collection_getItem_textValue2 = (_collection_getItem2 = collection.getItem(selectedKey)) === null || _collection_getItem2 === void 0 ? void 0 : _collection_getItem2.textValue) !== null && _collection_getItem_textValue2 !== void 0 ? _collection_getItem_textValue2 : "" : "";
      setLastValue(itemText);
      closeMenu();
    } else {
      resetInputValue();
      closeMenu();
    }
  };
  const commitValue = () => {
    if (allowsCustomValue) {
      var _collection_getItem2;
      var _collection_getItem_textValue2;
      const itemText = selectedKey != null ? (_collection_getItem_textValue2 = (_collection_getItem2 = collection.getItem(selectedKey)) === null || _collection_getItem2 === void 0 ? void 0 : _collection_getItem2.textValue) !== null && _collection_getItem_textValue2 !== void 0 ? _collection_getItem_textValue2 : "" : "";
      inputValue === itemText ? commitSelection() : commitCustomValue();
    } else
      commitSelection();
  };
  let commit = () => {
    if (triggerState.isOpen && selectionManager.focusedKey != null) {
      if (selectedKey === selectionManager.focusedKey) commitSelection();
      else setSelectedKey(selectionManager.focusedKey);
    } else commitValue();
  };
  let valueOnFocus = useRef(inputValue);
  let setFocused = (isFocused2) => {
    if (isFocused2) {
      valueOnFocus.current = inputValue;
      if (menuTrigger === "focus" && !props.isReadOnly) open(null, "focus");
    } else {
      if (shouldCloseOnBlur) commitValue();
      if (inputValue !== valueOnFocus.current) validation.commitValidation();
    }
    setFocusedState(isFocused2);
  };
  let displayedCollection = useMemo(() => {
    if (triggerState.isOpen) {
      if (showAllItems) return originalCollection;
      else return filteredCollection;
    } else return lastCollection;
  }, [
    triggerState.isOpen,
    originalCollection,
    filteredCollection,
    showAllItems,
    lastCollection
  ]);
  var _props_defaultSelectedKey;
  let defaultSelectedKey = (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : initialSelectedKey;
  var _getDefaultInputValue;
  return {
    ...validation,
    ...triggerState,
    focusStrategy,
    toggle,
    open,
    close: commitValue,
    selectionManager,
    selectedKey,
    defaultSelectedKey,
    setSelectedKey,
    disabledKeys,
    isFocused,
    setFocused,
    selectedItem,
    collection: displayedCollection,
    inputValue,
    defaultInputValue: (_getDefaultInputValue = $a9e7382a7d111cb5$var$getDefaultInputValue(props.defaultInputValue, defaultSelectedKey, collection)) !== null && _getDefaultInputValue !== void 0 ? _getDefaultInputValue : initialValue,
    setInputValue,
    commit,
    revert
  };
}
function $a9e7382a7d111cb5$var$filterCollection(collection, inputValue, filter) {
  return new $a02d57049d202695$export$d085fb9e920b5ca7($a9e7382a7d111cb5$var$filterNodes(collection, collection, inputValue, filter));
}
function $a9e7382a7d111cb5$var$filterNodes(collection, nodes, inputValue, filter) {
  let filteredNode = [];
  for (let node of nodes) {
    if (node.type === "section" && node.hasChildNodes) {
      let filtered = $a9e7382a7d111cb5$var$filterNodes(collection, $c5a24bc478652b5f$export$1005530eda016c13(node, collection), inputValue, filter);
      if ([
        ...filtered
      ].some((node2) => node2.type === "item")) filteredNode.push({
        ...node,
        childNodes: filtered
      });
    } else if (node.type === "item" && filter(node.textValue, inputValue)) filteredNode.push({
      ...node
    });
    else if (node.type !== "item") filteredNode.push({
      ...node
    });
  }
  return filteredNode;
}
function $a9e7382a7d111cb5$var$getDefaultInputValue(defaultInputValue, selectedKey, collection) {
  if (defaultInputValue == null) {
    var _collection_getItem;
    var _collection_getItem_textValue;
    if (selectedKey != null) return (_collection_getItem_textValue = (_collection_getItem = collection.getItem(selectedKey)) === null || _collection_getItem === void 0 ? void 0 : _collection_getItem.textValue) !== null && _collection_getItem_textValue !== void 0 ? _collection_getItem_textValue : "";
  }
  return defaultInputValue;
}
const $d01f2c01039c0eec$export$d414ccceff7063c3 = /* @__PURE__ */ createContext(null);
const $d01f2c01039c0eec$export$c02625b26074192c = /* @__PURE__ */ createContext(null);
const $d01f2c01039c0eec$export$72b9695b8216309a = /* @__PURE__ */ forwardRef(function ComboBox(props, ref) {
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $d01f2c01039c0eec$export$d414ccceff7063c3);
  let { children, isDisabled = false, isInvalid = false, isRequired = false } = props;
  let content = useMemo(() => {
    var _props_items;
    return /* @__PURE__ */ React__default.createElement($eed445e0843c11d0$export$7ff8f37d2d81a48d.Provider, {
      value: {
        items: (_props_items = props.items) !== null && _props_items !== void 0 ? _props_items : props.defaultItems
      }
    }, typeof children === "function" ? children({
      isOpen: false,
      isDisabled,
      isInvalid,
      isRequired,
      defaultChildren: null
    }) : children);
  }, [
    children,
    isDisabled,
    isInvalid,
    isRequired,
    props.items,
    props.defaultItems
  ]);
  return /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$bf788dd355e3a401, {
    content
  }, (collection) => /* @__PURE__ */ React__default.createElement($d01f2c01039c0eec$var$ComboBoxInner, {
    props,
    collection,
    comboBoxRef: ref
  }));
});
const $d01f2c01039c0eec$var$CLEAR_CONTEXTS = [
  $01b77f81d0f07f68$export$75b6ee27786ba447,
  $d2b4bc8c273e7be6$export$24d547caef80ccd1,
  $3985021b0ad6602f$export$37fb8590cf2c088c,
  $a049562f99e7db0e$export$f9c6924e160136d1,
  $514c0188e459b4c0$export$9afb8bc826b033ea
];
function $d01f2c01039c0eec$var$ComboBoxInner({ props, collection, comboBoxRef: ref }) {
  let { name, formValue = "key", allowsCustomValue } = props;
  if (allowsCustomValue) formValue = "text";
  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 { contains } = $bb77f239b46e8c72$export$3274cf84b703fff({
    sensitivity: "base"
  });
  let state = $a9e7382a7d111cb5$export$b453a3bfd4a5fa9e({
    defaultFilter: props.defaultFilter || contains,
    ...props,
    // If props.items isn't provided, rely on collection filtering (aka listbox.items is provided or defaultItems provided to Combobox)
    items: props.items,
    children: void 0,
    collection,
    validationBehavior
  });
  let buttonRef = useRef(null);
  let inputRef = useRef(null);
  let listBoxRef = useRef(null);
  let popoverRef = useRef(null);
  let [labelRef, label] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
  let { buttonProps, inputProps, listBoxProps, labelProps, descriptionProps, errorMessageProps, ...validation } = $c350ade66beef0af$export$8c18d1b4f7232bbf({
    ...$64fa3d84918910a7$export$ef03459518577ad4(props),
    label,
    inputRef,
    buttonRef,
    listBoxRef,
    popoverRef,
    name: formValue === "text" ? name : void 0,
    validationBehavior
  }, state);
  let [menuWidth, setMenuWidth] = useState(null);
  let onResize = useCallback(() => {
    if (inputRef.current) {
      var _buttonRef_current;
      let buttonRect = (_buttonRef_current = buttonRef.current) === null || _buttonRef_current === void 0 ? void 0 : _buttonRef_current.getBoundingClientRect();
      let inputRect = inputRef.current.getBoundingClientRect();
      let minX = buttonRect ? Math.min(buttonRect.left, inputRect.left) : inputRect.left;
      let maxX = buttonRect ? Math.max(buttonRect.right, inputRect.right) : inputRect.right;
      setMenuWidth(maxX - minX + "px");
    }
  }, [
    buttonRef,
    inputRef,
    setMenuWidth
  ]);
  $9daab02d461809db$export$683480f191c0e3ea({
    ref: inputRef,
    onResize
  });
  let renderPropsState = useMemo(() => ({
    isOpen: state.isOpen,
    isDisabled: props.isDisabled || false,
    isInvalid: validation.isInvalid || false,
    isRequired: props.isRequired || false
  }), [
    state.isOpen,
    props.isDisabled,
    validation.isInvalid,
    props.isRequired
  ]);
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    ...props,
    values: renderPropsState,
    defaultClassName: "react-aria-ComboBox"
  });
  let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    global: true
  });
  delete DOMProps.id;
  var _state_selectedKey;
  return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $d01f2c01039c0eec$export$c02625b26074192c,
        state
      ],
      [
        $01b77f81d0f07f68$export$75b6ee27786ba447,
        {
          ...labelProps,
          ref: labelRef
        }
      ],
      [
        $d2b4bc8c273e7be6$export$24d547caef80ccd1,
        {
          ...buttonProps,
          ref: buttonRef,
          isPressed: state.isOpen
        }
      ],
      [
        $3985021b0ad6602f$export$37fb8590cf2c088c,
        {
          ...inputProps,
          ref: inputRef
        }
      ],
      [
        $de32f1b87079253c$export$d2f961adcb0afbe,
        state
      ],
      [
        $07b14b47974efb58$export$9b9a0cd73afb7ca4,
        {
          ref: popoverRef,
          triggerRef: inputRef,
          scrollRef: listBoxRef,
          placement: "bottom start",
          isNonModal: true,
          trigger: "ComboBox",
          style: {
            "--trigger-width": menuWidth
          },
          clearContexts: $d01f2c01039c0eec$var$CLEAR_CONTEXTS
        }
      ],
      [
        $eed445e0843c11d0$export$7ff8f37d2d81a48d,
        {
          ...listBoxProps,
          ref: listBoxRef
        }
      ],
      [
        $eed445e0843c11d0$export$7c5906fe4f1f2af2,
        state
      ],
      [
        $514c0188e459b4c0$export$9afb8bc826b033ea,
        {
          slots: {
            description: descriptionProps,
            errorMessage: errorMessageProps
          }
        }
      ],
      [
        $a049562f99e7db0e$export$f9c6924e160136d1,
        {
          isInvalid: validation.isInvalid,
          isDisabled: props.isDisabled || false
        }
      ],
      [
        $ee014567cb39d3f0$export$ff05c3ac10437e03,
        validation
      ]
    ]
  }, /* @__PURE__ */ React__default.createElement("div", {
    ...DOMProps,
    ...renderProps,
    ref,
    slot: props.slot || void 0,
    "data-focused": state.isFocused || void 0,
    "data-open": state.isOpen || void 0,
    "data-disabled": props.isDisabled || void 0,
    "data-invalid": validation.isInvalid || void 0,
    "data-required": props.isRequired || void 0
  }), name && formValue === "key" && /* @__PURE__ */ React__default.createElement("input", {
    type: "hidden",
    name,
    form: props.form,
    value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ""
  }));
}
/**
 * Component that allows URL selection, with a suggestionList of suggestions and type-to-search.
 *
 * @component
 * @param {Object} props - Component props.
 * @param {string} [props.url] - The current URL.
 * @param {Function} [props.onChange] - Function to run when the URL changes.
 * @param {string} [props.label] - Label to display.
 * @param {string} [props.subtitle] - Subtitle to display.
 * @param {string} [props.help] - Help text to display below the input.
 * @param {string} [props.placeholder] - Placeholder to show in the input field.
 * @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display to the right of the label.
 * @param {JSX.Element} [props.icon=icons.globe] - Icon to display in the label.
 * @param {JSX.Element} [props.removeIcon=icons.clearAlt] - Icon to display in the input's clear button.
 * @param {boolean} [props.disabled=false] - If `true`, the input is disabled.
 * @param {Function} [props.fetchSuggestions] - A function that fetches suggestions based on the input value.
 * @param {string} [props.className] - Classes to pass to the input field.
 * @param {number} [props.inputDebounceDelay=500] - The delay in milliseconds before the input value is considered final.
 * @param {Function} [props.suggestionTypeIconOverride] - Allows overriding the default icon for the suggestion type, e.g. when using CPTs. Should be in the format: `(type) => icon or React component`.
 * @param {boolean} [props.showSuggestionsWhenEmpty] - If `true`, the suggestion list will be shown when down arrow is pressed even the input is empty.
 * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
 *
 * @returns {JSX.Element} The LinkInput component.
 *
 * @example
 * <LinkInput
 * 	url={url}
 * 	onChange={setUrl}
 * />
 *
 * @preserve
 */
const LinkInput = (props) => {
  const {
    url = "",
    onChange,
    label = __("Link", "eightshift-ui-components"),
    subtitle,
    help,
    actions,
    placeholder = __("Type to search or enter URL", "eightshift-ui-components"),
    icon = icons.globe,
    removeIcon = icons.clearAlt,
    disabled = false,
    suggestionTypeIconOverride,
    showSuggestionsWhenEmpty,
    fetchSuggestions,
    className,
    hidden
  } = props;
  const canShowSuggestions = typeof fetchSuggestions !== "undefined";
  const triggerRef = useRef(null);
  let shouldShowSuggestions = true;
  if (!canShowSuggestions || !showSuggestionsWhenEmpty && url.length < 1) {
    shouldShowSuggestions = false;
  } else {
    shouldShowSuggestions = !(showSuggestionsWhenEmpty !== true && url.trim().length < 3 || url.startsWith("/") || url.startsWith("#") || url.startsWith(":") || url.startsWith("mailto") || url.startsWith("tel") || url.startsWith("http") || url.startsWith("www"));
  }
  const suggestionList = $f86e6c1ec7da6ebb$export$bc3384a35de93d66({
    async load({ signal }) {
      if (disabled || !canShowSuggestions || !shouldShowSuggestions) {
        return {
          items: []
        };
      }
      const items = await fetchSuggestions(url, signal);
      return {
        items: items ?? []
      };
    }
  });
  if (hidden) {
    return null;
  }
  return /* @__PURE__ */ jsxs(
    $d01f2c01039c0eec$export$72b9695b8216309a,
    {
      items: suggestionList.items,
      inputValue: url,
      onInputChange: (value) => {
        onChange({ url: value, isAnchor: value?.includes("#") });
        if (shouldShowSuggestions) {
          suggestionList.reload();
        }
      },
      allowsCustomValue: true,
      allowsEmptyCollection: true,
      isDisabled: disabled,
      children: [
        /* @__PURE__ */ jsx(
          BaseControl,
          {
            as: $01b77f81d0f07f68$export$b04be29aa201d4f5,
            icon,
            label,
            subtitle,
            actions,
            labelAs: $01b77f81d0f07f68$export$b04be29aa201d4f5,
            help,
            children: /* @__PURE__ */ jsxs(
              $a049562f99e7db0e$export$eb2fcfdbd7ba97d4,
              {
                className: "es:relative",
                ref: triggerRef,
                children: [
                  /* @__PURE__ */ jsx(
                    $3985021b0ad6602f$export$f5b8910cec6cf069,
                    {
                      placeholder: disabled ? null : placeholder,
                      className: clsx(
                        "es:min-h-10 es:w-full es:rounded-10 es:border es:border-secondary-300 es:py-2 es:pl-2 es:pr-1 es:text-sm es:shadow-sm es:transition es:selection:bg-accent-500/20 es:selection:text-accent-950 es:bg-white",
                        "es:any-focus:outline-hidden",
                        "es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
                        "es:focus-visible:border-accent-500",
                        "es:inset-ring es:inset-ring-secondary-100",
                        "es:disabled:shadow-none! es:disabled:border-secondary-200 es:disabled:bg-secondary-50 es:disabled:text-secondary-500 es:disabled:cursor-default es:readonly:bg-secondary-50",
                        "es:not-readonly:focus:shadow-md",
                        "es:[&::-webkit-search-cancel-button]:hidden",
                        url?.length > 0 && "es:pr-10",
                        className
                      )
                    }
                  ),
                  /* @__PURE__ */ jsx(
                    AnimatedVisibility,
                    {
                      visible: !disabled && url?.length > 0,
                      className: "es:absolute es:inset-y-1 es:right-1",
                      transition: "fade",
                      children: /* @__PURE__ */ jsxs(
                        $d2b4bc8c273e7be6$export$353f5b6fc5456de1,
                        {
                          slot: null,
                          onPress: () => {
                            onChange({ url: void 0, isAnchor: false });
                          },
                          className: "es:any-focus:outline-hidden",
                          children: [
                            !(shouldShowSuggestions && suggestionList.isLoading) && /* @__PURE__ */ jsx(Tooltip, { text: __("Clear", "eightshift-ui-components"), children: /* @__PURE__ */ jsx(
                              "div",
                              {
                                className: clsx(
                                  "es:flex es:size-8 es:items-center es:justify-center es:rounded-md es:bg-white/85 es:text-secondary-600 es:backdrop-blur es:transition es:cursor-pointer",
                                  "es:hover:bg-red-600/5 es:hover:text-red-600",
                                  "es:icon:size-6"
                                ),
                                children: removeIcon
                              }
                            ) }),
                            shouldShowSuggestions && suggestionList.isLoading && /* @__PURE__ */ jsx("div", { className: "es:p-1.5", children: cloneElement(icons.loader, { className: "es:text-accent-600! es:stroke-2 es:motion-preset-spin es:motion-duration-1500" }) })
                          ]
                        }
                      )
                    }
                  )
                ]
              }
            )
          }
        ),
        canShowSuggestions && shouldShowSuggestions && /* @__PURE__ */ jsxs(
          $07b14b47974efb58$export$5b6b19405a83ff9d,
          {
            "aria-label": __("URL suggestions", "eightshift-ui-components"),
            className: ({ isEntering, isExiting }) => clsx(
              "es:border es:rounded-xl es:border-secondary-300 es:bg-white es:shadow-lg es:outline-hidden es:min-w-72",
              "es:motion-safe:motion-duration-200 es:motion-safe:motion-ease-spring-bouncy",
              "es:placement-bottom:origin-top-left es:placement-top:origin-bottom-left",
              (isEntering || !(suggestionList.isLoading || !shouldShowSuggestions)) && "es:motion-safe:motion-scale-in-95 es:motion-opacity-in-0",
              (isEntering || !(suggestionList.isLoading || !shouldShowSuggestions)) && "es:motion-safe:placement-top:motion-translate-y-in-[5%] es:motion-safe:placement-bottom:motion-translate-y-in-[-5%]",
              isExiting && "es:motion-safe:motion-scale-out-95 es:motion-opacity-out-0",
              isExiting && "es:motion-safe:placement-top:motion-translate-y-out-[5%] es:motion-safe:placement-bottom:motion-translate-y-out-[-5%]",
              (suggestionList.isLoading || !shouldShowSuggestions) && "es:invisible"
            ),
            offset: 3,
            style: {
              width: `${triggerRef.current?.offsetWidth}px`
            },
            children: [
              shouldShowSuggestions && !suggestionList.isLoading && suggestionList.items.length === 0 && /* @__PURE__ */ jsx(
                RichLabel,
                {
                  icon: icons.searchEmpty,
                  label: __("No results", "eightshift-ui-components"),
                  subtitle: __("Try a different search term", "eightshift-ui-components"),
                  className: "es:min-h-14 es:p-2 es:w-fit es:mx-auto",
                  iconClassName: "es:text-accent-700 es:icon:size-7!",
                  noColor: true
                }
              ),
              suggestionList.items.length > 0 && !suggestionList.isLoading && /* @__PURE__ */ jsxs(Fragment, { children: [
                /* @__PURE__ */ jsx($eed445e0843c11d0$export$41f133550aa26f48, { className: "es:space-y-1 es:p-1", children: (item) => {
                  const {
                    label: title,
                    value: url2,
                    metadata: { subtype: rawSubtype }
                  } = item;
                  const subtype = rawSubtype ?? "page";
                  let typeIcon = icons.file;
                  if (subtype.toLowerCase() === "url") {
                    typeIcon = icons.externalLink;
                  } else if (subtype.toLowerCase() === "attachment") {
                    typeIcon = icons.file;
                  } else if (subtype.toLowerCase() === "category") {
                    typeIcon = icons.layoutAlt;
                  } else if (subtype.toLowerCase() === "internal") {
                    typeIcon = icons.anchor;
                  } else if (subtype.toLowerCase() === "eightshift-forms") {
                    typeIcon = icons.formAlt;
                  }
                  if (suggestionTypeIconOverride) {
                    const overrideIcon = suggestionTypeIconOverride(subtype);
                    if (overrideIcon) {
                      typeIcon = overrideIcon;
                    }
                  }
                  return /* @__PURE__ */ jsx(
                    $eed445e0843c11d0$export$a11e76429ed99b4,
                    {
                      id: item.value,
                      className: clsx(
                        "es:rounded-10 es:p-1 es:text-sm es:transition",
                        "es:hover:border-secondary-300 es:hover:bg-secondary-100",
                        "es:focus-visible:border-secondary-300 es:focus-visible:bg-secondary-100",
                        "selected:es:bg-accent-600/10 selected:es:text-accent-900 selected:focus-visible:es:bg-accent-600/15"
                      ),
                      textValue: url2,
                      children: /* @__PURE__ */ jsx(
                        RichLabel,
                        {
                          icon: typeIcon,
                          label: title,
                          subtitle: url2?.replace(location.origin, "").replace(/\/$/, ""),
                          noColor: true
                        }
                      )
                    }
                  );
                } }),
                /* @__PURE__ */ jsx(
                  Spacer,
                  {
                    border: true,
                    className: "es:opacity-40"
                  }
                ),
                /* @__PURE__ */ jsxs("div", { className: "es:flex es:flex-wrap es:items-center es:justify-end es:gap-x-3 es:gap-y-1.5 es:p-2 es:text-sm es:text-secondary-500", children: [
                  /* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1", children: [
                    /* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-radial es:from-secondary-100 es:to-secondary-200 es:font-mono es:text-xs es:text-secondary-600", children: "↓" }),
                    /* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-radial es:from-secondary-100 es:to-secondary-200 es:font-mono es:text-xs es:text-secondary-600", children: "↑" }),
                    __("Navigate", "eightshift-ui-components")
                  ] }),
                  /* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1", children: [
                    /* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-radial es:from-secondary-100 es:to-secondary-200 es:font-mono es:text-xs es:text-secondary-600", children: "↵" }),
                    __("Select", "eightshift-ui-components")
                  ] }),
                  /* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1", children: [
                    /* @__PURE__ */ jsx("kbd", { className: "es:flex es:h-4 es:items-center es:justify-center es:rounded es:bg-radial es:from-secondary-100 es:to-secondary-200 es:font-mono es:text-xs es:tracking-tighter es:px-0.5 es:text-secondary-600", children: "Esc" }),
                    __("Hide", "eightshift-ui-components")
                  ] })
                ] })
              ] })
            ]
          }
        )
      ]
    }
  );
};
export {
  LinkInput
};
