fansunited-widgets-cdn 0.0.86-RC4 → 0.0.86-RC6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/chunks/{Alert-DuMXT9be.js → Alert-B6o66mYo.js} +39 -39
  2. package/chunks/{CardContent-COgjZl3_.js → CardContent-NCZhfGcZ.js} +16 -16
  3. package/chunks/{Snackbar-DJz-WddP.js → ChevronRight-1pLZ7T0v.js} +100 -94
  4. package/chunks/{ClassicQuizWrapper-C7svf4eh.js → ClassicQuizWrapper-n2epPO4k.js} +201 -205
  5. package/chunks/CollectLeadForm-C_3plJtn-Dr8J3eDw.js +3918 -0
  6. package/chunks/{CollectLeadWrapper-DACvBsa_.js → CollectLeadWrapper-CCtTZAxL.js} +55 -56
  7. package/chunks/EitherOrById-ClGwMK0b.js +6820 -0
  8. package/chunks/EitherOrPreviewWrapper-BYiKyYwi.js +46 -0
  9. package/chunks/Error-BurPfBJw-DWYn31sK.js +1119 -0
  10. package/chunks/{EventGameWrapper-DmjaKr3I.js → EventGameWrapper-BphusLTk.js} +208 -219
  11. package/chunks/{Grid-BbegUe2J.js → Grid-yjqNNhEx.js} +32 -32
  12. package/chunks/{IconButton-zh1RLwcE.js → IconButton-D7onwgY0.js} +22 -22
  13. package/chunks/{List-CA3L6bUS.js → List-8Vy9IZiv.js} +26 -29
  14. package/chunks/{MatchPredictionContainer-CmHKsJ_z.js → MatchPredictionContainer-BGytBwLo.js} +52 -54
  15. package/chunks/{MatchQuizWrapper-BxHHl4a5.js → MatchQuizWrapper-BGjldBpF.js} +73 -85
  16. package/chunks/{OverlayLeadAfterCollection-DnqztPJ5-CJnicIes.js → OverlayLeadAfterCollection-Bjh1xAB5-DgVOuSX5.js} +104 -105
  17. package/chunks/{OverlayScoreStateSkeleton-C9FUhcnd-CZ7cct30.js → OverlayScoreStateSkeleton-Cha5KeNi-fyZTu-l5.js} +18 -19
  18. package/chunks/{PersonalityQuizWrapper-B-Rkzvc0.js → PersonalityQuizWrapper-BgLFw5tM.js} +3 -3
  19. package/chunks/{PlayerOfTheMatch-CzGMT1jr.js → PlayerOfTheMatch-CImBLG3T.js} +1008 -609
  20. package/chunks/{PollWrapper-Cdl3AbXE.js → PollWrapper-QpIKCCVF.js} +30 -34
  21. package/chunks/Portal-DegkUXpU-ByGP9zS1.js +19236 -0
  22. package/chunks/{PreviewQuizById-CPiwewW_.js → PreviewQuizById-Ba6yhxKV.js} +11 -14
  23. package/chunks/Sheet-U5EnSrgg.js +282 -0
  24. package/chunks/{Stack-BBjT-MoB.js → Stack-DbDi7kPO.js} +30 -30
  25. package/chunks/Tabs-leN3Fb8D--YMyy3EM.js +783 -0
  26. package/chunks/{TeamNextMatchPrediction-BOOGeVEv.js → TeamNextMatchPrediction-9VSQOCcC.js} +2 -2
  27. package/chunks/Tutorial-CRJLOovs.js +1072 -0
  28. package/chunks/createLucideIcon-CMWOQsDL.js +381 -0
  29. package/chunks/{createSvgIcon-cOpRx8M1.js → createSvgIcon-D9D4a1R9.js} +412 -390
  30. package/chunks/default-quiz-bg-ADjjIfPj.js +126 -0
  31. package/chunks/{index-CNAE4RYY.js → index-0ADq_9jd.js} +1 -1
  32. package/chunks/{index-D9kNvflO.js → index-B74jHeYm.js} +2 -2
  33. package/chunks/{index-Dr-yGqo_.js → index-BfVvJg5R.js} +1 -1
  34. package/chunks/{index-D3wDyWq_.js → index-BycLbIYY.js} +1 -1
  35. package/chunks/{index-BKyd0MUt.js → index-C6KAc5B_.js} +1 -1
  36. package/chunks/{index-BkU2GDR4.js → index-CHV6tlpH.js} +5 -5
  37. package/chunks/{index-Uv42o9aR.js → index-CILd3yUc.js} +1 -1
  38. package/chunks/index-CJqcqbHq.js +5 -0
  39. package/chunks/{index-DrlzgjUf.js → index-CK2RXrJm.js} +1 -1
  40. package/chunks/{index-DFXrZaoM.js → index-CPTAlr_t.js} +1 -1
  41. package/chunks/{index-D1SEUyHT.js → index-CiB_Gqim.js} +1 -1
  42. package/chunks/{index-CNukXTLi.js → index-CvGJXa6l.js} +1 -1
  43. package/chunks/{index-CpFMxpj1.js → index-CviTG4Nv.js} +1 -1
  44. package/chunks/index-DUQ2LFod-Cw45tHim.js +4510 -0
  45. package/chunks/{index-DbZ10tsY.js → index-Da0AXb_O.js} +1 -1
  46. package/chunks/{index-CiI_vSMR.js → index-DwR4J2nN.js} +1 -1
  47. package/chunks/{index-CMhbRdLz.js → index-UwW9niUj.js} +1 -1
  48. package/chunks/index.es-wHqA4PHm.js +11480 -0
  49. package/chunks/{init-DYY4CJtu.js → init-C-gCorsh.js} +1 -1
  50. package/chunks/{main-NO9IQFuY.js → main-Bh6iw92_.js} +94 -110
  51. package/chunks/{Button-DJj0KOh3.js → resolveProps-Bgg0H6c2.js} +471 -313
  52. package/chunks/{users-C-6eqEb6.js → users-CXdzg3DM.js} +1 -1
  53. package/fu-widgets.es.js +2 -2
  54. package/fu-widgets.iife.js +310 -257
  55. package/manifest.json +56 -72
  56. package/package.json +1 -1
  57. package/chunks/AspectRatio-CKWgGwn-.js +0 -125
  58. package/chunks/Avatar-Cv70g9HX.js +0 -186
  59. package/chunks/Card-BDn3dk3E.js +0 -129
  60. package/chunks/ChevronRight-BwGivLSL.js +0 -11
  61. package/chunks/Chip-BkY7Uww3.js +0 -281
  62. package/chunks/CollectLeadForm-DtmR2Vuf-DvAoHDnn.js +0 -1560
  63. package/chunks/DialogActions-CuXgjeCi.js +0 -45
  64. package/chunks/DialogContent-CyQJ8yz-.js +0 -60
  65. package/chunks/EitherOrById-B8v0nJmv.js +0 -1496
  66. package/chunks/EitherOrPreviewWrapper-C9O6TEVe.js +0 -47
  67. package/chunks/Error-DhQL89pn-DD0O1kEt.js +0 -418
  68. package/chunks/Link-Cw8ci6QQ.js +0 -228
  69. package/chunks/ListItemDecorator-DwvO_ty1.js +0 -1882
  70. package/chunks/ModalDialog-DLPhSR9-.js +0 -619
  71. package/chunks/NotFoundSkeleton-BYJTzYJR-JURKfNZv.js +0 -2764
  72. package/chunks/Portal-BWqqFvVm-pvatNKfM.js +0 -12717
  73. package/chunks/Portal-BsATdUrC.js +0 -41
  74. package/chunks/Select-Cewujqtd.js +0 -3418
  75. package/chunks/Sheet-B8wNvQTa.js +0 -167
  76. package/chunks/Tabs-BP1RMTCA.js +0 -784
  77. package/chunks/Tutorial-B1LWDD9l.js +0 -427
  78. package/chunks/createLucideIcon-nPUeaUEe.js +0 -79
  79. package/chunks/createSvgIcon-DhITitgm.js +0 -119
  80. package/chunks/default-quiz-bg-CTzaADn7.js +0 -4
  81. package/chunks/getReactElementRef-66jU_By9.js +0 -25
  82. package/chunks/index-BPH9IX2Q.js +0 -5
  83. package/chunks/index.es-BZbN3xaq.js +0 -6162
  84. package/chunks/resolveProps-BfYZubfk.js +0 -37
  85. package/chunks/variantColorInheritance-DVZ9CGcB.js +0 -28
