@wrdagency/blockout 0.0.19 → 0.1.1

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 (166) hide show
  1. package/dist/2NBKRL7C-BAzCMGOw.js +85 -0
  2. package/dist/2RSXSRCN-qt84MtKs.js +61 -0
  3. package/dist/4CMBR7SL-BAGv8IL2.js +308 -0
  4. package/dist/5JTVDSTH-CG1NL6Fw.js +174 -0
  5. package/dist/5VQZOHHZ-CscZGerP.js +59 -0
  6. package/dist/6VRAQV3D-2rb_aClP.js +201 -0
  7. package/dist/7PRQYBBV-91wrWGjk.js +17 -0
  8. package/dist/ArrowRight.es-xyNbtVOa.js +60 -0
  9. package/dist/DG5U6ZEL-CVj-Czp2.js +17 -0
  10. package/dist/F5MUBM3I-87B2_4WK.js +54 -0
  11. package/dist/LMDWO4NN--KEvZePp.js +610 -0
  12. package/dist/MTZPJQMC-DyCWBG18.js +14 -0
  13. package/dist/P7GR5CS5-BoOYUfSQ.js +19 -0
  14. package/dist/PFRGBC2K-BEg8ahbY.js +303 -0
  15. package/dist/RS7LB2H4-D0fWv5qu.js +15 -0
  16. package/dist/RZ4GPYOB-13-5LlEb.js +37 -0
  17. package/dist/S43UC3DV-Dn8EFLaT.js +22 -0
  18. package/dist/Square.es-KJLdY11q.js +72 -0
  19. package/dist/T7VMP3TM-DeRMoW8g.js +77 -0
  20. package/dist/TP7N7UIH-BHb1rEeb.js +34 -0
  21. package/dist/UQQRIHDV-Bu8e1bYU.js +69 -0
  22. package/dist/UYGDZTLQ-DcCmv5SE.js +12 -0
  23. package/dist/VIIRIBF3-D5DmZNtI.js +26 -0
  24. package/dist/WMYDSCNQ-Dy1O-Kdl.js +2405 -0
  25. package/dist/WYCIER3C-DRn904Gy.js +175 -0
  26. package/dist/YV4JVR4I-kvospPUa.js +351 -0
  27. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  28. package/dist/assets/button.css +1 -1
  29. package/dist/assets/index.css +1 -1
  30. package/dist/assets/index10.css +1 -1
  31. package/dist/assets/index11.css +1 -1
  32. package/dist/assets/index12.css +1 -1
  33. package/dist/assets/index13.css +1 -1
  34. package/dist/assets/index14.css +1 -0
  35. package/dist/assets/index15.css +1 -0
  36. package/dist/assets/index16.css +1 -0
  37. package/dist/assets/index17.css +1 -0
  38. package/dist/assets/index18.css +1 -0
  39. package/dist/assets/index2.css +1 -1
  40. package/dist/assets/index3.css +1 -1
  41. package/dist/assets/index4.css +1 -1
  42. package/dist/assets/index5.css +1 -1
  43. package/dist/assets/index6.css +1 -1
  44. package/dist/assets/index7.css +1 -1
  45. package/dist/assets/index8.css +1 -1
  46. package/dist/assets/index9.css +1 -1
  47. package/dist/assets/style.css +1 -1
  48. package/dist/assets/style2.css +1 -0
  49. package/dist/assets/style3.css +1 -0
  50. package/dist/assets/style4.css +1 -0
  51. package/dist/assets/styles.css +1 -1
  52. package/dist/components/block-editor/editor.d.ts +5 -0
  53. package/dist/components/block-editor/editor.js +6 -0
  54. package/dist/components/block-editor/index.d.ts +1 -0
  55. package/dist/components/block-editor/index.js +4 -0
  56. package/dist/components/breadcrumbs/index.js +87 -31
  57. package/dist/components/button/button.d.ts +1 -1
  58. package/dist/components/button/button.js +5 -5
  59. package/dist/components/button/icon.d.ts +1 -2
  60. package/dist/components/button/icon.js +10 -3
  61. package/dist/components/button/index.d.ts +4 -0
  62. package/dist/components/controls/base-control/affix.js +7 -7
  63. package/dist/components/controls/base-control/index.js +11 -11
  64. package/dist/components/controls/base-popover-control/index.d.ts +9 -0
  65. package/dist/components/controls/base-popover-control/index.js +47 -0
  66. package/dist/components/controls/checkbox-control/index.d.ts +8 -0
  67. package/dist/components/controls/checkbox-control/index.js +57 -0
  68. package/dist/components/controls/choice-control/choice.js +13 -11
  69. package/dist/components/controls/choice-control/index.js +1 -1
  70. package/dist/components/controls/index.d.ts +4 -1
  71. package/dist/components/controls/index.js +25 -16
  72. package/dist/components/controls/number-control/index.js +29 -27
  73. package/dist/components/controls/password-control/index.js +1 -1
  74. package/dist/components/controls/recurrence-control/index.d.ts +8 -0
  75. package/dist/components/controls/recurrence-control/index.js +208 -0
  76. package/dist/components/controls/select-control/component.d.ts +12 -0
  77. package/dist/components/controls/select-control/component.js +1879 -0
  78. package/dist/components/controls/select-control/index.d.ts +2 -12
  79. package/dist/components/controls/select-control/index.js +5 -1860
  80. package/dist/components/controls/select-control/options.d.ts +7 -0
  81. package/dist/components/controls/select-control/options.js +9 -0
  82. package/dist/components/controls/textarea-control/index.js +1 -1
  83. package/dist/components/controls/toggle-control/index.js +11 -9
  84. package/dist/components/controls/toggle-group-control/index.d.ts +19 -0
  85. package/dist/components/controls/toggle-group-control/index.js +50 -0
  86. package/dist/components/data-table/column.js +1 -1
  87. package/dist/components/data-table/header.js +120 -171
  88. package/dist/components/data-table/index.js +1 -1
  89. package/dist/components/filesystem/file.d.ts +7 -0
  90. package/dist/components/filesystem/file.js +44 -0
  91. package/dist/components/filesystem/folder.d.ts +6 -0
  92. package/dist/components/filesystem/folder.js +160 -0
  93. package/dist/components/filesystem/icon.d.ts +7 -0
  94. package/dist/components/filesystem/icon.js +908 -0
  95. package/dist/components/filesystem/index.js +14 -0
  96. package/dist/components/filesystem/list.d.ts +4 -0
  97. package/dist/components/filesystem/list.js +18 -0
  98. package/dist/components/filesystem/root.d.ts +3 -0
  99. package/dist/components/filesystem/root.js +7 -0
  100. package/dist/components/form/components/index.js +12 -12
  101. package/dist/components/form/components/pagination.js +23 -16
  102. package/dist/components/form/components/progress.d.ts +3 -2
  103. package/dist/components/index.d.ts +4 -0
  104. package/dist/components/index.js +48 -31
  105. package/dist/components/menu/index.js +24 -23
  106. package/dist/components/menu/item.js +1 -1
  107. package/dist/components/menu/items/action.js +1 -1
  108. package/dist/components/menu/items/spacer.js +14 -42
  109. package/dist/components/menu/items/submenu.js +2 -2
  110. package/dist/components/menu/items/toggle.js +25 -91
  111. package/dist/components/progress/index.d.ts +5 -3
  112. package/dist/components/progress/index.js +44 -27
  113. package/dist/components/tabs/index.js +12 -0
  114. package/dist/components/tabs/list.d.ts +7 -0
  115. package/dist/components/tabs/list.js +42 -0
  116. package/dist/components/tabs/panel.d.ts +8 -0
  117. package/dist/components/tabs/panel.js +132 -0
  118. package/dist/components/tabs/root.d.ts +9 -0
  119. package/dist/components/tabs/root.js +173 -0
  120. package/dist/components/tabs/tab.d.ts +7 -0
  121. package/dist/components/tabs/tab.js +81 -0
  122. package/dist/components/toolbar/index.js +27 -0
  123. package/dist/components/toolbar/root.d.ts +6 -0
  124. package/dist/components/toolbar/root.js +6 -0
  125. package/dist/composite-provider-DNftbE5U.js +10 -0
  126. package/dist/hooks/state.d.ts +4 -0
  127. package/dist/hooks/state.js +7 -0
  128. package/dist/hooks/theme.js +7 -38
  129. package/dist/index-1AjPIqTN.js +73 -0
  130. package/dist/index-Cgx3BqdJ.js +388 -0
  131. package/dist/index.js +61 -40
  132. package/dist/{item-D9r2-3fk.js → item-B1ugJ7YQ.js} +240 -234
  133. package/dist/options-Cfoqhxw2.js +96 -0
  134. package/dist/primitives/index.d.ts +2 -0
  135. package/dist/primitives/index.js +4 -0
  136. package/dist/primitives/resizable/index.js +1 -1
  137. package/dist/primitives/scroll-area/index.d.ts +7 -0
  138. package/dist/primitives/scroll-area/index.js +777 -0
  139. package/dist/primitives/truncate/index.d.ts +7 -0
  140. package/dist/primitives/truncate/index.js +46 -0
  141. package/dist/primitives/visually-hidden/index.d.ts +2 -2
  142. package/dist/primitives/visually-hidden/index.js +13 -3
  143. package/dist/root-CaKPdqzv.js +73 -0
  144. package/dist/types/date.d.ts +39 -0
  145. package/dist/types/date.js +1778 -0
  146. package/dist/types/options.d.ts +8 -6
  147. package/dist/utils/components.d.ts +5 -0
  148. package/dist/utils/components.js +14 -0
  149. package/dist/utils/date.d.ts +1 -0
  150. package/dist/utils/date.js +15 -0
  151. package/dist/utils/string.d.ts +4 -0
  152. package/dist/utils/string.js +18 -0
  153. package/package.json +4 -2
  154. package/dist/2NBKRL7C-D-Q0qGRV.js +0 -81
  155. package/dist/P7GR5CS5-qyeuZVEs.js +0 -640
  156. package/dist/T7VMP3TM-BxgFbvdx.js +0 -2106
  157. package/dist/UQQRIHDV-BGs025hb.js +0 -1046
  158. package/dist/VIIRIBF3-D9clDhln.js +0 -21
  159. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  160. package/dist/components/markdown/formats.d.ts +0 -11
  161. package/dist/components/markdown/formats.js +0 -318
  162. package/dist/components/markdown/index.d.ts +0 -7
  163. package/dist/components/markdown/index.js +0 -25845
  164. package/dist/components/markdown/types/format.d.ts +0 -27
  165. package/dist/components/markdown/types/format.js +0 -4
  166. package/dist/floating-ui.dom-9sqP7IwC.js +0 -1512
