@nim.zone/ui 0.6.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.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +681 -0
  3. package/dist/components/admin-shell.d.ts +121 -0
  4. package/dist/components/app-shell.d.ts +23 -0
  5. package/dist/components/auth-screen.d.ts +33 -0
  6. package/dist/components/avatar.d.ts +10 -0
  7. package/dist/components/badge.d.ts +14 -0
  8. package/dist/components/banner.d.ts +11 -0
  9. package/dist/components/breadcrumb.d.ts +12 -0
  10. package/dist/components/button.d.ts +21 -0
  11. package/dist/components/card.d.ts +15 -0
  12. package/dist/components/chat-composer.d.ts +52 -0
  13. package/dist/components/chat.d.ts +77 -0
  14. package/dist/components/checkout.d.ts +79 -0
  15. package/dist/components/choice.d.ts +15 -0
  16. package/dist/components/combobox.d.ts +31 -0
  17. package/dist/components/date-field.d.ts +58 -0
  18. package/dist/components/dialog.d.ts +20 -0
  19. package/dist/components/empty-state.d.ts +9 -0
  20. package/dist/components/feedback.d.ts +18 -0
  21. package/dist/components/field.d.ts +47 -0
  22. package/dist/components/icon-button.d.ts +12 -0
  23. package/dist/components/icon.d.ts +72 -0
  24. package/dist/components/layout.d.ts +13 -0
  25. package/dist/components/list.d.ts +16 -0
  26. package/dist/components/menu.d.ts +56 -0
  27. package/dist/components/onboarding.d.ts +50 -0
  28. package/dist/components/otp-input.d.ts +29 -0
  29. package/dist/components/pagination.d.ts +12 -0
  30. package/dist/components/password-field.d.ts +33 -0
  31. package/dist/components/phone-field.d.ts +44 -0
  32. package/dist/components/plan-card.d.ts +45 -0
  33. package/dist/components/plan-picker.d.ts +52 -0
  34. package/dist/components/profile-header.d.ts +47 -0
  35. package/dist/components/profile-screen.d.ts +44 -0
  36. package/dist/components/resource-meter.d.ts +22 -0
  37. package/dist/components/section-header.d.ts +8 -0
  38. package/dist/components/segmented.d.ts +18 -0
  39. package/dist/components/sheet.d.ts +18 -0
  40. package/dist/components/sign-in-flow.d.ts +60 -0
  41. package/dist/components/slider.d.ts +10 -0
  42. package/dist/components/stat.d.ts +10 -0
  43. package/dist/components/stepper.d.ts +17 -0
  44. package/dist/components/tab-bar.d.ts +40 -0
  45. package/dist/components/table.d.ts +33 -0
  46. package/dist/components/tabs.d.ts +23 -0
  47. package/dist/components/task-progress.d.ts +38 -0
  48. package/dist/components/theme.d.ts +49 -0
  49. package/dist/components/toast.d.ts +17 -0
  50. package/dist/components/tooltip.d.ts +18 -0
  51. package/dist/components/typography.d.ts +18 -0
  52. package/dist/components/wizard.d.ts +70 -0
  53. package/dist/index.d.ts +104 -0
  54. package/dist/lib/calendars.d.ts +81 -0
  55. package/dist/lib/cn.d.ts +7 -0
  56. package/dist/lib/countries.d.ts +33 -0
  57. package/dist/lib/use-anchor.d.ts +22 -0
  58. package/dist/nim.css +1 -0
  59. package/dist/nim.js +3266 -0
  60. package/package.json +83 -0
  61. package/src/components/admin-shell.tsx +338 -0
  62. package/src/components/app-shell.tsx +36 -0
  63. package/src/components/auth-screen.tsx +71 -0
  64. package/src/components/avatar.tsx +32 -0
  65. package/src/components/badge.tsx +44 -0
  66. package/src/components/banner.tsx +47 -0
  67. package/src/components/breadcrumb.tsx +45 -0
  68. package/src/components/button.tsx +64 -0
  69. package/src/components/card.tsx +46 -0
  70. package/src/components/chat-composer.tsx +331 -0
  71. package/src/components/chat.tsx +352 -0
  72. package/src/components/checkout.tsx +173 -0
  73. package/src/components/choice.tsx +46 -0
  74. package/src/components/combobox.tsx +157 -0
  75. package/src/components/date-field.tsx +394 -0
  76. package/src/components/dialog.tsx +77 -0
  77. package/src/components/empty-state.tsx +23 -0
  78. package/src/components/feedback.tsx +61 -0
  79. package/src/components/field.tsx +177 -0
  80. package/src/components/icon-button.tsx +35 -0
  81. package/src/components/icon.tsx +167 -0
  82. package/src/components/layout.tsx +38 -0
  83. package/src/components/list.tsx +78 -0
  84. package/src/components/menu.tsx +172 -0
  85. package/src/components/onboarding.tsx +157 -0
  86. package/src/components/otp-input.tsx +144 -0
  87. package/src/components/pagination.tsx +86 -0
  88. package/src/components/password-field.tsx +112 -0
  89. package/src/components/phone-field.tsx +242 -0
  90. package/src/components/plan-card.tsx +124 -0
  91. package/src/components/plan-picker.tsx +144 -0
  92. package/src/components/profile-header.tsx +134 -0
  93. package/src/components/profile-screen.tsx +104 -0
  94. package/src/components/resource-meter.tsx +60 -0
  95. package/src/components/section-header.tsx +31 -0
  96. package/src/components/segmented.tsx +53 -0
  97. package/src/components/sheet.tsx +74 -0
  98. package/src/components/sign-in-flow.tsx +322 -0
  99. package/src/components/slider.tsx +50 -0
  100. package/src/components/stat.tsx +30 -0
  101. package/src/components/stepper.tsx +77 -0
  102. package/src/components/tab-bar.tsx +82 -0
  103. package/src/components/table.tsx +81 -0
  104. package/src/components/tabs.tsx +72 -0
  105. package/src/components/task-progress.tsx +111 -0
  106. package/src/components/theme.tsx +112 -0
  107. package/src/components/toast.tsx +87 -0
  108. package/src/components/tooltip.tsx +30 -0
  109. package/src/components/typography.tsx +65 -0
  110. package/src/components/wizard.tsx +192 -0
  111. package/src/index.ts +216 -0
  112. package/src/lib/calendars.ts +227 -0
  113. package/src/lib/cn.ts +8 -0
  114. package/src/lib/countries.ts +110 -0
  115. package/src/lib/use-anchor.ts +92 -0
  116. package/src/theme/colorways/coral.css +62 -0
  117. package/src/theme/colorways/oxblood.css +23 -0
  118. package/src/theme/colorways/paper.css +68 -0
  119. package/src/theme/colorways/teal.css +56 -0
  120. package/src/theme/colorways/vermilion.css +21 -0
  121. package/src/theme/components.css +4606 -0
  122. package/src/theme/contract.css +204 -0
  123. package/src/theme/fonts.css +67 -0
  124. package/src/theme/index.css +33 -0
  125. package/src/theme/persian.css +47 -0
  126. package/src/theme/reset.css +118 -0
  127. package/src/theme/styles/ledger.css +106 -0
  128. package/src/theme/styles/vlora.css +91 -0
  129. package/src/vite-env.d.ts +1 -0
