@directo-ui/web 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/wari.js ADDED
@@ -0,0 +1,2774 @@
1
+ import { useEffect as e, useId as t, useLayoutEffect as n, useMemo as r, useRef as i, useState as a } from "react";
2
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
3
+ //#region src/wari/statuses.ts
4
+ var l = [
5
+ {
6
+ value: "libre",
7
+ label: "Libre"
8
+ },
9
+ {
10
+ value: "aceptado",
11
+ label: "Aceptado"
12
+ },
13
+ {
14
+ value: "contacto",
15
+ label: "Contacto"
16
+ },
17
+ {
18
+ value: "inicio",
19
+ label: "Inició"
20
+ },
21
+ {
22
+ value: "llego",
23
+ label: "Llegó"
24
+ },
25
+ {
26
+ value: "terminado",
27
+ label: "Terminado"
28
+ },
29
+ {
30
+ value: "preasignado",
31
+ label: "Preasignado"
32
+ },
33
+ {
34
+ value: "anulado-operador",
35
+ label: "Anulado Operador"
36
+ },
37
+ {
38
+ value: "anulado-usuario",
39
+ label: "Anulado Usuario"
40
+ },
41
+ {
42
+ value: "empalmado",
43
+ label: "Empalmado"
44
+ }
45
+ ], u = (e) => l.find((t) => t.value === e)?.label ?? e;
46
+ //#endregion
47
+ //#region src/wari/StatusTag.tsx
48
+ function d({ status: e, size: t = "md", color: n, children: r, className: i, style: a, ...o }) {
49
+ let c = n ? {
50
+ "--ds-status-bg": n.background,
51
+ "--ds-status-fg": n.foreground
52
+ } : void 0, l = r ?? (e && e !== "todos" ? u(e) : "Todos");
53
+ return /* @__PURE__ */ s("span", {
54
+ ...o,
55
+ className: ["ds-status", i].filter(Boolean).join(" "),
56
+ "data-status": e,
57
+ "data-size": t,
58
+ style: c ? {
59
+ ...c,
60
+ ...a
61
+ } : a,
62
+ children: /* @__PURE__ */ s("span", { children: l })
63
+ });
64
+ }
65
+ //#endregion
66
+ //#region src/wari/logic.ts
67
+ function f(e) {
68
+ return e.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase().trim();
69
+ }
70
+ function p(e, t) {
71
+ let n = f(t);
72
+ return n ? e.filter((e) => f(e.label).includes(n)) : [...e];
73
+ }
74
+ function m(e, t) {
75
+ let n = new Set(e);
76
+ return t.filter((e) => n.has(e.value)).map((e) => e.value);
77
+ }
78
+ function h(e, t, n) {
79
+ let r = n.find((e) => e.value === t);
80
+ if (!r || r.disabled) return [...e];
81
+ let i = new Set(e);
82
+ return i.has(t) ? i.delete(t) : i.add(t), m(i, n);
83
+ }
84
+ function g(e, t) {
85
+ let n = t.filter((e) => !e.disabled), r = n.filter((t) => e.includes(t.value)).length;
86
+ return r === 0 ? "none" : r === n.length ? "all" : "some";
87
+ }
88
+ function _(e, t) {
89
+ let n = t.filter((t) => t.disabled && e.includes(t.value)).map((e) => e.value);
90
+ return g(e, t) === "all" ? m(n, t) : m([...n, ...t.filter((e) => !e.disabled).map((e) => e.value)], t);
91
+ }
92
+ function v(e) {
93
+ return e <= 0 ? "" : e === 1 ? "1 elemento seleccionado" : `${e} elementos seleccionados`;
94
+ }
95
+ //#endregion
96
+ //#region src/wari/MultiSelect.tsx
97
+ var y = Symbol("all");
98
+ function b({ options: n, value: o, defaultValue: l, onChange: u, label: f, "aria-label": m, placeholder: b = "Seleccionar", searchPlaceholder: x = "Buscar…", allLabel: S = "Todos", maxTags: C = 2, supportingText: w, summary: T = !0, emptyMessage: E = "Sin coincidencias", error: D = !1, disabled: O = !1, required: k, name: A, id: j, className: M, size: N = "md" }) {
99
+ let P = t(), F = j ?? P, I = `${F}-listbox`, L = `${F}-label`, R = `${F}-hint`, ee = (e) => `${F}-option-${e}`, [z, B] = a(() => l ?? []), V = o ?? z, [H, te] = a(!1), [U, ne] = a(""), [re, W] = a(0), ie = i(null), G = i(null), ae = r(() => p(n, U), [n, U]), K = S && !U && n.length > 0 ? [y, ...ae] : ae, q = Math.min(re, K.length - 1), J = g(V, n), oe = n.some((e) => e.status || e.color), Y = n.filter((e) => V.includes(e.value)).length, se = w ?? (T === !1 ? "" : typeof T == "function" ? T(Y, n.length) : v(Y));
100
+ e(() => {
101
+ if (!H) return;
102
+ let e = (e) => {
103
+ ie.current?.contains(e.target) || (te(!1), ne(""));
104
+ };
105
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
106
+ }, [H]), e(() => {
107
+ H && q >= 0 && document.getElementById(`${F}-option-${q}`)?.scrollIntoView?.({ block: "nearest" });
108
+ }, [
109
+ H,
110
+ q,
111
+ F
112
+ ]);
113
+ let X = (e) => {
114
+ o === void 0 && B(e), u?.(e);
115
+ }, ce = () => {
116
+ te(!1), ne("");
117
+ }, Z = (e) => {
118
+ O || (te(!0), W(e));
119
+ }, Q = (e) => X(e === y ? _(V, n) : h(V, e.value, n)), le = (e, t, n) => oe ? /* @__PURE__ */ s(d, {
120
+ status: t,
121
+ color: n,
122
+ children: e
123
+ }) : /* @__PURE__ */ s("span", {
124
+ className: "ds-multiselect-option-label",
125
+ children: e
126
+ }), ue = (e) => {
127
+ let t = K.length - 1;
128
+ switch (e.key) {
129
+ case "ArrowDown":
130
+ e.preventDefault(), H ? W(Math.min(q + 1, t)) : Z(0);
131
+ break;
132
+ case "ArrowUp":
133
+ e.preventDefault(), H ? W(Math.max(q - 1, 0)) : Z(t);
134
+ break;
135
+ case "Home":
136
+ case "End":
137
+ H && (e.preventDefault(), W(e.key === "Home" ? 0 : t));
138
+ break;
139
+ case "Enter":
140
+ e.preventDefault(), H ? K[q] && Q(K[q]) : Z(0);
141
+ break;
142
+ case "Escape":
143
+ H && (e.preventDefault(), U ? (ne(""), W(0)) : ce());
144
+ break;
145
+ case "Tab": ce();
146
+ }
147
+ }, de = (e) => {
148
+ O || e.target === G.current || (e.preventDefault(), G.current?.focus(), H ? ce() : Z(0));
149
+ }, $ = (e) => {
150
+ let t = e.relatedTarget;
151
+ t && !ie.current?.contains(t) && ce();
152
+ }, fe = n.filter((e) => V.includes(e.value)), pe = Math.max(0, fe.length - C);
153
+ return /* @__PURE__ */ c("div", {
154
+ ref: ie,
155
+ className: [
156
+ "ds-input",
157
+ "ds-multiselect",
158
+ M
159
+ ].filter(Boolean).join(" "),
160
+ "data-open": H,
161
+ "data-error": D,
162
+ "data-disabled": O,
163
+ "data-size": N,
164
+ onBlur: $,
165
+ children: [
166
+ f && /* @__PURE__ */ c("label", {
167
+ id: L,
168
+ htmlFor: F,
169
+ children: [f, k && /* @__PURE__ */ s("span", {
170
+ className: "ds-input-required",
171
+ "aria-hidden": "true",
172
+ children: "*"
173
+ })]
174
+ }),
175
+ /* @__PURE__ */ c("div", {
176
+ className: "ds-multiselect-anchor",
177
+ children: [/* @__PURE__ */ c("div", {
178
+ className: "ds-input-shell",
179
+ onMouseDown: de,
180
+ children: [
181
+ Y > 0 && /* @__PURE__ */ c("div", {
182
+ className: "ds-multiselect-values",
183
+ "aria-hidden": "true",
184
+ children: [J === "all" && S ? le(S, "todos") : fe.slice(0, C).map((e) => /* @__PURE__ */ s("span", { children: le(e.label, e.status, e.color) }, e.value)), !(J === "all" && S) && pe > 0 && /* @__PURE__ */ c("span", {
185
+ className: "ds-multiselect-more",
186
+ children: ["+", pe]
187
+ })]
188
+ }),
189
+ /* @__PURE__ */ s("input", {
190
+ ref: G,
191
+ id: F,
192
+ className: "ds-multiselect-input",
193
+ type: "text",
194
+ role: "combobox",
195
+ autoComplete: "off",
196
+ "aria-expanded": H,
197
+ "aria-controls": I,
198
+ "aria-autocomplete": "list",
199
+ "aria-activedescendant": H && q >= 0 ? ee(q) : void 0,
200
+ "aria-label": f ? void 0 : m,
201
+ "aria-invalid": D || void 0,
202
+ "aria-required": k || void 0,
203
+ "aria-describedby": se ? R : void 0,
204
+ placeholder: H ? x : Y ? "" : b,
205
+ value: U,
206
+ disabled: O,
207
+ onChange: (e) => {
208
+ ne(e.target.value), te(!0), W(0);
209
+ },
210
+ onClick: () => {
211
+ H || Z(0);
212
+ },
213
+ onKeyDown: ue
214
+ }),
215
+ /* @__PURE__ */ s("button", {
216
+ type: "button",
217
+ className: "ds-multiselect-caret",
218
+ tabIndex: -1,
219
+ "aria-hidden": "true",
220
+ disabled: O,
221
+ children: /* @__PURE__ */ s("svg", {
222
+ width: "16",
223
+ height: "16",
224
+ viewBox: "0 0 16 16",
225
+ fill: "none",
226
+ stroke: "currentColor",
227
+ strokeWidth: "1.8",
228
+ strokeLinecap: "round",
229
+ strokeLinejoin: "round",
230
+ children: /* @__PURE__ */ s("path", { d: "m4 6 4 4 4-4" })
231
+ })
232
+ })
233
+ ]
234
+ }), H && /* @__PURE__ */ c("ul", {
235
+ id: I,
236
+ className: "ds-multiselect-list",
237
+ role: "listbox",
238
+ "aria-multiselectable": "true",
239
+ "aria-labelledby": f ? L : void 0,
240
+ "aria-label": f ? void 0 : m,
241
+ children: [K.map((e, t) => {
242
+ let n = e === y, r = !n && !!e.disabled, i = n ? J === "all" : V.includes(e.value);
243
+ return /* @__PURE__ */ c("li", {
244
+ id: ee(t),
245
+ role: "option",
246
+ className: "ds-multiselect-option",
247
+ "aria-selected": i,
248
+ "aria-disabled": r || void 0,
249
+ "data-active": t === q,
250
+ "data-indeterminate": n && J === "some",
251
+ onMouseDown: (e) => e.preventDefault(),
252
+ onMouseMove: () => {
253
+ t !== q && W(t);
254
+ },
255
+ onClick: () => {
256
+ r || (Q(e), W(t));
257
+ },
258
+ children: [
259
+ /* @__PURE__ */ s("span", {
260
+ className: "ds-multiselect-check",
261
+ "aria-hidden": "true"
262
+ }),
263
+ n ? le(S, "todos") : le(e.label, e.status, e.color),
264
+ !n && e.description != null && /* @__PURE__ */ s("span", {
265
+ className: "ds-multiselect-option-label",
266
+ children: e.description
267
+ })
268
+ ]
269
+ }, n ? "__all__" : e.value);
270
+ }), K.length === 0 && /* @__PURE__ */ s("li", {
271
+ className: "ds-multiselect-empty",
272
+ role: "presentation",
273
+ children: E
274
+ })]
275
+ })]
276
+ }),
277
+ se && /* @__PURE__ */ s("small", {
278
+ id: R,
279
+ "aria-live": "polite",
280
+ children: se
281
+ }),
282
+ A && V.map((e) => /* @__PURE__ */ s("input", {
283
+ type: "hidden",
284
+ name: A,
285
+ value: e
286
+ }, e))
287
+ ]
288
+ });
289
+ }
290
+ //#endregion
291
+ //#region src/wari/WariStatusSelect.tsx
292
+ function x({ statuses: e, descriptions: t, onChange: n, label: r = "Estado", ...i }) {
293
+ let a = l.filter((t) => !e || e.includes(t.value)).map((e) => ({
294
+ value: e.value,
295
+ label: e.label,
296
+ status: e.value,
297
+ description: t?.[e.value]
298
+ }));
299
+ return /* @__PURE__ */ s(b, {
300
+ ...i,
301
+ label: r,
302
+ options: a,
303
+ onChange: (e) => n?.(e)
304
+ });
305
+ }
306
+ //#endregion
307
+ //#region src/wari/datetime.ts
308
+ var S = (e, t = 2) => String(e).padStart(t, "0");
309
+ function C(e, t, n) {
310
+ return `${S(e, 4)}-${S(t + 1)}-${S(n)}`;
311
+ }
312
+ function w(e) {
313
+ let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e ?? "");
314
+ if (!t) return null;
315
+ let n = Number(t[1]), r = Number(t[2]) - 1, i = Number(t[3]), a = new Date(n, r, i);
316
+ return a.getFullYear() === n && a.getMonth() === r && a.getDate() === i ? {
317
+ year: n,
318
+ month: r,
319
+ day: i
320
+ } : null;
321
+ }
322
+ function T(e = /* @__PURE__ */ new Date()) {
323
+ return C(e.getFullYear(), e.getMonth(), e.getDate());
324
+ }
325
+ function E(e) {
326
+ let t = w(e);
327
+ return t ? `${S(t.day)}/${S(t.month + 1)}/${S(t.year % 100)}` : "";
328
+ }
329
+ function D(e) {
330
+ let t = /^\s*(\d{1,2})[/.-](\d{1,2})[/.-](\d{2}|\d{4})\s*$/.exec(e);
331
+ if (!t) return null;
332
+ let n = C(t[3].length === 2 ? 2e3 + Number(t[3]) : Number(t[3]), Number(t[2]) - 1, Number(t[1]));
333
+ return w(n) ? n : null;
334
+ }
335
+ function O(e, t, n) {
336
+ return (!t || e >= t) && (!n || e <= n);
337
+ }
338
+ function k(e, t, n) {
339
+ let r = new Date(e, t + n, 1);
340
+ return {
341
+ year: r.getFullYear(),
342
+ month: r.getMonth()
343
+ };
344
+ }
345
+ function A(e, t, n = 0) {
346
+ let r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = [];
347
+ for (let n = 0; n < 6; n++) {
348
+ let a = [];
349
+ for (let i = 0; i < 7; i++) {
350
+ let o = new Date(e, t, 1 - r + n * 7 + i);
351
+ a.push({
352
+ iso: C(o.getFullYear(), o.getMonth(), o.getDate()),
353
+ day: o.getDate(),
354
+ outside: o.getMonth() !== t
355
+ });
356
+ }
357
+ i.push(a);
358
+ }
359
+ return i;
360
+ }
361
+ function j(e, t) {
362
+ let n = w(e);
363
+ if (!n) return e;
364
+ let r = new Date(n.year, n.month, n.day + t);
365
+ return C(r.getFullYear(), r.getMonth(), r.getDate());
366
+ }
367
+ function M(e, t) {
368
+ let n = w(e);
369
+ if (!n) return e;
370
+ let r = k(n.year, n.month, t), i = new Date(r.year, r.month + 1, 0).getDate();
371
+ return C(r.year, r.month, Math.min(n.day, i));
372
+ }
373
+ function N(e = "es", t = "long") {
374
+ let n = new Intl.DateTimeFormat(e, {
375
+ month: t,
376
+ timeZone: "UTC"
377
+ });
378
+ return Array.from({ length: 12 }, (e, t) => n.format(new Date(Date.UTC(2024, t, 1))).replace(".", ""));
379
+ }
380
+ function P(e = "es", t = 0, n = "narrow") {
381
+ let r = new Intl.DateTimeFormat(e, {
382
+ weekday: n,
383
+ timeZone: "UTC"
384
+ });
385
+ return Array.from({ length: 7 }, (e, n) => r.format(new Date(Date.UTC(2024, 0, 7 + (n + t) % 7))));
386
+ }
387
+ function F(e, t = "es") {
388
+ let n = w(e);
389
+ return n ? new Intl.DateTimeFormat(t, {
390
+ weekday: "long",
391
+ day: "numeric",
392
+ month: "long",
393
+ year: "numeric",
394
+ timeZone: "UTC"
395
+ }).format(new Date(Date.UTC(n.year, n.month, n.day))) : "";
396
+ }
397
+ function I(e) {
398
+ let t = /^(\d{1,2}):(\d{2})$/.exec(e ?? "");
399
+ if (!t) return null;
400
+ let n = Number(t[1]), r = Number(t[2]);
401
+ return n < 24 && r < 60 ? {
402
+ hours: n,
403
+ minutes: r
404
+ } : null;
405
+ }
406
+ function L(e, t) {
407
+ return `${S(e)}:${S(t)}`;
408
+ }
409
+ function R(e) {
410
+ return {
411
+ hour: e % 12 == 0 ? 12 : e % 12,
412
+ period: e < 12 ? "AM" : "PM"
413
+ };
414
+ }
415
+ function ee(e, t) {
416
+ return e % 12 + (t === "PM" ? 12 : 0);
417
+ }
418
+ function z(e) {
419
+ let t = I(e);
420
+ if (!t) return "";
421
+ let { hour: n, period: r } = R(t.hours);
422
+ return `${S(n)}:${S(t.minutes)} ${r}`;
423
+ }
424
+ function B(e) {
425
+ let t = /^\s*(\d{1,2})(?::?(\d{2}))?\s*([ap])?\.?\s*m?\.?\s*$/i.exec(e);
426
+ if (!t) return null;
427
+ let n = Number(t[1]), r = t[2] ? Number(t[2]) : 0, i = t[3]?.toLowerCase();
428
+ if (r > 59) return null;
429
+ if (i) {
430
+ if (n < 1 || n > 12) return null;
431
+ n = ee(n, i === "p" ? "PM" : "AM");
432
+ } else if (n > 23) return null;
433
+ return L(n, r);
434
+ }
435
+ function V(e, t, n, r) {
436
+ let i = e % t / t * Math.PI * 2;
437
+ return {
438
+ x: r + n * Math.sin(i),
439
+ y: r - n * Math.cos(i)
440
+ };
441
+ }
442
+ function H(e, t, n, r) {
443
+ let i = (Math.atan2(e - n, n - t) * 180 / Math.PI + 360) % 360;
444
+ if (r === "hour") {
445
+ let e = Math.round(i / 30) % 12;
446
+ return e === 0 ? 12 : e;
447
+ }
448
+ return Math.round(i / 6) % 60;
449
+ }
450
+ var te = (e) => S(e), U = {
451
+ width: 20,
452
+ height: 20,
453
+ viewBox: "0 0 24 24",
454
+ fill: "none",
455
+ stroke: "currentColor",
456
+ strokeWidth: 1.8,
457
+ strokeLinecap: "round",
458
+ strokeLinejoin: "round",
459
+ "aria-hidden": !0
460
+ }, ne = () => /* @__PURE__ */ c("svg", {
461
+ ...U,
462
+ children: [
463
+ /* @__PURE__ */ s("rect", {
464
+ x: "3.5",
465
+ y: "5",
466
+ width: "17",
467
+ height: "15.5",
468
+ rx: "2.5"
469
+ }),
470
+ /* @__PURE__ */ s("path", { d: "M3.5 9.5h17M8 3v4M16 3v4" }),
471
+ /* @__PURE__ */ s("rect", {
472
+ x: "11",
473
+ y: "13",
474
+ width: "2.4",
475
+ height: "2.4",
476
+ rx: ".6",
477
+ fill: "currentColor",
478
+ stroke: "none"
479
+ })
480
+ ]
481
+ }), re = ({ size: e = 20 }) => /* @__PURE__ */ c("svg", {
482
+ ...U,
483
+ width: e,
484
+ height: e,
485
+ children: [/* @__PURE__ */ s("circle", {
486
+ cx: "12",
487
+ cy: "12",
488
+ r: "8.5"
489
+ }), /* @__PURE__ */ s("path", { d: "M12 7.5V12l3 2" })]
490
+ }), W = () => /* @__PURE__ */ s("svg", {
491
+ ...U,
492
+ children: /* @__PURE__ */ s("path", { d: "m14.5 6-6 6 6 6" })
493
+ }), ie = () => /* @__PURE__ */ s("svg", {
494
+ ...U,
495
+ children: /* @__PURE__ */ s("path", { d: "m9.5 6 6 6-6 6" })
496
+ }), G = () => /* @__PURE__ */ s("svg", {
497
+ ...U,
498
+ width: 18,
499
+ height: 18,
500
+ children: /* @__PURE__ */ s("path", {
501
+ d: "m7 10 5 5 5-5",
502
+ fill: "currentColor",
503
+ stroke: "none"
504
+ })
505
+ }), ae = () => /* @__PURE__ */ s("svg", {
506
+ ...U,
507
+ width: 24,
508
+ height: 24,
509
+ children: /* @__PURE__ */ s("path", { d: "m5 12.5 4.5 4.5L19 7.5" })
510
+ }), K = () => /* @__PURE__ */ c("svg", {
511
+ ...U,
512
+ children: [/* @__PURE__ */ s("rect", {
513
+ x: "2.5",
514
+ y: "6",
515
+ width: "19",
516
+ height: "12",
517
+ rx: "2"
518
+ }), /* @__PURE__ */ s("path", { d: "M6 9.5h.01M9 9.5h.01M12 9.5h.01M15 9.5h.01M18 9.5h.01M7 14.5h10" })]
519
+ }), q = () => /* @__PURE__ */ s("svg", {
520
+ ...U,
521
+ width: 24,
522
+ height: 24,
523
+ children: /* @__PURE__ */ s("path", { d: "M6 4v8M6 16v4M12 4v2M12 10v10M18 4v10M18 18v2M4 14h4M10 8h4M16 16h4" })
524
+ }), J = () => /* @__PURE__ */ s("svg", {
525
+ ...U,
526
+ children: /* @__PURE__ */ s("path", { d: "m6 9.5 6 6 6-6" })
527
+ }), oe = () => /* @__PURE__ */ s("svg", {
528
+ ...U,
529
+ width: 16,
530
+ height: 16,
531
+ children: /* @__PURE__ */ s("path", { d: "M5 12h14" })
532
+ }), Y = () => /* @__PURE__ */ s("svg", {
533
+ ...U,
534
+ width: 16,
535
+ height: 16,
536
+ children: /* @__PURE__ */ s("path", { d: "M12 5v14M5 12h14" })
537
+ }), se = {
538
+ ...U,
539
+ width: 12,
540
+ height: 12,
541
+ strokeWidth: 2
542
+ }, X = () => /* @__PURE__ */ c("svg", {
543
+ ...se,
544
+ children: [/* @__PURE__ */ s("circle", {
545
+ cx: "12",
546
+ cy: "8",
547
+ r: "4",
548
+ fill: "currentColor",
549
+ stroke: "none"
550
+ }), /* @__PURE__ */ s("path", {
551
+ d: "M4.5 20.5c1-4 4-6 7.5-6s6.5 2 7.5 6",
552
+ fill: "currentColor",
553
+ stroke: "none"
554
+ })]
555
+ }), ce = () => /* @__PURE__ */ c("svg", {
556
+ ...se,
557
+ children: [/* @__PURE__ */ s("rect", {
558
+ x: "6",
559
+ y: "7",
560
+ width: "12",
561
+ height: "13",
562
+ rx: "2",
563
+ fill: "currentColor",
564
+ stroke: "none"
565
+ }), /* @__PURE__ */ s("path", { d: "M9.5 7V4.5h5V7M9 22v-2M15 22v-2" })]
566
+ }), Z = () => /* @__PURE__ */ c("svg", {
567
+ ...se,
568
+ children: [/* @__PURE__ */ s("rect", {
569
+ x: "2.5",
570
+ y: "8.5",
571
+ width: "19",
572
+ height: "11",
573
+ rx: "2",
574
+ fill: "currentColor",
575
+ stroke: "none"
576
+ }), /* @__PURE__ */ s("path", { d: "M9 8.5V6.5h6v2" })]
577
+ }), Q = () => /* @__PURE__ */ c("svg", {
578
+ ...U,
579
+ width: 24,
580
+ height: 24,
581
+ children: [
582
+ /* @__PURE__ */ s("rect", {
583
+ x: "3.5",
584
+ y: "3.5",
585
+ width: "17",
586
+ height: "17",
587
+ rx: "2.5"
588
+ }),
589
+ /* @__PURE__ */ s("circle", {
590
+ cx: "12",
591
+ cy: "10",
592
+ r: "3"
593
+ }),
594
+ /* @__PURE__ */ s("path", { d: "M6.5 20c.9-2.7 3-4 5.5-4s4.6 1.3 5.5 4" })
595
+ ]
596
+ }), le = () => /* @__PURE__ */ c("svg", {
597
+ ...U,
598
+ width: 24,
599
+ height: 24,
600
+ children: [/* @__PURE__ */ s("circle", {
601
+ cx: "10.5",
602
+ cy: "10.5",
603
+ r: "6.5"
604
+ }), /* @__PURE__ */ s("path", { d: "m20 20-4.8-4.8" })]
605
+ }), ue = () => /* @__PURE__ */ s("svg", {
606
+ ...U,
607
+ width: 16,
608
+ height: 16,
609
+ children: /* @__PURE__ */ s("path", { d: "M12 4v16M4 12h16" })
610
+ }), de = () => /* @__PURE__ */ s("svg", {
611
+ ...U,
612
+ width: 16,
613
+ height: 16,
614
+ children: /* @__PURE__ */ s("path", { d: "M5 3.5h3.2l1.6 4-2 1.3a10.5 10.5 0 0 0 5.4 5.4l1.3-2 4 1.6V17a2 2 0 0 1-2 2A15.5 15.5 0 0 1 3 5.5a2 2 0 0 1 2-2Z" })
615
+ }), $ = () => /* @__PURE__ */ c("svg", {
616
+ ...U,
617
+ width: 16,
618
+ height: 16,
619
+ children: [/* @__PURE__ */ s("circle", {
620
+ cx: "12",
621
+ cy: "12",
622
+ r: "9",
623
+ fill: "currentColor",
624
+ stroke: "none"
625
+ }), /* @__PURE__ */ s("path", {
626
+ d: "M12 11v5.5M12 7.6v.1",
627
+ stroke: "#fff",
628
+ strokeWidth: 2.4
629
+ })]
630
+ }), fe = () => /* @__PURE__ */ c("svg", {
631
+ ...U,
632
+ width: 16,
633
+ height: 16,
634
+ children: [/* @__PURE__ */ s("path", {
635
+ d: "M4 20h4.5L19 9.5 14.5 5 4 15.5z",
636
+ fill: "currentColor",
637
+ stroke: "none"
638
+ }), /* @__PURE__ */ s("path", { d: "M13 20h7" })]
639
+ }), pe = () => /* @__PURE__ */ s("svg", {
640
+ ...U,
641
+ width: 16,
642
+ height: 16,
643
+ children: /* @__PURE__ */ s("path", { d: "M4.5 6.5h15M9.5 6.5V4.5h5v2M6.5 6.5l1 13h9l1-13M10.5 10v6M13.5 10v6" })
644
+ }), me = () => /* @__PURE__ */ c("svg", {
645
+ ...U,
646
+ width: 24,
647
+ height: 24,
648
+ children: [/* @__PURE__ */ s("path", { d: "M6 5h9.5a3.5 3.5 0 0 1 0 7h-7a3.5 3.5 0 0 0 0 7H17" }), /* @__PURE__ */ s("circle", {
649
+ cx: "19",
650
+ cy: "19",
651
+ r: "2",
652
+ fill: "currentColor",
653
+ stroke: "none"
654
+ })]
655
+ }), he = () => /* @__PURE__ */ s("svg", {
656
+ ...U,
657
+ width: 16,
658
+ height: 16,
659
+ children: /* @__PURE__ */ s("path", { d: "M4 9a8 8 0 0 1 14-3l2 2M20 4v4h-4M20 15a8 8 0 0 1-14 3l-2-2M4 20v-4h4" })
660
+ }), ge = () => /* @__PURE__ */ s("svg", {
661
+ ...U,
662
+ width: 18,
663
+ height: 18,
664
+ children: /* @__PURE__ */ s("path", { d: "M5 7h14M5 12h14M5 17h14" })
665
+ }), _e = () => /* @__PURE__ */ s("svg", {
666
+ ...U,
667
+ width: 18,
668
+ height: 18,
669
+ children: /* @__PURE__ */ s("path", { d: "M6 6l12 12M18 6 6 18" })
670
+ }), ve = () => /* @__PURE__ */ s("svg", {
671
+ ...U,
672
+ width: 16,
673
+ height: 16,
674
+ strokeWidth: 2.4,
675
+ children: /* @__PURE__ */ s("circle", {
676
+ cx: "12",
677
+ cy: "12",
678
+ r: "7.5"
679
+ })
680
+ }), ye = () => /* @__PURE__ */ s("svg", {
681
+ ...U,
682
+ width: 16,
683
+ height: 16,
684
+ strokeWidth: 2.4,
685
+ children: /* @__PURE__ */ s("rect", {
686
+ x: "4.5",
687
+ y: "4.5",
688
+ width: "15",
689
+ height: "15",
690
+ rx: "1.5"
691
+ })
692
+ }), be = () => /* @__PURE__ */ c("svg", {
693
+ ...U,
694
+ width: 16,
695
+ height: 16,
696
+ children: [/* @__PURE__ */ s("circle", {
697
+ cx: "10",
698
+ cy: "8",
699
+ r: "3.5"
700
+ }), /* @__PURE__ */ s("path", { d: "M3.5 20c.8-3.5 3.3-5.5 6.5-5.5s5.7 2 6.5 5.5M18 8v6M15 11h6" })]
701
+ }), xe = () => /* @__PURE__ */ c("svg", {
702
+ ...U,
703
+ width: 16,
704
+ height: 16,
705
+ children: [/* @__PURE__ */ s("circle", {
706
+ cx: "12",
707
+ cy: "8",
708
+ r: "3.5"
709
+ }), /* @__PURE__ */ s("path", { d: "M5 20c.8-3.5 3.6-5.5 7-5.5s6.2 2 7 5.5" })]
710
+ }), Se = () => /* @__PURE__ */ c("svg", {
711
+ ...U,
712
+ width: 16,
713
+ height: 16,
714
+ children: [/* @__PURE__ */ s("circle", {
715
+ cx: "12",
716
+ cy: "12",
717
+ r: "9.5",
718
+ fill: "currentColor",
719
+ stroke: "none"
720
+ }), /* @__PURE__ */ s("path", {
721
+ d: "M12 7.5v9M7.5 12h9",
722
+ stroke: "#fff",
723
+ strokeWidth: 2.2
724
+ })]
725
+ }), Ce = () => /* @__PURE__ */ c("svg", {
726
+ ...U,
727
+ width: 16,
728
+ height: 16,
729
+ children: [/* @__PURE__ */ s("circle", {
730
+ cx: "12",
731
+ cy: "12",
732
+ r: "9.5",
733
+ fill: "currentColor",
734
+ stroke: "none"
735
+ }), /* @__PURE__ */ s("path", {
736
+ d: "m9 9 6 6M15 9l-6 6",
737
+ stroke: "#fff",
738
+ strokeWidth: 2
739
+ })]
740
+ }), we = () => /* @__PURE__ */ c("svg", {
741
+ ...U,
742
+ width: 16,
743
+ height: 16,
744
+ children: [/* @__PURE__ */ s("path", { d: "M5 3.5h3.2l1.6 4-2 1.3a10.5 10.5 0 0 0 5.4 5.4l1.3-2 4 1.6V17a2 2 0 0 1-2 2A15.5 15.5 0 0 1 3 5.5a2 2 0 0 1 2-2Z" }), /* @__PURE__ */ s("path", { d: "M15 4h5M15 7h5M17 10h3" })]
745
+ });
746
+ //#endregion
747
+ //#region src/wari/WariDateField.tsx
748
+ function Te({ label: n, value: r, defaultValue: o = "", onChange: l, min: u, max: d, placeholder: f = "dd/mm/aa", supportingText: p, error: m = !1, required: h, disabled: g = !1, name: _, id: v, locale: y = "es", weekStartsOn: b = 0, cancelLabel: x = "Cancelar", okLabel: S = "Aceptar", align: C = "start", className: I }) {
749
+ let L = t(), R = v ?? L, ee = `${R}-hint`, [z, B] = a(o), V = r ?? z, [H, te] = a(() => E(V)), [U, re] = a(!1), [K, q] = a(!1), [J, oe] = a("days"), [Y, se] = a(""), [X, ce] = a(""), [Z, Q] = a(() => {
750
+ let e = w(V) ?? w(T());
751
+ return {
752
+ year: e.year,
753
+ month: e.month
754
+ };
755
+ }), le = i(null), ue = i(null), de = i(null), $ = i(!1), fe = U ? H : E(V), pe = N(y, "long"), me = N(y, "short"), he = P(y, b), ge = P(y, b, "long"), _e = T(), ve = w(u)?.year ?? Z.year - 50, ye = w(d)?.year ?? Z.year + 50, be = (e) => {
756
+ r === void 0 && B(e), e !== V && l?.(e);
757
+ }, xe = (e) => u && e < u ? u : d && e > d ? d : e, Se = () => {
758
+ if (g) return;
759
+ let e = xe(w(V) ? V : _e), t = w(e);
760
+ se(w(V) ? V : ""), ce(e), Q({
761
+ year: t.year,
762
+ month: t.month
763
+ }), oe("days"), $.current = !0, q(!0);
764
+ }, Ce = (e = !0) => {
765
+ q(!1), e && ue.current?.focus();
766
+ };
767
+ e(() => {
768
+ if (!K) return;
769
+ let e = (e) => {
770
+ le.current?.contains(e.target) || q(!1);
771
+ };
772
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
773
+ }, [K]), e(() => {
774
+ if (!K || !$.current) return;
775
+ $.current = !1;
776
+ let e = J === "days" ? de.current?.querySelector(`[data-iso="${X}"]`) : de.current?.querySelector(".ds-wpicker-option[tabindex=\"0\"]");
777
+ e?.focus(), J !== "days" && e?.scrollIntoView?.({ block: "center" });
778
+ });
779
+ let we = (e) => {
780
+ let t = xe(e), n = w(t);
781
+ ce(t), (n.year !== Z.year || n.month !== Z.month) && Q({
782
+ year: n.year,
783
+ month: n.month
784
+ }), $.current = !0;
785
+ }, Te = (e) => {
786
+ let t = {
787
+ ArrowLeft: () => j(X, -1),
788
+ ArrowRight: () => j(X, 1),
789
+ ArrowUp: () => j(X, -7),
790
+ ArrowDown: () => j(X, 7),
791
+ PageUp: () => M(X, e.shiftKey ? -12 : -1),
792
+ PageDown: () => M(X, e.shiftKey ? 12 : 1),
793
+ Home: () => j(X, -(((/* @__PURE__ */ new Date(`${X}T00:00`)).getDay() - b + 7) % 7)),
794
+ End: () => j(X, 6 - ((/* @__PURE__ */ new Date(`${X}T00:00`)).getDay() - b + 7) % 7)
795
+ };
796
+ t[e.key] && (e.preventDefault(), we(t[e.key]()));
797
+ }, Ee = (e) => {
798
+ let t = [...e.currentTarget.querySelectorAll(".ds-wpicker-option")], n = t.indexOf(document.activeElement), r = {
799
+ ArrowDown: n + 1,
800
+ ArrowUp: n - 1,
801
+ Home: 0,
802
+ End: t.length - 1
803
+ }[e.key];
804
+ r !== void 0 && (e.preventDefault(), t[Math.max(0, Math.min(r, t.length - 1))]?.focus());
805
+ }, De = (e) => {
806
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), J === "days" ? Ce() : (oe("days"), $.current = !0));
807
+ }, Oe = () => {
808
+ if (re(!1), !H.trim()) {
809
+ be("");
810
+ return;
811
+ }
812
+ let e = D(H);
813
+ e && O(e, u, d) && be(e);
814
+ }, ke = (e) => {
815
+ let t = e.relatedTarget;
816
+ K && t && !le.current?.contains(t) && q(!1);
817
+ }, Ae = (e) => {
818
+ Q(e);
819
+ let t = w(X)?.day ?? 1, n = new Date(e.year, e.month + 1, 0).getDate();
820
+ ce(xe(`${String(e.year).padStart(4, "0")}-${String(e.month + 1).padStart(2, "0")}-${String(Math.min(t, n)).padStart(2, "0")}`)), oe("days"), $.current = !0;
821
+ }, je = k(Z.year, Z.month, -1), Me = k(Z.year, Z.month, 1), Ne = !!u && `${je.year}-${String(je.month + 1).padStart(2, "0")}-31` < u, Pe = !!d && `${Me.year}-${String(Me.month + 1).padStart(2, "0")}-01` > d, Fe = Array.from({ length: ye - ve + 1 }, (e, t) => ve + t);
822
+ return /* @__PURE__ */ c("div", {
823
+ ref: le,
824
+ className: [
825
+ "ds-input",
826
+ "ds-wfield",
827
+ I
828
+ ].filter(Boolean).join(" "),
829
+ "data-open": K,
830
+ "data-error": m,
831
+ "data-disabled": g,
832
+ "data-align": C,
833
+ onBlur: ke,
834
+ children: [
835
+ n && /* @__PURE__ */ c("label", {
836
+ htmlFor: R,
837
+ children: [n, h && /* @__PURE__ */ s("span", {
838
+ className: "ds-input-required",
839
+ "aria-hidden": "true",
840
+ children: "*"
841
+ })]
842
+ }),
843
+ /* @__PURE__ */ c("div", {
844
+ className: "ds-wfield-anchor",
845
+ children: [/* @__PURE__ */ c("div", {
846
+ className: "ds-input-shell",
847
+ children: [/* @__PURE__ */ s("input", {
848
+ id: R,
849
+ type: "text",
850
+ inputMode: "numeric",
851
+ autoComplete: "off",
852
+ placeholder: f,
853
+ value: fe,
854
+ disabled: g,
855
+ required: h,
856
+ "aria-invalid": m || void 0,
857
+ "aria-describedby": p ? ee : void 0,
858
+ onChange: (e) => {
859
+ re(!0), te(e.target.value);
860
+ },
861
+ onFocus: () => {
862
+ re(!0), te(E(V));
863
+ },
864
+ onBlur: Oe,
865
+ onKeyDown: (e) => {
866
+ e.key === "Enter" && (e.preventDefault(), Oe()), e.key === "ArrowDown" && (e.altKey || !K) && (e.preventDefault(), Oe(), Se());
867
+ }
868
+ }), /* @__PURE__ */ s("button", {
869
+ ref: ue,
870
+ type: "button",
871
+ className: "ds-wfield-trigger",
872
+ disabled: g,
873
+ "aria-label": `Elegir fecha${V ? `, ${F(V, y)}` : ""}`,
874
+ "aria-haspopup": "dialog",
875
+ "aria-expanded": K,
876
+ onClick: () => K ? Ce() : Se(),
877
+ children: /* @__PURE__ */ s(ne, {})
878
+ })]
879
+ }), K && /* @__PURE__ */ c("div", {
880
+ ref: de,
881
+ className: "ds-wpicker",
882
+ "data-kind": "date",
883
+ "data-view": J,
884
+ role: "dialog",
885
+ "aria-label": "Elegir fecha",
886
+ onKeyDown: De,
887
+ children: [
888
+ /* @__PURE__ */ c("div", {
889
+ className: "ds-wpicker-head",
890
+ children: [/* @__PURE__ */ c("div", {
891
+ className: "ds-wpicker-nav",
892
+ "data-part": "month",
893
+ children: [
894
+ /* @__PURE__ */ s("button", {
895
+ type: "button",
896
+ className: "ds-wpicker-icon",
897
+ "aria-label": "Mes anterior",
898
+ disabled: Ne || J !== "days",
899
+ onClick: () => Q(je),
900
+ children: /* @__PURE__ */ s(W, {})
901
+ }),
902
+ /* @__PURE__ */ c("button", {
903
+ type: "button",
904
+ className: "ds-wpicker-menu",
905
+ "aria-haspopup": "listbox",
906
+ "aria-expanded": J === "months",
907
+ "aria-label": `Elegir mes, ${pe[Z.month]}`,
908
+ onClick: () => {
909
+ oe(J === "months" ? "days" : "months"), $.current = !0;
910
+ },
911
+ children: [me[Z.month], /* @__PURE__ */ s(G, {})]
912
+ }),
913
+ /* @__PURE__ */ s("button", {
914
+ type: "button",
915
+ className: "ds-wpicker-icon",
916
+ "aria-label": "Mes siguiente",
917
+ disabled: Pe || J !== "days",
918
+ onClick: () => Q(Me),
919
+ children: /* @__PURE__ */ s(ie, {})
920
+ })
921
+ ]
922
+ }), /* @__PURE__ */ c("div", {
923
+ className: "ds-wpicker-nav",
924
+ "data-part": "year",
925
+ children: [
926
+ /* @__PURE__ */ s("button", {
927
+ type: "button",
928
+ className: "ds-wpicker-icon",
929
+ "aria-label": "Año anterior",
930
+ disabled: Z.year - 1 < ve || J !== "days",
931
+ onClick: () => Q({
932
+ ...Z,
933
+ year: Z.year - 1
934
+ }),
935
+ children: /* @__PURE__ */ s(W, {})
936
+ }),
937
+ /* @__PURE__ */ c("button", {
938
+ type: "button",
939
+ className: "ds-wpicker-menu",
940
+ "aria-haspopup": "listbox",
941
+ "aria-expanded": J === "years",
942
+ "aria-label": `Elegir año, ${Z.year}`,
943
+ onClick: () => {
944
+ oe(J === "years" ? "days" : "years"), $.current = !0;
945
+ },
946
+ children: [Z.year, /* @__PURE__ */ s(G, {})]
947
+ }),
948
+ /* @__PURE__ */ s("button", {
949
+ type: "button",
950
+ className: "ds-wpicker-icon",
951
+ "aria-label": "Año siguiente",
952
+ disabled: Z.year + 1 > ye || J !== "days",
953
+ onClick: () => Q({
954
+ ...Z,
955
+ year: Z.year + 1
956
+ }),
957
+ children: /* @__PURE__ */ s(ie, {})
958
+ })
959
+ ]
960
+ })]
961
+ }),
962
+ J === "days" && /* @__PURE__ */ c("table", {
963
+ className: "ds-wpicker-grid",
964
+ role: "grid",
965
+ "aria-label": `${pe[Z.month]} ${Z.year}`,
966
+ onKeyDown: Te,
967
+ children: [/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: he.map((e, t) => /* @__PURE__ */ s("th", {
968
+ scope: "col",
969
+ abbr: ge[t],
970
+ children: e
971
+ }, t)) }) }), /* @__PURE__ */ s("tbody", { children: A(Z.year, Z.month, b).map((e, t) => /* @__PURE__ */ s("tr", { children: e.map((e) => {
972
+ let t = !O(e.iso, u, d);
973
+ return /* @__PURE__ */ s("td", { children: /* @__PURE__ */ s("button", {
974
+ type: "button",
975
+ className: "ds-wpicker-day",
976
+ "data-iso": e.iso,
977
+ "data-outside": e.outside,
978
+ "data-today": e.iso === _e,
979
+ "aria-selected": e.iso === Y,
980
+ "aria-disabled": t || void 0,
981
+ "aria-label": F(e.iso, y),
982
+ tabIndex: e.iso === X ? 0 : -1,
983
+ onClick: () => {
984
+ t || (se(e.iso), we(e.iso));
985
+ },
986
+ children: e.day
987
+ }) }, e.iso);
988
+ }) }, t)) })]
989
+ }),
990
+ J === "months" && /* @__PURE__ */ s("div", {
991
+ className: "ds-wpicker-list",
992
+ role: "listbox",
993
+ "aria-label": "Meses",
994
+ onKeyDown: Ee,
995
+ children: pe.map((e, t) => /* @__PURE__ */ c("button", {
996
+ type: "button",
997
+ role: "option",
998
+ className: "ds-wpicker-option",
999
+ "aria-selected": t === Z.month,
1000
+ tabIndex: t === Z.month ? 0 : -1,
1001
+ onClick: () => Ae({
1002
+ year: Z.year,
1003
+ month: t
1004
+ }),
1005
+ children: [/* @__PURE__ */ s(ae, {}), e]
1006
+ }, e))
1007
+ }),
1008
+ J === "years" && /* @__PURE__ */ s("div", {
1009
+ className: "ds-wpicker-list",
1010
+ role: "listbox",
1011
+ "aria-label": "Años",
1012
+ onKeyDown: Ee,
1013
+ children: Fe.map((e) => /* @__PURE__ */ c("button", {
1014
+ type: "button",
1015
+ role: "option",
1016
+ className: "ds-wpicker-option",
1017
+ "aria-selected": e === Z.year,
1018
+ tabIndex: e === Z.year ? 0 : -1,
1019
+ onClick: () => Ae({
1020
+ year: e,
1021
+ month: Z.month
1022
+ }),
1023
+ children: [/* @__PURE__ */ s(ae, {}), e]
1024
+ }, e))
1025
+ }),
1026
+ /* @__PURE__ */ c("div", {
1027
+ className: "ds-wpicker-actions",
1028
+ children: [/* @__PURE__ */ s("button", {
1029
+ type: "button",
1030
+ className: "ds-wpicker-action",
1031
+ onClick: () => Ce(),
1032
+ children: x
1033
+ }), /* @__PURE__ */ s("button", {
1034
+ type: "button",
1035
+ className: "ds-wpicker-action",
1036
+ onClick: () => {
1037
+ Y && be(Y), Ce();
1038
+ },
1039
+ children: S
1040
+ })]
1041
+ })
1042
+ ]
1043
+ })]
1044
+ }),
1045
+ p && /* @__PURE__ */ s("small", {
1046
+ id: ee,
1047
+ children: p
1048
+ }),
1049
+ _ && /* @__PURE__ */ s("input", {
1050
+ type: "hidden",
1051
+ name: _,
1052
+ value: V
1053
+ })
1054
+ ]
1055
+ });
1056
+ }
1057
+ //#endregion
1058
+ //#region src/wari/WariTimeField.tsx
1059
+ var Ee = 256, De = Ee / 2, Oe = 100, ke = [
1060
+ 12,
1061
+ 1,
1062
+ 2,
1063
+ 3,
1064
+ 4,
1065
+ 5,
1066
+ 6,
1067
+ 7,
1068
+ 8,
1069
+ 9,
1070
+ 10,
1071
+ 11
1072
+ ], Ae = [
1073
+ 0,
1074
+ 5,
1075
+ 10,
1076
+ 15,
1077
+ 20,
1078
+ 25,
1079
+ 30,
1080
+ 35,
1081
+ 40,
1082
+ 45,
1083
+ 50,
1084
+ 55
1085
+ ];
1086
+ function je({ label: n, value: r, defaultValue: o = "", onChange: l, placeholder: u = "hh:mm", supportingText: d, error: f = !1, required: p, disabled: m = !1, name: h, id: g, title: _ = "Selecciona la hora", cancelLabel: v = "Cancelar", okLabel: y = "Aceptar", align: b = "start", className: x }) {
1087
+ let S = t(), C = g ?? S, w = `${C}-hint`, [T, E] = a(o), D = r ?? T, [O, k] = a(""), [A, j] = a(!1), [M, N] = a(!1), [P, F] = a(12), [U, ne] = a(0), [W, ie] = a("AM"), [G, ae] = a("hour"), [q, J] = a("dial"), oe = i(null), Y = i(null), se = i(null), X = i(null), ce = i(!1), Z = A ? O : z(D), Q = (e) => {
1088
+ r === void 0 && E(e), e !== D && l?.(e);
1089
+ }, le = () => {
1090
+ if (m) return;
1091
+ let e = I(D) ?? {
1092
+ hours: 12,
1093
+ minutes: 0
1094
+ }, t = R(e.hours);
1095
+ F(t.hour), ne(e.minutes), ie(t.period), ae("hour"), N(!0);
1096
+ }, ue = (e = !0) => {
1097
+ N(!1), e && Y.current?.focus();
1098
+ }, de = () => {
1099
+ Q(L(ee(P, W), U)), ue();
1100
+ };
1101
+ e(() => {
1102
+ if (!M) return;
1103
+ se.current?.focus(), se.current?.select();
1104
+ let e = (e) => {
1105
+ oe.current?.contains(e.target) || N(!1);
1106
+ };
1107
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1108
+ }, [M]);
1109
+ let $ = () => {
1110
+ if (j(!1), !O.trim()) {
1111
+ Q("");
1112
+ return;
1113
+ }
1114
+ let e = B(O);
1115
+ e && Q(e);
1116
+ }, fe = (e) => {
1117
+ let t = e.currentTarget.getBoundingClientRect(), n = Ee / t.width, r = H((e.clientX - t.left) * n, (e.clientY - t.top) * n, De, G);
1118
+ G === "hour" ? F(r) : ne(r);
1119
+ }, pe = (e, t) => {
1120
+ let n = e.key === "ArrowUp" ? 1 : e.key === "ArrowDown" ? -1 : 0;
1121
+ n && (e.preventDefault(), t === "hour" ? F((e) => (e - 1 + n + 12) % 12 + 1) : ne((e) => (e + n + 60) % 60)), e.key === "Enter" && (e.preventDefault(), de());
1122
+ }, me = (e, t) => {
1123
+ let n = e.replace(/\D/g, "").slice(-2);
1124
+ if (!n) return;
1125
+ let r = Number(n);
1126
+ t === "hour" ? (r >= 1 && r <= 12 ? F(r) : r > 12 && Number(n.slice(-1)) >= 1 && F(Number(n.slice(-1))), (n.length === 2 || r > 1) && (ae("minute"), X.current?.focus(), X.current?.select())) : ne(r <= 59 ? r : Number(n.slice(-1)));
1127
+ }, he = (e) => {
1128
+ let t = e.relatedTarget;
1129
+ M && t && !oe.current?.contains(t) && N(!1);
1130
+ }, ge = G === "hour" ? P : U, _e = G === "hour" ? P % 12 * 30 : U * 6, ve = G === "hour" ? ke : Ae;
1131
+ return /* @__PURE__ */ c("div", {
1132
+ ref: oe,
1133
+ className: [
1134
+ "ds-input",
1135
+ "ds-wfield",
1136
+ x
1137
+ ].filter(Boolean).join(" "),
1138
+ "data-open": M,
1139
+ "data-error": f,
1140
+ "data-disabled": m,
1141
+ "data-align": b,
1142
+ onBlur: he,
1143
+ children: [
1144
+ n && /* @__PURE__ */ c("label", {
1145
+ htmlFor: C,
1146
+ children: [n, p && /* @__PURE__ */ s("span", {
1147
+ className: "ds-input-required",
1148
+ "aria-hidden": "true",
1149
+ children: "*"
1150
+ })]
1151
+ }),
1152
+ /* @__PURE__ */ c("div", {
1153
+ className: "ds-wfield-anchor",
1154
+ children: [/* @__PURE__ */ c("div", {
1155
+ className: "ds-input-shell",
1156
+ children: [/* @__PURE__ */ s("input", {
1157
+ id: C,
1158
+ type: "text",
1159
+ autoComplete: "off",
1160
+ placeholder: u,
1161
+ value: Z,
1162
+ disabled: m,
1163
+ required: p,
1164
+ "aria-invalid": f || void 0,
1165
+ "aria-describedby": d ? w : void 0,
1166
+ onChange: (e) => {
1167
+ j(!0), k(e.target.value);
1168
+ },
1169
+ onFocus: () => {
1170
+ j(!0), k(z(D));
1171
+ },
1172
+ onBlur: $,
1173
+ onKeyDown: (e) => {
1174
+ e.key === "Enter" && (e.preventDefault(), $()), e.key === "ArrowDown" && (e.altKey || !M) && (e.preventDefault(), $(), le());
1175
+ }
1176
+ }), /* @__PURE__ */ s("button", {
1177
+ ref: Y,
1178
+ type: "button",
1179
+ className: "ds-wfield-trigger",
1180
+ disabled: m,
1181
+ "aria-label": `Elegir hora${D ? `, ${z(D)}` : ""}`,
1182
+ "aria-haspopup": "dialog",
1183
+ "aria-expanded": M,
1184
+ onClick: () => M ? ue() : le(),
1185
+ children: /* @__PURE__ */ s(re, {})
1186
+ })]
1187
+ }), M && /* @__PURE__ */ c("div", {
1188
+ className: "ds-wpicker",
1189
+ "data-kind": "time",
1190
+ "data-input": q,
1191
+ role: "dialog",
1192
+ "aria-label": _,
1193
+ onKeyDown: (e) => {
1194
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), ue());
1195
+ },
1196
+ children: [
1197
+ /* @__PURE__ */ s("div", {
1198
+ className: "ds-wpicker-title",
1199
+ children: _
1200
+ }),
1201
+ /* @__PURE__ */ c("div", {
1202
+ className: "ds-wtime-body",
1203
+ children: [/* @__PURE__ */ c("div", {
1204
+ className: "ds-wtime-inputs",
1205
+ children: [/* @__PURE__ */ c("div", {
1206
+ className: "ds-wtime-fields",
1207
+ children: [
1208
+ /* @__PURE__ */ s("input", {
1209
+ ref: se,
1210
+ className: "ds-wtime-box",
1211
+ inputMode: "numeric",
1212
+ "aria-label": "Hora",
1213
+ "data-active": G === "hour",
1214
+ value: te(P),
1215
+ onFocus: (e) => {
1216
+ ae("hour"), e.currentTarget.select();
1217
+ },
1218
+ onChange: (e) => me(e.target.value, "hour"),
1219
+ onKeyDown: (e) => pe(e, "hour")
1220
+ }),
1221
+ /* @__PURE__ */ s("span", {
1222
+ className: "ds-wtime-sep",
1223
+ "aria-hidden": "true",
1224
+ children: ":"
1225
+ }),
1226
+ /* @__PURE__ */ s("input", {
1227
+ ref: X,
1228
+ className: "ds-wtime-box",
1229
+ inputMode: "numeric",
1230
+ "aria-label": "Minutos",
1231
+ "data-active": G === "minute",
1232
+ value: te(U),
1233
+ onFocus: (e) => {
1234
+ ae("minute"), e.currentTarget.select();
1235
+ },
1236
+ onChange: (e) => me(e.target.value, "minute"),
1237
+ onKeyDown: (e) => pe(e, "minute")
1238
+ })
1239
+ ]
1240
+ }), /* @__PURE__ */ s("div", {
1241
+ className: "ds-wtime-period",
1242
+ role: "group",
1243
+ "aria-label": "AM o PM",
1244
+ children: ["AM", "PM"].map((e) => /* @__PURE__ */ s("button", {
1245
+ type: "button",
1246
+ "aria-pressed": W === e,
1247
+ onClick: () => ie(e),
1248
+ children: e
1249
+ }, e))
1250
+ })]
1251
+ }), /* @__PURE__ */ c("div", {
1252
+ className: "ds-wtime-dial",
1253
+ "aria-hidden": "true",
1254
+ onPointerDown: (e) => {
1255
+ ce.current = !0, e.currentTarget.setPointerCapture?.(e.pointerId), e.preventDefault(), fe(e);
1256
+ },
1257
+ onPointerMove: (e) => {
1258
+ ce.current && fe(e);
1259
+ },
1260
+ onPointerUp: () => {
1261
+ ce.current = !1, G === "hour" && (ae("minute"), X.current?.focus());
1262
+ },
1263
+ children: [
1264
+ /* @__PURE__ */ s("span", {
1265
+ className: "ds-wtime-hand",
1266
+ style: {
1267
+ width: Oe,
1268
+ transform: `rotate(${_e - 90}deg)`
1269
+ }
1270
+ }),
1271
+ /* @__PURE__ */ s("span", { className: "ds-wtime-center" }),
1272
+ ve.map((e) => {
1273
+ let t = V(e, G === "hour" ? 12 : 60, Oe, De);
1274
+ return /* @__PURE__ */ s("span", {
1275
+ className: "ds-wtime-num",
1276
+ "data-selected": e === ge,
1277
+ style: {
1278
+ left: `${t.x / Ee * 100}%`,
1279
+ top: `${t.y / Ee * 100}%`
1280
+ },
1281
+ children: G === "hour" ? e : te(e)
1282
+ }, e);
1283
+ })
1284
+ ]
1285
+ })]
1286
+ }),
1287
+ /* @__PURE__ */ c("div", {
1288
+ className: "ds-wpicker-actions",
1289
+ children: [
1290
+ /* @__PURE__ */ s("button", {
1291
+ type: "button",
1292
+ className: "ds-wpicker-mode",
1293
+ "aria-label": q === "dial" ? "Escribir la hora" : "Usar el reloj",
1294
+ onClick: () => J(q === "dial" ? "keyboard" : "dial"),
1295
+ children: s(q === "dial" ? K : re, {})
1296
+ }),
1297
+ /* @__PURE__ */ s("span", { className: "ds-wpicker-actions-spacer" }),
1298
+ /* @__PURE__ */ s("button", {
1299
+ type: "button",
1300
+ className: "ds-wpicker-action",
1301
+ onClick: () => ue(),
1302
+ children: v
1303
+ }),
1304
+ /* @__PURE__ */ s("button", {
1305
+ type: "button",
1306
+ className: "ds-wpicker-action",
1307
+ onClick: de,
1308
+ children: y
1309
+ })
1310
+ ]
1311
+ })
1312
+ ]
1313
+ })]
1314
+ }),
1315
+ d && /* @__PURE__ */ s("small", {
1316
+ id: w,
1317
+ children: d
1318
+ }),
1319
+ h && /* @__PURE__ */ s("input", {
1320
+ type: "hidden",
1321
+ name: h,
1322
+ value: D
1323
+ })
1324
+ ]
1325
+ });
1326
+ }
1327
+ //#endregion
1328
+ //#region src/wari/WariSchedule.tsx
1329
+ function Me({ title: e = "Horario", headingLevel: n = 3, date: r, defaultDate: i, onDateChange: a, time: o, defaultTime: l, onTimeChange: u, dateLabel: d = "Fecha", timeLabel: f = "Hora de recojo", minDate: p, maxDate: m, dateName: h, timeName: g, required: _ = !0, disabled: v, dateError: y, timeError: b, dateSupportingText: x, timeSupportingText: S, locale: C, weekStartsOn: w, className: T }) {
1330
+ let E = t(), D = `h${n}`;
1331
+ return /* @__PURE__ */ c("section", {
1332
+ className: ["ds-wschedule", T].filter(Boolean).join(" "),
1333
+ "aria-labelledby": E,
1334
+ children: [/* @__PURE__ */ c("header", {
1335
+ className: "ds-wschedule-header",
1336
+ children: [/* @__PURE__ */ s(re, { size: 24 }), /* @__PURE__ */ s(D, {
1337
+ id: E,
1338
+ className: "ds-wschedule-title",
1339
+ children: e
1340
+ })]
1341
+ }), /* @__PURE__ */ c("div", {
1342
+ className: "ds-wschedule-fields",
1343
+ children: [/* @__PURE__ */ s(Te, {
1344
+ label: d,
1345
+ value: r,
1346
+ defaultValue: i,
1347
+ onChange: a,
1348
+ min: p,
1349
+ max: m,
1350
+ name: h,
1351
+ required: _,
1352
+ disabled: v,
1353
+ error: y,
1354
+ supportingText: x,
1355
+ locale: C,
1356
+ weekStartsOn: w
1357
+ }), /* @__PURE__ */ s(je, {
1358
+ label: f,
1359
+ value: o,
1360
+ defaultValue: l,
1361
+ onChange: u,
1362
+ name: g,
1363
+ required: _,
1364
+ disabled: v,
1365
+ error: b,
1366
+ supportingText: S,
1367
+ align: "end"
1368
+ })]
1369
+ })]
1370
+ });
1371
+ }
1372
+ //#endregion
1373
+ //#region src/wari/trip.ts
1374
+ var Ne = [
1375
+ {
1376
+ value: "lite",
1377
+ label: "Lite",
1378
+ passengers: 4,
1379
+ luggage: 1,
1380
+ hourlyPrice: 80
1381
+ },
1382
+ {
1383
+ value: "comfort",
1384
+ label: "Comfort",
1385
+ passengers: 4,
1386
+ luggage: 2,
1387
+ hourlyPrice: 90
1388
+ },
1389
+ {
1390
+ value: "comfort-xl",
1391
+ label: "Comfort XL",
1392
+ passengers: 4,
1393
+ luggage: 2,
1394
+ hourlyPrice: 90
1395
+ },
1396
+ {
1397
+ value: "xl",
1398
+ label: "XL",
1399
+ passengers: 4,
1400
+ luggage: 4,
1401
+ luggageAlt: 6,
1402
+ hourlyPrice: 90
1403
+ },
1404
+ {
1405
+ value: "van",
1406
+ label: "Van",
1407
+ passengers: 7,
1408
+ luggage: 6,
1409
+ luggageAlt: 10,
1410
+ hourlyPrice: 140
1411
+ }
1412
+ ], Pe = [
1413
+ {
1414
+ value: "carseat",
1415
+ label: "Carseat",
1416
+ maxQuantity: 2,
1417
+ choices: [
1418
+ {
1419
+ value: "0-2",
1420
+ label: "0-2 años"
1421
+ },
1422
+ {
1423
+ value: "3-5",
1424
+ label: "3-5 años"
1425
+ },
1426
+ {
1427
+ value: "6-10",
1428
+ label: "6-10 años"
1429
+ }
1430
+ ],
1431
+ note: "Solicítalo con al menos 2 horas de anticipación a la hora programada."
1432
+ },
1433
+ {
1434
+ value: "booster",
1435
+ label: "Booster",
1436
+ description: "Para niños de 4 hasta 12 años",
1437
+ maxQuantity: 2,
1438
+ note: "Solicítalo con al menos 2 horas de anticipación a la hora programada."
1439
+ },
1440
+ {
1441
+ value: "carga",
1442
+ label: "Carga",
1443
+ fields: [{
1444
+ name: "weight",
1445
+ label: "Peso aproximado",
1446
+ placeholder: "Peso aprox.",
1447
+ inputMode: "decimal",
1448
+ width: "96px"
1449
+ }, {
1450
+ name: "value",
1451
+ label: "Valor estimado en soles",
1452
+ placeholder: "S/Valor est.",
1453
+ inputMode: "decimal"
1454
+ }]
1455
+ }
1456
+ ], Fe = [
1457
+ {
1458
+ value: "efectivo",
1459
+ label: "Efectivo"
1460
+ },
1461
+ {
1462
+ value: "tarjeta",
1463
+ label: "Tarjeta"
1464
+ },
1465
+ {
1466
+ value: "vale",
1467
+ label: "Vale corporativo"
1468
+ }
1469
+ ], Ie = {
1470
+ service: "lite",
1471
+ hourly: !1,
1472
+ delivery: !1,
1473
+ extras: [],
1474
+ extraQuantities: {},
1475
+ extraChoices: {},
1476
+ extraFields: {},
1477
+ vehicles: 1,
1478
+ payment: "efectivo"
1479
+ }, Le = (e) => `S/${Number.isInteger(e) ? e : e.toFixed(2)}`;
1480
+ function Re(e, t) {
1481
+ let n = t.hourly && e.hourlyPrice != null ? `Desde ${Le(e.hourlyPrice)}` : null, r = !t.hourly && !t.delivery ? {
1482
+ passengers: e.passengers,
1483
+ luggage: e.luggage,
1484
+ luggageAlt: e.luggageAlt
1485
+ } : null, i = [];
1486
+ return t.delivery && i.push("envío"), n && i.push(n.toLowerCase()), r && (i.push(`${r.passengers} pasajeros`), i.push(r.luggageAlt == null ? `${r.luggage} ${r.luggage === 1 ? "maleta" : "maletas"}` : `${r.luggage} o ${r.luggageAlt} maletas`)), {
1487
+ delivery: t.delivery,
1488
+ price: n,
1489
+ capacity: r,
1490
+ label: i.join(", ")
1491
+ };
1492
+ }
1493
+ function ze(e, t = 1, n = 99) {
1494
+ return Number.isFinite(e) ? Math.min(n, Math.max(t, Math.round(e))) : t;
1495
+ }
1496
+ function Be(e, t, n) {
1497
+ let r = t.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase();
1498
+ if (!r) return -1;
1499
+ let i = e.length;
1500
+ for (let t = 1; t <= i; t++) {
1501
+ let a = (n + t + i) % i, o = e[a], s = o.label.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase();
1502
+ if (!o.disabled && s.startsWith(r)) return a;
1503
+ }
1504
+ return -1;
1505
+ }
1506
+ function Ve(e, t, n = Pe) {
1507
+ let r = new Set(e);
1508
+ return r.has(t) ? r.delete(t) : r.add(t), n.filter((e) => r.has(e.value)).map((e) => e.value);
1509
+ }
1510
+ function He(e, t, n = Pe) {
1511
+ let r = {};
1512
+ for (let i of n) i.maxQuantity && e.includes(i.value) && (r[i.value] = ze(t[i.value] ?? 1, 1, i.maxQuantity));
1513
+ return r;
1514
+ }
1515
+ function Ue(e, t, n = Pe) {
1516
+ let r = {};
1517
+ for (let i of n) {
1518
+ if (!i.choices?.length || !e.includes(i.value)) continue;
1519
+ let n = (t[i.value] ?? []).filter((e) => i.choices.some((t) => t.value === e)), a = i.maxQuantity ?? 1;
1520
+ r[i.value] = (n.length ? n : [i.choices[0].value]).slice(0, Math.max(1, a));
1521
+ }
1522
+ return r;
1523
+ }
1524
+ function We(e, t, n = Pe) {
1525
+ let r = {};
1526
+ for (let i of n) i.fields?.length && e.includes(i.value) && (r[i.value] = Object.fromEntries(i.fields.map((e) => [e.name, t[i.value]?.[e.name] ?? ""])));
1527
+ return r;
1528
+ }
1529
+ function Ge(e, t = {}, n = Pe) {
1530
+ let r = Ue(e, t.extraChoices ?? {}, n), i = He(e, t.extraQuantities ?? {}, n);
1531
+ for (let [e, t] of Object.entries(r)) i[e] = t.length;
1532
+ return {
1533
+ extraQuantities: i,
1534
+ extraChoices: r,
1535
+ extraFields: We(e, t.extraFields ?? {}, n)
1536
+ };
1537
+ }
1538
+ //#endregion
1539
+ //#region src/wari/WariSelect.tsx
1540
+ function Ke({ label: n, "aria-label": r, options: o, value: l, defaultValue: u = "", onChange: d, placeholder: f = "Seleccionar", supportingText: p, error: m = !1, required: h, disabled: g = !1, name: _, id: v, className: y }) {
1541
+ let b = t(), x = v ?? b, S = `${x}-label`, C = `${x}-value`, w = `${x}-listbox`, T = `${x}-hint`, [E, D] = a(u), O = l ?? E, [k, A] = a(!1), [j, M] = a(0), N = i(null), P = i(null), F = i({
1542
+ text: "",
1543
+ at: 0
1544
+ }), I = o.findIndex((e) => e.value === O), L = o[I], R = (e) => !!o[e] && !o[e].disabled, ee = (e) => {
1545
+ let t = o[e];
1546
+ t && !t.disabled && (l === void 0 && D(t.value), t.value !== O && d?.(t.value));
1547
+ }, z = (e) => {
1548
+ g || (M(Math.max(0, e)), A(!0));
1549
+ }, B = (e, t) => {
1550
+ let n = e;
1551
+ for (let e = 0; e < o.length; e++) {
1552
+ if (n = Math.min(o.length - 1, Math.max(0, n + t)), R(n)) return n;
1553
+ if (n === 0 || n === o.length - 1) break;
1554
+ }
1555
+ return e;
1556
+ };
1557
+ return e(() => {
1558
+ if (!k) return;
1559
+ document.getElementById(`${x}-option-${j}`)?.scrollIntoView?.({ block: "nearest" });
1560
+ let e = (e) => {
1561
+ N.current?.contains(e.target) || A(!1);
1562
+ };
1563
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1564
+ }, [
1565
+ k,
1566
+ j,
1567
+ x
1568
+ ]), /* @__PURE__ */ c("div", {
1569
+ ref: N,
1570
+ className: [
1571
+ "ds-input",
1572
+ "ds-wfield",
1573
+ "ds-wselect",
1574
+ y
1575
+ ].filter(Boolean).join(" "),
1576
+ "data-open": k,
1577
+ "data-error": m,
1578
+ "data-disabled": g,
1579
+ "data-label": "lg",
1580
+ onBlur: (e) => {
1581
+ let t = e.relatedTarget;
1582
+ k && t && !N.current?.contains(t) && A(!1);
1583
+ },
1584
+ children: [
1585
+ n && /* @__PURE__ */ c("label", {
1586
+ id: S,
1587
+ onClick: () => P.current?.focus(),
1588
+ children: [n, h && /* @__PURE__ */ s("span", {
1589
+ className: "ds-input-required",
1590
+ "aria-hidden": "true",
1591
+ children: "*"
1592
+ })]
1593
+ }),
1594
+ /* @__PURE__ */ c("div", {
1595
+ className: "ds-wfield-anchor",
1596
+ children: [/* @__PURE__ */ c("div", {
1597
+ ref: P,
1598
+ className: "ds-input-shell",
1599
+ role: "combobox",
1600
+ tabIndex: g ? -1 : 0,
1601
+ "aria-haspopup": "listbox",
1602
+ "aria-expanded": k,
1603
+ "aria-controls": w,
1604
+ "aria-labelledby": n ? `${S} ${C}` : void 0,
1605
+ "aria-label": n ? void 0 : r,
1606
+ "aria-activedescendant": k ? `${x}-option-${j}` : void 0,
1607
+ "aria-disabled": g || void 0,
1608
+ "aria-required": h || void 0,
1609
+ "aria-invalid": m || void 0,
1610
+ "aria-describedby": p ? T : void 0,
1611
+ onClick: () => k ? A(!1) : z(I >= 0 ? I : 0),
1612
+ onKeyDown: (e) => {
1613
+ if (g) return;
1614
+ let t = I >= 0 ? I : 0;
1615
+ switch (e.key) {
1616
+ case "ArrowDown":
1617
+ e.preventDefault(), k ? M(B(j, 1)) : z(t);
1618
+ return;
1619
+ case "ArrowUp":
1620
+ e.preventDefault(), k ? M(B(j, -1)) : z(t);
1621
+ return;
1622
+ case "Home":
1623
+ e.preventDefault(), z(B(-1, 1));
1624
+ return;
1625
+ case "End":
1626
+ e.preventDefault(), z(B(o.length, -1));
1627
+ return;
1628
+ case "PageDown":
1629
+ case "PageUp":
1630
+ k && (e.preventDefault(), M(B(j, e.key === "PageDown" ? 10 : -10)));
1631
+ return;
1632
+ case "Enter":
1633
+ case " ":
1634
+ e.preventDefault(), k ? (ee(j), A(!1)) : z(t);
1635
+ return;
1636
+ case "Escape":
1637
+ k && (e.preventDefault(), A(!1));
1638
+ return;
1639
+ case "Tab":
1640
+ k && (ee(j), A(!1));
1641
+ return;
1642
+ }
1643
+ if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
1644
+ let n = Date.now();
1645
+ F.current = {
1646
+ text: n - F.current.at < 600 ? F.current.text + e.key : e.key,
1647
+ at: n
1648
+ };
1649
+ let r = k ? j : t, i = Be(o, F.current.text, F.current.text.length > 1 ? r - 1 : r);
1650
+ i >= 0 && (k ? M(i) : z(i));
1651
+ }
1652
+ },
1653
+ children: [
1654
+ /* @__PURE__ */ c("span", {
1655
+ id: C,
1656
+ className: "ds-wselect-value",
1657
+ "data-placeholder": !L,
1658
+ children: [L ? L.label : f, L?.metaLabel && /* @__PURE__ */ c("span", {
1659
+ className: "ds-wvisually-hidden",
1660
+ children: [", ", L.metaLabel]
1661
+ })]
1662
+ }),
1663
+ L?.meta && /* @__PURE__ */ s("span", {
1664
+ "aria-hidden": "true",
1665
+ style: { display: "contents" },
1666
+ children: L.meta
1667
+ }),
1668
+ /* @__PURE__ */ s("span", {
1669
+ className: "ds-wselect-caret",
1670
+ "aria-hidden": "true",
1671
+ children: /* @__PURE__ */ s(J, {})
1672
+ })
1673
+ ]
1674
+ }), k && /* @__PURE__ */ s("ul", {
1675
+ id: w,
1676
+ className: "ds-wselect-list",
1677
+ role: "listbox",
1678
+ "aria-labelledby": n ? S : void 0,
1679
+ "aria-label": n ? void 0 : r,
1680
+ children: o.map((e, t) => /* @__PURE__ */ c("li", {
1681
+ id: `${x}-option-${t}`,
1682
+ role: "option",
1683
+ className: "ds-wselect-option",
1684
+ "aria-selected": e.value === O,
1685
+ "aria-disabled": e.disabled || void 0,
1686
+ "data-active": t === j,
1687
+ "aria-label": e.metaLabel ? `${e.label}, ${e.metaLabel}` : void 0,
1688
+ onMouseDown: (e) => e.preventDefault(),
1689
+ onMouseMove: () => {
1690
+ t !== j && !e.disabled && M(t);
1691
+ },
1692
+ onClick: () => {
1693
+ e.disabled || (ee(t), A(!1), P.current?.focus());
1694
+ },
1695
+ children: [/* @__PURE__ */ s("span", {
1696
+ className: "ds-wselect-label",
1697
+ children: e.label
1698
+ }), e.meta && /* @__PURE__ */ s("span", {
1699
+ "aria-hidden": "true",
1700
+ style: { display: "contents" },
1701
+ children: e.meta
1702
+ })]
1703
+ }, e.value))
1704
+ })]
1705
+ }),
1706
+ p && /* @__PURE__ */ s("small", {
1707
+ id: T,
1708
+ children: p
1709
+ }),
1710
+ _ && /* @__PURE__ */ s("input", {
1711
+ type: "hidden",
1712
+ name: _,
1713
+ value: O
1714
+ })
1715
+ ]
1716
+ });
1717
+ }
1718
+ //#endregion
1719
+ //#region src/wari/WariStepper.tsx
1720
+ function qe({ label: e, "aria-label": n, variant: r = "filled", value: i, defaultValue: o = 1, onChange: l, min: u = 1, max: d = 99, name: f, id: p, disabled: m = !1, supportingText: h, className: g }) {
1721
+ let _ = t(), v = p ?? _, [y, b] = a(() => ze(o, u, d)), x = i ?? y, [S, C] = a(null), w = (e) => {
1722
+ let t = ze(e, u, d);
1723
+ i === void 0 && b(t), t !== x && l?.(t);
1724
+ }, T = () => {
1725
+ S !== null && (S.trim() && w(Number(S)), C(null));
1726
+ }, E = (e ?? n ?? "cantidad").toLowerCase();
1727
+ return /* @__PURE__ */ c("div", {
1728
+ className: [
1729
+ "ds-input",
1730
+ "ds-wfield",
1731
+ "ds-wstepper",
1732
+ g
1733
+ ].filter(Boolean).join(" "),
1734
+ "data-disabled": m,
1735
+ "data-label": "lg",
1736
+ "data-variant": r,
1737
+ children: [
1738
+ e && /* @__PURE__ */ s("label", {
1739
+ htmlFor: v,
1740
+ children: e
1741
+ }),
1742
+ /* @__PURE__ */ c("div", {
1743
+ className: "ds-input-shell",
1744
+ children: [
1745
+ /* @__PURE__ */ s("button", {
1746
+ type: "button",
1747
+ className: "ds-wstepper-button",
1748
+ "aria-label": `Disminuir ${E}`,
1749
+ "aria-controls": v,
1750
+ disabled: m || x <= u,
1751
+ onClick: () => w(x - 1),
1752
+ children: /* @__PURE__ */ s(oe, {})
1753
+ }),
1754
+ /* @__PURE__ */ s("input", {
1755
+ id: v,
1756
+ type: "text",
1757
+ inputMode: "numeric",
1758
+ role: "spinbutton",
1759
+ name: f,
1760
+ disabled: m,
1761
+ "aria-label": e ? void 0 : n,
1762
+ "aria-valuenow": x,
1763
+ "aria-valuemin": u,
1764
+ "aria-valuemax": d,
1765
+ "aria-describedby": h ? `${v}-hint` : void 0,
1766
+ value: S ?? String(x),
1767
+ onChange: (e) => C(e.target.value.replace(/\D/g, "")),
1768
+ onBlur: T,
1769
+ onKeyDown: (e) => {
1770
+ let t = {
1771
+ ArrowUp: x + 1,
1772
+ ArrowDown: x - 1,
1773
+ PageUp: x + 10,
1774
+ PageDown: x - 10,
1775
+ Home: u,
1776
+ End: d
1777
+ };
1778
+ e.key in t && (e.preventDefault(), C(null), w(t[e.key])), e.key === "Enter" && (e.preventDefault(), T());
1779
+ }
1780
+ }),
1781
+ /* @__PURE__ */ s("button", {
1782
+ type: "button",
1783
+ className: "ds-wstepper-button",
1784
+ "aria-label": `Aumentar ${E}`,
1785
+ "aria-controls": v,
1786
+ disabled: m || x >= d,
1787
+ onClick: () => w(x + 1),
1788
+ children: /* @__PURE__ */ s(Y, {})
1789
+ })
1790
+ ]
1791
+ }),
1792
+ h && /* @__PURE__ */ s("small", {
1793
+ id: `${v}-hint`,
1794
+ children: h
1795
+ })
1796
+ ]
1797
+ });
1798
+ }
1799
+ //#endregion
1800
+ //#region src/wari/WariSwitchList.tsx
1801
+ function Je({ legend: e, items: n, value: r, defaultValue: i = [], onChange: l, quantities: u, defaultQuantities: d = {}, onQuantitiesChange: f, choices: p, defaultChoices: m = {}, onChoicesChange: h, fields: g, defaultFields: _ = {}, onFieldsChange: v, orientation: y = "vertical", name: b, disabled: x = !1, className: S }) {
1802
+ let C = t(), [w, T] = a(i), E = r ?? w, [D] = a(() => Ge(i, {
1803
+ extraQuantities: d,
1804
+ extraChoices: m,
1805
+ extraFields: _
1806
+ }, n)), [O, k] = a(D.extraQuantities), [A, j] = a(D.extraChoices), [M, N] = a(D.extraFields), P = u ?? O, F = p ?? A, I = g ?? M, L = (e, t) => {
1807
+ let i = new Set(E);
1808
+ t ? i.add(e) : i.delete(e);
1809
+ let a = n.filter((e) => i.has(e.value)).map((e) => e.value), o = Ge(a, {
1810
+ extraQuantities: P,
1811
+ extraChoices: F,
1812
+ extraFields: I
1813
+ }, n);
1814
+ r === void 0 && T(a), u === void 0 && k(o.extraQuantities), p === void 0 && j(o.extraChoices), g === void 0 && N(o.extraFields), l?.(a, o.extraQuantities, o.extraChoices, o.extraFields);
1815
+ }, R = (e, t, n) => {
1816
+ let r = {
1817
+ ...I,
1818
+ [e]: {
1819
+ ...I[e],
1820
+ [t]: n
1821
+ }
1822
+ };
1823
+ g === void 0 && N(r), v?.(r);
1824
+ }, ee = (e, t) => {
1825
+ let n = {
1826
+ ...P,
1827
+ [e]: t
1828
+ };
1829
+ u === void 0 && k(n), f?.(n);
1830
+ }, z = (e, t, n) => {
1831
+ let r = {
1832
+ ...F,
1833
+ [e]: t
1834
+ }, i = {
1835
+ ...P,
1836
+ [e]: t.length
1837
+ };
1838
+ p === void 0 && j(r), u === void 0 && k(i), h?.(r, i), n && requestAnimationFrame(() => {
1839
+ let e = document.getElementById(n)?.querySelectorAll("[role=\"combobox\"]");
1840
+ e?.[e.length - 1]?.focus();
1841
+ });
1842
+ };
1843
+ return /* @__PURE__ */ c("fieldset", {
1844
+ className: ["ds-wswitches", S].filter(Boolean).join(" "),
1845
+ "data-orientation": y,
1846
+ disabled: x,
1847
+ children: [/* @__PURE__ */ s("legend", { children: e }), n.map((e, t) => {
1848
+ let n = E.includes(e.value), r = !!e.choices?.length, i = !!e.fields?.length, a = !!(e.description || e.note || e.maxQuantity || r || i), l = `${C}-panel-${t}`, u = `${C}-desc-${t}`, d = F[e.value] ?? [], f = e.maxQuantity ?? 1;
1849
+ return /* @__PURE__ */ c("div", {
1850
+ className: "ds-wswitch-item",
1851
+ children: [/* @__PURE__ */ c("label", {
1852
+ className: "ds-wswitch",
1853
+ children: [/* @__PURE__ */ s("span", { children: e.label }), /* @__PURE__ */ s("input", {
1854
+ type: "checkbox",
1855
+ role: "switch",
1856
+ name: b,
1857
+ value: e.value,
1858
+ checked: n,
1859
+ disabled: e.disabled,
1860
+ "aria-controls": a ? l : void 0,
1861
+ "aria-expanded": a ? n : void 0,
1862
+ "aria-describedby": a && n && e.description ? u : void 0,
1863
+ onChange: (t) => L(e.value, t.target.checked)
1864
+ })]
1865
+ }), a && /* @__PURE__ */ s("div", {
1866
+ id: l,
1867
+ className: "ds-wswitch-panel",
1868
+ hidden: !n,
1869
+ children: n && /* @__PURE__ */ c(o, { children: [
1870
+ e.description && /* @__PURE__ */ s("p", {
1871
+ id: u,
1872
+ className: "ds-wswitch-desc",
1873
+ children: e.description
1874
+ }),
1875
+ r && /* @__PURE__ */ s("div", {
1876
+ className: "ds-wswitch-units",
1877
+ role: "group",
1878
+ "aria-label": e.label,
1879
+ children: d.map((t, n) => /* @__PURE__ */ c("div", {
1880
+ className: "ds-wswitch-unit",
1881
+ children: [
1882
+ /* @__PURE__ */ s(Ke, {
1883
+ "aria-label": `${e.label} ${n + 1}`,
1884
+ options: e.choices,
1885
+ value: t,
1886
+ disabled: x || e.disabled,
1887
+ name: b ? `${b}.${e.value}` : void 0,
1888
+ onChange: (t) => z(e.value, d.map((e, r) => r === n ? t : e))
1889
+ }),
1890
+ d.length > 1 && /* @__PURE__ */ s("button", {
1891
+ type: "button",
1892
+ className: "ds-wswitch-unit-button",
1893
+ "aria-label": `Quitar ${e.label} ${n + 1}`,
1894
+ disabled: x || e.disabled,
1895
+ onClick: () => z(e.value, d.filter((e, t) => t !== n), l),
1896
+ children: /* @__PURE__ */ s(pe, {})
1897
+ }),
1898
+ n === d.length - 1 && d.length < f && /* @__PURE__ */ s("button", {
1899
+ type: "button",
1900
+ className: "ds-wswitch-unit-button",
1901
+ "aria-label": `Agregar otro ${e.label}`,
1902
+ disabled: x || e.disabled,
1903
+ onClick: () => z(e.value, [...d, e.choices[0].value], l),
1904
+ children: /* @__PURE__ */ s(Y, {})
1905
+ })
1906
+ ]
1907
+ }, n))
1908
+ }),
1909
+ i && /* @__PURE__ */ s("div", {
1910
+ className: "ds-wswitch-fields",
1911
+ role: "group",
1912
+ "aria-label": e.label,
1913
+ children: e.fields.map((t) => /* @__PURE__ */ s("input", {
1914
+ className: "ds-wswitch-field",
1915
+ type: "text",
1916
+ inputMode: t.inputMode ?? "text",
1917
+ "aria-label": t.label,
1918
+ placeholder: t.placeholder,
1919
+ autoComplete: "off",
1920
+ "data-fixed": t.width ? !0 : void 0,
1921
+ style: t.width ? { width: t.width } : void 0,
1922
+ value: I[e.value]?.[t.name] ?? "",
1923
+ disabled: x || e.disabled,
1924
+ name: b ? `${b}.${e.value}.${t.name}` : void 0,
1925
+ onChange: (n) => R(e.value, t.name, n.target.value)
1926
+ }, t.name))
1927
+ }),
1928
+ !r && e.maxQuantity != null && /* @__PURE__ */ s(qe, {
1929
+ "aria-label": `Cantidad de ${e.label}`,
1930
+ variant: "outlined",
1931
+ min: 1,
1932
+ max: e.maxQuantity,
1933
+ value: P[e.value] ?? 1,
1934
+ disabled: x || e.disabled,
1935
+ name: b ? `${b}.${e.value}` : void 0,
1936
+ onChange: (t) => ee(e.value, t)
1937
+ }),
1938
+ e.note && /* @__PURE__ */ s("p", {
1939
+ className: "ds-wswitch-note",
1940
+ role: "note",
1941
+ children: e.note
1942
+ })
1943
+ ] })
1944
+ })]
1945
+ }, e.value);
1946
+ })]
1947
+ });
1948
+ }
1949
+ //#endregion
1950
+ //#region src/wari/WariServiceMeta.tsx
1951
+ function Ye({ service: e, hourly: t = !1, delivery: n = !1 }) {
1952
+ let r = Re(e, {
1953
+ hourly: t,
1954
+ delivery: n
1955
+ });
1956
+ return /* @__PURE__ */ c("span", {
1957
+ className: "ds-wmeta",
1958
+ children: [
1959
+ r.delivery && /* @__PURE__ */ s("span", {
1960
+ className: "ds-wmeta-badge",
1961
+ children: "Envío"
1962
+ }),
1963
+ r.price && /* @__PURE__ */ s("span", {
1964
+ className: "ds-wmeta-item",
1965
+ children: r.price
1966
+ }),
1967
+ r.capacity && /* @__PURE__ */ c(o, { children: [
1968
+ /* @__PURE__ */ c("span", {
1969
+ className: "ds-wmeta-item",
1970
+ children: [/* @__PURE__ */ s(X, {}), r.capacity.passengers]
1971
+ }),
1972
+ /* @__PURE__ */ c("span", {
1973
+ className: "ds-wmeta-item",
1974
+ children: [/* @__PURE__ */ s(ce, {}), r.capacity.luggage]
1975
+ }),
1976
+ r.capacity.luggageAlt != null && /* @__PURE__ */ c("span", {
1977
+ className: "ds-wmeta-item",
1978
+ children: [
1979
+ "o ",
1980
+ /* @__PURE__ */ s(Z, {}),
1981
+ r.capacity.luggageAlt
1982
+ ]
1983
+ })
1984
+ ] })
1985
+ ]
1986
+ });
1987
+ }
1988
+ //#endregion
1989
+ //#region src/wari/WariTripAttributes.tsx
1990
+ function Xe({ title: e = "Atributos del viaje", headingLevel: n = 3, value: r, defaultValue: i, onChange: o, services: l = Ne, extras: u = Pe, paymentMethods: d = Fe, maxVehicles: f = 10, name: p, disabled: m = !1, serviceLabel: h = "Tipo de servicio", vehiclesLabel: g = "Cantidad de vehículos", paymentLabel: _ = "Método de pago", hourlyLabel: v = "Por horas", deliveryLabel: y = "Envíos", className: b }) {
1991
+ let x = t(), [S, C] = a(() => ({
1992
+ ...Ie,
1993
+ ...i
1994
+ })), w = r ?? S, T = (e) => {
1995
+ let t = {
1996
+ ...w,
1997
+ ...e
1998
+ };
1999
+ r === void 0 && C(t), o?.(t);
2000
+ }, E = (e) => p ? `${p}.${e}` : void 0, D = `h${n}`, O = {
2001
+ hourly: w.hourly,
2002
+ delivery: w.delivery
2003
+ }, k = [{
2004
+ value: "hourly",
2005
+ label: v
2006
+ }, {
2007
+ value: "delivery",
2008
+ label: y
2009
+ }];
2010
+ return /* @__PURE__ */ c("section", {
2011
+ className: [
2012
+ "ds-wcard",
2013
+ "ds-wtrip",
2014
+ b
2015
+ ].filter(Boolean).join(" "),
2016
+ "aria-labelledby": x,
2017
+ children: [/* @__PURE__ */ c("header", {
2018
+ className: "ds-wcard-header",
2019
+ children: [/* @__PURE__ */ s(q, {}), /* @__PURE__ */ s(D, {
2020
+ id: x,
2021
+ className: "ds-wcard-title",
2022
+ children: e
2023
+ })]
2024
+ }), /* @__PURE__ */ c("div", {
2025
+ className: "ds-wcard-body",
2026
+ children: [
2027
+ /* @__PURE__ */ c("div", {
2028
+ className: "ds-wtrip-service",
2029
+ children: [/* @__PURE__ */ s(Ke, {
2030
+ label: h,
2031
+ value: w.service,
2032
+ onChange: (e) => T({ service: e }),
2033
+ disabled: m,
2034
+ name: E("service"),
2035
+ options: l.map((e) => ({
2036
+ value: e.value,
2037
+ label: e.label,
2038
+ disabled: e.disabled,
2039
+ meta: /* @__PURE__ */ s(Ye, {
2040
+ service: e,
2041
+ ...O
2042
+ }),
2043
+ metaLabel: Re(e, O).label
2044
+ }))
2045
+ }), /* @__PURE__ */ s(Je, {
2046
+ legend: "Modalidad del viaje",
2047
+ orientation: "horizontal",
2048
+ items: k,
2049
+ disabled: m,
2050
+ value: k.filter((e) => w[e.value]).map((e) => e.value),
2051
+ onChange: (e) => T({
2052
+ hourly: e.includes("hourly"),
2053
+ delivery: e.includes("delivery")
2054
+ }),
2055
+ name: E("mode")
2056
+ })]
2057
+ }),
2058
+ /* @__PURE__ */ s(Je, {
2059
+ legend: "Extras",
2060
+ items: u,
2061
+ value: w.extras,
2062
+ quantities: w.extraQuantities ?? {},
2063
+ choices: w.extraChoices ?? {},
2064
+ fields: w.extraFields ?? {},
2065
+ onChange: (e, t, n, r) => T({
2066
+ extras: e,
2067
+ extraQuantities: t,
2068
+ extraChoices: n,
2069
+ extraFields: r
2070
+ }),
2071
+ onFieldsChange: (e) => T({ extraFields: e }),
2072
+ onQuantitiesChange: (e) => T({ extraQuantities: e }),
2073
+ onChoicesChange: (e, t) => T({
2074
+ extraChoices: e,
2075
+ extraQuantities: t
2076
+ }),
2077
+ disabled: m,
2078
+ name: E("extras")
2079
+ }),
2080
+ /* @__PURE__ */ s(qe, {
2081
+ label: g,
2082
+ value: w.vehicles,
2083
+ onChange: (e) => T({ vehicles: e }),
2084
+ min: 1,
2085
+ max: f,
2086
+ disabled: m,
2087
+ name: E("vehicles")
2088
+ }),
2089
+ /* @__PURE__ */ s(Ke, {
2090
+ label: _,
2091
+ value: w.payment,
2092
+ onChange: (e) => T({ payment: e }),
2093
+ options: d,
2094
+ disabled: m,
2095
+ name: E("payment")
2096
+ })
2097
+ ]
2098
+ })]
2099
+ });
2100
+ }
2101
+ //#endregion
2102
+ //#region src/wari/WariClientSearch.tsx
2103
+ function Ze({ title: e = "Cliente / usuario", headingLevel: n = 3, value: r, defaultValue: i = "", onChange: l, onSearch: u, onCreate: d, createHref: f, createLabel: p = "Crear usuario", placeholder: m = "Puedes filtrar por nombre o número", searchLabel: h = "Buscar cliente por nombre o número", name: g = "q", action: _, loading: v = !1, loadingLabel: y = "Buscando cliente…", showCreate: b, showSearch: x = !0, hoverable: S = !0, disabled: C = !1, children: w, className: T }) {
2104
+ let E = t(), D = t(), [O, k] = a(i), A = r ?? O, j = `h${n}`, M = /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(ue, {}), p] }), N = b ?? (!A.trim() && !v);
2105
+ return /* @__PURE__ */ c("section", {
2106
+ className: [
2107
+ "ds-wcard",
2108
+ "ds-wclient",
2109
+ T
2110
+ ].filter(Boolean).join(" "),
2111
+ "aria-labelledby": E,
2112
+ "data-hover": S ? "lift" : void 0,
2113
+ "aria-busy": v || void 0,
2114
+ children: [
2115
+ /* @__PURE__ */ c("header", {
2116
+ className: "ds-wcard-header",
2117
+ children: [
2118
+ /* @__PURE__ */ s(Q, {}),
2119
+ /* @__PURE__ */ s(j, {
2120
+ id: E,
2121
+ className: "ds-wcard-title",
2122
+ title: e,
2123
+ children: e
2124
+ }),
2125
+ N ? f ? /* @__PURE__ */ s("a", {
2126
+ className: "ds-wcard-action",
2127
+ href: f,
2128
+ children: M
2129
+ }) : d && /* @__PURE__ */ s("button", {
2130
+ type: "button",
2131
+ className: "ds-wcard-action",
2132
+ onClick: d,
2133
+ disabled: C,
2134
+ children: M
2135
+ }) : null
2136
+ ]
2137
+ }),
2138
+ x && /* @__PURE__ */ c("form", {
2139
+ role: "search",
2140
+ className: "ds-input ds-wsearch",
2141
+ action: _,
2142
+ onSubmit: (e) => {
2143
+ _ || e.preventDefault(), u?.(A.trim());
2144
+ },
2145
+ children: [/* @__PURE__ */ s("label", {
2146
+ htmlFor: D,
2147
+ className: "ds-wvisually-hidden",
2148
+ children: h
2149
+ }), /* @__PURE__ */ c("div", {
2150
+ className: "ds-input-shell",
2151
+ children: [/* @__PURE__ */ s(le, {}), /* @__PURE__ */ s("input", {
2152
+ id: D,
2153
+ type: "search",
2154
+ name: g,
2155
+ value: A,
2156
+ placeholder: m,
2157
+ autoComplete: "off",
2158
+ disabled: C,
2159
+ enterKeyHint: "search",
2160
+ onChange: (e) => {
2161
+ r === void 0 && k(e.target.value), l?.(e.target.value);
2162
+ }
2163
+ })]
2164
+ })]
2165
+ }),
2166
+ v && /* @__PURE__ */ s("div", {
2167
+ className: "ds-wclient-progress",
2168
+ role: "progressbar",
2169
+ "aria-label": y
2170
+ }),
2171
+ w != null && /* @__PURE__ */ s("div", {
2172
+ className: "ds-wclient-results",
2173
+ children: w
2174
+ })
2175
+ ]
2176
+ });
2177
+ }
2178
+ //#endregion
2179
+ //#region src/wari/WariClientDetails.tsx
2180
+ function Qe({ name: e, company: t, phone: n, vip: r, tone: i, onRates: a, ratesLabel: o = "Tarifas", onInfo: l, infoLabel: u = "Ver información del cliente", onEdit: d, editLabel: f = "Editar cliente", notes: p, notesLabel: m = "Observaciones del cliente", notesHint: h = "(no editable)", children: g, disabled: _ = !1, className: v }) {
2181
+ let y = a || l || d, b = i ?? (r === !1 ? "info" : "warning");
2182
+ return /* @__PURE__ */ c("div", {
2183
+ className: ["ds-wclient-details", v].filter(Boolean).join(" "),
2184
+ children: [
2185
+ /* @__PURE__ */ c("div", {
2186
+ className: "ds-wclient-summary",
2187
+ children: [/* @__PURE__ */ c("div", {
2188
+ className: "ds-wclient-banner",
2189
+ "data-tone": b,
2190
+ children: [
2191
+ /* @__PURE__ */ s("p", {
2192
+ className: "ds-wclient-name",
2193
+ title: e,
2194
+ children: e
2195
+ }),
2196
+ t && /* @__PURE__ */ s("span", {
2197
+ className: "ds-wclient-company",
2198
+ title: t,
2199
+ children: t
2200
+ }),
2201
+ n && /* @__PURE__ */ c("a", {
2202
+ className: "ds-wclient-phone",
2203
+ href: `tel:${n.replace(/[^\d+]/g, "")}`,
2204
+ children: [/* @__PURE__ */ s(de, {}), n]
2205
+ })
2206
+ ]
2207
+ }), y && /* @__PURE__ */ c("div", {
2208
+ className: "ds-wclient-actions",
2209
+ children: [a && /* @__PURE__ */ s("button", {
2210
+ type: "button",
2211
+ className: "ds-wclient-rates",
2212
+ onClick: a,
2213
+ disabled: _,
2214
+ children: o
2215
+ }), (l || d) && /* @__PURE__ */ c("div", { children: [l && /* @__PURE__ */ s("button", {
2216
+ type: "button",
2217
+ className: "ds-wclient-icon",
2218
+ "aria-label": u,
2219
+ title: u,
2220
+ onClick: l,
2221
+ disabled: _,
2222
+ children: /* @__PURE__ */ s($, {})
2223
+ }), d && /* @__PURE__ */ s("button", {
2224
+ type: "button",
2225
+ className: "ds-wclient-icon",
2226
+ "aria-label": f,
2227
+ title: f,
2228
+ onClick: d,
2229
+ disabled: _,
2230
+ children: /* @__PURE__ */ s(fe, {})
2231
+ })] })]
2232
+ })]
2233
+ }),
2234
+ g != null && /* @__PURE__ */ s("div", {
2235
+ className: "ds-wclient-fields",
2236
+ children: g
2237
+ }),
2238
+ p != null && /* @__PURE__ */ c("div", {
2239
+ className: "ds-wclient-notes",
2240
+ children: [/* @__PURE__ */ c("span", { children: [
2241
+ m,
2242
+ " ",
2243
+ /* @__PURE__ */ s("em", { children: h })
2244
+ ] }), /* @__PURE__ */ s("p", { children: p })]
2245
+ })
2246
+ ]
2247
+ });
2248
+ }
2249
+ //#endregion
2250
+ //#region src/wari/motion.ts
2251
+ var $e = "cubic-bezier(.2, .8, .2, 1)";
2252
+ function et() {
2253
+ return typeof window > "u" || typeof window.matchMedia != "function" || window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2254
+ }
2255
+ var tt = (e) => typeof e.animate == "function";
2256
+ function nt(e) {
2257
+ let t = /* @__PURE__ */ new Map();
2258
+ return !e || et() || e.querySelectorAll("[data-motion]").forEach((e) => t.set(e.dataset.motion, e.getBoundingClientRect())), t;
2259
+ }
2260
+ function rt(e, t) {
2261
+ if (!e || t.size === 0 || et()) return;
2262
+ let n = 0;
2263
+ e.querySelectorAll("[data-motion]").forEach((r) => {
2264
+ if (!tt(r)) return;
2265
+ let i = t.get(r.dataset.motion);
2266
+ if (!i) {
2267
+ r.animate([{
2268
+ opacity: 0,
2269
+ transform: "translateY(-6px) scale(.98)"
2270
+ }, {
2271
+ opacity: 1,
2272
+ transform: "none"
2273
+ }], {
2274
+ duration: 240,
2275
+ easing: $e,
2276
+ delay: Math.min(n++, 6) * 35,
2277
+ fill: "backwards"
2278
+ });
2279
+ return;
2280
+ }
2281
+ if (r.parentElement?.closest("[data-motion]") && e.contains(r.parentElement.closest("[data-motion]"))) return;
2282
+ let a = r.getBoundingClientRect(), o = i.left - a.left, s = i.top - a.top;
2283
+ Math.abs(o) < 1 && Math.abs(s) < 1 || r.animate([{ transform: `translate(${o}px, ${s}px)` }, { transform: "none" }], {
2284
+ duration: 280,
2285
+ easing: $e
2286
+ });
2287
+ });
2288
+ }
2289
+ function it(e, t) {
2290
+ if (!e || !tt(e) || et()) {
2291
+ t();
2292
+ return;
2293
+ }
2294
+ let n = e.animate([{
2295
+ opacity: 1,
2296
+ transform: "none"
2297
+ }, {
2298
+ opacity: 0,
2299
+ transform: "translateX(12px) scale(.97)"
2300
+ }], {
2301
+ duration: 170,
2302
+ easing: "ease-in",
2303
+ fill: "forwards"
2304
+ }), r = () => {
2305
+ t(), requestAnimationFrame(() => requestAnimationFrame(() => n.cancel()));
2306
+ };
2307
+ n.finished.then(r, r);
2308
+ }
2309
+ //#endregion
2310
+ //#region src/wari/route.ts
2311
+ var at = 0;
2312
+ function ot(e = {}) {
2313
+ return at += 1, {
2314
+ id: `stop-${Date.now().toString(36)}-${at}`,
2315
+ address: "",
2316
+ reference: "",
2317
+ passenger: null,
2318
+ ...e
2319
+ };
2320
+ }
2321
+ function st() {
2322
+ return {
2323
+ stops: [ot(), ot()],
2324
+ passenger: null,
2325
+ tolls: [""]
2326
+ };
2327
+ }
2328
+ var ct = () => ({
2329
+ name: "",
2330
+ phone: ""
2331
+ });
2332
+ function lt(e, t, n) {
2333
+ if (t === n || t < 0 || n < 0 || t >= e.length || n >= e.length) return [...e];
2334
+ let r = [...e], [i] = r.splice(t, 1);
2335
+ return r.splice(n, 0, i), r;
2336
+ }
2337
+ function ut(e) {
2338
+ return {
2339
+ ...e,
2340
+ stops: [...e.stops].reverse()
2341
+ };
2342
+ }
2343
+ function dt(e, t = 10) {
2344
+ return e.length >= t ? [...e] : [...e, ot()];
2345
+ }
2346
+ function ft(e, t) {
2347
+ return t < 0 || t >= e.length ? [...e] : e.length <= 2 ? e.map((e, n) => n === t ? {
2348
+ ...e,
2349
+ address: "",
2350
+ reference: "",
2351
+ zone: void 0,
2352
+ price: void 0,
2353
+ passenger: null
2354
+ } : e) : e.filter((e, n) => n !== t);
2355
+ }
2356
+ function pt(e, t, n) {
2357
+ return e.map((e, r) => r === t ? {
2358
+ ...e,
2359
+ ...n
2360
+ } : e);
2361
+ }
2362
+ function mt(e, t = 5) {
2363
+ return e.length >= t ? [...e] : [...e, ""];
2364
+ }
2365
+ function ht(e, t) {
2366
+ return e.length <= 1 ? [""] : e.filter((e, n) => n !== t);
2367
+ }
2368
+ function gt(e) {
2369
+ return e.reduce((e, t) => {
2370
+ let n = Number(t.replace(",", "."));
2371
+ return Number.isFinite(n) && n > 0 ? e + n : e;
2372
+ }, 0);
2373
+ }
2374
+ function _t(e) {
2375
+ return e === 0 ? "¿Dónde recogemos al cliente?" : "¿A dónde lo llevamos?";
2376
+ }
2377
+ function vt(e) {
2378
+ return e === 0 ? "Origen" : `Destino ${e}`;
2379
+ }
2380
+ function yt(e) {
2381
+ let t = e?.stops?.length ? e.stops.map((e) => ({
2382
+ passenger: null,
2383
+ ...e
2384
+ })) : st().stops;
2385
+ for (; t.length < 2;) t.push(ot());
2386
+ return {
2387
+ stops: t,
2388
+ passenger: e?.passenger ?? null,
2389
+ tolls: e?.tolls?.length ? [...e.tolls] : [""]
2390
+ };
2391
+ }
2392
+ //#endregion
2393
+ //#region src/wari/WariRoute.tsx
2394
+ var bt = /* @__PURE__ */ new WeakMap();
2395
+ function xt({ title: r = "Ruta", headingLevel: l = 3, value: u, defaultValue: d, onChange: f, onInvert: p, maxStops: m = 10, maxTolls: h = 5, showPassengers: g = !0, showTolls: _ = !0, invertingLabel: v = "Invirtiendo direcciones...", invertedMessage: y = "Direcciones invertidas con éxito", routePassengerNote: b = "Este pasajero será el registrado para todas las direcciones de la ruta.", disabled: x = !1, className: S }) {
2396
+ let C = t(), [w, T] = a(() => yt(d)), E = u ? yt(u) : w, [D, O] = a(!1), [k, A] = a(!1), [j, M] = a(null), [N, P] = a(null), F = i(null), I = () => typeof document > "u" ? null : document.getElementById(`${C}-title`)?.closest(".ds-wroute"), L = () => {
2397
+ let e = I();
2398
+ e && bt.set(e, nt(e));
2399
+ };
2400
+ n(() => {
2401
+ let e = I(), t = e && bt.get(e);
2402
+ e && t && (bt.delete(e), rt(e, t));
2403
+ });
2404
+ let R = (e, t) => it(e.currentTarget.closest("[data-motion]"), t), ee = `h${l}`, z = (e) => {
2405
+ L(), u === void 0 && T(e), f?.(e);
2406
+ }, B = (e) => z({
2407
+ ...E,
2408
+ ...e
2409
+ });
2410
+ e(() => {
2411
+ if (!k) return;
2412
+ let e = window.setTimeout(() => A(!1), 3e3);
2413
+ return () => window.clearTimeout(e);
2414
+ }, [k]);
2415
+ let V = async () => {
2416
+ let e = ut(E);
2417
+ A(!1);
2418
+ let t = p?.(e);
2419
+ if (t && typeof t.then == "function") {
2420
+ L(), O(!0);
2421
+ try {
2422
+ let n = await t;
2423
+ z(n ? yt(n) : e), A(!0);
2424
+ } catch {} finally {
2425
+ O(!1);
2426
+ }
2427
+ } else z(e), A(!0);
2428
+ }, H = (e) => requestAnimationFrame(() => {
2429
+ F.current?.querySelector(`[data-stop="${e}"] .ds-wroute-handle`)?.focus();
2430
+ }), te = (e, t) => {
2431
+ let n = e.key === "ArrowUp" ? t - 1 : e.key === "ArrowDown" ? t + 1 : -1;
2432
+ if (n < 0 || n >= E.stops.length) return;
2433
+ e.preventDefault();
2434
+ let r = E.stops[t].id;
2435
+ B({ stops: lt(E.stops, t, n) }), H(r);
2436
+ }, U = (e, t) => {
2437
+ e.preventDefault(), j !== null && B({ stops: lt(E.stops, j, t) }), M(null), P(null);
2438
+ }, ne = (e, t, n) => /* @__PURE__ */ c("div", {
2439
+ className: "ds-wroute-passenger",
2440
+ role: "group",
2441
+ "aria-label": `Pasajero: ${n}`,
2442
+ children: [
2443
+ /* @__PURE__ */ c("label", { children: [/* @__PURE__ */ s(xe, {}), /* @__PURE__ */ s("input", {
2444
+ className: "ds-wroute-input",
2445
+ type: "text",
2446
+ autoComplete: "name",
2447
+ placeholder: "Nombre del pasajero",
2448
+ "aria-label": "Nombre del pasajero",
2449
+ value: e.name,
2450
+ disabled: x,
2451
+ onChange: (n) => t({
2452
+ ...e,
2453
+ name: n.target.value
2454
+ })
2455
+ })] }),
2456
+ /* @__PURE__ */ c("label", { children: [/* @__PURE__ */ s(de, {}), /* @__PURE__ */ s("input", {
2457
+ className: "ds-wroute-input",
2458
+ type: "tel",
2459
+ autoComplete: "tel",
2460
+ inputMode: "tel",
2461
+ placeholder: "Ingresa el número del pasajero",
2462
+ "aria-label": "Número del pasajero",
2463
+ value: e.phone,
2464
+ disabled: x,
2465
+ onChange: (n) => t({
2466
+ ...e,
2467
+ phone: n.target.value
2468
+ })
2469
+ })] }),
2470
+ /* @__PURE__ */ s("button", {
2471
+ type: "button",
2472
+ className: "ds-wroute-clear",
2473
+ "aria-label": `Quitar pasajero: ${n}`,
2474
+ disabled: x,
2475
+ onClick: (e) => R(e, () => t(null)),
2476
+ children: /* @__PURE__ */ s(Ce, {})
2477
+ })
2478
+ ]
2479
+ });
2480
+ return /* @__PURE__ */ c("section", {
2481
+ className: [
2482
+ "ds-wcard",
2483
+ "ds-wroute",
2484
+ S
2485
+ ].filter(Boolean).join(" "),
2486
+ "aria-labelledby": `${C}-title`,
2487
+ "aria-busy": D || void 0,
2488
+ children: [/* @__PURE__ */ c("header", {
2489
+ className: "ds-wcard-header",
2490
+ children: [
2491
+ /* @__PURE__ */ s(me, {}),
2492
+ /* @__PURE__ */ s(ee, {
2493
+ id: `${C}-title`,
2494
+ className: "ds-wcard-title",
2495
+ children: r
2496
+ }),
2497
+ g && !E.passenger && !D && /* @__PURE__ */ c("button", {
2498
+ type: "button",
2499
+ className: "ds-wroute-pill",
2500
+ "data-motion": "pill",
2501
+ disabled: x,
2502
+ onClick: () => B({ passenger: ct() }),
2503
+ children: [/* @__PURE__ */ s(Y, {}), "Añadir pasajero (ruta completa)"]
2504
+ }),
2505
+ /* @__PURE__ */ s("span", { className: "ds-wroute-header-spacer" }),
2506
+ /* @__PURE__ */ c("button", {
2507
+ type: "button",
2508
+ className: "ds-wroute-link",
2509
+ disabled: x || D,
2510
+ onClick: V,
2511
+ children: [/* @__PURE__ */ s(he, {}), "Invertir"]
2512
+ })
2513
+ ]
2514
+ }), D ? /* @__PURE__ */ c("div", {
2515
+ className: "ds-wroute-status",
2516
+ role: "status",
2517
+ "data-motion": "status",
2518
+ children: [/* @__PURE__ */ s("div", {
2519
+ className: "ds-wclient-progress",
2520
+ role: "progressbar",
2521
+ "aria-label": v
2522
+ }), v]
2523
+ }) : /* @__PURE__ */ c(o, { children: [
2524
+ k && /* @__PURE__ */ s("p", {
2525
+ className: "ds-wroute-success",
2526
+ role: "status",
2527
+ children: y
2528
+ }),
2529
+ E.passenger && /* @__PURE__ */ c("div", {
2530
+ className: "ds-wroute-passenger-block",
2531
+ "data-motion": "route-passenger",
2532
+ children: [ne(E.passenger, (e) => B({ passenger: e }), "ruta completa"), /* @__PURE__ */ s("p", {
2533
+ className: "ds-wroute-info",
2534
+ children: b
2535
+ })]
2536
+ }),
2537
+ /* @__PURE__ */ s("ol", {
2538
+ ref: F,
2539
+ className: "ds-wroute-stops",
2540
+ "aria-label": "Paradas",
2541
+ children: E.stops.map((e, t) => {
2542
+ let n = vt(t);
2543
+ return /* @__PURE__ */ c("li", {
2544
+ className: "ds-wroute-stop",
2545
+ "data-stop": e.id,
2546
+ "data-motion": `stop:${e.id}`,
2547
+ "data-dragging": j === t || void 0,
2548
+ "data-drop": N === t && j !== t || void 0,
2549
+ onDragOver: (e) => {
2550
+ j !== null && (e.preventDefault(), P(t));
2551
+ },
2552
+ onDrop: (e) => U(e, t),
2553
+ children: [
2554
+ /* @__PURE__ */ s("button", {
2555
+ type: "button",
2556
+ className: "ds-wroute-handle",
2557
+ draggable: !x,
2558
+ disabled: x,
2559
+ "aria-label": `Mover ${n}`,
2560
+ "aria-describedby": `${C}-move-hint`,
2561
+ onKeyDown: (e) => te(e, t),
2562
+ onDragStart: (n) => {
2563
+ M(t), n.dataTransfer.effectAllowed = "move", n.dataTransfer.setData("text/plain", e.id);
2564
+ },
2565
+ onDragEnd: () => {
2566
+ M(null), P(null);
2567
+ },
2568
+ children: /* @__PURE__ */ s(ge, {})
2569
+ }),
2570
+ /* @__PURE__ */ c("div", {
2571
+ className: "ds-wroute-stop-box",
2572
+ children: [
2573
+ /* @__PURE__ */ c("div", {
2574
+ className: "ds-wroute-stop-main",
2575
+ children: [
2576
+ /* @__PURE__ */ c("label", {
2577
+ className: "ds-wroute-address",
2578
+ children: [s(t === 0 ? ve : ye, {}), /* @__PURE__ */ s("input", {
2579
+ className: "ds-wroute-input",
2580
+ type: "text",
2581
+ autoComplete: "off",
2582
+ placeholder: _t(t),
2583
+ "aria-label": `Dirección: ${n}`,
2584
+ value: e.address,
2585
+ disabled: x,
2586
+ onChange: (e) => B({ stops: pt(E.stops, t, { address: e.target.value }) })
2587
+ })]
2588
+ }),
2589
+ /* @__PURE__ */ c("span", {
2590
+ className: "ds-wroute-zone",
2591
+ children: [/* @__PURE__ */ s("strong", { children: "Zona" }), e.zone || "Sin definir"]
2592
+ }),
2593
+ e.price != null && /* @__PURE__ */ s("span", {
2594
+ className: "ds-wroute-price",
2595
+ children: Le(e.price)
2596
+ })
2597
+ ]
2598
+ }),
2599
+ /* @__PURE__ */ c("div", {
2600
+ className: "ds-wroute-stop-extra",
2601
+ children: [/* @__PURE__ */ s("input", {
2602
+ className: "ds-wroute-input ds-wroute-input-sm",
2603
+ type: "text",
2604
+ autoComplete: "off",
2605
+ placeholder: "Escribe la referencia",
2606
+ "aria-label": `Referencia: ${n}`,
2607
+ value: e.reference,
2608
+ disabled: x,
2609
+ onChange: (e) => B({ stops: pt(E.stops, t, { reference: e.target.value }) })
2610
+ }), g && !e.passenger && /* @__PURE__ */ c("button", {
2611
+ type: "button",
2612
+ className: "ds-wroute-stop-passenger",
2613
+ disabled: x,
2614
+ "aria-label": `Añadir pasajero: ${n}`,
2615
+ onClick: () => B({ stops: pt(E.stops, t, { passenger: ct() }) }),
2616
+ children: [/* @__PURE__ */ s(be, {}), "Añadir Pasajero"]
2617
+ })]
2618
+ }),
2619
+ e.passenger && /* @__PURE__ */ s("div", {
2620
+ className: "ds-wroute-stop-passenger-wrap",
2621
+ "data-motion": `passenger:${e.id}`,
2622
+ children: ne(e.passenger, (e) => B({ stops: pt(E.stops, t, { passenger: e }) }), n)
2623
+ })
2624
+ ]
2625
+ }),
2626
+ /* @__PURE__ */ s("button", {
2627
+ type: "button",
2628
+ className: "ds-wroute-remove",
2629
+ "aria-label": E.stops.length > 2 ? `Quitar ${n}` : `Vaciar ${n}`,
2630
+ disabled: x,
2631
+ onClick: (e) => {
2632
+ let n = () => B({ stops: ft(E.stops, t) });
2633
+ E.stops.length > 2 ? R(e, n) : n();
2634
+ },
2635
+ children: /* @__PURE__ */ s(_e, {})
2636
+ })
2637
+ ]
2638
+ }, e.id);
2639
+ })
2640
+ }),
2641
+ /* @__PURE__ */ s("span", {
2642
+ id: `${C}-move-hint`,
2643
+ className: "ds-wvisually-hidden",
2644
+ children: "Arrastra o usa las flechas arriba y abajo para cambiar el orden."
2645
+ }),
2646
+ /* @__PURE__ */ c("button", {
2647
+ type: "button",
2648
+ className: "ds-wroute-add",
2649
+ "data-motion": "add",
2650
+ disabled: x || E.stops.length >= m,
2651
+ onClick: () => {
2652
+ let e = dt(E.stops, m);
2653
+ B({ stops: e }), requestAnimationFrame(() => F.current?.querySelector(`[data-stop="${e[e.length - 1].id}"] input`)?.focus());
2654
+ },
2655
+ children: [/* @__PURE__ */ s(Se, {}), "Agregar destino"]
2656
+ }),
2657
+ _ && /* @__PURE__ */ c("div", {
2658
+ className: "ds-wroute-tolls",
2659
+ role: "group",
2660
+ "aria-label": "Peajes",
2661
+ "data-motion": "tolls",
2662
+ children: [E.tolls.map((e, t) => /* @__PURE__ */ c("div", {
2663
+ className: "ds-wroute-toll",
2664
+ "data-motion": `toll:${t}`,
2665
+ children: [
2666
+ /* @__PURE__ */ c("label", {
2667
+ htmlFor: `${C}-toll-${t}`,
2668
+ children: ["Peaje ", t + 1]
2669
+ }),
2670
+ /* @__PURE__ */ s("input", {
2671
+ id: `${C}-toll-${t}`,
2672
+ className: "ds-wroute-input",
2673
+ type: "text",
2674
+ inputMode: "decimal",
2675
+ placeholder: "S/ 0.00",
2676
+ value: e,
2677
+ disabled: x,
2678
+ onChange: (e) => B({ tolls: E.tolls.map((n, r) => r === t ? e.target.value : n) })
2679
+ }),
2680
+ E.tolls.length > 1 && /* @__PURE__ */ s("button", {
2681
+ type: "button",
2682
+ className: "ds-wroute-clear",
2683
+ "aria-label": `Quitar peaje ${t + 1}`,
2684
+ disabled: x,
2685
+ onClick: (e) => R(e, () => B({ tolls: ht(E.tolls, t) })),
2686
+ children: /* @__PURE__ */ s(_e, {})
2687
+ })
2688
+ ]
2689
+ }, t)), /* @__PURE__ */ c("button", {
2690
+ type: "button",
2691
+ className: "ds-wroute-toll-add",
2692
+ disabled: x || E.tolls.length >= h,
2693
+ onClick: () => B({ tolls: mt(E.tolls, h) }),
2694
+ children: [/* @__PURE__ */ s(Se, {}), "Agregar peaje"]
2695
+ })]
2696
+ })
2697
+ ] })]
2698
+ });
2699
+ }
2700
+ //#endregion
2701
+ //#region src/wari/WariPassengerField.tsx
2702
+ function St({ value: e, defaultValue: t, onChange: n, onClear: r, loading: i = !1, loadingLabel: o = "Buscando pasajero…", label: l = "Pasajero", namePlaceholder: u = "Nombre del pasajero", phonePlaceholder: d = "Ingresa el número del pasajero", nameLabel: f = "Nombre del pasajero", phoneLabel: p = "Número del pasajero", clearLabel: m = "Quitar pasajero", showClear: h = !0, nameInputName: g, phoneInputName: _, disabled: v = !1, className: y }) {
2703
+ let [b, x] = a(() => ({
2704
+ ...ct(),
2705
+ ...t
2706
+ })), S = e ?? b, C = (t) => {
2707
+ e === void 0 && x(t), n?.(t);
2708
+ };
2709
+ return /* @__PURE__ */ c("div", {
2710
+ className: ["ds-wpassenger", y].filter(Boolean).join(" "),
2711
+ role: "group",
2712
+ "aria-label": l,
2713
+ "aria-busy": i || void 0,
2714
+ children: [/* @__PURE__ */ c("div", {
2715
+ className: "ds-wpassenger-row",
2716
+ children: [
2717
+ /* @__PURE__ */ c("label", {
2718
+ className: "ds-wpassenger-field",
2719
+ children: [/* @__PURE__ */ s(xe, {}), /* @__PURE__ */ s("input", {
2720
+ className: "ds-wpassenger-input",
2721
+ type: "text",
2722
+ autoComplete: "name",
2723
+ name: g,
2724
+ placeholder: u,
2725
+ "aria-label": f,
2726
+ value: S.name,
2727
+ disabled: v,
2728
+ onChange: (e) => C({
2729
+ ...S,
2730
+ name: e.target.value
2731
+ })
2732
+ })]
2733
+ }),
2734
+ /* @__PURE__ */ c("label", {
2735
+ className: "ds-wpassenger-field",
2736
+ children: [S.phone ? /* @__PURE__ */ s(we, {}) : /* @__PURE__ */ s(de, {}), /* @__PURE__ */ s("input", {
2737
+ className: "ds-wpassenger-input",
2738
+ type: "tel",
2739
+ autoComplete: "tel",
2740
+ inputMode: "tel",
2741
+ name: _,
2742
+ placeholder: d,
2743
+ "aria-label": p,
2744
+ value: S.phone,
2745
+ disabled: v,
2746
+ onChange: (e) => C({
2747
+ ...S,
2748
+ phone: e.target.value
2749
+ })
2750
+ })]
2751
+ }),
2752
+ h && /* @__PURE__ */ s("button", {
2753
+ type: "button",
2754
+ className: "ds-wpassenger-clear",
2755
+ "aria-label": m,
2756
+ title: m,
2757
+ disabled: v,
2758
+ onClick: () => {
2759
+ C(ct()), r?.();
2760
+ },
2761
+ children: /* @__PURE__ */ s(Ce, {})
2762
+ })
2763
+ ]
2764
+ }), i && /* @__PURE__ */ s("div", {
2765
+ className: "ds-wclient-progress ds-wpassenger-progress",
2766
+ role: "progressbar",
2767
+ "aria-label": o
2768
+ })]
2769
+ });
2770
+ }
2771
+ //#endregion
2772
+ export { b as MultiSelect, d as StatusTag, Qe as WariClientDetails, Ze as WariClientSearch, Te as WariDateField, St as WariPassengerField, xt as WariRoute, Me as WariSchedule, Ke as WariSelect, Ye as WariServiceMeta, x as WariStatusSelect, qe as WariStepper, Je as WariSwitchList, je as WariTimeField, Xe as WariTripAttributes, dt as addStop, mt as addToll, A as calendarWeeks, ze as clampCount, ot as createStop, st as defaultRouteValue, Ie as defaultTripAttributes, ct as emptyPassenger, p as filterOptions, E as formatDisplayDate, z as formatDisplayTime, Le as formatSoles, ut as invertRoute, lt as moveStop, yt as normalizeRoute, f as normalizeSearch, D as parseDisplayDate, B as parseDisplayTime, w as parseISODate, I as parseTime24, ft as removeStop, ht as removeToll, g as selectionState, v as selectionSummary, Re as serviceMeta, vt as stopLabel, _t as stopPlaceholder, Ue as syncExtraChoices, We as syncExtraFields, He as syncExtraQuantities, Ge as syncExtras, C as toISODate, T as todayISO, _ as toggleAll, Ve as toggleExtra, h as toggleValue, gt as tollsTotal, Be as typeaheadIndex, pt as updateStop, Pe as wariExtras, Fe as wariPaymentMethods, Ne as wariServices, u as wariStatusLabel, l as wariStatuses };
2773
+
2774
+ //# sourceMappingURL=wari.js.map