@@ -0,0 +1,3918 @@
1
+ import { j as t, r as p } from "./main-Bh6iw92_.js";
2
+ import { A as uo, F as po, w as Wr, C as cr, b as Ae, z as mo, l as vo, Q as _r, n as Jr, c as zo, o as rr, q as Ur, r as Kr, s as Qr, T as Hr, B as Xr, L as Zr, t as Do, H as Lo, v as ze, x as ue, y as dr, P as s, K as H, U as N, Z as Xe, a0 as Ir, a1 as De, a2 as ur, a3 as pr, a4 as Pe, a5 as or, a6 as ho, a7 as $o, a8 as Fo, a9 as go, aa as No, ab as Ro, ac as jo, ad as te, ae as Oo, af as Sr, ag as xr, ah as Ho, ai as fo, aj as Bo, ak as Ao, al as Mo, am as Wo, an as Er, ao as Br, ap as $e, aq as _o, ar as Jo, as as Eo, at as Vo, au as Yr, av as bo, aw as qo, ax as Go, ay as Uo, az as Ar, aA as Ko, aB as Qo, aC as eo, aD as ro, aE as Xo, aF as Zo, aG as xo, aH as Yo, aI as et } from "./Portal-DegkUXpU-ByGP9zS1.js";
3
+ function rt(e, r = 166) {
4
+ let o;
5
+ function n(...i) {
6
+ const c = () => {
7
+ e.apply(this, i);
8
+ };
9
+ clearTimeout(o), o = setTimeout(c, r);
10
+ }
11
+ return n.clear = () => {
12
+ clearTimeout(o);
13
+ }, n;
14
+ }
15
+ const ot = (e) => {
16
+ const r = p.useRef({});
17
+ return p.useEffect(() => {
18
+ r.current = e;
19
+ }), r.current;
20
+ };
21
+ function oo() {
22
+ return null;
23
+ }
24
+ oo.isRequired = oo;
25
+ function tt(e) {
26
+ const {
27
+ checked: r,
28
+ defaultChecked: o,
29
+ disabled: n,
30
+ onBlur: i,
31
+ onChange: c,
32
+ onFocus: u,
33
+ onFocusVisible: m,
34
+ readOnly: y,
35
+ required: x
36
+ } = e, [C, v] = Sr({
37
+ controlled: r,
38
+ default: !!o,
39
+ name: "Switch",
40
+ state: "checked"
41
+ }), T = (k) => (L) => {
42
+ var J;
43
+ L.nativeEvent.defaultPrevented || (v(L.target.checked), c == null || c(L), (J = k.onChange) == null || J.call(k, L));
44
+ }, {
45
+ isFocusVisibleRef: b,
46
+ onBlur: z,
47
+ onFocus: S,
48
+ ref: w
49
+ } = xo(), [h, D] = p.useState(!1);
50
+ n && h && D(!1), p.useEffect(() => {
51
+ b.current = h;
52
+ }, [h, b]);
53
+ const I = p.useRef(null), d = (k) => (L) => {
54
+ var J;
55
+ I.current || (I.current = L.currentTarget), S(L), b.current === !0 && (D(!0), m == null || m(L)), u == null || u(L), (J = k.onFocus) == null || J.call(k, L);
56
+ }, q = (k) => (L) => {
57
+ var J;
58
+ z(L), b.current === !1 && D(!1), i == null || i(L), (J = k.onBlur) == null || J.call(k, L);
59
+ }, B = pr(w, I);
60
+ return {
61
+ checked: C,
62
+ disabled: !!n,
63
+ focusVisible: h,
64
+ getInputProps: (k = {}) => s({
65
+ checked: r,
66
+ defaultChecked: o,
67
+ disabled: n,
68
+ readOnly: y,
69
+ ref: B,
70
+ required: x,
71
+ type: "checkbox",
72
+ role: "switch",
73
+ "aria-checked": r
74
+ }, k, {
75
+ onChange: T(k),
76
+ onFocus: d(k),
77
+ onBlur: q(k)
78
+ }),
79
+ inputRef: B,
80
+ readOnly: !!y
81
+ };
82
+ }
83
+ const nt = ["onChange", "maxRows", "minRows", "style", "value"];
84
+ function yr(e) {
85
+ return parseInt(e, 10) || 0;
86
+ }
87
+ const at = {
88
+ shadow: {
89
+ // Visibility needed to hide the extra text area on iPads
90
+ visibility: "hidden",
91
+ // Remove from the content flow
92
+ position: "absolute",
93
+ // Ignore the scrollbar width
94
+ overflow: "hidden",
95
+ height: 0,
96
+ top: 0,
97
+ left: 0,
98
+ // Create a new layer, increase the isolation of the computed values
99
+ transform: "translateZ(0)"
100
+ }
101
+ };
102
+ function lt(e) {
103
+ return e == null || Object.keys(e).length === 0 || e.outerHeightStyle === 0 && !e.overflowing;
104
+ }
105
+ const it = /* @__PURE__ */ p.forwardRef(function(e, r) {
106
+ const {
107
+ onChange: o,
108
+ maxRows: n,
109
+ minRows: i = 1,
110
+ style: c,
111
+ value: u
112
+ } = e, m = ue(e, nt), {
113
+ current: y
114
+ } = p.useRef(u != null), x = p.useRef(null), C = pr(r, x), v = p.useRef(null), T = p.useCallback(() => {
115
+ const S = x.current, w = eo(S).getComputedStyle(S);
116
+ if (w.width === "0px")
117
+ return {
118
+ outerHeightStyle: 0,
119
+ overflowing: !1
120
+ };
121
+ const h = v.current;
122
+ h.style.width = w.width, h.value = S.value || e.placeholder || "x", h.value.slice(-1) === `
123
+ ` && (h.value += " ");
124
+ const D = w.boxSizing, I = yr(w.paddingBottom) + yr(w.paddingTop), d = yr(w.borderBottomWidth) + yr(w.borderTopWidth), q = h.scrollHeight;
125
+ h.value = "x";
126
+ const B = h.scrollHeight;
127
+ let k = q;
128
+ i && (k = Math.max(Number(i) * B, k)), n && (k = Math.min(Number(n) * B, k)), k = Math.max(k, B);
129
+ const L = k + (D === "border-box" ? I + d : 0), J = Math.abs(k - q) <= 1;
130
+ return {
131
+ outerHeightStyle: L,
132
+ overflowing: J
133
+ };
134
+ }, [n, i, e.placeholder]), b = p.useCallback(() => {
135
+ const S = T();
136
+ if (lt(S))
137
+ return;
138
+ const w = x.current;
139
+ w.style.height = `${S.outerHeightStyle}px`, w.style.overflow = S.overflowing ? "hidden" : "";
140
+ }, [T]);
141
+ ro(() => {
142
+ const S = () => {
143
+ b();
144
+ };
145
+ let w;
146
+ const h = rt(S), D = x.current, I = eo(D);
147
+ I.addEventListener("resize", h);
148
+ let d;
149
+ return typeof ResizeObserver < "u" && (d = new ResizeObserver(S), d.observe(D)), () => {
150
+ h.clear(), cancelAnimationFrame(w), I.removeEventListener("resize", h), d && d.disconnect();
151
+ };
152
+ }, [T, b]), ro(() => {
153
+ b();
154
+ });
155
+ const z = (S) => {
156
+ y || b(), o && o(S);
157
+ };
158
+ return /* @__PURE__ */ t.jsxs(p.Fragment, {
159
+ children: [/* @__PURE__ */ t.jsx("textarea", s({
160
+ value: u,
161
+ onChange: z,
162
+ ref: C,
163
+ rows: i,
164
+ style: c
165
+ }, m)), /* @__PURE__ */ t.jsx("textarea", {
166
+ "aria-hidden": !0,
167
+ className: e.className,
168
+ readOnly: !0,
169
+ ref: v,
170
+ tabIndex: -1,
171
+ style: s({}, at.shadow, c, {
172
+ paddingTop: 0,
173
+ paddingBottom: 0
174
+ })
175
+ })]
176
+ });
177
+ });
178
+ function to(e) {
179
+ return typeof e.normalize < "u" ? e.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : e;
180
+ }
181
+ function st(e = {}) {
182
+ const {
183
+ ignoreAccents: r = !0,
184
+ ignoreCase: o = !0,
185
+ limit: n,
186
+ matchFrom: i = "any",
187
+ stringify: c,
188
+ trim: u = !1
189
+ } = e;
190
+ return (m, {
191
+ inputValue: y,
192
+ getOptionLabel: x
193
+ }) => {
194
+ let C = u ? y.trim() : y;
195
+ o && (C = C.toLowerCase()), r && (C = to(C));
196
+ const v = C ? m.filter((T) => {
197
+ let b = (c || x)(T);
198
+ return o && (b = b.toLowerCase()), r && (b = to(b)), i === "start" ? b.indexOf(C) === 0 : b.indexOf(C) > -1;
199
+ }) : m;
200
+ return typeof n == "number" ? v.slice(0, n) : v;
201
+ };
202
+ }
203
+ function Cr(e, r) {
204
+ for (let o = 0; o < e.length; o += 1)
205
+ if (r(e[o]))
206
+ return o;
207
+ return -1;
208
+ }
209
+ const ct = st(), no = 5, dt = (e) => {
210
+ var r;
211
+ return e.current !== null && ((r = e.current.parentElement) == null ? void 0 : r.contains(document.activeElement));
212
+ };
213
+ function ut(e) {
214
+ const {
215
+ // eslint-disable-next-line @typescript-eslint/naming-convention
216
+ unstable_isActiveElementInListbox: r = dt,
217
+ // eslint-disable-next-line @typescript-eslint/naming-convention
218
+ unstable_classNamePrefix: o = "Mui",
219
+ autoComplete: n = !1,
220
+ autoHighlight: i = !1,
221
+ autoSelect: c = !1,
222
+ blurOnSelect: u = !1,
223
+ clearOnBlur: m = !e.freeSolo,
224
+ clearOnEscape: y = !1,
225
+ componentName: x = "useAutocomplete",
226
+ defaultValue: C = e.multiple ? [] : null,
227
+ disableClearable: v = !1,
228
+ disableCloseOnSelect: T = !1,
229
+ disabled: b,
230
+ disabledItemsFocusable: z = !1,
231
+ disableListWrap: S = !1,
232
+ filterOptions: w = ct,
233
+ filterSelectedOptions: h = !1,
234
+ freeSolo: D = !1,
235
+ getOptionDisabled: I,
236
+ getOptionKey: d,
237
+ getOptionLabel: q = (l) => {
238
+ var a;
239
+ return (a = l.label) != null ? a : l;
240
+ },
241
+ groupBy: B,
242
+ handleHomeEndKeys: k = !e.freeSolo,
243
+ id: L,
244
+ includeInputInList: J = !1,
245
+ inputValue: V,
246
+ isOptionEqualToValue: Q = (l, a) => l === a,
247
+ multiple: g = !1,
248
+ onChange: O,
249
+ onClose: _,
250
+ onHighlightChange: G,
251
+ onInputChange: ne,
252
+ onOpen: X,
253
+ open: W,
254
+ openOnFocus: he = !1,
255
+ options: se,
256
+ readOnly: A = !1,
257
+ selectOnFocus: ce = !e.freeSolo,
258
+ value: Se
259
+ } = e, ie = dr(L);
260
+ let ae = q;
261
+ ae = (l) => {
262
+ const a = q(l);
263
+ return typeof a != "string" ? String(a) : a;
264
+ };
265
+ const ge = p.useRef(!1), xe = p.useRef(!0), U = p.useRef(null), K = p.useRef(null), [pe, R] = p.useState(null), [de, Ce] = p.useState(-1), Z = i ? 0 : -1, le = p.useRef(Z), [P, Ie] = Sr({
266
+ controlled: Se,
267
+ default: C,
268
+ name: x
269
+ }), [M, Fe] = Sr({
270
+ controlled: V,
271
+ default: "",
272
+ name: x,
273
+ state: "inputValue"
274
+ }), [Ne, _e] = p.useState(!1), je = p.useCallback((l, a) => {
275
+ if (!(g ? P.length < a.length : a !== null) && !m)
276
+ return;
277
+ let f;
278
+ if (g)
279
+ f = "";
280
+ else if (a == null)
281
+ f = "";
282
+ else {
283
+ const j = ae(a);
284
+ f = typeof j == "string" ? j : "";
285
+ }
286
+ M !== f && (Fe(f), ne && ne(l, f, "reset"));
287
+ }, [ae, M, g, ne, Fe, m, P]), [ke, Ye] = Sr({
288
+ controlled: W,
289
+ default: !1,
290
+ name: x,
291
+ state: "open"
292
+ }), [nr, Me] = p.useState(!0), er = !g && P != null && M === ae(P), me = ke && !A, Y = me ? w(
293
+ se.filter((l) => !(h && (g ? P : [P]).some((a) => a !== null && Q(l, a)))),
294
+ // we use the empty string to manipulate `filterOptions` to not filter any options
295
+ // i.e. the filter predicate always returns true
296
+ {
297
+ inputValue: er && nr ? "" : M,
298
+ getOptionLabel: ae
299
+ }
300
+ ) : [], Te = ot({
301
+ filteredOptions: Y,
302
+ value: P,
303
+ inputValue: M
304
+ });
305
+ p.useEffect(() => {
306
+ const l = P !== Te.value;
307
+ Ne && !l || D && !l || je(null, P);
308
+ }, [P, je, Ne, Te.value, D]);
309
+ const Oe = ke && Y.length > 0 && !A, Je = xr((l) => {
310
+ l === -1 ? U.current.focus() : pe.querySelector(`[data-tag-index="${l}"]`).focus();
311
+ });
312
+ p.useEffect(() => {
313
+ g && de > P.length - 1 && (Ce(-1), Je(-1));
314
+ }, [P, g, de, Je]);
315
+ function ar(l, a) {
316
+ if (!K.current || l < 0 || l >= Y.length)
317
+ return -1;
318
+ let f = l;
319
+ for (; ; ) {
320
+ const j = K.current.querySelector(`[data-option-index="${f}"]`), E = z ? !1 : !j || j.disabled || j.getAttribute("aria-disabled") === "true";
321
+ if (j && j.hasAttribute("tabindex") && !E)
322
+ return f;
323
+ if (a === "next" ? f = (f + 1) % Y.length : f = (f - 1 + Y.length) % Y.length, f === l)
324
+ return -1;
325
+ }
326
+ }
327
+ const $ = xr(({
328
+ event: l,
329
+ index: a,
330
+ reason: f = "auto"
331
+ }) => {
332
+ if (le.current = a, a === -1 ? U.current.removeAttribute("aria-activedescendant") : U.current.setAttribute("aria-activedescendant", `${ie}-option-${a}`), G && G(l, a === -1 ? null : Y[a], f), !K.current)
333
+ return;
334
+ const j = K.current.querySelector(`[role="option"].${o}-focused`);
335
+ j && (j.classList.remove(`${o}-focused`), j.classList.remove(`${o}-focusVisible`));
336
+ let E = K.current;
337
+ if (K.current.getAttribute("role") !== "listbox" && (E = K.current.parentElement.querySelector('[role="listbox"]')), !E)
338
+ return;
339
+ if (a === -1) {
340
+ E.scrollTop = 0;
341
+ return;
342
+ }
343
+ const re = K.current.querySelector(`[data-option-index="${a}"]`);
344
+ if (re && (re.classList.add(`${o}-focused`), f === "keyboard" && re.classList.add(`${o}-focusVisible`), E.scrollHeight > E.clientHeight && f !== "mouse" && f !== "touch")) {
345
+ const ye = re, ir = E.clientHeight + E.scrollTop, br = ye.offsetTop + ye.offsetHeight;
346
+ br > ir ? E.scrollTop = br - E.clientHeight : ye.offsetTop - ye.offsetHeight * (B ? 1.3 : 0) < E.scrollTop && (E.scrollTop = ye.offsetTop - ye.offsetHeight * (B ? 1.3 : 0));
347
+ }
348
+ }), ee = xr(({
349
+ event: l,
350
+ diff: a,
351
+ direction: f = "next",
352
+ reason: j = "auto"
353
+ }) => {
354
+ if (!me)
355
+ return;
356
+ const E = ar((() => {
357
+ const re = Y.length - 1;
358
+ if (a === "reset")
359
+ return Z;
360
+ if (a === "start")
361
+ return 0;
362
+ if (a === "end")
363
+ return re;
364
+ const ye = le.current + a;
365
+ return ye < 0 ? ye === -1 && J ? -1 : S && le.current !== -1 || Math.abs(a) > 1 ? 0 : re : ye > re ? ye === re + 1 && J ? -1 : S || Math.abs(a) > 1 ? re : 0 : ye;
366
+ })(), f);
367
+ if ($({
368
+ index: E,
369
+ reason: j,
370
+ event: l
371
+ }), n && a !== "reset")
372
+ if (E === -1)
373
+ U.current.value = M;
374
+ else {
375
+ const re = ae(Y[E]);
376
+ U.current.value = re, re.toLowerCase().indexOf(M.toLowerCase()) === 0 && M.length > 0 && U.current.setSelectionRange(M.length, re.length);
377
+ }
378
+ }), He = () => {
379
+ const l = (a, f) => {
380
+ const j = a ? ae(a) : "", E = f ? ae(f) : "";
381
+ return j === E;
382
+ };
383
+ if (le.current !== -1 && Te.filteredOptions && Te.filteredOptions.length !== Y.length && Te.inputValue === M && (g ? P.length === Te.value.length && Te.value.every((a, f) => ae(P[f]) === ae(a)) : l(Te.value, P))) {
384
+ const a = Te.filteredOptions[le.current];
385
+ if (a)
386
+ return Cr(Y, (f) => ae(f) === ae(a));
387
+ }
388
+ return -1;
389
+ }, We = p.useCallback(() => {
390
+ if (!me)
391
+ return;
392
+ const l = He();
393
+ if (l !== -1) {
394
+ le.current = l;
395
+ return;
396
+ }
397
+ const a = g ? P[0] : P;
398
+ if (Y.length === 0 || a == null) {
399
+ ee({
400
+ diff: "reset"
401
+ });
402
+ return;
403
+ }
404
+ if (K.current) {
405
+ if (a != null) {
406
+ const f = Y[le.current];
407
+ if (g && f && Cr(P, (E) => Q(f, E)) !== -1)
408
+ return;
409
+ const j = Cr(Y, (E) => Q(E, a));
410
+ j === -1 ? ee({
411
+ diff: "reset"
412
+ }) : $({
413
+ index: j
414
+ });
415
+ return;
416
+ }
417
+ if (le.current >= Y.length - 1) {
418
+ $({
419
+ index: Y.length - 1
420
+ });
421
+ return;
422
+ }
423
+ $({
424
+ index: le.current
425
+ });
426
+ }
427
+ }, [
428
+ // Only sync the highlighted index when the option switch between empty and not
429
+ Y.length,
430
+ // Don't sync the highlighted index with the value when multiple
431
+ // eslint-disable-next-line react-hooks/exhaustive-deps
432
+ g ? !1 : P,
433
+ h,
434
+ ee,
435
+ $,
436
+ me,
437
+ M,
438
+ g
439
+ ]), Ee = xr((l) => {
440
+ Ho(K, l), l && We();
441
+ });
442
+ p.useEffect(() => {
443
+ We();
444
+ }, [We]);
445
+ const oe = (l) => {
446
+ ke || (Ye(!0), Me(!0), X && X(l));
447
+ }, fe = (l, a) => {
448
+ ke && (Ye(!1), _ && _(l, a));
449
+ }, ve = (l, a, f, j) => {
450
+ if (g) {
451
+ if (P.length === a.length && P.every((E, re) => E === a[re]))
452
+ return;
453
+ } else if (P === a)
454
+ return;
455
+ O && O(l, a, f, j), Ie(a);
456
+ }, we = p.useRef(!1), Ze = (l, a, f = "selectOption", j = "options") => {
457
+ let E = f, re = a;
458
+ if (g) {
459
+ re = Array.isArray(P) ? P.slice() : [];
460
+ const ye = Cr(re, (ir) => Q(a, ir));
461
+ ye === -1 ? re.push(a) : j !== "freeSolo" && (re.splice(ye, 1), E = "removeOption");
462
+ }
463
+ je(l, re), ve(l, re, E, {
464
+ option: a
465
+ }), !T && (!l || !l.ctrlKey && !l.metaKey) && fe(l, E), (u === !0 || u === "touch" && we.current || u === "mouse" && !we.current) && U.current.blur();
466
+ };
467
+ function wr(l, a) {
468
+ if (l === -1)
469
+ return -1;
470
+ let f = l;
471
+ for (; ; ) {
472
+ if (a === "next" && f === P.length || a === "previous" && f === -1)
473
+ return -1;
474
+ const j = pe.querySelector(`[data-tag-index="${f}"]`);
475
+ if (!j || !j.hasAttribute("tabindex") || j.disabled || j.getAttribute("aria-disabled") === "true")
476
+ f += a === "next" ? 1 : -1;
477
+ else
478
+ return f;
479
+ }
480
+ }
481
+ const mr = (l, a) => {
482
+ if (!g)
483
+ return;
484
+ M === "" && fe(l, "toggleInput");
485
+ let f = de;
486
+ de === -1 ? M === "" && a === "previous" && (f = P.length - 1) : (f += a === "next" ? 1 : -1, f < 0 && (f = 0), f === P.length && (f = -1)), f = wr(f, a), Ce(f), Je(f);
487
+ }, vr = (l) => {
488
+ ge.current = !0, Fe(""), ne && ne(l, "", "clear"), ve(l, g ? [] : null, "clear");
489
+ }, Pr = (l) => (a) => {
490
+ if (l.onKeyDown && l.onKeyDown(a), !a.defaultMuiPrevented && (de !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(a.key) === -1 && (Ce(-1), Je(-1)), a.which !== 229))
491
+ switch (a.key) {
492
+ case "Home":
493
+ me && k && (a.preventDefault(), ee({
494
+ diff: "start",
495
+ direction: "next",
496
+ reason: "keyboard",
497
+ event: a
498
+ }));
499
+ break;
500
+ case "End":
501
+ me && k && (a.preventDefault(), ee({
502
+ diff: "end",
503
+ direction: "previous",
504
+ reason: "keyboard",
505
+ event: a
506
+ }));
507
+ break;
508
+ case "PageUp":
509
+ a.preventDefault(), ee({
510
+ diff: -no,
511
+ direction: "previous",
512
+ reason: "keyboard",
513
+ event: a
514
+ }), oe(a);
515
+ break;
516
+ case "PageDown":
517
+ a.preventDefault(), ee({
518
+ diff: no,
519
+ direction: "next",
520
+ reason: "keyboard",
521
+ event: a
522
+ }), oe(a);
523
+ break;
524
+ case "ArrowDown":
525
+ a.preventDefault(), ee({
526
+ diff: 1,
527
+ direction: "next",
528
+ reason: "keyboard",
529
+ event: a
530
+ }), oe(a);
531
+ break;
532
+ case "ArrowUp":
533
+ a.preventDefault(), ee({
534
+ diff: -1,
535
+ direction: "previous",
536
+ reason: "keyboard",
537
+ event: a
538
+ }), oe(a);
539
+ break;
540
+ case "ArrowLeft":
541
+ mr(a, "previous");
542
+ break;
543
+ case "ArrowRight":
544
+ mr(a, "next");
545
+ break;
546
+ case "Enter":
547
+ if (le.current !== -1 && me) {
548
+ const f = Y[le.current], j = I ? I(f) : !1;
549
+ if (a.preventDefault(), j)
550
+ return;
551
+ Ze(a, f, "selectOption"), n && U.current.setSelectionRange(U.current.value.length, U.current.value.length);
552
+ } else D && M !== "" && er === !1 && (g && a.preventDefault(), Ze(a, M, "createOption", "freeSolo"));
553
+ break;
554
+ case "Escape":
555
+ me ? (a.preventDefault(), a.stopPropagation(), fe(a, "escape")) : y && (M !== "" || g && P.length > 0) && (a.preventDefault(), a.stopPropagation(), vr(a));
556
+ break;
557
+ case "Backspace":
558
+ if (g && !A && M === "" && P.length > 0) {
559
+ const f = de === -1 ? P.length - 1 : de, j = P.slice();
560
+ j.splice(f, 1), ve(a, j, "removeOption", {
561
+ option: P[f]
562
+ });
563
+ }
564
+ break;
565
+ case "Delete":
566
+ if (g && !A && M === "" && P.length > 0 && de !== -1) {
567
+ const f = de, j = P.slice();
568
+ j.splice(f, 1), ve(a, j, "removeOption", {
569
+ option: P[f]
570
+ });
571
+ }
572
+ break;
573
+ }
574
+ }, Tr = (l) => {
575
+ _e(!0), he && !ge.current && oe(l);
576
+ }, hr = (l) => {
577
+ if (r(K)) {
578
+ U.current.focus();
579
+ return;
580
+ }
581
+ _e(!1), xe.current = !0, ge.current = !1, c && le.current !== -1 && me ? Ze(l, Y[le.current], "blur") : c && D && M !== "" ? Ze(l, M, "blur", "freeSolo") : m && je(l, P), fe(l, "blur");
582
+ }, zr = (l) => {
583
+ const a = l.target.value;
584
+ M !== a && (Fe(a), Me(!1), ne && ne(l, a, "input")), a === "" ? !v && !g && ve(l, null, "clear") : oe(l);
585
+ }, Dr = (l) => {
586
+ const a = Number(l.currentTarget.getAttribute("data-option-index"));
587
+ le.current !== a && $({
588
+ event: l,
589
+ index: a,
590
+ reason: "mouse"
591
+ });
592
+ }, Lr = (l) => {
593
+ $({
594
+ event: l,
595
+ index: Number(l.currentTarget.getAttribute("data-option-index")),
596
+ reason: "touch"
597
+ }), we.current = !0;
598
+ }, $r = (l) => {
599
+ const a = Number(l.currentTarget.getAttribute("data-option-index"));
600
+ Ze(l, Y[a], "selectOption"), we.current = !1;
601
+ }, Fr = (l) => (a) => {
602
+ const f = P.slice();
603
+ f.splice(l, 1), ve(a, f, "removeOption", {
604
+ option: P[l]
605
+ });
606
+ }, gr = (l) => {
607
+ ke ? fe(l, "toggleInput") : oe(l);
608
+ }, Nr = (l) => {
609
+ l.currentTarget.contains(l.target) && l.target.getAttribute("id") !== ie && l.preventDefault();
610
+ }, Rr = (l) => {
611
+ l.currentTarget.contains(l.target) && (U.current.focus(), ce && xe.current && U.current.selectionEnd - U.current.selectionStart === 0 && U.current.select(), xe.current = !1);
612
+ }, jr = (l) => {
613
+ !b && (M === "" || !ke) && gr(l);
614
+ };
615
+ let lr = D && M.length > 0;
616
+ lr = lr || (g ? P.length > 0 : P !== null);
617
+ let fr = Y;
618
+ return B && (fr = Y.reduce((l, a, f) => {
619
+ const j = B(a);
620
+ return l.length > 0 && l[l.length - 1].group === j ? l[l.length - 1].options.push(a) : l.push({
621
+ key: f,
622
+ index: f,
623
+ group: j,
624
+ options: [a]
625
+ }), l;
626
+ }, [])), b && Ne && hr(), {
627
+ getRootProps: (l = {}) => s({
628
+ "aria-owns": Oe ? `${ie}-listbox` : null
629
+ }, l, {
630
+ onKeyDown: Pr(l),
631
+ onMouseDown: Nr,
632
+ onClick: Rr
633
+ }),
634
+ getInputLabelProps: () => ({
635
+ id: `${ie}-label`,
636
+ htmlFor: ie
637
+ }),
638
+ getInputProps: () => ({
639
+ id: ie,
640
+ value: M,
641
+ onBlur: hr,
642
+ onFocus: Tr,
643
+ onChange: zr,
644
+ onMouseDown: jr,
645
+ // if open then this is handled imperatively so don't let react override
646
+ // only have an opinion about this when closed
647
+ "aria-activedescendant": me ? "" : null,
648
+ "aria-autocomplete": n ? "both" : "list",
649
+ "aria-controls": Oe ? `${ie}-listbox` : void 0,
650
+ "aria-expanded": Oe,
651
+ // Disable browser's suggestion that might overlap with the popup.
652
+ // Handle autocomplete but not autofill.
653
+ autoComplete: "off",
654
+ ref: U,
655
+ autoCapitalize: "none",
656
+ spellCheck: "false",
657
+ role: "combobox",
658
+ disabled: b
659
+ }),
660
+ getClearProps: () => ({
661
+ tabIndex: -1,
662
+ type: "button",
663
+ onClick: vr
664
+ }),
665
+ getPopupIndicatorProps: () => ({
666
+ tabIndex: -1,
667
+ type: "button",
668
+ onClick: gr
669
+ }),
670
+ getTagProps: ({
671
+ index: l
672
+ }) => s({
673
+ key: l,
674
+ "data-tag-index": l,
675
+ tabIndex: -1
676
+ }, !A && {
677
+ onDelete: Fr(l)
678
+ }),
679
+ getListboxProps: () => ({
680
+ role: "listbox",
681
+ id: `${ie}-listbox`,
682
+ "aria-labelledby": `${ie}-label`,
683
+ ref: Ee,
684
+ onMouseDown: (l) => {
685
+ l.preventDefault();
686
+ }
687
+ }),
688
+ getOptionProps: ({
689
+ index: l,
690
+ option: a
691
+ }) => {
692
+ var f;
693
+ const j = (g ? P : [P]).some((re) => re != null && Q(a, re)), E = I ? I(a) : !1;
694
+ return {
695
+ key: (f = d == null ? void 0 : d(a)) != null ? f : ae(a),
696
+ tabIndex: -1,
697
+ role: "option",
698
+ id: `${ie}-option-${l}`,
699
+ onMouseMove: Dr,
700
+ onClick: $r,
701
+ onTouchStart: Lr,
702
+ "data-option-index": l,
703
+ "aria-disabled": E,
704
+ "aria-selected": j
705
+ };
706
+ },
707
+ id: ie,
708
+ inputValue: M,
709
+ value: P,
710
+ dirty: lr,
711
+ expanded: me && pe,
712
+ popupOpen: me,
713
+ focused: Ne || de !== -1,
714
+ anchorEl: pe,
715
+ setAnchorEl: R,
716
+ focusedTag: de,
717
+ groupedOptions: fr
718
+ };
719
+ }
720
+ const yo = /* @__PURE__ */ p.createContext(void 0), pt = ["component", "className", "children", "nested", "sticky", "variant", "color", "startAction", "endAction", "role", "slots", "slotProps"], mt = (e) => {
721
+ const {
722
+ sticky: r,
723
+ nested: o,
724
+ nesting: n,
725
+ variant: i,
726
+ color: c
727
+ } = e, u = {
728
+ root: ["root", o && "nested", n && "nesting", r && "sticky", c && `color${te(c)}`, i && `variant${te(i)}`],
729
+ startAction: ["startAction"],
730
+ endAction: ["endAction"]
731
+ };
732
+ return De(u, Yo, {});
733
+ }, vt = N("li")(({
734
+ theme: e,
735
+ ownerState: r
736
+ }) => {
737
+ var o;
738
+ return [
739
+ !r.nested && {
740
+ // add negative margin to ListItemButton equal to this ListItem padding
741
+ "--ListItemButton-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
742
+ "--ListItemButton-marginBlock": "calc(-1 * var(--ListItem-paddingY))",
743
+ alignItems: "center",
744
+ gap: "var(--ListItem-gap)",
745
+ marginInline: "var(--ListItem-marginInline)"
746
+ },
747
+ r.nested && {
748
+ // add negative margin to NestedList equal to this ListItem padding
749
+ "--NestedList-marginRight": "calc(-1 * var(--ListItem-paddingRight))",
750
+ "--NestedList-marginLeft": "calc(-1 * var(--ListItem-paddingLeft))",
751
+ "--NestedListItem-paddingLeft": "calc(var(--ListItem-paddingLeft) + var(--List-nestedInsetStart))",
752
+ // add negative margin to ListItem, ListItemButton to make them start from the edge.
753
+ "--ListItemButton-marginBlock": "0px",
754
+ "--ListItemButton-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
755
+ "--ListItem-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
756
+ flexDirection: "column"
757
+ },
758
+ // Base styles
759
+ s({
760
+ // Integration with control elements, for example Checkbox, Radio.
761
+ "--unstable_actionRadius": "calc(var(--ListItem-radius) - var(--variant-borderWidth, 0px))"
762
+ }, r.startAction && {
763
+ "--unstable_startActionWidth": "2rem"
764
+ // to add sufficient padding-left on ListItemButton
765
+ }, r.endAction && {
766
+ "--unstable_endActionWidth": "2.5rem"
767
+ // to add sufficient padding-right on ListItemButton
768
+ }, {
769
+ boxSizing: "border-box",
770
+ borderRadius: "var(--ListItem-radius)",
771
+ display: "var(--_ListItem-display)",
772
+ "&:not([hidden])": {
773
+ "--_ListItem-display": "var(--_List-markerDisplay, flex)"
774
+ },
775
+ flex: "none",
776
+ // prevent children from shrinking when the List's height is limited.
777
+ listStyleType: "var(--_List-markerType, disc)",
778
+ position: "relative",
779
+ paddingBlockStart: r.nested ? 0 : "var(--ListItem-paddingY)",
780
+ paddingBlockEnd: r.nested ? 0 : "var(--ListItem-paddingY)",
781
+ paddingInlineStart: "var(--ListItem-paddingLeft)",
782
+ paddingInlineEnd: "var(--ListItem-paddingRight)"
783
+ }, r["data-first-child"] === void 0 && s({}, r.row ? {
784
+ marginInlineStart: "var(--List-gap)"
785
+ } : {
786
+ marginBlockStart: "var(--List-gap)"
787
+ }), r.row && r.wrap && {
788
+ marginInlineStart: "var(--List-gap)",
789
+ marginBlockStart: "var(--List-gap)"
790
+ }, {
791
+ minBlockSize: "var(--ListItem-minHeight)"
792
+ }, r.sticky && {
793
+ // sticky in list item can be found in grouped options
794
+ position: "sticky",
795
+ top: "var(--ListItem-stickyTop, 0px)",
796
+ // integration with Menu and Select.
797
+ zIndex: 1,
798
+ background: `var(--ListItem-stickyBackground, ${e.vars.palette.background.body})`
799
+ }, {
800
+ [`.${Ar.nested} > &`]: {
801
+ "--_ListItem-display": "flex"
802
+ }
803
+ }),
804
+ (o = e.variants[r.variant]) == null ? void 0 : o[r.color]
805
+ ];
806
+ }), ht = N(vt, {
807
+ name: "JoyListItem",
808
+ slot: "Root",
809
+ overridesResolver: (e, r) => r.root
810
+ })({}), gt = N("div", {
811
+ name: "JoyListItem",
812
+ slot: "StartAction",
813
+ overridesResolver: (e, r) => r.startAction
814
+ })(({
815
+ ownerState: e
816
+ }) => ({
817
+ display: "inherit",
818
+ position: "absolute",
819
+ top: e.nested ? "calc(var(--ListItem-minHeight) / 2)" : "50%",
820
+ left: 0,
821
+ transform: "translate(var(--ListItem-startActionTranslateX), -50%)",
822
+ zIndex: 1
823
+ // to stay on top of ListItemButton (default `position: relative`).
824
+ })), ft = N("div", {
825
+ name: "JoyListItem",
826
+ slot: "StartAction",
827
+ overridesResolver: (e, r) => r.startAction
828
+ })(({
829
+ ownerState: e
830
+ }) => ({
831
+ display: "inherit",
832
+ position: "absolute",
833
+ top: e.nested ? "calc(var(--ListItem-minHeight) / 2)" : "50%",
834
+ right: 0,
835
+ transform: "translate(var(--ListItem-endActionTranslateX), -50%)"
836
+ })), kr = /* @__PURE__ */ p.forwardRef(function(e, r) {
837
+ const o = ze({
838
+ props: e,
839
+ name: "JoyListItem"
840
+ }), n = p.useContext(_o), i = p.useContext(Jo), c = p.useContext(Eo), u = p.useContext(Vo), m = p.useContext(Yr), {
841
+ component: y,
842
+ className: x,
843
+ children: C,
844
+ nested: v = !1,
845
+ sticky: T = !1,
846
+ variant: b = "plain",
847
+ color: z = "neutral",
848
+ startAction: S,
849
+ endAction: w,
850
+ role: h,
851
+ slots: D = {},
852
+ slotProps: I = {}
853
+ } = o, d = ue(o, pt), [q, B] = p.useState(""), [k, L] = (i == null ? void 0 : i.split(":")) || ["", ""], J = y || (k && !k.match(/^(ul|ol|menu)$/) ? "div" : void 0);
854
+ let V = n === "menu" ? "none" : void 0;
855
+ i && (V = {
856
+ menu: "none",
857
+ menubar: "none",
858
+ group: "presentation"
859
+ }[L]), h && (V = h);
860
+ const Q = s({}, o, {
861
+ sticky: T,
862
+ startAction: S,
863
+ endAction: w,
864
+ row: c,
865
+ wrap: u,
866
+ variant: b,
867
+ color: z,
868
+ nesting: m,
869
+ nested: v,
870
+ component: J,
871
+ role: V
872
+ }), g = mt(Q), O = s({}, d, {
873
+ component: J,
874
+ slots: D,
875
+ slotProps: I
876
+ }), [_, G] = H("root", {
877
+ additionalProps: {
878
+ role: V
879
+ },
880
+ ref: r,
881
+ className: Xe(g.root, x),
882
+ elementType: ht,
883
+ externalForwardedProps: O,
884
+ ownerState: Q
885
+ }), [ne, X] = H("startAction", {
886
+ className: g.startAction,
887
+ elementType: gt,
888
+ externalForwardedProps: O,
889
+ ownerState: Q
890
+ }), [W, he] = H("endAction", {
891
+ className: g.endAction,
892
+ elementType: ft,
893
+ externalForwardedProps: O,
894
+ ownerState: Q
895
+ });
896
+ return /* @__PURE__ */ t.jsx(yo.Provider, {
897
+ value: B,
898
+ children: /* @__PURE__ */ t.jsx(Yr.Provider, {
899
+ value: v ? q || !0 : !1,
900
+ children: /* @__PURE__ */ t.jsxs(_, s({}, G, {
901
+ children: [S && /* @__PURE__ */ t.jsx(ne, s({}, X, {
902
+ children: S
903
+ })), p.Children.map(C, (se, A) => /* @__PURE__ */ p.isValidElement(se) ? /* @__PURE__ */ p.cloneElement(se, s({}, A === 0 && {
904
+ "data-first-child": ""
905
+ }, bo(se, ["ListItem"]) && {
906
+ // The ListItem of ListItem should not be 'li'
907
+ component: se.props.component || "div"
908
+ })) : se), w && /* @__PURE__ */ t.jsx(W, s({}, he, {
909
+ children: w
910
+ }))]
911
+ }))
912
+ })
913
+ });
914
+ });
915
+ kr.muiName = "ListItem";
916
+ const bt = ur(/* @__PURE__ */ t.jsx("path", {
917
+ d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
918
+ }), "Close"), xt = ur(/* @__PURE__ */ t.jsx("path", {
919
+ d: "M7 10l5 5 5-5z"
920
+ }), "ArrowDropDown");
921
+ function yt(e) {
922
+ return $e("MuiChip", e);
923
+ }
924
+ const Mr = Pe("MuiChip", ["root", "clickable", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "disabled", "endDecorator", "focusVisible", "label", "labelSm", "labelMd", "labelLg", "sizeSm", "sizeMd", "sizeLg", "startDecorator", "variantPlain", "variantSolid", "variantSoft", "variantOutlined"]), Co = /* @__PURE__ */ p.createContext({
925
+ disabled: void 0,
926
+ variant: void 0,
927
+ color: void 0
928
+ }), Ct = ["children", "className", "color", "onClick", "disabled", "size", "variant", "startDecorator", "endDecorator", "component", "slots", "slotProps"], St = (e) => {
929
+ const {
930
+ disabled: r,
931
+ size: o,
932
+ color: n,
933
+ clickable: i,
934
+ variant: c,
935
+ focusVisible: u
936
+ } = e, m = {
937
+ root: ["root", r && "disabled", n && `color${te(n)}`, o && `size${te(o)}`, c && `variant${te(c)}`, i && "clickable"],
938
+ action: ["action", r && "disabled", u && "focusVisible"],
939
+ label: ["label", o && `label${te(o)}`],
940
+ startDecorator: ["startDecorator"],
941
+ endDecorator: ["endDecorator"]
942
+ };
943
+ return De(m, yt, {});
944
+ }, It = N("div", {
945
+ name: "JoyChip",
946
+ slot: "Root",
947
+ overridesResolver: (e, r) => r.root
948
+ })(({
949
+ theme: e,
950
+ ownerState: r
951
+ }) => {
952
+ var o, n, i;
953
+ const c = (o = e.variants[r.variant]) == null ? void 0 : o[r.color], {
954
+ borderRadius: u
955
+ } = qo({
956
+ theme: e,
957
+ ownerState: r
958
+ }, ["borderRadius"]);
959
+ return [s({
960
+ // for controlling chip delete margin offset
961
+ "--Chip-decoratorChildOffset": "min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))",
962
+ "--Chip-decoratorChildRadius": "max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))",
963
+ "--Chip-deleteRadius": "var(--Chip-decoratorChildRadius)",
964
+ "--Chip-deleteSize": "var(--Chip-decoratorChildHeight)",
965
+ "--Avatar-radius": "var(--Chip-decoratorChildRadius)",
966
+ "--Avatar-size": "var(--Chip-decoratorChildHeight)",
967
+ "--Icon-margin": "initial",
968
+ // reset the icon's margin.
969
+ "--Icon-color": "currentColor",
970
+ "--unstable_actionRadius": "var(--_Chip-radius)"
971
+ }, r.size === "sm" && {
972
+ "--Chip-paddingInline": "0.375rem",
973
+ "--Chip-decoratorChildHeight": "calc(var(--_Chip-minHeight) - 2 * var(--variant-borderWidth))",
974
+ "--Icon-fontSize": e.vars.fontSize.sm,
975
+ "--_Chip-minHeight": "var(--Chip-minHeight, 1.25rem)",
976
+ // 20px
977
+ gap: "3px"
978
+ }, r.size === "md" && {
979
+ "--Chip-paddingInline": "0.5rem",
980
+ "--Chip-decoratorChildHeight": "calc(var(--_Chip-minHeight) - 0.25rem - 2 * var(--variant-borderWidth))",
981
+ "--Icon-fontSize": e.vars.fontSize.md,
982
+ "--_Chip-minHeight": "var(--Chip-minHeight, 1.5rem)",
983
+ // 26px
984
+ gap: "0.25rem"
985
+ }, r.size === "lg" && {
986
+ "--Chip-paddingInline": "0.75rem",
987
+ "--Chip-decoratorChildHeight": "calc(var(--_Chip-minHeight) - 0.375rem - 2 * var(--variant-borderWidth))",
988
+ "--Icon-fontSize": e.vars.fontSize.lg,
989
+ "--_Chip-minHeight": "var(--Chip-minHeight, 1.75rem)",
990
+ // 28px
991
+ gap: "0.375rem"
992
+ }, {
993
+ "--_Chip-radius": "var(--Chip-radius, 1.5rem)",
994
+ "--_Chip-paddingBlock": "max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",
995
+ minHeight: "var(--_Chip-minHeight)",
996
+ maxWidth: "max-content",
997
+ // to prevent Chip from stretching to full width when used with flexbox
998
+ paddingInline: "var(--Chip-paddingInline)",
999
+ borderRadius: "var(--_Chip-radius)",
1000
+ position: "relative",
1001
+ display: "inline-flex",
1002
+ alignItems: "center",
1003
+ justifyContent: "center",
1004
+ whiteSpace: "nowrap",
1005
+ textDecoration: "none",
1006
+ verticalAlign: "middle",
1007
+ boxSizing: "border-box"
1008
+ }, e.typography[`body-${{
1009
+ sm: "xs",
1010
+ md: "sm",
1011
+ lg: "md"
1012
+ }[r.size]}`], {
1013
+ fontWeight: e.vars.fontWeight.md,
1014
+ [`&.${Mr.disabled}`]: {
1015
+ color: (n = e.variants[`${r.variant}Disabled`]) == null || (n = n[r.color]) == null ? void 0 : n.color
1016
+ }
1017
+ }), ...r.clickable ? [{
1018
+ "--variant-borderWidth": "0px",
1019
+ color: c == null ? void 0 : c.color
1020
+ }] : [s({
1021
+ backgroundColor: e.vars.palette.background.surface
1022
+ }, c, {
1023
+ [`&.${Mr.disabled}`]: (i = e.variants[`${r.variant}Disabled`]) == null ? void 0 : i[r.color]
1024
+ })], u !== void 0 && {
1025
+ "--_Chip-radius": u
1026
+ }];
1027
+ }), kt = N("span", {
1028
+ name: "JoyChip",
1029
+ slot: "Label",
1030
+ overridesResolver: (e, r) => r.label
1031
+ })(({
1032
+ ownerState: e
1033
+ }) => s({
1034
+ display: "inline-block",
1035
+ overflow: "hidden",
1036
+ textOverflow: "ellipsis",
1037
+ order: 1,
1038
+ minInlineSize: 0,
1039
+ flexGrow: 1
1040
+ }, e.clickable && {
1041
+ zIndex: 1,
1042
+ pointerEvents: "none"
1043
+ })), wt = N("button", {
1044
+ name: "JoyChip",
1045
+ slot: "Action",
1046
+ overridesResolver: (e, r) => r.action
1047
+ })(({
1048
+ theme: e,
1049
+ ownerState: r
1050
+ }) => {
1051
+ var o, n, i, c;
1052
+ return [{
1053
+ "--Icon-color": r.color !== "neutral" || r.variant === "solid" ? "currentColor" : e.vars.palette.text.icon,
1054
+ position: "absolute",
1055
+ zIndex: 0,
1056
+ top: 0,
1057
+ left: 0,
1058
+ bottom: 0,
1059
+ right: 0,
1060
+ width: "100%",
1061
+ // To fix Firefox issue (https://github.com/mui/material-ui/issues/36877)
1062
+ border: "none",
1063
+ cursor: "pointer",
1064
+ padding: "initial",
1065
+ margin: "initial",
1066
+ backgroundColor: "initial",
1067
+ textDecoration: "none",
1068
+ borderRadius: "inherit",
1069
+ [e.focus.selector]: e.focus.default
1070
+ }, s({
1071
+ backgroundColor: e.vars.palette.background.surface
1072
+ }, (o = e.variants[r.variant]) == null ? void 0 : o[r.color]), {
1073
+ "&:hover": {
1074
+ "@media (hover: hover)": (n = e.variants[`${r.variant}Hover`]) == null ? void 0 : n[r.color]
1075
+ }
1076
+ }, {
1077
+ "&:active": (i = e.variants[`${r.variant}Active`]) == null ? void 0 : i[r.color]
1078
+ }, {
1079
+ [`&.${Mr.disabled}`]: (c = e.variants[`${r.variant}Disabled`]) == null ? void 0 : c[r.color]
1080
+ }];
1081
+ }), Pt = N("span", {
1082
+ name: "JoyChip",
1083
+ slot: "StartDecorator",
1084
+ overridesResolver: (e, r) => r.startDecorator
1085
+ })({
1086
+ "--Avatar-marginInlineStart": "calc(var(--Chip-decoratorChildOffset) * -1)",
1087
+ "--IconButton-margin": "0 calc(-1 * var(--Chip-paddingInline) / 3) 0 calc(var(--Chip-decoratorChildOffset) * -1)",
1088
+ "--Icon-margin": "0 0 0 calc(var(--Chip-paddingInline) / -4)",
1089
+ display: "inherit",
1090
+ // set zIndex to 1 with order to stay on top of other controls, for example Checkbox, Radio
1091
+ order: 0,
1092
+ zIndex: 1,
1093
+ pointerEvents: "none"
1094
+ }), Tt = N("span", {
1095
+ name: "JoyChip",
1096
+ slot: "EndDecorator",
1097
+ overridesResolver: (e, r) => r.endDecorator
1098
+ })({
1099
+ "--IconButton-margin": "0 calc(var(--Chip-decoratorChildOffset) * -1) 0 calc(-1 * var(--Chip-paddingInline) / 3)",
1100
+ "--Icon-margin": "0 calc(var(--Chip-paddingInline) / -4) 0 0",
1101
+ display: "inherit",
1102
+ // set zIndex to 1 with order to stay on top of other controls, for example Checkbox, Radio
1103
+ order: 2,
1104
+ zIndex: 1,
1105
+ pointerEvents: "none"
1106
+ }), zt = /* @__PURE__ */ p.forwardRef(function(e, r) {
1107
+ const o = ze({
1108
+ props: e,
1109
+ name: "JoyChip"
1110
+ }), {
1111
+ children: n,
1112
+ className: i,
1113
+ color: c = "neutral",
1114
+ onClick: u,
1115
+ disabled: m = !1,
1116
+ size: y = "md",
1117
+ variant: x = "soft",
1118
+ startDecorator: C,
1119
+ endDecorator: v,
1120
+ component: T,
1121
+ slots: b = {},
1122
+ slotProps: z = {}
1123
+ } = o, S = ue(o, Ct), w = !!u || !!z.action, h = s({}, o, {
1124
+ disabled: m,
1125
+ size: y,
1126
+ color: c,
1127
+ variant: x,
1128
+ clickable: w,
1129
+ focusVisible: !1
1130
+ }), D = typeof z.action == "function" ? z.action(h) : z.action, I = p.useRef(null), {
1131
+ focusVisible: d,
1132
+ getRootProps: q
1133
+ } = fo(s({}, D, {
1134
+ disabled: m,
1135
+ rootRef: I
1136
+ }));
1137
+ h.focusVisible = d;
1138
+ const B = St(h), k = s({}, S, {
1139
+ component: T,
1140
+ slots: b,
1141
+ slotProps: z
1142
+ }), [L, J] = H("root", {
1143
+ ref: r,
1144
+ className: Xe(B.root, i),
1145
+ elementType: It,
1146
+ externalForwardedProps: k,
1147
+ ownerState: h
1148
+ }), [V, Q] = H("label", {
1149
+ className: B.label,
1150
+ elementType: kt,
1151
+ externalForwardedProps: k,
1152
+ ownerState: h
1153
+ }), g = dr(Q.id), [O, _] = H("action", {
1154
+ className: B.action,
1155
+ elementType: wt,
1156
+ externalForwardedProps: k,
1157
+ ownerState: h,
1158
+ getSlotProps: q,
1159
+ additionalProps: {
1160
+ "aria-labelledby": g,
1161
+ as: D == null ? void 0 : D.component,
1162
+ onClick: u
1163
+ }
1164
+ }), [G, ne] = H("startDecorator", {
1165
+ className: B.startDecorator,
1166
+ elementType: Pt,
1167
+ externalForwardedProps: k,
1168
+ ownerState: h
1169
+ }), [X, W] = H("endDecorator", {
1170
+ className: B.endDecorator,
1171
+ elementType: Tt,
1172
+ externalForwardedProps: k,
1173
+ ownerState: h
1174
+ }), he = p.useMemo(() => ({
1175
+ disabled: m
1176
+ }), [m]);
1177
+ return /* @__PURE__ */ t.jsx(Co.Provider, {
1178
+ value: he,
1179
+ children: /* @__PURE__ */ t.jsx(ho, {
1180
+ variant: x,
1181
+ color: c,
1182
+ children: /* @__PURE__ */ t.jsxs(L, s({}, J, {
1183
+ children: [w && /* @__PURE__ */ t.jsx(O, s({}, _)), /* @__PURE__ */ t.jsx(V, s({}, Q, {
1184
+ id: g,
1185
+ children: n
1186
+ })), C && /* @__PURE__ */ t.jsx(G, s({}, ne, {
1187
+ children: C
1188
+ })), v && /* @__PURE__ */ t.jsx(X, s({}, W, {
1189
+ children: v
1190
+ }))]
1191
+ }))
1192
+ })
1193
+ });
1194
+ }), Dt = ur(/* @__PURE__ */ t.jsx("path", {
1195
+ d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
1196
+ }), "Cancel");
1197
+ function Lt(e) {
1198
+ return $e("MuiChipDelete", e);
1199
+ }
1200
+ Pe("MuiChipDelete", ["root", "disabled", "focusVisible", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSolid", "variantSoft", "variantOutlined"]);
1201
+ var ao;
1202
+ const $t = ["children", "variant", "color", "disabled", "onKeyDown", "onDelete", "onClick", "component", "slots", "slotProps"], Ft = ["onDelete"], Nt = (e) => {
1203
+ const {
1204
+ focusVisible: r,
1205
+ variant: o,
1206
+ color: n,
1207
+ disabled: i
1208
+ } = e, c = {
1209
+ root: ["root", i && "disabled", r && "focusVisible", o && `variant${te(o)}`, n && `color${te(n)}`]
1210
+ };
1211
+ return De(c, Lt, {});
1212
+ }, Rt = N(Er, {
1213
+ name: "JoyChipDelete",
1214
+ slot: "Root",
1215
+ overridesResolver: (e, r) => r.root
1216
+ })(({
1217
+ theme: e
1218
+ }) => ({
1219
+ "--IconButton-size": "var(--Chip-deleteSize, 2rem)",
1220
+ "--Icon-fontSize": "calc(var(--IconButton-size, 2rem) / 1.3)",
1221
+ minWidth: "var(--IconButton-size, 2rem)",
1222
+ // use min-width instead of height to make the button resilient to its content
1223
+ minHeight: "var(--IconButton-size, 2rem)",
1224
+ // use min-height instead of height to make the button resilient to its content
1225
+ fontSize: e.vars.fontSize.sm,
1226
+ paddingInline: "2px",
1227
+ // add a gap, in case the content is long, for example multiple icons
1228
+ pointerEvents: "visible",
1229
+ // force the ChipDelete to be hoverable because the decorator can have pointerEvents 'none'
1230
+ borderRadius: "var(--Chip-deleteRadius, 50%)",
1231
+ zIndex: 1,
1232
+ // overflow above sibling button or anchor
1233
+ padding: 0
1234
+ // reset user agent stylesheet
1235
+ })), jt = /* @__PURE__ */ p.forwardRef(function(e, r) {
1236
+ const o = ze({
1237
+ props: e,
1238
+ name: "JoyChipDelete"
1239
+ }), {
1240
+ children: n,
1241
+ variant: i = "plain",
1242
+ color: c = "neutral",
1243
+ disabled: u,
1244
+ onKeyDown: m,
1245
+ onDelete: y,
1246
+ onClick: x,
1247
+ component: C,
1248
+ slots: v = {},
1249
+ slotProps: T = {}
1250
+ } = o, b = ue(o, $t), z = p.useContext(Co), {
1251
+ variant: S = i,
1252
+ color: w = c
1253
+ } = go(e.variant, e.color, !0), h = e.color || w, D = u ?? z.disabled, I = p.useRef(null), d = pr(I, r), {
1254
+ focusVisible: q,
1255
+ getRootProps: B
1256
+ } = fo(s({}, o, {
1257
+ disabled: D,
1258
+ rootRef: d
1259
+ })), k = s({}, o, {
1260
+ disabled: D,
1261
+ variant: S,
1262
+ color: h,
1263
+ focusVisible: q
1264
+ }), L = Nt(k), J = s({}, b, {
1265
+ component: C,
1266
+ slots: v,
1267
+ slotProps: T
1268
+ }), V = (G) => {
1269
+ !D && y && y(G), x && x(G);
1270
+ }, Q = (G) => {
1271
+ ["Backspace", "Enter", "Delete"].includes(G.key) && (G.preventDefault(), !D && y && y(G)), m && m(G);
1272
+ }, [g, O] = H("root", {
1273
+ ref: r,
1274
+ elementType: Rt,
1275
+ getSlotProps: B,
1276
+ externalForwardedProps: J,
1277
+ ownerState: k,
1278
+ additionalProps: {
1279
+ as: C,
1280
+ onKeyDown: Q,
1281
+ onClick: V
1282
+ },
1283
+ className: L.root
1284
+ }), _ = ue(O, Ft);
1285
+ return /* @__PURE__ */ t.jsx(g, s({}, _, {
1286
+ children: n ?? (ao || (ao = /* @__PURE__ */ t.jsx(Dt, {})))
1287
+ }));
1288
+ });
1289
+ function Ot(e) {
1290
+ return $e("MuiListSubheader", e);
1291
+ }
1292
+ Pe("MuiListSubheader", ["root", "sticky", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
1293
+ const Ht = ["component", "className", "children", "id", "sticky", "variant", "color", "slots", "slotProps"], Bt = (e) => {
1294
+ const {
1295
+ variant: r,
1296
+ color: o,
1297
+ sticky: n
1298
+ } = e, i = {
1299
+ root: ["root", n && "sticky", o && `color${te(o)}`, r && `variant${te(r)}`]
1300
+ };
1301
+ return De(i, Ot, {});
1302
+ }, At = N("div", {
1303
+ name: "JoyListSubheader",
1304
+ slot: "Root",
1305
+ overridesResolver: (e, r) => r.root
1306
+ })(({
1307
+ theme: e,
1308
+ ownerState: r
1309
+ }) => {
1310
+ var o, n;
1311
+ return s({
1312
+ boxSizing: "border-box",
1313
+ display: "flex",
1314
+ alignItems: "center",
1315
+ marginInline: "var(--ListItem-marginInline)",
1316
+ paddingBlock: "var(--ListItem-paddingY)",
1317
+ paddingInlineStart: "var(--ListItem-paddingLeft)",
1318
+ paddingInlineEnd: "var(--ListItem-paddingRight)",
1319
+ minBlockSize: "var(--ListItem-minHeight)"
1320
+ }, e.typography["body-xs"], {
1321
+ fontSize: "max(0.75em, 0.625rem)",
1322
+ textTransform: "uppercase",
1323
+ letterSpacing: "0.1em"
1324
+ }, r.sticky && {
1325
+ position: "sticky",
1326
+ top: "var(--ListItem-stickyTop, 0px)",
1327
+ // integration with Menu and Select.
1328
+ zIndex: 1,
1329
+ background: "var(--ListItem-stickyBackground)"
1330
+ }, {
1331
+ color: r.color ? `var(--_Link-color, rgba(${(o = e.vars.palette[r.color]) == null ? void 0 : o.mainChannel} / 1))` : e.vars.palette.text.tertiary
1332
+ }, r.instanceColor && {
1333
+ [`&:not([${et}])`]: {
1334
+ "--_Link-color": e.vars.palette.text.secondary
1335
+ }
1336
+ }, (n = e.variants[r.variant]) == null ? void 0 : n[r.color]);
1337
+ }), Mt = /* @__PURE__ */ p.forwardRef(function(e, r) {
1338
+ const o = ze({
1339
+ props: e,
1340
+ name: "JoyListSubheader"
1341
+ }), {
1342
+ component: n,
1343
+ className: i,
1344
+ children: c,
1345
+ id: u,
1346
+ sticky: m = !1,
1347
+ variant: y,
1348
+ color: x,
1349
+ slots: C = {},
1350
+ slotProps: v = {}
1351
+ } = o, T = ue(o, Ht), b = dr(u), z = p.useContext(yo);
1352
+ p.useEffect(() => {
1353
+ z && z(b || "");
1354
+ }, [z, b]);
1355
+ const S = s({
1356
+ instanceColor: e.color
1357
+ }, o, {
1358
+ id: b,
1359
+ sticky: m,
1360
+ variant: y,
1361
+ color: y ? x ?? "neutral" : x
1362
+ }), w = Bt(S), h = s({}, T, {
1363
+ component: n,
1364
+ slots: C,
1365
+ slotProps: v
1366
+ }), [D, I] = H("root", {
1367
+ ref: r,
1368
+ className: Xe(w.root, i),
1369
+ elementType: At,
1370
+ externalForwardedProps: h,
1371
+ ownerState: S,
1372
+ additionalProps: {
1373
+ as: n,
1374
+ id: b
1375
+ }
1376
+ });
1377
+ return /* @__PURE__ */ t.jsx(D, s({}, I, {
1378
+ children: c
1379
+ }));
1380
+ });
1381
+ function Wt(e) {
1382
+ return $e("MuiAutocomplete", e);
1383
+ }
1384
+ const Qe = Pe("MuiAutocomplete", ["root", "wrapper", "input", "startDecorator", "endDecorator", "formControl", "focused", "disabled", "error", "multiple", "limitTag", "hasPopupIcon", "hasClearIcon", "clearIndicator", "popupIndicator", "popupIndicatorOpen", "listbox", "option", "loading", "noOptions", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
1385
+ Pe("MuiAutocompleteListbox", ["root", "sizeSm", "sizeMd", "sizeLg", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
1386
+ const So = N(Go)(({
1387
+ theme: e,
1388
+ ownerState: r
1389
+ }) => {
1390
+ var o;
1391
+ const n = (o = e.variants[r.variant]) == null ? void 0 : o[r.color];
1392
+ return s({
1393
+ "--focus-outline-offset": `calc(${e.vars.focus.thickness} * -1)`,
1394
+ // to prevent the focus outline from being cut by overflow
1395
+ "--ListItem-stickyBackground": (n == null ? void 0 : n.backgroundColor) || (n == null ? void 0 : n.background) || e.vars.palette.background.popup,
1396
+ "--ListItem-stickyTop": "calc(var(--List-padding, var(--ListDivider-gap)) * -1)"
1397
+ }, Uo, {
1398
+ boxShadow: e.shadow.md,
1399
+ borderRadius: `var(--List-radius, ${e.vars.radius.sm})`
1400
+ }, !(n != null && n.backgroundColor) && {
1401
+ backgroundColor: e.vars.palette.background.popup
1402
+ }, {
1403
+ zIndex: e.vars.zIndex.popup,
1404
+ overflow: "auto",
1405
+ maxHeight: "40vh",
1406
+ position: "relative",
1407
+ // to make sure that the listbox is positioned for grouped options to work.
1408
+ "&:empty": {
1409
+ visibility: "hidden"
1410
+ },
1411
+ [`& .${Ar.nested}, & .${Ar.nested} .${Ko.root}`]: {
1412
+ // For grouped options autocomplete:
1413
+ // Force the position to make the scroll into view logic works because the `element.offsetTop` should reference to the listbox, not the grouped list.
1414
+ // See the implementation of the `useAutocomplete` line:370
1415
+ //
1416
+ // Resource: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop
1417
+ position: "initial"
1418
+ }
1419
+ });
1420
+ });
1421
+ N(So, {
1422
+ name: "JoyAutocompleteListbox",
1423
+ slot: "Root",
1424
+ overridesResolver: (e, r) => r.root
1425
+ })({});
1426
+ function _t(e) {
1427
+ return $e("MuiAutocompleteOption", e);
1428
+ }
1429
+ Pe("MuiAutocompleteOption", ["root", "focused", "focusVisible", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
1430
+ const Jt = ["children", "component", "color", "variant", "className", "slots", "slotProps"], Et = (e) => {
1431
+ const {
1432
+ color: r,
1433
+ variant: o
1434
+ } = e, n = {
1435
+ root: ["root", r && `color${te(r)}`, o && `variant${te(o)}`]
1436
+ };
1437
+ return De(n, _t, {});
1438
+ }, Io = N(Qo)(({
1439
+ theme: e,
1440
+ ownerState: r
1441
+ }) => {
1442
+ var o, n;
1443
+ return {
1444
+ '&[aria-disabled="true"]': (o = e.variants[`${r.variant}Disabled`]) == null ? void 0 : o[r.color],
1445
+ '&[aria-selected="true"]': s({}, (n = e.variants[`${r.variant}Active`]) == null ? void 0 : n[r.color], {
1446
+ fontWeight: e.vars.fontWeight.md
1447
+ })
1448
+ };
1449
+ }), Vt = N(Io, {
1450
+ name: "JoyAutocompleteOption",
1451
+ slot: "Root",
1452
+ overridesResolver: (e, r) => r.root
1453
+ })({}), qt = /* @__PURE__ */ p.forwardRef(function(e, r) {
1454
+ const o = ze({
1455
+ props: e,
1456
+ name: "JoyAutocompleteOption"
1457
+ }), {
1458
+ children: n,
1459
+ component: i = "li",
1460
+ color: c = "neutral",
1461
+ variant: u = "plain",
1462
+ className: m,
1463
+ slots: y = {},
1464
+ slotProps: x = {}
1465
+ } = o, C = ue(o, Jt), {
1466
+ variant: v = u,
1467
+ color: T = c
1468
+ } = go(e.variant, e.color), b = s({}, o, {
1469
+ component: i,
1470
+ color: T,
1471
+ variant: v
1472
+ }), z = Et(b), S = s({}, C, {
1473
+ component: i,
1474
+ slots: y,
1475
+ slotProps: x
1476
+ }), [w, h] = H("root", {
1477
+ ref: r,
1478
+ className: Xe(z.root, m),
1479
+ elementType: Vt,
1480
+ externalForwardedProps: S,
1481
+ ownerState: b,
1482
+ additionalProps: {
1483
+ as: i,
1484
+ role: "option"
1485
+ }
1486
+ });
1487
+ return /* @__PURE__ */ t.jsx(w, s({}, h, {
1488
+ children: n
1489
+ }));
1490
+ });
1491
+ var lo, io;
1492
+ const Gt = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete", "autoHighlight", "autoSelect", "autoFocus", "blurOnSelect", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "defaultValue", "disableCloseOnSelect", "disabledItemsFocusable", "disableListWrap", "disableClearable", "disabled", "endDecorator", "error", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "getLimitTagsText", "getOptionDisabled", "getOptionKey", "getOptionLabel", "handleHomeEndKeys", "includeInputInList", "isOptionEqualToValue", "groupBy", "id", "inputValue", "limitTags", "loading", "loadingText", "multiple", "name", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "placeholder", "popupIcon", "readOnly", "renderGroup", "renderOption", "renderTags", "required", "type", "startDecorator", "size", "color", "variant", "value", "component", "selectOnFocus", "slots", "slotProps"], Ut = ["onDelete"], Kt = ["key"], Qt = ["onBlur", "onFocus", "onMouseDown"], Xt = ["key"], Zt = (e) => e.current !== null && e.current.contains(document.activeElement), Yt = (e) => {
1493
+ var r;
1494
+ return (r = e.label) != null ? r : e;
1495
+ }, en = (e) => `+${e}`, rn = (e) => /* @__PURE__ */ t.jsxs(kr, {
1496
+ nested: !0,
1497
+ children: [/* @__PURE__ */ t.jsx(Mt, {
1498
+ sticky: !0,
1499
+ children: e.group
1500
+ }), /* @__PURE__ */ t.jsx(Oo, {
1501
+ children: e.children
1502
+ })]
1503
+ }, e.key), on = (e) => {
1504
+ const {
1505
+ disabled: r,
1506
+ focused: o,
1507
+ hasClearIcon: n,
1508
+ hasPopupIcon: i,
1509
+ popupOpen: c,
1510
+ variant: u,
1511
+ color: m,
1512
+ size: y,
1513
+ multiple: x
1514
+ } = e, C = {
1515
+ root: ["root", o && "focused", n && "hasClearIcon", i && "hasPopupIcon", u && `variant${te(u)}`, m && `color${te(m)}`, y && `size${te(y)}`],
1516
+ wrapper: ["wrapper", x && "multiple"],
1517
+ input: ["input"],
1518
+ startDecorator: ["startDecorator"],
1519
+ endDecorator: ["endDecorator"],
1520
+ clearIndicator: ["clearIndicator"],
1521
+ popupIndicator: ["popupIndicator", c && "popupIndicatorOpen", r && "disabled"],
1522
+ listbox: ["listbox"],
1523
+ option: ["option"],
1524
+ loading: ["loading"],
1525
+ noOptions: ["noOptions"],
1526
+ limitTag: ["limitTag"]
1527
+ };
1528
+ return De(C, Wt, {});
1529
+ }, tn = N(Bo, {
1530
+ name: "JoyAutocomplete",
1531
+ slot: "Root",
1532
+ overridesResolver: (e, r) => r.root
1533
+ })(({
1534
+ ownerState: e
1535
+ }) => s({}, e.size === "sm" && {
1536
+ "--Autocomplete-wrapperGap": "3px"
1537
+ }, e.size === "md" && {
1538
+ "--Autocomplete-wrapperGap": "3px"
1539
+ }, e.size === "lg" && {
1540
+ "--Autocomplete-wrapperGap": "4px"
1541
+ }, {
1542
+ /* Avoid double tap issue on iOS */
1543
+ "@media (pointer: fine)": {
1544
+ [`&:hover .${Qe.clearIndicator}`]: {
1545
+ visibility: "visible"
1546
+ }
1547
+ }
1548
+ }, e.multiple && !e.startDecorator && {
1549
+ paddingInlineStart: 0
1550
+ })), nn = N("div", {
1551
+ name: "JoyAutocomplete",
1552
+ slot: "Wrapper",
1553
+ overridesResolver: (e, r) => r.wrapper
1554
+ })(({
1555
+ ownerState: e
1556
+ }) => ({
1557
+ flex: 1,
1558
+ // stretch to fill the root slot
1559
+ minWidth: 0,
1560
+ // won't push end decorator out of the autocomplete
1561
+ display: "flex",
1562
+ alignItems: "center",
1563
+ flexWrap: "wrap",
1564
+ gap: "var(--Autocomplete-wrapperGap)",
1565
+ [`&.${Qe.multiple}`]: s({
1566
+ paddingBlock: "var(--Autocomplete-wrapperGap)"
1567
+ }, !e.startDecorator && {
1568
+ paddingInlineStart: "var(--Autocomplete-wrapperGap)"
1569
+ }, !e.endDecorator && {
1570
+ paddingInlineEnd: "var(--Autocomplete-wrapperGap)"
1571
+ })
1572
+ })), an = N(Ao, {
1573
+ name: "JoyAutocomplete",
1574
+ slot: "Input",
1575
+ overridesResolver: (e, r) => r.input
1576
+ })(({
1577
+ ownerState: e
1578
+ }) => s({
1579
+ minWidth: 30,
1580
+ minHeight: "var(--Chip-minHeight)"
1581
+ }, e.multiple && {
1582
+ marginInlineStart: "calc(var(--Autocomplete-wrapperGap) * 2.5)"
1583
+ })), ln = N(Mo, {
1584
+ name: "JoyAutocomplete",
1585
+ slot: "StartDecorator",
1586
+ overridesResolver: (e, r) => r.startDecorator
1587
+ })({}), sn = N(Wo, {
1588
+ name: "JoyAutocomplete",
1589
+ slot: "EndDecorator",
1590
+ overridesResolver: (e, r) => r.endDecorator
1591
+ })(({
1592
+ ownerState: e
1593
+ }) => s({}, (e.hasClearIcon || e.hasPopupIcon) && {
1594
+ "--Button-margin": "0px",
1595
+ "--IconButton-margin": "0px",
1596
+ "--Icon-margin": "0px"
1597
+ })), cn = N(Er, {
1598
+ name: "JoyAutocomplete",
1599
+ slot: "ClearIndicator",
1600
+ overridesResolver: (e, r) => r.clearIndicator
1601
+ })(({
1602
+ ownerState: e
1603
+ }) => s({
1604
+ alignSelf: "center"
1605
+ }, !e.hasPopupIcon && {
1606
+ marginInlineEnd: "calc(var(--Input-decoratorChildOffset) * -1)"
1607
+ }, {
1608
+ marginInlineStart: "calc(var(--_Input-paddingBlock) / 2)",
1609
+ visibility: e.focused ? "visible" : "hidden"
1610
+ })), dn = N(Er, {
1611
+ name: "JoyAutocomplete",
1612
+ slot: "PopupIndicator",
1613
+ overridesResolver: (e, r) => r.popupIndicator
1614
+ })({
1615
+ alignSelf: "center",
1616
+ marginInlineStart: "calc(var(--_Input-paddingBlock) / 2)",
1617
+ marginInlineEnd: "calc(var(--Input-decoratorChildOffset) * -1)",
1618
+ [`&.${Qe.popupIndicatorOpen}`]: {
1619
+ transform: "rotate(180deg)",
1620
+ "--Icon-color": "currentColor"
1621
+ }
1622
+ }), un = N(So, {
1623
+ name: "JoyAutocomplete",
1624
+ slot: "Listbox",
1625
+ overridesResolver: (e, r) => r.listbox
1626
+ })(({
1627
+ theme: e
1628
+ }) => ({
1629
+ // `unstable_popup-zIndex` is a private variable that lets other component, for example Modal, to override the z-index so that the listbox can be displayed above the Modal.
1630
+ zIndex: `var(--unstable_popup-zIndex, ${e.vars.zIndex.popup})`
1631
+ })), pn = N(Io, {
1632
+ name: "JoyAutocomplete",
1633
+ slot: "Option",
1634
+ overridesResolver: (e, r) => r.option
1635
+ })({}), mn = N(kr, {
1636
+ name: "JoyAutocomplete",
1637
+ slot: "Loading",
1638
+ overridesResolver: (e, r) => r.loading
1639
+ })(({
1640
+ theme: e
1641
+ }) => ({
1642
+ color: (e.vars || e).palette.text.secondary
1643
+ })), vn = N(kr, {
1644
+ name: "JoyAutocomplete",
1645
+ slot: "NoOptions",
1646
+ overridesResolver: (e, r) => r.noOptions
1647
+ })(({
1648
+ theme: e
1649
+ }) => ({
1650
+ color: (e.vars || e).palette.text.secondary
1651
+ })), hn = N("div", {
1652
+ name: "JoyAutocomplete",
1653
+ slot: "NoOptions",
1654
+ overridesResolver: (e, r) => r.noOptions
1655
+ })({
1656
+ marginInlineStart: "calc(var(--Input-paddingInline) / 2)",
1657
+ marginBlockStart: "var(--_Input-paddingBlock)"
1658
+ }), gn = /* @__PURE__ */ p.forwardRef(function(e, r) {
1659
+ var o, n, i, c, u, m, y;
1660
+ const x = ze({
1661
+ props: e,
1662
+ name: "JoyAutocomplete"
1663
+ }), {
1664
+ "aria-describedby": C,
1665
+ "aria-label": v,
1666
+ "aria-labelledby": T,
1667
+ autoFocus: b,
1668
+ clearIcon: z = lo || (lo = /* @__PURE__ */ t.jsx(bt, {
1669
+ fontSize: "md"
1670
+ })),
1671
+ clearText: S = "Clear",
1672
+ closeText: w = "Close",
1673
+ disableClearable: h = !1,
1674
+ disabled: D,
1675
+ endDecorator: I,
1676
+ error: d = !1,
1677
+ forcePopupIcon: q = "auto",
1678
+ freeSolo: B = !1,
1679
+ getLimitTagsText: k = en,
1680
+ getOptionLabel: L = Yt,
1681
+ groupBy: J,
1682
+ id: V,
1683
+ limitTags: Q = -1,
1684
+ loading: g = !1,
1685
+ loadingText: O = "Loading…",
1686
+ multiple: _ = !1,
1687
+ name: G,
1688
+ noOptionsText: ne = "No options",
1689
+ openText: X = "Open",
1690
+ placeholder: W,
1691
+ popupIcon: he = io || (io = /* @__PURE__ */ t.jsx(xt, {})),
1692
+ readOnly: se = !1,
1693
+ renderGroup: A = rn,
1694
+ renderOption: ce,
1695
+ renderTags: Se,
1696
+ required: ie,
1697
+ type: ae,
1698
+ startDecorator: ge,
1699
+ size: xe = "md",
1700
+ color: U = "neutral",
1701
+ variant: K = "outlined",
1702
+ component: pe,
1703
+ slots: R = {},
1704
+ slotProps: de = {}
1705
+ } = x, Ce = ue(x, Gt), Z = p.useContext(Ir), le = (o = (n = e.error) != null ? n : Z == null ? void 0 : Z.error) != null ? o : d, P = (i = (c = e.size) != null ? c : Z == null ? void 0 : Z.size) != null ? i : xe, Ie = (u = e.color) != null ? u : le ? "danger" : (m = Z == null ? void 0 : Z.color) != null ? m : U, M = (y = D ?? (Z == null ? void 0 : Z.disabled)) != null ? y : !1, {
1706
+ getRootProps: Fe,
1707
+ getInputProps: Ne,
1708
+ getPopupIndicatorProps: _e,
1709
+ getClearProps: je,
1710
+ getTagProps: ke,
1711
+ getListboxProps: Ye,
1712
+ getOptionProps: nr,
1713
+ value: Me,
1714
+ dirty: er,
1715
+ popupOpen: me,
1716
+ focused: Y,
1717
+ focusedTag: Te,
1718
+ anchorEl: Oe,
1719
+ setAnchorEl: Je,
1720
+ inputValue: ar,
1721
+ groupedOptions: $
1722
+ } = ut(s({}, x, {
1723
+ id: V ?? (Z == null ? void 0 : Z.htmlFor),
1724
+ componentName: "Autocomplete",
1725
+ unstable_classNamePrefix: "Mui",
1726
+ unstable_isActiveElementInListbox: Zt
1727
+ })), {
1728
+ onMouseDown: ee
1729
+ } = Ne(), {
1730
+ onClick: He
1731
+ } = Fe(), We = !h && !M && er && !se, Ee = (!B || q === !0) && q !== !1, oe = s({
1732
+ instanceColor: e.color
1733
+ }, x, {
1734
+ value: Me,
1735
+ disabled: M,
1736
+ focused: Y,
1737
+ getOptionLabel: L,
1738
+ hasOptions: !!$.length,
1739
+ hasClearIcon: We,
1740
+ hasPopupIcon: Ee,
1741
+ inputFocused: Te === -1,
1742
+ popupOpen: me,
1743
+ size: P,
1744
+ color: Ie,
1745
+ variant: K
1746
+ }), fe = on(oe), ve = s({}, Ce, {
1747
+ component: pe,
1748
+ slots: R,
1749
+ slotProps: de
1750
+ });
1751
+ let we;
1752
+ if (_ && Me.length > 0) {
1753
+ const F = (Le) => {
1754
+ const be = ke(Le), {
1755
+ onDelete: Re
1756
+ } = be, Ve = ue(be, Ut);
1757
+ return s({
1758
+ disabled: M,
1759
+ size: P,
1760
+ onClick: Re
1761
+ }, Ve);
1762
+ };
1763
+ Se ? we = Se(Me, F, oe) : we = Me.map((Le, be) => {
1764
+ const Re = F({
1765
+ index: be
1766
+ }), {
1767
+ key: Ve
1768
+ } = Re, Or = ue(Re, Kt);
1769
+ return /* @__PURE__ */ t.jsx(zt, {
1770
+ size: P,
1771
+ variant: "soft",
1772
+ color: "neutral",
1773
+ endDecorator: /* @__PURE__ */ t.jsx(jt, s({}, Or), Ve),
1774
+ sx: {
1775
+ minWidth: 0
1776
+ },
1777
+ children: L(Le)
1778
+ }, be);
1779
+ });
1780
+ }
1781
+ const Ze = pr(r, Je), wr = {
1782
+ [Qe.disabled]: M,
1783
+ [Qe.error]: le,
1784
+ [Qe.focused]: Y,
1785
+ [Qe.formControl]: !!Z
1786
+ }, [mr, vr] = H("root", {
1787
+ ref: Ze,
1788
+ className: [fe.root, wr],
1789
+ elementType: tn,
1790
+ externalForwardedProps: ve,
1791
+ ownerState: oe,
1792
+ getSlotProps: Fe,
1793
+ additionalProps: {
1794
+ onClick: (F) => {
1795
+ He && He(F), F.currentTarget === F.target && ee && ee(F);
1796
+ }
1797
+ }
1798
+ }), [Pr, Tr] = H("wrapper", {
1799
+ className: fe.wrapper,
1800
+ elementType: nn,
1801
+ externalForwardedProps: ve,
1802
+ ownerState: oe
1803
+ }), hr = {
1804
+ [Qe.disabled]: M
1805
+ }, [zr, Dr] = H("input", {
1806
+ className: [fe.input, hr],
1807
+ elementType: an,
1808
+ getSlotProps: (F) => {
1809
+ const Le = Ne(), {
1810
+ onBlur: be,
1811
+ onFocus: Re,
1812
+ onMouseDown: Ve
1813
+ } = Le, Or = ue(Le, Qt);
1814
+ return s({}, Or, {
1815
+ onBlur: (qe) => {
1816
+ var Ge;
1817
+ be == null || be(qe), (Ge = F.onBlur) == null || Ge.call(F, qe);
1818
+ },
1819
+ onFocus: (qe) => {
1820
+ var Ge;
1821
+ Re == null || Re(qe), (Ge = F.onFocus) == null || Ge.call(F, qe);
1822
+ },
1823
+ onMouseDown: (qe) => {
1824
+ var Ge;
1825
+ Ve == null || Ve(qe), (Ge = F.onMouseDown) == null || Ge.call(F, qe);
1826
+ }
1827
+ });
1828
+ },
1829
+ externalForwardedProps: ve,
1830
+ ownerState: oe,
1831
+ additionalProps: {
1832
+ autoFocus: b,
1833
+ placeholder: W,
1834
+ name: G,
1835
+ readOnly: se,
1836
+ disabled: M,
1837
+ required: ie ?? (Z == null ? void 0 : Z.required),
1838
+ type: ae,
1839
+ "aria-invalid": le || void 0,
1840
+ "aria-label": v,
1841
+ "aria-labelledby": T,
1842
+ "aria-describedby": C ?? (Z == null ? void 0 : Z["aria-describedby"])
1843
+ }
1844
+ }), [Lr, $r] = H("startDecorator", {
1845
+ className: fe.startDecorator,
1846
+ elementType: ln,
1847
+ externalForwardedProps: ve,
1848
+ ownerState: oe
1849
+ }), [Fr, gr] = H("endDecorator", {
1850
+ className: fe.endDecorator,
1851
+ elementType: sn,
1852
+ externalForwardedProps: ve,
1853
+ ownerState: oe
1854
+ }), [Nr, Rr] = H("clearIndicator", {
1855
+ className: fe.clearIndicator,
1856
+ elementType: cn,
1857
+ getSlotProps: je,
1858
+ externalForwardedProps: ve,
1859
+ ownerState: oe,
1860
+ getSlotOwnerState: (F) => ({
1861
+ size: F.size || P,
1862
+ variant: F.variant || or(K, Ie).variant || "plain",
1863
+ color: F.color || or(K, Ie).color || "neutral",
1864
+ disableColorInversion: !!e.color
1865
+ }),
1866
+ additionalProps: {
1867
+ "aria-label": S,
1868
+ title: S
1869
+ }
1870
+ }), [jr, lr] = H("popupIndicator", {
1871
+ className: fe.popupIndicator,
1872
+ elementType: dn,
1873
+ getSlotProps: _e,
1874
+ externalForwardedProps: ve,
1875
+ ownerState: oe,
1876
+ getSlotOwnerState: (F) => ({
1877
+ size: F.size || P,
1878
+ variant: F.variant || or(K, Ie).variant || "plain",
1879
+ color: F.color || or(K, Ie).color || "neutral",
1880
+ disableColorInversion: !!e.color
1881
+ }),
1882
+ additionalProps: {
1883
+ disabled: M,
1884
+ "aria-label": me ? w : X,
1885
+ title: me ? w : X,
1886
+ type: "button"
1887
+ }
1888
+ }), [fr, l] = H("listbox", {
1889
+ className: fe.listbox,
1890
+ elementType: un,
1891
+ getSlotProps: Ye,
1892
+ externalForwardedProps: ve,
1893
+ ownerState: oe,
1894
+ getSlotOwnerState: (F) => ({
1895
+ size: F.size || P,
1896
+ variant: F.variant || K,
1897
+ color: F.color || Ie,
1898
+ disableColorInversion: !F.disablePortal
1899
+ }),
1900
+ additionalProps: {
1901
+ anchorEl: Oe,
1902
+ open: me,
1903
+ style: Oe ? {
1904
+ width: Oe.clientWidth
1905
+ } : {}
1906
+ }
1907
+ }), [a, f] = H("loading", {
1908
+ className: fe.loading,
1909
+ elementType: mn,
1910
+ externalForwardedProps: ve,
1911
+ ownerState: oe
1912
+ }), [j, E] = H("noOptions", {
1913
+ className: fe.noOptions,
1914
+ elementType: vn,
1915
+ externalForwardedProps: ve,
1916
+ ownerState: oe,
1917
+ additionalProps: {
1918
+ role: "presentation",
1919
+ onMouseDown: (F) => {
1920
+ F.preventDefault();
1921
+ }
1922
+ }
1923
+ }), [re, ye] = H("limitTag", {
1924
+ className: fe.limitTag,
1925
+ elementType: hn,
1926
+ externalForwardedProps: ve,
1927
+ ownerState: oe
1928
+ });
1929
+ if (Q > -1 && Array.isArray(we)) {
1930
+ const F = we.length - Q;
1931
+ !Y && F > 0 && (we = we.splice(0, Q), we.push(/* @__PURE__ */ t.jsx(re, s({}, ye, {
1932
+ children: k(F)
1933
+ }), we.length)));
1934
+ }
1935
+ const [ir, br] = H("option", {
1936
+ className: fe.option,
1937
+ elementType: pn,
1938
+ externalForwardedProps: ve,
1939
+ ownerState: oe,
1940
+ getSlotOwnerState: (F) => ({
1941
+ variant: F.variant || or(K, Ie).variant || "plain",
1942
+ color: F.color || or(K, Ie).color || "neutral",
1943
+ disableColorInversion: !l.disablePortal
1944
+ }),
1945
+ additionalProps: {
1946
+ as: "li"
1947
+ }
1948
+ }), Po = ce || ((F, Le) => {
1949
+ const {
1950
+ key: be
1951
+ } = F, Re = ue(F, Xt);
1952
+ return /* @__PURE__ */ t.jsx(ir, s({}, Re, {
1953
+ children: L(Le)
1954
+ }), be);
1955
+ }), Vr = (F, Le) => {
1956
+ const be = nr({
1957
+ option: F,
1958
+ index: Le
1959
+ });
1960
+ return Po(s({}, br, be), F, {
1961
+ // `aria-selected` prop will always by boolean, see useAutocomplete hook.
1962
+ selected: !!be["aria-selected"],
1963
+ inputValue: ar,
1964
+ ownerState: oe
1965
+ });
1966
+ }, To = p.useMemo(() => [{
1967
+ name: "offset",
1968
+ options: {
1969
+ offset: [0, 4]
1970
+ }
1971
+ }, ...l.modifiers || []], [l.modifiers]);
1972
+ let qr = null;
1973
+ if (Oe) {
1974
+ var Gr;
1975
+ qr = /* @__PURE__ */ t.jsx(ho, {
1976
+ variant: K,
1977
+ color: Ie,
1978
+ children: /* @__PURE__ */ t.jsx($o, {
1979
+ nested: !0,
1980
+ children: /* @__PURE__ */ t.jsxs(fr, s({}, l, {
1981
+ className: Xe(l.className),
1982
+ modifiers: To
1983
+ }, !((Gr = x.slots) != null && Gr.listbox) && {
1984
+ as: Fo,
1985
+ slots: {
1986
+ root: l.as || "ul"
1987
+ }
1988
+ }, {
1989
+ children: [$.map((F, Le) => {
1990
+ if (J) {
1991
+ const be = F;
1992
+ return A({
1993
+ key: String(be.key),
1994
+ group: be.group,
1995
+ children: be.options.map((Re, Ve) => Vr(Re, be.index + Ve))
1996
+ });
1997
+ }
1998
+ return Vr(F, Le);
1999
+ }), g && $.length === 0 ? /* @__PURE__ */ t.jsx(a, s({}, f, {
2000
+ children: O
2001
+ })) : null, $.length === 0 && !B && !g ? /* @__PURE__ */ t.jsx(j, s({}, E, {
2002
+ children: ne
2003
+ })) : null]
2004
+ }))
2005
+ })
2006
+ });
2007
+ }
2008
+ return /* @__PURE__ */ t.jsxs(p.Fragment, {
2009
+ children: [/* @__PURE__ */ t.jsxs(mr, s({}, vr, {
2010
+ children: [ge && /* @__PURE__ */ t.jsx(Lr, s({}, $r, {
2011
+ children: ge
2012
+ })), /* @__PURE__ */ t.jsxs(Pr, s({}, Tr, {
2013
+ children: [we, /* @__PURE__ */ t.jsx(zr, s({}, Dr))]
2014
+ })), I && /* @__PURE__ */ t.jsx(Fr, s({}, gr, {
2015
+ children: I
2016
+ })), We ? /* @__PURE__ */ t.jsx(Nr, s({}, Rr, {
2017
+ children: z
2018
+ })) : null, Ee ? /* @__PURE__ */ t.jsx(jr, s({}, lr, {
2019
+ children: he
2020
+ })) : null]
2021
+ })), qr]
2022
+ });
2023
+ });
2024
+ function fn(e) {
2025
+ return $e("MuiCheckbox", e);
2026
+ }
2027
+ const tr = Pe("MuiCheckbox", ["root", "checkbox", "action", "input", "label", "checked", "disabled", "focusVisible", "indeterminate", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantOutlined", "variantSoft", "variantSolid"]), bn = ur(/* @__PURE__ */ t.jsx("path", {
2028
+ d: "M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"
2029
+ }), "Check"), xn = ur(/* @__PURE__ */ t.jsx("path", {
2030
+ d: "M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"
2031
+ }), "HorizontalRule"), yn = ["checked", "uncheckedIcon", "checkedIcon", "label", "defaultChecked", "disabled", "disableIcon", "overlay", "id", "indeterminate", "indeterminateIcon", "name", "onBlur", "onChange", "onFocus", "onFocusVisible", "readOnly", "required", "value", "color", "variant", "size", "component", "slots", "slotProps"], Cn = (e) => {
2032
+ const {
2033
+ checked: r,
2034
+ disabled: o,
2035
+ disableIcon: n,
2036
+ focusVisible: i,
2037
+ color: c,
2038
+ variant: u,
2039
+ size: m,
2040
+ indeterminate: y
2041
+ } = e, x = {
2042
+ root: ["root", r && "checked", o && "disabled", i && "focusVisible", u && `variant${te(u)}`, c && `color${te(c)}`, m && `size${te(m)}`],
2043
+ checkbox: [
2044
+ "checkbox",
2045
+ r && "checked",
2046
+ y && "indeterminate",
2047
+ o && "disabled"
2048
+ // disabled class is necessary for displaying global variant
2049
+ ],
2050
+ action: [
2051
+ "action",
2052
+ r && "checked",
2053
+ n && o && "disabled",
2054
+ // add disabled class to action element for displaying global variant
2055
+ i && "focusVisible"
2056
+ ],
2057
+ input: ["input"],
2058
+ label: ["label"]
2059
+ };
2060
+ return De(x, fn, {});
2061
+ }, Sn = N("span", {
2062
+ name: "JoyCheckbox",
2063
+ slot: "Root",
2064
+ overridesResolver: (e, r) => r.root
2065
+ })(({
2066
+ ownerState: e,
2067
+ theme: r
2068
+ }) => {
2069
+ var o, n, i;
2070
+ return s({
2071
+ "--Icon-fontSize": "var(--Checkbox-size)"
2072
+ }, e.size === "sm" && {
2073
+ "--Checkbox-size": "1rem",
2074
+ "& ~ *": {
2075
+ "--FormHelperText-margin": "0 0 0 1.5rem"
2076
+ },
2077
+ fontSize: r.vars.fontSize.sm,
2078
+ gap: "var(--Checkbox-gap, 0.5rem)"
2079
+ }, e.size === "md" && {
2080
+ "--Checkbox-size": "1.25rem",
2081
+ "& ~ *": {
2082
+ "--FormHelperText-margin": "0.25rem 0 0 1.875rem"
2083
+ },
2084
+ fontSize: r.vars.fontSize.md,
2085
+ gap: "var(--Checkbox-gap, 0.625rem)"
2086
+ }, e.size === "lg" && {
2087
+ "--Checkbox-size": "1.5rem",
2088
+ "& ~ *": {
2089
+ "--FormHelperText-margin": "0.375rem 0 0 2.25rem"
2090
+ },
2091
+ fontSize: r.vars.fontSize.lg,
2092
+ gap: "var(--Checkbox-gap, 0.75rem)"
2093
+ }, {
2094
+ position: e.overlay ? "initial" : "relative",
2095
+ display: "inline-flex",
2096
+ fontFamily: r.vars.fontFamily.body,
2097
+ lineHeight: "var(--Checkbox-size)",
2098
+ color: r.vars.palette.text.primary,
2099
+ [`&.${tr.disabled}`]: {
2100
+ color: (o = r.variants.plainDisabled) == null || (o = o[e.color]) == null ? void 0 : o.color
2101
+ }
2102
+ }, e.disableIcon && {
2103
+ color: (n = r.variants[e.variant]) == null || (n = n[e.color]) == null ? void 0 : n.color,
2104
+ [`&.${tr.disabled}`]: {
2105
+ color: (i = r.variants[`${e.variant}Disabled`]) == null || (i = i[e.color]) == null ? void 0 : i.color
2106
+ }
2107
+ });
2108
+ }), In = N("span", {
2109
+ name: "JoyCheckbox",
2110
+ slot: "Checkbox",
2111
+ overridesResolver: (e, r) => r.checkbox
2112
+ })(({
2113
+ theme: e,
2114
+ ownerState: r
2115
+ }) => {
2116
+ var o, n, i, c, u;
2117
+ const m = (o = e.variants[`${r.variant}`]) == null ? void 0 : o[r.color];
2118
+ return [s({
2119
+ "--Icon-color": r.color !== "neutral" || r.variant === "solid" ? "currentColor" : e.vars.palette.text.icon,
2120
+ boxSizing: "border-box",
2121
+ borderRadius: `min(${e.vars.radius.sm}, 0.25rem)`,
2122
+ width: "var(--Checkbox-size)",
2123
+ height: "var(--Checkbox-size)",
2124
+ display: "inline-flex",
2125
+ justifyContent: "center",
2126
+ alignItems: "center",
2127
+ flexShrink: 0
2128
+ }, r.disableIcon && {
2129
+ display: "contents"
2130
+ }, {
2131
+ [`&.${tr.checked}, &.${tr.indeterminate}`]: {
2132
+ "--Icon-color": "currentColor"
2133
+ }
2134
+ }), ...r.disableIcon ? [] : [s({}, m, {
2135
+ backgroundColor: (n = m == null ? void 0 : m.backgroundColor) != null ? n : e.vars.palette.background.surface
2136
+ }), {
2137
+ "&:hover": {
2138
+ "@media (hover: hover)": (i = e.variants[`${r.variant}Hover`]) == null ? void 0 : i[r.color]
2139
+ }
2140
+ }, {
2141
+ "&:active": (c = e.variants[`${r.variant}Active`]) == null ? void 0 : c[r.color]
2142
+ }, {
2143
+ [`&.${tr.disabled}`]: (u = e.variants[`${r.variant}Disabled`]) == null ? void 0 : u[r.color]
2144
+ }]];
2145
+ }), kn = N("span", {
2146
+ name: "JoyCheckbox",
2147
+ slot: "Action",
2148
+ overridesResolver: (e, r) => r.action
2149
+ })(({
2150
+ theme: e,
2151
+ ownerState: r
2152
+ }) => {
2153
+ var o, n, i, c;
2154
+ return [{
2155
+ borderRadius: `var(--Checkbox-actionRadius, ${r.overlay ? "var(--unstable_actionRadius, inherit)" : "inherit"})`,
2156
+ textAlign: "left",
2157
+ // prevent text-align inheritance
2158
+ position: "absolute",
2159
+ top: "calc(-1 * var(--variant-borderWidth, 0px))",
2160
+ // clickable on the border and focus outline does not move when checked/unchecked
2161
+ left: "calc(-1 * var(--variant-borderWidth, 0px))",
2162
+ bottom: "calc(-1 * var(--variant-borderWidth, 0px))",
2163
+ right: "calc(-1 * var(--variant-borderWidth, 0px))",
2164
+ zIndex: 1,
2165
+ // The action element usually cover the area of nearest positioned parent
2166
+ [e.focus.selector]: e.focus.default
2167
+ }, ...r.disableIcon ? [(o = e.variants[r.variant]) == null ? void 0 : o[r.color], {
2168
+ "&:hover": (n = e.variants[`${r.variant}Hover`]) == null ? void 0 : n[r.color]
2169
+ }, {
2170
+ "&:active": (i = e.variants[`${r.variant}Active`]) == null ? void 0 : i[r.color]
2171
+ }, {
2172
+ [`&.${tr.disabled}`]: (c = e.variants[`${r.variant}Disabled`]) == null ? void 0 : c[r.color]
2173
+ }] : []];
2174
+ }), wn = N("input", {
2175
+ name: "JoyCheckbox",
2176
+ slot: "Input",
2177
+ overridesResolver: (e, r) => r.input
2178
+ })(() => ({
2179
+ margin: 0,
2180
+ opacity: 0,
2181
+ position: "absolute",
2182
+ width: "100%",
2183
+ height: "100%",
2184
+ cursor: "pointer"
2185
+ })), Pn = N("label", {
2186
+ name: "JoyCheckbox",
2187
+ slot: "Label",
2188
+ overridesResolver: (e, r) => r.label
2189
+ })(({
2190
+ ownerState: e
2191
+ }) => s({
2192
+ flex: 1,
2193
+ minWidth: 0
2194
+ }, e.disableIcon && {
2195
+ zIndex: 1,
2196
+ // label should stay on top of the action.
2197
+ pointerEvents: "none"
2198
+ // makes hover ineffect.
2199
+ })), Tn = /* @__PURE__ */ t.jsx(bn, {}), zn = /* @__PURE__ */ t.jsx(xn, {}), ko = /* @__PURE__ */ p.forwardRef(function(e, r) {
2200
+ var o, n, i, c, u;
2201
+ const m = ze({
2202
+ props: e,
2203
+ name: "JoyCheckbox"
2204
+ }), {
2205
+ checked: y,
2206
+ uncheckedIcon: x,
2207
+ checkedIcon: C = Tn,
2208
+ label: v,
2209
+ defaultChecked: T,
2210
+ disabled: b,
2211
+ disableIcon: z = !1,
2212
+ overlay: S,
2213
+ id: w,
2214
+ indeterminate: h = !1,
2215
+ indeterminateIcon: D = zn,
2216
+ name: I,
2217
+ onBlur: d,
2218
+ onChange: q,
2219
+ onFocus: B,
2220
+ onFocusVisible: k,
2221
+ readOnly: L,
2222
+ required: J,
2223
+ value: V,
2224
+ color: Q,
2225
+ variant: g,
2226
+ size: O = "md",
2227
+ component: _,
2228
+ slots: G = {},
2229
+ slotProps: ne = {}
2230
+ } = m, X = ue(m, yn), W = p.useContext(Ir), he = (o = (n = e.disabled) != null ? n : W == null ? void 0 : W.disabled) != null ? o : b, se = (i = (c = e.size) != null ? c : W == null ? void 0 : W.size) != null ? i : O, A = dr(w ?? (W == null ? void 0 : W.htmlFor)), ce = {
2231
+ checked: y,
2232
+ defaultChecked: T,
2233
+ disabled: he,
2234
+ onBlur: d,
2235
+ onChange: q,
2236
+ onFocus: B,
2237
+ onFocusVisible: k
2238
+ }, {
2239
+ getInputProps: Se,
2240
+ checked: ie,
2241
+ disabled: ae,
2242
+ focusVisible: ge
2243
+ } = tt(ce), xe = ie || h, U = xe ? g || "solid" : g || "outlined", K = e.color || (W != null && W.error ? "danger" : (u = W == null ? void 0 : W.color) != null ? u : Q), pe = s({}, m, {
2244
+ checked: ie,
2245
+ disabled: ae,
2246
+ disableIcon: z,
2247
+ overlay: S,
2248
+ focusVisible: ge,
2249
+ color: xe ? K || "primary" : K || "neutral",
2250
+ variant: U,
2251
+ size: se
2252
+ }), R = Cn(pe), de = s({}, X, {
2253
+ component: _,
2254
+ slots: G,
2255
+ slotProps: ne
2256
+ }), [Ce, Z] = H("root", {
2257
+ ref: r,
2258
+ className: R.root,
2259
+ elementType: Sn,
2260
+ externalForwardedProps: de,
2261
+ ownerState: pe
2262
+ }), [le, P] = H("checkbox", {
2263
+ className: R.checkbox,
2264
+ elementType: In,
2265
+ externalForwardedProps: de,
2266
+ ownerState: pe
2267
+ }), [Ie, M] = H("action", {
2268
+ className: R.action,
2269
+ elementType: kn,
2270
+ externalForwardedProps: de,
2271
+ ownerState: pe
2272
+ }), [Fe, Ne] = H("input", {
2273
+ additionalProps: s({
2274
+ id: A,
2275
+ name: I,
2276
+ value: V,
2277
+ readOnly: L,
2278
+ role: void 0,
2279
+ required: J ?? (W == null ? void 0 : W.required),
2280
+ "aria-describedby": W == null ? void 0 : W["aria-describedby"]
2281
+ }, h && {
2282
+ // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked#values
2283
+ "aria-checked": "mixed"
2284
+ }),
2285
+ className: R.input,
2286
+ elementType: wn,
2287
+ externalForwardedProps: de,
2288
+ getSlotProps: Se,
2289
+ ownerState: pe
2290
+ }), [_e, je] = H("label", {
2291
+ additionalProps: {
2292
+ htmlFor: A
2293
+ },
2294
+ className: R.label,
2295
+ elementType: Pn,
2296
+ externalForwardedProps: de,
2297
+ ownerState: pe
2298
+ });
2299
+ let ke = x;
2300
+ return z ? ke = null : h ? ke = D : ie && (ke = C), /* @__PURE__ */ t.jsxs(Ce, s({}, Z, {
2301
+ children: [/* @__PURE__ */ t.jsxs(le, s({}, P, {
2302
+ children: [/* @__PURE__ */ t.jsx(Ie, s({}, M, {
2303
+ children: /* @__PURE__ */ t.jsx(Fe, s({}, Ne))
2304
+ })), ke]
2305
+ })), v && /* @__PURE__ */ t.jsx(Br.Provider, {
2306
+ value: !0,
2307
+ children: /* @__PURE__ */ t.jsx(_e, s({}, je, {
2308
+ children: v
2309
+ }))
2310
+ })]
2311
+ }));
2312
+ });
2313
+ function Dn(e) {
2314
+ return $e("MuiFormControl", e);
2315
+ }
2316
+ const so = Pe("MuiFormControl", ["root", "error", "disabled", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "sizeSm", "sizeMd", "sizeLg", "horizontal", "vertical"]), Ln = Pe("MuiSwitch", ["root", "checked", "disabled", "action", "input", "thumb", "track", "focusVisible", "readOnly", "colorPrimary", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantOutlined", "variantSoft", "variantSolid", "startDecorator", "endDecorator"]), $n = ["id", "className", "component", "disabled", "required", "error", "color", "size", "orientation", "slots", "slotProps"], Fn = (e) => {
2317
+ const {
2318
+ disabled: r,
2319
+ error: o,
2320
+ size: n,
2321
+ color: i,
2322
+ orientation: c
2323
+ } = e, u = {
2324
+ root: ["root", c, r && "disabled", o && "error", i && `color${te(i)}`, n && `size${te(n)}`]
2325
+ };
2326
+ return De(u, Dn, {});
2327
+ }, Nn = N("div", {
2328
+ name: "JoyFormControl",
2329
+ slot: "Root",
2330
+ overridesResolver: (e, r) => r.root
2331
+ })(({
2332
+ theme: e,
2333
+ ownerState: r
2334
+ }) => {
2335
+ var o, n, i;
2336
+ return s({
2337
+ "--unstable_RadioGroup-margin": "0.5rem 0",
2338
+ "--FormLabel-alignSelf": r.orientation === "horizontal" ? "align-items" : "flex-start",
2339
+ "--FormLabel-asteriskColor": e.vars.palette.danger[500]
2340
+ }, r.size === "sm" && {
2341
+ "--FormLabel-fontSize": e.vars.fontSize.xs,
2342
+ "--FormLabel-lineHeight": e.vars.lineHeight.xl,
2343
+ "--FormLabel-margin": r.orientation === "horizontal" ? "0 0.5rem 0 0" : "0 0 0.25rem 0",
2344
+ "--FormHelperText-fontSize": e.vars.fontSize.xs,
2345
+ "--FormHelperText-lineHeight": e.vars.lineHeight.xl
2346
+ }, r.size === "md" && {
2347
+ "--FormLabel-fontSize": e.vars.fontSize.sm,
2348
+ "--FormLabel-lineHeight": e.vars.lineHeight.sm,
2349
+ "--FormLabel-margin": r.orientation === "horizontal" ? "0 0.75rem 0 0" : "0 0 0.375rem 0",
2350
+ "--FormHelperText-fontSize": e.vars.fontSize.sm,
2351
+ "--FormHelperText-lineHeight": e.vars.lineHeight.sm
2352
+ }, r.size === "lg" && {
2353
+ "--FormLabel-fontSize": e.vars.fontSize.md,
2354
+ "--FormLabel-lineHeight": e.vars.lineHeight.md,
2355
+ "--FormLabel-margin": r.orientation === "horizontal" ? "0 1rem 0 0" : "0 0 0.5rem 0",
2356
+ "--FormHelperText-fontSize": e.vars.fontSize.sm,
2357
+ "--FormHelperText-lineHeight": e.vars.lineHeight.sm
2358
+ }, r.color && {
2359
+ "--FormHelperText-color": (o = e.vars.palette[r.color]) == null ? void 0 : o[500]
2360
+ }, {
2361
+ "--FormHelperText-margin": "0.375rem 0 0 0",
2362
+ [`&.${so.error}`]: {
2363
+ "--FormHelperText-color": e.vars.palette.danger[500]
2364
+ },
2365
+ [`&.${so.disabled}`]: {
2366
+ "--FormLabel-color": (n = e.variants.plainDisabled) == null || (n = n[r.color || "neutral"]) == null ? void 0 : n.color,
2367
+ "--FormHelperText-color": (i = e.variants.plainDisabled) == null || (i = i[r.color || "neutral"]) == null ? void 0 : i.color
2368
+ },
2369
+ display: "flex",
2370
+ position: "relative",
2371
+ // for keeping the control action area, for example Switch
2372
+ flexDirection: r.orientation === "horizontal" ? "row" : "column"
2373
+ }, r.orientation === "horizontal" && {
2374
+ [`& > label ~ .${Ln.root}`]: {
2375
+ "--unstable_Switch-margin": "0 0 0 auto"
2376
+ }
2377
+ });
2378
+ }), Be = /* @__PURE__ */ p.forwardRef(function(e, r) {
2379
+ const o = ze({
2380
+ props: e,
2381
+ name: "JoyFormControl"
2382
+ }), {
2383
+ id: n,
2384
+ className: i,
2385
+ component: c = "div",
2386
+ disabled: u = !1,
2387
+ required: m = !1,
2388
+ error: y = !1,
2389
+ color: x,
2390
+ size: C = "md",
2391
+ orientation: v = "vertical",
2392
+ slots: T = {},
2393
+ slotProps: b = {}
2394
+ } = o, z = ue(o, $n), S = dr(n), [w, h] = p.useState(null), D = s({}, o, {
2395
+ id: S,
2396
+ component: c,
2397
+ color: x,
2398
+ disabled: u,
2399
+ error: y,
2400
+ required: m,
2401
+ size: C,
2402
+ orientation: v
2403
+ });
2404
+ let I;
2405
+ const d = Fn(D), [q, B] = H("root", {
2406
+ ref: r,
2407
+ className: Xe(d.root, i),
2408
+ elementType: Nn,
2409
+ externalForwardedProps: s({}, z, {
2410
+ component: c,
2411
+ slots: T,
2412
+ slotProps: b
2413
+ }),
2414
+ ownerState: D
2415
+ }), k = p.useMemo(() => ({
2416
+ disabled: u,
2417
+ required: m,
2418
+ error: y,
2419
+ color: x,
2420
+ size: C,
2421
+ htmlFor: S,
2422
+ labelId: `${S}-label`,
2423
+ "aria-describedby": w ? `${S}-helper-text` : void 0,
2424
+ setHelperText: h,
2425
+ registerEffect: I
2426
+ }), [x, u, y, w, S, I, m, C]);
2427
+ return /* @__PURE__ */ t.jsx(Ir.Provider, {
2428
+ value: k,
2429
+ children: /* @__PURE__ */ t.jsx(q, s({}, B))
2430
+ });
2431
+ });
2432
+ function Rn(e) {
2433
+ return $e("MuiFormLabel", e);
2434
+ }
2435
+ Pe("MuiFormLabel", ["root", "asterisk"]);
2436
+ const jn = ["children", "component", "htmlFor", "id", "slots", "slotProps"], On = () => De({
2437
+ root: ["root"],
2438
+ asterisk: ["asterisk"]
2439
+ }, Rn, {}), Hn = N("label", {
2440
+ name: "JoyFormLabel",
2441
+ slot: "Root",
2442
+ overridesResolver: (e, r) => r.root
2443
+ })(({
2444
+ theme: e
2445
+ }) => ({
2446
+ "--Icon-fontSize": "calc(var(--FormLabel-lineHeight) * 1em)",
2447
+ WebkitTapHighlightColor: "transparent",
2448
+ alignSelf: "var(--FormLabel-alignSelf)",
2449
+ // to not fill the block space. It seems like a bug when clicking on empty space (within the label area), even though it is not.
2450
+ display: "flex",
2451
+ gap: "2px",
2452
+ alignItems: "center",
2453
+ flexWrap: "wrap",
2454
+ userSelect: "none",
2455
+ fontFamily: e.vars.fontFamily.body,
2456
+ fontSize: `var(--FormLabel-fontSize, ${e.vars.fontSize.sm})`,
2457
+ fontWeight: e.vars.fontWeight.md,
2458
+ lineHeight: `var(--FormLabel-lineHeight, ${e.vars.lineHeight.sm})`,
2459
+ color: `var(--FormLabel-color, ${e.vars.palette.text.primary})`,
2460
+ margin: "var(--FormLabel-margin, 0px)"
2461
+ })), Bn = N("span", {
2462
+ name: "JoyFormLabel",
2463
+ slot: "Asterisk",
2464
+ overridesResolver: (e, r) => r.asterisk
2465
+ })({
2466
+ color: "var(--FormLabel-asteriskColor)"
2467
+ }), Ue = /* @__PURE__ */ p.forwardRef(function(e, r) {
2468
+ var o, n;
2469
+ const i = ze({
2470
+ props: e,
2471
+ name: "JoyFormLabel"
2472
+ }), {
2473
+ children: c,
2474
+ component: u = "label",
2475
+ htmlFor: m,
2476
+ id: y,
2477
+ slots: x = {},
2478
+ slotProps: C = {}
2479
+ } = i, v = ue(i, jn), T = p.useContext(Ir), b = (o = (n = e.required) != null ? n : T == null ? void 0 : T.required) != null ? o : !1, z = s({}, i, {
2480
+ required: b
2481
+ }), S = On(), w = s({}, v, {
2482
+ component: u,
2483
+ slots: x,
2484
+ slotProps: C
2485
+ }), [h, D] = H("root", {
2486
+ additionalProps: {
2487
+ htmlFor: m ?? (T == null ? void 0 : T.htmlFor),
2488
+ id: y ?? (T == null ? void 0 : T.labelId)
2489
+ },
2490
+ ref: r,
2491
+ className: S.root,
2492
+ elementType: Hn,
2493
+ externalForwardedProps: w,
2494
+ ownerState: z
2495
+ }), [I, d] = H("asterisk", {
2496
+ additionalProps: {
2497
+ "aria-hidden": !0
2498
+ },
2499
+ className: S.asterisk,
2500
+ elementType: Bn,
2501
+ externalForwardedProps: w,
2502
+ ownerState: z
2503
+ });
2504
+ return /* @__PURE__ */ t.jsxs(h, s({}, D, {
2505
+ children: [c, b && /* @__PURE__ */ t.jsxs(I, s({}, d, {
2506
+ children: [" ", "*"]
2507
+ }))]
2508
+ }));
2509
+ });
2510
+ function An(e) {
2511
+ return $e("MuiLink", e);
2512
+ }
2513
+ const co = Pe("MuiLink", ["root", "disabled", "focusVisible", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "focusVisible", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "underlineNone", "underlineHover", "underlineAlways", "h1", "h2", "h3", "h4", "title-lg", "title-md", "title-sm", "body-lg", "body-md", "body-sm", "body-xs", "startDecorator", "endDecorator"]), Mn = ["color", "textColor", "variant"], Wn = ["children", "disabled", "onBlur", "onFocus", "level", "overlay", "underline", "endDecorator", "startDecorator", "component", "slots", "slotProps"], _n = (e) => {
2514
+ const {
2515
+ level: r,
2516
+ color: o,
2517
+ variant: n,
2518
+ underline: i,
2519
+ focusVisible: c,
2520
+ disabled: u
2521
+ } = e, m = {
2522
+ root: ["root", o && `color${te(o)}`, u && "disabled", c && "focusVisible", r, i && `underline${te(i)}`, n && `variant${te(n)}`],
2523
+ startDecorator: ["startDecorator"],
2524
+ endDecorator: ["endDecorator"]
2525
+ };
2526
+ return De(m, An, {});
2527
+ }, Jn = N("span", {
2528
+ name: "JoyLink",
2529
+ slot: "StartDecorator",
2530
+ overridesResolver: (e, r) => r.startDecorator
2531
+ })(({
2532
+ ownerState: e
2533
+ }) => {
2534
+ var r;
2535
+ return s({
2536
+ display: "inline-flex",
2537
+ marginInlineEnd: "clamp(4px, var(--Link-gap, 0.375em), 0.75rem)"
2538
+ }, typeof e.startDecorator != "string" && (e.alignItems === "flex-start" || ((r = e.sx) == null ? void 0 : r.alignItems) === "flex-start") && {
2539
+ marginTop: "2px"
2540
+ // this makes the alignment perfect in most cases
2541
+ });
2542
+ }), En = N("span", {
2543
+ name: "JoyLink",
2544
+ slot: "endDecorator",
2545
+ overridesResolver: (e, r) => r.endDecorator
2546
+ })(({
2547
+ ownerState: e
2548
+ }) => {
2549
+ var r;
2550
+ return s({
2551
+ display: "inline-flex",
2552
+ marginInlineStart: "clamp(4px, var(--Link-gap, 0.25em), 0.5rem)"
2553
+ }, typeof e.startDecorator != "string" && (e.alignItems === "flex-start" || ((r = e.sx) == null ? void 0 : r.alignItems) === "flex-start") && {
2554
+ marginTop: "2px"
2555
+ // this makes the alignment perfect in most cases
2556
+ });
2557
+ }), Vn = N("a", {
2558
+ name: "JoyLink",
2559
+ slot: "Root",
2560
+ overridesResolver: (e, r) => r.root
2561
+ })(({
2562
+ theme: e,
2563
+ ownerState: r
2564
+ }) => {
2565
+ var o, n, i, c, u, m, y;
2566
+ return [s({
2567
+ "--Icon-fontSize": "1.25em",
2568
+ "--Icon-color": "currentColor",
2569
+ "--CircularProgress-size": "1.25em",
2570
+ "--CircularProgress-thickness": "3px"
2571
+ }, r.level && r.level !== "inherit" && e.typography[r.level], r.level === "inherit" && {
2572
+ font: "inherit"
2573
+ }, r.underline === "none" && {
2574
+ textDecoration: "none"
2575
+ }, r.underline === "hover" && {
2576
+ textDecoration: "none",
2577
+ "&:hover": {
2578
+ "@media (hover: hover)": {
2579
+ textDecorationLine: "underline"
2580
+ }
2581
+ }
2582
+ }, r.underline === "always" && {
2583
+ textDecoration: "underline"
2584
+ }, r.startDecorator && {
2585
+ verticalAlign: "bottom"
2586
+ // to make the link align with the parent's content
2587
+ }, {
2588
+ textDecorationThickness: "max(0.08em, 1px)",
2589
+ // steal from https://moderncss.dev/modern-css-for-dynamic-component-based-architecture/#css-reset-additions
2590
+ textUnderlineOffset: "0.15em",
2591
+ // steal from https://moderncss.dev/modern-css-for-dynamic-component-based-architecture/#css-reset-additions
2592
+ display: "inline-flex",
2593
+ alignItems: "center",
2594
+ WebkitTapHighlightColor: "transparent",
2595
+ backgroundColor: "transparent",
2596
+ // Reset default value
2597
+ // We disable the focus ring for mouse, touch and keyboard users.
2598
+ outline: 0,
2599
+ border: 0,
2600
+ margin: 0,
2601
+ // Remove the margin in Safari
2602
+ borderRadius: e.vars.radius.xs,
2603
+ padding: 0,
2604
+ // Remove the padding in Firefox
2605
+ cursor: "pointer",
2606
+ textDecorationColor: `var(--variant-outlinedBorder, rgba(${(o = e.vars.palette[r.color]) == null ? void 0 : o.mainChannel} / var(--Link-underlineOpacity, 0.72)))`
2607
+ }, r.variant ? s({
2608
+ paddingBlock: "min(0.1em, 4px)",
2609
+ paddingInline: "0.25em"
2610
+ }, !r.nesting && {
2611
+ marginInline: "-0.25em"
2612
+ }) : {
2613
+ color: `var(--variant-plainColor, rgba(${(n = e.vars.palette[r.color]) == null ? void 0 : n.mainChannel} / 1))`,
2614
+ [`&.${co.disabled}`]: {
2615
+ pointerEvents: "none",
2616
+ color: `var(--variant-plainDisabledColor, rgba(${(i = e.vars.palette[r.color]) == null ? void 0 : i.mainChannel} / 0.6))`
2617
+ }
2618
+ }, {
2619
+ userSelect: r.component === "button" ? "none" : void 0,
2620
+ MozAppearance: "none",
2621
+ // Reset
2622
+ WebkitAppearance: "none",
2623
+ // Reset
2624
+ "&::-moz-focus-inner": {
2625
+ borderStyle: "none"
2626
+ // Remove Firefox dotted outline.
2627
+ }
2628
+ }, r.overlay ? {
2629
+ position: "initial",
2630
+ "&::after": {
2631
+ content: '""',
2632
+ display: "block",
2633
+ position: "absolute",
2634
+ top: 0,
2635
+ left: 0,
2636
+ bottom: 0,
2637
+ right: 0,
2638
+ borderRadius: "var(--unstable_actionRadius, inherit)",
2639
+ margin: "var(--unstable_actionMargin)"
2640
+ },
2641
+ [`${e.focus.selector}`]: {
2642
+ "&::after": e.focus.default
2643
+ }
2644
+ } : {
2645
+ position: "relative",
2646
+ [e.focus.selector]: e.focus.default
2647
+ }), r.variant && s({}, (c = e.variants[r.variant]) == null ? void 0 : c[r.color], {
2648
+ "&:hover": {
2649
+ "@media (hover: hover)": (u = e.variants[`${r.variant}Hover`]) == null ? void 0 : u[r.color]
2650
+ },
2651
+ "&:active": (m = e.variants[`${r.variant}Active`]) == null ? void 0 : m[r.color],
2652
+ [`&.${co.disabled}`]: (y = e.variants[`${r.variant}Disabled`]) == null ? void 0 : y[r.color]
2653
+ })];
2654
+ }), sr = /* @__PURE__ */ p.forwardRef(function(e, r) {
2655
+ const o = ze({
2656
+ props: e,
2657
+ name: "JoyLink"
2658
+ }), {
2659
+ color: n = "primary",
2660
+ textColor: i,
2661
+ variant: c
2662
+ } = o, u = ue(o, Mn), m = p.useContext(Br), y = p.useContext(Xo), x = Zo(s({}, u, {
2663
+ color: i
2664
+ })), {
2665
+ children: C,
2666
+ disabled: v = !1,
2667
+ onBlur: T,
2668
+ onFocus: b,
2669
+ level: z = "body-md",
2670
+ overlay: S = !1,
2671
+ underline: w = "hover",
2672
+ endDecorator: h,
2673
+ startDecorator: D,
2674
+ component: I,
2675
+ slots: d = {},
2676
+ slotProps: q = {}
2677
+ } = x, B = ue(x, Wn), k = m || y ? e.level || "inherit" : z, {
2678
+ isFocusVisibleRef: L,
2679
+ onBlur: J,
2680
+ onFocus: V,
2681
+ ref: Q
2682
+ } = xo(), [g, O] = p.useState(!1), _ = pr(r, Q), G = (ge) => {
2683
+ J(ge), L.current === !1 && O(!1), T && T(ge);
2684
+ }, ne = (ge) => {
2685
+ V(ge), L.current === !0 && O(!0), b && b(ge);
2686
+ }, X = s({}, x, {
2687
+ color: n,
2688
+ disabled: v,
2689
+ focusVisible: g,
2690
+ underline: w,
2691
+ variant: c,
2692
+ level: k,
2693
+ overlay: S,
2694
+ nesting: m
2695
+ }), W = _n(X), he = s({}, B, {
2696
+ component: I,
2697
+ slots: d,
2698
+ slotProps: q
2699
+ }), [se, A] = H("root", {
2700
+ additionalProps: {
2701
+ onBlur: G,
2702
+ onFocus: ne
2703
+ },
2704
+ ref: _,
2705
+ className: W.root,
2706
+ elementType: Vn,
2707
+ externalForwardedProps: he,
2708
+ ownerState: X
2709
+ }), [ce, Se] = H("startDecorator", {
2710
+ className: W.startDecorator,
2711
+ elementType: Jn,
2712
+ externalForwardedProps: he,
2713
+ ownerState: X
2714
+ }), [ie, ae] = H("endDecorator", {
2715
+ className: W.endDecorator,
2716
+ elementType: En,
2717
+ externalForwardedProps: he,
2718
+ ownerState: X
2719
+ });
2720
+ return /* @__PURE__ */ t.jsx(Br.Provider, {
2721
+ value: !0,
2722
+ children: /* @__PURE__ */ t.jsxs(se, s({}, A, {
2723
+ children: [D && /* @__PURE__ */ t.jsx(ce, s({}, Se, {
2724
+ children: D
2725
+ })), bo(C, ["Skeleton"]) ? /* @__PURE__ */ p.cloneElement(C, {
2726
+ variant: C.props.variant || "inline"
2727
+ }) : C, h && /* @__PURE__ */ t.jsx(ie, s({}, ae, {
2728
+ children: h
2729
+ }))]
2730
+ }))
2731
+ });
2732
+ });
2733
+ function qn(e) {
2734
+ return $e("MuiListItemContent", e);
2735
+ }
2736
+ Pe("MuiListItemContent", ["root"]);
2737
+ const Gn = ["component", "className", "children", "slots", "slotProps"], Un = () => De({
2738
+ root: ["root"]
2739
+ }, qn, {}), Kn = N("div", {
2740
+ name: "JoyListItemContent",
2741
+ slot: "Root",
2742
+ overridesResolver: (e, r) => r.root
2743
+ })({
2744
+ flex: "1 1 auto",
2745
+ minWidth: 0
2746
+ }), Qn = /* @__PURE__ */ p.forwardRef(function(e, r) {
2747
+ const o = ze({
2748
+ props: e,
2749
+ name: "JoyListItemContent"
2750
+ }), {
2751
+ component: n,
2752
+ className: i,
2753
+ children: c,
2754
+ slots: u = {},
2755
+ slotProps: m = {}
2756
+ } = o, y = ue(o, Gn), x = s({}, o), C = Un(), v = s({}, y, {
2757
+ component: n,
2758
+ slots: u,
2759
+ slotProps: m
2760
+ }), [T, b] = H("root", {
2761
+ ref: r,
2762
+ className: Xe(C.root, i),
2763
+ elementType: Kn,
2764
+ externalForwardedProps: v,
2765
+ ownerState: x
2766
+ });
2767
+ return /* @__PURE__ */ t.jsx(T, s({}, b, {
2768
+ children: c
2769
+ }));
2770
+ });
2771
+ function Xn(e) {
2772
+ return $e("MuiListItemDecorator", e);
2773
+ }
2774
+ Pe("MuiListItemDecorator", ["root"]);
2775
+ const Zn = ["component", "className", "children", "slots", "slotProps"], Yn = () => De({
2776
+ root: ["root"]
2777
+ }, Xn, {}), ea = N("span", {
2778
+ name: "JoyListItemDecorator",
2779
+ slot: "Root",
2780
+ overridesResolver: (e, r) => r.root
2781
+ })(({
2782
+ ownerState: e
2783
+ }) => s({
2784
+ boxSizing: "border-box",
2785
+ display: "inline-flex",
2786
+ alignItems: `var(--unstable_ListItemDecorator-alignItems, ${e.parentOrientation === "horizontal" ? "center" : "initial"})`
2787
+ }, e.parentOrientation === "horizontal" ? {
2788
+ minInlineSize: "var(--ListItemDecorator-size)",
2789
+ marginInlineEnd: "calc(-1 * var(--ListItem-gap))"
2790
+ } : {
2791
+ minBlockSize: "var(--ListItemDecorator-size)",
2792
+ justifyContent: "center",
2793
+ marginBlockEnd: "calc(-1 * var(--ListItem-gap))"
2794
+ })), ra = /* @__PURE__ */ p.forwardRef(function(e, r) {
2795
+ const o = ze({
2796
+ props: e,
2797
+ name: "JoyListItemDecorator"
2798
+ }), {
2799
+ component: n,
2800
+ className: i,
2801
+ children: c,
2802
+ slots: u = {},
2803
+ slotProps: m = {}
2804
+ } = o, y = ue(o, Zn), x = p.useContext(No), C = s({
2805
+ parentOrientation: x
2806
+ }, o), v = Yn(), T = s({}, y, {
2807
+ component: n,
2808
+ slots: u,
2809
+ slotProps: m
2810
+ }), [b, z] = H("root", {
2811
+ ref: r,
2812
+ className: Xe(v.root, i),
2813
+ elementType: ea,
2814
+ externalForwardedProps: T,
2815
+ ownerState: C
2816
+ });
2817
+ return /* @__PURE__ */ t.jsx(b, s({}, z, {
2818
+ children: c
2819
+ }));
2820
+ });
2821
+ function oa(e) {
2822
+ return $e("MuiTextarea", e);
2823
+ }
2824
+ const wo = Pe("MuiTextarea", ["root", "textarea", "startDecorator", "endDecorator", "formControl", "disabled", "error", "focused", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantPlain", "variantOutlined", "variantSoft"]), ta = ["propsToForward", "rootStateClasses", "inputStateClasses", "getRootProps", "getInputProps", "formControl", "focused", "error", "disabled", "size", "color", "variant", "startDecorator", "endDecorator", "minRows", "maxRows", "component", "slots", "slotProps"], na = (e) => {
2825
+ const {
2826
+ disabled: r,
2827
+ variant: o,
2828
+ color: n,
2829
+ size: i
2830
+ } = e, c = {
2831
+ root: ["root", r && "disabled", o && `variant${te(o)}`, n && `color${te(n)}`, i && `size${te(i)}`],
2832
+ textarea: ["textarea"],
2833
+ startDecorator: ["startDecorator"],
2834
+ endDecorator: ["endDecorator"]
2835
+ };
2836
+ return De(c, oa, {});
2837
+ }, aa = N("div", {
2838
+ name: "JoyTextarea",
2839
+ slot: "Root",
2840
+ overridesResolver: (e, r) => r.root
2841
+ })(({
2842
+ theme: e,
2843
+ ownerState: r
2844
+ }) => {
2845
+ var o, n, i, c, u, m;
2846
+ const y = (o = e.variants[`${r.variant}`]) == null ? void 0 : o[r.color];
2847
+ return [s({
2848
+ "--Textarea-radius": e.vars.radius.sm,
2849
+ "--Textarea-gap": "0.5rem",
2850
+ "--Textarea-placeholderColor": "inherit",
2851
+ "--Textarea-placeholderOpacity": 0.64,
2852
+ "--Textarea-decoratorColor": e.vars.palette.text.icon,
2853
+ "--Textarea-focused": "0",
2854
+ "--Textarea-focusedThickness": e.vars.focus.thickness,
2855
+ "--Textarea-focusedHighlight": (n = e.vars.palette[r.color === "neutral" ? "primary" : r.color]) == null ? void 0 : n[500],
2856
+ '&:not([data-inverted-colors="false"])': s({}, r.instanceColor && {
2857
+ "--_Textarea-focusedHighlight": (i = e.vars.palette[r.instanceColor === "neutral" ? "primary" : r.instanceColor]) == null ? void 0 : i[500]
2858
+ }, {
2859
+ "--Textarea-focusedHighlight": `var(--_Textarea-focusedHighlight, ${e.vars.palette.focusVisible})`
2860
+ })
2861
+ }, r.size === "sm" && {
2862
+ "--Textarea-minHeight": "2rem",
2863
+ "--Textarea-paddingBlock": "calc(0.375rem - 0.5px - var(--variant-borderWidth, 0px))",
2864
+ // to match Input because <textarea> does not center the text at the middle like <input>
2865
+ "--Textarea-paddingInline": "0.5rem",
2866
+ "--Textarea-decoratorChildHeight": "min(1.5rem, var(--Textarea-minHeight))",
2867
+ "--Icon-fontSize": e.vars.fontSize.xl
2868
+ }, r.size === "md" && {
2869
+ "--Textarea-minHeight": "2.25rem",
2870
+ "--Textarea-paddingBlock": "calc(0.375rem - var(--variant-borderWidth, 0px))",
2871
+ "--Textarea-paddingInline": "0.75rem",
2872
+ "--Textarea-decoratorChildHeight": "min(1.75rem, var(--Textarea-minHeight))",
2873
+ "--Icon-fontSize": e.vars.fontSize.xl2
2874
+ }, r.size === "lg" && {
2875
+ "--Textarea-minHeight": "3rem",
2876
+ "--Textarea-paddingBlock": "calc(0.75rem - var(--variant-borderWidth, 0px))",
2877
+ "--Textarea-paddingInline": "1rem",
2878
+ "--Textarea-gap": "0.75rem",
2879
+ "--Textarea-decoratorChildHeight": "min(2.375rem, var(--Textarea-minHeight))",
2880
+ "--Icon-fontSize": e.vars.fontSize.xl2
2881
+ }, {
2882
+ // variables for controlling child components
2883
+ "--_Textarea-paddingBlock": "max((var(--Textarea-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Textarea-decoratorChildHeight)) / 2, 0px)",
2884
+ "--Textarea-decoratorChildRadius": "max(var(--Textarea-radius) - var(--variant-borderWidth, 0px) - var(--_Textarea-paddingBlock), min(var(--_Textarea-paddingBlock) + var(--variant-borderWidth, 0px), var(--Textarea-radius) / 2))",
2885
+ "--Button-minHeight": "var(--Textarea-decoratorChildHeight)",
2886
+ "--Button-paddingBlock": "0px",
2887
+ // to ensure that the height of the button is equal to --Button-minHeight
2888
+ "--IconButton-size": "var(--Textarea-decoratorChildHeight)",
2889
+ "--Button-radius": "var(--Textarea-decoratorChildRadius)",
2890
+ "--IconButton-radius": "var(--Textarea-decoratorChildRadius)",
2891
+ boxSizing: "border-box"
2892
+ }, r.variant !== "plain" && {
2893
+ boxShadow: e.shadow.xs
2894
+ }, {
2895
+ minWidth: 0,
2896
+ minHeight: "var(--Textarea-minHeight)",
2897
+ cursor: "text",
2898
+ position: "relative",
2899
+ display: "flex",
2900
+ flexDirection: "column",
2901
+ paddingInlineStart: "var(--Textarea-paddingInline)",
2902
+ // the paddingInlineEnd is added to the textarea. It looks better when the scrollbar appears.
2903
+ paddingBlock: "var(--Textarea-paddingBlock)",
2904
+ borderRadius: "var(--Textarea-radius)"
2905
+ }, e.typography[`body-${r.size}`], y, {
2906
+ backgroundColor: (c = y == null ? void 0 : y.backgroundColor) != null ? c : e.vars.palette.background.surface,
2907
+ "&::before": {
2908
+ boxSizing: "border-box",
2909
+ content: '""',
2910
+ display: "block",
2911
+ position: "absolute",
2912
+ pointerEvents: "none",
2913
+ top: 0,
2914
+ left: 0,
2915
+ right: 0,
2916
+ bottom: 0,
2917
+ zIndex: 1,
2918
+ borderRadius: "inherit",
2919
+ margin: "calc(var(--variant-borderWidth, 0px) * -1)",
2920
+ // for outlined variant
2921
+ boxShadow: "var(--Textarea-focusedInset, inset) 0 0 0 calc(var(--Textarea-focused) * var(--Textarea-focusedThickness)) var(--Textarea-focusedHighlight)"
2922
+ }
2923
+ }), {
2924
+ "&:hover": s({}, (u = e.variants[`${r.variant}Hover`]) == null ? void 0 : u[r.color], {
2925
+ backgroundColor: null,
2926
+ // it is not common to change background on hover for Textarea
2927
+ cursor: "text"
2928
+ }),
2929
+ [`&.${wo.disabled}`]: (m = e.variants[`${r.variant}Disabled`]) == null ? void 0 : m[r.color],
2930
+ "&:focus-within::before": {
2931
+ "--Textarea-focused": "1"
2932
+ }
2933
+ }];
2934
+ }), la = N(it, {
2935
+ name: "JoyTextarea",
2936
+ slot: "Textarea",
2937
+ overridesResolver: (e, r) => r.textarea
2938
+ })({
2939
+ resize: "none",
2940
+ border: "none",
2941
+ // remove the native textarea width
2942
+ minWidth: 0,
2943
+ // remove the native textarea width
2944
+ outline: 0,
2945
+ // remove the native textarea outline
2946
+ padding: 0,
2947
+ // remove the native textarea padding
2948
+ paddingInlineEnd: "var(--Textarea-paddingInline)",
2949
+ flex: "auto",
2950
+ alignSelf: "stretch",
2951
+ color: "inherit",
2952
+ backgroundColor: "transparent",
2953
+ fontFamily: "inherit",
2954
+ fontSize: "inherit",
2955
+ fontStyle: "inherit",
2956
+ fontWeight: "inherit",
2957
+ lineHeight: "inherit",
2958
+ "&::-webkit-input-placeholder": {
2959
+ color: "var(--Textarea-placeholderColor)",
2960
+ opacity: "var(--Textarea-placeholderOpacity)"
2961
+ },
2962
+ "&::-moz-placeholder": {
2963
+ // Firefox 19+
2964
+ color: "var(--Textarea-placeholderColor)",
2965
+ opacity: "var(--Textarea-placeholderOpacity)"
2966
+ },
2967
+ "&:-ms-input-placeholder": {
2968
+ // IE11
2969
+ color: "var(--Textarea-placeholderColor)",
2970
+ opacity: "var(--Textarea-placeholderOpacity)"
2971
+ },
2972
+ "&::-ms-input-placeholder": {
2973
+ // Edge
2974
+ color: "var(--Textarea-placeholderColor)",
2975
+ opacity: "var(--Textarea-placeholderOpacity)"
2976
+ }
2977
+ }), ia = N("div", {
2978
+ name: "JoyTextarea",
2979
+ slot: "StartDecorator",
2980
+ overridesResolver: (e, r) => r.startDecorator
2981
+ })({
2982
+ display: "flex",
2983
+ marginInlineStart: "calc(var(--Textarea-paddingBlock) - var(--Textarea-paddingInline))",
2984
+ marginInlineEnd: "var(--Textarea-paddingBlock)",
2985
+ marginBlockEnd: "var(--Textarea-gap)",
2986
+ color: "var(--Textarea-decoratorColor)",
2987
+ cursor: "initial"
2988
+ }), sa = N("div", {
2989
+ name: "JoyTextarea",
2990
+ slot: "EndDecorator",
2991
+ overridesResolver: (e, r) => r.endDecorator
2992
+ })({
2993
+ display: "flex",
2994
+ marginInlineStart: "calc(var(--Textarea-paddingBlock) - var(--Textarea-paddingInline))",
2995
+ marginInlineEnd: "var(--Textarea-paddingBlock)",
2996
+ marginBlockStart: "var(--Textarea-gap)",
2997
+ color: "var(--Textarea-decoratorColor)",
2998
+ cursor: "initial"
2999
+ }), ca = /* @__PURE__ */ p.forwardRef(function(e, r) {
3000
+ var o, n, i, c, u, m, y, x;
3001
+ const C = ze({
3002
+ props: e,
3003
+ name: "JoyTextarea"
3004
+ }), v = Ro(C, wo), {
3005
+ propsToForward: T,
3006
+ rootStateClasses: b,
3007
+ inputStateClasses: z,
3008
+ getRootProps: S,
3009
+ getInputProps: w,
3010
+ formControl: h,
3011
+ focused: D,
3012
+ error: I = !1,
3013
+ disabled: d = !1,
3014
+ size: q = "md",
3015
+ color: B = "neutral",
3016
+ variant: k = "outlined",
3017
+ startDecorator: L,
3018
+ endDecorator: J,
3019
+ minRows: V,
3020
+ maxRows: Q,
3021
+ component: g,
3022
+ slots: O = {},
3023
+ slotProps: _ = {}
3024
+ } = v, G = ue(v, ta), ne = (o = (n = e.disabled) != null ? n : h == null ? void 0 : h.disabled) != null ? o : d, X = (i = (c = e.error) != null ? c : h == null ? void 0 : h.error) != null ? i : I, W = (u = (m = e.size) != null ? m : h == null ? void 0 : h.size) != null ? u : q, he = (y = e.color) != null ? y : X ? "danger" : (x = h == null ? void 0 : h.color) != null ? x : B, se = s({
3025
+ instanceColor: X ? "danger" : e.color
3026
+ }, C, {
3027
+ color: he,
3028
+ disabled: ne,
3029
+ error: X,
3030
+ focused: D,
3031
+ size: W,
3032
+ variant: k
3033
+ }), A = na(se), ce = s({}, G, {
3034
+ component: g,
3035
+ slots: O,
3036
+ slotProps: _
3037
+ }), [Se, ie] = H("root", {
3038
+ ref: r,
3039
+ className: [A.root, b],
3040
+ elementType: aa,
3041
+ externalForwardedProps: ce,
3042
+ getSlotProps: S,
3043
+ ownerState: se
3044
+ }), [ae, ge] = H("textarea", {
3045
+ additionalProps: {
3046
+ id: h == null ? void 0 : h.htmlFor,
3047
+ "aria-describedby": h == null ? void 0 : h["aria-describedby"]
3048
+ },
3049
+ className: [A.textarea, z],
3050
+ elementType: la,
3051
+ internalForwardedProps: s({}, T, {
3052
+ minRows: V,
3053
+ maxRows: Q
3054
+ }),
3055
+ externalForwardedProps: ce,
3056
+ getSlotProps: w,
3057
+ ownerState: se
3058
+ }), [xe, U] = H("startDecorator", {
3059
+ className: A.startDecorator,
3060
+ elementType: ia,
3061
+ externalForwardedProps: ce,
3062
+ ownerState: se
3063
+ }), [K, pe] = H("endDecorator", {
3064
+ className: A.endDecorator,
3065
+ elementType: sa,
3066
+ externalForwardedProps: ce,
3067
+ ownerState: se
3068
+ });
3069
+ return /* @__PURE__ */ t.jsxs(Se, s({}, ie, {
3070
+ children: [L && /* @__PURE__ */ t.jsx(xe, s({}, U, {
3071
+ children: L
3072
+ })), /* @__PURE__ */ t.jsx(ae, s({}, ge)), J && /* @__PURE__ */ t.jsx(K, s({}, pe, {
3073
+ children: J
3074
+ }))]
3075
+ }));
3076
+ });
3077
+ function da(e) {
3078
+ const {
3079
+ sdk: r,
3080
+ fields: o = ["fullName", "email"],
3081
+ campaignId: n = "",
3082
+ campaignName: i = "",
3083
+ contentType: c = "",
3084
+ contentId: u = "",
3085
+ contentName: m = "",
3086
+ syncWithProfile: y = !1
3087
+ } = e, { leadPhoneCountryCode: x, language: C } = mo(vo), [v, T] = p.useState({
3088
+ firstName: "",
3089
+ lastName: "",
3090
+ fullName: "",
3091
+ email: "",
3092
+ gender: "",
3093
+ country: "",
3094
+ phoneCountryCode: x ? Xr(x) : Zr(C || "en"),
3095
+ phoneNumber: "",
3096
+ customFields: {}
3097
+ });
3098
+ p.useEffect(() => {
3099
+ const g = x ? Xr(x) : Zr(C || "en");
3100
+ T((O) => !O.phoneNumber || !O.phoneCountryCode ? { ...O, phoneCountryCode: g } : O);
3101
+ }, [x, C]);
3102
+ const [b, z] = p.useState({}), [S, w] = p.useState(!1), [h, D] = p.useState(!1), [I, d] = p.useState(null), q = () => d(null), B = (g) => (O) => {
3103
+ T((_) => ({
3104
+ ..._,
3105
+ [g]: O.target.value
3106
+ }));
3107
+ }, k = (g) => (O) => {
3108
+ const _ = O.target.value;
3109
+ z((G) => ({ ...G, [g]: _ }));
3110
+ }, L = (g, O) => {
3111
+ T((_) => ({
3112
+ ..._,
3113
+ phoneCountryCode: O
3114
+ }));
3115
+ }, J = (g, O) => {
3116
+ T((_) => ({
3117
+ ..._,
3118
+ country: O || ""
3119
+ }));
3120
+ }, V = (g, O) => {
3121
+ T((_) => ({
3122
+ ..._,
3123
+ gender: O || ""
3124
+ }));
3125
+ }, Q = async () => {
3126
+ if (y)
3127
+ try {
3128
+ const g = r.profile.getOwn();
3129
+ if (v.fullName && o.includes("fullName") ? g.setName(v.fullName.trim()) : v.firstName && o.includes("firstName") && v.lastName && o.includes("lastName") ? g.setName(
3130
+ v.firstName.trim() + " " + v.lastName.trim()
3131
+ ) : v.firstName && o.includes("firstName") ? g.setName(v.firstName.trim()) : v.lastName && o.includes("lastName") && g.setName(v.lastName.trim()), v.email && o.includes("email") && g.setEmail(v.email.trim()), v.gender && o.includes("gender") && g.setGender(v.gender), v.country && o.includes("country")) {
3132
+ const O = await r.profile.getCountries(), _ = jo(v.country), G = O.find((ne) => ne.name === (_ == null ? void 0 : _.label));
3133
+ G && g.setCountry(G.id);
3134
+ }
3135
+ v.phoneCountryCode && o.includes("phoneCountryCode") && g.setPhoneCountryCode(
3136
+ "+" + v.phoneCountryCode.phone
3137
+ ), v.phoneNumber && o.includes("phoneNumber") && g.setPhoneNumber(v.phoneNumber.trim()), await g.update();
3138
+ } catch (g) {
3139
+ console.warn("[LeadForm] Failed to sync profile data:", g);
3140
+ }
3141
+ };
3142
+ return {
3143
+ formData: v,
3144
+ setFormData: T,
3145
+ isLoading: S,
3146
+ isSuccess: h,
3147
+ error: I,
3148
+ clearError: q,
3149
+ handleInputChange: B,
3150
+ handleCustomFieldChange: k,
3151
+ customFieldsData: b,
3152
+ handlePhoneCountryChange: L,
3153
+ handleCountryChange: J,
3154
+ handleGenderChange: V,
3155
+ handleSubmit: async (g) => {
3156
+ var O;
3157
+ g && g.preventDefault(), d(null);
3158
+ const _ = {
3159
+ firstName: v.firstName,
3160
+ lastName: v.lastName,
3161
+ fullName: v.fullName,
3162
+ email: v.email,
3163
+ gender: v.gender,
3164
+ country: v.country,
3165
+ phoneCountryCode: "+" + (((O = v.phoneCountryCode) == null ? void 0 : O.phone) ?? ""),
3166
+ phoneNumber: v.phoneNumber,
3167
+ campaignId: n,
3168
+ campaignName: i,
3169
+ contentType: c,
3170
+ contentId: u,
3171
+ contentName: m,
3172
+ customFields: b
3173
+ }, G = [
3174
+ "firstName",
3175
+ "lastName",
3176
+ "fullName",
3177
+ "email",
3178
+ "gender",
3179
+ "country",
3180
+ "phoneCountryCode",
3181
+ "phoneNumber",
3182
+ "customFields"
3183
+ ], ne = Object.fromEntries(
3184
+ Object.entries(_).map(([X, W]) => G.includes(X) ? X === "customFields" ? [X, W] : o.includes(X) && W !== "" && W !== null ? [X, W] : [X, null] : [X, W])
3185
+ );
3186
+ w(!0);
3187
+ try {
3188
+ await r.profile.collectLead(ne), await Q(), D(!0);
3189
+ } catch {
3190
+ d("leads.form.error");
3191
+ } finally {
3192
+ w(!1);
3193
+ }
3194
+ },
3195
+ countries: Do
3196
+ };
3197
+ }
3198
+ const ua = (e) => {
3199
+ const r = Jr(), { t: o } = _r();
3200
+ if (!e.brandingUrls)
3201
+ return /* @__PURE__ */ t.jsx(t.Fragment, {});
3202
+ const { privacyPolicyUrl: n, termsAndConditionsUrl: i } = e.brandingUrls;
3203
+ if (!n && !i)
3204
+ return /* @__PURE__ */ t.jsx(t.Fragment, {});
3205
+ const c = () => n && !i ? /* @__PURE__ */ t.jsxs(Ae, { children: [
3206
+ o("common.labels.iAgreeToThe"),
3207
+ " ",
3208
+ /* @__PURE__ */ t.jsx(
3209
+ sr,
3210
+ {
3211
+ href: n,
3212
+ target: "_blank",
3213
+ rel: "noopener noreferrer",
3214
+ sx: {
3215
+ color: e.primaryColor,
3216
+ textDecorationColor: e.primaryColor
3217
+ },
3218
+ children: o("leads.form.privacyPolicy")
3219
+ }
3220
+ )
3221
+ ] }) : !n && i ? /* @__PURE__ */ t.jsxs(Ae, { children: [
3222
+ o("common.labels.iAgreeToThe"),
3223
+ " ",
3224
+ /* @__PURE__ */ t.jsx(
3225
+ sr,
3226
+ {
3227
+ href: i,
3228
+ target: "_blank",
3229
+ rel: "noopener noreferrer",
3230
+ sx: {
3231
+ color: e.primaryColor,
3232
+ textDecorationColor: e.primaryColor
3233
+ },
3234
+ children: o("leads.form.termsAndConditions")
3235
+ }
3236
+ )
3237
+ ] }) : /* @__PURE__ */ t.jsxs(Ae, { children: [
3238
+ o("common.labels.iAgreeToThe"),
3239
+ " ",
3240
+ /* @__PURE__ */ t.jsx(
3241
+ sr,
3242
+ {
3243
+ href: n,
3244
+ target: "_blank",
3245
+ rel: "noopener noreferrer",
3246
+ sx: {
3247
+ color: e.primaryColor,
3248
+ textDecorationColor: e.primaryColor
3249
+ },
3250
+ children: o("leads.form.privacyPolicy")
3251
+ }
3252
+ ),
3253
+ " ",
3254
+ o("common.labels.andThe"),
3255
+ " ",
3256
+ /* @__PURE__ */ t.jsx(
3257
+ sr,
3258
+ {
3259
+ href: i,
3260
+ target: "_blank",
3261
+ rel: "noopener noreferrer",
3262
+ sx: {
3263
+ color: e.primaryColor,
3264
+ textDecorationColor: e.primaryColor
3265
+ },
3266
+ children: o("leads.form.termsAndConditions")
3267
+ }
3268
+ )
3269
+ ] });
3270
+ return /* @__PURE__ */ t.jsx(Be, { required: !0, disabled: e.isDisabled, size: "sm", children: /* @__PURE__ */ t.jsxs(cr, { sx: { display: "inline-flex", alignItems: "center", gap: "8px" }, children: [
3271
+ /* @__PURE__ */ t.jsx(
3272
+ ko,
3273
+ {
3274
+ slotProps: {
3275
+ input: {
3276
+ sx: {}
3277
+ },
3278
+ checkbox: {
3279
+ sx: {
3280
+ "&.Mui-checked": {
3281
+ bgcolor: e.primaryColor,
3282
+ "--Icon-color": "#FFF"
3283
+ },
3284
+ "&:not(.Mui-checked):not(.Mui-disabled):hover": {
3285
+ bgcolor: r.colorSchemes.light.palette.neutral.outlinedHoverBg
3286
+ },
3287
+ bgcolor: r.colorSchemes.light.palette.background.surface
3288
+ }
3289
+ }
3290
+ }
3291
+ }
3292
+ ),
3293
+ c()
3294
+ ] }) });
3295
+ }, pa = (e) => {
3296
+ const { consents: r, isDisabled: o, primaryColor: n, brandingUrls: i, labels: c, onChange: u } = e, m = Jr(), { t: y } = _r(), [x, C] = p.useState({}), v = (b) => (z) => {
3297
+ const S = { ...x, [b]: z.target.checked };
3298
+ C(S), u == null || u(S);
3299
+ }, T = (b) => {
3300
+ const z = [], S = /\{\{(privacyPolicyUrl|termsAndConditionsUrl)\}\}/g;
3301
+ let w = 0, h;
3302
+ for (; (h = S.exec(b)) !== null; ) {
3303
+ const I = b.slice(w, h.index);
3304
+ I && z.push(
3305
+ /* @__PURE__ */ t.jsx(Ae, { component: "span", children: I }, `text-${w}`)
3306
+ );
3307
+ const d = h[1], q = i == null ? void 0 : i[d], B = d === "privacyPolicyUrl" ? (c == null ? void 0 : c.privacyPolicyUrlLabel) || y("leads.form.privacyPolicy") : (c == null ? void 0 : c.termsAndConditionsUrlLabel) || y("leads.form.termsAndConditions");
3308
+ q ? z.push(
3309
+ /* @__PURE__ */ t.jsx(
3310
+ sr,
3311
+ {
3312
+ href: q,
3313
+ target: "_blank",
3314
+ rel: "noopener noreferrer",
3315
+ sx: { color: n, textDecorationColor: n },
3316
+ children: B
3317
+ },
3318
+ `link-${z.length}`
3319
+ )
3320
+ ) : (console.warn(
3321
+ `[CollectLead] Consent label contains {{${d}}} but branding.urls.${d} is not provided.`
3322
+ ), z.push(
3323
+ /* @__PURE__ */ t.jsx(Ae, { component: "span", children: B }, `plain-${z.length}`)
3324
+ )), w = S.lastIndex;
3325
+ }
3326
+ const D = b.slice(w);
3327
+ return D && z.push(
3328
+ /* @__PURE__ */ t.jsx(Ae, { component: "span", children: D }, "text-after")
3329
+ ), /* @__PURE__ */ t.jsx(Ae, { component: "span", children: z });
3330
+ };
3331
+ return /* @__PURE__ */ t.jsx(Wr, { spacing: 1, children: r.map((b) => /* @__PURE__ */ t.jsx(
3332
+ Be,
3333
+ {
3334
+ disabled: o,
3335
+ size: "sm",
3336
+ children: /* @__PURE__ */ t.jsxs(
3337
+ cr,
3338
+ {
3339
+ sx: { display: "inline-flex", alignItems: "center", gap: "8px" },
3340
+ children: [
3341
+ /* @__PURE__ */ t.jsx(
3342
+ ko,
3343
+ {
3344
+ checked: !!x[b.id],
3345
+ onChange: v(b.id),
3346
+ slotProps: {
3347
+ checkbox: {
3348
+ sx: {
3349
+ "&.Mui-checked": {
3350
+ bgcolor: n,
3351
+ "--Icon-color": "#FFF"
3352
+ },
3353
+ "&:not(.Mui-checked):not(.Mui-disabled):hover": {
3354
+ bgcolor: m.colorSchemes.light.palette.neutral.outlinedHoverBg
3355
+ },
3356
+ bgcolor: m.colorSchemes.light.palette.background.surface
3357
+ }
3358
+ }
3359
+ }
3360
+ }
3361
+ ),
3362
+ T(b.label)
3363
+ ]
3364
+ }
3365
+ )
3366
+ },
3367
+ `consent-${b.id}`
3368
+ )) });
3369
+ }, ma = [
3370
+ "fullName",
3371
+ "firstName",
3372
+ "lastName",
3373
+ "email",
3374
+ "gender",
3375
+ "country",
3376
+ "phoneCountryCode",
3377
+ "phoneNumber"
3378
+ ], Ke = {
3379
+ phoneContainer: { display: "flex", gap: 1 },
3380
+ countrySelect: { width: "45%" },
3381
+ phoneInput: { width: "100%" },
3382
+ listItemContent: { fontSize: "sm" },
3383
+ submitButton: { mt: 2 }
3384
+ }, va = (e) => {
3385
+ var r, o, n, i, c, u;
3386
+ const [m, y] = p.useState({}), {
3387
+ sdk: x,
3388
+ brandingColors: C,
3389
+ brandingUrls: v,
3390
+ fields: T = ["fullName", "email"],
3391
+ campaignId: b = "",
3392
+ campaignName: z = "",
3393
+ contentType: S = "",
3394
+ contentId: w = "",
3395
+ contentName: h = "",
3396
+ formCustomFields: D,
3397
+ onSuccessCta: I,
3398
+ labels: d,
3399
+ syncWithProfile: q = !1,
3400
+ isSubmittingParticipation: B = !1
3401
+ } = e, k = T.map(($) => $ && $.trim()).filter(($) => ma.includes($)), {
3402
+ formData: L,
3403
+ isLoading: J,
3404
+ isSuccess: V,
3405
+ error: Q,
3406
+ handleInputChange: g,
3407
+ handleCustomFieldChange: O,
3408
+ customFieldsData: _,
3409
+ handlePhoneCountryChange: G,
3410
+ handleCountryChange: ne,
3411
+ handleGenderChange: X,
3412
+ handleSubmit: W,
3413
+ countries: he
3414
+ } = da({
3415
+ sdk: x,
3416
+ fields: k,
3417
+ campaignId: b,
3418
+ campaignName: z,
3419
+ contentType: S,
3420
+ contentId: w,
3421
+ contentName: h,
3422
+ syncWithProfile: q
3423
+ }), { shadowRootElement: se } = mo(vo), { t: A } = _r(), ce = Jr(), Se = uo(), ie = zo(), ae = po().primary, ge = Se.textPrimary, xe = (C == null ? void 0 : C.primaryColor) || ((o = (r = Se.palette) == null ? void 0 : r.primary) == null ? void 0 : o.plainColor), U = (i = (n = Se.palette) == null ? void 0 : n.primary) == null ? void 0 : i.onPrimary, K = (C == null ? void 0 : C.primaryColor) || ((u = (c = Se.palette) == null ? void 0 : c.primary) == null ? void 0 : u.primaryContainer), pe = ie.sm, R = {
3424
+ background: {
3425
+ surface: ce.colorSchemes.light.palette.background.surface,
3426
+ popup: ce.colorSchemes.light.palette.background.popup
3427
+ },
3428
+ neutral: {
3429
+ outlinedBorder: ce.colorSchemes.light.palette.neutral.outlinedBorder,
3430
+ outlinedColor: ce.colorSchemes.light.palette.neutral.outlinedColor,
3431
+ outlinedHoverBg: ce.colorSchemes.light.palette.neutral.outlinedHoverBg,
3432
+ plainActiveBg: ce.colorSchemes.light.palette.neutral.plainActiveBg,
3433
+ plainHoverBg: ce.colorSchemes.light.palette.neutral.plainHoverBg,
3434
+ plainHoverColor: ce.colorSchemes.light.palette.neutral.plainHoverColor
3435
+ }
3436
+ }, de = [
3437
+ { value: "male", label: A("leads.form.genderOptions.male") },
3438
+ { value: "female", label: A("leads.form.genderOptions.female") },
3439
+ { value: "other", label: A("leads.form.genderOptions.other") },
3440
+ { value: "prefer_not_to_say", label: A("leads.form.genderOptions.notSay") }
3441
+ ], Ce = {
3442
+ color: `${ge} !important`,
3443
+ fontSize: "0.875em"
3444
+ }, Z = {
3445
+ fontFamily: ae,
3446
+ borderRadius: pe,
3447
+ bgcolor: R.background.surface,
3448
+ borderColor: R.neutral.outlinedBorder,
3449
+ color: R.neutral.outlinedColor,
3450
+ fontSize: "1em",
3451
+ lineHeight: "2.25em",
3452
+ "&:hover": {
3453
+ bgcolor: R.neutral.outlinedHoverBg
3454
+ },
3455
+ "&.Mui-disabled": {
3456
+ borderColor: R.neutral.outlinedBorder
3457
+ },
3458
+ "& input:-webkit-autofill": {
3459
+ WebkitBoxShadow: `0 0 0 1000px ${R.background.surface} inset !important`,
3460
+ WebkitTextFillColor: `${R.neutral.outlinedColor} !important`,
3461
+ caretColor: R.neutral.outlinedColor,
3462
+ borderRadius: pe
3463
+ },
3464
+ "& input:-webkit-autofill:hover": {
3465
+ WebkitBoxShadow: `0 0 0 1000px ${R.background.surface} inset !important`,
3466
+ WebkitTextFillColor: `${R.neutral.outlinedColor} !important`
3467
+ },
3468
+ "& input:-webkit-autofill:focus": {
3469
+ WebkitBoxShadow: `0 0 0 1000px ${R.background.surface} inset !important`,
3470
+ WebkitTextFillColor: `${R.neutral.outlinedColor} !important`
3471
+ },
3472
+ "& input:-webkit-autofill:active": {
3473
+ WebkitBoxShadow: `0 0 0 1000px ${R.background.surface} inset !important`,
3474
+ WebkitTextFillColor: `${R.neutral.outlinedColor} !important`
3475
+ },
3476
+ "& input:-moz-autofill": {
3477
+ backgroundColor: `${R.background.surface} !important`,
3478
+ color: `${R.neutral.outlinedColor} !important`
3479
+ },
3480
+ "& input:autofill": {
3481
+ backgroundColor: `${R.background.surface} !important`,
3482
+ color: `${R.neutral.outlinedColor} !important`
3483
+ }
3484
+ }, le = {
3485
+ root: {
3486
+ sx: {
3487
+ ...Z,
3488
+ "&:hover": { bgcolor: R.neutral.outlinedHoverBg }
3489
+ }
3490
+ },
3491
+ listbox: {
3492
+ container: se,
3493
+ sx: {
3494
+ zIndex: 10,
3495
+ bgcolor: R.background.popup,
3496
+ border: `1px solid ${R.neutral.outlinedBorder}`,
3497
+ borderRadius: pe,
3498
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
3499
+ }
3500
+ }
3501
+ }, P = {
3502
+ fontFamily: ae,
3503
+ color: `${R.neutral.outlinedColor} !important`,
3504
+ bgcolor: "transparent",
3505
+ "&:hover": {
3506
+ bgcolor: `${R.neutral.plainHoverBg} !important`,
3507
+ color: `${R.neutral.plainHoverColor} !important`
3508
+ },
3509
+ "&.Mui-selected": {
3510
+ bgcolor: `${R.neutral.plainActiveBg} !important`,
3511
+ color: `${R.neutral.outlinedColor} !important`
3512
+ },
3513
+ "&.Mui-selected:hover": {
3514
+ bgcolor: `${R.neutral.plainActiveBg} !important`,
3515
+ color: `${R.neutral.outlinedColor} !important`
3516
+ }
3517
+ }, Ie = (d == null ? void 0 : d.fullNameLabel) || A("leads.form.fullName"), M = (d == null ? void 0 : d.fullNamePlaceholder) || A("leads.form.fullNamePlaceholder"), Fe = (d == null ? void 0 : d.firstNameLabel) || A("leads.form.firstName"), Ne = (d == null ? void 0 : d.firstNamePlaceholder) || A("leads.form.firstNamePlaceholder"), _e = (d == null ? void 0 : d.lastNameLabel) || A("leads.form.lastName"), je = (d == null ? void 0 : d.lastNamePlaceholder) || A("leads.form.lastNamePlaceholder"), ke = (d == null ? void 0 : d.emailLabel) || A("leads.form.email"), Ye = (d == null ? void 0 : d.genderLabel) || A("leads.form.gender"), nr = (d == null ? void 0 : d.genderPlaceholder) || A("leads.form.genderPlaceholder"), Me = (d == null ? void 0 : d.countryLabel) || A("leads.form.country"), er = (d == null ? void 0 : d.countryPlaceholder) || A("leads.form.countryPlaceholder"), me = (d == null ? void 0 : d.phoneNumberLabel) || A("leads.form.phone"), Y = (d == null ? void 0 : d.phoneNumberPlaceholder) || A("leads.form.phonePlaceholder"), Te = ($) => {
3518
+ const ee = (d == null ? void 0 : d.privacyPolicyUrlLabel) || "Privacy Policy", He = (d == null ? void 0 : d.termsAndConditionsUrlLabel) || "Terms and Conditions";
3519
+ return $.replace(/\{\{privacyPolicyUrl\}\}/g, ee).replace(/\{\{termsAndConditionsUrl\}\}/g, He);
3520
+ }, Oe = ($) => {
3521
+ y($);
3522
+ }, Je = async ($) => {
3523
+ await W($);
3524
+ try {
3525
+ const ee = (e.consents || []).filter(
3526
+ (He) => m[He.id]
3527
+ );
3528
+ if (ee.length > 0) {
3529
+ const He = ee.map((We) => {
3530
+ const Ee = {
3531
+ consentId: We.id,
3532
+ content: Te(We.label)
3533
+ };
3534
+ w && (Ee.entityId = w);
3535
+ const oe = Lo(S);
3536
+ return oe && (Ee.entityType = oe), Ee;
3537
+ });
3538
+ await x.profile.collectConsents(He);
3539
+ }
3540
+ } catch (ee) {
3541
+ console.warn("[CollectLead] Failed to collect consents", ee);
3542
+ }
3543
+ }, ar = () => I != null && I.component ? I.component : I != null && I.onClick ? /* @__PURE__ */ t.jsx(
3544
+ Hr,
3545
+ {
3546
+ size: "lg",
3547
+ loading: B,
3548
+ sx: {
3549
+ ...Ke.submitButton,
3550
+ bgcolor: xe,
3551
+ color: U,
3552
+ ":hover": {
3553
+ bgcolor: K,
3554
+ color: U
3555
+ },
3556
+ fontSize: "1em"
3557
+ },
3558
+ onClick: I.onClick,
3559
+ children: I.defaultLabel
3560
+ }
3561
+ ) : I != null && I.url ? typeof window > "u" ? /* @__PURE__ */ t.jsx(
3562
+ cr,
3563
+ {
3564
+ component: "a",
3565
+ href: I.url,
3566
+ target: (I == null ? void 0 : I.target) || "_self",
3567
+ sx: {
3568
+ ...Ke.submitButton,
3569
+ bgcolor: xe,
3570
+ color: U,
3571
+ ":hover": {
3572
+ bgcolor: K,
3573
+ color: U
3574
+ },
3575
+ fontSize: "1em",
3576
+ textDecoration: "none",
3577
+ display: "inline-flex",
3578
+ alignItems: "center",
3579
+ justifyContent: "center"
3580
+ },
3581
+ children: I.defaultLabel
3582
+ }
3583
+ ) : /* @__PURE__ */ t.jsx(
3584
+ Hr,
3585
+ {
3586
+ size: "lg",
3587
+ sx: {
3588
+ ...Ke.submitButton,
3589
+ bgcolor: xe,
3590
+ color: U,
3591
+ ":hover": {
3592
+ bgcolor: K,
3593
+ color: U
3594
+ },
3595
+ fontSize: "1em"
3596
+ },
3597
+ onClick: () => {
3598
+ (I == null ? void 0 : I.target) === "_blank" ? window.open(I == null ? void 0 : I.url, "_blank") : window.location.href = I == null ? void 0 : I.url;
3599
+ },
3600
+ children: I.defaultLabel
3601
+ }
3602
+ ) : /* @__PURE__ */ t.jsx(t.Fragment, {});
3603
+ return /* @__PURE__ */ t.jsx("form", { onSubmit: Je, children: /* @__PURE__ */ t.jsxs(Wr, { spacing: 2, sx: { fontFamily: ae }, children: [
3604
+ k.includes("fullName") && /* @__PURE__ */ t.jsxs(Be, { required: !0, disabled: V, children: [
3605
+ /* @__PURE__ */ t.jsx(Ue, { sx: Ce, children: Ie }),
3606
+ /* @__PURE__ */ t.jsx(
3607
+ rr,
3608
+ {
3609
+ value: L.fullName,
3610
+ onChange: g("fullName"),
3611
+ placeholder: M,
3612
+ sx: Z
3613
+ }
3614
+ )
3615
+ ] }),
3616
+ k.includes("firstName") && /* @__PURE__ */ t.jsxs(Be, { required: !0, disabled: V, children: [
3617
+ /* @__PURE__ */ t.jsx(Ue, { sx: Ce, children: Fe }),
3618
+ /* @__PURE__ */ t.jsx(
3619
+ rr,
3620
+ {
3621
+ value: L.firstName,
3622
+ onChange: g("firstName"),
3623
+ placeholder: Ne,
3624
+ sx: Z
3625
+ }
3626
+ )
3627
+ ] }),
3628
+ k.includes("lastName") && /* @__PURE__ */ t.jsxs(Be, { required: !0, disabled: V, children: [
3629
+ /* @__PURE__ */ t.jsx(Ue, { sx: Ce, children: _e }),
3630
+ /* @__PURE__ */ t.jsx(
3631
+ rr,
3632
+ {
3633
+ value: L.lastName,
3634
+ onChange: g("lastName"),
3635
+ placeholder: je,
3636
+ sx: Z
3637
+ }
3638
+ )
3639
+ ] }),
3640
+ k.includes("email") && /* @__PURE__ */ t.jsxs(Be, { required: !0, disabled: V, children: [
3641
+ /* @__PURE__ */ t.jsx(Ue, { sx: Ce, children: ke }),
3642
+ /* @__PURE__ */ t.jsx(
3643
+ rr,
3644
+ {
3645
+ type: "email",
3646
+ value: L.email,
3647
+ onChange: g("email"),
3648
+ placeholder: "your.email@example.com",
3649
+ sx: Z
3650
+ }
3651
+ )
3652
+ ] }),
3653
+ k.includes("gender") && /* @__PURE__ */ t.jsxs(Be, { disabled: V, children: [
3654
+ /* @__PURE__ */ t.jsx(Ue, { sx: Ce, children: Ye }),
3655
+ /* @__PURE__ */ t.jsx(
3656
+ Ur,
3657
+ {
3658
+ value: L.gender,
3659
+ onChange: X,
3660
+ placeholder: nr,
3661
+ slotProps: le,
3662
+ children: de.map(($) => /* @__PURE__ */ t.jsx(
3663
+ Kr,
3664
+ {
3665
+ value: $.value,
3666
+ sx: P,
3667
+ children: $.label
3668
+ },
3669
+ $.value
3670
+ ))
3671
+ }
3672
+ )
3673
+ ] }),
3674
+ k.includes("country") && /* @__PURE__ */ t.jsxs(Be, { required: !0, disabled: V, children: [
3675
+ /* @__PURE__ */ t.jsx(Ue, { sx: Ce, children: Me }),
3676
+ /* @__PURE__ */ t.jsx(
3677
+ Ur,
3678
+ {
3679
+ value: L.country,
3680
+ onChange: ne,
3681
+ placeholder: er,
3682
+ slotProps: le,
3683
+ children: he.map(($) => /* @__PURE__ */ t.jsx(
3684
+ Kr,
3685
+ {
3686
+ value: $.code,
3687
+ sx: P,
3688
+ children: $.label
3689
+ },
3690
+ `${$.code}-${$.label}`
3691
+ ))
3692
+ }
3693
+ )
3694
+ ] }),
3695
+ (k.includes("phoneCountryCode") || k.includes("phoneNumber")) && /* @__PURE__ */ t.jsxs(Be, { required: !0, disabled: V, children: [
3696
+ /* @__PURE__ */ t.jsx(Ue, { sx: Ce, children: me }),
3697
+ /* @__PURE__ */ t.jsxs(cr, { sx: Ke.phoneContainer, children: [
3698
+ k.includes("phoneCountryCode") && /* @__PURE__ */ t.jsx(
3699
+ gn,
3700
+ {
3701
+ value: L.phoneCountryCode,
3702
+ onChange: G,
3703
+ slotProps: {
3704
+ input: { autoComplete: "new-phone-country-code" },
3705
+ listbox: le.listbox,
3706
+ root: le.root,
3707
+ clearIndicator: {
3708
+ sx: {
3709
+ "&:hover": {
3710
+ bgcolor: R.neutral.plainHoverBg,
3711
+ color: R.neutral.plainHoverColor
3712
+ }
3713
+ }
3714
+ },
3715
+ popupIndicator: {
3716
+ sx: {
3717
+ "&:hover": {
3718
+ bgcolor: R.neutral.plainHoverBg,
3719
+ color: R.neutral.plainHoverColor
3720
+ }
3721
+ }
3722
+ }
3723
+ },
3724
+ sx: Ke.countrySelect,
3725
+ options: he,
3726
+ autoHighlight: !0,
3727
+ getOptionLabel: ($) => `+${$.phone}`,
3728
+ renderOption: ($, ee) => /* @__PURE__ */ p.createElement(
3729
+ qt,
3730
+ {
3731
+ ...$,
3732
+ key: `autocomplete-${ee.code}-${ee.label}`,
3733
+ sx: {
3734
+ ...P,
3735
+ "&[aria-selected='true']": {
3736
+ bgcolor: R.neutral.plainActiveBg
3737
+ }
3738
+ }
3739
+ },
3740
+ /* @__PURE__ */ t.jsx(ra, { children: /* @__PURE__ */ t.jsx(
3741
+ "img",
3742
+ {
3743
+ loading: "lazy",
3744
+ width: "20",
3745
+ srcSet: `https://flagcdn.com/w40/${ee.code.toLowerCase()}.png 2x`,
3746
+ src: `https://flagcdn.com/w20/${ee.code.toLowerCase()}.png`,
3747
+ alt: ""
3748
+ }
3749
+ ) }),
3750
+ /* @__PURE__ */ t.jsxs(Qn, { sx: Ke.listItemContent, children: [
3751
+ ee.label,
3752
+ /* @__PURE__ */ t.jsxs(Ae, { level: "body-xs", children: [
3753
+ "+",
3754
+ ee.phone
3755
+ ] })
3756
+ ] })
3757
+ )
3758
+ }
3759
+ ),
3760
+ k.includes("phoneNumber") && /* @__PURE__ */ t.jsx(
3761
+ rr,
3762
+ {
3763
+ value: L.phoneNumber,
3764
+ onChange: g("phoneNumber"),
3765
+ placeholder: Y,
3766
+ sx: {
3767
+ ...Ke.phoneInput,
3768
+ ...Z
3769
+ }
3770
+ }
3771
+ )
3772
+ ] })
3773
+ ] }),
3774
+ D && D.length > 0 ? D.map(($, ee) => /* @__PURE__ */ t.jsxs(
3775
+ Be,
3776
+ {
3777
+ disabled: V,
3778
+ required: $.required || !1,
3779
+ children: [
3780
+ /* @__PURE__ */ t.jsx(Ue, { sx: Ce, children: $.label }),
3781
+ $.type === "textarea" ? /* @__PURE__ */ t.jsx(
3782
+ ca,
3783
+ {
3784
+ value: _[$.key] || "",
3785
+ onChange: O($.key),
3786
+ placeholder: $.placeholder || "",
3787
+ sx: Z,
3788
+ minRows: 3
3789
+ }
3790
+ ) : /* @__PURE__ */ t.jsx(
3791
+ rr,
3792
+ {
3793
+ value: _[$.key] || "",
3794
+ onChange: O($.key),
3795
+ placeholder: $.placeholder,
3796
+ sx: Z
3797
+ }
3798
+ )
3799
+ ]
3800
+ },
3801
+ `custom-field-${$.key}-${ee}`
3802
+ )) : null,
3803
+ e.consents && e.consents.length > 0 ? /* @__PURE__ */ t.jsx(
3804
+ pa,
3805
+ {
3806
+ consents: e.consents,
3807
+ isDisabled: V,
3808
+ primaryColor: xe,
3809
+ brandingUrls: v,
3810
+ labels: d,
3811
+ onChange: Oe
3812
+ }
3813
+ ) : /* @__PURE__ */ t.jsx(
3814
+ ua,
3815
+ {
3816
+ primaryColor: xe,
3817
+ brandingUrls: v,
3818
+ isDisabled: V
3819
+ }
3820
+ ),
3821
+ Q && /* @__PURE__ */ t.jsx(Qr, { variant: "error", message: A(Q) }),
3822
+ V ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
3823
+ d != null && d.successTitle || d != null && d.successDescription ? /* @__PURE__ */ t.jsx(
3824
+ Qr,
3825
+ {
3826
+ variant: "success",
3827
+ title: d == null ? void 0 : d.successTitle,
3828
+ description: d == null ? void 0 : d.successDescription
3829
+ }
3830
+ ) : /* @__PURE__ */ t.jsx(t.Fragment, {}),
3831
+ ar()
3832
+ ] }) : /* @__PURE__ */ t.jsx(
3833
+ Hr,
3834
+ {
3835
+ type: "submit",
3836
+ loading: J,
3837
+ size: "lg",
3838
+ sx: {
3839
+ ...Ke.submitButton,
3840
+ bgcolor: xe,
3841
+ color: U,
3842
+ ":hover": { bgcolor: K, color: U },
3843
+ fontSize: "0.8125em"
3844
+ },
3845
+ children: d == null ? void 0 : d.submitButtonLabel
3846
+ }
3847
+ )
3848
+ ] }) });
3849
+ }, fa = ({
3850
+ sdk: e,
3851
+ content: r,
3852
+ campaign: o,
3853
+ branding: n,
3854
+ fields: i = ["fullName", "email"],
3855
+ labels: c,
3856
+ onSuccessCta: u,
3857
+ customFields: m,
3858
+ consents: y,
3859
+ syncWithProfile: x = !1,
3860
+ isSubmittingParticipation: C = !1
3861
+ }) => {
3862
+ var v;
3863
+ const T = uo(), b = T.textColor, z = ((v = n == null ? void 0 : n.colors) == null ? void 0 : v.secondaryColor) || T.textColor, S = po().primary, w = i.map((h) => h && h.trim());
3864
+ return /* @__PURE__ */ t.jsxs(Wr, { spacing: 2, zIndex: 10, width: "100%", children: [
3865
+ c != null && c.title || c != null && c.description ? /* @__PURE__ */ t.jsxs(cr, { children: [
3866
+ c != null && c.title ? /* @__PURE__ */ t.jsx(
3867
+ Ae,
3868
+ {
3869
+ level: "h4",
3870
+ sx: {
3871
+ fontFamily: S,
3872
+ color: b,
3873
+ fontSize: "1.25em"
3874
+ },
3875
+ children: c.title
3876
+ }
3877
+ ) : /* @__PURE__ */ t.jsx(t.Fragment, {}),
3878
+ c != null && c.description ? /* @__PURE__ */ t.jsx(
3879
+ Ae,
3880
+ {
3881
+ level: "body-sm",
3882
+ sx: {
3883
+ fontFamily: S,
3884
+ color: z,
3885
+ opacity: 0.6,
3886
+ fontSize: "0.875em"
3887
+ },
3888
+ children: c == null ? void 0 : c.description
3889
+ }
3890
+ ) : /* @__PURE__ */ t.jsx(t.Fragment, {})
3891
+ ] }) : /* @__PURE__ */ t.jsx(t.Fragment, {}),
3892
+ /* @__PURE__ */ t.jsx(
3893
+ va,
3894
+ {
3895
+ sdk: e,
3896
+ brandingColors: n == null ? void 0 : n.colors,
3897
+ brandingUrls: n == null ? void 0 : n.urls,
3898
+ campaignId: o == null ? void 0 : o.id,
3899
+ campaignName: o == null ? void 0 : o.name,
3900
+ contentName: r == null ? void 0 : r.name,
3901
+ contentType: r == null ? void 0 : r.type,
3902
+ contentId: r == null ? void 0 : r.id,
3903
+ onSuccessCta: u,
3904
+ fields: w,
3905
+ labels: c,
3906
+ formCustomFields: m,
3907
+ consents: y,
3908
+ syncWithProfile: x,
3909
+ isSubmittingParticipation: C
3910
+ }
3911
+ )
3912
+ ] });
3913
+ };
3914
+ export {
3915
+ Be as H,
3916
+ ko as e,
3917
+ fa as w
3918
+ };