tguikit 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,89 +1,420 @@
1
1
  "use client";
2
- import { clsx as e } from "clsx";
3
- import { cva as t } from "class-variance-authority";
4
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
- import { Children as i, Fragment as a, createContext as o, isValidElement as s, useCallback as c, useContext as l, useEffect as u, useMemo as d, useRef as f, useState as p, useSyncExternalStore as m } from "react";
2
+ import { Children as e, Fragment as t, createContext as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as f } from "react";
3
+ import { clsx as p } from "clsx";
4
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
5
+ import { cva as _ } from "class-variance-authority";
6
+ import { createPortal as v } from "react-dom";
6
7
  //#region src/shared/lib/cn.ts
7
- function h(...t) {
8
- return e(t);
8
+ function y(...e) {
9
+ return p(e);
9
10
  }
10
- var g = {
11
+ var b = {
12
+ accordion: "_accordion_1bhfn_1",
13
+ item: "_item_1bhfn_6",
14
+ header: "_header_1bhfn_14",
15
+ title: "_title_1bhfn_31",
16
+ chevron: "_chevron_1bhfn_36",
17
+ panel: "_panel_1bhfn_59",
18
+ "panel--open": "_panel--open_1bhfn_70",
19
+ panelInner: "_panelInner_1bhfn_74",
20
+ panelContent: "_panelContent_1bhfn_78"
21
+ }, x = n(null);
22
+ x.displayName = "AccordionContext";
23
+ //#endregion
24
+ //#region src/components/Accordion/Accordion.tsx
25
+ var S = (e) => e == null ? [] : Array.isArray(e) ? e : [e];
26
+ function C({ ref: e, multiple: t = !1, value: n, defaultValue: r, onChange: a, className: o, children: s, ...c }) {
27
+ let [u, f] = d(() => S(r)), p = n == null ? u : S(n), m = i((e) => {
28
+ let r = p.includes(e) ? p.filter((t) => t !== e) : t ? [...p, e] : [e];
29
+ n ?? f(r), a?.(r);
30
+ }, [
31
+ p,
32
+ t,
33
+ n,
34
+ a
35
+ ]), g = l(() => ({
36
+ open: p,
37
+ toggle: m
38
+ }), [p, m]);
39
+ return /* @__PURE__ */ h(x.Provider, {
40
+ value: g,
41
+ children: /* @__PURE__ */ h("div", {
42
+ ref: e,
43
+ className: y(b.accordion, o),
44
+ ...c,
45
+ children: s
46
+ })
47
+ });
48
+ }
49
+ C.displayName = "Accordion";
50
+ //#endregion
51
+ //#region src/components/Accordion/AccordionItem.tsx
52
+ function w({ ref: e, value: t, header: n, className: r, children: i, ...o }) {
53
+ let c = a(x);
54
+ if (!c) throw Error("AccordionItem must be used within an <Accordion>.");
55
+ let l = s(), u = c.open.includes(t);
56
+ return /* @__PURE__ */ g("div", {
57
+ ref: e,
58
+ className: y(b.item, r),
59
+ ...o,
60
+ children: [/* @__PURE__ */ g("button", {
61
+ type: "button",
62
+ className: b.header,
63
+ "aria-expanded": u,
64
+ "aria-controls": l,
65
+ onClick: () => c.toggle(t),
66
+ children: [/* @__PURE__ */ h("span", {
67
+ className: b.title,
68
+ children: n
69
+ }), /* @__PURE__ */ h("svg", {
70
+ className: b.chevron,
71
+ viewBox: "0 0 18 18",
72
+ fill: "none",
73
+ "aria-hidden": !0,
74
+ children: /* @__PURE__ */ h("path", {
75
+ d: "M4.5 7l4.5 4.5L13.5 7",
76
+ stroke: "currentColor",
77
+ strokeWidth: "1.8",
78
+ strokeLinecap: "round",
79
+ strokeLinejoin: "round"
80
+ })
81
+ })]
82
+ }), /* @__PURE__ */ h("div", {
83
+ className: y(b.panel, u && b["panel--open"]),
84
+ children: /* @__PURE__ */ h("div", {
85
+ className: b.panelInner,
86
+ children: /* @__PURE__ */ h("div", {
87
+ id: l,
88
+ className: b.panelContent,
89
+ inert: !u,
90
+ "aria-hidden": !u,
91
+ children: i
92
+ })
93
+ })
94
+ })]
95
+ });
96
+ }
97
+ w.displayName = "AccordionItem";
98
+ var T = {
99
+ avatar: "_avatar_lii18_1",
100
+ s20: "_s20_lii18_18",
101
+ s24: "_s24_lii18_24",
102
+ s28: "_s28_lii18_30",
103
+ s40: "_s40_lii18_36",
104
+ s48: "_s48_lii18_42",
105
+ s96: "_s96_lii18_48",
106
+ img: "_img_lii18_54",
107
+ acronym: "_acronym_lii18_61",
108
+ icon: "_icon_lii18_65"
109
+ }, E = _(T.avatar, {
110
+ variants: { size: {
111
+ 20: T.s20,
112
+ 24: T.s24,
113
+ 28: T.s28,
114
+ 40: T.s40,
115
+ 48: T.s48,
116
+ 96: T.s96
117
+ } },
118
+ defaultVariants: { size: 40 }
119
+ });
120
+ //#endregion
121
+ //#region src/components/Avatar/Avatar.tsx
122
+ function D() {
123
+ return /* @__PURE__ */ h("svg", {
124
+ viewBox: "0 0 24 24",
125
+ fill: "currentColor",
126
+ "aria-hidden": !0,
127
+ children: /* @__PURE__ */ h("path", { d: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4.2 0-7 2.4-7 4.5V20h14v-1.5c0-2.1-2.8-4.5-7-4.5Z" })
128
+ });
129
+ }
130
+ function O({ ref: e, size: t = 40, src: n, alt: r = "", acronym: i, fallbackIcon: a, className: o, children: s, ...c }) {
131
+ let [l, u] = d(null), f = n != null && n !== "" && n !== l;
132
+ return /* @__PURE__ */ g("span", {
133
+ ref: e,
134
+ className: y(E({ size: t }), o),
135
+ ...c,
136
+ children: [f ? /* @__PURE__ */ h("img", {
137
+ className: T.img,
138
+ src: n,
139
+ alt: r,
140
+ loading: "lazy",
141
+ onError: () => u(n)
142
+ }) : i ? /* @__PURE__ */ h("span", {
143
+ className: T.acronym,
144
+ children: i
145
+ }) : /* @__PURE__ */ h("span", {
146
+ className: T.icon,
147
+ children: a ?? /* @__PURE__ */ h(D, {})
148
+ }), s]
149
+ });
150
+ }
151
+ O.displayName = "Avatar";
152
+ var k = { stack: "_stack_gi9bj_1" };
153
+ //#endregion
154
+ //#region src/components/AvatarStack/AvatarStack.tsx
155
+ function A({ ref: e, overlap: t, className: n, style: r, ...i }) {
156
+ return /* @__PURE__ */ h("div", {
157
+ ref: e,
158
+ className: y(k.stack, n),
159
+ style: t == null ? r : {
160
+ ...r,
161
+ "--tgui--avatar-stack--overlap": `${t}px`
162
+ },
163
+ ...i
164
+ });
165
+ }
166
+ A.displayName = "AvatarStack";
167
+ var j = {
168
+ badge: "_badge_76m5w_1",
169
+ number: "_number_76m5w_11",
170
+ large: "_large_76m5w_20",
171
+ dot: "_dot_76m5w_28",
172
+ "mode-primary": "_mode-primary_76m5w_39",
173
+ "mode-critical": "_mode-critical_76m5w_44",
174
+ "mode-secondary": "_mode-secondary_76m5w_49",
175
+ "mode-gray": "_mode-gray_76m5w_54",
176
+ "mode-white": "_mode-white_76m5w_59"
177
+ }, ee = _(j.badge, {
178
+ variants: {
179
+ type: {
180
+ number: j.number,
181
+ dot: j.dot
182
+ },
183
+ mode: {
184
+ primary: j["mode-primary"],
185
+ critical: j["mode-critical"],
186
+ secondary: j["mode-secondary"],
187
+ gray: j["mode-gray"],
188
+ white: j["mode-white"]
189
+ },
190
+ large: { true: j.large }
191
+ },
192
+ defaultVariants: {
193
+ type: "number",
194
+ mode: "primary"
195
+ }
196
+ });
197
+ //#endregion
198
+ //#region src/components/Badge/Badge.tsx
199
+ function te({ ref: e, type: t = "number", mode: n = "primary", large: r = !1, className: i, children: a, ...o }) {
200
+ return /* @__PURE__ */ h("span", {
201
+ ref: e,
202
+ className: y(ee({
203
+ type: t,
204
+ mode: n,
205
+ large: r
206
+ }), i),
207
+ ...o,
208
+ children: t === "number" ? a : null
209
+ });
210
+ }
211
+ te.displayName = "Badge";
212
+ var M = {
213
+ banner: "_banner_1sxll_1",
214
+ "type-section": "_type-section_1sxll_12",
215
+ "type-image": "_type-image_1sxll_17",
216
+ background: "_background_1sxll_21",
217
+ before: "_before_1sxll_41",
218
+ body: "_body_1sxll_47",
219
+ callout: "_callout_1sxll_57",
220
+ header: "_header_1sxll_66",
221
+ subheader: "_subheader_1sxll_72",
222
+ description: "_description_1sxll_78",
223
+ actions: "_actions_1sxll_84",
224
+ close: "_close_1sxll_91"
225
+ }, ne = _(M.banner, {
226
+ variants: { type: {
227
+ section: M["type-section"],
228
+ image: M["type-image"]
229
+ } },
230
+ defaultVariants: { type: "section" }
231
+ });
232
+ //#endregion
233
+ //#region src/components/Banner/Banner.tsx
234
+ function re({ ref: e, type: t = "section", before: n, callout: r, header: i, subheader: a, description: o, actions: s, background: c, onClose: l, closeLabel: u = "Close", className: d, children: f, ...p }) {
235
+ return /* @__PURE__ */ g("section", {
236
+ ref: e,
237
+ className: y(ne({ type: t }), d),
238
+ ...p,
239
+ children: [
240
+ t === "image" && c != null ? /* @__PURE__ */ h("div", {
241
+ className: M.background,
242
+ "aria-hidden": !0,
243
+ children: c
244
+ }) : null,
245
+ n == null ? null : /* @__PURE__ */ h("div", {
246
+ className: M.before,
247
+ children: n
248
+ }),
249
+ /* @__PURE__ */ g("div", {
250
+ className: M.body,
251
+ children: [
252
+ r == null ? null : /* @__PURE__ */ h("span", {
253
+ className: M.callout,
254
+ children: r
255
+ }),
256
+ i == null ? null : /* @__PURE__ */ h("span", {
257
+ className: M.header,
258
+ children: i
259
+ }),
260
+ a == null ? null : /* @__PURE__ */ h("span", {
261
+ className: M.subheader,
262
+ children: a
263
+ }),
264
+ o == null ? null : /* @__PURE__ */ h("p", {
265
+ className: M.description,
266
+ children: o
267
+ }),
268
+ f,
269
+ s == null ? null : /* @__PURE__ */ h("div", {
270
+ className: M.actions,
271
+ children: s
272
+ })
273
+ ]
274
+ }),
275
+ l == null ? null : /* @__PURE__ */ h("button", {
276
+ type: "button",
277
+ className: M.close,
278
+ "aria-label": u,
279
+ onClick: l,
280
+ children: /* @__PURE__ */ h("svg", {
281
+ width: "14",
282
+ height: "14",
283
+ viewBox: "0 0 14 14",
284
+ "aria-hidden": !0,
285
+ children: /* @__PURE__ */ h("path", {
286
+ d: "M3.5 3.5l7 7M10.5 3.5l-7 7",
287
+ stroke: "currentColor",
288
+ strokeWidth: "1.5",
289
+ strokeLinecap: "round"
290
+ })
291
+ })
292
+ })
293
+ ]
294
+ });
295
+ }
296
+ re.displayName = "Banner";
297
+ var ie = {
298
+ blockquote: "_blockquote_mub25_1",
299
+ cite: "_cite_mub25_13"
300
+ };
301
+ //#endregion
302
+ //#region src/components/Blockquote/Blockquote.tsx
303
+ function ae({ ref: e, author: t, className: n, children: r, ...i }) {
304
+ return /* @__PURE__ */ g("blockquote", {
305
+ ref: e,
306
+ className: y(ie.blockquote, n),
307
+ ...i,
308
+ children: [r, t == null ? null : /* @__PURE__ */ h("cite", {
309
+ className: ie.cite,
310
+ children: t
311
+ })]
312
+ });
313
+ }
314
+ ae.displayName = "Blockquote";
315
+ var oe = {
316
+ spinner: "_spinner_1kqa4_1",
317
+ "tgui-spinner": "_tgui-spinner_1kqa4_1",
318
+ s: "_s_1kqa4_1",
319
+ m: "_m_1kqa4_17",
320
+ l: "_l_1kqa4_23"
321
+ }, se = _(oe.spinner, {
322
+ variants: { size: {
323
+ s: oe.s,
324
+ m: oe.m,
325
+ l: oe.l
326
+ } },
327
+ defaultVariants: { size: "m" }
328
+ });
329
+ //#endregion
330
+ //#region src/components/Spinner/Spinner.tsx
331
+ function ce({ ref: e, size: t = "m", className: n, ...r }) {
332
+ return /* @__PURE__ */ h("span", {
333
+ ref: e,
334
+ role: "status",
335
+ "aria-label": "Loading",
336
+ className: y(se({ size: t }), n),
337
+ ...r
338
+ });
339
+ }
340
+ ce.displayName = "Spinner";
341
+ var le = {
11
342
  typography: "_typography_1uxpm_1",
12
343
  "weight-1": "_weight-1_1uxpm_6",
13
344
  "weight-2": "_weight-2_1uxpm_10",
14
345
  "weight-3": "_weight-3_1uxpm_14",
15
346
  caps: "_caps_1uxpm_18"
16
- }, _ = t(g.typography, {
347
+ }, ue = _(le.typography, {
17
348
  variants: {
18
349
  weight: {
19
- 1: g["weight-1"],
20
- 2: g["weight-2"],
21
- 3: g["weight-3"]
350
+ 1: le["weight-1"],
351
+ 2: le["weight-2"],
352
+ 3: le["weight-3"]
22
353
  },
23
- caps: { true: g.caps }
354
+ caps: { true: le.caps }
24
355
  },
25
356
  defaultVariants: { weight: "3" }
26
357
  });
27
358
  //#endregion
28
359
  //#region src/components/Typography/Typography.tsx
29
- function v({ ref: e, weight: t, caps: r, Component: i = "span", className: a, ...o }) {
30
- return /* @__PURE__ */ n(i, {
360
+ function N({ ref: e, weight: t, caps: n, Component: r = "span", className: i, ...a }) {
361
+ return /* @__PURE__ */ h(r, {
31
362
  ref: e,
32
- className: h(_({
363
+ className: y(ue({
33
364
  weight: t,
34
- caps: r
35
- }), a),
36
- ...o
365
+ caps: n
366
+ }), i),
367
+ ...a
37
368
  });
38
369
  }
39
- v.displayName = "Typography";
370
+ N.displayName = "Typography";
40
371
  //#endregion
41
372
  //#region src/components/Subheadline/Subheadline.module.css
42
- var y = {
373
+ var de = {
43
374
  "level-1": "_level-1_1azf3_1",
44
375
  "level-2": "_level-2_1azf3_6"
45
- }, b = t("", {
376
+ }, fe = _("", {
46
377
  variants: { level: {
47
- 1: y["level-1"],
48
- 2: y["level-2"]
378
+ 1: de["level-1"],
379
+ 2: de["level-2"]
49
380
  } },
50
381
  defaultVariants: { level: "1" }
51
382
  });
52
383
  //#endregion
53
384
  //#region src/components/Subheadline/Subheadline.tsx
54
- function x({ ref: e, level: t, Component: r = "h6", className: i, ...a }) {
55
- return /* @__PURE__ */ n(v, {
385
+ function P({ ref: e, level: t, Component: n = "h6", className: r, ...i }) {
386
+ return /* @__PURE__ */ h(N, {
56
387
  ref: e,
57
- Component: r,
58
- className: h(b({ level: t }), i),
59
- ...a
388
+ Component: n,
389
+ className: y(fe({ level: t }), r),
390
+ ...i
60
391
  });
61
392
  }
62
- x.displayName = "Subheadline";
393
+ P.displayName = "Subheadline";
63
394
  //#endregion
64
395
  //#region src/components/TguiProvider/context.ts
65
- var S = o(null);
66
- S.displayName = "TguiContext";
396
+ var pe = n(null);
397
+ pe.displayName = "TguiContext";
67
398
  //#endregion
68
399
  //#region src/components/TguiProvider/useTgui.ts
69
- function C() {
70
- let e = l(S);
400
+ function F() {
401
+ let e = a(pe);
71
402
  if (e === null) throw Error("useTgui must be used within a <TguiProvider>.");
72
403
  return e;
73
404
  }
74
- var ee = {
405
+ var me = {
75
406
  ripple: "_ripple_1cc3x_1",
76
407
  wave: "_wave_1cc3x_9",
77
408
  "wave-rise": "_wave-rise_1cc3x_1"
78
409
  };
79
410
  //#endregion
80
411
  //#region src/components/Tappable/Ripple.tsx
81
- function te({ waves: e, onWaveEnd: t }) {
82
- return /* @__PURE__ */ n("span", {
412
+ function he({ waves: e, onWaveEnd: t }) {
413
+ return /* @__PURE__ */ h("span", {
83
414
  "aria-hidden": !0,
84
- className: ee.ripple,
85
- children: e.map((e) => /* @__PURE__ */ n("span", {
86
- className: ee.wave,
415
+ className: me.ripple,
416
+ children: e.map((e) => /* @__PURE__ */ h("span", {
417
+ className: me.wave,
87
418
  style: {
88
419
  top: e.y,
89
420
  left: e.x
@@ -92,27 +423,27 @@ function te({ waves: e, onWaveEnd: t }) {
92
423
  }, e.id))
93
424
  });
94
425
  }
95
- var w = {
426
+ var ge = {
96
427
  tappable: "_tappable_10au7_1",
97
428
  "tappable--ios": "_tappable--ios_10au7_17",
98
429
  "tappable--opacity": "_tappable--opacity_10au7_18"
99
- }, ne = 70, re = 600;
100
- function ie() {
101
- let [e, t] = p([]), n = f(0), r = f(/* @__PURE__ */ new Map()), i = f(/* @__PURE__ */ new Set());
102
- u(() => {
103
- let e = r.current, t = i.current;
430
+ }, _e = 70, ve = 600;
431
+ function ye() {
432
+ let [e, t] = d([]), n = u(0), r = u(/* @__PURE__ */ new Map()), a = u(/* @__PURE__ */ new Set());
433
+ o(() => {
434
+ let e = r.current, t = a.current;
104
435
  return () => {
105
436
  for (let t of e.values()) clearTimeout(t);
106
437
  for (let e of t) clearTimeout(e);
107
438
  };
108
439
  }, []);
109
- let a = c((e) => {
440
+ let s = i((e) => {
110
441
  t((t) => t.filter((t) => t.id !== e));
111
442
  }, []);
112
443
  return {
113
444
  waves: e,
114
- onPointerDown: c((e) => {
115
- let { top: o, left: s } = e.currentTarget.getBoundingClientRect(), c = e.clientX - s, l = e.clientY - o, { pointerId: u } = e, d = setTimeout(() => {
445
+ onPointerDown: i((e) => {
446
+ let { top: i, left: o } = e.currentTarget.getBoundingClientRect(), c = e.clientX - o, l = e.clientY - i, { pointerId: u } = e, d = setTimeout(() => {
116
447
  r.current.delete(u);
117
448
  let e = n.current++;
118
449
  t((t) => [...t, {
@@ -120,155 +451,154 @@ function ie() {
120
451
  x: c,
121
452
  y: l
122
453
  }]);
123
- let o = setTimeout(() => {
124
- i.current.delete(o), a(e);
125
- }, re);
126
- i.current.add(o);
127
- }, ne);
454
+ let i = setTimeout(() => {
455
+ a.current.delete(i), s(e);
456
+ }, ve);
457
+ a.current.add(i);
458
+ }, _e);
128
459
  r.current.set(u, d);
129
- }, [a]),
130
- onPointerCancel: c((e) => {
460
+ }, [s]),
461
+ onPointerCancel: i((e) => {
131
462
  let t = r.current.get(e.pointerId);
132
463
  t && (clearTimeout(t), r.current.delete(e.pointerId));
133
464
  }, []),
134
- removeWave: a
465
+ removeWave: s
135
466
  };
136
467
  }
137
468
  //#endregion
138
469
  //#region src/components/Tappable/Tappable.tsx
139
- function T({ ref: e, Component: t = "div", interactiveAnimation: i = "background", className: a, children: o, onPointerDown: s, onPointerCancel: c, ...l }) {
140
- let { platform: u } = C(), d = ie(), f = !!l.disabled, p = !!l.readOnly, m = u === "base" && i === "background" && !p && !f && (t !== "div" && t !== "span" || l.onClick != null);
141
- return /* @__PURE__ */ r(t, {
142
- ref: e,
143
- className: h(w.tappable, u === "ios" && w["tappable--ios"], i === "opacity" && w["tappable--opacity"], a),
144
- "data-readonly": p || void 0,
145
- "data-disabled": f || void 0,
146
- "aria-disabled": f || void 0,
470
+ function be({ ref: e, Component: t = "div", interactiveAnimation: n = "background", className: r, children: i, onPointerDown: a, onPointerCancel: o, ...s }) {
471
+ let { platform: c } = F(), l = ye(), u = !!s.disabled, d = !!s.readOnly, f = c === "base" && n === "background" && !d && !u && (t !== "div" && t !== "span" || s.onClick != null);
472
+ return /* @__PURE__ */ g(t, {
473
+ ref: e,
474
+ className: y(ge.tappable, c === "ios" && ge["tappable--ios"], n === "opacity" && ge["tappable--opacity"], r),
475
+ "data-readonly": d || void 0,
476
+ "data-disabled": u || void 0,
477
+ "aria-disabled": u || void 0,
147
478
  onPointerDown: (e) => {
148
- m && d.onPointerDown(e), s?.(e);
479
+ f && l.onPointerDown(e), a?.(e);
149
480
  },
150
481
  onPointerCancel: (e) => {
151
- m && d.onPointerCancel(e), c?.(e);
482
+ f && l.onPointerCancel(e), o?.(e);
152
483
  },
153
- ...l,
154
- children: [m && /* @__PURE__ */ n(te, {
155
- waves: d.waves,
156
- onWaveEnd: d.removeWave
157
- }), o]
484
+ ...s,
485
+ children: [f && /* @__PURE__ */ h(he, {
486
+ waves: l.waves,
487
+ onWaveEnd: l.removeWave
488
+ }), i]
158
489
  });
159
490
  }
160
- T.displayName = "Tappable";
161
- var ae = { text: "_text_5v0x0_1" };
491
+ be.displayName = "Tappable";
492
+ var xe = { text: "_text_5v0x0_1" };
162
493
  //#endregion
163
494
  //#region src/components/Text/Text.tsx
164
- function E({ ref: e, className: t, Component: r = "span", ...i }) {
165
- return /* @__PURE__ */ n(v, {
495
+ function I({ ref: e, className: t, Component: n = "span", ...r }) {
496
+ return /* @__PURE__ */ h(N, {
166
497
  ref: e,
167
- Component: r,
168
- className: h(ae.text, t),
169
- ...i
498
+ Component: n,
499
+ className: y(xe.text, t),
500
+ ...r
170
501
  });
171
502
  }
172
- E.displayName = "Text";
503
+ I.displayName = "Text";
173
504
  //#endregion
174
505
  //#region src/shared/lib/telegram.ts
175
- function D() {
506
+ function Se() {
176
507
  if (!(typeof window > "u")) return window.Telegram?.WebApp;
177
508
  }
178
509
  //#endregion
179
510
  //#region src/shared/lib/appearance.ts
180
- var O = "(prefers-color-scheme: dark)";
181
- function oe() {
511
+ var Ce = "(prefers-color-scheme: dark)";
512
+ function we() {
182
513
  return typeof window < "u" && typeof window.matchMedia == "function";
183
514
  }
184
- function se() {
185
- let e = D();
186
- return e ? e.colorScheme === "dark" ? "dark" : "light" : oe() && window.matchMedia(O).matches ? "dark" : "light";
515
+ function Te() {
516
+ let e = Se();
517
+ return e ? e.colorScheme === "dark" ? "dark" : "light" : we() && window.matchMedia(Ce).matches ? "dark" : "light";
187
518
  }
188
- function ce(e) {
189
- let t = D();
519
+ function Ee(e) {
520
+ let t = Se();
190
521
  if (t) return t.onEvent("themeChanged", e), () => t.offEvent("themeChanged", e);
191
- if (!oe()) return () => {};
192
- let n = window.matchMedia(O);
522
+ if (!we()) return () => {};
523
+ let n = window.matchMedia(Ce);
193
524
  return n.addEventListener("change", e), () => n.removeEventListener("change", e);
194
525
  }
195
526
  //#endregion
196
527
  //#region src/shared/lib/platform.ts
197
- var le = /* @__PURE__ */ new Set(["ios", "macos"]);
198
- function ue() {
199
- let e = D();
200
- if (e) return le.has(e.platform) ? "ios" : "base";
528
+ var De = /* @__PURE__ */ new Set(["ios", "macos"]);
529
+ function Oe() {
530
+ let e = Se();
531
+ if (e) return De.has(e.platform) ? "ios" : "base";
201
532
  if (typeof navigator > "u") return "base";
202
533
  let t = navigator.userAgent, n = t.includes("Macintosh") && navigator.maxTouchPoints > 1;
203
534
  return /iphone|ipad|ipod/i.test(t) || n ? "ios" : "base";
204
535
  }
205
- var k = {
206
- wrapper: "_wrapper_17e4j_1",
207
- "wrapper--ios": "_wrapper--ios_17e4j_89",
208
- "wrapper--dark": "_wrapper--dark_17e4j_102"
209
- }, de = () => "light";
210
- function fe({ ref: e, platform: t, appearance: r, portalContainer: i, className: a, children: o, ...s }) {
211
- let l = d(() => t ?? ue(), [t]), u = m(ce, se, de), f = r ?? u, [g, _] = p(null), v = c((t) => {
212
- _(t), typeof e == "function" ? e(t) : e && (e.current = t);
213
- }, [e]), y = d(() => ({
214
- platform: l,
215
- appearance: f,
216
- portalContainer: i ?? g
536
+ var ke = {
537
+ wrapper: "_wrapper_mqlq3_1",
538
+ "wrapper--ios": "_wrapper--ios_mqlq3_89",
539
+ "wrapper--dark": "_wrapper--dark_mqlq3_102"
540
+ }, Ae = () => "light";
541
+ function je({ ref: e, platform: t, appearance: n, portalContainer: r, className: a, children: o, ...s }) {
542
+ let c = l(() => t ?? Oe(), [t]), u = f(Ee, Te, Ae), p = n ?? u, [m, g] = d(null), _ = i((t) => {
543
+ g(t), typeof e == "function" ? e(t) : e && (e.current = t);
544
+ }, [e]), v = l(() => ({
545
+ platform: c,
546
+ appearance: p,
547
+ portalContainer: r ?? m
217
548
  }), [
218
- l,
219
- f,
220
- i,
221
- g
549
+ c,
550
+ p,
551
+ r,
552
+ m
222
553
  ]);
223
- return /* @__PURE__ */ n("div", {
224
- ref: v,
225
- className: h(k.wrapper, l === "ios" && k["wrapper--ios"], f === "dark" && k["wrapper--dark"], a),
554
+ return /* @__PURE__ */ h("div", {
555
+ ref: _,
556
+ className: y(ke.wrapper, c === "ios" && ke["wrapper--ios"], p === "dark" && ke["wrapper--dark"], a),
226
557
  ...s,
227
- children: /* @__PURE__ */ n(S.Provider, {
228
- value: y,
558
+ children: /* @__PURE__ */ h(pe.Provider, {
559
+ value: v,
229
560
  children: o
230
561
  })
231
562
  });
232
563
  }
233
- fe.displayName = "TguiProvider";
234
- var A = {
235
- button: "_button_17mwm_1",
236
- stretched: "_stretched_17mwm_13",
237
- before: "_before_17mwm_33",
238
- after: "_after_17mwm_34",
239
- content: "_content_17mwm_40",
240
- label: "_label_17mwm_49",
241
- loading: "_loading_17mwm_60",
242
- spinner: "_spinner_17mwm_70",
243
- "button-spinner": "_button-spinner_17mwm_1",
244
- "size-s": "_size-s_17mwm_93",
245
- "size-m": "_size-m_17mwm_101",
246
- "size-l": "_size-l_17mwm_108",
247
- ios: "_ios_17mwm_114",
248
- "mode-filled": "_mode-filled_17mwm_122",
249
- "mode-bezeled": "_mode-bezeled_17mwm_129",
250
- "mode-plain": "_mode-plain_17mwm_136",
251
- "mode-gray": "_mode-gray_17mwm_143",
252
- "mode-outline": "_mode-outline_17mwm_150",
253
- "mode-white": "_mode-white_17mwm_158"
254
- }, pe = t(A.button, {
564
+ je.displayName = "TguiProvider";
565
+ var L = {
566
+ button: "_button_6vql2_1",
567
+ stretched: "_stretched_6vql2_13",
568
+ before: "_before_6vql2_34",
569
+ after: "_after_6vql2_35",
570
+ content: "_content_6vql2_41",
571
+ label: "_label_6vql2_50",
572
+ loading: "_loading_6vql2_61",
573
+ spinner: "_spinner_6vql2_71",
574
+ "size-s": "_size-s_6vql2_76",
575
+ "size-m": "_size-m_6vql2_84",
576
+ "size-l": "_size-l_6vql2_91",
577
+ ios: "_ios_6vql2_97",
578
+ "mode-filled": "_mode-filled_6vql2_105",
579
+ "mode-bezeled": "_mode-bezeled_6vql2_112",
580
+ "mode-plain": "_mode-plain_6vql2_119",
581
+ "mode-gray": "_mode-gray_6vql2_126",
582
+ "mode-outline": "_mode-outline_6vql2_133",
583
+ "mode-white": "_mode-white_6vql2_141"
584
+ }, Me = _(L.button, {
255
585
  variants: {
256
586
  mode: {
257
- filled: A["mode-filled"],
258
- bezeled: A["mode-bezeled"],
259
- plain: A["mode-plain"],
260
- gray: A["mode-gray"],
261
- outline: A["mode-outline"],
262
- white: A["mode-white"]
587
+ filled: L["mode-filled"],
588
+ bezeled: L["mode-bezeled"],
589
+ plain: L["mode-plain"],
590
+ gray: L["mode-gray"],
591
+ outline: L["mode-outline"],
592
+ white: L["mode-white"]
263
593
  },
264
594
  size: {
265
- s: A["size-s"],
266
- m: A["size-m"],
267
- l: A["size-l"]
595
+ s: L["size-s"],
596
+ m: L["size-m"],
597
+ l: L["size-l"]
268
598
  },
269
- stretched: { true: A.stretched },
599
+ stretched: { true: L.stretched },
270
600
  platform: {
271
- ios: A.ios,
601
+ ios: L.ios,
272
602
  base: null
273
603
  }
274
604
  },
@@ -279,91 +609,92 @@ var A = {
279
609
  });
280
610
  //#endregion
281
611
  //#region src/components/Button/Button.tsx
282
- function me({ size: e, children: t }) {
283
- let r = {
612
+ function Ne({ size: e, children: t }) {
613
+ let n = {
284
614
  weight: "2",
285
- className: A.content
286
- }, i = /* @__PURE__ */ n("span", {
287
- className: A.label,
615
+ className: L.content
616
+ }, r = /* @__PURE__ */ h("span", {
617
+ className: L.label,
288
618
  children: t
289
619
  });
290
- return e === "l" ? /* @__PURE__ */ n(E, {
291
- ...r,
292
- children: i
293
- }) : /* @__PURE__ */ n(x, {
620
+ return e === "l" ? /* @__PURE__ */ h(I, {
621
+ ...n,
622
+ children: r
623
+ }) : /* @__PURE__ */ h(P, {
294
624
  level: "2",
295
- ...r,
296
- children: i
625
+ ...n,
626
+ children: r
297
627
  });
298
628
  }
299
- function he({ ref: e, Component: t = "button", mode: i = "filled", size: a = "m", stretched: o = !1, loading: s = !1, type: c, before: l, after: u, children: d, className: f, ...p }) {
300
- let { platform: m } = C();
301
- return /* @__PURE__ */ r(T, {
629
+ function Pe({ ref: e, Component: t = "button", mode: n = "filled", size: r = "m", stretched: i = !1, loading: a = !1, type: o, before: s, after: c, children: l, className: u, ...d }) {
630
+ let { platform: f } = F();
631
+ return /* @__PURE__ */ g(be, {
302
632
  ref: e,
303
633
  Component: t,
304
- type: t === "button" ? c ?? "button" : c,
305
- "aria-busy": s || void 0,
306
- className: h(pe({
307
- mode: i,
308
- size: a,
309
- stretched: o,
310
- platform: m
311
- }), s && A.loading, f),
312
- ...p,
634
+ type: t === "button" ? o ?? "button" : o,
635
+ "aria-busy": a || void 0,
636
+ className: y(Me({
637
+ mode: n,
638
+ size: r,
639
+ stretched: i,
640
+ platform: f
641
+ }), a && L.loading, u),
642
+ ...d,
313
643
  children: [
314
- s ? /* @__PURE__ */ n("span", {
315
- className: A.spinner,
644
+ a ? /* @__PURE__ */ h(ce, {
645
+ size: "s",
646
+ className: L.spinner,
316
647
  "aria-hidden": !0
317
648
  }) : null,
318
- l ? /* @__PURE__ */ n("span", {
319
- className: A.before,
320
- children: l
649
+ s ? /* @__PURE__ */ h("span", {
650
+ className: L.before,
651
+ children: s
321
652
  }) : null,
322
- /* @__PURE__ */ n(me, {
323
- size: a,
324
- children: d
653
+ /* @__PURE__ */ h(Ne, {
654
+ size: r,
655
+ children: l
325
656
  }),
326
- u ? /* @__PURE__ */ n("span", {
327
- className: A.after,
328
- children: u
657
+ c ? /* @__PURE__ */ h("span", {
658
+ className: L.after,
659
+ children: c
329
660
  }) : null
330
661
  ]
331
662
  });
332
663
  }
333
- he.displayName = "Button";
664
+ Pe.displayName = "Button";
334
665
  //#endregion
335
666
  //#region src/components/Caption/Caption.module.css
336
- var ge = {
667
+ var Fe = {
337
668
  "level-1": "_level-1_1fkm7_1",
338
669
  "level-2": "_level-2_1fkm7_6"
339
- }, _e = t("", {
670
+ }, Ie = _("", {
340
671
  variants: { level: {
341
- 1: ge["level-1"],
342
- 2: ge["level-2"]
672
+ 1: Fe["level-1"],
673
+ 2: Fe["level-2"]
343
674
  } },
344
675
  defaultVariants: { level: "1" }
345
676
  });
346
677
  //#endregion
347
678
  //#region src/components/Caption/Caption.tsx
348
- function j({ ref: e, level: t, Component: r = "span", className: i, ...a }) {
349
- return /* @__PURE__ */ n(v, {
679
+ function R({ ref: e, level: t, Component: n = "span", className: r, ...i }) {
680
+ return /* @__PURE__ */ h(N, {
350
681
  ref: e,
351
- Component: r,
352
- className: h(_e({ level: t }), i),
353
- ...a
682
+ Component: n,
683
+ className: y(Ie({ level: t }), r),
684
+ ...i
354
685
  });
355
686
  }
356
- j.displayName = "Caption";
687
+ R.displayName = "Caption";
357
688
  //#endregion
358
689
  //#region src/components/Card/Card.context.ts
359
- var M = o({ type: "plain" }), N = {
690
+ var Le = n({ type: "plain" }), Re = {
360
691
  card: "_card_1maup_1",
361
692
  cardAmbient: "_cardAmbient_1maup_17",
362
693
  cell: "_cell_1maup_21",
363
694
  cellAmbient: "_cellAmbient_1maup_26",
364
695
  cellHeader: "_cellHeader_1maup_43",
365
696
  cellSubtitle: "_cellSubtitle_1maup_47"
366
- }, P = {
697
+ }, z = {
367
698
  cell: "_cell_1w7p5_1",
368
699
  before: "_before_1w7p5_10",
369
700
  after: "_after_1w7p5_11",
@@ -378,331 +709,899 @@ var M = o({ type: "plain" }), N = {
378
709
  hovered: "_hovered_1w7p5_56",
379
710
  ios: "_ios_1w7p5_60",
380
711
  interactive: "_interactive_1w7p5_67"
381
- }, ve = t(P.cell, { variants: {
712
+ }, ze = _(z.cell, { variants: {
382
713
  platform: {
383
- ios: P.ios,
714
+ ios: z.ios,
384
715
  base: null
385
716
  },
386
- hovered: { true: P.hovered },
387
- interactive: { true: P.interactive },
388
- multiline: { true: P.multiline }
717
+ hovered: { true: z.hovered },
718
+ interactive: { true: z.interactive },
719
+ multiline: { true: z.multiline }
389
720
  } });
390
721
  //#endregion
391
722
  //#region src/components/Cell/Cell.tsx
392
- function ye({ ios: e, children: t }) {
393
- return e ? /* @__PURE__ */ n(E, {
394
- className: P.head,
723
+ function Be({ ios: e, children: t }) {
724
+ return e ? /* @__PURE__ */ h(I, {
725
+ className: z.head,
395
726
  children: t
396
- }) : /* @__PURE__ */ n(x, {
727
+ }) : /* @__PURE__ */ h(P, {
397
728
  level: "1",
398
- className: P.head,
729
+ className: z.head,
399
730
  children: t
400
731
  });
401
732
  }
402
- function be({ ios: e, children: t }) {
403
- return e ? /* @__PURE__ */ n(j, {
404
- className: P.description,
733
+ function Ve({ ios: e, children: t }) {
734
+ return e ? /* @__PURE__ */ h(R, {
735
+ className: z.description,
405
736
  children: t
406
- }) : /* @__PURE__ */ n(x, {
737
+ }) : /* @__PURE__ */ h(P, {
407
738
  level: "2",
408
- className: P.description,
739
+ className: z.description,
409
740
  children: t
410
741
  });
411
742
  }
412
- function F({ ref: e, Component: t = "div", subhead: i, children: a, hint: o, titleBadge: s, subtitle: c, description: l, before: u, after: d, hovered: f, multiline: p, className: m, ...g }) {
413
- let { platform: _ } = C(), v = _ === "ios", y = a != null || o != null || s != null, b = g.onClick != null || g.href != null || t === "a" || t === "button" || t === "label";
414
- return /* @__PURE__ */ r(T, {
743
+ function He({ ref: e, Component: t = "div", subhead: n, children: r, hint: i, titleBadge: a, subtitle: o, description: s, before: c, after: l, hovered: u, multiline: d, className: f, ...p }) {
744
+ let { platform: m } = F(), _ = m === "ios", v = r != null || i != null || a != null, b = p.onClick != null || p.href != null || t === "a" || t === "button" || t === "label";
745
+ return /* @__PURE__ */ g(be, {
415
746
  ref: e,
416
747
  Component: t,
417
- className: h(ve({
418
- platform: _,
419
- hovered: f,
420
- multiline: p,
748
+ className: y(ze({
749
+ platform: m,
750
+ hovered: u,
751
+ multiline: d,
421
752
  interactive: b
422
- }), m),
423
- ...g,
753
+ }), f),
754
+ ...p,
424
755
  children: [
425
- u == null ? null : /* @__PURE__ */ n("div", {
426
- className: P.before,
427
- children: u
756
+ c == null ? null : /* @__PURE__ */ h("div", {
757
+ className: z.before,
758
+ children: c
428
759
  }),
429
- /* @__PURE__ */ r("div", {
430
- className: P.middle,
760
+ /* @__PURE__ */ g("div", {
761
+ className: z.middle,
431
762
  children: [
432
- i == null ? null : /* @__PURE__ */ n(x, {
763
+ n == null ? null : /* @__PURE__ */ h(P, {
433
764
  level: "2",
434
- className: P.subhead,
435
- children: i
765
+ className: z.subhead,
766
+ children: n
436
767
  }),
437
- y ? /* @__PURE__ */ r(ye, {
438
- ios: v,
768
+ v ? /* @__PURE__ */ g(Be, {
769
+ ios: _,
439
770
  children: [
440
- a == null ? null : /* @__PURE__ */ n("span", {
441
- className: P.title,
442
- children: a
771
+ r == null ? null : /* @__PURE__ */ h("span", {
772
+ className: z.title,
773
+ children: r
443
774
  }),
444
- o == null ? null : /* @__PURE__ */ n("span", {
445
- className: P.hint,
446
- children: o
775
+ i == null ? null : /* @__PURE__ */ h("span", {
776
+ className: z.hint,
777
+ children: i
447
778
  }),
448
- s
779
+ a
449
780
  ]
450
781
  }) : null,
451
- c == null ? null : /* @__PURE__ */ n(x, {
782
+ o == null ? null : /* @__PURE__ */ h(P, {
452
783
  level: "2",
453
- className: P.subtitle,
454
- children: c
784
+ className: z.subtitle,
785
+ children: o
455
786
  }),
456
- l == null ? null : /* @__PURE__ */ n(be, {
457
- ios: v,
458
- children: l
787
+ s == null ? null : /* @__PURE__ */ h(Ve, {
788
+ ios: _,
789
+ children: s
459
790
  })
460
791
  ]
461
792
  }),
462
- d == null ? null : /* @__PURE__ */ n("div", {
463
- className: P.after,
464
- children: d
793
+ l == null ? null : /* @__PURE__ */ h("div", {
794
+ className: z.after,
795
+ children: l
465
796
  })
466
797
  ]
467
798
  });
468
799
  }
469
- F.displayName = "Cell";
800
+ He.displayName = "Cell";
470
801
  //#endregion
471
802
  //#region src/components/Card/CardCell.tsx
472
- function I({ ref: e, children: t, subtitle: r, className: i, ...a }) {
473
- let { type: o } = l(M), s = o === "ambient";
474
- return /* @__PURE__ */ n(F, {
803
+ function Ue({ ref: e, children: t, subtitle: n, className: r, ...i }) {
804
+ let { type: o } = a(Le), s = o === "ambient";
805
+ return /* @__PURE__ */ h(He, {
475
806
  ref: e,
476
- className: h(N.cell, s && N.cellAmbient, i),
477
- subtitle: r == null ? void 0 : /* @__PURE__ */ n("span", {
478
- className: N.cellSubtitle,
479
- children: r
807
+ className: y(Re.cell, s && Re.cellAmbient, r),
808
+ subtitle: n == null ? void 0 : /* @__PURE__ */ h("span", {
809
+ className: Re.cellSubtitle,
810
+ children: n
480
811
  }),
481
- ...a,
482
- children: t == null ? null : /* @__PURE__ */ n("span", {
483
- className: N.cellHeader,
812
+ ...i,
813
+ children: t == null ? null : /* @__PURE__ */ h("span", {
814
+ className: Re.cellHeader,
484
815
  children: t
485
816
  })
486
817
  });
487
818
  }
488
- I.displayName = "CardCell";
819
+ Ue.displayName = "CardCell";
489
820
  //#endregion
490
821
  //#region src/components/Card/Card.tsx
491
- function L({ ref: e, type: t = "plain", className: r, children: i, ...a }) {
492
- let o = d(() => ({ type: t }), [t]);
493
- return /* @__PURE__ */ n(M.Provider, {
494
- value: o,
495
- children: /* @__PURE__ */ n("article", {
822
+ function We({ ref: e, type: t = "plain", className: n, children: r, ...i }) {
823
+ let a = l(() => ({ type: t }), [t]);
824
+ return /* @__PURE__ */ h(Le.Provider, {
825
+ value: a,
826
+ children: /* @__PURE__ */ h("article", {
496
827
  ref: e,
497
- className: h(N.card, t === "ambient" && N.cardAmbient, r),
498
- ...a,
499
- children: i
828
+ className: y(Re.card, t === "ambient" && Re.cardAmbient, n),
829
+ ...i,
830
+ children: r
500
831
  })
501
832
  });
502
833
  }
503
- L.displayName = "Card", L.Cell = I;
504
- var R = {
834
+ We.displayName = "Card", We.Cell = Ue;
835
+ var Ge = {
505
836
  checkbox: "_checkbox_yjw6v_1",
506
837
  input: "_input_yjw6v_12",
507
838
  box: "_box_yjw6v_22"
508
839
  };
509
840
  //#endregion
510
841
  //#region src/components/Checkbox/Checkbox.tsx
511
- function xe({ ref: e, indeterminate: t = !1, disabled: i, className: a, style: o, ...s }) {
512
- let c = f(null);
513
- return u(() => {
514
- c.current && (c.current.indeterminate = t);
515
- }, [t]), /* @__PURE__ */ r("span", {
516
- className: h(R.checkbox, a),
517
- style: o,
518
- "data-disabled": i || void 0,
519
- children: [/* @__PURE__ */ n("input", {
842
+ function Ke({ ref: e, indeterminate: t = !1, disabled: n, className: r, style: i, ...a }) {
843
+ let s = u(null);
844
+ return o(() => {
845
+ s.current && (s.current.indeterminate = t);
846
+ }, [t]), /* @__PURE__ */ g("span", {
847
+ className: y(Ge.checkbox, r),
848
+ style: i,
849
+ "data-disabled": n || void 0,
850
+ children: [/* @__PURE__ */ h("input", {
520
851
  ref: (t) => {
521
- c.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
852
+ s.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
522
853
  },
523
854
  type: "checkbox",
524
- className: R.input,
525
- disabled: i,
526
- ...s
527
- }), /* @__PURE__ */ n("span", {
528
- className: R.box,
855
+ className: Ge.input,
856
+ disabled: n,
857
+ ...a
858
+ }), /* @__PURE__ */ h("span", {
859
+ className: Ge.box,
529
860
  "aria-hidden": !0
530
861
  })]
531
862
  });
532
863
  }
533
- xe.displayName = "Checkbox";
534
- var Se = { divider: "_divider_fq1ux_1" };
864
+ Ke.displayName = "Checkbox";
865
+ var B = {
866
+ chip: "_chip_13v10_1",
867
+ "mode-elevated": "_mode-elevated_13v10_16",
868
+ "mode-outline": "_mode-outline_13v10_21",
869
+ clickable: "_clickable_13v10_26",
870
+ before: "_before_13v10_37",
871
+ after: "_after_13v10_38",
872
+ label: "_label_13v10_49",
873
+ remove: "_remove_13v10_56"
874
+ }, qe = _(B.chip, {
875
+ variants: {
876
+ mode: {
877
+ elevated: B["mode-elevated"],
878
+ outline: B["mode-outline"]
879
+ },
880
+ clickable: { true: B.clickable }
881
+ },
882
+ defaultVariants: { mode: "elevated" }
883
+ });
884
+ //#endregion
885
+ //#region src/components/Chip/Chip.tsx
886
+ function Je({ ref: e, Component: t = "div", mode: n = "elevated", before: r, after: i, onClick: a, onRemove: o, removeLabel: s = "Remove", className: c, children: l, ...u }) {
887
+ return /* @__PURE__ */ g(t, {
888
+ ref: e,
889
+ className: y(qe({
890
+ mode: n,
891
+ clickable: a != null
892
+ }), c),
893
+ onClick: a,
894
+ ...u,
895
+ children: [
896
+ r == null ? null : /* @__PURE__ */ h("span", {
897
+ className: B.before,
898
+ children: r
899
+ }),
900
+ /* @__PURE__ */ h("span", {
901
+ className: B.label,
902
+ children: l
903
+ }),
904
+ o == null ? i == null ? null : /* @__PURE__ */ h("span", {
905
+ className: B.after,
906
+ children: i
907
+ }) : /* @__PURE__ */ h("button", {
908
+ type: "button",
909
+ className: B.remove,
910
+ "aria-label": s,
911
+ onClick: (e) => {
912
+ e.stopPropagation(), o();
913
+ },
914
+ children: /* @__PURE__ */ h("svg", {
915
+ width: "12",
916
+ height: "12",
917
+ viewBox: "0 0 12 12",
918
+ "aria-hidden": !0,
919
+ children: /* @__PURE__ */ h("path", {
920
+ d: "M3 3l6 6M9 3l-6 6",
921
+ stroke: "currentColor",
922
+ strokeWidth: "1.5",
923
+ strokeLinecap: "round"
924
+ })
925
+ })
926
+ })
927
+ ]
928
+ });
929
+ }
930
+ Je.displayName = "Chip";
931
+ var Ye = {
932
+ root: "_root_hheo5_1",
933
+ svg: "_svg_hheo5_6",
934
+ track: "_track_hheo5_10",
935
+ indicator: "_indicator_hheo5_14"
936
+ }, Xe = {
937
+ s: 20,
938
+ m: 28,
939
+ l: 36
940
+ }, Ze = {
941
+ s: 2,
942
+ m: 2.5,
943
+ l: 3
944
+ };
945
+ //#endregion
946
+ //#region src/components/CircularProgress/CircularProgress.tsx
947
+ function Qe({ ref: e, value: t = 0, size: n = "m", className: r, ...i }) {
948
+ let a = Math.max(0, Math.min(100, t)), o = Xe[n], s = Ze[n], c = (o - s) / 2, l = 2 * Math.PI * c, u = o / 2;
949
+ return /* @__PURE__ */ h("span", {
950
+ ref: e,
951
+ role: "progressbar",
952
+ "aria-valuemin": 0,
953
+ "aria-valuemax": 100,
954
+ "aria-valuenow": Math.round(a),
955
+ className: y(Ye.root, r),
956
+ ...i,
957
+ children: /* @__PURE__ */ g("svg", {
958
+ className: Ye.svg,
959
+ width: o,
960
+ height: o,
961
+ viewBox: `0 0 ${o} ${o}`,
962
+ "aria-hidden": !0,
963
+ children: [/* @__PURE__ */ h("circle", {
964
+ className: Ye.track,
965
+ cx: u,
966
+ cy: u,
967
+ r: c,
968
+ strokeWidth: s,
969
+ fill: "none"
970
+ }), /* @__PURE__ */ h("circle", {
971
+ className: Ye.indicator,
972
+ cx: u,
973
+ cy: u,
974
+ r: c,
975
+ strokeWidth: s,
976
+ strokeLinecap: "round",
977
+ strokeDasharray: l,
978
+ strokeDashoffset: l * (1 - a / 100),
979
+ fill: "none"
980
+ })]
981
+ })
982
+ });
983
+ }
984
+ Qe.displayName = "CircularProgress";
985
+ var $e = { divider: "_divider_fq1ux_1" };
535
986
  //#endregion
536
987
  //#region src/components/Divider/Divider.tsx
537
- function z({ ref: e, className: t, ...r }) {
538
- return /* @__PURE__ */ n("hr", {
988
+ function et({ ref: e, className: t, ...n }) {
989
+ return /* @__PURE__ */ h("hr", {
539
990
  ref: e,
540
- className: h(Se.divider, t),
991
+ className: y($e.divider, t),
992
+ ...n
993
+ });
994
+ }
995
+ et.displayName = "Divider";
996
+ var tt = {
997
+ fixedLayout: "_fixedLayout_1b5hq_1",
998
+ top: "_top_1b5hq_9",
999
+ bottom: "_bottom_1b5hq_14"
1000
+ };
1001
+ //#endregion
1002
+ //#region src/components/FixedLayout/FixedLayout.tsx
1003
+ function nt({ ref: e, vertical: t = "bottom", className: n, ...r }) {
1004
+ return /* @__PURE__ */ h("div", {
1005
+ ref: e,
1006
+ className: y(tt.fixedLayout, tt[t], n),
541
1007
  ...r
542
1008
  });
543
1009
  }
544
- z.displayName = "Divider";
545
- var Ce = { headline: "_headline_17ihj_1" };
1010
+ nt.displayName = "FixedLayout";
1011
+ var rt = { headline: "_headline_17ihj_1" };
546
1012
  //#endregion
547
1013
  //#region src/components/Headline/Headline.tsx
548
- function we({ ref: e, weight: t = "2", className: r, Component: i = "h5", ...a }) {
549
- return /* @__PURE__ */ n(v, {
1014
+ function it({ ref: e, weight: t = "2", className: n, Component: r = "h5", ...i }) {
1015
+ return /* @__PURE__ */ h(N, {
550
1016
  ref: e,
551
1017
  weight: t,
552
- Component: i,
553
- className: h(Ce.headline, r),
554
- ...a
1018
+ Component: r,
1019
+ className: y(rt.headline, n),
1020
+ ...i
555
1021
  });
556
1022
  }
557
- we.displayName = "Headline";
558
- var B = {
559
- base: "_base_wqh9u_1",
560
- body: "_body_wqh9u_7",
561
- ios: "_ios_wqh9u_23",
562
- before: "_before_wqh9u_29",
563
- after: "_after_wqh9u_30",
564
- field: "_field_wqh9u_35",
565
- header: "_header_wqh9u_56",
566
- focused: "_focused_wqh9u_70",
567
- error: "_error_wqh9u_78",
568
- disabled: "_disabled_wqh9u_90"
1023
+ it.displayName = "Headline";
1024
+ var V = {
1025
+ root: "_root_ykq8r_1",
1026
+ edge: "_edge_ykq8r_9",
1027
+ visible: "_visible_ykq8r_25",
1028
+ "edge--start": "_edge--start_ykq8r_29",
1029
+ "edge--end": "_edge--end_ykq8r_34",
1030
+ scroller: "_scroller_ykq8r_39",
1031
+ snap: "_snap_ykq8r_72"
1032
+ }, at = 4;
1033
+ function ot({ ref: e, snap: t = !1, fade: n = !0, className: r, children: a, ...s }) {
1034
+ let c = u(null), [l, f] = d({
1035
+ start: !1,
1036
+ end: !1
1037
+ }), p = u({
1038
+ down: !1,
1039
+ moved: !1,
1040
+ startX: 0,
1041
+ startScroll: 0
1042
+ }), _ = i(() => {
1043
+ let e = c.current;
1044
+ if (!e) return;
1045
+ let t = e.scrollLeft > 1, n = e.scrollLeft < e.scrollWidth - e.clientWidth - 1;
1046
+ f((e) => e.start === t && e.end === n ? e : {
1047
+ start: t,
1048
+ end: n
1049
+ });
1050
+ }, []);
1051
+ o(() => {
1052
+ let e = c.current;
1053
+ if (!e) return;
1054
+ _(), e.addEventListener("scroll", _, { passive: !0 });
1055
+ let t = typeof ResizeObserver < "u" ? new ResizeObserver(_) : null;
1056
+ return t?.observe(e), () => {
1057
+ e.removeEventListener("scroll", _), t?.disconnect();
1058
+ };
1059
+ }, [_]);
1060
+ let v = (e) => {
1061
+ if (e.pointerType !== "mouse" || e.button !== 0) return;
1062
+ let t = c.current;
1063
+ t && (p.current = {
1064
+ down: !0,
1065
+ moved: !1,
1066
+ startX: e.clientX,
1067
+ startScroll: t.scrollLeft
1068
+ });
1069
+ }, b = (e) => {
1070
+ let t = p.current, n = c.current;
1071
+ if (!t.down || !n) return;
1072
+ let r = e.clientX - t.startX;
1073
+ if (!t.moved) {
1074
+ if (Math.abs(r) < at) return;
1075
+ t.moved = !0, n.setPointerCapture(e.pointerId), n.dataset.grabbing = "true", n.style.scrollBehavior = "auto";
1076
+ }
1077
+ e.preventDefault(), n.scrollLeft = t.startScroll - r;
1078
+ }, x = (e) => {
1079
+ let t = c.current;
1080
+ t && p.current.moved && (t.releasePointerCapture?.(e.pointerId), delete t.dataset.grabbing, t.style.scrollBehavior = ""), p.current.down = !1;
1081
+ };
1082
+ return /* @__PURE__ */ g("div", {
1083
+ ref: e,
1084
+ className: y(V.root, r),
1085
+ "data-start": n ? String(l.start) : void 0,
1086
+ "data-end": n ? String(l.end) : void 0,
1087
+ ...s,
1088
+ children: [n ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
1089
+ className: y(V.edge, V["edge--start"], l.start && V.visible),
1090
+ "aria-hidden": !0
1091
+ }), /* @__PURE__ */ h("span", {
1092
+ className: y(V.edge, V["edge--end"], l.end && V.visible),
1093
+ "aria-hidden": !0
1094
+ })] }) : null, /* @__PURE__ */ h("div", {
1095
+ ref: c,
1096
+ className: y(V.scroller, t && V.snap),
1097
+ onPointerDown: v,
1098
+ onPointerMove: b,
1099
+ onPointerUp: x,
1100
+ onPointerCancel: x,
1101
+ onDragStart: (e) => e.preventDefault(),
1102
+ onClickCapture: (e) => {
1103
+ p.current.moved && (e.stopPropagation(), p.current.moved = !1);
1104
+ },
1105
+ children: a
1106
+ })]
1107
+ });
1108
+ }
1109
+ ot.displayName = "HorizontalScroll";
1110
+ var H = {
1111
+ iconButton: "_iconButton_1ifh1_1",
1112
+ circle: "_circle_1ifh1_15",
1113
+ s: "_s_1ifh1_19",
1114
+ m: "_m_1ifh1_24",
1115
+ l: "_l_1ifh1_29",
1116
+ ios: "_ios_1ifh1_42",
1117
+ icon: "_icon_1ifh1_1",
1118
+ "mode-bezeled": "_mode-bezeled_1ifh1_67",
1119
+ "mode-plain": "_mode-plain_1ifh1_72",
1120
+ "mode-gray": "_mode-gray_1ifh1_76",
1121
+ "mode-outline": "_mode-outline_1ifh1_81"
1122
+ }, st = _(H.iconButton, {
1123
+ variants: {
1124
+ mode: {
1125
+ bezeled: H["mode-bezeled"],
1126
+ plain: H["mode-plain"],
1127
+ gray: H["mode-gray"],
1128
+ outline: H["mode-outline"]
1129
+ },
1130
+ size: {
1131
+ s: H.s,
1132
+ m: H.m,
1133
+ l: H.l
1134
+ },
1135
+ circle: { true: H.circle },
1136
+ platform: {
1137
+ ios: H.ios,
1138
+ base: null
1139
+ }
1140
+ },
1141
+ defaultVariants: {
1142
+ mode: "plain",
1143
+ size: "m"
1144
+ }
1145
+ });
1146
+ //#endregion
1147
+ //#region src/components/IconButton/IconButton.tsx
1148
+ function ct({ ref: e, Component: t = "button", mode: n = "plain", size: r = "m", circle: i = !1, type: a, className: o, children: s, ...c }) {
1149
+ let { platform: l } = F();
1150
+ return /* @__PURE__ */ h(be, {
1151
+ ref: e,
1152
+ Component: t,
1153
+ type: t === "button" ? a ?? "button" : a,
1154
+ className: y(st({
1155
+ mode: n,
1156
+ size: r,
1157
+ circle: i,
1158
+ platform: l
1159
+ }), o),
1160
+ ...c,
1161
+ children: /* @__PURE__ */ h("span", {
1162
+ className: H.icon,
1163
+ children: s
1164
+ })
1165
+ });
1166
+ }
1167
+ ct.displayName = "IconButton";
1168
+ var lt = {
1169
+ frame: "_frame_1q5rs_1",
1170
+ bordered: "_bordered_1q5rs_10",
1171
+ img: "_img_1q5rs_14",
1172
+ loading: "_loading_1q5rs_21",
1173
+ placeholder: "_placeholder_1q5rs_25",
1174
+ fallback: "_fallback_1q5rs_26",
1175
+ "tgui-image-shimmer": "_tgui-image-shimmer_1q5rs_1"
1176
+ }, ut = /* @__PURE__ */ h("svg", {
1177
+ viewBox: "0 0 24 24",
1178
+ fill: "none",
1179
+ "aria-hidden": !0,
1180
+ children: /* @__PURE__ */ h("path", {
1181
+ d: "M3 5h18v14H3zM3 15l5-5 4 4 3-3 6 6",
1182
+ stroke: "currentColor",
1183
+ strokeWidth: "1.6",
1184
+ strokeLinejoin: "round"
1185
+ })
1186
+ });
1187
+ function dt({ ref: e, size: t, width: n, height: r, aspectRatio: i, fit: a = "cover", radius: o, bordered: s = !1, fallback: c = ut, src: l, alt: u = "", className: f, style: p, onLoad: m, onError: _, ...v }) {
1188
+ let [b, x] = d(null), [S, C] = d(!1), w = l != null && l === b, T = {
1189
+ ...p,
1190
+ width: t ?? n,
1191
+ height: t ?? r,
1192
+ aspectRatio: i,
1193
+ borderRadius: o === "full" ? "50%" : o,
1194
+ "--tgui--image--fit": a
1195
+ };
1196
+ return /* @__PURE__ */ g("div", {
1197
+ className: y(lt.frame, s && lt.bordered, !S && lt.loading, f),
1198
+ style: T,
1199
+ children: [
1200
+ l != null && !w ? /* @__PURE__ */ h("img", {
1201
+ ref: e,
1202
+ className: lt.img,
1203
+ src: l,
1204
+ alt: u,
1205
+ draggable: !1,
1206
+ onLoad: (e) => {
1207
+ C(!0), m?.(e);
1208
+ },
1209
+ onError: (e) => {
1210
+ x(l), _?.(e);
1211
+ },
1212
+ ...v
1213
+ }) : null,
1214
+ !S && !w ? /* @__PURE__ */ h("div", {
1215
+ className: lt.placeholder,
1216
+ "aria-hidden": !0
1217
+ }) : null,
1218
+ w ? /* @__PURE__ */ h("div", {
1219
+ className: lt.fallback,
1220
+ "aria-hidden": !0,
1221
+ children: c
1222
+ }) : null
1223
+ ]
1224
+ });
1225
+ }
1226
+ dt.displayName = "Image";
1227
+ var U = {
1228
+ base: "_base_1k0ze_1",
1229
+ body: "_body_1k0ze_7",
1230
+ ios: "_ios_1k0ze_23",
1231
+ "align-start": "_align-start_1k0ze_29",
1232
+ before: "_before_1k0ze_33",
1233
+ after: "_after_1k0ze_34",
1234
+ header: "_header_1k0ze_39",
1235
+ focused: "_focused_1k0ze_53",
1236
+ error: "_error_1k0ze_61",
1237
+ disabled: "_disabled_1k0ze_73"
569
1238
  };
570
1239
  //#endregion
571
- //#region src/components/Input/Input.tsx
572
- function Te({ ref: e, type: t = "text", header: i, before: a, after: o, status: s, disabled: c, className: l, onFocus: u, onBlur: d, ...f }) {
573
- let { platform: m } = C(), g = m === "ios", [_, v] = p(!1), y = s ?? (_ ? "focused" : "default"), b = g ? E : x;
574
- return /* @__PURE__ */ r("div", {
575
- className: h(g ? B.ios : B.base, y === "error" && B.error, y === "focused" && B.focused, c && B.disabled, l),
576
- "aria-disabled": c || void 0,
577
- children: [/* @__PURE__ */ r("label", {
578
- className: B.body,
1240
+ //#region src/components/FormField/FormField.tsx
1241
+ function ft({ ref: e, ios: t = !1, status: n = "default", disabled: r = !1, alignStart: i = !1, header: a, before: o, after: s, className: c, children: l }) {
1242
+ return /* @__PURE__ */ g("div", {
1243
+ ref: e,
1244
+ className: y(t ? U.ios : U.base, n === "error" && U.error, n === "focused" && U.focused, r && U.disabled, i && U["align-start"], c),
1245
+ "aria-disabled": r || void 0,
1246
+ children: [/* @__PURE__ */ g("label", {
1247
+ className: U.body,
579
1248
  children: [
580
- a == null ? null : /* @__PURE__ */ n("span", {
581
- className: B.before,
582
- children: a
583
- }),
584
- /* @__PURE__ */ n(b, {
585
- ref: e,
586
- Component: "input",
587
- className: B.field,
588
- type: t,
589
- disabled: c,
590
- onFocus: (e) => {
591
- c || v(!0), u?.(e);
592
- },
593
- onBlur: (e) => {
594
- v(!1), d?.(e);
595
- },
596
- ...f
597
- }),
598
- o == null ? null : /* @__PURE__ */ n("span", {
599
- className: B.after,
1249
+ o == null ? null : /* @__PURE__ */ h("span", {
1250
+ className: U.before,
600
1251
  children: o
1252
+ }),
1253
+ l,
1254
+ s == null ? null : /* @__PURE__ */ h("span", {
1255
+ className: U.after,
1256
+ children: s
601
1257
  })
602
1258
  ]
603
- }), i != null && !g ? /* @__PURE__ */ n("span", {
604
- className: B.header,
605
- children: i
1259
+ }), a != null && !t ? /* @__PURE__ */ h("span", {
1260
+ className: U.header,
1261
+ children: a
606
1262
  }) : null]
607
1263
  });
608
1264
  }
609
- Te.displayName = "Input";
1265
+ ft.displayName = "FormField";
1266
+ var pt = { field: "_field_11zrf_1" };
1267
+ //#endregion
1268
+ //#region src/components/Input/Input.tsx
1269
+ function mt({ ref: e, type: t = "text", header: n, before: r, after: i, status: a, disabled: o, className: s, onFocus: c, onBlur: l, ...u }) {
1270
+ let { platform: f } = F(), p = f === "ios", [m, g] = d(!1);
1271
+ return /* @__PURE__ */ h(ft, {
1272
+ ios: p,
1273
+ status: a ?? (m ? "focused" : "default"),
1274
+ disabled: o,
1275
+ header: n,
1276
+ before: r,
1277
+ after: i,
1278
+ className: s,
1279
+ children: /* @__PURE__ */ h(p ? I : P, {
1280
+ ref: e,
1281
+ Component: "input",
1282
+ className: pt.field,
1283
+ type: t,
1284
+ disabled: o,
1285
+ onFocus: (e) => {
1286
+ o || g(!0), c?.(e);
1287
+ },
1288
+ onBlur: (e) => {
1289
+ g(!1), l?.(e);
1290
+ },
1291
+ ...u
1292
+ })
1293
+ });
1294
+ }
1295
+ mt.displayName = "Input";
610
1296
  //#endregion
611
1297
  //#region src/components/LargeTitle/LargeTitle.module.css
612
- var Ee = { "large-title": "_large-title_15hug_1" };
1298
+ var ht = { "large-title": "_large-title_15hug_1" };
613
1299
  //#endregion
614
1300
  //#region src/components/LargeTitle/LargeTitle.tsx
615
- function De({ ref: e, weight: t = "1", className: r, Component: i = "h1", ...a }) {
616
- return /* @__PURE__ */ n(v, {
1301
+ function gt({ ref: e, weight: t = "1", className: n, Component: r = "h1", ...i }) {
1302
+ return /* @__PURE__ */ h(N, {
617
1303
  ref: e,
618
1304
  weight: t,
619
- Component: i,
620
- className: h(Ee["large-title"], r),
621
- ...a
1305
+ Component: r,
1306
+ className: y(ht["large-title"], n),
1307
+ ...i
622
1308
  });
623
1309
  }
624
- De.displayName = "LargeTitle";
625
- var Oe = {
1310
+ gt.displayName = "LargeTitle";
1311
+ var _t = {
1312
+ link: "_link_1ylyy_1",
1313
+ icon: "_icon_1ylyy_18"
1314
+ };
1315
+ //#endregion
1316
+ //#region src/components/Link/Link.tsx
1317
+ function vt({ ref: e, target: t, rel: n, className: r, children: i, ...a }) {
1318
+ let o = t === "_blank";
1319
+ return /* @__PURE__ */ g("a", {
1320
+ ref: e,
1321
+ target: t,
1322
+ rel: o ? n ?? "noopener noreferrer" : n,
1323
+ className: y(_t.link, r),
1324
+ ...a,
1325
+ children: [i, o ? /* @__PURE__ */ h("svg", {
1326
+ className: _t.icon,
1327
+ viewBox: "0 0 16 16",
1328
+ fill: "none",
1329
+ "aria-hidden": !0,
1330
+ children: /* @__PURE__ */ h("path", {
1331
+ d: "M6 3h7v7M13 3l-8 8",
1332
+ stroke: "currentColor",
1333
+ strokeWidth: "1.6",
1334
+ strokeLinecap: "round",
1335
+ strokeLinejoin: "round"
1336
+ })
1337
+ }) : null]
1338
+ });
1339
+ }
1340
+ vt.displayName = "Link";
1341
+ var yt = {
626
1342
  list: "_list_1rhgw_1",
627
1343
  ios: "_ios_1rhgw_5"
628
1344
  };
629
1345
  //#endregion
630
1346
  //#region src/components/List/List.tsx
631
- function ke({ ref: e, Component: t = "div", className: r, children: i, ...a }) {
632
- let { platform: o } = C();
633
- return /* @__PURE__ */ n(t, {
1347
+ function bt({ ref: e, Component: t = "div", className: n, children: r, ...i }) {
1348
+ let { platform: a } = F();
1349
+ return /* @__PURE__ */ h(t, {
634
1350
  ref: e,
635
- className: h(Oe.list, o === "ios" && Oe.ios, r),
636
- ...a,
637
- children: i
1351
+ className: y(yt.list, a === "ios" && yt.ios, n),
1352
+ ...i,
1353
+ children: r
638
1354
  });
639
1355
  }
640
- ke.displayName = "List";
1356
+ bt.displayName = "List";
1357
+ var xt = {
1358
+ pinInput: "_pinInput_fn21m_1",
1359
+ cell: "_cell_fn21m_6"
1360
+ }, St = {
1361
+ numeric: /[0-9]/,
1362
+ alphanumeric: /[a-z0-9]/i
1363
+ };
1364
+ function Ct({ ref: e, length: t = 4, value: n, defaultValue: r = "", onChange: i, onComplete: a, type: o = "numeric", mask: s = !1, disabled: c = !1, invalid: f = !1, name: p, "aria-label": m = "Verification code", className: g }) {
1365
+ let [_, v] = d(r.slice(0, t)), b = n ?? _, x = l(() => {
1366
+ let e = b.split("").slice(0, t);
1367
+ for (; e.length < t;) e.push("");
1368
+ return e;
1369
+ }, [b, t]), S = u([]), C = St[o], w = (e) => {
1370
+ let r = e.join("");
1371
+ n ?? v(r), i?.(r), r.length === t && e.every(Boolean) && a?.(r);
1372
+ }, T = (e) => {
1373
+ let n = Math.max(0, Math.min(t - 1, e));
1374
+ S.current[n]?.focus(), S.current[n]?.select();
1375
+ }, E = (e, t) => {
1376
+ let n = t.split("").reverse().find((e) => C.test(e));
1377
+ if (!n) return;
1378
+ let r = [...x];
1379
+ r[e] = n, w(r), T(e + 1);
1380
+ }, D = (e, t) => {
1381
+ if (t.key === "Backspace") {
1382
+ t.preventDefault();
1383
+ let n = [...x];
1384
+ n[e] ? (n[e] = "", w(n)) : e > 0 && (n[e - 1] = "", w(n), T(e - 1));
1385
+ } else t.key === "ArrowLeft" ? (t.preventDefault(), T(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), T(e + 1));
1386
+ }, O = (e, n) => {
1387
+ n.preventDefault();
1388
+ let r = n.clipboardData.getData("text").split("").filter((e) => C.test(e));
1389
+ if (r.length === 0) return;
1390
+ let i = [...x];
1391
+ for (let n = 0; n < r.length && e + n < t; n += 1) i[e + n] = r[n];
1392
+ w(i), T(e + r.length);
1393
+ };
1394
+ return /* @__PURE__ */ h("div", {
1395
+ ref: e,
1396
+ className: y(xt.pinInput, g),
1397
+ role: "group",
1398
+ "aria-label": m,
1399
+ "data-invalid": f || void 0,
1400
+ children: x.map((e, t) => /* @__PURE__ */ h("input", {
1401
+ ref: (e) => {
1402
+ S.current[t] = e;
1403
+ },
1404
+ className: xt.cell,
1405
+ type: s ? "password" : "text",
1406
+ inputMode: o === "numeric" ? "numeric" : "text",
1407
+ autoComplete: t === 0 ? "one-time-code" : "off",
1408
+ name: p ? `${p}-${t}` : void 0,
1409
+ "aria-label": `${m}, digit ${t + 1}`,
1410
+ maxLength: 1,
1411
+ value: e,
1412
+ disabled: c,
1413
+ onChange: (e) => E(t, e.target.value),
1414
+ onKeyDown: (e) => D(t, e),
1415
+ onPaste: (e) => O(t, e),
1416
+ onFocus: (e) => e.target.select()
1417
+ }, t))
1418
+ });
1419
+ }
1420
+ Ct.displayName = "PinInput";
641
1421
  //#endregion
642
1422
  //#region src/components/Title/Title.module.css
643
- var V = {
1423
+ var wt = {
644
1424
  "level-1": "_level-1_rosk9_1",
645
1425
  "level-2": "_level-2_rosk9_6",
646
1426
  "level-3": "_level-3_rosk9_11"
647
- }, Ae = {
1427
+ }, Tt = {
648
1428
  1: {
649
1429
  tag: "h2",
650
- className: V["level-1"]
1430
+ className: wt["level-1"]
651
1431
  },
652
1432
  2: {
653
1433
  tag: "h3",
654
- className: V["level-2"]
1434
+ className: wt["level-2"]
655
1435
  },
656
1436
  3: {
657
1437
  tag: "h4",
658
- className: V["level-3"]
1438
+ className: wt["level-3"]
659
1439
  }
660
1440
  };
661
1441
  //#endregion
662
1442
  //#region src/components/Title/Title.tsx
663
- function H({ ref: e, level: t = "2", Component: r, className: i, ...a }) {
664
- let { tag: o, className: s } = Ae[t];
665
- return /* @__PURE__ */ n(v, {
1443
+ function Et({ ref: e, level: t = "2", Component: n, className: r, ...i }) {
1444
+ let { tag: a, className: o } = Tt[t];
1445
+ return /* @__PURE__ */ h(N, {
666
1446
  ref: e,
667
- Component: r ?? o,
668
- className: h(s, i),
669
- ...a
1447
+ Component: n ?? a,
1448
+ className: y(o, r),
1449
+ ...i
670
1450
  });
671
1451
  }
672
- H.displayName = "Title";
673
- var U = {
1452
+ Et.displayName = "Title";
1453
+ var Dt = {
674
1454
  placeholder: "_placeholder_4t5fq_1",
675
1455
  fields: "_fields_4t5fq_13",
676
1456
  description: "_description_4t5fq_19"
677
1457
  };
678
1458
  //#endregion
679
1459
  //#region src/components/Placeholder/Placeholder.tsx
680
- function je({ ref: e, children: t, header: i, description: a, action: o, className: s, ...c }) {
681
- return /* @__PURE__ */ r("section", {
1460
+ function Ot({ ref: e, children: t, header: n, description: r, action: i, className: a, ...o }) {
1461
+ return /* @__PURE__ */ g("section", {
682
1462
  ref: e,
683
- className: h(U.placeholder, s),
684
- ...c,
1463
+ className: y(Dt.placeholder, a),
1464
+ ...o,
685
1465
  children: [
686
1466
  t,
687
- i != null || a != null ? /* @__PURE__ */ r("dl", {
688
- className: U.fields,
689
- children: [i == null ? null : /* @__PURE__ */ n(H, {
1467
+ n != null || r != null ? /* @__PURE__ */ g("dl", {
1468
+ className: Dt.fields,
1469
+ children: [n == null ? null : /* @__PURE__ */ h(Et, {
690
1470
  Component: "dt",
691
1471
  level: "3",
692
1472
  weight: "2",
693
- children: i
694
- }), a == null ? null : /* @__PURE__ */ n(E, {
1473
+ children: n
1474
+ }), r == null ? null : /* @__PURE__ */ h(I, {
695
1475
  Component: "dd",
696
- className: U.description,
697
- children: a
1476
+ className: Dt.description,
1477
+ children: r
698
1478
  })]
699
1479
  }) : null,
700
- o
1480
+ i
701
1481
  ]
702
1482
  });
703
1483
  }
704
- je.displayName = "Placeholder";
1484
+ Ot.displayName = "Placeholder";
1485
+ //#endregion
1486
+ //#region src/components/Portal/Portal.tsx
1487
+ function kt({ children: e, container: t }) {
1488
+ let { portalContainer: n } = F(), r = t ?? n;
1489
+ return r ? v(e, r) : null;
1490
+ }
1491
+ kt.displayName = "Portal";
1492
+ var At = {
1493
+ track: "_track_5w1vs_1",
1494
+ bar: "_bar_5w1vs_9"
1495
+ };
1496
+ //#endregion
1497
+ //#region src/components/Progress/Progress.tsx
1498
+ function jt({ ref: e, value: t = 0, className: n, ...r }) {
1499
+ let i = Math.max(0, Math.min(100, t));
1500
+ return /* @__PURE__ */ h("div", {
1501
+ ref: e,
1502
+ role: "progressbar",
1503
+ "aria-valuemin": 0,
1504
+ "aria-valuemax": 100,
1505
+ "aria-valuenow": Math.round(i),
1506
+ className: y(At.track, n),
1507
+ ...r,
1508
+ children: /* @__PURE__ */ h("div", {
1509
+ className: At.bar,
1510
+ style: { width: `${i}%` }
1511
+ })
1512
+ });
1513
+ }
1514
+ jt.displayName = "Progress";
1515
+ var Mt = {
1516
+ radio: "_radio_czv9z_1",
1517
+ input: "_input_czv9z_12",
1518
+ dot: "_dot_czv9z_22"
1519
+ };
1520
+ //#endregion
1521
+ //#region src/components/Radio/Radio.tsx
1522
+ function Nt({ ref: e, disabled: t, className: n, style: r, ...i }) {
1523
+ return /* @__PURE__ */ g("span", {
1524
+ className: y(Mt.radio, n),
1525
+ style: r,
1526
+ "data-disabled": t || void 0,
1527
+ children: [/* @__PURE__ */ h("input", {
1528
+ ref: e,
1529
+ type: "radio",
1530
+ className: Mt.input,
1531
+ disabled: t,
1532
+ ...i
1533
+ }), /* @__PURE__ */ h("span", {
1534
+ className: Mt.dot,
1535
+ "aria-hidden": !0
1536
+ })]
1537
+ });
1538
+ }
1539
+ Nt.displayName = "Radio";
705
1540
  var W = {
1541
+ rating: "_rating_pfqty_1",
1542
+ row: "_row_pfqty_7",
1543
+ empty: "_empty_pfqty_12",
1544
+ fill: "_fill_pfqty_16",
1545
+ star: "_star_pfqty_29",
1546
+ interactive: "_interactive_pfqty_41"
1547
+ }, Pt = /* @__PURE__ */ h("svg", {
1548
+ viewBox: "0 0 24 24",
1549
+ fill: "currentColor",
1550
+ "aria-hidden": !0,
1551
+ children: /* @__PURE__ */ h("path", { d: "M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.8 5.9 20.4l1.4-6.8L2.2 9.1l6.9-.8z" })
1552
+ });
1553
+ function Ft({ ref: e, value: t, defaultValue: n = 0, onChange: r, count: i = 5, readOnly: a = !1, disabled: o = !1, icon: s = Pt, name: c, "aria-label": l = "Rating", className: u }) {
1554
+ let [f, p] = d(n), m = t ?? f, [_, v] = d(null), b = !a && !o, x = Math.max(0, Math.min(1, (_ ?? m) / i)) * 100, S = (e) => {
1555
+ b && (t ?? p(e), r?.(e));
1556
+ }, C = (e) => {
1557
+ b && (e.key === "ArrowRight" || e.key === "ArrowUp" ? (e.preventDefault(), S(Math.min(i, Math.round(m) + 1))) : (e.key === "ArrowLeft" || e.key === "ArrowDown") && (e.preventDefault(), S(Math.max(0, Math.round(m) - 1))));
1558
+ }, w = Array.from({ length: i }, (e, t) => t + 1), T = b ? {
1559
+ onKeyDown: C,
1560
+ onMouseLeave: () => v(null)
1561
+ } : {}, E = b ? "radiogroup" : "img", D = b ? l : `${l}: ${m} out of ${i}`;
1562
+ return /* @__PURE__ */ g("div", {
1563
+ ref: e,
1564
+ className: y(W.rating, b && W.interactive, u),
1565
+ "data-disabled": o || void 0,
1566
+ role: E,
1567
+ "aria-label": D,
1568
+ ...T,
1569
+ children: [/* @__PURE__ */ h("div", {
1570
+ className: y(W.row, W.empty),
1571
+ "aria-hidden": !b,
1572
+ children: w.map((e) => b ? /* @__PURE__ */ h("button", {
1573
+ type: "button",
1574
+ role: "radio",
1575
+ "aria-checked": Math.round(m) === e,
1576
+ "aria-label": `${e}`,
1577
+ tabIndex: e === (Math.round(m) || 1) ? 0 : -1,
1578
+ name: c,
1579
+ className: W.star,
1580
+ onClick: () => S(e),
1581
+ onMouseEnter: () => v(e),
1582
+ onFocus: () => v(e),
1583
+ onBlur: () => v(null),
1584
+ children: s
1585
+ }, e) : /* @__PURE__ */ h("span", {
1586
+ className: W.star,
1587
+ children: s
1588
+ }, e))
1589
+ }), /* @__PURE__ */ h("div", {
1590
+ className: W.fill,
1591
+ style: { clipPath: `inset(0 ${100 - x}% 0 0)` },
1592
+ "aria-hidden": !0,
1593
+ children: /* @__PURE__ */ h("div", {
1594
+ className: W.row,
1595
+ children: w.map((e) => /* @__PURE__ */ h("span", {
1596
+ className: W.star,
1597
+ children: s
1598
+ }, e))
1599
+ })
1600
+ })]
1601
+ });
1602
+ }
1603
+ Ft.displayName = "Rating";
1604
+ var G = {
706
1605
  body: "_body_1o4ef_1",
707
1606
  sectionBase: "_sectionBase_1o4ef_6",
708
1607
  bodyWithHeader: "_bodyWithHeader_1o4ef_6",
@@ -717,86 +1616,153 @@ var W = {
717
1616
  };
718
1617
  //#endregion
719
1618
  //#region src/components/Section/SectionFooter.tsx
720
- function Me({ ios: e, children: t }) {
721
- return e ? /* @__PURE__ */ n(j, {
722
- className: W.footerText,
1619
+ function It({ ios: e, children: t }) {
1620
+ return e ? /* @__PURE__ */ h(R, {
1621
+ className: G.footerText,
723
1622
  children: t
724
- }) : /* @__PURE__ */ n(x, {
1623
+ }) : /* @__PURE__ */ h(P, {
725
1624
  level: "2",
726
- className: W.footerText,
1625
+ className: G.footerText,
727
1626
  children: t
728
1627
  });
729
1628
  }
730
- function G({ ref: e, centered: t = !1, className: r, children: i, ...a }) {
731
- let { platform: o } = C(), s = o === "ios";
732
- return /* @__PURE__ */ n("footer", {
1629
+ function Lt({ ref: e, centered: t = !1, className: n, children: r, ...i }) {
1630
+ let { platform: a } = F(), o = a === "ios";
1631
+ return /* @__PURE__ */ h("footer", {
733
1632
  ref: e,
734
- className: h(W.footer, s && W.footerIos, t && W.footerCentered, r),
735
- ...a,
736
- children: /* @__PURE__ */ n(Me, {
737
- ios: s,
738
- children: i
1633
+ className: y(G.footer, o && G.footerIos, t && G.footerCentered, n),
1634
+ ...i,
1635
+ children: /* @__PURE__ */ h(It, {
1636
+ ios: o,
1637
+ children: r
739
1638
  })
740
1639
  });
741
1640
  }
742
- G.displayName = "SectionFooter";
1641
+ Lt.displayName = "SectionFooter";
743
1642
  //#endregion
744
1643
  //#region src/components/Section/SectionHeader.tsx
745
- function Ne({ ios: e, large: t, children: r }) {
746
- return t ? e ? /* @__PURE__ */ n(x, {
1644
+ function Rt({ ios: e, large: t, children: n }) {
1645
+ return t ? e ? /* @__PURE__ */ h(P, {
747
1646
  Component: "h2",
748
1647
  level: "1",
749
1648
  weight: "2",
750
- children: r
751
- }) : /* @__PURE__ */ n(E, {
1649
+ children: n
1650
+ }) : /* @__PURE__ */ h(I, {
752
1651
  Component: "h2",
753
1652
  weight: "2",
754
- children: r
755
- }) : e ? /* @__PURE__ */ n(j, {
1653
+ children: n
1654
+ }) : e ? /* @__PURE__ */ h(R, {
756
1655
  Component: "h2",
757
1656
  caps: !0,
758
- children: r
759
- }) : /* @__PURE__ */ n(x, {
1657
+ children: n
1658
+ }) : /* @__PURE__ */ h(P, {
760
1659
  Component: "h2",
761
1660
  level: "2",
762
1661
  weight: "2",
763
- children: r
1662
+ children: n
764
1663
  });
765
1664
  }
766
- function K({ ref: e, large: t = !1, className: r, children: i, ...a }) {
767
- let { platform: o } = C(), s = o === "ios";
768
- return /* @__PURE__ */ n("header", {
1665
+ function zt({ ref: e, large: t = !1, className: n, children: r, ...i }) {
1666
+ let { platform: a } = F(), o = a === "ios";
1667
+ return /* @__PURE__ */ h("header", {
769
1668
  ref: e,
770
- className: h(W.header, s && W.headerIos, t && W.headerLarge, r),
771
- ...a,
772
- children: /* @__PURE__ */ n(Ne, {
773
- ios: s,
1669
+ className: y(G.header, o && G.headerIos, t && G.headerLarge, n),
1670
+ ...i,
1671
+ children: /* @__PURE__ */ h(Rt, {
1672
+ ios: o,
774
1673
  large: t,
775
- children: i
1674
+ children: r
776
1675
  })
777
1676
  });
778
1677
  }
779
- K.displayName = "SectionHeader";
1678
+ zt.displayName = "SectionHeader";
780
1679
  //#endregion
781
1680
  //#region src/components/Section/Section.tsx
782
- var q = (e) => typeof e == "string" || typeof e == "number";
783
- function J({ ref: e, header: t, footer: o, className: c, children: l, ...u }) {
784
- let { platform: d } = C(), f = i.toArray(l);
785
- return /* @__PURE__ */ r("section", {
786
- ref: e,
787
- className: h(d === "ios" ? W.sectionIos : W.sectionBase, c),
788
- ...u,
789
- children: [/* @__PURE__ */ r("div", {
790
- className: W.bodyWithHeader,
791
- children: [q(t) ? /* @__PURE__ */ n(K, { children: t }) : t, /* @__PURE__ */ n("div", {
792
- className: W.body,
793
- children: f.map((e, t) => /* @__PURE__ */ r(a, { children: [e, t < f.length - 1 ? /* @__PURE__ */ n(z, {}) : null] }, s(e) ? e.key : t))
1681
+ var Bt = (e) => typeof e == "string" || typeof e == "number";
1682
+ function Vt({ ref: n, header: i, footer: a, className: o, children: s, ...c }) {
1683
+ let { platform: l } = F(), u = e.toArray(s);
1684
+ return /* @__PURE__ */ g("section", {
1685
+ ref: n,
1686
+ className: y(l === "ios" ? G.sectionIos : G.sectionBase, o),
1687
+ ...c,
1688
+ children: [/* @__PURE__ */ g("div", {
1689
+ className: G.bodyWithHeader,
1690
+ children: [Bt(i) ? /* @__PURE__ */ h(zt, { children: i }) : i, /* @__PURE__ */ h("div", {
1691
+ className: G.body,
1692
+ children: u.map((e, n) => /* @__PURE__ */ g(t, { children: [e, n < u.length - 1 ? /* @__PURE__ */ h(et, {}) : null] }, r(e) ? e.key : n))
794
1693
  })]
795
- }), q(o) ? /* @__PURE__ */ n(G, { children: o }) : o]
1694
+ }), Bt(a) ? /* @__PURE__ */ h(Lt, { children: a }) : a]
796
1695
  });
797
1696
  }
798
- J.displayName = "Section", J.Header = K, J.Footer = G;
799
- var Y = {
1697
+ Vt.displayName = "Section", Vt.Header = zt, Vt.Footer = Lt;
1698
+ var Ht = {
1699
+ control: "_control_1uo8p_1",
1700
+ pill: "_pill_1uo8p_10",
1701
+ item: "_item_1uo8p_28"
1702
+ };
1703
+ //#endregion
1704
+ //#region src/components/SegmentedControl/SegmentedControl.tsx
1705
+ function Ut({ ref: e, className: t, children: n, onKeyDown: r, ...a }) {
1706
+ let s = u(null), [l, f] = d(null), p = i(() => {
1707
+ let e = s.current;
1708
+ if (!e) return;
1709
+ let t = e.querySelector("[role=\"radio\"][data-selected]"), n = t ? {
1710
+ left: t.offsetLeft,
1711
+ width: t.offsetWidth
1712
+ } : null;
1713
+ f((e) => e === n || e && n && e.left === n.left && e.width === n.width ? e : n);
1714
+ }, []);
1715
+ c(p), o(() => {
1716
+ let e = s.current;
1717
+ if (!e || typeof ResizeObserver > "u") return;
1718
+ let t = new ResizeObserver(p);
1719
+ return t.observe(e), () => t.disconnect();
1720
+ }, [p]);
1721
+ let m = i((t) => {
1722
+ s.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
1723
+ }, [e]);
1724
+ return /* @__PURE__ */ g("div", {
1725
+ ref: m,
1726
+ role: "radiogroup",
1727
+ className: y(Ht.control, t),
1728
+ onKeyDown: (e) => {
1729
+ if (r?.(e), e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
1730
+ let t = s.current;
1731
+ if (!t) return;
1732
+ let n = Array.from(t.querySelectorAll("[role=\"radio\"]:not(:disabled)")), i = n.indexOf(document.activeElement);
1733
+ if (i < 0) return;
1734
+ e.preventDefault();
1735
+ let a = n[(i + (e.key === "ArrowRight" ? 1 : -1) + n.length) % n.length];
1736
+ a.focus(), a.click();
1737
+ },
1738
+ ...a,
1739
+ children: [/* @__PURE__ */ h("div", {
1740
+ className: Ht.pill,
1741
+ style: l ? {
1742
+ transform: `translateX(${l.left}px)`,
1743
+ width: l.width
1744
+ } : { opacity: 0 },
1745
+ "aria-hidden": !0
1746
+ }), n]
1747
+ });
1748
+ }
1749
+ Ut.displayName = "SegmentedControl";
1750
+ //#endregion
1751
+ //#region src/components/SegmentedControl/SegmentedControlItem.tsx
1752
+ function Wt({ ref: e, selected: t = !1, className: n, ...r }) {
1753
+ return /* @__PURE__ */ h("button", {
1754
+ ref: e,
1755
+ type: "button",
1756
+ role: "radio",
1757
+ "aria-checked": t,
1758
+ tabIndex: t ? 0 : -1,
1759
+ "data-selected": t || void 0,
1760
+ className: y(Ht.item, n),
1761
+ ...r
1762
+ });
1763
+ }
1764
+ Wt.displayName = "SegmentedControlItem";
1765
+ var K = {
800
1766
  base: "_base_yxki5_1",
801
1767
  row: "_row_yxki5_7",
802
1768
  ios: "_ios_yxki5_17",
@@ -809,38 +1775,593 @@ var Y = {
809
1775
  };
810
1776
  //#endregion
811
1777
  //#region src/components/Select/Select.tsx
812
- function Pe({ ref: e, header: t, status: i, disabled: a, className: o, onFocus: s, onBlur: c, children: l, ...u }) {
813
- let { platform: d } = C(), f = d === "ios", [m, g] = p(!1), _ = i ?? (m ? "focused" : "default"), v = f ? E : x;
814
- return /* @__PURE__ */ r("div", {
815
- className: h(f ? Y.ios : Y.base, _ === "error" && Y.error, _ === "focused" && Y.focused, a && Y.disabled, o),
816
- "aria-disabled": a || void 0,
817
- children: [/* @__PURE__ */ r("div", {
818
- className: Y.row,
819
- children: [/* @__PURE__ */ n(v, {
1778
+ function Gt({ ref: e, header: t, status: n, disabled: r, className: i, onFocus: a, onBlur: o, children: s, ...c }) {
1779
+ let { platform: l } = F(), u = l === "ios", [f, p] = d(!1), m = n ?? (f ? "focused" : "default"), _ = u ? I : P;
1780
+ return /* @__PURE__ */ g("div", {
1781
+ className: y(u ? K.ios : K.base, m === "error" && K.error, m === "focused" && K.focused, r && K.disabled, i),
1782
+ "aria-disabled": r || void 0,
1783
+ children: [/* @__PURE__ */ g("div", {
1784
+ className: K.row,
1785
+ children: [/* @__PURE__ */ h(_, {
820
1786
  ref: e,
821
1787
  Component: "select",
822
- className: Y.select,
823
- disabled: a,
1788
+ className: K.select,
1789
+ disabled: r,
824
1790
  onFocus: (e) => {
825
- a || g(!0), s?.(e);
1791
+ r || p(!0), a?.(e);
826
1792
  },
827
1793
  onBlur: (e) => {
828
- g(!1), c?.(e);
1794
+ p(!1), o?.(e);
829
1795
  },
830
- ...u,
831
- children: l
832
- }), /* @__PURE__ */ n("span", {
1796
+ ...c,
1797
+ children: s
1798
+ }), /* @__PURE__ */ h("span", {
833
1799
  "aria-hidden": !0,
834
- className: Y.chevron
1800
+ className: K.chevron
835
1801
  })]
836
- }), t != null && !f ? /* @__PURE__ */ n("span", {
837
- className: Y.header,
1802
+ }), t != null && !u ? /* @__PURE__ */ h("span", {
1803
+ className: K.header,
838
1804
  children: t
839
1805
  }) : null]
840
1806
  });
841
1807
  }
842
- Pe.displayName = "Select";
843
- var X = {
1808
+ Gt.displayName = "Select";
1809
+ //#endregion
1810
+ //#region src/shared/lib/useReducedMotion.ts
1811
+ var Kt = "(prefers-reduced-motion: reduce)";
1812
+ function qt(e) {
1813
+ if (typeof window > "u" || !window.matchMedia) return () => {};
1814
+ let t = window.matchMedia(Kt);
1815
+ return t.addEventListener("change", e), () => t.removeEventListener("change", e);
1816
+ }
1817
+ function Jt() {
1818
+ return typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia(Kt).matches;
1819
+ }
1820
+ function Yt() {
1821
+ return f(qt, Jt, () => !1);
1822
+ }
1823
+ var q = {
1824
+ backdrop: "_backdrop_a10cl_1",
1825
+ "backdrop--contained": "_backdrop--contained_a10cl_12",
1826
+ "backdrop--visible": "_backdrop--visible_a10cl_16",
1827
+ panel: "_panel_a10cl_20",
1828
+ "panel--visible": "_panel--visible_a10cl_37",
1829
+ grip: "_grip_a10cl_67",
1830
+ handle: "_handle_a10cl_76",
1831
+ header: "_header_a10cl_84",
1832
+ title: "_title_a10cl_95",
1833
+ close: "_close_a10cl_100",
1834
+ body: "_body_a10cl_105"
1835
+ }, Xt = 340, Zt = 6, Qt = 96, $t = .5;
1836
+ function en(e) {
1837
+ return Array.from(e.querySelectorAll("a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex=\"-1\"])")).filter((e) => e.offsetParent !== null || e === document.activeElement);
1838
+ }
1839
+ function tn({ ref: e, open: t, onClose: n, header: r, children: a, dismissable: s = !0, closeLabel: c = "Close", className: l, container: f }) {
1840
+ let p = Yt(), m = f != null, [_, v] = d(t), [b, x] = d(!1), S = u(null), C = u(null), w = u({
1841
+ id: -1,
1842
+ active: !1,
1843
+ startY: 0,
1844
+ lastY: 0,
1845
+ lastT: 0,
1846
+ velocity: 0
1847
+ });
1848
+ o(() => {
1849
+ if (t) {
1850
+ v(!0);
1851
+ return;
1852
+ }
1853
+ if (x(!1), p) {
1854
+ v(!1);
1855
+ return;
1856
+ }
1857
+ let e = setTimeout(() => v(!1), Xt);
1858
+ return () => clearTimeout(e);
1859
+ }, [t, p]), o(() => {
1860
+ if (!_ || !t) return;
1861
+ let e = S.current;
1862
+ e && (e.offsetHeight, x(!0));
1863
+ }, [_, t]), o(() => {
1864
+ if (!_) return;
1865
+ C.current = document.activeElement;
1866
+ let { body: e, documentElement: t } = document, n = {
1867
+ overflow: e.style.overflow,
1868
+ paddingRight: e.style.paddingRight
1869
+ };
1870
+ if (!m) {
1871
+ let n = window.innerWidth - t.clientWidth;
1872
+ e.style.overflow = "hidden", n > 0 && (e.style.paddingRight = `${n}px`);
1873
+ }
1874
+ let r = requestAnimationFrame(() => S.current?.focus({ preventScroll: !0 }));
1875
+ return () => {
1876
+ cancelAnimationFrame(r), e.style.overflow = n.overflow, e.style.paddingRight = n.paddingRight, C.current?.focus?.({ preventScroll: !0 });
1877
+ };
1878
+ }, [_, m]), o(() => {
1879
+ if (!_) return;
1880
+ let e = (e) => {
1881
+ e.key === "Escape" && s && (e.stopPropagation(), n());
1882
+ };
1883
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1884
+ }, [
1885
+ _,
1886
+ s,
1887
+ n
1888
+ ]);
1889
+ let T = i((e) => {
1890
+ if (e.key !== "Tab" || !S.current) return;
1891
+ let t = en(S.current);
1892
+ if (t.length === 0) {
1893
+ e.preventDefault(), S.current.focus();
1894
+ return;
1895
+ }
1896
+ let n = t[0], r = t[t.length - 1], i = document.activeElement;
1897
+ e.shiftKey && (i === n || i === S.current) ? (e.preventDefault(), r.focus()) : !e.shiftKey && i === r && (e.preventDefault(), n.focus());
1898
+ }, []), E = (e) => {
1899
+ !s || e.button !== 0 || p || e.target.closest("button") || (w.current = {
1900
+ id: e.pointerId,
1901
+ active: !1,
1902
+ startY: e.clientY,
1903
+ lastY: e.clientY,
1904
+ lastT: e.timeStamp,
1905
+ velocity: 0
1906
+ });
1907
+ }, D = (e) => {
1908
+ let t = w.current;
1909
+ if (t.id !== e.pointerId) return;
1910
+ let n = e.clientY - t.startY;
1911
+ if (!t.active) {
1912
+ if (n < Zt) return;
1913
+ t.active = !0, e.currentTarget.setPointerCapture(e.pointerId), S.current && (S.current.style.transition = "none");
1914
+ }
1915
+ let r = e.timeStamp - t.lastT;
1916
+ if (r >= 1) {
1917
+ let n = (e.clientY - t.lastY) / r;
1918
+ t.velocity = t.velocity * .6 + n * .4, t.lastY = e.clientY, t.lastT = e.timeStamp;
1919
+ }
1920
+ S.current && (S.current.style.transform = `translateY(${Math.max(0, n)}px)`);
1921
+ }, O = (e) => {
1922
+ let t = w.current;
1923
+ if (t.id !== e.pointerId || (w.current = {
1924
+ ...t,
1925
+ id: -1,
1926
+ active: !1
1927
+ }, !t.active)) return;
1928
+ e.currentTarget.releasePointerCapture?.(e.pointerId);
1929
+ let r = S.current, i = e.clientY - t.startY > Qt || t.velocity > $t;
1930
+ r && (r.style.transition = "", r.getBoundingClientRect(), r.style.transform = ""), i && (x(!1), n());
1931
+ };
1932
+ if (!_) return null;
1933
+ let k = b && t;
1934
+ return /* @__PURE__ */ h(kt, {
1935
+ container: f,
1936
+ children: /* @__PURE__ */ h("div", {
1937
+ ref: e,
1938
+ className: y(q.backdrop, m && q["backdrop--contained"], k && q["backdrop--visible"]),
1939
+ onPointerDown: (e) => {
1940
+ e.target === e.currentTarget && s && n();
1941
+ },
1942
+ children: /* @__PURE__ */ g("div", {
1943
+ ref: S,
1944
+ role: "dialog",
1945
+ "aria-modal": "true",
1946
+ tabIndex: -1,
1947
+ className: y(q.panel, k && q["panel--visible"], l),
1948
+ onKeyDown: T,
1949
+ children: [/* @__PURE__ */ g("div", {
1950
+ className: q.grip,
1951
+ onPointerDown: E,
1952
+ onPointerMove: D,
1953
+ onPointerUp: O,
1954
+ onPointerCancel: O,
1955
+ children: [s ? /* @__PURE__ */ h("span", {
1956
+ className: q.handle,
1957
+ "aria-hidden": !0
1958
+ }) : null, r == null ? null : /* @__PURE__ */ g("div", {
1959
+ className: q.header,
1960
+ children: [/* @__PURE__ */ h("div", {
1961
+ className: q.title,
1962
+ children: r
1963
+ }), s ? /* @__PURE__ */ h(ct, {
1964
+ mode: "gray",
1965
+ size: "s",
1966
+ circle: !0,
1967
+ className: q.close,
1968
+ "aria-label": c,
1969
+ onClick: n,
1970
+ children: /* @__PURE__ */ h("svg", {
1971
+ width: "16",
1972
+ height: "16",
1973
+ viewBox: "0 0 16 16",
1974
+ "aria-hidden": !0,
1975
+ children: /* @__PURE__ */ h("path", {
1976
+ d: "M4 4l8 8M12 4l-8 8",
1977
+ stroke: "currentColor",
1978
+ strokeWidth: "1.6",
1979
+ strokeLinecap: "round"
1980
+ })
1981
+ })
1982
+ }) : null]
1983
+ })]
1984
+ }), /* @__PURE__ */ h("div", {
1985
+ className: q.body,
1986
+ children: a
1987
+ })]
1988
+ })
1989
+ })
1990
+ });
1991
+ }
1992
+ tn.displayName = "Sheet";
1993
+ var nn = {
1994
+ skeleton: "_skeleton_197j4_1",
1995
+ visible: "_visible_197j4_5",
1996
+ "tgui-skeleton": "_tgui-skeleton_197j4_1"
1997
+ };
1998
+ //#endregion
1999
+ //#region src/components/Skeleton/Skeleton.tsx
2000
+ function rn({ ref: e, visible: t = !0, className: n, children: r, ...i }) {
2001
+ return /* @__PURE__ */ h("div", {
2002
+ ref: e,
2003
+ "aria-hidden": t || void 0,
2004
+ className: y(nn.skeleton, t && nn.visible, n),
2005
+ ...i,
2006
+ children: r
2007
+ });
2008
+ }
2009
+ rn.displayName = "Skeleton";
2010
+ var J = {
2011
+ slider: "_slider_avyl5_1",
2012
+ track: "_track_avyl5_8",
2013
+ rail: "_rail_avyl5_16",
2014
+ fill: "_fill_avyl5_25",
2015
+ input: "_input_avyl5_39",
2016
+ side: "_side_avyl5_98"
2017
+ };
2018
+ //#endregion
2019
+ //#region src/components/Slider/Slider.tsx
2020
+ function an({ ref: e, value: t, defaultValue: n, onChange: r, min: i = 0, max: a = 100, step: o = 1, before: s, after: c, disabled: l, className: u, ...f }) {
2021
+ let [p, m] = d(n ?? i), _ = t ?? p, v = a > i ? (_ - i) / (a - i) * 100 : 0;
2022
+ return /* @__PURE__ */ g("div", {
2023
+ className: y(J.slider, u),
2024
+ "data-disabled": l || void 0,
2025
+ children: [
2026
+ s == null ? null : /* @__PURE__ */ h("span", {
2027
+ className: J.side,
2028
+ children: s
2029
+ }),
2030
+ /* @__PURE__ */ g("span", {
2031
+ className: J.track,
2032
+ children: [
2033
+ /* @__PURE__ */ h("span", { className: J.rail }),
2034
+ /* @__PURE__ */ h("span", {
2035
+ className: J.fill,
2036
+ style: { width: `${Math.max(0, Math.min(100, v))}%` }
2037
+ }),
2038
+ /* @__PURE__ */ h("input", {
2039
+ ref: e,
2040
+ type: "range",
2041
+ className: J.input,
2042
+ min: i,
2043
+ max: a,
2044
+ step: o,
2045
+ value: _,
2046
+ disabled: l,
2047
+ onChange: (e) => {
2048
+ let n = Number(e.target.value);
2049
+ t ?? m(n), r?.(n);
2050
+ },
2051
+ ...f
2052
+ })
2053
+ ]
2054
+ }),
2055
+ c == null ? null : /* @__PURE__ */ h("span", {
2056
+ className: J.side,
2057
+ children: c
2058
+ })
2059
+ ]
2060
+ });
2061
+ }
2062
+ an.displayName = "Slider";
2063
+ //#endregion
2064
+ //#region src/components/Snackbar/context.ts
2065
+ var on = n(null);
2066
+ on.displayName = "SnackbarContext";
2067
+ var Y = {
2068
+ viewport: "_viewport_1rbuf_1",
2069
+ snackbar: "_snackbar_1rbuf_19",
2070
+ "snackbar--visible": "_snackbar--visible_1rbuf_37",
2071
+ "snackbar--dragging": "_snackbar--dragging_1rbuf_50",
2072
+ before: "_before_1rbuf_54",
2073
+ body: "_body_1rbuf_60",
2074
+ message: "_message_1rbuf_69",
2075
+ description: "_description_1rbuf_74",
2076
+ action: "_action_1rbuf_80"
2077
+ }, sn = 240, cn = 80;
2078
+ function ln({ children: e, duration: t = 4e3, max: n = 3 }) {
2079
+ let [r, a] = d([]), o = u(0), s = i((e) => {
2080
+ a((t) => t.filter((t) => t.id !== e));
2081
+ }, []), c = i((e) => {
2082
+ let t = `snackbar-${o.current++}`;
2083
+ return a((r) => [...r, {
2084
+ ...e,
2085
+ id: t
2086
+ }].slice(-n)), t;
2087
+ }, [n]), f = l(() => ({
2088
+ show: c,
2089
+ dismiss: s
2090
+ }), [c, s]);
2091
+ return /* @__PURE__ */ g(on.Provider, {
2092
+ value: f,
2093
+ children: [e, r.length > 0 ? /* @__PURE__ */ h(kt, { children: /* @__PURE__ */ h("div", {
2094
+ className: Y.viewport,
2095
+ children: r.map((e) => /* @__PURE__ */ h(un, {
2096
+ item: e,
2097
+ defaultDuration: t,
2098
+ onDismiss: () => s(e.id)
2099
+ }, e.id))
2100
+ }) }) : null]
2101
+ });
2102
+ }
2103
+ ln.displayName = "SnackbarProvider";
2104
+ function un({ item: e, defaultDuration: t, onDismiss: n }) {
2105
+ let r = Yt(), [a, s] = d(!1), [l, f] = d(!1), p = u(null), m = e.duration ?? t, _ = u(m), v = u(0), b = u(null), x = u({
2106
+ id: -1,
2107
+ startX: 0,
2108
+ active: !1
2109
+ });
2110
+ c(() => {
2111
+ let e = p.current;
2112
+ e && e.offsetHeight, s(!0);
2113
+ }, []);
2114
+ let S = i(() => {
2115
+ if (f(!0), s(!1), r) {
2116
+ n();
2117
+ return;
2118
+ }
2119
+ let e = setTimeout(n, sn);
2120
+ return () => clearTimeout(e);
2121
+ }, [r, n]), C = i(() => {
2122
+ b.current && (clearTimeout(b.current), b.current = null, _.current -= Date.now() - v.current);
2123
+ }, []), w = i(() => {
2124
+ m <= 0 || l || b.current || (v.current = Date.now(), b.current = setTimeout(() => S(), Math.max(0, _.current)));
2125
+ }, [
2126
+ m,
2127
+ l,
2128
+ S
2129
+ ]);
2130
+ o(() => (w(), C), [w, C]);
2131
+ let T = (e) => {
2132
+ e.button === 0 && (x.current = {
2133
+ id: e.pointerId,
2134
+ startX: e.clientX,
2135
+ active: !1
2136
+ }, C());
2137
+ }, E = (e) => {
2138
+ let t = x.current;
2139
+ if (t.id !== e.pointerId) return;
2140
+ let n = e.clientX - t.startX;
2141
+ if (!t.active) {
2142
+ if (Math.abs(n) < 6) return;
2143
+ t.active = !0, e.currentTarget.setPointerCapture(e.pointerId), p.current?.classList.add(Y["snackbar--dragging"]);
2144
+ }
2145
+ p.current && (p.current.style.transform = `translateX(${n}px)`, p.current.style.opacity = `${Math.max(0, 1 - Math.abs(n) / 240)}`);
2146
+ }, D = (e) => {
2147
+ let t = x.current;
2148
+ if (t.id !== e.pointerId) return;
2149
+ x.current = {
2150
+ id: -1,
2151
+ startX: 0,
2152
+ active: !1
2153
+ };
2154
+ let i = p.current;
2155
+ if (!i) return;
2156
+ i.classList.remove(Y["snackbar--dragging"]);
2157
+ let a = e.clientX - t.startX;
2158
+ if (t.active && Math.abs(a) > cn) {
2159
+ if (r) {
2160
+ n();
2161
+ return;
2162
+ }
2163
+ i.style.transition = "transform 0.2s ease-out, opacity 0.2s ease-out", i.style.transform = `translateX(${Math.sign(a) * (window.innerWidth || 400)}px)`, i.style.opacity = "0", setTimeout(n, 190);
2164
+ return;
2165
+ }
2166
+ i.style.transform = "", i.style.opacity = "", w();
2167
+ };
2168
+ return /* @__PURE__ */ g("div", {
2169
+ ref: p,
2170
+ className: y(Y.snackbar, a && !l && Y["snackbar--visible"]),
2171
+ role: "status",
2172
+ onMouseEnter: C,
2173
+ onMouseLeave: w,
2174
+ onFocus: C,
2175
+ onBlur: w,
2176
+ onPointerDown: T,
2177
+ onPointerMove: E,
2178
+ onPointerUp: D,
2179
+ onPointerCancel: D,
2180
+ children: [
2181
+ e.before == null ? null : /* @__PURE__ */ h("span", {
2182
+ className: Y.before,
2183
+ children: e.before
2184
+ }),
2185
+ /* @__PURE__ */ g("div", {
2186
+ className: Y.body,
2187
+ children: [/* @__PURE__ */ h("span", {
2188
+ className: Y.message,
2189
+ children: e.message
2190
+ }), e.description == null ? null : /* @__PURE__ */ h("span", {
2191
+ className: Y.description,
2192
+ children: e.description
2193
+ })]
2194
+ }),
2195
+ e.action == null ? null : /* @__PURE__ */ h("button", {
2196
+ type: "button",
2197
+ className: Y.action,
2198
+ onClick: () => {
2199
+ e.action?.onClick(), S();
2200
+ },
2201
+ children: e.action.label
2202
+ })
2203
+ ]
2204
+ });
2205
+ }
2206
+ //#endregion
2207
+ //#region src/components/Snackbar/useSnackbar.ts
2208
+ function dn() {
2209
+ let e = a(on);
2210
+ if (!e) throw Error("useSnackbar must be used within a <SnackbarProvider>.");
2211
+ return e;
2212
+ }
2213
+ //#endregion
2214
+ //#region src/components/Spoiler/particles.ts
2215
+ var fn = Math.PI * 2, pn = (e) => Math.max(0, Math.min(1, e)), mn = (e) => 1 - (1 - e) ** 3;
2216
+ function hn(e, t, n, r) {
2217
+ let i = Math.max(t, e - n);
2218
+ return r < t ? Math.max(0, r / t) : r > i ? Math.max(0, 1 - (r - i) / (e - i)) : 1;
2219
+ }
2220
+ function gn(e, t, n) {
2221
+ let r = Math.round(Math.min(1800, Math.max(12, n * e * t))), i = [];
2222
+ for (let n = 0; n < r; n += 1) {
2223
+ let n = 2 + Math.random() * 10, r = Math.random() * fn, a = .3 + Math.random() * 1.2, o = Math.random();
2224
+ i.push({
2225
+ x0: Math.random() * e,
2226
+ y0: Math.random() * t,
2227
+ vx: n * Math.cos(r),
2228
+ vy: n * Math.sin(r),
2229
+ life: a,
2230
+ respawn: o,
2231
+ phase: Math.random() * (a + o),
2232
+ size: 1 + Math.random() * .7,
2233
+ square: Math.random() > .5
2234
+ });
2235
+ }
2236
+ return i;
2237
+ }
2238
+ function _n(e, t, n, r, i, a, o, s, c) {
2239
+ e.clearRect(0, 0, t, n);
2240
+ let l = t / r, u = n / r, [d, f, p] = a, m = i.length;
2241
+ for (let t = 0; t < m; t += 1) {
2242
+ let n = i[t], a = n.life + n.respawn;
2243
+ if (s != null && Math.floor((o + n.phase) / a) > Math.floor((s + n.phase) / a)) continue;
2244
+ let h = (o + n.phase) % a;
2245
+ if (h >= n.life) continue;
2246
+ let g = (n.x0 + n.vx * h) % l;
2247
+ g < 0 && (g += l);
2248
+ let _ = (n.y0 + n.vy * h) % u;
2249
+ _ < 0 && (_ += u);
2250
+ let v = hn(n.life, .15, .3, h), y = v * (.45 + .55 * (1 - h / n.life));
2251
+ if (s != null && c > 0) {
2252
+ let e = pn((o - (s + 2 / 3 * c * t / m)) / (1 / 3 * c));
2253
+ y *= mn(1 - e);
2254
+ }
2255
+ if (y <= .01) continue;
2256
+ let b = Math.max(.5, n.size * v) * r;
2257
+ e.fillStyle = `rgba(${d}, ${f}, ${p}, ${y.toFixed(3)})`, e.beginPath(), n.square ? e.rect(g * r, _ * r, b, b) : e.arc(g * r, _ * r, b / 2, 0, fn), e.fill();
2258
+ }
2259
+ }
2260
+ var vn = {
2261
+ spoiler: "_spoiler_15ysm_1",
2262
+ revealed: "_revealed_15ysm_15",
2263
+ canvas: "_canvas_15ysm_20",
2264
+ content: "_content_15ysm_67"
2265
+ }, yn = .5;
2266
+ function bn(e) {
2267
+ let t = e.match(/-?\d*\.?\d+/g);
2268
+ return !t || t.length < 3 ? [
2269
+ 128,
2270
+ 128,
2271
+ 128
2272
+ ] : [
2273
+ Number(t[0]),
2274
+ Number(t[1]),
2275
+ Number(t[2])
2276
+ ];
2277
+ }
2278
+ function xn({ ref: e, revealed: t, defaultRevealed: n = !1, onRevealedChange: r, revealOn: i = "click", accentColor: a, density: s = .1, fps: c = 40, revealLabel: l = "Reveal hidden text", className: f, style: p, children: m, onClick: _, onKeyDown: v, onMouseEnter: b, onMouseLeave: x, ...S }) {
2279
+ let [C, w] = d(n), T = t ?? C, E = Yt(), D = i === "click", O = u(null), k = u(null), A = u([]), j = u([
2280
+ 128,
2281
+ 128,
2282
+ 128
2283
+ ]), ee = u(!0), te = u(T ? 0 : null), M = u(0), [ne, re] = d(!T), ie = (e) => {
2284
+ e ? te.current = M.current : (te.current = null, re(!0)), t ?? w(e), r?.(e);
2285
+ };
2286
+ o(() => {
2287
+ if (!ne) return;
2288
+ let e = O.current, t = k.current, n = t?.getContext("2d");
2289
+ if (!e || !t || !n) return;
2290
+ let r = Math.min(2, window.devicePixelRatio || 1), i = () => {
2291
+ let n = t.getBoundingClientRect(), i = Math.max(1, Math.round(n.width * r)), o = Math.max(1, Math.round(n.height * r));
2292
+ (t.width !== i || t.height !== o) && (t.width = i, t.height = o, A.current = gn(i / r, o / r, s)), j.current = bn(a ?? getComputedStyle(e).color);
2293
+ };
2294
+ if (i(), E) {
2295
+ _n(n, t.width, t.height, r, A.current, j.current, .6, null, 0);
2296
+ return;
2297
+ }
2298
+ let o = 0, l = 0, u = -1, d = 1e3 / Math.max(8, c), f = (e) => {
2299
+ l ||= e;
2300
+ let i = (e - l) / 1e3;
2301
+ M.current = i;
2302
+ let a = te.current;
2303
+ if (a != null && i > a + yn + .06) {
2304
+ n.clearRect(0, 0, t.width, t.height), re(!1);
2305
+ return;
2306
+ }
2307
+ o = requestAnimationFrame(f), !(!ee.current || e - u < d) && (u = e, _n(n, t.width, t.height, r, A.current, j.current, i, a, yn));
2308
+ };
2309
+ o = requestAnimationFrame(f);
2310
+ let p = typeof ResizeObserver < "u" ? new ResizeObserver(i) : null;
2311
+ p?.observe(e);
2312
+ let m = typeof IntersectionObserver < "u" ? new IntersectionObserver(([e]) => {
2313
+ ee.current = e.isIntersecting;
2314
+ }) : null;
2315
+ return m?.observe(e), () => {
2316
+ cancelAnimationFrame(o), p?.disconnect(), m?.disconnect();
2317
+ };
2318
+ }, [
2319
+ ne,
2320
+ E,
2321
+ s,
2322
+ c,
2323
+ a
2324
+ ]);
2325
+ let ae = () => ie(!T);
2326
+ return /* @__PURE__ */ g("span", {
2327
+ ref: (t) => {
2328
+ O.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
2329
+ },
2330
+ className: y(vn.spoiler, T && vn.revealed, f),
2331
+ role: "button",
2332
+ tabIndex: 0,
2333
+ "aria-pressed": T,
2334
+ "aria-label": T ? void 0 : l,
2335
+ style: {
2336
+ ...p,
2337
+ "--tgui--spoiler--p": +!!T
2338
+ },
2339
+ onClick: (e) => {
2340
+ _?.(e), D && ae();
2341
+ },
2342
+ onKeyDown: (e) => {
2343
+ v?.(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ae());
2344
+ },
2345
+ onMouseEnter: (e) => {
2346
+ b?.(e), !D && !T && ie(!0);
2347
+ },
2348
+ onMouseLeave: (e) => {
2349
+ x?.(e), !D && T && ie(!1);
2350
+ },
2351
+ ...S,
2352
+ children: [/* @__PURE__ */ h("span", {
2353
+ className: vn.content,
2354
+ "aria-hidden": !T,
2355
+ children: m
2356
+ }), ne ? /* @__PURE__ */ h("canvas", {
2357
+ ref: k,
2358
+ className: vn.canvas,
2359
+ "aria-hidden": !0
2360
+ }) : null]
2361
+ });
2362
+ }
2363
+ xn.displayName = "Spoiler";
2364
+ var Sn = {
844
2365
  switch: "_switch_s4zd1_1",
845
2366
  input: "_input_s4zd1_18",
846
2367
  control: "_control_s4zd1_28",
@@ -849,26 +2370,26 @@ var X = {
849
2370
  };
850
2371
  //#endregion
851
2372
  //#region src/components/Switch/Switch.tsx
852
- function Fe({ ref: e, disabled: t, className: i, style: a, ...o }) {
853
- let { platform: s } = C();
854
- return /* @__PURE__ */ r("label", {
855
- className: h(X.switch, s === "ios" ? X.ios : X.base, i),
856
- style: a,
2373
+ function Cn({ ref: e, disabled: t, className: n, style: r, ...i }) {
2374
+ let { platform: a } = F();
2375
+ return /* @__PURE__ */ g("label", {
2376
+ className: y(Sn.switch, a === "ios" ? Sn.ios : Sn.base, n),
2377
+ style: r,
857
2378
  "data-disabled": t || void 0,
858
- children: [/* @__PURE__ */ n("input", {
2379
+ children: [/* @__PURE__ */ h("input", {
859
2380
  ref: e,
860
2381
  type: "checkbox",
861
- className: X.input,
2382
+ className: Sn.input,
862
2383
  disabled: t,
863
- ...o
864
- }), /* @__PURE__ */ n("span", {
2384
+ ...i
2385
+ }), /* @__PURE__ */ h("span", {
865
2386
  "aria-hidden": !0,
866
- className: X.control
2387
+ className: Sn.control
867
2388
  })]
868
2389
  });
869
2390
  }
870
- Fe.displayName = "Switch";
871
- var Z = {
2391
+ Cn.displayName = "Switch";
2392
+ var X = {
872
2393
  bar: "_bar_muj3n_1",
873
2394
  barIos: "_barIos_muj3n_10",
874
2395
  item: "_item_muj3n_15",
@@ -879,40 +2400,181 @@ var Z = {
879
2400
  };
880
2401
  //#endregion
881
2402
  //#region src/components/TabBar/TabBarItem.tsx
882
- function Q({ ref: e, selected: t, text: i, children: a, className: o, ...s }) {
883
- let { platform: c } = C(), l = c === "ios";
884
- return /* @__PURE__ */ r(T, {
2403
+ function wn({ ref: e, selected: t, text: n, children: r, className: i, ...a }) {
2404
+ let { platform: o } = F(), s = o === "ios";
2405
+ return /* @__PURE__ */ g(be, {
885
2406
  ref: e,
886
2407
  Component: "button",
887
2408
  interactiveAnimation: "opacity",
888
2409
  "aria-current": t ? "page" : void 0,
889
- className: h(Z.item, l && Z.itemIos, t && Z.itemSelected, o),
890
- ...s,
891
- children: [a == null ? null : /* @__PURE__ */ n("span", {
892
- className: Z.icon,
893
- children: a
894
- }), i == null ? null : /* @__PURE__ */ n(j, {
895
- className: Z.text,
2410
+ className: y(X.item, s && X.itemIos, t && X.itemSelected, i),
2411
+ ...a,
2412
+ children: [r == null ? null : /* @__PURE__ */ h("span", {
2413
+ className: X.icon,
2414
+ children: r
2415
+ }), n == null ? null : /* @__PURE__ */ h(R, {
2416
+ className: X.text,
896
2417
  weight: "2",
897
- level: l ? "2" : "1",
898
- children: i
2418
+ level: s ? "2" : "1",
2419
+ children: n
899
2420
  })]
900
2421
  });
901
2422
  }
902
- Q.displayName = "TabBarItem";
2423
+ wn.displayName = "TabBarItem";
903
2424
  //#endregion
904
2425
  //#region src/components/TabBar/TabBar.tsx
905
- function $({ ref: e, className: t, children: r, ...i }) {
906
- let { platform: a } = C();
907
- return /* @__PURE__ */ n("nav", {
2426
+ function Tn({ ref: e, className: t, children: n, ...r }) {
2427
+ let { platform: i } = F();
2428
+ return /* @__PURE__ */ h("nav", {
908
2429
  ref: e,
909
- className: h(Z.bar, a === "ios" && Z.barIos, t),
910
- ...i,
911
- children: r
2430
+ className: y(X.bar, i === "ios" && X.barIos, t),
2431
+ ...r,
2432
+ children: n
2433
+ });
2434
+ }
2435
+ Tn.displayName = "TabBar", Tn.Item = wn;
2436
+ var En = { field: "_field_1crg0_1" };
2437
+ //#endregion
2438
+ //#region src/components/Textarea/Textarea.tsx
2439
+ function Dn({ ref: e, header: t, status: n, autoGrow: r = !1, maxRows: a, rows: s = 3, disabled: c, className: l, value: f, defaultValue: p, onFocus: m, onBlur: g, onChange: _, ...v }) {
2440
+ let { platform: y } = F(), b = y === "ios", [x, S] = d(!1), C = n ?? (x ? "focused" : "default"), w = b ? I : P, T = u(null), E = i((t) => {
2441
+ T.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
2442
+ }, [e]), D = i(() => {
2443
+ let e = T.current;
2444
+ if (!e || !r) return;
2445
+ e.style.height = "auto";
2446
+ let t = getComputedStyle(e), n = Number.parseFloat(t.lineHeight) || 20, i = a ? n * a : Infinity;
2447
+ e.style.height = `${Math.min(e.scrollHeight, i)}px`, e.style.overflowY = e.scrollHeight > i ? "auto" : "hidden";
2448
+ }, [r, a]);
2449
+ return o(D, [
2450
+ D,
2451
+ f,
2452
+ p
2453
+ ]), /* @__PURE__ */ h(ft, {
2454
+ ios: b,
2455
+ status: C,
2456
+ disabled: c,
2457
+ alignStart: !0,
2458
+ header: t,
2459
+ className: l,
2460
+ children: /* @__PURE__ */ h(w, {
2461
+ ref: E,
2462
+ Component: "textarea",
2463
+ className: En.field,
2464
+ rows: s,
2465
+ disabled: c,
2466
+ value: f,
2467
+ defaultValue: p,
2468
+ onFocus: (e) => {
2469
+ c || S(!0), m?.(e);
2470
+ },
2471
+ onBlur: (e) => {
2472
+ S(!1), g?.(e);
2473
+ },
2474
+ onChange: (e) => {
2475
+ D(), _?.(e);
2476
+ },
2477
+ ...v
2478
+ })
912
2479
  });
913
2480
  }
914
- $.displayName = "TabBar", $.Item = Q;
2481
+ Dn.displayName = "Textarea";
2482
+ var On = {
2483
+ trigger: "_trigger_83ipz_1",
2484
+ tooltip: "_tooltip_83ipz_5",
2485
+ "tooltip--visible": "_tooltip--visible_83ipz_25",
2486
+ arrow: "_arrow_83ipz_44"
2487
+ }, Z = 8, Q = 8, $ = (e, t, n) => Math.max(t, Math.min(n, e));
2488
+ function kn(e, t, n) {
2489
+ let r = window.innerWidth, i = window.innerHeight, a = n;
2490
+ a === "top" && e.top - t.height - Z < Q ? a = "bottom" : a === "bottom" && e.bottom + t.height + Z > i - Q ? a = "top" : a === "left" && e.left - t.width - Z < Q ? a = "right" : a === "right" && e.right + t.width + Z > r - Q && (a = "left");
2491
+ let o = 0, s = 0;
2492
+ a === "top" || a === "bottom" ? (s = e.left + e.width / 2 - t.width / 2, o = a === "top" ? e.top - t.height - Z : e.bottom + Z) : (o = e.top + e.height / 2 - t.height / 2, s = a === "left" ? e.left - t.width - Z : e.right + Z), s = $(s, Q, r - t.width - Q), o = $(o, Q, i - t.height - Q);
2493
+ let c = e.left + e.width / 2 - s, l = e.top + e.height / 2 - o, u = {};
2494
+ return a === "top" ? (u.left = $(c, 10, t.width - 10) - 4, u.bottom = -4) : a === "bottom" ? (u.left = $(c, 10, t.width - 10) - 4, u.top = -4) : a === "left" ? (u.top = $(l, 10, t.height - 10) - 4, u.right = -4) : (u.top = $(l, 10, t.height - 10) - 4, u.left = -4), {
2495
+ top: o,
2496
+ left: s,
2497
+ placement: a,
2498
+ originX: $(c, 0, t.width),
2499
+ originY: $(l, 0, t.height),
2500
+ arrow: u
2501
+ };
2502
+ }
2503
+ function An({ ref: e, children: t, content: n, placement: r = "top", open: a, onOpenChange: l, className: f }) {
2504
+ let [p, _] = d(!1), v = a ?? p, b = u(null), x = u(null), S = u(null), [C, w] = d(null), [T, E] = d(!1), D = s(), O = i((e) => {
2505
+ a ?? _(e), l?.(e);
2506
+ }, [a, l]), k = i(() => {
2507
+ let e = b.current, t = x.current;
2508
+ !e || !t || w(kn(e.getBoundingClientRect(), t.getBoundingClientRect(), r));
2509
+ }, [r]);
2510
+ c(() => {
2511
+ if (!v) {
2512
+ E(!1), w(null);
2513
+ return;
2514
+ }
2515
+ k();
2516
+ }, [v, k]), o(() => {
2517
+ if (!v || !C) return;
2518
+ let e = requestAnimationFrame(() => E(!0)), t = () => O(!1);
2519
+ return window.addEventListener("scroll", t, !0), window.addEventListener("resize", k), () => {
2520
+ cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", k);
2521
+ };
2522
+ }, [
2523
+ v,
2524
+ C,
2525
+ k,
2526
+ O
2527
+ ]), o(() => {
2528
+ if (!v) return;
2529
+ let e = (e) => {
2530
+ e.key === "Escape" && O(!1);
2531
+ };
2532
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
2533
+ }, [v, O]);
2534
+ let A = i(() => {
2535
+ S.current &&= (clearTimeout(S.current), null);
2536
+ }, []);
2537
+ return o(() => A, [A]), /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
2538
+ ref: (t) => {
2539
+ b.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
2540
+ },
2541
+ className: y(On.trigger, f),
2542
+ "aria-describedby": v ? D : void 0,
2543
+ onPointerEnter: (e) => {
2544
+ e.pointerType !== "touch" && O(!0);
2545
+ },
2546
+ onPointerLeave: (e) => {
2547
+ e.pointerType !== "touch" && O(!1), A();
2548
+ },
2549
+ onPointerDown: (e) => {
2550
+ e.pointerType === "touch" && (S.current = setTimeout(() => O(!0), 450));
2551
+ },
2552
+ onPointerUp: A,
2553
+ onPointerCancel: A,
2554
+ onFocus: () => O(!0),
2555
+ onBlur: () => O(!1),
2556
+ children: t
2557
+ }), v ? /* @__PURE__ */ h(kt, { children: /* @__PURE__ */ g("div", {
2558
+ ref: x,
2559
+ id: D,
2560
+ role: "tooltip",
2561
+ className: y(On.tooltip, T && On["tooltip--visible"]),
2562
+ style: C ? {
2563
+ top: C.top,
2564
+ left: C.left,
2565
+ "--tgui--tooltip--origin-x": `${C.originX}px`,
2566
+ "--tgui--tooltip--origin-y": `${C.originY}px`
2567
+ } : void 0,
2568
+ "data-placement": C?.placement,
2569
+ children: [n, C ? /* @__PURE__ */ h("span", {
2570
+ className: On.arrow,
2571
+ style: C.arrow,
2572
+ "aria-hidden": !0
2573
+ }) : null]
2574
+ }) }) : null] });
2575
+ }
2576
+ An.displayName = "Tooltip";
915
2577
  //#endregion
916
- export { he as Button, j as Caption, L as Card, I as CardCell, F as Cell, xe as Checkbox, z as Divider, we as Headline, Te as Input, De as LargeTitle, ke as List, je as Placeholder, J as Section, G as SectionFooter, K as SectionHeader, Pe as Select, x as Subheadline, Fe as Switch, $ as TabBar, Q as TabBarItem, T as Tappable, E as Text, fe as TguiProvider, H as Title, v as Typography, C as useTgui };
2578
+ export { C as Accordion, w as AccordionItem, O as Avatar, A as AvatarStack, te as Badge, re as Banner, ae as Blockquote, Pe as Button, R as Caption, We as Card, Ue as CardCell, He as Cell, Ke as Checkbox, Je as Chip, Qe as CircularProgress, et as Divider, nt as FixedLayout, it as Headline, ot as HorizontalScroll, ct as IconButton, dt as Image, mt as Input, gt as LargeTitle, vt as Link, bt as List, Ct as PinInput, Ot as Placeholder, kt as Portal, jt as Progress, Nt as Radio, Ft as Rating, Vt as Section, Lt as SectionFooter, zt as SectionHeader, Ut as SegmentedControl, Wt as SegmentedControlItem, Gt as Select, tn as Sheet, rn as Skeleton, an as Slider, ln as SnackbarProvider, ce as Spinner, xn as Spoiler, P as Subheadline, Cn as Switch, Tn as TabBar, wn as TabBarItem, be as Tappable, I as Text, Dn as Textarea, je as TguiProvider, Et as Title, An as Tooltip, N as Typography, dn as useSnackbar, F as useTgui };
917
2579
 
918
2580
  //# sourceMappingURL=index.js.map