docthub-core-components 3.2.2 → 3.2.3

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.
@@ -1,491 +1,497 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as D } from "react/jsx-runtime";
3
- import { c as ro } from "react-compiler-runtime";
4
- import { ChevronDown as to, X as ao } from "lucide-react";
5
- import { useId as so, useState as co, useEffect as yt, useRef as oo } from "react";
6
- import { createPortal as bo } from "react-dom";
7
- import { Chip as go } from "./chips/doct-chip.js";
8
- import { SearchInput as xo } from "./search/search-input.js";
9
- import { DoctButton as vo } from "../../ui/button.js";
10
- import { Checkbox as wo } from "../../ui/checkbox.js";
11
- import { Input as yo } from "../../ui/input.js";
12
- import { TooltipProvider as ko, Tooltip as Co, TooltipTrigger as So, TooltipContent as No } from "../../ui/tooltip.js";
13
- import { useAutocompleteCheckbox as To } from "../../../hooks/useAutocompleteCheckbox.js";
2
+ import { jsx as n, jsxs as I } from "react/jsx-runtime";
3
+ import { c as io } from "react-compiler-runtime";
4
+ import { ChevronDown as lo, X as fo } from "lucide-react";
5
+ import { useId as uo, useState as mo, useEffect as Ct, useRef as no } from "react";
6
+ import { createPortal as vo } from "react-dom";
7
+ import { Chip as wo } from "./chips/doct-chip.js";
8
+ import { SearchInput as yo } from "./search/search-input.js";
9
+ import { DoctButton as ko } from "../../ui/button.js";
10
+ import { Checkbox as Co } from "../../ui/checkbox.js";
11
+ import { Input as So } from "../../ui/input.js";
12
+ import { TooltipProvider as No, Tooltip as To, TooltipTrigger as Oo, TooltipContent as Io } from "../../ui/tooltip.js";
13
+ import { useAutocompleteCheckbox as Po } from "../../../hooks/useAutocompleteCheckbox.js";
14
14
  import { cn as C } from "../../../lib/utils.js";