@@ -0,0 +1,1879 @@
1
+ import { jsx as w, jsxs as te, Fragment as Ue } from "react/jsx-runtime";
2
+ import { normalizeOption as Ft } from "../../../types/options.js";
3
+ import { noop as Bt } from "../../../utils/noop.js";
4
+ import { e as jt } from "../../../CaretDown.es-eySGHzTJ.js";
5
+ import * as M from "react";
6
+ import { useMemo as Ce, useState as de, useRef as se, useEffect as ae, useCallback as Qe, useContext as we, createContext as _e, startTransition as Wt } from "react";
7
+ import { w as Zt } from "../../../SSRBase.es-BUXS72ra.js";
8
+ import { g as $t } from "../../../_commonjsHelpers-C6fGbg64.js";
9
+ import { BaseControl as qt } from "../base-control/index.js";
10
+ import { useBaseControlProps as Yt } from "../base-control/props.js";
11
+ import { C as zt, a as Qt } from "../../../P7GR5CS5-BoOYUfSQ.js";
12
+ import { a as ne, _ as oe, i as me, m as R, o as y, v as Xe, f as re, q as le, $ as Ge, Y as ue, X as D, U as Z, Z as ke, j as L, e as Q, H as Je, l as he, n as ye, ab as et, r as tt, s as Ae, t as Xt, P as nt, Q as ot, R as Gt, h as Jt, u as en, ac as rt, c as tn, a0 as nn, A as on, ad as rn, ae as ln, af as sn, x as Fe, ag as Ie, a6 as an, B as un, b as Ve, a9 as cn, W as dn, K as mn, k as fn } from "../../../LMDWO4NN--KEvZePp.js";
13
+ import { c as lt, b as st, f as vn, e as pn, d as bn, g as hn } from "../../../WMYDSCNQ-Dy1O-Kdl.js";
14
+ import { c as at, d as ut, b as it } from "../../../4CMBR7SL-BAGv8IL2.js";
15
+ import { m as ct, o as Sn, t as dt, c as mt, s as X, b as G, g as ft, e as vt, f as be, u as pt, a as gn, p as Cn } from "../../../YV4JVR4I-kvospPUa.js";
16
+ import { a as bt, C as En, b as ht, c as On, d as yn, e as St, u as An, f as xn } from "../../../S43UC3DV-Dn8EFLaT.js";
17
+ import { t as gt } from "../../../7PRQYBBV-91wrWGjk.js";
18
+ import { u as Me, a as De, S as Ct, b as In, c as wn, d as Vn, e as Be } from "../../../DG5U6ZEL-CVj-Czp2.js";
19
+ import { u as Pn } from "../../../MTZPJQMC-DyCWBG18.js";
20
+ import { u as Et } from "../../../T7VMP3TM-DeRMoW8g.js";
21
+ import { i as Ot } from "../../../WYCIER3C-DRn904Gy.js";
22
+ import { u as yt } from "../../../5JTVDSTH-CG1NL6Fw.js";
23
+ import { h as Pe } from "../../../PFRGBC2K-BEg8ahbY.js";
24
+ import { u as At } from "../../../UQQRIHDV-Bu8e1bYU.js";
25
+ import { u as xt } from "../../../6VRAQV3D-2rb_aClP.js";
26
+ var _n = "span", kn = {
27
+ top: "4,10 8,6 12,10",
28
+ right: "6,4 10,8 6,12",
29
+ bottom: "4,6 8,10 12,6",
30
+ left: "10,4 6,8 10,12"
31
+ }, It = ne(function(n) {
32
+ var o = n, { store: e, placement: r } = o, l = oe(o, ["store", "placement"]);
33
+ const a = Pn();
34
+ e = e || a, me(
35
+ e,
36
+ process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
37
+ );
38
+ const f = e.useState((s) => r || s.placement).split("-")[0], d = kn[f], u = Ce(
39
+ () => /* @__PURE__ */ w(
40
+ "svg",
41
+ {
42
+ display: "block",
43
+ fill: "none",
44
+ stroke: "currentColor",
45
+ strokeLinecap: "round",
46
+ strokeLinejoin: "round",
47
+ strokeWidth: 1.5,
48
+ viewBox: "0 0 16 16",
49
+ height: "1em",
50
+ width: "1em",
51
+ children: /* @__PURE__ */ w("polyline", { points: d })
52
+ }
53
+ ),
54
+ [d]
55
+ );
56
+ return l = R(y({
57
+ children: u,
58
+ "aria-hidden": !0
59
+ }, l), {
60
+ style: y({
61
+ width: "1em",
62
+ height: "1em",
63
+ pointerEvents: "none"
64
+ }, l.style)
65
+ }), Xe(l);
66
+ });
67
+ re(
68
+ function(n) {
69
+ const o = It(n);
70
+ return le(_n, o);
71
+ }
72
+ );
73
+ function Mn(t = {}) {
74
+ var n = t, {
75
+ combobox: o
76
+ } = n, e = Ge(n, [
77
+ "combobox"
78
+ ]);
79
+ const r = ct(
80
+ e.store,
81
+ Sn(o, [
82
+ "value",
83
+ "items",
84
+ "renderedItems",
85
+ "baseElement",
86
+ "arrowElement",
87
+ "anchorElement",
88
+ "contentElement",
89
+ "popoverElement",
90
+ "disclosureElement"
91
+ ])
92
+ );
93
+ dt(e, r);
94
+ const l = r.getState(), a = at(ue(Z({}, e), {
95
+ store: r,
96
+ virtualFocus: D(
97
+ e.virtualFocus,
98
+ l.virtualFocus,
99
+ !0
100
+ ),
101
+ includesBaseElement: D(
102
+ e.includesBaseElement,
103
+ l.includesBaseElement,
104
+ !1
105
+ ),
106
+ activeId: D(
107
+ e.activeId,
108
+ l.activeId,
109
+ e.defaultActiveId,
110
+ null
111
+ ),
112
+ orientation: D(
113
+ e.orientation,
114
+ l.orientation,
115
+ "vertical"
116
+ )
117
+ })), m = lt(ue(Z({}, e), {
118
+ store: r,
119
+ placement: D(
120
+ e.placement,
121
+ l.placement,
122
+ "bottom-start"
123
+ )
124
+ })), f = new String(""), d = ue(Z(Z({}, a.getState()), m.getState()), {
125
+ value: D(
126
+ e.value,
127
+ l.value,
128
+ e.defaultValue,
129
+ f
130
+ ),
131
+ setValueOnMove: D(
132
+ e.setValueOnMove,
133
+ l.setValueOnMove,
134
+ !1
135
+ ),
136
+ labelElement: D(l.labelElement, null),
137
+ selectElement: D(l.selectElement, null),
138
+ listElement: D(l.listElement, null)
139
+ }), u = mt(d, a, m, r);
140
+ return X(
141
+ u,
142
+ () => G(u, ["value", "items"], (s) => {
143
+ if (s.value !== f || !s.items.length) return;
144
+ const v = s.items.find(
145
+ (g) => !g.disabled && g.value != null
146
+ );
147
+ (v == null ? void 0 : v.value) != null && u.setState("value", v.value);
148
+ })
149
+ ), X(
150
+ u,
151
+ () => G(u, ["mounted"], (s) => {
152
+ s.mounted || u.setState("activeId", d.activeId);
153
+ })
154
+ ), X(
155
+ u,
156
+ () => G(u, ["mounted", "items", "value"], (s) => {
157
+ if (o || s.mounted) return;
158
+ const v = gt(s.value), g = v[v.length - 1];
159
+ if (g == null) return;
160
+ const c = s.items.find(
161
+ (p) => !p.disabled && p.value === g
162
+ );
163
+ c && u.setState("activeId", c.id);
164
+ })
165
+ ), X(
166
+ u,
167
+ () => ft(u, ["setValueOnMove", "moves"], (s) => {
168
+ const { mounted: v, value: g, activeId: c } = u.getState();
169
+ if (!s.setValueOnMove && v || Array.isArray(g) || !s.moves || !c) return;
170
+ const p = a.item(c);
171
+ !p || p.disabled || p.value == null || u.setState("value", p.value);
172
+ })
173
+ ), ue(Z(Z(Z({}, a), m), u), {
174
+ combobox: o,
175
+ setValue: (s) => u.setState("value", s),
176
+ setLabelElement: (s) => u.setState("labelElement", s),
177
+ setSelectElement: (s) => u.setState("selectElement", s),
178
+ setListElement: (s) => u.setState("listElement", s)
179
+ });
180
+ }
181
+ function Dn(t) {
182
+ const n = bt();
183
+ return t = R(y({}, t), {
184
+ combobox: t.combobox !== void 0 ? t.combobox : n
185
+ }), ut(t);
186
+ }
187
+ function Nn(t, n, o) {
188
+ return ke(n, [o.combobox]), be(t, o, "value", "setValue"), be(t, o, "setValueOnMove"), Object.assign(
189
+ st(
190
+ it(t, n, o),
191
+ n,
192
+ o
193
+ ),
194
+ { combobox: o.combobox }
195
+ );
196
+ }
197
+ function Tn(t = {}) {
198
+ t = Dn(t);
199
+ const [n, o] = vt(Mn, t);
200
+ return Nn(n, o, t);
201
+ }
202
+ var Ln = "span", Rn = ne(
203
+ function(n) {
204
+ var o = n, { store: e } = o, r = oe(o, ["store"]);
205
+ const l = Me();
206
+ return e = e || l, r = It(y({ store: e }, r)), r;
207
+ }
208
+ ), Kn = re(function(n) {
209
+ const o = Rn(n);
210
+ return le(Ln, o);
211
+ }), Hn = "button";
212
+ function Un(t) {
213
+ return Array.from(t.selectedOptions).map((n) => n.value);
214
+ }
215
+ function Oe(t, n) {
216
+ return () => {
217
+ const o = n();
218
+ if (!o) return;
219
+ let e = 0, r = t.item(o);
220
+ const l = r;
221
+ for (; r && r.value == null; ) {
222
+ const a = n(++e);
223
+ if (!a) return;
224
+ if (r = t.item(a), r === l) break;
225
+ }
226
+ return r == null ? void 0 : r.id;
227
+ };
228
+ }
229
+ var Fn = ne(function(n) {
230
+ var o = n, {
231
+ store: e,
232
+ name: r,
233
+ form: l,
234
+ required: a,
235
+ showOnKeyDown: m = !0,
236
+ moveOnKeyDown: f = !0,
237
+ toggleOnPress: d = !0,
238
+ toggleOnClick: u = d
239
+ } = o, s = oe(o, [
240
+ "store",
241
+ "name",
242
+ "form",
243
+ "required",
244
+ "showOnKeyDown",
245
+ "moveOnKeyDown",
246
+ "toggleOnPress",
247
+ "toggleOnClick"
248
+ ]);
249
+ const v = De();
250
+ e = e || v, me(
251
+ e,
252
+ process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
253
+ );
254
+ const g = s.onKeyDown, c = L(m), p = L(f), A = e.useState("placement").split("-")[0], C = e.useState("value"), W = Array.isArray(C), K = Q((S) => {
255
+ var E;
256
+ if (g == null || g(S), S.defaultPrevented || !e) return;
257
+ const { orientation: q, items: Y, activeId: J } = e.getState(), fe = q !== "horizontal", ie = q !== "vertical", k = !!((E = Y.find((Ee) => !Ee.disabled && Ee.value != null)) != null && E.rowId), pe = {
258
+ ArrowUp: (k || fe) && Oe(e, e.up),
259
+ ArrowRight: (k || ie) && Oe(e, e.next),
260
+ ArrowDown: (k || fe) && Oe(e, e.down),
261
+ ArrowLeft: (k || ie) && Oe(e, e.previous)
262
+ }[S.key];
263
+ pe && p(S) && (S.preventDefault(), e.move(pe()));
264
+ const Se = A === "top" || A === "bottom";
265
+ ({
266
+ ArrowDown: Se,
267
+ ArrowUp: Se,
268
+ ArrowLeft: A === "left",
269
+ ArrowRight: A === "right"
270
+ })[S.key] && c(S) && (S.preventDefault(), e.move(J), Je(S.currentTarget, "keyup", e.show));
271
+ });
272
+ s = he(
273
+ s,
274
+ (S) => /* @__PURE__ */ w(Ct, { value: e, children: S }),
275
+ [e]
276
+ );
277
+ const [$, _] = de(!1), I = se(!1);
278
+ ae(() => {
279
+ const S = I.current;
280
+ I.current = !1, !S && _(!1);
281
+ }, [C]);
282
+ const U = e.useState((S) => {
283
+ var E;
284
+ return (E = S.labelElement) == null ? void 0 : E.id;
285
+ }), b = s["aria-label"], O = s["aria-labelledby"] || U, F = e.useState((S) => {
286
+ if (r)
287
+ return S.items;
288
+ }), B = Ce(() => [...new Set(F == null ? void 0 : F.map((S) => S.value).filter((S) => S != null))], [F]);
289
+ s = he(
290
+ s,
291
+ (S) => r ? /* @__PURE__ */ te(Ue, { children: [
292
+ /* @__PURE__ */ te(
293
+ "select",
294
+ {
295
+ style: {
296
+ border: 0,
297
+ clip: "rect(0 0 0 0)",
298
+ height: "1px",
299
+ margin: "-1px",
300
+ overflow: "hidden",
301
+ padding: 0,
302
+ position: "absolute",
303
+ whiteSpace: "nowrap",
304
+ width: "1px"
305
+ },
306
+ tabIndex: -1,
307
+ "aria-hidden": !0,
308
+ "aria-label": b,
309
+ "aria-labelledby": O,
310
+ name: r,
311
+ form: l,
312
+ required: a,
313
+ disabled: s.disabled,
314
+ value: C,
315
+ multiple: W,
316
+ onFocus: () => {
317
+ var E;
318
+ return (E = e == null ? void 0 : e.getState().selectElement) == null ? void 0 : E.focus();
319
+ },
320
+ onChange: (E) => {
321
+ I.current = !0, _(!0), e == null || e.setValue(
322
+ W ? Un(E.target) : E.target.value
323
+ );
324
+ },
325
+ children: [
326
+ gt(C).map((E) => E == null || B.includes(E) ? null : /* @__PURE__ */ w("option", { value: E, children: E }, E)),
327
+ B.map((E) => /* @__PURE__ */ w("option", { value: E, children: E }, E))
328
+ ]
329
+ }
330
+ ),
331
+ S
332
+ ] }) : S,
333
+ [
334
+ e,
335
+ b,
336
+ O,
337
+ r,
338
+ l,
339
+ a,
340
+ C,
341
+ W,
342
+ B,
343
+ s.disabled
344
+ ]
345
+ );
346
+ const h = /* @__PURE__ */ te(Ue, { children: [
347
+ C,
348
+ /* @__PURE__ */ w(Kn, {})
349
+ ] }), P = e.useState("contentElement");
350
+ return s = R(y({
351
+ role: "combobox",
352
+ "aria-autocomplete": "none",
353
+ "aria-labelledby": U,
354
+ "aria-haspopup": et(P, "listbox"),
355
+ "data-autofill": $ || void 0,
356
+ "data-name": r,
357
+ children: h
358
+ }, s), {
359
+ ref: ye(e.setSelectElement, s.ref),
360
+ onKeyDown: K
361
+ }), s = vn(y({ store: e, toggleOnClick: u }, s)), s = Et(y({ store: e }, s)), s;
362
+ }), Bn = re(function(n) {
363
+ const o = Fn(n);
364
+ return le(Hn, o);
365
+ });
366
+ function jn(t = {}) {
367
+ const n = Tn(t);
368
+ return /* @__PURE__ */ w(In, { value: n, children: t.children });
369
+ }
370
+ var Wn = "div";
371
+ function Zn(t, n) {
372
+ if (n != null)
373
+ return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
374
+ }
375
+ var $n = ne(
376
+ function(n) {
377
+ var o = n, {
378
+ store: e,
379
+ value: r,
380
+ getItem: l,
381
+ hideOnClick: a,
382
+ setValueOnClick: m = r != null,
383
+ preventScrollOnKeyDown: f = !0,
384
+ focusOnHover: d = !0
385
+ } = o, u = oe(o, [
386
+ "store",
387
+ "value",
388
+ "getItem",
389
+ "hideOnClick",
390
+ "setValueOnClick",
391
+ "preventScrollOnKeyDown",
392
+ "focusOnHover"
393
+ ]), s;
394
+ const v = wn();
395
+ e = e || v, me(
396
+ e,
397
+ process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
398
+ );
399
+ const g = Ae(u.id), c = Xt(u), { listElement: p, multiSelectable: V, selected: A, autoFocus: C } = pt(e, {
400
+ listElement: "listElement",
401
+ multiSelectable(b) {
402
+ return Array.isArray(b.value);
403
+ },
404
+ selected(b) {
405
+ return Zn(b.value, r);
406
+ },
407
+ autoFocus(b) {
408
+ return r == null || b.value == null || b.activeId !== g && (e != null && e.item(b.activeId)) ? !1 : Array.isArray(b.value) ? b.value[b.value.length - 1] === r : b.value === r;
409
+ }
410
+ }), W = Qe(
411
+ (b) => {
412
+ const O = R(y({}, b), {
413
+ value: c ? void 0 : r,
414
+ children: r
415
+ });
416
+ return l ? l(O) : O;
417
+ },
418
+ [c, r, l]
419
+ );
420
+ a = a ?? (r != null && !V);
421
+ const K = u.onClick, $ = L(m), _ = L(a), I = Q((b) => {
422
+ K == null || K(b), !b.defaultPrevented && (nt(b) || ot(b) || ($(b) && r != null && (e == null || e.setValue((O) => Array.isArray(O) ? O.includes(r) ? O.filter((F) => F !== r) : [...O, r] : r)), _(b) && (e == null || e.hide())));
423
+ });
424
+ u = he(
425
+ u,
426
+ (b) => /* @__PURE__ */ w(Vn.Provider, { value: A ?? !1, children: b }),
427
+ [A]
428
+ ), u = R(y({
429
+ id: g,
430
+ role: Gt(p),
431
+ "aria-selected": A,
432
+ children: r
433
+ }, u), {
434
+ autoFocus: (s = u.autoFocus) != null ? s : C,
435
+ onClick: I
436
+ }), u = xt(y({
437
+ store: e,
438
+ getItem: W,
439
+ preventScrollOnKeyDown: f
440
+ }, u));
441
+ const U = L(d);
442
+ return u = At(R(y({
443
+ store: e
444
+ }, u), {
445
+ // We have to disable focusOnHover when the popup is closed, otherwise
446
+ // the active item will change to null (the container) when the popup is
447
+ // closed by clicking on an item.
448
+ focusOnHover(b) {
449
+ if (!U(b)) return !1;
450
+ const O = e == null ? void 0 : e.getState();
451
+ return !!(O != null && O.open);
452
+ }
453
+ })), u;
454
+ }
455
+ ), qn = tt(
456
+ re(function(n) {
457
+ const o = $n(n);
458
+ return le(Wn, o);
459
+ })
460
+ ), Yn = "div", je = _e(null), wt = ne(
461
+ function(n) {
462
+ var o = n, {
463
+ store: e,
464
+ resetOnEscape: r = !0,
465
+ hideOnEnter: l = !0,
466
+ focusOnMove: a = !0,
467
+ composite: m,
468
+ alwaysVisible: f
469
+ } = o, d = oe(o, [
470
+ "store",
471
+ "resetOnEscape",
472
+ "hideOnEnter",
473
+ "focusOnMove",
474
+ "composite",
475
+ "alwaysVisible"
476
+ ]);
477
+ const u = Me();
478
+ e = e || u, me(
479
+ e,
480
+ process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
481
+ );
482
+ const s = Ae(d.id), v = e.useState("value"), g = Array.isArray(v), [c, p] = de(v), V = e.useState("mounted");
483
+ ae(() => {
484
+ V || p(v);
485
+ }, [V, v]), r = r && !g;
486
+ const A = d.onKeyDown, C = L(r), W = L(l), K = Q((k) => {
487
+ A == null || A(k), !k.defaultPrevented && (k.key === "Escape" && C(k) && (e == null || e.setValue(c)), (k.key === " " || k.key === "Enter") && Jt(k) && W(k) && (k.preventDefault(), e == null || e.hide()));
488
+ }), $ = we(Be), _ = de(), [I, U] = $ || _, b = Ce(
489
+ () => [I, U],
490
+ [I]
491
+ ), [O, F] = de(null), B = we(je);
492
+ ae(() => {
493
+ if (B)
494
+ return B(e), () => B(null);
495
+ }, [B, e]), d = he(
496
+ d,
497
+ (k) => /* @__PURE__ */ w(Ct, { value: e, children: /* @__PURE__ */ w(je.Provider, { value: F, children: /* @__PURE__ */ w(Be.Provider, { value: b, children: k }) }) }),
498
+ [e, b]
499
+ );
500
+ const h = !!e.combobox;
501
+ m = m ?? (!h && O !== e);
502
+ const [P, S] = en(
503
+ m ? e.setListElement : null
504
+ ), E = rt(P, "role", d.role), Y = (m || (E === "listbox" || E === "menu" || E === "tree" || E === "grid")) && g || void 0, J = Ot(V, d.hidden, f), fe = J ? R(y({}, d.style), { display: "none" }) : d.style;
505
+ m && (d = y({
506
+ role: "listbox",
507
+ "aria-multiselectable": Y
508
+ }, d));
509
+ const ie = e.useState(
510
+ (k) => {
511
+ var ve;
512
+ return I || ((ve = k.labelElement) == null ? void 0 : ve.id);
513
+ }
514
+ );
515
+ return d = R(y({
516
+ id: s,
517
+ "aria-labelledby": ie,
518
+ hidden: J
519
+ }, d), {
520
+ ref: ye(S, d.ref),
521
+ style: fe,
522
+ onKeyDown: K
523
+ }), d = yt(R(y({ store: e }, d), { composite: m })), d = Et(y({ store: e, typeahead: !h }, d)), d;
524
+ }
525
+ ), zn = re(function(n) {
526
+ const o = wt(n);
527
+ return le(Yn, o);
528
+ }), Qn = "div", Xn = ne(
529
+ function(n) {
530
+ var o = n, { store: e, alwaysVisible: r } = o, l = oe(o, ["store", "alwaysVisible"]);
531
+ const a = De();
532
+ return e = e || a, l = wt(y({ store: e, alwaysVisible: r }, l)), l = bn(y({ store: e, alwaysVisible: r }, l)), l;
533
+ }
534
+ ), Gn = pn(
535
+ re(function(n) {
536
+ const o = Xn(n);
537
+ return le(Qn, o);
538
+ }),
539
+ De
540
+ );
541
+ function Jn({
542
+ store: t,
543
+ fallback: n,
544
+ children: o
545
+ } = {}) {
546
+ const e = Me();
547
+ t = t || e;
548
+ const r = gn(t, (l) => l != null && l.value.length ? l.value : n);
549
+ return o ? o(r || "") : r;
550
+ }
551
+ _e(null);
552
+ _e(
553
+ null
554
+ );
555
+ var eo = tn(
556
+ [Qt],
557
+ [zt]
558
+ ), to = eo.useContext, no = on() && rn();
559
+ function oo(t = {}) {
560
+ var n = t, {
561
+ tag: o
562
+ } = n, e = Ge(n, [
563
+ "tag"
564
+ ]);
565
+ const r = ct(e.store, Cn(o, ["value", "rtl"]));
566
+ dt(e, r);
567
+ const l = o == null ? void 0 : o.getState(), a = r == null ? void 0 : r.getState(), m = D(
568
+ e.activeId,
569
+ a == null ? void 0 : a.activeId,
570
+ e.defaultActiveId,
571
+ null
572
+ ), f = at(ue(Z({}, e), {
573
+ activeId: m,
574
+ includesBaseElement: D(
575
+ e.includesBaseElement,
576
+ a == null ? void 0 : a.includesBaseElement,
577
+ !0
578
+ ),
579
+ orientation: D(
580
+ e.orientation,
581
+ a == null ? void 0 : a.orientation,
582
+ "vertical"
583
+ ),
584
+ focusLoop: D(e.focusLoop, a == null ? void 0 : a.focusLoop, !0),
585
+ focusWrap: D(e.focusWrap, a == null ? void 0 : a.focusWrap, !0),
586
+ virtualFocus: D(
587
+ e.virtualFocus,
588
+ a == null ? void 0 : a.virtualFocus,
589
+ !0
590
+ )
591
+ })), d = lt(ue(Z({}, e), {
592
+ placement: D(
593
+ e.placement,
594
+ a == null ? void 0 : a.placement,
595
+ "bottom-start"
596
+ )
597
+ })), u = D(
598
+ e.value,
599
+ a == null ? void 0 : a.value,
600
+ e.defaultValue,
601
+ ""
602
+ ), s = D(
603
+ e.selectedValue,
604
+ a == null ? void 0 : a.selectedValue,
605
+ l == null ? void 0 : l.values,
606
+ e.defaultSelectedValue,
607
+ ""
608
+ ), v = Array.isArray(s), g = ue(Z(Z({}, f.getState()), d.getState()), {
609
+ value: u,
610
+ selectedValue: s,
611
+ resetValueOnSelect: D(
612
+ e.resetValueOnSelect,
613
+ a == null ? void 0 : a.resetValueOnSelect,
614
+ v
615
+ ),
616
+ resetValueOnHide: D(
617
+ e.resetValueOnHide,
618
+ a == null ? void 0 : a.resetValueOnHide,
619
+ v && !o
620
+ ),
621
+ activeValue: a == null ? void 0 : a.activeValue
622
+ }), c = mt(g, f, d, r);
623
+ return no && X(
624
+ c,
625
+ () => G(c, ["virtualFocus"], () => {
626
+ c.setState("virtualFocus", !1);
627
+ })
628
+ ), X(c, () => {
629
+ if (o)
630
+ return nn(
631
+ G(c, ["selectedValue"], (p) => {
632
+ Array.isArray(p.selectedValue) && o.setValues(p.selectedValue);
633
+ }),
634
+ G(o, ["values"], (p) => {
635
+ c.setState("selectedValue", p.values);
636
+ })
637
+ );
638
+ }), X(
639
+ c,
640
+ () => G(c, ["resetValueOnHide", "mounted"], (p) => {
641
+ p.resetValueOnHide && (p.mounted || c.setState("value", u));
642
+ })
643
+ ), X(
644
+ c,
645
+ () => G(c, ["open"], (p) => {
646
+ p.open || (c.setState("activeId", m), c.setState("moves", 0));
647
+ })
648
+ ), X(
649
+ c,
650
+ () => G(c, ["moves", "activeId"], (p, V) => {
651
+ p.moves === V.moves && c.setState("activeValue", void 0);
652
+ })
653
+ ), X(
654
+ c,
655
+ () => ft(c, ["moves", "renderedItems"], (p, V) => {
656
+ if (p.moves === V.moves) return;
657
+ const { activeId: A } = c.getState(), C = f.item(A);
658
+ c.setState("activeValue", C == null ? void 0 : C.value);
659
+ })
660
+ ), ue(Z(Z(Z({}, d), f), c), {
661
+ tag: o,
662
+ setValue: (p) => c.setState("value", p),
663
+ resetValue: () => c.setState("value", g.value),
664
+ setSelectedValue: (p) => c.setState("selectedValue", p)
665
+ });
666
+ }
667
+ function ro(t) {
668
+ const n = to();
669
+ return t = R(y({}, t), {
670
+ tag: t.tag !== void 0 ? t.tag : n
671
+ }), ut(t);
672
+ }
673
+ function lo(t, n, o) {
674
+ return ke(n, [o.tag]), be(t, o, "value", "setValue"), be(t, o, "selectedValue", "setSelectedValue"), be(t, o, "resetValueOnHide"), be(t, o, "resetValueOnSelect"), Object.assign(
675
+ it(
676
+ st(t, n, o),
677
+ n,
678
+ o
679
+ ),
680
+ { tag: o.tag }
681
+ );
682
+ }
683
+ function so(t = {}) {
684
+ t = ro(t);
685
+ const [n, o] = vt(oo, t);
686
+ return lo(n, o, t);
687
+ }
688
+ var ao = "input";
689
+ function We(t, n, o) {
690
+ if (!o) return !1;
691
+ const e = t.find((r) => !r.disabled && r.value);
692
+ return (e == null ? void 0 : e.value) === n;
693
+ }
694
+ function Ze(t, n) {
695
+ return !n || t == null ? !1 : (t = mn(t), n.length > t.length && n.toLowerCase().indexOf(t.toLowerCase()) === 0);
696
+ }
697
+ function uo(t) {
698
+ return t.type === "input";
699
+ }
700
+ function io(t) {
701
+ return t === "inline" || t === "list" || t === "both" || t === "none";
702
+ }
703
+ function co(t) {
704
+ const n = t.find((o) => {
705
+ var e;
706
+ return o.disabled ? !1 : ((e = o.element) == null ? void 0 : e.getAttribute("role")) !== "tab";
707
+ });
708
+ return n == null ? void 0 : n.id;
709
+ }
710
+ var mo = ne(
711
+ function(n) {
712
+ var o = n, {
713
+ store: e,
714
+ focusable: r = !0,
715
+ autoSelect: l = !1,
716
+ getAutoSelectId: a,
717
+ setValueOnChange: m,
718
+ showMinLength: f = 0,
719
+ showOnChange: d,
720
+ showOnMouseDown: u,
721
+ showOnClick: s = u,
722
+ showOnKeyDown: v,
723
+ showOnKeyPress: g = v,
724
+ blurActiveItemOnClick: c,
725
+ setValueOnClick: p = !0,
726
+ moveOnKeyPress: V = !0,
727
+ autoComplete: A = "list"
728
+ } = o, C = oe(o, [
729
+ "store",
730
+ "focusable",
731
+ "autoSelect",
732
+ "getAutoSelectId",
733
+ "setValueOnChange",
734
+ "showMinLength",
735
+ "showOnChange",
736
+ "showOnMouseDown",
737
+ "showOnClick",
738
+ "showOnKeyDown",
739
+ "showOnKeyPress",
740
+ "blurActiveItemOnClick",
741
+ "setValueOnClick",
742
+ "moveOnKeyPress",
743
+ "autoComplete"
744
+ ]);
745
+ const W = bt();
746
+ e = e || W, me(
747
+ e,
748
+ process.env.NODE_ENV !== "production" && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
749
+ );
750
+ const K = se(null), [$, _] = ln(), I = se(!1), U = se(!1), b = e.useState(
751
+ (i) => i.virtualFocus && l
752
+ ), O = A === "inline" || A === "both", [F, B] = de(O);
753
+ sn(() => {
754
+ O && B(!0);
755
+ }, [O]);
756
+ const h = e.useState("value"), P = se();
757
+ ae(() => G(e, ["selectedValue", "activeId"], (i, x) => {
758
+ P.current = x.selectedValue;
759
+ }), []);
760
+ const S = e.useState((i) => {
761
+ var x;
762
+ if (O && F && !(i.activeValue && Array.isArray(i.selectedValue) && (i.selectedValue.includes(i.activeValue) || (x = P.current) != null && x.includes(i.activeValue))))
763
+ return i.activeValue;
764
+ }), E = e.useState("renderedItems"), q = e.useState("open"), Y = e.useState("contentElement"), J = Ce(() => {
765
+ if (!O || !F) return h;
766
+ if (We(
767
+ E,
768
+ S,
769
+ b
770
+ )) {
771
+ if (Ze(h, S)) {
772
+ const x = (S == null ? void 0 : S.slice(h.length)) || "";
773
+ return h + x;
774
+ }
775
+ return h;
776
+ }
777
+ return S || h;
778
+ }, [O, F, E, S, b, h]);
779
+ ae(() => {
780
+ const i = K.current;
781
+ if (!i) return;
782
+ const x = () => B(!0);
783
+ return i.addEventListener("combobox-item-move", x), () => {
784
+ i.removeEventListener("combobox-item-move", x);
785
+ };
786
+ }, []), ae(() => {
787
+ if (!O || !F || !S || !We(
788
+ E,
789
+ S,
790
+ b
791
+ ) || !Ze(h, S)) return;
792
+ let x = an;
793
+ return queueMicrotask(() => {
794
+ const N = K.current;
795
+ if (!N) return;
796
+ const { start: T, end: z } = Fe(N), ee = h.length, H = S.length;
797
+ Ie(N, ee, H), x = () => {
798
+ if (!Pe(N)) return;
799
+ const { start: ce, end: Ut } = Fe(N);
800
+ ce === ee && Ut === H && Ie(N, T, z);
801
+ };
802
+ }), () => x();
803
+ }, [
804
+ $,
805
+ O,
806
+ F,
807
+ S,
808
+ E,
809
+ b,
810
+ h
811
+ ]);
812
+ const fe = se(null), ie = Q(a), k = se(null);
813
+ ae(() => {
814
+ if (!q || !Y) return;
815
+ const i = un(Y);
816
+ if (!i) return;
817
+ fe.current = i;
818
+ const x = () => {
819
+ I.current = !1;
820
+ }, N = () => {
821
+ if (!e || !I.current) return;
822
+ const { activeId: z } = e.getState();
823
+ z !== null && z !== k.current && (I.current = !1);
824
+ }, T = { passive: !0, capture: !0 };
825
+ return i.addEventListener("wheel", x, T), i.addEventListener("touchmove", x, T), i.addEventListener("scroll", N, T), () => {
826
+ i.removeEventListener("wheel", x, !0), i.removeEventListener("touchmove", x, !0), i.removeEventListener("scroll", N, !0);
827
+ };
828
+ }, [q, Y, e]), Ve(() => {
829
+ h && (U.current || (I.current = !0));
830
+ }, [h]), Ve(() => {
831
+ b !== "always" && q || (I.current = q);
832
+ }, [b, q]);
833
+ const ve = e.useState("resetValueOnSelect");
834
+ ke(() => {
835
+ var i, x;
836
+ const N = I.current;
837
+ if (!e || !q || !N && !ve) return;
838
+ const { baseElement: T, contentElement: z, activeId: ee } = e.getState();
839
+ if (!(T && !Pe(T))) {
840
+ if (z != null && z.hasAttribute("data-placing")) {
841
+ const H = new MutationObserver(_);
842
+ return H.observe(z, { attributeFilter: ["data-placing"] }), () => H.disconnect();
843
+ }
844
+ if (b && N) {
845
+ const H = ie(E), ce = H !== void 0 ? H : (i = co(E)) != null ? i : e.first();
846
+ k.current = ce, e.move(ce ?? null);
847
+ } else {
848
+ const H = (x = e.item(ee || e.first())) == null ? void 0 : x.element;
849
+ H && "scrollIntoView" in H && H.scrollIntoView({ block: "nearest", inline: "nearest" });
850
+ }
851
+ }
852
+ }, [
853
+ e,
854
+ q,
855
+ $,
856
+ h,
857
+ b,
858
+ ve,
859
+ ie,
860
+ E
861
+ ]), ae(() => {
862
+ if (!O) return;
863
+ const i = K.current;
864
+ if (!i) return;
865
+ const x = [i, Y].filter(
866
+ (T) => !!T
867
+ ), N = (T) => {
868
+ x.every((z) => dn(T, z)) && (e == null || e.setValue(J));
869
+ };
870
+ for (const T of x)
871
+ T.addEventListener("focusout", N);
872
+ return () => {
873
+ for (const T of x)
874
+ T.removeEventListener("focusout", N);
875
+ };
876
+ }, [O, Y, e, J]);
877
+ const pe = (i) => i.currentTarget.value.length >= f, Se = C.onChange, Ne = L(d ?? pe), Te = L(
878
+ // If the combobox is combined with tags, the value will be set by the tag
879
+ // input component.
880
+ m ?? !e.tag
881
+ ), Le = Q((i) => {
882
+ if (Se == null || Se(i), i.defaultPrevented || !e) return;
883
+ const x = i.currentTarget, { value: N, selectionStart: T, selectionEnd: z } = x, ee = i.nativeEvent;
884
+ if (I.current = !0, uo(ee) && (ee.isComposing && (I.current = !1, U.current = !0), O)) {
885
+ const H = ee.inputType === "insertText" || ee.inputType === "insertCompositionText", ce = T === N.length;
886
+ B(H && ce);
887
+ }
888
+ if (Te(i)) {
889
+ const H = N === e.getState().value;
890
+ e.setValue(N), queueMicrotask(() => {
891
+ Ie(x, T, z);
892
+ }), O && b && H && _();
893
+ }
894
+ Ne(i) && e.show(), (!b || !I.current) && e.setActiveId(null);
895
+ }), xe = C.onCompositionEnd, Ee = Q((i) => {
896
+ I.current = !0, U.current = !1, xe == null || xe(i), !i.defaultPrevented && b && _();
897
+ }), Re = C.onMouseDown, _t = L(
898
+ c ?? (() => !!(e != null && e.getState().includesBaseElement))
899
+ ), kt = L(p), Mt = L(s ?? pe), Dt = Q((i) => {
900
+ Re == null || Re(i), !i.defaultPrevented && (i.button || i.ctrlKey || e && (_t(i) && e.setActiveId(null), kt(i) && e.setValue(J), Mt(i) && Je(i.currentTarget, "mouseup", e.show)));
901
+ }), Ke = C.onKeyDown, Nt = L(g ?? pe), Tt = Q((i) => {
902
+ if (Ke == null || Ke(i), i.repeat || (I.current = !1), i.defaultPrevented || i.ctrlKey || i.altKey || i.shiftKey || i.metaKey || !e) return;
903
+ const { open: x } = e.getState();
904
+ x || (i.key === "ArrowUp" || i.key === "ArrowDown") && Nt(i) && (i.preventDefault(), e.show());
905
+ }), He = C.onBlur, Lt = Q((i) => {
906
+ I.current = !1, He == null || He(i), i.defaultPrevented;
907
+ }), Rt = Ae(C.id), Kt = io(A) ? A : void 0, Ht = e.useState((i) => i.activeId === null);
908
+ return C = R(y({
909
+ id: Rt,
910
+ role: "combobox",
911
+ "aria-autocomplete": Kt,
912
+ "aria-haspopup": et(Y, "listbox"),
913
+ "aria-expanded": q,
914
+ "aria-controls": Y == null ? void 0 : Y.id,
915
+ "data-active-item": Ht || void 0,
916
+ value: J
917
+ }, C), {
918
+ ref: ye(K, C.ref),
919
+ onChange: Le,
920
+ onCompositionEnd: Ee,
921
+ onMouseDown: Dt,
922
+ onKeyDown: Tt,
923
+ onBlur: Lt
924
+ }), C = yt(R(y({
925
+ store: e,
926
+ focusable: r
927
+ }, C), {
928
+ // Enable inline autocomplete when the user moves from the combobox input
929
+ // to an item.
930
+ moveOnKeyPress: (i) => cn(V, i) ? !1 : (O && B(!0), !0)
931
+ })), C = hn(y({ store: e }, C)), y({ autoComplete: "off" }, C);
932
+ }
933
+ ), fo = re(function(n) {
934
+ const o = mo(n);
935
+ return le(ao, o);
936
+ });
937
+ function vo(t = {}) {
938
+ const n = so(t);
939
+ return /* @__PURE__ */ w(En, { value: n, children: t.children });
940
+ }
941
+ var po = "div";
942
+ function bo(t, n) {
943
+ if (n != null)
944
+ return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
945
+ }
946
+ function ho(t) {
947
+ var n;
948
+ return (n = {
949
+ menu: "menuitem",
950
+ listbox: "option",
951
+ tree: "treeitem"
952
+ }[t]) != null ? n : "option";
953
+ }
954
+ var So = ne(
955
+ function(n) {
956
+ var o = n, {
957
+ store: e,
958
+ value: r,
959
+ hideOnClick: l,
960
+ setValueOnClick: a,
961
+ selectValueOnClick: m = !0,
962
+ resetValueOnSelect: f,
963
+ focusOnHover: d = !1,
964
+ moveOnKeyPress: u = !0,
965
+ getItem: s
966
+ } = o, v = oe(o, [
967
+ "store",
968
+ "value",
969
+ "hideOnClick",
970
+ "setValueOnClick",
971
+ "selectValueOnClick",
972
+ "resetValueOnSelect",
973
+ "focusOnHover",
974
+ "moveOnKeyPress",
975
+ "getItem"
976
+ ]), g;
977
+ const c = ht();
978
+ e = e || c, me(
979
+ e,
980
+ process.env.NODE_ENV !== "production" && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
981
+ );
982
+ const { resetValueOnSelectState: p, multiSelectable: V, selected: A } = pt(e, {
983
+ resetValueOnSelectState: "resetValueOnSelect",
984
+ multiSelectable(h) {
985
+ return Array.isArray(h.selectedValue);
986
+ },
987
+ selected(h) {
988
+ return bo(h.selectedValue, r);
989
+ }
990
+ }), C = Qe(
991
+ (h) => {
992
+ const P = R(y({}, h), { value: r });
993
+ return s ? s(P) : P;
994
+ },
995
+ [r, s]
996
+ );
997
+ a = a ?? !V, l = l ?? (r != null && !V);
998
+ const W = v.onClick, K = L(a), $ = L(m), _ = L(
999
+ (g = f ?? p) != null ? g : V
1000
+ ), I = L(l), U = Q((h) => {
1001
+ W == null || W(h), !h.defaultPrevented && (nt(h) || ot(h) || (r != null && ($(h) && (_(h) && (e == null || e.resetValue()), e == null || e.setSelectedValue((P) => Array.isArray(P) ? P.includes(r) ? P.filter((S) => S !== r) : [...P, r] : r)), K(h) && (e == null || e.setValue(r))), I(h) && (e == null || e.hide())));
1002
+ }), b = v.onKeyDown, O = Q((h) => {
1003
+ if (b == null || b(h), h.defaultPrevented) return;
1004
+ const P = e == null ? void 0 : e.getState().baseElement;
1005
+ if (!P || Pe(P)) return;
1006
+ (h.key.length === 1 || h.key === "Backspace" || h.key === "Delete") && (queueMicrotask(() => P.focus()), fn(P) && (e == null || e.setValue(P.value)));
1007
+ });
1008
+ V && A != null && (v = y({
1009
+ "aria-selected": A
1010
+ }, v)), v = he(
1011
+ v,
1012
+ (h) => /* @__PURE__ */ w(On.Provider, { value: r, children: /* @__PURE__ */ w(yn.Provider, { value: A ?? !1, children: h }) }),
1013
+ [r, A]
1014
+ );
1015
+ const F = we(St);
1016
+ v = R(y({
1017
+ role: ho(F),
1018
+ children: r
1019
+ }, v), {
1020
+ onClick: U,
1021
+ onKeyDown: O
1022
+ });
1023
+ const B = L(u);
1024
+ return v = xt(R(y({
1025
+ store: e
1026
+ }, v), {
1027
+ getItem: C,
1028
+ // Dispatch a custom event on the combobox input when moving to an item
1029
+ // with the keyboard so the Combobox component can enable inline
1030
+ // autocompletion.
1031
+ moveOnKeyPress: (h) => {
1032
+ if (!B(h)) return !1;
1033
+ const P = new Event("combobox-item-move"), S = e == null ? void 0 : e.getState().baseElement;
1034
+ return S == null || S.dispatchEvent(P), !0;
1035
+ }
1036
+ })), v = At(y({ store: e, focusOnHover: d }, v)), v;
1037
+ }
1038
+ ), go = tt(
1039
+ re(function(n) {
1040
+ const o = So(n);
1041
+ return le(po, o);
1042
+ })
1043
+ ), Co = "div", Eo = ne(
1044
+ function(n) {
1045
+ var o = n, { store: e, alwaysVisible: r } = o, l = oe(o, ["store", "alwaysVisible"]);
1046
+ const a = ht(!0), m = An();
1047
+ e = e || m;
1048
+ const f = !!e && e === a;
1049
+ me(
1050
+ e,
1051
+ process.env.NODE_ENV !== "production" && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
1052
+ );
1053
+ const d = se(null), u = Ae(l.id), s = e.useState("mounted"), v = Ot(s, l.hidden, r), g = v ? R(y({}, l.style), { display: "none" }) : l.style, c = e.useState(
1054
+ (_) => Array.isArray(_.selectedValue)
1055
+ ), p = rt(d, "role", l.role), A = (p === "listbox" || p === "tree" || p === "grid") && c || void 0, [C, W] = de(!1), K = e.useState("contentElement");
1056
+ Ve(() => {
1057
+ if (!s) return;
1058
+ const _ = d.current;
1059
+ if (!_ || K !== _) return;
1060
+ const I = () => {
1061
+ W(!!_.querySelector("[role='listbox']"));
1062
+ }, U = new MutationObserver(I);
1063
+ return U.observe(_, {
1064
+ subtree: !0,
1065
+ childList: !0,
1066
+ attributeFilter: ["role"]
1067
+ }), I(), () => U.disconnect();
1068
+ }, [s, K]), C || (l = y({
1069
+ role: "listbox",
1070
+ "aria-multiselectable": A
1071
+ }, l)), l = he(
1072
+ l,
1073
+ (_) => /* @__PURE__ */ w(xn, { value: e, children: /* @__PURE__ */ w(St.Provider, { value: p, children: _ }) }),
1074
+ [e, p]
1075
+ );
1076
+ const $ = u && (!a || !f) ? e.setContentElement : null;
1077
+ return l = R(y({
1078
+ id: u,
1079
+ hidden: v
1080
+ }, l), {
1081
+ ref: ye($, d, l.ref),
1082
+ style: g
1083
+ }), Xe(l);
1084
+ }
1085
+ ), Oo = re(function(n) {
1086
+ const o = Eo(n);
1087
+ return le(Co, o);
1088
+ });
1089
+ const yo = /* @__PURE__ */ new Map([
1090
+ [
1091
+ "bold",
1092
+ /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z" }))
1093
+ ],
1094
+ [
1095
+ "duotone",
1096
+ /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z", opacity: "0.2" }), /* @__PURE__ */ M.createElement("path", { d: "M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
1097
+ ],
1098
+ [
1099
+ "fill",
1100
+ /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z" }))
1101
+ ],
1102
+ [
1103
+ "light",
1104
+ /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z" }))
1105
+ ],
1106
+ [
1107
+ "regular",
1108
+ /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
1109
+ ],
1110
+ [
1111
+ "thin",
1112
+ /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z" }))
1113
+ ]
1114
+ ]), Vt = M.forwardRef((t, n) => /* @__PURE__ */ M.createElement(Zt, { ref: n, ...t, weights: yo }));
1115
+ Vt.displayName = "MagnifyingGlassIcon";
1116
+ var ge = { exports: {} }, $e;
1117
+ function Ao() {
1118
+ if ($e) return ge.exports;
1119
+ $e = 1;
1120
+ var t = {
1121
+ À: "A",
1122
+ Á: "A",
1123
+ Â: "A",
1124
+ Ã: "A",
1125
+ Ä: "A",
1126
+ Å: "A",
1127
+ Ấ: "A",
1128
+ Ắ: "A",
1129
+ Ẳ: "A",
1130
+ Ẵ: "A",
1131
+ Ặ: "A",
1132
+ Æ: "AE",
1133
+ Ầ: "A",
1134
+ Ằ: "A",
1135
+ Ȃ: "A",
1136
+ Ả: "A",
1137
+ Ạ: "A",
1138
+ Ẩ: "A",
1139
+ Ẫ: "A",
1140
+ Ậ: "A",
1141
+ Ç: "C",
1142
+ Ḉ: "C",
1143
+ È: "E",
1144
+ É: "E",
1145
+ Ê: "E",
1146
+ Ë: "E",
1147
+ Ế: "E",
1148
+ Ḗ: "E",
1149
+ Ề: "E",
1150
+ Ḕ: "E",
1151
+ Ḝ: "E",
1152
+ Ȇ: "E",
1153
+ Ẻ: "E",
1154
+ Ẽ: "E",
1155
+ Ẹ: "E",
1156
+ Ể: "E",
1157
+ Ễ: "E",
1158
+ Ệ: "E",
1159
+ Ì: "I",
1160
+ Í: "I",
1161
+ Î: "I",
1162
+ Ï: "I",
1163
+ Ḯ: "I",
1164
+ Ȋ: "I",
1165
+ Ỉ: "I",
1166
+ Ị: "I",
1167
+ Ð: "D",
1168
+ Ñ: "N",
1169
+ Ò: "O",
1170
+ Ó: "O",
1171
+ Ô: "O",
1172
+ Õ: "O",
1173
+ Ö: "O",
1174
+ Ø: "O",
1175
+ Ố: "O",
1176
+ Ṍ: "O",
1177
+ Ṓ: "O",
1178
+ Ȏ: "O",
1179
+ Ỏ: "O",
1180
+ Ọ: "O",
1181
+ Ổ: "O",
1182
+ Ỗ: "O",
1183
+ Ộ: "O",
1184
+ Ờ: "O",
1185
+ Ở: "O",
1186
+ Ỡ: "O",
1187
+ Ớ: "O",
1188
+ Ợ: "O",
1189
+ Ù: "U",
1190
+ Ú: "U",
1191
+ Û: "U",
1192
+ Ü: "U",
1193
+ Ủ: "U",
1194
+ Ụ: "U",
1195
+ Ử: "U",
1196
+ Ữ: "U",
1197
+ Ự: "U",
1198
+ Ý: "Y",
1199
+ à: "a",
1200
+ á: "a",
1201
+ â: "a",
1202
+ ã: "a",
1203
+ ä: "a",
1204
+ å: "a",
1205
+ ấ: "a",
1206
+ ắ: "a",
1207
+ ẳ: "a",
1208
+ ẵ: "a",
1209
+ ặ: "a",
1210
+ æ: "ae",
1211
+ ầ: "a",
1212
+ ằ: "a",
1213
+ ȃ: "a",
1214
+ ả: "a",
1215
+ ạ: "a",
1216
+ ẩ: "a",
1217
+ ẫ: "a",
1218
+ ậ: "a",
1219
+ ç: "c",
1220
+ ḉ: "c",
1221
+ è: "e",
1222
+ é: "e",
1223
+ ê: "e",
1224
+ ë: "e",
1225
+ ế: "e",
1226
+ ḗ: "e",
1227
+ ề: "e",
1228
+ ḕ: "e",
1229
+ ḝ: "e",
1230
+ ȇ: "e",
1231
+ ẻ: "e",
1232
+ ẽ: "e",
1233
+ ẹ: "e",
1234
+ ể: "e",
1235
+ ễ: "e",
1236
+ ệ: "e",
1237
+ ì: "i",
1238
+ í: "i",
1239
+ î: "i",
1240
+ ï: "i",
1241
+ ḯ: "i",
1242
+ ȋ: "i",
1243
+ ỉ: "i",
1244
+ ị: "i",
1245
+ ð: "d",
1246
+ ñ: "n",
1247
+ ò: "o",
1248
+ ó: "o",
1249
+ ô: "o",
1250
+ õ: "o",
1251
+ ö: "o",
1252
+ ø: "o",
1253
+ ố: "o",
1254
+ ṍ: "o",
1255
+ ṓ: "o",
1256
+ ȏ: "o",
1257
+ ỏ: "o",
1258
+ ọ: "o",
1259
+ ổ: "o",
1260
+ ỗ: "o",
1261
+ ộ: "o",
1262
+ ờ: "o",
1263
+ ở: "o",
1264
+ ỡ: "o",
1265
+ ớ: "o",
1266
+ ợ: "o",
1267
+ ù: "u",
1268
+ ú: "u",
1269
+ û: "u",
1270
+ ü: "u",
1271
+ ủ: "u",
1272
+ ụ: "u",
1273
+ ử: "u",
1274
+ ữ: "u",
1275
+ ự: "u",
1276
+ ý: "y",
1277
+ ÿ: "y",
1278
+ Ā: "A",
1279
+ ā: "a",
1280
+ Ă: "A",
1281
+ ă: "a",
1282
+ Ą: "A",
1283
+ ą: "a",
1284
+ Ć: "C",
1285
+ ć: "c",
1286
+ Ĉ: "C",
1287
+ ĉ: "c",
1288
+ Ċ: "C",
1289
+ ċ: "c",
1290
+ Č: "C",
1291
+ č: "c",
1292
+ C̆: "C",
1293
+ c̆: "c",
1294
+ Ď: "D",
1295
+ ď: "d",
1296
+ Đ: "D",
1297
+ đ: "d",
1298
+ Ē: "E",
1299
+ ē: "e",
1300
+ Ĕ: "E",
1301
+ ĕ: "e",
1302
+ Ė: "E",
1303
+ ė: "e",
1304
+ Ę: "E",
1305
+ ę: "e",
1306
+ Ě: "E",
1307
+ ě: "e",
1308
+ Ĝ: "G",
1309
+ Ǵ: "G",
1310
+ ĝ: "g",
1311
+ ǵ: "g",
1312
+ Ğ: "G",
1313
+ ğ: "g",
1314
+ Ġ: "G",
1315
+ ġ: "g",
1316
+ Ģ: "G",
1317
+ ģ: "g",
1318
+ Ĥ: "H",
1319
+ ĥ: "h",
1320
+ Ħ: "H",
1321
+ ħ: "h",
1322
+ Ḫ: "H",
1323
+ ḫ: "h",
1324
+ Ĩ: "I",
1325
+ ĩ: "i",
1326
+ Ī: "I",
1327
+ ī: "i",
1328
+ Ĭ: "I",
1329
+ ĭ: "i",
1330
+ Į: "I",
1331
+ į: "i",
1332
+ İ: "I",
1333
+ ı: "i",
1334
+ IJ: "IJ",
1335
+ ij: "ij",
1336
+ Ĵ: "J",
1337
+ ĵ: "j",
1338
+ Ķ: "K",
1339
+ ķ: "k",
1340
+ Ḱ: "K",
1341
+ ḱ: "k",
1342
+ K̆: "K",
1343
+ k̆: "k",
1344
+ Ĺ: "L",
1345
+ ĺ: "l",
1346
+ Ļ: "L",
1347
+ ļ: "l",
1348
+ Ľ: "L",
1349
+ ľ: "l",
1350
+ Ŀ: "L",
1351
+ ŀ: "l",
1352
+ Ł: "l",
1353
+ ł: "l",
1354
+ Ḿ: "M",
1355
+ ḿ: "m",
1356
+ M̆: "M",
1357
+ m̆: "m",
1358
+ Ń: "N",
1359
+ ń: "n",
1360
+ Ņ: "N",
1361
+ ņ: "n",
1362
+ Ň: "N",
1363
+ ň: "n",
1364
+ ʼn: "n",
1365
+ N̆: "N",
1366
+ n̆: "n",
1367
+ Ō: "O",
1368
+ ō: "o",
1369
+ Ŏ: "O",
1370
+ ŏ: "o",
1371
+ Ő: "O",
1372
+ ő: "o",
1373
+ Œ: "OE",
1374
+ œ: "oe",
1375
+ P̆: "P",
1376
+ p̆: "p",
1377
+ Ŕ: "R",
1378
+ ŕ: "r",
1379
+ Ŗ: "R",
1380
+ ŗ: "r",
1381
+ Ř: "R",
1382
+ ř: "r",
1383
+ R̆: "R",
1384
+ r̆: "r",
1385
+ Ȓ: "R",
1386
+ ȓ: "r",
1387
+ Ś: "S",
1388
+ ś: "s",
1389
+ Ŝ: "S",
1390
+ ŝ: "s",
1391
+ Ş: "S",
1392
+ Ș: "S",
1393
+ ș: "s",
1394
+ ş: "s",
1395
+ Š: "S",
1396
+ š: "s",
1397
+ Ţ: "T",
1398
+ ţ: "t",
1399
+ ț: "t",
1400
+ Ț: "T",
1401
+ Ť: "T",
1402
+ ť: "t",
1403
+ Ŧ: "T",
1404
+ ŧ: "t",
1405
+ T̆: "T",
1406
+ t̆: "t",
1407
+ Ũ: "U",
1408
+ ũ: "u",
1409
+ Ū: "U",
1410
+ ū: "u",
1411
+ Ŭ: "U",
1412
+ ŭ: "u",
1413
+ Ů: "U",
1414
+ ů: "u",
1415
+ Ű: "U",
1416
+ ű: "u",
1417
+ Ų: "U",
1418
+ ų: "u",
1419
+ Ȗ: "U",
1420
+ ȗ: "u",
1421
+ V̆: "V",
1422
+ v̆: "v",
1423
+ Ŵ: "W",
1424
+ ŵ: "w",
1425
+ Ẃ: "W",
1426
+ ẃ: "w",
1427
+ X̆: "X",
1428
+ x̆: "x",
1429
+ Ŷ: "Y",
1430
+ ŷ: "y",
1431
+ Ÿ: "Y",
1432
+ Y̆: "Y",
1433
+ y̆: "y",
1434
+ Ź: "Z",
1435
+ ź: "z",
1436
+ Ż: "Z",
1437
+ ż: "z",
1438
+ Ž: "Z",
1439
+ ž: "z",
1440
+ ſ: "s",
1441
+ ƒ: "f",
1442
+ Ơ: "O",
1443
+ ơ: "o",
1444
+ Ư: "U",
1445
+ ư: "u",
1446
+ Ǎ: "A",
1447
+ ǎ: "a",
1448
+ Ǐ: "I",
1449
+ ǐ: "i",
1450
+ Ǒ: "O",
1451
+ ǒ: "o",
1452
+ Ǔ: "U",
1453
+ ǔ: "u",
1454
+ Ǖ: "U",
1455
+ ǖ: "u",
1456
+ Ǘ: "U",
1457
+ ǘ: "u",
1458
+ Ǚ: "U",
1459
+ ǚ: "u",
1460
+ Ǜ: "U",
1461
+ ǜ: "u",
1462
+ Ứ: "U",
1463
+ ứ: "u",
1464
+ Ṹ: "U",
1465
+ ṹ: "u",
1466
+ Ǻ: "A",
1467
+ ǻ: "a",
1468
+ Ǽ: "AE",
1469
+ ǽ: "ae",
1470
+ Ǿ: "O",
1471
+ ǿ: "o",
1472
+ Þ: "TH",
1473
+ þ: "th",
1474
+ Ṕ: "P",
1475
+ ṕ: "p",
1476
+ Ṥ: "S",
1477
+ ṥ: "s",
1478
+ X́: "X",
1479
+ x́: "x",
1480
+ Ѓ: "Г",
1481
+ ѓ: "г",
1482
+ Ќ: "К",
1483
+ ќ: "к",
1484
+ A̋: "A",
1485
+ a̋: "a",
1486
+ E̋: "E",
1487
+ e̋: "e",
1488
+ I̋: "I",
1489
+ i̋: "i",
1490
+ Ǹ: "N",
1491
+ ǹ: "n",
1492
+ Ồ: "O",
1493
+ ồ: "o",
1494
+ Ṑ: "O",
1495
+ ṑ: "o",
1496
+ Ừ: "U",
1497
+ ừ: "u",
1498
+ Ẁ: "W",
1499
+ ẁ: "w",
1500
+ Ỳ: "Y",
1501
+ ỳ: "y",
1502
+ Ȁ: "A",
1503
+ ȁ: "a",
1504
+ Ȅ: "E",
1505
+ ȅ: "e",
1506
+ Ȉ: "I",
1507
+ ȉ: "i",
1508
+ Ȍ: "O",
1509
+ ȍ: "o",
1510
+ Ȑ: "R",
1511
+ ȑ: "r",
1512
+ Ȕ: "U",
1513
+ ȕ: "u",
1514
+ B̌: "B",
1515
+ b̌: "b",
1516
+ Č̣: "C",
1517
+ č̣: "c",
1518
+ Ê̌: "E",
1519
+ ê̌: "e",
1520
+ F̌: "F",
1521
+ f̌: "f",
1522
+ Ǧ: "G",
1523
+ ǧ: "g",
1524
+ Ȟ: "H",
1525
+ ȟ: "h",
1526
+ J̌: "J",
1527
+ ǰ: "j",
1528
+ Ǩ: "K",
1529
+ ǩ: "k",
1530
+ M̌: "M",
1531
+ m̌: "m",
1532
+ P̌: "P",
1533
+ p̌: "p",
1534
+ Q̌: "Q",
1535
+ q̌: "q",
1536
+ Ř̩: "R",
1537
+ ř̩: "r",
1538
+ Ṧ: "S",
1539
+ ṧ: "s",
1540
+ V̌: "V",
1541
+ v̌: "v",
1542
+ W̌: "W",
1543
+ w̌: "w",
1544
+ X̌: "X",
1545
+ x̌: "x",
1546
+ Y̌: "Y",
1547
+ y̌: "y",
1548
+ A̧: "A",
1549
+ a̧: "a",
1550
+ B̧: "B",
1551
+ b̧: "b",
1552
+ Ḑ: "D",
1553
+ ḑ: "d",
1554
+ Ȩ: "E",
1555
+ ȩ: "e",
1556
+ Ɛ̧: "E",
1557
+ ɛ̧: "e",
1558
+ Ḩ: "H",
1559
+ ḩ: "h",
1560
+ I̧: "I",
1561
+ i̧: "i",
1562
+ Ɨ̧: "I",
1563
+ ɨ̧: "i",
1564
+ M̧: "M",
1565
+ m̧: "m",
1566
+ O̧: "O",
1567
+ o̧: "o",
1568
+ Q̧: "Q",
1569
+ q̧: "q",
1570
+ U̧: "U",
1571
+ u̧: "u",
1572
+ X̧: "X",
1573
+ x̧: "x",
1574
+ Z̧: "Z",
1575
+ z̧: "z",
1576
+ й: "и",
1577
+ Й: "И",
1578
+ ё: "е",
1579
+ Ё: "Е"
1580
+ }, n = Object.keys(t).join("|"), o = new RegExp(n, "g"), e = new RegExp(n, "");
1581
+ function r(m) {
1582
+ return t[m];
1583
+ }
1584
+ var l = function(m) {
1585
+ return m.replace(o, r);
1586
+ }, a = function(m) {
1587
+ return !!m.match(e);
1588
+ };
1589
+ return ge.exports = l, ge.exports.has = a, ge.exports.remove = l, ge.exports;
1590
+ }
1591
+ var xo = Ao();
1592
+ const Io = /* @__PURE__ */ $t(xo);
1593
+ /**
1594
+ * @name match-sorter
1595
+ * @license MIT license.
1596
+ * @copyright (c) 2020 Kent C. Dodds
1597
+ * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
1598
+ */
1599
+ const j = {
1600
+ CASE_SENSITIVE_EQUAL: 7,
1601
+ EQUAL: 6,
1602
+ STARTS_WITH: 5,
1603
+ WORD_STARTS_WITH: 4,
1604
+ CONTAINS: 3,
1605
+ ACRONYM: 2,
1606
+ MATCHES: 1,
1607
+ NO_MATCH: 0
1608
+ }, wo = (t, n) => String(t.rankedValue).localeCompare(String(n.rankedValue));
1609
+ function Pt(t, n, o) {
1610
+ o === void 0 && (o = {});
1611
+ const {
1612
+ keys: e,
1613
+ threshold: r = j.MATCHES,
1614
+ baseSort: l = wo,
1615
+ sorter: a = (d) => d.sort((u, s) => ko(u, s, l))
1616
+ } = o, m = t.reduce(f, []);
1617
+ return a(m).map((d) => {
1618
+ let {
1619
+ item: u
1620
+ } = d;
1621
+ return u;
1622
+ });
1623
+ function f(d, u, s) {
1624
+ const v = Vo(u, e, n, o), {
1625
+ rank: g,
1626
+ keyThreshold: c = r
1627
+ } = v;
1628
+ return g >= c && d.push({
1629
+ ...v,
1630
+ item: u,
1631
+ index: s
1632
+ }), d;
1633
+ }
1634
+ }
1635
+ Pt.rankings = j;
1636
+ function Vo(t, n, o, e) {
1637
+ if (!n) {
1638
+ const l = t;
1639
+ return {
1640
+ // ends up being duplicate of 'item' in matches but consistent
1641
+ rankedValue: l,
1642
+ rank: qe(l, o, e),
1643
+ keyIndex: -1,
1644
+ keyThreshold: e.threshold
1645
+ };
1646
+ }
1647
+ return No(t, n).reduce((l, a, m) => {
1648
+ let {
1649
+ rank: f,
1650
+ rankedValue: d,
1651
+ keyIndex: u,
1652
+ keyThreshold: s
1653
+ } = l, {
1654
+ itemValue: v,
1655
+ attributes: g
1656
+ } = a, c = qe(v, o, e), p = d;
1657
+ const {
1658
+ minRanking: V,
1659
+ maxRanking: A,
1660
+ threshold: C
1661
+ } = g;
1662
+ return c < V && c >= j.MATCHES ? c = V : c > A && (c = A), c > f && (f = c, u = m, s = C, p = v), {
1663
+ rankedValue: p,
1664
+ rank: f,
1665
+ keyIndex: u,
1666
+ keyThreshold: s
1667
+ };
1668
+ }, {
1669
+ rankedValue: t,
1670
+ rank: j.NO_MATCH,
1671
+ keyIndex: -1,
1672
+ keyThreshold: e.threshold
1673
+ });
1674
+ }
1675
+ function qe(t, n, o) {
1676
+ return t = Ye(t, o), n = Ye(n, o), n.length > t.length ? j.NO_MATCH : t === n ? j.CASE_SENSITIVE_EQUAL : (t = t.toLowerCase(), n = n.toLowerCase(), t === n ? j.EQUAL : t.startsWith(n) ? j.STARTS_WITH : t.includes(` ${n}`) ? j.WORD_STARTS_WITH : t.includes(n) ? j.CONTAINS : n.length === 1 ? j.NO_MATCH : Po(t).includes(n) ? j.ACRONYM : _o(t, n));
1677
+ }
1678
+ function Po(t) {
1679
+ let n = "";
1680
+ return t.split(" ").forEach((e) => {
1681
+ e.split("-").forEach((l) => {
1682
+ n += l.substr(0, 1);
1683
+ });
1684
+ }), n;
1685
+ }
1686
+ function _o(t, n) {
1687
+ let o = 0, e = 0;
1688
+ function r(f, d, u) {
1689
+ for (let s = u, v = d.length; s < v; s++)
1690
+ if (d[s] === f)
1691
+ return o += 1, s + 1;
1692
+ return -1;
1693
+ }
1694
+ function l(f) {
1695
+ const d = 1 / f, u = o / n.length;
1696
+ return j.MATCHES + u * d;
1697
+ }
1698
+ const a = r(n[0], t, 0);
1699
+ if (a < 0)
1700
+ return j.NO_MATCH;
1701
+ e = a;
1702
+ for (let f = 1, d = n.length; f < d; f++) {
1703
+ const u = n[f];
1704
+ if (e = r(u, t, e), !(e > -1))
1705
+ return j.NO_MATCH;
1706
+ }
1707
+ const m = e - a;
1708
+ return l(m);
1709
+ }
1710
+ function ko(t, n, o) {
1711
+ const {
1712
+ rank: l,
1713
+ keyIndex: a
1714
+ } = t, {
1715
+ rank: m,
1716
+ keyIndex: f
1717
+ } = n;
1718
+ return l === m ? a === f ? o(t, n) : a < f ? -1 : 1 : l > m ? -1 : 1;
1719
+ }
1720
+ function Ye(t, n) {
1721
+ let {
1722
+ keepDiacritics: o
1723
+ } = n;
1724
+ return t = `${t}`, o || (t = Io(t)), t;
1725
+ }
1726
+ function Mo(t, n) {
1727
+ typeof n == "object" && (n = n.key);
1728
+ let o;
1729
+ if (typeof n == "function")
1730
+ o = n(t);
1731
+ else if (t == null)
1732
+ o = null;
1733
+ else if (Object.hasOwnProperty.call(t, n))
1734
+ o = t[n];
1735
+ else {
1736
+ if (n.includes("."))
1737
+ return Do(n, t);
1738
+ o = null;
1739
+ }
1740
+ return o == null ? [] : Array.isArray(o) ? o : [String(o)];
1741
+ }
1742
+ function Do(t, n) {
1743
+ const o = t.split(".");
1744
+ let e = [n];
1745
+ for (let r = 0, l = o.length; r < l; r++) {
1746
+ const a = o[r];
1747
+ let m = [];
1748
+ for (let f = 0, d = e.length; f < d; f++) {
1749
+ const u = e[f];
1750
+ if (u != null)
1751
+ if (Object.hasOwnProperty.call(u, a)) {
1752
+ const s = u[a];
1753
+ s != null && m.push(s);
1754
+ } else a === "*" && (m = m.concat(u));
1755
+ }
1756
+ e = m;
1757
+ }
1758
+ return Array.isArray(e[0]) ? [].concat(...e) : e;
1759
+ }
1760
+ function No(t, n) {
1761
+ const o = [];
1762
+ for (let e = 0, r = n.length; e < r; e++) {
1763
+ const l = n[e], a = To(l), m = Mo(t, l);
1764
+ for (let f = 0, d = m.length; f < d; f++)
1765
+ o.push({
1766
+ itemValue: m[f],
1767
+ attributes: a
1768
+ });
1769
+ }
1770
+ return o;
1771
+ }
1772
+ const ze = {
1773
+ maxRanking: 1 / 0,
1774
+ minRanking: -1 / 0
1775
+ };
1776
+ function To(t) {
1777
+ return typeof t == "string" ? ze : {
1778
+ ...ze,
1779
+ ...t
1780
+ };
1781
+ }
1782
+ function sr(t) {
1783
+ const { baseProps: n, controlProps: o } = Yt(t, {
1784
+ className: "component-select-control"
1785
+ }), [e, r] = de(""), {
1786
+ value: l,
1787
+ onChangeValue: a = Bt,
1788
+ options: m,
1789
+ placeholder: f = "Choose an option...",
1790
+ searchable: d = !1,
1791
+ ...u
1792
+ } = o, s = (m || []).map(Ft), v = Ce(() => Pt(s, e, {
1793
+ baseSort: (c, p) => c.index < p.index ? -1 : 1,
1794
+ keys: ["label", "description"]
1795
+ }), [e]), g = d ? Oo : zn;
1796
+ return /* @__PURE__ */ w(
1797
+ vo,
1798
+ {
1799
+ resetValueOnHide: !0,
1800
+ setValue: (c) => {
1801
+ Wt(() => {
1802
+ r(c);
1803
+ });
1804
+ },
1805
+ children: /* @__PURE__ */ w(jn, { value: l, setValue: a, children: /* @__PURE__ */ te(qt, { ...n, children: [
1806
+ /* @__PURE__ */ te(
1807
+ Bn,
1808
+ {
1809
+ className: "component-select-control__input",
1810
+ ...u,
1811
+ children: [
1812
+ /* @__PURE__ */ w("div", { className: "component-select-control__value", children: /* @__PURE__ */ w(Jn, { fallback: f, children: (c) => {
1813
+ var p;
1814
+ return ((p = s.find((V) => V.value === c)) == null ? void 0 : p.label) || f;
1815
+ } }) }),
1816
+ /* @__PURE__ */ w("div", { className: "component-select-control__caret", children: /* @__PURE__ */ w(jt, {}) })
1817
+ ]
1818
+ }
1819
+ ),
1820
+ /* @__PURE__ */ te(
1821
+ Gn,
1822
+ {
1823
+ className: "component-select-control__popover",
1824
+ "data-colour-scheme": "invert",
1825
+ wrapperProps: {
1826
+ className: "component-select-control__popover__wrapper"
1827
+ },
1828
+ fitViewport: !0,
1829
+ gutter: 8,
1830
+ overflowPadding: 4,
1831
+ shift: -1,
1832
+ portal: !0,
1833
+ children: [
1834
+ /* @__PURE__ */ te(
1835
+ "div",
1836
+ {
1837
+ className: "component-select-control__popover__search-wrapper",
1838
+ inert: !d,
1839
+ hidden: !d,
1840
+ children: [
1841
+ /* @__PURE__ */ w(Vt, { className: "component-select-control__popover__search-icon" }),
1842
+ /* @__PURE__ */ w(
1843
+ fo,
1844
+ {
1845
+ autoSelect: !0,
1846
+ placeholder: "Search...",
1847
+ className: "component-select-control__popover__search"
1848
+ }
1849
+ )
1850
+ ]
1851
+ }
1852
+ ),
1853
+ /* @__PURE__ */ w(g, { className: "component-select-control__list", children: v.map((c) => /* @__PURE__ */ te(
1854
+ qn,
1855
+ {
1856
+ disabled: c.disabled,
1857
+ value: c.value,
1858
+ className: "component-select-control__option",
1859
+ render: /* @__PURE__ */ w(go, {}),
1860
+ children: [
1861
+ /* @__PURE__ */ te("div", { className: "component-select-control__option__label", children: [
1862
+ c.icon,
1863
+ c.label
1864
+ ] }),
1865
+ c.description && /* @__PURE__ */ w("div", { className: "component-select-control__option__description", children: c.description })
1866
+ ]
1867
+ },
1868
+ c.value
1869
+ )) })
1870
+ ]
1871
+ }
1872
+ )
1873
+ ] }) })
1874
+ }
1875
+ );
1876
+ }
1877
+ export {
1878
+ sr as SelectControl
1879
+ };