@strapi/ui-primitives 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +1 -64
  2. package/dist/index.mjs +1104 -2190
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,125 +1,124 @@
1
- import { jsx as b, jsxs as it, Fragment as at } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import Ue, { useDebugValue as ho, createElement as Gn, useRef as Yn, useContext as qn } from "react";
4
- import { useComposedRefs as z } from "@radix-ui/react-compose-refs";
5
- import { createContextScope as Oo, createContext as Mo } from "@radix-ui/react-context";
6
- import { Slot as Ct } from "@radix-ui/react-slot";
7
- import { composeEventHandlers as M } from "@radix-ui/primitive";
8
- import { DismissableLayer as Do } from "@radix-ui/react-dismissable-layer";
9
- import { useFocusGuards as Fo } from "@radix-ui/react-focus-guards";
10
- import { FocusScope as Lo } from "@radix-ui/react-focus-scope";
11
- import { useId as Ee } from "@radix-ui/react-id";
12
- import * as Pe from "@radix-ui/react-popper";
13
- import { createPopperScope as $o } from "@radix-ui/react-popper";
14
- import { Portal as Bo } from "@radix-ui/react-portal";
15
- import { Primitive as F } from "@radix-ui/react-primitive";
16
- import { useControllableState as Re } from "@radix-ui/react-use-controllable-state";
17
- import { useLayoutEffect as te } from "@radix-ui/react-use-layout-effect";
18
- import { hideOthers as zo } from "aria-hidden";
19
- import * as ct from "react-dom";
20
- import { RemoveScroll as jo } from "react-remove-scroll";
21
- import { useVirtualizer as Xn } from "@tanstack/react-virtual";
22
- import { clamp as mo } from "@radix-ui/number";
23
- import { createCollection as Zn } from "@radix-ui/react-collection";
24
- import { useDirection as Jn } from "@radix-ui/react-direction";
25
- import { usePrevious as Qn } from "@radix-ui/react-use-previous";
26
- import { VisuallyHidden as er } from "@radix-ui/react-visually-hidden";
27
- function tr(e) {
28
- const o = `${e}CollectionProvider`, [t, n] = Oo(o), [r, s] = t(o, {
1
+ import { jsx as p, jsxs as ye, Fragment as Se } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { useComposedRefs as A } from "@radix-ui/react-compose-refs";
4
+ import { createContextScope as st, createContext as it } from "@radix-ui/react-context";
5
+ import { Slot as Ee } from "@radix-ui/react-slot";
6
+ import { composeEventHandlers as E } from "@radix-ui/primitive";
7
+ import { DismissableLayer as ct } from "@radix-ui/react-dismissable-layer";
8
+ import { useFocusGuards as at } from "@radix-ui/react-focus-guards";
9
+ import { FocusScope as ut } from "@radix-ui/react-focus-scope";
10
+ import { useId as se } from "@radix-ui/react-id";
11
+ import * as ie from "@radix-ui/react-popper";
12
+ import { createPopperScope as dt } from "@radix-ui/react-popper";
13
+ import { Portal as pt } from "@radix-ui/react-portal";
14
+ import { Primitive as N } from "@radix-ui/react-primitive";
15
+ import { useControllableState as de } from "@radix-ui/react-use-controllable-state";
16
+ import { useLayoutEffect as $ } from "@radix-ui/react-use-layout-effect";
17
+ import { hideOthers as ft } from "aria-hidden";
18
+ import * as we from "react-dom";
19
+ import { RemoveScroll as mt } from "react-remove-scroll";
20
+ import { useVirtualizer as jt } from "@tanstack/react-virtual";
21
+ import { clamp as rt } from "@radix-ui/number";
22
+ import { createCollection as Yt } from "@radix-ui/react-collection";
23
+ import { useDirection as qt } from "@radix-ui/react-direction";
24
+ import { usePrevious as Xt } from "@radix-ui/react-use-previous";
25
+ import { VisuallyHidden as Zt } from "@radix-ui/react-visually-hidden";
26
+ function Jt(o) {
27
+ const i = `${o}CollectionProvider`, [e, t] = st(i), [n, r] = e(i, {
29
28
  collectionRef: { current: null },
30
29
  itemMap: /* @__PURE__ */ new Map(),
31
30
  listeners: /* @__PURE__ */ new Set()
32
- }), i = (u) => {
33
- const { scope: f, children: m } = u, S = l.useRef(null), v = l.useRef(/* @__PURE__ */ new Map()).current, p = l.useRef(/* @__PURE__ */ new Set()).current;
34
- return /* @__PURE__ */ b(r, { scope: f, itemMap: v, collectionRef: S, listeners: p, children: m });
31
+ }), c = (u) => {
32
+ const { scope: f, children: m } = u, b = s.useRef(null), g = s.useRef(/* @__PURE__ */ new Map()).current, d = s.useRef(/* @__PURE__ */ new Set()).current;
33
+ return /* @__PURE__ */ p(n, { scope: f, itemMap: g, collectionRef: b, listeners: d, children: m });
35
34
  };
36
- i.displayName = o;
37
- const a = `${e}CollectionSlot`, c = l.forwardRef((u, f) => {
38
- const { scope: m, children: S } = u, v = s(a, m), p = z(f, v.collectionRef);
39
- return /* @__PURE__ */ b(Ct, { ref: p, children: S });
35
+ c.displayName = i;
36
+ const l = `${o}CollectionSlot`, a = s.forwardRef((u, f) => {
37
+ const { scope: m, children: b } = u, g = r(l, m), d = A(f, g.collectionRef);
38
+ return /* @__PURE__ */ p(Ee, { ref: d, children: b });
40
39
  });
41
- c.displayName = a;
42
- const d = `${e}CollectionItemSlot`, y = "data-radix-collection-item", g = l.forwardRef((u, f) => {
43
- const { scope: m, children: S, ...v } = u, p = l.useRef(null), w = z(f, p), C = s(d, m);
44
- return l.useEffect(() => {
45
- const E = Array.from(C.itemMap.values());
46
- return C.itemMap.set(p, { ref: p, ...v }), C.listeners.forEach((T) => T(Array.from(C.itemMap.values()), E)), () => {
47
- const T = Array.from(C.itemMap.values());
48
- C.itemMap.delete(p), C.listeners.forEach((x) => x(Array.from(C.itemMap.values()), T));
40
+ a.displayName = l;
41
+ const h = `${o}CollectionItemSlot`, C = "data-radix-collection-item", v = s.forwardRef((u, f) => {
42
+ const { scope: m, children: b, ...g } = u, d = s.useRef(null), y = A(f, d), V = r(h, m);
43
+ return s.useEffect(() => {
44
+ const O = Array.from(V.itemMap.values());
45
+ return V.itemMap.set(d, { ref: d, ...g }), V.listeners.forEach((F) => F(Array.from(V.itemMap.values()), O)), () => {
46
+ const F = Array.from(V.itemMap.values());
47
+ V.itemMap.delete(d), V.listeners.forEach((_) => _(Array.from(V.itemMap.values()), F));
49
48
  };
50
- }), /* @__PURE__ */ b(Ct, { [y]: "", ref: w, children: S });
49
+ }), /* @__PURE__ */ p(Ee, { [C]: "", ref: y, children: b });
51
50
  });
52
- g.displayName = d;
53
- function h(u) {
54
- const f = s(`${e}CollectionConsumer`, u), m = l.useCallback(() => {
55
- const v = f.collectionRef.current;
56
- if (!v) return [];
57
- const p = Array.from(v.querySelectorAll(`[${y}]`));
51
+ v.displayName = h;
52
+ function x(u) {
53
+ const f = r(`${o}CollectionConsumer`, u), m = s.useCallback(() => {
54
+ const g = f.collectionRef.current;
55
+ if (!g) return [];
56
+ const d = Array.from(g.querySelectorAll(`[${C}]`));
58
57
  return Array.from(f.itemMap.values()).sort(
59
- (E, T) => p.indexOf(E.ref.current) - p.indexOf(T.ref.current)
58
+ (O, F) => d.indexOf(O.ref.current) - d.indexOf(F.ref.current)
60
59
  );
61
- }, [f.collectionRef, f.itemMap]), S = l.useCallback(
62
- (v) => (f.listeners.add(v), () => f.listeners.delete(v)),
60
+ }, [f.collectionRef, f.itemMap]), b = s.useCallback(
61
+ (g) => (f.listeners.add(g), () => f.listeners.delete(g)),
63
62
  [f.listeners]
64
63
  );
65
- return { getItems: m, subscribe: S };
64
+ return { getItems: m, subscribe: b };
66
65
  }
67
66
  return [
68
- { Provider: i, Slot: c, ItemSlot: g },
69
- h,
70
- n
67
+ { Provider: c, Slot: a, ItemSlot: v },
68
+ x,
69
+ t
71
70
  ];
72
71
  }
73
- const vt = /* @__PURE__ */ new Map();
74
- function or(e, o) {
75
- const t = e + (o ? Object.entries(o).sort((r, s) => r[0] < s[0] ? -1 : 1).join() : "");
76
- if (vt.has(t))
77
- return vt.get(t);
78
- const n = new Intl.Collator(e, o);
79
- return vt.set(t, n), n;
72
+ const Pe = /* @__PURE__ */ new Map();
73
+ function Qt(o, i) {
74
+ const e = o + (i ? Object.entries(i).sort((n, r) => n[0] < r[0] ? -1 : 1).join() : "");
75
+ if (Pe.has(e))
76
+ return Pe.get(e);
77
+ const t = new Intl.Collator(o, i);
78
+ return Pe.set(e, t), t;
80
79
  }
81
- function Lt(e, o) {
82
- const t = or(e, {
80
+ function De(o, i) {
81
+ const e = Qt(o, {
83
82
  usage: "search",
84
- ...o
83
+ ...i
85
84
  });
86
85
  return {
87
- startsWith(n, r) {
88
- return r.length === 0 ? !0 : (n = n.normalize("NFC"), r = r.normalize("NFC"), t.compare(n.slice(0, r.length), r) === 0);
86
+ startsWith(t, n) {
87
+ return n.length === 0 ? !0 : (t = t.normalize("NFC"), n = n.normalize("NFC"), e.compare(t.slice(0, n.length), n) === 0);
89
88
  },
90
- endsWith(n, r) {
91
- return r.length === 0 ? !0 : (n = n.normalize("NFC"), r = r.normalize("NFC"), t.compare(n.slice(-r.length), r) === 0);
89
+ endsWith(t, n) {
90
+ return n.length === 0 ? !0 : (t = t.normalize("NFC"), n = n.normalize("NFC"), e.compare(t.slice(-n.length), n) === 0);
92
91
  },
93
- contains(n, r) {
94
- if (r.length === 0)
92
+ contains(t, n) {
93
+ if (n.length === 0)
95
94
  return !0;
96
- n = n.normalize("NFC"), r = r.normalize("NFC");
97
- let s = 0;
98
- const i = r.length;
99
- for (; s + i <= n.length; s++) {
100
- const a = n.slice(s, s + i);
101
- if (t.compare(r, a) === 0)
95
+ t = t.normalize("NFC"), n = n.normalize("NFC");
96
+ let r = 0;
97
+ const c = n.length;
98
+ for (; r + c <= t.length; r++) {
99
+ const l = t.slice(r, r + c);
100
+ if (e.compare(n, l) === 0)
102
101
  return !0;
103
102
  }
104
103
  return !1;
105
104
  }
106
105
  };
107
106
  }
108
- const nr = (e) => {
109
- const o = l.useRef();
110
- return l.useEffect(() => {
111
- o.current = e;
112
- }), o.current;
113
- }, Ho = l.forwardRef(
114
- ({ children: e, estimatedItemSize: o = 40, overscan: t = 5, getItemCount: n, onViewportChange: r, ...s }, i) => {
115
- const a = l.useRef(null), c = z(i, a, r), d = l.useMemo(() => l.Children.toArray(e), [e]), y = Xn({
116
- count: n(),
117
- getScrollElement: () => a.current,
118
- estimateSize: () => o,
119
- overscan: t
120
- }), g = y.getVirtualItems();
121
- return /* @__PURE__ */ it(at, { children: [
122
- /* @__PURE__ */ b(
107
+ const eo = (o) => {
108
+ const i = s.useRef();
109
+ return s.useEffect(() => {
110
+ i.current = o;
111
+ }), i.current;
112
+ }, ht = s.forwardRef(
113
+ ({ children: o, estimatedItemSize: i = 40, overscan: e = 5, getItemCount: t, onViewportChange: n, ...r }, c) => {
114
+ const l = s.useRef(null), a = A(c, l, n), h = s.useMemo(() => s.Children.toArray(o), [o]), C = jt({
115
+ count: t(),
116
+ getScrollElement: () => l.current,
117
+ estimateSize: () => i,
118
+ overscan: e
119
+ }), v = C.getVirtualItems();
120
+ return /* @__PURE__ */ ye(Se, { children: [
121
+ /* @__PURE__ */ p(
123
122
  "style",
124
123
  {
125
124
  dangerouslySetInnerHTML: {
@@ -127,44 +126,44 @@ const nr = (e) => {
127
126
  }
128
127
  }
129
128
  ),
130
- /* @__PURE__ */ b(
131
- F.div,
129
+ /* @__PURE__ */ p(
130
+ N.div,
132
131
  {
133
132
  "data-radix-combobox-viewport": "",
134
133
  role: "presentation",
135
- ...s,
136
- ref: c,
134
+ ...r,
135
+ ref: a,
137
136
  style: {
138
137
  position: "relative",
139
138
  flex: 1,
140
139
  overflow: "auto",
141
- ...s.style
140
+ ...r.style
142
141
  },
143
- children: /* @__PURE__ */ b(
142
+ children: /* @__PURE__ */ p(
144
143
  "div",
145
144
  {
146
145
  style: {
147
- height: `${y.getTotalSize()}px`,
146
+ height: `${C.getTotalSize()}px`,
148
147
  width: "100%",
149
148
  position: "relative"
150
149
  },
151
- children: g.map((h) => {
152
- const u = d[h.index];
153
- return /* @__PURE__ */ b(
150
+ children: v.map((x) => {
151
+ const u = h[x.index];
152
+ return /* @__PURE__ */ p(
154
153
  "div",
155
154
  {
156
- "data-index": h.index,
157
- ref: y.measureElement,
155
+ "data-index": x.index,
156
+ ref: C.measureElement,
158
157
  style: {
159
158
  position: "absolute",
160
159
  top: 0,
161
160
  left: 0,
162
161
  width: "100%",
163
- transform: `translateY(${h.start}px)`
162
+ transform: `translateY(${x.start}px)`
164
163
  },
165
164
  children: u
166
165
  },
167
- h.key
166
+ x.key
168
167
  );
169
168
  })
170
169
  }
@@ -174,352 +173,352 @@ const nr = (e) => {
174
173
  ] });
175
174
  }
176
175
  );
177
- Ho.displayName = "VirtualizedViewport";
178
- const rr = [" ", "Enter", "ArrowUp", "ArrowDown"], sr = ["Enter"], ir = (e) => !!(e.length === 1 && e.match(/\S| /)), Uo = "Combobox", [Ce, We] = tr(Uo), [ar, pe] = Mo(Uo), cr = ({ children: e }) => /* @__PURE__ */ b(Pe.Root, { children: /* @__PURE__ */ b(Ce.Provider, { scope: void 0, children: e }) }), lr = (e) => typeof e == "string" ? e === "none" ? {
179
- type: e,
176
+ ht.displayName = "VirtualizedViewport";
177
+ const to = [" ", "Enter", "ArrowUp", "ArrowDown"], oo = ["Enter"], no = (o) => !!(o.length === 1 && o.match(/\S| /)), gt = "Combobox", [re, xe] = Jt(gt), [ro, Y] = it(gt), lo = ({ children: o }) => /* @__PURE__ */ p(ie.Root, { children: /* @__PURE__ */ p(re.Provider, { scope: void 0, children: o }) }), so = (o) => typeof o == "string" ? o === "none" ? {
178
+ type: o,
180
179
  filter: void 0
181
180
  } : {
182
- type: e,
181
+ type: o,
183
182
  filter: "startsWith"
184
- } : e, ur = (e) => {
183
+ } : o, io = (o) => {
185
184
  const {
186
- allowCustomValue: o = !1,
187
- autocomplete: t = "none",
188
- children: n,
189
- open: r,
190
- defaultOpen: s,
191
- onOpenChange: i,
192
- value: a,
193
- defaultValue: c,
194
- onValueChange: d,
195
- disabled: y,
196
- required: g = !1,
197
- locale: h = "en-EN",
185
+ allowCustomValue: i = !1,
186
+ autocomplete: e = "none",
187
+ children: t,
188
+ open: n,
189
+ defaultOpen: r,
190
+ onOpenChange: c,
191
+ value: l,
192
+ defaultValue: a,
193
+ onValueChange: h,
194
+ disabled: C,
195
+ required: v = !1,
196
+ locale: x = "en-EN",
198
197
  onTextValueChange: u,
199
198
  textValue: f,
200
199
  defaultTextValue: m,
201
- filterValue: S,
202
- defaultFilterValue: v,
203
- onFilterValueChange: p,
204
- isPrintableCharacter: w = ir,
205
- visible: C = !1,
206
- virtualized: E = "auto",
207
- estimatedItemSize: T = 40,
208
- overscan: x = 5
209
- } = e, [D, W] = l.useState(null), [G, oe] = l.useState(null), [L, Y] = l.useState(null), [K, Z] = l.useState(null), [le = !1, ne] = Re({
210
- prop: r,
211
- defaultProp: s,
212
- onChange: i
213
- }), [J, $] = Re({
214
- prop: a,
215
- defaultProp: c,
216
- onChange: d
217
- }), [re, q] = Re({
200
+ filterValue: b,
201
+ defaultFilterValue: g,
202
+ onFilterValueChange: d,
203
+ isPrintableCharacter: y = no,
204
+ visible: V = !1,
205
+ virtualized: O = "auto",
206
+ estimatedItemSize: F = 40,
207
+ overscan: _ = 5
208
+ } = o, [k, Z] = s.useState(null), [U, W] = s.useState(null), [R, H] = s.useState(null), [L, z] = s.useState(null), [J = !1, Q] = de({
209
+ prop: n,
210
+ defaultProp: r,
211
+ onChange: c
212
+ }), [K, G] = de({
213
+ prop: l,
214
+ defaultProp: a,
215
+ onChange: h
216
+ }), [ce, ee] = de({
218
217
  prop: f,
219
- defaultProp: o && !m ? a : m,
218
+ defaultProp: i && !m ? l : m,
220
219
  onChange: u
221
- }), [j, fe] = Re({
222
- prop: S,
223
- defaultProp: v,
224
- onChange: p
225
- }), se = Ee(), ae = l.useCallback(
226
- (I, N) => {
227
- var ue;
228
- const k = N.map((U) => U.ref.current), [_, ...R] = k, [A] = R.slice(-1), ee = K ?? ((ue = N.find((U) => U.value === J)) == null ? void 0 : ue.ref.current);
229
- for (const U of I) {
230
- if (U === ee) return;
231
- if (U == null || U.scrollIntoView({ block: "nearest" }), U === _ && G && (G.scrollTop = 0), U === A && G && (G.scrollTop = G.scrollHeight), Z(U), t === "both") {
232
- const Ae = N.find((Be) => Be.ref.current === U);
233
- Ae && q(Ae.textValue);
220
+ }), [fe, me] = de({
221
+ prop: b,
222
+ defaultProp: g,
223
+ onChange: d
224
+ }), te = se(), ae = s.useCallback(
225
+ (S, I) => {
226
+ var j;
227
+ const M = I.map((D) => D.ref.current), [P, ...T] = M, [w] = T.slice(-1), B = L ?? ((j = I.find((D) => D.value === K)) == null ? void 0 : j.ref.current);
228
+ for (const D of S) {
229
+ if (D === B) return;
230
+ if (D == null || D.scrollIntoView({ block: "nearest" }), D === P && U && (U.scrollTop = 0), D === w && U && (U.scrollTop = U.scrollHeight), z(D), e === "both") {
231
+ const ue = I.find((he) => he.ref.current === D);
232
+ ue && ee(ue.textValue);
234
233
  }
235
- if (U !== ee) return;
234
+ if (D !== B) return;
236
235
  }
237
236
  },
238
- [t, q, G, K, J]
239
- ), Q = lr(t);
240
- return l.useEffect(() => {
241
- t !== "both" && Z(null);
242
- }, [re, t]), l.useEffect(() => {
243
- if (L && D) return zo([L, D]);
244
- }, [L, D]), /* @__PURE__ */ b(cr, { children: /* @__PURE__ */ b(
245
- ar,
237
+ [e, ee, U, L, K]
238
+ ), ne = so(e);
239
+ return s.useEffect(() => {
240
+ e !== "both" && z(null);
241
+ }, [ce, e]), s.useEffect(() => {
242
+ if (R && k) return ft([R, k]);
243
+ }, [R, k]), /* @__PURE__ */ p(lo, { children: /* @__PURE__ */ p(
244
+ ro,
246
245
  {
247
- allowCustomValue: o,
248
- autocomplete: Q,
249
- required: g,
250
- trigger: D,
251
- onTriggerChange: W,
252
- contentId: se,
253
- value: J,
254
- onValueChange: $,
255
- open: le,
256
- onOpenChange: ne,
257
- disabled: y,
258
- locale: h,
246
+ allowCustomValue: i,
247
+ autocomplete: ne,
248
+ required: v,
249
+ trigger: k,
250
+ onTriggerChange: Z,
251
+ contentId: te,
252
+ value: K,
253
+ onValueChange: G,
254
+ open: J,
255
+ onOpenChange: Q,
256
+ disabled: C,
257
+ locale: x,
259
258
  focusFirst: ae,
260
- textValue: re,
261
- onTextValueChange: q,
262
- onViewportChange: oe,
263
- onContentChange: Y,
264
- visuallyFocussedItem: K,
265
- filterValue: j,
266
- onFilterValueChange: fe,
267
- onVisuallyFocussedItemChange: Z,
268
- isPrintableCharacter: w,
269
- visible: C,
270
- virtualized: E,
271
- estimatedItemSize: T,
272
- overscan: x,
273
- children: n
259
+ textValue: ce,
260
+ onTextValueChange: ee,
261
+ onViewportChange: W,
262
+ onContentChange: H,
263
+ visuallyFocussedItem: L,
264
+ filterValue: fe,
265
+ onFilterValueChange: me,
266
+ onVisuallyFocussedItemChange: z,
267
+ isPrintableCharacter: y,
268
+ visible: V,
269
+ virtualized: O,
270
+ estimatedItemSize: F,
271
+ overscan: _,
272
+ children: t
274
273
  }
275
274
  ) });
276
- }, Wo = "ComboboxTrigger", Ko = l.forwardRef((e, o) => {
277
- const { ...t } = e, n = pe(Wo), r = () => {
278
- n.disabled || n.onOpenChange(!0);
275
+ }, xt = "ComboboxTrigger", Ct = s.forwardRef((o, i) => {
276
+ const { ...e } = o, t = Y(xt), n = () => {
277
+ t.disabled || t.onOpenChange(!0);
279
278
  };
280
- return /* @__PURE__ */ b(Pe.Anchor, { asChild: !0, children: /* @__PURE__ */ b(
281
- Lo,
279
+ return /* @__PURE__ */ p(ie.Anchor, { asChild: !0, children: /* @__PURE__ */ p(
280
+ ut,
282
281
  {
283
282
  asChild: !0,
284
- trapped: n.open,
285
- onMountAutoFocus: (s) => {
286
- s.preventDefault();
283
+ trapped: t.open,
284
+ onMountAutoFocus: (r) => {
285
+ r.preventDefault();
287
286
  },
288
- onUnmountAutoFocus: (s) => {
289
- var i, a;
290
- (i = n.trigger) == null || i.focus({ preventScroll: !0 }), (a = document.getSelection()) == null || a.empty(), s.preventDefault();
287
+ onUnmountAutoFocus: (r) => {
288
+ var c, l;
289
+ (c = t.trigger) == null || c.focus({ preventScroll: !0 }), (l = document.getSelection()) == null || l.empty(), r.preventDefault();
291
290
  },
292
- children: /* @__PURE__ */ b(
291
+ children: /* @__PURE__ */ p(
293
292
  "div",
294
293
  {
295
- ref: o,
296
- "data-disabled": n.disabled ? "" : void 0,
297
- ...t,
298
- onClick: M(t.onClick, (s) => {
299
- var i;
300
- if (n.disabled) {
301
- s.preventDefault();
294
+ ref: i,
295
+ "data-disabled": t.disabled ? "" : void 0,
296
+ ...e,
297
+ onClick: E(e.onClick, (r) => {
298
+ var c;
299
+ if (t.disabled) {
300
+ r.preventDefault();
302
301
  return;
303
302
  }
304
- (i = n.trigger) == null || i.focus();
303
+ (c = t.trigger) == null || c.focus();
305
304
  }),
306
- onPointerDown: M(t.onPointerDown, (s) => {
307
- var c;
308
- if (n.disabled) {
309
- s.preventDefault();
305
+ onPointerDown: E(e.onPointerDown, (r) => {
306
+ var a;
307
+ if (t.disabled) {
308
+ r.preventDefault();
310
309
  return;
311
310
  }
312
- const i = s.target;
313
- i.hasPointerCapture(s.pointerId) && i.releasePointerCapture(s.pointerId), (i.closest("button") ?? i.closest("div")) === s.currentTarget && s.button === 0 && s.ctrlKey === !1 && (r(), (c = n.trigger) == null || c.focus());
311
+ const c = r.target;
312
+ c.hasPointerCapture(r.pointerId) && c.releasePointerCapture(r.pointerId), (c.closest("button") ?? c.closest("div")) === r.currentTarget && r.button === 0 && r.ctrlKey === !1 && (n(), (a = t.trigger) == null || a.focus());
314
313
  })
315
314
  }
316
315
  )
317
316
  }
318
317
  ) });
319
318
  });
320
- Ko.displayName = Wo;
321
- const Go = "ComboboxInput", Yo = l.forwardRef((e, o) => {
322
- var y;
323
- const t = pe(Go), n = l.useRef(null), { getItems: r } = We(void 0), { startsWith: s } = Lt(t.locale, { sensitivity: "base" }), i = t.disabled, a = z(n, o, t.onTriggerChange), c = () => {
324
- i || t.onOpenChange(!0);
325
- }, d = nr(t.filterValue);
326
- return te(() => {
327
- const g = setTimeout(() => {
319
+ Ct.displayName = xt;
320
+ const vt = "ComboboxInput", bt = s.forwardRef((o, i) => {
321
+ var C;
322
+ const e = Y(vt), t = s.useRef(null), { getItems: n } = xe(void 0), { startsWith: r } = De(e.locale, { sensitivity: "base" }), c = e.disabled, l = A(t, i, e.onTriggerChange), a = () => {
323
+ c || e.onOpenChange(!0);
324
+ }, h = eo(e.filterValue);
325
+ return $(() => {
326
+ const v = setTimeout(() => {
328
327
  var f;
329
- if (t.textValue === "" || t.textValue === void 0 || t.filterValue === "" || t.filterValue === void 0)
328
+ if (e.textValue === "" || e.textValue === void 0 || e.filterValue === "" || e.filterValue === void 0)
330
329
  return;
331
- const h = r().find(
332
- (m) => m.type === "option" && s(m.textValue, t.textValue)
333
- ), u = Tr(d ?? "", t.filterValue);
334
- h && !t.visuallyFocussedItem && u === t.filterValue.length && ((f = n.current) == null || f.setSelectionRange(t.filterValue.length, t.textValue.length));
330
+ const x = n().find(
331
+ (m) => m.type === "option" && r(m.textValue, e.textValue)
332
+ ), u = wo(h ?? "", e.filterValue);
333
+ x && !e.visuallyFocussedItem && u === e.filterValue.length && ((f = t.current) == null || f.setSelectionRange(e.filterValue.length, e.textValue.length));
335
334
  });
336
- return () => clearTimeout(g);
337
- }, [t.textValue, t.filterValue, s, t.visuallyFocussedItem, r, d]), /* @__PURE__ */ b(
335
+ return () => clearTimeout(v);
336
+ }, [e.textValue, e.filterValue, r, e.visuallyFocussedItem, n, h]), /* @__PURE__ */ p(
338
337
  "input",
339
338
  {
340
339
  type: "text",
341
340
  role: "combobox",
342
- "aria-controls": t.contentId,
343
- "aria-expanded": t.open,
344
- "aria-required": t.required,
345
- "aria-autocomplete": t.autocomplete.type,
346
- "data-state": t.open ? "open" : "closed",
347
- "aria-disabled": i,
348
- "aria-activedescendant": (y = t.visuallyFocussedItem) == null ? void 0 : y.id,
349
- disabled: i,
350
- "data-disabled": i ? "" : void 0,
351
- "data-placeholder": t.textValue === void 0 ? "" : void 0,
352
- value: t.textValue ?? "",
353
- ...e,
354
- ref: a,
355
- onKeyDown: M(e.onKeyDown, (g) => {
356
- var h, u;
357
- if (["ArrowUp", "ArrowDown", "Home", "End"].includes(g.key))
358
- t.open || c(), setTimeout(() => {
359
- var S;
360
- let m = r().filter((v) => !v.disabled && v.isVisible).map((v) => v.ref.current);
361
- if (["ArrowUp", "End"].includes(g.key) && (m = m.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(g.key)) {
362
- const v = t.visuallyFocussedItem ?? ((S = r().find((p) => p.value === t.value)) == null ? void 0 : S.ref.current);
363
- if (v) {
364
- let p = m.indexOf(v);
365
- p === m.length - 1 && (p = -1), m = m.slice(p + 1);
341
+ "aria-controls": e.contentId,
342
+ "aria-expanded": e.open,
343
+ "aria-required": e.required,
344
+ "aria-autocomplete": e.autocomplete.type,
345
+ "data-state": e.open ? "open" : "closed",
346
+ "aria-disabled": c,
347
+ "aria-activedescendant": (C = e.visuallyFocussedItem) == null ? void 0 : C.id,
348
+ disabled: c,
349
+ "data-disabled": c ? "" : void 0,
350
+ "data-placeholder": e.textValue === void 0 ? "" : void 0,
351
+ value: e.textValue ?? "",
352
+ ...o,
353
+ ref: l,
354
+ onKeyDown: E(o.onKeyDown, (v) => {
355
+ var x, u;
356
+ if (["ArrowUp", "ArrowDown", "Home", "End"].includes(v.key))
357
+ e.open || a(), setTimeout(() => {
358
+ var b;
359
+ let m = n().filter((g) => !g.disabled && g.isVisible).map((g) => g.ref.current);
360
+ if (["ArrowUp", "End"].includes(v.key) && (m = m.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(v.key)) {
361
+ const g = e.visuallyFocussedItem ?? ((b = n().find((d) => d.value === e.value)) == null ? void 0 : b.ref.current);
362
+ if (g) {
363
+ let d = m.indexOf(g);
364
+ d === m.length - 1 && (d = -1), m = m.slice(d + 1);
366
365
  }
367
366
  }
368
- if (["ArrowDown"].includes(g.key) && t.autocomplete.type === "both" && m.length > 1) {
369
- const [v, ...p] = m, w = r().find((C) => C.ref.current === v).textValue;
370
- t.textValue === w && (m = p);
367
+ if (["ArrowDown"].includes(v.key) && e.autocomplete.type === "both" && m.length > 1) {
368
+ const [g, ...d] = m, y = n().find((V) => V.ref.current === g).textValue;
369
+ e.textValue === y && (m = d);
371
370
  }
372
- t.focusFirst(m, r());
373
- }), g.preventDefault();
374
- else if (["Tab"].includes(g.key) && t.open)
375
- g.preventDefault();
376
- else if (["Escape"].includes(g.key))
377
- t.open ? t.onOpenChange(!1) : (t.onValueChange(void 0), t.onTextValueChange("")), g.preventDefault();
378
- else if (sr.includes(g.key)) {
379
- if (t.visuallyFocussedItem) {
380
- const f = r().find((m) => m.ref.current === t.visuallyFocussedItem);
381
- f && (t.onValueChange(f.value), t.onTextValueChange(f.textValue), t.autocomplete.type === "both" && t.onFilterValueChange(f.textValue), (h = f.ref.current) == null || h.click());
371
+ e.focusFirst(m, n());
372
+ }), v.preventDefault();
373
+ else if (["Tab"].includes(v.key) && e.open)
374
+ v.preventDefault();
375
+ else if (["Escape"].includes(v.key))
376
+ e.open ? e.onOpenChange(!1) : (e.onValueChange(void 0), e.onTextValueChange("")), v.preventDefault();
377
+ else if (oo.includes(v.key)) {
378
+ if (e.visuallyFocussedItem) {
379
+ const f = n().find((m) => m.ref.current === e.visuallyFocussedItem);
380
+ f && (e.onValueChange(f.value), e.onTextValueChange(f.textValue), e.autocomplete.type === "both" && e.onFilterValueChange(f.textValue), (x = f.ref.current) == null || x.click());
382
381
  } else {
383
- const f = r().find(
384
- (m) => m.type === "option" && !m.disabled && m.textValue === t.textValue
382
+ const f = n().find(
383
+ (m) => m.type === "option" && !m.disabled && m.textValue === e.textValue
385
384
  );
386
- f && (t.onValueChange(f.value), t.onTextValueChange(f.textValue), t.autocomplete.type === "both" && t.onFilterValueChange(f.textValue), (u = f.ref.current) == null || u.click());
385
+ f && (e.onValueChange(f.value), e.onTextValueChange(f.textValue), e.autocomplete.type === "both" && e.onFilterValueChange(f.textValue), (u = f.ref.current) == null || u.click());
387
386
  }
388
- t.onOpenChange(!1), g.preventDefault();
387
+ e.onOpenChange(!1), v.preventDefault();
389
388
  } else
390
- t.onVisuallyFocussedItemChange(null);
389
+ e.onVisuallyFocussedItemChange(null);
391
390
  }),
392
- onChange: M(e.onChange, (g) => {
393
- t.onTextValueChange(g.currentTarget.value), t.autocomplete.type === "both" && t.onFilterValueChange(g.currentTarget.value);
391
+ onChange: E(o.onChange, (v) => {
392
+ e.onTextValueChange(v.currentTarget.value), e.autocomplete.type === "both" && e.onFilterValueChange(v.currentTarget.value);
394
393
  }),
395
- onKeyUp: M(e.onKeyUp, (g) => {
396
- var h;
397
- if (!t.open && (t.isPrintableCharacter(g.key) || ["Backspace"].includes(g.key)) && c(), setTimeout(() => {
398
- if (t.autocomplete.type === "both" && t.isPrintableCharacter(g.key) && t.filterValue !== void 0) {
399
- const u = t.filterValue, f = r().find((m) => s(m.textValue, u));
400
- f && t.onTextValueChange(f.textValue);
394
+ onKeyUp: E(o.onKeyUp, (v) => {
395
+ var x;
396
+ if (!e.open && (e.isPrintableCharacter(v.key) || ["Backspace"].includes(v.key)) && a(), setTimeout(() => {
397
+ if (e.autocomplete.type === "both" && e.isPrintableCharacter(v.key) && e.filterValue !== void 0) {
398
+ const u = e.filterValue, f = n().find((m) => r(m.textValue, u));
399
+ f && e.onTextValueChange(f.textValue);
401
400
  }
402
- }), t.autocomplete.type === "none" && t.isPrintableCharacter(g.key)) {
403
- const u = t.textValue ?? "", f = r().find((m) => s(m.textValue, u));
404
- f && (t.onVisuallyFocussedItemChange(f.ref.current), (h = f.ref.current) == null || h.scrollIntoView());
401
+ }), e.autocomplete.type === "none" && e.isPrintableCharacter(v.key)) {
402
+ const u = e.textValue ?? "", f = n().find((m) => r(m.textValue, u));
403
+ f && (e.onVisuallyFocussedItemChange(f.ref.current), (x = f.ref.current) == null || x.scrollIntoView());
405
404
  }
406
405
  }),
407
- onBlur: M(e.onBlur, () => {
408
- if (t.open)
406
+ onBlur: E(o.onBlur, () => {
407
+ if (e.open)
409
408
  return;
410
- t.onVisuallyFocussedItemChange(null);
411
- const [g] = r().filter(
412
- (u) => u.textValue === t.textValue && u.type === "option"
409
+ e.onVisuallyFocussedItemChange(null);
410
+ const [v] = n().filter(
411
+ (u) => u.textValue === e.textValue && u.type === "option"
413
412
  );
414
- if (g) {
415
- t.onValueChange(g.value), t.autocomplete.type === "both" && t.onFilterValueChange(g.textValue);
413
+ if (v) {
414
+ e.onValueChange(v.value), e.autocomplete.type === "both" && e.onFilterValueChange(v.textValue);
416
415
  return;
417
416
  }
418
- if (t.allowCustomValue) {
419
- t.onValueChange(t.textValue), t.autocomplete.type === "both" && t.onFilterValueChange(t.textValue);
417
+ if (e.allowCustomValue) {
418
+ e.onValueChange(e.textValue), e.autocomplete.type === "both" && e.onFilterValueChange(e.textValue);
420
419
  return;
421
420
  }
422
- const [h] = r().filter((u) => u.value === t.value && u.type === "option");
423
- h && t.textValue !== "" ? (t.onTextValueChange(h.textValue), t.autocomplete.type === "both" && t.onFilterValueChange(h.textValue)) : (t.onValueChange(void 0), t.onTextValueChange(""));
421
+ const [x] = n().filter((u) => u.value === e.value && u.type === "option");
422
+ x && e.textValue !== "" ? (e.onTextValueChange(x.textValue), e.autocomplete.type === "both" && e.onFilterValueChange(x.textValue)) : (e.onValueChange(void 0), e.onTextValueChange(""));
424
423
  })
425
424
  }
426
425
  );
427
426
  });
428
- Yo.displayName = "ComboboxTextInput";
429
- const qo = l.forwardRef((e, o) => {
430
- const { children: t, ...n } = e, r = pe(Go), s = r.disabled, i = () => {
431
- var a;
432
- s || (r.onOpenChange(!0), (a = r.trigger) == null || a.focus());
427
+ bt.displayName = "ComboboxTextInput";
428
+ const yt = s.forwardRef((o, i) => {
429
+ const { children: e, ...t } = o, n = Y(vt), r = n.disabled, c = () => {
430
+ var l;
431
+ r || (n.onOpenChange(!0), (l = n.trigger) == null || l.focus());
433
432
  };
434
- return /* @__PURE__ */ b(
435
- F.button,
433
+ return /* @__PURE__ */ p(
434
+ N.button,
436
435
  {
437
436
  "aria-hidden": !0,
438
437
  type: "button",
439
- "aria-disabled": s,
440
- "aria-controls": r.contentId,
441
- "aria-expanded": r.open,
442
- disabled: s,
443
- "data-disabled": s ? "" : void 0,
444
- ...n,
438
+ "aria-disabled": r,
439
+ "aria-controls": n.contentId,
440
+ "aria-expanded": n.open,
441
+ disabled: r,
442
+ "data-disabled": r ? "" : void 0,
443
+ ...t,
445
444
  tabIndex: -1,
446
- ref: o,
447
- onClick: M(n.onClick, () => {
448
- var a;
449
- (a = r.trigger) == null || a.focus();
445
+ ref: i,
446
+ onClick: E(t.onClick, () => {
447
+ var l;
448
+ (l = n.trigger) == null || l.focus();
450
449
  }),
451
- onPointerDown: M(n.onPointerDown, (a) => {
452
- a.button === 0 && a.ctrlKey === !1 && (i(), a.preventDefault());
450
+ onPointerDown: E(t.onPointerDown, (l) => {
451
+ l.button === 0 && l.ctrlKey === !1 && (c(), l.preventDefault());
453
452
  }),
454
- onKeyDown: M(n.onKeyDown, (a) => {
455
- rr.includes(a.key) && (i(), a.preventDefault());
453
+ onKeyDown: E(t.onKeyDown, (l) => {
454
+ to.includes(l.key) && (c(), l.preventDefault());
456
455
  }),
457
- children: t || "▼"
456
+ children: e || "▼"
458
457
  }
459
458
  );
460
459
  });
461
- qo.displayName = "ComboboxIcon";
462
- const dr = "ComboboxPortal", Xo = (e) => /* @__PURE__ */ b(Bo, { asChild: !0, ...e });
463
- Xo.displayName = dr;
464
- const $t = "ComboboxContent", Zo = l.forwardRef((e, o) => {
465
- const t = pe($t), { getItems: n } = We(void 0), [r, s] = l.useState();
466
- if (te(() => {
467
- s(new DocumentFragment());
468
- }, []), te(() => {
469
- t.open && t.autocomplete.type === "none" && setTimeout(() => {
470
- var a;
471
- const i = n().find((c) => c.value === t.value);
472
- (a = i == null ? void 0 : i.ref.current) == null || a.scrollIntoView({ block: "nearest" });
460
+ yt.displayName = "ComboboxIcon";
461
+ const co = "ComboboxPortal", St = (o) => /* @__PURE__ */ p(pt, { asChild: !0, ...o });
462
+ St.displayName = co;
463
+ const ke = "ComboboxContent", wt = s.forwardRef((o, i) => {
464
+ const e = Y(ke), { getItems: t } = xe(void 0), [n, r] = s.useState();
465
+ if ($(() => {
466
+ r(new DocumentFragment());
467
+ }, []), $(() => {
468
+ e.open && e.autocomplete.type === "none" && setTimeout(() => {
469
+ var l;
470
+ const c = t().find((a) => a.value === e.value);
471
+ (l = c == null ? void 0 : c.ref.current) == null || l.scrollIntoView({ block: "nearest" });
473
472
  });
474
- }, [n, t.autocomplete, t.value, t.open]), !t.open) {
475
- const i = r;
476
- return i ? ct.createPortal(
477
- /* @__PURE__ */ b(Ce.Slot, { scope: void 0, children: /* @__PURE__ */ b("div", { children: e.children }) }),
478
- i
473
+ }, [t, e.autocomplete, e.value, e.open]), !e.open) {
474
+ const c = n;
475
+ return c ? we.createPortal(
476
+ /* @__PURE__ */ p(re.Slot, { scope: void 0, children: /* @__PURE__ */ p("div", { children: o.children }) }),
477
+ c
479
478
  ) : null;
480
479
  }
481
- return /* @__PURE__ */ b(Jo, { ...e, ref: o });
480
+ return /* @__PURE__ */ p(It, { ...o, ref: i });
482
481
  });
483
- Zo.displayName = $t;
484
- const pr = 10, Jo = l.forwardRef(
485
- (e, o) => {
486
- const { onEscapeKeyDown: t, onPointerDownOutside: n, ...r } = e, s = pe($t), i = z(o, (c) => s.onContentChange(c)), { onOpenChange: a } = s;
487
- return Fo(), l.useEffect(() => {
488
- const c = () => {
489
- a(!1);
482
+ wt.displayName = ke;
483
+ const ao = 10, It = s.forwardRef(
484
+ (o, i) => {
485
+ const { onEscapeKeyDown: e, onPointerDownOutside: t, ...n } = o, r = Y(ke), c = A(i, (a) => r.onContentChange(a)), { onOpenChange: l } = r;
486
+ return at(), s.useEffect(() => {
487
+ const a = () => {
488
+ l(!1);
490
489
  };
491
- return window.addEventListener("blur", c), window.addEventListener("resize", c), () => {
492
- window.removeEventListener("blur", c), window.removeEventListener("resize", c);
490
+ return window.addEventListener("blur", a), window.addEventListener("resize", a), () => {
491
+ window.removeEventListener("blur", a), window.removeEventListener("resize", a);
493
492
  };
494
- }, [a]), /* @__PURE__ */ b(jo, { allowPinchZoom: !0, children: /* @__PURE__ */ b(
495
- Do,
493
+ }, [l]), /* @__PURE__ */ p(mt, { allowPinchZoom: !0, children: /* @__PURE__ */ p(
494
+ ct,
496
495
  {
497
496
  asChild: !0,
498
- onEscapeKeyDown: t,
499
- onPointerDownOutside: n,
500
- onFocusOutside: (c) => {
501
- c.preventDefault();
497
+ onEscapeKeyDown: e,
498
+ onPointerDownOutside: t,
499
+ onFocusOutside: (a) => {
500
+ a.preventDefault();
502
501
  },
503
502
  onDismiss: () => {
504
- var c;
505
- s.onOpenChange(!1), (c = s.trigger) == null || c.focus({ preventScroll: !0 });
503
+ var a;
504
+ r.onOpenChange(!1), (a = r.trigger) == null || a.focus({ preventScroll: !0 });
506
505
  },
507
- children: /* @__PURE__ */ b(
508
- Qo,
506
+ children: /* @__PURE__ */ p(
507
+ Tt,
509
508
  {
510
509
  role: "listbox",
511
- id: s.contentId,
512
- "data-state": s.open ? "open" : "closed",
513
- onContextMenu: (c) => c.preventDefault(),
514
- ...r,
515
- ref: i,
510
+ id: r.contentId,
511
+ "data-state": r.open ? "open" : "closed",
512
+ onContextMenu: (a) => a.preventDefault(),
513
+ ...n,
514
+ ref: c,
516
515
  style: {
517
516
  // flex layout so we can place the scroll buttons properly
518
517
  display: "flex",
519
518
  flexDirection: "column",
520
519
  // reset the outline by default as the content MAY get focused
521
520
  outline: "none",
522
- ...r.style
521
+ ...n.style
523
522
  }
524
523
  }
525
524
  )
@@ -527,21 +526,21 @@ const pr = 10, Jo = l.forwardRef(
527
526
  ) });
528
527
  }
529
528
  );
530
- Jo.displayName = "ComboboxContentImpl";
531
- const Qo = l.forwardRef(
532
- (e, o) => {
533
- const { align: t = "start", collisionPadding: n = pr, ...r } = e;
534
- return /* @__PURE__ */ b(
535
- Pe.Content,
529
+ It.displayName = "ComboboxContentImpl";
530
+ const Tt = s.forwardRef(
531
+ (o, i) => {
532
+ const { align: e = "start", collisionPadding: t = ao, ...n } = o;
533
+ return /* @__PURE__ */ p(
534
+ ie.Content,
536
535
  {
537
- ...r,
538
- ref: o,
539
- align: t,
540
- collisionPadding: n,
536
+ ...n,
537
+ ref: i,
538
+ align: e,
539
+ collisionPadding: t,
541
540
  style: {
542
541
  // Ensure border-box for floating-ui calculations
543
542
  boxSizing: "border-box",
544
- ...r.style,
543
+ ...n.style,
545
544
  "--radix-combobox-content-transform-origin": "var(--radix-popper-transform-origin)",
546
545
  "--radix-combobox-content-available-width": "var(--radix-popper-available-width)",
547
546
  "--radix-combobox-content-available-height": "var(--radix-popper-available-height)",
@@ -552,21 +551,21 @@ const Qo = l.forwardRef(
552
551
  );
553
552
  }
554
553
  );
555
- Qo.displayName = "ComboboxPopperPosition";
556
- const en = "ComboboxViewport", tn = l.forwardRef((e, o) => {
557
- const t = pe(en), n = z(o, t.onViewportChange), s = l.useMemo(() => l.Children.toArray(e.children), [e.children]).length;
558
- return t.virtualized === !0 || t.virtualized === "auto" && s > 100 ? /* @__PURE__ */ b(Ce.Slot, { scope: void 0, children: /* @__PURE__ */ b(
559
- Ho,
554
+ Tt.displayName = "ComboboxPopperPosition";
555
+ const Vt = "ComboboxViewport", Pt = s.forwardRef((o, i) => {
556
+ const e = Y(Vt), t = A(i, e.onViewportChange), r = s.useMemo(() => s.Children.toArray(o.children), [o.children]).length;
557
+ return e.virtualized === !0 || e.virtualized === "auto" && r > 100 ? /* @__PURE__ */ p(re.Slot, { scope: void 0, children: /* @__PURE__ */ p(
558
+ ht,
560
559
  {
561
- ...e,
562
- ref: n,
563
- getItemCount: () => s,
564
- estimatedItemSize: t.estimatedItemSize,
565
- overscan: t.overscan,
566
- onViewportChange: t.onViewportChange
560
+ ...o,
561
+ ref: t,
562
+ getItemCount: () => r,
563
+ estimatedItemSize: e.estimatedItemSize,
564
+ overscan: e.overscan,
565
+ onViewportChange: e.onViewportChange
567
566
  }
568
- ) }) : /* @__PURE__ */ it(at, { children: [
569
- /* @__PURE__ */ b(
567
+ ) }) : /* @__PURE__ */ ye(Se, { children: [
568
+ /* @__PURE__ */ p(
570
569
  "style",
571
570
  {
572
571
  dangerouslySetInnerHTML: {
@@ -574,13 +573,13 @@ const en = "ComboboxViewport", tn = l.forwardRef((e, o) => {
574
573
  }
575
574
  }
576
575
  ),
577
- /* @__PURE__ */ b(Ce.Slot, { scope: void 0, children: /* @__PURE__ */ b(
578
- F.div,
576
+ /* @__PURE__ */ p(re.Slot, { scope: void 0, children: /* @__PURE__ */ p(
577
+ N.div,
579
578
  {
580
579
  "data-radix-combobox-viewport": "",
581
580
  role: "presentation",
582
- ...e,
583
- ref: n,
581
+ ...o,
582
+ ref: t,
584
583
  style: {
585
584
  // we use position: 'relative' here on the `viewport` so that when we call
586
585
  // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
@@ -588,1624 +587,545 @@ const en = "ComboboxViewport", tn = l.forwardRef((e, o) => {
588
587
  position: "relative",
589
588
  flex: 1,
590
589
  overflow: "auto",
591
- ...e.style
590
+ ...o.style
592
591
  }
593
592
  }
594
593
  ) })
595
594
  ] });
596
595
  });
597
- tn.displayName = en;
598
- const lt = "ComboboxItem", [go, Bt] = Mo(lt), zt = l.forwardRef((e, o) => {
599
- const { value: t, disabled: n = !1, textValue: r, ...s } = e, [i, a] = l.useState();
600
- te(() => {
601
- a(new DocumentFragment());
596
+ Pt.displayName = Vt;
597
+ const Ie = "ComboboxItem", [lt, Fe] = it(Ie), Le = s.forwardRef((o, i) => {
598
+ const { value: e, disabled: t = !1, textValue: n, ...r } = o, [c, l] = s.useState();
599
+ $(() => {
600
+ l(new DocumentFragment());
602
601
  }, []);
603
- const { onTextValueChange: c, textValue: d, ...y } = pe(lt), g = Ee(), [h, u] = l.useState(r ?? ""), f = y.value === t, { startsWith: m, contains: S } = Lt(y.locale, { sensitivity: "base" }), v = l.useCallback((p) => {
604
- u((w) => w || ((p == null ? void 0 : p.textContent) ?? "").trim());
602
+ const { onTextValueChange: a, textValue: h, ...C } = Y(Ie), v = se(), [x, u] = s.useState(n ?? ""), f = C.value === e, { startsWith: m, contains: b } = De(C.locale, { sensitivity: "base" }), g = s.useCallback((d) => {
603
+ u((y) => y || ((d == null ? void 0 : d.textContent) ?? "").trim());
605
604
  }, []);
606
- return l.useEffect(() => {
607
- f && d === void 0 && h !== "" && c(h);
608
- }, [h, f, d, c]), y.autocomplete.type === "both" && h && y.filterValue && !m(h, y.filterValue) || y.autocomplete.type === "list" && y.autocomplete.filter === "startsWith" && h && d && !m(h, d) || y.autocomplete.type === "list" && y.autocomplete.filter === "contains" && h && d && !S(h, d) ? i ? ct.createPortal(
609
- /* @__PURE__ */ b(
610
- go,
605
+ return s.useEffect(() => {
606
+ f && h === void 0 && x !== "" && a(x);
607
+ }, [x, f, h, a]), C.autocomplete.type === "both" && x && C.filterValue && !m(x, C.filterValue) || C.autocomplete.type === "list" && C.autocomplete.filter === "startsWith" && x && h && !m(x, h) || C.autocomplete.type === "list" && C.autocomplete.filter === "contains" && x && h && !b(x, h) ? c ? we.createPortal(
608
+ /* @__PURE__ */ p(
609
+ lt,
611
610
  {
612
- textId: g,
613
- onTextValueChange: v,
611
+ textId: v,
612
+ onTextValueChange: g,
614
613
  isSelected: f,
615
- textValue: h,
616
- children: /* @__PURE__ */ b(
617
- Ce.ItemSlot,
614
+ textValue: x,
615
+ children: /* @__PURE__ */ p(
616
+ re.ItemSlot,
618
617
  {
619
618
  scope: void 0,
620
- value: t,
621
- textValue: h,
622
- disabled: n,
619
+ value: e,
620
+ textValue: x,
621
+ disabled: t,
623
622
  type: "option",
624
623
  isVisible: !1,
625
- children: /* @__PURE__ */ b(It, { ref: o, value: t, disabled: n, ...s })
624
+ children: /* @__PURE__ */ p(Ne, { ref: i, value: e, disabled: t, ...r })
626
625
  }
627
626
  )
628
627
  }
629
628
  ),
630
- i
631
- ) : null : /* @__PURE__ */ b(
632
- go,
629
+ c
630
+ ) : null : /* @__PURE__ */ p(
631
+ lt,
633
632
  {
634
- textId: g,
635
- onTextValueChange: v,
633
+ textId: v,
634
+ onTextValueChange: g,
636
635
  isSelected: f,
637
- textValue: h,
638
- children: /* @__PURE__ */ b(
639
- Ce.ItemSlot,
636
+ textValue: x,
637
+ children: /* @__PURE__ */ p(
638
+ re.ItemSlot,
640
639
  {
641
640
  scope: void 0,
642
- value: t,
643
- textValue: h,
644
- disabled: n,
641
+ value: e,
642
+ textValue: x,
643
+ disabled: t,
645
644
  type: "option",
646
645
  isVisible: !0,
647
- children: /* @__PURE__ */ b(It, { ref: o, value: t, disabled: n, ...s })
646
+ children: /* @__PURE__ */ p(Ne, { ref: i, value: e, disabled: t, ...r })
648
647
  }
649
648
  )
650
649
  }
651
650
  );
652
651
  });
653
- zt.displayName = lt;
654
- const on = "ComboboxItemImpl", It = l.forwardRef((e, o) => {
655
- const { value: t, disabled: n = !1, ...r } = e, s = l.useRef(null), i = z(o, s), { getItems: a } = We(void 0), { onTextValueChange: c, visuallyFocussedItem: d, ...y } = pe(lt), { isSelected: g, textValue: h, textId: u } = Bt(on), f = () => {
656
- var v;
657
- n || (y.onValueChange(t), c(h), y.onOpenChange(!1), y.autocomplete.type === "both" && y.onFilterValueChange(h), (v = y.trigger) == null || v.focus({ preventScroll: !0 }));
658
- }, m = l.useMemo(() => {
659
- var v;
660
- return d === ((v = a().find((p) => p.ref.current === s.current)) == null ? void 0 : v.ref.current);
661
- }, [a, d]), S = Ee();
662
- return /* @__PURE__ */ b(
663
- F.div,
652
+ Le.displayName = Ie;
653
+ const Et = "ComboboxItemImpl", Ne = s.forwardRef((o, i) => {
654
+ const { value: e, disabled: t = !1, ...n } = o, r = s.useRef(null), c = A(i, r), { getItems: l } = xe(void 0), { onTextValueChange: a, visuallyFocussedItem: h, ...C } = Y(Ie), { isSelected: v, textValue: x, textId: u } = Fe(Et), f = () => {
655
+ var g;
656
+ t || (C.onValueChange(e), a(x), C.onOpenChange(!1), C.autocomplete.type === "both" && C.onFilterValueChange(x), (g = C.trigger) == null || g.focus({ preventScroll: !0 }));
657
+ }, m = s.useMemo(() => {
658
+ var g;
659
+ return h === ((g = l().find((d) => d.ref.current === r.current)) == null ? void 0 : g.ref.current);
660
+ }, [l, h]), b = se();
661
+ return /* @__PURE__ */ p(
662
+ N.div,
664
663
  {
665
664
  role: "option",
666
665
  "aria-labelledby": u,
667
666
  "data-highlighted": m ? "" : void 0,
668
- "aria-selected": g && m,
669
- "data-state": g ? "checked" : "unchecked",
670
- "aria-disabled": n || void 0,
671
- "data-disabled": n ? "" : void 0,
672
- tabIndex: n ? void 0 : -1,
673
- ...r,
674
- id: S,
675
- ref: i,
676
- onPointerUp: M(r.onPointerUp, f)
667
+ "aria-selected": v && m,
668
+ "data-state": v ? "checked" : "unchecked",
669
+ "aria-disabled": t || void 0,
670
+ "data-disabled": t ? "" : void 0,
671
+ tabIndex: t ? void 0 : -1,
672
+ ...n,
673
+ id: b,
674
+ ref: c,
675
+ onPointerUp: E(n.onPointerUp, f)
677
676
  }
678
677
  );
679
678
  });
680
- It.displayName = on;
681
- const nn = "ComboboxItemText", rn = l.forwardRef((e, o) => {
682
- const { className: t, style: n, ...r } = e, s = Bt(nn), i = z(o, s.onTextValueChange);
683
- return /* @__PURE__ */ b(F.span, { id: s.textId, ...r, ref: i });
679
+ Ne.displayName = Et;
680
+ const Nt = "ComboboxItemText", Rt = s.forwardRef((o, i) => {
681
+ const { className: e, style: t, ...n } = o, r = Fe(Nt), c = A(i, r.onTextValueChange);
682
+ return /* @__PURE__ */ p(N.span, { id: r.textId, ...n, ref: c });
684
683
  });
685
- rn.displayName = nn;
686
- const sn = "ComboboxItemIndicator", an = l.forwardRef((e, o) => {
687
- const { isSelected: t } = Bt(sn);
688
- return t ? /* @__PURE__ */ b(F.span, { "aria-hidden": !0, ...e, ref: o }) : null;
684
+ Rt.displayName = Nt;
685
+ const At = "ComboboxItemIndicator", _t = s.forwardRef((o, i) => {
686
+ const { isSelected: e } = Fe(At);
687
+ return e ? /* @__PURE__ */ p(N.span, { "aria-hidden": !0, ...o, ref: i }) : null;
689
688
  });
690
- an.displayName = sn;
691
- const jt = "ComboboxNoValueFound", cn = l.forwardRef((e, o) => {
689
+ _t.displayName = At;
690
+ const Be = "ComboboxNoValueFound", Mt = s.forwardRef((o, i) => {
692
691
  const {
693
- textValue: t = "",
694
- filterValue: n = "",
695
- visible: r = !1,
696
- locale: s,
697
- autocomplete: i
698
- } = pe(jt), [a, c] = l.useState([]), { subscribe: d } = We(void 0), { startsWith: y, contains: g } = Lt(s, { sensitivity: "base" });
699
- return l.useEffect(() => {
700
- const h = d((u) => {
701
- if (r) {
692
+ textValue: e = "",
693
+ filterValue: t = "",
694
+ visible: n = !1,
695
+ locale: r,
696
+ autocomplete: c
697
+ } = Y(Be), [l, a] = s.useState([]), { subscribe: h } = xe(void 0), { startsWith: C, contains: v } = De(r, { sensitivity: "base" });
698
+ return s.useEffect(() => {
699
+ const x = h((u) => {
700
+ if (n) {
702
701
  const f = u.filter((m) => m.type !== "create");
703
- c(f);
702
+ a(f);
704
703
  } else
705
- c(u);
704
+ a(u);
706
705
  });
707
706
  return () => {
708
- h();
707
+ x();
709
708
  };
710
- }, [r, d]), i.type === "none" && a.length > 0 || i.type === "list" && i.filter === "startsWith" && a.some((h) => y(h.textValue, t)) || i.type === "both" && a.some((h) => y(h.textValue, n)) || i.type === "list" && i.filter === "contains" && a.some((h) => g(h.textValue, t)) ? null : /* @__PURE__ */ b(F.div, { ...e, ref: o });
709
+ }, [n, h]), c.type === "none" && l.length > 0 || c.type === "list" && c.filter === "startsWith" && l.some((x) => C(x.textValue, e)) || c.type === "both" && l.some((x) => C(x.textValue, t)) || c.type === "list" && c.filter === "contains" && l.some((x) => v(x.textValue, e)) ? null : /* @__PURE__ */ p(N.div, { ...o, ref: i });
711
710
  });
712
- cn.displayName = jt;
713
- const ln = l.forwardRef((e, o) => {
714
- const { disabled: t = !1, ...n } = e, r = pe(jt), { textValue: s, visuallyFocussedItem: i } = r, { getItems: a, subscribe: c } = We(void 0), d = l.useRef(null), [y, g] = l.useState(!1), h = z(o, d), u = l.useMemo(() => {
715
- var S;
716
- return i === ((S = a().find((v) => v.ref.current === d.current)) == null ? void 0 : S.ref.current);
717
- }, [a, i]), f = Ee(), m = () => {
718
- var S;
719
- !t && s && (r.onValueChange(s), r.onTextValueChange(s), r.onOpenChange(!1), r.autocomplete.type === "both" && r.onFilterValueChange(s), (S = r.trigger) == null || S.focus({ preventScroll: !0 }));
711
+ Mt.displayName = Be;
712
+ const Ot = s.forwardRef((o, i) => {
713
+ const { disabled: e = !1, ...t } = o, n = Y(Be), { textValue: r, visuallyFocussedItem: c } = n, { getItems: l, subscribe: a } = xe(void 0), h = s.useRef(null), [C, v] = s.useState(!1), x = A(i, h), u = s.useMemo(() => {
714
+ var b;
715
+ return c === ((b = l().find((g) => g.ref.current === h.current)) == null ? void 0 : b.ref.current);
716
+ }, [l, c]), f = se(), m = () => {
717
+ var b;
718
+ !e && r && (n.onValueChange(r), n.onTextValueChange(r), n.onOpenChange(!1), n.autocomplete.type === "both" && n.onFilterValueChange(r), (b = n.trigger) == null || b.focus({ preventScroll: !0 }));
720
719
  };
721
- return te(() => {
722
- const S = c((v) => {
723
- g(!v.some((p) => p.textValue === s && p.type !== "create"));
720
+ return $(() => {
721
+ const b = a((g) => {
722
+ v(!g.some((d) => d.textValue === r && d.type !== "create"));
724
723
  });
725
- return a().length === 0 && g(!0), () => {
726
- S();
724
+ return l().length === 0 && v(!0), () => {
725
+ b();
727
726
  };
728
- }, [s, c, a]), (!s || !y) && !r.visible ? null : /* @__PURE__ */ b(
729
- Ce.ItemSlot,
727
+ }, [r, a, l]), (!r || !C) && !n.visible ? null : /* @__PURE__ */ p(
728
+ re.ItemSlot,
730
729
  {
731
730
  scope: void 0,
732
- value: s ?? "",
733
- textValue: s ?? "",
734
- disabled: t,
731
+ value: r ?? "",
732
+ textValue: r ?? "",
733
+ disabled: e,
735
734
  isVisible: !0,
736
735
  type: "create",
737
- children: /* @__PURE__ */ b(
738
- F.div,
736
+ children: /* @__PURE__ */ p(
737
+ N.div,
739
738
  {
740
739
  role: "option",
741
- tabIndex: t ? void 0 : -1,
742
- "aria-disabled": t || void 0,
743
- "data-disabled": t ? "" : void 0,
740
+ tabIndex: e ? void 0 : -1,
741
+ "aria-disabled": e || void 0,
742
+ "data-disabled": e ? "" : void 0,
744
743
  "data-highlighted": u ? "" : void 0,
745
- ...n,
744
+ ...t,
746
745
  id: f,
747
- ref: h,
748
- onPointerUp: M(n.onPointerUp, m)
746
+ ref: x,
747
+ onPointerUp: E(t.onPointerUp, m)
749
748
  }
750
749
  )
751
750
  }
752
751
  );
753
752
  });
754
- ln.displayName = "ComboboxCreateItem";
755
- const fr = ur, hr = Ko, mr = Yo, gr = qo, yr = Xo, vr = Zo, br = tn, wr = zt, Sr = rn, xr = an, Cr = cn, Ir = ln;
756
- function Tr(e, o) {
757
- const t = Math.min(e.length, o.length);
758
- for (let n = 0; n < t; n++)
759
- if (e[n] !== o[n])
760
- return n;
761
- return t;
753
+ Ot.displayName = "ComboboxCreateItem";
754
+ const uo = io, po = Ct, fo = bt, mo = yt, ho = St, go = wt, xo = Pt, Co = Le, vo = Rt, bo = _t, yo = Mt, So = Ot;
755
+ function wo(o, i) {
756
+ const e = Math.min(o.length, i.length);
757
+ for (let t = 0; t < e; t++)
758
+ if (o[t] !== i[t])
759
+ return t;
760
+ return e;
762
761
  }
763
- const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
762
+ const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
764
763
  __proto__: null,
765
- ComboboxItem: zt,
766
- Content: vr,
767
- CreateItem: Ir,
768
- Icon: gr,
769
- Item: wr,
770
- ItemIndicator: xr,
771
- ItemText: Sr,
772
- NoValueFound: Cr,
773
- Portal: yr,
774
- Root: fr,
775
- TextInput: mr,
776
- Trigger: hr,
777
- Viewport: br
764
+ ComboboxItem: Le,
765
+ Content: go,
766
+ CreateItem: So,
767
+ Icon: mo,
768
+ Item: Co,
769
+ ItemIndicator: bo,
770
+ ItemText: vo,
771
+ NoValueFound: yo,
772
+ Portal: ho,
773
+ Root: uo,
774
+ TextInput: fo,
775
+ Trigger: po,
776
+ Viewport: xo
778
777
  }, Symbol.toStringTag, { value: "Module" }));
779
- var X = function() {
780
- return X = Object.assign || function(o) {
781
- for (var t, n = 1, r = arguments.length; n < r; n++) {
782
- t = arguments[n];
783
- for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (o[s] = t[s]);
784
- }
785
- return o;
786
- }, X.apply(this, arguments);
787
- };
788
- function Ve(e, o, t) {
789
- if (t || arguments.length === 2) for (var n = 0, r = o.length, s; n < r; n++)
790
- (s || !(n in o)) && (s || (s = Array.prototype.slice.call(o, 0, n)), s[n] = o[n]);
791
- return e.concat(s || Array.prototype.slice.call(o));
792
- }
793
- function Er(e) {
794
- var o = /* @__PURE__ */ Object.create(null);
795
- return function(t) {
796
- return o[t] === void 0 && (o[t] = e(t)), o[t];
797
- };
798
- }
799
- var Pr = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, Ar = /* @__PURE__ */ Er(
800
- function(e) {
801
- return Pr.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
802
- }
803
- /* Z+1 */
804
- ), O = "-ms-", He = "-moz-", V = "-webkit-", un = "comm", ut = "rule", Ht = "decl", Nr = "@import", dn = "@keyframes", Rr = "@layer", pn = Math.abs, Ut = String.fromCharCode, Tt = Object.assign;
805
- function Vr(e, o) {
806
- return H(e, 0) ^ 45 ? (((o << 2 ^ H(e, 0)) << 2 ^ H(e, 1)) << 2 ^ H(e, 2)) << 2 ^ H(e, 3) : 0;
807
- }
808
- function fn(e) {
809
- return e.trim();
810
- }
811
- function he(e, o) {
812
- return (e = o.exec(e)) ? e[0] : e;
813
- }
814
- function P(e, o, t) {
815
- return e.replace(o, t);
816
- }
817
- function Je(e, o, t) {
818
- return e.indexOf(o, t);
819
- }
820
- function H(e, o) {
821
- return e.charCodeAt(o) | 0;
822
- }
823
- function _e(e, o, t) {
824
- return e.slice(o, t);
825
- }
826
- function de(e) {
827
- return e.length;
828
- }
829
- function hn(e) {
830
- return e.length;
831
- }
832
- function ze(e, o) {
833
- return o.push(e), e;
834
- }
835
- function _r(e, o) {
836
- return e.map(o).join("");
837
- }
838
- function yo(e, o) {
839
- return e.filter(function(t) {
840
- return !he(t, o);
841
- });
842
- }
843
- var dt = 1, ke = 1, mn = 0, ie = 0, B = 0, Fe = "";
844
- function pt(e, o, t, n, r, s, i, a) {
845
- return { value: e, root: o, parent: t, type: n, props: r, children: s, line: dt, column: ke, length: i, return: "", siblings: a };
846
- }
847
- function ye(e, o) {
848
- return Tt(pt("", null, null, "", null, null, 0, e.siblings), e, { length: -e.length }, o);
849
- }
850
- function Ne(e) {
851
- for (; e.root; )
852
- e = ye(e.root, { children: [e] });
853
- ze(e, e.siblings);
854
- }
855
- function kr() {
856
- return B;
857
- }
858
- function Or() {
859
- return B = ie > 0 ? H(Fe, --ie) : 0, ke--, B === 10 && (ke = 1, dt--), B;
860
- }
861
- function ce() {
862
- return B = ie < mn ? H(Fe, ie++) : 0, ke++, B === 10 && (ke = 1, dt++), B;
863
- }
864
- function Se() {
865
- return H(Fe, ie);
866
- }
867
- function Qe() {
868
- return ie;
869
- }
870
- function ft(e, o) {
871
- return _e(Fe, e, o);
872
- }
873
- function Et(e) {
874
- switch (e) {
875
- case 0:
876
- case 9:
877
- case 10:
878
- case 13:
879
- case 32:
880
- return 5;
881
- case 33:
882
- case 43:
883
- case 44:
884
- case 47:
885
- case 62:
886
- case 64:
887
- case 126:
888
- case 59:
889
- case 123:
890
- case 125:
891
- return 4;
892
- case 58:
893
- return 3;
894
- case 34:
895
- case 39:
896
- case 40:
897
- case 91:
898
- return 2;
899
- case 41:
900
- case 93:
901
- return 1;
902
- }
903
- return 0;
904
- }
905
- function Mr(e) {
906
- return dt = ke = 1, mn = de(Fe = e), ie = 0, [];
907
- }
908
- function Dr(e) {
909
- return Fe = "", e;
910
- }
911
- function bt(e) {
912
- return fn(ft(ie - 1, Pt(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
913
- }
914
- function Fr(e) {
915
- for (; (B = Se()) && B < 33; )
916
- ce();
917
- return Et(e) > 2 || Et(B) > 3 ? "" : " ";
918
- }
919
- function Lr(e, o) {
920
- for (; --o && ce() && !(B < 48 || B > 102 || B > 57 && B < 65 || B > 70 && B < 97); )
921
- ;
922
- return ft(e, Qe() + (o < 6 && Se() == 32 && ce() == 32));
923
- }
924
- function Pt(e) {
925
- for (; ce(); )
926
- switch (B) {
927
- case e:
928
- return ie;
929
- case 34:
930
- case 39:
931
- e !== 34 && e !== 39 && Pt(B);
932
- break;
933
- case 40:
934
- e === 41 && Pt(e);
935
- break;
936
- case 92:
937
- ce();
938
- break;
939
- }
940
- return ie;
941
- }
942
- function $r(e, o) {
943
- for (; ce() && e + B !== 57; )
944
- if (e + B === 84 && Se() === 47)
945
- break;
946
- return "/*" + ft(o, ie - 1) + "*" + Ut(e === 47 ? e : ce());
947
- }
948
- function Br(e) {
949
- for (; !Et(Se()); )
950
- ce();
951
- return ft(e, ie);
952
- }
953
- function zr(e) {
954
- return Dr(et("", null, null, null, [""], e = Mr(e), 0, [0], e));
955
- }
956
- function et(e, o, t, n, r, s, i, a, c) {
957
- for (var d = 0, y = 0, g = i, h = 0, u = 0, f = 0, m = 1, S = 1, v = 1, p = 0, w = "", C = r, E = s, T = n, x = w; S; )
958
- switch (f = p, p = ce()) {
959
- case 40:
960
- if (f != 108 && H(x, g - 1) == 58) {
961
- Je(x += P(bt(p), "&", "&\f"), "&\f", pn(d ? a[d - 1] : 0)) != -1 && (v = -1);
962
- break;
963
- }
964
- case 34:
965
- case 39:
966
- case 91:
967
- x += bt(p);
968
- break;
969
- case 9:
970
- case 10:
971
- case 13:
972
- case 32:
973
- x += Fr(f);
974
- break;
975
- case 92:
976
- x += Lr(Qe() - 1, 7);
977
- continue;
978
- case 47:
979
- switch (Se()) {
980
- case 42:
981
- case 47:
982
- ze(jr($r(ce(), Qe()), o, t, c), c);
983
- break;
984
- default:
985
- x += "/";
986
- }
987
- break;
988
- case 123 * m:
989
- a[d++] = de(x) * v;
990
- case 125 * m:
991
- case 59:
992
- case 0:
993
- switch (p) {
994
- case 0:
995
- case 125:
996
- S = 0;
997
- case 59 + y:
998
- v == -1 && (x = P(x, /\f/g, "")), u > 0 && de(x) - g && ze(u > 32 ? bo(x + ";", n, t, g - 1, c) : bo(P(x, " ", "") + ";", n, t, g - 2, c), c);
999
- break;
1000
- case 59:
1001
- x += ";";
1002
- default:
1003
- if (ze(T = vo(x, o, t, d, y, r, a, w, C = [], E = [], g, s), s), p === 123)
1004
- if (y === 0)
1005
- et(x, o, T, T, C, s, g, a, E);
1006
- else
1007
- switch (h === 99 && H(x, 3) === 110 ? 100 : h) {
1008
- case 100:
1009
- case 108:
1010
- case 109:
1011
- case 115:
1012
- et(e, T, T, n && ze(vo(e, T, T, 0, 0, r, a, w, r, C = [], g, E), E), r, E, g, a, n ? C : E);
1013
- break;
1014
- default:
1015
- et(x, T, T, T, [""], E, 0, a, E);
1016
- }
1017
- }
1018
- d = y = u = 0, m = v = 1, w = x = "", g = i;
1019
- break;
1020
- case 58:
1021
- g = 1 + de(x), u = f;
1022
- default:
1023
- if (m < 1) {
1024
- if (p == 123)
1025
- --m;
1026
- else if (p == 125 && m++ == 0 && Or() == 125)
1027
- continue;
1028
- }
1029
- switch (x += Ut(p), p * m) {
1030
- case 38:
1031
- v = y > 0 ? 1 : (x += "\f", -1);
1032
- break;
1033
- case 44:
1034
- a[d++] = (de(x) - 1) * v, v = 1;
1035
- break;
1036
- case 64:
1037
- Se() === 45 && (x += bt(ce())), h = Se(), y = g = de(w = x += Br(Qe())), p++;
1038
- break;
1039
- case 45:
1040
- f === 45 && de(x) == 2 && (m = 0);
1041
- }
1042
- }
1043
- return s;
1044
- }
1045
- function vo(e, o, t, n, r, s, i, a, c, d, y, g) {
1046
- for (var h = r - 1, u = r === 0 ? s : [""], f = hn(u), m = 0, S = 0, v = 0; m < n; ++m)
1047
- for (var p = 0, w = _e(e, h + 1, h = pn(S = i[m])), C = e; p < f; ++p)
1048
- (C = fn(S > 0 ? u[p] + " " + w : P(w, /&\f/g, u[p]))) && (c[v++] = C);
1049
- return pt(e, o, t, r === 0 ? ut : a, c, d, y, g);
1050
- }
1051
- function jr(e, o, t, n) {
1052
- return pt(e, o, t, un, Ut(kr()), _e(e, 2, -2), 0, n);
1053
- }
1054
- function bo(e, o, t, n, r) {
1055
- return pt(e, o, t, Ht, _e(e, 0, n), _e(e, n + 1, -1), n, r);
1056
- }
1057
- function gn(e, o, t) {
1058
- switch (Vr(e, o)) {
1059
- case 5103:
1060
- return V + "print-" + e + e;
1061
- case 5737:
1062
- case 4201:
1063
- case 3177:
1064
- case 3433:
1065
- case 1641:
1066
- case 4457:
1067
- case 2921:
1068
- case 5572:
1069
- case 6356:
1070
- case 5844:
1071
- case 3191:
1072
- case 6645:
1073
- case 3005:
1074
- case 6391:
1075
- case 5879:
1076
- case 5623:
1077
- case 6135:
1078
- case 4599:
1079
- case 4855:
1080
- case 4215:
1081
- case 6389:
1082
- case 5109:
1083
- case 5365:
1084
- case 5621:
1085
- case 3829:
1086
- return V + e + e;
1087
- case 4789:
1088
- return He + e + e;
1089
- case 5349:
1090
- case 4246:
1091
- case 4810:
1092
- case 6968:
1093
- case 2756:
1094
- return V + e + He + e + O + e + e;
1095
- case 5936:
1096
- switch (H(e, o + 11)) {
1097
- case 114:
1098
- return V + e + O + P(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
1099
- case 108:
1100
- return V + e + O + P(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
1101
- case 45:
1102
- return V + e + O + P(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
1103
- }
1104
- case 6828:
1105
- case 4268:
1106
- case 2903:
1107
- return V + e + O + e + e;
1108
- case 6165:
1109
- return V + e + O + "flex-" + e + e;
1110
- case 5187:
1111
- return V + e + P(e, /(\w+).+(:[^]+)/, V + "box-$1$2" + O + "flex-$1$2") + e;
1112
- case 5443:
1113
- return V + e + O + "flex-item-" + P(e, /flex-|-self/g, "") + (he(e, /flex-|baseline/) ? "" : O + "grid-row-" + P(e, /flex-|-self/g, "")) + e;
1114
- case 4675:
1115
- return V + e + O + "flex-line-pack" + P(e, /align-content|flex-|-self/g, "") + e;
1116
- case 5548:
1117
- return V + e + O + P(e, "shrink", "negative") + e;
1118
- case 5292:
1119
- return V + e + O + P(e, "basis", "preferred-size") + e;
1120
- case 6060:
1121
- return V + "box-" + P(e, "-grow", "") + V + e + O + P(e, "grow", "positive") + e;
1122
- case 4554:
1123
- return V + P(e, /([^-])(transform)/g, "$1" + V + "$2") + e;
1124
- case 6187:
1125
- return P(P(P(e, /(zoom-|grab)/, V + "$1"), /(image-set)/, V + "$1"), e, "") + e;
1126
- case 5495:
1127
- case 3959:
1128
- return P(e, /(image-set\([^]*)/, V + "$1$`$1");
1129
- case 4968:
1130
- return P(P(e, /(.+:)(flex-)?(.*)/, V + "box-pack:$3" + O + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + V + e + e;
1131
- case 4200:
1132
- if (!he(e, /flex-|baseline/)) return O + "grid-column-align" + _e(e, o) + e;
1133
- break;
1134
- case 2592:
1135
- case 3360:
1136
- return O + P(e, "template-", "") + e;
1137
- case 4384:
1138
- case 3616:
1139
- return t && t.some(function(n, r) {
1140
- return o = r, he(n.props, /grid-\w+-end/);
1141
- }) ? ~Je(e + (t = t[o].value), "span", 0) ? e : O + P(e, "-start", "") + e + O + "grid-row-span:" + (~Je(t, "span", 0) ? he(t, /\d+/) : +he(t, /\d+/) - +he(e, /\d+/)) + ";" : O + P(e, "-start", "") + e;
1142
- case 4896:
1143
- case 4128:
1144
- return t && t.some(function(n) {
1145
- return he(n.props, /grid-\w+-start/);
1146
- }) ? e : O + P(P(e, "-end", "-span"), "span ", "") + e;
1147
- case 4095:
1148
- case 3583:
1149
- case 4068:
1150
- case 2532:
1151
- return P(e, /(.+)-inline(.+)/, V + "$1$2") + e;
1152
- case 8116:
1153
- case 7059:
1154
- case 5753:
1155
- case 5535:
1156
- case 5445:
1157
- case 5701:
1158
- case 4933:
1159
- case 4677:
1160
- case 5533:
1161
- case 5789:
1162
- case 5021:
1163
- case 4765:
1164
- if (de(e) - 1 - o > 6)
1165
- switch (H(e, o + 1)) {
1166
- case 109:
1167
- if (H(e, o + 4) !== 45)
1168
- break;
1169
- case 102:
1170
- return P(e, /(.+:)(.+)-([^]+)/, "$1" + V + "$2-$3$1" + He + (H(e, o + 3) == 108 ? "$3" : "$2-$3")) + e;
1171
- case 115:
1172
- return ~Je(e, "stretch", 0) ? gn(P(e, "stretch", "fill-available"), o, t) + e : e;
1173
- }
1174
- break;
1175
- case 5152:
1176
- case 5920:
1177
- return P(e, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(n, r, s, i, a, c, d) {
1178
- return O + r + ":" + s + d + (i ? O + r + "-span:" + (a ? c : +c - +s) + d : "") + e;
1179
- });
1180
- case 4949:
1181
- if (H(e, o + 6) === 121)
1182
- return P(e, ":", ":" + V) + e;
1183
- break;
1184
- case 6444:
1185
- switch (H(e, H(e, 14) === 45 ? 18 : 11)) {
1186
- case 120:
1187
- return P(e, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + V + (H(e, 14) === 45 ? "inline-" : "") + "box$3$1" + V + "$2$3$1" + O + "$2box$3") + e;
1188
- case 100:
1189
- return P(e, ":", ":" + O) + e;
1190
- }
1191
- break;
1192
- case 5719:
1193
- case 2647:
1194
- case 2135:
1195
- case 3927:
1196
- case 2391:
1197
- return P(e, "scroll-", "scroll-snap-") + e;
1198
- }
1199
- return e;
1200
- }
1201
- function nt(e, o) {
1202
- for (var t = "", n = 0; n < e.length; n++)
1203
- t += o(e[n], n, e, o) || "";
1204
- return t;
1205
- }
1206
- function Hr(e, o, t, n) {
1207
- switch (e.type) {
1208
- case Rr:
1209
- if (e.children.length) break;
1210
- case Nr:
1211
- case Ht:
1212
- return e.return = e.return || e.value;
1213
- case un:
1214
- return "";
1215
- case dn:
1216
- return e.return = e.value + "{" + nt(e.children, n) + "}";
1217
- case ut:
1218
- if (!de(e.value = e.props.join(","))) return "";
1219
- }
1220
- return de(t = nt(e.children, n)) ? e.return = e.value + "{" + t + "}" : "";
1221
- }
1222
- function Ur(e) {
1223
- var o = hn(e);
1224
- return function(t, n, r, s) {
1225
- for (var i = "", a = 0; a < o; a++)
1226
- i += e[a](t, n, r, s) || "";
1227
- return i;
1228
- };
1229
- }
1230
- function Wr(e) {
1231
- return function(o) {
1232
- o.root || (o = o.return) && e(o);
1233
- };
1234
- }
1235
- function Kr(e, o, t, n) {
1236
- if (e.length > -1 && !e.return)
1237
- switch (e.type) {
1238
- case Ht:
1239
- e.return = gn(e.value, e.length, t);
1240
- return;
1241
- case dn:
1242
- return nt([ye(e, { value: P(e.value, "@", "@" + V) })], n);
1243
- case ut:
1244
- if (e.length)
1245
- return _r(t = e.props, function(r) {
1246
- switch (he(r, n = /(::plac\w+|:read-\w+)/)) {
1247
- case ":read-only":
1248
- case ":read-write":
1249
- Ne(ye(e, { props: [P(r, /:(read-\w+)/, ":" + He + "$1")] })), Ne(ye(e, { props: [r] })), Tt(e, { props: yo(t, n) });
1250
- break;
1251
- case "::placeholder":
1252
- Ne(ye(e, { props: [P(r, /:(plac\w+)/, ":" + V + "input-$1")] })), Ne(ye(e, { props: [P(r, /:(plac\w+)/, ":" + He + "$1")] })), Ne(ye(e, { props: [P(r, /:(plac\w+)/, O + "input-$1")] })), Ne(ye(e, { props: [r] })), Tt(e, { props: yo(t, n) });
1253
- break;
1254
- }
1255
- return "";
1256
- });
1257
- }
1258
- }
1259
- var Gr = {
1260
- animationIterationCount: 1,
1261
- aspectRatio: 1,
1262
- borderImageOutset: 1,
1263
- borderImageSlice: 1,
1264
- borderImageWidth: 1,
1265
- boxFlex: 1,
1266
- boxFlexGroup: 1,
1267
- boxOrdinalGroup: 1,
1268
- columnCount: 1,
1269
- columns: 1,
1270
- flex: 1,
1271
- flexGrow: 1,
1272
- flexPositive: 1,
1273
- flexShrink: 1,
1274
- flexNegative: 1,
1275
- flexOrder: 1,
1276
- gridRow: 1,
1277
- gridRowEnd: 1,
1278
- gridRowSpan: 1,
1279
- gridRowStart: 1,
1280
- gridColumn: 1,
1281
- gridColumnEnd: 1,
1282
- gridColumnSpan: 1,
1283
- gridColumnStart: 1,
1284
- msGridRow: 1,
1285
- msGridRowSpan: 1,
1286
- msGridColumn: 1,
1287
- msGridColumnSpan: 1,
1288
- fontWeight: 1,
1289
- lineHeight: 1,
1290
- opacity: 1,
1291
- order: 1,
1292
- orphans: 1,
1293
- tabSize: 1,
1294
- widows: 1,
1295
- zIndex: 1,
1296
- zoom: 1,
1297
- WebkitLineClamp: 1,
1298
- // SVG-related properties
1299
- fillOpacity: 1,
1300
- floodOpacity: 1,
1301
- stopOpacity: 1,
1302
- strokeDasharray: 1,
1303
- strokeDashoffset: 1,
1304
- strokeMiterlimit: 1,
1305
- strokeOpacity: 1,
1306
- strokeWidth: 1
1307
- }, Ie = typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", yn = "active", vn = "data-styled-version", ht = "6.1.11", Wt = `/*!sc*/
1308
- `, Kt = typeof window < "u" && "HTMLElement" in window, Yr = !!(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== "" ? process.env.REACT_APP_SC_DISABLE_SPEEDY !== "false" && process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.SC_DISABLE_SPEEDY !== void 0 && process.env.SC_DISABLE_SPEEDY !== "" ? process.env.SC_DISABLE_SPEEDY !== "false" && process.env.SC_DISABLE_SPEEDY : process.env.NODE_ENV !== "production"), wo = /invalid hook call/i, Ye = /* @__PURE__ */ new Set(), qr = function(e, o) {
1309
- if (process.env.NODE_ENV !== "production") {
1310
- var t = o ? ' with the id of "'.concat(o, '"') : "", n = "The component ".concat(e).concat(t, ` has been created dynamically.
1311
- `) + `You may see this warning because you've called styled inside another component.
1312
- To resolve this only create new StyledComponents outside of any render method and function component.`, r = console.error;
1313
- try {
1314
- var s = !0;
1315
- console.error = function(i) {
1316
- for (var a = [], c = 1; c < arguments.length; c++) a[c - 1] = arguments[c];
1317
- wo.test(i) ? (s = !1, Ye.delete(n)) : r.apply(void 0, Ve([i], a, !1));
1318
- }, Yn(), s && !Ye.has(n) && (console.warn(n), Ye.add(n));
1319
- } catch (i) {
1320
- wo.test(i.message) && Ye.delete(n);
1321
- } finally {
1322
- console.error = r;
1323
- }
1324
- }
1325
- }, mt = Object.freeze([]), Oe = Object.freeze({});
1326
- function Xr(e, o, t) {
1327
- return t === void 0 && (t = Oe), e.theme !== t.theme && e.theme || o || t.theme;
1328
- }
1329
- var At = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]), Zr = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, Jr = /(^-|-$)/g;
1330
- function So(e) {
1331
- return e.replace(Zr, "-").replace(Jr, "");
1332
- }
1333
- var Qr = /(a)(d)/gi, qe = 52, xo = function(e) {
1334
- return String.fromCharCode(e + (e > 25 ? 39 : 97));
1335
- };
1336
- function Nt(e) {
1337
- var o, t = "";
1338
- for (o = Math.abs(e); o > qe; o = o / qe | 0) t = xo(o % qe) + t;
1339
- return (xo(o % qe) + t).replace(Qr, "$1-$2");
1340
- }
1341
- var wt, bn = 5381, be = function(e, o) {
1342
- for (var t = o.length; t; ) e = 33 * e ^ o.charCodeAt(--t);
1343
- return e;
1344
- }, wn = function(e) {
1345
- return be(bn, e);
1346
- };
1347
- function es(e) {
1348
- return Nt(wn(e) >>> 0);
1349
- }
1350
- function Sn(e) {
1351
- return process.env.NODE_ENV !== "production" && typeof e == "string" && e || e.displayName || e.name || "Component";
1352
- }
1353
- function St(e) {
1354
- return typeof e == "string" && (process.env.NODE_ENV === "production" || e.charAt(0) === e.charAt(0).toLowerCase());
1355
- }
1356
- var xn = typeof Symbol == "function" && Symbol.for, Cn = xn ? Symbol.for("react.memo") : 60115, ts = xn ? Symbol.for("react.forward_ref") : 60112, os = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, ns = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, In = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, rs = ((wt = {})[ts] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, wt[Cn] = In, wt);
1357
- function Co(e) {
1358
- return ("type" in (o = e) && o.type.$$typeof) === Cn ? In : "$$typeof" in e ? rs[e.$$typeof] : os;
1359
- var o;
1360
- }
1361
- var ss = Object.defineProperty, is = Object.getOwnPropertyNames, Io = Object.getOwnPropertySymbols, as = Object.getOwnPropertyDescriptor, cs = Object.getPrototypeOf, To = Object.prototype;
1362
- function Tn(e, o, t) {
1363
- if (typeof o != "string") {
1364
- if (To) {
1365
- var n = cs(o);
1366
- n && n !== To && Tn(e, n, t);
1367
- }
1368
- var r = is(o);
1369
- Io && (r = r.concat(Io(o)));
1370
- for (var s = Co(e), i = Co(o), a = 0; a < r.length; ++a) {
1371
- var c = r[a];
1372
- if (!(c in ns || t && t[c] || i && c in i || s && c in s)) {
1373
- var d = as(o, c);
1374
- try {
1375
- ss(e, c, d);
1376
- } catch {
1377
- }
1378
- }
1379
- }
1380
- }
1381
- return e;
1382
- }
1383
- function Me(e) {
1384
- return typeof e == "function";
1385
- }
1386
- function Gt(e) {
1387
- return typeof e == "object" && "styledComponentId" in e;
1388
- }
1389
- function we(e, o) {
1390
- return e && o ? "".concat(e, " ").concat(o) : e || o || "";
1391
- }
1392
- function Eo(e, o) {
1393
- if (e.length === 0) return "";
1394
- for (var t = e[0], n = 1; n < e.length; n++) t += e[n];
1395
- return t;
1396
- }
1397
- function De(e) {
1398
- return e !== null && typeof e == "object" && e.constructor.name === Object.name && !("props" in e && e.$$typeof);
1399
- }
1400
- function Rt(e, o, t) {
1401
- if (t === void 0 && (t = !1), !t && !De(e) && !Array.isArray(e)) return o;
1402
- if (Array.isArray(o)) for (var n = 0; n < o.length; n++) e[n] = Rt(e[n], o[n]);
1403
- else if (De(o)) for (var n in o) e[n] = Rt(e[n], o[n]);
1404
- return e;
1405
- }
1406
- function Yt(e, o) {
1407
- Object.defineProperty(e, "toString", { value: o });
1408
- }
1409
- var ls = process.env.NODE_ENV !== "production" ? { 1: `Cannot create styled-component for component: %s.
1410
-
1411
- `, 2: `Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
1412
-
1413
- - Are you trying to reuse it across renders?
1414
- - Are you accidentally calling collectStyles twice?
1415
-
1416
- `, 3: `Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
1417
-
1418
- `, 4: `The \`StyleSheetManager\` expects a valid target or sheet prop!
1419
-
1420
- - Does this error occur on the client and is your target falsy?
1421
- - Does this error occur on the server and is the sheet falsy?
1422
-
1423
- `, 5: `The clone method cannot be used on the client!
1424
-
1425
- - Are you running in a client-like environment on the server?
1426
- - Are you trying to run SSR on the client?
1427
-
1428
- `, 6: `Trying to insert a new style tag, but the given Node is unmounted!
1429
-
1430
- - Are you using a custom target that isn't mounted?
1431
- - Does your document not have a valid head element?
1432
- - Have you accidentally removed a style tag manually?
1433
-
1434
- `, 7: 'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n', 8: `ThemeProvider: Please make your "theme" prop an object.
1435
-
1436
- `, 9: "Missing document `<head>`\n\n", 10: `Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
1437
-
1438
- `, 11: `_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
1439
-
1440
- `, 12: "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n", 13: `%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
1441
-
1442
- `, 14: `ThemeProvider: "theme" prop is required.
1443
-
1444
- `, 15: "A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n", 16: `Reached the limit of how many styled components may be created at group %s.
1445
- You may only create up to 1,073,741,824 components. If you're creating components dynamically,
1446
- as for instance in your render method then you may be running into this limitation.
1447
-
1448
- `, 17: `CSSStyleSheet could not be found on HTMLStyleElement.
1449
- Has styled-components' style tag been unmounted or altered by another script?
1450
- `, 18: "ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`" } : {};
1451
- function us() {
1452
- for (var e = [], o = 0; o < arguments.length; o++) e[o] = arguments[o];
1453
- for (var t = e[0], n = [], r = 1, s = e.length; r < s; r += 1) n.push(e[r]);
1454
- return n.forEach(function(i) {
1455
- t = t.replace(/%[a-z]/, i);
1456
- }), t;
1457
- }
1458
- function Le(e) {
1459
- for (var o = [], t = 1; t < arguments.length; t++) o[t - 1] = arguments[t];
1460
- return process.env.NODE_ENV === "production" ? new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e, " for more information.").concat(o.length > 0 ? " Args: ".concat(o.join(", ")) : "")) : new Error(us.apply(void 0, Ve([ls[e]], o, !1)).trim());
1461
- }
1462
- var ds = function() {
1463
- function e(o) {
1464
- this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = o;
1465
- }
1466
- return e.prototype.indexOfGroup = function(o) {
1467
- for (var t = 0, n = 0; n < o; n++) t += this.groupSizes[n];
1468
- return t;
1469
- }, e.prototype.insertRules = function(o, t) {
1470
- if (o >= this.groupSizes.length) {
1471
- for (var n = this.groupSizes, r = n.length, s = r; o >= s; ) if ((s <<= 1) < 0) throw Le(16, "".concat(o));
1472
- this.groupSizes = new Uint32Array(s), this.groupSizes.set(n), this.length = s;
1473
- for (var i = r; i < s; i++) this.groupSizes[i] = 0;
1474
- }
1475
- for (var a = this.indexOfGroup(o + 1), c = (i = 0, t.length); i < c; i++) this.tag.insertRule(a, t[i]) && (this.groupSizes[o]++, a++);
1476
- }, e.prototype.clearGroup = function(o) {
1477
- if (o < this.length) {
1478
- var t = this.groupSizes[o], n = this.indexOfGroup(o), r = n + t;
1479
- this.groupSizes[o] = 0;
1480
- for (var s = n; s < r; s++) this.tag.deleteRule(n);
1481
- }
1482
- }, e.prototype.getGroup = function(o) {
1483
- var t = "";
1484
- if (o >= this.length || this.groupSizes[o] === 0) return t;
1485
- for (var n = this.groupSizes[o], r = this.indexOfGroup(o), s = r + n, i = r; i < s; i++) t += "".concat(this.tag.getRule(i)).concat(Wt);
1486
- return t;
1487
- }, e;
1488
- }(), ps = 1 << 30, tt = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Map(), ot = 1, Xe = function(e) {
1489
- if (tt.has(e)) return tt.get(e);
1490
- for (; rt.has(ot); ) ot++;
1491
- var o = ot++;
1492
- if (process.env.NODE_ENV !== "production" && ((0 | o) < 0 || o > ps)) throw Le(16, "".concat(o));
1493
- return tt.set(e, o), rt.set(o, e), o;
1494
- }, fs = function(e, o) {
1495
- ot = o + 1, tt.set(e, o), rt.set(o, e);
1496
- }, hs = "style[".concat(Ie, "][").concat(vn, '="').concat(ht, '"]'), ms = new RegExp("^".concat(Ie, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), gs = function(e, o, t) {
1497
- for (var n, r = t.split(","), s = 0, i = r.length; s < i; s++) (n = r[s]) && e.registerName(o, n);
1498
- }, ys = function(e, o) {
1499
- for (var t, n = ((t = o.textContent) !== null && t !== void 0 ? t : "").split(Wt), r = [], s = 0, i = n.length; s < i; s++) {
1500
- var a = n[s].trim();
1501
- if (a) {
1502
- var c = a.match(ms);
1503
- if (c) {
1504
- var d = 0 | parseInt(c[1], 10), y = c[2];
1505
- d !== 0 && (fs(y, d), gs(e, y, c[3]), e.getTag().insertRules(d, r)), r.length = 0;
1506
- } else r.push(a);
1507
- }
1508
- }
1509
- };
1510
- function vs() {
1511
- return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : null;
1512
- }
1513
- var En = function(e) {
1514
- var o = document.head, t = e || o, n = document.createElement("style"), r = function(a) {
1515
- var c = Array.from(a.querySelectorAll("style[".concat(Ie, "]")));
1516
- return c[c.length - 1];
1517
- }(t), s = r !== void 0 ? r.nextSibling : null;
1518
- n.setAttribute(Ie, yn), n.setAttribute(vn, ht);
1519
- var i = vs();
1520
- return i && n.setAttribute("nonce", i), t.insertBefore(n, s), n;
1521
- }, bs = function() {
1522
- function e(o) {
1523
- this.element = En(o), this.element.appendChild(document.createTextNode("")), this.sheet = function(t) {
1524
- if (t.sheet) return t.sheet;
1525
- for (var n = document.styleSheets, r = 0, s = n.length; r < s; r++) {
1526
- var i = n[r];
1527
- if (i.ownerNode === t) return i;
1528
- }
1529
- throw Le(17);
1530
- }(this.element), this.length = 0;
1531
- }
1532
- return e.prototype.insertRule = function(o, t) {
1533
- try {
1534
- return this.sheet.insertRule(t, o), this.length++, !0;
1535
- } catch {
1536
- return !1;
1537
- }
1538
- }, e.prototype.deleteRule = function(o) {
1539
- this.sheet.deleteRule(o), this.length--;
1540
- }, e.prototype.getRule = function(o) {
1541
- var t = this.sheet.cssRules[o];
1542
- return t && t.cssText ? t.cssText : "";
1543
- }, e;
1544
- }(), ws = function() {
1545
- function e(o) {
1546
- this.element = En(o), this.nodes = this.element.childNodes, this.length = 0;
1547
- }
1548
- return e.prototype.insertRule = function(o, t) {
1549
- if (o <= this.length && o >= 0) {
1550
- var n = document.createTextNode(t);
1551
- return this.element.insertBefore(n, this.nodes[o] || null), this.length++, !0;
1552
- }
1553
- return !1;
1554
- }, e.prototype.deleteRule = function(o) {
1555
- this.element.removeChild(this.nodes[o]), this.length--;
1556
- }, e.prototype.getRule = function(o) {
1557
- return o < this.length ? this.nodes[o].textContent : "";
1558
- }, e;
1559
- }(), Ss = function() {
1560
- function e(o) {
1561
- this.rules = [], this.length = 0;
1562
- }
1563
- return e.prototype.insertRule = function(o, t) {
1564
- return o <= this.length && (this.rules.splice(o, 0, t), this.length++, !0);
1565
- }, e.prototype.deleteRule = function(o) {
1566
- this.rules.splice(o, 1), this.length--;
1567
- }, e.prototype.getRule = function(o) {
1568
- return o < this.length ? this.rules[o] : "";
1569
- }, e;
1570
- }(), Po = Kt, xs = { isServer: !Kt, useCSSOMInjection: !Yr }, Pn = function() {
1571
- function e(o, t, n) {
1572
- o === void 0 && (o = Oe), t === void 0 && (t = {});
1573
- var r = this;
1574
- this.options = X(X({}, xs), o), this.gs = t, this.names = new Map(n), this.server = !!o.isServer, !this.server && Kt && Po && (Po = !1, function(s) {
1575
- for (var i = document.querySelectorAll(hs), a = 0, c = i.length; a < c; a++) {
1576
- var d = i[a];
1577
- d && d.getAttribute(Ie) !== yn && (ys(s, d), d.parentNode && d.parentNode.removeChild(d));
1578
- }
1579
- }(this)), Yt(this, function() {
1580
- return function(s) {
1581
- for (var i = s.getTag(), a = i.length, c = "", d = function(g) {
1582
- var h = function(v) {
1583
- return rt.get(v);
1584
- }(g);
1585
- if (h === void 0) return "continue";
1586
- var u = s.names.get(h), f = i.getGroup(g);
1587
- if (u === void 0 || f.length === 0) return "continue";
1588
- var m = "".concat(Ie, ".g").concat(g, '[id="').concat(h, '"]'), S = "";
1589
- u !== void 0 && u.forEach(function(v) {
1590
- v.length > 0 && (S += "".concat(v, ","));
1591
- }), c += "".concat(f).concat(m, '{content:"').concat(S, '"}').concat(Wt);
1592
- }, y = 0; y < a; y++) d(y);
1593
- return c;
1594
- }(r);
1595
- });
1596
- }
1597
- return e.registerId = function(o) {
1598
- return Xe(o);
1599
- }, e.prototype.reconstructWithOptions = function(o, t) {
1600
- return t === void 0 && (t = !0), new e(X(X({}, this.options), o), this.gs, t && this.names || void 0);
1601
- }, e.prototype.allocateGSInstance = function(o) {
1602
- return this.gs[o] = (this.gs[o] || 0) + 1;
1603
- }, e.prototype.getTag = function() {
1604
- return this.tag || (this.tag = (o = function(t) {
1605
- var n = t.useCSSOMInjection, r = t.target;
1606
- return t.isServer ? new Ss(r) : n ? new bs(r) : new ws(r);
1607
- }(this.options), new ds(o)));
1608
- var o;
1609
- }, e.prototype.hasNameForId = function(o, t) {
1610
- return this.names.has(o) && this.names.get(o).has(t);
1611
- }, e.prototype.registerName = function(o, t) {
1612
- if (Xe(o), this.names.has(o)) this.names.get(o).add(t);
1613
- else {
1614
- var n = /* @__PURE__ */ new Set();
1615
- n.add(t), this.names.set(o, n);
1616
- }
1617
- }, e.prototype.insertRules = function(o, t, n) {
1618
- this.registerName(o, t), this.getTag().insertRules(Xe(o), n);
1619
- }, e.prototype.clearNames = function(o) {
1620
- this.names.has(o) && this.names.get(o).clear();
1621
- }, e.prototype.clearRules = function(o) {
1622
- this.getTag().clearGroup(Xe(o)), this.clearNames(o);
1623
- }, e.prototype.clearTag = function() {
1624
- this.tag = void 0;
1625
- }, e;
1626
- }(), Cs = /&/g, Is = /^\s*\/\/.*$/gm;
1627
- function An(e, o) {
1628
- return e.map(function(t) {
1629
- return t.type === "rule" && (t.value = "".concat(o, " ").concat(t.value), t.value = t.value.replaceAll(",", ",".concat(o, " ")), t.props = t.props.map(function(n) {
1630
- return "".concat(o, " ").concat(n);
1631
- })), Array.isArray(t.children) && t.type !== "@keyframes" && (t.children = An(t.children, o)), t;
1632
- });
1633
- }
1634
- function Ts(e) {
1635
- var o, t, n, r = Oe, s = r.options, i = s === void 0 ? Oe : s, a = r.plugins, c = a === void 0 ? mt : a, d = function(h, u, f) {
1636
- return f.startsWith(t) && f.endsWith(t) && f.replaceAll(t, "").length > 0 ? ".".concat(o) : h;
1637
- }, y = c.slice();
1638
- y.push(function(h) {
1639
- h.type === ut && h.value.includes("&") && (h.props[0] = h.props[0].replace(Cs, t).replace(n, d));
1640
- }), i.prefix && y.push(Kr), y.push(Hr);
1641
- var g = function(h, u, f, m) {
1642
- u === void 0 && (u = ""), f === void 0 && (f = ""), m === void 0 && (m = "&"), o = m, t = u, n = new RegExp("\\".concat(t, "\\b"), "g");
1643
- var S = h.replace(Is, ""), v = zr(f || u ? "".concat(f, " ").concat(u, " { ").concat(S, " }") : S);
1644
- i.namespace && (v = An(v, i.namespace));
1645
- var p = [];
1646
- return nt(v, Ur(y.concat(Wr(function(w) {
1647
- return p.push(w);
1648
- })))), p;
1649
- };
1650
- return g.hash = c.length ? c.reduce(function(h, u) {
1651
- return u.name || Le(15), be(h, u.name);
1652
- }, bn).toString() : "", g;
1653
- }
1654
- var Es = new Pn(), Vt = Ts(), Nn = Ue.createContext({ shouldForwardProp: void 0, styleSheet: Es, stylis: Vt });
1655
- Nn.Consumer;
1656
- Ue.createContext(void 0);
1657
- function Ao() {
1658
- return qn(Nn);
1659
- }
1660
- var No = function() {
1661
- function e(o, t) {
1662
- var n = this;
1663
- this.inject = function(r, s) {
1664
- s === void 0 && (s = Vt);
1665
- var i = n.name + s.hash;
1666
- r.hasNameForId(n.id, i) || r.insertRules(n.id, i, s(n.rules, i, "@keyframes"));
1667
- }, this.name = o, this.id = "sc-keyframes-".concat(o), this.rules = t, Yt(this, function() {
1668
- throw Le(12, String(n.name));
1669
- });
1670
- }
1671
- return e.prototype.getName = function(o) {
1672
- return o === void 0 && (o = Vt), this.name + o.hash;
1673
- }, e;
1674
- }(), Ps = function(e) {
1675
- return e >= "A" && e <= "Z";
1676
- };
1677
- function Ro(e) {
1678
- for (var o = "", t = 0; t < e.length; t++) {
1679
- var n = e[t];
1680
- if (t === 1 && n === "-" && e[0] === "-") return e;
1681
- Ps(n) ? o += "-" + n.toLowerCase() : o += n;
1682
- }
1683
- return o.startsWith("ms-") ? "-" + o : o;
1684
- }
1685
- var Rn = function(e) {
1686
- return e == null || e === !1 || e === "";
1687
- }, Vn = function(e) {
1688
- var o, t, n = [];
1689
- for (var r in e) {
1690
- var s = e[r];
1691
- e.hasOwnProperty(r) && !Rn(s) && (Array.isArray(s) && s.isCss || Me(s) ? n.push("".concat(Ro(r), ":"), s, ";") : De(s) ? n.push.apply(n, Ve(Ve(["".concat(r, " {")], Vn(s), !1), ["}"], !1)) : n.push("".concat(Ro(r), ": ").concat((o = r, (t = s) == null || typeof t == "boolean" || t === "" ? "" : typeof t != "number" || t === 0 || o in Gr || o.startsWith("--") ? String(t).trim() : "".concat(t, "px")), ";")));
1692
- }
1693
- return n;
1694
- };
1695
- function xe(e, o, t, n) {
1696
- if (Rn(e)) return [];
1697
- if (Gt(e)) return [".".concat(e.styledComponentId)];
1698
- if (Me(e)) {
1699
- if (!Me(s = e) || s.prototype && s.prototype.isReactComponent || !o) return [e];
1700
- var r = e(o);
1701
- return process.env.NODE_ENV === "production" || typeof r != "object" || Array.isArray(r) || r instanceof No || De(r) || r === null || console.error("".concat(Sn(e), " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")), xe(r, o, t, n);
1702
- }
1703
- var s;
1704
- return e instanceof No ? t ? (e.inject(t, n), [e.getName(n)]) : [e] : De(e) ? Vn(e) : Array.isArray(e) ? Array.prototype.concat.apply(mt, e.map(function(i) {
1705
- return xe(i, o, t, n);
1706
- })) : [e.toString()];
1707
- }
1708
- function As(e) {
1709
- for (var o = 0; o < e.length; o += 1) {
1710
- var t = e[o];
1711
- if (Me(t) && !Gt(t)) return !1;
1712
- }
1713
- return !0;
1714
- }
1715
- var Ns = wn(ht), Rs = function() {
1716
- function e(o, t, n) {
1717
- this.rules = o, this.staticRulesId = "", this.isStatic = process.env.NODE_ENV === "production" && (n === void 0 || n.isStatic) && As(o), this.componentId = t, this.baseHash = be(Ns, t), this.baseStyle = n, Pn.registerId(t);
1718
- }
1719
- return e.prototype.generateAndInjectStyles = function(o, t, n) {
1720
- var r = this.baseStyle ? this.baseStyle.generateAndInjectStyles(o, t, n) : "";
1721
- if (this.isStatic && !n.hash) if (this.staticRulesId && t.hasNameForId(this.componentId, this.staticRulesId)) r = we(r, this.staticRulesId);
1722
- else {
1723
- var s = Eo(xe(this.rules, o, t, n)), i = Nt(be(this.baseHash, s) >>> 0);
1724
- if (!t.hasNameForId(this.componentId, i)) {
1725
- var a = n(s, ".".concat(i), void 0, this.componentId);
1726
- t.insertRules(this.componentId, i, a);
1727
- }
1728
- r = we(r, i), this.staticRulesId = i;
1729
- }
1730
- else {
1731
- for (var c = be(this.baseHash, n.hash), d = "", y = 0; y < this.rules.length; y++) {
1732
- var g = this.rules[y];
1733
- if (typeof g == "string") d += g, process.env.NODE_ENV !== "production" && (c = be(c, g));
1734
- else if (g) {
1735
- var h = Eo(xe(g, o, t, n));
1736
- c = be(c, h + y), d += h;
1737
- }
1738
- }
1739
- if (d) {
1740
- var u = Nt(c >>> 0);
1741
- t.hasNameForId(this.componentId, u) || t.insertRules(this.componentId, u, n(d, ".".concat(u), void 0, this.componentId)), r = we(r, u);
1742
- }
1743
- }
1744
- return r;
1745
- }, e;
1746
- }(), _n = Ue.createContext(void 0);
1747
- _n.Consumer;
1748
- var xt = {}, Vo = /* @__PURE__ */ new Set();
1749
- function Vs(e, o, t) {
1750
- var n = Gt(e), r = e, s = !St(e), i = o.attrs, a = i === void 0 ? mt : i, c = o.componentId, d = c === void 0 ? function(C, E) {
1751
- var T = typeof C != "string" ? "sc" : So(C);
1752
- xt[T] = (xt[T] || 0) + 1;
1753
- var x = "".concat(T, "-").concat(es(ht + T + xt[T]));
1754
- return E ? "".concat(E, "-").concat(x) : x;
1755
- }(o.displayName, o.parentComponentId) : c, y = o.displayName, g = y === void 0 ? function(C) {
1756
- return St(C) ? "styled.".concat(C) : "Styled(".concat(Sn(C), ")");
1757
- }(e) : y, h = o.displayName && o.componentId ? "".concat(So(o.displayName), "-").concat(o.componentId) : o.componentId || d, u = n && r.attrs ? r.attrs.concat(a).filter(Boolean) : a, f = o.shouldForwardProp;
1758
- if (n && r.shouldForwardProp) {
1759
- var m = r.shouldForwardProp;
1760
- if (o.shouldForwardProp) {
1761
- var S = o.shouldForwardProp;
1762
- f = function(C, E) {
1763
- return m(C, E) && S(C, E);
1764
- };
1765
- } else f = m;
1766
- }
1767
- var v = new Rs(t, h, n ? r.componentStyle : void 0);
1768
- function p(C, E) {
1769
- return function(T, x, D) {
1770
- var W = T.attrs, G = T.componentStyle, oe = T.defaultProps, L = T.foldedComponentIds, Y = T.styledComponentId, K = T.target, Z = Ue.useContext(_n), le = Ao(), ne = T.shouldForwardProp || le.shouldForwardProp;
1771
- process.env.NODE_ENV !== "production" && ho(Y);
1772
- var J = Xr(x, Z, oe) || Oe, $ = function(ae, Q, I) {
1773
- for (var N, k = X(X({}, Q), { className: void 0, theme: I }), _ = 0; _ < ae.length; _ += 1) {
1774
- var R = Me(N = ae[_]) ? N(k) : N;
1775
- for (var A in R) k[A] = A === "className" ? we(k[A], R[A]) : A === "style" ? X(X({}, k[A]), R[A]) : R[A];
1776
- }
1777
- return Q.className && (k.className = we(k.className, Q.className)), k;
1778
- }(W, x, J), re = $.as || K, q = {};
1779
- for (var j in $) $[j] === void 0 || j[0] === "$" || j === "as" || j === "theme" && $.theme === J || (j === "forwardedAs" ? q.as = $.forwardedAs : ne && !ne(j, re) || (q[j] = $[j], ne || process.env.NODE_ENV !== "development" || Ar(j) || Vo.has(j) || !At.has(re) || (Vo.add(j), console.warn('styled-components: it looks like an unknown prop "'.concat(j, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
1780
- var fe = function(ae, Q) {
1781
- var I = Ao(), N = ae.generateAndInjectStyles(Q, I.styleSheet, I.stylis);
1782
- return process.env.NODE_ENV !== "production" && ho(N), N;
1783
- }(G, $);
1784
- process.env.NODE_ENV !== "production" && T.warnTooManyClasses && T.warnTooManyClasses(fe);
1785
- var se = we(L, Y);
1786
- return fe && (se += " " + fe), $.className && (se += " " + $.className), q[St(re) && !At.has(re) ? "class" : "className"] = se, q.ref = D, Gn(re, q);
1787
- }(w, C, E);
1788
- }
1789
- p.displayName = g;
1790
- var w = Ue.forwardRef(p);
1791
- return w.attrs = u, w.componentStyle = v, w.displayName = g, w.shouldForwardProp = f, w.foldedComponentIds = n ? we(r.foldedComponentIds, r.styledComponentId) : "", w.styledComponentId = h, w.target = n ? r.target : e, Object.defineProperty(w, "defaultProps", { get: function() {
1792
- return this._foldedDefaultProps;
1793
- }, set: function(C) {
1794
- this._foldedDefaultProps = n ? function(E) {
1795
- for (var T = [], x = 1; x < arguments.length; x++) T[x - 1] = arguments[x];
1796
- for (var D = 0, W = T; D < W.length; D++) Rt(E, W[D], !0);
1797
- return E;
1798
- }({}, r.defaultProps, C) : C;
1799
- } }), process.env.NODE_ENV !== "production" && (qr(g, h), w.warnTooManyClasses = /* @__PURE__ */ function(C, E) {
1800
- var T = {}, x = !1;
1801
- return function(D) {
1802
- if (!x && (T[D] = !0, Object.keys(T).length >= 200)) {
1803
- var W = E ? ' with the id of "'.concat(E, '"') : "";
1804
- console.warn("Over ".concat(200, " classes were generated for component ").concat(C).concat(W, `.
1805
- `) + `Consider using the attrs method, together with a style object for frequently changed styles.
1806
- Example:
1807
- const Component = styled.div.attrs(props => ({
1808
- style: {
1809
- background: props.background,
1810
- },
1811
- }))\`width: 100%;\`
1812
-
1813
- <Component />`), x = !0, T = {};
1814
- }
1815
- };
1816
- }(g, h)), Yt(w, function() {
1817
- return ".".concat(w.styledComponentId);
1818
- }), s && Tn(w, e, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), w;
1819
- }
1820
- function _o(e, o) {
1821
- for (var t = [e[0]], n = 0, r = o.length; n < r; n += 1) t.push(o[n], e[n + 1]);
1822
- return t;
1823
- }
1824
- var ko = function(e) {
1825
- return Object.assign(e, { isCss: !0 });
1826
- };
1827
- function _s(e) {
1828
- for (var o = [], t = 1; t < arguments.length; t++) o[t - 1] = arguments[t];
1829
- if (Me(e) || De(e)) return ko(xe(_o(mt, Ve([e], o, !0))));
1830
- var n = e;
1831
- return o.length === 0 && n.length === 1 && typeof n[0] == "string" ? xe(n) : ko(xe(_o(n, o)));
1832
- }
1833
- function _t(e, o, t) {
1834
- if (t === void 0 && (t = Oe), !o) throw Le(1, o);
1835
- var n = function(r) {
1836
- for (var s = [], i = 1; i < arguments.length; i++) s[i - 1] = arguments[i];
1837
- return e(o, t, _s.apply(void 0, Ve([r], s, !1)));
1838
- };
1839
- return n.attrs = function(r) {
1840
- return _t(e, o, X(X({}, t), { attrs: Array.prototype.concat(t.attrs, r).filter(Boolean) }));
1841
- }, n.withConfig = function(r) {
1842
- return _t(e, o, X(X({}, t), r));
1843
- }, n;
1844
- }
1845
- var kn = function(e) {
1846
- return _t(Vs, e);
1847
- }, On = kn;
1848
- At.forEach(function(e) {
1849
- On[e] = kn(e);
1850
- });
1851
- process.env.NODE_ENV !== "production" && typeof navigator < "u" && navigator.product === "ReactNative" && console.warn(`It looks like you've imported 'styled-components' on React Native.
1852
- Perhaps you're looking to import 'styled-components/native'?
1853
- Read more about this at https://www.styled-components.com/docs/basics#react-native`);
1854
- var Ze = "__sc-".concat(Ie, "__");
1855
- process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && typeof window < "u" && (window[Ze] || (window[Ze] = 0), window[Ze] === 1 && console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
1856
-
1857
- See https://s-c.sh/2BAXzed for more info.`), window[Ze] += 1);
1858
- function ks(e) {
1859
- const o = l.useRef(e);
1860
- return l.useEffect(() => {
1861
- o.current = e;
1862
- }), l.useMemo(() => (...t) => {
1863
- var n;
1864
- return (n = o.current) == null ? void 0 : n.call(o, ...t);
778
+ function Io(o) {
779
+ const i = s.useRef(o);
780
+ return s.useEffect(() => {
781
+ i.current = o;
782
+ }), s.useMemo(() => (...e) => {
783
+ var t;
784
+ return (t = i.current) == null ? void 0 : t.call(i, ...e);
1865
785
  }, []);
1866
786
  }
1867
- const Os = [" ", "Enter", "ArrowUp", "ArrowDown"], Ms = [" ", "Enter"], Ke = "Select", [gt, Ge, Ds] = Zn(Ke), [$e, Fs] = Oo(Ke, [
1868
- Ds,
1869
- $o
1870
- ]), yt = $o(), [Ls, ge] = $e(Ke), [$s, Bs] = $e(Ke), qt = (e) => {
787
+ const To = [" ", "Enter", "ArrowUp", "ArrowDown"], Vo = [" ", "Enter"], Ce = "Select", [Te, ve, Po] = Yt(Ce), [pe, Eo] = st(Ce, [
788
+ Po,
789
+ dt
790
+ ]), Ve = dt(), [No, X] = pe(Ce), [Ro, Ao] = pe(Ce), $e = (o) => {
1871
791
  const {
1872
- __scopeSelect: o,
1873
- children: t,
1874
- open: n,
1875
- defaultOpen: r,
1876
- onOpenChange: s,
1877
- value: i,
1878
- defaultValue: a,
1879
- onValueChange: c,
1880
- dir: d,
792
+ __scopeSelect: i,
793
+ children: e,
794
+ open: t,
795
+ defaultOpen: n,
796
+ onOpenChange: r,
797
+ value: c,
798
+ defaultValue: l,
799
+ onValueChange: a,
800
+ dir: h,
1881
801
  // name,
1882
802
  // autoComplete,
1883
- disabled: y,
1884
- required: g,
1885
- multi: h = !1
1886
- } = e, u = yt(o), [f, m] = l.useState(null), [S, v] = l.useState(null), [p, w] = l.useState(!1), C = Jn(d), [E = !1, T] = Re({
1887
- prop: n,
1888
- defaultProp: r,
1889
- onChange: s
1890
- }), [x, D] = Re({
1891
- prop: i,
1892
- defaultProp: a,
1893
- onChange(L) {
1894
- c && (Array.isArray(L), c(L));
803
+ disabled: C,
804
+ required: v,
805
+ multi: x = !1
806
+ } = o, u = Ve(i), [f, m] = s.useState(null), [b, g] = s.useState(null), [d, y] = s.useState(!1), V = qt(h), [O = !1, F] = de({
807
+ prop: t,
808
+ defaultProp: n,
809
+ onChange: r
810
+ }), [_, k] = de({
811
+ prop: c,
812
+ defaultProp: l,
813
+ onChange(R) {
814
+ a && (Array.isArray(R), a(R));
1895
815
  }
1896
- }), W = l.useRef(null), [G, oe] = l.useState(/* @__PURE__ */ new Set());
1897
- return /* @__PURE__ */ b(Pe.Root, { ...u, children: /* @__PURE__ */ b(
1898
- Ls,
816
+ }), Z = s.useRef(null), [U, W] = s.useState(/* @__PURE__ */ new Set());
817
+ return /* @__PURE__ */ p(ie.Root, { ...u, children: /* @__PURE__ */ p(
818
+ No,
1899
819
  {
1900
- required: g,
1901
- scope: o,
820
+ required: v,
821
+ scope: i,
1902
822
  trigger: f,
1903
823
  onTriggerChange: m,
1904
- valueNode: S,
1905
- onValueNodeChange: v,
1906
- valueNodeHasChildren: p,
1907
- onValueNodeHasChildrenChange: w,
1908
- contentId: Ee(),
1909
- value: x,
1910
- onValueChange: D,
1911
- open: E,
1912
- onOpenChange: T,
1913
- dir: C,
1914
- triggerPointerDownPosRef: W,
1915
- disabled: y,
1916
- multi: h,
1917
- children: /* @__PURE__ */ b(gt.Provider, { scope: o, children: /* @__PURE__ */ b(
1918
- $s,
824
+ valueNode: b,
825
+ onValueNodeChange: g,
826
+ valueNodeHasChildren: d,
827
+ onValueNodeHasChildrenChange: y,
828
+ contentId: se(),
829
+ value: _,
830
+ onValueChange: k,
831
+ open: O,
832
+ onOpenChange: F,
833
+ dir: V,
834
+ triggerPointerDownPosRef: Z,
835
+ disabled: C,
836
+ multi: x,
837
+ children: /* @__PURE__ */ p(Te.Provider, { scope: i, children: /* @__PURE__ */ p(
838
+ Ro,
1919
839
  {
1920
- scope: e.__scopeSelect,
1921
- onNativeOptionAdd: l.useCallback((L) => {
1922
- oe((Y) => new Set(Y).add(L));
840
+ scope: o.__scopeSelect,
841
+ onNativeOptionAdd: s.useCallback((R) => {
842
+ W((H) => new Set(H).add(R));
1923
843
  }, []),
1924
- onNativeOptionRemove: l.useCallback((L) => {
1925
- oe((Y) => {
1926
- const K = new Set(Y);
1927
- return K.delete(L), K;
844
+ onNativeOptionRemove: s.useCallback((R) => {
845
+ W((H) => {
846
+ const L = new Set(H);
847
+ return L.delete(R), L;
1928
848
  });
1929
849
  }, []),
1930
- children: t
850
+ children: e
1931
851
  }
1932
852
  ) })
1933
853
  }
1934
854
  ) });
1935
855
  };
1936
- qt.displayName = Ke;
1937
- const Mn = "SelectTrigger", Xt = l.forwardRef(
1938
- (e, o) => {
1939
- const { __scopeSelect: t, ...n } = e, r = yt(t), s = ge(Mn, t), i = s.disabled, a = z(o, s.onTriggerChange), c = Ge(t), [d, y, g] = Un((u) => {
1940
- const f = c().filter((v) => !v.disabled), m = f.find((v) => v.value === s.value), S = Wn(f, u, m);
1941
- if (S !== void 0 && !Array.isArray(S.value)) {
1942
- const v = s.multi ? [S.value] : S.value;
1943
- s.onValueChange(v);
856
+ $e.displayName = Ce;
857
+ const Dt = "SelectTrigger", Ue = s.forwardRef(
858
+ (o, i) => {
859
+ const { __scopeSelect: e, ...t } = o, n = Ve(e), r = X(Dt, e), c = r.disabled, l = A(i, r.onTriggerChange), a = ve(e), [h, C, v] = Wt((u) => {
860
+ const f = a().filter((g) => !g.disabled), m = f.find((g) => g.value === r.value), b = Kt(f, u, m);
861
+ if (b !== void 0 && !Array.isArray(b.value)) {
862
+ const g = r.multi ? [b.value] : b.value;
863
+ r.onValueChange(g);
1944
864
  }
1945
- }), h = () => {
1946
- i || (s.onOpenChange(!0), g());
865
+ }), x = () => {
866
+ c || (r.onOpenChange(!0), v());
1947
867
  };
1948
- return /* @__PURE__ */ b(Pe.Anchor, { asChild: !0, ...r, children: /* @__PURE__ */ b(
1949
- F.div,
868
+ return /* @__PURE__ */ p(ie.Anchor, { asChild: !0, ...n, children: /* @__PURE__ */ p(
869
+ N.div,
1950
870
  {
1951
871
  role: "combobox",
1952
- "aria-controls": s.contentId,
1953
- "aria-expanded": s.open,
1954
- "aria-required": s.required,
872
+ "aria-controls": r.contentId,
873
+ "aria-expanded": r.open,
874
+ "aria-required": r.required,
1955
875
  "aria-autocomplete": "none",
1956
- dir: s.dir,
1957
- "data-state": s.open ? "open" : "closed",
1958
- "data-disabled": i ? "" : void 0,
1959
- "data-placeholder": s.value === void 0 ? "" : void 0,
1960
- tabIndex: i ? void 0 : 0,
1961
- ...n,
1962
- ref: a,
1963
- onClick: M(n.onClick, (u) => {
876
+ dir: r.dir,
877
+ "data-state": r.open ? "open" : "closed",
878
+ "data-disabled": c ? "" : void 0,
879
+ "data-placeholder": r.value === void 0 ? "" : void 0,
880
+ tabIndex: c ? void 0 : 0,
881
+ ...t,
882
+ ref: l,
883
+ onClick: E(t.onClick, (u) => {
1964
884
  u.currentTarget.focus();
1965
885
  }),
1966
- onPointerDown: M(n.onPointerDown, (u) => {
886
+ onPointerDown: E(t.onPointerDown, (u) => {
1967
887
  const f = u.target;
1968
- f.hasPointerCapture(u.pointerId) && f.releasePointerCapture(u.pointerId), (f.closest("button") ?? f.closest("div")) === u.currentTarget && u.button === 0 && u.ctrlKey === !1 && (h(), s.triggerPointerDownPosRef.current = {
888
+ f.hasPointerCapture(u.pointerId) && f.releasePointerCapture(u.pointerId), (f.closest("button") ?? f.closest("div")) === u.currentTarget && u.button === 0 && u.ctrlKey === !1 && (x(), r.triggerPointerDownPosRef.current = {
1969
889
  x: Math.round(u.pageX),
1970
890
  y: Math.round(u.pageY)
1971
891
  }, u.preventDefault());
1972
892
  }),
1973
- onKeyDown: M(n.onKeyDown, (u) => {
1974
- const f = d.current !== "", m = u.ctrlKey || u.altKey || u.metaKey, S = u.target;
1975
- (S.closest("button") ?? S.closest("div")) === u.currentTarget && (!m && u.key.length === 1 && y(u.key), !(f && u.key === " ") && Os.includes(u.key) && (h(), u.preventDefault()));
893
+ onKeyDown: E(t.onKeyDown, (u) => {
894
+ const f = h.current !== "", m = u.ctrlKey || u.altKey || u.metaKey, b = u.target;
895
+ (b.closest("button") ?? b.closest("div")) === u.currentTarget && (!m && u.key.length === 1 && C(u.key), !(f && u.key === " ") && To.includes(u.key) && (x(), u.preventDefault()));
1976
896
  })
1977
897
  }
1978
898
  ) });
1979
899
  }
1980
900
  );
1981
- Xt.displayName = Mn;
1982
- const Dn = "SelectValue", Zt = l.forwardRef(
1983
- (e, o) => {
1984
- const { __scopeSelect: t, children: n, placeholder: r, ...s } = e, i = ge(Dn, t), { onValueNodeHasChildrenChange: a } = i, c = n !== void 0, d = z(o, i.onValueNodeChange), [y, g] = l.useState([]), h = Ge(t);
1985
- te(() => {
1986
- a(c);
1987
- }, [a, c]), l.useLayoutEffect(() => {
1988
- if (Array.isArray(i.value)) {
1989
- const f = new Set(y.map((v) => v.value)), m = new Set(i.value);
1990
- if (!(f.size === m.size && Array.from(m).every((v) => f.has(v)))) {
1991
- const v = setTimeout(() => {
1992
- const p = h().filter(
1993
- (w) => {
1994
- var C;
1995
- return Array.isArray(w.value) ? !1 : (C = i.value) == null ? void 0 : C.includes(w.value);
901
+ Ue.displayName = Dt;
902
+ const kt = "SelectValue", He = s.forwardRef(
903
+ (o, i) => {
904
+ const { __scopeSelect: e, children: t, placeholder: n, ...r } = o, c = X(kt, e), { onValueNodeHasChildrenChange: l } = c, a = t !== void 0, h = A(i, c.onValueNodeChange), [C, v] = s.useState([]), x = ve(e);
905
+ $(() => {
906
+ l(a);
907
+ }, [l, a]), s.useLayoutEffect(() => {
908
+ if (Array.isArray(c.value)) {
909
+ const f = new Set(C.map((g) => g.value)), m = new Set(c.value);
910
+ if (!(f.size === m.size && Array.from(m).every((g) => f.has(g)))) {
911
+ const g = setTimeout(() => {
912
+ const d = x().filter(
913
+ (y) => {
914
+ var V;
915
+ return Array.isArray(y.value) ? !1 : (V = c.value) == null ? void 0 : V.includes(y.value);
1996
916
  }
1997
917
  );
1998
- g(p);
918
+ v(d);
1999
919
  });
2000
920
  return () => {
2001
- clearTimeout(v);
921
+ clearTimeout(g);
2002
922
  };
2003
923
  }
2004
924
  }
2005
- }, [i.value, h, y]);
925
+ }, [c.value, x, C]);
2006
926
  let u;
2007
- if ((i.value === void 0 || i.value.length === 0) && r !== void 0)
2008
- u = /* @__PURE__ */ b("span", { children: r });
2009
- else if (typeof n == "function")
2010
- if (Array.isArray(i.value)) {
2011
- const f = i.value.map((m) => {
2012
- const S = y.find((v) => v.value === m);
2013
- return S ? n({ value: m, textValue: S == null ? void 0 : S.textValue }) : null;
927
+ if ((c.value === void 0 || c.value.length === 0) && n !== void 0)
928
+ u = /* @__PURE__ */ p("span", { children: n });
929
+ else if (typeof t == "function")
930
+ if (Array.isArray(c.value)) {
931
+ const f = c.value.map((m) => {
932
+ const b = C.find((g) => g.value === m);
933
+ return b ? t({ value: m, textValue: b == null ? void 0 : b.textValue }) : null;
2014
934
  });
2015
- u = f.every((m) => m === null) ? r : f;
935
+ u = f.every((m) => m === null) ? n : f;
2016
936
  } else
2017
- u = n(i.value);
937
+ u = t(c.value);
2018
938
  else
2019
- u = n;
2020
- return /* @__PURE__ */ b(F.span, { ...s, ref: d, children: u || null });
939
+ u = t;
940
+ return /* @__PURE__ */ p(N.span, { ...r, ref: h, children: u || null });
2021
941
  }
2022
942
  );
2023
- Zt.displayName = Dn;
2024
- const zs = "SelectIcon", Jt = l.forwardRef(
2025
- (e, o) => {
2026
- const { __scopeSelect: t, children: n, ...r } = e;
2027
- return /* @__PURE__ */ b(F.span, { "aria-hidden": !0, ...r, ref: o, children: n || "▼" });
943
+ He.displayName = kt;
944
+ const _o = "SelectIcon", ze = s.forwardRef(
945
+ (o, i) => {
946
+ const { __scopeSelect: e, children: t, ...n } = o;
947
+ return /* @__PURE__ */ p(N.span, { "aria-hidden": !0, ...n, ref: i, children: t || "▼" });
2028
948
  }
2029
949
  );
2030
- Jt.displayName = zs;
2031
- const js = "SelectPortal", Qt = (e) => /* @__PURE__ */ b(Bo, { asChild: !0, ...e });
2032
- Qt.displayName = js;
2033
- const Te = "SelectContent", eo = l.forwardRef(
2034
- (e, o) => {
2035
- const t = ge(Te, e.__scopeSelect), [n, r] = l.useState();
2036
- if (te(() => {
2037
- r(new DocumentFragment());
2038
- }, []), !t.open) {
2039
- const s = n;
2040
- return s ? ct.createPortal(
2041
- /* @__PURE__ */ b(Fn, { scope: e.__scopeSelect, children: /* @__PURE__ */ b(gt.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ b("div", { children: e.children }) }) }),
2042
- s
950
+ ze.displayName = _o;
951
+ const Mo = "SelectPortal", We = (o) => /* @__PURE__ */ p(pt, { asChild: !0, ...o });
952
+ We.displayName = Mo;
953
+ const le = "SelectContent", Ke = s.forwardRef(
954
+ (o, i) => {
955
+ const e = X(le, o.__scopeSelect), [t, n] = s.useState();
956
+ if ($(() => {
957
+ n(new DocumentFragment());
958
+ }, []), !e.open) {
959
+ const r = t;
960
+ return r ? we.createPortal(
961
+ /* @__PURE__ */ p(Ft, { scope: o.__scopeSelect, children: /* @__PURE__ */ p(Te.Slot, { scope: o.__scopeSelect, children: /* @__PURE__ */ p("div", { children: o.children }) }) }),
962
+ r
2043
963
  ) : null;
2044
964
  }
2045
- return /* @__PURE__ */ b(Ln, { ...e, ref: o });
965
+ return /* @__PURE__ */ p(Lt, { ...o, ref: i });
2046
966
  }
2047
967
  );
2048
- eo.displayName = Te;
2049
- const me = 10, [Fn, ve] = $e(Te), Hs = "SelectContentImpl", Ln = l.forwardRef(
2050
- (e, o) => {
968
+ Ke.displayName = le;
969
+ const q = 10, [Ft, oe] = pe(le), Oo = "SelectContentImpl", Lt = s.forwardRef(
970
+ (o, i) => {
2051
971
  const {
2052
- __scopeSelect: t,
2053
- position: n = "item-aligned",
2054
- onCloseAutoFocus: r,
2055
- onEscapeKeyDown: s,
2056
- onPointerDownOutside: i,
972
+ __scopeSelect: e,
973
+ position: t = "item-aligned",
974
+ onCloseAutoFocus: n,
975
+ onEscapeKeyDown: r,
976
+ onPointerDownOutside: c,
2057
977
  //
2058
978
  // PopperContent props
2059
- side: a,
2060
- sideOffset: c,
2061
- align: d,
2062
- alignOffset: y,
2063
- arrowPadding: g,
2064
- collisionBoundary: h,
979
+ side: l,
980
+ sideOffset: a,
981
+ align: h,
982
+ alignOffset: C,
983
+ arrowPadding: v,
984
+ collisionBoundary: x,
2065
985
  collisionPadding: u,
2066
986
  sticky: f,
2067
987
  hideWhenDetached: m,
2068
- avoidCollisions: S,
988
+ avoidCollisions: b,
2069
989
  //
2070
- ...v
2071
- } = e, p = ge(Te, t), [w, C] = l.useState(null), [E, T] = l.useState(null), x = z(o, (I) => C(I)), [D, W] = l.useState(null), [G, oe] = l.useState(null), L = Ge(t), [Y, K] = l.useState(!1), Z = l.useRef(!1);
2072
- l.useEffect(() => {
2073
- if (w) return zo(w);
2074
- }, [w]), Fo();
2075
- const le = l.useCallback(
2076
- (I) => {
2077
- const [N, ...k] = L().map((A) => A.ref.current), [_] = k.slice(-1), R = document.activeElement;
2078
- for (const A of I)
2079
- if (A === R || (A == null || A.scrollIntoView({ block: "nearest" }), A === N && E && (E.scrollTop = 0), A === _ && E && (E.scrollTop = E.scrollHeight), A == null || A.focus(), document.activeElement !== R)) return;
990
+ ...g
991
+ } = o, d = X(le, e), [y, V] = s.useState(null), [O, F] = s.useState(null), _ = A(i, (S) => V(S)), [k, Z] = s.useState(null), [U, W] = s.useState(null), R = ve(e), [H, L] = s.useState(!1), z = s.useRef(!1);
992
+ s.useEffect(() => {
993
+ if (y) return ft(y);
994
+ }, [y]), at();
995
+ const J = s.useCallback(
996
+ (S) => {
997
+ const [I, ...M] = R().map((w) => w.ref.current), [P] = M.slice(-1), T = document.activeElement;
998
+ for (const w of S)
999
+ if (w === T || (w == null || w.scrollIntoView({ block: "nearest" }), w === I && O && (O.scrollTop = 0), w === P && O && (O.scrollTop = O.scrollHeight), w == null || w.focus(), document.activeElement !== T)) return;
2080
1000
  },
2081
- [L, E]
2082
- ), ne = l.useCallback(
2083
- () => le([D, w]),
2084
- [le, D, w]
1001
+ [R, O]
1002
+ ), Q = s.useCallback(
1003
+ () => J([k, y]),
1004
+ [J, k, y]
2085
1005
  );
2086
- l.useEffect(() => {
2087
- Y && ne();
2088
- }, [Y, ne]);
2089
- const { onOpenChange: J, triggerPointerDownPosRef: $ } = p;
2090
- l.useEffect(() => {
2091
- if (w) {
2092
- let I = { x: 0, y: 0 };
2093
- const N = (_) => {
2094
- var R, A;
2095
- I = {
2096
- x: Math.abs(Math.round(_.pageX) - (((R = $.current) == null ? void 0 : R.x) ?? 0)),
2097
- y: Math.abs(Math.round(_.pageY) - (((A = $.current) == null ? void 0 : A.y) ?? 0))
1006
+ s.useEffect(() => {
1007
+ H && Q();
1008
+ }, [H, Q]);
1009
+ const { onOpenChange: K, triggerPointerDownPosRef: G } = d;
1010
+ s.useEffect(() => {
1011
+ if (y) {
1012
+ let S = { x: 0, y: 0 };
1013
+ const I = (P) => {
1014
+ var T, w;
1015
+ S = {
1016
+ x: Math.abs(Math.round(P.pageX) - (((T = G.current) == null ? void 0 : T.x) ?? 0)),
1017
+ y: Math.abs(Math.round(P.pageY) - (((w = G.current) == null ? void 0 : w.y) ?? 0))
2098
1018
  };
2099
- }, k = (_) => {
2100
- I.x <= 10 && I.y <= 10 ? _.preventDefault() : w.contains(_.target) || J(!1), document.removeEventListener("pointermove", N), $.current = null;
1019
+ }, M = (P) => {
1020
+ S.x <= 10 && S.y <= 10 ? P.preventDefault() : y.contains(P.target) || K(!1), document.removeEventListener("pointermove", I), G.current = null;
2101
1021
  };
2102
- return $.current !== null && (document.addEventListener("pointermove", N), document.addEventListener("pointerup", k, { capture: !0, once: !0 })), () => {
2103
- document.removeEventListener("pointermove", N), document.removeEventListener("pointerup", k, { capture: !0 });
1022
+ return G.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", M, { capture: !0, once: !0 })), () => {
1023
+ document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", M, { capture: !0 });
2104
1024
  };
2105
1025
  }
2106
- }, [w, J, $]), l.useEffect(() => {
2107
- const I = () => J(!1);
2108
- return window.addEventListener("blur", I), window.addEventListener("resize", I), () => {
2109
- window.removeEventListener("blur", I), window.removeEventListener("resize", I);
1026
+ }, [y, K, G]), s.useEffect(() => {
1027
+ const S = () => K(!1);
1028
+ return window.addEventListener("blur", S), window.addEventListener("resize", S), () => {
1029
+ window.removeEventListener("blur", S), window.removeEventListener("resize", S);
2110
1030
  };
2111
- }, [J]);
2112
- const [re, q] = Un((I) => {
2113
- const N = L().filter((R) => !R.disabled), k = N.find((R) => R.ref.current === document.activeElement), _ = Wn(N, I, k);
2114
- _ && setTimeout(() => _.ref.current.focus());
2115
- }), j = l.useCallback(
2116
- (I, N, k) => {
2117
- const _ = !Z.current && !k;
2118
- (p.value !== void 0 && p.value === N || _) && (W(I), _ && (Z.current = !0));
1031
+ }, [K]);
1032
+ const [ce, ee] = Wt((S) => {
1033
+ const I = R().filter((T) => !T.disabled), M = I.find((T) => T.ref.current === document.activeElement), P = Kt(I, S, M);
1034
+ P && setTimeout(() => P.ref.current.focus());
1035
+ }), fe = s.useCallback(
1036
+ (S, I, M) => {
1037
+ const P = !z.current && !M;
1038
+ (d.value !== void 0 && d.value === I || P) && (Z(S), P && (z.current = !0));
2119
1039
  },
2120
- [p.value]
2121
- ), fe = l.useCallback(() => w == null ? void 0 : w.focus(), [w]), se = l.useCallback(
2122
- (I, N, k) => {
2123
- const _ = !Z.current && !k;
2124
- (p.value !== void 0 && (Array.isArray(N) ? N.every((A) => {
2125
- var ee;
2126
- return (ee = p.value) == null ? void 0 : ee.includes(A);
2127
- }) : p.value === N) || _) && oe(I);
1040
+ [d.value]
1041
+ ), me = s.useCallback(() => y == null ? void 0 : y.focus(), [y]), te = s.useCallback(
1042
+ (S, I, M) => {
1043
+ const P = !z.current && !M;
1044
+ (d.value !== void 0 && (Array.isArray(I) ? I.every((w) => {
1045
+ var B;
1046
+ return (B = d.value) == null ? void 0 : B.includes(w);
1047
+ }) : d.value === I) || P) && W(S);
2128
1048
  },
2129
- [p.value]
2130
- ), ae = n === "popper" ? kt : $n, Q = ae === kt ? {
2131
- side: a,
2132
- sideOffset: c,
2133
- align: d,
2134
- alignOffset: y,
2135
- arrowPadding: g,
2136
- collisionBoundary: h,
1049
+ [d.value]
1050
+ ), ae = t === "popper" ? Re : Bt, ne = ae === Re ? {
1051
+ side: l,
1052
+ sideOffset: a,
1053
+ align: h,
1054
+ alignOffset: C,
1055
+ arrowPadding: v,
1056
+ collisionBoundary: x,
2137
1057
  collisionPadding: u,
2138
1058
  sticky: f,
2139
1059
  hideWhenDetached: m,
2140
- avoidCollisions: S
1060
+ avoidCollisions: b
2141
1061
  } : {};
2142
- return /* @__PURE__ */ b(
2143
- Fn,
1062
+ return /* @__PURE__ */ p(
1063
+ Ft,
2144
1064
  {
2145
- scope: t,
2146
- content: w,
2147
- viewport: E,
2148
- onViewportChange: T,
2149
- itemRefCallback: j,
2150
- selectedItem: D,
2151
- onItemLeave: fe,
2152
- itemTextRefCallback: se,
2153
- focusSelectedItem: ne,
2154
- selectedItemText: G,
2155
- position: n,
2156
- isPositioned: Y,
2157
- searchRef: re,
2158
- children: /* @__PURE__ */ b(jo, { as: Ct, allowPinchZoom: !0, children: /* @__PURE__ */ b(
2159
- Lo,
1065
+ scope: e,
1066
+ content: y,
1067
+ viewport: O,
1068
+ onViewportChange: F,
1069
+ itemRefCallback: fe,
1070
+ selectedItem: k,
1071
+ onItemLeave: me,
1072
+ itemTextRefCallback: te,
1073
+ focusSelectedItem: Q,
1074
+ selectedItemText: U,
1075
+ position: t,
1076
+ isPositioned: H,
1077
+ searchRef: ce,
1078
+ children: /* @__PURE__ */ p(mt, { as: Ee, allowPinchZoom: !0, children: /* @__PURE__ */ p(
1079
+ ut,
2160
1080
  {
2161
1081
  asChild: !0,
2162
- trapped: p.open,
2163
- onMountAutoFocus: (I) => {
2164
- I.preventDefault();
1082
+ trapped: d.open,
1083
+ onMountAutoFocus: (S) => {
1084
+ S.preventDefault();
2165
1085
  },
2166
- onUnmountAutoFocus: M(r, (I) => {
2167
- var N, k;
2168
- (N = p.trigger) == null || N.focus({ preventScroll: !0 }), (k = document.getSelection()) == null || k.empty(), I.preventDefault();
1086
+ onUnmountAutoFocus: E(n, (S) => {
1087
+ var I, M;
1088
+ (I = d.trigger) == null || I.focus({ preventScroll: !0 }), (M = document.getSelection()) == null || M.empty(), S.preventDefault();
2169
1089
  }),
2170
- children: /* @__PURE__ */ b(
2171
- Do,
1090
+ children: /* @__PURE__ */ p(
1091
+ ct,
2172
1092
  {
2173
1093
  asChild: !0,
2174
1094
  disableOutsidePointerEvents: !0,
2175
- onEscapeKeyDown: s,
2176
- onPointerDownOutside: i,
2177
- onFocusOutside: (I) => I.preventDefault(),
2178
- onDismiss: () => p.onOpenChange(!1),
2179
- children: /* @__PURE__ */ b(
1095
+ onEscapeKeyDown: r,
1096
+ onPointerDownOutside: c,
1097
+ onFocusOutside: (S) => S.preventDefault(),
1098
+ onDismiss: () => d.onOpenChange(!1),
1099
+ children: /* @__PURE__ */ p(
2180
1100
  ae,
2181
1101
  {
2182
1102
  role: "listbox",
2183
- id: p.contentId,
2184
- "data-state": p.open ? "open" : "closed",
2185
- "aria-multiselectable": p.multi ? "true" : void 0,
2186
- dir: p.dir,
2187
- onContextMenu: (I) => I.preventDefault(),
2188
- ...v,
2189
- ...Q,
2190
- onPlaced: () => K(!0),
2191
- ref: x,
1103
+ id: d.contentId,
1104
+ "data-state": d.open ? "open" : "closed",
1105
+ "aria-multiselectable": d.multi ? "true" : void 0,
1106
+ dir: d.dir,
1107
+ onContextMenu: (S) => S.preventDefault(),
1108
+ ...g,
1109
+ ...ne,
1110
+ onPlaced: () => L(!0),
1111
+ ref: _,
2192
1112
  style: {
2193
1113
  // flex layout so we can place the scroll buttons properly
2194
1114
  display: "flex",
2195
1115
  flexDirection: "column",
2196
1116
  // reset the outline by default as the content MAY get focused
2197
1117
  outline: "none",
2198
- ...v.style
1118
+ ...g.style
2199
1119
  },
2200
- onKeyDown: M(v.onKeyDown, (I) => {
2201
- const N = I.ctrlKey || I.altKey || I.metaKey;
2202
- if (I.key === "Tab" && I.preventDefault(), !N && I.key.length === 1 && q(I.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(I.key)) {
2203
- let _ = L().filter((R) => !R.disabled).map((R) => R.ref.current);
2204
- if (["ArrowUp", "End"].includes(I.key) && (_ = _.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(I.key)) {
2205
- const R = I.target, A = _.indexOf(R);
2206
- _ = _.slice(A + 1);
1120
+ onKeyDown: E(g.onKeyDown, (S) => {
1121
+ const I = S.ctrlKey || S.altKey || S.metaKey;
1122
+ if (S.key === "Tab" && S.preventDefault(), !I && S.key.length === 1 && ee(S.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(S.key)) {
1123
+ let P = R().filter((T) => !T.disabled).map((T) => T.ref.current);
1124
+ if (["ArrowUp", "End"].includes(S.key) && (P = P.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(S.key)) {
1125
+ const T = S.target, w = P.indexOf(T);
1126
+ P = P.slice(w + 1);
2207
1127
  }
2208
- setTimeout(() => le(_)), I.preventDefault();
1128
+ setTimeout(() => J(P)), S.preventDefault();
2209
1129
  }
2210
1130
  })
2211
1131
  }
@@ -2218,93 +1138,93 @@ const me = 10, [Fn, ve] = $e(Te), Hs = "SelectContentImpl", Ln = l.forwardRef(
2218
1138
  );
2219
1139
  }
2220
1140
  );
2221
- Ln.displayName = Hs;
2222
- const Us = "SelectItemAlignedPosition", $n = l.forwardRef(
2223
- (e, o) => {
2224
- const { __scopeSelect: t, onPlaced: n, ...r } = e, s = ge(Te, t), i = ve(Te, t), [a, c] = l.useState(null), [d, y] = l.useState(null), g = z(o, (x) => y(x)), h = Ge(t), u = l.useRef(!1), f = l.useRef(!0), { viewport: m, selectedItem: S, selectedItemText: v, focusSelectedItem: p } = i, w = l.useCallback(() => {
2225
- if (s.trigger && s.valueNode && a && d && m && S && v) {
2226
- const x = s.trigger.getBoundingClientRect(), D = d.getBoundingClientRect(), W = s.valueNode.getBoundingClientRect(), G = v.getBoundingClientRect();
2227
- if (s.dir !== "rtl") {
2228
- const R = G.left - D.left, A = W.left - R, ee = x.left - A, ue = x.width + ee, U = Math.max(ue, D.width), Ae = window.innerWidth - me, Be = mo(A, [me, Ae - U]);
2229
- a.style.minWidth = `${ue}px`, a.style.left = `${Be}px`;
1141
+ Lt.displayName = Oo;
1142
+ const Do = "SelectItemAlignedPosition", Bt = s.forwardRef(
1143
+ (o, i) => {
1144
+ const { __scopeSelect: e, onPlaced: t, ...n } = o, r = X(le, e), c = oe(le, e), [l, a] = s.useState(null), [h, C] = s.useState(null), v = A(i, (_) => C(_)), x = ve(e), u = s.useRef(!1), f = s.useRef(!0), { viewport: m, selectedItem: b, selectedItemText: g, focusSelectedItem: d } = c, y = s.useCallback(() => {
1145
+ if (r.trigger && r.valueNode && l && h && m && b && g) {
1146
+ const _ = r.trigger.getBoundingClientRect(), k = h.getBoundingClientRect(), Z = r.valueNode.getBoundingClientRect(), U = g.getBoundingClientRect();
1147
+ if (r.dir !== "rtl") {
1148
+ const T = U.left - k.left, w = Z.left - T, B = _.left - w, j = _.width + B, D = Math.max(j, k.width), ue = window.innerWidth - q, he = rt(w, [q, ue - D]);
1149
+ l.style.minWidth = `${j}px`, l.style.left = `${he}px`;
2230
1150
  } else {
2231
- const R = D.right - G.right, A = window.innerWidth - W.right - R, ee = window.innerWidth - x.right - A, ue = x.width + ee, U = Math.max(ue, D.width), Ae = window.innerWidth - me, Be = mo(A, [me, Ae - U]);
2232
- a.style.minWidth = `${ue}px`, a.style.right = `${Be}px`;
1151
+ const T = k.right - U.right, w = window.innerWidth - Z.right - T, B = window.innerWidth - _.right - w, j = _.width + B, D = Math.max(j, k.width), ue = window.innerWidth - q, he = rt(w, [q, ue - D]);
1152
+ l.style.minWidth = `${j}px`, l.style.right = `${he}px`;
2233
1153
  }
2234
- const oe = h(), L = window.innerHeight - me * 2, Y = m.scrollHeight, K = window.getComputedStyle(d), Z = parseInt(K.borderTopWidth, 10), le = parseInt(K.paddingTop, 10), ne = parseInt(K.borderBottomWidth, 10), J = parseInt(K.paddingBottom, 10), $ = Z + le + Y + J + ne, re = Math.min(S.offsetHeight * 5, $), q = window.getComputedStyle(m), j = parseInt(q.paddingTop, 10), fe = parseInt(q.paddingBottom, 10), se = x.top + x.height / 2 - me, ae = L - se, Q = S.offsetHeight / 2, I = S.offsetTop + Q, N = Z + le + I, k = $ - N;
2235
- if (N <= se) {
2236
- const R = S === oe[oe.length - 1].ref.current;
2237
- a.style.bottom = "0px";
2238
- const A = d.clientHeight - m.offsetTop - m.offsetHeight, ee = Math.max(
1154
+ const W = x(), R = window.innerHeight - q * 2, H = m.scrollHeight, L = window.getComputedStyle(h), z = parseInt(L.borderTopWidth, 10), J = parseInt(L.paddingTop, 10), Q = parseInt(L.borderBottomWidth, 10), K = parseInt(L.paddingBottom, 10), G = z + J + H + K + Q, ce = Math.min(b.offsetHeight * 5, G), ee = window.getComputedStyle(m), fe = parseInt(ee.paddingTop, 10), me = parseInt(ee.paddingBottom, 10), te = _.top + _.height / 2 - q, ae = R - te, ne = b.offsetHeight / 2, S = b.offsetTop + ne, I = z + J + S, M = G - I;
1155
+ if (I <= te) {
1156
+ const T = b === W[W.length - 1].ref.current;
1157
+ l.style.bottom = "0px";
1158
+ const w = h.clientHeight - m.offsetTop - m.offsetHeight, B = Math.max(
2239
1159
  ae,
2240
- Q + // viewport might have padding bottom, include it to avoid a scrollable viewport
2241
- (R ? fe : 0) + A + ne
2242
- ), ue = N + ee;
2243
- a.style.height = `${ue}px`;
1160
+ ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
1161
+ (T ? me : 0) + w + Q
1162
+ ), j = I + B;
1163
+ l.style.height = `${j}px`;
2244
1164
  } else {
2245
- const R = S === oe[0].ref.current;
2246
- a.style.top = "0px";
2247
- const ee = Math.max(
2248
- se,
2249
- Z + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
2250
- (R ? j : 0) + Q
2251
- ) + k;
2252
- a.style.height = `${ee}px`, m.scrollTop = N - se + m.offsetTop;
1165
+ const T = b === W[0].ref.current;
1166
+ l.style.top = "0px";
1167
+ const B = Math.max(
1168
+ te,
1169
+ z + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
1170
+ (T ? fe : 0) + ne
1171
+ ) + M;
1172
+ l.style.height = `${B}px`, m.scrollTop = I - te + m.offsetTop;
2253
1173
  }
2254
- a.style.margin = `${me}px 0`, a.style.minHeight = `${re}px`, a.style.maxHeight = `${L}px`, n == null || n(), requestAnimationFrame(() => u.current = !0);
1174
+ l.style.margin = `${q}px 0`, l.style.minHeight = `${ce}px`, l.style.maxHeight = `${R}px`, t == null || t(), requestAnimationFrame(() => u.current = !0);
2255
1175
  }
2256
1176
  }, [
1177
+ x,
1178
+ r.trigger,
1179
+ r.valueNode,
1180
+ l,
2257
1181
  h,
2258
- s.trigger,
2259
- s.valueNode,
2260
- a,
2261
- d,
2262
1182
  m,
2263
- S,
2264
- v,
2265
- s.dir,
2266
- n
1183
+ b,
1184
+ g,
1185
+ r.dir,
1186
+ t
2267
1187
  ]);
2268
- te(() => w(), [w]);
2269
- const [C, E] = l.useState();
2270
- te(() => {
2271
- d && E(window.getComputedStyle(d).zIndex);
2272
- }, [d]);
2273
- const T = l.useCallback(
2274
- (x) => {
2275
- x && f.current === !0 && (w(), p == null || p(), f.current = !1);
1188
+ $(() => y(), [y]);
1189
+ const [V, O] = s.useState();
1190
+ $(() => {
1191
+ h && O(window.getComputedStyle(h).zIndex);
1192
+ }, [h]);
1193
+ const F = s.useCallback(
1194
+ (_) => {
1195
+ _ && f.current === !0 && (y(), d == null || d(), f.current = !1);
2276
1196
  },
2277
- [w, p]
1197
+ [y, d]
2278
1198
  );
2279
- return /* @__PURE__ */ b(
2280
- Ks,
1199
+ return /* @__PURE__ */ p(
1200
+ Fo,
2281
1201
  {
2282
- scope: t,
2283
- contentWrapper: a,
1202
+ scope: e,
1203
+ contentWrapper: l,
2284
1204
  shouldExpandOnScrollRef: u,
2285
- onScrollButtonChange: T,
2286
- children: /* @__PURE__ */ b(
1205
+ onScrollButtonChange: F,
1206
+ children: /* @__PURE__ */ p(
2287
1207
  "div",
2288
1208
  {
2289
- ref: c,
1209
+ ref: a,
2290
1210
  style: {
2291
1211
  display: "flex",
2292
1212
  flexDirection: "column",
2293
1213
  position: "fixed",
2294
- zIndex: C
1214
+ zIndex: V
2295
1215
  },
2296
- children: /* @__PURE__ */ b(
2297
- F.div,
1216
+ children: /* @__PURE__ */ p(
1217
+ N.div,
2298
1218
  {
2299
- ...r,
2300
- ref: g,
1219
+ ...n,
1220
+ ref: v,
2301
1221
  style: {
2302
1222
  // When we get the height of the content, it includes borders. If we were to set
2303
1223
  // the height without having `boxSizing: 'border-box'` it would be too big.
2304
1224
  boxSizing: "border-box",
2305
1225
  // We need to ensure the content doesn't get taller than the wrapper
2306
1226
  maxHeight: "100%",
2307
- ...r.style
1227
+ ...n.style
2308
1228
  }
2309
1229
  }
2310
1230
  )
@@ -2314,22 +1234,22 @@ const Us = "SelectItemAlignedPosition", $n = l.forwardRef(
2314
1234
  );
2315
1235
  }
2316
1236
  );
2317
- $n.displayName = Us;
2318
- const Ws = "SelectPopperPosition", kt = l.forwardRef(
2319
- (e, o) => {
2320
- const { __scopeSelect: t, align: n = "start", collisionPadding: r = me, ...s } = e, i = yt(t);
2321
- return /* @__PURE__ */ b(
2322
- Pe.Content,
1237
+ Bt.displayName = Do;
1238
+ const ko = "SelectPopperPosition", Re = s.forwardRef(
1239
+ (o, i) => {
1240
+ const { __scopeSelect: e, align: t = "start", collisionPadding: n = q, ...r } = o, c = Ve(e);
1241
+ return /* @__PURE__ */ p(
1242
+ ie.Content,
2323
1243
  {
2324
- ...i,
2325
- ...s,
2326
- ref: o,
2327
- align: n,
2328
- collisionPadding: r,
1244
+ ...c,
1245
+ ...r,
1246
+ ref: i,
1247
+ align: t,
1248
+ collisionPadding: n,
2329
1249
  style: {
2330
1250
  // Ensure border-box for floating-ui calculations
2331
1251
  boxSizing: "border-box",
2332
- ...s.style,
1252
+ ...r.style,
2333
1253
  "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
2334
1254
  "--radix-select-content-available-width": "var(--radix-popper-available-width)",
2335
1255
  "--radix-select-content-available-height": "var(--radix-popper-available-height)",
@@ -2340,15 +1260,15 @@ const Ws = "SelectPopperPosition", kt = l.forwardRef(
2340
1260
  );
2341
1261
  }
2342
1262
  );
2343
- kt.displayName = Ws;
2344
- const [Ks, to] = $e(
2345
- Te,
1263
+ Re.displayName = ko;
1264
+ const [Fo, Ge] = pe(
1265
+ le,
2346
1266
  {}
2347
- ), Ot = "SelectViewport", oo = l.forwardRef(
2348
- (e, o) => {
2349
- const { __scopeSelect: t, ...n } = e, r = ve(Ot, t), s = to(Ot, t), i = z(o, r.onViewportChange), a = l.useRef(0);
2350
- return /* @__PURE__ */ it(at, { children: [
2351
- /* @__PURE__ */ b(
1267
+ ), Ae = "SelectViewport", je = s.forwardRef(
1268
+ (o, i) => {
1269
+ const { __scopeSelect: e, ...t } = o, n = oe(Ae, e), r = Ge(Ae, e), c = A(i, n.onViewportChange), l = s.useRef(0);
1270
+ return /* @__PURE__ */ ye(Se, { children: [
1271
+ /* @__PURE__ */ p(
2352
1272
  "style",
2353
1273
  {
2354
1274
  dangerouslySetInnerHTML: {
@@ -2356,13 +1276,13 @@ const [Ks, to] = $e(
2356
1276
  }
2357
1277
  }
2358
1278
  ),
2359
- /* @__PURE__ */ b(gt.Slot, { scope: t, children: /* @__PURE__ */ b(
2360
- F.div,
1279
+ /* @__PURE__ */ p(Te.Slot, { scope: e, children: /* @__PURE__ */ p(
1280
+ N.div,
2361
1281
  {
2362
1282
  "data-radix-select-viewport": "",
2363
1283
  role: "presentation",
2364
- ...n,
2365
- ref: i,
1284
+ ...t,
1285
+ ref: c,
2366
1286
  style: {
2367
1287
  // we use position: 'relative' here on the `viewport` so that when we call
2368
1288
  // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
@@ -2370,104 +1290,104 @@ const [Ks, to] = $e(
2370
1290
  position: "relative",
2371
1291
  flex: 1,
2372
1292
  overflow: "auto",
2373
- ...n.style
1293
+ ...t.style
2374
1294
  },
2375
- onScroll: M(n.onScroll, (c) => {
2376
- const d = c.currentTarget, { contentWrapper: y, shouldExpandOnScrollRef: g } = s;
2377
- if (g != null && g.current && y) {
2378
- const h = Math.abs(a.current - d.scrollTop);
2379
- if (h > 0) {
2380
- const u = window.innerHeight - me * 2, f = parseFloat(y.style.minHeight), m = parseFloat(y.style.height), S = Math.max(f, m);
2381
- if (S < u) {
2382
- const v = S + h, p = Math.min(u, v), w = v - p;
2383
- y.style.height = `${p}px`, y.style.bottom === "0px" && (d.scrollTop = w > 0 ? w : 0, y.style.justifyContent = "flex-end");
1295
+ onScroll: E(t.onScroll, (a) => {
1296
+ const h = a.currentTarget, { contentWrapper: C, shouldExpandOnScrollRef: v } = r;
1297
+ if (v != null && v.current && C) {
1298
+ const x = Math.abs(l.current - h.scrollTop);
1299
+ if (x > 0) {
1300
+ const u = window.innerHeight - q * 2, f = parseFloat(C.style.minHeight), m = parseFloat(C.style.height), b = Math.max(f, m);
1301
+ if (b < u) {
1302
+ const g = b + x, d = Math.min(u, g), y = g - d;
1303
+ C.style.height = `${d}px`, C.style.bottom === "0px" && (h.scrollTop = y > 0 ? y : 0, C.style.justifyContent = "flex-end");
2384
1304
  }
2385
1305
  }
2386
1306
  }
2387
- a.current = d.scrollTop;
1307
+ l.current = h.scrollTop;
2388
1308
  })
2389
1309
  }
2390
1310
  ) })
2391
1311
  ] });
2392
1312
  }
2393
1313
  );
2394
- oo.displayName = Ot;
2395
- const Bn = "SelectGroup", [Gs, Ys] = $e(Bn), no = l.forwardRef(
2396
- (e, o) => {
2397
- const { __scopeSelect: t, ...n } = e, r = Ee();
2398
- return /* @__PURE__ */ b(Gs, { scope: t, id: r, children: /* @__PURE__ */ b(F.div, { role: "group", "aria-labelledby": r, ...n, ref: o }) });
1314
+ je.displayName = Ae;
1315
+ const $t = "SelectGroup", [Lo, Bo] = pe($t), Ye = s.forwardRef(
1316
+ (o, i) => {
1317
+ const { __scopeSelect: e, ...t } = o, n = se();
1318
+ return /* @__PURE__ */ p(Lo, { scope: e, id: n, children: /* @__PURE__ */ p(N.div, { role: "group", "aria-labelledby": n, ...t, ref: i }) });
2399
1319
  }
2400
1320
  );
2401
- no.displayName = Bn;
2402
- const zn = "SelectLabel", ro = l.forwardRef(
2403
- (e, o) => {
2404
- const { __scopeSelect: t, ...n } = e, r = Ys(zn, t);
2405
- return /* @__PURE__ */ b(F.div, { id: r.id, ...n, ref: o });
1321
+ Ye.displayName = $t;
1322
+ const Ut = "SelectLabel", qe = s.forwardRef(
1323
+ (o, i) => {
1324
+ const { __scopeSelect: e, ...t } = o, n = Bo(Ut, e);
1325
+ return /* @__PURE__ */ p(N.div, { id: n.id, ...t, ref: i });
2406
1326
  }
2407
1327
  );
2408
- ro.displayName = zn;
2409
- const st = "SelectItem", [qs, jn] = $e(st), so = l.forwardRef(
2410
- (e, o) => {
2411
- const { __scopeSelect: t, value: n, disabled: r = !1, textValue: s, ...i } = e, a = ge(st, t), c = ve(st, t), d = typeof n == "string" ? Array.isArray(a.value) ? a.value.includes(n) : a.value === n : n.every((p) => {
2412
- var w;
2413
- return (w = a.value) == null ? void 0 : w.includes(p);
2414
- }), y = Array.isArray(a.value) && Array.isArray(n) && n.some((p) => {
2415
- var w;
2416
- return (w = a.value) == null ? void 0 : w.includes(p);
2417
- }), [g, h] = l.useState(s ?? ""), [u, f] = l.useState(!1), m = z(
2418
- o,
2419
- (p) => {
2420
- var w;
2421
- return (w = c.itemRefCallback) == null ? void 0 : w.call(c, p, n, r);
1328
+ qe.displayName = Ut;
1329
+ const be = "SelectItem", [$o, Ht] = pe(be), Xe = s.forwardRef(
1330
+ (o, i) => {
1331
+ const { __scopeSelect: e, value: t, disabled: n = !1, textValue: r, ...c } = o, l = X(be, e), a = oe(be, e), h = typeof t == "string" ? Array.isArray(l.value) ? l.value.includes(t) : l.value === t : t.every((d) => {
1332
+ var y;
1333
+ return (y = l.value) == null ? void 0 : y.includes(d);
1334
+ }), C = Array.isArray(l.value) && Array.isArray(t) && t.some((d) => {
1335
+ var y;
1336
+ return (y = l.value) == null ? void 0 : y.includes(d);
1337
+ }), [v, x] = s.useState(r ?? ""), [u, f] = s.useState(!1), m = A(
1338
+ i,
1339
+ (d) => {
1340
+ var y;
1341
+ return (y = a.itemRefCallback) == null ? void 0 : y.call(a, d, t, n);
2422
1342
  }
2423
- ), S = Ee(), v = () => {
2424
- if (!r) {
2425
- let p = a.multi && typeof n == "string" ? [n] : n;
2426
- y && !d ? a.onValueChange(p) : Array.isArray(a.value) && (p = Kn(n, a.value)), a.onValueChange(p), a.multi || a.onOpenChange(!1);
1343
+ ), b = se(), g = () => {
1344
+ if (!n) {
1345
+ let d = l.multi && typeof t == "string" ? [t] : t;
1346
+ C && !h ? l.onValueChange(d) : Array.isArray(l.value) && (d = Gt(t, l.value)), l.onValueChange(d), l.multi || l.onOpenChange(!1);
2427
1347
  }
2428
1348
  };
2429
- if (!a.multi && Array.isArray(n))
1349
+ if (!l.multi && Array.isArray(t))
2430
1350
  throw new Error("You can only pass an array of values in multi selects");
2431
- return /* @__PURE__ */ b(
2432
- qs,
1351
+ return /* @__PURE__ */ p(
1352
+ $o,
2433
1353
  {
2434
- scope: t,
2435
- value: n,
2436
- disabled: r,
2437
- textId: S,
2438
- isSelected: d,
2439
- isIntermediate: y,
2440
- onItemTextChange: l.useCallback((p) => {
2441
- h((w) => w || ((p == null ? void 0 : p.textContent) ?? "").trim());
1354
+ scope: e,
1355
+ value: t,
1356
+ disabled: n,
1357
+ textId: b,
1358
+ isSelected: h,
1359
+ isIntermediate: C,
1360
+ onItemTextChange: s.useCallback((d) => {
1361
+ x((y) => y || ((d == null ? void 0 : d.textContent) ?? "").trim());
2442
1362
  }, []),
2443
- children: /* @__PURE__ */ b(gt.ItemSlot, { scope: t, value: n, disabled: r, textValue: g, children: /* @__PURE__ */ b(
2444
- F.div,
1363
+ children: /* @__PURE__ */ p(Te.ItemSlot, { scope: e, value: t, disabled: n, textValue: v, children: /* @__PURE__ */ p(
1364
+ N.div,
2445
1365
  {
2446
1366
  role: "option",
2447
- "aria-labelledby": S,
1367
+ "aria-labelledby": b,
2448
1368
  "data-highlighted": u ? "" : void 0,
2449
- "aria-selected": a.multi ? void 0 : d && u,
2450
- "aria-checked": a.multi ? d : void 0,
2451
- "data-state": d ? "checked" : "unchecked",
2452
- "aria-disabled": r || void 0,
2453
- "data-disabled": r ? "" : void 0,
2454
- tabIndex: r ? void 0 : -1,
2455
- ...i,
1369
+ "aria-selected": l.multi ? void 0 : h && u,
1370
+ "aria-checked": l.multi ? h : void 0,
1371
+ "data-state": h ? "checked" : "unchecked",
1372
+ "aria-disabled": n || void 0,
1373
+ "data-disabled": n ? "" : void 0,
1374
+ tabIndex: n ? void 0 : -1,
1375
+ ...c,
2456
1376
  ref: m,
2457
- onFocus: M(i.onFocus, () => f(!0)),
2458
- onBlur: M(i.onBlur, () => f(!1)),
2459
- onPointerUp: M(i.onPointerUp, v),
2460
- onPointerMove: M(i.onPointerMove, (p) => {
2461
- var w;
2462
- r ? (w = c.onItemLeave) == null || w.call(c) : p.currentTarget.focus({ preventScroll: !0 });
1377
+ onFocus: E(c.onFocus, () => f(!0)),
1378
+ onBlur: E(c.onBlur, () => f(!1)),
1379
+ onPointerUp: E(c.onPointerUp, g),
1380
+ onPointerMove: E(c.onPointerMove, (d) => {
1381
+ var y;
1382
+ n ? (y = a.onItemLeave) == null || y.call(a) : d.currentTarget.focus({ preventScroll: !0 });
2463
1383
  }),
2464
- onPointerLeave: M(i.onPointerLeave, (p) => {
2465
- var w;
2466
- p.currentTarget === document.activeElement && ((w = c.onItemLeave) == null || w.call(c));
1384
+ onPointerLeave: E(c.onPointerLeave, (d) => {
1385
+ var y;
1386
+ d.currentTarget === document.activeElement && ((y = a.onItemLeave) == null || y.call(a));
2467
1387
  }),
2468
- onKeyDown: M(i.onKeyDown, (p) => {
2469
- var C;
2470
- ((C = c.searchRef) == null ? void 0 : C.current) !== "" && p.key === " " || (Ms.includes(p.key) && v(), p.key === " " && p.preventDefault());
1388
+ onKeyDown: E(c.onKeyDown, (d) => {
1389
+ var V;
1390
+ ((V = a.searchRef) == null ? void 0 : V.current) !== "" && d.key === " " || (Vo.includes(d.key) && g(), d.key === " " && d.preventDefault());
2471
1391
  })
2472
1392
  }
2473
1393
  ) })
@@ -2475,245 +1395,239 @@ const st = "SelectItem", [qs, jn] = $e(st), so = l.forwardRef(
2475
1395
  );
2476
1396
  }
2477
1397
  );
2478
- so.displayName = st;
2479
- const je = "SelectItemText", Xs = On(F.span)`
2480
- &:not(:last-child) {
2481
- &::after {
2482
- content: ', ';
2483
- }
2484
- }
2485
- `, io = l.forwardRef(
2486
- (e, o) => {
2487
- const { __scopeSelect: t, className: n, style: r, ...s } = e, i = ge(je, t), a = ve(je, t), c = jn(je, t), d = Bs(je, t), [y, g] = l.useState(null), h = z(
2488
- o,
2489
- (v) => g(v),
2490
- c.onItemTextChange,
2491
- (v) => {
2492
- var p;
2493
- return (p = a.itemTextRefCallback) == null ? void 0 : p.call(a, v, c.value, c.disabled);
1398
+ Xe.displayName = be;
1399
+ const ge = "SelectItemText", Ze = s.forwardRef(
1400
+ (o, i) => {
1401
+ const { __scopeSelect: e, className: t, style: n, ...r } = o, c = X(ge, e), l = oe(ge, e), a = Ht(ge, e), h = Ao(ge, e), [C, v] = s.useState(null), x = A(
1402
+ i,
1403
+ (g) => v(g),
1404
+ a.onItemTextChange,
1405
+ (g) => {
1406
+ var d;
1407
+ return (d = l.itemTextRefCallback) == null ? void 0 : d.call(l, g, a.value, a.disabled);
2494
1408
  }
2495
- ), u = y == null ? void 0 : y.textContent, f = l.useMemo(
2496
- () => /* @__PURE__ */ b(
1409
+ ), u = C == null ? void 0 : C.textContent, f = s.useMemo(
1410
+ () => /* @__PURE__ */ p(
2497
1411
  "option",
2498
1412
  {
2499
- value: c.value,
2500
- disabled: c.disabled,
1413
+ value: a.value,
1414
+ disabled: a.disabled,
2501
1415
  children: u
2502
1416
  },
2503
- Array.isArray(c.value) ? c.value.join(";") : c.value
1417
+ Array.isArray(a.value) ? a.value.join(";") : a.value
2504
1418
  ),
2505
- [c.disabled, c.value, u]
2506
- ), { onNativeOptionAdd: m, onNativeOptionRemove: S } = d;
2507
- return te(() => (m(f), () => S(f)), [m, S, f]), /* @__PURE__ */ it(at, { children: [
2508
- /* @__PURE__ */ b(F.span, { id: c.textId, ...s, ref: h }),
2509
- c.isSelected && i.valueNode && !i.valueNodeHasChildren ? ct.createPortal(/* @__PURE__ */ b(Xs, { children: s.children }), i.valueNode) : null
1419
+ [a.disabled, a.value, u]
1420
+ ), { onNativeOptionAdd: m, onNativeOptionRemove: b } = h;
1421
+ return $(() => (m(f), () => b(f)), [m, b, f]), /* @__PURE__ */ ye(Se, { children: [
1422
+ /* @__PURE__ */ p(N.span, { id: a.textId, ...r, ref: x }),
1423
+ a.isSelected && c.valueNode && !c.valueNodeHasChildren ? we.createPortal(r.children, c.valueNode) : null
2510
1424
  ] });
2511
1425
  }
2512
1426
  );
2513
- io.displayName = je;
2514
- const Hn = "SelectItemIndicator", ao = l.forwardRef(
2515
- (e, o) => {
2516
- const { __scopeSelect: t, children: n, ...r } = e, s = jn(Hn, t);
2517
- return typeof n == "function" ? /* @__PURE__ */ b(F.span, { "aria-hidden": !0, ...r, ref: o, children: n({
2518
- isSelected: s.isSelected,
2519
- isIntermediate: s.isIntermediate
2520
- }) }) : s.isSelected ? /* @__PURE__ */ b(F.span, { "aria-hidden": !0, ...r, ref: o, children: n }) : null;
1427
+ Ze.displayName = ge;
1428
+ const zt = "SelectItemIndicator", Je = s.forwardRef(
1429
+ (o, i) => {
1430
+ const { __scopeSelect: e, children: t, ...n } = o, r = Ht(zt, e);
1431
+ return typeof t == "function" ? /* @__PURE__ */ p(N.span, { "aria-hidden": !0, ...n, ref: i, children: t({
1432
+ isSelected: r.isSelected,
1433
+ isIntermediate: r.isIntermediate
1434
+ }) }) : r.isSelected ? /* @__PURE__ */ p(N.span, { "aria-hidden": !0, ...n, ref: i, children: t }) : null;
2521
1435
  }
2522
1436
  );
2523
- ao.displayName = Hn;
2524
- const Mt = "SelectScrollUpButton", co = l.forwardRef(
2525
- (e, o) => {
2526
- const t = ve(Mt, e.__scopeSelect), n = to(Mt, e.__scopeSelect), [r, s] = l.useState(!1), i = z(o, n.onScrollButtonChange);
2527
- return te(() => {
2528
- if (t.viewport && t.isPositioned) {
2529
- const a = t.viewport, c = () => {
2530
- const d = a.scrollTop > 0;
2531
- s(d);
1437
+ Je.displayName = zt;
1438
+ const _e = "SelectScrollUpButton", Qe = s.forwardRef(
1439
+ (o, i) => {
1440
+ const e = oe(_e, o.__scopeSelect), t = Ge(_e, o.__scopeSelect), [n, r] = s.useState(!1), c = A(i, t.onScrollButtonChange);
1441
+ return $(() => {
1442
+ if (e.viewport && e.isPositioned) {
1443
+ const l = e.viewport, a = () => {
1444
+ const h = l.scrollTop > 0;
1445
+ r(h);
2532
1446
  };
2533
- return c(), a.addEventListener("scroll", c), () => a.removeEventListener("scroll", c);
1447
+ return a(), l.addEventListener("scroll", a), () => l.removeEventListener("scroll", a);
2534
1448
  }
2535
- }, [t.viewport, t.isPositioned]), r ? /* @__PURE__ */ b(
2536
- uo,
1449
+ }, [e.viewport, e.isPositioned]), n ? /* @__PURE__ */ p(
1450
+ tt,
2537
1451
  {
2538
- ...e,
2539
- ref: i,
1452
+ ...o,
1453
+ ref: c,
2540
1454
  onAutoScroll: () => {
2541
- const { viewport: a, selectedItem: c } = t;
2542
- a && c && (a.scrollTop -= c.offsetHeight);
1455
+ const { viewport: l, selectedItem: a } = e;
1456
+ l && a && (l.scrollTop -= a.offsetHeight);
2543
1457
  }
2544
1458
  }
2545
1459
  ) : null;
2546
1460
  }
2547
1461
  );
2548
- co.displayName = Mt;
2549
- const Dt = "SelectScrollDownButton", lo = l.forwardRef(
2550
- (e, o) => {
2551
- const t = ve(Dt, e.__scopeSelect), n = to(Dt, e.__scopeSelect), [r, s] = l.useState(!1), i = z(o, n.onScrollButtonChange);
2552
- return te(() => {
2553
- if (t.viewport && t.isPositioned) {
2554
- const a = t.viewport, c = () => {
2555
- const d = a.scrollHeight - a.clientHeight, y = Math.ceil(a.scrollTop) < d;
2556
- s(y);
1462
+ Qe.displayName = _e;
1463
+ const Me = "SelectScrollDownButton", et = s.forwardRef(
1464
+ (o, i) => {
1465
+ const e = oe(Me, o.__scopeSelect), t = Ge(Me, o.__scopeSelect), [n, r] = s.useState(!1), c = A(i, t.onScrollButtonChange);
1466
+ return $(() => {
1467
+ if (e.viewport && e.isPositioned) {
1468
+ const l = e.viewport, a = () => {
1469
+ const h = l.scrollHeight - l.clientHeight, C = Math.ceil(l.scrollTop) < h;
1470
+ r(C);
2557
1471
  };
2558
- return c(), a.addEventListener("scroll", c), () => a.removeEventListener("scroll", c);
1472
+ return a(), l.addEventListener("scroll", a), () => l.removeEventListener("scroll", a);
2559
1473
  }
2560
- }, [t.viewport, t.isPositioned]), r ? /* @__PURE__ */ b(
2561
- uo,
1474
+ }, [e.viewport, e.isPositioned]), n ? /* @__PURE__ */ p(
1475
+ tt,
2562
1476
  {
2563
- ...e,
2564
- ref: i,
1477
+ ...o,
1478
+ ref: c,
2565
1479
  onAutoScroll: () => {
2566
- const { viewport: a, selectedItem: c } = t;
2567
- a && c && (a.scrollTop += c.offsetHeight);
1480
+ const { viewport: l, selectedItem: a } = e;
1481
+ l && a && (l.scrollTop += a.offsetHeight);
2568
1482
  }
2569
1483
  }
2570
1484
  ) : null;
2571
1485
  }
2572
1486
  );
2573
- lo.displayName = Dt;
2574
- const uo = l.forwardRef(
2575
- (e, o) => {
2576
- const { __scopeSelect: t, onAutoScroll: n, ...r } = e, s = ve("SelectScrollButton", t), i = l.useRef(null), a = Ge(t), c = l.useCallback(() => {
2577
- i.current !== null && (window.clearInterval(i.current), i.current = null);
1487
+ et.displayName = Me;
1488
+ const tt = s.forwardRef(
1489
+ (o, i) => {
1490
+ const { __scopeSelect: e, onAutoScroll: t, ...n } = o, r = oe("SelectScrollButton", e), c = s.useRef(null), l = ve(e), a = s.useCallback(() => {
1491
+ c.current !== null && (window.clearInterval(c.current), c.current = null);
2578
1492
  }, []);
2579
- return l.useEffect(() => () => c(), [c]), te(() => {
2580
- var y;
2581
- const d = a().find((g) => g.ref.current === document.activeElement);
2582
- (y = d == null ? void 0 : d.ref.current) == null || y.scrollIntoView({ block: "nearest" });
2583
- }, [a]), /* @__PURE__ */ b(
2584
- F.div,
1493
+ return s.useEffect(() => () => a(), [a]), $(() => {
1494
+ var C;
1495
+ const h = l().find((v) => v.ref.current === document.activeElement);
1496
+ (C = h == null ? void 0 : h.ref.current) == null || C.scrollIntoView({ block: "nearest" });
1497
+ }, [l]), /* @__PURE__ */ p(
1498
+ N.div,
2585
1499
  {
2586
1500
  "aria-hidden": !0,
2587
- ...r,
2588
- ref: o,
2589
- style: { flexShrink: 0, ...r.style },
2590
- onPointerMove: M(r.onPointerMove, () => {
2591
- var d;
2592
- (d = s.onItemLeave) == null || d.call(s), i.current === null && (i.current = window.setInterval(n, 50));
1501
+ ...n,
1502
+ ref: i,
1503
+ style: { flexShrink: 0, ...n.style },
1504
+ onPointerMove: E(n.onPointerMove, () => {
1505
+ var h;
1506
+ (h = r.onItemLeave) == null || h.call(r), c.current === null && (c.current = window.setInterval(t, 50));
2593
1507
  }),
2594
- onPointerLeave: M(r.onPointerLeave, () => {
2595
- c();
1508
+ onPointerLeave: E(n.onPointerLeave, () => {
1509
+ a();
2596
1510
  })
2597
1511
  }
2598
1512
  );
2599
1513
  }
2600
1514
  );
2601
- uo.displayName = "SelectScrollButtonImpl";
2602
- const Zs = "SelectSeparator", po = l.forwardRef(
2603
- (e, o) => {
2604
- const { __scopeSelect: t, ...n } = e;
2605
- return /* @__PURE__ */ b(F.div, { "aria-hidden": !0, ...n, ref: o });
1515
+ tt.displayName = "SelectScrollButtonImpl";
1516
+ const Uo = "SelectSeparator", ot = s.forwardRef(
1517
+ (o, i) => {
1518
+ const { __scopeSelect: e, ...t } = o;
1519
+ return /* @__PURE__ */ p(N.div, { "aria-hidden": !0, ...t, ref: i });
2606
1520
  }
2607
1521
  );
2608
- po.displayName = Zs;
2609
- const Ft = "SelectArrow", fo = l.forwardRef(
2610
- (e, o) => {
2611
- const { __scopeSelect: t, ...n } = e, r = yt(t), s = ge(Ft, t), i = ve(Ft, t);
2612
- return s.open && i.position === "popper" ? /* @__PURE__ */ b(Pe.Arrow, { ...r, ...n, ref: o }) : null;
1522
+ ot.displayName = Uo;
1523
+ const Oe = "SelectArrow", nt = s.forwardRef(
1524
+ (o, i) => {
1525
+ const { __scopeSelect: e, ...t } = o, n = Ve(e), r = X(Oe, e), c = oe(Oe, e);
1526
+ return r.open && c.position === "popper" ? /* @__PURE__ */ p(ie.Arrow, { ...n, ...t, ref: i }) : null;
2613
1527
  }
2614
1528
  );
2615
- fo.displayName = Ft;
2616
- const Js = "BubbleSelect", Qs = l.forwardRef(
2617
- (e, o) => {
2618
- const { value: t, ...n } = e, r = l.useRef(null), s = z(o, r), i = Qn(t), a = ge(Js, void 0);
2619
- l.useEffect(() => {
2620
- const d = r.current, y = window.HTMLSelectElement.prototype, h = Object.getOwnPropertyDescriptor(y, "value").set;
2621
- if (i !== t && h) {
1529
+ nt.displayName = Oe;
1530
+ const Ho = "BubbleSelect", zo = s.forwardRef(
1531
+ (o, i) => {
1532
+ const { value: e, ...t } = o, n = s.useRef(null), r = A(i, n), c = Xt(e), l = X(Ho, void 0);
1533
+ s.useEffect(() => {
1534
+ const h = n.current, C = window.HTMLSelectElement.prototype, x = Object.getOwnPropertyDescriptor(C, "value").set;
1535
+ if (c !== e && x) {
2622
1536
  const u = new Event("change", { bubbles: !0 });
2623
- h.call(d, t), d.dispatchEvent(u);
1537
+ x.call(h, e), h.dispatchEvent(u);
2624
1538
  }
2625
- }, [i, t]);
2626
- let c = t;
2627
- return a.multi && !Array.isArray(t) && (c = []), /* @__PURE__ */ b(er, { asChild: !0, children: /* @__PURE__ */ b(
1539
+ }, [c, e]);
1540
+ let a = e;
1541
+ return l.multi && !Array.isArray(e) && (a = []), /* @__PURE__ */ p(Zt, { asChild: !0, children: /* @__PURE__ */ p(
2628
1542
  "select",
2629
1543
  {
2630
- ...n,
2631
- multiple: a.multi ? !0 : void 0,
2632
- ref: s,
2633
- defaultValue: c
1544
+ ...t,
1545
+ multiple: l.multi ? !0 : void 0,
1546
+ ref: r,
1547
+ defaultValue: a
2634
1548
  }
2635
1549
  ) });
2636
1550
  }
2637
1551
  );
2638
- Qs.displayName = "BubbleSelect";
2639
- function Un(e) {
2640
- const o = ks(e), t = l.useRef(""), n = l.useRef(0), r = l.useCallback(
2641
- (i) => {
2642
- const a = t.current + i;
2643
- o(a), function c(d) {
2644
- t.current = d, window.clearTimeout(n.current), d !== "" && (n.current = window.setTimeout(() => c(""), 1e3));
2645
- }(a);
1552
+ zo.displayName = "BubbleSelect";
1553
+ function Wt(o) {
1554
+ const i = Io(o), e = s.useRef(""), t = s.useRef(0), n = s.useCallback(
1555
+ (c) => {
1556
+ const l = e.current + c;
1557
+ i(l), function a(h) {
1558
+ e.current = h, window.clearTimeout(t.current), h !== "" && (t.current = window.setTimeout(() => a(""), 1e3));
1559
+ }(l);
2646
1560
  },
2647
- [o]
2648
- ), s = l.useCallback(() => {
2649
- t.current = "", window.clearTimeout(n.current);
1561
+ [i]
1562
+ ), r = s.useCallback(() => {
1563
+ e.current = "", window.clearTimeout(t.current);
2650
1564
  }, []);
2651
- return l.useEffect(() => () => window.clearTimeout(n.current), []), [t, r, s];
2652
- }
2653
- function Wn(e, o, t) {
2654
- const r = o.length > 1 && Array.from(o).every((d) => d === o[0]) ? o[0] : o, s = t ? e.indexOf(t) : -1;
2655
- let i = ei(e, Math.max(s, 0));
2656
- r.length === 1 && (i = i.filter((d) => d !== t));
2657
- const c = i.find((d) => d.textValue.toLowerCase().startsWith(r.toLowerCase()));
2658
- return c !== t ? c : void 0;
2659
- }
2660
- function ei(e, o) {
2661
- return e.map((t, n) => e[(o + n) % e.length]);
2662
- }
2663
- const Kn = (e, o = []) => {
2664
- if (Array.isArray(e))
2665
- return e.reduce((n, r) => Kn(r, n), o);
2666
- const t = o.indexOf(e);
2667
- return t === -1 ? [...o, e] : [...o.slice(0, t), ...o.slice(t + 1)];
2668
- }, ti = qt, oi = Xt, ni = Zt, ri = Jt, si = Qt, ii = eo, ai = oo, ci = no, li = ro, ui = so, di = io, pi = ao, fi = co, hi = lo, mi = po, gi = fo, zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1565
+ return s.useEffect(() => () => window.clearTimeout(t.current), []), [e, n, r];
1566
+ }
1567
+ function Kt(o, i, e) {
1568
+ const n = i.length > 1 && Array.from(i).every((h) => h === i[0]) ? i[0] : i, r = e ? o.indexOf(e) : -1;
1569
+ let c = Wo(o, Math.max(r, 0));
1570
+ n.length === 1 && (c = c.filter((h) => h !== e));
1571
+ const a = c.find((h) => h.textValue.toLowerCase().startsWith(n.toLowerCase()));
1572
+ return a !== e ? a : void 0;
1573
+ }
1574
+ function Wo(o, i) {
1575
+ return o.map((e, t) => o[(i + t) % o.length]);
1576
+ }
1577
+ const Gt = (o, i = []) => {
1578
+ if (Array.isArray(o))
1579
+ return o.reduce((t, n) => Gt(n, t), i);
1580
+ const e = i.indexOf(o);
1581
+ return e === -1 ? [...i, o] : [...i.slice(0, e), ...i.slice(e + 1)];
1582
+ }, Ko = $e, Go = Ue, jo = He, Yo = ze, qo = We, Xo = Ke, Zo = je, Jo = Ye, Qo = qe, en = Xe, tn = Ze, on = Je, nn = Qe, rn = et, ln = ot, sn = nt, An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2669
1583
  __proto__: null,
2670
- Arrow: gi,
2671
- Content: ii,
2672
- Group: ci,
2673
- Icon: ri,
2674
- Item: ui,
2675
- ItemIndicator: pi,
2676
- ItemText: di,
2677
- Label: li,
2678
- Portal: si,
2679
- Root: ti,
2680
- ScrollDownButton: hi,
2681
- ScrollUpButton: fi,
2682
- Select: qt,
2683
- SelectArrow: fo,
2684
- SelectContent: eo,
2685
- SelectGroup: no,
2686
- SelectIcon: Jt,
2687
- SelectItem: so,
2688
- SelectItemIndicator: ao,
2689
- SelectItemText: io,
2690
- SelectLabel: ro,
2691
- SelectPortal: Qt,
2692
- SelectScrollDownButton: lo,
2693
- SelectScrollUpButton: co,
2694
- SelectSeparator: po,
2695
- SelectTrigger: Xt,
2696
- SelectValue: Zt,
2697
- SelectViewport: oo,
2698
- Separator: mi,
2699
- Trigger: oi,
2700
- Value: ni,
2701
- Viewport: ai,
2702
- createSelectScope: Fs
1584
+ Arrow: sn,
1585
+ Content: Xo,
1586
+ Group: Jo,
1587
+ Icon: Yo,
1588
+ Item: en,
1589
+ ItemIndicator: on,
1590
+ ItemText: tn,
1591
+ Label: Qo,
1592
+ Portal: qo,
1593
+ Root: Ko,
1594
+ ScrollDownButton: rn,
1595
+ ScrollUpButton: nn,
1596
+ Select: $e,
1597
+ SelectArrow: nt,
1598
+ SelectContent: Ke,
1599
+ SelectGroup: Ye,
1600
+ SelectIcon: ze,
1601
+ SelectItem: Xe,
1602
+ SelectItemIndicator: Je,
1603
+ SelectItemText: Ze,
1604
+ SelectLabel: qe,
1605
+ SelectPortal: We,
1606
+ SelectScrollDownButton: et,
1607
+ SelectScrollUpButton: Qe,
1608
+ SelectSeparator: ot,
1609
+ SelectTrigger: Ue,
1610
+ SelectValue: He,
1611
+ SelectViewport: je,
1612
+ Separator: ln,
1613
+ Trigger: Go,
1614
+ Value: jo,
1615
+ Viewport: Zo,
1616
+ createSelectScope: Eo
2703
1617
  }, Symbol.toStringTag, { value: "Module" }));
2704
- function ji(e, o, { checkForDefaultPrevented: t = !0 } = {}) {
2705
- return function(r) {
2706
- if (e == null || e(r), t === !1 || !r.defaultPrevented)
2707
- return o == null ? void 0 : o(r);
1618
+ function _n(o, i, { checkForDefaultPrevented: e = !0 } = {}) {
1619
+ return function(n) {
1620
+ if (o == null || o(n), e === !1 || !n.defaultPrevented)
1621
+ return i == null ? void 0 : i(n);
2708
1622
  };
2709
1623
  }
2710
1624
  export {
2711
- Bi as Combobox,
2712
- zi as Select,
2713
- ji as composeEventHandlers,
2714
- tr as createCollection,
2715
- ks as useCallbackRef,
2716
- or as useCollator,
2717
- Lt as useFilter,
2718
- nr as usePrev
1625
+ Rn as Combobox,
1626
+ An as Select,
1627
+ _n as composeEventHandlers,
1628
+ Jt as createCollection,
1629
+ Io as useCallbackRef,
1630
+ Qt as useCollator,
1631
+ De as useFilter,
1632
+ eo as usePrev
2719
1633
  };