15
- const Oo = {
15
+ const Bo = {
16
16
  small: "h-8 text-xs px-2",
17
17
  medium: "h-10 text-sm px-3",
18
18
  large: "h-12 text-base px-4"
19
- }, Po = {
19
+ }, Do = {
20
20
  outlined: "border border-input bg-background",
21
21
  filled: "border-0 bg-accent",
22
22
  standard: "border-0 border-b border-input rounded-none bg-transparent"
23
- }, Io = (Qe) => {
24
- const e = ro(68), {
23
+ }, Fo = (Ye) => {
24
+ const e = io(68), {
25
25
  option: r,
26
- index: g,
26
+ index: b,
27
27
  isSelected: d,
28
- isHighlighted: b,
28
+ isHighlighted: p,
29
29
  onSelect: a,
30
30
  getOptionLabel: i,
31
- renderOption: v,
32
- freeSolo: x,
31
+ renderOption: x,
32
+ freeSolo: g,
33
33
  originalOptions: S,
34
34
  checkboxPosition: N,
35
35
  showChip: T,
36
- checkboxProps: B,
37
- chipProps: F,
38
- checkboxColor: et,
39
- hideCheckbox: Ue
40
- } = Qe, Ne = x === void 0 ? !1 : x;
41
- let ae;
42
- e[0] !== S ? (ae = S === void 0 ? [] : S, e[0] = S, e[1] = ae) : ae = e[1];
43
- const Te = ae, Z = Ue === void 0 ? !1 : Ue, $ = oo(null), [Oe, kt] = co(!1);
44
- let w;
45
- e[2] !== a || e[3] !== r ? (w = () => {
36
+ checkboxProps: A,
37
+ chipProps: D,
38
+ checkboxColor: ot,
39
+ hideCheckbox: _e
40
+ } = Ye, Pe = g === void 0 ? !1 : g;
41
+ let ue;
42
+ e[0] !== S ? (ue = S === void 0 ? [] : S, e[0] = S, e[1] = ue) : ue = e[1];
43
+ const Be = ue, J = _e === void 0 ? !1 : _e, q = no(null), [De, St] = mo(!1);
44
+ let v;
45
+ e[2] !== a || e[3] !== r ? (v = () => {
46
46
  a(r);
47
- }, e[2] = a, e[3] = r, e[4] = w) : w = e[4];
48
- const Pe = w;
49
- let ce;
50
- e[5] !== a || e[6] !== r ? (ce = (p) => {
51
- (p.key === "Enter" || p.key === " ") && (p.preventDefault(), a(r));
52
- }, e[5] = a, e[6] = r, e[7] = ce) : ce = e[7];
53
- const Ie = ce;
54
- let G;
55
- e[8] !== Ne || e[9] !== i || e[10] !== r || e[11] !== Te ? (G = Ne && typeof r == "string" && !Te.some((p) => i(p).toLowerCase() === r.toLowerCase()), e[8] = Ne, e[9] = i, e[10] = r, e[11] = Te, e[12] = G) : G = e[12];
56
- const J = G;
57
- let de;
58
- e[13] !== i || e[14] !== J || e[15] !== r ? (de = J ? `Add "${i(r)}"` : i(r), e[13] = i, e[14] = J, e[15] = r, e[16] = de) : de = e[16];
59
- const P = de;
60
- let Q, ue;
61
- e[17] === Symbol.for("react.memo_cache_sentinel") ? (Q = () => {
62
- const p = () => {
63
- if ($.current) {
64
- const Ae = $.current.scrollWidth > $.current.clientWidth;
65
- kt(Ae);
47
+ }, e[2] = a, e[3] = r, e[4] = v) : v = e[4];
48
+ const Fe = v;
49
+ let fe;
50
+ e[5] !== a || e[6] !== r ? (fe = (w) => {
51
+ (w.key === "Enter" || w.key === " ") && (w.preventDefault(), a(r));
52
+ }, e[5] = a, e[6] = r, e[7] = fe) : fe = e[7];
53
+ const Re = fe;
54
+ let Q;
55
+ e[8] !== Pe || e[9] !== i || e[10] !== r || e[11] !== Be ? (Q = Pe && typeof r == "string" && !Be.some((w) => i(w).toLowerCase() === r.toLowerCase()), e[8] = Pe, e[9] = i, e[10] = r, e[11] = Be, e[12] = Q) : Q = e[12];
56
+ const U = Q;
57
+ let me;
58
+ e[13] !== i || e[14] !== U || e[15] !== r ? (me = U ? `Add "${i(r)}"` : i(r), e[13] = i, e[14] = U, e[15] = r, e[16] = me) : me = e[16];
59
+ const P = me;
60
+ let Y, pe;
61
+ e[17] === Symbol.for("react.memo_cache_sentinel") ? (Y = () => {
62
+ const w = () => {
63
+ if (q.current) {
64
+ const Nt = q.current.scrollWidth > q.current.clientWidth;
65
+ St(Nt);
66
66
  }
67
67
  };
68
- p();
69
- const tt = new ResizeObserver(() => {
70
- p();
68
+ w();
69
+ const o = new ResizeObserver(() => {
70
+ w();
71
71
  });
72
- $.current && tt.observe($.current);
73
- const m = setTimeout(p, 0);
72
+ q.current && o.observe(q.current);
73
+ const j = setTimeout(w, 0);
74
74
  return () => {
75
- tt.disconnect(), clearTimeout(m);
75
+ o.disconnect(), clearTimeout(j);
76
76
  };
77
- }, ue = [], e[17] = Q, e[18] = ue) : (Q = e[17], ue = e[18]), yt(Q, ue);
78
- let q;
79
- e[19] !== B ? (q = B ?? {}, e[19] = B, e[20] = q) : q = e[20];
80
- let K, fe, O, De;
81
- e[21] !== q ? ({
82
- className: K,
83
- tabIndex: De,
84
- color: fe,
77
+ }, pe = [], e[17] = Y, e[18] = pe) : (Y = e[17], pe = e[18]), Ct(Y, pe);
78
+ let K;
79
+ e[19] !== A ? (K = A ?? {}, e[19] = A, e[20] = K) : K = e[20];
80
+ let H, he, O, Ae;
81
+ e[21] !== K ? ({
82
+ className: H,
83
+ tabIndex: Ae,
84
+ color: he,
85
85
  ...O
86
- } = q, e[21] = q, e[22] = K, e[23] = fe, e[24] = O, e[25] = De) : (K = e[22], fe = e[23], O = e[24], De = e[25]);
87
- const Ye = fe ?? et, me = De ?? -1, pe = !d && "opacity-20";
88
- let U;
89
- e[26] !== K || e[27] !== pe ? (U = C("pointer-events-none border-2 opacity-100 flex items-center justify-center !rounded-sm", pe, K), e[26] = K, e[27] = pe, e[28] = U) : U = e[28];
90
- let Y;
91
- e[29] !== O || e[30] !== d || e[31] !== Ye || e[32] !== me || e[33] !== U ? (Y = /* @__PURE__ */ n(wo, { checked: d, tabIndex: me, className: U, color: Ye, ...O }), e[29] = O, e[30] = d, e[31] = Ye, e[32] = me, e[33] = U, e[34] = Y) : Y = e[34];
92
- const he = Y, Fe = F == null ? void 0 : F.className;
86
+ } = K, e[21] = K, e[22] = H, e[23] = he, e[24] = O, e[25] = Ae) : (H = e[22], he = e[23], O = e[24], Ae = e[25]);
87
+ const et = he ?? ot, be = Ae ?? -1, ge = !d && "opacity-20";
88
+ let _;
89
+ e[26] !== H || e[27] !== ge ? (_ = C("pointer-events-none border-2 opacity-100 flex items-center justify-center !rounded-sm", ge, H), e[26] = H, e[27] = ge, e[28] = _) : _ = e[28];
93
90
  let L;
94
- e[35] !== Fe ? (L = C("flex-shrink-0", Fe), e[35] = Fe, e[36] = L) : L = e[36];
95
- let u;
96
- e[37] !== F || e[38] !== L ? (u = {
91
+ e[29] !== O || e[30] !== d || e[31] !== et || e[32] !== be || e[33] !== _ ? (L = /* @__PURE__ */ n(Co, { checked: d, tabIndex: be, className: _, color: et, ...O }), e[29] = O, e[30] = d, e[31] = et, e[32] = be, e[33] = _, e[34] = L) : L = e[34];
92
+ const W = L, xe = D == null ? void 0 : D.className;
93
+ let V;
94
+ e[35] !== xe ? (V = C("flex-shrink-0", xe), e[35] = xe, e[36] = V) : V = e[36];
95
+ let ve;
96
+ e[37] !== D || e[38] !== V ? (ve = {
97
97
  size: "small",
98
98
  variant: "soft",
99
- ...F,
100
- className: L
101
- }, e[37] = F, e[38] = L, e[39] = u) : u = e[39];
102
- const be = u, _ = N === "left";
99
+ ...D,
100
+ className: V
101
+ }, e[37] = D, e[38] = V, e[39] = ve) : ve = e[39];
102
+ const we = ve, u = N === "left";
103
103
  let ee;
104
- e[40] !== P ? (ee = /* @__PURE__ */ n("span", { ref: $, className: "flex-1 truncate", children: P }), e[40] = P, e[41] = ee) : ee = e[41];
105
- const H = ee;
106
- let f;
107
- e[42] !== Oe || e[43] !== P || e[44] !== H ? (f = Oe ? /* @__PURE__ */ D(Co, { children: [
108
- /* @__PURE__ */ n(So, { asChild: !0, children: H }),
109
- /* @__PURE__ */ n(No, { children: /* @__PURE__ */ n("p", { children: P }) })
110
- ] }) : H, e[42] = Oe, e[43] = P, e[44] = H, e[45] = f) : f = e[45];
111
- const ge = f, te = b ? "bg-accent text-accent-foreground" : "", xe = Z && d && "bg-[#F5F5F5]", oe = J && "italic";
112
- let W;
113
- e[46] !== te || e[47] !== xe || e[48] !== oe ? (W = C("px-3 py-2 cursor-pointer flex items-center", "text-sm transition-colors mx-2.5 rounded-md my-0.5 hover:bg-[#F5F5F5]", te, xe, oe), e[46] = te, e[47] = xe, e[48] = oe, e[49] = W) : W = e[49];
114
- let A;
115
- e[50] !== he || e[51] !== be || e[52] !== Z || e[53] !== g || e[54] !== _ || e[55] !== r || e[56] !== P || e[57] !== v || e[58] !== T || e[59] !== ge ? (A = v ? v(r, g) : /* @__PURE__ */ D("div", { className: "flex items-center gap-2 w-full", children: [
116
- !Z && _ && he,
117
- ge,
118
- T && /* @__PURE__ */ n(go, { label: P, ...be }),
119
- !Z && !_ && he
120
- ] }), e[50] = he, e[51] = be, e[52] = Z, e[53] = g, e[54] = _, e[55] = r, e[56] = P, e[57] = v, e[58] = T, e[59] = ge, e[60] = A) : A = e[60];
121
- let t;
122
- return e[61] !== Pe || e[62] !== Ie || e[63] !== g || e[64] !== d || e[65] !== W || e[66] !== A ? (t = /* @__PURE__ */ n("div", { role: "option", "aria-selected": d, tabIndex: 0, onClick: Pe, onKeyDown: Ie, "data-option-index": g, className: W, children: A }), e[61] = Pe, e[62] = Ie, e[63] = g, e[64] = d, e[65] = W, e[66] = A, e[67] = t) : t = e[67], t;
123
- }, Do = (Qe) => {
124
- const e = ro(17), {
104
+ e[40] !== P ? (ee = /* @__PURE__ */ n("span", { ref: q, className: "flex-1 truncate", children: P }), e[40] = P, e[41] = ee) : ee = e[41];
105
+ const te = ee;
106
+ let oe;
107
+ e[42] !== De || e[43] !== P || e[44] !== te ? (oe = De ? /* @__PURE__ */ I(To, { children: [
108
+ /* @__PURE__ */ n(Oo, { asChild: !0, children: te }),
109
+ /* @__PURE__ */ n(Io, { children: /* @__PURE__ */ n("p", { children: P }) })
110
+ ] }) : te, e[42] = De, e[43] = P, e[44] = te, e[45] = oe) : oe = e[45];
111
+ const re = oe, f = p ? "bg-accent text-accent-foreground" : "", ye = J && d && "bg-[#F5F5F5]", le = U && "italic";
112
+ let z;
113
+ e[46] !== f || e[47] !== ye || e[48] !== le ? (z = C("px-3 py-2 cursor-pointer flex items-center", "text-sm transition-colors mx-2.5 rounded-md my-0.5 hover:bg-[#F5F5F5]", f, ye, le), e[46] = f, e[47] = ye, e[48] = le, e[49] = z) : z = e[49];
114
+ let F;
115
+ e[50] !== W || e[51] !== we || e[52] !== J || e[53] !== b || e[54] !== u || e[55] !== r || e[56] !== P || e[57] !== x || e[58] !== T || e[59] !== re ? (F = x ? x(r, b) : /* @__PURE__ */ I("div", { className: "flex items-center gap-2 w-full", children: [
116
+ !J && u && W,
117
+ re,
118
+ T && /* @__PURE__ */ n(wo, { label: P, ...we }),
119
+ !J && !u && W
120
+ ] }), e[50] = W, e[51] = we, e[52] = J, e[53] = b, e[54] = u, e[55] = r, e[56] = P, e[57] = x, e[58] = T, e[59] = re, e[60] = F) : F = e[60];
121
+ let ne;
122
+ return e[61] !== Fe || e[62] !== Re || e[63] !== b || e[64] !== d || e[65] !== z || e[66] !== F ? (ne = /* @__PURE__ */ n("div", { role: "option", "aria-selected": d, tabIndex: 0, onClick: Fe, onKeyDown: Re, "data-option-index": b, className: z, children: F }), e[61] = Fe, e[62] = Re, e[63] = b, e[64] = d, e[65] = z, e[66] = F, e[67] = ne) : ne = e[67], ne;
123
+ }, Ro = (Ye) => {
124
+ const e = io(17), {
125
125
  tag: r,
126
- index: g,
126
+ index: b,
127
127
  getOptionLabel: d,
128
- onRemove: b
129
- } = Qe;
128
+ onRemove: p
129
+ } = Ye;
130
130
  let a;
131
- e[0] !== b || e[1] !== r ? (a = (F) => {
132
- F.stopPropagation(), b(r);
133
- }, e[0] = b, e[1] = r, e[2] = a) : a = e[2];
131
+ e[0] !== p || e[1] !== r ? (a = (D) => {
132
+ D.stopPropagation(), p(r);
133
+ }, e[0] = p, e[1] = r, e[2] = a) : a = e[2];
134
134
  const i = a;
135
- let v;
136
- e[3] !== d || e[4] !== r ? (v = d(r), e[3] = d, e[4] = r, e[5] = v) : v = e[5];
137
135
  let x;
138
- e[6] !== d || e[7] !== r ? (x = d(r), e[6] = d, e[7] = r, e[8] = x) : x = e[8];
139
- const S = `Remove ${x}`;
136
+ e[3] !== d || e[4] !== r ? (x = d(r), e[3] = d, e[4] = r, e[5] = x) : x = e[5];
137
+ let g;
138
+ e[6] !== d || e[7] !== r ? (g = d(r), e[6] = d, e[7] = r, e[8] = g) : g = e[8];
139
+ const S = `Remove ${g}`;
140
140
  let N;
141
- e[9] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n(ao, { className: "h-3 w-3" }), e[9] = N) : N = e[9];
141
+ e[9] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n(fo, { className: "h-3 w-3" }), e[9] = N) : N = e[9];
142
142
  let T;
143
143
  e[10] !== i || e[11] !== S ? (T = /* @__PURE__ */ n("button", { type: "button", onClick: i, className: "ml-1 hover:bg-secondary-foreground/20 rounded-full p-0.5", "aria-label": S, children: N }), e[10] = i, e[11] = S, e[12] = T) : T = e[12];
144
- let B;
145
- return e[13] !== g || e[14] !== v || e[15] !== T ? (B = /* @__PURE__ */ D("div", { className: "inline-flex items-center gap-1 px-2.5 py-0.5 text-xs font-medium bg-secondary text-secondary-foreground rounded-full", children: [
146
- v,
144
+ let A;
145
+ return e[13] !== b || e[14] !== x || e[15] !== T ? (A = /* @__PURE__ */ I("div", { className: "inline-flex items-center gap-1 px-2.5 py-0.5 text-xs font-medium bg-secondary text-secondary-foreground rounded-full", children: [
146
+ x,
147
147
  T
148
- ] }, g), e[13] = g, e[14] = v, e[15] = T, e[16] = B) : B = e[16], B;
148
+ ] }, b), e[13] = b, e[14] = x, e[15] = T, e[16] = A) : A = e[16], A;
149
149
  };
150
- function jo(Qe) {
151
- const e = ro(197), {
150
+ function Zo(Ye) {
151
+ const e = io(200), {
152
152
  options: r,
153
- dataSource: g,
153
+ dataSource: b,
154
154
  value: d,
155
- onChange: b,
155
+ onChange: p,
156
156
  change: a,
157
157
  onInputChange: i,
158
- placeholder: v,
159
- label: x,
158
+ placeholder: x,
159
+ label: g,
160
160
  helperText: S,
161
161
  error: N,
162
162
  noOptionsText: T,
163
- emptyMessage: B,
164
- disabled: F,
165
- loading: et,
166
- required: Ue,
167
- clearable: Ne,
168
- disableCloseOnSelect: ae,
169
- freeSolo: Te,
170
- size: Z,
171
- variant: $,
172
- fullWidth: Oe,
173
- className: kt,
174
- inputClassName: w,
175
- checkboxPosition: Pe,
176
- showChip: ce,
177
- showTags: Ie,
178
- checkboxProps: G,
179
- chipProps: J,
180
- checkboxColor: de,
163
+ emptyMessage: A,
164
+ disabled: D,
165
+ loading: ot,
166
+ required: _e,
167
+ clearable: Pe,
168
+ disableCloseOnSelect: ue,
169
+ freeSolo: Be,
170
+ size: J,
171
+ variant: q,
172
+ fullWidth: De,
173
+ className: St,
174
+ inputClassName: v,
175
+ checkboxPosition: Fe,
176
+ showChip: fe,
177
+ showTags: Re,
178
+ checkboxProps: Q,
179
+ chipProps: U,
180
+ checkboxColor: me,
181
181
  showSearch: P,
182
- searchPlaceholder: Q,
183
- showScroller: ue,
184
- multiple: q,
185
- hideCheckbox: K,
186
- triggerType: fe,
182
+ searchPlaceholder: Y,
183
+ showScroller: pe,
184
+ multiple: K,
185
+ hideCheckbox: H,
186
+ triggerType: he,
187
187
  triggerButtonLabel: O,
188
- triggerButtonVariant: De,
189
- triggerButtonSize: Ye,
190
- triggerButtonProps: me,
191
- triggerButtonIcon: pe,
192
- triggerButtonIconPosition: U,
193
- portalContainer: Y,
194
- disablePortal: he,
195
- dropdownWidth: Fe,
196
- getOptionLabel: L,
188
+ triggerButtonVariant: Ae,
189
+ triggerButtonSize: et,
190
+ triggerButtonProps: be,
191
+ triggerButtonIcon: ge,
192
+ triggerButtonIconPosition: _,
193
+ triggerButtonLeftIcon: L,
194
+ triggerButtonRightIcon: W,
195
+ portalContainer: xe,
196
+ disablePortal: V,
197
+ dropdownWidth: ve,
198
+ getOptionLabel: we,
197
199
  getOptionValue: u,
198
- isOptionEqualToValue: be,
199
- filterOptions: _,
200
- renderOption: ee,
201
- renderTags: H,
200
+ isOptionEqualToValue: ee,
201
+ filterOptions: te,
202
+ renderOption: oe,
203
+ renderTags: re,
202
204
  limitTags: f,
203
- fields: ge
204
- } = Qe;
205
- let te;
206
- e[0] !== r ? (te = r === void 0 ? [] : r, e[0] = r, e[1] = te) : te = e[1];
207
- const xe = te;
208
- let oe;
209
- e[2] !== g ? (oe = g === void 0 ? [] : g, e[2] = g, e[3] = oe) : oe = e[3];
210
- const W = oe;
211
- let A;
212
- e[4] !== d ? (A = d === void 0 ? [] : d, e[4] = d, e[5] = A) : A = e[5];
213
- const t = A, p = v === void 0 ? "Search..." : v, tt = T === void 0 ? "No options" : T, m = F === void 0 ? !1 : F, Ae = et === void 0 ? !1 : et, Ct = Ue === void 0 ? !1 : Ue, uo = Ne === void 0 ? !0 : Ne, St = ae === void 0 ? !0 : ae, Re = Te === void 0 ? !1 : Te, fo = Z === void 0 ? "medium" : Z, mo = $ === void 0 ? "outlined" : $, lo = Oe === void 0 ? !0 : Oe, Nt = Pe === void 0 ? "right" : Pe, Tt = ce === void 0 ? !1 : ce, po = Ie === void 0 ? !0 : Ie, Ot = de === void 0 ? "#000000" : de, h = P === void 0 ? !1 : P, Pt = ue === void 0 ? !0 : ue, It = q === void 0 ? !0 : q, Dt = K === void 0 ? !1 : K, Ft = fe === void 0 ? "input" : fe, At = he === void 0 ? !1 : he, Be = Fe === void 0 ? "220px" : Fe, ve = so(), [we, Rt] = co(!1);
214
- let ot;
215
- e[6] === Symbol.for("react.memo_cache_sentinel") ? (ot = () => {
216
- Rt(!1);
217
- }, e[6] = ot) : ot = e[6];
218
- let rt;
219
- e[7] !== t ? (rt = [t], e[7] = t, e[8] = rt) : rt = e[8], yt(ot, rt);
205
+ fields: ye
206
+ } = Ye;
207
+ let le;
208
+ e[0] !== r ? (le = r === void 0 ? [] : r, e[0] = r, e[1] = le) : le = e[1];
209
+ const z = le;
210
+ let F;
211
+ e[2] !== b ? (F = b === void 0 ? [] : b, e[2] = b, e[3] = F) : F = e[3];
212
+ const ne = F;
213
+ let w;
214
+ e[4] !== d ? (w = d === void 0 ? [] : d, e[4] = d, e[5] = w) : w = e[5];
215
+ const o = w, j = x === void 0 ? "Search..." : x, Nt = T === void 0 ? "No options" : T, h = D === void 0 ? !1 : D, rt = ot === void 0 ? !1 : ot, Tt = _e === void 0 ? !1 : _e, po = Pe === void 0 ? !0 : Pe, Ot = ue === void 0 ? !0 : ue, Le = Be === void 0 ? !1 : Be, ho = J === void 0 ? "medium" : J, bo = q === void 0 ? "outlined" : q, so = De === void 0 ? !0 : De, It = Fe === void 0 ? "right" : Fe, Pt = fe === void 0 ? !1 : fe, go = Re === void 0 ? !0 : Re, Bt = me === void 0 ? "#000000" : me, m = P === void 0 ? !1 : P, Dt = pe === void 0 ? !0 : pe, Ft = K === void 0 ? !0 : K, Rt = H === void 0 ? !1 : H, At = he === void 0 ? "input" : he, Lt = V === void 0 ? !1 : V, We = ve === void 0 ? "220px" : ve, ke = uo(), [Ce, Wt] = mo(!1);
220
216
  let lt;
221
- e[9] !== W ? (lt = W ?? [], e[9] = W, e[10] = lt) : lt = e[10];
222
- const no = lt;
217
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (lt = () => {
218
+ Wt(!1);
219
+ }, e[6] = lt) : lt = e[6];
223
220
  let nt;
224
- e[11] !== xe ? (nt = xe ?? [], e[11] = xe, e[12] = nt) : nt = e[12];
225
- const ho = nt, Le = no.length > 0 ? no : ho;
226
- let We;
227
- e[13] !== a || e[14] !== b ? (We = (o, l) => {
228
- b == null || b(o, l), a == null || a({
221
+ e[7] !== o ? (nt = [o], e[7] = o, e[8] = nt) : nt = e[8], Ct(lt, nt);
222
+ let it;
223
+ e[9] !== ne ? (it = ne ?? [], e[9] = ne, e[10] = it) : it = e[10];
224
+ const ao = it;
225
+ let st;
226
+ e[11] !== z ? (st = z ?? [], e[11] = z, e[12] = st) : st = e[12];
227
+ const xo = st, ze = ao.length > 0 ? ao : xo;
228
+ let Ee;
229
+ e[13] !== a || e[14] !== p ? (Ee = (t, l) => {
230
+ p == null || p(t, l), a == null || a({
229
231
  itemData: l
230
232
  });
231
- }, e[13] = a, e[14] = b, e[15] = We) : We = e[15];
232
- let it;
233
- e[16] !== St || e[17] !== m || e[18] !== Le || e[19] !== ge || e[20] !== _ || e[21] !== Re || e[22] !== L || e[23] !== u || e[24] !== be || e[25] !== i || e[26] !== We || e[27] !== t ? (it = {
234
- options: Le,
235
- value: t,
236
- onChange: We,
233
+ }, e[13] = a, e[14] = p, e[15] = Ee) : Ee = e[15];
234
+ let at;
235
+ e[16] !== Ot || e[17] !== h || e[18] !== ze || e[19] !== ye || e[20] !== te || e[21] !== Le || e[22] !== we || e[23] !== u || e[24] !== ee || e[25] !== i || e[26] !== Ee || e[27] !== o ? (at = {
236
+ options: ze,
237
+ value: o,
238
+ onChange: Ee,
237
239
  onInputChange: i,
238
- disabled: m,
239
- disableCloseOnSelect: St,
240
- freeSolo: Re,
241
- getOptionLabel: L,
240
+ disabled: h,
241
+ disableCloseOnSelect: Ot,
242
+ freeSolo: Le,
243
+ getOptionLabel: we,
242
244
  getOptionValue: u,
243
- isOptionEqualToValue: be,
244
- filterOptions: _,
245
- fields: ge
246
- }, e[16] = St, e[17] = m, e[18] = Le, e[19] = ge, e[20] = _, e[21] = Re, e[22] = L, e[23] = u, e[24] = be, e[25] = i, e[26] = We, e[27] = t, e[28] = it) : it = e[28];
245
+ isOptionEqualToValue: ee,
246
+ filterOptions: te,
247
+ fields: ye
248
+ }, e[16] = Ot, e[17] = h, e[18] = ze, e[19] = ye, e[20] = te, e[21] = Le, e[22] = we, e[23] = u, e[24] = ee, e[25] = i, e[26] = Ee, e[27] = o, e[28] = at) : at = e[28];
247
249
  const {
248
250
  open: s,
249
- inputValue: re,
250
- highlightedIndex: V,
251
- filteredOptions: j,
252
- dropdownPosition: M,
253
- inputRef: I,
254
- listRef: X,
255
- containerRef: Bt,
256
- triggerRef: st,
257
- setOpen: z,
258
- setInputValue: ye,
259
- handleInputChange: ke,
260
- handleOptionSelect: Lt,
261
- handleTagRemove: le,
262
- handleClear: Wt,
263
- handleKeyDown: Ce,
264
- handleToggle: at,
265
- handleFocus: ct,
266
- isOptionSelected: ze,
251
+ inputValue: ie,
252
+ highlightedIndex: M,
253
+ filteredOptions: X,
254
+ dropdownPosition: Z,
255
+ inputRef: B,
256
+ listRef: G,
257
+ containerRef: zt,
258
+ triggerRef: ct,
259
+ setOpen: E,
260
+ setInputValue: Se,
261
+ handleInputChange: Ne,
262
+ handleOptionSelect: Et,
263
+ handleTagRemove: se,
264
+ handleClear: $t,
265
+ handleKeyDown: Te,
266
+ handleToggle: dt,
267
+ handleFocus: ut,
268
+ isOptionSelected: $e,
267
269
  getOptionLabelSafe: R
268
- } = To(it), zt = uo && !m && re !== "" && !h && Ft !== "button";
269
- let _e;
270
+ } = Po(at), qt = po && !h && ie !== "" && !m && At !== "button";
271
+ let tt;
270
272
  e: {
271
- if (!po || Ft === "button") {
272
- _e = null;
273
+ if (!go || At === "button") {
274
+ tt = null;
273
275
  break e;
274
276
  }
275
- if (!Array.isArray(t) || t.length === 0) {
276
- _e = null;
277
+ if (!Array.isArray(o) || o.length === 0) {
278
+ tt = null;
277
279
  break e;
278
280
  }
279
- if (H) {
281
+ if (re) {
280
282
  let c;
281
- e[29] !== le || e[30] !== H || e[31] !== t ? (c = H(t, le), e[29] = le, e[30] = H, e[31] = t, e[32] = c) : c = e[32], _e = c;
283
+ e[29] !== se || e[30] !== re || e[31] !== o ? (c = re(o, se), e[29] = se, e[30] = re, e[31] = o, e[32] = c) : c = e[32], tt = c;
282
284
  break e;
283
285
  }
284
- let o = t;
285
- if (f && t.length > f && !we) {
286
+ let t = o;
287
+ if (f && o.length > f && !Ce) {
286
288
  let c;
287
- e[33] !== f || e[34] !== t ? (c = t.slice(0, f), e[33] = f, e[34] = t, e[35] = c) : c = e[35], o = c;
289
+ e[33] !== f || e[34] !== o ? (c = o.slice(0, f), e[33] = f, e[34] = o, e[35] = c) : c = e[35], t = c;
288
290
  }
289
291
  let l;
290
- e[36] !== I || e[37] !== i || e[38] !== ye || e[39] !== z ? (l = () => {
292
+ e[36] !== B || e[37] !== i || e[38] !== Se || e[39] !== E ? (l = () => {
291
293
  var c;
292
- z(!1), ye(""), i == null || i({
294
+ E(!1), Se(""), i == null || i({
293
295
  target: {
294
296
  value: ""
295
297
  }
296
- }, ""), (c = I.current) == null || c.focus();
297
- }, e[36] = I, e[37] = i, e[38] = ye, e[39] = z, e[40] = l) : l = e[40];
298
+ }, ""), (c = B.current) == null || c.focus();
299
+ }, e[36] = B, e[37] = i, e[38] = Se, e[39] = E, e[40] = l) : l = e[40];
298
300
  let y;
299
- if (e[41] !== R || e[42] !== u || e[43] !== le || e[44] !== o) {
301
+ if (e[41] !== R || e[42] !== u || e[43] !== se || e[44] !== t) {
300
302
  let c;
301
- e[46] !== R || e[47] !== u || e[48] !== le ? (c = (wt, io) => /* @__PURE__ */ n(Do, { tag: wt, index: io, getOptionLabel: R, onRemove: le }, typeof wt == "string" ? wt : String((u == null ? void 0 : u(wt)) ?? io)), e[46] = R, e[47] = u, e[48] = le, e[49] = c) : c = e[49], y = o.map(c), e[41] = R, e[42] = u, e[43] = le, e[44] = o, e[45] = y;
303
+ e[46] !== R || e[47] !== u || e[48] !== se ? (c = (kt, co) => /* @__PURE__ */ n(Ro, { tag: kt, index: co, getOptionLabel: R, onRemove: se }, typeof kt == "string" ? kt : String((u == null ? void 0 : u(kt)) ?? co)), e[46] = R, e[47] = u, e[48] = se, e[49] = c) : c = e[49], y = t.map(c), e[41] = R, e[42] = u, e[43] = se, e[44] = t, e[45] = y;
302
304
  } else
303
305
  y = e[45];
304
306
  let k;
305
- e[50] !== f || e[51] !== we || e[52] !== t ? (k = f && t.length > f && !we && /* @__PURE__ */ D("button", { type: "button", onClick: (c) => {
306
- c.stopPropagation(), Rt(!0);
307
+ e[50] !== f || e[51] !== Ce || e[52] !== o ? (k = f && o.length > f && !Ce && /* @__PURE__ */ I("button", { type: "button", onClick: (c) => {
308
+ c.stopPropagation(), Wt(!0);
307
309
  }, className: "inline-flex items-center px-2.5 py-0.5 text-xs font-medium bg-muted text-muted-foreground rounded-full hover:bg-muted/80 transition-colors cursor-pointer", children: [
308
310
  "+",
309
- t.length - f,
311
+ o.length - f,
310
312
  " more"
311
- ] }), e[50] = f, e[51] = we, e[52] = t, e[53] = k) : k = e[53];
312
- let E;
313
- e[54] !== f || e[55] !== we || e[56] !== t ? (E = f && t.length > f && we && /* @__PURE__ */ n("button", { type: "button", onClick: (c) => {
314
- c.stopPropagation(), Rt(!1);
315
- }, className: "inline-flex items-center px-2.5 py-0.5 text-xs font-medium bg-muted text-muted-foreground rounded-full hover:bg-muted/80 transition-colors cursor-pointer", children: "Show less" }), e[54] = f, e[55] = we, e[56] = t, e[57] = E) : E = e[57];
316
- let Je;
317
- e[58] !== l || e[59] !== y || e[60] !== k || e[61] !== E ? (Je = /* @__PURE__ */ D("div", { className: "flex flex-wrap gap-1 mb-1", onClick: l, children: [
313
+ ] }), e[50] = f, e[51] = Ce, e[52] = o, e[53] = k) : k = e[53];
314
+ let $;
315
+ e[54] !== f || e[55] !== Ce || e[56] !== o ? ($ = f && o.length > f && Ce && /* @__PURE__ */ n("button", { type: "button", onClick: (c) => {
316
+ c.stopPropagation(), Wt(!1);
317
+ }, className: "inline-flex items-center px-2.5 py-0.5 text-xs font-medium bg-muted text-muted-foreground rounded-full hover:bg-muted/80 transition-colors cursor-pointer", children: "Show less" }), e[54] = f, e[55] = Ce, e[56] = o, e[57] = $) : $ = e[57];
318
+ let Ue;
319
+ e[58] !== l || e[59] !== y || e[60] !== k || e[61] !== $ ? (Ue = /* @__PURE__ */ I("div", { className: "flex flex-wrap gap-1 mb-1", onClick: l, children: [
318
320
  y,
319
321
  k,
320
- E
321
- ] }), e[58] = l, e[59] = y, e[60] = k, e[61] = E, e[62] = Je) : Je = e[62], _e = Je;
322
+ $
323
+ ] }), e[58] = l, e[59] = y, e[60] = k, e[61] = $, e[62] = Ue) : Ue = e[62], tt = Ue;
322
324
  }
323
- const Et = _e, ne = Ft === "button", $t = N ? "border border-destructive" : Po[mo], qt = Oo[fo], Kt = m ? "opacity-50 cursor-not-allowed" : "cursor-text";
324
- let dt;
325
- e[63] !== w || e[64] !== $t || e[65] !== qt || e[66] !== Kt ? (dt = C("relative flex items-center rounded-md", $t, qt, Kt, "transition-colors", w), e[63] = w, e[64] = $t, e[65] = qt, e[66] = Kt, e[67] = dt) : dt = e[67];
326
- const Ht = dt, Vt = m ? "opacity-50 cursor-not-allowed" : "cursor-pointer";
327
- let ut;
328
- e[68] !== w || e[69] !== Vt ? (ut = C("relative inline-flex items-center gap-2", Vt, w), e[68] = w, e[69] = Vt, e[70] = ut) : ut = e[70];
329
- const jt = ut, Mt = B ?? tt, Se = so(), Xt = oo(null), ie = oo(null);
330
- let ft, mt;
331
- e[71] !== s || e[72] !== h ? (ft = () => {
332
- var o;
333
- s && h && ((o = Xt.current) == null || o.focus());
334
- }, mt = [s, h], e[71] = s, e[72] = h, e[73] = ft, e[74] = mt) : (ft = e[73], mt = e[74]), yt(ft, mt);
335
- let pt;
336
- e[75] !== a || e[76] !== Lt || e[77] !== ze || e[78] !== It || e[79] !== b || e[80] !== s || e[81] !== z || e[82] !== h ? (pt = (o) => {
337
- if (!It) {
338
- const y = ze(o) ? [] : [o];
339
- b == null || b(null, y), a == null || a({
325
+ const Kt = tt, ae = At === "button", Ht = N ? "border border-destructive" : Do[bo], Vt = Bo[ho], jt = h ? "opacity-50 cursor-not-allowed" : "cursor-text";
326
+ let ft;
327
+ e[63] !== v || e[64] !== Ht || e[65] !== Vt || e[66] !== jt ? (ft = C("relative flex items-center rounded-md", Ht, Vt, jt, "transition-colors", v), e[63] = v, e[64] = Ht, e[65] = Vt, e[66] = jt, e[67] = ft) : ft = e[67];
328
+ const Mt = ft, Xt = h ? "opacity-50 cursor-not-allowed" : "cursor-pointer";
329
+ let mt;
330
+ e[68] !== v || e[69] !== Xt ? (mt = C("relative inline-flex items-center gap-2", Xt, v), e[68] = v, e[69] = Xt, e[70] = mt) : mt = e[70];
331
+ const Zt = mt, Gt = A ?? Nt, Oe = uo(), Jt = no(null), ce = no(null);
332
+ let pt, ht;
333
+ e[71] !== s || e[72] !== m ? (pt = () => {
334
+ var t;
335
+ s && m && ((t = Jt.current) == null || t.focus());
336
+ }, ht = [s, m], e[71] = s, e[72] = m, e[73] = pt, e[74] = ht) : (pt = e[73], ht = e[74]), Ct(pt, ht);
337
+ let bt;
338
+ e[75] !== a || e[76] !== Et || e[77] !== $e || e[78] !== Ft || e[79] !== p || e[80] !== s || e[81] !== E || e[82] !== m ? (bt = (t) => {
339
+ if (!Ft) {
340
+ const y = $e(t) ? [] : [t];
341
+ p == null || p(null, y), a == null || a({
340
342
  itemData: y
341
- }), z(!1);
343
+ }), E(!1);
342
344
  return;
343
345
  }
344
- Lt(o), h && s && setTimeout(() => {
346
+ Et(t), m && s && setTimeout(() => {
345
347
  var l;
346
- (l = Xt.current) == null || l.focus();
348
+ (l = Jt.current) == null || l.focus();
347
349
  }, 10);
348
- }, e[75] = a, e[76] = Lt, e[77] = ze, e[78] = It, e[79] = b, e[80] = s, e[81] = z, e[82] = h, e[83] = pt) : pt = e[83];
349
- const Zt = pt;
350
- let ht, bt;
351
- e[84] !== j.length || e[85] !== V || e[86] !== X || e[87] !== s ? (ht = () => {
352
- if (!(!s || V < 0 || !X.current) && j.length !== 0 && !(V >= j.length))
353
- return ie.current !== null && (cancelAnimationFrame(ie.current), ie.current = null), ie.current = requestAnimationFrame(() => {
354
- if (!X.current)
350
+ }, e[75] = a, e[76] = Et, e[77] = $e, e[78] = Ft, e[79] = p, e[80] = s, e[81] = E, e[82] = m, e[83] = bt) : bt = e[83];
351
+ const Qt = bt;
352
+ let gt, xt;
353
+ e[84] !== X.length || e[85] !== M || e[86] !== G || e[87] !== s ? (gt = () => {
354
+ if (!(!s || M < 0 || !G.current) && X.length !== 0 && !(M >= X.length))
355
+ return ce.current !== null && (cancelAnimationFrame(ce.current), ce.current = null), ce.current = requestAnimationFrame(() => {
356
+ if (!G.current)
355
357
  return;
356
- const o = X.current.querySelector('div.max-h-60, div[class*="max-h-60"]');
357
- if (!o)
358
+ const t = G.current.querySelector('div.max-h-60, div[class*="max-h-60"]');
359
+ if (!t)
358
360
  return;
359
- const l = o.querySelector(`[data-option-index="${V}"]`);
361
+ const l = t.querySelector(`[data-option-index="${M}"]`);
360
362
  l && l.scrollIntoView({
361
363
  behavior: "auto",
362
364
  block: "nearest",
363
365
  inline: "nearest"
364
- }), ie.current = null;
366
+ }), ce.current = null;
365
367
  }), () => {
366
- ie.current !== null && (cancelAnimationFrame(ie.current), ie.current = null);
368
+ ce.current !== null && (cancelAnimationFrame(ce.current), ce.current = null);
367
369
  };
368
- }, bt = [V, s, j.length, X], e[84] = j.length, e[85] = V, e[86] = X, e[87] = s, e[88] = ht, e[89] = bt) : (ht = e[88], bt = e[89]), yt(ht, bt);
369
- let Ee;
370
+ }, xt = [M, s, X.length, G], e[84] = X.length, e[85] = M, e[86] = G, e[87] = s, e[88] = gt, e[89] = xt) : (gt = e[88], xt = e[89]), Ct(gt, xt);
371
+ let qe;
370
372
  e: {
371
373
  if (typeof O == "function") {
372
- let o;
373
- e[90] !== t ? (o = t ?? [], e[90] = t, e[91] = o) : o = e[91];
374
+ let t;
375
+ e[90] !== o ? (t = o ?? [], e[90] = o, e[91] = t) : t = e[91];
374
376
  let l;
375
- e[92] !== o || e[93] !== O ? (l = O(o), e[92] = o, e[93] = O, e[94] = l) : l = e[94], Ee = l;
377
+ e[92] !== t || e[93] !== O ? (l = O(t), e[92] = t, e[93] = O, e[94] = l) : l = e[94], qe = l;
376
378
  break e;
377
379
  }
378
380
  if (O !== void 0) {
379
- Ee = O;
381
+ qe = O;
380
382
  break e;
381
383
  }
382
- if (Array.isArray(t) && t.length > 0) {
383
- if (t.length === 1) {
384
- let o;
385
- e[95] !== R || e[96] !== t[0] ? (o = R(t[0]), e[95] = R, e[96] = t[0], e[97] = o) : o = e[97], Ee = o;
384
+ if (Array.isArray(o) && o.length > 0) {
385
+ if (o.length === 1) {
386
+ let t;
387
+ e[95] !== R || e[96] !== o[0] ? (t = R(o[0]), e[95] = R, e[96] = o[0], e[97] = t) : t = e[97], qe = t;
386
388
  break e;
387
389
  }
388
- Ee = `${t.length} selected`;
390
+ qe = `${o.length} selected`;
389
391
  break e;
390
392
  }
391
- Ee = p;
393
+ qe = j;
392
394
  }
393
- const Gt = Ee;
394
- let $e;
395
- e[98] !== me ? ($e = me ?? {}, e[98] = me, e[99] = $e) : $e = e[99];
396
- let qe, Ke, gt, se;
397
- e[100] !== $e ? ({
398
- onClick: se,
399
- fullWidth: gt,
400
- className: Ke,
401
- ...qe
402
- } = $e, e[100] = $e, e[101] = qe, e[102] = Ke, e[103] = gt, e[104] = se) : (qe = e[101], Ke = e[102], gt = e[103], se = e[104]);
403
- const Jt = De ?? "outline", Qt = Ye ?? "small", Ut = gt ?? lo ?? !1, He = U ?? "right";
404
- let xt;
405
- e[105] !== s || e[106] !== He || e[107] !== pe ? (xt = pe ?? (He === "left" ? /* @__PURE__ */ n(to, { className: C("h-4 w-4 transition-transform", s ? "-rotate-180" : "") }) : /* @__PURE__ */ n(to, { className: C("h-4 w-4 transition-transform", s ? "rotate-180" : "") })), e[105] = s, e[106] = He, e[107] = pe, e[108] = xt) : xt = e[108];
406
- const Yt = xt, _t = "w-auto", eo = ne ? "" : kt;
407
- let Ve;
408
- e[109] !== _t || e[110] !== eo ? (Ve = C("relative", _t, eo), e[109] = _t, e[110] = eo, e[111] = Ve) : Ve = e[111];
409
- let je;
410
- e[112] !== ve || e[113] !== I || e[114] !== x || e[115] !== i || e[116] !== Ct || e[117] !== ye || e[118] !== z ? (je = x && /* @__PURE__ */ D("label", { htmlFor: ve, className: "block text-sm font-medium mb-1", onClick: (o) => {
395
+ const Ut = qe;
396
+ let Ke;
397
+ e[98] !== be ? (Ke = be ?? {}, e[98] = be, e[99] = Ke) : Ke = e[99];
398
+ let He, Ve, vt, de;
399
+ e[100] !== Ke ? ({
400
+ onClick: de,
401
+ fullWidth: vt,
402
+ className: Ve,
403
+ ...He
404
+ } = Ke, e[100] = Ke, e[101] = He, e[102] = Ve, e[103] = vt, e[104] = de) : (He = e[101], Ve = e[102], vt = e[103], de = e[104]);
405
+ const Yt = Ae ?? "outline", _t = et ?? "small", eo = vt ?? so ?? !1, je = _ ?? "right", Ie = L !== void 0 || W !== void 0;
406
+ let wt;
407
+ e[105] !== s || e[106] !== je || e[107] !== ge ? (wt = ge ?? (je === "left" ? /* @__PURE__ */ n(lo, { className: C("h-4 w-4 transition-transform", s ? "-rotate-180" : "") }) : /* @__PURE__ */ n(lo, { className: C("h-4 w-4 transition-transform", s ? "rotate-180" : "") })), e[105] = s, e[106] = je, e[107] = ge, e[108] = wt) : wt = e[108];
408
+ const to = wt, oo = "w-auto", ro = ae ? "" : St;
409
+ let Me;
410
+ e[109] !== oo || e[110] !== ro ? (Me = C("relative", oo, ro), e[109] = oo, e[110] = ro, e[111] = Me) : Me = e[111];
411
+ let Xe;
412
+ e[112] !== ke || e[113] !== B || e[114] !== g || e[115] !== i || e[116] !== Tt || e[117] !== Se || e[118] !== E ? (Xe = g && /* @__PURE__ */ I("label", { htmlFor: ke, className: "block text-sm font-medium mb-1", onClick: (t) => {
411
413
  var l;
412
- o.preventDefault(), z(!1), ye(""), i == null || i({
414
+ t.preventDefault(), E(!1), Se(""), i == null || i({
413
415
  target: {
414
416
  value: ""
415
417
  }
416
- }, ""), (l = I.current) == null || l.focus();
417
- }, onKeyDown: (o) => {
418
+ }, ""), (l = B.current) == null || l.focus();
419
+ }, onKeyDown: (t) => {
418
420
  var l;
419
- (o.key === "Enter" || o.key === " ") && (o.preventDefault(), z(!1), ye(""), i == null || i({
421
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), E(!1), Se(""), i == null || i({
420
422
  target: {
421
423
  value: ""
422
424
  }
423
- }, ""), (l = I.current) == null || l.focus());
425
+ }, ""), (l = B.current) == null || l.focus());
424
426
  }, children: [
425
- x,
426
- Ct && /* @__PURE__ */ n("span", { className: "text-destructive ml-1", children: "*" })
427
- ] }), e[112] = ve, e[113] = I, e[114] = x, e[115] = i, e[116] = Ct, e[117] = ye, e[118] = z, e[119] = je) : je = e[119];
428
- let Me;
429
- e[120] !== jt || e[121] !== Gt || e[122] !== Ht || e[123] !== m || e[124] !== Wt || e[125] !== ct || e[126] !== ke || e[127] !== Ce || e[128] !== at || e[129] !== ve || e[130] !== I || e[131] !== re || e[132] !== ne || e[133] !== Se || e[134] !== Ae || e[135] !== s || e[136] !== p || e[137] !== Ut || e[138] !== Yt || e[139] !== He || e[140] !== Qt || e[141] !== Jt || e[142] !== qe || e[143] !== zt || e[144] !== h || e[145] !== Ke || e[146] !== se || e[147] !== st ? (Me = ne ? /* @__PURE__ */ D("div", { ref: st, className: jt, children: [
430
- /* @__PURE__ */ n("input", { id: ve, ref: I, value: re, onChange: ke, onKeyDown: Ce, onFocus: ct, "aria-hidden": "true", tabIndex: -1, readOnly: !0, className: "sr-only" }),
431
- /* @__PURE__ */ n(vo, { variant: Jt, size: Qt, icon: Yt, iconPosition: He, fullWidth: Ut, disabled: m, type: "button", "aria-haspopup": "listbox", "aria-expanded": s, "aria-controls": Se, className: C("hover:bg-transparent active:bg-transparent focus-visible:bg-transparent focus-visible:ring-0", Ke), ...qe, onClick: (o) => {
432
- if (se == null || se(o), m)
427
+ g,
428
+ Tt && /* @__PURE__ */ n("span", { className: "text-destructive ml-1", children: "*" })
429
+ ] }), e[112] = ke, e[113] = B, e[114] = g, e[115] = i, e[116] = Tt, e[117] = Se, e[118] = E, e[119] = Xe) : Xe = e[119];
430
+ let Ze;
431
+ e[120] !== Zt || e[121] !== Ut || e[122] !== Mt || e[123] !== h || e[124] !== $t || e[125] !== ut || e[126] !== Ne || e[127] !== Te || e[128] !== dt || e[129] !== Ie || e[130] !== ke || e[131] !== B || e[132] !== ie || e[133] !== ae || e[134] !== Oe || e[135] !== rt || e[136] !== s || e[137] !== j || e[138] !== eo || e[139] !== to || e[140] !== je || e[141] !== _t || e[142] !== Yt || e[143] !== He || e[144] !== qt || e[145] !== m || e[146] !== Ve || e[147] !== L || e[148] !== de || e[149] !== W || e[150] !== ct ? (Ze = ae ? /* @__PURE__ */ I("div", { ref: ct, className: Zt, children: [
432
+ /* @__PURE__ */ n("input", { id: ke, ref: B, value: ie, onChange: Ne, onKeyDown: Te, onFocus: ut, "aria-hidden": "true", tabIndex: -1, readOnly: !0, className: "sr-only" }),
433
+ /* @__PURE__ */ I(ko, { variant: Yt, size: _t, icon: Ie ? void 0 : to, iconPosition: Ie ? void 0 : je, fullWidth: eo, disabled: h, type: "button", "aria-haspopup": "listbox", "aria-expanded": s, "aria-controls": Oe, className: C("hover:bg-transparent active:bg-transparent focus-visible:bg-transparent focus-visible:ring-0", Ie && "gap-2", Ve), ...He, onClick: (t) => {
434
+ if (de == null || de(t), h)
433
435
  return;
434
436
  const l = !s;
435
- at(), l && setTimeout(() => {
437
+ dt(), l && setTimeout(() => {
436
438
  var y;
437
- (y = I.current) == null || y.focus();
439
+ (y = B.current) == null || y.focus();
438
440
  }, 0);
439
- }, children: Gt }),
440
- Ae && /* @__PURE__ */ n("div", { className: "ml-2 animate-spin rounded-full h-4 w-4 border-2 border-muted-foreground border-t-transparent" })
441
- ] }) : /* @__PURE__ */ D("div", { ref: st, className: Ht, children: [
442
- /* @__PURE__ */ n(yo, { id: ve, ref: I, value: h ? "" : re, onChange: h ? void 0 : ke, onKeyDown: Ce, onFocus: ct, placeholder: p, disabled: m, readOnly: h, className: "px-0 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent rounded-md", role: "combobox", "aria-expanded": s, "aria-controls": Se, "aria-autocomplete": "list" }),
443
- /* @__PURE__ */ D("div", { className: "flex items-center gap-1 ml-auto", children: [
444
- Ae && /* @__PURE__ */ n("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-muted-foreground border-t-transparent" }),
445
- zt && /* @__PURE__ */ n("button", { type: "button", onClick: Wt, className: "p-1 hover:bg-accent rounded-sm transition-colors", tabIndex: -1, children: /* @__PURE__ */ n(ao, { className: "h-4 w-4 text-muted-foreground" }) }),
446
- /* @__PURE__ */ n("button", { type: "button", disabled: m, onClick: at, className: C("p-1 hover:bg-accent rounded-sm transition-colors", m ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), tabIndex: -1, "aria-label": s ? "Close options" : "Open options", children: /* @__PURE__ */ n(to, { className: C("h-4 w-4 text-muted-foreground transition-transform", s ? "rotate-180" : "") }) })
441
+ }, children: [
442
+ Ie && L && /* @__PURE__ */ n("span", { "data-testid": "button-left-icon", className: "inline-flex shrink-0", children: L }),
443
+ Ut,
444
+ Ie && W && /* @__PURE__ */ n("span", { "data-testid": "button-right-icon", className: "inline-flex shrink-0", children: W })
445
+ ] }),
446
+ rt && /* @__PURE__ */ n("div", { className: "ml-2 animate-spin rounded-full h-4 w-4 border-2 border-muted-foreground border-t-transparent" })
447
+ ] }) : /* @__PURE__ */ I("div", { ref: ct, className: Mt, children: [
448
+ /* @__PURE__ */ n(So, { id: ke, ref: B, value: m ? "" : ie, onChange: m ? void 0 : Ne, onKeyDown: Te, onFocus: ut, placeholder: j, disabled: h, readOnly: m, className: "px-0 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent rounded-md", role: "combobox", "aria-expanded": s, "aria-controls": Oe, "aria-autocomplete": "list" }),
449
+ /* @__PURE__ */ I("div", { className: "flex items-center gap-1 ml-auto", children: [
450
+ rt && /* @__PURE__ */ n("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-muted-foreground border-t-transparent" }),
451
+ qt && /* @__PURE__ */ n("button", { type: "button", onClick: $t, className: "p-1 hover:bg-accent rounded-sm transition-colors", tabIndex: -1, children: /* @__PURE__ */ n(fo, { className: "h-4 w-4 text-muted-foreground" }) }),
452
+ /* @__PURE__ */ n("button", { type: "button", disabled: h, onClick: dt, className: C("p-1 hover:bg-accent rounded-sm transition-colors", h ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), tabIndex: -1, "aria-label": s ? "Close options" : "Open options", children: /* @__PURE__ */ n(lo, { className: C("h-4 w-4 text-muted-foreground transition-transform", s ? "rotate-180" : "") }) })
447
453
  ] })
448
- ] }), e[120] = jt, e[121] = Gt, e[122] = Ht, e[123] = m, e[124] = Wt, e[125] = ct, e[126] = ke, e[127] = Ce, e[128] = at, e[129] = ve, e[130] = I, e[131] = re, e[132] = ne, e[133] = Se, e[134] = Ae, e[135] = s, e[136] = p, e[137] = Ut, e[138] = Yt, e[139] = He, e[140] = Qt, e[141] = Jt, e[142] = qe, e[143] = zt, e[144] = h, e[145] = Ke, e[146] = se, e[147] = st, e[148] = Me) : Me = e[148];
449
- let Xe;
450
- e[149] !== Ot || e[150] !== Nt || e[151] !== G || e[152] !== J || e[153] !== At || e[154] !== m || e[155] !== M || e[156] !== Be || e[157] !== Le || e[158] !== j || e[159] !== Re || e[160] !== R || e[161] !== u || e[162] !== ke || e[163] !== Ce || e[164] !== Zt || e[165] !== Dt || e[166] !== V || e[167] !== w || e[168] !== re || e[169] !== ne || e[170] !== ze || e[171] !== x || e[172] !== X || e[173] !== Se || e[174] !== Mt || e[175] !== s || e[176] !== p || e[177] !== Y || e[178] !== ee || e[179] !== Q || e[180] !== Tt || e[181] !== Pt || e[182] !== h ? (Xe = s && (() => {
451
- const o = M.width > 0 && M.maxHeight > 0, l = /* @__PURE__ */ n(ko, { delayDuration: 0, children: /* @__PURE__ */ D("div", { id: Se, role: "listbox", "aria-label": x || "Options", "data-dialog-interactive-layer": "true", className: C("fixed z-[99999] pointer-events-auto bg-popover border border-border rounded-md shadow-lg", "flex flex-col overflow-hidden", !o && "invisible", w), style: (() => {
452
- const k = () => ne ? typeof Be == "number" ? `${Be}px` : typeof Be == "string" ? Be : "220px" : M.width;
454
+ ] }), e[120] = Zt, e[121] = Ut, e[122] = Mt, e[123] = h, e[124] = $t, e[125] = ut, e[126] = Ne, e[127] = Te, e[128] = dt, e[129] = Ie, e[130] = ke, e[131] = B, e[132] = ie, e[133] = ae, e[134] = Oe, e[135] = rt, e[136] = s, e[137] = j, e[138] = eo, e[139] = to, e[140] = je, e[141] = _t, e[142] = Yt, e[143] = He, e[144] = qt, e[145] = m, e[146] = Ve, e[147] = L, e[148] = de, e[149] = W, e[150] = ct, e[151] = Ze) : Ze = e[151];
455
+ let Ge;
456
+ e[152] !== Bt || e[153] !== It || e[154] !== Q || e[155] !== U || e[156] !== Lt || e[157] !== h || e[158] !== Z || e[159] !== We || e[160] !== ze || e[161] !== X || e[162] !== Le || e[163] !== R || e[164] !== u || e[165] !== Ne || e[166] !== Te || e[167] !== Qt || e[168] !== Rt || e[169] !== M || e[170] !== v || e[171] !== ie || e[172] !== ae || e[173] !== $e || e[174] !== g || e[175] !== G || e[176] !== Oe || e[177] !== Gt || e[178] !== s || e[179] !== j || e[180] !== xe || e[181] !== oe || e[182] !== Y || e[183] !== Pt || e[184] !== Dt || e[185] !== m ? (Ge = s && (() => {
457
+ const t = Z.width > 0 && Z.maxHeight > 0, l = /* @__PURE__ */ n(No, { delayDuration: 0, children: /* @__PURE__ */ I("div", { id: Oe, role: "listbox", "aria-label": g || "Options", "data-dialog-interactive-layer": "true", className: C("fixed z-[99999] pointer-events-auto bg-popover border border-border rounded-md shadow-lg", "flex flex-col overflow-hidden", !t && "invisible", v), style: (() => {
458
+ const k = () => ae ? typeof We == "number" ? `${We}px` : typeof We == "string" ? We : "220px" : Z.width;
453
459
  return {
454
- top: M.top,
455
- left: M.left,
456
- minWidth: ne ? void 0 : M.width,
460
+ top: Z.top,
461
+ left: Z.left,
462
+ minWidth: ae ? void 0 : Z.width,
457
463
  width: k(),
458
- maxHeight: M.maxHeight,
464
+ maxHeight: Z.maxHeight,
459
465
  zIndex: 99999,
460
466
  pointerEvents: "auto"
461
467
  };
462
- })(), ref: X, children: [
463
- h && /* @__PURE__ */ n("div", { className: "p-2 bg-popover", children: /* @__PURE__ */ n(xo, { ref: Xt, query: re, onChange: ke, onKeyDown: Ce, placeholder: Q ?? p, className: "w-full", "aria-label": "Search options", disabled: m, size: "small" }) }),
464
- /* @__PURE__ */ n("div", { className: C("min-h-0 flex-1 overflow-auto", !h && "py-2", Pt ? ["[scrollbar-gutter:stable]", "[&::-webkit-scrollbar]:w-2", "[&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:bg-gray-300", "[&::-webkit-scrollbar-thumb]:rounded-full", "[&::-webkit-scrollbar-thumb]:border-0", "[&::-webkit-scrollbar-thumb]:min-h-[30px]", "scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent"] : ["[&::-webkit-scrollbar]:hidden", "[-ms-overflow-style:none]", "[scrollbar-width:none]"]), children: j.length === 0 ? /* @__PURE__ */ n("div", { className: "p-3 text-sm text-muted-foreground text-center", children: Mt }) : j.map((k, E) => {
465
- const Je = ze(k);
466
- return /* @__PURE__ */ n(Io, { option: k, index: E, isSelected: Je, isHighlighted: E === V, onSelect: Zt, getOptionLabel: R, renderOption: ee, freeSolo: Re, originalOptions: Le, checkboxPosition: Nt, showChip: Tt, checkboxProps: G, chipProps: J, checkboxColor: Ot, hideCheckbox: Dt }, typeof k == "string" ? k : String((u == null ? void 0 : u(k)) ?? E));
468
+ })(), ref: G, children: [
469
+ m && /* @__PURE__ */ n("div", { className: "p-2 bg-popover", children: /* @__PURE__ */ n(yo, { ref: Jt, query: ie, onChange: Ne, onKeyDown: Te, placeholder: Y ?? j, className: "w-full", "aria-label": "Search options", disabled: h, size: "small" }) }),
470
+ /* @__PURE__ */ n("div", { className: C("min-h-0 flex-1 overflow-auto", !m && "py-2", Dt ? ["[scrollbar-gutter:stable]", "[&::-webkit-scrollbar]:w-2", "[&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:bg-gray-300", "[&::-webkit-scrollbar-thumb]:rounded-full", "[&::-webkit-scrollbar-thumb]:border-0", "[&::-webkit-scrollbar-thumb]:min-h-[30px]", "scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent"] : ["[&::-webkit-scrollbar]:hidden", "[-ms-overflow-style:none]", "[scrollbar-width:none]"]), children: X.length === 0 ? /* @__PURE__ */ n("div", { className: "p-3 text-sm text-muted-foreground text-center", children: Gt }) : X.map((k, $) => {
471
+ const Ue = $e(k);
472
+ return /* @__PURE__ */ n(Fo, { option: k, index: $, isSelected: Ue, isHighlighted: $ === M, onSelect: Qt, getOptionLabel: R, renderOption: oe, freeSolo: Le, originalOptions: ze, checkboxPosition: It, showChip: Pt, checkboxProps: Q, chipProps: U, checkboxColor: Bt, hideCheckbox: Rt }, typeof k == "string" ? k : String((u == null ? void 0 : u(k)) ?? $));
467
473
  }) })
468
474
  ] }) });
469
- if (At)
475
+ if (Lt)
470
476
  return l;
471
- const y = Y ?? document.body;
472
- return bo(l, y);
473
- })(), e[149] = Ot, e[150] = Nt, e[151] = G, e[152] = J, e[153] = At, e[154] = m, e[155] = M, e[156] = Be, e[157] = Le, e[158] = j, e[159] = Re, e[160] = R, e[161] = u, e[162] = ke, e[163] = Ce, e[164] = Zt, e[165] = Dt, e[166] = V, e[167] = w, e[168] = re, e[169] = ne, e[170] = ze, e[171] = x, e[172] = X, e[173] = Se, e[174] = Mt, e[175] = s, e[176] = p, e[177] = Y, e[178] = ee, e[179] = Q, e[180] = Tt, e[181] = Pt, e[182] = h, e[183] = Xe) : Xe = e[183];
474
- let Ze;
475
- e[184] !== Et || e[185] !== Me || e[186] !== Xe ? (Ze = /* @__PURE__ */ D("div", { className: "relative overflow-visible", children: [
476
- Et,
477
- Me,
478
- Xe
479
- ] }), e[184] = Et, e[185] = Me, e[186] = Xe, e[187] = Ze) : Ze = e[187];
480
- let Ge;
481
- e[188] !== N || e[189] !== S ? (Ge = (S || N) && /* @__PURE__ */ n("p", { className: C("mt-1 text-xs", N ? "text-destructive" : "text-muted-foreground"), children: N || S }), e[188] = N, e[189] = S, e[190] = Ge) : Ge = e[190];
482
- let vt;
483
- return e[191] !== Bt || e[192] !== Ve || e[193] !== je || e[194] !== Ze || e[195] !== Ge ? (vt = /* @__PURE__ */ D("div", { className: Ve, ref: Bt, children: [
484
- je,
477
+ const y = xe ?? document.body;
478
+ return vo(l, y);
479
+ })(), e[152] = Bt, e[153] = It, e[154] = Q, e[155] = U, e[156] = Lt, e[157] = h, e[158] = Z, e[159] = We, e[160] = ze, e[161] = X, e[162] = Le, e[163] = R, e[164] = u, e[165] = Ne, e[166] = Te, e[167] = Qt, e[168] = Rt, e[169] = M, e[170] = v, e[171] = ie, e[172] = ae, e[173] = $e, e[174] = g, e[175] = G, e[176] = Oe, e[177] = Gt, e[178] = s, e[179] = j, e[180] = xe, e[181] = oe, e[182] = Y, e[183] = Pt, e[184] = Dt, e[185] = m, e[186] = Ge) : Ge = e[186];
480
+ let Je;
481
+ e[187] !== Kt || e[188] !== Ze || e[189] !== Ge ? (Je = /* @__PURE__ */ I("div", { className: "relative overflow-visible", children: [
482
+ Kt,
485
483
  Ze,
486
484
  Ge
487
- ] }), e[191] = Bt, e[192] = Ve, e[193] = je, e[194] = Ze, e[195] = Ge, e[196] = vt) : vt = e[196], vt;
485
+ ] }), e[187] = Kt, e[188] = Ze, e[189] = Ge, e[190] = Je) : Je = e[190];
486
+ let Qe;
487
+ e[191] !== N || e[192] !== S ? (Qe = (S || N) && /* @__PURE__ */ n("p", { className: C("mt-1 text-xs", N ? "text-destructive" : "text-muted-foreground"), children: N || S }), e[191] = N, e[192] = S, e[193] = Qe) : Qe = e[193];
488
+ let yt;
489
+ return e[194] !== zt || e[195] !== Me || e[196] !== Xe || e[197] !== Je || e[198] !== Qe ? (yt = /* @__PURE__ */ I("div", { className: Me, ref: zt, children: [
490
+ Xe,
491
+ Je,
492
+ Qe
493
+ ] }), e[194] = zt, e[195] = Me, e[196] = Xe, e[197] = Je, e[198] = Qe, e[199] = yt) : yt = e[199], yt;
488
494
  }
489
495
  export {
490
- jo as AutocompleteCheckbox
496
+ Zo as AutocompleteCheckbox
491
497
  };