diff --git a/.github/config/changelog.js b/.github/config/changelog.cjs similarity index 97% rename from .github/config/changelog.js rename to .github/config/changelog.cjs index 8618391..49223c4 100644 --- a/.github/config/changelog.js +++ b/.github/config/changelog.cjs @@ -13,5 +13,5 @@ module.exports = { { types: ['other'], label: 'Autres changements' }, ], - excludeTypes: ['other', 'perf', 'test', 'tests', 'style', 'chore', 'doc', 'docs'], + excludeTypes: ['other', 'perf', 'test', 'tests', 'style', 'chore', 'build', 'ci'], }; \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92ee5bf..b22104d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,37 +1,55 @@ -name: Publish package to Npmjs and notify on Mattermost +name: Publish documentation on github pages and notify on Mattermost on: push: - tags: - - "v[0-9]+.[0-9]+.[0-9]+" + branches: + - main + env: - DEPLOYMENT_URL: https://datasupr.staging.dataesr.ovh - MM_NOTIFICATION_CHANNEL: "bots" + DEPLOYMENT_URL: https://dataesr.github.io/dsfr-plus/ + MM_NOTIFICATION_CHANNEL: bots permissions: contents: read pages: write id-token: write +# Allow one concurrent deployment +concurrency: + group: 'pages' + cancel-in-progress: true + jobs: - publish: + deploy-examples: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + cache: 'npm' + - name: Install dependencies and Build + run: npm ci --silent && npm run build && cd ./example-ts && npm run build + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - node-version: "20.x" - registry-url: "https://registry.npmjs.org" - scope: "@dataesr" - - run: npm ci - - run: npm run build - - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # Upload build repository + path: './example-ts/dist' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + notify: - needs: publish + needs: + - deploy-examples if: always() runs-on: ubuntu-latest steps: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index d90220f..64b6588 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -1,56 +1,24 @@ -name: Deploy on Github Pages +name: Build test for staging push on: push: branches: - staging - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: env: - DEPLOYMENT_URL: https://datasupr.staging.dataesr.ovh - MM_NOTIFICATION_CHANNEL: 'bots' - -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: 'pages' - cancel-in-progress: true + MM_NOTIFICATION_CHANNEL: bots jobs: - deploy-examples: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + build-test: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: '20.x' - cache: 'npm' - - name: Install dependencies and Build - run: npm ci --silent && npm run build && cd ./example-ts && npm run build - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload build repository - path: './example-ts/dist' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - uses: actions/checkout@v4 + - run: npm ci + - run: npm run build notify: - needs: deploy-examples + needs: build-test if: always() runs-on: ubuntu-latest steps: @@ -59,4 +27,3 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN}} mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }} mattermost_channel: ${{ env.MM_NOTIFICATION_CHANNEL}} - deployment_url: ${{ env.DEPLOYMENT_URL }} \ No newline at end of file diff --git a/.github/workflows/tags.yml b/.github/workflows/tags.yml new file mode 100644 index 0000000..7baecc9 --- /dev/null +++ b/.github/workflows/tags.yml @@ -0,0 +1,71 @@ +name: Publish package to Npmjs and notify on Mattermost + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +env: + DEPLOYMENT_URL: https://www.npmjs.com/package/@dataesr/dsfr-plus + MM_NOTIFICATION_CHANNEL: bots + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version: "20.x" + registry-url: "https://registry.npmjs.org" + scope: "@dataesr" + - run: npm ci + - run: npm run build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + release: + name: Create new Github release + runs-on: ubuntu-latest + needs: publish + steps: + - name: 🏁 Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: đŸ·ïž Get tag + id: tag + run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - name: Create changelog text + id: changelog + uses: loopwerk/tag-changelog@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config_file: .github/config/changelog.cjs + + - name: 📩 Create release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ steps.tag.outputs.tag }} + body: ${{ steps.changelog.outputs.changes }} + + notify: + needs: + - publish + - release + if: always() + runs-on: ubuntu-latest + steps: + - uses: dataesr/mm-notifier-action@v1.0.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN}} + mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }} + mattermost_channel: ${{ env.MM_NOTIFICATION_CHANNEL}} + deployment_url: ${{ env.DEPLOYMENT_URL }} \ No newline at end of file diff --git a/dist/dsfr-plus.js b/dist/dsfr-plus.js new file mode 100644 index 0000000..5d8e94c --- /dev/null +++ b/dist/dsfr-plus.js @@ -0,0 +1,9210 @@ +import './style.css'; +import { jsxs as O, jsx as m, Fragment as In } from "react/jsx-runtime"; +import x from "classnames"; +import * as vt from "react"; +import Q, { useState as Z, useEffect as W, forwardRef as me, useId as ie, useRef as I, useCallback as te, isValidElement as $e, Children as Ot, Fragment as xn, createContext as Rt, useMemo as ne, useContext as Se, useReducer as ss, createElement as ir, cloneElement as _e } from "react"; +import Bn, { flushSync as us, createPortal as as } from "react-dom"; +const cs = { + config: { attributes: !0, childList: !1, subtree: !1 } +}; +function ds(t, e, n = cs) { + const [r, o] = Z(null); + W(() => { + const i = new MutationObserver(e); + o(i); + }, [e, n, o]), W(() => { + if (!r || !t) + return; + const { config: i } = n; + return r.observe(t, i), () => { + r && r.disconnect(); + }; + }, [r, t, n]); +} +function pt(t, e) { + t && e.forEach((n) => { + typeof n == "function" ? n(t) : n && (n.current = t); + }); +} +const fs = me(({ + title: t, + titleAs: e = "h3", + children: n, + className: r, + css: o = {}, + defaultExpanded: i = !1, + ...l +}, s) => { + const u = ie(), a = I(null), [c, f] = Z(!!i), p = te( + (d) => { + var $; + if (d.find((h) => h.attributeName === "aria-expanded") && (($ = a == null ? void 0 : a.current) != null && $.attributes)) { + const h = a.current.attributes.getNamedItem("aria-expanded"); + f(h ? h.value === "true" : !1); + } + }, + [a] + ); + return ds(a == null ? void 0 : a.current, p), /* @__PURE__ */ O("section", { className: x("fr-accordion", r), children: [ + /* @__PURE__ */ m( + e, + { + className: x("fr-accordion__title", o.title), + children: /* @__PURE__ */ m( + "button", + { + ...l, + ref: (d) => pt(d, [s, a]), + className: x("fr-accordion__btn", o.button), + "aria-expanded": i, + "aria-controls": u, + children: $e(t) || typeof t == "string" ? t : typeof t == "function" ? t(c) : null + } + ) + } + ), + /* @__PURE__ */ m("div", { className: "fr-collapse", id: u, children: n }) + ] }); +}); +function de(t, e) { + return Ot.toArray(t).filter((r) => $e(r) && r.type === e); +} +function et(t, e) { + return Ot.toArray(t).filter((n) => $e(n) && e.includes(n.type)); +} +function ps(t, e) { + return Ot.toArray(t).filter((n) => $e(n) && !e.includes(n.type)); +} +const ud = ({ children: t, className: e, ...n }) => { + const r = ie(); + return /* @__PURE__ */ m("div", { className: x("fr-accordions-group", e), ...n, children: de(t, fs).map((o, i) => /* @__PURE__ */ m(xn, { children: o }, `${r}-d${i}`)) }); +}, ad = me(({ + className: t, + closeMode: e = "disallow", + description: n, + size: r, + onClose: o, + title: i, + css: l = {}, + titleAs: s = "h3", + variant: u = "info", + ...a +}, c) => { + const f = I(null), p = (d) => { + var v; + d.preventDefault(), (v = f.current) == null || v.remove(), o && o(d); + }; + return /* @__PURE__ */ O( + "div", + { + ref: (d) => pt(d, [c, f]), + className: x(`fr-alert fr-alert--${u}`, { "fr-alert--sm": r === "sm" }, t), + ...a, + children: [ + i && /* @__PURE__ */ m(s, { className: x("fr-alert__title", l.title), children: i }), + n && /* @__PURE__ */ m("p", { className: x(l.description), children: n }), + e === "uncontrolled" && /* @__PURE__ */ m("button", { onClick: p, className: x("fr-btn--close fr-btn", l.button), children: "Masquer le message" }), + e === "controlled" && /* @__PURE__ */ m("button", { onClick: o, className: x("fr-link--close fr-link", l.button), children: "Masquer le message" }) + ] + } + ); +}); +function bs(t, e) { + if (e.has(t)) + throw new TypeError("Cannot initialize the same private elements twice on an object"); +} +function ms(t, e, n) { + bs(t, e), e.set(t, n); +} +function tt(t, e, n) { + let [r, o] = Z(t || e), i = I(t !== void 0), l = t !== void 0; + W(() => { + let a = i.current; + a !== l && console.warn(`WARN: A component changed from ${a ? "controlled" : "uncontrolled"} to ${l ? "controlled" : "uncontrolled"}.`), i.current = l; + }, [ + l + ]); + let s = l ? t : r, u = te((a, ...c) => { + let f = (p, ...d) => { + n && (Object.is(s, p) || n(p, ...d)), l || (s = p); + }; + typeof a == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), o((d, ...v) => { + let $ = a(l ? s : d, ...v); + return f($, ...c), l ? d : $; + })) : (l || o(a), f(a, ...c)); + }, [ + l, + s, + n + ]); + return [ + s, + u + ]; +} +function Cn(t, e = -1 / 0, n = 1 / 0) { + return Math.min(Math.max(t, e), n); +} +const no = { + badInput: !1, + customError: !1, + patternMismatch: !1, + rangeOverflow: !1, + rangeUnderflow: !1, + stepMismatch: !1, + tooLong: !1, + tooShort: !1, + typeMismatch: !1, + valueMissing: !1, + valid: !0 +}, ro = { + ...no, + customError: !0, + valid: !1 +}, nt = { + isInvalid: !1, + validationDetails: no, + validationErrors: [] +}, vs = Rt({}), En = "__formValidationState" + Date.now(); +function On(t) { + if (t[En]) { + let { realtimeValidation: e, displayValidation: n, updateValidation: r, resetValidation: o, commitValidation: i } = t[En]; + return { + realtimeValidation: e, + displayValidation: n, + updateValidation: r, + resetValidation: o, + commitValidation: i + }; + } + return hs(t); +} +function hs(t) { + let { isInvalid: e, validationState: n, name: r, value: o, builtinValidation: i, validate: l, validationBehavior: s = "aria" } = t; + n && (e || (e = n === "invalid")); + let u = e ? { + isInvalid: !0, + validationErrors: [], + validationDetails: ro + } : null, a = ne(() => lr(gs(l, o)), [ + l, + o + ]); + i != null && i.validationDetails.valid && (i = null); + let c = Se(vs), f = ne(() => r ? Array.isArray(r) ? r.flatMap((E) => Pn(c[E])) : Pn(c[r]) : [], [ + c, + r + ]), [p, d] = Z(c), [v, $] = Z(!1); + c !== p && (d(c), $(!1)); + let h = ne(() => lr(v ? [] : f), [ + v, + f + ]), _ = I(nt), [w, S] = Z(nt), K = I(nt), g = () => { + if (!N) + return; + R(!1); + let E = a || i || _.current; + Qt(E, K.current) || (K.current = E, S(E)); + }, [N, R] = Z(!1); + return W(g), { + realtimeValidation: u || h || a || i || nt, + displayValidation: s === "native" ? u || h || w : u || h || a || i || w, + updateValidation(E) { + s === "aria" && !Qt(w, E) ? S(E) : _.current = E; + }, + resetValidation() { + let E = nt; + Qt(E, K.current) || (K.current = E, S(E)), s === "native" && R(!1), $(!0); + }, + commitValidation() { + s === "native" && R(!0), $(!0); + } + }; +} +function Pn(t) { + return t ? Array.isArray(t) ? t : [ + t + ] : []; +} +function gs(t, e) { + if (typeof t == "function") { + let n = t(e); + if (n && typeof n != "boolean") + return Pn(n); + } + return []; +} +function lr(t) { + return t.length ? { + isInvalid: !0, + validationErrors: t, + validationDetails: ro + } : null; +} +function Qt(t, e) { + return t === e ? !0 : t && e && t.isInvalid === e.isInvalid && t.validationErrors.length === e.validationErrors.length && t.validationErrors.every((n, r) => n === e.validationErrors[r]) && Object.entries(t.validationDetails).every(([n, r]) => e.validationDetails[n] === r); +} +function oo(t) { + return null; +} +oo.getCollectionNode = function* (e, n) { + let { childItems: r, title: o, children: i } = e, l = e.title || e.children, s = e.textValue || (typeof l == "string" ? l : "") || e["aria-label"] || ""; + !s && !(n != null && n.suppressTextValueWarning) && console.warn(" with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."), yield { + type: "item", + props: e, + rendered: l, + textValue: s, + "aria-label": e["aria-label"], + hasChildNodes: $s(e), + *childNodes() { + if (r) + for (let u of r) + yield { + type: "item", + value: u + }; + else if (o) { + let u = []; + Q.Children.forEach(i, (a) => { + u.push({ + type: "item", + element: a + }); + }), yield* u; + } + } + }; +}; +function $s(t) { + return t.hasChildItems != null ? t.hasChildItems : !!(t.childItems || t.title && Q.Children.count(t.children) > 0); +} +let Vt = oo; +function io(t) { + return null; +} +io.getCollectionNode = function* (e) { + let { children: n, title: r, items: o } = e; + yield { + type: "section", + props: e, + hasChildNodes: !0, + rendered: r, + "aria-label": e["aria-label"], + *childNodes() { + if (typeof n == "function") { + if (!o) + throw new Error("props.children was a function but props.items is missing"); + for (let i of o) + yield { + type: "item", + value: i, + renderer: n + }; + } else { + let i = []; + Q.Children.forEach(n, (l) => { + i.push({ + type: "item", + element: l + }); + }), yield* i; + } + } + }; +}; +let lo = io; +class ys { + build(e, n) { + return this.context = n, sr(() => this.iterateCollection(e)); + } + *iterateCollection(e) { + let { children: n, items: r } = e; + if (typeof n == "function") { + if (!r) + throw new Error("props.children was a function but props.items is missing"); + for (let o of e.items) + yield* this.getFullNode({ + value: o + }, { + renderer: n + }); + } else { + let o = []; + Q.Children.forEach(n, (l) => { + o.push(l); + }); + let i = 0; + for (let l of o) { + let s = this.getFullNode({ + element: l, + index: i + }, {}); + for (let u of s) + i++, yield u; + } + } + } + getKey(e, n, r, o) { + if (e.key != null) + return e.key; + if (n.type === "cell" && n.key != null) + return `${o}${n.key}`; + let i = n.value; + if (i != null) { + var l; + let s = (l = i.key) !== null && l !== void 0 ? l : i.id; + if (s == null) + throw new Error("No key found for item"); + return s; + } + return o ? `${o}.${n.index}` : `$.${n.index}`; + } + getChildState(e, n) { + return { + renderer: n.renderer || e.renderer + }; + } + *getFullNode(e, n, r, o) { + let i = e.element; + if (!i && e.value && n && n.renderer) { + let u = this.cache.get(e.value); + if (u && (!u.shouldInvalidate || !u.shouldInvalidate(this.context))) { + u.index = e.index, u.parentKey = o ? o.key : null, yield u; + return; + } + i = n.renderer(e.value); + } + if (Q.isValidElement(i)) { + let u = i.type; + if (typeof u != "function" && typeof u.getCollectionNode != "function") { + let p = typeof i.type == "function" ? i.type.name : i.type; + throw new Error(`Unknown element <${p}> in collection.`); + } + let a = u.getCollectionNode(i.props, this.context), c = e.index, f = a.next(); + for (; !f.done && f.value; ) { + let p = f.value; + e.index = c; + let d = p.key; + d || (d = p.element ? null : this.getKey(i, e, n, r)); + let $ = [ + ...this.getFullNode({ + ...p, + key: d, + index: c, + wrapper: xs(e.wrapper, p.wrapper) + }, this.getChildState(n, p), r ? `${r}${i.key}` : i.key, o) + ]; + for (let h of $) { + if (h.value = p.value || e.value, h.value && this.cache.set(h.value, h), e.type && h.type !== e.type) + throw new Error(`Unsupported type <${en(h.type)}> in <${en(o.type)}>. Only <${en(e.type)}> is supported.`); + c++, yield h; + } + f = a.next($); + } + return; + } + if (e.key == null) + return; + let l = this, s = { + type: e.type, + props: e.props, + key: e.key, + parentKey: o ? o.key : null, + value: e.value, + level: o ? o.level + 1 : 0, + index: e.index, + rendered: e.rendered, + textValue: e.textValue, + "aria-label": e["aria-label"], + wrapper: e.wrapper, + shouldInvalidate: e.shouldInvalidate, + hasChildNodes: e.hasChildNodes, + childNodes: sr(function* () { + if (!e.hasChildNodes) + return; + let u = 0; + for (let a of e.childNodes()) { + a.key != null && (a.key = `${s.key}${a.key}`), a.index = u; + let c = l.getFullNode(a, l.getChildState(n, a), s.key, s); + for (let f of c) + u++, yield f; + } + }) + }; + yield s; + } + constructor() { + this.cache = /* @__PURE__ */ new WeakMap(); + } +} +function sr(t) { + let e = [], n = null; + return { + *[Symbol.iterator]() { + for (let r of e) + yield r; + n || (n = t()); + for (let r of n) + e.push(r), yield r; + } + }; +} +function xs(t, e) { + if (t && e) + return (n) => t(e(n)); + if (t) + return t; + if (e) + return e; +} +function en(t) { + return t[0].toUpperCase() + t.slice(1); +} +function so(t, e, n) { + let r = ne(() => new ys(), []), { children: o, items: i, collection: l } = t; + return ne(() => { + if (l) + return l; + let u = r.build({ + children: o, + items: i + }, n); + return e(u); + }, [ + r, + o, + i, + l, + n, + e + ]); +} +function zt(t, e) { + return typeof e.getChildren == "function" ? e.getChildren(t.key) : t.childNodes; +} +function Cs(t) { + return Es(t, 0); +} +function Es(t, e) { + if (e < 0) + return; + let n = 0; + for (let r of t) { + if (n === e) + return r; + n++; + } +} +function tn(t, e, n) { + if (e.parentKey === n.parentKey) + return e.index - n.index; + let r = [ + ...ur(t, e), + e + ], o = [ + ...ur(t, n), + n + ], i = r.slice(0, o.length).findIndex((l, s) => l !== o[s]); + return i !== -1 ? (e = r[i], n = o[i], e.index - n.index) : r.findIndex((l) => l === n) >= 0 ? 1 : (o.findIndex((l) => l === e) >= 0, -1); +} +function ur(t, e) { + let n = []; + for (; (e == null ? void 0 : e.parentKey) != null; ) + e = t.getItem(e.parentKey), n.unshift(e); + return n; +} +const ar = /* @__PURE__ */ new WeakMap(); +function Rn(t) { + let e = ar.get(t); + if (e != null) + return e; + e = 0; + let n = (r) => { + for (let o of r) + o.type === "section" ? n(zt(o, t)) : e++; + }; + return n(t), ar.set(t, e), e; +} +class we extends Set { + constructor(e, n, r) { + super(e), e instanceof we ? (this.anchorKey = n || e.anchorKey, this.currentKey = r || e.currentKey) : (this.anchorKey = n, this.currentKey = r); + } +} +function Ps(t, e) { + if (t.size !== e.size) + return !1; + for (let n of t) + if (!e.has(n)) + return !1; + return !0; +} +function uo(t) { + let { selectionMode: e = "none", disallowEmptySelection: n, allowDuplicateSelectionEvents: r, selectionBehavior: o = "toggle", disabledBehavior: i = "all" } = t, l = I(!1), [, s] = Z(!1), u = I(null), a = I(null), [, c] = Z(null), f = ne(() => cr(t.selectedKeys), [ + t.selectedKeys + ]), p = ne(() => cr(t.defaultSelectedKeys, new we()), [ + t.defaultSelectedKeys + ]), [d, v] = tt(f, p, t.onSelectionChange), $ = ne(() => t.disabledKeys ? new Set(t.disabledKeys) : /* @__PURE__ */ new Set(), [ + t.disabledKeys + ]), [h, _] = Z(o); + o === "replace" && h === "toggle" && typeof d == "object" && d.size === 0 && _("replace"); + let w = I(o); + return W(() => { + o !== w.current && (_(o), w.current = o); + }, [ + o + ]), { + selectionMode: e, + disallowEmptySelection: n, + selectionBehavior: h, + setSelectionBehavior: _, + get isFocused() { + return l.current; + }, + setFocused(S) { + l.current = S, s(S); + }, + get focusedKey() { + return u.current; + }, + get childFocusStrategy() { + return a.current; + }, + setFocusedKey(S, K = "first") { + u.current = S, a.current = K, c(S); + }, + selectedKeys: d, + setSelectedKeys(S) { + (r || !Ps(S, d)) && v(S); + }, + disabledKeys: $, + disabledBehavior: i + }; +} +function cr(t, e) { + return t ? t === "all" ? "all" : new we(t) : e; +} +class ao { + /** + * The type of selection that is allowed in the collection. + */ + get selectionMode() { + return this.state.selectionMode; + } + /** + * Whether the collection allows empty selection. + */ + get disallowEmptySelection() { + return this.state.disallowEmptySelection; + } + /** + * The selection behavior for the collection. + */ + get selectionBehavior() { + return this.state.selectionBehavior; + } + /** + * Sets the selection behavior for the collection. + */ + setSelectionBehavior(e) { + this.state.setSelectionBehavior(e); + } + /** + * Whether the collection is currently focused. + */ + get isFocused() { + return this.state.isFocused; + } + /** + * Sets whether the collection is focused. + */ + setFocused(e) { + this.state.setFocused(e); + } + /** + * The current focused key in the collection. + */ + get focusedKey() { + return this.state.focusedKey; + } + /** Whether the first or last child of the focused key should receive focus. */ + get childFocusStrategy() { + return this.state.childFocusStrategy; + } + /** + * Sets the focused key. + */ + setFocusedKey(e, n) { + (e == null || this.collection.getItem(e)) && this.state.setFocusedKey(e, n); + } + /** + * The currently selected keys in the collection. + */ + get selectedKeys() { + return this.state.selectedKeys === "all" ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys; + } + /** + * The raw selection value for the collection. + * Either 'all' for select all, or a set of keys. + */ + get rawSelection() { + return this.state.selectedKeys; + } + /** + * Returns whether a key is selected. + */ + isSelected(e) { + return this.state.selectionMode === "none" ? !1 : (e = this.getKey(e), this.state.selectedKeys === "all" ? this.canSelectItem(e) : this.state.selectedKeys.has(e)); + } + /** + * Whether the selection is empty. + */ + get isEmpty() { + return this.state.selectedKeys !== "all" && this.state.selectedKeys.size === 0; + } + /** + * Whether all items in the collection are selected. + */ + get isSelectAll() { + if (this.isEmpty) + return !1; + if (this.state.selectedKeys === "all") + return !0; + if (this._isSelectAll != null) + return this._isSelectAll; + let e = this.getSelectAllKeys(), n = this.state.selectedKeys; + return this._isSelectAll = e.every((r) => n.has(r)), this._isSelectAll; + } + get firstSelectedKey() { + let e = null; + for (let n of this.state.selectedKeys) { + let r = this.collection.getItem(n); + (!e || r && tn(this.collection, r, e) < 0) && (e = r); + } + return e == null ? void 0 : e.key; + } + get lastSelectedKey() { + let e = null; + for (let n of this.state.selectedKeys) { + let r = this.collection.getItem(n); + (!e || r && tn(this.collection, r, e) > 0) && (e = r); + } + return e == null ? void 0 : e.key; + } + get disabledKeys() { + return this.state.disabledKeys; + } + get disabledBehavior() { + return this.state.disabledBehavior; + } + /** + * Extends the selection to the given key. + */ + extendSelection(e) { + if (this.selectionMode === "none") + return; + if (this.selectionMode === "single") { + this.replaceSelection(e); + return; + } + e = this.getKey(e); + let n; + if (this.state.selectedKeys === "all") + n = new we([ + e + ], e, e); + else { + let r = this.state.selectedKeys, o = r.anchorKey || e; + n = new we(r, o, e); + for (let i of this.getKeyRange(o, r.currentKey || e)) + n.delete(i); + for (let i of this.getKeyRange(e, o)) + this.canSelectItem(i) && n.add(i); + } + this.state.setSelectedKeys(n); + } + getKeyRange(e, n) { + let r = this.collection.getItem(e), o = this.collection.getItem(n); + return r && o ? tn(this.collection, r, o) <= 0 ? this.getKeyRangeInternal(e, n) : this.getKeyRangeInternal(n, e) : []; + } + getKeyRangeInternal(e, n) { + let r = [], o = e; + for (; o; ) { + let i = this.collection.getItem(o); + if ((i && i.type === "item" || i.type === "cell" && this.allowsCellSelection) && r.push(o), o === n) + return r; + o = this.collection.getKeyAfter(o); + } + return []; + } + getKey(e) { + let n = this.collection.getItem(e); + if (!n || n.type === "cell" && this.allowsCellSelection) + return e; + for (; n.type !== "item" && n.parentKey != null; ) + n = this.collection.getItem(n.parentKey); + return !n || n.type !== "item" ? null : n.key; + } + /** + * Toggles whether the given key is selected. + */ + toggleSelection(e) { + if (this.selectionMode === "none") + return; + if (this.selectionMode === "single" && !this.isSelected(e)) { + this.replaceSelection(e); + return; + } + if (e = this.getKey(e), e == null) + return; + let n = new we(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys); + n.has(e) ? n.delete(e) : this.canSelectItem(e) && (n.add(e), n.anchorKey = e, n.currentKey = e), !(this.disallowEmptySelection && n.size === 0) && this.state.setSelectedKeys(n); + } + /** + * Replaces the selection with only the given key. + */ + replaceSelection(e) { + if (this.selectionMode === "none" || (e = this.getKey(e), e == null)) + return; + let n = this.canSelectItem(e) ? new we([ + e + ], e, e) : new we(); + this.state.setSelectedKeys(n); + } + /** + * Replaces the selection with the given keys. + */ + setSelectedKeys(e) { + if (this.selectionMode === "none") + return; + let n = new we(); + for (let r of e) + if (r = this.getKey(r), r != null && (n.add(r), this.selectionMode === "single")) + break; + this.state.setSelectedKeys(n); + } + getSelectAllKeys() { + let e = [], n = (r) => { + for (; r; ) { + if (this.canSelectItem(r)) { + let o = this.collection.getItem(r); + o.type === "item" && e.push(r), o.hasChildNodes && (this.allowsCellSelection || o.type !== "item") && n(Cs(zt(o, this.collection)).key); + } + r = this.collection.getKeyAfter(r); + } + }; + return n(this.collection.getFirstKey()), e; + } + /** + * Selects all items in the collection. + */ + selectAll() { + !this.isSelectAll && this.selectionMode === "multiple" && this.state.setSelectedKeys("all"); + } + /** + * Removes all keys from the selection. + */ + clearSelection() { + !this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0) && this.state.setSelectedKeys(new we()); + } + /** + * Toggles between select all and an empty selection. + */ + toggleSelectAll() { + this.isSelectAll ? this.clearSelection() : this.selectAll(); + } + select(e, n) { + this.selectionMode !== "none" && (this.selectionMode === "single" ? this.isSelected(e) && !this.disallowEmptySelection ? this.toggleSelection(e) : this.replaceSelection(e) : this.selectionBehavior === "toggle" || n && (n.pointerType === "touch" || n.pointerType === "virtual") ? this.toggleSelection(e) : this.replaceSelection(e)); + } + /** + * Returns whether the current selection is equal to the given selection. + */ + isSelectionEqual(e) { + if (e === this.state.selectedKeys) + return !0; + let n = this.selectedKeys; + if (e.size !== n.size) + return !1; + for (let r of e) + if (!n.has(r)) + return !1; + for (let r of n) + if (!e.has(r)) + return !1; + return !0; + } + canSelectItem(e) { + if (this.state.selectionMode === "none" || this.state.disabledKeys.has(e)) + return !1; + let n = this.collection.getItem(e); + return !(!n || n.type === "cell" && !this.allowsCellSelection); + } + isDisabled(e) { + return this.state.disabledKeys.has(e) && this.state.disabledBehavior === "all"; + } + isLink(e) { + var n, r; + return !!(!((r = this.collection.getItem(e)) === null || r === void 0 || (n = r.props) === null || n === void 0) && n.href); + } + constructor(e, n, r) { + this.collection = e, this.state = n; + var o; + this.allowsCellSelection = (o = r == null ? void 0 : r.allowsCellSelection) !== null && o !== void 0 ? o : !1, this._isSelectAll = null; + } +} +class wn { + *[Symbol.iterator]() { + yield* this.iterable; + } + get size() { + return this.keyMap.size; + } + getKeys() { + return this.keyMap.keys(); + } + getKeyBefore(e) { + let n = this.keyMap.get(e); + return n ? n.prevKey : null; + } + getKeyAfter(e) { + let n = this.keyMap.get(e); + return n ? n.nextKey : null; + } + getFirstKey() { + return this.firstKey; + } + getLastKey() { + return this.lastKey; + } + getItem(e) { + return this.keyMap.get(e); + } + at(e) { + const n = [ + ...this.getKeys() + ]; + return this.getItem(n[e]); + } + getChildren(e) { + let n = this.keyMap.get(e); + return (n == null ? void 0 : n.childNodes) || []; + } + constructor(e) { + this.keyMap = /* @__PURE__ */ new Map(), this.iterable = e; + let n = (i) => { + if (this.keyMap.set(i.key, i), i.childNodes && i.type === "section") + for (let l of i.childNodes) + n(l); + }; + for (let i of e) + n(i); + let r, o = 0; + for (let [i, l] of this.keyMap) + r ? (r.nextKey = i, l.prevKey = r.key) : (this.firstKey = i, l.prevKey = void 0), l.type === "item" && (l.index = o++), r = l, r.nextKey = void 0; + this.lastKey = r == null ? void 0 : r.key; + } +} +function co(t) { + let { filter: e } = t, n = uo(t), r = ne(() => t.disabledKeys ? new Set(t.disabledKeys) : /* @__PURE__ */ new Set(), [ + t.disabledKeys + ]), o = te((a) => e ? new wn(e(a)) : new wn(a), [ + e + ]), i = ne(() => ({ + suppressTextValueWarning: t.suppressTextValueWarning + }), [ + t.suppressTextValueWarning + ]), l = so(t, o, i), s = ne(() => new ao(l, n), [ + l, + n + ]); + const u = I(null); + return W(() => { + if (n.focusedKey != null && !l.getItem(n.focusedKey)) { + const a = u.current.getItem(n.focusedKey), c = [ + ...u.current.getKeys() + ].map(($) => { + const h = u.current.getItem($); + return h.type === "item" ? h : null; + }).filter(($) => $ !== null), f = [ + ...l.getKeys() + ].map(($) => { + const h = l.getItem($); + return h.type === "item" ? h : null; + }).filter(($) => $ !== null), p = c.length - f.length; + let d = Math.min(p > 1 ? Math.max(a.index - p + 1, 0) : a.index, f.length - 1), v; + for (; d >= 0; ) { + if (!s.isDisabled(f[d].key)) { + v = f[d]; + break; + } + d < f.length - 1 ? d++ : (d > a.index && (d = a.index), d--); + } + n.setFocusedKey(v ? v.key : null); + } + u.current = l; + }, [ + l, + s, + n, + n.focusedKey + ]), { + collection: l, + disabledKeys: r, + selectionManager: s + }; +} +function fo(t) { + var e; + let [n, r] = tt(t.selectedKey, (e = t.defaultSelectedKey) !== null && e !== void 0 ? e : null, t.onSelectionChange), o = ne(() => n != null ? [ + n + ] : [], [ + n + ]), { collection: i, disabledKeys: l, selectionManager: s } = co({ + ...t, + selectionMode: "single", + disallowEmptySelection: !0, + allowDuplicateSelectionEvents: !0, + selectedKeys: o, + onSelectionChange: (a) => { + var c; + let f = (c = a.values().next().value) !== null && c !== void 0 ? c : null; + f === n && t.onSelectionChange && t.onSelectionChange(f), r(f); + } + }), u = n != null ? i.getItem(n) : null; + return { + collection: i, + disabledKeys: l, + selectionManager: s, + selectedKey: n, + setSelectedKey: r, + selectedItem: u + }; +} +function Vn(t) { + let [e, n] = tt(t.isOpen, t.defaultOpen || !1, t.onOpenChange); + const r = te(() => { + n(!0); + }, [ + n + ]), o = te(() => { + n(!1); + }, [ + n + ]), i = te(() => { + n(!e); + }, [ + n, + e + ]); + return { + isOpen: e, + setOpen: n, + open: r, + close: o, + toggle: i + }; +} +function ws(t) { + var e, n; + let { defaultFilter: r, menuTrigger: o = "input", allowsEmptyCollection: i = !1, allowsCustomValue: l, shouldCloseOnBlur: s = !0 } = t, [u, a] = Z(!1), [c, f] = Z(!1), [p, d] = Z(null), v = (ee) => { + t.onSelectionChange && t.onSelectionChange(ee), ee === w && (H(), D()); + }; + var $; + let { collection: h, selectionManager: _, selectedKey: w, setSelectedKey: S, selectedItem: K, disabledKeys: g } = fo({ + ...t, + onSelectionChange: v, + items: ($ = t.items) !== null && $ !== void 0 ? $ : t.defaultItems + }); + var N, R; + let [b, A] = tt(t.inputValue, (R = (N = t.defaultInputValue) !== null && N !== void 0 ? N : (e = h.getItem(w)) === null || e === void 0 ? void 0 : e.textValue) !== null && R !== void 0 ? R : "", t.onInputChange), E = h, P = ne(() => ( + // No default filter if items are controlled. + t.items != null || !r ? h : Ss(h, b, r) + ), [ + h, + b, + r, + t.items + ]), [B, C] = Z(P), T = I("focus"), V = Vn({ + ...t, + onOpenChange: (ee) => { + t.onOpenChange && t.onOpenChange(ee, ee ? T.current : void 0), _.setFocused(ee), ee || _.setFocusedKey(null); + }, + isOpen: void 0, + defaultOpen: void 0 + }), F = (ee = null, ce) => { + let ve = ce === "manual" || ce === "focus" && o === "focus"; + (i || P.size > 0 || ve && E.size > 0 || t.items) && (ve && !V.isOpen && t.items === void 0 && a(!0), T.current = ce, d(ee), V.open()); + }, ue = (ee = null, ce) => { + let ve = ce === "manual" || ce === "focus" && o === "focus"; + !(i || P.size > 0 || ve && E.size > 0 || t.items) && !V.isOpen || (ve && !V.isOpen && t.items === void 0 && a(!0), V.isOpen || (T.current = ce), y(ee)); + }, ae = te(() => { + C(u ? E : P); + }, [ + u, + E, + P + ]), y = te((ee = null) => { + V.isOpen && ae(), d(ee), V.toggle(); + }, [ + V, + ae + ]), D = te(() => { + V.isOpen && (ae(), V.close()); + }, [ + V, + ae + ]), [z, j] = Z(b), H = () => { + var ee, ce; + let ve = (ce = (ee = h.getItem(w)) === null || ee === void 0 ? void 0 : ee.textValue) !== null && ce !== void 0 ? ce : ""; + j(ve), A(ve); + }; + var Y, U; + let L = I((U = (Y = t.selectedKey) !== null && Y !== void 0 ? Y : t.defaultSelectedKey) !== null && U !== void 0 ? U : null); + var k; + let X = I((k = (n = h.getItem(w)) === null || n === void 0 ? void 0 : n.textValue) !== null && k !== void 0 ? k : ""); + W(() => { + var ee; + c && (P.size > 0 || i) && !V.isOpen && b !== z && o !== "manual" && F(null, "input"), !u && !i && V.isOpen && P.size === 0 && D(), w != null && w !== L.current && D(), b !== z && (_.setFocusedKey(null), a(!1), b === "" && (t.inputValue === void 0 || t.selectedKey === void 0) && S(null)), w !== L.current && (t.inputValue === void 0 || t.selectedKey === void 0) ? H() : z !== b && j(b); + var ce; + let ve = (ce = (ee = h.getItem(w)) === null || ee === void 0 ? void 0 : ee.textValue) !== null && ce !== void 0 ? ce : ""; + !c && w != null && t.inputValue === void 0 && w === L.current && X.current !== ve && (j(ve), A(ve)), L.current = w, X.current = ve; + }); + let G = On({ + ...t, + value: ne(() => ({ + inputValue: b, + selectedKey: w + }), [ + b, + w + ]) + }), J = () => { + l && w == null ? M() : ye(); + }, M = () => { + L.current = null, S(null), D(); + }, ye = () => { + if (t.selectedKey !== void 0 && t.inputValue !== void 0) { + var ee; + t.onSelectionChange(w); + var ce; + let ve = (ce = (ee = h.getItem(w)) === null || ee === void 0 ? void 0 : ee.textValue) !== null && ce !== void 0 ? ce : ""; + j(ve), D(); + } else + H(), D(); + }; + const ke = () => { + if (l) { + var ee, ce; + const ve = (ce = (ee = h.getItem(w)) === null || ee === void 0 ? void 0 : ee.textValue) !== null && ce !== void 0 ? ce : ""; + b === ve ? ye() : M(); + } else + ye(); + }; + let mt = () => { + V.isOpen && _.focusedKey != null ? w === _.focusedKey ? ye() : S(_.focusedKey) : ke(); + }, or = I(b), is = (ee) => { + ee ? (or.current = b, o === "focus" && F(null, "focus")) : (s && ke(), b !== or.current && G.commitValidation()), f(ee); + }, ls = ne(() => V.isOpen ? u ? E : P : B, [ + V.isOpen, + E, + P, + u, + B + ]); + return { + ...G, + ...V, + focusStrategy: p, + toggle: ue, + open: F, + close: ke, + selectionManager: _, + selectedKey: w, + setSelectedKey: S, + disabledKeys: g, + isFocused: c, + setFocused: is, + selectedItem: K, + collection: ls, + inputValue: b, + setInputValue: A, + commit: mt, + revert: J + }; +} +function Ss(t, e, n) { + return new wn(po(t, t, e, n)); +} +function po(t, e, n, r) { + let o = []; + for (let i of e) + if (i.type === "section" && i.hasChildNodes) { + let l = po(t, zt(i, t), n, r); + [ + ...l + ].some((s) => s.type === "item") && o.push({ + ...i, + childNodes: l + }); + } else + i.type === "item" && r(i.textValue, n) ? o.push({ + ...i + }) : i.type !== "item" && o.push({ + ...i + }); + return o; +} +const Ts = Symbol.for("react-aria.i18n.locale"), _s = Symbol.for("react-aria.i18n.strings"); +let He; +class jt { + /** Returns a localized string for the given key and locale. */ + getStringForLocale(e, n) { + let o = this.getStringsForLocale(n)[e]; + if (!o) + throw new Error(`Could not find intl message ${e} in ${n} locale`); + return o; + } + /** Returns all localized strings for the given locale. */ + getStringsForLocale(e) { + let n = this.strings[e]; + return n || (n = As(e, this.strings, this.defaultLocale), this.strings[e] = n), n; + } + static getGlobalDictionaryForPackage(e) { + if (typeof window > "u") + return null; + let n = window[Ts]; + if (He === void 0) { + let o = window[_s]; + if (!o) + return null; + He = {}; + for (let i in o) + He[i] = new jt({ + [n]: o[i] + }, n); + } + let r = He == null ? void 0 : He[e]; + if (!r) + throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`); + return r; + } + constructor(e, n = "en-US") { + this.strings = { + ...e + }, this.defaultLocale = n; + } +} +function As(t, e, n = "en-US") { + if (e[t]) + return e[t]; + let r = Ks(t); + if (e[r]) + return e[r]; + for (let o in e) + if (o.startsWith(r + "-")) + return e[o]; + return e[n]; +} +function Ks(t) { + return Intl.Locale ? new Intl.Locale(t).language : t.split("-")[0]; +} +const dr = /* @__PURE__ */ new Map(), fr = /* @__PURE__ */ new Map(); +class Ds { + /** Formats a localized string for the given key with the provided variables. */ + format(e, n) { + let r = this.strings.getStringForLocale(e, this.locale); + return typeof r == "function" ? r(n, this) : r; + } + plural(e, n, r = "cardinal") { + let o = n["=" + e]; + if (o) + return typeof o == "function" ? o() : o; + let i = this.locale + ":" + r, l = dr.get(i); + l || (l = new Intl.PluralRules(this.locale, { + type: r + }), dr.set(i, l)); + let s = l.select(e); + return o = n[s] || n.other, typeof o == "function" ? o() : o; + } + number(e) { + let n = fr.get(this.locale); + return n || (n = new Intl.NumberFormat(this.locale), fr.set(this.locale, n)), n.format(e); + } + select(e, n) { + let r = e[n] || e.other; + return typeof r == "function" ? r() : r; + } + constructor(e, n) { + this.locale = e, this.strings = n; + } +} +function Fs(t, e) { + let { cursor: n, getKey: r } = t; + return { + setSelectedKeys(o) { + e((i) => ({ + ...i, + selectedKeys: o + })); + }, + setFilterText(o) { + e((i) => ({ + ...i, + filterText: o + })); + }, + insert(o, ...i) { + e((l) => rt(l, o, ...i)); + }, + insertBefore(o, ...i) { + e((l) => { + let s = l.items.findIndex((u) => r(u) === o); + if (s === -1) + if (l.items.length === 0) + s = 0; + else + return l; + return rt(l, s, ...i); + }); + }, + insertAfter(o, ...i) { + e((l) => { + let s = l.items.findIndex((u) => r(u) === o); + if (s === -1) + if (l.items.length === 0) + s = 0; + else + return l; + return rt(l, s + 1, ...i); + }); + }, + prepend(...o) { + e((i) => rt(i, 0, ...o)); + }, + append(...o) { + e((i) => rt(i, i.items.length, ...o)); + }, + remove(...o) { + e((i) => { + let l = new Set(o), s = i.items.filter((a) => !l.has(r(a))), u = "all"; + if (i.selectedKeys !== "all") { + u = new Set(i.selectedKeys); + for (let a of o) + u.delete(a); + } + return n == null && s.length === 0 && (u = /* @__PURE__ */ new Set()), { + ...i, + items: s, + selectedKeys: u + }; + }); + }, + removeSelectedItems() { + e((o) => { + if (o.selectedKeys === "all") + return { + ...o, + items: [], + selectedKeys: /* @__PURE__ */ new Set() + }; + let i = o.selectedKeys, l = o.items.filter((s) => !i.has(r(s))); + return { + ...o, + items: l, + selectedKeys: /* @__PURE__ */ new Set() + }; + }); + }, + move(o, i) { + e((l) => { + let s = l.items.findIndex((c) => r(c) === o); + if (s === -1) + return l; + let u = l.items.slice(), [a] = u.splice(s, 1); + return u.splice(i, 0, a), { + ...l, + items: u + }; + }); + }, + moveBefore(o, i) { + e((l) => { + let s = l.items.findIndex((c) => r(c) === o); + if (s === -1) + return l; + let a = (Array.isArray(i) ? i : [ + ...i + ]).map((c) => l.items.findIndex((f) => r(f) === c)).sort(); + return pr(l, a, s); + }); + }, + moveAfter(o, i) { + e((l) => { + let s = l.items.findIndex((c) => r(c) === o); + if (s === -1) + return l; + let a = (Array.isArray(i) ? i : [ + ...i + ]).map((c) => l.items.findIndex((f) => r(f) === c)).sort(); + return pr(l, a, s + 1); + }); + }, + update(o, i) { + e((l) => { + let s = l.items.findIndex((u) => r(u) === o); + return s === -1 ? l : { + ...l, + items: [ + ...l.items.slice(0, s), + i, + ...l.items.slice(s + 1) + ] + }; + }); + } + }; +} +function rt(t, e, ...n) { + return { + ...t, + items: [ + ...t.items.slice(0, e), + ...n, + ...t.items.slice(e) + ] + }; +} +function pr(t, e, n) { + n -= e.filter((i) => i < n).length; + let r = e.map((i) => ({ + from: i, + to: n++ + })); + for (let i = 0; i < r.length; i++) { + let l = r[i].from; + for (let s = i; s < r.length; s++) + r[s].from > l && r[s].from--; + } + for (let i = 0; i < r.length; i++) { + let l = r[i]; + for (let s = r.length - 1; s > i; s--) { + let u = r[s]; + u.from < l.to ? l.to++ : u.from++; + } + } + let o = t.items.slice(); + for (let i of r) { + let [l] = o.splice(i.from, 1); + o.splice(i.to, 0, l); + } + return { + ...t, + items: o + }; +} +function Ls(t, e) { + let n; + switch (t.state) { + case "idle": + case "error": + switch (e.type) { + case "loading": + case "loadingMore": + case "sorting": + case "filtering": + var r, o; + return { + ...t, + filterText: (r = e.filterText) !== null && r !== void 0 ? r : t.filterText, + state: e.type, + // Reset items to an empty list if loading, but not when sorting. + items: e.type === "loading" ? [] : t.items, + sortDescriptor: (o = e.sortDescriptor) !== null && o !== void 0 ? o : t.sortDescriptor, + abortController: e.abortController + }; + case "update": + return { + ...t, + ...e.updater(t) + }; + case "success": + case "error": + return t; + default: + throw new Error(`Invalid action "${e.type}" in state "${t.state}"`); + } + case "loading": + case "sorting": + case "filtering": + switch (e.type) { + case "success": + if (e.abortController !== t.abortController) + return t; + var i; + n = (i = e.selectedKeys) !== null && i !== void 0 ? i : t.selectedKeys; + var l, s; + return { + ...t, + filterText: (l = e.filterText) !== null && l !== void 0 ? l : t.filterText, + state: "idle", + items: [ + ...e.items + ], + selectedKeys: n === "all" ? "all" : new Set(n), + sortDescriptor: (s = e.sortDescriptor) !== null && s !== void 0 ? s : t.sortDescriptor, + abortController: null, + cursor: e.cursor + }; + case "error": + return e.abortController !== t.abortController ? t : { + ...t, + state: "error", + error: e.error, + abortController: null + }; + case "loading": + case "loadingMore": + case "sorting": + case "filtering": + t.abortController.abort(); + var u; + return { + ...t, + filterText: (u = e.filterText) !== null && u !== void 0 ? u : t.filterText, + state: e.type, + // Reset items to an empty list if loading, but not when sorting. + items: e.type === "loading" ? [] : t.items, + abortController: e.abortController + }; + case "update": + return { + ...t, + ...e.updater(t) + }; + default: + throw new Error(`Invalid action "${e.type}" in state "${t.state}"`); + } + case "loadingMore": + switch (e.type) { + case "success": + var a; + n = t.selectedKeys === "all" || e.selectedKeys === "all" ? "all" : /* @__PURE__ */ new Set([ + ...t.selectedKeys, + ...(a = e.selectedKeys) !== null && a !== void 0 ? a : [] + ]); + var c; + return { + ...t, + state: "idle", + items: [ + ...t.items, + ...e.items + ], + selectedKeys: n, + sortDescriptor: (c = e.sortDescriptor) !== null && c !== void 0 ? c : t.sortDescriptor, + abortController: null, + cursor: e.cursor + }; + case "error": + return e.abortController !== t.abortController ? t : { + ...t, + state: "error", + error: e.error + }; + case "loading": + case "sorting": + case "filtering": + t.abortController.abort(); + var f; + return { + ...t, + filterText: (f = e.filterText) !== null && f !== void 0 ? f : t.filterText, + state: e.type, + // Reset items to an empty list if loading, but not when sorting. + items: e.type === "loading" ? [] : t.items, + abortController: e.abortController + }; + case "loadingMore": + return e.abortController.abort(), t; + case "update": + return { + ...t, + ...e.updater(t) + }; + default: + throw new Error(`Invalid action "${e.type}" in state "${t.state}"`); + } + default: + throw new Error(`Invalid state "${t.state}"`); + } +} +function cd(t) { + const { load: e, sort: n, initialSelectedKeys: r, initialSortDescriptor: o, getKey: i = (f) => f.id || f.key, initialFilterText: l = "" } = t; + let [s, u] = ss(Ls, { + state: "idle", + error: null, + items: [], + selectedKeys: r === "all" ? "all" : new Set(r), + sortDescriptor: o, + filterText: l + }); + const a = async (f, p) => { + let d = new AbortController(); + try { + u({ + ...f, + abortController: d + }); + var v; + let _ = (v = f.filterText) !== null && v !== void 0 ? v : s.filterText; + var $; + let w = await p({ + items: s.items.slice(), + selectedKeys: s.selectedKeys, + sortDescriptor: ($ = f.sortDescriptor) !== null && $ !== void 0 ? $ : s.sortDescriptor, + signal: d.signal, + cursor: f.type === "loadingMore" ? s.cursor : null, + filterText: _ + }); + var h; + let S = (h = w.filterText) !== null && h !== void 0 ? h : _; + u({ + type: "success", + ...w, + abortController: d + }), S && S !== _ && !d.signal.aborted && a({ + type: "filtering", + filterText: S + }, e); + } catch (_) { + u({ + type: "error", + error: _, + abortController: d + }); + } + }; + let c = I(!1); + return W(() => { + c.current || (a({ + type: "loading" + }, e), c.current = !0); + }, []), { + items: s.items, + selectedKeys: s.selectedKeys, + sortDescriptor: s.sortDescriptor, + isLoading: s.state === "loading" || s.state === "loadingMore" || s.state === "sorting" || s.state === "filtering", + loadingState: s.state, + error: s.error, + filterText: s.filterText, + getItem(f) { + return s.items.find((p) => i(p) === f); + }, + reload() { + a({ + type: "loading" + }, e); + }, + loadMore() { + s.state === "loadingMore" || s.state === "filtering" || s.cursor == null || a({ + type: "loadingMore" + }, e); + }, + sort(f) { + a({ + type: "sorting", + sortDescriptor: f + }, n || e); + }, + ...Fs({ + ...t, + getKey: i, + cursor: s.cursor + }, (f) => { + u({ + type: "update", + updater: f + }); + }), + setFilterText(f) { + a({ + type: "filtering", + filterText: f + }, e); + } + }; +} +function Ms(t) { + let e = Vn(t), [n, r] = Z(null), [o, i] = Z([]), l = () => { + i([]), e.close(); + }; + return { + focusStrategy: n, + ...e, + open(a = null) { + r(a), e.open(); + }, + toggle(a = null) { + r(a), e.toggle(); + }, + close() { + l(); + }, + UNSTABLE_expandedKeysStack: o, + UNSTABLE_openSubmenu: (a, c) => { + i((f) => c > f.length ? f : [ + ...f.slice(0, c), + a + ]); + }, + UNSTABLE_closeSubmenu: (a, c) => { + i((f) => f[c] === a ? f.slice(0, c) : f); + } + }; +} +function Ns(t) { + let e = Vn(t), [n, r] = Z(null), o = fo({ + ...t, + onSelectionChange: (u) => { + t.onSelectionChange != null && t.onSelectionChange(u), e.close(), i.commitValidation(); + } + }), i = On({ + ...t, + value: o.selectedKey + }), [l, s] = Z(!1); + return { + ...i, + ...o, + ...e, + focusStrategy: n, + open(u = null) { + o.collection.size !== 0 && (r(u), e.open()); + }, + toggle(u = null) { + o.collection.size !== 0 && (r(u), e.toggle()); + }, + isFocused: l, + setFocused: s + }; +} +class ks { + *[Symbol.iterator]() { + yield* this.iterable; + } + get size() { + return this.keyMap.size; + } + getKeys() { + return this.keyMap.keys(); + } + getKeyBefore(e) { + let n = this.keyMap.get(e); + return n ? n.prevKey : null; + } + getKeyAfter(e) { + let n = this.keyMap.get(e); + return n ? n.nextKey : null; + } + getFirstKey() { + return this.firstKey; + } + getLastKey() { + return this.lastKey; + } + getItem(e) { + return this.keyMap.get(e); + } + at(e) { + const n = [ + ...this.getKeys() + ]; + return this.getItem(n[e]); + } + constructor(e, { expandedKeys: n } = {}) { + this.keyMap = /* @__PURE__ */ new Map(), this.iterable = e, n = n || /* @__PURE__ */ new Set(); + let r = (l) => { + if (this.keyMap.set(l.key, l), l.childNodes && (l.type === "section" || n.has(l.key))) + for (let s of l.childNodes) + r(s); + }; + for (let l of e) + r(l); + let o, i = 0; + for (let [l, s] of this.keyMap) + o ? (o.nextKey = l, s.prevKey = o.key) : (this.firstKey = l, s.prevKey = void 0), s.type === "item" && (s.index = i++), o = s, o.nextKey = void 0; + this.lastKey = o == null ? void 0 : o.key; + } +} +function Is(t) { + let [e, n] = tt(t.expandedKeys ? new Set(t.expandedKeys) : void 0, t.defaultExpandedKeys ? new Set(t.defaultExpandedKeys) : /* @__PURE__ */ new Set(), t.onExpandedChange), r = uo(t), o = ne(() => t.disabledKeys ? new Set(t.disabledKeys) : /* @__PURE__ */ new Set(), [ + t.disabledKeys + ]), i = so(t, te((s) => new ks(s, { + expandedKeys: e + }), [ + e + ]), null); + return W(() => { + r.focusedKey != null && !i.getItem(r.focusedKey) && r.setFocusedKey(null); + }, [ + i, + r.focusedKey + ]), { + collection: i, + expandedKeys: e, + disabledKeys: o, + toggleKey: (s) => { + n(Bs(e, s)); + }, + setExpandedKeys: n, + selectionManager: new ao(i, r) + }; +} +function Bs(t, e) { + let n = new Set(t); + return n.has(e) ? n.delete(e) : n.add(e), n; +} +const Tt = { + prefix: String(Math.round(Math.random() * 1e10)), + current: 0 +}, bo = /* @__PURE__ */ Q.createContext(Tt), Os = /* @__PURE__ */ Q.createContext(!1); +let Rs = !!(typeof window < "u" && window.document && window.document.createElement), nn = /* @__PURE__ */ new WeakMap(); +function Vs(t = !1) { + let e = Se(bo), n = I(null); + if (n.current === null && !t) { + var r, o; + let i = (o = Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || o === void 0 || (r = o.ReactCurrentOwner) === null || r === void 0 ? void 0 : r.current; + if (i) { + let l = nn.get(i); + l == null ? nn.set(i, { + id: e.current, + state: i.memoizedState + }) : i.memoizedState !== l.state && (e.current = l.id, nn.delete(i)); + } + n.current = ++e.current; + } + return n.current; +} +function zs(t) { + let e = Se(bo); + e === Tt && !Rs && console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server."); + let n = Vs(!!t), r = e === Tt && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${e.prefix}`; + return t || `${r}-${n}`; +} +function js(t) { + let e = Q.useId(), [n] = Z(Ht()), r = n || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${Tt.prefix}`; + return t || `${r}-${e}`; +} +const Hs = typeof Q.useId == "function" ? js : zs; +function Us() { + return !1; +} +function Ws() { + return !0; +} +function Gs(t) { + return () => { + }; +} +function Ht() { + return typeof Q.useSyncExternalStore == "function" ? Q.useSyncExternalStore(Gs, Us, Ws) : Se(Os); +} +function mo(t) { + var e, n, r = ""; + if (typeof t == "string" || typeof t == "number") + r += t; + else if (typeof t == "object") + if (Array.isArray(t)) { + var o = t.length; + for (e = 0; e < o; e++) + t[e] && (n = mo(t[e])) && (r && (r += " "), r += n); + } else + for (n in t) + t[n] && (r && (r += " "), r += n); + return r; +} +function qs() { + for (var t, e, n = 0, r = "", o = arguments.length; n < o; n++) + (t = arguments[n]) && (e = mo(t)) && (r && (r += " "), r += e); + return r; +} +const fe = typeof document < "u" ? Q.useLayoutEffect : () => { +}; +function xe(t) { + const e = I(null); + return fe(() => { + e.current = t; + }, [ + t + ]), te((...n) => { + const r = e.current; + return r(...n); + }, []); +} +function Ys(t) { + let [e, n] = Z(t), r = I(null), o = xe(() => { + let l = r.current.next(); + if (l.done) { + r.current = null; + return; + } + e === l.value ? o() : n(l.value); + }); + fe(() => { + r.current && o(); + }); + let i = xe((l) => { + r.current = l(e), o(); + }); + return [ + e, + i + ]; +} +let Xs = !!(typeof window < "u" && window.document && window.document.createElement), _t = /* @__PURE__ */ new Map(); +function Ae(t) { + let [e, n] = Z(t), r = I(null), o = Hs(e), i = te((l) => { + r.current = l; + }, []); + return Xs && _t.set(o, i), fe(() => { + let l = o; + return () => { + _t.delete(l); + }; + }, [ + o + ]), W(() => { + let l = r.current; + l && (r.current = null, n(l)); + }), o; +} +function Zs(t, e) { + if (t === e) + return t; + let n = _t.get(t); + if (n) + return n(e), e; + let r = _t.get(e); + return r ? (r(t), t) : e; +} +function Oe(t = []) { + let e = Ae(), [n, r] = Ys(e), o = te(() => { + r(function* () { + yield e, yield document.getElementById(e) ? e : void 0; + }); + }, [ + e, + r + ]); + return fe(o, [ + e, + o, + ...t + ]), n; +} +function Qe(...t) { + return (...e) => { + for (let n of t) + typeof n == "function" && n(...e); + }; +} +const pe = (t) => { + var e; + return (e = t == null ? void 0 : t.ownerDocument) !== null && e !== void 0 ? e : document; +}, at = (t) => t && "window" in t && t.window === t ? t : pe(t).defaultView || window; +function se(...t) { + let e = { + ...t[0] + }; + for (let n = 1; n < t.length; n++) { + let r = t[n]; + for (let o in r) { + let i = e[o], l = r[o]; + typeof i == "function" && typeof l == "function" && // This is a lot faster than a regex. + o[0] === "o" && o[1] === "n" && o.charCodeAt(2) >= /* 'A' */ + 65 && o.charCodeAt(2) <= /* 'Z' */ + 90 ? e[o] = Qe(i, l) : (o === "className" || o === "UNSAFE_className") && typeof i == "string" && typeof l == "string" ? e[o] = qs(i, l) : o === "id" && i && l ? e.id = Zs(i, l) : e[o] = l !== void 0 ? l : i; + } + } + return e; +} +const Js = /* @__PURE__ */ new Set([ + "id" +]), Qs = /* @__PURE__ */ new Set([ + "aria-label", + "aria-labelledby", + "aria-describedby", + "aria-details" +]), eu = /* @__PURE__ */ new Set([ + "href", + "target", + "rel", + "download", + "ping", + "referrerPolicy" +]), tu = /^(data-.*)$/; +function ze(t, e = {}) { + let { labelable: n, isLink: r, propNames: o } = e, i = {}; + for (const l in t) + Object.prototype.hasOwnProperty.call(t, l) && (Js.has(l) || n && Qs.has(l) || r && eu.has(l) || o != null && o.has(l) || tu.test(l)) && (i[l] = t[l]); + return i; +} +function Fe(t) { + if (nu()) + t.focus({ + preventScroll: !0 + }); + else { + let e = ru(t); + t.focus(), ou(e); + } +} +let ht = null; +function nu() { + if (ht == null) { + ht = !1; + try { + var t = document.createElement("div"); + t.focus({ + get preventScroll() { + return ht = !0, !0; + } + }); + } catch { + } + } + return ht; +} +function ru(t) { + for (var e = t.parentNode, n = [], r = document.scrollingElement || document.documentElement; e instanceof HTMLElement && e !== r; ) + (e.offsetHeight < e.scrollHeight || e.offsetWidth < e.scrollWidth) && n.push({ + element: e, + scrollTop: e.scrollTop, + scrollLeft: e.scrollLeft + }), e = e.parentNode; + return r instanceof HTMLElement && n.push({ + element: r, + scrollTop: r.scrollTop, + scrollLeft: r.scrollLeft + }), n; +} +function ou(t) { + for (let { element: e, scrollTop: n, scrollLeft: r } of t) + e.scrollTop = n, e.scrollLeft = r; +} +function Ut(t) { + var e; + return typeof window > "u" || window.navigator == null ? !1 : ((e = window.navigator.userAgentData) === null || e === void 0 ? void 0 : e.brands.some((n) => t.test(n.brand))) || t.test(window.navigator.userAgent); +} +function zn(t) { + var e; + return typeof window < "u" && window.navigator != null ? t.test(((e = window.navigator.userAgentData) === null || e === void 0 ? void 0 : e.platform) || window.navigator.platform) : !1; +} +function Ie() { + return zn(/^Mac/i); +} +function iu() { + return zn(/^iPhone/i); +} +function vo() { + return zn(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support. + Ie() && navigator.maxTouchPoints > 1; +} +function Wt() { + return iu() || vo(); +} +function wt() { + return Ie() || Wt(); +} +function ho() { + return Ut(/AppleWebKit/i) && !lu(); +} +function lu() { + return Ut(/Chrome/i); +} +function go() { + return Ut(/Android/i); +} +function su() { + return Ut(/Firefox/i); +} +const uu = /* @__PURE__ */ Rt({ + isNative: !0, + open: cu +}); +function Gt() { + return Se(uu); +} +function Re(t, e, n = !0) { + var r, o; + let { metaKey: i, ctrlKey: l, altKey: s, shiftKey: u } = e; + su() && (!((o = window.event) === null || o === void 0 || (r = o.type) === null || r === void 0) && r.startsWith("key")) && t.target === "_blank" && (Ie() ? i = !0 : l = !0); + let a = ho() && Ie() && !vo() ? new KeyboardEvent("keydown", { + keyIdentifier: "Enter", + metaKey: i, + ctrlKey: l, + altKey: s, + shiftKey: u + }) : new MouseEvent("click", { + metaKey: i, + ctrlKey: l, + altKey: s, + shiftKey: u, + bubbles: !0, + cancelable: !0 + }); + Re.isOpening = n, Fe(t), t.dispatchEvent(a), Re.isOpening = !1; +} +Re.isOpening = !1; +function au(t, e) { + if (t instanceof HTMLAnchorElement) + e(t); + else if (t.hasAttribute("data-href")) { + let n = document.createElement("a"); + n.href = t.getAttribute("data-href"), t.hasAttribute("data-target") && (n.target = t.getAttribute("data-target")), t.hasAttribute("data-rel") && (n.rel = t.getAttribute("data-rel")), t.hasAttribute("data-download") && (n.download = t.getAttribute("data-download")), t.hasAttribute("data-ping") && (n.ping = t.getAttribute("data-ping")), t.hasAttribute("data-referrer-policy") && (n.referrerPolicy = t.getAttribute("data-referrer-policy")), t.appendChild(n), e(n), t.removeChild(n); + } +} +function cu(t, e) { + au(t, (n) => Re(n, e)); +} +let qe = /* @__PURE__ */ new Map(), Sn = /* @__PURE__ */ new Set(); +function br() { + if (typeof window > "u") + return; + let t = (n) => { + let r = qe.get(n.target); + r || (r = /* @__PURE__ */ new Set(), qe.set(n.target, r), n.target.addEventListener("transitioncancel", e)), r.add(n.propertyName); + }, e = (n) => { + let r = qe.get(n.target); + if (r && (r.delete(n.propertyName), r.size === 0 && (n.target.removeEventListener("transitioncancel", e), qe.delete(n.target)), qe.size === 0)) { + for (let o of Sn) + o(); + Sn.clear(); + } + }; + document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", e); +} +typeof document < "u" && (document.readyState !== "loading" ? br() : document.addEventListener("DOMContentLoaded", br)); +function $o(t) { + requestAnimationFrame(() => { + qe.size === 0 ? t() : Sn.add(t); + }); +} +function yo() { + let t = I(/* @__PURE__ */ new Map()), e = te((o, i, l, s) => { + let u = s != null && s.once ? (...a) => { + t.current.delete(l), l(...a); + } : l; + t.current.set(l, { + type: i, + eventTarget: o, + fn: u, + options: s + }), o.addEventListener(i, l, s); + }, []), n = te((o, i, l, s) => { + var u; + let a = ((u = t.current.get(l)) === null || u === void 0 ? void 0 : u.fn) || l; + o.removeEventListener(i, a, s), t.current.delete(l); + }, []), r = te(() => { + t.current.forEach((o, i) => { + n(o.eventTarget, o.type, i, o.options); + }); + }, [ + n + ]); + return W(() => r, [ + r + ]), { + addGlobalListener: e, + removeGlobalListener: n, + removeAllGlobalListeners: r + }; +} +function At(t, e) { + let { id: n, "aria-label": r, "aria-labelledby": o } = t; + return n = Ae(n), o && r ? o = [ + .../* @__PURE__ */ new Set([ + n, + ...o.trim().split(/\s+/) + ]) + ].join(" ") : o && (o = o.trim().split(/\s+/).join(" ")), !r && !o && e && (r = e), { + id: n, + "aria-label": r, + "aria-labelledby": o + }; +} +function du() { + return typeof window.ResizeObserver < "u"; +} +function fu(t) { + const { ref: e, onResize: n } = t; + W(() => { + let r = e == null ? void 0 : e.current; + if (r) + if (du()) { + const o = new window.ResizeObserver((i) => { + i.length && n(); + }); + return o.observe(r), () => { + r && o.unobserve(r); + }; + } else + return window.addEventListener("resize", n, !1), () => { + window.removeEventListener("resize", n, !1); + }; + }, [ + n, + e + ]); +} +function xo(t, e) { + fe(() => { + if (t && t.ref && e) + return t.ref.current = e.current, () => { + t.ref.current = null; + }; + }); +} +function Kt(t, e) { + for (Dt(t, e) && (t = t.parentElement); t && !Dt(t, e); ) + t = t.parentElement; + return t || document.scrollingElement || document.documentElement; +} +function Dt(t, e) { + let n = window.getComputedStyle(t), r = /(auto|scroll)/.test(n.overflow + n.overflowX + n.overflowY); + return r && e && (r = t.scrollHeight !== t.clientHeight || t.scrollWidth !== t.clientWidth), r; +} +let pu = 0; +const rn = /* @__PURE__ */ new Map(); +function bu(t) { + let [e, n] = Z(void 0); + return fe(() => { + if (!t) + return; + let r = rn.get(t); + if (r) + n(r.element.id); + else { + let o = `react-aria-description-${pu++}`; + n(o); + let i = document.createElement("div"); + i.id = o, i.style.display = "none", i.textContent = t, document.body.appendChild(i), r = { + refCount: 0, + element: i + }, rn.set(t, r); + } + return r.refCount++, () => { + --r.refCount === 0 && (r.element.remove(), rn.delete(t)); + }; + }, [ + t + ]), { + "aria-describedby": t ? e : void 0 + }; +} +function mu(t, e, n, r) { + let o = xe(n), i = n == null; + W(() => { + if (i) + return; + let l = t.current; + return l.addEventListener(e, o, r), () => { + l.removeEventListener(e, o, r); + }; + }, [ + t, + e, + r, + i, + o + ]); +} +function Co(t, e) { + let n = mr(t, e, "left"), r = mr(t, e, "top"), o = e.offsetWidth, i = e.offsetHeight, l = t.scrollLeft, s = t.scrollTop, { borderTopWidth: u, borderLeftWidth: a } = getComputedStyle(t), c = t.scrollLeft + parseInt(a, 10), f = t.scrollTop + parseInt(u, 10), p = c + t.clientWidth, d = f + t.clientHeight; + n <= l ? l = n - parseInt(a, 10) : n + o > p && (l += n + o - p), r <= f ? s = r - parseInt(u, 10) : r + i > d && (s += r + i - d), t.scrollLeft = l, t.scrollTop = s; +} +function mr(t, e, n) { + const r = n === "left" ? "offsetLeft" : "offsetTop"; + let o = 0; + for (; e.offsetParent && (o += e[r], e.offsetParent !== t); ) { + if (e.offsetParent.contains(t)) { + o -= t[r]; + break; + } + e = e.offsetParent; + } + return o; +} +function vr(t, e) { + if (document.contains(t)) { + let l = document.scrollingElement || document.documentElement; + if (window.getComputedStyle(l).overflow === "hidden") { + let u = Kt(t); + for (; t && u && t !== l && u !== l; ) + Co(u, t), t = u, u = Kt(t); + } else { + var n; + let { left: u, top: a } = t.getBoundingClientRect(); + t == null || (n = t.scrollIntoView) === null || n === void 0 || n.call(t, { + block: "nearest" + }); + let { left: c, top: f } = t.getBoundingClientRect(); + if (Math.abs(u - c) > 1 || Math.abs(a - f) > 1) { + var r, o, i; + e == null || (o = e.containingElement) === null || o === void 0 || (r = o.scrollIntoView) === null || r === void 0 || r.call(o, { + block: "center", + inline: "center" + }), (i = t.scrollIntoView) === null || i === void 0 || i.call(t, { + block: "nearest" + }); + } + } + } +} +function Tn(t) { + return t.mozInputSource === 0 && t.isTrusted ? !0 : go() && t.pointerType ? t.type === "click" && t.buttons === 1 : t.detail === 0 && !t.pointerType; +} +function vu(t) { + return !go() && t.width === 0 && t.height === 0 || t.width === 1 && t.height === 1 && t.pressure === 0 && t.detail === 0 && t.pointerType === "mouse"; +} +function Eo(t, e, n) { + let r = I(e), o = xe(() => { + n && n(r.current); + }); + W(() => { + var i; + let l = t == null || (i = t.current) === null || i === void 0 ? void 0 : i.form; + return l == null || l.addEventListener("reset", o), () => { + l == null || l.removeEventListener("reset", o); + }; + }, [ + t, + o + ]); +} +function hu(t, e) { + return e.get ? e.get.call(t) : e.value; +} +function Po(t, e, n) { + if (!e.has(t)) + throw new TypeError("attempted to " + n + " private field on non-instance"); + return e.get(t); +} +function gu(t, e) { + var n = Po(t, e, "get"); + return hu(t, n); +} +function $u(t, e, n) { + if (e.set) + e.set.call(t, n); + else { + if (!e.writable) + throw new TypeError("attempted to set read only private field"); + e.value = n; + } +} +function hr(t, e, n) { + var r = Po(t, e, "set"); + return $u(t, r, n), n; +} +let Xe = "default", _n = "", St = /* @__PURE__ */ new WeakMap(); +function gr(t) { + if (Wt()) { + if (Xe === "default") { + const e = pe(t); + _n = e.documentElement.style.webkitUserSelect, e.documentElement.style.webkitUserSelect = "none"; + } + Xe = "disabled"; + } else + (t instanceof HTMLElement || t instanceof SVGElement) && (St.set(t, t.style.userSelect), t.style.userSelect = "none"); +} +function gt(t) { + if (Wt()) { + if (Xe !== "disabled") + return; + Xe = "restoring", setTimeout(() => { + $o(() => { + if (Xe === "restoring") { + const e = pe(t); + e.documentElement.style.webkitUserSelect === "none" && (e.documentElement.style.webkitUserSelect = _n || ""), _n = "", Xe = "default"; + } + }); + }, 300); + } else if ((t instanceof HTMLElement || t instanceof SVGElement) && t && St.has(t)) { + let e = St.get(t); + t.style.userSelect === "none" && (t.style.userSelect = e), t.getAttribute("style") === "" && t.removeAttribute("style"), St.delete(t); + } +} +const jn = Q.createContext({ + register: () => { + } +}); +jn.displayName = "PressResponderContext"; +function yu(t) { + let e = Se(jn); + if (e) { + let { register: n, ...r } = e; + t = se(r, t), n(); + } + return xo(e, t.ref), t; +} +var $t = /* @__PURE__ */ new WeakMap(); +class yt { + continuePropagation() { + hr(this, $t, !1); + } + get shouldStopPropagation() { + return gu(this, $t); + } + constructor(e, n, r) { + ms(this, $t, { + writable: !0, + value: void 0 + }), hr(this, $t, !0), this.type = e, this.pointerType = n, this.target = r.currentTarget, this.shiftKey = r.shiftKey, this.metaKey = r.metaKey, this.ctrlKey = r.ctrlKey, this.altKey = r.altKey; + } +} +const $r = Symbol("linkClicked"); +function qt(t) { + let { + onPress: e, + onPressChange: n, + onPressStart: r, + onPressEnd: o, + onPressUp: i, + isDisabled: l, + isPressed: s, + preventFocusOnPress: u, + shouldCancelOnPointerExit: a, + allowTextSelectionOnPress: c, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + ref: f, + ...p + } = yu(t), [d, v] = Z(!1), $ = I({ + isPressed: !1, + ignoreEmulatedMouseEvents: !1, + ignoreClickAfterPress: !1, + didFirePressStart: !1, + isTriggeringEvent: !1, + activePointerId: null, + target: null, + isOverTarget: !1, + pointerType: null + }), { addGlobalListener: h, removeAllGlobalListeners: _ } = yo(), w = xe((b, A) => { + let E = $.current; + if (l || E.didFirePressStart) + return !1; + let P = !0; + if (E.isTriggeringEvent = !0, r) { + let B = new yt("pressstart", A, b); + r(B), P = B.shouldStopPropagation; + } + return n && n(!0), E.isTriggeringEvent = !1, E.didFirePressStart = !0, v(!0), P; + }), S = xe((b, A, E = !0) => { + let P = $.current; + if (!P.didFirePressStart) + return !1; + P.ignoreClickAfterPress = !0, P.didFirePressStart = !1, P.isTriggeringEvent = !0; + let B = !0; + if (o) { + let C = new yt("pressend", A, b); + o(C), B = C.shouldStopPropagation; + } + if (n && n(!1), v(!1), e && E && !l) { + let C = new yt("press", A, b); + e(C), B && (B = C.shouldStopPropagation); + } + return P.isTriggeringEvent = !1, B; + }), K = xe((b, A) => { + let E = $.current; + if (l) + return !1; + if (i) { + E.isTriggeringEvent = !0; + let P = new yt("pressup", A, b); + return i(P), E.isTriggeringEvent = !1, P.shouldStopPropagation; + } + return !0; + }), g = xe((b) => { + let A = $.current; + A.isPressed && A.target && (A.isOverTarget && A.pointerType != null && S(Ke(A.target, b), A.pointerType, !1), A.isPressed = !1, A.isOverTarget = !1, A.activePointerId = null, A.pointerType = null, _(), c || gt(A.target)); + }), N = xe((b) => { + a && g(b); + }), R = ne(() => { + let b = $.current, A = { + onKeyDown(P) { + if (on(P.nativeEvent, P.currentTarget) && P.currentTarget.contains(P.target)) { + var B; + xr(P.target, P.key) && P.preventDefault(); + let C = !0; + !b.isPressed && !P.repeat && (b.target = P.currentTarget, b.isPressed = !0, C = w(P, "keyboard"), h(pe(P.currentTarget), "keyup", E, !1)), C && P.stopPropagation(), P.metaKey && Ie() && ((B = b.metaKeyEvents) === null || B === void 0 || B.set(P.key, P.nativeEvent)); + } else + P.key === "Meta" && (b.metaKeyEvents = /* @__PURE__ */ new Map()); + }, + onKeyUp(P) { + on(P.nativeEvent, P.currentTarget) && !P.repeat && P.currentTarget.contains(P.target) && b.target && K(Ke(b.target, P), "keyboard"); + }, + onClick(P) { + if (!(P && !P.currentTarget.contains(P.target)) && P && P.button === 0 && !b.isTriggeringEvent && !Re.isOpening) { + let B = !0; + if (l && P.preventDefault(), !b.ignoreClickAfterPress && !b.ignoreEmulatedMouseEvents && !b.isPressed && (b.pointerType === "virtual" || Tn(P.nativeEvent))) { + !l && !u && Fe(P.currentTarget); + let C = w(P, "virtual"), T = K(P, "virtual"), q = S(P, "virtual"); + B = C && T && q; + } + b.ignoreEmulatedMouseEvents = !1, b.ignoreClickAfterPress = !1, B && P.stopPropagation(); + } + } + }, E = (P) => { + var B; + if (b.isPressed && b.target && on(P, b.target)) { + var C; + xr(P.target, P.key) && P.preventDefault(); + let q = P.target, V = S(Ke(b.target, P), "keyboard", b.target.contains(q)); + _(), V && P.stopPropagation(), P.key !== "Enter" && Hn(b.target) && b.target.contains(q) && !P[$r] && (P[$r] = !0, Re(b.target, P, !1)), b.isPressed = !1, (C = b.metaKeyEvents) === null || C === void 0 || C.delete(P.key); + } else if (P.key === "Meta" && (!((B = b.metaKeyEvents) === null || B === void 0) && B.size)) { + var T; + let q = b.metaKeyEvents; + b.metaKeyEvents = void 0; + for (let V of q.values()) + (T = b.target) === null || T === void 0 || T.dispatchEvent(new KeyboardEvent("keyup", V)); + } + }; + if (typeof PointerEvent < "u") { + A.onPointerDown = (T) => { + if (T.button !== 0 || !T.currentTarget.contains(T.target)) + return; + if (vu(T.nativeEvent)) { + b.pointerType = "virtual"; + return; + } + ln(T.currentTarget) && T.preventDefault(), b.pointerType = T.pointerType; + let q = !0; + b.isPressed || (b.isPressed = !0, b.isOverTarget = !0, b.activePointerId = T.pointerId, b.target = T.currentTarget, !l && !u && Fe(T.currentTarget), c || gr(b.target), q = w(T, b.pointerType), h(pe(T.currentTarget), "pointermove", P, !1), h(pe(T.currentTarget), "pointerup", B, !1), h(pe(T.currentTarget), "pointercancel", C, !1)), q && T.stopPropagation(); + }, A.onMouseDown = (T) => { + T.currentTarget.contains(T.target) && T.button === 0 && (ln(T.currentTarget) && T.preventDefault(), T.stopPropagation()); + }, A.onPointerUp = (T) => { + !T.currentTarget.contains(T.target) || b.pointerType === "virtual" || T.button === 0 && Ue(T, T.currentTarget) && K(T, b.pointerType || T.pointerType); + }; + let P = (T) => { + T.pointerId === b.activePointerId && (b.target && Ue(T, b.target) ? !b.isOverTarget && b.pointerType != null && (b.isOverTarget = !0, w(Ke(b.target, T), b.pointerType)) : b.target && b.isOverTarget && b.pointerType != null && (b.isOverTarget = !1, S(Ke(b.target, T), b.pointerType, !1), N(T))); + }, B = (T) => { + T.pointerId === b.activePointerId && b.isPressed && T.button === 0 && b.target && (Ue(T, b.target) && b.pointerType != null ? S(Ke(b.target, T), b.pointerType) : b.isOverTarget && b.pointerType != null && S(Ke(b.target, T), b.pointerType, !1), b.isPressed = !1, b.isOverTarget = !1, b.activePointerId = null, b.pointerType = null, _(), c || gt(b.target)); + }, C = (T) => { + g(T); + }; + A.onDragStart = (T) => { + T.currentTarget.contains(T.target) && g(T); + }; + } else { + A.onMouseDown = (C) => { + if (C.button !== 0 || !C.currentTarget.contains(C.target)) + return; + if (ln(C.currentTarget) && C.preventDefault(), b.ignoreEmulatedMouseEvents) { + C.stopPropagation(); + return; + } + b.isPressed = !0, b.isOverTarget = !0, b.target = C.currentTarget, b.pointerType = Tn(C.nativeEvent) ? "virtual" : "mouse", !l && !u && Fe(C.currentTarget), w(C, b.pointerType) && C.stopPropagation(), h(pe(C.currentTarget), "mouseup", P, !1); + }, A.onMouseEnter = (C) => { + if (!C.currentTarget.contains(C.target)) + return; + let T = !0; + b.isPressed && !b.ignoreEmulatedMouseEvents && b.pointerType != null && (b.isOverTarget = !0, T = w(C, b.pointerType)), T && C.stopPropagation(); + }, A.onMouseLeave = (C) => { + if (!C.currentTarget.contains(C.target)) + return; + let T = !0; + b.isPressed && !b.ignoreEmulatedMouseEvents && b.pointerType != null && (b.isOverTarget = !1, T = S(C, b.pointerType, !1), N(C)), T && C.stopPropagation(); + }, A.onMouseUp = (C) => { + C.currentTarget.contains(C.target) && !b.ignoreEmulatedMouseEvents && C.button === 0 && K(C, b.pointerType || "mouse"); + }; + let P = (C) => { + if (C.button === 0) { + if (b.isPressed = !1, _(), b.ignoreEmulatedMouseEvents) { + b.ignoreEmulatedMouseEvents = !1; + return; + } + b.target && Ue(C, b.target) && b.pointerType != null ? S(Ke(b.target, C), b.pointerType) : b.target && b.isOverTarget && b.pointerType != null && S(Ke(b.target, C), b.pointerType, !1), b.isOverTarget = !1; + } + }; + A.onTouchStart = (C) => { + if (!C.currentTarget.contains(C.target)) + return; + let T = xu(C.nativeEvent); + if (!T) + return; + b.activePointerId = T.identifier, b.ignoreEmulatedMouseEvents = !0, b.isOverTarget = !0, b.isPressed = !0, b.target = C.currentTarget, b.pointerType = "touch", !l && !u && Fe(C.currentTarget), c || gr(b.target), w(C, b.pointerType) && C.stopPropagation(), h(at(C.currentTarget), "scroll", B, !0); + }, A.onTouchMove = (C) => { + if (!C.currentTarget.contains(C.target)) + return; + if (!b.isPressed) { + C.stopPropagation(); + return; + } + let T = yr(C.nativeEvent, b.activePointerId), q = !0; + T && Ue(T, C.currentTarget) ? !b.isOverTarget && b.pointerType != null && (b.isOverTarget = !0, q = w(C, b.pointerType)) : b.isOverTarget && b.pointerType != null && (b.isOverTarget = !1, q = S(C, b.pointerType, !1), N(C)), q && C.stopPropagation(); + }, A.onTouchEnd = (C) => { + if (!C.currentTarget.contains(C.target)) + return; + if (!b.isPressed) { + C.stopPropagation(); + return; + } + let T = yr(C.nativeEvent, b.activePointerId), q = !0; + T && Ue(T, C.currentTarget) && b.pointerType != null ? (K(C, b.pointerType), q = S(C, b.pointerType)) : b.isOverTarget && b.pointerType != null && (q = S(C, b.pointerType, !1)), q && C.stopPropagation(), b.isPressed = !1, b.activePointerId = null, b.isOverTarget = !1, b.ignoreEmulatedMouseEvents = !0, b.target && !c && gt(b.target), _(); + }, A.onTouchCancel = (C) => { + C.currentTarget.contains(C.target) && (C.stopPropagation(), b.isPressed && g(C)); + }; + let B = (C) => { + b.isPressed && C.target.contains(b.target) && g({ + currentTarget: b.target, + shiftKey: !1, + ctrlKey: !1, + metaKey: !1, + altKey: !1 + }); + }; + A.onDragStart = (C) => { + C.currentTarget.contains(C.target) && g(C); + }; + } + return A; + }, [ + h, + l, + u, + _, + c, + g, + N, + S, + w, + K + ]); + return W(() => () => { + var b; + c || gt((b = $.current.target) !== null && b !== void 0 ? b : void 0); + }, [ + c + ]), { + isPressed: s || d, + pressProps: se(p, R) + }; +} +function Hn(t) { + return t.tagName === "A" && t.hasAttribute("href"); +} +function on(t, e) { + const { key: n, code: r } = t, o = e, i = o.getAttribute("role"); + return (n === "Enter" || n === " " || n === "Spacebar" || r === "Space") && !(o instanceof at(o).HTMLInputElement && !wo(o, n) || o instanceof at(o).HTMLTextAreaElement || o.isContentEditable) && // Links should only trigger with Enter key + !((i === "link" || !i && Hn(o)) && n !== "Enter"); +} +function xu(t) { + const { targetTouches: e } = t; + return e.length > 0 ? e[0] : null; +} +function yr(t, e) { + const n = t.changedTouches; + for (let r = 0; r < n.length; r++) { + const o = n[r]; + if (o.identifier === e) + return o; + } + return null; +} +function Ke(t, e) { + return { + currentTarget: t, + shiftKey: e.shiftKey, + ctrlKey: e.ctrlKey, + metaKey: e.metaKey, + altKey: e.altKey + }; +} +function Cu(t) { + let e = 0, n = 0; + return t.width !== void 0 ? e = t.width / 2 : t.radiusX !== void 0 && (e = t.radiusX), t.height !== void 0 ? n = t.height / 2 : t.radiusY !== void 0 && (n = t.radiusY), { + top: t.clientY - n, + right: t.clientX + e, + bottom: t.clientY + n, + left: t.clientX - e + }; +} +function Eu(t, e) { + return !(t.left > e.right || e.left > t.right || t.top > e.bottom || e.top > t.bottom); +} +function Ue(t, e) { + let n = e.getBoundingClientRect(), r = Cu(t); + return Eu(n, r); +} +function ln(t) { + return !(t instanceof HTMLElement) || !t.hasAttribute("draggable"); +} +function xr(t, e) { + return t instanceof HTMLInputElement ? !wo(t, e) : t instanceof HTMLButtonElement ? t.type !== "submit" && t.type !== "reset" : !Hn(t); +} +const Pu = /* @__PURE__ */ new Set([ + "checkbox", + "radio", + "range", + "color", + "file", + "image", + "button", + "submit", + "reset" +]); +function wo(t, e) { + return t.type === "checkbox" || t.type === "radio" ? e === " " : Pu.has(t.type); +} +function wu({ children: t }) { + let e = ne(() => ({ + register: () => { + } + }), []); + return /* @__PURE__ */ Q.createElement(jn.Provider, { + value: e + }, t); +} +class Su { + isDefaultPrevented() { + return this.nativeEvent.defaultPrevented; + } + preventDefault() { + this.defaultPrevented = !0, this.nativeEvent.preventDefault(); + } + stopPropagation() { + this.nativeEvent.stopPropagation(), this.isPropagationStopped = () => !0; + } + isPropagationStopped() { + return !1; + } + persist() { + } + constructor(e, n) { + this.nativeEvent = n, this.target = n.target, this.currentTarget = n.currentTarget, this.relatedTarget = n.relatedTarget, this.bubbles = n.bubbles, this.cancelable = n.cancelable, this.defaultPrevented = n.defaultPrevented, this.eventPhase = n.eventPhase, this.isTrusted = n.isTrusted, this.timeStamp = n.timeStamp, this.type = e; + } +} +function So(t) { + let e = I({ + isFocused: !1, + observer: null + }); + fe(() => { + const r = e.current; + return () => { + r.observer && (r.observer.disconnect(), r.observer = null); + }; + }, []); + let n = xe((r) => { + t == null || t(r); + }); + return te((r) => { + if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) { + e.current.isFocused = !0; + let o = r.target, i = (l) => { + e.current.isFocused = !1, o.disabled && n(new Su("blur", l)), e.current.observer && (e.current.observer.disconnect(), e.current.observer = null); + }; + o.addEventListener("focusout", i, { + once: !0 + }), e.current.observer = new MutationObserver(() => { + if (e.current.isFocused && o.disabled) { + var l; + (l = e.current.observer) === null || l === void 0 || l.disconnect(); + let s = o === document.activeElement ? null : document.activeElement; + o.dispatchEvent(new FocusEvent("blur", { + relatedTarget: s + })), o.dispatchEvent(new FocusEvent("focusout", { + bubbles: !0, + relatedTarget: s + })); + } + }), e.current.observer.observe(o, { + attributes: !0, + attributeFilter: [ + "disabled" + ] + }); + } + }, [ + n + ]); +} +function Un(t) { + let { isDisabled: e, onFocus: n, onBlur: r, onFocusChange: o } = t; + const i = te((u) => { + if (u.target === u.currentTarget) + return r && r(u), o && o(!1), !0; + }, [ + r, + o + ]), l = So(i), s = te((u) => { + u.target === u.currentTarget && document.activeElement === u.target && (n && n(u), o && o(!0), l(u)); + }, [ + o, + n, + l + ]); + return { + focusProps: { + onFocus: !e && (n || o || r) ? s : void 0, + onBlur: !e && (r || o) ? i : void 0 + } + }; +} +let Ne = null, ct = /* @__PURE__ */ new Set(), Cr = !1, Ve = !1, An = !1; +const Tu = { + Tab: !0, + Escape: !0 +}; +function Yt(t, e) { + for (let n of ct) + n(t, e); +} +function _u(t) { + return !(t.metaKey || !Ie() && t.altKey || t.ctrlKey || t.key === "Control" || t.key === "Shift" || t.key === "Meta"); +} +function Er(t) { + Ve = !0, _u(t) && (Ne = "keyboard", Yt("keyboard", t)); +} +function We(t) { + Ne = "pointer", (t.type === "mousedown" || t.type === "pointerdown") && (Ve = !0, Yt("pointer", t)); +} +function Au(t) { + Tn(t) && (Ve = !0, Ne = "virtual"); +} +function Ku(t) { + t.target === window || t.target === document || (!Ve && !An && (Ne = "virtual", Yt("virtual", t)), Ve = !1, An = !1); +} +function Du() { + Ve = !1, An = !0; +} +function Ft() { + if (typeof window > "u" || Cr) + return; + let t = HTMLElement.prototype.focus; + HTMLElement.prototype.focus = function() { + Ve = !0, t.apply(this, arguments); + }, document.addEventListener("keydown", Er, !0), document.addEventListener("keyup", Er, !0), document.addEventListener("click", Au, !0), window.addEventListener("focus", Ku, !0), window.addEventListener("blur", Du, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", We, !0), document.addEventListener("pointermove", We, !0), document.addEventListener("pointerup", We, !0)) : (document.addEventListener("mousedown", We, !0), document.addEventListener("mousemove", We, !0), document.addEventListener("mouseup", We, !0)), Cr = !0; +} +typeof document < "u" && (document.readyState !== "loading" ? Ft() : document.addEventListener("DOMContentLoaded", Ft)); +function dt() { + return Ne !== "pointer"; +} +function Kn() { + return Ne; +} +function To(t) { + Ne = t, Yt(t, null); +} +function Fu() { + Ft(); + let [t, e] = Z(Ne); + return W(() => { + let n = () => { + e(Ne); + }; + return ct.add(n), () => { + ct.delete(n); + }; + }, []), Ht() ? null : t; +} +const Lu = /* @__PURE__ */ new Set([ + "checkbox", + "radio", + "range", + "color", + "file", + "image", + "button", + "submit", + "reset" +]); +function Mu(t, e, n) { + var r; + return t = t || (n == null ? void 0 : n.target) instanceof HTMLInputElement && !Lu.has(n == null || (r = n.target) === null || r === void 0 ? void 0 : r.type) || (n == null ? void 0 : n.target) instanceof HTMLTextAreaElement || (n == null ? void 0 : n.target) instanceof HTMLElement && (n == null ? void 0 : n.target.isContentEditable), !(t && e === "keyboard" && n instanceof KeyboardEvent && !Tu[n.key]); +} +function Nu(t, e, n) { + Ft(), W(() => { + let r = (o, i) => { + Mu(!!(n != null && n.isTextInput), o, i) && t(dt()); + }; + return ct.add(r), () => { + ct.delete(r); + }; + }, e); +} +function Xt(t) { + let { isDisabled: e, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = t, i = I({ + isFocusWithin: !1 + }), l = te((a) => { + i.current.isFocusWithin && !a.currentTarget.contains(a.relatedTarget) && (i.current.isFocusWithin = !1, n && n(a), o && o(!1)); + }, [ + n, + o, + i + ]), s = So(l), u = te((a) => { + !i.current.isFocusWithin && document.activeElement === a.target && (r && r(a), o && o(!0), i.current.isFocusWithin = !0, s(a)); + }, [ + r, + o, + s + ]); + return e ? { + focusWithinProps: { + // These should not have been null, that would conflict in mergeProps + onFocus: void 0, + onBlur: void 0 + } + } : { + focusWithinProps: { + onFocus: u, + onBlur: l + } + }; +} +let Lt = !1, sn = 0; +function Dn() { + Lt = !0, setTimeout(() => { + Lt = !1; + }, 50); +} +function Pr(t) { + t.pointerType === "touch" && Dn(); +} +function ku() { + if (!(typeof document > "u")) + return typeof PointerEvent < "u" ? document.addEventListener("pointerup", Pr) : document.addEventListener("touchend", Dn), sn++, () => { + sn--, !(sn > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", Pr) : document.removeEventListener("touchend", Dn)); + }; +} +function _o(t) { + let { onHoverStart: e, onHoverChange: n, onHoverEnd: r, isDisabled: o } = t, [i, l] = Z(!1), s = I({ + isHovered: !1, + ignoreEmulatedMouseEvents: !1, + pointerType: "", + target: null + }).current; + W(ku, []); + let { hoverProps: u, triggerHoverEnd: a } = ne(() => { + let c = (d, v) => { + if (s.pointerType = v, o || v === "touch" || s.isHovered || !d.currentTarget.contains(d.target)) + return; + s.isHovered = !0; + let $ = d.currentTarget; + s.target = $, e && e({ + type: "hoverstart", + target: $, + pointerType: v + }), n && n(!0), l(!0); + }, f = (d, v) => { + if (s.pointerType = "", s.target = null, v === "touch" || !s.isHovered) + return; + s.isHovered = !1; + let $ = d.currentTarget; + r && r({ + type: "hoverend", + target: $, + pointerType: v + }), n && n(!1), l(!1); + }, p = {}; + return typeof PointerEvent < "u" ? (p.onPointerEnter = (d) => { + Lt && d.pointerType === "mouse" || c(d, d.pointerType); + }, p.onPointerLeave = (d) => { + !o && d.currentTarget.contains(d.target) && f(d, d.pointerType); + }) : (p.onTouchStart = () => { + s.ignoreEmulatedMouseEvents = !0; + }, p.onMouseEnter = (d) => { + !s.ignoreEmulatedMouseEvents && !Lt && c(d, "mouse"), s.ignoreEmulatedMouseEvents = !1; + }, p.onMouseLeave = (d) => { + !o && d.currentTarget.contains(d.target) && f(d, "mouse"); + }), { + hoverProps: p, + triggerHoverEnd: f + }; + }, [ + e, + n, + r, + o, + s + ]); + return W(() => { + o && a({ + currentTarget: s.target + }, s.pointerType); + }, [ + o + ]), { + hoverProps: u, + isHovered: i + }; +} +function Iu(t) { + let { ref: e, onInteractOutside: n, isDisabled: r, onInteractOutsideStart: o } = t, i = I({ + isPointerDown: !1, + ignoreEmulatedMouseEvents: !1 + }), l = xe((u) => { + n && xt(u, e) && (o && o(u), i.current.isPointerDown = !0); + }), s = xe((u) => { + n && n(u); + }); + W(() => { + let u = i.current; + if (r) + return; + const a = e.current, c = pe(a); + if (typeof PointerEvent < "u") { + let f = (p) => { + u.isPointerDown && xt(p, e) && s(p), u.isPointerDown = !1; + }; + return c.addEventListener("pointerdown", l, !0), c.addEventListener("pointerup", f, !0), () => { + c.removeEventListener("pointerdown", l, !0), c.removeEventListener("pointerup", f, !0); + }; + } else { + let f = (d) => { + u.ignoreEmulatedMouseEvents ? u.ignoreEmulatedMouseEvents = !1 : u.isPointerDown && xt(d, e) && s(d), u.isPointerDown = !1; + }, p = (d) => { + u.ignoreEmulatedMouseEvents = !0, u.isPointerDown && xt(d, e) && s(d), u.isPointerDown = !1; + }; + return c.addEventListener("mousedown", l, !0), c.addEventListener("mouseup", f, !0), c.addEventListener("touchstart", l, !0), c.addEventListener("touchend", p, !0), () => { + c.removeEventListener("mousedown", l, !0), c.removeEventListener("mouseup", f, !0), c.removeEventListener("touchstart", l, !0), c.removeEventListener("touchend", p, !0); + }; + } + }, [ + e, + r, + l, + s + ]); +} +function xt(t, e) { + if (t.button > 0) + return !1; + if (t.target) { + const n = t.target.ownerDocument; + if (!n || !n.documentElement.contains(t.target) || t.target.closest("[data-react-aria-top-layer]")) + return !1; + } + return e.current && !e.current.contains(t.target); +} +function wr(t) { + if (!t) + return; + let e = !0; + return (n) => { + let r = { + ...n, + preventDefault() { + n.preventDefault(); + }, + isDefaultPrevented() { + return n.isDefaultPrevented(); + }, + stopPropagation() { + console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."); + }, + continuePropagation() { + e = !1; + } + }; + t(r), e && n.stopPropagation(); + }; +} +function Ao(t) { + return { + keyboardProps: t.isDisabled ? {} : { + onKeyDown: wr(t.onKeyDown), + onKeyUp: wr(t.onKeyUp) + } + }; +} +const Bu = 500; +function Ko(t) { + let { isDisabled: e, onLongPressStart: n, onLongPressEnd: r, onLongPress: o, threshold: i = Bu, accessibilityDescription: l } = t; + const s = I(); + let { addGlobalListener: u, removeGlobalListener: a } = yo(), { pressProps: c } = qt({ + isDisabled: e, + onPressStart(p) { + if (p.continuePropagation(), (p.pointerType === "mouse" || p.pointerType === "touch") && (n && n({ + ...p, + type: "longpressstart" + }), s.current = setTimeout(() => { + p.target.dispatchEvent(new PointerEvent("pointercancel", { + bubbles: !0 + })), o && o({ + ...p, + type: "longpress" + }), s.current = void 0; + }, i), p.pointerType === "touch")) { + let d = (v) => { + v.preventDefault(); + }; + u(p.target, "contextmenu", d, { + once: !0 + }), u(window, "pointerup", () => { + setTimeout(() => { + a(p.target, "contextmenu", d); + }, 30); + }, { + once: !0 + }); + } + }, + onPressEnd(p) { + s.current && clearTimeout(s.current), r && (p.pointerType === "mouse" || p.pointerType === "touch") && r({ + ...p, + type: "longpressend" + }); + } + }), f = bu(o && !e ? l : void 0); + return { + longPressProps: se(c, f) + }; +} +function ft(t) { + const e = pe(t); + if (Kn() === "virtual") { + let n = e.activeElement; + $o(() => { + e.activeElement === n && t.isConnected && Fe(t); + }); + } else + Fe(t); +} +function Ou(t) { + const e = at(t); + if (!(t instanceof e.HTMLElement) && !(t instanceof e.SVGElement)) + return !1; + let { display: n, visibility: r } = t.style, o = n !== "none" && r !== "hidden" && r !== "collapse"; + if (o) { + const { getComputedStyle: i } = t.ownerDocument.defaultView; + let { display: l, visibility: s } = i(t); + o = l !== "none" && s !== "hidden" && s !== "collapse"; + } + return o; +} +function Ru(t, e) { + return !t.hasAttribute("hidden") && (t.nodeName === "DETAILS" && e && e.nodeName !== "SUMMARY" ? t.hasAttribute("open") : !0); +} +function Do(t, e) { + return t.nodeName !== "#comment" && Ou(t) && Ru(t, e) && (!t.parentElement || Do(t.parentElement, t)); +} +const Sr = /* @__PURE__ */ Q.createContext(null); +let le = null; +function Vu(t) { + let { children: e, contain: n, restoreFocus: r, autoFocus: o } = t, i = I(null), l = I(null), s = I([]), { parentNode: u } = Se(Sr) || {}, a = ne(() => new Fn({ + scopeRef: s + }), [ + s + ]); + fe(() => { + let p = u || be.root; + if (be.getTreeNode(p.scopeRef) && le && !Nt(le, p.scopeRef)) { + let d = be.getTreeNode(le); + d && (p = d); + } + p.addChild(a), be.addNode(a); + }, [ + a, + u + ]), fe(() => { + let p = be.getTreeNode(s); + p && (p.contain = !!n); + }, [ + n + ]), fe(() => { + var p; + let d = (p = i.current) === null || p === void 0 ? void 0 : p.nextSibling, v = []; + for (; d && d !== l.current; ) + v.push(d), d = d.nextSibling; + s.current = v; + }, [ + e + ]), qu(s, r, n), Uu(s, n), Xu(s, r, n), Gu(s, o), W(() => { + const p = pe(s.current ? s.current[0] : void 0).activeElement; + let d = null; + if (ge(p, s.current)) { + for (let v of be.traverse()) + v.scopeRef && ge(p, v.scopeRef.current) && (d = v); + d === be.getTreeNode(s) && (le = d.scopeRef); + } + }, [ + s + ]), fe(() => () => { + var p, d, v; + let $ = (v = (d = be.getTreeNode(s)) === null || d === void 0 || (p = d.parent) === null || p === void 0 ? void 0 : p.scopeRef) !== null && v !== void 0 ? v : null; + (s === le || Nt(s, le)) && (!$ || be.getTreeNode($)) && (le = $), be.removeTreeNode(s); + }, [ + s + ]); + let c = ne(() => zu(s), []), f = ne(() => ({ + focusManager: c, + parentNode: a + }), [ + a, + c + ]); + return /* @__PURE__ */ Q.createElement(Sr.Provider, { + value: f + }, /* @__PURE__ */ Q.createElement("span", { + "data-focus-scope-start": !0, + hidden: !0, + ref: i + }), e, /* @__PURE__ */ Q.createElement("span", { + "data-focus-scope-end": !0, + hidden: !0, + ref: l + })); +} +function zu(t) { + return { + focusNext(e = {}) { + let n = t.current, { from: r, tabbable: o, wrap: i, accept: l } = e, s = r || pe(n[0]).activeElement, u = n[0].previousElementSibling, a = Be(n), c = Me(a, { + tabbable: o, + accept: l + }, n); + c.currentNode = ge(s, n) ? s : u; + let f = c.nextNode(); + return !f && i && (c.currentNode = u, f = c.nextNode()), f && Le(f, !0), f; + }, + focusPrevious(e = {}) { + let n = t.current, { from: r, tabbable: o, wrap: i, accept: l } = e, s = r || pe(n[0]).activeElement, u = n[n.length - 1].nextElementSibling, a = Be(n), c = Me(a, { + tabbable: o, + accept: l + }, n); + c.currentNode = ge(s, n) ? s : u; + let f = c.previousNode(); + return !f && i && (c.currentNode = u, f = c.previousNode()), f && Le(f, !0), f; + }, + focusFirst(e = {}) { + let n = t.current, { tabbable: r, accept: o } = e, i = Be(n), l = Me(i, { + tabbable: r, + accept: o + }, n); + l.currentNode = n[0].previousElementSibling; + let s = l.nextNode(); + return s && Le(s, !0), s; + }, + focusLast(e = {}) { + let n = t.current, { tabbable: r, accept: o } = e, i = Be(n), l = Me(i, { + tabbable: r, + accept: o + }, n); + l.currentNode = n[n.length - 1].nextElementSibling; + let s = l.previousNode(); + return s && Le(s, !0), s; + } + }; +} +const Wn = [ + "input:not([disabled]):not([type=hidden])", + "select:not([disabled])", + "textarea:not([disabled])", + "button:not([disabled])", + "a[href]", + "area[href]", + "summary", + "iframe", + "object", + "embed", + "audio[controls]", + "video[controls]", + "[contenteditable]" +], ju = Wn.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])"; +Wn.push('[tabindex]:not([tabindex="-1"]):not([disabled])'); +const Hu = Wn.join(':not([hidden]):not([tabindex="-1"]),'); +function Be(t) { + return t[0].parentElement; +} +function lt(t) { + let e = be.getTreeNode(le); + for (; e && e.scopeRef !== t; ) { + if (e.contain) + return !1; + e = e.parent; + } + return !0; +} +function Uu(t, e) { + let n = I(), r = I(); + fe(() => { + let o = t.current; + if (!e) { + r.current && (cancelAnimationFrame(r.current), r.current = void 0); + return; + } + const i = pe(o ? o[0] : void 0); + let l = (a) => { + if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !lt(t)) + return; + let c = i.activeElement, f = t.current; + if (!f || !ge(c, f)) + return; + let p = Be(f), d = Me(p, { + tabbable: !0 + }, f); + if (!c) + return; + d.currentNode = c; + let v = a.shiftKey ? d.previousNode() : d.nextNode(); + v || (d.currentNode = a.shiftKey ? f[f.length - 1].nextElementSibling : f[0].previousElementSibling, v = a.shiftKey ? d.previousNode() : d.nextNode()), a.preventDefault(), v && Le(v, !0); + }, s = (a) => { + (!le || Nt(le, t)) && ge(a.target, t.current) ? (le = t, n.current = a.target) : lt(t) && !Mt(a.target, t) ? n.current ? n.current.focus() : le && le.current && kt(le.current) : lt(t) && (n.current = a.target); + }, u = (a) => { + r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => { + if (i.activeElement && lt(t) && !Mt(i.activeElement, t)) + if (le = t, i.body.contains(a.target)) { + var c; + n.current = a.target, (c = n.current) === null || c === void 0 || c.focus(); + } else + le.current && kt(le.current); + }); + }; + return i.addEventListener("keydown", l, !1), i.addEventListener("focusin", s, !1), o == null || o.forEach((a) => a.addEventListener("focusin", s, !1)), o == null || o.forEach((a) => a.addEventListener("focusout", u, !1)), () => { + i.removeEventListener("keydown", l, !1), i.removeEventListener("focusin", s, !1), o == null || o.forEach((a) => a.removeEventListener("focusin", s, !1)), o == null || o.forEach((a) => a.removeEventListener("focusout", u, !1)); + }; + }, [ + t, + e + ]), fe(() => () => { + r.current && cancelAnimationFrame(r.current); + }, [ + r + ]); +} +function Fo(t) { + return Mt(t); +} +function ge(t, e) { + return !t || !e ? !1 : e.some((n) => n.contains(t)); +} +function Mt(t, e = null) { + if (t instanceof Element && t.closest("[data-react-aria-top-layer]")) + return !0; + for (let { scopeRef: n } of be.traverse(be.getTreeNode(e))) + if (n && ge(t, n.current)) + return !0; + return !1; +} +function Wu(t) { + return Mt(t, le); +} +function Nt(t, e) { + var n; + let r = (n = be.getTreeNode(e)) === null || n === void 0 ? void 0 : n.parent; + for (; r; ) { + if (r.scopeRef === t) + return !0; + r = r.parent; + } + return !1; +} +function Le(t, e = !1) { + if (t != null && !e) + try { + ft(t); + } catch { + } + else if (t != null) + try { + t.focus(); + } catch { + } +} +function kt(t, e = !0) { + let n = t[0].previousElementSibling, r = Be(t), o = Me(r, { + tabbable: e + }, t); + o.currentNode = n; + let i = o.nextNode(); + e && !i && (r = Be(t), o = Me(r, { + tabbable: !1 + }, t), o.currentNode = n, i = o.nextNode()), Le(i); +} +function Gu(t, e) { + const n = Q.useRef(e); + W(() => { + if (n.current) { + le = t; + const r = pe(t.current ? t.current[0] : void 0); + !ge(r.activeElement, le.current) && t.current && kt(t.current); + } + n.current = !1; + }, [ + t + ]); +} +function qu(t, e, n) { + fe(() => { + if (e || n) + return; + let r = t.current; + const o = pe(r ? r[0] : void 0); + let i = (l) => { + let s = l.target; + ge(s, t.current) ? le = t : Fo(s) || (le = null); + }; + return o.addEventListener("focusin", i, !1), r == null || r.forEach((l) => l.addEventListener("focusin", i, !1)), () => { + o.removeEventListener("focusin", i, !1), r == null || r.forEach((l) => l.removeEventListener("focusin", i, !1)); + }; + }, [ + t, + e, + n + ]); +} +function Yu(t) { + let e = be.getTreeNode(le); + for (; e && e.scopeRef !== t; ) { + if (e.nodeToRestore) + return !1; + e = e.parent; + } + return (e == null ? void 0 : e.scopeRef) === t; +} +function Xu(t, e, n) { + const r = I(typeof document < "u" ? pe(t.current ? t.current[0] : void 0).activeElement : null); + fe(() => { + let o = t.current; + const i = pe(o ? o[0] : void 0); + if (!e || n) + return; + let l = () => { + (!le || Nt(le, t)) && ge(i.activeElement, t.current) && (le = t); + }; + return i.addEventListener("focusin", l, !1), o == null || o.forEach((s) => s.addEventListener("focusin", l, !1)), () => { + i.removeEventListener("focusin", l, !1), o == null || o.forEach((s) => s.removeEventListener("focusin", l, !1)); + }; + }, [ + t, + n + ]), fe(() => { + const o = pe(t.current ? t.current[0] : void 0); + if (!e) + return; + let i = (l) => { + if (l.key !== "Tab" || l.altKey || l.ctrlKey || l.metaKey || !lt(t)) + return; + let s = o.activeElement; + if (!ge(s, t.current)) + return; + let u = be.getTreeNode(t); + if (!u) + return; + let a = u.nodeToRestore, c = Me(o.body, { + tabbable: !0 + }); + c.currentNode = s; + let f = l.shiftKey ? c.previousNode() : c.nextNode(); + if ((!a || !o.body.contains(a) || a === o.body) && (a = void 0, u.nodeToRestore = void 0), (!f || !ge(f, t.current)) && a) { + c.currentNode = a; + do + f = l.shiftKey ? c.previousNode() : c.nextNode(); + while (ge(f, t.current)); + l.preventDefault(), l.stopPropagation(), f ? Le(f, !0) : Fo(a) ? Le(a, !0) : s.blur(); + } + }; + return n || o.addEventListener("keydown", i, !0), () => { + n || o.removeEventListener("keydown", i, !0); + }; + }, [ + t, + e, + n + ]), fe(() => { + const o = pe(t.current ? t.current[0] : void 0); + if (!e) + return; + let i = be.getTreeNode(t); + if (i) { + var l; + return i.nodeToRestore = (l = r.current) !== null && l !== void 0 ? l : void 0, () => { + let s = be.getTreeNode(t); + if (!s) + return; + let u = s.nodeToRestore; + if (e && u && // eslint-disable-next-line react-hooks/exhaustive-deps + (ge(o.activeElement, t.current) || o.activeElement === o.body && Yu(t))) { + let a = be.clone(); + requestAnimationFrame(() => { + if (o.activeElement === o.body) { + let c = a.getTreeNode(t); + for (; c; ) { + if (c.nodeToRestore && c.nodeToRestore.isConnected) { + Le(c.nodeToRestore); + return; + } + c = c.parent; + } + for (c = a.getTreeNode(t); c; ) { + if (c.scopeRef && c.scopeRef.current && be.getTreeNode(c.scopeRef)) { + kt(c.scopeRef.current, !0); + return; + } + c = c.parent; + } + } + }); + } + }; + } + }, [ + t, + e + ]); +} +function Me(t, e, n) { + let r = e != null && e.tabbable ? Hu : ju, o = pe(t).createTreeWalker(t, NodeFilter.SHOW_ELEMENT, { + acceptNode(i) { + var l; + return !(e == null || (l = e.from) === null || l === void 0) && l.contains(i) ? NodeFilter.FILTER_REJECT : i.matches(r) && Do(i) && (!n || ge(i, n)) && (!(e != null && e.accept) || e.accept(i)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + return e != null && e.from && (o.currentNode = e.from), o; +} +class Gn { + get size() { + return this.fastMap.size; + } + getTreeNode(e) { + return this.fastMap.get(e); + } + addTreeNode(e, n, r) { + let o = this.fastMap.get(n ?? null); + if (!o) + return; + let i = new Fn({ + scopeRef: e + }); + o.addChild(i), i.parent = o, this.fastMap.set(e, i), r && (i.nodeToRestore = r); + } + addNode(e) { + this.fastMap.set(e.scopeRef, e); + } + removeTreeNode(e) { + if (e === null) + return; + let n = this.fastMap.get(e); + if (!n) + return; + let r = n.parent; + for (let i of this.traverse()) + i !== n && n.nodeToRestore && i.nodeToRestore && n.scopeRef && n.scopeRef.current && ge(i.nodeToRestore, n.scopeRef.current) && (i.nodeToRestore = n.nodeToRestore); + let o = n.children; + r && (r.removeChild(n), o.size > 0 && o.forEach((i) => r && r.addChild(i))), this.fastMap.delete(n.scopeRef); + } + // Pre Order Depth First + *traverse(e = this.root) { + if (e.scopeRef != null && (yield e), e.children.size > 0) + for (let n of e.children) + yield* this.traverse(n); + } + clone() { + var e; + let n = new Gn(); + var r; + for (let o of this.traverse()) + n.addTreeNode(o.scopeRef, (r = (e = o.parent) === null || e === void 0 ? void 0 : e.scopeRef) !== null && r !== void 0 ? r : null, o.nodeToRestore); + return n; + } + constructor() { + this.fastMap = /* @__PURE__ */ new Map(), this.root = new Fn({ + scopeRef: null + }), this.fastMap.set(null, this.root); + } +} +class Fn { + addChild(e) { + this.children.add(e), e.parent = this; + } + removeChild(e) { + this.children.delete(e), e.parent = void 0; + } + constructor(e) { + this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = e.scopeRef; + } +} +let be = new Gn(); +function qn(t = {}) { + let { autoFocus: e = !1, isTextInput: n, within: r } = t, o = I({ + isFocused: !1, + isFocusVisible: e || dt() + }), [i, l] = Z(!1), [s, u] = Z(() => o.current.isFocused && o.current.isFocusVisible), a = te(() => u(o.current.isFocused && o.current.isFocusVisible), []), c = te((d) => { + o.current.isFocused = d, l(d), a(); + }, [ + a + ]); + Nu((d) => { + o.current.isFocusVisible = d, a(); + }, [], { + isTextInput: n + }); + let { focusProps: f } = Un({ + isDisabled: r, + onFocusChange: c + }), { focusWithinProps: p } = Xt({ + isDisabled: !r, + onFocusWithinChange: c + }); + return { + isFocused: i, + isFocusVisible: s, + focusProps: r ? p : f + }; +} +let Zu = /* @__PURE__ */ Q.createContext(null); +function Ju(t) { + let e = Se(Zu) || {}; + xo(e, t); + let { ref: n, ...r } = e; + return r; +} +function Lo(t, e) { + let { focusProps: n } = Un(t), { keyboardProps: r } = Ao(t), o = se(n, r), i = Ju(e), l = t.isDisabled ? {} : i, s = I(t.autoFocus); + return W(() => { + s.current && e.current && ft(e.current), s.current = !1; + }, [ + e + ]), { + focusableProps: se({ + ...o, + tabIndex: t.excludeFromTabOrder && !t.isDisabled ? -1 : void 0 + }, l) + }; +} +const Qu = /* @__PURE__ */ new Set([ + "Arab", + "Syrc", + "Samr", + "Mand", + "Thaa", + "Mend", + "Nkoo", + "Adlm", + "Rohg", + "Hebr" +]), ea = /* @__PURE__ */ new Set([ + "ae", + "ar", + "arc", + "bcc", + "bqi", + "ckb", + "dv", + "fa", + "glk", + "he", + "ku", + "mzn", + "nqo", + "pnb", + "ps", + "sd", + "ug", + "ur", + "yi" +]); +function ta(t) { + if (Intl.Locale) { + let n = new Intl.Locale(t).maximize(), r = typeof n.getTextInfo == "function" ? n.getTextInfo() : n.textInfo; + if (r) + return r.direction === "rtl"; + if (n.script) + return Qu.has(n.script); + } + let e = t.split("-")[0]; + return ea.has(e); +} +const na = Symbol.for("react-aria.i18n.locale"); +function Mo() { + let t = typeof window < "u" && window[na] || typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US"; + try { + Intl.DateTimeFormat.supportedLocalesOf([ + t + ]); + } catch { + t = "en-US"; + } + return { + locale: t, + direction: ta(t) ? "rtl" : "ltr" + }; +} +let Ln = Mo(), st = /* @__PURE__ */ new Set(); +function Tr() { + Ln = Mo(); + for (let t of st) + t(Ln); +} +function ra() { + let t = Ht(), [e, n] = Z(Ln); + return W(() => (st.size === 0 && window.addEventListener("languagechange", Tr), st.add(n), () => { + st.delete(n), st.size === 0 && window.removeEventListener("languagechange", Tr); + }), []), t ? { + locale: "en-US", + direction: "ltr" + } : e; +} +const oa = /* @__PURE__ */ Q.createContext(null); +function Zt() { + let t = ra(); + return Se(oa) || t; +} +const _r = /* @__PURE__ */ new WeakMap(); +function ia(t) { + let e = _r.get(t); + return e || (e = new jt(t), _r.set(t, e)), e; +} +function la(t, e) { + return e && jt.getGlobalDictionaryForPackage(e) || ia(t); +} +function Yn(t, e) { + let { locale: n } = Zt(), r = la(t, e); + return ne(() => new Ds(n, r), [ + n, + r + ]); +} +let un = /* @__PURE__ */ new Map(); +function Xn(t) { + let { locale: e } = Zt(), n = e + (t ? Object.entries(t).sort((o, i) => o[0] < i[0] ? -1 : 1).join() : ""); + if (un.has(n)) + return un.get(n); + let r = new Intl.Collator(e, t); + return un.set(n, r), r; +} +function sa(t) { + let e = Xn({ + usage: "search", + ...t + }), n = te((i, l) => l.length === 0 ? !0 : (i = i.normalize("NFC"), l = l.normalize("NFC"), e.compare(i.slice(0, l.length), l) === 0), [ + e + ]), r = te((i, l) => l.length === 0 ? !0 : (i = i.normalize("NFC"), l = l.normalize("NFC"), e.compare(i.slice(-l.length), l) === 0), [ + e + ]), o = te((i, l) => { + if (l.length === 0) + return !0; + i = i.normalize("NFC"), l = l.normalize("NFC"); + let s = 0, u = l.length; + for (; s + u <= i.length; s++) { + let a = i.slice(s, s + u); + if (e.compare(l, a) === 0) + return !0; + } + return !1; + }, [ + e + ]); + return ne(() => ({ + startsWith: n, + endsWith: r, + contains: o + }), [ + n, + r, + o + ]); +} +function No(t, e) { + let { + elementType: n = "button", + isDisabled: r, + onPress: o, + onPressStart: i, + onPressEnd: l, + onPressUp: s, + onPressChange: u, + preventFocusOnPress: a, + allowFocusWhenDisabled: c, + // @ts-ignore + onClick: f, + href: p, + target: d, + rel: v, + type: $ = "button" + } = t, h; + n === "button" ? h = { + type: $, + disabled: r + } : h = { + role: "button", + tabIndex: r ? void 0 : 0, + href: n === "a" && r ? void 0 : p, + target: n === "a" ? d : void 0, + type: n === "input" ? $ : void 0, + disabled: n === "input" ? r : void 0, + "aria-disabled": !r || n === "input" ? void 0 : r, + rel: n === "a" ? v : void 0 + }; + let { pressProps: _, isPressed: w } = qt({ + onPressStart: i, + onPressEnd: l, + onPressChange: u, + onPress: o, + onPressUp: s, + isDisabled: r, + preventFocusOnPress: a, + ref: e + }), { focusableProps: S } = Lo(t, e); + c && (S.tabIndex = r ? -1 : S.tabIndex); + let K = se(S, _, ze(t, { + labelable: !0 + })); + return { + isPressed: w, + buttonProps: se(h, K, { + "aria-haspopup": t["aria-haspopup"], + "aria-expanded": t["aria-expanded"], + "aria-controls": t["aria-controls"], + "aria-pressed": t["aria-pressed"], + onClick: (g) => { + f && (f(g), console.warn("onClick is deprecated, please use onPress")); + } + }) + }; +} +const ko = 7e3; +let an = null; +function cn(t, e = "assertive", n = ko) { + an || (an = new ua()), an.announce(t, e, n); +} +class ua { + createLog(e) { + let n = document.createElement("div"); + return n.setAttribute("role", "log"), n.setAttribute("aria-live", e), n.setAttribute("aria-relevant", "additions"), n; + } + destroy() { + this.node && (document.body.removeChild(this.node), this.node = null); + } + announce(e, n = "assertive", r = ko) { + if (!this.node) + return; + let o = document.createElement("div"); + o.textContent = e, n === "assertive" ? this.assertiveLog.appendChild(o) : this.politeLog.appendChild(o), e !== "" && setTimeout(() => { + o.remove(); + }, r); + } + clear(e) { + this.node && ((!e || e === "assertive") && (this.assertiveLog.innerHTML = ""), (!e || e === "polite") && (this.politeLog.innerHTML = "")); + } + constructor() { + this.node = document.createElement("div"), this.node.dataset.liveAnnouncer = "true", Object.assign(this.node.style, { + border: 0, + clip: "rect(0 0 0 0)", + clipPath: "inset(50%)", + height: "1px", + margin: "-1px", + overflow: "hidden", + padding: 0, + position: "absolute", + width: "1px", + whiteSpace: "nowrap" + }), this.assertiveLog = this.createLog("assertive"), this.node.appendChild(this.assertiveLog), this.politeLog = this.createLog("polite"), this.node.appendChild(this.politeLog), document.body.prepend(this.node); + } +} +function Io(t, e, n) { + let { validationBehavior: r, focus: o } = t; + fe(() => { + if (r === "native" && (n != null && n.current)) { + let u = e.realtimeValidation.isInvalid ? e.realtimeValidation.validationErrors.join(" ") || "Invalid value." : ""; + n.current.setCustomValidity(u), n.current.hasAttribute("title") || (n.current.title = ""), e.realtimeValidation.isInvalid || e.updateValidation(ca(n.current)); + } + }); + let i = xe(() => { + e.resetValidation(); + }), l = xe((u) => { + var a; + e.displayValidation.isInvalid || e.commitValidation(); + let c = n == null || (a = n.current) === null || a === void 0 ? void 0 : a.form; + if (!u.defaultPrevented && n && c && da(c) === n.current) { + var f; + o ? o() : (f = n.current) === null || f === void 0 || f.focus(), To("keyboard"); + } + u.preventDefault(); + }), s = xe(() => { + e.commitValidation(); + }); + W(() => { + let u = n == null ? void 0 : n.current; + if (!u) + return; + let a = u.form; + return u.addEventListener("invalid", l), u.addEventListener("change", s), a == null || a.addEventListener("reset", i), () => { + u.removeEventListener("invalid", l), u.removeEventListener("change", s), a == null || a.removeEventListener("reset", i); + }; + }, [ + n, + l, + s, + i, + r + ]); +} +function aa(t) { + let e = t.validity; + return { + badInput: e.badInput, + customError: e.customError, + patternMismatch: e.patternMismatch, + rangeOverflow: e.rangeOverflow, + rangeUnderflow: e.rangeUnderflow, + stepMismatch: e.stepMismatch, + tooLong: e.tooLong, + tooShort: e.tooShort, + typeMismatch: e.typeMismatch, + valueMissing: e.valueMissing, + valid: e.valid + }; +} +function ca(t) { + return { + isInvalid: !t.validity.valid, + validationDetails: aa(t), + validationErrors: t.validationMessage ? [ + t.validationMessage + ] : [] + }; +} +function da(t) { + for (let e = 0; e < t.elements.length; e++) { + let n = t.elements[e]; + if (!n.validity.valid) + return n; + } + return null; +} +function Bo(t) { + let { id: e, label: n, "aria-labelledby": r, "aria-label": o, labelElementType: i = "label" } = t; + e = Ae(e); + let l = Ae(), s = {}; + n ? (r = r ? `${l} ${r}` : l, s = { + id: l, + htmlFor: i === "label" ? e : void 0 + }) : !r && !o && console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility"); + let u = At({ + id: e, + "aria-label": o, + "aria-labelledby": r + }); + return { + labelProps: s, + fieldProps: u + }; +} +function Oo(t) { + let { description: e, errorMessage: n, isInvalid: r, validationState: o } = t, { labelProps: i, fieldProps: l } = Bo(t), s = Oe([ + !!e, + !!n, + r, + o + ]), u = Oe([ + !!e, + !!n, + r, + o + ]); + return l = se(l, { + "aria-describedby": [ + s, + // Use aria-describedby for error message because aria-errormessage is unsupported using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268 + u, + t["aria-describedby"] + ].filter(Boolean).join(" ") || void 0 + }), { + labelProps: i, + fieldProps: l, + descriptionProps: { + id: s + }, + errorMessageProps: { + id: u + } + }; +} +var Ro = {}; +Ro = { + buttonLabel: "Űč۱۶ Ű§Ù„Ù…Ù‚ŰȘ۱ۭۧŰȘ", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} ŰźÙŠŰ§Ű±`, + other: () => `${e.number(t.optionCount)} ŰźÙŠŰ§Ű±Ű§ŰȘ` + })} مŰȘۭۧ۩.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Ű§Ù„Ù…ŰŹÙ…ÙˆŰčŰ© Ű§Ù„Ù…ŰŻŰźÙ„Ű© ${t.groupTitle}, مŰč ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} ŰźÙŠŰ§Ű±`, + other: () => `${e.number(t.groupCount)} ŰźÙŠŰ§Ű±Ű§ŰȘ` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", Ù…Ű­ŰŻŰŻ", + other: "" + }, t.isSelected)}`, + listboxLabel: "مقŰȘ۱ۭۧŰȘ", + selectedAnnouncement: (t) => `${t.optionText}ی Ù…Ű­ŰŻŰŻ` +}; +var Vo = {}; +Vo = { + buttonLabel: "ĐŸĐŸĐșажО ĐżŃ€Đ”ĐŽĐ»ĐŸĐ¶Đ”ĐœĐžŃ", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} ĐŸĐżŃ†ĐžŃ`, + other: () => `${e.number(t.optionCount)} ĐŸĐżŃ†ĐžĐž` + })} ĐœĐ° Ń€Đ°Đ·ĐżĐŸĐ»ĐŸĐ¶Đ”ĐœĐžĐ”.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `ВъĐČĐ”ĐŽĐ”ĐœĐ° група ${t.groupTitle}, с ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} ĐŸĐżŃ†ĐžŃ`, + other: () => `${e.number(t.groupCount)} ĐŸĐżŃ†ĐžĐž` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", ĐžĐ·Đ±Ń€Đ°ĐœĐž", + other: "" + }, t.isSelected)}`, + listboxLabel: "ĐŸŃ€Đ”ĐŽĐ»ĐŸĐ¶Đ”ĐœĐžŃ", + selectedAnnouncement: (t) => `${t.optionText}, ĐžĐ·Đ±Ń€Đ°ĐœĐž` +}; +var zo = {}; +zo = { + buttonLabel: "Zobrazit doporučenĂ­", + countAnnouncement: (t, e) => `K dispozici ${e.plural(t.optionCount, { + one: () => `je ${e.number(t.optionCount)} moĆŸnost`, + other: () => `jsou/je ${e.number(t.optionCount)} moĆŸnosti/-Ă­` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `ZadanĂĄ skupina „${t.groupTitle}“ ${e.plural(t.groupCount, { + one: () => `s ${e.number(t.groupCount)} moĆŸnostĂ­`, + other: () => `se ${e.number(t.groupCount)} moĆŸnostmi` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: " (vybrĂĄno)", + other: "" + }, t.isSelected)}`, + listboxLabel: "NĂĄvrhy", + selectedAnnouncement: (t) => `${t.optionText}, vybrĂĄno` +}; +var jo = {}; +jo = { + buttonLabel: "Vis forslag", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} mulighed tilgĂŠngelig`, + other: () => `${e.number(t.optionCount)} muligheder tilgĂŠngelige` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Angivet gruppe ${t.groupTitle}, med ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} mulighed`, + other: () => `${e.number(t.groupCount)} muligheder` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", valgt", + other: "" + }, t.isSelected)}`, + listboxLabel: "Forslag", + selectedAnnouncement: (t) => `${t.optionText}, valgt` +}; +var Ho = {}; +Ho = { + buttonLabel: "Empfehlungen anzeigen", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} Option`, + other: () => `${e.number(t.optionCount)} Optionen` + })} verfĂŒgbar.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Eingetretene Gruppe ${t.groupTitle}, mit ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} Option`, + other: () => `${e.number(t.groupCount)} Optionen` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", ausgewĂ€hlt", + other: "" + }, t.isSelected)}`, + listboxLabel: "Empfehlungen", + selectedAnnouncement: (t) => `${t.optionText}, ausgewĂ€hlt` +}; +var Uo = {}; +Uo = { + buttonLabel: "Î ÏÎżÎČολΟ Ï€ÏÎżÏ„ÎŹÏƒÎ”Ï‰Îœ", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} ΔπÎčλογΟ`, + other: () => `${e.number(t.optionCount)} ΔπÎčÎ»ÎżÎłÎ­Ï‚ ` + })} ÎŽÎčαΞέσÎčΌΔς.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `ΕÎčÏƒÎ±ÎłÎŒÎ­ÎœÎ· ÎżÎŒÎŹÎŽÎ± ${t.groupTitle}, ΌΔ ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} ΔπÎčλογΟ`, + other: () => `${e.number(t.groupCount)} ΔπÎčÎ»ÎżÎłÎ­Ï‚` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", ΔπÎčÎ»Î”ÎłÎŒÎ­ÎœÎż", + other: "" + }, t.isSelected)}`, + listboxLabel: "Î ÏÎżÏ„ÎŹÏƒÎ”Îčς", + selectedAnnouncement: (t) => `${t.optionText}, ΔπÎčλέχΞηÎșΔ` +}; +var Wo = {}; +Wo = { + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Entered group ${t.groupTitle}, with ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} option`, + other: () => `${e.number(t.groupCount)} options` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", selected", + other: "" + }, t.isSelected)}`, + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} option`, + other: () => `${e.number(t.optionCount)} options` + })} available.`, + selectedAnnouncement: (t) => `${t.optionText}, selected`, + buttonLabel: "Show suggestions", + listboxLabel: "Suggestions" +}; +var Go = {}; +Go = { + buttonLabel: "Mostrar sugerencias", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opciĂłn`, + other: () => `${e.number(t.optionCount)} opciones` + })} disponible(s).`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Se ha unido al grupo ${t.groupTitle}, con ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opciĂłn`, + other: () => `${e.number(t.groupCount)} opciones` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", seleccionado", + other: "" + }, t.isSelected)}`, + listboxLabel: "Sugerencias", + selectedAnnouncement: (t) => `${t.optionText}, seleccionado` +}; +var qo = {}; +qo = { + buttonLabel: "Kuva soovitused", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} valik`, + other: () => `${e.number(t.optionCount)} valikud` + })} saadaval.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Sisestatud rĂŒhm ${t.groupTitle}, valikuga ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} valik`, + other: () => `${e.number(t.groupCount)} valikud` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", valitud", + other: "" + }, t.isSelected)}`, + listboxLabel: "Soovitused", + selectedAnnouncement: (t) => `${t.optionText}, valitud` +}; +var Yo = {}; +Yo = { + buttonLabel: "NĂ€ytĂ€ ehdotukset", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} vaihtoehto`, + other: () => `${e.number(t.optionCount)} vaihtoehdot` + })} saatavilla.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Mentiin ryhmÀÀn ${t.groupTitle}, ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} vaihtoehdon`, + other: () => `${e.number(t.groupCount)} vaihtoehdon` + })} kanssa.`, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", valittu", + other: "" + }, t.isSelected)}`, + listboxLabel: "Ehdotukset", + selectedAnnouncement: (t) => `${t.optionText}, valittu` +}; +var Xo = {}; +Xo = { + buttonLabel: "Afficher les suggestions", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} option`, + other: () => `${e.number(t.optionCount)} options` + })} disponible(s).`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Groupe ${t.groupTitle} saisi, avec ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} option`, + other: () => `${e.number(t.groupCount)} options` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", sĂ©lectionnĂ©(s)", + other: "" + }, t.isSelected)}`, + listboxLabel: "Suggestions", + selectedAnnouncement: (t) => `${t.optionText}, sĂ©lectionnĂ©` +}; +var Zo = {}; +Zo = { + buttonLabel: "Ś”ŚŠŚ’ Ś”ŚŠŚąŚ•ŚȘ", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `ŚŚ€Ś©ŚšŚ•ŚȘ ${e.number(t.optionCount)}`, + other: () => `${e.number(t.optionCount)} ŚŚ€Ś©ŚšŚ•Ś™Ś•ŚȘ` + })} Ś‘ŚžŚŠŚ‘ Ś–ŚžŚ™ŚŸ.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Ś Ś›Ś ŚĄ ŚœŚ§Ś‘Ś•ŚŠŚ” ${t.groupTitle}, ŚąŚ ${e.plural(t.groupCount, { + one: () => `ŚŚ€Ś©ŚšŚ•ŚȘ ${e.number(t.groupCount)}`, + other: () => `${e.number(t.groupCount)} ŚŚ€Ś©ŚšŚ•Ś™Ś•ŚȘ` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", Ś Ś‘Ś—Śš", + other: "" + }, t.isSelected)}`, + listboxLabel: "Ś”ŚŠŚąŚ•ŚȘ", + selectedAnnouncement: (t) => `${t.optionText}, Ś Ś‘Ś—Śš` +}; +var Jo = {}; +Jo = { + buttonLabel: "PrikaĆŸi prijedloge", + countAnnouncement: (t, e) => `Dostupno joĆĄ: ${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opcija`, + other: () => `${e.number(t.optionCount)} opcije/a` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Unesena skupina ${t.groupTitle}, s ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opcijom`, + other: () => `${e.number(t.groupCount)} opcije/a` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", odabranih", + other: "" + }, t.isSelected)}`, + listboxLabel: "Prijedlozi", + selectedAnnouncement: (t) => `${t.optionText}, odabrano` +}; +var Qo = {}; +Qo = { + buttonLabel: "Javaslatok megjelenĂ­tĂ©se", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} lehetƑsĂ©g`, + other: () => `${e.number(t.optionCount)} lehetƑsĂ©g` + })} ĂĄll rendelkezĂ©sre.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `BelĂ©pett a(z) ${t.groupTitle} csoportba, amely ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} lehetƑsĂ©get`, + other: () => `${e.number(t.groupCount)} lehetƑsĂ©get` + })} tartalmaz. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", kijelölve", + other: "" + }, t.isSelected)}`, + listboxLabel: "Javaslatok", + selectedAnnouncement: (t) => `${t.optionText}, kijelölve` +}; +var ei = {}; +ei = { + buttonLabel: "Mostra suggerimenti", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opzione disponibile`, + other: () => `${e.number(t.optionCount)} opzioni disponibili` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Ingresso nel gruppo ${t.groupTitle}, con ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opzione`, + other: () => `${e.number(t.groupCount)} opzioni` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", selezionato", + other: "" + }, t.isSelected)}`, + listboxLabel: "Suggerimenti", + selectedAnnouncement: (t) => `${t.optionText}, selezionato` +}; +var ti = {}; +ti = { + buttonLabel: "ć€™èŁœă‚’èĄšç€ș", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} 怋ぼă‚Șăƒ—ă‚·ăƒ§ăƒł`, + other: () => `${e.number(t.optionCount)} 怋ぼă‚Șăƒ—ă‚·ăƒ§ăƒł` + })}ă‚’ćˆ©ç”šă§ăăŸă™ă€‚`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `ć…„ćŠ›ă•ă‚ŒăŸă‚°ăƒ«ăƒŒăƒ— ${t.groupTitle}、${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} 怋ぼă‚Șăƒ—ă‚·ăƒ§ăƒł`, + other: () => `${e.number(t.groupCount)} 怋ぼă‚Șăƒ—ă‚·ăƒ§ăƒł` + })}を搫む。`, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: "ă€éžæŠžæžˆăż", + other: "" + }, t.isSelected)}`, + listboxLabel: "ć€™èŁœ", + selectedAnnouncement: (t) => `${t.optionText}ă€éžæŠžæžˆăż` +}; +var ni = {}; +ni = { + buttonLabel: "제안 ì‚Źí•­ 표시", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)}개 옔션`, + other: () => `${e.number(t.optionCount)}개 옔션` + })}을 ì‚Źìš©í•  수 있슔니닀.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `ìž…ë „í•œ ê·žëŁč ${t.groupTitle}, ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)}개 옔션`, + other: () => `${e.number(t.groupCount)}개 옔션` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", 선택됚", + other: "" + }, t.isSelected)}`, + listboxLabel: "제안", + selectedAnnouncement: (t) => `${t.optionText}, 선택됚` +}; +var ri = {}; +ri = { + buttonLabel: "Rodyti pasiĆ«lymus", + countAnnouncement: (t, e) => `Yra ${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} parinktis`, + other: () => `${e.number(t.optionCount)} parinktys (-iĆł)` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Äźvesta grupė ${t.groupTitle}, su ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} parinktimi`, + other: () => `${e.number(t.groupCount)} parinktimis (-iĆł)` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", pasirinkta", + other: "" + }, t.isSelected)}`, + listboxLabel: "PasiĆ«lymai", + selectedAnnouncement: (t) => `${t.optionText}, pasirinkta` +}; +var oi = {}; +oi = { + buttonLabel: "RādÄ«t ieteikumus", + countAnnouncement: (t, e) => `Pieejamo opciju skaits: ${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opcija`, + other: () => `${e.number(t.optionCount)} opcijas` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `IevadÄ«ta grupa ${t.groupTitle}, ar ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opciju`, + other: () => `${e.number(t.groupCount)} opcijām` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", atlasÄ«ta", + other: "" + }, t.isSelected)}`, + listboxLabel: "Ieteikumi", + selectedAnnouncement: (t) => `${t.optionText}, atlasÄ«ta` +}; +var ii = {}; +ii = { + buttonLabel: "Vis forslag", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} alternativ`, + other: () => `${e.number(t.optionCount)} alternativer` + })} finnes.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Angitt gruppe ${t.groupTitle}, med ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} alternativ`, + other: () => `${e.number(t.groupCount)} alternativer` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", valgt", + other: "" + }, t.isSelected)}`, + listboxLabel: "Forslag", + selectedAnnouncement: (t) => `${t.optionText}, valgt` +}; +var li = {}; +li = { + buttonLabel: "Suggesties weergeven", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} optie`, + other: () => `${e.number(t.optionCount)} opties` + })} beschikbaar.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Groep ${t.groupTitle} ingevoerd met ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} optie`, + other: () => `${e.number(t.groupCount)} opties` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", geselecteerd", + other: "" + }, t.isSelected)}`, + listboxLabel: "Suggesties", + selectedAnnouncement: (t) => `${t.optionText}, geselecteerd` +}; +var si = {}; +si = { + buttonLabel: "Wyƛwietlaj sugestie", + countAnnouncement: (t, e) => `dostępna/dostępne(-nych) ${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opcja`, + other: () => `${e.number(t.optionCount)} opcje(-i)` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `DoƂączono do grupy ${t.groupTitle}, z ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opcją`, + other: () => `${e.number(t.groupCount)} opcjami` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", wybrano", + other: "" + }, t.isSelected)}`, + listboxLabel: "Sugestie", + selectedAnnouncement: (t) => `${t.optionText}, wybrano` +}; +var ui = {}; +ui = { + buttonLabel: "Mostrar sugestĂ”es", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opção`, + other: () => `${e.number(t.optionCount)} opçÔes` + })} disponĂ­vel.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Grupo inserido ${t.groupTitle}, com ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opção`, + other: () => `${e.number(t.groupCount)} opçÔes` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", selecionado", + other: "" + }, t.isSelected)}`, + listboxLabel: "SugestĂ”es", + selectedAnnouncement: (t) => `${t.optionText}, selecionado` +}; +var ai = {}; +ai = { + buttonLabel: "Apresentar sugestĂ”es", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opção`, + other: () => `${e.number(t.optionCount)} opçÔes` + })} disponĂ­vel.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Grupo introduzido ${t.groupTitle}, com ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opção`, + other: () => `${e.number(t.groupCount)} opçÔes` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", selecionado", + other: "" + }, t.isSelected)}`, + listboxLabel: "SugestĂ”es", + selectedAnnouncement: (t) => `${t.optionText}, selecionado` +}; +var ci = {}; +ci = { + buttonLabel: "Afișare sugestii", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opțiune`, + other: () => `${e.number(t.optionCount)} opțiuni` + })} disponibile.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Grup ${t.groupTitle} introdus, cu ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opțiune`, + other: () => `${e.number(t.groupCount)} opțiuni` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", selectat", + other: "" + }, t.isSelected)}`, + listboxLabel: "Sugestii", + selectedAnnouncement: (t) => `${t.optionText}, selectat` +}; +var di = {}; +di = { + buttonLabel: "ĐŸĐŸĐșĐ°Đ·Đ°Ń‚ŃŒ ĐżŃ€Đ”ĐŽĐ»ĐŸĐ¶Đ”ĐœĐžŃ", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} ĐżĐ°Ń€Đ°ĐŒĐ”Ń‚Ń€`, + other: () => `${e.number(t.optionCount)} ĐżĐ°Ń€Đ°ĐŒĐ”Ń‚Ń€ĐŸĐČ` + })} ĐŽĐŸŃŃ‚ŃƒĐżĐœĐŸ.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `ВĐČĐ”ĐŽĐ”ĐœĐœĐ°Ń группа ${t.groupTitle}, с ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} ĐżĐ°Ń€Đ°ĐŒĐ”Ń‚Ń€ĐŸĐŒ`, + other: () => `${e.number(t.groupCount)} ĐżĐ°Ń€Đ°ĐŒĐ”Ń‚Ń€Đ°ĐŒĐž` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", ĐČŃ‹Đ±Ń€Đ°ĐœĐœŃ‹ĐŒĐž", + other: "" + }, t.isSelected)}`, + listboxLabel: "ĐŸŃ€Đ”ĐŽĐ»ĐŸĐ¶Đ”ĐœĐžŃ", + selectedAnnouncement: (t) => `${t.optionText}, ĐČŃ‹Đ±Ń€Đ°ĐœĐŸ` +}; +var fi = {}; +fi = { + buttonLabel: "ZobraziĆ„ nĂĄvrhy", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} moĆŸnosĆ„`, + other: () => `${e.number(t.optionCount)} moĆŸnosti/-Ă­` + })} k dispozĂ­cii.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `ZadanĂĄ skupina ${t.groupTitle}, s ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} moĆŸnosĆ„ou`, + other: () => `${e.number(t.groupCount)} moĆŸnosĆ„ami` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", vybratĂ©", + other: "" + }, t.isSelected)}`, + listboxLabel: "NĂĄvrhy", + selectedAnnouncement: (t) => `${t.optionText}, vybratĂ©` +}; +var pi = {}; +pi = { + buttonLabel: "PrikaĆŸi predloge", + countAnnouncement: (t, e) => `Na voljo je ${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opcija`, + other: () => `${e.number(t.optionCount)} opcije` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Vnesena skupina ${t.groupTitle}, z ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opcija`, + other: () => `${e.number(t.groupCount)} opcije` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", izbrano", + other: "" + }, t.isSelected)}`, + listboxLabel: "Predlogi", + selectedAnnouncement: (t) => `${t.optionText}, izbrano` +}; +var bi = {}; +bi = { + buttonLabel: "PrikaĆŸi predloge", + countAnnouncement: (t, e) => `Dostupno joĆĄ: ${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} opcija`, + other: () => `${e.number(t.optionCount)} opcije/a` + })}.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Unesena grupa ${t.groupTitle}, s ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} opcijom`, + other: () => `${e.number(t.groupCount)} optione/a` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", izabranih", + other: "" + }, t.isSelected)}`, + listboxLabel: "Predlozi", + selectedAnnouncement: (t) => `${t.optionText}, izabrano` +}; +var mi = {}; +mi = { + buttonLabel: "Visa förslag", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} alternativ`, + other: () => `${e.number(t.optionCount)} alternativ` + })} tillgĂ€ngliga.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Ingick i gruppen ${t.groupTitle} med ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} alternativ`, + other: () => `${e.number(t.groupCount)} alternativ` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", valda", + other: "" + }, t.isSelected)}`, + listboxLabel: "Förslag", + selectedAnnouncement: (t) => `${t.optionText}, valda` +}; +var vi = {}; +vi = { + buttonLabel: "Önerileri göster", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} seçenek`, + other: () => `${e.number(t.optionCount)} seçenekler` + })} kullanılabilir.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `Girilen grup ${t.groupTitle}, ile ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} seçenek`, + other: () => `${e.number(t.groupCount)} seçenekler` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", seçildi", + other: "" + }, t.isSelected)}`, + listboxLabel: "Öneriler", + selectedAnnouncement: (t) => `${t.optionText}, seçildi` +}; +var hi = {}; +hi = { + buttonLabel: "ĐŸĐŸĐșĐ°Đ·Đ°Ń‚Đž ĐżŃ€ĐŸĐżĐŸĐ·ĐžŃ†Ń–Ń—", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} ĐżĐ°Ń€Đ°ĐŒĐ”Ń‚Ń€`, + other: () => `${e.number(t.optionCount)} ĐżĐ°Ń€Đ°ĐŒĐ”Ń‚Ń€Đž(-іĐČ)` + })} ĐŽĐŸŃŃ‚ŃƒĐżĐœĐŸ.`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `ВĐČĐ”ĐŽĐ”ĐœĐ° група ${t.groupTitle}, Đ· ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} ĐżĐ°Ń€Đ°ĐŒĐ”Ń‚Ń€`, + other: () => `${e.number(t.groupCount)} ĐżĐ°Ń€Đ°ĐŒĐ”Ń‚Ń€Đž(-іĐČ)` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", ĐČĐžĐ±Ń€Đ°ĐœĐŸ", + other: "" + }, t.isSelected)}`, + listboxLabel: "ĐŸŃ€ĐŸĐżĐŸĐ·ĐžŃ†Ń–Ń—", + selectedAnnouncement: (t) => `${t.optionText}, ĐČĐžĐ±Ń€Đ°ĐœĐŸ` +}; +var gi = {}; +gi = { + buttonLabel: "星ç€șć»șèźź", + countAnnouncement: (t, e) => `有 ${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} äžȘ选éĄč`, + other: () => `${e.number(t.optionCount)} äžȘ选éĄč` + })}揯甹。`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `èż›ć…„äș† ${t.groupTitle} ç»„ïŒŒć…¶äž­æœ‰ ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} äžȘ选éĄč`, + other: () => `${e.number(t.groupCount)} äžȘ选éĄč` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", ć·Č选择", + other: "" + }, t.isSelected)}`, + listboxLabel: "ć»șèźź", + selectedAnnouncement: (t) => `${t.optionText}, ć·Č选择` +}; +var $i = {}; +$i = { + buttonLabel: "饯ç€șć»șè­°", + countAnnouncement: (t, e) => `${e.plural(t.optionCount, { + one: () => `${e.number(t.optionCount)} 遾項`, + other: () => `${e.number(t.optionCount)} 遾項` + })} 揯甹。`, + focusAnnouncement: (t, e) => `${e.select({ + true: () => `èŒžć…„çš„çŸ€ç”„ ${t.groupTitle}, 有 ${e.plural(t.groupCount, { + one: () => `${e.number(t.groupCount)} 遾項`, + other: () => `${e.number(t.groupCount)} 遾項` + })}. `, + other: "" + }, t.isGroupChange)}${t.optionText}${e.select({ + true: ", ć·Č遾揖", + other: "" + }, t.isSelected)}`, + listboxLabel: "ć»șè­°", + selectedAnnouncement: (t) => `${t.optionText}, ć·Č遾揖` +}; +var yi = {}; +yi = { + dismiss: "ŰȘŰŹŰ§Ù‡Ù„" +}; +var xi = {}; +xi = { + dismiss: "ОтхĐČŃŠŃ€Đ»ŃĐœĐ”" +}; +var Ci = {}; +Ci = { + dismiss: "Odstranit" +}; +var Ei = {}; +Ei = { + dismiss: "Luk" +}; +var Pi = {}; +Pi = { + dismiss: "Schließen" +}; +var wi = {}; +wi = { + dismiss: "ΑπόρρÎčψη" +}; +var Si = {}; +Si = { + dismiss: "Dismiss" +}; +var Ti = {}; +Ti = { + dismiss: "Descartar" +}; +var _i = {}; +_i = { + dismiss: "LĂ”peta" +}; +var Ai = {}; +Ai = { + dismiss: "HylkÀÀ" +}; +var Ki = {}; +Ki = { + dismiss: "Rejeter" +}; +var Di = {}; +Di = { + dismiss: "Ś”ŚȘŚąŚœŚ" +}; +var Fi = {}; +Fi = { + dismiss: "Odbaci" +}; +var Li = {}; +Li = { + dismiss: "ElutasĂ­tĂĄs" +}; +var Mi = {}; +Mi = { + dismiss: "Ignora" +}; +var Ni = {}; +Ni = { + dismiss: "閉じる" +}; +var ki = {}; +ki = { + dismiss: "ëŹŽì‹œ" +}; +var Ii = {}; +Ii = { + dismiss: "Atmesti" +}; +var Bi = {}; +Bi = { + dismiss: "NerādÄ«t" +}; +var Oi = {}; +Oi = { + dismiss: "Lukk" +}; +var Ri = {}; +Ri = { + dismiss: "Negeren" +}; +var Vi = {}; +Vi = { + dismiss: "Zignoruj" +}; +var zi = {}; +zi = { + dismiss: "Descartar" +}; +var ji = {}; +ji = { + dismiss: "Dispensar" +}; +var Hi = {}; +Hi = { + dismiss: "Revocare" +}; +var Ui = {}; +Ui = { + dismiss: "ĐŸŃ€ĐŸĐżŃƒŃŃ‚ĐžŃ‚ŃŒ" +}; +var Wi = {}; +Wi = { + dismiss: "ZruĆĄiĆ„" +}; +var Gi = {}; +Gi = { + dismiss: "Opusti" +}; +var qi = {}; +qi = { + dismiss: "Odbaci" +}; +var Yi = {}; +Yi = { + dismiss: "Avvisa" +}; +var Xi = {}; +Xi = { + dismiss: "Kapat" +}; +var Zi = {}; +Zi = { + dismiss: "ĐĄĐșасуĐČато" +}; +var Ji = {}; +Ji = { + dismiss: "ć–æ¶ˆ" +}; +var Qi = {}; +Qi = { + dismiss: "關閉" +}; +const Ar = { + border: 0, + clip: "rect(0 0 0 0)", + clipPath: "inset(50%)", + height: "1px", + margin: "-1px", + overflow: "hidden", + padding: 0, + position: "absolute", + width: "1px", + whiteSpace: "nowrap" +}; +function el(t = {}) { + let { style: e, isFocusable: n } = t, [r, o] = Z(!1), { focusWithinProps: i } = Xt({ + isDisabled: !n, + onFocusWithinChange: (s) => o(s) + }), l = ne(() => r ? e : e ? { + ...Ar, + ...e + } : Ar, [ + r + ]); + return { + visuallyHiddenProps: { + ...i, + style: l + } + }; +} +function fa(t) { + let { children: e, elementType: n = "div", isFocusable: r, style: o, ...i } = t, { visuallyHiddenProps: l } = el(t); + return /* @__PURE__ */ Q.createElement(n, se(i, l), e); +} +function pa(t) { + return t && t.__esModule ? t.default : t; +} +const Kr = { + top: "top", + bottom: "top", + left: "left", + right: "left" +}, It = { + top: "bottom", + bottom: "top", + left: "right", + right: "left" +}, ba = { + top: "left", + left: "top" +}, Mn = { + top: "height", + left: "width" +}, ma = { + width: "totalWidth", + height: "totalHeight" +}, Ct = {}; +let Ge = typeof document < "u" && window.visualViewport; +function Dr(t) { + let e = 0, n = 0, r = 0, o = 0, i = 0, l = 0, s = {}; + if (t.tagName === "BODY") { + let c = document.documentElement; + r = c.clientWidth, o = c.clientHeight; + var u; + e = (u = Ge == null ? void 0 : Ge.width) !== null && u !== void 0 ? u : r; + var a; + n = (a = Ge == null ? void 0 : Ge.height) !== null && a !== void 0 ? a : o, s.top = c.scrollTop || t.scrollTop, s.left = c.scrollLeft || t.scrollLeft; + } else + ({ width: e, height: n, top: i, left: l } = Je(t)), s.top = t.scrollTop, s.left = t.scrollLeft, r = e, o = n; + return { + width: e, + height: n, + totalWidth: r, + totalHeight: o, + scroll: s, + top: i, + left: l + }; +} +function va(t) { + return { + top: t.scrollTop, + left: t.scrollLeft, + width: t.scrollWidth, + height: t.scrollHeight + }; +} +function Fr(t, e, n, r, o, i) { + let l = o.scroll[t], s = r[Mn[t]], u = e - i - l, a = e + i - l + n; + return u < 0 ? -u : a > s ? Math.max(s - a, -u) : 0; +} +function ha(t) { + let e = window.getComputedStyle(t); + return { + top: parseInt(e.marginTop, 10) || 0, + bottom: parseInt(e.marginBottom, 10) || 0, + left: parseInt(e.marginLeft, 10) || 0, + right: parseInt(e.marginRight, 10) || 0 + }; +} +function Lr(t) { + if (Ct[t]) + return Ct[t]; + let [e, n] = t.split(" "), r = Kr[e] || "right", o = ba[r]; + Kr[n] || (n = "center"); + let i = Mn[r], l = Mn[o]; + return Ct[t] = { + placement: e, + crossPlacement: n, + axis: r, + crossAxis: o, + size: i, + crossSize: l + }, Ct[t]; +} +function dn(t, e, n, r, o, i, l, s, u, a) { + let { placement: c, crossPlacement: f, axis: p, crossAxis: d, size: v, crossSize: $ } = r, h = {}; + h[d] = t[d], f === "center" ? h[d] += (t[$] - n[$]) / 2 : f !== d && (h[d] += t[$] - n[$]), h[d] += i; + const _ = t[d] - n[$] + u + a, w = t[d] + t[$] - u - a; + if (h[d] = Cn(h[d], _, w), c === p) { + const S = s ? l[v] : e[ma[v]]; + h[It[p]] = Math.floor(S - t[p] + o); + } else + h[p] = Math.floor(t[p] + t[v] + o); + return h; +} +function ga(t, e, n, r, o, i) { + return t.top != null ? Math.max(0, e.height + e.top + e.scroll.top - (n.top + t.top) - (o.top + o.bottom + i)) : Math.max(0, r.top + n.top - (e.top + e.scroll.top) - (o.top + o.bottom + i)); +} +function Mr(t, e, n, r, o, i) { + let { placement: l, axis: s, size: u } = i; + return l === s ? Math.max(0, n[s] - t[s] - t.scroll[s] + e[s] - r[s] - r[It[s]] - o) : Math.max(0, t[u] + t[s] + t.scroll[s] - e[s] - n[s] - n[u] - r[s] - r[It[s]] - o); +} +function $a(t, e, n, r, o, i, l, s, u, a, c, f, p, d, v, $) { + let h = Lr(t), { size: _, crossAxis: w, crossSize: S, placement: K, crossPlacement: g } = h, N = dn(e, s, n, h, c, f, a, p, v, $), R = c, b = Mr(s, a, e, o, i + c, h); + if (l && r[_] > b) { + let ue = Lr(`${It[K]} ${g}`), ae = dn(e, s, n, ue, c, f, a, p, v, $); + Mr(s, a, e, o, i + c, ue) > b && (h = ue, N = ae, R = c); + } + let A = Fr(w, N[w], n[S], s, u, i); + N[w] += A; + let E = ga(N, s, a, e, o, i); + d && d < E && (E = d), n.height = Math.min(n.height, E), N = dn(e, s, n, h, R, f, a, p, v, $), A = Fr(w, N[w], n[S], s, u, i), N[w] += A; + let P = {}, B = e[w] + 0.5 * e[S] - n[w]; + const C = v / 2 + $, T = n[S] - v / 2 - $, q = e[w] - n[w] + v / 2, V = e[w] + e[S] - n[w] - v / 2, F = Cn(B, q, V); + return P[w] = Cn(F, C, T), { + position: N, + maxHeight: E, + arrowOffsetLeft: P.left, + arrowOffsetTop: P.top, + placement: h.placement + }; +} +function ya(t) { + let { placement: e, targetNode: n, overlayNode: r, scrollNode: o, padding: i, shouldFlip: l, boundaryElement: s, offset: u, crossOffset: a, maxHeight: c, arrowSize: f = 0, arrowBoundaryOffset: p = 0 } = t, d = r instanceof HTMLElement ? xa(r) : document.documentElement, v = d === document.documentElement; + const $ = window.getComputedStyle(d).position; + let h = !!$ && $ !== "static", _ = v ? Je(n) : Nr(n, d); + if (!v) { + let { marginTop: b, marginLeft: A } = window.getComputedStyle(n); + _.top += parseInt(b, 10) || 0, _.left += parseInt(A, 10) || 0; + } + let w = Je(r), S = ha(r); + w.width += S.left + S.right, w.height += S.top + S.bottom; + let K = va(o), g = Dr(s), N = Dr(d), R = s.tagName === "BODY" ? Je(d) : Nr(d, s); + return $a(e, _, w, K, S, i, l, g, N, R, u, a, h, c, f, p); +} +function Je(t) { + let { top: e, left: n, width: r, height: o } = t.getBoundingClientRect(), { scrollTop: i, scrollLeft: l, clientTop: s, clientLeft: u } = document.documentElement; + return { + top: e + i - s, + left: n + l - u, + width: r, + height: o + }; +} +function Nr(t, e) { + let n = window.getComputedStyle(t), r; + if (n.position === "fixed") { + let { top: o, left: i, width: l, height: s } = t.getBoundingClientRect(); + r = { + top: o, + left: i, + width: l, + height: s + }; + } else { + r = Je(t); + let o = Je(e), i = window.getComputedStyle(e); + o.top += (parseInt(i.borderTopWidth, 10) || 0) - e.scrollTop, o.left += (parseInt(i.borderLeftWidth, 10) || 0) - e.scrollLeft, r.top -= o.top, r.left -= o.left; + } + return r.top -= parseInt(n.marginTop, 10) || 0, r.left -= parseInt(n.marginLeft, 10) || 0, r; +} +function xa(t) { + let e = t.offsetParent; + if (e && e === document.body && window.getComputedStyle(e).position === "static" && !kr(e) && (e = document.documentElement), e == null) + for (e = t.parentElement; e && !kr(e); ) + e = e.parentElement; + return e || document.documentElement; +} +function kr(t) { + let e = window.getComputedStyle(t); + return e.transform !== "none" || /transform|perspective/.test(e.willChange) || e.filter !== "none" || e.contain === "paint" || // @ts-ignore + "backdropFilter" in e && e.backdropFilter !== "none" || // @ts-ignore + "WebkitBackdropFilter" in e && e.WebkitBackdropFilter !== "none"; +} +const tl = /* @__PURE__ */ new WeakMap(); +function Ca(t) { + let { triggerRef: e, isOpen: n, onClose: r } = t; + W(() => { + if (!n || r === null) + return; + let o = (i) => { + let l = i.target; + if (!e.current || l instanceof Node && !l.contains(e.current)) + return; + let s = r || tl.get(e.current); + s && s(); + }; + return window.addEventListener("scroll", o, !0), () => { + window.removeEventListener("scroll", o, !0); + }; + }, [ + n, + r, + e + ]); +} +let Ee = typeof document < "u" && window.visualViewport; +function Ea(t) { + let { direction: e } = Zt(), { arrowSize: n = 0, targetRef: r, overlayRef: o, scrollRef: i = o, placement: l = "bottom", containerPadding: s = 12, shouldFlip: u = !0, boundaryElement: a = typeof document < "u" ? document.body : null, offset: c = 0, crossOffset: f = 0, shouldUpdatePosition: p = !0, isOpen: d = !0, onClose: v, maxHeight: $, arrowBoundaryOffset: h = 0 } = t, [_, w] = Z({ + position: {}, + arrowOffsetLeft: void 0, + arrowOffsetTop: void 0, + maxHeight: void 0, + placement: void 0 + }), S = [ + p, + l, + o.current, + r.current, + i.current, + s, + u, + a, + c, + f, + d, + e, + $, + h, + n + ], K = te(() => { + if (p === !1 || !d || !o.current || !r.current || !i.current || !a) + return; + let R = ya({ + placement: wa(l, e), + overlayNode: o.current, + targetNode: r.current, + scrollNode: i.current, + padding: s, + shouldFlip: u, + boundaryElement: a, + offset: c, + crossOffset: f, + maxHeight: $, + arrowSize: n, + arrowBoundaryOffset: h + }); + Object.keys(R.position).forEach((b) => o.current.style[b] = R.position[b] + "px"), o.current.style.maxHeight = R.maxHeight != null ? R.maxHeight + "px" : void 0, w(R); + }, S); + fe(K, S), Pa(K), fu({ + ref: o, + onResize: K + }); + let g = I(!1); + fe(() => { + let R, b = () => { + g.current = !0, clearTimeout(R), R = setTimeout(() => { + g.current = !1; + }, 500), K(); + }; + return Ee == null || Ee.addEventListener("resize", b), Ee == null || Ee.addEventListener("scroll", b), () => { + Ee == null || Ee.removeEventListener("resize", b), Ee == null || Ee.removeEventListener("scroll", b); + }; + }, [ + K + ]); + let N = te(() => { + g.current || v(); + }, [ + v, + g + ]); + return Ca({ + triggerRef: r, + isOpen: d, + onClose: v && N + }), { + overlayProps: { + style: { + position: "absolute", + zIndex: 1e5, + ..._.position, + maxHeight: _.maxHeight + } + }, + placement: _.placement, + arrowProps: { + "aria-hidden": "true", + role: "presentation", + style: { + left: _.arrowOffsetLeft, + top: _.arrowOffsetTop + } + }, + updatePosition: K + }; +} +function Pa(t) { + fe(() => (window.addEventListener("resize", t, !1), () => { + window.removeEventListener("resize", t, !1); + }), [ + t + ]); +} +function wa(t, e) { + return e === "rtl" ? t.replace("start", "right").replace("end", "left") : t.replace("start", "left").replace("end", "right"); +} +const De = []; +function Sa(t, e) { + let { onClose: n, shouldCloseOnBlur: r, isOpen: o, isDismissable: i = !1, isKeyboardDismissDisabled: l = !1, shouldCloseOnInteractOutside: s } = t; + W(() => (o && De.push(e), () => { + let v = De.indexOf(e); + v >= 0 && De.splice(v, 1); + }), [ + o, + e + ]); + let u = () => { + De[De.length - 1] === e && n && n(); + }, a = (v) => { + (!s || s(v.target)) && De[De.length - 1] === e && (v.stopPropagation(), v.preventDefault()); + }, c = (v) => { + (!s || s(v.target)) && (De[De.length - 1] === e && (v.stopPropagation(), v.preventDefault()), u()); + }, f = (v) => { + v.key === "Escape" && !l && (v.stopPropagation(), v.preventDefault(), u()); + }; + Iu({ + ref: e, + onInteractOutside: i && o ? c : null, + onInteractOutsideStart: a + }); + let { focusWithinProps: p } = Xt({ + isDisabled: !r, + onBlurWithin: (v) => { + !v.relatedTarget || Wu(v.relatedTarget) || (!s || s(v.relatedTarget)) && n(); + } + }), d = (v) => { + v.target === v.currentTarget && v.preventDefault(); + }; + return { + overlayProps: { + onKeyDown: f, + ...p + }, + underlayProps: { + onPointerDown: d + } + }; +} +function Ta(t, e, n) { + let { type: r } = t, { isOpen: o } = e; + W(() => { + n && n.current && tl.set(n.current, e.close); + }); + let i; + r === "menu" ? i = !0 : r === "listbox" && (i = "listbox"); + let l = Ae(); + return { + triggerProps: { + "aria-haspopup": i, + "aria-expanded": o, + "aria-controls": o ? l : null, + onPress: e.toggle + }, + overlayProps: { + id: l + } + }; +} +const fn = typeof document < "u" && window.visualViewport, _a = /* @__PURE__ */ new Set([ + "checkbox", + "radio", + "range", + "color", + "file", + "image", + "button", + "submit", + "reset" +]); +let Et = 0, pn; +function Aa(t = {}) { + let { isDisabled: e } = t; + fe(() => { + if (!e) + return Et++, Et === 1 && (Wt() ? pn = Da() : pn = Ka()), () => { + Et--, Et === 0 && pn(); + }; + }, [ + e + ]); +} +function Ka() { + return Qe(Ze(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), Ze(document.documentElement, "overflow", "hidden")); +} +function Da() { + let t, e, n = (a) => { + t = Kt(a.target, !0), !(t === document.documentElement && t === document.body) && t instanceof HTMLElement && window.getComputedStyle(t).overscrollBehavior === "auto" && (e = Ze(t, "overscrollBehavior", "contain")); + }, r = (a) => { + if (!t || t === document.documentElement || t === document.body) { + a.preventDefault(); + return; + } + t.scrollHeight === t.clientHeight && t.scrollWidth === t.clientWidth && a.preventDefault(); + }, o = (a) => { + let c = a.target; + Br(c) && c !== document.activeElement && (a.preventDefault(), s(), c.style.transform = "translateY(-2000px)", c.focus(), requestAnimationFrame(() => { + c.style.transform = ""; + })), e && e(); + }, i = (a) => { + let c = a.target; + Br(c) && (s(), c.style.transform = "translateY(-2000px)", requestAnimationFrame(() => { + c.style.transform = "", fn && (fn.height < window.innerHeight ? requestAnimationFrame(() => { + Ir(c); + }) : fn.addEventListener("resize", () => Ir(c), { + once: !0 + })); + })); + }, l = null, s = () => { + if (l) + return; + let a = () => { + window.scrollTo(0, 0); + }, c = window.pageXOffset, f = window.pageYOffset; + l = Qe(ot(window, "scroll", a), Ze(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), Ze(document.documentElement, "overflow", "hidden"), Ze(document.body, "marginTop", `-${f}px`), () => { + window.scrollTo(c, f); + }), window.scrollTo(0, 0); + }, u = Qe(ot(document, "touchstart", n, { + passive: !1, + capture: !0 + }), ot(document, "touchmove", r, { + passive: !1, + capture: !0 + }), ot(document, "touchend", o, { + passive: !1, + capture: !0 + }), ot(document, "focus", i, !0)); + return () => { + e == null || e(), l == null || l(), u(); + }; +} +function Ze(t, e, n) { + let r = t.style[e]; + return t.style[e] = n, () => { + t.style[e] = r; + }; +} +function ot(t, e, n, r) { + return t.addEventListener(e, n, r), () => { + t.removeEventListener(e, n, r); + }; +} +function Ir(t) { + let e = document.scrollingElement || document.documentElement; + for (; t && t !== e; ) { + let n = Kt(t); + if (n !== document.documentElement && n !== document.body && n !== t) { + let r = n.getBoundingClientRect().top, o = t.getBoundingClientRect().top; + o > r + t.clientHeight && (n.scrollTop += o - r); + } + t = n.parentElement; + } +} +function Br(t) { + return t instanceof HTMLInputElement && !_a.has(t.type) || t instanceof HTMLTextAreaElement || t instanceof HTMLElement && t.isContentEditable; +} +var nl = {}; +nl = { + "ar-AE": yi, + "bg-BG": xi, + "cs-CZ": Ci, + "da-DK": Ei, + "de-DE": Pi, + "el-GR": wi, + "en-US": Si, + "es-ES": Ti, + "et-EE": _i, + "fi-FI": Ai, + "fr-FR": Ki, + "he-IL": Di, + "hr-HR": Fi, + "hu-HU": Li, + "it-IT": Mi, + "ja-JP": Ni, + "ko-KR": ki, + "lt-LT": Ii, + "lv-LV": Bi, + "nb-NO": Oi, + "nl-NL": Ri, + "pl-PL": Vi, + "pt-BR": zi, + "pt-PT": ji, + "ro-RO": Hi, + "ru-RU": Ui, + "sk-SK": Wi, + "sl-SI": Gi, + "sr-SP": qi, + "sv-SE": Yi, + "tr-TR": Xi, + "uk-UA": Zi, + "zh-CN": Ji, + "zh-TW": Qi +}; +function Or(t) { + let { onDismiss: e, ...n } = t, r = Yn(/* @__PURE__ */ pa(nl), "@react-aria/overlays"), o = At(n, r.format("dismiss")), i = () => { + e && e(); + }; + return /* @__PURE__ */ Q.createElement(fa, null, /* @__PURE__ */ Q.createElement("button", { + ...o, + tabIndex: -1, + onClick: i, + style: { + width: 1, + height: 1 + } + })); +} +let it = /* @__PURE__ */ new WeakMap(), Pe = []; +function rl(t, e = document.body) { + let n = new Set(t), r = /* @__PURE__ */ new Set(), o = (u) => { + for (let p of u.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]")) + n.add(p); + let a = (p) => { + if (n.has(p) || r.has(p.parentElement) && p.parentElement.getAttribute("role") !== "row") + return NodeFilter.FILTER_REJECT; + for (let d of n) + if (p.contains(d)) + return NodeFilter.FILTER_SKIP; + return NodeFilter.FILTER_ACCEPT; + }, c = document.createTreeWalker(u, NodeFilter.SHOW_ELEMENT, { + acceptNode: a + }), f = a(u); + if (f === NodeFilter.FILTER_ACCEPT && i(u), f !== NodeFilter.FILTER_REJECT) { + let p = c.nextNode(); + for (; p != null; ) + i(p), p = c.nextNode(); + } + }, i = (u) => { + var a; + let c = (a = it.get(u)) !== null && a !== void 0 ? a : 0; + u.getAttribute("aria-hidden") === "true" && c === 0 || (c === 0 && u.setAttribute("aria-hidden", "true"), r.add(u), it.set(u, c + 1)); + }; + Pe.length && Pe[Pe.length - 1].disconnect(), o(e); + let l = new MutationObserver((u) => { + for (let a of u) + if (!(a.type !== "childList" || a.addedNodes.length === 0) && ![ + ...n, + ...r + ].some((c) => c.contains(a.target))) { + for (let c of a.removedNodes) + c instanceof Element && (n.delete(c), r.delete(c)); + for (let c of a.addedNodes) + (c instanceof HTMLElement || c instanceof SVGElement) && (c.dataset.liveAnnouncer === "true" || c.dataset.reactAriaTopLayer === "true") ? n.add(c) : c instanceof Element && o(c); + } + }); + l.observe(e, { + childList: !0, + subtree: !0 + }); + let s = { + observe() { + l.observe(e, { + childList: !0, + subtree: !0 + }); + }, + disconnect() { + l.disconnect(); + } + }; + return Pe.push(s), () => { + l.disconnect(); + for (let u of r) { + let a = it.get(u); + a === 1 ? (u.removeAttribute("aria-hidden"), it.delete(u)) : it.set(u, a - 1); + } + s === Pe[Pe.length - 1] ? (Pe.pop(), Pe.length && Pe[Pe.length - 1].observe()) : Pe.splice(Pe.indexOf(s), 1); + }; +} +function Fa(t, e) { + let { triggerRef: n, popoverRef: r, isNonModal: o, isKeyboardDismissDisabled: i, shouldCloseOnInteractOutside: l, ...s } = t, { overlayProps: u, underlayProps: a } = Sa({ + isOpen: e.isOpen, + onClose: e.close, + shouldCloseOnBlur: !0, + isDismissable: !o, + isKeyboardDismissDisabled: i, + shouldCloseOnInteractOutside: l + }, r), { overlayProps: c, arrowProps: f, placement: p } = Ea({ + ...s, + targetRef: n, + overlayRef: r, + isOpen: e.isOpen, + onClose: o ? e.close : null + }); + return Aa({ + isDisabled: o || !e.isOpen + }), fe(() => { + if (e.isOpen && !o && r.current) + return rl([ + r.current + ]); + }, [ + o, + e.isOpen, + r + ]), { + popoverProps: se(u, c), + arrowProps: f, + underlayProps: a, + placement: p + }; +} +const La = /* @__PURE__ */ Q.createContext(null); +function Ma(t) { + let e = Ht(), { portalContainer: n = e ? null : document.body, isExiting: r } = t, [o, i] = Z(!1), l = ne(() => ({ + contain: o, + setContain: i + }), [ + o, + i + ]); + if (!n) + return null; + let s = t.children; + return t.disableFocusManagement || (s = /* @__PURE__ */ Q.createElement(Vu, { + restoreFocus: !0, + contain: o && !r + }, s)), s = /* @__PURE__ */ Q.createElement(La.Provider, { + value: l + }, /* @__PURE__ */ Q.createElement(wu, null, s)), /* @__PURE__ */ Bn.createPortal(s, n); +} +function Nn(t) { + return wt() ? t.altKey : t.ctrlKey; +} +function Ye(t) { + return Ie() ? t.metaKey : t.ctrlKey; +} +const Na = 1e3; +function ol(t) { + let { keyboardDelegate: e, selectionManager: n, onTypeSelect: r } = t, o = I({ + search: "", + timeout: null + }).current, i = (l) => { + let s = ka(l.key); + if (!s || l.ctrlKey || l.metaKey || !l.currentTarget.contains(l.target)) + return; + s === " " && o.search.trim().length > 0 && (l.preventDefault(), "continuePropagation" in l || l.stopPropagation()), o.search += s; + let u = e.getKeyForSearch(o.search, n.focusedKey); + u == null && (u = e.getKeyForSearch(o.search)), u != null && (n.setFocusedKey(u), r && r(u)), clearTimeout(o.timeout), o.timeout = setTimeout(() => { + o.search = ""; + }, Na); + }; + return { + typeSelectProps: { + // Using a capturing listener to catch the keydown event before + // other hooks in order to handle the Spacebar event. + onKeyDownCapture: e.getKeyForSearch ? i : null + } + }; +} +function ka(t) { + return t.length === 1 || !/^[A-Z]/i.test(t) ? t : ""; +} +function il(t) { + let { selectionManager: e, keyboardDelegate: n, ref: r, autoFocus: o = !1, shouldFocusWrap: i = !1, disallowEmptySelection: l = !1, disallowSelectAll: s = !1, selectOnFocus: u = e.selectionBehavior === "replace", disallowTypeAhead: a = !1, shouldUseVirtualFocus: c, allowsTabNavigation: f = !1, isVirtualized: p, scrollRef: d = r, linkBehavior: v = "action" } = t, { direction: $ } = Zt(), h = Gt(), _ = (E) => { + if (E.altKey && E.key === "Tab" && E.preventDefault(), !r.current.contains(E.target)) + return; + const P = (y, D) => { + if (y != null) { + if (e.isLink(y) && v === "selection" && u && !Nn(E)) { + us(() => { + e.setFocusedKey(y, D); + }); + let z = d.current.querySelector(`[data-key="${CSS.escape(y.toString())}"]`); + h.open(z, E); + return; + } + if (e.setFocusedKey(y, D), e.isLink(y) && v === "override") + return; + E.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(y) : u && !Nn(E) && e.replaceSelection(y); + } + }; + switch (E.key) { + case "ArrowDown": + if (n.getKeyBelow) { + var B, C; + E.preventDefault(); + let y = e.focusedKey != null ? n.getKeyBelow(e.focusedKey) : (B = n.getFirstKey) === null || B === void 0 ? void 0 : B.call(n); + y == null && i && (y = (C = n.getFirstKey) === null || C === void 0 ? void 0 : C.call(n, e.focusedKey)), P(y); + } + break; + case "ArrowUp": + if (n.getKeyAbove) { + var T, q; + E.preventDefault(); + let y = e.focusedKey != null ? n.getKeyAbove(e.focusedKey) : (T = n.getLastKey) === null || T === void 0 ? void 0 : T.call(n); + y == null && i && (y = (q = n.getLastKey) === null || q === void 0 ? void 0 : q.call(n, e.focusedKey)), P(y); + } + break; + case "ArrowLeft": + if (n.getKeyLeftOf) { + var V, F; + E.preventDefault(); + let y = n.getKeyLeftOf(e.focusedKey); + y == null && i && (y = $ === "rtl" ? (V = n.getFirstKey) === null || V === void 0 ? void 0 : V.call(n, e.focusedKey) : (F = n.getLastKey) === null || F === void 0 ? void 0 : F.call(n, e.focusedKey)), P(y, $ === "rtl" ? "first" : "last"); + } + break; + case "ArrowRight": + if (n.getKeyRightOf) { + var ue, ae; + E.preventDefault(); + let y = n.getKeyRightOf(e.focusedKey); + y == null && i && (y = $ === "rtl" ? (ue = n.getLastKey) === null || ue === void 0 ? void 0 : ue.call(n, e.focusedKey) : (ae = n.getFirstKey) === null || ae === void 0 ? void 0 : ae.call(n, e.focusedKey)), P(y, $ === "rtl" ? "last" : "first"); + } + break; + case "Home": + if (n.getFirstKey) { + E.preventDefault(); + let y = n.getFirstKey(e.focusedKey, Ye(E)); + e.setFocusedKey(y), Ye(E) && E.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(y) : u && e.replaceSelection(y); + } + break; + case "End": + if (n.getLastKey) { + E.preventDefault(); + let y = n.getLastKey(e.focusedKey, Ye(E)); + e.setFocusedKey(y), Ye(E) && E.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(y) : u && e.replaceSelection(y); + } + break; + case "PageDown": + if (n.getKeyPageBelow) { + E.preventDefault(); + let y = n.getKeyPageBelow(e.focusedKey); + P(y); + } + break; + case "PageUp": + if (n.getKeyPageAbove) { + E.preventDefault(); + let y = n.getKeyPageAbove(e.focusedKey); + P(y); + } + break; + case "a": + Ye(E) && e.selectionMode === "multiple" && s !== !0 && (E.preventDefault(), e.selectAll()); + break; + case "Escape": + E.preventDefault(), l || e.clearSelection(); + break; + case "Tab": + if (!f) { + if (E.shiftKey) + r.current.focus(); + else { + let y = Me(r.current, { + tabbable: !0 + }), D, z; + do + z = y.lastChild(), z && (D = z); + while (z); + D && !D.contains(document.activeElement) && Fe(D); + } + break; + } + } + }, w = I({ + top: 0, + left: 0 + }); + mu(d, "scroll", p ? null : () => { + w.current = { + top: d.current.scrollTop, + left: d.current.scrollLeft + }; + }); + let S = (E) => { + if (e.isFocused) { + E.currentTarget.contains(E.target) || e.setFocused(!1); + return; + } + if (E.currentTarget.contains(E.target)) { + if (e.setFocused(!0), e.focusedKey == null) { + let C = (q) => { + q != null && (e.setFocusedKey(q), u && e.replaceSelection(q)); + }, T = E.relatedTarget; + var P, B; + T && E.currentTarget.compareDocumentPosition(T) & Node.DOCUMENT_POSITION_FOLLOWING ? C((P = e.lastSelectedKey) !== null && P !== void 0 ? P : n.getLastKey()) : C((B = e.firstSelectedKey) !== null && B !== void 0 ? B : n.getFirstKey()); + } else + p || (d.current.scrollTop = w.current.top, d.current.scrollLeft = w.current.left); + if (!p && e.focusedKey != null) { + let C = d.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`); + C && (C.contains(document.activeElement) || Fe(C), Kn() === "keyboard" && vr(C, { + containingElement: r.current + })); + } + } + }, K = (E) => { + E.currentTarget.contains(E.relatedTarget) || e.setFocused(!1); + }; + const g = I(o); + W(() => { + if (g.current) { + let E = null; + o === "first" && (E = n.getFirstKey()), o === "last" && (E = n.getLastKey()); + let P = e.selectedKeys; + if (P.size) { + for (let B of P) + if (e.canSelectItem(B)) { + E = B; + break; + } + } + e.setFocused(!0), e.setFocusedKey(E), E == null && !c && ft(r.current); + } + }, []); + let N = I(e.focusedKey); + W(() => { + let E = Kn(); + if (e.isFocused && e.focusedKey != null && (d != null && d.current)) { + let P = d.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`); + P && (E === "keyboard" || g.current) && (p || Co(d.current, P), vr(P, { + containingElement: r.current + })); + } + e.isFocused && e.focusedKey == null && N.current != null && ft(r.current), N.current = e.focusedKey, g.current = !1; + }, [ + p, + d, + e.focusedKey, + e.isFocused, + r + ]); + let R = { + onKeyDown: _, + onFocus: S, + onBlur: K, + onMouseDown(E) { + d.current === E.target && E.preventDefault(); + } + }, { typeSelectProps: b } = ol({ + keyboardDelegate: n, + selectionManager: e + }); + a || (R = se(b, R)); + let A; + return c || (A = e.focusedKey == null ? 0 : -1), { + collectionProps: { + ...R, + tabIndex: A + } + }; +} +function ll(t) { + let { selectionManager: e, key: n, ref: r, shouldSelectOnPressUp: o, shouldUseVirtualFocus: i, focus: l, isDisabled: s, onAction: u, allowsDifferentPressOrigin: a, linkBehavior: c = "action" } = t, f = Gt(), p = (F) => { + if (F.pointerType === "keyboard" && Nn(F)) + e.toggleSelection(n); + else { + if (e.selectionMode === "none") + return; + if (e.isLink(n)) { + if (c === "selection") { + f.open(r.current, F), e.setSelectedKeys(e.selectedKeys); + return; + } else if (c === "override" || c === "none") + return; + } + e.selectionMode === "single" ? e.isSelected(n) && !e.disallowEmptySelection ? e.toggleSelection(n) : e.replaceSelection(n) : F && F.shiftKey ? e.extendSelection(n) : e.selectionBehavior === "toggle" || F && (Ye(F) || F.pointerType === "touch" || F.pointerType === "virtual") ? e.toggleSelection(n) : e.replaceSelection(n); + } + }; + W(() => { + n === e.focusedKey && e.isFocused && !i && (l ? l() : document.activeElement !== r.current && ft(r.current)); + }, [ + r, + n, + e.focusedKey, + e.childFocusStrategy, + e.isFocused, + i + ]), s = s || e.isDisabled(n); + let d = {}; + !i && !s ? d = { + tabIndex: n === e.focusedKey ? 0 : -1, + onFocus(F) { + F.target === r.current && e.setFocusedKey(n); + } + } : s && (d.onMouseDown = (F) => { + F.preventDefault(); + }); + let v = e.isLink(n) && c === "override", $ = e.isLink(n) && c !== "selection" && c !== "none", h = !s && e.canSelectItem(n) && !v, _ = (u || $) && !s, w = _ && (e.selectionBehavior === "replace" ? !h : !h || e.isEmpty), S = _ && h && e.selectionBehavior === "replace", K = w || S, g = I(null), N = K && h, R = I(!1), b = I(!1), A = (F) => { + u && u(), $ && f.open(r.current, F); + }, E = {}; + o ? (E.onPressStart = (F) => { + g.current = F.pointerType, R.current = N, F.pointerType === "keyboard" && (!K || Vr()) && p(F); + }, a ? (E.onPressUp = w ? null : (F) => { + F.pointerType !== "keyboard" && h && p(F); + }, E.onPress = w ? A : null) : E.onPress = (F) => { + if (w || S && F.pointerType !== "mouse") { + if (F.pointerType === "keyboard" && !Rr()) + return; + A(F); + } else + F.pointerType !== "keyboard" && h && p(F); + }) : (E.onPressStart = (F) => { + g.current = F.pointerType, R.current = N, b.current = w, h && (F.pointerType === "mouse" && !w || F.pointerType === "keyboard" && (!_ || Vr())) && p(F); + }, E.onPress = (F) => { + (F.pointerType === "touch" || F.pointerType === "pen" || F.pointerType === "virtual" || F.pointerType === "keyboard" && K && Rr() || F.pointerType === "mouse" && b.current) && (K ? A(F) : h && p(F)); + }), d["data-key"] = n, E.preventFocusOnPress = i; + let { pressProps: P, isPressed: B } = qt(E), C = S ? (F) => { + g.current === "mouse" && (F.stopPropagation(), F.preventDefault(), A(F)); + } : void 0, { longPressProps: T } = Ko({ + isDisabled: !N, + onLongPress(F) { + F.pointerType === "touch" && (p(F), e.setSelectionBehavior("toggle")); + } + }), q = (F) => { + g.current === "touch" && R.current && F.preventDefault(); + }, V = e.isLink(n) ? (F) => { + Re.isOpening || F.preventDefault(); + } : void 0; + return { + itemProps: se(d, h || w ? P : {}, N ? T : {}, { + onDoubleClick: C, + onDragStartCapture: q, + onClick: V + }), + isPressed: B, + isSelected: e.isSelected(n), + isFocused: e.isFocused && e.focusedKey === n, + isDisabled: s, + allowsSelection: h, + hasAction: K + }; +} +function Rr() { + let t = window.event; + return (t == null ? void 0 : t.key) === "Enter"; +} +function Vr() { + let t = window.event; + return (t == null ? void 0 : t.key) === " " || (t == null ? void 0 : t.code) === "Space"; +} +class Zn { + getNextKey(e) { + for (e = this.collection.getKeyAfter(e); e != null; ) { + if (this.collection.getItem(e).type === "item" && !this.disabledKeys.has(e)) + return e; + e = this.collection.getKeyAfter(e); + } + return null; + } + getPreviousKey(e) { + for (e = this.collection.getKeyBefore(e); e != null; ) { + if (this.collection.getItem(e).type === "item" && !this.disabledKeys.has(e)) + return e; + e = this.collection.getKeyBefore(e); + } + return null; + } + findKey(e, n, r) { + let o = this.getItem(e); + if (!o) + return null; + let i = o.getBoundingClientRect(); + do + e = n(e), o = this.getItem(e); + while (o && r(i, o.getBoundingClientRect())); + return e; + } + isSameRow(e, n) { + return e.top === n.top || e.left !== n.left; + } + isSameColumn(e, n) { + return e.left === n.left || e.top !== n.top; + } + getKeyBelow(e) { + return this.layout === "grid" && this.orientation === "vertical" ? this.findKey(e, (n) => this.getNextKey(n), this.isSameRow) : this.getNextKey(e); + } + getKeyAbove(e) { + return this.layout === "grid" && this.orientation === "vertical" ? this.findKey(e, (n) => this.getPreviousKey(n), this.isSameRow) : this.getPreviousKey(e); + } + getNextColumn(e, n) { + return n ? this.getPreviousKey(e) : this.getNextKey(e); + } + getKeyRightOf(e) { + return this.layout === "grid" ? this.orientation === "vertical" ? this.getNextColumn(e, this.direction === "rtl") : this.findKey(e, (n) => this.getNextColumn(n, this.direction === "rtl"), this.isSameColumn) : this.orientation === "horizontal" ? this.getNextColumn(e, this.direction === "rtl") : null; + } + getKeyLeftOf(e) { + return this.layout === "grid" ? this.orientation === "vertical" ? this.getNextColumn(e, this.direction === "ltr") : this.findKey(e, (n) => this.getNextColumn(n, this.direction === "ltr"), this.isSameColumn) : this.orientation === "horizontal" ? this.getNextColumn(e, this.direction === "ltr") : null; + } + getFirstKey() { + let e = this.collection.getFirstKey(); + for (; e != null; ) { + if (this.collection.getItem(e).type === "item" && !this.disabledKeys.has(e)) + return e; + e = this.collection.getKeyAfter(e); + } + return null; + } + getLastKey() { + let e = this.collection.getLastKey(); + for (; e != null; ) { + if (this.collection.getItem(e).type === "item" && !this.disabledKeys.has(e)) + return e; + e = this.collection.getKeyBefore(e); + } + return null; + } + getItem(e) { + return this.ref.current.querySelector(`[data-key="${CSS.escape(e.toString())}"]`); + } + getKeyPageAbove(e) { + let n = this.ref.current, r = this.getItem(e); + if (!r) + return null; + if (!Dt(n)) + return this.getFirstKey(); + let o = n.getBoundingClientRect(), i = r.getBoundingClientRect(); + if (this.orientation === "horizontal") { + let l = o.x - n.scrollLeft, s = Math.max(0, i.x - l + i.width - o.width); + for (; r && i.x - l > s; ) + e = this.getKeyAbove(e), r = e == null ? null : this.getItem(e), i = r == null ? void 0 : r.getBoundingClientRect(); + } else { + let l = o.y - n.scrollTop, s = Math.max(0, i.y - l + i.height - o.height); + for (; r && i.y - l > s; ) + e = this.getKeyAbove(e), r = e == null ? null : this.getItem(e), i = r == null ? void 0 : r.getBoundingClientRect(); + } + return e ?? this.getFirstKey(); + } + getKeyPageBelow(e) { + let n = this.ref.current, r = this.getItem(e); + if (!r) + return null; + if (!Dt(n)) + return this.getLastKey(); + let o = n.getBoundingClientRect(), i = r.getBoundingClientRect(); + if (this.orientation === "horizontal") { + let l = o.x - n.scrollLeft, s = Math.min(n.scrollWidth, i.x - l - i.width + o.width); + for (; r && i.x - l < s; ) + e = this.getKeyBelow(e), r = e == null ? null : this.getItem(e), i = r == null ? void 0 : r.getBoundingClientRect(); + } else { + let l = o.y - n.scrollTop, s = Math.min(n.scrollHeight, i.y - l - i.height + o.height); + for (; r && i.y - l < s; ) + e = this.getKeyBelow(e), r = e == null ? null : this.getItem(e), i = r == null ? void 0 : r.getBoundingClientRect(); + } + return e ?? this.getLastKey(); + } + getKeyForSearch(e, n) { + if (!this.collator) + return null; + let r = this.collection, o = n || this.getFirstKey(); + for (; o != null; ) { + let i = r.getItem(o), l = i.textValue.slice(0, e.length); + if (i.textValue && this.collator.compare(l, e) === 0) + return o; + o = this.getKeyBelow(o); + } + return null; + } + constructor(...e) { + if (e.length === 1) { + let n = e[0]; + this.collection = n.collection, this.ref = n.ref, this.collator = n.collator, this.disabledKeys = n.disabledKeys || /* @__PURE__ */ new Set(), this.orientation = n.orientation, this.direction = n.direction, this.layout = n.layout || "stack"; + } else + this.collection = e[0], this.disabledKeys = e[1], this.ref = e[2], this.collator = e[3], this.layout = "stack", this.orientation = "vertical"; + this.layout === "stack" && this.orientation === "vertical" && (this.getKeyLeftOf = void 0, this.getKeyRightOf = void 0); + } +} +function sl(t) { + let { selectionManager: e, collection: n, disabledKeys: r, ref: o, keyboardDelegate: i } = t, l = Xn({ + usage: "search", + sensitivity: "base" + }), s = e.disabledBehavior, u = ne(() => i || new Zn(n, s === "selection" ? /* @__PURE__ */ new Set() : r, o, l), [ + i, + n, + r, + o, + l, + s + ]), { collectionProps: a } = il({ + ...t, + ref: o, + selectionManager: e, + keyboardDelegate: u + }); + return { + listProps: a + }; +} +const Jt = /* @__PURE__ */ new WeakMap(); +function Ia(t) { + return typeof t == "string" ? t.replace(/\s*/g, "") : "" + t; +} +function ul(t, e) { + let n = Jt.get(t); + if (!n) + throw new Error("Unknown list"); + return `${n.id}-option-${Ia(e)}`; +} +function Ba(t, e, n) { + let r = ze(t, { + labelable: !0 + }), o = t.selectionBehavior || "toggle", i = t.linkBehavior || (o === "replace" ? "action" : "override"); + o === "toggle" && i === "action" && (i = "override"); + let { listProps: l } = sl({ + ...t, + ref: n, + selectionManager: e.selectionManager, + collection: e.collection, + disabledKeys: e.disabledKeys, + linkBehavior: i + }), { focusWithinProps: s } = Xt({ + onFocusWithin: t.onFocus, + onBlurWithin: t.onBlur, + onFocusWithinChange: t.onFocusChange + }), u = Ae(t.id); + Jt.set(e, { + id: u, + shouldUseVirtualFocus: t.shouldUseVirtualFocus, + shouldSelectOnPressUp: t.shouldSelectOnPressUp, + shouldFocusOnHover: t.shouldFocusOnHover, + isVirtualized: t.isVirtualized, + onAction: t.onAction, + linkBehavior: i + }); + let { labelProps: a, fieldProps: c } = Bo({ + ...t, + id: u, + // listbox is not an HTML input element so it + // shouldn't be labeled by a