package/dist/nim.js ADDED
@@ -0,0 +1,3266 @@
1
+ import { jsx as e, jsxs as d, Fragment as Y } from "react/jsx-runtime";
2
+ import { forwardRef as Ae, useState as A, Fragment as Oe, useRef as L, useMemo as H, useEffect as Z, useCallback as O, useId as pe, useLayoutEffect as Ue, createContext as Ee, useContext as xe, createElement as Ge } from "react";
3
+ import { Wallet as Ke, User as We, Video as He, Upload as Ye, TrendingUp as Ze, TrendingDown as Ve, Trash2 as je, Sun as Je, Star as Qe, Sparkles as Xe, CircleStop as qe, LogOut as en, Share2 as nn, Settings as an, Send as tn, Search as ln, Plus as sn, Play as rn, Pause as cn, Paperclip as on, Moon as dn, Minus as mn, Mic as un, Menu as hn, Loader as pn, Info as _n, Home as fn, Heart as Nn, Filter as bn, Eye as vn, ExternalLink as gn, Pencil as yn, Download as wn, FileText as kn, CircleAlert as Cn, Copy as Sn, X as Tn, Clock as An, ChevronUp as En, ChevronRight as xn, ChevronDown as Dn, ChevronLeft as Mn, CircleCheck as Ln, Check as In, Camera as zn, Calendar as Pn, Bookmark as Bn, Bell as $n, ArrowRight as Rn, AlertTriangle as Fn } from "lucide-react";
4
+ import { createPortal as se } from "react-dom";
5
+ const b = (...n) => n.filter(Boolean).join(" "), De = {
6
+ alert: Fn,
7
+ "arrow-forward": Rn,
8
+ bell: $n,
9
+ bookmark: Bn,
10
+ calendar: Pn,
11
+ camera: zn,
12
+ check: In,
13
+ "check-circle": Ln,
14
+ "chevron-back": Mn,
15
+ "chevron-down": Dn,
16
+ "chevron-forward": xn,
17
+ "chevron-up": En,
18
+ clock: An,
19
+ close: Tn,
20
+ copy: Sn,
21
+ danger: Cn,
22
+ document: kn,
23
+ download: wn,
24
+ edit: yn,
25
+ external: gn,
26
+ eye: vn,
27
+ filter: bn,
28
+ heart: Nn,
29
+ home: fn,
30
+ info: _n,
31
+ loading: pn,
32
+ menu: hn,
33
+ mic: un,
34
+ minus: mn,
35
+ moon: dn,
36
+ paperclip: on,
37
+ pause: cn,
38
+ play: rn,
39
+ plus: sn,
40
+ search: ln,
41
+ send: tn,
42
+ settings: an,
43
+ share: nn,
44
+ "sign-out": en,
45
+ stop: qe,
46
+ sparkle: Xe,
47
+ star: Qe,
48
+ sun: Je,
49
+ trash: je,
50
+ "trend-down": Ve,
51
+ "trend-up": Ze,
52
+ upload: Ye,
53
+ video: He,
54
+ user: We,
55
+ wallet: Ke
56
+ }, On = /* @__PURE__ */ new Set([
57
+ "arrow-forward",
58
+ "chevron-back",
59
+ "chevron-forward",
60
+ "external",
61
+ "send",
62
+ "share",
63
+ "sign-out"
64
+ ]), ve = { xs: 14, sm: 16, md: 20, lg: 24, xl: 32 };
65
+ function C({ className: n, label: i, name: a, size: t = "md", tone: s = "default", ...l }) {
66
+ const o = De[a];
67
+ return /* @__PURE__ */ e(
68
+ o,
69
+ {
70
+ "aria-hidden": i ? void 0 : !0,
71
+ "aria-label": i,
72
+ className: b("nim-icon", n),
73
+ "data-flip": On.has(a) ? "true" : void 0,
74
+ "data-tone": s === "default" ? void 0 : s,
75
+ focusable: "false",
76
+ height: ve[t],
77
+ role: i ? "img" : void 0,
78
+ strokeWidth: 1.75,
79
+ width: ve[t],
80
+ ...l
81
+ }
82
+ );
83
+ }
84
+ const Ha = Object.keys(De), Un = { sm: "sm", md: "md", lg: "md" }, R = Ae(function({ className: i, label: a, name: t, size: s = "md", type: l = "button", variant: o = "ghost", ...c }, r) {
85
+ return /* @__PURE__ */ e(
86
+ "button",
87
+ {
88
+ "aria-label": a,
89
+ className: b("nim-icon-button", `nim-icon-button--${o}`, `nim-icon-button--${s}`, i),
90
+ ref: r,
91
+ title: a,
92
+ type: l,
93
+ ...c,
94
+ children: /* @__PURE__ */ e(C, { name: t, size: Un[s] })
95
+ }
96
+ );
97
+ }), Gn = {
98
+ close: "Close menu",
99
+ menu: "Open menu",
100
+ nav: "Admin navigation"
101
+ };
102
+ function Ya({
103
+ brand: n,
104
+ children: i,
105
+ className: a,
106
+ groups: t,
107
+ labels: s,
108
+ sidebarFooter: l,
109
+ title: o,
110
+ toolbar: c,
111
+ value: r
112
+ }) {
113
+ const m = { ...Gn, ...s }, [h, u] = A(!1), p = /* @__PURE__ */ e("nav", { "aria-label": m.nav, className: "nim-admin__nav", children: t.map((_) => /* @__PURE__ */ d("div", { className: "nim-admin__group", children: [
114
+ /* @__PURE__ */ d("p", { className: "nim-admin__group-label", children: [
115
+ _.icon ? /* @__PURE__ */ e(C, { name: _.icon, size: "xs" }) : null,
116
+ _.label
117
+ ] }),
118
+ _.items.map((f) => {
119
+ const w = f.key === r, N = /* @__PURE__ */ d(Y, { children: [
120
+ f.icon ? /* @__PURE__ */ e(C, { name: f.icon, size: "sm" }) : null,
121
+ /* @__PURE__ */ e("span", { children: f.label })
122
+ ] }), g = {
123
+ "aria-current": w ? "page" : void 0,
124
+ className: "nim-admin__link",
125
+ "data-active": w ? "true" : void 0,
126
+ onClick: () => {
127
+ var y;
128
+ (y = f.onSelect) == null || y.call(f), u(!1);
129
+ }
130
+ };
131
+ return f.href ? /* @__PURE__ */ e("a", { href: f.href, ...g, children: N }, f.key) : /* @__PURE__ */ e("button", { type: "button", ...g, children: N }, f.key);
132
+ })
133
+ ] }, _.key)) });
134
+ return /* @__PURE__ */ d("div", { className: b("nim-admin", a), "data-drawer": h ? "open" : void 0, children: [
135
+ /* @__PURE__ */ d("aside", { className: "nim-admin__sidebar", children: [
136
+ n ? /* @__PURE__ */ e("div", { className: "nim-admin__brand", children: n }) : null,
137
+ p,
138
+ l ? /* @__PURE__ */ e("div", { className: "nim-admin__sidebar-foot", children: l }) : null
139
+ ] }),
140
+ /* @__PURE__ */ d("div", { className: "nim-admin__drawer", hidden: !h, children: [
141
+ /* @__PURE__ */ e("div", { className: "nim-admin__scrim", onClick: () => u(!1) }),
142
+ /* @__PURE__ */ d("div", { className: "nim-admin__drawer-panel", children: [
143
+ /* @__PURE__ */ d("div", { className: "nim-admin__drawer-head", children: [
144
+ n,
145
+ /* @__PURE__ */ e(R, { label: m.close, name: "close", onClick: () => u(!1), size: "sm" })
146
+ ] }),
147
+ p
148
+ ] })
149
+ ] }),
150
+ /* @__PURE__ */ d("div", { className: "nim-admin__workspace", children: [
151
+ /* @__PURE__ */ d("header", { className: "nim-admin__topbar", children: [
152
+ /* @__PURE__ */ e(
153
+ R,
154
+ {
155
+ "aria-expanded": h,
156
+ className: "nim-admin__menu",
157
+ label: m.menu,
158
+ name: "menu",
159
+ onClick: () => u(!0),
160
+ size: "sm"
161
+ }
162
+ ),
163
+ o ? /* @__PURE__ */ e("h1", { className: "nim-admin__title", children: o }) : null,
164
+ c ? /* @__PURE__ */ e("div", { className: "nim-admin__toolbar", children: c }) : null
165
+ ] }),
166
+ /* @__PURE__ */ e("main", { className: "nim-admin__main", children: i })
167
+ ] })
168
+ ] });
169
+ }
170
+ function Za({
171
+ actions: n,
172
+ back: i,
173
+ className: a,
174
+ meta: t,
175
+ status: s,
176
+ subtitle: l,
177
+ title: o
178
+ }) {
179
+ return /* @__PURE__ */ d("header", { className: b("nim-detail-header", a), children: [
180
+ i ? i.href ? /* @__PURE__ */ d("a", { className: "nim-detail-header__back", href: i.href, children: [
181
+ /* @__PURE__ */ e(C, { name: "chevron-back", size: "sm" }),
182
+ i.label
183
+ ] }) : /* @__PURE__ */ d("button", { className: "nim-detail-header__back", onClick: i.onClick, type: "button", children: [
184
+ /* @__PURE__ */ e(C, { name: "chevron-back", size: "sm" }),
185
+ i.label
186
+ ] }) : null,
187
+ /* @__PURE__ */ d("div", { className: "nim-detail-header__row", children: [
188
+ /* @__PURE__ */ d("div", { className: "nim-detail-header__text", children: [
189
+ /* @__PURE__ */ d("div", { className: "nim-detail-header__headline", children: [
190
+ /* @__PURE__ */ e("h1", { className: "nim-detail-header__title", children: o }),
191
+ s ? /* @__PURE__ */ e("span", { className: "nim-detail-header__status", children: s }) : null
192
+ ] }),
193
+ l ? /* @__PURE__ */ e("p", { className: "nim-detail-header__subtitle", children: l }) : null,
194
+ t ? /* @__PURE__ */ e("p", { className: "nim-detail-header__meta", children: t }) : null
195
+ ] }),
196
+ n ? /* @__PURE__ */ e("div", { className: "nim-detail-header__actions", children: n }) : null
197
+ ] })
198
+ ] });
199
+ }
200
+ function Va({
201
+ chips: n,
202
+ className: i,
203
+ clearLabel: a,
204
+ labels: t,
205
+ onClearAll: s
206
+ }) {
207
+ if (n.length === 0) return null;
208
+ const l = {
209
+ remove: (o) => `Remove filter ${o}`,
210
+ toolbar: "Active filters",
211
+ ...t
212
+ };
213
+ return /* @__PURE__ */ d("div", { "aria-label": l.toolbar, className: b("nim-filter-chips", i), role: "toolbar", children: [
214
+ n.map((o) => /* @__PURE__ */ d("span", { className: "nim-filter-chip", children: [
215
+ /* @__PURE__ */ d("span", { className: "nim-filter-chip__label", children: [
216
+ o.label,
217
+ o.value !== void 0 ? /* @__PURE__ */ d(Y, { children: [
218
+ ": ",
219
+ o.value
220
+ ] }) : null
221
+ ] }),
222
+ /* @__PURE__ */ e(
223
+ "button",
224
+ {
225
+ "aria-label": l.remove(typeof o.label == "string" ? o.label : o.key),
226
+ className: "nim-filter-chip__remove",
227
+ onClick: o.onRemove,
228
+ type: "button",
229
+ children: /* @__PURE__ */ e(C, { name: "close", size: "xs" })
230
+ }
231
+ )
232
+ ] }, o.key)),
233
+ s && a ? /* @__PURE__ */ e("button", { className: "nim-filter-chips__clear", onClick: s, type: "button", children: a }) : null
234
+ ] });
235
+ }
236
+ function ja({ className: n, empty: i, events: a, locale: t }) {
237
+ const s = new Intl.DateTimeFormat(t, {
238
+ day: "numeric",
239
+ hour: "2-digit",
240
+ minute: "2-digit",
241
+ month: "short"
242
+ });
243
+ return a.length === 0 ? /* @__PURE__ */ e("div", { className: b("nim-activity", n), children: i }) : /* @__PURE__ */ e("ol", { className: b("nim-activity", n), children: a.map((l) => /* @__PURE__ */ d("li", { className: "nim-activity__item", "data-tone": l.tone, children: [
244
+ /* @__PURE__ */ e("span", { className: "nim-activity__marker", children: l.icon ? /* @__PURE__ */ e(C, { name: l.icon, size: "xs" }) : null }),
245
+ /* @__PURE__ */ d("div", { className: "nim-activity__body", children: [
246
+ /* @__PURE__ */ d("p", { className: "nim-activity__action", children: [
247
+ l.actor ? /* @__PURE__ */ e("strong", { children: l.actor }) : null,
248
+ " ",
249
+ l.action,
250
+ " ",
251
+ l.target ? /* @__PURE__ */ e("span", { className: "nim-activity__target", children: l.target }) : null
252
+ ] }),
253
+ l.at ? /* @__PURE__ */ e("time", { className: "nim-activity__time", dateTime: l.at, children: s.format(new Date(l.at)) }) : null
254
+ ] })
255
+ ] }, l.id)) });
256
+ }
257
+ function Kn({ className: n, items: i, label: a, renderItem: t, value: s }) {
258
+ return /* @__PURE__ */ e("nav", { "aria-label": a, className: b("nim-tab-bar", n), children: /* @__PURE__ */ e("div", { className: "nim-tab-bar__row", style: { "--nim-tab-count": i.length }, children: i.map((l) => {
259
+ const o = l.key === s, c = /* @__PURE__ */ d(Y, { children: [
260
+ /* @__PURE__ */ e(C, { name: l.icon, size: l.center ? "lg" : "md" }),
261
+ /* @__PURE__ */ e("span", { className: "nim-tab-bar__label", children: l.label })
262
+ ] }), r = {
263
+ "aria-current": o ? "page" : void 0,
264
+ "aria-label": l.fullLabel ?? l.label,
265
+ className: b("nim-tab-bar__item", l.center && "nim-tab-bar__item--center"),
266
+ "data-active": o ? "true" : void 0
267
+ };
268
+ return t ? /* @__PURE__ */ e("div", { className: "nim-tab-bar__slot", children: t(l, c, r) }, l.key) : l.href ? /* @__PURE__ */ e("a", { href: l.href, ...r, children: c }, l.key) : /* @__PURE__ */ e("button", { onClick: l.onSelect, type: "button", ...r, children: c }, l.key);
269
+ }) }) });
270
+ }
271
+ function Ja({ children: n, className: i, header: a, tabs: t }) {
272
+ return /* @__PURE__ */ d("div", { className: b("nim-app-shell", i), children: [
273
+ a ? /* @__PURE__ */ e("header", { className: "nim-app-shell__header", children: a }) : null,
274
+ /* @__PURE__ */ e("main", { className: "nim-app-shell__content", "data-has-tabs": t ? "true" : void 0, children: n }),
275
+ t ? /* @__PURE__ */ e(Kn, { ...t }) : null
276
+ ] });
277
+ }
278
+ const J = Ae(function({
279
+ children: i,
280
+ className: a,
281
+ disabled: t = !1,
282
+ fullWidth: s = !1,
283
+ iconEnd: l,
284
+ iconStart: o,
285
+ loading: c = !1,
286
+ size: r = "md",
287
+ type: m = "button",
288
+ variant: h = "primary",
289
+ ...u
290
+ }, p) {
291
+ return /* @__PURE__ */ d(
292
+ "button",
293
+ {
294
+ "aria-busy": c || void 0,
295
+ className: b(
296
+ "nim-button",
297
+ `nim-button--${h}`,
298
+ `nim-button--${r}`,
299
+ s && "nim-button--full",
300
+ c && "nim-button--loading",
301
+ a
302
+ ),
303
+ disabled: t || c,
304
+ ref: p,
305
+ type: m,
306
+ ...u,
307
+ children: [
308
+ c ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-button__spinner" }) : null,
309
+ !c && o ? /* @__PURE__ */ e(C, { name: o, size: "sm" }) : null,
310
+ /* @__PURE__ */ e("span", { className: "nim-button__label", children: i }),
311
+ l ? /* @__PURE__ */ e(C, { name: l, size: "sm" }) : null
312
+ ]
313
+ }
314
+ );
315
+ });
316
+ function de({
317
+ action: n,
318
+ back: i,
319
+ brand: a,
320
+ children: t,
321
+ className: s,
322
+ footer: l,
323
+ subtitle: o,
324
+ title: c
325
+ }) {
326
+ return /* @__PURE__ */ d("section", { className: b("nim-auth", s), children: [
327
+ a ? /* @__PURE__ */ e("div", { className: "nim-auth__brand", children: a }) : null,
328
+ /* @__PURE__ */ d("div", { className: "nim-auth__body", children: [
329
+ i ? /* @__PURE__ */ e(J, { className: "nim-auth__back", iconStart: "chevron-back", onClick: i.onClick, size: "sm", variant: "ghost", children: i.label }) : null,
330
+ /* @__PURE__ */ e("h1", { className: "nim-auth__title", children: c }),
331
+ o ? /* @__PURE__ */ e("p", { className: "nim-auth__subtitle", children: o }) : null,
332
+ /* @__PURE__ */ e("div", { className: "nim-auth__fields", children: t })
333
+ ] }),
334
+ /* @__PURE__ */ d("div", { className: "nim-auth__foot", children: [
335
+ n ? /* @__PURE__ */ e(
336
+ J,
337
+ {
338
+ disabled: n.disabled,
339
+ fullWidth: !0,
340
+ loading: n.loading,
341
+ onClick: n.onClick,
342
+ size: "lg",
343
+ variant: "accent",
344
+ children: n.label
345
+ }
346
+ ) : null,
347
+ l ? /* @__PURE__ */ e("div", { className: "nim-auth__footer", children: l }) : null
348
+ ] })
349
+ ] });
350
+ }
351
+ const Wn = (n) => n.split(/\s+/).filter(Boolean).slice(0, 2).map((i) => {
352
+ var a;
353
+ return ((a = i[0]) == null ? void 0 : a.toUpperCase()) ?? "";
354
+ }).join("");
355
+ function Hn({ className: n, name: i, shape: a = "round", size: t = "md", src: s, ...l }) {
356
+ return /* @__PURE__ */ d(
357
+ "span",
358
+ {
359
+ className: b("nim-avatar", t !== "md" && `nim-avatar--${t}`, a === "square" && "nim-avatar--square", n),
360
+ ...l,
361
+ children: [
362
+ s ? /* @__PURE__ */ e("img", { alt: "", src: s }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: Wn(i) }),
363
+ /* @__PURE__ */ e("span", { className: "nim-visually-hidden", children: i })
364
+ ]
365
+ }
366
+ );
367
+ }
368
+ function Qa({
369
+ caption: n,
370
+ className: i,
371
+ initials: a,
372
+ label: t,
373
+ size: s = 96,
374
+ src: l,
375
+ value: o
376
+ }) {
377
+ const c = Math.max(4, Math.round(s * 0.05)), r = (s - c) / 2, m = 2 * Math.PI * r, h = Math.min(100, Math.max(0, o)) / 100 * m;
378
+ return /* @__PURE__ */ d(
379
+ "div",
380
+ {
381
+ "aria-label": t,
382
+ className: b("nim-avatar-ring", i),
383
+ role: "img",
384
+ style: { "--nim-ring-size": `${s}px`, "--nim-ring-stroke": `${c}px` },
385
+ children: [
386
+ /* @__PURE__ */ d("svg", { "aria-hidden": "true", className: "nim-avatar-ring__arc", viewBox: `0 0 ${s} ${s}`, children: [
387
+ /* @__PURE__ */ e(
388
+ "circle",
389
+ {
390
+ className: "nim-avatar-ring__track",
391
+ cx: s / 2,
392
+ cy: s / 2,
393
+ fill: "none",
394
+ r,
395
+ strokeWidth: c
396
+ }
397
+ ),
398
+ /* @__PURE__ */ e(
399
+ "circle",
400
+ {
401
+ className: "nim-avatar-ring__fill",
402
+ cx: s / 2,
403
+ cy: s / 2,
404
+ fill: "none",
405
+ r,
406
+ strokeDasharray: `${h} ${m}`,
407
+ strokeLinecap: "round",
408
+ strokeWidth: c
409
+ }
410
+ )
411
+ ] }),
412
+ /* @__PURE__ */ d("span", { className: "nim-avatar-ring__face", children: [
413
+ l ? /* @__PURE__ */ e("img", { alt: "", className: "nim-avatar-ring__image", src: l }) : /* @__PURE__ */ e("span", { className: "nim-avatar-ring__initials", children: a }),
414
+ n && !l ? /* @__PURE__ */ e("span", { className: "nim-avatar-ring__caption", children: n }) : null
415
+ ] })
416
+ ]
417
+ }
418
+ );
419
+ }
420
+ function Yn({
421
+ actions: n,
422
+ avatar: i,
423
+ chips: a,
424
+ className: t,
425
+ eyebrow: s,
426
+ name: l,
427
+ stats: o = []
428
+ }) {
429
+ return /* @__PURE__ */ d("section", { className: b("nim-profile-header", t), children: [
430
+ /* @__PURE__ */ d("div", { className: "nim-profile-header__identity", children: [
431
+ i,
432
+ /* @__PURE__ */ d("div", { className: "nim-profile-header__who", children: [
433
+ s ? /* @__PURE__ */ e("p", { className: "nim-profile-header__eyebrow", children: s }) : null,
434
+ /* @__PURE__ */ e("h1", { className: "nim-profile-header__name", children: l }),
435
+ a ? /* @__PURE__ */ e("div", { className: "nim-profile-header__chips", children: a }) : null
436
+ ] })
437
+ ] }),
438
+ o.length ? /* @__PURE__ */ e("dl", { className: "nim-profile-header__stats", children: o.map((c, r) => /* @__PURE__ */ d("div", { className: "nim-profile-header__stat", children: [
439
+ /* @__PURE__ */ e("dt", { className: "nim-profile-header__stat-label", children: c.label }),
440
+ /* @__PURE__ */ e("dd", { className: "nim-profile-header__stat-value", children: c.value })
441
+ ] }, r)) }) : null,
442
+ n ? /* @__PURE__ */ e("div", { className: "nim-profile-header__actions", children: n }) : null
443
+ ] });
444
+ }
445
+ function Xa({
446
+ children: n,
447
+ className: i,
448
+ dot: a = !1,
449
+ pill: t = !1,
450
+ size: s = "md",
451
+ tone: l = "soft",
452
+ variant: o = "neutral",
453
+ ...c
454
+ }) {
455
+ return /* @__PURE__ */ d(
456
+ "span",
457
+ {
458
+ className: b(
459
+ "nim-badge",
460
+ `nim-badge--${o}`,
461
+ `nim-badge--${l}`,
462
+ s === "sm" && "nim-badge--sm",
463
+ t && "nim-badge--pill",
464
+ i
465
+ ),
466
+ ...c,
467
+ children: [
468
+ a ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-badge__dot" }) : null,
469
+ n
470
+ ]
471
+ }
472
+ );
473
+ }
474
+ const Zn = {
475
+ accent: "sparkle",
476
+ danger: "danger",
477
+ info: "info",
478
+ neutral: "info",
479
+ success: "check-circle",
480
+ warning: "alert"
481
+ };
482
+ function Vn({
483
+ action: n,
484
+ children: i,
485
+ className: a,
486
+ icon: t,
487
+ title: s,
488
+ tone: l = "neutral",
489
+ ...o
490
+ }) {
491
+ return /* @__PURE__ */ d(
492
+ "div",
493
+ {
494
+ className: b("nim-banner", `nim-banner--${l}`, a),
495
+ role: l === "danger" ? "alert" : "status",
496
+ ...o,
497
+ children: [
498
+ /* @__PURE__ */ e(C, { className: "nim-banner__icon", name: t ?? Zn[l], size: "sm" }),
499
+ /* @__PURE__ */ d("div", { className: "nim-banner__content", children: [
500
+ s ? /* @__PURE__ */ e("p", { className: "nim-banner__title", children: s }) : null,
501
+ /* @__PURE__ */ e("div", { children: i })
502
+ ] }),
503
+ n ? /* @__PURE__ */ e("div", { children: n }) : null
504
+ ]
505
+ }
506
+ );
507
+ }
508
+ function qa({ className: n, items: i, label: a = "Breadcrumb" }) {
509
+ return /* @__PURE__ */ e("nav", { "aria-label": a, className: b("nim-breadcrumb", n), children: i.map((t, s) => {
510
+ const l = s === i.length - 1;
511
+ return /* @__PURE__ */ d(Oe, { children: [
512
+ s > 0 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-breadcrumb__separator", children: /* @__PURE__ */ e(C, { name: "chevron-forward", size: "xs" }) }) : null,
513
+ l || !t.href ? /* @__PURE__ */ e("span", { "aria-current": l ? "page" : void 0, className: "nim-breadcrumb__current", children: t.label }) : /* @__PURE__ */ e("a", { className: "nim-breadcrumb__link", href: t.href, children: t.label })
514
+ ] }, t.label);
515
+ }) });
516
+ }
517
+ function ei({
518
+ as: n = "article",
519
+ children: i,
520
+ className: a,
521
+ footer: t,
522
+ header: s,
523
+ interactive: l = !1,
524
+ padding: o = "md",
525
+ variant: c = "default",
526
+ ...r
527
+ }) {
528
+ return /* @__PURE__ */ d(
529
+ n,
530
+ {
531
+ className: b(
532
+ "nim-card",
533
+ `nim-card--${c}`,
534
+ `nim-card--pad-${o}`,
535
+ l && "nim-card--interactive",
536
+ a
537
+ ),
538
+ ...r,
539
+ children: [
540
+ s ? /* @__PURE__ */ e("div", { className: "nim-card__header", children: s }) : null,
541
+ i,
542
+ t ? /* @__PURE__ */ e("div", { className: "nim-card__footer", children: t }) : null
543
+ ]
544
+ }
545
+ );
546
+ }
547
+ function ni({
548
+ badge: n,
549
+ className: i,
550
+ description: a,
551
+ detail: t,
552
+ disabled: s = !1,
553
+ icon: l,
554
+ name: o,
555
+ onSelect: c,
556
+ selected: r,
557
+ title: m
558
+ }) {
559
+ return /* @__PURE__ */ d("label", { className: b("nim-option-card", r && "nim-option-card--selected", i), children: [
560
+ /* @__PURE__ */ e(
561
+ "input",
562
+ {
563
+ checked: r,
564
+ className: "nim-option-card__input",
565
+ disabled: s,
566
+ name: o,
567
+ onChange: c,
568
+ type: "radio"
569
+ }
570
+ ),
571
+ l ? /* @__PURE__ */ e("span", { className: "nim-option-card__icon", children: /* @__PURE__ */ e(C, { name: l, size: "md" }) }) : null,
572
+ /* @__PURE__ */ d("span", { className: "nim-option-card__text", children: [
573
+ /* @__PURE__ */ e("span", { className: "nim-option-card__title", children: m }),
574
+ a ? /* @__PURE__ */ e("span", { className: "nim-option-card__description", children: a }) : null,
575
+ r && t ? /* @__PURE__ */ e("span", { className: "nim-option-card__detail", children: t }) : null
576
+ ] }),
577
+ n ? /* @__PURE__ */ e("span", { className: "nim-option-card__badge", children: n }) : null,
578
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-option-card__dot" })
579
+ ] });
580
+ }
581
+ function ai({ className: n, items: i, title: a, totals: t = [] }) {
582
+ return /* @__PURE__ */ d("section", { className: b("nim-summary", n), children: [
583
+ a ? /* @__PURE__ */ e("h2", { className: "nim-summary__title", children: a }) : null,
584
+ /* @__PURE__ */ e("dl", { className: "nim-summary__lines", children: i.map((s) => /* @__PURE__ */ d("div", { className: "nim-summary__line", children: [
585
+ /* @__PURE__ */ d("dt", { children: [
586
+ /* @__PURE__ */ e("span", { className: "nim-summary__label", children: s.label }),
587
+ s.meta ? /* @__PURE__ */ e("span", { className: "nim-summary__meta", children: s.meta }) : null
588
+ ] }),
589
+ /* @__PURE__ */ e("dd", { className: "nim-summary__value", children: s.value })
590
+ ] }, s.key)) }),
591
+ t.length ? /* @__PURE__ */ d(Y, { children: [
592
+ /* @__PURE__ */ e("hr", { className: "nim-summary__rule" }),
593
+ /* @__PURE__ */ e("dl", { className: "nim-summary__lines nim-summary__lines--totals", children: t.map((s) => /* @__PURE__ */ d(
594
+ "div",
595
+ {
596
+ className: "nim-summary__line",
597
+ "data-emphasis": s.emphasis ? "true" : void 0,
598
+ children: [
599
+ /* @__PURE__ */ e("dt", { children: /* @__PURE__ */ e("span", { className: "nim-summary__label", children: s.label }) }),
600
+ /* @__PURE__ */ e("dd", { className: "nim-summary__value", children: s.value })
601
+ ]
602
+ },
603
+ s.key
604
+ )) })
605
+ ] }) : null
606
+ ] });
607
+ }
608
+ function ii({ action: n, className: i, note: a, total: t }) {
609
+ return /* @__PURE__ */ d("div", { className: b("nim-action-bar", i), children: [
610
+ /* @__PURE__ */ d("div", { className: "nim-action-bar__row", children: [
611
+ t ? /* @__PURE__ */ d("div", { className: "nim-action-bar__total", children: [
612
+ /* @__PURE__ */ e("span", { className: "nim-action-bar__total-label", children: t.label }),
613
+ /* @__PURE__ */ e("strong", { className: "nim-action-bar__total-value", children: t.value })
614
+ ] }) : null,
615
+ /* @__PURE__ */ e("div", { className: "nim-action-bar__action", children: n })
616
+ ] }),
617
+ a ? /* @__PURE__ */ e("p", { className: "nim-action-bar__note", children: a }) : null
618
+ ] });
619
+ }
620
+ function Me({ className: n, label: i = "Loading", size: a = "md", ...t }) {
621
+ return /* @__PURE__ */ e(
622
+ "span",
623
+ {
624
+ className: b("nim-spinner", a !== "md" && `nim-spinner--${a}`, n),
625
+ role: "status",
626
+ ...t,
627
+ children: /* @__PURE__ */ e("span", { className: "nim-visually-hidden", children: i })
628
+ }
629
+ );
630
+ }
631
+ function jn({ className: n, label: i, value: a, ...t }) {
632
+ const s = a === void 0, l = s ? 0 : Math.min(100, Math.max(0, a));
633
+ return /* @__PURE__ */ e(
634
+ "div",
635
+ {
636
+ "aria-label": i,
637
+ "aria-valuemax": 100,
638
+ "aria-valuemin": 0,
639
+ "aria-valuenow": s ? void 0 : l,
640
+ className: b("nim-progress", s && "nim-progress--indeterminate", n),
641
+ role: "progressbar",
642
+ ...t,
643
+ children: /* @__PURE__ */ e("div", { className: "nim-progress__fill", style: s ? void 0 : { inlineSize: `${l}%` } })
644
+ }
645
+ );
646
+ }
647
+ function ti({ className: n, height: i = "1em", radius: a, width: t = "100%", ...s }) {
648
+ return /* @__PURE__ */ e(
649
+ "span",
650
+ {
651
+ "aria-hidden": "true",
652
+ className: b("nim-skeleton", n),
653
+ style: { blockSize: i, borderRadius: a, inlineSize: t },
654
+ ...s
655
+ }
656
+ );
657
+ }
658
+ const Jn = {
659
+ download: "Download",
660
+ failed: "Not delivered",
661
+ pause: "Pause",
662
+ play: "Play",
663
+ read: "Read",
664
+ sending: "Sending",
665
+ sent: "Sent",
666
+ today: "Today",
667
+ typing: "is typing",
668
+ yesterday: "Yesterday",
669
+ voiceMessage: "Voice message"
670
+ }, ge = 1024;
671
+ function Qn(n, i) {
672
+ const a = ["B", "KB", "MB", "GB"];
673
+ let t = n, s = 0;
674
+ for (; t >= ge && s < a.length - 1; )
675
+ t /= ge, s += 1;
676
+ return `${new Intl.NumberFormat(i, { maximumFractionDigits: s === 0 ? 0 : 1 }).format(t)} ${a[s]}`;
677
+ }
678
+ function Le(n, i) {
679
+ const a = new Intl.NumberFormat(i, { minimumIntegerDigits: 2, useGrouping: !1 }), t = Math.max(0, Math.round(n));
680
+ return `${new Intl.NumberFormat(i).format(Math.floor(t / 60))}:${a.format(t % 60)}`;
681
+ }
682
+ function Xn({
683
+ attachment: n,
684
+ labels: i,
685
+ locale: a
686
+ }) {
687
+ const t = L(null), [s, l] = A(!1), [o, c] = A(0), r = n.duration ?? 0, m = H(
688
+ () => n.waveform ?? Array.from({ length: 32 }, (u, p) => 0.35 + p * 7 % 11 / 18),
689
+ [n.waveform]
690
+ ), h = r > 0 ? Math.min(1, o / r) : 0;
691
+ return /* @__PURE__ */ d("div", { className: "nim-chat-voice", children: [
692
+ /* @__PURE__ */ e(
693
+ R,
694
+ {
695
+ label: s ? i.pause : i.play,
696
+ name: s ? "pause" : "play",
697
+ onClick: () => {
698
+ const u = t.current;
699
+ u && (u.paused ? u.play() : u.pause());
700
+ },
701
+ size: "sm",
702
+ variant: "solid"
703
+ }
704
+ ),
705
+ /* @__PURE__ */ e(
706
+ "div",
707
+ {
708
+ "aria-label": i.voiceMessage,
709
+ className: "nim-chat-voice__wave",
710
+ "aria-hidden": "true",
711
+ children: m.map((u, p) => /* @__PURE__ */ e(
712
+ "span",
713
+ {
714
+ className: "nim-chat-voice__bar",
715
+ "data-played": p / m.length <= h ? "true" : void 0,
716
+ style: { blockSize: `${Math.round(u * 100)}%` }
717
+ },
718
+ p
719
+ ))
720
+ }
721
+ ),
722
+ /* @__PURE__ */ e("span", { className: "nim-chat-voice__time", children: Le(s || o ? Math.max(0, r - o) : r, a) }),
723
+ /* @__PURE__ */ e(
724
+ "audio",
725
+ {
726
+ onEnded: () => {
727
+ l(!1), c(0);
728
+ },
729
+ onPause: () => l(!1),
730
+ onPlay: () => l(!0),
731
+ onTimeUpdate: (u) => c(u.currentTarget.currentTime),
732
+ preload: "metadata",
733
+ ref: t,
734
+ src: n.url
735
+ }
736
+ )
737
+ ] });
738
+ }
739
+ function qn({
740
+ attachment: n,
741
+ labels: i,
742
+ locale: a
743
+ }) {
744
+ return n.kind === "voice" ? /* @__PURE__ */ e(Xn, { attachment: n, labels: i, locale: a }) : n.kind === "video" ? /* @__PURE__ */ d("figure", { className: "nim-chat-media", children: [
745
+ /* @__PURE__ */ e("video", { controls: !0, playsInline: !0, poster: n.poster, preload: "metadata", src: n.url }),
746
+ n.duration ? /* @__PURE__ */ e("figcaption", { className: "nim-chat-media__meta", children: Le(n.duration, a) }) : null
747
+ ] }) : n.kind === "image" ? /* @__PURE__ */ e("figure", { className: "nim-chat-media", children: /* @__PURE__ */ e("img", { alt: n.name ?? "", loading: "lazy", src: n.url }) }) : /* @__PURE__ */ d(
748
+ "a",
749
+ {
750
+ className: "nim-chat-file",
751
+ download: n.name,
752
+ href: n.url,
753
+ rel: "noreferrer",
754
+ target: "_blank",
755
+ children: [
756
+ /* @__PURE__ */ e("span", { className: "nim-chat-file__icon", children: /* @__PURE__ */ e(C, { name: "document", size: "md" }) }),
757
+ /* @__PURE__ */ d("span", { className: "nim-chat-file__text", children: [
758
+ /* @__PURE__ */ e("span", { className: "nim-chat-file__name", children: n.name ?? i.download }),
759
+ n.size !== void 0 ? /* @__PURE__ */ e("span", { className: "nim-chat-file__size", children: Qn(n.size, a) }) : null
760
+ ] }),
761
+ /* @__PURE__ */ e(C, { className: "nim-chat-file__action", name: "download", size: "sm" })
762
+ ]
763
+ }
764
+ );
765
+ }
766
+ function li({
767
+ className: n,
768
+ composer: i,
769
+ footer: a,
770
+ header: t,
771
+ labels: s,
772
+ locale: l,
773
+ messages: o,
774
+ typing: c
775
+ }) {
776
+ const r = { ...Jn, ...s }, m = L(null), h = L(!0), u = H(
777
+ () => new Intl.DateTimeFormat(l, { hour: "2-digit", minute: "2-digit" }),
778
+ [l]
779
+ );
780
+ return Z(() => {
781
+ const p = m.current;
782
+ !p || !h.current || (p.scrollTop = p.scrollHeight);
783
+ }, [o, c]), /* @__PURE__ */ d("section", { className: b("nim-chat", n), children: [
784
+ t ? /* @__PURE__ */ e("header", { className: "nim-chat__header", children: t }) : null,
785
+ /* @__PURE__ */ d(
786
+ "div",
787
+ {
788
+ className: "nim-chat__scroll",
789
+ onScroll: (p) => {
790
+ const _ = p.currentTarget;
791
+ h.current = _.scrollHeight - _.scrollTop - _.clientHeight < 48;
792
+ },
793
+ ref: m,
794
+ children: [
795
+ /* @__PURE__ */ e("ol", { "aria-live": "polite", className: "nim-chat__list", children: o.map((p) => {
796
+ var _;
797
+ return /* @__PURE__ */ d(
798
+ "li",
799
+ {
800
+ className: b("nim-chat-message", p.own && "nim-chat-message--own"),
801
+ children: [
802
+ !p.own && p.author ? /* @__PURE__ */ e(
803
+ Hn,
804
+ {
805
+ className: "nim-chat-message__avatar",
806
+ name: p.author.name,
807
+ size: "sm",
808
+ src: p.author.avatar
809
+ }
810
+ ) : null,
811
+ /* @__PURE__ */ d("div", { className: "nim-chat-message__stack", children: [
812
+ !p.own && p.author ? /* @__PURE__ */ e("span", { className: "nim-chat-message__author", children: p.author.name }) : null,
813
+ /* @__PURE__ */ d("div", { className: "nim-chat-message__bubble", children: [
814
+ (_ = p.attachments) == null ? void 0 : _.map((f, w) => /* @__PURE__ */ e(
815
+ qn,
816
+ {
817
+ attachment: f,
818
+ labels: r,
819
+ locale: l
820
+ },
821
+ `${p.id}-${w}`
822
+ )),
823
+ p.text ? /* @__PURE__ */ e("p", { className: "nim-chat-message__text", children: p.text }) : null
824
+ ] }),
825
+ /* @__PURE__ */ d("span", { className: "nim-chat-message__meta", children: [
826
+ p.at ? /* @__PURE__ */ e("time", { dateTime: p.at, children: u.format(new Date(p.at)) }) : null,
827
+ p.own && p.status ? /* @__PURE__ */ e("span", { className: "nim-chat-message__status", "data-status": p.status, children: p.status === "sending" ? /* @__PURE__ */ e(Me, { size: "sm" }) : /* @__PURE__ */ e(
828
+ C,
829
+ {
830
+ label: r[p.status],
831
+ name: p.status === "failed" ? "danger" : "check-circle",
832
+ size: "xs"
833
+ }
834
+ ) }) : null
835
+ ] })
836
+ ] })
837
+ ]
838
+ },
839
+ p.id
840
+ );
841
+ }) }),
842
+ c ? /* @__PURE__ */ d("p", { className: "nim-chat__typing", children: [
843
+ typeof c == "string" ? `${c} ${r.typing}` : r.typing,
844
+ /* @__PURE__ */ d("span", { "aria-hidden": "true", className: "nim-chat__dots", children: [
845
+ /* @__PURE__ */ e("i", {}),
846
+ /* @__PURE__ */ e("i", {}),
847
+ /* @__PURE__ */ e("i", {})
848
+ ] })
849
+ ] }) : null,
850
+ a ? /* @__PURE__ */ e("div", { className: "nim-chat__footer", children: a }) : null
851
+ ]
852
+ }
853
+ ),
854
+ i ? /* @__PURE__ */ e("div", { className: "nim-chat__composer", children: i }) : null
855
+ ] });
856
+ }
857
+ const ea = {
858
+ attach: "Attach a file",
859
+ cancel: "Cancel recording",
860
+ discard: "Remove attachment",
861
+ record: "Record a voice message",
862
+ recording: "Recording",
863
+ send: "Send",
864
+ stop: "Stop and attach",
865
+ video: "Attach a video"
866
+ }, na = () => {
867
+ var n;
868
+ return typeof navigator < "u" && typeof window < "u" && "MediaRecorder" in window && !!((n = navigator.mediaDevices) != null && n.getUserMedia);
869
+ }, aa = (n) => n.type.startsWith("video/") ? "video" : n.type.startsWith("image/") ? "image" : "file";
870
+ function si({
871
+ accept: n,
872
+ allow: i,
873
+ className: a,
874
+ disabled: t = !1,
875
+ labels: s,
876
+ onFiles: l,
877
+ onSend: o,
878
+ placeholder: c
879
+ }) {
880
+ const r = { ...ea, ...s }, m = { file: !0, video: !0, voice: !0, ...i }, [h, u] = A(""), [p, _] = A([]), [f, w] = A(!1), [N, g] = A(0), [y] = A(na), E = L([]), I = L(null), F = L(null), k = L(null), B = L(0), S = L([]), D = L(null), T = O(() => {
881
+ var v;
882
+ (v = k.current) == null || v.stream.getTracks().forEach((x) => x.stop()), k.current = null;
883
+ }, []);
884
+ Z(() => T, [T]), Z(() => {
885
+ if (!f) return;
886
+ const v = window.setInterval(() => g((Date.now() - B.current) / 1e3), 200);
887
+ return () => window.clearInterval(v);
888
+ }, [f]);
889
+ const P = O(
890
+ (v) => {
891
+ if (!(v != null && v.length)) return;
892
+ const x = Array.from(v);
893
+ E.current = [...E.current, ...x], _((M) => [
894
+ ...M,
895
+ ...x.map((z) => ({
896
+ kind: aa(z),
897
+ name: z.name,
898
+ size: z.size,
899
+ url: URL.createObjectURL(z)
900
+ }))
901
+ ]);
902
+ },
903
+ []
904
+ ), $ = O(async () => {
905
+ try {
906
+ const v = await navigator.mediaDevices.getUserMedia({ audio: !0 }), x = new MediaRecorder(v);
907
+ S.current = [], x.ondataavailable = (M) => {
908
+ M.data.size && S.current.push(M.data);
909
+ }, x.onstop = () => {
910
+ const M = new Blob(S.current, { type: x.mimeType }), z = new File([M], "voice-message", { type: x.mimeType });
911
+ E.current = [...E.current, z], _((U) => [
912
+ ...U,
913
+ {
914
+ duration: (Date.now() - B.current) / 1e3,
915
+ kind: "voice",
916
+ size: M.size,
917
+ url: URL.createObjectURL(M)
918
+ }
919
+ ]), T();
920
+ }, k.current = x, x.start(), B.current = Date.now(), g(0), w(!0);
921
+ } catch {
922
+ w(!1), T();
923
+ }
924
+ }, [T]), K = O(
925
+ (v) => {
926
+ const x = k.current;
927
+ w(!1), x && (v || (x.onstop = T), x.stop());
928
+ },
929
+ [T]
930
+ ), j = (v) => {
931
+ _((x) => (URL.revokeObjectURL(x[v].url), x.filter((M, z) => z !== v))), E.current = E.current.filter((x, M) => M !== v);
932
+ }, W = () => {
933
+ var v;
934
+ !h.trim() && p.length === 0 || (o({ attachments: p, text: h.trim() }), l == null || l(E.current), E.current = [], _([]), u(""), (v = D.current) == null || v.focus());
935
+ }, V = !h.trim() && p.length === 0;
936
+ return /* @__PURE__ */ d("div", { className: b("nim-composer", a), children: [
937
+ p.length ? /* @__PURE__ */ e("ul", { className: "nim-composer__tray", children: p.map((v, x) => /* @__PURE__ */ d("li", { className: "nim-composer__chip", children: [
938
+ /* @__PURE__ */ e(
939
+ C,
940
+ {
941
+ name: v.kind === "voice" ? "mic" : v.kind === "video" ? "video" : v.kind === "image" ? "camera" : "document",
942
+ size: "xs"
943
+ }
944
+ ),
945
+ /* @__PURE__ */ e("span", { className: "nim-composer__chip-name", children: v.name ?? r.record }),
946
+ /* @__PURE__ */ e(
947
+ R,
948
+ {
949
+ label: r.discard,
950
+ name: "close",
951
+ onClick: () => j(x),
952
+ size: "sm"
953
+ }
954
+ )
955
+ ] }, v.url)) }) : null,
956
+ /* @__PURE__ */ e("div", { className: "nim-composer__row", children: f ? /* @__PURE__ */ d("div", { className: "nim-composer__recording", role: "status", children: [
957
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-composer__pulse" }),
958
+ /* @__PURE__ */ e("span", { className: "nim-composer__recording-label", children: r.recording }),
959
+ /* @__PURE__ */ d("span", { className: "nim-composer__elapsed", children: [
960
+ N.toFixed(1),
961
+ "s"
962
+ ] }),
963
+ /* @__PURE__ */ e(
964
+ R,
965
+ {
966
+ label: r.cancel,
967
+ name: "close",
968
+ onClick: () => K(!1),
969
+ size: "sm"
970
+ }
971
+ ),
972
+ /* @__PURE__ */ e(
973
+ R,
974
+ {
975
+ label: r.stop,
976
+ name: "stop",
977
+ onClick: () => K(!0),
978
+ size: "sm",
979
+ variant: "solid"
980
+ }
981
+ )
982
+ ] }) : /* @__PURE__ */ d(Y, { children: [
983
+ m.file ? /* @__PURE__ */ e(
984
+ R,
985
+ {
986
+ disabled: t,
987
+ label: r.attach,
988
+ name: "paperclip",
989
+ onClick: () => {
990
+ var v;
991
+ return (v = I.current) == null ? void 0 : v.click();
992
+ },
993
+ size: "sm"
994
+ }
995
+ ) : null,
996
+ m.video ? /* @__PURE__ */ e(
997
+ R,
998
+ {
999
+ disabled: t,
1000
+ label: r.video,
1001
+ name: "video",
1002
+ onClick: () => {
1003
+ var v;
1004
+ return (v = F.current) == null ? void 0 : v.click();
1005
+ },
1006
+ size: "sm"
1007
+ }
1008
+ ) : null,
1009
+ /* @__PURE__ */ e(
1010
+ "textarea",
1011
+ {
1012
+ className: "nim-composer__input",
1013
+ disabled: t,
1014
+ onChange: (v) => u(v.target.value),
1015
+ onKeyDown: (v) => {
1016
+ v.key === "Enter" && !v.shiftKey && (v.preventDefault(), W());
1017
+ },
1018
+ placeholder: c,
1019
+ ref: D,
1020
+ rows: 1,
1021
+ value: h
1022
+ }
1023
+ ),
1024
+ m.voice && y && V ? /* @__PURE__ */ e(
1025
+ R,
1026
+ {
1027
+ disabled: t,
1028
+ label: r.record,
1029
+ name: "mic",
1030
+ onClick: () => void $(),
1031
+ size: "sm"
1032
+ }
1033
+ ) : /* @__PURE__ */ e(
1034
+ R,
1035
+ {
1036
+ disabled: t || V,
1037
+ label: r.send,
1038
+ name: "send",
1039
+ onClick: W,
1040
+ size: "sm",
1041
+ variant: "solid"
1042
+ }
1043
+ )
1044
+ ] }) }),
1045
+ /* @__PURE__ */ e(
1046
+ "input",
1047
+ {
1048
+ accept: n,
1049
+ className: "nim-visually-hidden",
1050
+ multiple: !0,
1051
+ onChange: (v) => {
1052
+ P(v.target.files), v.target.value = "";
1053
+ },
1054
+ ref: I,
1055
+ tabIndex: -1,
1056
+ type: "file"
1057
+ }
1058
+ ),
1059
+ /* @__PURE__ */ e(
1060
+ "input",
1061
+ {
1062
+ accept: "video/*",
1063
+ className: "nim-visually-hidden",
1064
+ onChange: (v) => {
1065
+ P(v.target.files), v.target.value = "";
1066
+ },
1067
+ ref: F,
1068
+ tabIndex: -1,
1069
+ type: "file"
1070
+ }
1071
+ )
1072
+ ] });
1073
+ }
1074
+ function ri({ children: n, className: i, description: a, ...t }) {
1075
+ return /* @__PURE__ */ d("label", { className: b("nim-choice nim-choice--checkbox", i), children: [
1076
+ /* @__PURE__ */ e("input", { className: "nim-choice__input", type: "checkbox", ...t }),
1077
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-checkbox__box", children: /* @__PURE__ */ e(C, { name: "check", size: "xs" }) }),
1078
+ /* @__PURE__ */ d("span", { className: "nim-choice__text", children: [
1079
+ n,
1080
+ a ? /* @__PURE__ */ e("span", { className: "nim-choice__description", children: a }) : null
1081
+ ] })
1082
+ ] });
1083
+ }
1084
+ function ia({ children: n, className: i, description: a, ...t }) {
1085
+ return /* @__PURE__ */ d("label", { className: b("nim-choice nim-choice--switch", i), children: [
1086
+ /* @__PURE__ */ e("input", { className: "nim-choice__input", role: "switch", type: "checkbox", ...t }),
1087
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-switch__track", children: /* @__PURE__ */ e("span", { className: "nim-switch__thumb" }) }),
1088
+ /* @__PURE__ */ d("span", { className: "nim-choice__text", children: [
1089
+ n,
1090
+ a ? /* @__PURE__ */ e("span", { className: "nim-choice__description", children: a }) : null
1091
+ ] })
1092
+ ] });
1093
+ }
1094
+ function X({ children: n, className: i, error: a, hint: t, id: s, label: l, required: o }) {
1095
+ const c = pe(), r = s ?? `nim-${c}`, m = t ? `${r}-hint` : void 0, h = a ? `${r}-error` : void 0, u = [h, m].filter(Boolean).join(" ") || void 0;
1096
+ return /* @__PURE__ */ d("div", { className: b("nim-field", a && "nim-field--invalid", i), children: [
1097
+ l ? /* @__PURE__ */ d("label", { className: "nim-field__label", htmlFor: r, children: [
1098
+ l,
1099
+ o ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-field__required", children: "*" }) : null
1100
+ ] }) : null,
1101
+ n({ control: r, describedBy: u }),
1102
+ a ? /* @__PURE__ */ e("p", { className: "nim-field__error", id: h, children: a }) : null,
1103
+ t && !a ? /* @__PURE__ */ e("p", { className: "nim-field__hint", id: m, children: t }) : null
1104
+ ] });
1105
+ }
1106
+ function ta({ className: n, error: i, hint: a, iconEnd: t, iconStart: s, id: l, label: o, required: c, ...r }) {
1107
+ return /* @__PURE__ */ e(X, { error: i, hint: a, id: l, label: o, required: c, children: ({ control: m, describedBy: h }) => /* @__PURE__ */ d(
1108
+ "div",
1109
+ {
1110
+ className: b(
1111
+ "nim-input-shell",
1112
+ s && "nim-input-shell--has-start",
1113
+ t && "nim-input-shell--has-end"
1114
+ ),
1115
+ children: [
1116
+ s ? /* @__PURE__ */ e("span", { className: "nim-input-shell__affix nim-input-shell__affix--start", children: /* @__PURE__ */ e(C, { name: s, size: "sm" }) }) : null,
1117
+ /* @__PURE__ */ e(
1118
+ "input",
1119
+ {
1120
+ "aria-describedby": h,
1121
+ "aria-invalid": i ? !0 : void 0,
1122
+ className: b("nim-input", n),
1123
+ id: m,
1124
+ required: c,
1125
+ ...r
1126
+ }
1127
+ ),
1128
+ t ? /* @__PURE__ */ e("span", { className: "nim-input-shell__affix nim-input-shell__affix--end", children: /* @__PURE__ */ e(C, { name: t, size: "sm" }) }) : null
1129
+ ]
1130
+ }
1131
+ ) });
1132
+ }
1133
+ function ci({ className: n, error: i, hint: a, id: t, label: s, required: l, rows: o = 4, ...c }) {
1134
+ return /* @__PURE__ */ e(X, { error: i, hint: a, id: t, label: s, required: l, children: ({ control: r, describedBy: m }) => /* @__PURE__ */ e(
1135
+ "textarea",
1136
+ {
1137
+ "aria-describedby": m,
1138
+ "aria-invalid": i ? !0 : void 0,
1139
+ className: b("nim-textarea", n),
1140
+ id: r,
1141
+ required: l,
1142
+ rows: o,
1143
+ ...c
1144
+ }
1145
+ ) });
1146
+ }
1147
+ function oi({
1148
+ className: n,
1149
+ error: i,
1150
+ hint: a,
1151
+ id: t,
1152
+ label: s,
1153
+ options: l,
1154
+ placeholder: o,
1155
+ required: c,
1156
+ ...r
1157
+ }) {
1158
+ return /* @__PURE__ */ e(X, { error: i, hint: a, id: t, label: s, required: c, children: ({ control: m, describedBy: h }) => /* @__PURE__ */ d("div", { className: "nim-input-shell nim-input-shell--has-end", children: [
1159
+ /* @__PURE__ */ d(
1160
+ "select",
1161
+ {
1162
+ "aria-describedby": h,
1163
+ "aria-invalid": i ? !0 : void 0,
1164
+ className: b("nim-select", n),
1165
+ id: m,
1166
+ required: c,
1167
+ ...r,
1168
+ children: [
1169
+ o ? /* @__PURE__ */ e("option", { value: "", disabled: !0, children: o }) : null,
1170
+ l.map((u) => /* @__PURE__ */ e("option", { disabled: u.disabled, value: u.value, children: u.label }, u.value))
1171
+ ]
1172
+ }
1173
+ ),
1174
+ /* @__PURE__ */ e("span", { className: "nim-input-shell__affix nim-input-shell__affix--end", children: /* @__PURE__ */ e(C, { name: "chevron-down", size: "sm" }) })
1175
+ ] }) });
1176
+ }
1177
+ function di({
1178
+ className: n,
1179
+ emptyState: i,
1180
+ error: a,
1181
+ hint: t,
1182
+ id: s,
1183
+ label: l,
1184
+ onChange: o,
1185
+ options: c,
1186
+ placeholder: r,
1187
+ required: m,
1188
+ value: h
1189
+ }) {
1190
+ const u = pe(), p = c.find((S) => S.value === h) ?? null, [_, f] = A(""), [w, N] = A(!1), [g, y] = A(0), E = L(null), I = H(() => {
1191
+ const S = _.trim().toLowerCase();
1192
+ return S ? c.filter((D) => D.label.toLowerCase().includes(S)) : c;
1193
+ }, [c, _]), F = (S) => {
1194
+ o(S.value), f(""), N(!1);
1195
+ }, k = (S) => {
1196
+ if (S.key === "Escape") {
1197
+ f(""), N(!1);
1198
+ return;
1199
+ }
1200
+ if (!w && (S.key === "ArrowDown" || S.key === "ArrowUp")) {
1201
+ N(!0);
1202
+ return;
1203
+ }
1204
+ if (S.key === "ArrowDown" || S.key === "ArrowUp") {
1205
+ S.preventDefault();
1206
+ const D = S.key === "ArrowDown" ? 1 : -1, T = I.filter((P) => !P.disabled);
1207
+ if (T.length === 0) return;
1208
+ y((P) => (P + D + T.length) % T.length);
1209
+ }
1210
+ if (S.key === "Enter") {
1211
+ const T = I.filter((P) => !P.disabled)[g];
1212
+ T && (S.preventDefault(), F(T));
1213
+ }
1214
+ }, B = I.filter((S) => !S.disabled);
1215
+ return /* @__PURE__ */ e(X, { className: n, error: a, hint: t, id: s, label: l, required: m, children: ({ control: S, describedBy: D }) => /* @__PURE__ */ d("div", { className: "nim-combobox", children: [
1216
+ /* @__PURE__ */ d("div", { className: b("nim-input-shell", "nim-input-shell--has-end"), children: [
1217
+ /* @__PURE__ */ e(
1218
+ "input",
1219
+ {
1220
+ "aria-autocomplete": "list",
1221
+ "aria-controls": w ? u : void 0,
1222
+ "aria-describedby": D,
1223
+ "aria-expanded": w,
1224
+ className: "nim-input",
1225
+ id: S,
1226
+ onBlur: () => window.setTimeout(() => N(!1), 120),
1227
+ onChange: (T) => {
1228
+ f(T.target.value), y(0), N(!0);
1229
+ },
1230
+ onFocus: () => N(!0),
1231
+ onKeyDown: k,
1232
+ placeholder: r,
1233
+ ref: E,
1234
+ role: "combobox",
1235
+ value: w ? _ : (p == null ? void 0 : p.label) ?? ""
1236
+ }
1237
+ ),
1238
+ /* @__PURE__ */ e("span", { className: "nim-input-shell__affix nim-input-shell__affix--end", children: /* @__PURE__ */ e(C, { name: "chevron-down", size: "sm" }) })
1239
+ ] }),
1240
+ w ? /* @__PURE__ */ e("div", { className: "nim-combobox__list", id: u, role: "listbox", children: B.length === 0 ? /* @__PURE__ */ e("div", { className: "nim-combobox__empty", children: i ? i(_) : `Nothing matches “${_}”.` }) : I.map((T) => /* @__PURE__ */ d(
1241
+ "button",
1242
+ {
1243
+ "aria-selected": B.indexOf(T) === g,
1244
+ className: "nim-combobox__option",
1245
+ disabled: T.disabled,
1246
+ onClick: () => F(T),
1247
+ onPointerEnter: () => y(B.indexOf(T)),
1248
+ role: "option",
1249
+ type: "button",
1250
+ children: [
1251
+ /* @__PURE__ */ e("span", { children: T.label }),
1252
+ T.meta ? /* @__PURE__ */ e("span", { className: "nim-combobox__meta", children: T.meta }) : null
1253
+ ]
1254
+ },
1255
+ T.value
1256
+ )) }) : null
1257
+ ] }) });
1258
+ }
1259
+ function Ie(n, i, { onDismiss: a, open: t }) {
1260
+ const [s, l] = A({ left: 0, top: 0 }), o = L(null), c = O(() => {
1261
+ const r = n.current, m = i.current;
1262
+ if (!r || !m) return;
1263
+ const h = r.getBoundingClientRect(), { height: u, width: p } = m.getBoundingClientRect(), _ = 4, f = 8, w = getComputedStyle(r).direction === "rtl", N = h.bottom + _, y = N + u > window.innerHeight && h.top - _ - u > 0 ? h.top - _ - u : N, E = w ? h.right - p : h.left, I = Math.min(Math.max(E, f), window.innerWidth - p - f);
1264
+ l({ left: I, top: y });
1265
+ }, [i, n]);
1266
+ return Ue(() => {
1267
+ t && c();
1268
+ }, [t, c]), Z(() => {
1269
+ if (!t) return;
1270
+ o.current = document.activeElement;
1271
+ const r = (h) => {
1272
+ h.key === "Escape" && (h.stopPropagation(), a());
1273
+ }, m = (h) => {
1274
+ var p, _;
1275
+ const u = h.target;
1276
+ (p = i.current) != null && p.contains(u) || (_ = n.current) != null && _.contains(u) || a();
1277
+ };
1278
+ return window.addEventListener("keydown", r), window.addEventListener("pointerdown", m), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), () => {
1279
+ var h, u;
1280
+ window.removeEventListener("keydown", r), window.removeEventListener("pointerdown", m), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0), (u = (h = o.current) == null ? void 0 : h.focus) == null || u.call(h);
1281
+ };
1282
+ }, [a, t, i, c, n]), s;
1283
+ }
1284
+ const la = (n) => n.kind === void 0 || n.kind === "action";
1285
+ function mi({ children: n, className: i, items: a, label: t }) {
1286
+ const [s, l] = A(!1), [o, c] = A(0), r = L(null), m = L(null), h = Ie(r, m, { onDismiss: () => l(!1), open: s }), p = a.filter(la).filter((N) => !N.disabled), _ = () => {
1287
+ c(0), l((N) => !N);
1288
+ }, f = (N) => {
1289
+ l(!1), N.onSelect();
1290
+ }, w = (N) => {
1291
+ if (p.length !== 0) {
1292
+ if (N.key === "ArrowDown" || N.key === "ArrowUp") {
1293
+ N.preventDefault();
1294
+ const g = N.key === "ArrowDown" ? 1 : -1;
1295
+ c((y) => (y + g + p.length) % p.length);
1296
+ }
1297
+ if (N.key === "Home" && (N.preventDefault(), c(0)), N.key === "End" && (N.preventDefault(), c(p.length - 1)), N.key === "Enter" || N.key === " ") {
1298
+ N.preventDefault();
1299
+ const g = p[o];
1300
+ g && f(g);
1301
+ }
1302
+ }
1303
+ };
1304
+ return /* @__PURE__ */ d(Y, { children: [
1305
+ n({ open: s, ref: r, toggle: _ }),
1306
+ s && typeof document < "u" ? se(
1307
+ /* @__PURE__ */ e(
1308
+ "div",
1309
+ {
1310
+ "aria-label": t,
1311
+ className: b("nim-menu", i),
1312
+ onKeyDown: w,
1313
+ ref: m,
1314
+ role: "menu",
1315
+ style: { insetBlockStart: h.top, insetInlineStart: h.left },
1316
+ tabIndex: -1,
1317
+ children: a.map((N, g) => N.kind === "separator" ? /* @__PURE__ */ e("hr", { className: "nim-menu__separator" }, `sep-${g}`) : N.kind === "heading" ? /* @__PURE__ */ e("p", { className: "nim-menu__label", children: N.label }, `head-${g}`) : /* @__PURE__ */ d(
1318
+ "button",
1319
+ {
1320
+ className: b("nim-menu__item", N.danger && "nim-menu__item--danger"),
1321
+ "data-active": p.indexOf(N) === o ? "true" : void 0,
1322
+ disabled: N.disabled,
1323
+ onClick: () => f(N),
1324
+ onPointerEnter: () => c(p.indexOf(N)),
1325
+ role: "menuitem",
1326
+ type: "button",
1327
+ children: [
1328
+ N.icon ? /* @__PURE__ */ e(C, { className: "nim-menu__icon", name: N.icon, size: "sm" }) : null,
1329
+ /* @__PURE__ */ e("span", { children: N.label }),
1330
+ N.shortcut ? /* @__PURE__ */ e("span", { className: "nim-menu__shortcut", children: N.shortcut }) : null
1331
+ ]
1332
+ },
1333
+ N.label
1334
+ ))
1335
+ }
1336
+ ),
1337
+ document.body
1338
+ ) : null
1339
+ ] });
1340
+ }
1341
+ function sa({ children: n, className: i, label: a, onClose: t, open: s, triggerRef: l }) {
1342
+ const o = L(null), c = Ie(l, o, { onDismiss: t, open: s });
1343
+ return !s || typeof document > "u" ? null : se(
1344
+ /* @__PURE__ */ e(
1345
+ "div",
1346
+ {
1347
+ "aria-label": a,
1348
+ className: b("nim-popover", i),
1349
+ ref: o,
1350
+ role: "dialog",
1351
+ style: { insetBlockStart: c.top, insetInlineStart: c.left },
1352
+ children: n
1353
+ }
1354
+ ),
1355
+ document.body
1356
+ );
1357
+ }
1358
+ const ze = Ee(null);
1359
+ function ui({
1360
+ children: n,
1361
+ className: i,
1362
+ defaultColorway: a = "vermilion",
1363
+ defaultScheme: t = "light",
1364
+ defaultStyle: s = "ledger",
1365
+ direction: l = "ltr",
1366
+ locale: o,
1367
+ syncDocument: c = !0
1368
+ }) {
1369
+ const [r, m] = A(s), [h, u] = A(a), [p, _] = A(t);
1370
+ Z(() => {
1371
+ if (!c || typeof document > "u") return;
1372
+ const w = document.documentElement;
1373
+ w.dataset.nimStyle = r, w.dataset.nimColorway = h, p === "system" ? delete w.dataset.nimScheme : w.dataset.nimScheme = p, w.dir = l, o && (w.lang = o);
1374
+ }, [h, l, o, p, r, c]);
1375
+ const f = H(
1376
+ () => ({ colorway: h, direction: l, locale: o, scheme: p, setColorway: u, setScheme: _, setStyle: m, style: r }),
1377
+ [h, l, o, p, r]
1378
+ );
1379
+ return /* @__PURE__ */ e(ze.Provider, { value: f, children: /* @__PURE__ */ e(
1380
+ "div",
1381
+ {
1382
+ className: b("nim-root", i),
1383
+ "data-nim-colorway": h,
1384
+ "data-nim-scheme": p === "system" ? void 0 : p,
1385
+ "data-nim-style": r,
1386
+ dir: l,
1387
+ lang: o,
1388
+ children: n
1389
+ }
1390
+ ) });
1391
+ }
1392
+ function re() {
1393
+ const n = xe(ze);
1394
+ if (!n) throw new Error("useNim must be used inside <NimProvider>");
1395
+ return n;
1396
+ }
1397
+ function hi() {
1398
+ const { scheme: n, setScheme: i } = re();
1399
+ return O(() => i(n === "dark" ? "light" : "dark"), [n, i]);
1400
+ }
1401
+ const te = 864e5, ra = Date.UTC(622, 2, 22), ca = 365.2422, ee = (n) => n.toISOString().slice(0, 10), ne = (n) => /* @__PURE__ */ new Date(`${n}T00:00:00Z`), ce = () => ee(/* @__PURE__ */ new Date()), oa = new Intl.DateTimeFormat("en-u-ca-persian-nu-latn", {
1402
+ day: "numeric",
1403
+ month: "numeric",
1404
+ timeZone: "UTC",
1405
+ year: "numeric"
1406
+ });
1407
+ function Q(n, i) {
1408
+ const a = ne(n);
1409
+ if (i === "gregory")
1410
+ return { day: a.getUTCDate(), month: a.getUTCMonth() + 1, year: a.getUTCFullYear() };
1411
+ const t = oa.formatToParts(a), s = (l) => {
1412
+ var o;
1413
+ return Number(((o = t.find((c) => c.type === l)) == null ? void 0 : o.value) ?? "0");
1414
+ };
1415
+ return { day: s("day"), month: s("month"), year: s("year") };
1416
+ }
1417
+ const ye = (n) => n.year * 1e4 + n.month * 100 + n.day;
1418
+ function ae(n, i) {
1419
+ if (i === "gregory")
1420
+ return ee(new Date(Date.UTC(n.year, n.month - 1, n.day)));
1421
+ const a = Math.floor((n.year - 1) * ca) + (n.month <= 7 ? (n.month - 1) * 31 : 186 + (n.month - 7) * 30) + n.day - 1;
1422
+ let t = new Date(ra + a * te);
1423
+ const s = ye(n);
1424
+ for (let l = 0; l < 40; l += 1) {
1425
+ const o = Q(ee(t), "persian"), c = ye(o);
1426
+ if (c === s) break;
1427
+ const r = (n.year - o.year) * 365 + (n.month - o.month) * 30 + (n.day - o.day);
1428
+ t = new Date(t.getTime() + (r === 0 ? c < s ? 1 : -1 : r) * te);
1429
+ }
1430
+ return ee(t);
1431
+ }
1432
+ function da(n, i) {
1433
+ const a = Q(n, i);
1434
+ return ae({ ...a, day: 1 }, i);
1435
+ }
1436
+ function we(n, i, a) {
1437
+ const t = Q(n, a), s = t.year * 12 + (t.month - 1) + i, l = Math.floor(s / 12), o = s % 12 + 1, c = Pe(l, o, a);
1438
+ return ae({ day: Math.min(t.day, c), month: o, year: l }, a);
1439
+ }
1440
+ function Pe(n, i, a) {
1441
+ const t = ne(ae({ day: 1, month: i, year: n }, a)).getTime(), s = i === 12 ? 1 : i + 1, l = i === 12 ? n + 1 : n, o = ne(ae({ day: 1, month: s, year: l }, a)).getTime();
1442
+ return Math.round((o - t) / te);
1443
+ }
1444
+ const me = (n, i) => ee(new Date(ne(n).getTime() + i * te)), ma = (n) => ne(n).getUTCDay();
1445
+ function ua(n, i) {
1446
+ const a = n ?? "en";
1447
+ return a.includes("-u-ca-") || a.includes("-u-") ? a : `${a}-u-ca-${i}`;
1448
+ }
1449
+ const _e = (n) => n != null && n.startsWith("fa") ? "persian" : "gregory", ha = (n) => n === "persian" ? 6 : 1, ke = /* @__PURE__ */ new Map();
1450
+ function pa(n) {
1451
+ const i = n ?? "en", a = ke.get(i);
1452
+ if (a) return a;
1453
+ const t = new Intl.NumberFormat(i, { useGrouping: !1 }), s = Array.from({ length: 10 }, (l, o) => t.format(o));
1454
+ return ke.set(i, s), s;
1455
+ }
1456
+ function he(n, i, a) {
1457
+ const t = Q(n, a), s = pa(i), l = (o, c = 1) => String(o).padStart(c, "0").replace(/\d/g, (r) => s[Number(r)]);
1458
+ return `${l(t.year)}/${l(t.month, 2)}/${l(t.day, 2)}`;
1459
+ }
1460
+ function _a(n, i) {
1461
+ const t = fa(n).match(/\d+/g);
1462
+ if (!t || t.length < 3) return null;
1463
+ const [s, l, o] = t.map(Number);
1464
+ if (l < 1 || l > 12 || o < 1 || o > Pe(s, l, i)) return null;
1465
+ const c = ae({ day: o, month: l, year: s }, i), r = Q(c, i);
1466
+ return r.year === s && r.month === l && r.day === o ? c : null;
1467
+ }
1468
+ function fa(n) {
1469
+ let i = "";
1470
+ for (const a of n) {
1471
+ const t = a.codePointAt(0) ?? 0;
1472
+ t >= 1776 && t <= 1785 ? i += String.fromCodePoint(t - 1776 + 48) : t >= 1632 && t <= 1641 ? i += String.fromCodePoint(t - 1632 + 48) : i += a;
1473
+ }
1474
+ return i;
1475
+ }
1476
+ const Ce = {
1477
+ next: "Next month",
1478
+ previous: "Previous month"
1479
+ };
1480
+ function Be({
1481
+ className: n,
1482
+ marked: i = [],
1483
+ max: a,
1484
+ min: t,
1485
+ month: s,
1486
+ onMonthChange: l,
1487
+ onSelect: o,
1488
+ system: c,
1489
+ value: r,
1490
+ weekStart: m
1491
+ }) {
1492
+ const { locale: h } = re(), u = c ?? _e(h), p = m ?? ha(u), _ = ce(), f = ua(h, u), w = H(
1493
+ () => new Intl.DateTimeFormat(f, { month: "long", timeZone: "UTC", year: "numeric" }),
1494
+ [f]
1495
+ ), N = H(() => new Intl.NumberFormat(h), [h]), g = H(
1496
+ () => new Intl.DateTimeFormat(f, { timeZone: "UTC", weekday: "short" }),
1497
+ [f]
1498
+ ), y = da(s, u), E = Q(y, u).month, I = H(() => {
1499
+ const k = (ma(y) - p + 7) % 7, B = me(y, -k);
1500
+ return Array.from({ length: 42 }, (S, D) => {
1501
+ const T = me(B, D), P = Q(T, u);
1502
+ return { date: T, day: P.day, outside: P.month !== E };
1503
+ });
1504
+ }, [y, E, u, p]), F = H(() => {
1505
+ const k = "2024-01-07";
1506
+ return Array.from({ length: 7 }, (B, S) => ({
1507
+ key: `${p}-${S}`,
1508
+ label: g.format(/* @__PURE__ */ new Date(`${me(k, (p + S) % 7)}T00:00:00Z`))
1509
+ }));
1510
+ }, [p, g]);
1511
+ return /* @__PURE__ */ d("div", { className: b("nim-calendar", n), children: [
1512
+ /* @__PURE__ */ d("div", { className: "nim-calendar__header", children: [
1513
+ /* @__PURE__ */ e(
1514
+ R,
1515
+ {
1516
+ label: Ce.previous,
1517
+ name: "chevron-back",
1518
+ onClick: () => l(we(y, -1, u)),
1519
+ size: "sm"
1520
+ }
1521
+ ),
1522
+ /* @__PURE__ */ e("span", { className: "nim-calendar__month", children: w.format(/* @__PURE__ */ new Date(`${y}T00:00:00Z`)) }),
1523
+ /* @__PURE__ */ e(
1524
+ R,
1525
+ {
1526
+ label: Ce.next,
1527
+ name: "chevron-forward",
1528
+ onClick: () => l(we(y, 1, u)),
1529
+ size: "sm"
1530
+ }
1531
+ )
1532
+ ] }),
1533
+ /* @__PURE__ */ d("div", { className: "nim-calendar__grid", role: "grid", children: [
1534
+ F.map((k) => /* @__PURE__ */ e("span", { className: "nim-calendar__weekday", children: k.label }, k.key)),
1535
+ I.map((k) => /* @__PURE__ */ e(
1536
+ "button",
1537
+ {
1538
+ "aria-selected": k.date === r,
1539
+ className: b(
1540
+ "nim-calendar__day",
1541
+ k.outside && "nim-calendar__day--outside",
1542
+ k.date === _ && "nim-calendar__day--today",
1543
+ i.includes(k.date) && "nim-calendar__day--marked"
1544
+ ),
1545
+ disabled: t !== void 0 && k.date < t || a !== void 0 && k.date > a,
1546
+ onClick: () => o(k.date),
1547
+ role: "gridcell",
1548
+ type: "button",
1549
+ children: N.format(k.day)
1550
+ },
1551
+ k.date
1552
+ ))
1553
+ ] })
1554
+ ] });
1555
+ }
1556
+ function $e({
1557
+ calendar: n,
1558
+ describedBy: i,
1559
+ id: a,
1560
+ invalid: t,
1561
+ locale: s,
1562
+ onChange: l,
1563
+ value: o
1564
+ }) {
1565
+ const [c, r] = A(null);
1566
+ if (n === "gregory")
1567
+ return /* @__PURE__ */ e(
1568
+ "input",
1569
+ {
1570
+ "aria-describedby": i,
1571
+ "aria-invalid": t ? !0 : void 0,
1572
+ className: "nim-input",
1573
+ id: a,
1574
+ onChange: (h) => l(h.target.value),
1575
+ type: "date",
1576
+ value: o
1577
+ }
1578
+ );
1579
+ const m = c ?? (o ? he(o, s, n) : "");
1580
+ return /* @__PURE__ */ e(
1581
+ "input",
1582
+ {
1583
+ "aria-describedby": i,
1584
+ "aria-invalid": t ? !0 : void 0,
1585
+ className: "nim-input",
1586
+ dir: "ltr",
1587
+ id: a,
1588
+ inputMode: "numeric",
1589
+ onBlur: () => r(null),
1590
+ onChange: (h) => {
1591
+ r(h.target.value);
1592
+ const u = _a(h.target.value, n);
1593
+ u ? l(u) : h.target.value.trim() === "" && l("");
1594
+ },
1595
+ placeholder: he(ce(), s, n),
1596
+ type: "text",
1597
+ value: m
1598
+ }
1599
+ );
1600
+ }
1601
+ function pi({
1602
+ error: n,
1603
+ hint: i,
1604
+ id: a,
1605
+ label: t,
1606
+ onChange: s,
1607
+ required: l,
1608
+ value: o,
1609
+ ...c
1610
+ }) {
1611
+ const { locale: r } = re(), m = c.system ?? _e(r), [h, u] = A(o || ce());
1612
+ return /* @__PURE__ */ e(X, { error: n, hint: i, id: a, label: t, required: l, children: ({ control: p, describedBy: _ }) => /* @__PURE__ */ d("div", { className: "nim-stack nim-stack--tight", children: [
1613
+ /* @__PURE__ */ e(
1614
+ $e,
1615
+ {
1616
+ calendar: m,
1617
+ describedBy: _,
1618
+ id: p,
1619
+ invalid: !!n,
1620
+ locale: r,
1621
+ onChange: (f) => {
1622
+ s(f), f && u(f);
1623
+ },
1624
+ value: o
1625
+ }
1626
+ ),
1627
+ /* @__PURE__ */ e(
1628
+ Be,
1629
+ {
1630
+ ...c,
1631
+ month: h,
1632
+ onMonthChange: u,
1633
+ onSelect: (f) => {
1634
+ s(f), u(f);
1635
+ },
1636
+ system: m,
1637
+ value: o
1638
+ }
1639
+ )
1640
+ ] }) });
1641
+ }
1642
+ function _i({
1643
+ error: n,
1644
+ hint: i,
1645
+ id: a,
1646
+ label: t,
1647
+ labels: s,
1648
+ onChange: l,
1649
+ required: o,
1650
+ showEquivalent: c,
1651
+ value: r,
1652
+ ...m
1653
+ }) {
1654
+ const { locale: h } = re(), u = m.system ?? _e(h), [p, _] = A(!1), [f, w] = A(r || ce()), N = L(null), g = { clear: "Clear date", open: "Open calendar", ...s }, y = c ?? u === "persian", E = u === "persian" ? "gregory" : "persian";
1655
+ return /* @__PURE__ */ e(X, { error: n, hint: i, id: a, label: t, required: o, children: ({ control: I, describedBy: F }) => /* @__PURE__ */ d("div", { className: "nim-date-picker", children: [
1656
+ /* @__PURE__ */ d("div", { className: "nim-date-picker__group", children: [
1657
+ /* @__PURE__ */ e(
1658
+ $e,
1659
+ {
1660
+ calendar: u,
1661
+ describedBy: F,
1662
+ id: I,
1663
+ invalid: !!n,
1664
+ locale: h,
1665
+ onChange: (k) => {
1666
+ l(k), k && w(k);
1667
+ },
1668
+ value: r
1669
+ }
1670
+ ),
1671
+ r ? /* @__PURE__ */ e(
1672
+ R,
1673
+ {
1674
+ label: g.clear,
1675
+ name: "close",
1676
+ onClick: () => l(""),
1677
+ size: "sm"
1678
+ }
1679
+ ) : null,
1680
+ /* @__PURE__ */ e(
1681
+ R,
1682
+ {
1683
+ "aria-expanded": p,
1684
+ label: g.open,
1685
+ name: "calendar",
1686
+ onClick: () => _((k) => !k),
1687
+ ref: N,
1688
+ size: "sm"
1689
+ }
1690
+ )
1691
+ ] }),
1692
+ y && r ? /* @__PURE__ */ d("p", { className: "nim-date-picker__equivalent", children: [
1693
+ /* @__PURE__ */ e(C, { name: "calendar", size: "xs" }),
1694
+ /* @__PURE__ */ e("span", { dir: E === "gregory" ? "ltr" : void 0, children: he(r, h, E) })
1695
+ ] }) : null,
1696
+ /* @__PURE__ */ e(
1697
+ sa,
1698
+ {
1699
+ label: t ?? g.open,
1700
+ onClose: () => _(!1),
1701
+ open: p,
1702
+ triggerRef: N,
1703
+ children: /* @__PURE__ */ e(
1704
+ Be,
1705
+ {
1706
+ ...m,
1707
+ month: f,
1708
+ onMonthChange: w,
1709
+ onSelect: (k) => {
1710
+ l(k), w(k), _(!1);
1711
+ },
1712
+ system: u,
1713
+ value: r
1714
+ }
1715
+ )
1716
+ }
1717
+ )
1718
+ ] }) });
1719
+ }
1720
+ function fi({
1721
+ children: n,
1722
+ className: i,
1723
+ closeLabel: a = "Close",
1724
+ description: t,
1725
+ footer: s,
1726
+ onClose: l,
1727
+ open: o,
1728
+ title: c
1729
+ }) {
1730
+ const r = L(null);
1731
+ return Z(() => {
1732
+ const m = r.current;
1733
+ m && (o && !m.open && m.showModal(), !o && m.open && m.close());
1734
+ }, [o]), Z(() => {
1735
+ const m = r.current;
1736
+ if (!m) return;
1737
+ const h = () => l();
1738
+ return m.addEventListener("close", h), () => m.removeEventListener("close", h);
1739
+ }, [l]), /* @__PURE__ */ d(
1740
+ "dialog",
1741
+ {
1742
+ className: b("nim-dialog", i),
1743
+ onClick: (m) => {
1744
+ m.target === r.current && l();
1745
+ },
1746
+ ref: r,
1747
+ children: [
1748
+ /* @__PURE__ */ d("div", { className: "nim-dialog__header", children: [
1749
+ /* @__PURE__ */ d("div", { children: [
1750
+ /* @__PURE__ */ e("p", { className: "nim-title nim-title--md", children: c }),
1751
+ t ? /* @__PURE__ */ e("p", { className: "nim-caption", children: t }) : null
1752
+ ] }),
1753
+ /* @__PURE__ */ e(R, { label: a, name: "close", onClick: l, size: "sm" })
1754
+ ] }),
1755
+ /* @__PURE__ */ e("div", { className: "nim-dialog__body", children: n }),
1756
+ s ? /* @__PURE__ */ e("div", { className: "nim-dialog__footer", children: s }) : null
1757
+ ]
1758
+ }
1759
+ );
1760
+ }
1761
+ function Ni({ actions: n, className: i, description: a, icon: t = "search", title: s, ...l }) {
1762
+ return /* @__PURE__ */ d("div", { className: b("nim-empty", i), ...l, children: [
1763
+ /* @__PURE__ */ e("span", { className: "nim-empty__icon", children: /* @__PURE__ */ e(C, { name: t, size: "md" }) }),
1764
+ /* @__PURE__ */ e("p", { className: "nim-title nim-title--md", children: s }),
1765
+ a ? /* @__PURE__ */ e("p", { className: "nim-body nim-body--sm nim-empty__body", children: a }) : null,
1766
+ n ? /* @__PURE__ */ e("div", { className: "nim-empty__actions", children: n }) : null
1767
+ ] });
1768
+ }
1769
+ function bi({
1770
+ className: n,
1771
+ detail: i,
1772
+ label: a,
1773
+ percent: t,
1774
+ tone: s = "accent",
1775
+ value: l,
1776
+ ...o
1777
+ }) {
1778
+ const c = typeof t == "number", r = Math.min(100, Math.max(0, t ?? 0)), m = typeof a == "string" ? a : void 0;
1779
+ return /* @__PURE__ */ d("div", { className: b("nim-resource-meter", n), "data-tone": s, ...o, children: [
1780
+ /* @__PURE__ */ d("div", { className: "nim-resource-meter__head", children: [
1781
+ /* @__PURE__ */ e("span", { className: "nim-resource-meter__label", children: a }),
1782
+ /* @__PURE__ */ e("span", { className: "nim-resource-meter__value", children: l })
1783
+ ] }),
1784
+ c ? /* @__PURE__ */ e(
1785
+ "div",
1786
+ {
1787
+ "aria-label": m,
1788
+ "aria-valuemax": 100,
1789
+ "aria-valuemin": 0,
1790
+ "aria-valuenow": r,
1791
+ className: "nim-resource-meter__track",
1792
+ role: "meter",
1793
+ children: /* @__PURE__ */ e("span", { className: "nim-resource-meter__fill", style: { inlineSize: `${r}%` } })
1794
+ }
1795
+ ) : null,
1796
+ i ? /* @__PURE__ */ e("span", { className: "nim-resource-meter__detail", children: i }) : null
1797
+ ] });
1798
+ }
1799
+ function vi({ children: n, className: i, ...a }) {
1800
+ return /* @__PURE__ */ e("div", { className: b("nim-app-frame", i), ...a, children: n });
1801
+ }
1802
+ function gi({
1803
+ children: n,
1804
+ className: i,
1805
+ gap: a = "md",
1806
+ ...t
1807
+ }) {
1808
+ return /* @__PURE__ */ e("div", { className: b("nim-stack", a !== "md" && `nim-stack--${a}`, i), ...t, children: n });
1809
+ }
1810
+ function yi({ children: n, className: i, ...a }) {
1811
+ return /* @__PURE__ */ e("div", { className: b("nim-inline", i), ...a, children: n });
1812
+ }
1813
+ function Na({ children: n, className: i, plain: a = !1, ...t }) {
1814
+ return /* @__PURE__ */ e("div", { className: b("nim-list", a && "nim-list--plain", i), ...t, children: n });
1815
+ }
1816
+ function ba({
1817
+ className: n,
1818
+ href: i,
1819
+ leading: a,
1820
+ onClick: t,
1821
+ subtitle: s,
1822
+ title: l,
1823
+ trailing: o,
1824
+ ...c
1825
+ }) {
1826
+ const r = !!(i || t), m = /* @__PURE__ */ d(Y, { children: [
1827
+ a ? /* @__PURE__ */ e("span", { className: "nim-list-row__leading", children: a }) : null,
1828
+ /* @__PURE__ */ d("span", { className: "nim-list-row__content", children: [
1829
+ /* @__PURE__ */ e("span", { className: "nim-list-row__title", children: l }),
1830
+ s ? /* @__PURE__ */ e("span", { className: "nim-list-row__subtitle", children: s }) : null
1831
+ ] }),
1832
+ o ? /* @__PURE__ */ e("span", { className: "nim-list-row__trailing", children: o }) : null,
1833
+ r && !o ? /* @__PURE__ */ e(C, { className: "nim-list-row__chevron", name: "chevron-forward", size: "sm" }) : null
1834
+ ] }), h = b("nim-list-row", r && "nim-list-row--interactive", n);
1835
+ return i ? /* @__PURE__ */ e("a", { className: h, href: i, ...c, children: m }) : t ? /* @__PURE__ */ e("button", { className: h, onClick: t, type: "button", ...c, children: m }) : /* @__PURE__ */ e("div", { className: h, ...c, children: m });
1836
+ }
1837
+ const va = {
1838
+ back: "Back",
1839
+ dot: (n) => `Slide ${n + 1}`
1840
+ };
1841
+ function wi({
1842
+ brand: n,
1843
+ className: i,
1844
+ finishLabel: a,
1845
+ footnote: t,
1846
+ labels: s,
1847
+ nextLabel: l,
1848
+ onDone: o,
1849
+ onSkip: c,
1850
+ onStep: r,
1851
+ skipLabel: m,
1852
+ slides: h
1853
+ }) {
1854
+ var g;
1855
+ const [u, p] = A(0), _ = { ...va, ...s }, f = h[Math.min(u, h.length - 1)], w = u === h.length - 1, N = O(
1856
+ (y) => {
1857
+ p(y), r == null || r(y);
1858
+ },
1859
+ [r]
1860
+ );
1861
+ return /* @__PURE__ */ d("section", { className: b("nim-onboarding", i), children: [
1862
+ /* @__PURE__ */ d("header", { className: "nim-onboarding__bar", children: [
1863
+ /* @__PURE__ */ e("span", { className: "nim-onboarding__brand", children: n }),
1864
+ m ? /* @__PURE__ */ e(
1865
+ J,
1866
+ {
1867
+ iconEnd: "chevron-forward",
1868
+ onClick: c ?? o,
1869
+ size: "sm",
1870
+ variant: "ghost",
1871
+ children: m
1872
+ }
1873
+ ) : null
1874
+ ] }),
1875
+ /* @__PURE__ */ d("div", { "aria-live": "polite", className: "nim-onboarding__stage", children: [
1876
+ f.art ? /* @__PURE__ */ e("div", { className: "nim-onboarding__art", children: f.art }) : null,
1877
+ f.proof ? /* @__PURE__ */ d("div", { className: "nim-onboarding__proof", children: [
1878
+ f.proof.icon ? /* @__PURE__ */ e("span", { className: "nim-onboarding__proof-icon", children: f.proof.icon }) : null,
1879
+ /* @__PURE__ */ d("span", { className: "nim-onboarding__proof-text", children: [
1880
+ /* @__PURE__ */ e("span", { className: "nim-onboarding__proof-title", children: f.proof.title }),
1881
+ (g = f.proof.points) != null && g.length ? /* @__PURE__ */ e("span", { className: "nim-onboarding__proof-points", children: f.proof.points.join(" · ") }) : null
1882
+ ] })
1883
+ ] }) : null
1884
+ ] }),
1885
+ /* @__PURE__ */ d("div", { className: "nim-onboarding__copy", children: [
1886
+ f.label ? /* @__PURE__ */ e("span", { className: "nim-onboarding__chip", children: f.label }) : null,
1887
+ /* @__PURE__ */ e("h1", { className: "nim-onboarding__title", children: f.title }),
1888
+ f.body ? /* @__PURE__ */ e("p", { className: "nim-onboarding__body", children: f.body }) : null
1889
+ ] }),
1890
+ /* @__PURE__ */ d("footer", { className: "nim-onboarding__controls", children: [
1891
+ /* @__PURE__ */ e("div", { className: "nim-onboarding__dots", children: h.map((y, E) => /* @__PURE__ */ e(
1892
+ "button",
1893
+ {
1894
+ "aria-current": E === u ? "step" : void 0,
1895
+ "aria-label": _.dot(E),
1896
+ className: "nim-onboarding__dot",
1897
+ onClick: () => N(E),
1898
+ type: "button"
1899
+ },
1900
+ y.id
1901
+ )) }),
1902
+ /* @__PURE__ */ d("div", { className: "nim-onboarding__cta", children: [
1903
+ u > 0 ? /* @__PURE__ */ e(
1904
+ R,
1905
+ {
1906
+ label: _.back,
1907
+ name: "chevron-back",
1908
+ onClick: () => N(u - 1),
1909
+ size: "lg",
1910
+ variant: "outline"
1911
+ }
1912
+ ) : null,
1913
+ /* @__PURE__ */ e(
1914
+ J,
1915
+ {
1916
+ fullWidth: !0,
1917
+ iconEnd: w ? "arrow-forward" : void 0,
1918
+ onClick: () => w ? o() : N(u + 1),
1919
+ size: "lg",
1920
+ variant: "accent",
1921
+ children: w ? a : l
1922
+ }
1923
+ )
1924
+ ] }),
1925
+ t ? /* @__PURE__ */ e("p", { className: "nim-onboarding__footnote", children: t }) : null
1926
+ ] })
1927
+ ] });
1928
+ }
1929
+ const ga = "AD:376 AE:971 AF:93 AG:1268 AI:1264 AL:355 AM:374 AO:244 AQ:672 AR:54 AS:1684 AT:43 AU:61 AW:297 AX:358 AZ:994 BA:387 BB:1246 BD:880 BE:32 BF:226 BG:359 BH:973 BI:257 BJ:229 BL:590 BM:1441 BN:673 BO:591 BQ:599 BR:55 BS:1242 BT:975 BW:267 BY:375 BZ:501 CA:1 CC:61 CD:243 CF:236 CG:242 CH:41 CI:225 CK:682 CL:56 CM:237 CN:86 CO:57 CR:506 CU:53 CV:238 CW:599 CX:61 CY:357 CZ:420 DE:49 DJ:253 DK:45 DM:1767 DO:1809 DZ:213 EC:593 EE:372 EG:20 EH:212 ER:291 ES:34 ET:251 FI:358 FJ:679 FK:500 FM:691 FO:298 FR:33 GA:241 GB:44 GD:1473 GE:995 GF:594 GG:44 GH:233 GI:350 GL:299 GM:220 GN:224 GP:590 GQ:240 GR:30 GT:502 GU:1671 GW:245 GY:592 HK:852 HN:504 HR:385 HT:509 HU:36 ID:62 IE:353 IL:972 IM:44 IN:91 IO:246 IQ:964 IR:98 IS:354 IT:39 JE:44 JM:1876 JO:962 JP:81 KE:254 KG:996 KH:855 KI:686 KM:269 KN:1869 KP:850 KR:82 KW:965 KY:1345 KZ:7 LA:856 LB:961 LC:1758 LI:423 LK:94 LR:231 LS:266 LT:370 LU:352 LV:371 LY:218 MA:212 MC:377 MD:373 ME:382 MF:590 MG:261 MH:692 MK:389 ML:223 MM:95 MN:976 MO:853 MP:1670 MQ:596 MR:222 MS:1664 MT:356 MU:230 MV:960 MW:265 MX:52 MY:60 MZ:258 NA:264 NC:687 NE:227 NF:672 NG:234 NI:505 NL:31 NO:47 NP:977 NR:674 NU:683 NZ:64 OM:968 PA:507 PE:51 PF:689 PG:675 PH:63 PK:92 PL:48 PM:508 PR:1787 PS:970 PT:351 PW:680 PY:595 QA:974 RE:262 RO:40 RS:381 RU:7 RW:250 SA:966 SB:677 SC:248 SD:249 SE:46 SG:65 SH:290 SI:386 SJ:47 SK:421 SL:232 SM:378 SN:221 SO:252 SR:597 SS:211 ST:239 SV:503 SX:1721 SY:963 SZ:268 TC:1649 TD:235 TG:228 TH:66 TJ:992 TK:690 TL:670 TM:993 TN:216 TO:676 TR:90 TT:1868 TV:688 TW:886 TZ:255 UA:380 UG:256 US:1 UY:598 UZ:998 VA:39 VC:1784 VE:58 VG:1284 VI:1340 VN:84 VU:678 WF:681 WS:685 YE:967 YT:262 ZA:27 ZM:260 ZW:263";
1930
+ function ya(n) {
1931
+ return String.fromCodePoint(...[...n].map((i) => 127462 + i.charCodeAt(0) - 65));
1932
+ }
1933
+ const le = ga.split(" ").map((n) => {
1934
+ const [i, a] = n.split(":");
1935
+ return { dial: a, flag: ya(i), iso2: i };
1936
+ }), wa = new Map(le.map((n) => [n.iso2, n]));
1937
+ function Re(n) {
1938
+ return wa.get(n.toUpperCase());
1939
+ }
1940
+ function ki(n) {
1941
+ const i = n.replace(/\D/g, "");
1942
+ let a;
1943
+ for (const t of le)
1944
+ i.startsWith(t.dial) && (!a || t.dial.length > a.dial.length) && (a = t);
1945
+ return a;
1946
+ }
1947
+ const Se = /* @__PURE__ */ new Map();
1948
+ function ka(n) {
1949
+ const i = Se.get(n);
1950
+ if (i) return i;
1951
+ let a;
1952
+ try {
1953
+ const t = new Intl.DisplayNames([n], { type: "region" });
1954
+ a = (s) => t.of(s) ?? s;
1955
+ } catch {
1956
+ a = (t) => t;
1957
+ }
1958
+ return Se.set(n, a), a;
1959
+ }
1960
+ function ie(n) {
1961
+ let i = "";
1962
+ for (const a of n) {
1963
+ const t = a.codePointAt(0) ?? 0;
1964
+ t >= 1776 && t <= 1785 ? i += String.fromCodePoint(t - 1776 + 48) : t >= 1632 && t <= 1641 ? i += String.fromCodePoint(t - 1632 + 48) : a >= "0" && a <= "9" && (i += a);
1965
+ }
1966
+ return i;
1967
+ }
1968
+ function Ca({
1969
+ autoFocus: n = !1,
1970
+ className: i,
1971
+ digitLabel: a,
1972
+ error: t,
1973
+ label: s,
1974
+ length: l = 5,
1975
+ onChange: o,
1976
+ onComplete: c,
1977
+ value: r
1978
+ }) {
1979
+ const m = L(null), h = r.slice(0, l).split(""), u = O((N) => {
1980
+ var y, E;
1981
+ const g = (y = m.current) == null ? void 0 : y.querySelectorAll("input");
1982
+ (E = g == null ? void 0 : g[Math.max(0, Math.min(N, g.length - 1))]) == null || E.focus();
1983
+ }, []);
1984
+ Z(() => {
1985
+ n && u(0);
1986
+ }, [n, u]);
1987
+ const p = O(
1988
+ (N, g) => {
1989
+ const y = N.slice(0, l);
1990
+ o(y), y.length === l ? c == null || c(y) : u(g);
1991
+ },
1992
+ [u, l, o, c]
1993
+ ), _ = O(
1994
+ (N, g) => {
1995
+ const y = ie(g);
1996
+ if (!y) return;
1997
+ const E = (r.slice(0, N) + y).slice(0, l);
1998
+ p(E, E.length);
1999
+ },
2000
+ [p, l, r]
2001
+ ), f = O(
2002
+ (N, g) => {
2003
+ if (g.key === "Backspace") {
2004
+ g.preventDefault();
2005
+ const y = r[N] ? N : N - 1;
2006
+ if (y < 0) return;
2007
+ o(r.slice(0, y) + r.slice(y + 1)), u(y);
2008
+ } else g.key === "ArrowLeft" ? u(N - 1) : g.key === "ArrowRight" && u(N + 1);
2009
+ },
2010
+ [u, o, r]
2011
+ ), w = O(
2012
+ (N) => {
2013
+ const g = ie(N.clipboardData.getData("text"));
2014
+ g && (N.preventDefault(), p(g.slice(0, l), g.length));
2015
+ },
2016
+ [p, l]
2017
+ );
2018
+ return /* @__PURE__ */ d("div", { className: b("nim-otp", t && "nim-otp--invalid", i), children: [
2019
+ /* @__PURE__ */ e(
2020
+ "div",
2021
+ {
2022
+ "aria-label": s,
2023
+ className: "nim-otp__boxes",
2024
+ dir: "ltr",
2025
+ onPaste: w,
2026
+ ref: m,
2027
+ role: "group",
2028
+ children: Array.from({ length: l }, (N, g) => /* @__PURE__ */ e(
2029
+ "input",
2030
+ {
2031
+ "aria-invalid": t ? !0 : void 0,
2032
+ "aria-label": a ? a(g) : `${s} ${g + 1}`,
2033
+ autoComplete: g === 0 ? "one-time-code" : "off",
2034
+ className: "nim-otp__box",
2035
+ "data-filled": h[g] ? "true" : void 0,
2036
+ enterKeyHint: "done",
2037
+ inputMode: "numeric",
2038
+ onChange: (y) => _(g, y.target.value),
2039
+ onFocus: (y) => y.currentTarget.select(),
2040
+ onKeyDown: (y) => f(g, y),
2041
+ type: "text",
2042
+ value: h[g] ?? ""
2043
+ },
2044
+ g
2045
+ ))
2046
+ }
2047
+ ),
2048
+ t ? /* @__PURE__ */ e("p", { className: "nim-otp__error", role: "alert", children: t }) : null
2049
+ ] });
2050
+ }
2051
+ const Sa = (n, i) => {
2052
+ if (i <= 7) return Array.from({ length: i }, (s, l) => l + 1);
2053
+ const a = /* @__PURE__ */ new Set([1, i, n, n - 1, n + 1]);
2054
+ n <= 3 && [2, 3, 4].forEach((s) => a.add(s)), n >= i - 2 && [i - 3, i - 2, i - 1].forEach((s) => a.add(s));
2055
+ const t = [...a].filter((s) => s >= 1 && s <= i).sort((s, l) => s - l);
2056
+ return t.flatMap((s, l) => l > 0 && s - t[l - 1] > 1 ? ["gap", s] : [s]);
2057
+ };
2058
+ function Ci({
2059
+ className: n,
2060
+ label: i = "Pagination",
2061
+ nextLabel: a = "Next page",
2062
+ onChange: t,
2063
+ page: s,
2064
+ pageCount: l,
2065
+ previousLabel: o = "Previous page",
2066
+ summary: c
2067
+ }) {
2068
+ return /* @__PURE__ */ d("nav", { "aria-label": i, className: b("nim-pagination", n), children: [
2069
+ c ? /* @__PURE__ */ e("p", { className: "nim-pagination__summary", children: c }) : /* @__PURE__ */ e("span", {}),
2070
+ /* @__PURE__ */ d("div", { className: "nim-pagination__list", children: [
2071
+ /* @__PURE__ */ e(
2072
+ "button",
2073
+ {
2074
+ "aria-label": o,
2075
+ className: "nim-pagination__item",
2076
+ disabled: s <= 1,
2077
+ onClick: () => t(s - 1),
2078
+ type: "button",
2079
+ children: /* @__PURE__ */ e(C, { name: "chevron-back", size: "sm" })
2080
+ }
2081
+ ),
2082
+ Sa(s, l).map(
2083
+ (r, m) => r === "gap" ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-pagination__ellipsis", children: "…" }, `gap-${m}`) : /* @__PURE__ */ e(
2084
+ "button",
2085
+ {
2086
+ "aria-current": r === s ? "page" : void 0,
2087
+ className: "nim-pagination__item",
2088
+ onClick: () => t(r),
2089
+ type: "button",
2090
+ children: r
2091
+ },
2092
+ r
2093
+ )
2094
+ ),
2095
+ /* @__PURE__ */ e(
2096
+ "button",
2097
+ {
2098
+ "aria-label": a,
2099
+ className: "nim-pagination__item",
2100
+ disabled: s >= l,
2101
+ onClick: () => t(s + 1),
2102
+ type: "button",
2103
+ children: /* @__PURE__ */ e(C, { name: "chevron-forward", size: "sm" })
2104
+ }
2105
+ )
2106
+ ] })
2107
+ ] });
2108
+ }
2109
+ const Ta = {
2110
+ hide: "Hide password",
2111
+ show: "Show password",
2112
+ strength: (n) => `Password strength: ${n}`
2113
+ }, Te = ["weak", "fair", "good", "strong"];
2114
+ function Aa({
2115
+ className: n,
2116
+ error: i,
2117
+ hint: a,
2118
+ id: t,
2119
+ label: s,
2120
+ labels: l,
2121
+ required: o,
2122
+ strength: c,
2123
+ ...r
2124
+ }) {
2125
+ const [m, h] = A(!1), u = { ...Ta, ...l };
2126
+ return /* @__PURE__ */ e(X, { error: i, hint: a, id: t, label: s, required: o, children: ({ control: p, describedBy: _ }) => /* @__PURE__ */ d(Y, { children: [
2127
+ /* @__PURE__ */ d("div", { className: "nim-input-shell nim-input-shell--has-end", children: [
2128
+ /* @__PURE__ */ e(
2129
+ "input",
2130
+ {
2131
+ "aria-describedby": _,
2132
+ "aria-invalid": i ? !0 : void 0,
2133
+ autoComplete: r.autoComplete ?? "current-password",
2134
+ className: b("nim-input", n),
2135
+ id: p,
2136
+ required: o,
2137
+ ...r,
2138
+ type: m ? "text" : "password"
2139
+ }
2140
+ ),
2141
+ /* @__PURE__ */ e(
2142
+ "button",
2143
+ {
2144
+ "aria-controls": p,
2145
+ "aria-label": m ? u.hide : u.show,
2146
+ "aria-pressed": m,
2147
+ className: "nim-password__toggle",
2148
+ onClick: () => h((f) => !f),
2149
+ type: "button",
2150
+ children: /* @__PURE__ */ e(C, { name: "eye", size: "sm" })
2151
+ }
2152
+ )
2153
+ ] }),
2154
+ c ? /* @__PURE__ */ e(
2155
+ "div",
2156
+ {
2157
+ "aria-label": u.strength(c),
2158
+ className: "nim-password__meter",
2159
+ "data-level": c,
2160
+ role: "img",
2161
+ children: Te.map((f, w) => /* @__PURE__ */ e(
2162
+ "span",
2163
+ {
2164
+ className: "nim-password__step",
2165
+ "data-on": w <= Te.indexOf(c) ? "true" : void 0
2166
+ },
2167
+ f
2168
+ ))
2169
+ }
2170
+ ) : null
2171
+ ] }) });
2172
+ }
2173
+ function Si(n) {
2174
+ if (n.length < 8) return "weak";
2175
+ const i = [/[a-z]/, /[A-Z]/, /\d/, /[^\w\s]/].filter((a) => a.test(n)).length;
2176
+ return n.length >= 14 && i >= 3 ? "strong" : n.length >= 10 && i >= 2 ? "good" : "fair";
2177
+ }
2178
+ const Ea = {
2179
+ noMatch: "No country matches",
2180
+ pickCountry: "Country code",
2181
+ search: "Search countries"
2182
+ };
2183
+ function xa({
2184
+ className: n,
2185
+ country: i,
2186
+ error: a,
2187
+ hint: t,
2188
+ id: s,
2189
+ label: l,
2190
+ labels: o,
2191
+ locale: c,
2192
+ onChange: r,
2193
+ onCountryChange: m,
2194
+ onSubmit: h,
2195
+ placeholder: u,
2196
+ priority: p = [],
2197
+ required: _,
2198
+ value: f
2199
+ }) {
2200
+ const w = pe(), N = s ?? `nim-${w}`, g = t ? `${N}-hint` : void 0, y = a ? `${N}-error` : void 0, E = { ...Ea, ...o }, [I, F] = A(!1), [k, B] = A(""), S = L(null), D = L(null), T = L(null), P = c ?? (typeof document > "u" ? "en" : document.documentElement.lang || "en"), $ = H(() => ka(P), [P]), K = Re(i) ?? le[0], j = H(() => {
2201
+ const v = new Intl.Collator(P), x = le.map((z) => ({ ...z, name: $(z.iso2) })), M = (z) => {
2202
+ const U = p.indexOf(z);
2203
+ return U === -1 ? p.length : U;
2204
+ };
2205
+ return x.sort(
2206
+ (z, U) => M(z.iso2) - M(U.iso2) || v.compare(z.name, U.name)
2207
+ );
2208
+ }, [$, p, P]), W = H(() => {
2209
+ const v = k.trim().toLocaleLowerCase(P);
2210
+ if (!v) return j;
2211
+ const x = ie(v);
2212
+ return j.filter(
2213
+ (M) => M.name.toLocaleLowerCase(P).includes(v) || M.iso2.toLowerCase().includes(v) || (x ? M.dial.startsWith(x) : !1)
2214
+ );
2215
+ }, [j, k, P]);
2216
+ Z(() => {
2217
+ var M;
2218
+ if (!I) return;
2219
+ (M = T.current) == null || M.focus();
2220
+ const v = (z) => {
2221
+ var U;
2222
+ (U = S.current) != null && U.contains(z.target) || F(!1);
2223
+ }, x = (z) => {
2224
+ var U;
2225
+ z.key === "Escape" && (F(!1), (U = D.current) == null || U.focus());
2226
+ };
2227
+ return document.addEventListener("mousedown", v), document.addEventListener("keydown", x), () => {
2228
+ document.removeEventListener("mousedown", v), document.removeEventListener("keydown", x);
2229
+ };
2230
+ }, [I]);
2231
+ const V = (v) => {
2232
+ var x;
2233
+ m(v), F(!1), B(""), (x = D.current) == null || x.focus();
2234
+ };
2235
+ return /* @__PURE__ */ d("div", { className: b("nim-field", a && "nim-field--invalid", n), children: [
2236
+ l ? /* @__PURE__ */ d("label", { className: "nim-field__label", htmlFor: N, children: [
2237
+ l,
2238
+ _ ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-field__required", children: "*" }) : null
2239
+ ] }) : null,
2240
+ /* @__PURE__ */ d("div", { className: "nim-phone", ref: S, children: [
2241
+ /* @__PURE__ */ d("div", { className: "nim-phone__shell", dir: "ltr", children: [
2242
+ /* @__PURE__ */ d(
2243
+ "button",
2244
+ {
2245
+ "aria-expanded": I,
2246
+ "aria-haspopup": "listbox",
2247
+ "aria-label": `${E.pickCountry}: ${$(K.iso2)} +${K.dial}`,
2248
+ className: "nim-phone__country",
2249
+ onClick: () => F((v) => !v),
2250
+ ref: D,
2251
+ type: "button",
2252
+ children: [
2253
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-phone__flag", children: K.flag }),
2254
+ /* @__PURE__ */ d("span", { className: "nim-phone__dial", children: [
2255
+ "+",
2256
+ K.dial
2257
+ ] }),
2258
+ /* @__PURE__ */ e(C, { className: "nim-phone__caret", name: "chevron-down", size: "xs" })
2259
+ ]
2260
+ }
2261
+ ),
2262
+ /* @__PURE__ */ e(
2263
+ "input",
2264
+ {
2265
+ "aria-describedby": [y, g].filter(Boolean).join(" ") || void 0,
2266
+ "aria-invalid": a ? !0 : void 0,
2267
+ autoComplete: "tel-national",
2268
+ className: "nim-phone__input",
2269
+ enterKeyHint: "go",
2270
+ id: N,
2271
+ inputMode: "tel",
2272
+ onChange: (v) => r(ie(v.target.value)),
2273
+ onKeyDown: (v) => {
2274
+ v.key === "Enter" && (h == null || h());
2275
+ },
2276
+ placeholder: u,
2277
+ required: _,
2278
+ type: "tel",
2279
+ value: f
2280
+ }
2281
+ )
2282
+ ] }),
2283
+ I ? /* @__PURE__ */ d("div", { className: "nim-phone__picker", children: [
2284
+ /* @__PURE__ */ d("div", { className: "nim-phone__search", children: [
2285
+ /* @__PURE__ */ e(C, { name: "search", size: "sm" }),
2286
+ /* @__PURE__ */ e(
2287
+ "input",
2288
+ {
2289
+ "aria-label": E.search,
2290
+ className: "nim-phone__search-input",
2291
+ onChange: (v) => B(v.target.value),
2292
+ placeholder: E.search,
2293
+ ref: T,
2294
+ type: "search",
2295
+ value: k
2296
+ }
2297
+ )
2298
+ ] }),
2299
+ /* @__PURE__ */ d("ul", { className: "nim-phone__list", role: "listbox", children: [
2300
+ W.map((v) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
2301
+ "button",
2302
+ {
2303
+ "aria-selected": v.iso2 === K.iso2,
2304
+ className: "nim-phone__option",
2305
+ onClick: () => V(v.iso2),
2306
+ role: "option",
2307
+ type: "button",
2308
+ children: [
2309
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-phone__flag", children: v.flag }),
2310
+ /* @__PURE__ */ e("span", { className: "nim-phone__name", children: v.name }),
2311
+ /* @__PURE__ */ d("span", { className: "nim-phone__option-dial", dir: "ltr", children: [
2312
+ "+",
2313
+ v.dial
2314
+ ] })
2315
+ ]
2316
+ }
2317
+ ) }, v.iso2)),
2318
+ W.length === 0 ? /* @__PURE__ */ e("li", { className: "nim-phone__empty", children: E.noMatch }) : null
2319
+ ] })
2320
+ ] }) : null
2321
+ ] }),
2322
+ a ? /* @__PURE__ */ e("p", { className: "nim-field__error", id: y, children: a }) : null,
2323
+ t && !a ? /* @__PURE__ */ e("p", { className: "nim-field__hint", id: g, children: t }) : null
2324
+ ] });
2325
+ }
2326
+ function Da(n, i) {
2327
+ var t;
2328
+ return `+${((t = Re(n)) == null ? void 0 : t.dial) ?? ""}${ie(i).replace(/^0+/, "")}`;
2329
+ }
2330
+ const Ma = {
2331
+ excluded: "minus",
2332
+ included: "check",
2333
+ pending: "clock"
2334
+ };
2335
+ function La({
2336
+ badge: n,
2337
+ className: i,
2338
+ features: a = [],
2339
+ icon: t,
2340
+ name: s,
2341
+ onSelect: l,
2342
+ price: o,
2343
+ priceCaption: c,
2344
+ secondary: r,
2345
+ selected: m = !1,
2346
+ tagline: h
2347
+ }) {
2348
+ const u = /* @__PURE__ */ d(Y, { children: [
2349
+ /* @__PURE__ */ d("div", { className: "nim-plan__top", children: [
2350
+ t ? /* @__PURE__ */ e("span", { className: "nim-plan__icon", children: /* @__PURE__ */ e(C, { name: t, size: "md" }) }) : null,
2351
+ /* @__PURE__ */ d("div", { className: "nim-plan__heading", children: [
2352
+ /* @__PURE__ */ e("span", { className: "nim-plan__name", children: s }),
2353
+ h ? /* @__PURE__ */ e("span", { className: "nim-plan__tagline", children: h }) : null
2354
+ ] }),
2355
+ n ? /* @__PURE__ */ e("span", { className: "nim-plan__badge", children: n }) : null,
2356
+ l ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-plan__radio", children: m ? /* @__PURE__ */ e(C, { name: "check", size: "xs" }) : null }) : null
2357
+ ] }),
2358
+ /* @__PURE__ */ d("div", { className: "nim-plan__price-box", children: [
2359
+ /* @__PURE__ */ d("div", { children: [
2360
+ c ? /* @__PURE__ */ e("span", { className: "nim-plan__price-caption", children: c }) : null,
2361
+ /* @__PURE__ */ e("strong", { className: "nim-plan__price", children: o })
2362
+ ] }),
2363
+ r ? /* @__PURE__ */ d("div", { className: "nim-plan__secondary", children: [
2364
+ /* @__PURE__ */ e("span", { className: "nim-plan__price-caption", children: r.caption }),
2365
+ /* @__PURE__ */ e("strong", { className: "nim-plan__secondary-value", children: r.value })
2366
+ ] }) : null
2367
+ ] }),
2368
+ a.length ? /* @__PURE__ */ e("ul", { className: "nim-plan__features", children: a.map((_, f) => {
2369
+ const w = _.state ?? "included";
2370
+ return /* @__PURE__ */ d("li", { className: "nim-plan__feature", "data-state": w, children: [
2371
+ /* @__PURE__ */ e(C, { name: Ma[w], size: "xs" }),
2372
+ /* @__PURE__ */ e("span", { className: "nim-plan__feature-label", children: _.label }),
2373
+ _.note ? /* @__PURE__ */ e("span", { className: "nim-plan__feature-note", children: _.note }) : null
2374
+ ] }, f);
2375
+ }) }) : null
2376
+ ] }), p = b("nim-plan", m && "nim-plan--selected", i);
2377
+ return l ? /* @__PURE__ */ e("button", { "aria-pressed": m, className: p, onClick: l, type: "button", children: u }) : /* @__PURE__ */ e("article", { className: p, children: u });
2378
+ }
2379
+ function Ia({
2380
+ className: n,
2381
+ fullWidth: i = !1,
2382
+ label: a,
2383
+ onChange: t,
2384
+ options: s,
2385
+ value: l,
2386
+ ...o
2387
+ }) {
2388
+ return /* @__PURE__ */ e(
2389
+ "div",
2390
+ {
2391
+ "aria-label": a,
2392
+ className: b("nim-segmented", i && "nim-segmented--full", n),
2393
+ role: "tablist",
2394
+ ...o,
2395
+ children: s.map((c) => /* @__PURE__ */ e(
2396
+ "button",
2397
+ {
2398
+ "aria-selected": c.value === l,
2399
+ className: "nim-segmented__option",
2400
+ disabled: c.disabled,
2401
+ onClick: () => t(c.value),
2402
+ role: "tab",
2403
+ type: "button",
2404
+ children: c.label
2405
+ },
2406
+ c.value
2407
+ ))
2408
+ }
2409
+ );
2410
+ }
2411
+ const za = {
2412
+ cycle: "Billing period",
2413
+ monthly: "Per month",
2414
+ price: "This package"
2415
+ };
2416
+ function Ti({
2417
+ className: n,
2418
+ cycle: i,
2419
+ cycles: a = [],
2420
+ defaultCycle: t,
2421
+ defaultPlan: s,
2422
+ labels: l,
2423
+ note: o,
2424
+ onCycleChange: c,
2425
+ onPlanChange: r,
2426
+ onSubmit: m,
2427
+ plan: h,
2428
+ plans: u,
2429
+ submitLabel: p
2430
+ }) {
2431
+ var B, S;
2432
+ const _ = { ...za, ...l }, [f, w] = A(t ?? ((B = a[0]) == null ? void 0 : B.id) ?? ""), [N, g] = A(s ?? ((S = u[0]) == null ? void 0 : S.id) ?? ""), y = i ?? f, E = h ?? N, I = (D) => {
2433
+ g(D), r == null || r(D);
2434
+ }, F = (D) => {
2435
+ w(D), c == null || c(D);
2436
+ }, k = a.find((D) => D.id === y);
2437
+ return /* @__PURE__ */ d("section", { className: b("nim-plan-picker", n), children: [
2438
+ a.length > 1 ? /* @__PURE__ */ d("div", { className: "nim-plan-picker__cycles", children: [
2439
+ /* @__PURE__ */ e(
2440
+ Ia,
2441
+ {
2442
+ fullWidth: !0,
2443
+ label: _.cycle,
2444
+ onChange: F,
2445
+ options: a.map((D) => ({ label: D.label, value: D.id })),
2446
+ value: y
2447
+ }
2448
+ ),
2449
+ k != null && k.note ? /* @__PURE__ */ e("p", { className: "nim-plan-picker__save", children: k.note }) : null
2450
+ ] }) : null,
2451
+ /* @__PURE__ */ e("div", { className: "nim-plan-picker__plans", children: u.map(({ id: D, prices: T, ...P }) => {
2452
+ const $ = T[y] ?? Object.values(T)[0];
2453
+ return /* @__PURE__ */ Ge(
2454
+ La,
2455
+ {
2456
+ ...P,
2457
+ key: D,
2458
+ onSelect: () => I(D),
2459
+ price: ($ == null ? void 0 : $.price) ?? "",
2460
+ priceCaption: _.price,
2461
+ secondary: ($ == null ? void 0 : $.monthly) === void 0 ? void 0 : { caption: _.monthly, value: $.monthly },
2462
+ selected: D === E
2463
+ }
2464
+ );
2465
+ }) }),
2466
+ p ? /* @__PURE__ */ d("div", { className: "nim-plan-picker__foot", children: [
2467
+ /* @__PURE__ */ e(
2468
+ J,
2469
+ {
2470
+ fullWidth: !0,
2471
+ onClick: () => m == null ? void 0 : m(E, y),
2472
+ size: "lg",
2473
+ variant: "accent",
2474
+ children: p
2475
+ }
2476
+ ),
2477
+ o ? /* @__PURE__ */ e("p", { className: "nim-plan-picker__note", children: o }) : null
2478
+ ] }) : null
2479
+ ] });
2480
+ }
2481
+ function Pa({
2482
+ action: n,
2483
+ className: i,
2484
+ description: a,
2485
+ eyebrow: t,
2486
+ title: s,
2487
+ ...l
2488
+ }) {
2489
+ return /* @__PURE__ */ d("header", { className: b("nim-section-header", i), ...l, children: [
2490
+ /* @__PURE__ */ d("div", { children: [
2491
+ t ? /* @__PURE__ */ e("p", { className: "nim-label nim-section-header__eyebrow", children: t }) : null,
2492
+ /* @__PURE__ */ e("h2", { className: "nim-title nim-title--md", children: s }),
2493
+ a ? /* @__PURE__ */ e("p", { className: "nim-body nim-body--sm nim-section-header__description", children: a }) : null
2494
+ ] }),
2495
+ n ? /* @__PURE__ */ e("div", { className: "nim-section-header__action", children: n }) : null
2496
+ ] });
2497
+ }
2498
+ function Ai({
2499
+ className: n,
2500
+ footer: i,
2501
+ sections: a = [],
2502
+ ...t
2503
+ }) {
2504
+ return /* @__PURE__ */ d("div", { className: b("nim-profile-screen", n), children: [
2505
+ /* @__PURE__ */ e(Yn, { ...t }),
2506
+ a.map((s) => /* @__PURE__ */ d("section", { className: "nim-profile-screen__section", children: [
2507
+ s.title ? /* @__PURE__ */ e(Pa, { description: s.description, title: s.title }) : null,
2508
+ /* @__PURE__ */ e(Na, { children: s.rows.map((l) => /* @__PURE__ */ e(
2509
+ ba,
2510
+ {
2511
+ className: b(l.danger && "nim-list-row--danger"),
2512
+ href: l.href,
2513
+ leading: l.icon ? /* @__PURE__ */ e(C, { name: l.icon, size: "md" }) : void 0,
2514
+ onClick: l.onToggle ? void 0 : l.onSelect,
2515
+ subtitle: l.subtitle,
2516
+ title: l.label,
2517
+ trailing: l.onToggle ? (
2518
+ // The row's own title names the switch, so the control
2519
+ // carries the name rather than repeating the text beside
2520
+ // itself. A toggle row is a div, never a button — a switch
2521
+ // inside a button is two controls in one target.
2522
+ /* @__PURE__ */ e(
2523
+ ia,
2524
+ {
2525
+ "aria-label": typeof l.label == "string" ? l.label : void 0,
2526
+ checked: l.checked ?? !1,
2527
+ onChange: (o) => {
2528
+ var c;
2529
+ return (c = l.onToggle) == null ? void 0 : c.call(l, o.target.checked);
2530
+ },
2531
+ children: ""
2532
+ }
2533
+ )
2534
+ ) : l.value !== void 0 ? /* @__PURE__ */ e("span", { className: "nim-profile-screen__value", children: l.value }) : void 0
2535
+ },
2536
+ l.key
2537
+ )) })
2538
+ ] }, s.key)),
2539
+ i ? /* @__PURE__ */ e("div", { className: "nim-profile-screen__footer", children: i }) : null
2540
+ ] });
2541
+ }
2542
+ const Ba = {
2543
+ back: "Back",
2544
+ codeLabel: "Verification code",
2545
+ codeSubtitle: (n) => `Enter the code we sent to ${n}`,
2546
+ codeTitle: "Verification code",
2547
+ identifierLabel: "Email",
2548
+ passwordLabel: "Password",
2549
+ passwordSubtitle: "Use the email and password on your account.",
2550
+ passwordTitle: "Sign in with a password",
2551
+ phoneLabel: "Mobile number",
2552
+ phoneSubtitle: "Enter your mobile number. We will text you a code — no password.",
2553
+ phoneTitle: "Welcome",
2554
+ resend: "Send the code again",
2555
+ resendIn: (n) => `You can ask for a new code in ${n}s`,
2556
+ sendCode: "Send code",
2557
+ signIn: "Sign in",
2558
+ usePassword: "Sign in with a password instead",
2559
+ usePhone: "Sign in with a code instead",
2560
+ verify: "Verify and sign in"
2561
+ }, ue = (n, i) => n instanceof Error && n.message.trim() ? n.message.trim() : i;
2562
+ function Ei({
2563
+ brand: n,
2564
+ className: i,
2565
+ codeLength: a = 5,
2566
+ copy: t,
2567
+ defaultCountry: s = "IR",
2568
+ defaultMethod: l = "code",
2569
+ footer: o,
2570
+ methods: c = ["code", "password"],
2571
+ onPasswordSignIn: r,
2572
+ onRequestCode: m,
2573
+ onVerifyCode: h,
2574
+ priority: u = ["IR", "AE", "TR", "DE", "US", "GB"],
2575
+ resendSeconds: p = 60
2576
+ }) {
2577
+ const _ = { ...Ba, ...t }, [f, w] = A(
2578
+ c.includes(l) ? l : c[0]
2579
+ ), [N, g] = A(!1), [y, E] = A(s), [I, F] = A(""), [k, B] = A(""), [S, D] = A(""), [T, P] = A(""), [$, K] = A(!1), [j, W] = A(""), [V, v] = A(0), x = L(!1);
2580
+ Z(() => {
2581
+ if (V <= 0) return;
2582
+ const G = window.setTimeout(() => v((q) => q - 1), 1e3);
2583
+ return () => window.clearTimeout(G);
2584
+ }, [V]);
2585
+ const M = Da(y, I), z = I.replace(/\D/g, "").length >= 6, U = O(
2586
+ async (G = !1) => {
2587
+ if (!($ || !G && !z)) {
2588
+ K(!0), W("");
2589
+ try {
2590
+ await (m == null ? void 0 : m(M)), g(!0), B(""), v(p);
2591
+ } catch (q) {
2592
+ W(ue(q, _.sendCode));
2593
+ } finally {
2594
+ K(!1);
2595
+ }
2596
+ }
2597
+ },
2598
+ [$, M, m, z, p, _.sendCode]
2599
+ ), fe = O(
2600
+ async (G) => {
2601
+ if (!(x.current || G.length !== a)) {
2602
+ x.current = !0, K(!0), W("");
2603
+ try {
2604
+ await (h == null ? void 0 : h(M, G));
2605
+ } catch (q) {
2606
+ W(ue(q, _.verify)), B("");
2607
+ } finally {
2608
+ x.current = !1, K(!1);
2609
+ }
2610
+ }
2611
+ },
2612
+ [a, M, h, _.verify]
2613
+ ), Ne = O(async () => {
2614
+ if (!($ || !S.trim() || !T)) {
2615
+ K(!0), W("");
2616
+ try {
2617
+ await (r == null ? void 0 : r(S.trim(), T));
2618
+ } catch (G) {
2619
+ W(ue(G, _.signIn));
2620
+ } finally {
2621
+ K(!1);
2622
+ }
2623
+ }
2624
+ }, [$, S, r, T, _.signIn]), be = c.length > 1 ? /* @__PURE__ */ e(
2625
+ J,
2626
+ {
2627
+ onClick: () => {
2628
+ w(f === "code" ? "password" : "code"), W("");
2629
+ },
2630
+ size: "sm",
2631
+ variant: "ghost",
2632
+ children: f === "code" ? _.usePassword : _.usePhone
2633
+ }
2634
+ ) : null, oe = j ? /* @__PURE__ */ e(Vn, { tone: "danger", children: j }) : null;
2635
+ return f === "password" ? /* @__PURE__ */ d(
2636
+ de,
2637
+ {
2638
+ action: {
2639
+ disabled: !S.trim() || !T,
2640
+ label: _.signIn,
2641
+ loading: $,
2642
+ onClick: () => void Ne()
2643
+ },
2644
+ brand: n,
2645
+ className: i,
2646
+ footer: /* @__PURE__ */ d(Y, { children: [
2647
+ be,
2648
+ o
2649
+ ] }),
2650
+ subtitle: _.passwordSubtitle,
2651
+ title: _.passwordTitle,
2652
+ children: [
2653
+ oe,
2654
+ /* @__PURE__ */ e(
2655
+ ta,
2656
+ {
2657
+ autoComplete: "username",
2658
+ label: _.identifierLabel,
2659
+ onChange: (G) => D(G.target.value),
2660
+ type: "email",
2661
+ value: S
2662
+ }
2663
+ ),
2664
+ /* @__PURE__ */ e(
2665
+ Aa,
2666
+ {
2667
+ autoComplete: "current-password",
2668
+ label: _.passwordLabel,
2669
+ onChange: (G) => P(G.target.value),
2670
+ onKeyDown: (G) => {
2671
+ G.key === "Enter" && Ne();
2672
+ },
2673
+ value: T
2674
+ }
2675
+ )
2676
+ ]
2677
+ }
2678
+ ) : N ? /* @__PURE__ */ d(
2679
+ de,
2680
+ {
2681
+ action: {
2682
+ disabled: k.length !== a,
2683
+ label: _.verify,
2684
+ loading: $,
2685
+ onClick: () => void fe(k)
2686
+ },
2687
+ back: {
2688
+ label: _.back,
2689
+ onClick: () => {
2690
+ g(!1), B(""), W("");
2691
+ }
2692
+ },
2693
+ className: i,
2694
+ footer: /* @__PURE__ */ d(Y, { children: [
2695
+ V > 0 ? /* @__PURE__ */ e("p", { children: _.resendIn(V) }) : /* @__PURE__ */ e(J, { onClick: () => void U(!0), size: "sm", variant: "ghost", children: _.resend }),
2696
+ o
2697
+ ] }),
2698
+ subtitle: _.codeSubtitle(M),
2699
+ title: _.codeTitle,
2700
+ children: [
2701
+ oe,
2702
+ /* @__PURE__ */ e(
2703
+ Ca,
2704
+ {
2705
+ autoFocus: !0,
2706
+ label: _.codeLabel,
2707
+ length: a,
2708
+ onChange: B,
2709
+ onComplete: (G) => void fe(G),
2710
+ value: k
2711
+ }
2712
+ )
2713
+ ]
2714
+ }
2715
+ ) : /* @__PURE__ */ d(
2716
+ de,
2717
+ {
2718
+ action: {
2719
+ disabled: !z,
2720
+ label: _.sendCode,
2721
+ loading: $,
2722
+ onClick: () => void U()
2723
+ },
2724
+ brand: n,
2725
+ className: i,
2726
+ footer: /* @__PURE__ */ d(Y, { children: [
2727
+ be,
2728
+ o
2729
+ ] }),
2730
+ subtitle: _.phoneSubtitle,
2731
+ title: _.phoneTitle,
2732
+ children: [
2733
+ oe,
2734
+ /* @__PURE__ */ e(
2735
+ xa,
2736
+ {
2737
+ country: y,
2738
+ label: _.phoneLabel,
2739
+ onChange: F,
2740
+ onCountryChange: E,
2741
+ onSubmit: () => void U(),
2742
+ priority: u,
2743
+ value: I
2744
+ }
2745
+ )
2746
+ ]
2747
+ }
2748
+ );
2749
+ }
2750
+ function xi({ children: n, className: i, closeLabel: a = "Close", footer: t, onClose: s, open: l, title: o }) {
2751
+ const c = L(null), r = L(null);
2752
+ return Z(() => {
2753
+ var u;
2754
+ if (!l) return;
2755
+ r.current = document.activeElement;
2756
+ const m = document.body.style.overflow;
2757
+ document.body.style.overflow = "hidden", (u = c.current) == null || u.focus();
2758
+ const h = (p) => {
2759
+ p.key === "Escape" && s();
2760
+ };
2761
+ return window.addEventListener("keydown", h), () => {
2762
+ var p, _;
2763
+ document.body.style.overflow = m, window.removeEventListener("keydown", h), (_ = (p = r.current) == null ? void 0 : p.focus) == null || _.call(p);
2764
+ };
2765
+ }, [s, l]), !l || typeof document > "u" ? null : se(
2766
+ /* @__PURE__ */ d(Y, { children: [
2767
+ /* @__PURE__ */ e("div", { className: "nim-sheet__scrim", onClick: s }),
2768
+ /* @__PURE__ */ d(
2769
+ "div",
2770
+ {
2771
+ "aria-label": typeof o == "string" ? o : a,
2772
+ "aria-modal": "true",
2773
+ className: b("nim-sheet__panel", i),
2774
+ ref: c,
2775
+ role: "dialog",
2776
+ tabIndex: -1,
2777
+ children: [
2778
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-sheet__handle" }),
2779
+ o ? /* @__PURE__ */ d("div", { className: "nim-sheet__header", children: [
2780
+ /* @__PURE__ */ e("p", { className: "nim-title nim-title--md", children: o }),
2781
+ /* @__PURE__ */ e(R, { label: a, name: "close", onClick: s, size: "sm" })
2782
+ ] }) : null,
2783
+ /* @__PURE__ */ e("div", { className: "nim-sheet__body", children: n }),
2784
+ t ? /* @__PURE__ */ e("div", { className: "nim-sheet__footer", children: t }) : null
2785
+ ]
2786
+ }
2787
+ )
2788
+ ] }),
2789
+ document.body
2790
+ );
2791
+ }
2792
+ function Di({
2793
+ className: n,
2794
+ label: i,
2795
+ max: a = 100,
2796
+ min: t = 0,
2797
+ scale: s,
2798
+ step: l = 1,
2799
+ value: o,
2800
+ ...c
2801
+ }) {
2802
+ const r = a === t ? 0 : (o - t) / (a - t) * 100;
2803
+ return /* @__PURE__ */ d("div", { className: "nim-field", children: [
2804
+ i ? /* @__PURE__ */ e("span", { className: "nim-field__label", children: i }) : null,
2805
+ /* @__PURE__ */ e(
2806
+ "input",
2807
+ {
2808
+ "aria-label": i,
2809
+ className: b("nim-slider", n),
2810
+ max: a,
2811
+ min: t,
2812
+ step: l,
2813
+ style: { "--nim-slider-progress": `${r}%` },
2814
+ type: "range",
2815
+ value: o,
2816
+ ...c
2817
+ }
2818
+ ),
2819
+ s ? /* @__PURE__ */ e("div", { "aria-hidden": "true", className: "nim-inline", style: { justifyContent: "space-between" }, children: s.map((m) => /* @__PURE__ */ e("span", { className: "nim-caption", children: m }, m)) }) : null
2820
+ ] });
2821
+ }
2822
+ function Mi({ className: n, delta: i, deltaDirection: a = "up", label: t, unit: s, value: l, ...o }) {
2823
+ return /* @__PURE__ */ d("div", { className: b("nim-stat", n), ...o, children: [
2824
+ /* @__PURE__ */ d("p", { className: "nim-stat__value", children: [
2825
+ l,
2826
+ s ? /* @__PURE__ */ e("span", { className: "nim-stat__unit", children: s }) : null
2827
+ ] }),
2828
+ /* @__PURE__ */ e("p", { className: "nim-label nim-stat__label", children: t }),
2829
+ i ? /* @__PURE__ */ d("p", { className: "nim-stat__delta", "data-direction": a, children: [
2830
+ /* @__PURE__ */ e(C, { name: a === "up" ? "trend-up" : "trend-down", size: "xs" }),
2831
+ i
2832
+ ] }) : null
2833
+ ] });
2834
+ }
2835
+ function Li({
2836
+ className: n,
2837
+ decrementLabel: i = "Decrease",
2838
+ incrementLabel: a = "Increase",
2839
+ label: t,
2840
+ max: s = Number.MAX_SAFE_INTEGER,
2841
+ min: l = 0,
2842
+ onChange: o,
2843
+ step: c = 1,
2844
+ value: r
2845
+ }) {
2846
+ const m = (h) => Math.min(Math.max(h, l), s);
2847
+ return /* @__PURE__ */ d(
2848
+ "div",
2849
+ {
2850
+ "aria-label": t,
2851
+ "aria-valuemax": s,
2852
+ "aria-valuemin": l,
2853
+ "aria-valuenow": r,
2854
+ className: b("nim-stepper", n),
2855
+ role: "spinbutton",
2856
+ tabIndex: 0,
2857
+ onKeyDown: (h) => {
2858
+ h.key === "ArrowUp" && (h.preventDefault(), o(m(r + c))), h.key === "ArrowDown" && (h.preventDefault(), o(m(r - c)));
2859
+ },
2860
+ children: [
2861
+ /* @__PURE__ */ e(
2862
+ "button",
2863
+ {
2864
+ "aria-label": i,
2865
+ className: "nim-stepper__button",
2866
+ disabled: r <= l,
2867
+ onClick: () => o(m(r - c)),
2868
+ tabIndex: -1,
2869
+ type: "button",
2870
+ children: /* @__PURE__ */ e(C, { name: "minus", size: "sm" })
2871
+ }
2872
+ ),
2873
+ /* @__PURE__ */ e("span", { className: "nim-stepper__value", children: r }),
2874
+ /* @__PURE__ */ e(
2875
+ "button",
2876
+ {
2877
+ "aria-label": a,
2878
+ className: "nim-stepper__button",
2879
+ disabled: r >= s,
2880
+ onClick: () => o(m(r + c)),
2881
+ tabIndex: -1,
2882
+ type: "button",
2883
+ children: /* @__PURE__ */ e(C, { name: "plus", size: "sm" })
2884
+ }
2885
+ )
2886
+ ]
2887
+ }
2888
+ );
2889
+ }
2890
+ const $a = {
2891
+ of: (n, i) => `${n} of ${i} steps`,
2892
+ status: {
2893
+ active: "In progress",
2894
+ done: "Done",
2895
+ failed: "Failed",
2896
+ pending: "Waiting",
2897
+ skipped: "Skipped"
2898
+ }
2899
+ }, Ra = {
2900
+ done: "check",
2901
+ failed: "close",
2902
+ pending: "clock",
2903
+ skipped: "minus"
2904
+ };
2905
+ function Ii({
2906
+ action: n,
2907
+ caption: i,
2908
+ className: a,
2909
+ labels: t,
2910
+ steps: s,
2911
+ title: l,
2912
+ value: o
2913
+ }) {
2914
+ const c = { ...$a, ...t }, r = s.filter((u) => u.status === "done" || u.status === "skipped").length, m = o ?? (s.length ? Math.round(r / s.length * 100) : 0), h = s.some((u) => u.status === "failed");
2915
+ return /* @__PURE__ */ d(
2916
+ "section",
2917
+ {
2918
+ "aria-live": "polite",
2919
+ className: b("nim-task", h && "nim-task--failed", a),
2920
+ children: [
2921
+ /* @__PURE__ */ d("header", { className: "nim-task__head", children: [
2922
+ l ? /* @__PURE__ */ e("h2", { className: "nim-task__title", children: l }) : null,
2923
+ i ? /* @__PURE__ */ e("p", { className: "nim-task__caption", children: i }) : null,
2924
+ /* @__PURE__ */ e(jn, { label: c.of(r, s.length), value: m })
2925
+ ] }),
2926
+ /* @__PURE__ */ e("ol", { className: "nim-task__steps", children: s.map((u) => /* @__PURE__ */ d("li", { className: "nim-task__step", "data-status": u.status, children: [
2927
+ /* @__PURE__ */ e("span", { className: "nim-task__marker", children: u.status === "active" ? /* @__PURE__ */ e(Me, { size: "sm" }) : /* @__PURE__ */ e(C, { name: Ra[u.status], size: "xs" }) }),
2928
+ /* @__PURE__ */ d("span", { className: "nim-task__step-text", children: [
2929
+ /* @__PURE__ */ e("span", { className: "nim-task__step-label", children: u.label }),
2930
+ /* @__PURE__ */ e("span", { className: "nim-task__step-detail", children: u.detail ?? c.status[u.status] })
2931
+ ] })
2932
+ ] }, u.id)) }),
2933
+ n ? /* @__PURE__ */ e("div", { className: "nim-task__action", children: n }) : null
2934
+ ]
2935
+ }
2936
+ );
2937
+ }
2938
+ function zi({ caption: n, className: i, columns: a, onSort: t, rowKey: s, rows: l, sort: o }) {
2939
+ return /* @__PURE__ */ e("div", { className: b("nim-table-wrap", i), children: /* @__PURE__ */ d("table", { className: "nim-table", children: [
2940
+ n ? /* @__PURE__ */ e("caption", { className: "nim-caption", children: n }) : null,
2941
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: a.map((c) => {
2942
+ const r = (o == null ? void 0 : o.key) === c.key ? o.direction : void 0;
2943
+ return /* @__PURE__ */ e(
2944
+ "th",
2945
+ {
2946
+ "aria-sort": r,
2947
+ className: b(c.numeric && "nim-table__cell--numeric"),
2948
+ scope: "col",
2949
+ style: c.width ? { inlineSize: c.width } : void 0,
2950
+ children: c.sortable && t ? /* @__PURE__ */ d("button", { className: "nim-table__sort", onClick: () => t(c.key), type: "button", children: [
2951
+ c.header,
2952
+ r ? /* @__PURE__ */ e(C, { name: r === "ascending" ? "chevron-up" : "chevron-down", size: "xs" }) : null
2953
+ ] }) : c.header
2954
+ },
2955
+ c.key
2956
+ );
2957
+ }) }) }),
2958
+ /* @__PURE__ */ e("tbody", { children: l.map((c) => /* @__PURE__ */ e("tr", { children: a.map((r) => /* @__PURE__ */ e("td", { className: b(r.numeric && "nim-table__cell--numeric"), children: r.render(c) }, r.key)) }, s(c))) })
2959
+ ] }) });
2960
+ }
2961
+ function Pi({ className: n, label: i, onChange: a, options: t, value: s, ...l }) {
2962
+ const o = L(null), c = (r) => {
2963
+ var _, f;
2964
+ const m = r.key === "ArrowRight" ? 1 : r.key === "ArrowLeft" ? -1 : 0;
2965
+ if (m === 0) return;
2966
+ r.preventDefault();
2967
+ const h = t.filter((w) => !w.disabled), u = h.findIndex((w) => w.value === s), p = h[(u + m + h.length) % h.length];
2968
+ p && (a(p.value), (f = (_ = o.current) == null ? void 0 : _.querySelector(`[data-value="${p.value}"]`)) == null || f.focus());
2969
+ };
2970
+ return /* @__PURE__ */ e(
2971
+ "div",
2972
+ {
2973
+ "aria-label": i,
2974
+ className: b("nim-tabs", n),
2975
+ onKeyDown: c,
2976
+ ref: o,
2977
+ role: "tablist",
2978
+ ...l,
2979
+ children: t.map((r) => /* @__PURE__ */ d(
2980
+ "button",
2981
+ {
2982
+ "aria-selected": r.value === s,
2983
+ className: "nim-tab",
2984
+ "data-value": r.value,
2985
+ disabled: r.disabled,
2986
+ onClick: () => a(r.value),
2987
+ role: "tab",
2988
+ tabIndex: r.value === s ? 0 : -1,
2989
+ type: "button",
2990
+ children: [
2991
+ r.label,
2992
+ r.count === void 0 ? null : /* @__PURE__ */ e("span", { className: "nim-tab__count", children: r.count })
2993
+ ]
2994
+ },
2995
+ r.value
2996
+ ))
2997
+ }
2998
+ );
2999
+ }
3000
+ const Fe = Ee(null), Fa = {
3001
+ accent: "sparkle",
3002
+ danger: "danger",
3003
+ neutral: "info",
3004
+ success: "check-circle"
3005
+ };
3006
+ function Bi({ children: n }) {
3007
+ const [i, a] = A([]), t = L(0), s = O((c) => {
3008
+ a((r) => r.filter((m) => m.id !== c));
3009
+ }, []), l = O(
3010
+ (c) => {
3011
+ const r = t.current++;
3012
+ a((h) => [...h, { ...c, id: r }]);
3013
+ const m = c.duration ?? 4e3;
3014
+ m > 0 && window.setTimeout(() => s(r), m);
3015
+ },
3016
+ [s]
3017
+ ), o = H(() => l, [l]);
3018
+ return /* @__PURE__ */ d(Fe.Provider, { value: o, children: [
3019
+ n,
3020
+ typeof document < "u" ? se(
3021
+ /* @__PURE__ */ e("div", { "aria-live": "polite", className: "nim-toast-stack", children: i.map((c) => /* @__PURE__ */ d("div", { className: b("nim-toast", `nim-toast--${c.tone ?? "neutral"}`), children: [
3022
+ /* @__PURE__ */ e(C, { className: "nim-toast__icon", name: Fa[c.tone ?? "neutral"], size: "sm" }),
3023
+ /* @__PURE__ */ e("span", { className: "nim-toast__message", children: c.message }),
3024
+ c.action ? /* @__PURE__ */ e(
3025
+ "button",
3026
+ {
3027
+ className: "nim-toast__action",
3028
+ onClick: () => {
3029
+ var r;
3030
+ (r = c.action) == null || r.onPress(), s(c.id);
3031
+ },
3032
+ type: "button",
3033
+ children: c.action.label
3034
+ }
3035
+ ) : null
3036
+ ] }, c.id)) }),
3037
+ document.body
3038
+ ) : null
3039
+ ] });
3040
+ }
3041
+ function $i() {
3042
+ const n = xe(Fe);
3043
+ if (!n) throw new Error("useToast must be used inside <ToastProvider>");
3044
+ return n;
3045
+ }
3046
+ function Ri({ children: n, className: i, label: a }) {
3047
+ return /* @__PURE__ */ d("span", { className: b("nim-tooltip", i), children: [
3048
+ n,
3049
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nim-tooltip__bubble", role: "tooltip", children: a })
3050
+ ] });
3051
+ }
3052
+ const Oa = {
3053
+ back: "Back",
3054
+ close: "Close",
3055
+ step: (n, i) => `Step ${n + 1} of ${i}`
3056
+ };
3057
+ function Fi({
3058
+ className: n,
3059
+ continueLabel: i,
3060
+ finishLabel: a,
3061
+ labels: t,
3062
+ onClose: s,
3063
+ onDone: l,
3064
+ onStep: o,
3065
+ steps: c
3066
+ }) {
3067
+ const r = { ...Oa, ...t }, [m, h] = A(0), u = c[Math.min(m, c.length - 1)], p = m === c.length - 1, _ = O(
3068
+ (f) => {
3069
+ h(f), o == null || o(f);
3070
+ },
3071
+ [o]
3072
+ );
3073
+ return /* @__PURE__ */ d("section", { className: b("nim-wizard", n), children: [
3074
+ /* @__PURE__ */ d("header", { className: "nim-wizard__bar", children: [
3075
+ /* @__PURE__ */ e("span", { className: "nim-wizard__slot", children: m > 0 ? /* @__PURE__ */ e(R, { label: r.back, name: "chevron-back", onClick: () => _(m - 1), size: "sm" }) : null }),
3076
+ /* @__PURE__ */ e("ol", { "aria-label": r.step(m, c.length), className: "nim-wizard__dots", children: c.map((f, w) => /* @__PURE__ */ e(
3077
+ "li",
3078
+ {
3079
+ className: "nim-wizard__dot",
3080
+ "data-done": w < m ? "true" : void 0,
3081
+ "data-on": w === m ? "true" : void 0
3082
+ },
3083
+ f.id
3084
+ )) }),
3085
+ /* @__PURE__ */ e("span", { className: "nim-wizard__slot", children: s ? /* @__PURE__ */ e(R, { label: r.close, name: "close", onClick: s, size: "sm" }) : null })
3086
+ ] }),
3087
+ u.question ? /* @__PURE__ */ d("div", { className: "nim-wizard__ask", children: [
3088
+ /* @__PURE__ */ e("h1", { className: "nim-wizard__question", children: u.question }),
3089
+ u.subtitle ? /* @__PURE__ */ e("p", { className: "nim-wizard__subtitle", children: u.subtitle }) : null
3090
+ ] }) : null,
3091
+ /* @__PURE__ */ e("div", { className: "nim-wizard__content", children: u.content }),
3092
+ /* @__PURE__ */ e("footer", { className: "nim-wizard__foot", children: /* @__PURE__ */ e(
3093
+ J,
3094
+ {
3095
+ disabled: u.canContinue === !1,
3096
+ fullWidth: !0,
3097
+ onClick: () => p ? l() : _(m + 1),
3098
+ size: "lg",
3099
+ variant: "accent",
3100
+ children: u.continueLabel ?? (p ? a : i)
3101
+ }
3102
+ ) })
3103
+ ] });
3104
+ }
3105
+ function Oi({
3106
+ className: n,
3107
+ max: i,
3108
+ multiple: a = !1,
3109
+ onChange: t,
3110
+ options: s,
3111
+ selected: l
3112
+ }) {
3113
+ const o = a && i !== void 0 && l.length >= i, c = (r) => {
3114
+ if (!a) {
3115
+ t([r]);
3116
+ return;
3117
+ }
3118
+ t(l.includes(r) ? l.filter((m) => m !== r) : [...l, r]);
3119
+ };
3120
+ return /* @__PURE__ */ e("div", { className: b("nim-choice-grid", n), role: a ? "group" : "radiogroup", children: s.map((r) => {
3121
+ const m = l.includes(r.id);
3122
+ return /* @__PURE__ */ d(
3123
+ "button",
3124
+ {
3125
+ "aria-checked": m,
3126
+ className: "nim-choice-grid__tile",
3127
+ "data-on": m ? "true" : void 0,
3128
+ disabled: r.disabled || o && !m,
3129
+ onClick: () => c(r.id),
3130
+ role: a ? "checkbox" : "radio",
3131
+ type: "button",
3132
+ children: [
3133
+ r.icon ? /* @__PURE__ */ e("span", { className: "nim-choice-grid__icon", children: r.icon }) : null,
3134
+ /* @__PURE__ */ e("span", { className: "nim-choice-grid__label", children: r.label })
3135
+ ]
3136
+ },
3137
+ r.id
3138
+ );
3139
+ }) });
3140
+ }
3141
+ function Ui({ as: n = "h1", children: i, className: a, ...t }) {
3142
+ return /* @__PURE__ */ e(n, { className: b("nim-display", a), ...t, children: i });
3143
+ }
3144
+ function Gi({
3145
+ as: n = "h2",
3146
+ children: i,
3147
+ className: a,
3148
+ size: t = "lg",
3149
+ ...s
3150
+ }) {
3151
+ return /* @__PURE__ */ e(n, { className: b("nim-title", t === "md" && "nim-title--md", a), ...s, children: i });
3152
+ }
3153
+ function Ki({
3154
+ as: n = "p",
3155
+ children: i,
3156
+ className: a,
3157
+ size: t = "md",
3158
+ ...s
3159
+ }) {
3160
+ return /* @__PURE__ */ e(n, { className: b("nim-body", t === "sm" && "nim-body--sm", a), ...s, children: i });
3161
+ }
3162
+ function Wi({ as: n = "span", children: i, className: a, ...t }) {
3163
+ return /* @__PURE__ */ e(n, { className: b("nim-label", a), ...t, children: i });
3164
+ }
3165
+ function Hi({ as: n = "p", children: i, className: a, ...t }) {
3166
+ return /* @__PURE__ */ e(n, { className: b("nim-caption", a), ...t, children: i });
3167
+ }
3168
+ function Yi({ className: n, ...i }) {
3169
+ return /* @__PURE__ */ e("hr", { className: b("nim-rule", n), ...i });
3170
+ }
3171
+ export {
3172
+ ii as ActionBar,
3173
+ ja as ActivityFeed,
3174
+ Ya as AdminShell,
3175
+ vi as AppFrame,
3176
+ Ja as AppShell,
3177
+ de as AuthScreen,
3178
+ Hn as Avatar,
3179
+ Qa as AvatarRing,
3180
+ Xa as Badge,
3181
+ Vn as Banner,
3182
+ Ki as Body,
3183
+ qa as Breadcrumb,
3184
+ J as Button,
3185
+ le as COUNTRIES,
3186
+ Be as Calendar,
3187
+ Hi as Caption,
3188
+ ei as Card,
3189
+ li as Chat,
3190
+ si as ChatComposer,
3191
+ ri as Checkbox,
3192
+ Oi as ChoiceGrid,
3193
+ di as Combobox,
3194
+ pi as DateField,
3195
+ _i as DatePicker,
3196
+ Za as DetailHeader,
3197
+ fi as Dialog,
3198
+ Ui as Display,
3199
+ Ni as EmptyState,
3200
+ Va as FilterChips,
3201
+ C as Icon,
3202
+ R as IconButton,
3203
+ yi as Inline,
3204
+ ta as Input,
3205
+ Wi as Label,
3206
+ Na as List,
3207
+ ba as ListRow,
3208
+ mi as Menu,
3209
+ ui as NimProvider,
3210
+ wi as Onboarding,
3211
+ ni as OptionCard,
3212
+ ai as OrderSummary,
3213
+ Ca as OtpInput,
3214
+ Ci as Pagination,
3215
+ Aa as PasswordField,
3216
+ xa as PhoneField,
3217
+ La as PlanCard,
3218
+ Ti as PlanPicker,
3219
+ sa as Popover,
3220
+ Yn as ProfileHeader,
3221
+ Ai as ProfileScreen,
3222
+ jn as Progress,
3223
+ bi as ResourceMeter,
3224
+ Yi as Rule,
3225
+ Pa as SectionHeader,
3226
+ Ia as Segmented,
3227
+ oi as Select,
3228
+ xi as Sheet,
3229
+ Ei as SignInFlow,
3230
+ ti as Skeleton,
3231
+ Di as Slider,
3232
+ Me as Spinner,
3233
+ gi as Stack,
3234
+ Mi as Stat,
3235
+ Li as Stepper,
3236
+ ia as Switch,
3237
+ Kn as TabBar,
3238
+ zi as Table,
3239
+ Pi as Tabs,
3240
+ Ii as TaskProgress,
3241
+ ci as Textarea,
3242
+ Gi as Title,
3243
+ Bi as ToastProvider,
3244
+ Ri as Tooltip,
3245
+ Fi as Wizard,
3246
+ me as addDays,
3247
+ we as addMonths,
3248
+ b as cn,
3249
+ ki as countryByDial,
3250
+ Re as countryByIso2,
3251
+ ka as countryNamer,
3252
+ he as formatNumeric,
3253
+ ae as fromParts,
3254
+ Ha as iconNames,
3255
+ Pe as monthLength,
3256
+ _a as parseNumeric,
3257
+ Q as partsOf,
3258
+ Si as scorePassword,
3259
+ da as startOfMonth,
3260
+ ie as toAsciiDigits,
3261
+ Da as toE164,
3262
+ ce as todayIso,
3263
+ re as useNim,
3264
+ hi as useSchemeToggle,
3265
+ $i as useToast
3266
+ };