@webority/ui-react 0.0.9

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 (3) hide show
  1. package/LICENSE +5 -0
  2. package/dist/ui-react.js +3005 -0
  3. package/package.json +55 -0
@@ -0,0 +1,3005 @@
1
+ import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import r from "react-bootstrap/Alert";
3
+ import { forwardRef as i, useCallback as a, useEffect as o, useId as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
4
+ import d from "react-bootstrap/Badge";
5
+ import f from "react-bootstrap/Button";
6
+ import p from "react-bootstrap/Card";
7
+ import m from "react-bootstrap/Form";
8
+ import { createPortal as h } from "react-dom";
9
+ import g from "react-bootstrap/Modal";
10
+ import _ from "react-bootstrap/Dropdown";
11
+ import { Add as v, ArrowDown2 as y, Category as b, CloseCircle as x, DocumentDownload as S, DocumentText as C, Flash as w, ShieldTick as T, Verify as E } from "iconsax-react";
12
+ import { toast as D } from "react-toastify";
13
+ import O from "react-bootstrap/Offcanvas";
14
+ import k from "react-bootstrap/Nav";
15
+ //#region src/components/Icon.jsx
16
+ var ee = {
17
+ activity: "activity",
18
+ "alert-circle": "exclamation-circle",
19
+ "alert-triangle": "exclamation-triangle",
20
+ "arrow-left": "arrow-left",
21
+ "arrow-right": "arrow-right",
22
+ "rotate-ccw": "arrow-counterclockwise",
23
+ "arrow-up-right": "arrow-up-right",
24
+ "badge-check": "patch-check",
25
+ bell: "bell",
26
+ briefcase: "briefcase",
27
+ building: "building",
28
+ "building-2": "buildings",
29
+ calculator: "calculator",
30
+ calendar: "calendar",
31
+ "calendar-check": "calendar-check",
32
+ "calendar-dots": "calendar3",
33
+ "chart-column": "bar-chart",
34
+ check: "check-lg",
35
+ "check-check": "check-all",
36
+ "check-circle": "check-circle",
37
+ "chevron-down": "chevron-down",
38
+ "chevron-up": "chevron-up",
39
+ "chevrons-up-down": "chevron-expand",
40
+ circle: "circle-fill",
41
+ "circle-help": "question-circle",
42
+ "clipboard-check": "clipboard-check",
43
+ coins: "coin",
44
+ contact: "person-vcard",
45
+ copy: "copy",
46
+ "credit-card": "credit-card",
47
+ download: "download",
48
+ edit: "pencil-square",
49
+ "external-link": "box-arrow-up-right",
50
+ eye: "eye",
51
+ "eye-off": "eye-slash",
52
+ factory: "buildings",
53
+ "file-plus-2": "file-earmark-plus",
54
+ "file-text": "file-earmark-text",
55
+ "folder-kanban": "kanban",
56
+ "folder-open": "folder2-open",
57
+ "folder-plus": "folder-plus",
58
+ gauge: "speedometer2",
59
+ gift: "gift",
60
+ globe: "globe2",
61
+ history: "clock-history",
62
+ house: "house",
63
+ image: "image",
64
+ info: "info-circle",
65
+ "layout-dashboard": "grid-1x2",
66
+ "layout-grid": "grid-3x3-gap",
67
+ lightbulb: "lightbulb",
68
+ list: "list",
69
+ lock: "lock",
70
+ "log-out": "box-arrow-right",
71
+ "map-pin": "geo-alt",
72
+ mail: "envelope",
73
+ menu: "list",
74
+ "message-square": "chat-square-text",
75
+ moon: "moon",
76
+ "more-horizontal": "three-dots",
77
+ palette: "palette",
78
+ "panel-left-close": "layout-sidebar-inset",
79
+ "panel-left-open": "layout-sidebar",
80
+ pencil: "pencil",
81
+ "pen-tool": "pen",
82
+ phone: "telephone",
83
+ plug: "plug",
84
+ plus: "plus-lg",
85
+ "plus-circle": "plus-circle",
86
+ "refresh-cw": "arrow-clockwise",
87
+ repeat: "arrow-repeat",
88
+ search: "search",
89
+ send: "send",
90
+ server: "hdd-stack",
91
+ settings: "gear",
92
+ "share-2": "share",
93
+ shield: "shield",
94
+ "shield-check": "shield-check",
95
+ "shield-plus": "shield-plus",
96
+ sparkles: "stars",
97
+ sun: "sun",
98
+ "trash-2": "trash",
99
+ "trending-up": "graph-up-arrow",
100
+ triangle: "triangle",
101
+ upload: "upload",
102
+ user: "person",
103
+ "user-check": "person-check",
104
+ "user-minus": "person-dash",
105
+ "user-plus": "person-plus",
106
+ users: "people",
107
+ "wand-sparkles": "magic",
108
+ x: "x-lg",
109
+ zap: "lightning-charge"
110
+ };
111
+ function A({ name: e, size: r = 16, className: i, color: a, style: o }) {
112
+ if (e === "hard-hat") return /* @__PURE__ */ t("svg", {
113
+ width: r,
114
+ height: r,
115
+ viewBox: "0 0 24 24",
116
+ fill: "none",
117
+ className: i ? `bi ${i}` : "bi",
118
+ "data-icon": e,
119
+ "aria-hidden": "true",
120
+ style: {
121
+ verticalAlign: "-.125em",
122
+ color: a,
123
+ ...o
124
+ },
125
+ children: /* @__PURE__ */ n("g", {
126
+ fill: "currentColor",
127
+ children: [/* @__PURE__ */ t("circle", {
128
+ cx: "12",
129
+ cy: "7.5",
130
+ r: "4.2"
131
+ }), /* @__PURE__ */ t("path", { d: "M3.2 22.5C3.2 17.4 7.5 14.9 11 14.7L12 17.4l1-2.7C16.5 14.9 20.8 17.4 20.8 22.5z" })]
132
+ })
133
+ });
134
+ let s = ee[e];
135
+ return s ? /* @__PURE__ */ t("i", {
136
+ className: `bi bi-${s}${i ? ` ${i}` : ""}`,
137
+ "data-icon": e,
138
+ "aria-hidden": "true",
139
+ style: {
140
+ fontSize: r,
141
+ lineHeight: 1,
142
+ color: a,
143
+ ...o
144
+ }
145
+ }) : null;
146
+ }
147
+ //#endregion
148
+ //#region src/components/ActionIcon.jsx
149
+ function te({ name: e, size: n = 20 }) {
150
+ return /* @__PURE__ */ t(A, {
151
+ name: e,
152
+ size: n,
153
+ variant: "Bold"
154
+ });
155
+ }
156
+ //#endregion
157
+ //#region src/components/AppAlert.jsx
158
+ function ne({ variant: e = "danger", children: n, className: i = "", onClose: a, role: o = "alert", ...s }) {
159
+ return /* @__PURE__ */ t(r, {
160
+ variant: e,
161
+ className: i || void 0,
162
+ onClose: a,
163
+ dismissible: typeof a == "function",
164
+ transition: !1,
165
+ role: o,
166
+ ...s,
167
+ children: n
168
+ });
169
+ }
170
+ //#endregion
171
+ //#region ../elements/dist/ui-elements.js
172
+ var re = class extends HTMLElement {
173
+ static formAssociated = !0;
174
+ static get observedAttributes() {
175
+ return [
176
+ "value",
177
+ "placeholder",
178
+ "disabled",
179
+ "min-chars",
180
+ "debounce",
181
+ "remote"
182
+ ];
183
+ }
184
+ constructor() {
185
+ super(), this._internals = this.attachInternals ? this.attachInternals() : null, this._value = "", this._label = "", this._optionsProp = null, this._loading = !1, this._active = -1, this._timer = null;
186
+ }
187
+ connectedCallback() {
188
+ this._rendered || this.render();
189
+ }
190
+ attributeChangedCallback(e, t, n) {
191
+ this._rendered && (e === "value" ? this.value = n : this.render());
192
+ }
193
+ get value() {
194
+ return this._value;
195
+ }
196
+ set value(e) {
197
+ this._value = e == null ? "" : String(e), this._internals?.setFormValue(this._value);
198
+ let t = this._readOptions().find((e) => String(e.value) === this._value);
199
+ t && (this._label = M(t.label)), this._syncInput();
200
+ }
201
+ set options(e) {
202
+ this._optionsProp = Array.isArray(e) ? e : [], this._renderOptions();
203
+ }
204
+ get options() {
205
+ return this._readOptions();
206
+ }
207
+ set loading(e) {
208
+ this._loading = !!e, this._renderLoading();
209
+ }
210
+ get loading() {
211
+ return this._loading;
212
+ }
213
+ get _remote() {
214
+ return this.hasAttribute("remote");
215
+ }
216
+ get _minChars() {
217
+ return Math.max(0, Number(this.getAttribute("min-chars")) || +!!this._remote);
218
+ }
219
+ get _debounceMs() {
220
+ let e = Number(this.getAttribute("debounce"));
221
+ return Number.isFinite(e) && e >= 0 ? e : 250;
222
+ }
223
+ _readOptions() {
224
+ return this._optionsProp ? this._optionsProp : [...this.querySelectorAll(":scope > wui-option")].map((e) => ({
225
+ value: e.getAttribute("value") ?? e.textContent.trim(),
226
+ label: e.innerHTML
227
+ }));
228
+ }
229
+ render() {
230
+ let e = this.getAttribute("placeholder") || "Search…";
231
+ this.innerHTML = `
232
+ <div class="search-select">
233
+ <div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false">
234
+ <input class="search-select-input search-select-ac-input" placeholder="${j(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
235
+ <span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
236
+ <button type="button" class="search-select-clear" aria-label="Clear" hidden><i class="bi bi-x" aria-hidden="true"></i></button>
237
+ </div>
238
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
239
+ <div class="search-select-options"></div>
240
+ <div class="search-select-empty" hidden>No matches</div>
241
+ <div class="search-select-hint" hidden>Type to search…</div>
242
+ </div>
243
+ </div>`, this._rendered = !0, this._wire(), this._syncInput(), this._renderOptions();
244
+ }
245
+ _refs() {
246
+ return {
247
+ control: this.querySelector(".search-select-control"),
248
+ input: this.querySelector(".search-select-ac-input"),
249
+ menu: this.querySelector(".search-select-menu"),
250
+ spinner: this.querySelector(".search-select-spinner"),
251
+ clear: this.querySelector(".search-select-clear"),
252
+ optionsWrap: this.querySelector(".search-select-options"),
253
+ empty: this.querySelector(".search-select-empty"),
254
+ hint: this.querySelector(".search-select-hint")
255
+ };
256
+ }
257
+ _optionEls() {
258
+ return [...this.querySelectorAll(".search-select-option")];
259
+ }
260
+ _syncInput() {
261
+ let { input: e, clear: t } = this._refs();
262
+ e && document.activeElement !== e && (e.value = this._label), t && (t.hidden = !this._value && !(e && e.value));
263
+ }
264
+ _renderLoading() {
265
+ let { spinner: e } = this._refs();
266
+ e && (e.hidden = !this._loading);
267
+ }
268
+ _renderOptions(e) {
269
+ let t = this._refs();
270
+ if (!t.optionsWrap) return;
271
+ let n = (e ?? (t.input ? t.input.value : "")).trim().toLowerCase(), r = this._readOptions();
272
+ !this._remote && n && (r = r.filter((e) => M(e.label).toLowerCase().includes(n))), t.optionsWrap.innerHTML = r.map((e) => {
273
+ let t = String(e.value) === String(this._value);
274
+ return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${j(e.value)}" aria-selected="${t}">${e.label}</button>`;
275
+ }).join(""), this._active = -1;
276
+ let i = n.length < this._minChars;
277
+ t.hint && (t.hint.hidden = !(this._remote && i && !r.length)), t.empty && (t.empty.hidden = this._loading || r.length > 0 || this._remote && i);
278
+ }
279
+ _wire() {
280
+ let e = this._refs();
281
+ if (!e.control || !e.input) return;
282
+ let t = () => {
283
+ let t = e.control.getBoundingClientRect();
284
+ e.menu.style.position = "fixed", e.menu.style.top = `${t.bottom + 4}px`, e.menu.style.left = `${t.left}px`, e.menu.style.width = `${t.width}px`;
285
+ }, n = () => this._optionEls().filter((e) => !e.hidden), r = (e) => {
286
+ let t = n();
287
+ this._active = e;
288
+ for (let e of this._optionEls()) e.classList.remove("is-active");
289
+ e >= 0 && t[e] && (t[e].classList.add("is-active"), t[e].scrollIntoView({ block: "nearest" }));
290
+ }, i = () => !e.menu.hidden, a = () => {
291
+ e.menu.hidden = !1, e.control.setAttribute("aria-expanded", "true"), e.control.classList.add("open"), t(), this._renderOptions();
292
+ }, o = () => {
293
+ e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), this._syncInput();
294
+ }, s = (t) => {
295
+ this._value = t.dataset.value, this._label = M(t.innerHTML), this._internals?.setFormValue(this._value), e.input.value = this._label, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.input.focus();
296
+ };
297
+ e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", () => {
298
+ let t = e.input.value;
299
+ if (e.clear && (e.clear.hidden = !t), i() || a(), this._remote) {
300
+ if (this._renderOptions(t), t.trim().length < this._minChars) return;
301
+ clearTimeout(this._timer), this._timer = setTimeout(() => {
302
+ this.dispatchEvent(new CustomEvent("search", {
303
+ bubbles: !0,
304
+ detail: { query: t }
305
+ }));
306
+ }, this._debounceMs);
307
+ } else this._renderOptions(t);
308
+ }), e.input.addEventListener("keydown", (e) => {
309
+ let t = n();
310
+ e.key === "ArrowDown" ? (e.preventDefault(), i() || a(), r(Math.min(this._active + 1, t.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), r(Math.max(this._active - 1, 0))) : e.key === "Enter" ? t[this._active] && (e.preventDefault(), s(t[this._active])) : e.key === "Escape" && o();
311
+ }), e.optionsWrap.addEventListener("click", (e) => {
312
+ let t = e.target.closest(".search-select-option");
313
+ t && s(t);
314
+ }), e.optionsWrap.addEventListener("mousemove", (e) => {
315
+ let t = e.target.closest(".search-select-option");
316
+ t && r(this._optionEls().indexOf(t));
317
+ }), e.clear?.addEventListener("click", () => {
318
+ this._value = "", this._label = "", this._internals?.setFormValue(""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
319
+ }), this._onDocClick = (e) => {
320
+ i() && !this.contains(e.target) && o();
321
+ }, document.addEventListener("click", this._onDocClick), window.addEventListener("resize", () => {
322
+ i() && t();
323
+ });
324
+ }
325
+ disconnectedCallback() {
326
+ this._onDocClick && document.removeEventListener("click", this._onDocClick), clearTimeout(this._timer);
327
+ }
328
+ }, j = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), M = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ie = [
329
+ "January",
330
+ "February",
331
+ "March",
332
+ "April",
333
+ "May",
334
+ "June",
335
+ "July",
336
+ "August",
337
+ "September",
338
+ "October",
339
+ "November",
340
+ "December"
341
+ ], ae = [
342
+ "Su",
343
+ "Mo",
344
+ "Tu",
345
+ "We",
346
+ "Th",
347
+ "Fr",
348
+ "Sa"
349
+ ], N = (e) => String(e).padStart(2, "0"), oe = (e, t, n) => `${e}-${N(t + 1)}-${N(n)}`, P = (e) => {
350
+ let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
351
+ return t ? {
352
+ y: +t[1],
353
+ m: t[2] - 1,
354
+ d: +t[3]
355
+ } : null;
356
+ }, F = (e) => {
357
+ let t = P(e);
358
+ return t ? `${N(t.d)} ${ie[t.m].slice(0, 3)} ${t.y}` : "";
359
+ }, se = class extends HTMLElement {
360
+ static formAssociated = !0;
361
+ static get observedAttributes() {
362
+ return [
363
+ "value",
364
+ "min",
365
+ "max",
366
+ "placeholder",
367
+ "disabled"
368
+ ];
369
+ }
370
+ constructor() {
371
+ super(), this._internals = this.attachInternals ? this.attachInternals() : null, this._value = "";
372
+ let e = new Date(2e3, 0, 1);
373
+ this._viewY = e.getFullYear(), this._viewM = e.getMonth();
374
+ }
375
+ connectedCallback() {
376
+ this._rendered || this.render();
377
+ }
378
+ attributeChangedCallback(e, t, n) {
379
+ this._rendered && (e === "value" ? (this._value = n || "", this._syncTrigger()) : this.render());
380
+ }
381
+ get value() {
382
+ return this._value;
383
+ }
384
+ set value(e) {
385
+ this._value = e || "", this._internals?.setFormValue(this._value), this._syncTrigger(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
386
+ }
387
+ render() {
388
+ this._value = this.getAttribute("value") || this._value;
389
+ let e = this.getAttribute("placeholder") || "Enter Date", t = P(this._value);
390
+ t && (this._viewY = t.y, this._viewM = t.m), this.innerHTML = `
391
+ <div class="datepicker">
392
+ <button type="button" class="input datepicker-trigger" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
393
+ <span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? F(this._value) : e}</span>
394
+ <i class="bi bi-calendar3" aria-hidden="true"></i>
395
+ </button>
396
+ <div class="datepicker-pop" role="dialog" hidden></div>
397
+ </div>`, this._rendered = !0, this._wire();
398
+ }
399
+ _internalsSet() {
400
+ this._internals?.setFormValue(this._value);
401
+ }
402
+ _syncTrigger() {
403
+ let e = this.querySelector("[data-trigger-label]");
404
+ if (!e) return;
405
+ let t = P(this._value);
406
+ e.textContent = t ? F(this._value) : this.getAttribute("placeholder") || "Enter Date", e.classList.toggle("search-select-placeholder", !t);
407
+ }
408
+ _renderMonth() {
409
+ let e = this.querySelector(".datepicker-pop"), t = new Date(this._viewY, this._viewM, 1).getDay(), n = new Date(this._viewY, this._viewM + 1, 0).getDate(), r = P(this._value), i = P(this.getAttribute("min")), a = P(this.getAttribute("max")), o = (e, t, n) => {
410
+ let r = new Date(e, t, n).getTime();
411
+ return !!(i && r < new Date(i.y, i.m, i.d).getTime() || a && r > new Date(a.y, a.m, a.d).getTime());
412
+ }, s = "";
413
+ for (let e = 0; e < t; e++) s += "<span class=\"datepicker-day is-outside\"></span>";
414
+ for (let e = 1; e <= n; e++) {
415
+ let t = oe(this._viewY, this._viewM, e), n = r && r.y === this._viewY && r.m === this._viewM && r.d === e, i = o(this._viewY, this._viewM, e);
416
+ s += `<button type="button" class="datepicker-day${n ? " selected" : ""}" data-iso="${t}"${i ? " disabled" : ""}>${e}</button>`;
417
+ }
418
+ e.innerHTML = `
419
+ <div class="datepicker-head">
420
+ <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
421
+ <span class="datepicker-month">${ie[this._viewM]} ${this._viewY}</span>
422
+ <button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
423
+ </div>
424
+ <div class="datepicker-weekdays">${ae.map((e) => `<span>${e}</span>`).join("")}</div>
425
+ <div class="datepicker-grid">${s}</div>
426
+ <div class="datepicker-foot"><button type="button" class="datepicker-link" data-clear>Clear</button></div>`;
427
+ }
428
+ _wire() {
429
+ let e = this.querySelector(".datepicker-trigger"), t = this.querySelector(".datepicker-pop");
430
+ if (!e || !t) return;
431
+ let n = () => !t.hidden, r = () => {
432
+ this._renderMonth(), t.hidden = !1, e.setAttribute("aria-expanded", "true");
433
+ }, i = () => {
434
+ t.hidden = !0, e.setAttribute("aria-expanded", "false");
435
+ };
436
+ e.addEventListener("click", () => n() ? i() : r()), t.addEventListener("click", (e) => {
437
+ let t = e.target.closest("[data-nav]");
438
+ if (t) {
439
+ this._viewM += Number(t.dataset.nav), this._viewM < 0 ? (this._viewM = 11, --this._viewY) : this._viewM > 11 && (this._viewM = 0, this._viewY += 1), this._renderMonth();
440
+ return;
441
+ }
442
+ if (e.target.closest("[data-clear]")) {
443
+ this.value = "", i();
444
+ return;
445
+ }
446
+ let n = e.target.closest(".datepicker-day[data-iso]");
447
+ n && !n.disabled && (this.value = n.dataset.iso, i());
448
+ }), this._onDocClick = (e) => {
449
+ n() && !this.contains(e.target) && i();
450
+ }, document.addEventListener("click", this._onDocClick), document.addEventListener("keydown", (e) => {
451
+ n() && e.key === "Escape" && i();
452
+ }), this._internalsSet();
453
+ }
454
+ disconnectedCallback() {
455
+ this._onDocClick && document.removeEventListener("click", this._onDocClick);
456
+ }
457
+ }, ce = class extends HTMLElement {
458
+ static formAssociated = !0;
459
+ static get observedAttributes() {
460
+ return [
461
+ "placeholder",
462
+ "search-placeholder",
463
+ "searchable",
464
+ "disabled"
465
+ ];
466
+ }
467
+ constructor() {
468
+ super(), this._internals = this.attachInternals ? this.attachInternals() : null, this._values = [], this._optionsProp = null, this._active = -1;
469
+ }
470
+ connectedCallback() {
471
+ if (!this._rendered) {
472
+ if (!this._valuesInit && !this._optionsProp && !this._values.length) {
473
+ let e = [...this.querySelectorAll(":scope > wui-option[selected]")].map((e) => e.getAttribute("value") ?? e.textContent.trim());
474
+ e.length && (this._values = e.map(String));
475
+ }
476
+ this._valuesInit = !0, this.render();
477
+ }
478
+ }
479
+ attributeChangedCallback() {
480
+ this._rendered && this.render();
481
+ }
482
+ get values() {
483
+ return this._values.slice();
484
+ }
485
+ set values(e) {
486
+ this._values = Array.isArray(e) ? e.map(String) : [], this._internals?.setFormValue(this._values.join(",")), this._rendered && this._renderControl();
487
+ }
488
+ set options(e) {
489
+ this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
490
+ }
491
+ get options() {
492
+ return this._readOptions();
493
+ }
494
+ _readOptions() {
495
+ return this._optionsProp ? this._optionsProp : [...this.querySelectorAll(":scope > wui-option")].map((e) => ({
496
+ value: e.getAttribute("value") ?? e.textContent.trim(),
497
+ label: e.innerHTML
498
+ }));
499
+ }
500
+ _labelFor(e) {
501
+ let t = this._readOptions().find((t) => String(t.value) === String(e));
502
+ return t ? t.label : e;
503
+ }
504
+ render() {
505
+ let e = this.hasAttribute("searchable"), t = this.getAttribute("search-placeholder") || "Search…";
506
+ this._internals?.setFormValue(this._values.join(",")), this.innerHTML = `
507
+ <div class="search-select">
508
+ <div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
509
+ <div class="ms-chips" data-chips></div>
510
+ <i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
511
+ </div>
512
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" aria-multiselectable="true" tabindex="-1" hidden>
513
+ ${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${I(t)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
514
+ <div class="search-select-options"></div>
515
+ <div class="search-select-empty" hidden>No matches</div>
516
+ </div>
517
+ </div>`, this._rendered = !0, this._renderControl(), this._renderOptions(), this._wire();
518
+ }
519
+ _renderControl() {
520
+ let e = this.querySelector("[data-chips]");
521
+ if (!e) return;
522
+ let t = this.getAttribute("placeholder") || "Select…";
523
+ if (!this._values.length) {
524
+ e.innerHTML = `<span class="search-select-placeholder">${le(t)}</span>`;
525
+ return;
526
+ }
527
+ e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelFor(e)}</span><button type="button" class="chip-remove" data-remove="${I(e)}" aria-label="Remove"><i class="bi bi-x" aria-hidden="true"></i></button></span>`).join("");
528
+ }
529
+ _renderOptions(e) {
530
+ let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
531
+ if (!t) return;
532
+ let r = (e || "").trim().toLowerCase(), i = this._readOptions();
533
+ r && (i = i.filter((e) => ue(e.label).toLowerCase().includes(r))), t.innerHTML = i.map((e) => {
534
+ let t = this._values.includes(String(e.value));
535
+ return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${I(e.value)}" aria-selected="${t}"><span class="ms-check"><i class="bi bi-check" aria-hidden="true"></i></span><span class="ms-opt-label">${e.label}</span></button>`;
536
+ }).join(""), n && (n.hidden = i.length > 0), this._active = -1;
537
+ }
538
+ _wire() {
539
+ let e = this.querySelector(".search-select-control"), t = this.querySelector(".search-select-menu"), n = this.querySelector(".search-select-input"), r = this.querySelector(".search-select-clear"), i = this.querySelector(".search-select-options");
540
+ if (this.querySelector("[data-chips]"), !e || !t) return;
541
+ let a = () => this.hasAttribute("disabled"), o = () => {
542
+ let n = e.getBoundingClientRect();
543
+ t.style.position = "fixed", t.style.top = `${n.bottom + 4}px`, t.style.left = `${n.left}px`, t.style.width = `${n.width}px`;
544
+ }, s = () => [...this.querySelectorAll(".search-select-option")], c = () => s().filter((e) => !e.hidden), l = (e) => {
545
+ let t = c();
546
+ this._active = e;
547
+ for (let e of s()) e.classList.remove("is-active");
548
+ e >= 0 && t[e] && (t[e].classList.add("is-active"), t[e].scrollIntoView({ block: "nearest" }));
549
+ }, u = () => !t.hidden, d = () => {
550
+ a() || (t.hidden = !1, e.setAttribute("aria-expanded", "true"), e.classList.add("open"), o(), n && (n.value = "", this._renderOptions(""), n.focus()));
551
+ }, f = () => {
552
+ t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open"), l(-1);
553
+ }, p = () => {
554
+ this._internals?.setFormValue(this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
555
+ }, m = (e) => {
556
+ let t = String(e);
557
+ this._values.includes(t) ? this._values = this._values.filter((e) => e !== t) : this._values = [...this._values, t], this._renderControl(), this._renderOptions(n ? n.value : ""), p();
558
+ }, h = (e) => {
559
+ this._values = this._values.filter((t) => t !== String(e)), this._renderControl(), this._renderOptions(n ? n.value : ""), p();
560
+ };
561
+ e.addEventListener("click", (e) => {
562
+ let t = e.target.closest("[data-remove]");
563
+ if (t) {
564
+ e.stopPropagation(), h(t.dataset.remove);
565
+ return;
566
+ }
567
+ u() ? f() : d();
568
+ }), i.addEventListener("click", (e) => {
569
+ let t = e.target.closest(".search-select-option");
570
+ t && (m(t.dataset.value), n?.focus());
571
+ }), i.addEventListener("mousemove", (e) => {
572
+ let t = e.target.closest(".search-select-option");
573
+ t && l(c().indexOf(t));
574
+ }), n?.addEventListener("input", () => {
575
+ this._renderOptions(n.value), r && (r.hidden = !n.value), l(-1);
576
+ }), n?.addEventListener("keydown", (t) => {
577
+ let r = c();
578
+ t.key === "ArrowDown" ? (t.preventDefault(), l(Math.min(this._active + 1, r.length - 1))) : t.key === "ArrowUp" ? (t.preventDefault(), l(Math.max(this._active - 1, 0))) : t.key === "Enter" ? (t.preventDefault(), r[this._active] && m(r[this._active].dataset.value)) : t.key === "Escape" ? (f(), e.focus()) : t.key === "Backspace" && !n.value && this._values.length && h(this._values[this._values.length - 1]);
579
+ }), r?.addEventListener("click", () => {
580
+ n.value = "", this._renderOptions(""), r.hidden = !0, n.focus();
581
+ }), e.addEventListener("keydown", (e) => {
582
+ !u() && (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
583
+ }), this._onDocClick = (e) => {
584
+ u() && !this.contains(e.target) && f();
585
+ }, document.addEventListener("click", this._onDocClick), window.addEventListener("resize", () => {
586
+ u() && o();
587
+ });
588
+ }
589
+ disconnectedCallback() {
590
+ this._onDocClick && document.removeEventListener("click", this._onDocClick);
591
+ }
592
+ }, I = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), le = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;"), ue = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), L = [
593
+ [
594
+ "IN",
595
+ "India",
596
+ "91"
597
+ ],
598
+ [
599
+ "US",
600
+ "United States",
601
+ "1"
602
+ ],
603
+ [
604
+ "GB",
605
+ "United Kingdom",
606
+ "44"
607
+ ],
608
+ [
609
+ "AE",
610
+ "United Arab Emirates",
611
+ "971"
612
+ ],
613
+ [
614
+ "SG",
615
+ "Singapore",
616
+ "65"
617
+ ],
618
+ [
619
+ "AU",
620
+ "Australia",
621
+ "61"
622
+ ],
623
+ [
624
+ "CA",
625
+ "Canada",
626
+ "1"
627
+ ],
628
+ [
629
+ "DE",
630
+ "Germany",
631
+ "49"
632
+ ],
633
+ [
634
+ "FR",
635
+ "France",
636
+ "33"
637
+ ],
638
+ [
639
+ "IT",
640
+ "Italy",
641
+ "39"
642
+ ],
643
+ [
644
+ "ES",
645
+ "Spain",
646
+ "34"
647
+ ],
648
+ [
649
+ "NL",
650
+ "Netherlands",
651
+ "31"
652
+ ],
653
+ [
654
+ "CH",
655
+ "Switzerland",
656
+ "41"
657
+ ],
658
+ [
659
+ "SE",
660
+ "Sweden",
661
+ "46"
662
+ ],
663
+ [
664
+ "NO",
665
+ "Norway",
666
+ "47"
667
+ ],
668
+ [
669
+ "DK",
670
+ "Denmark",
671
+ "45"
672
+ ],
673
+ [
674
+ "IE",
675
+ "Ireland",
676
+ "353"
677
+ ],
678
+ [
679
+ "NZ",
680
+ "New Zealand",
681
+ "64"
682
+ ],
683
+ [
684
+ "JP",
685
+ "Japan",
686
+ "81"
687
+ ],
688
+ [
689
+ "CN",
690
+ "China",
691
+ "86"
692
+ ],
693
+ [
694
+ "HK",
695
+ "Hong Kong",
696
+ "852"
697
+ ],
698
+ [
699
+ "MY",
700
+ "Malaysia",
701
+ "60"
702
+ ],
703
+ [
704
+ "ID",
705
+ "Indonesia",
706
+ "62"
707
+ ],
708
+ [
709
+ "TH",
710
+ "Thailand",
711
+ "66"
712
+ ],
713
+ [
714
+ "PH",
715
+ "Philippines",
716
+ "63"
717
+ ],
718
+ [
719
+ "VN",
720
+ "Vietnam",
721
+ "84"
722
+ ],
723
+ [
724
+ "KR",
725
+ "South Korea",
726
+ "82"
727
+ ],
728
+ [
729
+ "SA",
730
+ "Saudi Arabia",
731
+ "966"
732
+ ],
733
+ [
734
+ "QA",
735
+ "Qatar",
736
+ "974"
737
+ ],
738
+ [
739
+ "KW",
740
+ "Kuwait",
741
+ "965"
742
+ ],
743
+ [
744
+ "BH",
745
+ "Bahrain",
746
+ "973"
747
+ ],
748
+ [
749
+ "OM",
750
+ "Oman",
751
+ "968"
752
+ ],
753
+ [
754
+ "ZA",
755
+ "South Africa",
756
+ "27"
757
+ ],
758
+ [
759
+ "NG",
760
+ "Nigeria",
761
+ "234"
762
+ ],
763
+ [
764
+ "KE",
765
+ "Kenya",
766
+ "254"
767
+ ],
768
+ [
769
+ "EG",
770
+ "Egypt",
771
+ "20"
772
+ ],
773
+ [
774
+ "BR",
775
+ "Brazil",
776
+ "55"
777
+ ],
778
+ [
779
+ "MX",
780
+ "Mexico",
781
+ "52"
782
+ ],
783
+ [
784
+ "AR",
785
+ "Argentina",
786
+ "54"
787
+ ],
788
+ [
789
+ "BD",
790
+ "Bangladesh",
791
+ "880"
792
+ ],
793
+ [
794
+ "PK",
795
+ "Pakistan",
796
+ "92"
797
+ ],
798
+ [
799
+ "LK",
800
+ "Sri Lanka",
801
+ "94"
802
+ ],
803
+ [
804
+ "NP",
805
+ "Nepal",
806
+ "977"
807
+ ]
808
+ ], R = (e) => e.toUpperCase().replace(/./g, (e) => String.fromCodePoint(127397 + e.charCodeAt(0))), z = (e) => (L.find((t) => t[0] === e) || [
809
+ "",
810
+ "",
811
+ ""
812
+ ])[2], de = class extends HTMLElement {
813
+ static formAssociated = !0;
814
+ static get observedAttributes() {
815
+ return [
816
+ "value",
817
+ "country",
818
+ "placeholder",
819
+ "disabled"
820
+ ];
821
+ }
822
+ constructor() {
823
+ super(), this._internals = this.attachInternals ? this.attachInternals() : null, this._country = "IN", this._national = "";
824
+ }
825
+ connectedCallback() {
826
+ this._rendered || this.render();
827
+ }
828
+ attributeChangedCallback(e, t, n) {
829
+ this._rendered && (e === "country" && (this._country = n || "IN"), this.render());
830
+ }
831
+ get value() {
832
+ return `+${z(this._country)}${this._national}`;
833
+ }
834
+ set value(e) {
835
+ this._national = String(e ?? "").replace(/[^0-9]/g, ""), this._commit();
836
+ }
837
+ _commit() {
838
+ this._internals?.setFormValue(this.value), this.dispatchEvent(new Event("change", { bubbles: !0 }));
839
+ }
840
+ render() {
841
+ let e = this.getAttribute("placeholder") || "Enter phone number";
842
+ this._country = this.getAttribute("country") || this._country;
843
+ let t = L.map(([e, t, n]) => `<button type="button" role="option" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}"><span class="phone-flag-lg">${R(e)}</span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join("");
844
+ this.innerHTML = `
845
+ <div class="phone-input-wrap">
846
+ <div class="phone-country-adornment">
847
+ <button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
848
+ <span class="phone-flag" data-flag>${R(this._country)}</span>
849
+ <i class="bi bi-chevron-down phone-chevron" aria-hidden="true"></i>
850
+ <span class="phone-dial" data-dial>+${z(this._country)}</span>
851
+ </button>
852
+ <div class="country-dropdown-menu" role="listbox" hidden>
853
+ <div class="dropdown-search-wrapper"><span class="dropdown-search-icon"><i class="bi bi-search" aria-hidden="true"></i></span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" /></div>
854
+ <div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
855
+ </div>
856
+ </div>
857
+ <input type="tel" class="input" placeholder="${B(e)}" value="${B(this._national)}"${this.hasAttribute("disabled") ? " disabled" : ""} />
858
+ </div>`, this._rendered = !0, this._wire();
859
+ }
860
+ _wire() {
861
+ let e = this.querySelector(".country-toggle"), t = this.querySelector(".country-dropdown-menu"), n = this.querySelector(".dropdown-search-input"), r = this.querySelector(".country-list-scroll"), i = this.querySelector(".country-empty"), a = this.querySelector("input[type=tel]"), o = this.querySelector("[data-flag]"), s = this.querySelector("[data-dial]");
862
+ if (!e || !t) return;
863
+ let c = () => !t.hidden, l = () => {
864
+ t.hidden = !1, e.setAttribute("aria-expanded", "true"), n.value = "", d(""), n.focus();
865
+ }, u = () => {
866
+ t.hidden = !0, e.setAttribute("aria-expanded", "false");
867
+ }, d = (e) => {
868
+ let t = e.trim().toLowerCase(), n = 0;
869
+ for (let e of r.querySelectorAll(".country-dropdown-item")) {
870
+ let r = !t || e.textContent.toLowerCase().includes(t);
871
+ e.hidden = !r, r && (n += 1);
872
+ }
873
+ i && (i.hidden = n > 0);
874
+ }, f = (e) => {
875
+ this._country = e, this.setAttribute("country", e), o && (o.textContent = R(e)), s && (s.textContent = `+${z(e)}`);
876
+ for (let t of r.querySelectorAll(".country-dropdown-item")) t.classList.toggle("selected", t.dataset.iso === e);
877
+ u(), this._commit();
878
+ };
879
+ e.addEventListener("click", () => c() ? u() : l()), n.addEventListener("input", () => d(n.value)), r.addEventListener("click", (e) => {
880
+ let t = e.target.closest(".country-dropdown-item");
881
+ t && f(t.dataset.iso);
882
+ }), a.addEventListener("input", () => {
883
+ this._national = a.value.replace(/[^0-9]/g, ""), this._commit();
884
+ }), this._onDocClick = (e) => {
885
+ c() && !this.contains(e.target) && u();
886
+ }, document.addEventListener("click", this._onDocClick), this._internals?.setFormValue(this.value);
887
+ }
888
+ disconnectedCallback() {
889
+ this._onDocClick && document.removeEventListener("click", this._onDocClick);
890
+ }
891
+ }, B = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), fe = class extends HTMLElement {
892
+ static formAssociated = !0;
893
+ static get observedAttributes() {
894
+ return [
895
+ "value",
896
+ "placeholder",
897
+ "search-placeholder",
898
+ "searchable",
899
+ "disabled",
900
+ "compact"
901
+ ];
902
+ }
903
+ constructor() {
904
+ super(), this._internals = this.attachInternals ? this.attachInternals() : null, this._value = "", this._optionsProp = null, this._active = -1;
905
+ }
906
+ connectedCallback() {
907
+ this._rendered || this.render();
908
+ }
909
+ attributeChangedCallback(e, t, n) {
910
+ this._rendered && (e === "value" ? this.value = n : this.render());
911
+ }
912
+ get value() {
913
+ return this._value;
914
+ }
915
+ set value(e) {
916
+ this._value = e == null ? "" : String(e), this._internals?.setFormValue(this._value), this._syncSelected();
917
+ }
918
+ set options(e) {
919
+ this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
920
+ }
921
+ get options() {
922
+ return this._readOptions();
923
+ }
924
+ _readOptions() {
925
+ return this._optionsProp ? this._optionsProp : [...this.querySelectorAll(":scope > wui-option")].map((e) => ({
926
+ value: e.getAttribute("value") ?? e.textContent.trim(),
927
+ label: e.innerHTML,
928
+ selected: e.hasAttribute("selected")
929
+ }));
930
+ }
931
+ render() {
932
+ let e = this._readOptions(), t = this.hasAttribute("searchable"), n = this.getAttribute("placeholder") || "Select...", r = this.getAttribute("search-placeholder") || "Search...", i = e.find((e) => String(e.value) === String(this._value)) || e.find((e) => e.selected);
933
+ i && (this._value = String(i.value)), this._internals?.setFormValue(this._value);
934
+ let a = e.map((e) => {
935
+ let t = String(e.value) === String(this._value);
936
+ return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${V(e.value)}" aria-selected="${t}">${e.label}</button>`;
937
+ }).join("");
938
+ this.innerHTML = `
939
+ <div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}">
940
+ <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
941
+ <span class="${i ? "" : "search-select-placeholder"}" data-label>${i ? i.label : n}</span>
942
+ <i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
943
+ </button>
944
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
945
+ ${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${V(r)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
946
+ <div class="search-select-options">${a}<div class="search-select-empty" hidden>No matches</div></div>
947
+ </div>
948
+ </div>`, this._rendered = !0, this._wire();
949
+ }
950
+ _refs() {
951
+ return {
952
+ control: this.querySelector(".search-select-control"),
953
+ menu: this.querySelector(".search-select-menu"),
954
+ label: this.querySelector("[data-label]"),
955
+ search: this.querySelector(".search-select-input"),
956
+ clear: this.querySelector(".search-select-clear"),
957
+ empty: this.querySelector(".search-select-empty"),
958
+ optionsWrap: this.querySelector(".search-select-options")
959
+ };
960
+ }
961
+ _optionEls() {
962
+ return [...this.querySelectorAll(".search-select-option")];
963
+ }
964
+ _visible() {
965
+ return this._optionEls().filter((e) => !e.hidden);
966
+ }
967
+ _syncSelected() {
968
+ let { label: e } = this._refs(), t = this._readOptions().find((e) => String(e.value) === String(this._value));
969
+ for (let e of this._optionEls()) {
970
+ let t = e.dataset.value === String(this._value);
971
+ e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
972
+ }
973
+ e && (e.innerHTML = t ? t.label : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
974
+ }
975
+ _wire() {
976
+ let e = this._refs();
977
+ if (!e.control || !e.menu) return;
978
+ let t = () => {
979
+ let t = e.control.getBoundingClientRect();
980
+ e.menu.style.position = "fixed", e.menu.style.top = `${t.bottom + 4}px`, e.menu.style.left = `${t.left}px`, e.menu.style.width = `${t.width}px`;
981
+ }, n = (e) => {
982
+ let t = this._visible();
983
+ this._active = e;
984
+ for (let e of this._optionEls()) e.classList.remove("is-active");
985
+ e >= 0 && t[e] && (t[e].classList.add("is-active"), t[e].scrollIntoView({ block: "nearest" }));
986
+ }, r = (t) => {
987
+ let n = t.trim().toLowerCase(), r = 0;
988
+ for (let e of this._optionEls()) {
989
+ let t = !n || e.textContent.toLowerCase().includes(n);
990
+ e.hidden = !t, t && (r += 1);
991
+ }
992
+ e.empty && (e.empty.hidden = r > 0), e.clear && (e.clear.hidden = !n);
993
+ }, i = () => !e.menu.hidden, a = () => {
994
+ e.menu.hidden = !1, e.control.setAttribute("aria-expanded", "true"), e.control.classList.add("open"), t(), e.search && (e.search.value = "", r(""), e.search.focus()), n(this._optionEls().findIndex((e) => e.classList.contains("selected")));
995
+ }, o = () => {
996
+ e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), n(-1);
997
+ }, s = (t) => {
998
+ this.value = t.dataset.value, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.control.focus();
999
+ }, c = (t) => {
1000
+ let r = this._visible();
1001
+ t.key === "ArrowDown" ? (t.preventDefault(), n(Math.min(this._active + 1, r.length - 1))) : t.key === "ArrowUp" ? (t.preventDefault(), n(Math.max(this._active - 1, 0))) : t.key === "Enter" ? (t.preventDefault(), r[this._active] && s(r[this._active])) : t.key === "Escape" && (o(), e.control.focus());
1002
+ };
1003
+ e.control.addEventListener("click", () => i() ? o() : a()), e.control.addEventListener("keydown", (e) => {
1004
+ !i() && (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
1005
+ }), e.optionsWrap.addEventListener("click", (e) => {
1006
+ let t = e.target.closest(".search-select-option");
1007
+ t && s(t);
1008
+ }), e.optionsWrap.addEventListener("mousemove", (e) => {
1009
+ let t = e.target.closest(".search-select-option");
1010
+ t && n(this._visible().indexOf(t));
1011
+ }), e.search?.addEventListener("input", () => {
1012
+ r(e.search.value), n(-1);
1013
+ }), e.search?.addEventListener("keydown", c), e.clear?.addEventListener("click", () => {
1014
+ e.search.value = "", r(""), e.search.focus();
1015
+ }), e.menu.addEventListener("keydown", c), this._onDocClick = (e) => {
1016
+ i() && !this.contains(e.target) && o();
1017
+ }, document.addEventListener("click", this._onDocClick), window.addEventListener("resize", () => {
1018
+ i() && t();
1019
+ });
1020
+ }
1021
+ disconnectedCallback() {
1022
+ this._onDocClick && document.removeEventListener("click", this._onDocClick);
1023
+ }
1024
+ }, V = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), H = (e, t) => {
1025
+ typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
1026
+ };
1027
+ function pe() {
1028
+ H("wui-select", fe), H("wui-phone", de), H("wui-datepicker", se), H("wui-autocomplete", re), H("wui-multiselect", ce);
1029
+ }
1030
+ pe();
1031
+ //#endregion
1032
+ //#region src/components/RequiredMark.jsx
1033
+ function U() {
1034
+ return /* @__PURE__ */ n("span", {
1035
+ className: "required",
1036
+ "aria-hidden": "true",
1037
+ children: [" ", "*"]
1038
+ });
1039
+ }
1040
+ //#endregion
1041
+ //#region src/components/AppAutocomplete.jsx
1042
+ function me({ value: e, onChange: r, options: i, loadOptions: a, placeholder: s = "Search…", minChars: c, debounce: u, disabled: d = !1, name: f, label: p, error: m, hint: h, required: g = !1, fieldClassName: _ = "" }) {
1043
+ let v = l(null), y = typeof a == "function";
1044
+ return o(() => {
1045
+ let e = v.current;
1046
+ e && !y && (e.options = i || []);
1047
+ }, [i, y]), o(() => {
1048
+ let t = v.current;
1049
+ t && t.value !== (e ?? "") && (t.value = e ?? "");
1050
+ }, [e]), o(() => {
1051
+ let e = v.current;
1052
+ if (!e) return;
1053
+ let t = () => r?.(e.value);
1054
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
1055
+ }, [r]), o(() => {
1056
+ let e = v.current;
1057
+ if (!e || !y) return;
1058
+ let t = !1, n = async (n) => {
1059
+ e.loading = !0;
1060
+ try {
1061
+ let r = await a(n.detail.query);
1062
+ t || (e.options = r || []);
1063
+ } finally {
1064
+ t || (e.loading = !1);
1065
+ }
1066
+ };
1067
+ return e.addEventListener("search", n), () => {
1068
+ t = !0, e.removeEventListener("search", n);
1069
+ };
1070
+ }, [y, a]), /* @__PURE__ */ n("div", {
1071
+ className: `field${_ ? ` ${_}` : ""}`,
1072
+ children: [
1073
+ p && /* @__PURE__ */ n("label", {
1074
+ className: "label",
1075
+ htmlFor: f,
1076
+ children: [p, g && /* @__PURE__ */ t(U, {})]
1077
+ }),
1078
+ /* @__PURE__ */ t("wui-autocomplete", {
1079
+ ref: v,
1080
+ name: f,
1081
+ placeholder: s,
1082
+ remote: y ? "" : void 0,
1083
+ "min-chars": c == null ? void 0 : String(c),
1084
+ debounce: u == null ? void 0 : String(u),
1085
+ disabled: d ? "" : void 0
1086
+ }),
1087
+ m ? /* @__PURE__ */ t("div", {
1088
+ className: "field-error",
1089
+ children: m
1090
+ }) : h ? /* @__PURE__ */ t("div", {
1091
+ className: "field-hint",
1092
+ children: h
1093
+ }) : null
1094
+ ]
1095
+ });
1096
+ }
1097
+ //#endregion
1098
+ //#region src/components/AppAvatar.jsx
1099
+ function he(e) {
1100
+ let t = (e || "").trim();
1101
+ if (!t) return "?";
1102
+ let n = t.split(/\s+/).filter(Boolean);
1103
+ return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
1104
+ }
1105
+ function ge({ name: e, src: n, className: r = "" }) {
1106
+ let i = ["avatar", r].filter(Boolean).join(" ");
1107
+ return n ? /* @__PURE__ */ t("span", {
1108
+ className: i,
1109
+ children: /* @__PURE__ */ t("img", {
1110
+ className: "avatar-img",
1111
+ src: n,
1112
+ alt: e || "Profile photo"
1113
+ })
1114
+ }) : /* @__PURE__ */ t("span", {
1115
+ className: i,
1116
+ children: he(e)
1117
+ });
1118
+ }
1119
+ //#endregion
1120
+ //#region src/components/AppBadge.jsx
1121
+ function _e({ children: e, variant: n, dot: r = !1, className: i = "", ...a }) {
1122
+ return /* @__PURE__ */ t(d, {
1123
+ bg: !1,
1124
+ className: [
1125
+ n ? `badge-${n}` : "",
1126
+ r ? "badge-dot" : "",
1127
+ i
1128
+ ].filter(Boolean).join(" ") || void 0,
1129
+ ...a,
1130
+ children: e
1131
+ });
1132
+ }
1133
+ //#endregion
1134
+ //#region src/components/AppButton.jsx
1135
+ var ve = {
1136
+ primary: "primary",
1137
+ secondary: "secondary",
1138
+ outline: "outline-primary",
1139
+ ghost: "link",
1140
+ danger: "danger"
1141
+ };
1142
+ function W({ children: e, variant: r = "primary", size: i = "md", type: a = "button", loading: o = !1, disabled: s = !1, block: c = !1, leftIcon: l = null, rightIcon: u = null, className: d = "", ...p }) {
1143
+ let m = [c ? "w-100" : "", d].filter(Boolean).join(" ");
1144
+ return /* @__PURE__ */ n(f, {
1145
+ type: a,
1146
+ variant: ve[r] ?? "primary",
1147
+ size: i === "md" ? void 0 : i,
1148
+ disabled: s || o,
1149
+ className: m || void 0,
1150
+ ...p,
1151
+ children: [
1152
+ o && /* @__PURE__ */ t("span", {
1153
+ className: "spinner-border spinner-border-sm me-2",
1154
+ "aria-hidden": "true"
1155
+ }),
1156
+ !o && l,
1157
+ e,
1158
+ !o && u
1159
+ ]
1160
+ });
1161
+ }
1162
+ //#endregion
1163
+ //#region src/components/AppCard.jsx
1164
+ function ye({ title: r, titleClassName: i = "", header: a, headerExtra: o, headerActions: s, children: c, className: l = "", bodyClassName: u = "", headerClassName: d = "", body: f = !0, ...m }) {
1165
+ let h = a != null || r != null || o != null || s != null;
1166
+ return /* @__PURE__ */ n(p, {
1167
+ className: l || void 0,
1168
+ ...m,
1169
+ children: [h && /* @__PURE__ */ t(p.Header, {
1170
+ className: d || void 0,
1171
+ children: a ?? /* @__PURE__ */ n(e, { children: [
1172
+ r != null && /* @__PURE__ */ t(p.Title, {
1173
+ as: "div",
1174
+ className: i || void 0,
1175
+ children: r
1176
+ }),
1177
+ o,
1178
+ s
1179
+ ] })
1180
+ }), f ? /* @__PURE__ */ t(p.Body, {
1181
+ className: u || void 0,
1182
+ children: c
1183
+ }) : c]
1184
+ });
1185
+ }
1186
+ //#endregion
1187
+ //#region src/components/AppCheckbox.jsx
1188
+ var be = i(function({ label: e, className: n = "", ...r }, i) {
1189
+ return /* @__PURE__ */ t(m.Check, {
1190
+ type: "checkbox",
1191
+ label: e,
1192
+ className: n || void 0,
1193
+ ref: i,
1194
+ ...r
1195
+ });
1196
+ });
1197
+ //#endregion
1198
+ //#region src/components/AppChip.jsx
1199
+ function xe({ label: r, children: i, tone: a = "neutral", size: o = "md", leadingIcon: s, avatar: c, onRemove: l, onClick: u, disabled: d = !1, removeLabel: f, className: p = "" }) {
1200
+ let m = r ?? i, h = [
1201
+ "chip",
1202
+ a && a !== "neutral" ? a : "",
1203
+ o === "sm" ? "chip-sm" : "",
1204
+ u ? "chip-clickable" : "",
1205
+ l ? "chip-removable" : "",
1206
+ d ? "is-disabled" : "",
1207
+ p
1208
+ ].filter(Boolean).join(" "), g = c ? /* @__PURE__ */ t("span", {
1209
+ className: "chip-avatar",
1210
+ children: typeof c == "string" ? /* @__PURE__ */ t("img", {
1211
+ src: c,
1212
+ alt: ""
1213
+ }) : c
1214
+ }) : s ? /* @__PURE__ */ t("span", {
1215
+ className: "chip-ic",
1216
+ children: /* @__PURE__ */ t(A, {
1217
+ name: s,
1218
+ size: o === "sm" ? 12 : 14,
1219
+ variant: "Linear"
1220
+ })
1221
+ }) : null;
1222
+ return /* @__PURE__ */ n("span", {
1223
+ className: h,
1224
+ children: [u ? /* @__PURE__ */ n("button", {
1225
+ type: "button",
1226
+ className: "chip-body",
1227
+ onClick: u,
1228
+ disabled: d,
1229
+ children: [g, /* @__PURE__ */ t("span", {
1230
+ className: "chip-label",
1231
+ children: m
1232
+ })]
1233
+ }) : /* @__PURE__ */ n(e, { children: [g, /* @__PURE__ */ t("span", {
1234
+ className: "chip-label",
1235
+ children: m
1236
+ })] }), l && /* @__PURE__ */ t("button", {
1237
+ type: "button",
1238
+ className: "chip-remove",
1239
+ onClick: l,
1240
+ disabled: d,
1241
+ "aria-label": f || (typeof m == "string" ? `Remove ${m}` : "Remove"),
1242
+ children: /* @__PURE__ */ t(A, {
1243
+ name: "x",
1244
+ size: o === "sm" ? 12 : 14,
1245
+ variant: "Linear"
1246
+ })
1247
+ })]
1248
+ });
1249
+ }
1250
+ //#endregion
1251
+ //#region src/components/AppChoiceCard.jsx
1252
+ function Se({ name: r, value: i, checked: a, onChange: o, icon: s, iconNode: c, iconSize: l = 18, image: u, imageAlt: d = "", children: f, title: p, desc: m, checkIcon: h = "check", checkSize: g = 12, checkVariant: _, className: v = "" }) {
1253
+ return /* @__PURE__ */ n("label", {
1254
+ className: `struct-card${u ? " struct-card-img-card" : ""}${a ? " checked" : ""}${v ? ` ${v}` : ""}`,
1255
+ children: [
1256
+ /* @__PURE__ */ t("input", {
1257
+ type: "radio",
1258
+ name: r,
1259
+ value: i,
1260
+ className: "struct-card-input",
1261
+ checked: a,
1262
+ onChange: o
1263
+ }),
1264
+ u ? /* @__PURE__ */ t("span", {
1265
+ className: "struct-card-media",
1266
+ children: /* @__PURE__ */ t("img", {
1267
+ className: "struct-card-img",
1268
+ src: u,
1269
+ alt: d
1270
+ })
1271
+ }) : c || s ? /* @__PURE__ */ t("span", {
1272
+ className: "struct-card-ic",
1273
+ children: c || /* @__PURE__ */ t(A, {
1274
+ name: s,
1275
+ size: l
1276
+ })
1277
+ }) : null,
1278
+ /* @__PURE__ */ t("span", {
1279
+ className: "struct-card-body",
1280
+ children: f || /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
1281
+ className: "struct-card-title",
1282
+ children: p
1283
+ }), m && /* @__PURE__ */ t("span", {
1284
+ className: "struct-card-desc",
1285
+ children: m
1286
+ })] })
1287
+ }),
1288
+ /* @__PURE__ */ t("span", {
1289
+ className: "struct-card-check",
1290
+ children: /* @__PURE__ */ t(A, {
1291
+ name: h,
1292
+ size: g,
1293
+ variant: _
1294
+ })
1295
+ })
1296
+ ]
1297
+ });
1298
+ }
1299
+ //#endregion
1300
+ //#region src/components/AppChoiceChip.jsx
1301
+ function Ce({ type: e = "checkbox", name: r, checked: i, onChange: a, children: o, className: s = "" }) {
1302
+ return /* @__PURE__ */ n("label", {
1303
+ className: `choice-chip${i ? " checked" : ""}${s ? ` ${s}` : ""}`,
1304
+ children: [/* @__PURE__ */ t("input", {
1305
+ type: e,
1306
+ name: r,
1307
+ checked: i,
1308
+ onChange: a
1309
+ }), o]
1310
+ });
1311
+ }
1312
+ //#endregion
1313
+ //#region src/components/AppInfoTip.jsx
1314
+ function G({ label: e, children: r }) {
1315
+ let [i, a] = u(!1), [o, d] = u(null), f = l(null), p = l(null), m = s();
1316
+ return c(() => {
1317
+ if (!i || !f.current || !p.current) return;
1318
+ let e = f.current.getBoundingClientRect(), t = p.current.offsetWidth, n = p.current.offsetHeight, r = e.left + e.width / 2 - t / 2;
1319
+ r = Math.max(8, Math.min(r, window.innerWidth - t - 8));
1320
+ let a = e.top - n - 8;
1321
+ a < 8 && (a = e.bottom + 8), d({
1322
+ top: a,
1323
+ left: r
1324
+ });
1325
+ }, [i]), r ? /* @__PURE__ */ n("span", {
1326
+ className: "infotip",
1327
+ onMouseLeave: () => a(!1),
1328
+ children: [/* @__PURE__ */ t("button", {
1329
+ type: "button",
1330
+ ref: f,
1331
+ className: "infotip-btn",
1332
+ "aria-label": e,
1333
+ "aria-expanded": i,
1334
+ "aria-describedby": i ? m : void 0,
1335
+ onMouseEnter: () => a(!0),
1336
+ onClick: () => a((e) => !e),
1337
+ onFocus: () => a(!0),
1338
+ onBlur: () => a(!1),
1339
+ children: /* @__PURE__ */ t(A, {
1340
+ name: "info",
1341
+ size: 16,
1342
+ variant: "Bulk"
1343
+ })
1344
+ }), i && h(/* @__PURE__ */ t("span", {
1345
+ ref: p,
1346
+ className: "infotip-pop is-portal",
1347
+ role: "tooltip",
1348
+ id: m,
1349
+ style: {
1350
+ position: "fixed",
1351
+ top: o ? o.top : 0,
1352
+ left: o ? o.left : 0,
1353
+ visibility: o ? "visible" : "hidden"
1354
+ },
1355
+ children: r
1356
+ }), document.body)]
1357
+ }) : null;
1358
+ }
1359
+ //#endregion
1360
+ //#region src/components/AppInput.jsx
1361
+ var K = i(function({ label: e, required: r = !1, error: i, hint: a, help: o, helpLabel: s = "More information", type: c = "text", leftIcon: l, rightIcon: d, onRightIconClick: f, unit: p, id: h, name: g, className: _ = "", fieldClassName: v = "", disabled: y = !1, ...b }, x) {
1362
+ let [S, C] = u(!1), w = h || g, T = c === "password", E = T && S ? "text" : c, D = [
1363
+ "input",
1364
+ i ? "error" : "",
1365
+ T ? "pw" : "",
1366
+ p ? "num-input" : "",
1367
+ _
1368
+ ].filter(Boolean).join(" "), O = /* @__PURE__ */ t(m.Control, {
1369
+ id: w,
1370
+ name: g,
1371
+ type: E,
1372
+ className: D,
1373
+ disabled: y,
1374
+ "aria-invalid": i ? "true" : "false",
1375
+ ref: x,
1376
+ ...b
1377
+ }), k;
1378
+ return k = p ? /* @__PURE__ */ n("div", {
1379
+ className: "input-with-unit",
1380
+ children: [O, /* @__PURE__ */ t("span", {
1381
+ className: "unit",
1382
+ children: p
1383
+ })]
1384
+ }) : T ? /* @__PURE__ */ n("div", {
1385
+ className: "input-wrap",
1386
+ children: [O, /* @__PURE__ */ t("button", {
1387
+ type: "button",
1388
+ className: "pw-toggle",
1389
+ onClick: () => C((e) => !e),
1390
+ "aria-label": S ? "Hide password" : "Show password",
1391
+ tabIndex: -1,
1392
+ children: /* @__PURE__ */ t(A, {
1393
+ name: S ? "eye-off" : "eye",
1394
+ size: 18,
1395
+ variant: "Linear"
1396
+ })
1397
+ })]
1398
+ }) : d ? /* @__PURE__ */ n("div", {
1399
+ className: "input-wrap",
1400
+ children: [O, /* @__PURE__ */ t("button", {
1401
+ type: "button",
1402
+ className: "pw-toggle",
1403
+ onClick: f,
1404
+ disabled: !f,
1405
+ tabIndex: -1,
1406
+ children: /* @__PURE__ */ t(A, {
1407
+ name: d,
1408
+ size: 18,
1409
+ variant: "Linear"
1410
+ })
1411
+ })]
1412
+ }) : l ? /* @__PURE__ */ n("div", {
1413
+ className: "input-icon",
1414
+ children: [/* @__PURE__ */ t("span", {
1415
+ className: "ic",
1416
+ children: /* @__PURE__ */ t(A, {
1417
+ name: l,
1418
+ size: 16,
1419
+ variant: "Linear"
1420
+ })
1421
+ }), O]
1422
+ }) : O, /* @__PURE__ */ n(m.Group, {
1423
+ className: `field${v ? ` ${v}` : ""}`,
1424
+ children: [
1425
+ e && /* @__PURE__ */ n(m.Label, {
1426
+ className: "label",
1427
+ htmlFor: w,
1428
+ children: [
1429
+ e,
1430
+ o && /* @__PURE__ */ t(G, {
1431
+ label: s,
1432
+ children: o
1433
+ }),
1434
+ r && /* @__PURE__ */ t(U, {})
1435
+ ]
1436
+ }),
1437
+ k,
1438
+ i ? /* @__PURE__ */ t("div", {
1439
+ className: "field-error",
1440
+ children: i
1441
+ }) : a ? /* @__PURE__ */ t("div", {
1442
+ className: "field-hint",
1443
+ children: a
1444
+ }) : null
1445
+ ]
1446
+ });
1447
+ }), we = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
1448
+ function q({ open: e, title: r, subtitle: i, headerIcon: o, onClose: s, footer: c, wide: l = !1, side: u = !1, maxWidth: d, hideHeader: f = !1, className: p = "", children: m }) {
1449
+ let h = a((e) => {
1450
+ if (!e) return;
1451
+ let t = e.querySelector?.(".modal-content") || e;
1452
+ d != null && t.style && (t.style.maxWidth = typeof d == "number" ? `${d}px` : String(d));
1453
+ let n = () => Array.from(t.querySelectorAll?.(we) || []);
1454
+ (t.querySelector?.("[data-autofocus]") || n().find((e) => !e.classList.contains("lx-modal-close")) || n()[0] || t)?.focus?.();
1455
+ }, [d]), _ = ["lx-modal-shell", u ? "is-side" : ""].filter(Boolean).join(" "), v = [
1456
+ "lx-modal",
1457
+ l ? "lx-modal-wide" : "",
1458
+ u ? "lx-modal-side" : "",
1459
+ p
1460
+ ].filter(Boolean).join(" ");
1461
+ return /* @__PURE__ */ n(g, {
1462
+ show: e,
1463
+ onHide: s,
1464
+ animation: !1,
1465
+ backdrop: !0,
1466
+ keyboard: !0,
1467
+ autoFocus: !1,
1468
+ enforceFocus: !0,
1469
+ restoreFocus: !0,
1470
+ centered: !u,
1471
+ className: _,
1472
+ dialogClassName: "lx-rb-dialog",
1473
+ contentClassName: v,
1474
+ backdropClassName: "lx-modal-dim",
1475
+ onEntered: h,
1476
+ "aria-label": typeof r == "string" ? r : void 0,
1477
+ children: [
1478
+ !f && /* @__PURE__ */ n("div", {
1479
+ className: "lx-modal-header",
1480
+ children: [/* @__PURE__ */ n("div", {
1481
+ className: "lx-modal-heading",
1482
+ children: [o && /* @__PURE__ */ t("span", {
1483
+ className: "lx-modal-headicon",
1484
+ children: /* @__PURE__ */ t(A, {
1485
+ name: o,
1486
+ size: 18,
1487
+ variant: "Bulk"
1488
+ })
1489
+ }), /* @__PURE__ */ n("div", {
1490
+ className: "lx-modal-headtext",
1491
+ children: [/* @__PURE__ */ t("div", {
1492
+ className: "lx-modal-title",
1493
+ children: r
1494
+ }), i && /* @__PURE__ */ t("div", {
1495
+ className: "lx-modal-subtitle",
1496
+ children: i
1497
+ })]
1498
+ })]
1499
+ }), /* @__PURE__ */ t("button", {
1500
+ type: "button",
1501
+ className: "lx-modal-close",
1502
+ onClick: s,
1503
+ "aria-label": "Close",
1504
+ children: /* @__PURE__ */ t("svg", {
1505
+ width: "18",
1506
+ height: "18",
1507
+ viewBox: "0 0 24 24",
1508
+ fill: "none",
1509
+ stroke: "currentColor",
1510
+ strokeWidth: "2",
1511
+ strokeLinecap: "round",
1512
+ strokeLinejoin: "round",
1513
+ "aria-hidden": "true",
1514
+ children: /* @__PURE__ */ t("path", { d: "M18 6 6 18M6 6l12 12" })
1515
+ })
1516
+ })]
1517
+ }),
1518
+ /* @__PURE__ */ t("div", {
1519
+ className: "lx-modal-body",
1520
+ children: m
1521
+ }),
1522
+ c && /* @__PURE__ */ t("div", {
1523
+ className: "lx-modal-footer",
1524
+ children: c
1525
+ })
1526
+ ]
1527
+ });
1528
+ }
1529
+ //#endregion
1530
+ //#region src/components/ModalIcons.jsx
1531
+ function Te({ size: e = 72 }) {
1532
+ return /* @__PURE__ */ n("svg", {
1533
+ width: e,
1534
+ height: e,
1535
+ viewBox: "0 0 174 174",
1536
+ fill: "none",
1537
+ xmlns: "http://www.w3.org/2000/svg",
1538
+ "aria-hidden": "true",
1539
+ children: [
1540
+ /* @__PURE__ */ t("rect", {
1541
+ width: "174",
1542
+ height: "174",
1543
+ rx: "87",
1544
+ fill: "var(--wui-success-5)"
1545
+ }),
1546
+ /* @__PURE__ */ t("rect", {
1547
+ x: "24",
1548
+ y: "24",
1549
+ width: "126",
1550
+ height: "126",
1551
+ rx: "63",
1552
+ stroke: "var(--wui-success-20)",
1553
+ strokeWidth: "16"
1554
+ }),
1555
+ /* @__PURE__ */ n("g", {
1556
+ clipPath: "url(#ki_success_clip)",
1557
+ children: [
1558
+ /* @__PURE__ */ t("rect", {
1559
+ x: "32",
1560
+ y: "32",
1561
+ width: "110",
1562
+ height: "110",
1563
+ rx: "55",
1564
+ fill: "var(--wui-success-active)"
1565
+ }),
1566
+ /* @__PURE__ */ t("rect", {
1567
+ x: "108.758",
1568
+ y: "67.5986",
1569
+ width: "75.5044",
1570
+ height: "49.155",
1571
+ transform: "rotate(45 108.758 67.5986)",
1572
+ fill: "var(--wui-success)"
1573
+ }),
1574
+ /* @__PURE__ */ t("path", {
1575
+ d: "M87.895 96.1046C89.7154 97.9249 89.7154 101.046 87.895 102.866L84.1243 106.637C82.3039 108.457 79.1833 108.457 77.3629 106.637L60.8496 89.9934C59.0293 88.173 59.0293 85.0524 60.8496 83.232L64.6204 79.4613C66.4408 77.6409 69.5614 77.6409 71.3817 79.4613L87.895 96.1046Z",
1576
+ fill: "white"
1577
+ }),
1578
+ /* @__PURE__ */ t("path", {
1579
+ d: "M102.324 67.3672C104.144 65.5469 107.265 65.5469 109.085 67.3672L112.856 71.138C114.676 72.9583 114.676 76.079 112.856 77.8993L84.2499 106.375C82.4296 108.195 79.3089 108.195 77.4886 106.375L73.7178 102.604C71.8975 100.784 71.8975 97.6633 73.7178 95.8429L102.324 67.3672Z",
1580
+ fill: "white"
1581
+ })
1582
+ ]
1583
+ }),
1584
+ /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", {
1585
+ id: "ki_success_clip",
1586
+ children: /* @__PURE__ */ t("rect", {
1587
+ x: "32",
1588
+ y: "32",
1589
+ width: "110",
1590
+ height: "110",
1591
+ rx: "55",
1592
+ fill: "white"
1593
+ })
1594
+ }) })
1595
+ ]
1596
+ });
1597
+ }
1598
+ function Ee({ size: e = 72 }) {
1599
+ return /* @__PURE__ */ n("svg", {
1600
+ width: e,
1601
+ height: e,
1602
+ viewBox: "0 0 174 174",
1603
+ fill: "none",
1604
+ xmlns: "http://www.w3.org/2000/svg",
1605
+ "aria-hidden": "true",
1606
+ children: [
1607
+ /* @__PURE__ */ t("rect", {
1608
+ width: "174",
1609
+ height: "174",
1610
+ rx: "87",
1611
+ fill: "var(--wui-danger-5)"
1612
+ }),
1613
+ /* @__PURE__ */ t("rect", {
1614
+ x: "24",
1615
+ y: "24",
1616
+ width: "126",
1617
+ height: "126",
1618
+ rx: "63",
1619
+ stroke: "var(--wui-danger-20)",
1620
+ strokeWidth: "16"
1621
+ }),
1622
+ /* @__PURE__ */ n("g", {
1623
+ clipPath: "url(#ki_error_clip0)",
1624
+ children: [
1625
+ /* @__PURE__ */ t("rect", {
1626
+ x: "32",
1627
+ y: "32",
1628
+ width: "110",
1629
+ height: "110",
1630
+ rx: "55",
1631
+ fill: "var(--wui-danger)"
1632
+ }),
1633
+ /* @__PURE__ */ t("rect", {
1634
+ x: "110.758",
1635
+ y: "62",
1636
+ width: "75.5044",
1637
+ height: "69.9535",
1638
+ transform: "rotate(45 110.758 62)",
1639
+ fill: "var(--wui-danger-active)"
1640
+ }),
1641
+ /* @__PURE__ */ t("g", {
1642
+ clipPath: "url(#ki_error_clip1)",
1643
+ children: /* @__PURE__ */ t("path", {
1644
+ d: "M95.9285 87.0037L112.943 69.9887C114.823 68.1087 114.823 65.0608 112.943 63.1838L110.675 60.9155C108.795 59.0349 105.747 59.0349 103.87 60.9155L86.8552 77.9298L69.8403 60.9119C67.9603 59.032 64.9124 59.032 63.0353 60.9119L60.7635 63.1802C58.8835 65.0608 58.8835 68.1087 60.7635 69.9858L77.7814 87.0037L60.767 104.018C58.8865 105.899 58.8865 108.947 60.767 110.824L63.0353 113.092C64.9153 114.972 67.9632 114.972 69.8403 113.092L86.8552 96.0769L103.87 113.092C105.75 114.972 108.798 114.972 110.675 113.092L112.943 110.824C114.823 108.943 114.823 105.895 112.943 104.018L95.9285 87.0037Z",
1645
+ fill: "white"
1646
+ })
1647
+ })
1648
+ ]
1649
+ }),
1650
+ /* @__PURE__ */ n("defs", { children: [/* @__PURE__ */ t("clipPath", {
1651
+ id: "ki_error_clip0",
1652
+ children: /* @__PURE__ */ t("rect", {
1653
+ x: "32",
1654
+ y: "32",
1655
+ width: "110",
1656
+ height: "110",
1657
+ rx: "55",
1658
+ fill: "white"
1659
+ })
1660
+ }), /* @__PURE__ */ t("clipPath", {
1661
+ id: "ki_error_clip1",
1662
+ children: /* @__PURE__ */ t("rect", {
1663
+ width: "55",
1664
+ height: "55",
1665
+ fill: "white",
1666
+ transform: "translate(59.3535 59.502)"
1667
+ })
1668
+ })] })
1669
+ ]
1670
+ });
1671
+ }
1672
+ function De({ size: e = 72 }) {
1673
+ return /* @__PURE__ */ n("svg", {
1674
+ width: e,
1675
+ height: e,
1676
+ viewBox: "0 0 174 174",
1677
+ fill: "none",
1678
+ xmlns: "http://www.w3.org/2000/svg",
1679
+ "aria-hidden": "true",
1680
+ children: [
1681
+ /* @__PURE__ */ t("rect", {
1682
+ width: "174",
1683
+ height: "174",
1684
+ rx: "87",
1685
+ fill: "var(--wui-warning-5)"
1686
+ }),
1687
+ /* @__PURE__ */ t("rect", {
1688
+ x: "24",
1689
+ y: "24",
1690
+ width: "126",
1691
+ height: "126",
1692
+ rx: "63",
1693
+ stroke: "var(--wui-warning-20)",
1694
+ strokeWidth: "16"
1695
+ }),
1696
+ /* @__PURE__ */ n("g", {
1697
+ clipPath: "url(#ki_warning_clip)",
1698
+ children: [
1699
+ /* @__PURE__ */ t("rect", {
1700
+ x: "32",
1701
+ y: "32",
1702
+ width: "110",
1703
+ height: "110",
1704
+ rx: "55",
1705
+ fill: "var(--wui-warning)"
1706
+ }),
1707
+ /* @__PURE__ */ t("path", {
1708
+ d: "M93.7812 60.9731L156.173 123.365L113.082 166.456L60 113.5L97 109L93.7812 60.9731Z",
1709
+ fill: "var(--wui-warning-active)"
1710
+ }),
1711
+ /* @__PURE__ */ t("path", {
1712
+ d: "M116.145 101.611L96.0431 62.7255C94.8912 60.6967 93.0607 59.1479 90.8656 58.3543C88.6768 57.5543 86.2768 57.5607 84.0945 58.3671C83.0001 58.7767 81.9953 59.3655 81.125 60.1079C80.2545 60.8567 79.5122 61.7527 78.9425 62.7703L57.8933 101.554C56.1525 104.594 56.1717 108.331 57.9317 111.358C59.6981 114.392 62.9427 116.248 66.4435 116.242H107.563C111.051 116.248 114.283 114.398 116.049 111.39C116.952 109.854 117.4 108.133 117.4 106.418C117.4 104.76 116.984 103.102 116.145 101.611ZM87.0064 105.714C85.0672 105.714 83.4929 104.146 83.4929 102.207C83.4929 100.267 85.0672 98.6993 87.0064 98.6993C88.9392 98.6993 90.5136 100.267 90.5136 102.207C90.5136 104.146 88.9392 105.714 87.0064 105.714ZM90.9104 78.098L88.0432 95.3266C88.0049 95.8706 87.5504 96.2994 87.0064 96.2994C86.4561 96.2994 86.0016 95.8706 85.9633 95.3266L83.0961 78.098C83.0385 77.8101 83.0065 77.522 83.0065 77.2405C83.0065 76.3125 83.3137 75.4037 83.8833 74.6485C84.6321 73.6629 85.7713 73.0549 87.0064 72.9717C88.2352 73.0549 89.3744 73.6629 90.1232 74.6485C90.872 75.6341 91.16 76.8885 90.9104 78.098Z",
1713
+ fill: "white"
1714
+ })
1715
+ ]
1716
+ }),
1717
+ /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", {
1718
+ id: "ki_warning_clip",
1719
+ children: /* @__PURE__ */ t("rect", {
1720
+ x: "32",
1721
+ y: "32",
1722
+ width: "110",
1723
+ height: "110",
1724
+ rx: "55",
1725
+ fill: "white"
1726
+ })
1727
+ }) })
1728
+ ]
1729
+ });
1730
+ }
1731
+ function Oe({ size: e = 72 }) {
1732
+ return /* @__PURE__ */ n("svg", {
1733
+ width: e,
1734
+ height: e,
1735
+ viewBox: "0 0 174 174",
1736
+ fill: "none",
1737
+ xmlns: "http://www.w3.org/2000/svg",
1738
+ "aria-hidden": "true",
1739
+ children: [
1740
+ /* @__PURE__ */ t("rect", {
1741
+ width: "174",
1742
+ height: "174",
1743
+ rx: "87",
1744
+ fill: "var(--wui-info-5)"
1745
+ }),
1746
+ /* @__PURE__ */ t("rect", {
1747
+ x: "24",
1748
+ y: "24",
1749
+ width: "126",
1750
+ height: "126",
1751
+ rx: "63",
1752
+ stroke: "var(--wui-info-20)",
1753
+ strokeWidth: "16"
1754
+ }),
1755
+ /* @__PURE__ */ n("g", {
1756
+ clipPath: "url(#ki_info_clip)",
1757
+ children: [
1758
+ /* @__PURE__ */ t("rect", {
1759
+ x: "32",
1760
+ y: "32",
1761
+ width: "110",
1762
+ height: "110",
1763
+ rx: "55",
1764
+ fill: "var(--wui-info)"
1765
+ }),
1766
+ /* @__PURE__ */ t("path", {
1767
+ d: "M104.999 67.5L111.454 64L163.495 116.041L115.739 163.797L62.999 111L101.897 104.102L104.999 67.5Z",
1768
+ fill: "var(--wui-info-active)"
1769
+ }),
1770
+ /* @__PURE__ */ t("path", {
1771
+ d: "M87 121C105.778 121 121 105.778 121 87C121 68.2223 105.778 53 87 53C68.2223 53 53 68.2223 53 87C53 105.778 68.2223 121 87 121Z",
1772
+ fill: "white"
1773
+ }),
1774
+ /* @__PURE__ */ t("path", {
1775
+ d: "M87 75.542C89.3472 75.542 91.25 73.6392 91.25 71.292C91.25 68.9448 89.3472 67.042 87 67.042C84.6528 67.042 82.75 68.9448 82.75 71.292C82.75 73.6392 84.6528 75.542 87 75.542Z",
1776
+ fill: "var(--wui-info-active)"
1777
+ }),
1778
+ /* @__PURE__ */ t("path", {
1779
+ d: "M86.9992 106.992C86.0975 106.992 85.2327 106.634 84.5951 105.996C83.9574 105.359 83.5992 104.494 83.5992 103.592V86.592C82.6975 86.592 81.8327 86.2338 81.1951 85.5962C80.5574 84.9585 80.1992 84.0937 80.1992 83.192C80.1992 82.2903 80.5574 81.4255 81.1951 80.7878C81.8327 80.1502 82.6975 79.792 83.5992 79.792H86.9992C87.901 79.792 88.7658 80.1502 89.4034 80.7878C90.041 81.4255 90.3992 82.2903 90.3992 83.192V103.592C90.3992 104.494 90.041 105.359 89.4034 105.996C88.7658 106.634 87.901 106.992 86.9992 106.992Z",
1780
+ fill: "var(--wui-info-active)"
1781
+ }),
1782
+ /* @__PURE__ */ t("path", {
1783
+ d: "M90.3992 106.992H83.5992C82.6975 106.992 81.8327 106.634 81.1951 105.996C80.5574 105.358 80.1992 104.494 80.1992 103.592C80.1992 102.69 80.5574 101.825 81.1951 101.188C81.8327 100.55 82.6975 100.192 83.5992 100.192H90.3992C91.301 100.192 92.1658 100.55 92.8034 101.188C93.441 101.825 93.7992 102.69 93.7992 103.592C93.7992 104.494 93.441 105.358 92.8034 105.996C92.1658 106.634 91.301 106.992 90.3992 106.992Z",
1784
+ fill: "var(--wui-info-active)"
1785
+ })
1786
+ ]
1787
+ }),
1788
+ /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", {
1789
+ id: "ki_info_clip",
1790
+ children: /* @__PURE__ */ t("rect", {
1791
+ x: "32",
1792
+ y: "32",
1793
+ width: "110",
1794
+ height: "110",
1795
+ rx: "55",
1796
+ fill: "white"
1797
+ })
1798
+ }) })
1799
+ ]
1800
+ });
1801
+ }
1802
+ function ke({ size: e = 72 }) {
1803
+ return /* @__PURE__ */ n("svg", {
1804
+ width: e,
1805
+ height: e,
1806
+ viewBox: "0 0 174 174",
1807
+ fill: "none",
1808
+ xmlns: "http://www.w3.org/2000/svg",
1809
+ "aria-hidden": "true",
1810
+ children: [
1811
+ /* @__PURE__ */ t("rect", {
1812
+ width: "174",
1813
+ height: "174",
1814
+ rx: "87",
1815
+ fill: "var(--wui-danger-5)"
1816
+ }),
1817
+ /* @__PURE__ */ t("rect", {
1818
+ x: "24",
1819
+ y: "24",
1820
+ width: "126",
1821
+ height: "126",
1822
+ rx: "63",
1823
+ stroke: "var(--wui-danger-20)",
1824
+ strokeWidth: "16"
1825
+ }),
1826
+ /* @__PURE__ */ n("g", {
1827
+ clipPath: "url(#ki_delete_clip0)",
1828
+ children: [
1829
+ /* @__PURE__ */ t("rect", {
1830
+ x: "32",
1831
+ y: "32",
1832
+ width: "110",
1833
+ height: "110",
1834
+ rx: "55",
1835
+ fill: "var(--wui-danger)"
1836
+ }),
1837
+ /* @__PURE__ */ t("path", {
1838
+ d: "M114.529 67.5672L163.249 116.287L116.354 163.183L67.6336 114.463L100.999 81.0975L64.999 77.5L58.999 69.5L114.529 67.5672Z",
1839
+ fill: "var(--wui-danger-active)"
1840
+ }),
1841
+ /* @__PURE__ */ t("path", {
1842
+ d: "M103.5 79L100.5 105.5L76 113L69.5 83.5L103.5 79Z",
1843
+ fill: "var(--wui-danger)"
1844
+ }),
1845
+ /* @__PURE__ */ n("g", {
1846
+ clipPath: "url(#ki_delete_clip1)",
1847
+ children: [/* @__PURE__ */ t("path", {
1848
+ d: "M113.652 66.9993C108.895 66.5266 104.139 66.1721 99.3522 65.9061V65.8766L98.7022 62.0357C98.259 59.3175 97.609 55.2402 90.6954 55.2402H82.9545C76.0704 55.2402 75.4204 59.1402 74.9477 62.0061L74.3272 65.788C71.5795 65.9652 68.8318 66.1425 66.084 66.4084L60.0568 66.9993C58.8159 67.1175 57.9295 68.2107 58.0477 69.4221C58.1659 70.6334 59.2295 71.5198 60.4704 71.4016L66.4977 70.8107C81.9795 69.2743 97.5795 69.8652 113.239 71.4311C113.327 71.4311 113.386 71.4311 113.475 71.4311C114.598 71.4311 115.573 70.5743 115.691 69.4221C115.779 68.2107 114.893 67.1175 113.652 66.9993Z",
1849
+ fill: "white"
1850
+ }), /* @__PURE__ */ t("path", {
1851
+ d: "M108.216 75.5971C107.507 74.8585 106.532 74.4448 105.527 74.4448H68.1816C67.177 74.4448 66.1725 74.8585 65.4929 75.5971C64.8134 76.3357 64.4293 77.3403 64.4884 78.3744L66.3202 108.688C66.6452 113.179 67.0588 118.793 77.3702 118.793H96.3384C106.65 118.793 107.063 113.208 107.388 108.688L109.22 78.4039C109.279 77.3403 108.895 76.3357 108.216 75.5971ZM91.7588 103.99H81.9202C80.7088 103.99 79.7043 102.986 79.7043 101.774C79.7043 100.563 80.7088 99.5585 81.9202 99.5585H91.7588C92.9702 99.5585 93.9747 100.563 93.9747 101.774C93.9747 102.986 92.9702 103.99 91.7588 103.99ZM94.2406 92.1721H79.4679C78.2566 92.1721 77.252 91.1676 77.252 89.9562C77.252 88.7448 78.2566 87.7403 79.4679 87.7403H94.2406C95.452 87.7403 96.4566 88.7448 96.4566 89.9562C96.4566 91.1676 95.452 92.1721 94.2406 92.1721Z",
1852
+ fill: "white"
1853
+ })]
1854
+ })
1855
+ ]
1856
+ }),
1857
+ /* @__PURE__ */ n("defs", { children: [/* @__PURE__ */ t("clipPath", {
1858
+ id: "ki_delete_clip0",
1859
+ children: /* @__PURE__ */ t("rect", {
1860
+ x: "32",
1861
+ y: "32",
1862
+ width: "110",
1863
+ height: "110",
1864
+ rx: "55",
1865
+ fill: "white"
1866
+ })
1867
+ }), /* @__PURE__ */ t("clipPath", {
1868
+ id: "ki_delete_clip1",
1869
+ children: /* @__PURE__ */ t("rect", {
1870
+ width: "65",
1871
+ height: "65",
1872
+ fill: "white",
1873
+ transform: "translate(54.3535 54.502)"
1874
+ })
1875
+ })] })
1876
+ ]
1877
+ });
1878
+ }
1879
+ var J = {
1880
+ success: Te,
1881
+ error: Ee,
1882
+ warning: De,
1883
+ info: Oe,
1884
+ delete: ke
1885
+ };
1886
+ //#endregion
1887
+ //#region src/components/AppConfirmDialog.jsx
1888
+ function Ae({ open: r, title: i, body: a, confirmLabel: s = "Confirm", danger: c = !1, tone: l, confirmPhrase: d, onConfirm: f, onClose: p }) {
1889
+ let [m, h] = u("");
1890
+ if (o(() => {
1891
+ r || h("");
1892
+ }, [r]), !r) return null;
1893
+ let g = !!d && m.trim() !== d, _ = J[l || (c ? "delete" : "info")];
1894
+ return /* @__PURE__ */ t(q, {
1895
+ open: r,
1896
+ hideHeader: !0,
1897
+ title: i,
1898
+ maxWidth: 440,
1899
+ onClose: p,
1900
+ className: "lx-confirm",
1901
+ footer: /* @__PURE__ */ n("div", {
1902
+ className: "lx-confirm-actions",
1903
+ children: [/* @__PURE__ */ t(W, {
1904
+ variant: "secondary",
1905
+ onClick: p,
1906
+ children: "Cancel"
1907
+ }), /* @__PURE__ */ t(W, {
1908
+ variant: c ? "danger" : "primary",
1909
+ disabled: g,
1910
+ onClick: f,
1911
+ children: s
1912
+ })]
1913
+ }),
1914
+ children: /* @__PURE__ */ n("div", {
1915
+ className: "lx-confirm-content",
1916
+ children: [
1917
+ _ && /* @__PURE__ */ t("span", {
1918
+ className: "lx-confirm-icon",
1919
+ children: /* @__PURE__ */ t(_, { size: 104 })
1920
+ }),
1921
+ /* @__PURE__ */ t("h3", {
1922
+ className: "lx-confirm-title",
1923
+ children: i
1924
+ }),
1925
+ a && /* @__PURE__ */ t("p", {
1926
+ className: "lx-confirm-msg",
1927
+ children: a
1928
+ }),
1929
+ d && /* @__PURE__ */ t(K, {
1930
+ fieldClassName: "mt-3 mb-0 w-100 text-start",
1931
+ label: /* @__PURE__ */ n(e, { children: [
1932
+ "Type ",
1933
+ /* @__PURE__ */ t("strong", { children: d }),
1934
+ " to confirm"
1935
+ ] }),
1936
+ value: m,
1937
+ onChange: (e) => h(e.target.value),
1938
+ "aria-label": `Type ${d} to confirm`
1939
+ })
1940
+ ]
1941
+ })
1942
+ });
1943
+ }
1944
+ //#endregion
1945
+ //#region src/components/AppSkeleton.jsx
1946
+ function Y({ w: e = "100%", h: n = 14, r = 6, className: i = "", style: a }) {
1947
+ return /* @__PURE__ */ t("span", {
1948
+ className: `skeleton${i ? ` ${i}` : ""}`,
1949
+ "aria-hidden": "true",
1950
+ style: {
1951
+ width: e,
1952
+ height: n,
1953
+ borderRadius: r,
1954
+ ...a
1955
+ }
1956
+ });
1957
+ }
1958
+ var je = [
1959
+ "r0",
1960
+ "r1",
1961
+ "r2",
1962
+ "r3",
1963
+ "r4",
1964
+ "r5",
1965
+ "r6",
1966
+ "r7"
1967
+ ], Me = [
1968
+ "c0",
1969
+ "c1",
1970
+ "c2",
1971
+ "c3",
1972
+ "c4",
1973
+ "c5",
1974
+ "c6",
1975
+ "c7"
1976
+ ];
1977
+ function X({ rows: e = 4, cols: n = 5 }) {
1978
+ return je.slice(0, e).map((e) => /* @__PURE__ */ t("tr", { children: Me.slice(0, n).map((e, n) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(Y, {
1979
+ w: n === 0 ? "70%" : "50%",
1980
+ h: 12
1981
+ }) }, e)) }, e));
1982
+ }
1983
+ //#endregion
1984
+ //#region src/components/AppSelectMini.jsx
1985
+ function Z({ value: e, onChange: n, options: r = [], placeholder: i = "Select...", ariaLabel: a, id: s, disabled: c }) {
1986
+ let u = l(null);
1987
+ return o(() => {
1988
+ u.current && (u.current.options = r.map((e) => ({
1989
+ value: e.value,
1990
+ label: e.label ?? e.text ?? ""
1991
+ })));
1992
+ }, [r]), o(() => {
1993
+ let t = u.current;
1994
+ t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
1995
+ }, [e]), o(() => {
1996
+ let e = u.current;
1997
+ if (!e) return;
1998
+ let t = () => n?.(e.value);
1999
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
2000
+ }, [n]), /* @__PURE__ */ t("wui-select", {
2001
+ ref: u,
2002
+ compact: "",
2003
+ id: s,
2004
+ placeholder: i,
2005
+ "aria-label": a,
2006
+ disabled: c ? "" : void 0
2007
+ });
2008
+ }
2009
+ //#endregion
2010
+ //#region src/components/AppTablePagination.jsx
2011
+ var Ne = [
2012
+ 5,
2013
+ 10,
2014
+ 25,
2015
+ 50
2016
+ ];
2017
+ function Pe({ page: e, pageCount: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = Ne }) {
2018
+ return /* @__PURE__ */ n("div", {
2019
+ className: "table-pagination",
2020
+ children: [
2021
+ /* @__PURE__ */ n("span", {
2022
+ className: "tpg-rows",
2023
+ children: ["Rows per page:", /* @__PURE__ */ t(Z, {
2024
+ compact: !0,
2025
+ value: i,
2026
+ onChange: (e) => l(Number(e)),
2027
+ ariaLabel: "Rows per page",
2028
+ options: u.map((e) => ({
2029
+ value: e,
2030
+ label: String(e)
2031
+ }))
2032
+ })]
2033
+ }),
2034
+ /* @__PURE__ */ n("span", {
2035
+ className: "tpg-range",
2036
+ children: [
2037
+ o,
2038
+ "–",
2039
+ s,
2040
+ " of ",
2041
+ a
2042
+ ]
2043
+ }),
2044
+ /* @__PURE__ */ n("div", {
2045
+ className: "tpg-nav",
2046
+ children: [/* @__PURE__ */ t("button", {
2047
+ type: "button",
2048
+ className: "tpg-arrow",
2049
+ onClick: () => c(Math.max(0, e - 1)),
2050
+ disabled: e === 0,
2051
+ "aria-label": "Previous page",
2052
+ children: /* @__PURE__ */ t(A, {
2053
+ name: "arrow-left",
2054
+ size: 18,
2055
+ variant: "Linear"
2056
+ })
2057
+ }), /* @__PURE__ */ t("button", {
2058
+ type: "button",
2059
+ className: "tpg-arrow",
2060
+ onClick: () => c(Math.min(r - 1, e + 1)),
2061
+ disabled: e >= r - 1,
2062
+ "aria-label": "Next page",
2063
+ children: /* @__PURE__ */ t(A, {
2064
+ name: "arrow-right",
2065
+ size: 18,
2066
+ variant: "Linear"
2067
+ })
2068
+ })]
2069
+ })
2070
+ ]
2071
+ });
2072
+ }
2073
+ //#endregion
2074
+ //#region src/components/AppDataTable.jsx
2075
+ function Fe(e) {
2076
+ return e === "end" ? "lx-cell-end" : e === "num" ? "ledger-num" : e === "center" ? "text-center" : "";
2077
+ }
2078
+ function Ie(e) {
2079
+ return e == null || e === "" ? "—" : e;
2080
+ }
2081
+ function Le({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s, loading: c = !1, skeletonRows: l = 5, empty: u = "No records found.", emptyFiltered: d, sourceCount: f, rowActions: p, rowActionsLabel: m, pagination: h, ariaLabel: g, className: _ = "", selectable: v = !1, selectedIds: y, onToggleRow: b, onToggleAll: x }) {
2082
+ let S = Math.max(1, r.length + +!!p + +!!v), C = v && i ? i.reduce((e, t) => e + +!!y?.has(a(t)), 0) : 0, w = v && i && i.length > 0 && C === i.length, T = C > 0 && !w, E = (e) => {
2083
+ e && (e.indeterminate = T);
2084
+ }, D = d !== void 0 && f > 0 ? d : u;
2085
+ return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
2086
+ className: "table-wrap",
2087
+ children: /* @__PURE__ */ n("table", {
2088
+ className: `table table-ledger${_ ? ` ${_}` : ""}`,
2089
+ "aria-label": g,
2090
+ children: [/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ n("tr", { children: [
2091
+ v && /* @__PURE__ */ t("th", {
2092
+ className: "lx-select-cell",
2093
+ children: /* @__PURE__ */ t("input", {
2094
+ ref: E,
2095
+ type: "checkbox",
2096
+ className: "lx-check",
2097
+ checked: w,
2098
+ onChange: (e) => x?.(e.target.checked),
2099
+ "aria-label": "Select all rows"
2100
+ })
2101
+ }),
2102
+ r.map((e) => {
2103
+ let r = !!(e.sortable && s), i = o && o.key === e.key;
2104
+ return /* @__PURE__ */ n("th", {
2105
+ className: (r ? "th-sort " : "") + Fe(e.align),
2106
+ style: e.width ? { width: e.width } : void 0,
2107
+ role: r ? "button" : void 0,
2108
+ tabIndex: r ? 0 : void 0,
2109
+ "aria-sort": i ? o.dir === "asc" ? "ascending" : "descending" : r ? "none" : void 0,
2110
+ onClick: r ? () => s(e.key) : void 0,
2111
+ onKeyDown: r ? (t) => {
2112
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), s(e.key));
2113
+ } : void 0,
2114
+ children: [e.label, r && /* @__PURE__ */ t("span", {
2115
+ className: `sort-ind${i ? "" : " idle"}`,
2116
+ children: /* @__PURE__ */ t(A, {
2117
+ name: "chevrons-up-down",
2118
+ size: 14,
2119
+ variant: "Linear"
2120
+ })
2121
+ })]
2122
+ }, e.key);
2123
+ }),
2124
+ p && (m ? /* @__PURE__ */ t("th", {
2125
+ className: "lx-cell-end",
2126
+ children: m
2127
+ }) : /* @__PURE__ */ t("th", {
2128
+ className: "lx-cell-end",
2129
+ children: /* @__PURE__ */ t("span", {
2130
+ className: "visually-hidden",
2131
+ children: "Actions"
2132
+ })
2133
+ }))
2134
+ ] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(X, {
2135
+ rows: l,
2136
+ cols: S
2137
+ }) : i?.length ? i.map((e) => {
2138
+ let i = a(e);
2139
+ return /* @__PURE__ */ n("tr", {
2140
+ className: v && y?.has(i) ? "is-selected" : void 0,
2141
+ children: [
2142
+ v && /* @__PURE__ */ t("td", {
2143
+ className: "lx-select-cell",
2144
+ children: /* @__PURE__ */ t("input", {
2145
+ type: "checkbox",
2146
+ className: "lx-check",
2147
+ checked: y?.has(i) || !1,
2148
+ onChange: () => b?.(i),
2149
+ "aria-label": "Select row"
2150
+ })
2151
+ }),
2152
+ r.map((n) => /* @__PURE__ */ t("td", {
2153
+ className: Fe(n.align) + (n.cellClassName ? ` ${n.cellClassName}` : ""),
2154
+ children: n.render ? n.render(e) : Ie(e[n.key])
2155
+ }, n.key)),
2156
+ p && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", {
2157
+ className: "u-row-actions",
2158
+ children: p(e)
2159
+ }) })
2160
+ ]
2161
+ }, i);
2162
+ }) : /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
2163
+ colSpan: S,
2164
+ className: "lx-table-empty",
2165
+ children: D
2166
+ }) }) })]
2167
+ })
2168
+ }), h && !c && h.total > 0 && /* @__PURE__ */ t(Pe, {
2169
+ page: h.page,
2170
+ pageCount: h.pageCount,
2171
+ pageSize: h.pageSize,
2172
+ total: h.total,
2173
+ firstRow: h.firstRow,
2174
+ lastRow: h.lastRow,
2175
+ onPageChange: h.setPage,
2176
+ onPageSizeChange: h.setPageSize
2177
+ })] });
2178
+ }
2179
+ //#endregion
2180
+ //#region src/components/AppDatePicker.jsx
2181
+ function Re({ value: e, onChange: n, min: r, max: i, placeholder: a = "Enter Date", disabled: s, id: c, ariaLabel: u }) {
2182
+ let d = l(null);
2183
+ return o(() => {
2184
+ let t = d.current;
2185
+ t && t.value !== (e ?? "") && (t.value = e ?? "");
2186
+ }, [e]), o(() => {
2187
+ let e = d.current;
2188
+ if (!e) return;
2189
+ let t = () => n?.(e.value);
2190
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
2191
+ }, [n]), /* @__PURE__ */ t("wui-datepicker", {
2192
+ ref: d,
2193
+ id: c,
2194
+ min: r,
2195
+ max: i,
2196
+ placeholder: a,
2197
+ "aria-label": u,
2198
+ disabled: s ? "" : void 0
2199
+ });
2200
+ }
2201
+ //#endregion
2202
+ //#region src/components/AppDropdown.jsx
2203
+ var ze = i(function({ icon: e, iconSize: n = 20, btnClass: r = "topbar-icon-btn", title: i, "aria-label": a, className: o, ...s }, c) {
2204
+ return /* @__PURE__ */ t("button", {
2205
+ ref: c,
2206
+ type: "button",
2207
+ className: r,
2208
+ title: i,
2209
+ "aria-label": a,
2210
+ ...s,
2211
+ children: /* @__PURE__ */ t(A, {
2212
+ name: e,
2213
+ size: n,
2214
+ variant: "Bulk"
2215
+ })
2216
+ });
2217
+ });
2218
+ function Be({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", title: a, ariaLabel: o, align: s = "end", items: c = [], menuClassName: l = "", linkComponent: u }) {
2219
+ return /* @__PURE__ */ n(_, {
2220
+ align: s,
2221
+ children: [/* @__PURE__ */ t(_.Toggle, {
2222
+ as: ze,
2223
+ icon: e,
2224
+ iconSize: r,
2225
+ btnClass: i,
2226
+ title: a,
2227
+ "aria-label": o
2228
+ }), /* @__PURE__ */ t(_.Menu, {
2229
+ className: l,
2230
+ renderOnMount: !0,
2231
+ children: c.map((e) => {
2232
+ let r = e.to ? u ? {
2233
+ as: u,
2234
+ to: e.to
2235
+ } : {
2236
+ as: "a",
2237
+ href: e.to
2238
+ } : {
2239
+ as: "button",
2240
+ type: "button"
2241
+ };
2242
+ return /* @__PURE__ */ n(_.Item, {
2243
+ ...r,
2244
+ onClick: e.onClick,
2245
+ className: e.danger ? "danger" : void 0,
2246
+ children: [e.icon && /* @__PURE__ */ t(A, {
2247
+ name: e.icon,
2248
+ size: 14,
2249
+ color: e.danger ? "var(--wui-danger)" : "var(--wui-primary)",
2250
+ variant: "Linear"
2251
+ }), e.label]
2252
+ }, e.key);
2253
+ })
2254
+ })]
2255
+ });
2256
+ }
2257
+ //#endregion
2258
+ //#region src/components/AppEmptyState.jsx
2259
+ function Ve({ icon: e, iconSize: r = 24, iconVariant: i, size: a = "md", title: o, text: s, action: c, className: l = "", style: u }) {
2260
+ let d = `fw-semibold text-body-emphasis${a === "sm" ? " lx-text-sm" : ""}`, f = a === "sm" ? "lx-text-xs mt-1" : "lx-text-sm mt-1";
2261
+ return /* @__PURE__ */ n("div", {
2262
+ className: `empty-state${l ? ` ${l}` : ""}`,
2263
+ style: u,
2264
+ children: [
2265
+ /* @__PURE__ */ t("div", {
2266
+ className: "empty-state-icon",
2267
+ children: /* @__PURE__ */ t(A, {
2268
+ name: e,
2269
+ size: r,
2270
+ variant: i
2271
+ })
2272
+ }),
2273
+ o != null && /* @__PURE__ */ t("div", {
2274
+ className: d,
2275
+ children: o
2276
+ }),
2277
+ s != null && /* @__PURE__ */ t("div", {
2278
+ className: f,
2279
+ children: s
2280
+ }),
2281
+ c
2282
+ ]
2283
+ });
2284
+ }
2285
+ //#endregion
2286
+ //#region src/components/icons.jsx
2287
+ function Q(e) {
2288
+ function n({ size: n = 24, color: r = "currentColor", variant: i = "Bulk", ...a }) {
2289
+ return /* @__PURE__ */ t(e, {
2290
+ size: n,
2291
+ color: r,
2292
+ variant: i,
2293
+ ...a
2294
+ });
2295
+ }
2296
+ return n.displayName = `Bulk(${e.displayName || "Icon"})`, n;
2297
+ }
2298
+ Q(T), Q(C), Q(b), Q(w), Q(S), Q(E), Q(y), Q(x);
2299
+ function He({ size: e = 16, color: n = "currentColor", ...r }) {
2300
+ return /* @__PURE__ */ t(v, {
2301
+ size: e,
2302
+ color: n,
2303
+ variant: "Linear",
2304
+ style: { transform: "rotate(45deg)" },
2305
+ ...r
2306
+ });
2307
+ }
2308
+ //#endregion
2309
+ //#region src/components/AppFileAttachment.jsx
2310
+ var Ue = "image/png,image/jpeg,image/webp";
2311
+ function We({ label: r = "Attachment", value: i, onChange: a, accept: c = Ue, maxSizeMb: l = 5, optional: d = !1, error: f, id: p }) {
2312
+ let m = s(), h = p || m, [g, _] = u(null), [v, y] = u("");
2313
+ o(() => {
2314
+ if (i instanceof File) {
2315
+ let e = URL.createObjectURL(i);
2316
+ return _(e), () => URL.revokeObjectURL(e);
2317
+ }
2318
+ _(i?.url || null);
2319
+ }, [i]);
2320
+ function b(e) {
2321
+ let t = e.target.files?.[0];
2322
+ if (e.target.value = "", t) {
2323
+ if (!c.split(",").map((e) => e.trim()).includes(t.type)) {
2324
+ y("Attach a PNG, JPG or WEBP image.");
2325
+ return;
2326
+ }
2327
+ if (t.size > l * 1024 * 1024) {
2328
+ y(`Keep the image under ${l} MB.`);
2329
+ return;
2330
+ }
2331
+ y(""), a(t);
2332
+ }
2333
+ }
2334
+ function x() {
2335
+ y(""), a(null);
2336
+ }
2337
+ let S = i instanceof File ? i.name : i?.name, C = i instanceof File ? `${(i.size / 1024).toFixed(0)} KB` : null, w = f || v;
2338
+ return /* @__PURE__ */ n("div", {
2339
+ className: "field",
2340
+ children: [
2341
+ /* @__PURE__ */ n("label", {
2342
+ className: "label",
2343
+ htmlFor: h,
2344
+ children: [r, d && /* @__PURE__ */ t("span", {
2345
+ className: "label-optional",
2346
+ children: " (optional)"
2347
+ })]
2348
+ }),
2349
+ i ? /* @__PURE__ */ n("div", {
2350
+ className: "attach-preview",
2351
+ children: [/* @__PURE__ */ n("div", {
2352
+ className: "attach-figure",
2353
+ children: [/* @__PURE__ */ t("img", {
2354
+ src: g,
2355
+ alt: S
2356
+ }), /* @__PURE__ */ t("button", {
2357
+ type: "button",
2358
+ className: "attach-remove",
2359
+ "aria-label": "Remove attachment",
2360
+ onClick: x,
2361
+ children: /* @__PURE__ */ t(He, { size: 18 })
2362
+ })]
2363
+ }), /* @__PURE__ */ n("div", {
2364
+ className: "attach-meta",
2365
+ children: [/* @__PURE__ */ t("div", {
2366
+ className: "attach-name",
2367
+ children: S
2368
+ }), C && /* @__PURE__ */ t("div", {
2369
+ className: "attach-size",
2370
+ children: C
2371
+ })]
2372
+ })]
2373
+ }) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("label", {
2374
+ className: "attach-drop",
2375
+ htmlFor: h,
2376
+ children: [
2377
+ /* @__PURE__ */ t("span", {
2378
+ className: "attach-drop-icon",
2379
+ children: /* @__PURE__ */ t(A, {
2380
+ name: "image",
2381
+ size: 18
2382
+ })
2383
+ }),
2384
+ /* @__PURE__ */ n("span", {
2385
+ className: "attach-drop-copy",
2386
+ children: [/* @__PURE__ */ t("span", {
2387
+ className: "attach-drop-title",
2388
+ children: "Add an image"
2389
+ }), /* @__PURE__ */ n("span", {
2390
+ className: "attach-drop-hint",
2391
+ children: [
2392
+ "PNG, JPG or WEBP, up to ",
2393
+ l,
2394
+ " MB"
2395
+ ]
2396
+ })]
2397
+ }),
2398
+ /* @__PURE__ */ t("span", {
2399
+ className: "attach-drop-cta",
2400
+ children: "Browse"
2401
+ })
2402
+ ]
2403
+ }), /* @__PURE__ */ t("input", {
2404
+ id: h,
2405
+ type: "file",
2406
+ className: "visually-hidden-input",
2407
+ accept: c,
2408
+ onChange: b
2409
+ })] }),
2410
+ w && /* @__PURE__ */ t("div", {
2411
+ className: "field-error",
2412
+ children: w
2413
+ })
2414
+ ]
2415
+ });
2416
+ }
2417
+ var Ge = [
2418
+ ".jpg",
2419
+ ".jpeg",
2420
+ ".png"
2421
+ ];
2422
+ function Ke(e) {
2423
+ if (!e) return null;
2424
+ let t = (e.name || "").toLowerCase();
2425
+ return Ge.some((e) => t.endsWith(e)) ? e.size > 5242880 ? "File size must be less than 5 MB." : null : "Use a JPG or PNG image.";
2426
+ }
2427
+ //#endregion
2428
+ //#region src/components/toast.js
2429
+ var qe = /* @__PURE__ */ new Set([
2430
+ "success",
2431
+ "info",
2432
+ "warning",
2433
+ "error"
2434
+ ]);
2435
+ function $(e, t = "success") {
2436
+ let n = qe.has(t) ? t : "success";
2437
+ D[n](e, { toastId: `${n}:${e}` });
2438
+ }
2439
+ function Je(e) {
2440
+ D.error(e, { toastId: `error:${e}` });
2441
+ }
2442
+ //#endregion
2443
+ //#region src/components/AppFilePicker.jsx
2444
+ function Ye({ label: e, value: r, onPick: i, required: a, error: c }) {
2445
+ let [d, f] = u(null), [p, m] = u(!1), h = l(null), g = s();
2446
+ o(() => {
2447
+ if (r instanceof File) {
2448
+ let e = URL.createObjectURL(r);
2449
+ return f(e), () => URL.revokeObjectURL(e);
2450
+ }
2451
+ f(null);
2452
+ }, [r]);
2453
+ let _ = r?.url || d, v = (e) => {
2454
+ let t = Ke(e);
2455
+ return t ? ($(t, "error"), !1) : (i(e), !0);
2456
+ }, y = (e) => {
2457
+ let t = e.target.files?.[0] || null;
2458
+ t && (v(t) || (e.target.value = ""));
2459
+ }, b = (e) => {
2460
+ e.preventDefault(), m(!1);
2461
+ let t = e.dataTransfer.files?.[0];
2462
+ t && v(t);
2463
+ }, x = () => h.current?.click(), S = /* @__PURE__ */ t("input", {
2464
+ id: g,
2465
+ ref: h,
2466
+ type: "file",
2467
+ accept: ".jpg,.jpeg,.png",
2468
+ className: "d-none",
2469
+ onClick: (e) => {
2470
+ e.currentTarget.value = "";
2471
+ },
2472
+ onChange: y
2473
+ });
2474
+ return /* @__PURE__ */ n("div", {
2475
+ className: "field",
2476
+ children: [
2477
+ /* @__PURE__ */ n("label", {
2478
+ className: "label",
2479
+ htmlFor: g,
2480
+ children: [e, a && /* @__PURE__ */ t(U, {})]
2481
+ }),
2482
+ _ ? /* @__PURE__ */ n("div", {
2483
+ className: `file-preview${c ? " error" : ""}`,
2484
+ children: [
2485
+ /* @__PURE__ */ n("button", {
2486
+ type: "button",
2487
+ className: "file-preview-open",
2488
+ "aria-label": `Change ${e}`,
2489
+ onClick: x,
2490
+ children: [/* @__PURE__ */ t("img", {
2491
+ src: _,
2492
+ alt: `${e} preview`,
2493
+ className: "file-preview-img"
2494
+ }), /* @__PURE__ */ t("span", {
2495
+ className: "file-preview-overlay",
2496
+ children: /* @__PURE__ */ n("span", {
2497
+ className: "file-preview-cta",
2498
+ children: [/* @__PURE__ */ t(A, {
2499
+ name: "image",
2500
+ size: 16,
2501
+ variant: "Linear"
2502
+ }), " Change image"]
2503
+ })
2504
+ })]
2505
+ }),
2506
+ /* @__PURE__ */ t("button", {
2507
+ type: "button",
2508
+ className: "file-preview-remove",
2509
+ "aria-label": `Remove ${e}`,
2510
+ title: "Remove image",
2511
+ onClick: () => i(null),
2512
+ children: /* @__PURE__ */ t(A, {
2513
+ name: "x",
2514
+ size: 16,
2515
+ variant: "Linear"
2516
+ })
2517
+ }),
2518
+ S
2519
+ ]
2520
+ }) : /* @__PURE__ */ n("div", {
2521
+ className: `file-input file-input-tall${p ? " dragging" : ""}${c ? " error" : ""}`,
2522
+ onDragOver: (e) => {
2523
+ e.preventDefault(), p || m(!0);
2524
+ },
2525
+ onDragLeave: (e) => {
2526
+ e.preventDefault(), m(!1);
2527
+ },
2528
+ onDrop: b,
2529
+ children: [/* @__PURE__ */ n("label", {
2530
+ htmlFor: g,
2531
+ className: "file-input-zone-label",
2532
+ children: [
2533
+ /* @__PURE__ */ t("span", {
2534
+ className: "file-input-icon",
2535
+ children: /* @__PURE__ */ t(A, {
2536
+ name: "upload",
2537
+ size: 24,
2538
+ variant: "Linear"
2539
+ })
2540
+ }),
2541
+ /* @__PURE__ */ n("span", {
2542
+ className: "file-input-title",
2543
+ children: [/* @__PURE__ */ t("span", {
2544
+ className: "browse",
2545
+ children: "Click to upload"
2546
+ }), " or drag & drop"]
2547
+ }),
2548
+ /* @__PURE__ */ t("span", {
2549
+ className: "file-input-text",
2550
+ children: "JPG, JPEG or PNG · up to 5 MB"
2551
+ })
2552
+ ]
2553
+ }), S]
2554
+ }),
2555
+ c && /* @__PURE__ */ t("div", {
2556
+ className: "field-error",
2557
+ children: c
2558
+ })
2559
+ ]
2560
+ });
2561
+ }
2562
+ //#endregion
2563
+ //#region src/components/AppLogoPicker.jsx
2564
+ function Xe({ value: r, fallback: i, onPick: a, loading: o = !1, accept: s = "image/png,image/jpeg", overlayIcon: c = "image", overlayLabel: u = "Update photo", ariaLabel: d = "Upload photo" }) {
2565
+ let f = l(null);
2566
+ return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
2567
+ type: "button",
2568
+ className: "set-uploader",
2569
+ "aria-busy": o,
2570
+ disabled: o,
2571
+ onClick: () => {
2572
+ o || f.current?.click();
2573
+ },
2574
+ "aria-label": d,
2575
+ children: /* @__PURE__ */ n("div", {
2576
+ className: "set-uploader-ring",
2577
+ children: [r ? /* @__PURE__ */ t("img", {
2578
+ className: "set-uploader-img",
2579
+ src: r,
2580
+ alt: ""
2581
+ }) : /* @__PURE__ */ t("div", {
2582
+ className: "set-uploader-logo",
2583
+ children: i
2584
+ }), o ? /* @__PURE__ */ t("div", {
2585
+ className: "set-uploader-overlay is-loading",
2586
+ "aria-hidden": "true",
2587
+ children: /* @__PURE__ */ t(A, {
2588
+ name: "refresh-cw",
2589
+ size: 22,
2590
+ variant: "Linear",
2591
+ className: "lx-spin"
2592
+ })
2593
+ }) : /* @__PURE__ */ n("div", {
2594
+ className: "set-uploader-overlay",
2595
+ children: [/* @__PURE__ */ t(A, {
2596
+ name: c,
2597
+ size: 22,
2598
+ variant: "Linear"
2599
+ }), /* @__PURE__ */ t("span", { children: u })]
2600
+ })]
2601
+ })
2602
+ }), /* @__PURE__ */ t("input", {
2603
+ ref: f,
2604
+ type: "file",
2605
+ hidden: !0,
2606
+ accept: s,
2607
+ onChange: (e) => {
2608
+ let t = e.target.files?.[0];
2609
+ if (e.target.value = "", !t) return;
2610
+ let n = Ke(t);
2611
+ if (n) {
2612
+ $(n, "error");
2613
+ return;
2614
+ }
2615
+ a(t);
2616
+ },
2617
+ disabled: o
2618
+ })] });
2619
+ }
2620
+ //#endregion
2621
+ //#region src/components/AppMultiSelect.jsx
2622
+ function Ze({ values: e, onChange: r, options: i, placeholder: a = "Select…", searchable: s = !0, disabled: c = !1, name: u, label: d, error: f, hint: p, required: m = !1, fieldClassName: h = "" }) {
2623
+ let g = l(null);
2624
+ return o(() => {
2625
+ let e = g.current;
2626
+ e && (e.options = i || []);
2627
+ }, [i]), o(() => {
2628
+ let t = g.current;
2629
+ if (!t) return;
2630
+ let n = e || [], r = t.values || [];
2631
+ n.join(",") !== r.join(",") && (t.values = n);
2632
+ }, [e]), o(() => {
2633
+ let e = g.current;
2634
+ if (!e) return;
2635
+ let t = () => r?.(e.values);
2636
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
2637
+ }, [r]), /* @__PURE__ */ n("div", {
2638
+ className: `field${h ? ` ${h}` : ""}`,
2639
+ children: [
2640
+ d && /* @__PURE__ */ n("label", {
2641
+ className: "label",
2642
+ htmlFor: u,
2643
+ children: [d, m && /* @__PURE__ */ t(U, {})]
2644
+ }),
2645
+ /* @__PURE__ */ t("wui-multiselect", {
2646
+ ref: g,
2647
+ name: u,
2648
+ placeholder: a,
2649
+ searchable: s ? "" : void 0,
2650
+ disabled: c ? "" : void 0
2651
+ }),
2652
+ f ? /* @__PURE__ */ t("div", {
2653
+ className: "field-error",
2654
+ children: f
2655
+ }) : p ? /* @__PURE__ */ t("div", {
2656
+ className: "field-hint",
2657
+ children: p
2658
+ }) : null
2659
+ ]
2660
+ });
2661
+ }
2662
+ //#endregion
2663
+ //#region src/components/AppPageHeader.jsx
2664
+ function Qe({ title: e, subtitle: r, actions: i, className: a = "" }) {
2665
+ return /* @__PURE__ */ n("div", {
2666
+ className: `page-header${i ? " d-flex align-items-end justify-content-between" : ""}${a ? ` ${a}` : ""}`,
2667
+ children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("div", {
2668
+ className: "page-title",
2669
+ children: e
2670
+ }), r != null && /* @__PURE__ */ t("div", {
2671
+ className: "page-subtitle",
2672
+ children: r
2673
+ })] }), i && /* @__PURE__ */ t("div", {
2674
+ className: "page-actions",
2675
+ children: i
2676
+ })]
2677
+ });
2678
+ }
2679
+ //#endregion
2680
+ //#region src/components/AppPhoneNumberInput.jsx
2681
+ function $e({ value: e, onChange: r, countryCode: i, disabled: a = !1, name: s, label: c = "Phone number", placeholder: u = "Enter phone number", required: d = !1, error: f, fieldClassName: p = "" }) {
2682
+ let m = l(null);
2683
+ return o(() => {
2684
+ let t = m.current;
2685
+ t && t.value !== (e ?? "") && (t.value = e ?? "");
2686
+ }, [e]), o(() => {
2687
+ let e = m.current;
2688
+ if (!e) return;
2689
+ let t = () => r?.(e.value);
2690
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
2691
+ }, [r]), /* @__PURE__ */ n("div", {
2692
+ className: `field app-phone-number-input${p ? ` ${p}` : ""}`,
2693
+ children: [
2694
+ c && /* @__PURE__ */ n("label", {
2695
+ className: "label",
2696
+ htmlFor: s,
2697
+ children: [c, d && /* @__PURE__ */ t(U, {})]
2698
+ }),
2699
+ /* @__PURE__ */ t("wui-phone", {
2700
+ ref: m,
2701
+ name: s,
2702
+ country: i,
2703
+ placeholder: u,
2704
+ disabled: a ? "" : void 0
2705
+ }),
2706
+ f && /* @__PURE__ */ t("div", {
2707
+ className: "field-error",
2708
+ children: f
2709
+ })
2710
+ ]
2711
+ });
2712
+ }
2713
+ //#endregion
2714
+ //#region src/components/AppRadio.jsx
2715
+ var et = i(function({ label: e, className: n = "", ...r }, i) {
2716
+ return /* @__PURE__ */ t(m.Check, {
2717
+ type: "radio",
2718
+ label: e,
2719
+ className: n || void 0,
2720
+ ref: i,
2721
+ ...r
2722
+ });
2723
+ });
2724
+ //#endregion
2725
+ //#region src/components/AppSearch.jsx
2726
+ function tt({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize: o = 18, className: s = "", ...c }) {
2727
+ return /* @__PURE__ */ n("div", {
2728
+ className: [
2729
+ "search-wrap",
2730
+ "search-field",
2731
+ e ? "has-value" : "",
2732
+ s
2733
+ ].filter(Boolean).join(" "),
2734
+ children: [
2735
+ /* @__PURE__ */ t(A, {
2736
+ name: "search",
2737
+ size: o
2738
+ }),
2739
+ /* @__PURE__ */ t(m.Control, {
2740
+ className: "search-input w-100",
2741
+ placeholder: i,
2742
+ value: e,
2743
+ onChange: (e) => r(e.target.value),
2744
+ "aria-label": a,
2745
+ ...c
2746
+ }),
2747
+ e && /* @__PURE__ */ t("button", {
2748
+ type: "button",
2749
+ className: "search-clear",
2750
+ "aria-label": "Clear search",
2751
+ onClick: () => r(""),
2752
+ children: /* @__PURE__ */ t(A, {
2753
+ name: "x",
2754
+ size: 16,
2755
+ variant: "Bulk"
2756
+ })
2757
+ })
2758
+ ]
2759
+ });
2760
+ }
2761
+ //#endregion
2762
+ //#region src/components/AppSelect.jsx
2763
+ var nt = (e) => e == null ? "" : e.label ?? e.text ?? "";
2764
+ function rt({ value: e, onChange: r, options: i = [], placeholder: a = "Select...", searchPlaceholder: s = "Search...", searchable: c = !1, disabled: u, label: d, required: f = !1, error: p, hint: m, help: h, helpLabel: g = "More information", id: _, name: v, fieldClassName: y = "" }) {
2765
+ let b = l(null);
2766
+ o(() => {
2767
+ b.current && (b.current.options = i.map((e) => ({
2768
+ value: e.value,
2769
+ label: nt(e)
2770
+ })));
2771
+ }, [i]), o(() => {
2772
+ let t = b.current;
2773
+ t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
2774
+ }, [e]), o(() => {
2775
+ let e = b.current;
2776
+ if (!e) return;
2777
+ let t = () => r?.(e.value);
2778
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
2779
+ }, [r]);
2780
+ let x = /* @__PURE__ */ t("wui-select", {
2781
+ ref: b,
2782
+ id: _ || v,
2783
+ placeholder: a,
2784
+ "search-placeholder": s,
2785
+ searchable: c ? "" : void 0,
2786
+ disabled: u ? "" : void 0
2787
+ });
2788
+ if (!d && !p && !m) return x;
2789
+ let S = _ || v;
2790
+ return /* @__PURE__ */ n("div", {
2791
+ className: `field${y ? ` ${y}` : ""}`,
2792
+ children: [
2793
+ d && /* @__PURE__ */ n("label", {
2794
+ className: "label",
2795
+ htmlFor: S,
2796
+ children: [
2797
+ d,
2798
+ h && /* @__PURE__ */ t(G, {
2799
+ label: g,
2800
+ children: h
2801
+ }),
2802
+ f && /* @__PURE__ */ t(U, {})
2803
+ ]
2804
+ }),
2805
+ x,
2806
+ p ? /* @__PURE__ */ t("div", {
2807
+ className: "field-error",
2808
+ children: p
2809
+ }) : m ? /* @__PURE__ */ t("div", {
2810
+ className: "field-hint",
2811
+ children: m
2812
+ }) : null
2813
+ ]
2814
+ });
2815
+ }
2816
+ //#endregion
2817
+ //#region src/components/AppSidebarMenu.jsx
2818
+ var it = {
2819
+ left: "start",
2820
+ right: "end",
2821
+ start: "start",
2822
+ end: "end",
2823
+ top: "top",
2824
+ bottom: "bottom"
2825
+ };
2826
+ function at({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, header: s, children: c, footer: l, width: u, backdrop: d = !0, scroll: f = !1, keyboard: p = !0, closeButton: m = !0, responsive: h, className: g = "", bodyClassName: _ = "", ariaLabel: v }) {
2827
+ return /* @__PURE__ */ n(O, {
2828
+ show: e,
2829
+ onHide: r,
2830
+ placement: it[i] || "end",
2831
+ backdrop: d,
2832
+ scroll: f,
2833
+ keyboard: p,
2834
+ responsive: h,
2835
+ style: u ? { "--asm-width": u } : void 0,
2836
+ className: `app-sidebar-menu${g ? ` ${g}` : ""}`,
2837
+ "aria-label": v || (typeof a == "string" ? a : void 0),
2838
+ children: [
2839
+ s === void 0 ? (a != null || m) && /* @__PURE__ */ n("div", {
2840
+ className: "drawer-header",
2841
+ children: [a != null && /* @__PURE__ */ n("div", {
2842
+ className: "drawer-title",
2843
+ children: [o && /* @__PURE__ */ t("span", {
2844
+ className: "drawer-title-ic",
2845
+ children: /* @__PURE__ */ t(A, {
2846
+ name: o,
2847
+ size: 18,
2848
+ variant: "Bulk"
2849
+ })
2850
+ }), a]
2851
+ }), m && /* @__PURE__ */ t(W, {
2852
+ variant: "ghost",
2853
+ className: "btn-icon",
2854
+ onClick: r,
2855
+ "aria-label": "Close",
2856
+ icon: "x",
2857
+ iconSize: 16
2858
+ })]
2859
+ }) : s,
2860
+ /* @__PURE__ */ t(O.Body, {
2861
+ className: _,
2862
+ children: c
2863
+ }),
2864
+ l && /* @__PURE__ */ t("div", {
2865
+ className: "asm-footer",
2866
+ children: l
2867
+ })
2868
+ ]
2869
+ });
2870
+ }
2871
+ //#endregion
2872
+ //#region src/components/AppStatusBadge.jsx
2873
+ function ot({ label: e, tone: n = "", className: r = "" }) {
2874
+ return e == null || e === "" ? "—" : /* @__PURE__ */ t("span", {
2875
+ className: `status-label ${n}${r ? ` ${r}` : ""}`,
2876
+ children: e
2877
+ });
2878
+ }
2879
+ //#endregion
2880
+ //#region src/components/AppSwitch.jsx
2881
+ var st = i(function({ label: e, className: n = "", ...r }, i) {
2882
+ return /* @__PURE__ */ t(m.Check, {
2883
+ type: "switch",
2884
+ "aria-label": e,
2885
+ className: n || void 0,
2886
+ ref: i,
2887
+ ...r
2888
+ });
2889
+ });
2890
+ //#endregion
2891
+ //#region src/components/AppTableEmptyState.jsx
2892
+ function ct({ icon: e, title: r, text: i, action: a }) {
2893
+ return /* @__PURE__ */ n("div", {
2894
+ className: "tbl-empty",
2895
+ children: [
2896
+ /* @__PURE__ */ t("span", {
2897
+ className: "tbl-empty-icon",
2898
+ children: /* @__PURE__ */ t(A, {
2899
+ name: e,
2900
+ size: 24,
2901
+ variant: "Bulk"
2902
+ })
2903
+ }),
2904
+ /* @__PURE__ */ t("div", {
2905
+ className: "tbl-empty-title",
2906
+ children: r
2907
+ }),
2908
+ i && /* @__PURE__ */ t("div", {
2909
+ className: "tbl-empty-text",
2910
+ children: i
2911
+ }),
2912
+ a && /* @__PURE__ */ t("div", {
2913
+ className: "tbl-empty-action",
2914
+ children: a
2915
+ })
2916
+ ]
2917
+ });
2918
+ }
2919
+ //#endregion
2920
+ //#region src/components/AppTabs.jsx
2921
+ function lt({ tabs: e, value: r, onChange: i, ariaLabel: a, className: o = "" }) {
2922
+ let s = l(null);
2923
+ function c(t) {
2924
+ let n = e.findIndex((e) => e.key === r);
2925
+ if (n < 0) return;
2926
+ let a = null;
2927
+ if (t.key === "ArrowRight" ? a = e[(n + 1) % e.length] : t.key === "ArrowLeft" ? a = e[(n - 1 + e.length) % e.length] : t.key === "Home" ? a = e[0] : t.key === "End" && (a = e[e.length - 1]), !a) return;
2928
+ t.preventDefault(), i(a.key);
2929
+ let o = CSS.escape(String(a.key));
2930
+ s.current?.querySelector(`[data-rr-ui-event-key="${o}"]`)?.focus();
2931
+ }
2932
+ return /* @__PURE__ */ t(k, {
2933
+ as: "div",
2934
+ role: "tablist",
2935
+ ref: s,
2936
+ activeKey: r,
2937
+ onSelect: (e) => {
2938
+ e != null && i(e);
2939
+ },
2940
+ onKeyDown: c,
2941
+ className: `user-tabs${o ? ` ${o}` : ""}`,
2942
+ "aria-label": a,
2943
+ children: e.map((e) => /* @__PURE__ */ n(k.Link, {
2944
+ as: "button",
2945
+ type: "button",
2946
+ eventKey: e.key,
2947
+ role: "tab",
2948
+ bsPrefix: "user-tab",
2949
+ className: e.danger ? "user-tab-danger" : void 0,
2950
+ children: [
2951
+ e.icon,
2952
+ e.label,
2953
+ e.count != null && /* @__PURE__ */ t("span", {
2954
+ className: `utab-count${e.tone ? ` ${e.tone}` : ""}`,
2955
+ children: e.count
2956
+ })
2957
+ ]
2958
+ }, e.key))
2959
+ });
2960
+ }
2961
+ //#endregion
2962
+ //#region src/components/AppTextarea.jsx
2963
+ var ut = i(function({ label: e, required: r = !1, error: i, hint: a, help: o, helpLabel: s = "More information", id: c, name: l, rows: u = 4, className: d = "", fieldClassName: f = "", ...p }, h) {
2964
+ let g = c || l, _ = [
2965
+ "textarea",
2966
+ i ? "error" : "",
2967
+ d
2968
+ ].filter(Boolean).join(" ");
2969
+ return /* @__PURE__ */ n(m.Group, {
2970
+ className: `field${f ? ` ${f}` : ""}`,
2971
+ children: [
2972
+ e && /* @__PURE__ */ n(m.Label, {
2973
+ className: "label",
2974
+ htmlFor: g,
2975
+ children: [
2976
+ e,
2977
+ o && /* @__PURE__ */ t(G, {
2978
+ label: s,
2979
+ children: o
2980
+ }),
2981
+ r && /* @__PURE__ */ t(U, {})
2982
+ ]
2983
+ }),
2984
+ /* @__PURE__ */ t(m.Control, {
2985
+ as: "textarea",
2986
+ id: g,
2987
+ name: l,
2988
+ rows: u,
2989
+ className: _,
2990
+ "aria-invalid": i ? "true" : "false",
2991
+ ref: h,
2992
+ ...p
2993
+ }),
2994
+ i ? /* @__PURE__ */ t("div", {
2995
+ className: "field-error",
2996
+ children: i
2997
+ }) : a ? /* @__PURE__ */ t("div", {
2998
+ className: "field-hint",
2999
+ children: a
3000
+ }) : null
3001
+ ]
3002
+ });
3003
+ });
3004
+ //#endregion
3005
+ export { te as ActionIcon, ne as AppAlert, me as AppAutocomplete, ge as AppAvatar, _e as AppBadge, W as AppButton, ye as AppCard, be as AppCheckbox, xe as AppChip, Se as AppChoiceCard, Ce as AppChoiceChip, Ae as AppConfirmDialog, Le as AppDataTable, Re as AppDatePicker, Be as AppDropdown, Ve as AppEmptyState, We as AppFileAttachment, Ye as AppFilePicker, G as AppInfoTip, K as AppInput, Xe as AppLogoPicker, q as AppModal, Ze as AppMultiSelect, Qe as AppPageHeader, $e as AppPhoneNumberInput, et as AppRadio, tt as AppSearch, rt as AppSelect, Z as AppSelectMini, at as AppSidebarMenu, Y as AppSkeleton, X as AppSkeletonRows, ot as AppStatusBadge, st as AppSwitch, ct as AppTableEmptyState, Pe as AppTablePagination, lt as AppTabs, ut as AppTextarea, A as Icon, J as MODAL_ICONS, U as RequiredMark, Je as errorToast, $ as toast };