@choc-ui/chakra-autocomplete 5.7.2 → 5.8.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.
package/dist/index.es.js CHANGED
@@ -1,811 +1,182 @@
1
- import * as Ze from "react";
2
- import Re, { useMemo as Je, useRef as Ue, useState as at, useEffect as ee, useImperativeHandle as Ut, memo as Gt } from "react";
3
- import { useDisclosure as Bt, useControllableState as zt, useUpdateEffect as Kt, forwardRef as Se, Popover as Ht, chakra as Jt, useMergeRefs as ut, Flex as qe, Box as Ot, Divider as Ct, InputGroup as Xt, Input as Qt, InputRightElement as Zt, Spinner as jt, useMultiStyleConfig as qt, Wrap as er, WrapItem as Tt, PopoverAnchor as tr, PopoverContent as rr, Center as nr, Tag as or, TagLabel as ar, TagCloseButton as sr } from "@chakra-ui/react";
4
- var it = { exports: {} }, Ye = {};
5
- /**
6
- * @license React
7
- * react-jsx-runtime.production.min.js
8
- *
9
- * Copyright (c) Facebook, Inc. and its affiliates.
10
- *
11
- * This source code is licensed under the MIT license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- */
14
- var Et;
15
- function ir() {
16
- if (Et) return Ye;
17
- Et = 1;
18
- var t = Re, r = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function c(f, g, R) {
20
- var y, m = {}, A = null, w = null;
21
- R !== void 0 && (A = "" + R), g.key !== void 0 && (A = "" + g.key), g.ref !== void 0 && (w = g.ref);
22
- for (y in g) s.call(g, y) && !l.hasOwnProperty(y) && (m[y] = g[y]);
23
- if (f && f.defaultProps) for (y in g = f.defaultProps, g) m[y] === void 0 && (m[y] = g[y]);
24
- return { $$typeof: r, type: f, key: A, ref: w, props: m, _owner: a.current };
1
+ import { jsx as p, jsxs as K, Fragment as it } from "react/jsx-runtime";
2
+ import * as fe from "react";
3
+ import ee, { useMemo as ue, useRef as te, useState as Le, useEffect as D, useImperativeHandle as ut, memo as at } from "react";
4
+ import { useDisclosure as ct, useControllableState as ft, useUpdateEffect as pt, forwardRef as B, Popover as dt, chakra as gt, useMergeRefs as Pe, Flex as pe, Box as Xe, Divider as Qe, InputGroup as mt, Input as vt, InputRightElement as ht, Spinner as Ze, useMultiStyleConfig as yt, Wrap as bt, WrapItem as qe, PopoverAnchor as Ct, PopoverContent as St, Center as xt, Tag as At, TagLabel as It, TagCloseButton as wt } from "@chakra-ui/react";
5
+ const [Ot, W] = Et();
6
+ function Et() {
7
+ const e = fe.createContext(void 0);
8
+ e.displayName = "AutoCompleteContext";
9
+ function t() {
10
+ var o;
11
+ const n = fe.useContext(e), r = "useAutoCompleteContext: `context` is undefined. Seems you forgot to wrap all autoomplete components within `<AutoComplete />`";
12
+ if (!n) {
13
+ const l = new Error(r);
14
+ throw l.name = "ContextError", (o = Error.captureStackTrace) == null || o.call(Error, l, t), l;
15
+ }
16
+ return n;
25
17
  }
26
- return Ye.Fragment = o, Ye.jsx = c, Ye.jsxs = c, Ye;
18
+ return [e.Provider, t, e];
27
19
  }
28
- var Ve = {};
29
- /**
30
- * @license React
31
- * react-jsx-runtime.development.js
32
- *
33
- * Copyright (c) Facebook, Inc. and its affiliates.
34
- *
35
- * This source code is licensed under the MIT license found in the
36
- * LICENSE file in the root directory of this source tree.
37
- */
38
- var xt;
39
- function ur() {
40
- return xt || (xt = 1, process.env.NODE_ENV !== "production" && function() {
41
- var t = Re, r = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), f = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), L = Symbol.iterator, ie = "@@iterator";
42
- function te(e) {
43
- if (e === null || typeof e != "object")
44
- return null;
45
- var n = L && e[L] || e[ie];
46
- return typeof n == "function" ? n : null;
47
- }
48
- var X = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
49
- function P(e) {
50
- {
51
- for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), d = 1; d < n; d++)
52
- i[d - 1] = arguments[d];
53
- _e("error", e, i);
54
- }
55
- }
56
- function _e(e, n, i) {
57
- {
58
- var d = X.ReactDebugCurrentFrame, b = d.getStackAddendum();
59
- b !== "" && (n += "%s", i = i.concat([b]));
60
- var x = i.map(function(h) {
61
- return String(h);
62
- });
63
- x.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, x);
64
- }
65
- }
66
- var me = !1, Ie = !1, Fe = !1, we = !1, re = !1, ue;
67
- ue = Symbol.for("react.module.reference");
68
- function M(e) {
69
- return !!(typeof e == "string" || typeof e == "function" || e === s || e === l || re || e === a || e === R || e === y || we || e === w || me || Ie || Fe || typeof e == "object" && e !== null && (e.$$typeof === A || e.$$typeof === m || e.$$typeof === c || e.$$typeof === f || e.$$typeof === g || // This needs to include all possible module reference object
70
- // types supported by any Flight configuration anywhere since
71
- // we don't know which Flight build this will end up being used
72
- // with.
73
- e.$$typeof === ue || e.getModuleId !== void 0));
74
- }
75
- function Z(e, n, i) {
76
- var d = e.displayName;
77
- if (d)
78
- return d;
79
- var b = n.displayName || n.name || "";
80
- return b !== "" ? i + "(" + b + ")" : i;
81
- }
82
- function ne(e) {
83
- return e.displayName || "Context";
84
- }
85
- function G(e) {
86
- if (e == null)
87
- return null;
88
- if (typeof e.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
89
- return e.displayName || e.name || null;
90
- if (typeof e == "string")
91
- return e;
92
- switch (e) {
93
- case s:
94
- return "Fragment";
95
- case o:
96
- return "Portal";
97
- case l:
98
- return "Profiler";
99
- case a:
100
- return "StrictMode";
101
- case R:
102
- return "Suspense";
103
- case y:
104
- return "SuspenseList";
105
- }
106
- if (typeof e == "object")
107
- switch (e.$$typeof) {
108
- case f:
109
- var n = e;
110
- return ne(n) + ".Consumer";
111
- case c:
112
- var i = e;
113
- return ne(i._context) + ".Provider";
114
- case g:
115
- return Z(e, e.render, "ForwardRef");
116
- case m:
117
- var d = e.displayName || null;
118
- return d !== null ? d : G(e.type) || "Memo";
119
- case A: {
120
- var b = e, x = b._payload, h = b._init;
121
- try {
122
- return G(h(x));
123
- } catch {
124
- return null;
125
- }
126
- }
127
- }
128
- return null;
129
- }
130
- var I = Object.assign, N = 0, ke, le, oe, De, he, ye, H;
131
- function ce() {
132
- }
133
- ce.__reactDisabledLog = !0;
134
- function Le() {
135
- {
136
- if (N === 0) {
137
- ke = console.log, le = console.info, oe = console.warn, De = console.error, he = console.group, ye = console.groupCollapsed, H = console.groupEnd;
138
- var e = {
139
- configurable: !0,
140
- enumerable: !0,
141
- value: ce,
142
- writable: !0
143
- };
144
- Object.defineProperties(console, {
145
- info: e,
146
- log: e,
147
- warn: e,
148
- error: e,
149
- group: e,
150
- groupCollapsed: e,
151
- groupEnd: e
152
- });
153
- }
154
- N++;
155
- }
156
- }
157
- function Ge() {
158
- {
159
- if (N--, N === 0) {
160
- var e = {
161
- configurable: !0,
162
- enumerable: !0,
163
- writable: !0
164
- };
165
- Object.defineProperties(console, {
166
- log: I({}, e, {
167
- value: ke
168
- }),
169
- info: I({}, e, {
170
- value: le
171
- }),
172
- warn: I({}, e, {
173
- value: oe
174
- }),
175
- error: I({}, e, {
176
- value: De
177
- }),
178
- group: I({}, e, {
179
- value: he
180
- }),
181
- groupCollapsed: I({}, e, {
182
- value: ye
183
- }),
184
- groupEnd: I({}, e, {
185
- value: H
186
- })
187
- });
188
- }
189
- N < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
190
- }
191
- }
192
- var O = X.ReactCurrentDispatcher, z;
193
- function fe(e, n, i) {
194
- {
195
- if (z === void 0)
196
- try {
197
- throw Error();
198
- } catch (b) {
199
- var d = b.stack.trim().match(/\n( *(at )?)/);
200
- z = d && d[1] || "";
201
- }
202
- return `
203
- ` + z + e;
204
- }
205
- }
206
- var q = !1, K;
207
- {
208
- var tt = typeof WeakMap == "function" ? WeakMap : Map;
209
- K = new tt();
210
- }
211
- function Oe(e, n) {
212
- if (!e || q)
213
- return "";
214
- {
215
- var i = K.get(e);
216
- if (i !== void 0)
217
- return i;
218
- }
219
- var d;
220
- q = !0;
221
- var b = Error.prepareStackTrace;
222
- Error.prepareStackTrace = void 0;
223
- var x;
224
- x = O.current, O.current = null, Le();
225
- try {
226
- if (n) {
227
- var h = function() {
228
- throw Error();
229
- };
230
- if (Object.defineProperty(h.prototype, "props", {
231
- set: function() {
232
- throw Error();
233
- }
234
- }), typeof Reflect == "object" && Reflect.construct) {
235
- try {
236
- Reflect.construct(h, []);
237
- } catch (B) {
238
- d = B;
239
- }
240
- Reflect.construct(e, [], h);
241
- } else {
242
- try {
243
- h.call();
244
- } catch (B) {
245
- d = B;
246
- }
247
- e.call(h.prototype);
248
- }
249
- } else {
250
- try {
251
- throw Error();
252
- } catch (B) {
253
- d = B;
254
- }
255
- e();
256
- }
257
- } catch (B) {
258
- if (B && d && typeof B.stack == "string") {
259
- for (var v = B.stack.split(`
260
- `), U = d.stack.split(`
261
- `), T = v.length - 1, F = U.length - 1; T >= 1 && F >= 0 && v[T] !== U[F]; )
262
- F--;
263
- for (; T >= 1 && F >= 0; T--, F--)
264
- if (v[T] !== U[F]) {
265
- if (T !== 1 || F !== 1)
266
- do
267
- if (T--, F--, F < 0 || v[T] !== U[F]) {
268
- var J = `
269
- ` + v[T].replace(" at new ", " at ");
270
- return e.displayName && J.includes("<anonymous>") && (J = J.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, J), J;
271
- }
272
- while (T >= 1 && F >= 0);
273
- break;
274
- }
275
- }
276
- } finally {
277
- q = !1, O.current = x, Ge(), Error.prepareStackTrace = b;
278
- }
279
- var Pe = e ? e.displayName || e.name : "", xe = Pe ? fe(Pe) : "";
280
- return typeof e == "function" && K.set(e, xe), xe;
281
- }
282
- function Ne(e, n, i) {
283
- return Oe(e, !1);
284
- }
285
- function We(e) {
286
- var n = e.prototype;
287
- return !!(n && n.isReactComponent);
288
- }
289
- function $(e, n, i) {
290
- if (e == null)
291
- return "";
292
- if (typeof e == "function")
293
- return Oe(e, We(e));
294
- if (typeof e == "string")
295
- return fe(e);
296
- switch (e) {
297
- case R:
298
- return fe("Suspense");
299
- case y:
300
- return fe("SuspenseList");
301
- }
302
- if (typeof e == "object")
303
- switch (e.$$typeof) {
304
- case g:
305
- return Ne(e.render);
306
- case m:
307
- return $(e.type, n, i);
308
- case A: {
309
- var d = e, b = d._payload, x = d._init;
310
- try {
311
- return $(x(b), n, i);
312
- } catch {
313
- }
314
- }
315
- }
316
- return "";
317
- }
318
- var ae = Object.prototype.hasOwnProperty, Me = {}, je = X.ReactDebugCurrentFrame;
319
- function be(e) {
320
- if (e) {
321
- var n = e._owner, i = $(e.type, e._source, n ? n.type : null);
322
- je.setExtraStackFrame(i);
323
- } else
324
- je.setExtraStackFrame(null);
325
- }
326
- function rt(e, n, i, d, b) {
327
- {
328
- var x = Function.call.bind(ae);
329
- for (var h in e)
330
- if (x(e, h)) {
331
- var v = void 0;
332
- try {
333
- if (typeof e[h] != "function") {
334
- var U = Error((d || "React class") + ": " + i + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
- throw U.name = "Invariant Violation", U;
336
- }
337
- v = e[h](n, h, d, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
338
- } catch (T) {
339
- v = T;
340
- }
341
- v && !(v instanceof Error) && (be(b), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class", i, h, typeof v), be(null)), v instanceof Error && !(v.message in Me) && (Me[v.message] = !0, be(b), P("Failed %s type: %s", i, v.message), be(null));
342
- }
343
- }
344
- }
345
- var Be = Array.isArray;
346
- function ze(e) {
347
- return Be(e);
348
- }
349
- function vt(e) {
350
- {
351
- var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
352
- return i;
353
- }
354
- }
355
- function gt(e) {
356
- try {
357
- return nt(e), !1;
358
- } catch {
359
- return !0;
360
- }
361
- }
362
- function nt(e) {
363
- return "" + e;
364
- }
365
- function $e(e) {
366
- if (gt(e))
367
- return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", vt(e)), nt(e);
368
- }
369
- var u = X.ReactCurrentOwner, p = {
370
- key: !0,
371
- ref: !0,
372
- __self: !0,
373
- __source: !0
374
- }, S, Y, V;
375
- V = {};
376
- function W(e) {
377
- if (ae.call(e, "ref")) {
378
- var n = Object.getOwnPropertyDescriptor(e, "ref").get;
379
- if (n && n.isReactWarning)
380
- return !1;
381
- }
382
- return e.ref !== void 0;
383
- }
384
- function de(e) {
385
- if (ae.call(e, "key")) {
386
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
387
- if (n && n.isReactWarning)
388
- return !1;
389
- }
390
- return e.key !== void 0;
391
- }
392
- function Q(e, n) {
393
- if (typeof e.ref == "string" && u.current && n && u.current.stateNode !== n) {
394
- var i = G(u.current.type);
395
- V[i] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', G(u.current.type), e.ref), V[i] = !0);
396
- }
397
- }
398
- function E(e, n) {
399
- {
400
- var i = function() {
401
- S || (S = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
402
- };
403
- i.isReactWarning = !0, Object.defineProperty(e, "key", {
404
- get: i,
405
- configurable: !0
406
- });
407
- }
408
- }
409
- function D(e, n) {
410
- {
411
- var i = function() {
412
- Y || (Y = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
413
- };
414
- i.isReactWarning = !0, Object.defineProperty(e, "ref", {
415
- get: i,
416
- configurable: !0
417
- });
418
- }
419
- }
420
- var _ = function(e, n, i, d, b, x, h) {
421
- var v = {
422
- // This tag allows us to uniquely identify this as a React Element
423
- $$typeof: r,
424
- // Built-in properties that belong on the element
425
- type: e,
426
- key: n,
427
- ref: i,
428
- props: h,
429
- // Record the component responsible for creating this element.
430
- _owner: x
431
- };
432
- return v._store = {}, Object.defineProperty(v._store, "validated", {
433
- configurable: !1,
434
- enumerable: !1,
435
- writable: !0,
436
- value: !1
437
- }), Object.defineProperty(v, "_self", {
438
- configurable: !1,
439
- enumerable: !1,
440
- writable: !1,
441
- value: d
442
- }), Object.defineProperty(v, "_source", {
443
- configurable: !1,
444
- enumerable: !1,
445
- writable: !1,
446
- value: b
447
- }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
448
- };
449
- function se(e, n, i, d, b) {
450
- {
451
- var x, h = {}, v = null, U = null;
452
- i !== void 0 && ($e(i), v = "" + i), de(n) && ($e(n.key), v = "" + n.key), W(n) && (U = n.ref, Q(n, b));
453
- for (x in n)
454
- ae.call(n, x) && !p.hasOwnProperty(x) && (h[x] = n[x]);
455
- if (e && e.defaultProps) {
456
- var T = e.defaultProps;
457
- for (x in T)
458
- h[x] === void 0 && (h[x] = T[x]);
459
- }
460
- if (v || U) {
461
- var F = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
462
- v && E(h, F), U && D(h, F);
463
- }
464
- return _(e, v, U, b, d, u.current, h);
465
- }
466
- }
467
- var pe = X.ReactCurrentOwner, Te = X.ReactDebugCurrentFrame;
468
- function j(e) {
469
- if (e) {
470
- var n = e._owner, i = $(e.type, e._source, n ? n.type : null);
471
- Te.setExtraStackFrame(i);
472
- } else
473
- Te.setExtraStackFrame(null);
474
- }
475
- var Ce;
476
- Ce = !1;
477
- function Ee(e) {
478
- return typeof e == "object" && e !== null && e.$$typeof === r;
479
- }
480
- function Ae() {
481
- {
482
- if (pe.current) {
483
- var e = G(pe.current.type);
484
- if (e)
485
- return `
486
-
487
- Check the render method of \`` + e + "`.";
488
- }
489
- return "";
490
- }
491
- }
492
- function Ke(e) {
493
- return "";
494
- }
495
- var ve = {};
496
- function He(e) {
497
- {
498
- var n = Ae();
499
- if (!n) {
500
- var i = typeof e == "string" ? e : e.displayName || e.name;
501
- i && (n = `
502
-
503
- Check the top-level render call using <` + i + ">.");
504
- }
505
- return n;
506
- }
507
- }
508
- function mt(e, n) {
509
- {
510
- if (!e._store || e._store.validated || e.key != null)
511
- return;
512
- e._store.validated = !0;
513
- var i = He(n);
514
- if (ve[i])
515
- return;
516
- ve[i] = !0;
517
- var d = "";
518
- e && e._owner && e._owner !== pe.current && (d = " It was passed a child from " + G(e._owner.type) + "."), j(e), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, d), j(null);
519
- }
520
- }
521
- function ht(e, n) {
522
- {
523
- if (typeof e != "object")
524
- return;
525
- if (ze(e))
526
- for (var i = 0; i < e.length; i++) {
527
- var d = e[i];
528
- Ee(d) && mt(d, n);
529
- }
530
- else if (Ee(e))
531
- e._store && (e._store.validated = !0);
532
- else if (e) {
533
- var b = te(e);
534
- if (typeof b == "function" && b !== e.entries)
535
- for (var x = b.call(e), h; !(h = x.next()).done; )
536
- Ee(h.value) && mt(h.value, n);
537
- }
538
- }
539
- }
540
- function Dt(e) {
541
- {
542
- var n = e.type;
543
- if (n == null || typeof n == "string")
544
- return;
545
- var i;
546
- if (typeof n == "function")
547
- i = n.propTypes;
548
- else if (typeof n == "object" && (n.$$typeof === g || // Note: Memo only checks outer props here.
549
- // Inner props are checked in the reconciler.
550
- n.$$typeof === m))
551
- i = n.propTypes;
552
- else
553
- return;
554
- if (i) {
555
- var d = G(n);
556
- rt(i, e.props, "prop", d, e);
557
- } else if (n.PropTypes !== void 0 && !Ce) {
558
- Ce = !0;
559
- var b = G(n);
560
- P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
561
- }
562
- typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
563
- }
564
- }
565
- function Lt(e) {
566
- {
567
- for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
568
- var d = n[i];
569
- if (d !== "children" && d !== "key") {
570
- j(e), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), j(null);
571
- break;
572
- }
573
- }
574
- e.ref !== null && (j(e), P("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
575
- }
576
- }
577
- var yt = {};
578
- function bt(e, n, i, d, b, x) {
579
- {
580
- var h = M(e);
581
- if (!h) {
582
- var v = "";
583
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
584
- var U = Ke();
585
- U ? v += U : v += Ae();
586
- var T;
587
- e === null ? T = "null" : ze(e) ? T = "array" : e !== void 0 && e.$$typeof === r ? (T = "<" + (G(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : T = typeof e, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, v);
588
- }
589
- var F = se(e, n, i, b, x);
590
- if (F == null)
591
- return F;
592
- if (h) {
593
- var J = n.children;
594
- if (J !== void 0)
595
- if (d)
596
- if (ze(J)) {
597
- for (var Pe = 0; Pe < J.length; Pe++)
598
- ht(J[Pe], e);
599
- Object.freeze && Object.freeze(J);
600
- } else
601
- P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
602
- else
603
- ht(J, e);
604
- }
605
- if (ae.call(n, "key")) {
606
- var xe = G(e), B = Object.keys(n).filter(function(Vt) {
607
- return Vt !== "key";
608
- }), ot = B.length > 0 ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}";
609
- if (!yt[xe + ot]) {
610
- var Yt = B.length > 0 ? "{" + B.join(": ..., ") + ": ...}" : "{}";
611
- P(`A props object containing a "key" prop is being spread into JSX:
612
- let props = %s;
613
- <%s {...props} />
614
- React keys must be passed directly to JSX without using spread:
615
- let props = %s;
616
- <%s key={someKey} {...props} />`, ot, xe, Yt, xe), yt[xe + ot] = !0;
617
- }
618
- }
619
- return e === s ? Lt(F) : Dt(F), F;
620
- }
621
- }
622
- function Nt(e, n, i) {
623
- return bt(e, n, i, !0);
624
- }
625
- function Wt(e, n, i) {
626
- return bt(e, n, i, !1);
627
- }
628
- var Mt = Wt, $t = Nt;
629
- Ve.Fragment = s, Ve.jsx = Mt, Ve.jsxs = $t;
630
- }()), Ve;
20
+ function Ft(e) {
21
+ return e == null ? void 0 : e[0];
631
22
  }
632
- process.env.NODE_ENV === "production" ? it.exports = ir() : it.exports = ur();
633
- var C = it.exports;
634
- const [lr, ge] = cr();
635
- function cr() {
636
- const t = Ze.createContext(void 0);
637
- t.displayName = "AutoCompleteContext";
638
- function r() {
639
- var a;
640
- const o = Ze.useContext(t), s = "useAutoCompleteContext: `context` is undefined. Seems you forgot to wrap all autoomplete components within `<AutoComplete />`";
641
- if (!o) {
642
- const l = new Error(s);
643
- throw l.name = "ContextError", (a = Error.captureStackTrace) == null || a.call(Error, l, r), l;
644
- }
645
- return o;
646
- }
647
- return [t.Provider, r, t];
23
+ function Ne(e) {
24
+ return e != null && e.length ? e[e.length - 1] : void 0;
648
25
  }
649
- function fr(t) {
650
- return t == null ? void 0 : t[0];
26
+ function et(e, t, n = 1, r = !0) {
27
+ if (t === 0) return -1;
28
+ let o = e + n;
29
+ return e === -1 && (o = n > 0 ? 0 : t - 1), r ? o = (o % t + t) % t : o = Math.max(0, Math.min(o, t - 1)), o;
651
30
  }
652
- function st(t) {
653
- return t != null && t.length ? t[t.length - 1] : void 0;
31
+ function Lt(e, t, n = !0) {
32
+ return et(e, t, -1, n);
654
33
  }
655
- function At(t, r, o = 1, s = !0) {
656
- if (r === 0) return -1;
657
- let a = t + o;
658
- return t === -1 && (a = o > 0 ? 0 : r - 1), s ? a = (a % r + r) % r : a = Math.max(0, Math.min(a, r - 1)), a;
34
+ function Nt(e, t, n = !0) {
35
+ const r = et(e, t.length, 1, n);
36
+ return t[r];
659
37
  }
660
- function dr(t, r, o = !0) {
661
- return At(t, r, -1, o);
38
+ function Pt(e, t, n = !0) {
39
+ const r = Lt(e, t.length, n);
40
+ return t[r];
662
41
  }
663
- function pr(t, r, o = !0) {
664
- const s = At(t, r.length, 1, o);
665
- return r[s];
42
+ function De(e) {
43
+ return Array.isArray(e);
666
44
  }
667
- function vr(t, r, o = !0) {
668
- const s = dr(t, r.length, o);
669
- return r[s];
45
+ function Dt(e) {
46
+ return De(e) && e.length === 0;
670
47
  }
671
- function lt(t) {
672
- return Array.isArray(t);
48
+ function Re(e) {
49
+ return e !== null && typeof e == "object" && !De(e);
673
50
  }
674
- function gr(t) {
675
- return lt(t) && t.length === 0;
51
+ function Rt(e) {
52
+ return Re(e) && Object.keys(e).length === 0;
676
53
  }
677
- function ct(t) {
678
- return t !== null && typeof t == "object" && !lt(t);
54
+ function Te(e) {
55
+ return De(e) ? Dt(e) : Re(e) ? Rt(e) : e == null || e === "";
679
56
  }
680
- function mr(t) {
681
- return ct(t) && Object.keys(t).length === 0;
57
+ function ce(e) {
58
+ return typeof e > "u";
682
59
  }
683
- function ft(t) {
684
- return lt(t) ? gr(t) : ct(t) ? mr(t) : t == null || t === "";
60
+ function tt(e) {
61
+ return typeof e < "u";
685
62
  }
686
- function Qe(t) {
687
- return typeof t > "u";
63
+ function Tt(e, t) {
64
+ const n = {};
65
+ return t.forEach((r) => {
66
+ r in e && (n[r] = e[r]);
67
+ }), n;
688
68
  }
689
- function Pt(t) {
690
- return typeof t < "u";
69
+ function Me(e, t) {
70
+ const n = { ...e };
71
+ return t.forEach((r) => {
72
+ delete n[r];
73
+ }), n;
691
74
  }
692
- function hr(t, r) {
693
- const o = {};
694
- return r.forEach((s) => {
695
- s in t && (o[s] = t[s]);
696
- }), o;
75
+ function Mt(e) {
76
+ return typeof e == "function";
697
77
  }
698
- function dt(t, r) {
699
- const o = { ...t };
700
- return r.forEach((s) => {
701
- delete o[s];
702
- }), o;
78
+ function m(e, ...t) {
79
+ return Mt(e) ? e(...t) : e;
703
80
  }
704
- function yr(t) {
705
- return typeof t == "function";
706
- }
707
- function k(t, ...r) {
708
- return yr(t) ? t(...r) : t;
709
- }
710
- var et = function(t, r) {
711
- for (var o, s = Ze.Children.toArray(t), a = 0, l = s; a < l.length; a++) {
712
- var c = l[a];
713
- if (r(c))
714
- return c;
715
- if (!((o = c.props) === null || o === void 0) && o.children) {
716
- var f = et(c.props.children, r);
717
- if (f)
718
- return f;
81
+ var de = function(e, t) {
82
+ for (var n, r = fe.Children.toArray(e), o = 0, l = r; o < l.length; o++) {
83
+ var i = l[o];
84
+ if (t(i))
85
+ return i;
86
+ if (!((n = i.props) === null || n === void 0) && n.children) {
87
+ var u = de(i.props.children, t);
88
+ if (u)
89
+ return u;
719
90
  }
720
91
  }
721
- }, Xe = function(t, r) {
722
- for (var o = 0, s = r.length, a = t.length; o < s; o++, a++)
723
- t[a] = r[o];
724
- return t;
725
- }, It = function(t, r) {
726
- for (var o, s = Ze.Children.toArray(t), a = [], l = 0, c = s; l < c.length; l++) {
727
- var f = c[l];
728
- r(f) && (a = Xe(Xe([], a), [f])), !((o = f.props) === null || o === void 0) && o.children && (a = Xe(Xe([], a), It(f.props.children, r)));
92
+ }, ae = function(e, t) {
93
+ for (var n = 0, r = t.length, o = e.length; n < r; n++, o++)
94
+ e[o] = t[n];
95
+ return e;
96
+ }, nt = function(e, t) {
97
+ for (var n, r = fe.Children.toArray(e), o = [], l = 0, i = r; l < i.length; l++) {
98
+ var u = i[l];
99
+ t(u) && (o = ae(ae([], o), [u])), !((n = u.props) === null || n === void 0) && n.children && (o = ae(ae([], o), nt(u.props.children, t)));
729
100
  }
730
- return a;
101
+ return o;
731
102
  };
732
- function Rt(t, r, o = 2) {
733
- function s(m, A) {
734
- m = " ".repeat(A - 1) + m.toLowerCase() + " ".repeat(A - 1);
735
- let w = new Array(m.length - A + 1);
736
- for (let L = 0; L < w.length; L++)
737
- w[L] = m.slice(L, L + A);
738
- return w;
103
+ function $e(e, t, n = 2) {
104
+ function r(c, O) {
105
+ c = " ".repeat(O - 1) + c.toLowerCase() + " ".repeat(O - 1);
106
+ let C = new Array(c.length - O + 1);
107
+ for (let I = 0; I < C.length; I++)
108
+ C[I] = c.slice(I, I + O);
109
+ return C;
739
110
  }
740
- if (!(t != null && t.length) || !(r != null && r.length))
111
+ if (!(e != null && e.length) || !(t != null && t.length))
741
112
  return 0;
742
- let a = t.length < r.length ? t : r, l = t.length < r.length ? r : t, c = s(a, o), f = s(l, o), g = new Set(c), R = f.length, y = 0;
743
- for (let m of f)
744
- g.delete(m) && y++;
745
- return y / R;
113
+ let o = e.length < t.length ? e : t, l = e.length < t.length ? t : e, i = r(o, n), u = r(l, n), v = new Set(i), h = u.length, b = 0;
114
+ for (let c of u)
115
+ v.delete(c) && b++;
116
+ return b / h;
746
117
  }
747
- const pt = (t) => {
748
- var r;
749
- return (r = typeof t == "string" || typeof t == "number" ? t : t[Object.keys(t)[0]]) == null ? void 0 : r.toString();
750
- }, br = (t, r) => typeof t != "string" || ft(r) ? t : t.toString().replace(
751
- new RegExp(Rr(r), "gi"),
752
- (s) => `<mark>${s}</mark>`
753
- ), Cr = (t) => It(
754
- t,
755
- (o) => {
756
- var s;
757
- return ((s = o == null ? void 0 : o.type) == null ? void 0 : s.displayName) === "AutoCompleteItem";
118
+ const _e = (e) => {
119
+ var t;
120
+ return (t = typeof e == "string" || typeof e == "number" ? e : e[Object.keys(e)[0]]) == null ? void 0 : t.toString();
121
+ }, _t = (e, t) => typeof e != "string" || Te(t) ? e : e.toString().replace(
122
+ new RegExp(kt(t), "gi"),
123
+ (r) => `<mark>${r}</mark>`
124
+ ), Gt = (e) => nt(
125
+ e,
126
+ (n) => {
127
+ var r;
128
+ return ((r = n == null ? void 0 : n.type) == null ? void 0 : r.displayName) === "AutoCompleteItem";
758
129
  }
759
- ).map((o) => {
760
- const s = hr(o.props, ["value", "label", "fixed", "disabled"]), { getValue: a = pt } = o.props, l = a(s.value);
761
- return { ...Pt(s.label) ? s : { ...s, label: l }, value: l, originalValue: s.value };
762
- }), Er = () => ({
130
+ ).map((n) => {
131
+ const r = Tt(n.props, ["value", "label", "fixed", "disabled"]), { getValue: o = _e } = n.props, l = o(r.value);
132
+ return { ...tt(r.label) ? r : { ...r, label: l }, value: l, originalValue: r.value };
133
+ }), Wt = () => ({
763
134
  bg: "whiteAlpha.100",
764
135
  _light: {
765
136
  bg: "gray.200"
766
137
  }
767
- }), xr = (t, r, o) => (r == null ? void 0 : r.toLowerCase().indexOf(t == null ? void 0 : t.toLowerCase())) >= 0 || (o == null ? void 0 : o.toLowerCase().indexOf(t == null ? void 0 : t.toLowerCase())) >= 0 || Rt(t, r) >= 0.5 || Rt(t, o) >= 0.5;
768
- function Rr(t) {
769
- return t.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
138
+ }), jt = (e, t, n) => (t == null ? void 0 : t.toLowerCase().indexOf(e == null ? void 0 : e.toLowerCase())) >= 0 || (n == null ? void 0 : n.toLowerCase().indexOf(e == null ? void 0 : e.toLowerCase())) >= 0 || $e(e, t) >= 0.5 || $e(e, n) >= 0.5;
139
+ function kt(e) {
140
+ return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
770
141
  }
771
- const Sr = (t, r) => et(
772
- t,
773
- (s) => {
774
- var a;
775
- return ((a = s == null ? void 0 : s.type) == null ? void 0 : a.displayName) === "AutoCompleteItem" && s.props.value === (r == null ? void 0 : r.value);
142
+ const zt = (e, t) => de(
143
+ e,
144
+ (r) => {
145
+ var o;
146
+ return ((o = r == null ? void 0 : r.type) == null ? void 0 : o.displayName) === "AutoCompleteItem" && r.props.value === (t == null ? void 0 : t.value);
776
147
  }
777
- ), _r = (t, r) => et(
778
- t,
779
- (s) => {
780
- var a;
781
- return ((a = s == null ? void 0 : s.type) == null ? void 0 : a.displayName) === "AutoCompleteItem" && s.props.value === (r == null ? void 0 : r.value);
148
+ ), Bt = (e, t) => de(
149
+ e,
150
+ (r) => {
151
+ var o;
152
+ return ((o = r == null ? void 0 : r.type) == null ? void 0 : o.displayName) === "AutoCompleteItem" && r.props.value === (t == null ? void 0 : t.value);
782
153
  }
783
- ), wr = (t, r) => Pt(
784
- et(t, (o) => {
785
- var a, l;
786
- const s = k(
787
- ((a = o.props) == null ? void 0 : a.getValue) || pt,
788
- ((l = o.props) == null ? void 0 : l.value) || {}
154
+ ), Ht = (e, t) => tt(
155
+ de(e, (n) => {
156
+ var o, l;
157
+ const r = m(
158
+ ((o = n.props) == null ? void 0 : o.getValue) || _e,
159
+ ((l = n.props) == null ? void 0 : l.value) || {}
789
160
  );
790
- return r.some((c) => c.value === s);
161
+ return t.some((i) => i.value === r);
791
162
  })
792
- ), Or = (t, r) => {
793
- const o = {}, s = {}, { field: a } = t;
794
- return a && Object.keys(a).forEach((l) => {
163
+ ), Ut = (e, t) => {
164
+ const n = {}, r = {}, { field: o } = e;
165
+ return o && Object.keys(o).forEach((l) => {
795
166
  if (l.startsWith("--input") === !1)
796
- o[l] = a[l];
167
+ n[l] = o[l];
797
168
  else {
798
- let c = a[l];
799
- const g = l.replace("--input-", "").replace(/-([a-z])/g, function(R) {
800
- return R[1].toUpperCase();
169
+ let i = o[l];
170
+ const v = l.replace("--input-", "").replace(/-([a-z])/g, function(h) {
171
+ return h[1].toUpperCase();
801
172
  });
802
- c.indexOf(".") !== -1 && (c = c.substring(c.indexOf(".") + 1)), s[g] = c;
173
+ i.indexOf(".") !== -1 && (i = i.substring(i.indexOf(".") + 1)), r[v] = i;
803
174
  }
804
175
  }), {
805
- ...r && {
806
- ...o,
807
- ...s,
808
- _focusWithin: t.field._focus,
176
+ ...t && {
177
+ ...n,
178
+ ...r,
179
+ _focusWithin: e.field._focus,
809
180
  pos: "relative",
810
181
  minH: 9,
811
182
  // px: 3,
@@ -817,542 +188,542 @@ const Sr = (t, r) => et(
817
188
  // w: "full",
818
189
  };
819
190
  };
820
- function jr(t) {
821
- var $e;
191
+ function Vt(e) {
192
+ var He;
822
193
  let {
823
- prefocusFirstItem: r = !0,
824
- closeOnBlur: o = !0,
825
- creatable: s,
826
- emphasize: a,
194
+ prefocusFirstItem: t = !0,
195
+ closeOnBlur: n = !0,
196
+ creatable: r,
197
+ emphasize: o,
827
198
  emptyState: l = !0,
828
- defaultEmptyStateProps: c = {},
829
- freeSolo: f,
830
- isReadOnly: g,
831
- listAllValuesOnFocus: R,
832
- maxSuggestions: y,
833
- multiple: m,
834
- closeOnSelect: A = !m,
835
- defaultValue: w,
836
- defaultValues: L = w ? [w] : [],
837
- onReady: ie,
838
- defaultIsOpen: te,
839
- disableFilter: X,
840
- isLoading: P = !1,
841
- placement: _e = "bottom",
842
- restoreOnBlurIfEmpty: me = !f,
843
- shouldRenderSuggestions: Ie = () => !0,
844
- submitKeys: Fe = [],
845
- suggestWhenEmpty: we,
846
- value: re,
847
- values: ue = re ? typeof re == "string" ? [re] : [...re] : void 0
848
- } = t;
849
- f = f || (m ? !0 : t.freeSolo);
850
- const { isOpen: M, onClose: Z, onOpen: ne } = Bt({ defaultIsOpen: te }), G = Je(
851
- () => k(t.children, {
852
- isOpen: M,
853
- onClose: Z,
854
- onOpen: ne
199
+ defaultEmptyStateProps: i = {},
200
+ freeSolo: u,
201
+ isReadOnly: v,
202
+ listAllValuesOnFocus: h,
203
+ maxSuggestions: b,
204
+ multiple: c,
205
+ closeOnSelect: O = !c,
206
+ defaultValue: C,
207
+ defaultValues: I = C ? [C] : [],
208
+ onReady: H,
209
+ defaultIsOpen: j,
210
+ disableFilter: ne,
211
+ isLoading: ge = !1,
212
+ placement: oe = "bottom",
213
+ restoreOnBlurIfEmpty: Y = !u,
214
+ shouldRenderSuggestions: me = () => !0,
215
+ submitKeys: ve = [],
216
+ suggestWhenEmpty: re,
217
+ value: k,
218
+ values: J = k ? typeof k == "string" ? [k] : [...k] : void 0
219
+ } = e;
220
+ u = u || (c ? !0 : e.freeSolo);
221
+ const { isOpen: w, onClose: _, onOpen: U } = ct({ defaultIsOpen: j }), he = ue(
222
+ () => m(e.children, {
223
+ isOpen: w,
224
+ onClose: _,
225
+ onOpen: U
855
226
  }),
856
- [t.children, M]
857
- ), I = Je(() => Cr(G), [G]), N = Ue(null), ke = Ue(null), le = Ue(null), oe = Ue(null), [De, he] = at(!1);
858
- let ye = "";
859
- m ? ye = "" : Qe(L) ? Qe(ue) || (ye = ue[0]) : ye = L[0];
860
- const [H, ce] = at(ye ?? ""), Le = Je(
861
- () => X ? I : I.filter(
862
- (u) => u.fixed || k(
863
- t.filter || xr,
864
- H,
865
- u.value,
866
- u.label
867
- ) || De
227
+ [e.children, w]
228
+ ), E = ue(() => Gt(he), [he]), N = te(null), Ge = te(null), X = te(null), V = te(null), [We, se] = Le(!1);
229
+ let le = "";
230
+ c ? le = "" : ce(I) ? ce(J) || (le = J[0]) : le = I[0];
231
+ const [R, Z] = Le(le ?? ""), ye = ue(
232
+ () => ne ? E : E.filter(
233
+ (s) => s.fixed || m(
234
+ e.filter || jt,
235
+ R,
236
+ s.value,
237
+ s.label
238
+ ) || We
868
239
  ).filter(
869
- (u, p) => y ? u.fixed || p < y : !0
240
+ (s, a) => b ? s.fixed || a < b : !0
870
241
  ),
871
- [H, I, De, y, X]
872
- ), Ge = s ? [{ value: H, noFilter: !0, creatable: !0 }] : [], O = Je(() => [...Le, ...Ge], [Le, Ge]), [z, fe] = zt({
873
- defaultValue: L.map((u) => u == null ? void 0 : u.toString()),
874
- value: ue,
875
- onChange: (u) => {
876
- const p = O.find((Y) => Y.value === u[0]);
877
- if (!p) return;
878
- const S = u.map(
879
- (Y) => O.find((V) => V.value === Y)
242
+ [R, E, We, b, ne]
243
+ ), je = r ? [{ value: R, noFilter: !0, creatable: !0 }] : [], y = ue(() => [...ye, ...je], [ye, je]), [T, be] = ft({
244
+ defaultValue: I.map((s) => s == null ? void 0 : s.toString()),
245
+ value: J,
246
+ onChange: (s) => {
247
+ const a = y.find((F) => F.value === s[0]);
248
+ if (!a) return;
249
+ const d = s.map(
250
+ (F) => y.find((L) => L.value === F)
880
251
  );
881
- k(
882
- t.onChange,
883
- m ? u : u[0],
884
- m ? S : p
252
+ m(
253
+ e.onChange,
254
+ c ? s : s[0],
255
+ c ? d : a
885
256
  );
886
257
  }
887
258
  });
888
- ee(() => {
889
- O.length === 0 && !l && M && Z();
890
- }, [O.length, l, M]);
891
- const [q, K] = at(
892
- r ? ($e = I[0]) == null ? void 0 : $e.value : null
893
- ), tt = t.maxSelections || z.length + 1, Oe = O.findIndex((u) => u.value === q), Ne = pr(
894
- Oe,
895
- O,
896
- !!t.rollNavigation
897
- ), We = vr(
898
- Oe,
899
- O,
900
- !!t.rollNavigation
901
- ), $ = fr(O), ae = st(O), Me = !O.some(
902
- (u) => u.value === q
259
+ D(() => {
260
+ y.length === 0 && !l && w && _();
261
+ }, [y.length, l, w]);
262
+ const [Q, G] = Le(
263
+ t ? (He = E[0]) == null ? void 0 : He.value : null
264
+ ), st = e.maxSelections || T.length + 1, Ce = y.findIndex((s) => s.value === Q), Se = Nt(
265
+ Ce,
266
+ y,
267
+ !!e.rollNavigation
268
+ ), xe = Pt(
269
+ Ce,
270
+ y,
271
+ !!e.rollNavigation
272
+ ), P = Ft(y), Ae = Ne(y), ke = !y.some(
273
+ (s) => s.value === Q
903
274
  );
904
- ee(() => {
905
- var u;
906
- Me && K(r ? (u = I[0]) == null ? void 0 : u.value : null);
907
- }, [Me]), Kt(() => {
908
- r && K($ == null ? void 0 : $.value);
909
- }, [H, $ == null ? void 0 : $.value]), ee(() => {
910
- var u;
911
- !M && r && K((u = I[0]) == null ? void 0 : u.value);
912
- }, [M]), ee(() => {
913
- M && R && he(!0);
914
- }, [M, R, he]), ee(() => {
915
- const u = I.find((p) => p.value === q);
916
- k(t.onOptionFocus, {
917
- item: u,
918
- focusMethod: oe.current,
919
- isNewInput: u == null ? void 0 : u.creatable
275
+ D(() => {
276
+ var s;
277
+ ke && G(t ? (s = E[0]) == null ? void 0 : s.value : null);
278
+ }, [ke]), pt(() => {
279
+ t && G(P == null ? void 0 : P.value);
280
+ }, [R, P == null ? void 0 : P.value]), D(() => {
281
+ var s;
282
+ !w && t && G((s = E[0]) == null ? void 0 : s.value);
283
+ }, [w]), D(() => {
284
+ w && h && se(!0);
285
+ }, [w, h, se]), D(() => {
286
+ const s = E.find((a) => a.value === Q);
287
+ m(e.onOptionFocus, {
288
+ item: s,
289
+ focusMethod: V.current,
290
+ isNewInput: s == null ? void 0 : s.creatable
920
291
  });
921
- }, [q, t.onOptionFocus]);
922
- const je = (u) => {
923
- var Y, V;
924
- const p = O.find((W) => W.value === u), S = (p == null ? void 0 : p.label) || (p == null ? void 0 : p.value);
925
- ce(() => m ? "" : S ?? ""), !z.includes(u) && z.length < tt && fe((W) => m ? [...W, u] : [u]), m && ((Y = N.current) == null || Y.focus()), t.focusInputOnSelect && ((V = N.current) == null || V.focus()), k(t.onSelectOption, {
926
- item: p,
927
- selectMethod: oe.current,
928
- isNewInput: p == null ? void 0 : p.creatable
929
- }), p != null && p.creatable && k(t.onCreateOption, {
930
- item: dt(p, ["noFilter"]),
931
- selectMethod: oe.current
932
- }), A && Z();
933
- }, be = (u, p) => {
934
- var V;
935
- fe((W) => {
936
- const de = I.find((Q) => Q.value === u);
937
- return de ? (k(t.onTagRemoved, u, de, W), W.filter((Q) => Q !== u)) : W;
292
+ }, [Q, e.onOptionFocus]);
293
+ const Ie = (s) => {
294
+ var F, L;
295
+ const a = y.find((x) => x.value === s), d = (a == null ? void 0 : a.label) || (a == null ? void 0 : a.value);
296
+ Z(() => c ? "" : d ?? ""), !T.includes(s) && T.length < st && be((x) => c ? [...x, s] : [s]), c && ((F = N.current) == null || F.focus()), e.focusInputOnSelect && ((L = N.current) == null || L.focus()), m(e.onSelectOption, {
297
+ item: a,
298
+ selectMethod: V.current,
299
+ isNewInput: a == null ? void 0 : a.creatable
300
+ }), a != null && a.creatable && m(e.onCreateOption, {
301
+ item: Me(a, ["noFilter"]),
302
+ selectMethod: V.current
303
+ }), O && _();
304
+ }, ze = (s, a) => {
305
+ var L;
306
+ be((x) => {
307
+ const $ = E.find((M) => M.value === s);
308
+ return $ ? (m(e.onTagRemoved, s, $, x), x.filter((M) => M !== s)) : x;
938
309
  });
939
- const S = I.find((W) => W.value === u), Y = (S == null ? void 0 : S.label) || (S == null ? void 0 : S.value);
940
- H === Y && ce(""), p && ((V = N.current) == null || V.focus());
941
- }, rt = (u) => {
942
- var p;
943
- fe([]), u && ((p = N.current) == null || p.focus());
944
- }, Be = m ? z.map((u) => {
945
- var p;
310
+ const d = E.find((x) => x.value === s), F = (d == null ? void 0 : d.label) || (d == null ? void 0 : d.value);
311
+ R === F && Z(""), a && ((L = N.current) == null || L.focus());
312
+ }, lt = (s) => {
313
+ var a;
314
+ be([]), s && ((a = N.current) == null || a.focus());
315
+ }, Be = c ? T.map((s) => {
316
+ var a;
946
317
  return {
947
- label: ((p = I.find((S) => S.value === (u == null ? void 0 : u.toString()))) == null ? void 0 : p.label) || u,
948
- onRemove: () => be(u)
318
+ label: ((a = E.find((d) => d.value === (s == null ? void 0 : s.toString()))) == null ? void 0 : a.label) || s,
319
+ onRemove: () => ze(s)
949
320
  };
950
321
  }) : [];
951
- return ee(() => {
952
- k(ie, { tags: Be });
953
- }, [z]), {
954
- autoCompleteProps: t,
955
- children: G,
956
- filteredList: O,
957
- filteredResults: Le,
958
- focusedValue: q,
959
- defaultEmptyStateProps: c,
960
- getEmptyStateProps: (u) => {
961
- if (O.every((S) => S.noFilter) && l && !s)
962
- return typeof l == "boolean" ? u : k(l, { query: H });
322
+ return D(() => {
323
+ m(H, { tags: Be });
324
+ }, [T]), {
325
+ autoCompleteProps: e,
326
+ children: he,
327
+ filteredList: y,
328
+ filteredResults: ye,
329
+ focusedValue: Q,
330
+ defaultEmptyStateProps: i,
331
+ getEmptyStateProps: (s) => {
332
+ if (y.every((d) => d.noFilter) && l && !r)
333
+ return typeof l == "boolean" ? s : m(l, { query: R });
963
334
  },
964
- getGroupProps: (u) => {
965
- const p = wr(u.children, O);
335
+ getGroupProps: (s) => {
336
+ const a = Ht(s.children, y);
966
337
  return {
967
338
  divider: {
968
- hasFirstChild: Sr(u.children, $),
969
- hasLastChild: _r(
970
- u.children,
971
- st(O.filter((S) => Qe(S == null ? void 0 : S.noFilter)))
339
+ hasFirstChild: zt(s.children, P),
340
+ hasLastChild: Bt(
341
+ s.children,
342
+ Ne(y.filter((d) => ce(d == null ? void 0 : d.noFilter)))
972
343
  )
973
344
  },
974
345
  group: {
975
- display: p ? "initial" : "none"
346
+ display: a ? "initial" : "none"
976
347
  }
977
348
  };
978
349
  },
979
- getInputProps: (u, p) => {
980
- const { onBlur: S, onChange: Y, onFocus: V, onKeyDown: W, variant: de, ...Q } = u;
350
+ getInputProps: (s, a) => {
351
+ const { onBlur: d, onChange: F, onFocus: L, onKeyDown: x, variant: $, ...M } = s;
981
352
  return {
982
353
  wrapper: {
983
- ref: ke,
354
+ ref: Ge,
984
355
  onClick: () => {
985
- var E;
986
- (E = N == null ? void 0 : N.current) == null || E.focus();
356
+ var f;
357
+ (f = N == null ? void 0 : N.current) == null || f.focus();
987
358
  },
988
- ...Or(p, m),
989
- ...Q
359
+ ...Ut(a, c),
360
+ ...M
990
361
  },
991
362
  input: {
992
- isReadOnly: g,
993
- onFocus: (E) => {
994
- k(V, E), t.openOnFocus && !g && ne(), t.selectOnFocus && E.target.select(), R && he(!0);
363
+ isReadOnly: v,
364
+ onFocus: (f) => {
365
+ m(L, f), e.openOnFocus && !v && U(), e.selectOnFocus && f.target.select(), h && se(!0);
995
366
  },
996
- onBlur: (E) => {
997
- var se, pe;
998
- k(S, E);
999
- const D = E.relatedTarget === (le == null ? void 0 : le.current) || ((se = le.current) == null ? void 0 : se.contains(E.relatedTarget)), _ = (pe = ke.current) == null ? void 0 : pe.contains(
1000
- E.relatedTarget
367
+ onBlur: (f) => {
368
+ var z, ie;
369
+ m(d, f);
370
+ const S = f.relatedTarget === (X == null ? void 0 : X.current) || ((z = X.current) == null ? void 0 : z.contains(f.relatedTarget)), g = (ie = Ge.current) == null ? void 0 : ie.contains(
371
+ f.relatedTarget
1001
372
  );
1002
- if (!D && !_ && (o && Z(), !z.includes(E.target.value) && me)) {
1003
- const Te = st(z), j = I.find(
1004
- (Ee) => Ee.value === Te
1005
- ), Ce = (j == null ? void 0 : j.label) || (j == null ? void 0 : j.value) || "";
1006
- ce(Ce);
373
+ if (!S && !g && (n && _(), !T.includes(f.target.value) && Y)) {
374
+ const we = Ne(T), A = E.find(
375
+ (Ee) => Ee.value === we
376
+ ), Oe = (A == null ? void 0 : A.label) || (A == null ? void 0 : A.value) || "";
377
+ Z(Oe);
1007
378
  }
1008
379
  },
1009
- onChange: (E) => {
1010
- const D = E.target.value;
1011
- k(Y, E), ce(D);
1012
- const _ = ft(D);
1013
- k(Ie, D) && (!_ || we) ? ne() : Z(), he(!1);
380
+ onChange: (f) => {
381
+ const S = f.target.value;
382
+ m(F, f), Z(S);
383
+ const g = Te(S);
384
+ m(me, S) && (!g || re) ? U() : _(), se(!1);
1014
385
  },
1015
- onKeyDown: (E) => {
1016
- var se;
1017
- k(W, E), oe.current = "keyboard";
1018
- const { key: D } = E, _ = O[Oe];
1019
- if (["Enter", ...Fe].includes(D)) {
1020
- _ && !(_ != null && _.disabled) && M ? je(_ == null ? void 0 : _.value) : (se = N.current) == null || se.focus(), E.preventDefault();
386
+ onKeyDown: (f) => {
387
+ var z;
388
+ m(x, f), V.current = "keyboard";
389
+ const { key: S } = f, g = y[Ce];
390
+ if (["Enter", ...ve].includes(S)) {
391
+ g && !(g != null && g.disabled) && w ? Ie(g == null ? void 0 : g.value) : (z = N.current) == null || z.focus(), f.preventDefault();
1021
392
  return;
1022
393
  }
1023
- if (D === "ArrowDown") {
1024
- M ? K(Ne == null ? void 0 : Ne.value) : ne(), E.preventDefault();
394
+ if (S === "ArrowDown") {
395
+ w ? G(Se == null ? void 0 : Se.value) : U(), f.preventDefault();
1025
396
  return;
1026
397
  }
1027
- if (D === "ArrowUp") {
1028
- M ? K(We == null ? void 0 : We.value) : ne(), E.preventDefault();
398
+ if (S === "ArrowUp") {
399
+ w ? G(xe == null ? void 0 : xe.value) : U(), f.preventDefault();
1029
400
  return;
1030
401
  }
1031
- if (D === "Tab") {
1032
- M && _ && !(_ != null && _.disabled) ? je(_ == null ? void 0 : _.value) : Z();
402
+ if (S === "Tab") {
403
+ w && g && !(g != null && g.disabled) ? Ie(g == null ? void 0 : g.value) : _();
1033
404
  return;
1034
405
  }
1035
- if (D === "Home") {
1036
- K($ == null ? void 0 : $.value), E.preventDefault();
406
+ if (S === "Home") {
407
+ G(P == null ? void 0 : P.value), f.preventDefault();
1037
408
  return;
1038
409
  }
1039
- if (D === "End") {
1040
- K(ae == null ? void 0 : ae.value), E.preventDefault();
410
+ if (S === "End") {
411
+ G(Ae == null ? void 0 : Ae.value), f.preventDefault();
1041
412
  return;
1042
413
  }
1043
- D === "Escape" && (Z(), E.preventDefault());
414
+ S === "Escape" && (_(), f.preventDefault());
1044
415
  },
1045
- value: H,
1046
- variant: m ? "unstyled" : de,
1047
- ...Q
416
+ value: R,
417
+ variant: c ? "unstyled" : $,
418
+ ...M
1048
419
  }
1049
420
  };
1050
421
  },
1051
- getItemProps: (u, p) => {
1052
- var Ke;
422
+ getItemProps: (s, a) => {
423
+ var Ue;
1053
424
  const {
1054
- _fixed: S,
1055
- _focus: Y,
1056
- children: V,
1057
- disabled: W,
1058
- label: de,
1059
- value: Q,
1060
- fixed: E,
1061
- getValue: D = pt,
1062
- onClick: _,
1063
- onMouseOver: se,
1064
- sx: pe,
1065
- ...Te
1066
- } = u, j = p ? Q : (Ke = D(Q)) == null ? void 0 : Ke.toString(), Ce = j === q, Ee = O.findIndex((ve) => ve.value === j) >= 0, Ae = V || de || j;
425
+ _fixed: d,
426
+ _focus: F,
427
+ children: L,
428
+ disabled: x,
429
+ label: $,
430
+ value: M,
431
+ fixed: f,
432
+ getValue: S = _e,
433
+ onClick: g,
434
+ onMouseOver: z,
435
+ sx: ie,
436
+ ...we
437
+ } = s, A = a ? M : (Ue = S(M)) == null ? void 0 : Ue.toString(), Oe = A === Q, Ee = y.findIndex((q) => q.value === A) >= 0, Fe = L || $ || A;
1067
438
  return {
1068
439
  item: {
1069
- ...typeof Ae != "string" || !a ? { children: Ae } : {
440
+ ...typeof Fe != "string" || !o ? { children: Fe } : {
1070
441
  dangerouslySetInnerHTML: {
1071
- __html: br(Ae, H)
442
+ __html: _t(Fe, R)
1072
443
  }
1073
444
  },
1074
- "aria-selected": z.includes(j),
1075
- "aria-disabled": W,
445
+ "aria-selected": T.includes(A),
446
+ "aria-disabled": x,
1076
447
  _disabled: { opacity: 0.4, cursor: "not-allowed", userSelect: "none" },
1077
- onClick: (ve) => {
1078
- var He;
1079
- k(_, ve), W ? (He = N.current) == null || He.focus() : je(j);
448
+ onClick: (q) => {
449
+ var Ve;
450
+ m(g, q), x ? (Ve = N.current) == null || Ve.focus() : Ie(A);
1080
451
  },
1081
- onMouseOver: (ve) => {
1082
- k(se, ve), K(j), oe.current = "mouse";
452
+ onMouseOver: (q) => {
453
+ m(z, q), G(A), V.current = "mouse";
1083
454
  },
1084
455
  sx: {
1085
- ...pe,
456
+ ...ie,
1086
457
  mark: {
1087
458
  color: "inherit",
1088
459
  bg: "transparent",
1089
- ...ct(a) ? a : {
1090
- fontWeight: a ? "extrabold" : "inherit"
460
+ ...Re(o) ? o : {
461
+ fontWeight: o ? "extrabold" : "inherit"
1091
462
  }
1092
463
  }
1093
464
  },
1094
- ...Ce && (Y || Er()),
1095
- ...E && S,
1096
- ...Te
465
+ ...Oe && (F || Wt()),
466
+ ...f && d,
467
+ ...we
1097
468
  },
1098
469
  root: {
1099
470
  isValidSuggestion: Ee,
1100
- value: j
471
+ value: A
1101
472
  }
1102
473
  };
1103
474
  },
1104
475
  inputRef: N,
1105
- interactionRef: oe,
1106
- isLoading: P,
1107
- isOpen: M,
1108
- itemList: I,
1109
- listRef: le,
1110
- onClose: Z,
1111
- onOpen: ne,
1112
- placement: _e,
1113
- query: H,
1114
- removeItem: be,
1115
- resetItems: rt,
1116
- setQuery: ce,
476
+ interactionRef: V,
477
+ isLoading: ge,
478
+ isOpen: w,
479
+ itemList: E,
480
+ listRef: X,
481
+ onClose: _,
482
+ onOpen: U,
483
+ placement: oe,
484
+ query: R,
485
+ removeItem: ze,
486
+ resetItems: lt,
487
+ setQuery: Z,
1117
488
  tags: Be,
1118
- value: re,
1119
- values: z
489
+ value: k,
490
+ values: T
1120
491
  };
1121
492
  }
1122
- const Tr = Se(
1123
- (t, r) => {
1124
- const o = jr(t), {
1125
- children: s,
1126
- isOpen: a,
493
+ const Qt = B(
494
+ (e, t) => {
495
+ const n = Vt(e), {
496
+ children: r,
497
+ isOpen: o,
1127
498
  onClose: l,
1128
- onOpen: c,
1129
- placement: f,
1130
- resetItems: g,
1131
- removeItem: R
1132
- } = o;
1133
- Ut(r, () => ({
1134
- resetItems: g,
1135
- removeItem: R
499
+ onOpen: i,
500
+ placement: u,
501
+ resetItems: v,
502
+ removeItem: h
503
+ } = n;
504
+ ut(t, () => ({
505
+ resetItems: v,
506
+ removeItem: h
1136
507
  }));
1137
- const { matchWidth: y = !0 } = o.autoCompleteProps;
1138
- return /* @__PURE__ */ C.jsx(lr, { value: o, children: /* @__PURE__ */ C.jsx(
1139
- Ht,
508
+ const { matchWidth: b = !0 } = n.autoCompleteProps;
509
+ return /* @__PURE__ */ p(Ot, { value: n, children: /* @__PURE__ */ p(
510
+ dt,
1140
511
  {
1141
512
  isLazy: !0,
1142
- isOpen: a,
513
+ isOpen: o,
1143
514
  onClose: l,
1144
- onOpen: c,
515
+ onOpen: i,
1145
516
  autoFocus: !1,
1146
- placement: f,
517
+ placement: u,
1147
518
  closeOnBlur: !0,
1148
- matchWidth: y,
1149
- children: /* @__PURE__ */ C.jsx(Jt.div, { w: "full", ref: r, children: s })
519
+ matchWidth: b,
520
+ children: /* @__PURE__ */ p(gt.div, { w: "full", ref: t, children: r })
1150
521
  }
1151
522
  ) });
1152
523
  }
1153
524
  );
1154
- Tr.displayName = "AutoComplete";
1155
- const Ar = Se(
1156
- (t, r) => {
525
+ Qt.displayName = "AutoComplete";
526
+ const $t = B(
527
+ (e, t) => {
1157
528
  const {
1158
- focusedValue: o,
1159
- getItemProps: s,
1160
- interactionRef: a
1161
- } = ge(), l = Ue(), c = ut(r, l), f = s(t), { isValidSuggestion: g, value: R } = f.root, y = o === R;
1162
- ee(() => {
1163
- var ie;
1164
- y && a.current === "keyboard" && ((ie = l == null ? void 0 : l.current) == null || ie.scrollIntoView({
529
+ focusedValue: n,
530
+ getItemProps: r,
531
+ interactionRef: o
532
+ } = W(), l = te(), i = Pe(t, l), u = r(e), { isValidSuggestion: v, value: h } = u.root, b = n === h;
533
+ D(() => {
534
+ var H;
535
+ b && o.current === "keyboard" && ((H = l == null ? void 0 : l.current) == null || H.scrollIntoView({
1165
536
  behavior: "smooth",
1166
537
  block: "nearest"
1167
538
  }));
1168
- }, [y, a]), ee(() => {
1169
- typeof R != "string" && console.warn("wow"), typeof R != "string" && Qe(t.getValue) && console.error(
539
+ }, [b, o]), D(() => {
540
+ typeof h != "string" && console.warn("wow"), typeof h != "string" && ce(e.getValue) && console.error(
1170
541
  "You must define the `getValue` prop, when an Item's value is not a string"
1171
542
  );
1172
543
  }, []);
1173
- const { children: m, dangerouslySetInnerHTML: A, ...w } = f.item, L = dt(w, ["groupId"]);
1174
- return g ? /* @__PURE__ */ C.jsx(qe, { ref: c, ...Ft, ...L, children: m || /* @__PURE__ */ C.jsx("span", { dangerouslySetInnerHTML: A }) }) : null;
544
+ const { children: c, dangerouslySetInnerHTML: O, ...C } = u.item, I = Me(C, ["groupId"]);
545
+ return v ? /* @__PURE__ */ p(pe, { ref: i, ...ot, ...I, children: c || /* @__PURE__ */ p("span", { dangerouslySetInnerHTML: O }) }) : null;
1175
546
  }
1176
547
  );
1177
- Ar.displayName = "AutoCompleteItem";
1178
- const Ft = {
548
+ $t.displayName = "AutoCompleteItem";
549
+ const ot = {
1179
550
  mx: "2",
1180
551
  px: "2",
1181
552
  py: "2",
1182
553
  rounded: "md",
1183
554
  cursor: "pointer"
1184
555
  };
1185
- function Pr(t) {
1186
- const { alwaysDisplay: r, children: o, ...s } = t, {
1187
- autoCompleteProps: a,
556
+ function Kt(e) {
557
+ const { alwaysDisplay: t, children: n, ...r } = e, {
558
+ autoCompleteProps: o,
1188
559
  getItemProps: l,
1189
- query: c,
1190
- filteredResults: f
1191
- } = ge(), { children: g, ...R } = l(
560
+ query: i,
561
+ filteredResults: u
562
+ } = W(), { children: v, ...h } = l(
1192
563
  {
1193
- ...t,
1194
- value: c,
1195
- children: k(o, {
1196
- value: c
564
+ ...e,
565
+ value: i,
566
+ children: m(n, {
567
+ value: i
1197
568
  })
1198
569
  },
1199
570
  !0
1200
- ).item, y = f.some((w) => w.value === c), m = ft(c) ? r : !0;
1201
- return a.creatable && m && !y ? /* @__PURE__ */ C.jsx(qe, { ...Ft, ...R, ...s, children: g || `Add ${c}` }) : null;
571
+ ).item, b = u.some((C) => C.value === i), c = Te(i) ? t : !0;
572
+ return o.creatable && c && !b ? /* @__PURE__ */ p(pe, { ...ot, ...h, ...r, children: v || `Add ${i}` }) : null;
1202
573
  }
1203
- Pr.displayName = "AutoCompleteCreatable";
1204
- const Ir = Se(
1205
- (t, r) => {
1206
- const { children: o, showDivider: s, ...a } = t, l = dt(a, ["groupSibling"]), { getGroupProps: c } = ge(), { group: f } = c(t), g = Dr(t);
1207
- return /* @__PURE__ */ C.jsxs(Ot, { ref: r, ...f, ...l, children: [
1208
- /* @__PURE__ */ C.jsx(Ct, { ...g.top }),
1209
- o,
1210
- /* @__PURE__ */ C.jsx(Ct, { ...g.bottom })
574
+ Kt.displayName = "AutoCompleteCreatable";
575
+ const Yt = B(
576
+ (e, t) => {
577
+ const { children: n, showDivider: r, ...o } = e, l = Me(o, ["groupSibling"]), { getGroupProps: i } = W(), { group: u } = i(e), v = Zt(e);
578
+ return /* @__PURE__ */ K(Xe, { ref: t, ...u, ...l, children: [
579
+ /* @__PURE__ */ p(Qe, { ...v.top }),
580
+ n,
581
+ /* @__PURE__ */ p(Qe, { ...v.bottom })
1211
582
  ] });
1212
583
  }
1213
- ), Fr = Se(
1214
- (t, r) => /* @__PURE__ */ C.jsx(qe, { ...kr, ...t, ref: r })
584
+ ), Jt = B(
585
+ (e, t) => /* @__PURE__ */ p(pe, { ...Xt, ...e, ref: t })
1215
586
  );
1216
- Ir.displayName = "AutoCompleteGroup";
1217
- Fr.displayName = "AutoCompleteGroupTitle";
1218
- const kr = {
587
+ Yt.displayName = "AutoCompleteGroup";
588
+ Jt.displayName = "AutoCompleteGroupTitle";
589
+ const Xt = {
1219
590
  ml: 5,
1220
591
  my: 1,
1221
592
  fontSize: "xs",
1222
593
  letterSpacing: "wider",
1223
594
  fontWeight: "extrabold",
1224
595
  textTransform: "uppercase"
1225
- }, Dr = (t) => {
1226
- const { getGroupProps: r } = ge(), o = t.groupSibling, {
1227
- divider: { hasFirstChild: s, hasLastChild: a }
1228
- } = r(t), l = {
596
+ }, Zt = (e) => {
597
+ const { getGroupProps: t } = W(), n = e.groupSibling, {
598
+ divider: { hasFirstChild: r, hasLastChild: o }
599
+ } = t(e), l = {
1229
600
  my: 2,
1230
- borderColor: t.dividerColor
1231
- }, c = {
601
+ borderColor: e.dividerColor
602
+ }, i = {
1232
603
  ...l,
1233
604
  mb: 4,
1234
- display: !t.showDivider || s ? "none" : ""
1235
- }, f = {
605
+ display: !e.showDivider || r ? "none" : ""
606
+ }, u = {
1236
607
  ...l,
1237
- display: !t.showDivider || a || o ? "none" : ""
608
+ display: !e.showDivider || o || n ? "none" : ""
1238
609
  };
1239
- return { top: c, bottom: f };
1240
- }, St = Se((t, r) => {
1241
- const { isLoading: o } = ge(), { loadingIcon: s, ...a } = t;
1242
- return /* @__PURE__ */ C.jsxs(Xt, { children: [
1243
- /* @__PURE__ */ C.jsx(Qt, { ...a, ref: r }),
1244
- o && /* @__PURE__ */ C.jsx(Zt, { children: s || /* @__PURE__ */ C.jsx(jt, {}) })
610
+ return { top: i, bottom: u };
611
+ }, Ke = B((e, t) => {
612
+ const { isLoading: n } = W(), { loadingIcon: r, ...o } = e;
613
+ return /* @__PURE__ */ K(mt, { children: [
614
+ /* @__PURE__ */ p(vt, { ...o, ref: t }),
615
+ n && /* @__PURE__ */ p(ht, { children: r || /* @__PURE__ */ p(Ze, {}) })
1245
616
  ] });
1246
- }), kt = Se(
1247
- (t, r) => {
617
+ }), rt = B(
618
+ (e, t) => {
1248
619
  const {
1249
- autoCompleteProps: o,
1250
- inputRef: s,
1251
- getInputProps: a,
620
+ autoCompleteProps: n,
621
+ inputRef: r,
622
+ getInputProps: o,
1252
623
  tags: l,
1253
- setQuery: c,
1254
- value: f,
1255
- itemList: g
1256
- } = ge(), {
1257
- children: R,
1258
- isInvalid: y,
1259
- hidePlaceholder: m,
1260
- ...A
1261
- } = t, { value: w } = A;
1262
- ee(() => {
1263
- if (f !== void 0 && (typeof f == "string" || f instanceof String)) {
1264
- const we = g.find((ue) => ue.value === f), re = we === void 0 ? f : we.label;
1265
- c(re);
624
+ setQuery: i,
625
+ value: u,
626
+ itemList: v
627
+ } = W(), {
628
+ children: h,
629
+ isInvalid: b,
630
+ hidePlaceholder: c,
631
+ ...O
632
+ } = e, { value: C } = O;
633
+ D(() => {
634
+ if (u !== void 0 && (typeof u == "string" || u instanceof String)) {
635
+ const re = v.find((J) => J.value === u), k = re === void 0 ? u : re.label;
636
+ i(k);
1266
637
  }
1267
- }, [f]), ee(() => {
1268
- w !== void 0 && (typeof w == "string" || w instanceof String) && c(w);
1269
- }, [w]);
1270
- const L = qt("Input", t);
1271
- let { wrapper: ie, input: te } = a(A, L);
1272
- const { ref: X, ...P } = ie, _e = ut(r, s), me = k(R, { tags: l });
1273
- m && (te = {
1274
- ...te,
1275
- placeholder: Array.isArray(me) && me.length ? void 0 : te.placeholder
638
+ }, [u]), D(() => {
639
+ C !== void 0 && (typeof C == "string" || C instanceof String) && i(C);
640
+ }, [C]);
641
+ const I = yt("Input", e);
642
+ let { wrapper: H, input: j } = o(O, I);
643
+ const { ref: ne, ...ge } = H, oe = Pe(t, r), Y = m(h, { tags: l });
644
+ c && (j = {
645
+ ...j,
646
+ placeholder: Array.isArray(Y) && Y.length ? void 0 : j.placeholder
1276
647
  });
1277
- const Ie = /* @__PURE__ */ C.jsx(
1278
- St,
648
+ const me = /* @__PURE__ */ p(
649
+ Ke,
1279
650
  {
1280
- isInvalid: y,
1281
- ...te,
1282
- ref: _e
651
+ isInvalid: b,
652
+ ...j,
653
+ ref: oe
1283
654
  }
1284
- ), Fe = /* @__PURE__ */ C.jsxs(er, { "aria-invalid": y, ...P, ref: X, children: [
1285
- me,
1286
- /* @__PURE__ */ C.jsx(
1287
- Tt,
655
+ ), ve = /* @__PURE__ */ K(bt, { "aria-invalid": b, ...ge, ref: ne, children: [
656
+ Y,
657
+ /* @__PURE__ */ p(
658
+ qe,
1288
659
  {
1289
- as: St,
1290
- ...te,
1291
- ref: _e
660
+ as: Ke,
661
+ ...j,
662
+ ref: oe
1292
663
  }
1293
664
  )
1294
665
  ] });
1295
- return /* @__PURE__ */ C.jsx(tr, { children: o.multiple ? Fe : Ie });
666
+ return /* @__PURE__ */ p(Ct, { children: n.multiple ? ve : me });
1296
667
  }
1297
668
  );
1298
- kt.displayName = "Input";
1299
- kt.id = "Input";
1300
- const Lr = (t) => {
1301
- const { getEmptyStateProps: r, defaultEmptyStateProps: o } = ge(), s = r(
1302
- /* @__PURE__ */ C.jsx(qe, { ...Nr, ...o, children: "No options found!" })
669
+ rt.displayName = "Input";
670
+ rt.id = "Input";
671
+ const qt = (e) => {
672
+ const { getEmptyStateProps: t, defaultEmptyStateProps: n } = W(), r = t(
673
+ /* @__PURE__ */ p(pe, { ...en, ...n, children: "No options found!" })
1303
674
  );
1304
- return /* @__PURE__ */ C.jsx(Ot, { ...t, children: s });
1305
- }, Nr = {
675
+ return /* @__PURE__ */ p(Xe, { ...e, children: r });
676
+ }, en = {
1306
677
  fontSize: "sm",
1307
678
  align: "center",
1308
679
  justify: "center",
1309
680
  fontWeight: "bold",
1310
681
  fontStyle: "italic"
1311
- }, _t = [
682
+ }, Ye = [
1312
683
  "AutoCompleteGroup",
1313
684
  "AutoCompleteItem",
1314
685
  "AutoCompleteCreatable"
1315
- ], Wr = (t) => {
1316
- const r = Re.Children.map(t, (a, l) => {
1317
- var c;
1318
- if (((c = a == null ? void 0 : a.type) == null ? void 0 : c.displayName) === "AutoCompleteGroup") {
1319
- const f = Re.Children.toArray(t)[l + 1];
1320
- return Re.cloneElement(a, {
1321
- groupSibling: f ? f.type.displayName === "AutoCompleteGroup" : !1
686
+ ], tn = (e) => {
687
+ const t = ee.Children.map(e, (o, l) => {
688
+ var i;
689
+ if (((i = o == null ? void 0 : o.type) == null ? void 0 : i.displayName) === "AutoCompleteGroup") {
690
+ const u = ee.Children.toArray(e)[l + 1];
691
+ return ee.cloneElement(o, {
692
+ groupSibling: u ? u.type.displayName === "AutoCompleteGroup" : !1
1322
693
  });
1323
694
  }
1324
- return a;
1325
- }), o = Re.Children.toArray(r).filter(
1326
- (a) => {
695
+ return o;
696
+ }), n = ee.Children.toArray(t).filter(
697
+ (o) => {
1327
698
  var l;
1328
- return !_t.includes(
1329
- (l = a == null ? void 0 : a.type) == null ? void 0 : l.displayName
699
+ return !Ye.includes(
700
+ (l = o == null ? void 0 : o.type) == null ? void 0 : l.displayName
1330
701
  );
1331
702
  }
1332
703
  );
1333
- return [Re.Children.toArray(r).filter(
1334
- (a) => {
704
+ return [ee.Children.toArray(t).filter(
705
+ (o) => {
1335
706
  var l;
1336
- return _t.includes(
1337
- (l = a == null ? void 0 : a.type) == null ? void 0 : l.displayName
707
+ return Ye.includes(
708
+ (l = o == null ? void 0 : o.type) == null ? void 0 : l.displayName
1338
709
  );
1339
710
  }
1340
- ), o];
1341
- }, Mr = Se(
1342
- (t, r) => {
1343
- const { children: o, loadingState: s, ...a } = t, { listRef: l, isLoading: c } = ge(), f = ut(r, l), [g, R] = Wr(o);
1344
- return /* @__PURE__ */ C.jsxs(rr, { ref: f, w: "inherit", ...$r, ...a, children: [
1345
- c && /* @__PURE__ */ C.jsx(nr, { children: s || /* @__PURE__ */ C.jsx(jt, { size: "md" }) }),
1346
- !c && /* @__PURE__ */ C.jsxs(C.Fragment, { children: [
1347
- g,
1348
- /* @__PURE__ */ C.jsx(Lr, {}),
1349
- R
711
+ ), n];
712
+ }, nn = B(
713
+ (e, t) => {
714
+ const { children: n, loadingState: r, ...o } = e, { listRef: l, isLoading: i } = W(), u = Pe(t, l), [v, h] = tn(n);
715
+ return /* @__PURE__ */ K(St, { ref: u, w: "inherit", ...on, ...o, children: [
716
+ i && /* @__PURE__ */ p(xt, { children: r || /* @__PURE__ */ p(Ze, { size: "md" }) }),
717
+ !i && /* @__PURE__ */ K(it, { children: [
718
+ v,
719
+ /* @__PURE__ */ p(qt, {}),
720
+ h
1350
721
  ] })
1351
722
  ] });
1352
723
  }
1353
724
  );
1354
- Mr.displayName = "AutoCompleteList";
1355
- const $r = {
725
+ nn.displayName = "AutoCompleteList";
726
+ const on = {
1356
727
  py: "4",
1357
728
  opacity: "0",
1358
729
  bg: "#232934",
@@ -1368,46 +739,46 @@ const $r = {
1368
739
  _focus: {
1369
740
  boxShadow: "none"
1370
741
  }
1371
- }, Ur = Gt((t) => {
1372
- const { label: r, onRemove: o, disabled: s, ...a } = t;
1373
- return /* @__PURE__ */ C.jsx(Tt, { children: /* @__PURE__ */ C.jsxs(
1374
- or,
742
+ }, pn = at((e) => {
743
+ const { label: t, onRemove: n, disabled: r, ...o } = e;
744
+ return /* @__PURE__ */ p(qe, { children: /* @__PURE__ */ K(
745
+ At,
1375
746
  {
1376
747
  borderRadius: "md",
1377
748
  fontWeight: "normal",
1378
- ...s && wt,
1379
- ...a,
749
+ ...r && Je,
750
+ ...o,
1380
751
  children: [
1381
- /* @__PURE__ */ C.jsx(ar, { children: r }),
1382
- /* @__PURE__ */ C.jsx(
1383
- sr,
752
+ /* @__PURE__ */ p(It, { children: t }),
753
+ /* @__PURE__ */ p(
754
+ wt,
1384
755
  {
1385
- onClick: () => !s && k(o),
756
+ onClick: () => !r && m(n),
1386
757
  cursor: "pointer",
1387
- ...s && wt
758
+ ...r && Je
1388
759
  }
1389
760
  )
1390
761
  ]
1391
762
  }
1392
763
  ) });
1393
- }), wt = {
764
+ }), Je = {
1394
765
  cursor: "text",
1395
766
  userSelect: "none",
1396
767
  opacity: 0.4,
1397
768
  _focus: { boxShadow: "none" }
1398
769
  };
1399
770
  export {
1400
- Tr as AutoComplete,
1401
- Pr as AutoCompleteCreatable,
1402
- Ir as AutoCompleteGroup,
1403
- Fr as AutoCompleteGroupTitle,
1404
- kt as AutoCompleteInput,
1405
- Ar as AutoCompleteItem,
1406
- Mr as AutoCompleteList,
1407
- lr as AutoCompleteProvider,
1408
- Ur as AutoCompleteTag,
1409
- Ft as baseItemStyles,
1410
- cr as createContext,
1411
- jr as useAutoComplete,
1412
- ge as useAutoCompleteContext
771
+ Qt as AutoComplete,
772
+ Kt as AutoCompleteCreatable,
773
+ Yt as AutoCompleteGroup,
774
+ Jt as AutoCompleteGroupTitle,
775
+ rt as AutoCompleteInput,
776
+ $t as AutoCompleteItem,
777
+ nn as AutoCompleteList,
778
+ Ot as AutoCompleteProvider,
779
+ pn as AutoCompleteTag,
780
+ ot as baseItemStyles,
781
+ Et as createContext,
782
+ Vt as useAutoComplete,
783
+ W as useAutoCompleteContext
1413
784
  };