@inploi/plugin-chatbot 4.3.0 → 4.3.1
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/cdn/index.js +3 -3
- package/cdn/style.css +1 -1
- package/dist/{chatbot-body-68b4780b.js → chatbot-body-3a421cab.js} +355 -353
- package/dist/{chatbot-body-e9a02854.cjs → chatbot-body-59e32abf.cjs} +1 -1
- package/dist/components/status-bar.d.ts +2 -1
- package/dist/{index-2b3a83c0.cjs → index-26542f57.cjs} +3 -3
- package/dist/{index-32cebead.js → index-d718e966.js} +23 -19
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as Ue, i as Yt, k as Ne, a as er, b as le, A as Fe, c as Ir, N as Ke, _ as D, d as tr, h as Y, e as re, p as ue, F as pt, u as G, o as l, f as De, j as dt, y as pe, s as I, l as Ze, m as he, n as Mr, q as at, r as ee, t as Fr, v as
|
|
1
|
+
import { g as Ue, i as Yt, k as Ne, a as er, b as le, A as Fe, c as Ir, N as Ke, _ as D, d as tr, h as Y, e as re, p as ue, F as pt, u as G, o as l, f as De, j as dt, y as pe, s as I, l as Ze, m as he, n as Mr, q as at, r as ee, t as Fr, v as be, w as Lr, x as rr, z as Nr, B as nr, C as Tr, D as Se, E as Q, G as Dr, V as Rr, H as sr, I as je, J as Te, K as Or, L as Br, M as Pr, O as $r, P as jr, Q as zr, R as qr, S as Ur, T as Kr, U as Gr, W as Hr } from "./index-d718e966.js";
|
|
2
2
|
import "@inploi/sdk";
|
|
3
3
|
const Ft = ({
|
|
4
4
|
condition: e,
|
|
@@ -172,10 +172,10 @@ const Ft = ({
|
|
|
172
172
|
return !1;
|
|
173
173
|
return !0;
|
|
174
174
|
}
|
|
175
|
-
},
|
|
175
|
+
}, Wr = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ne = (e, {
|
|
176
176
|
context: t,
|
|
177
177
|
submissions: r
|
|
178
|
-
}) => e.replace(
|
|
178
|
+
}) => e.replace(Wr, (n, s, a = "") => {
|
|
179
179
|
const [i, ...u] = s.trim().split("."), d = ir({
|
|
180
180
|
key: i,
|
|
181
181
|
path: u,
|
|
@@ -231,7 +231,7 @@ const Ft = ({
|
|
|
231
231
|
nodes: t,
|
|
232
232
|
stopWhen: r
|
|
233
233
|
});
|
|
234
|
-
},
|
|
234
|
+
}, Jr = ({
|
|
235
235
|
childNode: e,
|
|
236
236
|
nodes: t
|
|
237
237
|
}) => {
|
|
@@ -250,7 +250,7 @@ const Ft = ({
|
|
|
250
250
|
});
|
|
251
251
|
if (n != null && n.nextId)
|
|
252
252
|
return t.find((s) => s.id === n.nextId);
|
|
253
|
-
},
|
|
253
|
+
}, Zr = ({
|
|
254
254
|
flow: e,
|
|
255
255
|
analytics: t,
|
|
256
256
|
logger: r,
|
|
@@ -272,11 +272,11 @@ const Ft = ({
|
|
|
272
272
|
...t.customProperties
|
|
273
273
|
}
|
|
274
274
|
})
|
|
275
|
-
}, h = async (k,
|
|
275
|
+
}, h = async (k, b) => {
|
|
276
276
|
const A = a();
|
|
277
|
-
d == null || d(k,
|
|
277
|
+
d == null || d(k, b);
|
|
278
278
|
try {
|
|
279
|
-
await
|
|
279
|
+
await Xr({
|
|
280
280
|
flow: e,
|
|
281
281
|
analytics: v,
|
|
282
282
|
logger: r,
|
|
@@ -298,7 +298,7 @@ const Ft = ({
|
|
|
298
298
|
addToSubmissions: i.addToSubmissions
|
|
299
299
|
},
|
|
300
300
|
next: (S) => {
|
|
301
|
-
const E = S ? e.nodes.find((g) => g.id === S) :
|
|
301
|
+
const E = S ? e.nodes.find((g) => g.id === S) : Jr({
|
|
302
302
|
childNode: k,
|
|
303
303
|
nodes: e.nodes
|
|
304
304
|
});
|
|
@@ -314,21 +314,21 @@ const Ft = ({
|
|
|
314
314
|
};
|
|
315
315
|
return {
|
|
316
316
|
interpret: async (k) => {
|
|
317
|
-
const
|
|
318
|
-
return h(
|
|
317
|
+
const b = e.nodes.find((A) => A.id === k) ?? er(e.nodes);
|
|
318
|
+
return h(b);
|
|
319
319
|
},
|
|
320
320
|
undo: (k) => {
|
|
321
|
-
let
|
|
321
|
+
let b = 1;
|
|
322
322
|
const A = e.nodes.find((E) => E.id === k[k.length - 1]);
|
|
323
323
|
for (let E = k.length - 2; E > 0; E--) {
|
|
324
324
|
const g = k[E], M = e.nodes.find((R) => R.id === g);
|
|
325
|
-
if (!M || (
|
|
325
|
+
if (!M || (b++, M.type.startsWith("question-")))
|
|
326
326
|
break;
|
|
327
327
|
}
|
|
328
328
|
w.abort(), w = new AbortController();
|
|
329
|
-
const S = e.nodes.find((E) => E.id === k[k.length -
|
|
329
|
+
const S = e.nodes.find((E) => E.id === k[k.length - b]);
|
|
330
330
|
return le(S, "Undo failed: new start node not found"), h(S, A), {
|
|
331
|
-
removed:
|
|
331
|
+
removed: b
|
|
332
332
|
};
|
|
333
333
|
},
|
|
334
334
|
abort: () => {
|
|
@@ -336,93 +336,93 @@ const Ft = ({
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
}, Xe = (e) => `+${e.countryCode} ${e.phoneNumber}`;
|
|
339
|
-
async function
|
|
339
|
+
async function Xr(e) {
|
|
340
340
|
const t = e.node;
|
|
341
341
|
switch (t.type) {
|
|
342
342
|
case "text":
|
|
343
|
-
return
|
|
343
|
+
return an({
|
|
344
344
|
...e,
|
|
345
345
|
node: t
|
|
346
346
|
});
|
|
347
347
|
case "image":
|
|
348
|
-
return
|
|
348
|
+
return on({
|
|
349
349
|
...e,
|
|
350
350
|
node: t
|
|
351
351
|
});
|
|
352
352
|
case "question-text":
|
|
353
|
-
return
|
|
353
|
+
return ln({
|
|
354
354
|
...e,
|
|
355
355
|
node: t
|
|
356
356
|
});
|
|
357
357
|
case "question-enum":
|
|
358
|
-
return
|
|
358
|
+
return dn({
|
|
359
359
|
...e,
|
|
360
360
|
node: t
|
|
361
361
|
});
|
|
362
362
|
case "question-number":
|
|
363
|
-
return
|
|
363
|
+
return un({
|
|
364
364
|
...e,
|
|
365
365
|
node: t
|
|
366
366
|
});
|
|
367
367
|
case "question-phone":
|
|
368
|
-
return
|
|
368
|
+
return cn({
|
|
369
369
|
...e,
|
|
370
370
|
node: t
|
|
371
371
|
});
|
|
372
372
|
case "question-boolean":
|
|
373
|
-
return
|
|
373
|
+
return fn({
|
|
374
374
|
...e,
|
|
375
375
|
node: t
|
|
376
376
|
});
|
|
377
377
|
case "question-file":
|
|
378
|
-
return
|
|
378
|
+
return pn({
|
|
379
379
|
...e,
|
|
380
380
|
node: t
|
|
381
381
|
});
|
|
382
382
|
case "question-address":
|
|
383
|
-
return
|
|
383
|
+
return hn({
|
|
384
384
|
...e,
|
|
385
385
|
node: t
|
|
386
386
|
});
|
|
387
387
|
case "end-flow":
|
|
388
|
-
return
|
|
388
|
+
return mn({
|
|
389
389
|
...e,
|
|
390
390
|
node: t
|
|
391
391
|
});
|
|
392
392
|
case "if-block":
|
|
393
|
-
return
|
|
393
|
+
return sn({
|
|
394
394
|
...e,
|
|
395
395
|
node: t
|
|
396
396
|
});
|
|
397
397
|
case "jump":
|
|
398
|
-
return
|
|
398
|
+
return en({
|
|
399
399
|
...e,
|
|
400
400
|
node: t
|
|
401
401
|
});
|
|
402
402
|
case "link":
|
|
403
|
-
return
|
|
403
|
+
return nn({
|
|
404
404
|
...e,
|
|
405
405
|
node: t
|
|
406
406
|
});
|
|
407
407
|
case "integration-application-submit":
|
|
408
|
-
return
|
|
408
|
+
return rn({
|
|
409
409
|
...e,
|
|
410
410
|
node: t
|
|
411
411
|
});
|
|
412
412
|
case "add-submission":
|
|
413
|
-
return
|
|
413
|
+
return tn({
|
|
414
414
|
...e,
|
|
415
415
|
node: t
|
|
416
416
|
});
|
|
417
417
|
case "integration-workflow-get":
|
|
418
418
|
throw Error("Workflow should be unreachable");
|
|
419
419
|
case "identify":
|
|
420
|
-
return
|
|
420
|
+
return Yr({
|
|
421
421
|
...e,
|
|
422
422
|
node: t
|
|
423
423
|
});
|
|
424
424
|
case "feedback":
|
|
425
|
-
return
|
|
425
|
+
return Qr({
|
|
426
426
|
...e,
|
|
427
427
|
node: t
|
|
428
428
|
});
|
|
@@ -437,13 +437,13 @@ const Ve = (e, t) => {
|
|
|
437
437
|
throw new Error(`Submission at “${t}” is not a string or number`);
|
|
438
438
|
return r;
|
|
439
439
|
};
|
|
440
|
-
async function
|
|
440
|
+
async function Qr({
|
|
441
441
|
next: e,
|
|
442
442
|
node: t
|
|
443
443
|
}) {
|
|
444
444
|
e(t.nextId);
|
|
445
445
|
}
|
|
446
|
-
async function
|
|
446
|
+
async function Yr({
|
|
447
447
|
next: e,
|
|
448
448
|
node: t,
|
|
449
449
|
analytics: r,
|
|
@@ -476,13 +476,13 @@ async function Qr({
|
|
|
476
476
|
e(t.nextId);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
async function
|
|
479
|
+
async function en({
|
|
480
480
|
next: e,
|
|
481
481
|
node: t
|
|
482
482
|
}) {
|
|
483
483
|
e(t.data.targetId);
|
|
484
484
|
}
|
|
485
|
-
async function
|
|
485
|
+
async function tn({
|
|
486
486
|
next: e,
|
|
487
487
|
node: t,
|
|
488
488
|
logger: r,
|
|
@@ -501,7 +501,7 @@ async function en({
|
|
|
501
501
|
})
|
|
502
502
|
}, e(t.nextId);
|
|
503
503
|
}
|
|
504
|
-
async function
|
|
504
|
+
async function rn({
|
|
505
505
|
chat: e,
|
|
506
506
|
next: t,
|
|
507
507
|
node: r,
|
|
@@ -535,7 +535,7 @@ async function tn({
|
|
|
535
535
|
job: u.job,
|
|
536
536
|
submissions: Ir(a || {})
|
|
537
537
|
})
|
|
538
|
-
}).catch((
|
|
538
|
+
}).catch((b) => b);
|
|
539
539
|
r.data.key && e.addToSubmissions(r.data.key, {
|
|
540
540
|
type: "integration",
|
|
541
541
|
value: k
|
|
@@ -552,7 +552,7 @@ async function tn({
|
|
|
552
552
|
data: D.any
|
|
553
553
|
}
|
|
554
554
|
}))
|
|
555
|
-
}, (
|
|
555
|
+
}, (b) => {
|
|
556
556
|
i.log({
|
|
557
557
|
event: "FLOW_SUBMIT",
|
|
558
558
|
properties: {
|
|
@@ -560,10 +560,10 @@ async function tn({
|
|
|
560
560
|
flow_version: u.version,
|
|
561
561
|
flow_session_id: u.data.flowSessionId,
|
|
562
562
|
flow_build: u.build,
|
|
563
|
-
service:
|
|
563
|
+
service: b.service ?? "INVALID_SERVICE",
|
|
564
564
|
response: {
|
|
565
|
-
status:
|
|
566
|
-
payload: "data" in
|
|
565
|
+
status: b.status,
|
|
566
|
+
payload: "data" in b ? b.data : b.error.data ?? null
|
|
567
567
|
},
|
|
568
568
|
job: u.job
|
|
569
569
|
}
|
|
@@ -577,18 +577,18 @@ async function tn({
|
|
|
577
577
|
button_text: D.optional(D.union(D.string, D.nullish))
|
|
578
578
|
})
|
|
579
579
|
}
|
|
580
|
-
}, async (
|
|
580
|
+
}, async (b) => {
|
|
581
581
|
await e.sendMessage({
|
|
582
582
|
type: "text",
|
|
583
583
|
author: "bot",
|
|
584
|
-
text:
|
|
584
|
+
text: b.redirect.message ?? d("submission_redirect_message")
|
|
585
585
|
});
|
|
586
586
|
try {
|
|
587
|
-
const A = new URL(
|
|
587
|
+
const A = new URL(b.redirect.redirect_url);
|
|
588
588
|
v && !A.searchParams.has("anonymous_id") && A.searchParams.set("anonymous_id", v), await e.sendMessage({
|
|
589
589
|
type: "link",
|
|
590
590
|
href: A.toString(),
|
|
591
|
-
text:
|
|
591
|
+
text: b.redirect.button_text ?? d("complete_submission"),
|
|
592
592
|
onClick: () => {
|
|
593
593
|
if (!h) {
|
|
594
594
|
n.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
@@ -608,7 +608,7 @@ async function tn({
|
|
|
608
608
|
}
|
|
609
609
|
});
|
|
610
610
|
} catch (A) {
|
|
611
|
-
n.error(`Invalid redirect URL: ${
|
|
611
|
+
n.error(`Invalid redirect URL: ${b.redirect.redirect_url}`, A), e.sendMessage({
|
|
612
612
|
type: "system",
|
|
613
613
|
variant: "error",
|
|
614
614
|
text: d("redirect_url_error")
|
|
@@ -629,14 +629,14 @@ async function tn({
|
|
|
629
629
|
message: D.string
|
|
630
630
|
})
|
|
631
631
|
}
|
|
632
|
-
}, async (
|
|
633
|
-
n.error(
|
|
632
|
+
}, async (b) => {
|
|
633
|
+
n.error(b.error), await e.sendMessage({
|
|
634
634
|
type: "system",
|
|
635
635
|
variant: "error",
|
|
636
|
-
text:
|
|
636
|
+
text: b.error.message || d("submission_failed")
|
|
637
637
|
}), await p(!1);
|
|
638
|
-
}).otherwise(async (
|
|
639
|
-
n.error(
|
|
638
|
+
}).otherwise(async (b) => {
|
|
639
|
+
n.error(b), await e.sendMessage({
|
|
640
640
|
type: "system",
|
|
641
641
|
variant: "error",
|
|
642
642
|
text: d("submission_failed")
|
|
@@ -645,7 +645,7 @@ async function tn({
|
|
|
645
645
|
};
|
|
646
646
|
await p(r.data.skipConfirmation);
|
|
647
647
|
}
|
|
648
|
-
async function
|
|
648
|
+
async function nn({
|
|
649
649
|
chat: e,
|
|
650
650
|
next: t,
|
|
651
651
|
node: r,
|
|
@@ -664,7 +664,7 @@ async function rn({
|
|
|
664
664
|
})
|
|
665
665
|
}), t(r.nextId);
|
|
666
666
|
}
|
|
667
|
-
async function
|
|
667
|
+
async function sn({
|
|
668
668
|
submissions: e,
|
|
669
669
|
next: t,
|
|
670
670
|
node: r,
|
|
@@ -675,7 +675,7 @@ async function nn({
|
|
|
675
675
|
context: n
|
|
676
676
|
}) ? r.branchId : r.nextId);
|
|
677
677
|
}
|
|
678
|
-
async function
|
|
678
|
+
async function an({
|
|
679
679
|
chat: e,
|
|
680
680
|
next: t,
|
|
681
681
|
node: r,
|
|
@@ -691,7 +691,7 @@ async function sn({
|
|
|
691
691
|
})
|
|
692
692
|
}), t(r.nextId);
|
|
693
693
|
}
|
|
694
|
-
async function
|
|
694
|
+
async function on({
|
|
695
695
|
chat: e,
|
|
696
696
|
next: t,
|
|
697
697
|
node: r
|
|
@@ -704,7 +704,7 @@ async function an({
|
|
|
704
704
|
width: r.data.width
|
|
705
705
|
}), t(r.nextId);
|
|
706
706
|
}
|
|
707
|
-
async function
|
|
707
|
+
async function ln({
|
|
708
708
|
chat: e,
|
|
709
709
|
next: t,
|
|
710
710
|
node: r,
|
|
@@ -751,7 +751,7 @@ async function on({
|
|
|
751
751
|
text: i.type === "phone" ? Xe(i.value) : i.value
|
|
752
752
|
}), t(r.nextId);
|
|
753
753
|
}
|
|
754
|
-
async function
|
|
754
|
+
async function un({
|
|
755
755
|
chat: e,
|
|
756
756
|
next: t,
|
|
757
757
|
node: r,
|
|
@@ -788,7 +788,7 @@ async function ln({
|
|
|
788
788
|
text: i.value.toString()
|
|
789
789
|
}), t(r.nextId);
|
|
790
790
|
}
|
|
791
|
-
async function
|
|
791
|
+
async function cn({
|
|
792
792
|
chat: e,
|
|
793
793
|
next: t,
|
|
794
794
|
node: r,
|
|
@@ -826,7 +826,7 @@ async function un({
|
|
|
826
826
|
text: a.type === "phone" ? Xe(a.value) : a.value
|
|
827
827
|
}), t(r.nextId);
|
|
828
828
|
}
|
|
829
|
-
async function
|
|
829
|
+
async function dn({
|
|
830
830
|
chat: e,
|
|
831
831
|
next: t,
|
|
832
832
|
node: r,
|
|
@@ -857,7 +857,7 @@ async function cn({
|
|
|
857
857
|
text: r.data.options.filter((u) => i.value.includes(u.value)).map((u) => u.label).join(", ")
|
|
858
858
|
}), t(r.nextId);
|
|
859
859
|
}
|
|
860
|
-
async function
|
|
860
|
+
async function fn({
|
|
861
861
|
chat: e,
|
|
862
862
|
next: t,
|
|
863
863
|
node: r,
|
|
@@ -894,7 +894,7 @@ async function dn({
|
|
|
894
894
|
text: i.value === !0 ? r.data.trueLabel : r.data.falseLabel
|
|
895
895
|
}), t(r.nextId);
|
|
896
896
|
}
|
|
897
|
-
async function
|
|
897
|
+
async function hn({
|
|
898
898
|
chat: e,
|
|
899
899
|
next: t,
|
|
900
900
|
node: r,
|
|
@@ -930,7 +930,7 @@ async function fn({
|
|
|
930
930
|
}
|
|
931
931
|
return t(r.nextId);
|
|
932
932
|
}
|
|
933
|
-
async function
|
|
933
|
+
async function pn({
|
|
934
934
|
node: e,
|
|
935
935
|
chat: t,
|
|
936
936
|
next: r,
|
|
@@ -973,7 +973,7 @@ async function hn({
|
|
|
973
973
|
});
|
|
974
974
|
r(e.nextId);
|
|
975
975
|
}
|
|
976
|
-
async function
|
|
976
|
+
async function mn({
|
|
977
977
|
chat: e,
|
|
978
978
|
end: t,
|
|
979
979
|
node: r
|
|
@@ -1036,9 +1036,9 @@ function ft(e, t, r) {
|
|
|
1036
1036
|
}, p;
|
|
1037
1037
|
}
|
|
1038
1038
|
ft.debounce = ft;
|
|
1039
|
-
var
|
|
1040
|
-
const Lt = /* @__PURE__ */ tr(
|
|
1041
|
-
function
|
|
1039
|
+
var gn = ft;
|
|
1040
|
+
const Lt = /* @__PURE__ */ tr(gn);
|
|
1041
|
+
function yn(e) {
|
|
1042
1042
|
let {
|
|
1043
1043
|
debounce: t,
|
|
1044
1044
|
scroll: r,
|
|
@@ -1069,7 +1069,7 @@ function gn(e) {
|
|
|
1069
1069
|
lastBounds: i
|
|
1070
1070
|
}), p = t ? typeof t == "number" ? t : t.scroll : null, w = t ? typeof t == "number" ? t : t.resize : null, v = re(!1);
|
|
1071
1071
|
ue(() => (v.current = !0, () => void (v.current = !1)));
|
|
1072
|
-
const [h, k,
|
|
1072
|
+
const [h, k, b] = pt(() => {
|
|
1073
1073
|
const g = () => {
|
|
1074
1074
|
if (!d.current.element)
|
|
1075
1075
|
return;
|
|
@@ -1092,15 +1092,15 @@ function gn(e) {
|
|
|
1092
1092
|
x: H,
|
|
1093
1093
|
y: se
|
|
1094
1094
|
};
|
|
1095
|
-
d.current.element instanceof HTMLElement && s && (q.height = d.current.element.offsetHeight, q.width = d.current.element.offsetWidth), Object.freeze(q), v.current && !
|
|
1095
|
+
d.current.element instanceof HTMLElement && s && (q.height = d.current.element.offsetHeight, q.width = d.current.element.offsetWidth), Object.freeze(q), v.current && !wn(d.current.lastBounds, q) && u(d.current.lastBounds = q);
|
|
1096
1096
|
};
|
|
1097
1097
|
return [g, w ? Lt(g, w) : g, p ? Lt(g, p) : g];
|
|
1098
1098
|
}, [u, s, p, w]);
|
|
1099
1099
|
function A() {
|
|
1100
|
-
d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll",
|
|
1100
|
+
d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll", b, !0)), d.current.scrollContainers = null), d.current.resizeObserver && (d.current.resizeObserver.disconnect(), d.current.resizeObserver = null);
|
|
1101
1101
|
}
|
|
1102
1102
|
function S() {
|
|
1103
|
-
d.current.element && (d.current.resizeObserver = new a(
|
|
1103
|
+
d.current.element && (d.current.resizeObserver = new a(b), d.current.resizeObserver.observe(d.current.element), r && d.current.scrollContainers && d.current.scrollContainers.forEach((g) => g.addEventListener("scroll", b, {
|
|
1104
1104
|
capture: !0,
|
|
1105
1105
|
passive: !0
|
|
1106
1106
|
})));
|
|
@@ -1108,9 +1108,9 @@ function gn(e) {
|
|
|
1108
1108
|
const E = (g) => {
|
|
1109
1109
|
!g || g === d.current.element || (A(), d.current.element = g, d.current.scrollContainers = or(g), S());
|
|
1110
1110
|
};
|
|
1111
|
-
return
|
|
1111
|
+
return vn(b, !!r), bn(k), ue(() => {
|
|
1112
1112
|
A(), S();
|
|
1113
|
-
}, [r,
|
|
1113
|
+
}, [r, b, k]), ue(() => A, []), [E, i, h];
|
|
1114
1114
|
}
|
|
1115
1115
|
function bn(e) {
|
|
1116
1116
|
ue(() => {
|
|
@@ -1118,7 +1118,7 @@ function bn(e) {
|
|
|
1118
1118
|
return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
|
|
1119
1119
|
}, [e]);
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function vn(e, t) {
|
|
1122
1122
|
ue(() => {
|
|
1123
1123
|
if (t) {
|
|
1124
1124
|
const r = e;
|
|
@@ -1140,7 +1140,7 @@ function or(e) {
|
|
|
1140
1140
|
} = window.getComputedStyle(e);
|
|
1141
1141
|
return [r, n, s].some((a) => a === "auto" || a === "scroll") && t.push(e), [...t, ...or(e.parentElement)];
|
|
1142
1142
|
}
|
|
1143
|
-
const
|
|
1143
|
+
const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn = (e, t) => xn.every((r) => e[r] === t[r]), ve = ({
|
|
1144
1144
|
class: e,
|
|
1145
1145
|
...t
|
|
1146
1146
|
}) => {
|
|
@@ -1169,7 +1169,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1169
1169
|
})]
|
|
1170
1170
|
})
|
|
1171
1171
|
});
|
|
1172
|
-
},
|
|
1172
|
+
}, _n = 25, ht = dt({
|
|
1173
1173
|
instant: () => {
|
|
1174
1174
|
},
|
|
1175
1175
|
smooth: () => {
|
|
@@ -1182,7 +1182,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1182
1182
|
instant: () => ht.value.instant(),
|
|
1183
1183
|
smooth: () => ht.value.smooth()
|
|
1184
1184
|
}
|
|
1185
|
-
},
|
|
1185
|
+
}, kn = () => {
|
|
1186
1186
|
const e = re(null);
|
|
1187
1187
|
pe(() => {
|
|
1188
1188
|
ht.value = {
|
|
@@ -1215,7 +1215,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1215
1215
|
if (s != null && s.aborted)
|
|
1216
1216
|
throw new Fe();
|
|
1217
1217
|
z.isBotTyping$.value = !0;
|
|
1218
|
-
const u = Math.min(Math.max(20, i.text.length), 100) *
|
|
1218
|
+
const u = Math.min(Math.max(20, i.text.length), 100) * _n;
|
|
1219
1219
|
await new Promise((d) => setTimeout(d, u, {
|
|
1220
1220
|
signal: s
|
|
1221
1221
|
})), z.isBotTyping$.value = !1;
|
|
@@ -1277,7 +1277,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1277
1277
|
class: "truncate pr-1 text-sm",
|
|
1278
1278
|
children: e.message
|
|
1279
1279
|
})]
|
|
1280
|
-
}),
|
|
1280
|
+
}), xe = ({
|
|
1281
1281
|
class: e,
|
|
1282
1282
|
...t
|
|
1283
1283
|
}) => {
|
|
@@ -1565,9 +1565,9 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1565
1565
|
defaultVariants: {
|
|
1566
1566
|
optional: !1
|
|
1567
1567
|
}
|
|
1568
|
-
}),
|
|
1568
|
+
}), Sn = "https://api.mapbox.com/search/searchbox/v1/suggest", Cn = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", En = (e) => atob(e).split("").reverse().join(""), ae = he({
|
|
1569
1569
|
name: ee()
|
|
1570
|
-
}),
|
|
1570
|
+
}), An = he({
|
|
1571
1571
|
suggestions: Mr(he({
|
|
1572
1572
|
full_address: at(ee()),
|
|
1573
1573
|
place_formatted: at(ee()),
|
|
@@ -1585,7 +1585,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1585
1585
|
country: ae
|
|
1586
1586
|
}))
|
|
1587
1587
|
}))
|
|
1588
|
-
}),
|
|
1588
|
+
}), Vn = ({
|
|
1589
1589
|
logger: e,
|
|
1590
1590
|
t
|
|
1591
1591
|
}) => pt(() => {
|
|
@@ -1595,17 +1595,17 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1595
1595
|
enabled: !0,
|
|
1596
1596
|
getPredictions: async (s) => {
|
|
1597
1597
|
var v;
|
|
1598
|
-
const a = new URL(
|
|
1598
|
+
const a = new URL(Sn);
|
|
1599
1599
|
a.searchParams.set("q", s), a.searchParams.set("session_token", r);
|
|
1600
1600
|
const i = (v = I.current$.peek().flow) == null ? void 0 : v.locationOrigin;
|
|
1601
|
-
i && i.lat !== void 0 && i.lng !== void 0 && i.lat >= -90 && i.lat <= 90 && i.lng >= -180 && i.lng <= 180 && a.searchParams.set("proximity", `${i.lng},${i.lat}`), a.searchParams.set("access_token", Cn
|
|
1601
|
+
i && i.lat !== void 0 && i.lng !== void 0 && i.lat >= -90 && i.lat <= 90 && i.lng >= -180 && i.lng <= 180 && a.searchParams.set("proximity", `${i.lng},${i.lat}`), a.searchParams.set("access_token", En(Cn));
|
|
1602
1602
|
const d = await fetch(a);
|
|
1603
1603
|
if (!d.ok)
|
|
1604
1604
|
return e.error("Failed to get address details", d), {
|
|
1605
1605
|
ok: !1,
|
|
1606
1606
|
error: t("address_error")
|
|
1607
1607
|
};
|
|
1608
|
-
const p = Lr(
|
|
1608
|
+
const p = Lr(An, await d.json());
|
|
1609
1609
|
if (p.success === !1)
|
|
1610
1610
|
return e.error("Failed to parse address details", p.issues), {
|
|
1611
1611
|
ok: !1,
|
|
@@ -1617,12 +1617,12 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1617
1617
|
return {
|
|
1618
1618
|
ok: !0,
|
|
1619
1619
|
data: w.map((h) => {
|
|
1620
|
-
var k,
|
|
1620
|
+
var k, b, A, S, E, g, M, R, N;
|
|
1621
1621
|
return {
|
|
1622
1622
|
label: h.full_address ?? h.place_formatted ?? h.name ?? h.mapbox_id,
|
|
1623
1623
|
id: h.mapbox_id,
|
|
1624
1624
|
address: {
|
|
1625
|
-
line1: ((k = h.context.address) == null ? void 0 : k.name) ?? ((
|
|
1625
|
+
line1: ((k = h.context.address) == null ? void 0 : k.name) ?? ((b = h.context.street) == null ? void 0 : b.name),
|
|
1626
1626
|
line2: void 0,
|
|
1627
1627
|
line3: ((A = h.context.neighborhood) == null ? void 0 : A.name) ?? ((S = h.context.locality) == null ? void 0 : S.name),
|
|
1628
1628
|
city: ((E = h.context.place) == null ? void 0 : E.name) ?? ((g = h.context.district) == null ? void 0 : g.name),
|
|
@@ -1660,7 +1660,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1660
1660
|
children: t("back")
|
|
1661
1661
|
})]
|
|
1662
1662
|
});
|
|
1663
|
-
},
|
|
1663
|
+
}, In = ({
|
|
1664
1664
|
input: e,
|
|
1665
1665
|
onSubmitSuccess: t,
|
|
1666
1666
|
logger: r
|
|
@@ -1670,10 +1670,10 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1670
1670
|
} = G(), [s, a] = Y(), [i, u] = Y([]), {
|
|
1671
1671
|
enabled: d,
|
|
1672
1672
|
getPredictions: p
|
|
1673
|
-
} =
|
|
1673
|
+
} = Vn({
|
|
1674
1674
|
logger: r,
|
|
1675
1675
|
t: n
|
|
1676
|
-
}), [w, v] = Y(d ? "query" : "manual"), [h, k] = Y(""), [
|
|
1676
|
+
}), [w, v] = Y(d ? "query" : "manual"), [h, k] = Y(""), [b, A] = Y(), S = (E) => {
|
|
1677
1677
|
le(d, "Query state should not be enabled"), E = E.trim(), E !== (h == null ? void 0 : h.trim()) && (k(E), E === "" && u([]), A(void 0), p(E).then((g) => {
|
|
1678
1678
|
if (g.ok === !1) {
|
|
1679
1679
|
u([]), A(g.error);
|
|
@@ -1684,7 +1684,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1684
1684
|
};
|
|
1685
1685
|
switch (w) {
|
|
1686
1686
|
case "query":
|
|
1687
|
-
return le(d, "Query state should not be enabled"), l(
|
|
1687
|
+
return le(d, "Query state should not be enabled"), l(Mn, {
|
|
1688
1688
|
input: e,
|
|
1689
1689
|
onSkip: () => t(null),
|
|
1690
1690
|
onAddressSelect: (E) => {
|
|
@@ -1700,7 +1700,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1700
1700
|
},
|
|
1701
1701
|
suggestions: i,
|
|
1702
1702
|
query: h,
|
|
1703
|
-
error:
|
|
1703
|
+
error: b
|
|
1704
1704
|
});
|
|
1705
1705
|
case "details":
|
|
1706
1706
|
return le(s !== void 0), l(Dt, {
|
|
@@ -1727,7 +1727,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1727
1727
|
}) : void 0
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
|
-
},
|
|
1730
|
+
}, Mn = ({
|
|
1731
1731
|
input: e,
|
|
1732
1732
|
onSkip: t,
|
|
1733
1733
|
suggestions: r,
|
|
@@ -1741,7 +1741,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1741
1741
|
} = G(), d = re(null);
|
|
1742
1742
|
return pe(() => {
|
|
1743
1743
|
d.current && (d.current.focus(), d.current.select());
|
|
1744
|
-
}, []), l(
|
|
1744
|
+
}, []), l(be, {
|
|
1745
1745
|
children: [l("form", {
|
|
1746
1746
|
noValidate: !0,
|
|
1747
1747
|
onSubmit: (p) => {
|
|
@@ -1792,7 +1792,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1792
1792
|
})]
|
|
1793
1793
|
})
|
|
1794
1794
|
})]
|
|
1795
|
-
}), e.config.optional && l(
|
|
1795
|
+
}), e.config.optional && l(xe, {
|
|
1796
1796
|
class: "",
|
|
1797
1797
|
onClick: t
|
|
1798
1798
|
})]
|
|
@@ -1868,7 +1868,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1868
1868
|
ref: s,
|
|
1869
1869
|
children: Tt.map((u, d) => {
|
|
1870
1870
|
const p = `isdk_${u}`, w = n.config.keys[u];
|
|
1871
|
-
return w ? l(
|
|
1871
|
+
return w ? l(be, {
|
|
1872
1872
|
children: [l("label", {
|
|
1873
1873
|
for: p,
|
|
1874
1874
|
class: "text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
@@ -1928,7 +1928,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1928
1928
|
children: [l("div", {
|
|
1929
1929
|
class: "flex-grow",
|
|
1930
1930
|
children: r
|
|
1931
|
-
}), l(
|
|
1931
|
+
}), l(ve, {
|
|
1932
1932
|
class: "flex items-center justify-center"
|
|
1933
1933
|
})]
|
|
1934
1934
|
})]
|
|
@@ -1939,7 +1939,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1939
1939
|
var t;
|
|
1940
1940
|
(t = e.current) == null || t.focus();
|
|
1941
1941
|
}, []), e;
|
|
1942
|
-
}, lr = ["true", "false"],
|
|
1942
|
+
}, lr = ["true", "false"], Fn = Tr(lr), Ln = "answer", ur = "flex items-center gap-2 p-2.5", cr = rr(({
|
|
1943
1943
|
label: e,
|
|
1944
1944
|
...t
|
|
1945
1945
|
}, r) => l("button", {
|
|
@@ -1950,7 +1950,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1950
1950
|
class: "truncate text-center text-base",
|
|
1951
1951
|
children: e
|
|
1952
1952
|
})
|
|
1953
|
-
})),
|
|
1953
|
+
})), Nn = ({
|
|
1954
1954
|
input: e,
|
|
1955
1955
|
onSubmitSuccess: t
|
|
1956
1956
|
}) => {
|
|
@@ -1960,7 +1960,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1960
1960
|
class: "",
|
|
1961
1961
|
onSubmit: (n) => {
|
|
1962
1962
|
n.preventDefault();
|
|
1963
|
-
const s = Nr(n).value, a = nr(
|
|
1963
|
+
const s = Nr(n).value, a = nr(Fn, s);
|
|
1964
1964
|
t({
|
|
1965
1965
|
type: "boolean",
|
|
1966
1966
|
value: a === "true"
|
|
@@ -1973,24 +1973,24 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1973
1973
|
children: l(cr, {
|
|
1974
1974
|
ref: s === 0 ? r : null,
|
|
1975
1975
|
type: "submit",
|
|
1976
|
-
name:
|
|
1976
|
+
name: Ln,
|
|
1977
1977
|
value: n,
|
|
1978
1978
|
label: e.config.labels[n]
|
|
1979
1979
|
}, n)
|
|
1980
1980
|
}))
|
|
1981
1981
|
}), e.config.optional && l("div", {
|
|
1982
1982
|
class: "px-2 pb-2",
|
|
1983
|
-
children: l(
|
|
1983
|
+
children: l(xe, {
|
|
1984
1984
|
class: "w-full",
|
|
1985
1985
|
type: "button",
|
|
1986
1986
|
onClick: () => t(null)
|
|
1987
1987
|
})
|
|
1988
1988
|
})]
|
|
1989
1989
|
});
|
|
1990
|
-
},
|
|
1990
|
+
}, Tn = (e) => new Promise((t, r) => {
|
|
1991
1991
|
const n = new FileReader();
|
|
1992
1992
|
n.readAsDataURL(e), n.onload = () => n.result ? t(n.result.toString()) : r("No result from reader"), n.onerror = r;
|
|
1993
|
-
}),
|
|
1993
|
+
}), Dn = (e) => e.reduce((t, r) => t + r.sizeKb, 0), Rn = Se("file"), Rt = 3, On = ({
|
|
1994
1994
|
file: e,
|
|
1995
1995
|
class: t,
|
|
1996
1996
|
...r
|
|
@@ -2025,21 +2025,21 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2025
2025
|
if (!t)
|
|
2026
2026
|
throw new Error("No file extension found");
|
|
2027
2027
|
return t ? "." + t : "";
|
|
2028
|
-
},
|
|
2028
|
+
}, Bn = ({
|
|
2029
2029
|
allowedExtensions: e,
|
|
2030
2030
|
files: t
|
|
2031
2031
|
}) => {
|
|
2032
2032
|
const r = e.map((n) => n.toLowerCase());
|
|
2033
2033
|
return t.every((n) => r.includes(dr(n.name).toLowerCase()));
|
|
2034
|
-
},
|
|
2034
|
+
}, Pn = (e, t) => {
|
|
2035
2035
|
const r = dr(e);
|
|
2036
2036
|
return `${e.replace(new RegExp(`${r}$`), "").slice(0, t)}${r}`;
|
|
2037
|
-
},
|
|
2037
|
+
}, $n = ({
|
|
2038
2038
|
input: e,
|
|
2039
2039
|
onSubmitSuccess: t
|
|
2040
2040
|
}) => {
|
|
2041
2041
|
var v;
|
|
2042
|
-
const r = (v = I.current$.value.flow) == null ? void 0 : v.data.submissions[e.key], [n, s] = Y(
|
|
2042
|
+
const r = (v = I.current$.value.flow) == null ? void 0 : v.data.submissions[e.key], [n, s] = Y(Rn(r) ? r.value : []), [a, i] = Y(), u = n.length - Rt, d = Dn(n), p = gt(), {
|
|
2043
2043
|
t: w
|
|
2044
2044
|
} = G();
|
|
2045
2045
|
return l("form", {
|
|
@@ -2047,7 +2047,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2047
2047
|
onSubmit: (h) => (h.preventDefault(), i(void 0), n.length === 0 ? i({
|
|
2048
2048
|
type: "required",
|
|
2049
2049
|
message: w("validation_file")
|
|
2050
|
-
}) : e.config.extensions.length > 0 && !
|
|
2050
|
+
}) : e.config.extensions.length > 0 && !Bn({
|
|
2051
2051
|
allowedExtensions: e.config.extensions,
|
|
2052
2052
|
files: n
|
|
2053
2053
|
}) ? i({
|
|
@@ -2073,16 +2073,16 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2073
2073
|
ref: p,
|
|
2074
2074
|
for: "dropzone-file",
|
|
2075
2075
|
class: "border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",
|
|
2076
|
-
children: [n.length > 0 ? l(
|
|
2076
|
+
children: [n.length > 0 ? l(be, {
|
|
2077
2077
|
children: [l("ul", {
|
|
2078
2078
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2079
2079
|
children: [n.slice(0, Rt).map((h) => {
|
|
2080
|
-
const k = h.name.split(".").pop(),
|
|
2080
|
+
const k = h.name.split(".").pop(), b = h.name.replace(new RegExp(`.${k}$`), "");
|
|
2081
2081
|
return l(Ot, {
|
|
2082
2082
|
class: "flex overflow-hidden",
|
|
2083
2083
|
children: [l("span", {
|
|
2084
2084
|
class: "block truncate",
|
|
2085
|
-
children:
|
|
2085
|
+
children: b
|
|
2086
2086
|
}), l("span", {
|
|
2087
2087
|
children: [".", k]
|
|
2088
2088
|
})]
|
|
@@ -2141,22 +2141,22 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2141
2141
|
id: "dropzone-file",
|
|
2142
2142
|
onInput: async (h) => {
|
|
2143
2143
|
le(h.target instanceof HTMLInputElement);
|
|
2144
|
-
const k = h.target.files ? Array.from(h.target.files) : [],
|
|
2145
|
-
const E = await
|
|
2144
|
+
const k = h.target.files ? Array.from(h.target.files) : [], b = await Promise.allSettled(k.map(async (S) => {
|
|
2145
|
+
const E = await Tn(S);
|
|
2146
2146
|
return {
|
|
2147
|
-
name:
|
|
2147
|
+
name: Pn(S.name, 42),
|
|
2148
2148
|
data: E,
|
|
2149
2149
|
sizeKb: S.size / 1e3
|
|
2150
2150
|
};
|
|
2151
2151
|
}));
|
|
2152
|
-
if (
|
|
2152
|
+
if (b.some(({
|
|
2153
2153
|
status: S
|
|
2154
2154
|
}) => S === "rejected"))
|
|
2155
2155
|
return i({
|
|
2156
2156
|
type: "invalid",
|
|
2157
2157
|
message: "Invalid file"
|
|
2158
2158
|
});
|
|
2159
|
-
const A =
|
|
2159
|
+
const A = b.map((S) => S.status === "fulfilled" ? S.value : null).filter(Boolean);
|
|
2160
2160
|
s(A);
|
|
2161
2161
|
},
|
|
2162
2162
|
multiple: e.config.allowMultiple,
|
|
@@ -2165,9 +2165,9 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2165
2165
|
})]
|
|
2166
2166
|
}), l("div", {
|
|
2167
2167
|
class: "flex h-full flex-col items-center gap-2",
|
|
2168
|
-
children: [l(
|
|
2168
|
+
children: [l(ve, {
|
|
2169
2169
|
disabled: n.length === 0
|
|
2170
|
-
}), e.config.optional && l(
|
|
2170
|
+
}), e.config.optional && l(xe, {
|
|
2171
2171
|
onClick: () => t(null)
|
|
2172
2172
|
})]
|
|
2173
2173
|
})]
|
|
@@ -2176,12 +2176,12 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2176
2176
|
})]
|
|
2177
2177
|
});
|
|
2178
2178
|
};
|
|
2179
|
-
var Oe = (e) => e.type === "checkbox",
|
|
2179
|
+
var Oe = (e) => e.type === "checkbox", ke = (e) => e instanceof Date, U = (e) => e == null;
|
|
2180
2180
|
const fr = (e) => typeof e == "object";
|
|
2181
|
-
var $ = (e) => !U(e) && !Array.isArray(e) && fr(e) && !
|
|
2181
|
+
var $ = (e) => !U(e) && !Array.isArray(e) && fr(e) && !ke(e), jn = (e) => $(e) && e.target ? Oe(e.target) ? e.target.checked : e.target.value : e, zn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, qn = (e, t) => e.has(zn(t)), Un = (e) => {
|
|
2182
2182
|
const t = e.constructor && e.constructor.prototype;
|
|
2183
2183
|
return $(t) && t.hasOwnProperty("isPrototypeOf");
|
|
2184
|
-
},
|
|
2184
|
+
}, yt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2185
2185
|
function oe(e) {
|
|
2186
2186
|
let t;
|
|
2187
2187
|
const r = Array.isArray(e);
|
|
@@ -2189,8 +2189,8 @@ function oe(e) {
|
|
|
2189
2189
|
t = new Date(e);
|
|
2190
2190
|
else if (e instanceof Set)
|
|
2191
2191
|
t = new Set(e);
|
|
2192
|
-
else if (!(
|
|
2193
|
-
if (t = r ? [] : {}, !r && !
|
|
2192
|
+
else if (!(yt && (e instanceof Blob || e instanceof FileList)) && (r || $(e)))
|
|
2193
|
+
if (t = r ? [] : {}, !r && !Un(e))
|
|
2194
2194
|
t = e;
|
|
2195
2195
|
else
|
|
2196
2196
|
for (const n in e)
|
|
@@ -2225,7 +2225,7 @@ const Bt = {
|
|
|
2225
2225
|
validate: "validate"
|
|
2226
2226
|
};
|
|
2227
2227
|
Q.createContext(null);
|
|
2228
|
-
var
|
|
2228
|
+
var Kn = (e, t, r, n = !0) => {
|
|
2229
2229
|
const s = {
|
|
2230
2230
|
defaultValues: t._defaultValues
|
|
2231
2231
|
};
|
|
@@ -2237,12 +2237,12 @@ var Un = (e, t, r, n = !0) => {
|
|
|
2237
2237
|
}
|
|
2238
2238
|
});
|
|
2239
2239
|
return s;
|
|
2240
|
-
}, J = (e) => $(e) && !Object.keys(e).length,
|
|
2240
|
+
}, J = (e) => $(e) && !Object.keys(e).length, Gn = (e, t, r, n) => {
|
|
2241
2241
|
r(e);
|
|
2242
2242
|
const { name: s, ...a } = e;
|
|
2243
2243
|
return J(a) || Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((i) => t[i] === (!n || Z.all));
|
|
2244
2244
|
}, it = (e) => Array.isArray(e) ? e : [e];
|
|
2245
|
-
function
|
|
2245
|
+
function Hn(e) {
|
|
2246
2246
|
const t = Q.useRef(e);
|
|
2247
2247
|
t.current = e, Q.useEffect(() => {
|
|
2248
2248
|
const r = !e.disabled && t.current.subject && t.current.subject.subscribe({
|
|
@@ -2253,10 +2253,10 @@ function Gn(e) {
|
|
|
2253
2253
|
};
|
|
2254
2254
|
}, [e.disabled]);
|
|
2255
2255
|
}
|
|
2256
|
-
var te = (e) => typeof e == "string",
|
|
2256
|
+
var te = (e) => typeof e == "string", Wn = (e, t, r, n, s) => te(e) ? (n && t.watch.add(e), x(r, e, s)) : Array.isArray(e) ? e.map((a) => (n && t.watch.add(a), x(r, a))) : (n && (t.watchAll = !0), r), bt = (e) => /^\w*$/.test(e), hr = (e) => Be(e.replace(/["|']|\]/g, "").split(/\.|\[/));
|
|
2257
2257
|
function L(e, t, r) {
|
|
2258
2258
|
let n = -1;
|
|
2259
|
-
const s =
|
|
2259
|
+
const s = bt(t) ? [t] : hr(t), a = s.length, i = a - 1;
|
|
2260
2260
|
for (; ++n < a; ) {
|
|
2261
2261
|
const u = s[n];
|
|
2262
2262
|
let d = r;
|
|
@@ -2296,11 +2296,11 @@ const ze = (e, t, r, n) => {
|
|
|
2296
2296
|
}
|
|
2297
2297
|
}
|
|
2298
2298
|
};
|
|
2299
|
-
var
|
|
2299
|
+
var Jn = (e, t, r) => {
|
|
2300
2300
|
const n = Be(x(e, r));
|
|
2301
2301
|
return L(n, "root", t[r]), L(e, r, n), e;
|
|
2302
2302
|
}, vt = (e) => e.type === "file", fe = (e) => typeof e == "function", Ge = (e) => {
|
|
2303
|
-
if (!
|
|
2303
|
+
if (!yt)
|
|
2304
2304
|
return !1;
|
|
2305
2305
|
const t = e ? e.ownerDocument : 0;
|
|
2306
2306
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
@@ -2338,18 +2338,18 @@ function Ut(e, t, r = "validate") {
|
|
|
2338
2338
|
ref: t
|
|
2339
2339
|
};
|
|
2340
2340
|
}
|
|
2341
|
-
var
|
|
2341
|
+
var _e = (e) => $(e) && !He(e) ? e : {
|
|
2342
2342
|
value: e,
|
|
2343
2343
|
message: ""
|
|
2344
2344
|
}, Kt = async (e, t, r, n, s) => {
|
|
2345
|
-
const { ref: a, refs: i, required: u, maxLength: d, minLength: p, min: w, max: v, pattern: h, validate: k, name:
|
|
2345
|
+
const { ref: a, refs: i, required: u, maxLength: d, minLength: p, min: w, max: v, pattern: h, validate: k, name: b, valueAsNumber: A, mount: S, disabled: E } = e._f, g = x(t, b);
|
|
2346
2346
|
if (!S || E)
|
|
2347
2347
|
return {};
|
|
2348
2348
|
const M = i ? i[0] : a, R = (F) => {
|
|
2349
2349
|
n && M.reportValidity && (M.setCustomValidity(de(F) ? "" : F || ""), M.reportValidity());
|
|
2350
|
-
}, N = {}, me = xt(a), ce = Oe(a), Ee = me || ce, H = (A || vt(a)) && B(a.value) && B(g) || Ge(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = pr.bind(null,
|
|
2350
|
+
}, N = {}, me = xt(a), ce = Oe(a), Ee = me || ce, H = (A || vt(a)) && B(a.value) && B(g) || Ge(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = pr.bind(null, b, r, N), q = (F, V, O, K = ie.maxLength, W = ie.minLength) => {
|
|
2351
2351
|
const X = F ? V : O;
|
|
2352
|
-
N[
|
|
2352
|
+
N[b] = {
|
|
2353
2353
|
type: F ? K : W,
|
|
2354
2354
|
message: X,
|
|
2355
2355
|
ref: a,
|
|
@@ -2357,8 +2357,8 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2357
2357
|
};
|
|
2358
2358
|
};
|
|
2359
2359
|
if (s ? !Array.isArray(g) || !g.length : u && (!Ee && (H || U(g)) || de(g) && !g || ce && !mr(i).isValid || me && !gr(i).isValid)) {
|
|
2360
|
-
const { value: F, message: V } = qe(u) ? { value: !!u, message: u } :
|
|
2361
|
-
if (F && (N[
|
|
2360
|
+
const { value: F, message: V } = qe(u) ? { value: !!u, message: u } : _e(u);
|
|
2361
|
+
if (F && (N[b] = {
|
|
2362
2362
|
type: ie.required,
|
|
2363
2363
|
message: V,
|
|
2364
2364
|
ref: M,
|
|
@@ -2368,7 +2368,7 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2368
2368
|
}
|
|
2369
2369
|
if (!H && (!U(w) || !U(v))) {
|
|
2370
2370
|
let F, V;
|
|
2371
|
-
const O =
|
|
2371
|
+
const O = _e(v), K = _e(w);
|
|
2372
2372
|
if (!U(g) && !isNaN(g)) {
|
|
2373
2373
|
const W = a.valueAsNumber || g && +g;
|
|
2374
2374
|
U(O.value) || (F = W > O.value), U(K.value) || (V = W < K.value);
|
|
@@ -2377,16 +2377,16 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2377
2377
|
te(O.value) && g && (F = ge ? X(g) > X(O.value) : Ae ? g > O.value : W > new Date(O.value)), te(K.value) && g && (V = ge ? X(g) < X(K.value) : Ae ? g < K.value : W < new Date(K.value));
|
|
2378
2378
|
}
|
|
2379
2379
|
if ((F || V) && (q(!!F, O.message, K.message, ie.max, ie.min), !r))
|
|
2380
|
-
return R(N[
|
|
2380
|
+
return R(N[b].message), N;
|
|
2381
2381
|
}
|
|
2382
2382
|
if ((d || p) && !H && (te(g) || s && Array.isArray(g))) {
|
|
2383
|
-
const F =
|
|
2383
|
+
const F = _e(d), V = _e(p), O = !U(F.value) && g.length > +F.value, K = !U(V.value) && g.length < +V.value;
|
|
2384
2384
|
if ((O || K) && (q(O, F.message, V.message), !r))
|
|
2385
|
-
return R(N[
|
|
2385
|
+
return R(N[b].message), N;
|
|
2386
2386
|
}
|
|
2387
2387
|
if (h && !H && te(g)) {
|
|
2388
|
-
const { value: F, message: V } =
|
|
2389
|
-
if (He(F) && !g.match(F) && (N[
|
|
2388
|
+
const { value: F, message: V } = _e(h);
|
|
2389
|
+
if (He(F) && !g.match(F) && (N[b] = {
|
|
2390
2390
|
type: ie.pattern,
|
|
2391
2391
|
message: V,
|
|
2392
2392
|
ref: a,
|
|
@@ -2397,7 +2397,7 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2397
2397
|
if (k) {
|
|
2398
2398
|
if (fe(k)) {
|
|
2399
2399
|
const F = await k(g, t), V = Ut(F, M);
|
|
2400
|
-
if (V && (N[
|
|
2400
|
+
if (V && (N[b] = {
|
|
2401
2401
|
...V,
|
|
2402
2402
|
...se(ie.validate, V.message)
|
|
2403
2403
|
}, !r))
|
|
@@ -2411,9 +2411,9 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2411
2411
|
O && (F = {
|
|
2412
2412
|
...O,
|
|
2413
2413
|
...se(V, O.message)
|
|
2414
|
-
}, R(O.message), r && (N[
|
|
2414
|
+
}, R(O.message), r && (N[b] = F));
|
|
2415
2415
|
}
|
|
2416
|
-
if (!J(F) && (N[
|
|
2416
|
+
if (!J(F) && (N[b] = {
|
|
2417
2417
|
ref: M,
|
|
2418
2418
|
...F
|
|
2419
2419
|
}, !r))
|
|
@@ -2422,22 +2422,22 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2422
2422
|
}
|
|
2423
2423
|
return R(!0), N;
|
|
2424
2424
|
};
|
|
2425
|
-
function
|
|
2425
|
+
function Zn(e, t) {
|
|
2426
2426
|
const r = t.slice(0, -1).length;
|
|
2427
2427
|
let n = 0;
|
|
2428
2428
|
for (; n < r; )
|
|
2429
2429
|
e = B(e) ? n++ : e[t[n++]];
|
|
2430
2430
|
return e;
|
|
2431
2431
|
}
|
|
2432
|
-
function
|
|
2432
|
+
function Xn(e) {
|
|
2433
2433
|
for (const t in e)
|
|
2434
2434
|
if (e.hasOwnProperty(t) && !B(e[t]))
|
|
2435
2435
|
return !1;
|
|
2436
2436
|
return !0;
|
|
2437
2437
|
}
|
|
2438
2438
|
function j(e, t) {
|
|
2439
|
-
const r = Array.isArray(t) ? t :
|
|
2440
|
-
return n && delete n[a], s !== 0 && ($(n) && J(n) || Array.isArray(n) &&
|
|
2439
|
+
const r = Array.isArray(t) ? t : bt(t) ? [t] : hr(t), n = r.length === 1 ? e : Zn(e, r), s = r.length - 1, a = r[s];
|
|
2440
|
+
return n && delete n[a], s !== 0 && ($(n) && J(n) || Array.isArray(n) && Xn(n)) && j(e, r.slice(0, -1)), e;
|
|
2441
2441
|
}
|
|
2442
2442
|
function ot() {
|
|
2443
2443
|
let e = [];
|
|
@@ -2460,10 +2460,10 @@ function ot() {
|
|
|
2460
2460
|
};
|
|
2461
2461
|
}
|
|
2462
2462
|
var We = (e) => U(e) || !fr(e);
|
|
2463
|
-
function
|
|
2463
|
+
function ye(e, t) {
|
|
2464
2464
|
if (We(e) || We(t))
|
|
2465
2465
|
return e === t;
|
|
2466
|
-
if (
|
|
2466
|
+
if (ke(e) && ke(t))
|
|
2467
2467
|
return e.getTime() === t.getTime();
|
|
2468
2468
|
const r = Object.keys(e), n = Object.keys(t);
|
|
2469
2469
|
if (r.length !== n.length)
|
|
@@ -2474,13 +2474,13 @@ function be(e, t) {
|
|
|
2474
2474
|
return !1;
|
|
2475
2475
|
if (s !== "ref") {
|
|
2476
2476
|
const i = t[s];
|
|
2477
|
-
if (
|
|
2477
|
+
if (ke(a) && ke(i) || $(a) && $(i) || Array.isArray(a) && Array.isArray(i) ? !ye(a, i) : a !== i)
|
|
2478
2478
|
return !1;
|
|
2479
2479
|
}
|
|
2480
2480
|
}
|
|
2481
2481
|
return !0;
|
|
2482
2482
|
}
|
|
2483
|
-
var
|
|
2483
|
+
var yr = (e) => e.type === "select-multiple", Qn = (e) => xt(e) || Oe(e), lt = (e) => Ge(e) && e.isConnected, br = (e) => {
|
|
2484
2484
|
for (const t in e)
|
|
2485
2485
|
if (fe(e[t]))
|
|
2486
2486
|
return !0;
|
|
@@ -2490,23 +2490,23 @@ function Je(e, t = {}) {
|
|
|
2490
2490
|
const r = Array.isArray(e);
|
|
2491
2491
|
if ($(e) || r)
|
|
2492
2492
|
for (const n in e)
|
|
2493
|
-
Array.isArray(e[n]) || $(e[n]) && !
|
|
2493
|
+
Array.isArray(e[n]) || $(e[n]) && !br(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Je(e[n], t[n])) : U(e[n]) || (t[n] = !0);
|
|
2494
2494
|
return t;
|
|
2495
2495
|
}
|
|
2496
2496
|
function vr(e, t, r) {
|
|
2497
2497
|
const n = Array.isArray(e);
|
|
2498
2498
|
if ($(e) || n)
|
|
2499
2499
|
for (const s in e)
|
|
2500
|
-
Array.isArray(e[s]) || $(e[s]) && !
|
|
2500
|
+
Array.isArray(e[s]) || $(e[s]) && !br(e[s]) ? B(t) || We(r[s]) ? r[s] = Array.isArray(e[s]) ? Je(e[s], []) : { ...Je(e[s]) } : vr(e[s], U(t) ? {} : t[s], r[s]) : r[s] = !ye(e[s], t[s]);
|
|
2501
2501
|
return r;
|
|
2502
2502
|
}
|
|
2503
2503
|
var ut = (e, t) => vr(e, t, Je(t)), xr = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) => B(e) ? e : t ? e === "" ? NaN : e && +e : r && te(e) ? new Date(e) : n ? n(e) : e;
|
|
2504
2504
|
function ct(e) {
|
|
2505
2505
|
const t = e.ref;
|
|
2506
2506
|
if (!(e.refs ? e.refs.every((r) => r.disabled) : t.disabled))
|
|
2507
|
-
return vt(t) ? t.files : xt(t) ? gr(e.refs).value :
|
|
2507
|
+
return vt(t) ? t.files : xt(t) ? gr(e.refs).value : yr(t) ? [...t.selectedOptions].map(({ value: r }) => r) : Oe(t) ? mr(e.refs).value : xr(B(t.value) ? e.ref.value : t.value, e);
|
|
2508
2508
|
}
|
|
2509
|
-
var
|
|
2509
|
+
var Yn = (e, t, r, n) => {
|
|
2510
2510
|
const s = {};
|
|
2511
2511
|
for (const a of e) {
|
|
2512
2512
|
const i = x(t, a);
|
|
@@ -2518,10 +2518,10 @@ var Qn = (e, t, r, n) => {
|
|
|
2518
2518
|
fields: s,
|
|
2519
2519
|
shouldUseNativeValidation: n
|
|
2520
2520
|
};
|
|
2521
|
-
}, Ie = (e) => B(e) ? e : He(e) ? e.source : $(e) ? He(e.value) ? e.value.source : e.value : e,
|
|
2521
|
+
}, Ie = (e) => B(e) ? e : He(e) ? e.source : $(e) ? He(e.value) ? e.value.source : e.value : e, es = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2522
2522
|
function Gt(e, t, r) {
|
|
2523
2523
|
const n = x(e, r);
|
|
2524
|
-
if (n ||
|
|
2524
|
+
if (n || bt(r))
|
|
2525
2525
|
return {
|
|
2526
2526
|
error: n,
|
|
2527
2527
|
name: r
|
|
@@ -2542,15 +2542,15 @@ function Gt(e, t, r) {
|
|
|
2542
2542
|
name: r
|
|
2543
2543
|
};
|
|
2544
2544
|
}
|
|
2545
|
-
var
|
|
2546
|
-
const
|
|
2545
|
+
var ts = (e, t, r, n, s) => s.isOnAll ? !1 : !r && s.isOnTouch ? !(t || e) : (r ? n.isOnBlur : s.isOnBlur) ? !e : (r ? n.isOnChange : s.isOnChange) ? e : !0, rs = (e, t) => !Be(x(e, t)).length && j(e, t);
|
|
2546
|
+
const ns = {
|
|
2547
2547
|
mode: Z.onSubmit,
|
|
2548
2548
|
reValidateMode: Z.onChange,
|
|
2549
2549
|
shouldFocusError: !0
|
|
2550
2550
|
};
|
|
2551
|
-
function
|
|
2551
|
+
function ss(e = {}, t) {
|
|
2552
2552
|
let r = {
|
|
2553
|
-
...
|
|
2553
|
+
...ns,
|
|
2554
2554
|
...e
|
|
2555
2555
|
}, n = {
|
|
2556
2556
|
submitCount: 0,
|
|
@@ -2586,7 +2586,7 @@ function ns(e = {}, t) {
|
|
|
2586
2586
|
values: ot(),
|
|
2587
2587
|
array: ot(),
|
|
2588
2588
|
state: ot()
|
|
2589
|
-
}, k = e.resetOptions && e.resetOptions.keepDirtyValues,
|
|
2589
|
+
}, k = e.resetOptions && e.resetOptions.keepDirtyValues, b = Pt(r.mode), A = Pt(r.reValidateMode), S = r.criteriaMode === Z.all, E = (o) => (c) => {
|
|
2590
2590
|
clearTimeout(w), w = setTimeout(o, c);
|
|
2591
2591
|
}, g = async (o) => {
|
|
2592
2592
|
if (v.isValid || o) {
|
|
@@ -2597,19 +2597,19 @@ function ns(e = {}, t) {
|
|
|
2597
2597
|
}
|
|
2598
2598
|
}, M = (o) => v.isValidating && h.state.next({
|
|
2599
2599
|
isValidating: o
|
|
2600
|
-
}), R = (o, c = [], f, _,
|
|
2600
|
+
}), R = (o, c = [], f, _, y = !0, m = !0) => {
|
|
2601
2601
|
if (_ && f) {
|
|
2602
2602
|
if (u.action = !0, m && Array.isArray(x(s, o))) {
|
|
2603
2603
|
const C = f(x(s, o), _.argA, _.argB);
|
|
2604
|
-
|
|
2604
|
+
y && L(s, o, C);
|
|
2605
2605
|
}
|
|
2606
2606
|
if (m && Array.isArray(x(n.errors, o))) {
|
|
2607
2607
|
const C = f(x(n.errors, o), _.argA, _.argB);
|
|
2608
|
-
|
|
2608
|
+
y && L(n.errors, o, C), rs(n.errors, o);
|
|
2609
2609
|
}
|
|
2610
2610
|
if (v.touchedFields && m && Array.isArray(x(n.touchedFields, o))) {
|
|
2611
2611
|
const C = f(x(n.touchedFields, o), _.argA, _.argB);
|
|
2612
|
-
|
|
2612
|
+
y && L(n.touchedFields, o, C);
|
|
2613
2613
|
}
|
|
2614
2614
|
v.dirtyFields && (n.dirtyFields = ut(a, i)), h.state.next({
|
|
2615
2615
|
name: o,
|
|
@@ -2625,29 +2625,29 @@ function ns(e = {}, t) {
|
|
|
2625
2625
|
errors: n.errors
|
|
2626
2626
|
});
|
|
2627
2627
|
}, me = (o, c, f, _) => {
|
|
2628
|
-
const
|
|
2629
|
-
if (
|
|
2628
|
+
const y = x(s, o);
|
|
2629
|
+
if (y) {
|
|
2630
2630
|
const m = x(i, o, B(f) ? x(a, o) : f);
|
|
2631
|
-
B(m) || _ && _.defaultChecked || c ? L(i, o, c ? m : ct(
|
|
2631
|
+
B(m) || _ && _.defaultChecked || c ? L(i, o, c ? m : ct(y._f)) : W(o, m), u.mount && g();
|
|
2632
2632
|
}
|
|
2633
|
-
}, ce = (o, c, f, _,
|
|
2633
|
+
}, ce = (o, c, f, _, y) => {
|
|
2634
2634
|
let m = !1, C = !1;
|
|
2635
2635
|
const T = {
|
|
2636
2636
|
name: o
|
|
2637
2637
|
};
|
|
2638
2638
|
if (!f || _) {
|
|
2639
2639
|
v.isDirty && (C = n.isDirty, n.isDirty = T.isDirty = V(), m = C !== T.isDirty);
|
|
2640
|
-
const P =
|
|
2640
|
+
const P = ye(x(a, o), c);
|
|
2641
2641
|
C = x(n.dirtyFields, o), P ? j(n.dirtyFields, o) : L(n.dirtyFields, o, !0), T.dirtyFields = n.dirtyFields, m = m || v.dirtyFields && C !== !P;
|
|
2642
2642
|
}
|
|
2643
2643
|
if (f) {
|
|
2644
2644
|
const P = x(n.touchedFields, o);
|
|
2645
2645
|
P || (L(n.touchedFields, o, f), T.touchedFields = n.touchedFields, m = m || v.touchedFields && P !== f);
|
|
2646
2646
|
}
|
|
2647
|
-
return m &&
|
|
2647
|
+
return m && y && h.state.next(T), m ? T : {};
|
|
2648
2648
|
}, Ee = (o, c, f, _) => {
|
|
2649
|
-
const
|
|
2650
|
-
if (e.delayError && f ? (p = E(() => N(o, f)), p(e.delayError)) : (clearTimeout(w), p = null, f ? L(n.errors, o, f) : j(n.errors, o)), (f ? !
|
|
2649
|
+
const y = x(n.errors, o), m = v.isValid && de(c) && n.isValid !== c;
|
|
2650
|
+
if (e.delayError && f ? (p = E(() => N(o, f)), p(e.delayError)) : (clearTimeout(w), p = null, f ? L(n.errors, o, f) : j(n.errors, o)), (f ? !ye(y, f) : y) || !J(_) || m) {
|
|
2651
2651
|
const C = {
|
|
2652
2652
|
..._,
|
|
2653
2653
|
...m && de(c) ? { isValid: c } : {},
|
|
@@ -2660,7 +2660,7 @@ function ns(e = {}, t) {
|
|
|
2660
2660
|
}, h.state.next(C);
|
|
2661
2661
|
}
|
|
2662
2662
|
M(!1);
|
|
2663
|
-
}, H = async (o) => r.resolver(i, r.context,
|
|
2663
|
+
}, H = async (o) => r.resolver(i, r.context, Yn(o || d.mount, s, r.criteriaMode, r.shouldUseNativeValidation)), se = async (o) => {
|
|
2664
2664
|
const { errors: c } = await H(o);
|
|
2665
2665
|
if (o)
|
|
2666
2666
|
for (const f of o) {
|
|
@@ -2674,14 +2674,14 @@ function ns(e = {}, t) {
|
|
|
2674
2674
|
valid: !0
|
|
2675
2675
|
}) => {
|
|
2676
2676
|
for (const _ in o) {
|
|
2677
|
-
const
|
|
2678
|
-
if (
|
|
2679
|
-
const { _f: m, ...C } =
|
|
2677
|
+
const y = o[_];
|
|
2678
|
+
if (y) {
|
|
2679
|
+
const { _f: m, ...C } = y;
|
|
2680
2680
|
if (m) {
|
|
2681
|
-
const T = d.array.has(m.name), P = await Kt(
|
|
2681
|
+
const T = d.array.has(m.name), P = await Kt(y, i, S, r.shouldUseNativeValidation && !c, T);
|
|
2682
2682
|
if (P[m.name] && (f.valid = !1, c))
|
|
2683
2683
|
break;
|
|
2684
|
-
!c && (x(P, m.name) ? T ?
|
|
2684
|
+
!c && (x(P, m.name) ? T ? Jn(n.errors, P, m.name) : L(n.errors, m.name, P[m.name]) : j(n.errors, m.name));
|
|
2685
2685
|
}
|
|
2686
2686
|
C && await q(C, c, f);
|
|
2687
2687
|
}
|
|
@@ -2693,27 +2693,27 @@ function ns(e = {}, t) {
|
|
|
2693
2693
|
c && (c._f.refs ? c._f.refs.every((f) => !lt(f)) : !lt(c._f.ref)) && tt(o);
|
|
2694
2694
|
}
|
|
2695
2695
|
d.unMount = /* @__PURE__ */ new Set();
|
|
2696
|
-
}, V = (o, c) => (o && c && L(i, o, c), !
|
|
2696
|
+
}, V = (o, c) => (o && c && L(i, o, c), !ye(wt(), a)), O = (o, c, f) => Wn(o, d, {
|
|
2697
2697
|
...u.mount ? i : B(c) ? a : te(o) ? { [o]: c } : c
|
|
2698
2698
|
}, f, c), K = (o) => Be(x(u.mount ? i : a, o, e.shouldUnregister ? x(a, o, []) : [])), W = (o, c, f = {}) => {
|
|
2699
2699
|
const _ = x(s, o);
|
|
2700
|
-
let
|
|
2700
|
+
let y = c;
|
|
2701
2701
|
if (_) {
|
|
2702
2702
|
const m = _._f;
|
|
2703
|
-
m && (!m.disabled && L(i, o, xr(c, m)),
|
|
2703
|
+
m && (!m.disabled && L(i, o, xr(c, m)), y = Ge(m.ref) && U(c) ? "" : c, yr(m.ref) ? [...m.ref.options].forEach((C) => C.selected = y.includes(C.value)) : m.refs ? Oe(m.ref) ? m.refs.length > 1 ? m.refs.forEach((C) => (!C.defaultChecked || !C.disabled) && (C.checked = Array.isArray(y) ? !!y.find((T) => T === C.value) : y === C.value)) : m.refs[0] && (m.refs[0].checked = !!y) : m.refs.forEach((C) => C.checked = C.value === y) : vt(m.ref) ? m.ref.value = "" : (m.ref.value = y, m.ref.type || h.values.next({
|
|
2704
2704
|
name: o,
|
|
2705
2705
|
values: { ...i }
|
|
2706
2706
|
})));
|
|
2707
2707
|
}
|
|
2708
|
-
(f.shouldDirty || f.shouldTouch) && ce(o,
|
|
2708
|
+
(f.shouldDirty || f.shouldTouch) && ce(o, y, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && et(o);
|
|
2709
2709
|
}, X = (o, c, f) => {
|
|
2710
2710
|
for (const _ in c) {
|
|
2711
|
-
const
|
|
2712
|
-
(d.array.has(o) || !We(
|
|
2711
|
+
const y = c[_], m = `${o}.${_}`, C = x(s, m);
|
|
2712
|
+
(d.array.has(o) || !We(y) || C && !C._f) && !ke(y) ? X(m, y, f) : W(m, y, f);
|
|
2713
2713
|
}
|
|
2714
2714
|
}, ge = (o, c, f = {}) => {
|
|
2715
|
-
const _ = x(s, o),
|
|
2716
|
-
L(i, o, m),
|
|
2715
|
+
const _ = x(s, o), y = d.array.has(o), m = oe(c);
|
|
2716
|
+
L(i, o, m), y ? (h.array.next({
|
|
2717
2717
|
name: o,
|
|
2718
2718
|
values: { ...i }
|
|
2719
2719
|
}), (v.isDirty || v.dirtyFields) && f.shouldDirty && h.state.next({
|
|
@@ -2727,41 +2727,41 @@ function ns(e = {}, t) {
|
|
|
2727
2727
|
}, Ae = async (o) => {
|
|
2728
2728
|
const c = o.target;
|
|
2729
2729
|
let f = c.name, _ = !0;
|
|
2730
|
-
const
|
|
2730
|
+
const y = x(s, f), m = () => c.type ? ct(y._f) : jn(o), C = (T) => {
|
|
2731
2731
|
_ = Number.isNaN(T) || T === x(i, f, T);
|
|
2732
2732
|
};
|
|
2733
|
-
if (
|
|
2733
|
+
if (y) {
|
|
2734
2734
|
let T, P;
|
|
2735
|
-
const $e = m(),
|
|
2736
|
-
L(i, f, $e),
|
|
2737
|
-
const st = ce(f, $e,
|
|
2738
|
-
if (!
|
|
2735
|
+
const $e = m(), we = o.type === Bt.BLUR || o.type === Bt.FOCUS_OUT, Er = !es(y._f) && !r.resolver && !x(n.errors, f) && !y._f.deps || ts(we, x(n.touchedFields, f), n.isSubmitted, A, b), nt = $t(f, d, we);
|
|
2736
|
+
L(i, f, $e), we ? (y._f.onBlur && y._f.onBlur(o), p && p(0)) : y._f.onChange && y._f.onChange(o);
|
|
2737
|
+
const st = ce(f, $e, we, !1), Ar = !J(st) || nt;
|
|
2738
|
+
if (!we && h.values.next({
|
|
2739
2739
|
name: f,
|
|
2740
2740
|
type: o.type,
|
|
2741
2741
|
values: { ...i }
|
|
2742
2742
|
}), Er)
|
|
2743
2743
|
return v.isValid && g(), Ar && h.state.next({ name: f, ...nt ? {} : st });
|
|
2744
|
-
if (!
|
|
2744
|
+
if (!we && nt && h.state.next({ ...n }), M(!0), r.resolver) {
|
|
2745
2745
|
const { errors: It } = await H([f]);
|
|
2746
2746
|
if (C($e), _) {
|
|
2747
2747
|
const Vr = Gt(n.errors, s, f), Mt = Gt(It, s, Vr.name || f);
|
|
2748
2748
|
T = Mt.error, f = Mt.name, P = J(It);
|
|
2749
2749
|
}
|
|
2750
2750
|
} else
|
|
2751
|
-
T = (await Kt(
|
|
2752
|
-
_ && (
|
|
2751
|
+
T = (await Kt(y, i, S, r.shouldUseNativeValidation))[f], C($e), _ && (T ? P = !1 : v.isValid && (P = await q(s, !0)));
|
|
2752
|
+
_ && (y._f.deps && et(y._f.deps), Ee(f, P, T, st));
|
|
2753
2753
|
}
|
|
2754
2754
|
}, Pe = (o, c) => {
|
|
2755
2755
|
if (x(n.errors, c) && o.focus)
|
|
2756
2756
|
return o.focus(), 1;
|
|
2757
2757
|
}, et = async (o, c = {}) => {
|
|
2758
2758
|
let f, _;
|
|
2759
|
-
const
|
|
2759
|
+
const y = it(o);
|
|
2760
2760
|
if (M(!0), r.resolver) {
|
|
2761
|
-
const m = await se(B(o) ? o :
|
|
2762
|
-
f = J(m), _ = o ? !
|
|
2761
|
+
const m = await se(B(o) ? o : y);
|
|
2762
|
+
f = J(m), _ = o ? !y.some((C) => x(m, C)) : f;
|
|
2763
2763
|
} else
|
|
2764
|
-
o ? (_ = (await Promise.all(
|
|
2764
|
+
o ? (_ = (await Promise.all(y.map(async (m) => {
|
|
2765
2765
|
const C = x(s, m);
|
|
2766
2766
|
return await q(C && C._f ? { [m]: C } : C);
|
|
2767
2767
|
}))).every(Boolean), !(!_ && !n.isValid) && g()) : _ = f = await q(s);
|
|
@@ -2770,7 +2770,7 @@ function ns(e = {}, t) {
|
|
|
2770
2770
|
...r.resolver || !o ? { isValid: f } : {},
|
|
2771
2771
|
errors: n.errors,
|
|
2772
2772
|
isValidating: !1
|
|
2773
|
-
}), c.shouldFocus && !_ && ze(s, Pe, o ?
|
|
2773
|
+
}), c.shouldFocus && !_ && ze(s, Pe, o ? y : d.mount), _;
|
|
2774
2774
|
}, wt = (o) => {
|
|
2775
2775
|
const c = {
|
|
2776
2776
|
...a,
|
|
@@ -2807,9 +2807,9 @@ function ns(e = {}, t) {
|
|
|
2807
2807
|
...n,
|
|
2808
2808
|
...c.keepDirty ? { isDirty: V() } : {}
|
|
2809
2809
|
}), !c.keepIsValid && g();
|
|
2810
|
-
}, St = ({ disabled: o, name: c, field: f, fields: _, value:
|
|
2810
|
+
}, St = ({ disabled: o, name: c, field: f, fields: _, value: y }) => {
|
|
2811
2811
|
if (de(o)) {
|
|
2812
|
-
const m = o ? void 0 : B(
|
|
2812
|
+
const m = o ? void 0 : B(y) ? ct(f ? f._f : x(_, c)._f) : y;
|
|
2813
2813
|
L(i, c, m), ce(c, m, !1, !1, !0);
|
|
2814
2814
|
}
|
|
2815
2815
|
}, rt = (o, c = {}) => {
|
|
@@ -2840,10 +2840,10 @@ function ns(e = {}, t) {
|
|
|
2840
2840
|
name: o,
|
|
2841
2841
|
onChange: Ae,
|
|
2842
2842
|
onBlur: Ae,
|
|
2843
|
-
ref: (
|
|
2844
|
-
if (
|
|
2843
|
+
ref: (y) => {
|
|
2844
|
+
if (y) {
|
|
2845
2845
|
rt(o, c), f = x(s, o);
|
|
2846
|
-
const m = B(
|
|
2846
|
+
const m = B(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, C = Qn(m), T = f._f.refs || [];
|
|
2847
2847
|
if (C ? T.find((P) => P === m) : m === f._f.ref)
|
|
2848
2848
|
return;
|
|
2849
2849
|
L(s, o, {
|
|
@@ -2860,7 +2860,7 @@ function ns(e = {}, t) {
|
|
|
2860
2860
|
}
|
|
2861
2861
|
}), me(o, !1, void 0, m);
|
|
2862
2862
|
} else
|
|
2863
|
-
f = x(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(
|
|
2863
|
+
f = x(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(qn(d.array, o) && u.action) && d.unMount.add(o);
|
|
2864
2864
|
}
|
|
2865
2865
|
};
|
|
2866
2866
|
}, Ct = () => r.shouldFocusError && ze(s, Pe, d.mount), Sr = (o) => {
|
|
@@ -2873,8 +2873,8 @@ function ns(e = {}, t) {
|
|
|
2873
2873
|
if (h.state.next({
|
|
2874
2874
|
isSubmitting: !0
|
|
2875
2875
|
}), r.resolver) {
|
|
2876
|
-
const { errors:
|
|
2877
|
-
n.errors =
|
|
2876
|
+
const { errors: y, values: m } = await H();
|
|
2877
|
+
n.errors = y, _ = m;
|
|
2878
2878
|
} else
|
|
2879
2879
|
await q(s);
|
|
2880
2880
|
j(n.errors, "root"), J(n.errors) ? (h.state.next({
|
|
@@ -2889,13 +2889,13 @@ function ns(e = {}, t) {
|
|
|
2889
2889
|
}, Cr = (o, c = {}) => {
|
|
2890
2890
|
x(s, o) && (B(c.defaultValue) ? ge(o, x(a, o)) : (ge(o, c.defaultValue), L(a, o, c.defaultValue)), c.keepTouched || j(n.touchedFields, o), c.keepDirty || (j(n.dirtyFields, o), n.isDirty = c.defaultValue ? V(o, x(a, o)) : V()), c.keepError || (j(n.errors, o), v.isValid && g()), h.state.next({ ...n }));
|
|
2891
2891
|
}, At = (o, c = {}) => {
|
|
2892
|
-
const f = o ? oe(o) : a, _ = oe(f),
|
|
2892
|
+
const f = o ? oe(o) : a, _ = oe(f), y = o && !J(o) ? _ : a;
|
|
2893
2893
|
if (c.keepDefaultValues || (a = f), !c.keepValues) {
|
|
2894
2894
|
if (c.keepDirtyValues || k)
|
|
2895
2895
|
for (const m of d.mount)
|
|
2896
|
-
x(n.dirtyFields, m) ? L(
|
|
2896
|
+
x(n.dirtyFields, m) ? L(y, m, x(i, m)) : ge(m, x(y, m));
|
|
2897
2897
|
else {
|
|
2898
|
-
if (
|
|
2898
|
+
if (yt && B(o))
|
|
2899
2899
|
for (const m of d.mount) {
|
|
2900
2900
|
const C = x(s, m);
|
|
2901
2901
|
if (C && C._f) {
|
|
@@ -2911,10 +2911,10 @@ function ns(e = {}, t) {
|
|
|
2911
2911
|
}
|
|
2912
2912
|
s = {};
|
|
2913
2913
|
}
|
|
2914
|
-
i = e.shouldUnregister ? c.keepDefaultValues ? oe(a) : {} : oe(
|
|
2915
|
-
values: { ...
|
|
2914
|
+
i = e.shouldUnregister ? c.keepDefaultValues ? oe(a) : {} : oe(y), h.array.next({
|
|
2915
|
+
values: { ...y }
|
|
2916
2916
|
}), h.values.next({
|
|
2917
|
-
values: { ...
|
|
2917
|
+
values: { ...y }
|
|
2918
2918
|
});
|
|
2919
2919
|
}
|
|
2920
2920
|
d = {
|
|
@@ -2926,7 +2926,7 @@ function ns(e = {}, t) {
|
|
|
2926
2926
|
focus: ""
|
|
2927
2927
|
}, !u.mount && t(), u.mount = !v.isValid || !!c.keepIsValid, u.watch = !!e.shouldUnregister, h.state.next({
|
|
2928
2928
|
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
2929
|
-
isDirty: c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !
|
|
2929
|
+
isDirty: c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !ye(o, a)),
|
|
2930
2930
|
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
2931
2931
|
dirtyFields: c.keepDirtyValues ? n.dirtyFields : c.keepDefaultValues && o ? ut(a, o) : {},
|
|
2932
2932
|
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
@@ -3016,8 +3016,8 @@ function ns(e = {}, t) {
|
|
|
3016
3016
|
setFocus: (o, c = {}) => {
|
|
3017
3017
|
const f = x(s, o), _ = f && f._f;
|
|
3018
3018
|
if (_) {
|
|
3019
|
-
const
|
|
3020
|
-
|
|
3019
|
+
const y = _.refs ? _.refs[0] : _.ref;
|
|
3020
|
+
y.focus && (y.focus(), c.shouldSelect && y.select());
|
|
3021
3021
|
}
|
|
3022
3022
|
},
|
|
3023
3023
|
getFieldState: _t
|
|
@@ -3040,14 +3040,14 @@ function Qe(e = {}) {
|
|
|
3040
3040
|
defaultValues: fe(e.defaultValues) ? void 0 : e.defaultValues
|
|
3041
3041
|
});
|
|
3042
3042
|
t.current || (t.current = {
|
|
3043
|
-
...
|
|
3043
|
+
...ss(e, () => s((i) => ({ ...i }))),
|
|
3044
3044
|
formState: n
|
|
3045
3045
|
});
|
|
3046
3046
|
const a = t.current.control;
|
|
3047
|
-
return a._options = e,
|
|
3047
|
+
return a._options = e, Hn({
|
|
3048
3048
|
subject: a._subjects.state,
|
|
3049
3049
|
next: (i) => {
|
|
3050
|
-
|
|
3050
|
+
Gn(i, a._proxyFormState, a._updateFormState, !0) && s({ ...a._formState });
|
|
3051
3051
|
}
|
|
3052
3052
|
}), Q.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), Q.useEffect(() => {
|
|
3053
3053
|
if (a._proxyFormState.isDirty) {
|
|
@@ -3057,17 +3057,17 @@ function Qe(e = {}) {
|
|
|
3057
3057
|
});
|
|
3058
3058
|
}
|
|
3059
3059
|
}, [a, n.isDirty]), Q.useEffect(() => {
|
|
3060
|
-
e.values && !
|
|
3060
|
+
e.values && !ye(e.values, r.current) ? (a._reset(e.values, a._options.resetOptions), r.current = e.values) : a._resetDefaultValues();
|
|
3061
3061
|
}, [e.values, a]), Q.useEffect(() => {
|
|
3062
3062
|
a._state.mount || (a._updateValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
|
|
3063
|
-
}), t.current.formState =
|
|
3063
|
+
}), t.current.formState = Kn(n, a), t.current;
|
|
3064
3064
|
}
|
|
3065
3065
|
var Ht = function(e, t, r) {
|
|
3066
3066
|
if (e && "reportValidity" in e) {
|
|
3067
3067
|
var n = x(r, t);
|
|
3068
3068
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
3069
3069
|
}
|
|
3070
|
-
},
|
|
3070
|
+
}, as = function(e, t) {
|
|
3071
3071
|
var r = function(s) {
|
|
3072
3072
|
var a = t.fields[s];
|
|
3073
3073
|
a && a.ref && "reportValidity" in a.ref ? Ht(a.ref, s, e) : a.refs && a.refs.forEach(function(i) {
|
|
@@ -3076,25 +3076,25 @@ var Ht = function(e, t, r) {
|
|
|
3076
3076
|
};
|
|
3077
3077
|
for (var n in t.fields)
|
|
3078
3078
|
r(n);
|
|
3079
|
-
},
|
|
3080
|
-
t.shouldUseNativeValidation &&
|
|
3079
|
+
}, is = function(e, t) {
|
|
3080
|
+
t.shouldUseNativeValidation && as(e, t);
|
|
3081
3081
|
var r = {};
|
|
3082
3082
|
for (var n in e) {
|
|
3083
3083
|
var s = x(t.fields, n), a = Object.assign(e[n] || {}, { ref: s && s.ref });
|
|
3084
|
-
if (
|
|
3085
|
-
var i = Object.assign({},
|
|
3084
|
+
if (ls(t.names || Object.keys(e), n)) {
|
|
3085
|
+
var i = Object.assign({}, os(x(r, n)));
|
|
3086
3086
|
L(i, "root", a), L(r, n, i);
|
|
3087
3087
|
} else
|
|
3088
3088
|
L(r, n, a);
|
|
3089
3089
|
}
|
|
3090
3090
|
return r;
|
|
3091
|
-
},
|
|
3091
|
+
}, os = function(e) {
|
|
3092
3092
|
return Array.isArray(e) ? e.filter(Boolean) : [];
|
|
3093
|
-
},
|
|
3093
|
+
}, ls = function(e, t) {
|
|
3094
3094
|
return e.some(function(r) {
|
|
3095
3095
|
return r.startsWith(t + ".");
|
|
3096
3096
|
});
|
|
3097
|
-
},
|
|
3097
|
+
}, us = function(e, t) {
|
|
3098
3098
|
for (var r = {}; e.issues.length; ) {
|
|
3099
3099
|
var n = e.issues[0];
|
|
3100
3100
|
if (n.path) {
|
|
@@ -3127,7 +3127,7 @@ var Ht = function(e, t, r) {
|
|
|
3127
3127
|
return d && d.then ? d.then(void 0, u) : d;
|
|
3128
3128
|
}(0, function(i) {
|
|
3129
3129
|
if (i instanceof Rr)
|
|
3130
|
-
return { values: {}, errors:
|
|
3130
|
+
return { values: {}, errors: is(us(i, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a) };
|
|
3131
3131
|
throw i;
|
|
3132
3132
|
}));
|
|
3133
3133
|
} catch (i) {
|
|
@@ -3135,7 +3135,7 @@ var Ht = function(e, t, r) {
|
|
|
3135
3135
|
}
|
|
3136
3136
|
};
|
|
3137
3137
|
};
|
|
3138
|
-
const Wt = 27, Jt = 12, Zt = 10,
|
|
3138
|
+
const Wt = 27, Jt = 12, Zt = 10, cs = Se("enum"), ds = (e, t) => {
|
|
3139
3139
|
const r = {
|
|
3140
3140
|
min: e.minSelected ?? 0,
|
|
3141
3141
|
max: e.maxSelected ?? e.options.length
|
|
@@ -3147,10 +3147,10 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3147
3147
|
count: r.min
|
|
3148
3148
|
}))])
|
|
3149
3149
|
}));
|
|
3150
|
-
},
|
|
3150
|
+
}, fs = rr(({
|
|
3151
3151
|
option: e,
|
|
3152
3152
|
...t
|
|
3153
|
-
}, r) => l(
|
|
3153
|
+
}, r) => l(be, {
|
|
3154
3154
|
children: [l("input", {
|
|
3155
3155
|
class: "peer sr-only h-full",
|
|
3156
3156
|
type: "checkbox",
|
|
@@ -3170,7 +3170,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3170
3170
|
booleanLike: ur
|
|
3171
3171
|
}
|
|
3172
3172
|
}
|
|
3173
|
-
}),
|
|
3173
|
+
}), hs = ({
|
|
3174
3174
|
input: e,
|
|
3175
3175
|
onSubmitSuccess: t
|
|
3176
3176
|
}) => {
|
|
@@ -3185,9 +3185,9 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3185
3185
|
}
|
|
3186
3186
|
} = Qe({
|
|
3187
3187
|
defaultValues: {
|
|
3188
|
-
checked: n ? {} :
|
|
3188
|
+
checked: n ? {} : cs(r) ? Object.fromEntries(r.value.map((h) => [h, !0])) : {}
|
|
3189
3189
|
},
|
|
3190
|
-
resolver:
|
|
3190
|
+
resolver: ds(e.config, a)
|
|
3191
3191
|
}), p = gt();
|
|
3192
3192
|
return s ? l("ul", {
|
|
3193
3193
|
style: {
|
|
@@ -3200,8 +3200,8 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3200
3200
|
class: "flex-1",
|
|
3201
3201
|
children: l(cr, {
|
|
3202
3202
|
type: "submit",
|
|
3203
|
-
ref: (
|
|
3204
|
-
|
|
3203
|
+
ref: (b) => {
|
|
3204
|
+
b && k === 0 && (p.current = b);
|
|
3205
3205
|
},
|
|
3206
3206
|
label: h.label,
|
|
3207
3207
|
value: "true",
|
|
@@ -3214,10 +3214,10 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3214
3214
|
}) : l("form", {
|
|
3215
3215
|
noValidate: !0,
|
|
3216
3216
|
onSubmit: (h) => u((k) => {
|
|
3217
|
-
const
|
|
3217
|
+
const b = k.checked;
|
|
3218
3218
|
t({
|
|
3219
3219
|
type: "enum",
|
|
3220
|
-
value:
|
|
3220
|
+
value: b
|
|
3221
3221
|
});
|
|
3222
3222
|
})(h),
|
|
3223
3223
|
children: [l("div", {
|
|
@@ -3230,19 +3230,19 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3230
3230
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3231
3231
|
}),
|
|
3232
3232
|
children: e.config.options.map((h, k) => {
|
|
3233
|
-
const
|
|
3233
|
+
const b = `checked.${h.value}`, {
|
|
3234
3234
|
ref: A,
|
|
3235
3235
|
...S
|
|
3236
|
-
} = i(
|
|
3236
|
+
} = i(b);
|
|
3237
3237
|
return l("li", {
|
|
3238
3238
|
class: "relative",
|
|
3239
|
-
children: l(
|
|
3239
|
+
children: l(fs, {
|
|
3240
3240
|
option: h,
|
|
3241
3241
|
autoFocus: k === 0,
|
|
3242
3242
|
ref: (E) => {
|
|
3243
3243
|
E && k === 0 && (p.current = E), A(E);
|
|
3244
3244
|
},
|
|
3245
|
-
id:
|
|
3245
|
+
id: b,
|
|
3246
3246
|
...S,
|
|
3247
3247
|
onClick: n ? () => t({
|
|
3248
3248
|
type: "enum",
|
|
@@ -3253,7 +3253,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3253
3253
|
})
|
|
3254
3254
|
}), l("div", {
|
|
3255
3255
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3256
|
-
children: [n ? null : l(
|
|
3256
|
+
children: [n ? null : l(ve, {}), e.config.minSelected === 0 && l(xe, {
|
|
3257
3257
|
type: "button",
|
|
3258
3258
|
onClick: () => t({
|
|
3259
3259
|
type: "enum",
|
|
@@ -3268,7 +3268,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3268
3268
|
})
|
|
3269
3269
|
})]
|
|
3270
3270
|
});
|
|
3271
|
-
},
|
|
3271
|
+
}, ps = Se("number"), ms = (e, t) => {
|
|
3272
3272
|
const r = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
|
|
3273
3273
|
return Ye(he({
|
|
3274
3274
|
number: Pr(t("validation_number"), [$r(r, t("validation_number_min", {
|
|
@@ -3279,7 +3279,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3279
3279
|
count: s
|
|
3280
3280
|
}))])
|
|
3281
3281
|
}));
|
|
3282
|
-
},
|
|
3282
|
+
}, gs = ({
|
|
3283
3283
|
input: e,
|
|
3284
3284
|
onSubmitSuccess: t
|
|
3285
3285
|
}) => {
|
|
@@ -3294,9 +3294,9 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3294
3294
|
}
|
|
3295
3295
|
} = Qe({
|
|
3296
3296
|
defaultValues: {
|
|
3297
|
-
number: r ? Number(r) :
|
|
3297
|
+
number: r ? Number(r) : ps(n) ? n.value : void 0
|
|
3298
3298
|
},
|
|
3299
|
-
resolver:
|
|
3299
|
+
resolver: ms(e.config, s)
|
|
3300
3300
|
}), {
|
|
3301
3301
|
ref: d,
|
|
3302
3302
|
...p
|
|
@@ -3336,16 +3336,16 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3336
3336
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3337
3337
|
}),
|
|
3338
3338
|
placeholder: e.config.placeholder
|
|
3339
|
-
}), e.config.optional && l(
|
|
3339
|
+
}), e.config.optional && l(xe, {
|
|
3340
3340
|
class: "absolute right-0 top-0",
|
|
3341
3341
|
onClick: () => t(null)
|
|
3342
3342
|
})]
|
|
3343
|
-
}), l(
|
|
3343
|
+
}), l(ve, {})]
|
|
3344
3344
|
}), l(Ce, {
|
|
3345
3345
|
error: u.number
|
|
3346
3346
|
})]
|
|
3347
3347
|
});
|
|
3348
|
-
},
|
|
3348
|
+
}, ys = (e) => {
|
|
3349
3349
|
if (e === "")
|
|
3350
3350
|
return {
|
|
3351
3351
|
countryCode: "",
|
|
@@ -3359,20 +3359,20 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3359
3359
|
countryCode: "",
|
|
3360
3360
|
phoneNumber: ""
|
|
3361
3361
|
};
|
|
3362
|
-
}, bs = "44",
|
|
3363
|
-
const t = ee(e("validation_country_code"), [qr(
|
|
3362
|
+
}, bs = "44", vs = /^[0-9 ]+$/, xs = Se("string"), ws = Se("phone"), _s = (e) => {
|
|
3363
|
+
const t = ee(e("validation_country_code"), [qr(vs, e("validation_country_code"))]), r = sr(ee(e("validation_phone"), [Te(1, e("validation_phone"))]), (n) => n.replace(/[^0-9]/g, ""), []);
|
|
3364
3364
|
return Ye(he({
|
|
3365
3365
|
countryCode: t,
|
|
3366
3366
|
phoneNumber: r
|
|
3367
3367
|
}));
|
|
3368
|
-
},
|
|
3368
|
+
}, ks = ({
|
|
3369
3369
|
input: e,
|
|
3370
3370
|
onSubmitSuccess: t
|
|
3371
3371
|
}) => {
|
|
3372
3372
|
var A;
|
|
3373
3373
|
const r = e.key ? (A = I.current$.value.flow) == null ? void 0 : A.data.submissions[e.key] : void 0, {
|
|
3374
3374
|
t: n
|
|
3375
|
-
} = G(), [s, a] = Y(), i =
|
|
3375
|
+
} = G(), [s, a] = Y(), i = xs(r) ? ys(r.value) : ws(r) ? r.value : void 0, {
|
|
3376
3376
|
register: u,
|
|
3377
3377
|
handleSubmit: d,
|
|
3378
3378
|
formState: {
|
|
@@ -3384,13 +3384,13 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3384
3384
|
countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ?? bs,
|
|
3385
3385
|
phoneNumber: (i == null ? void 0 : i.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3386
3386
|
},
|
|
3387
|
-
resolver:
|
|
3387
|
+
resolver: _s(n)
|
|
3388
3388
|
}), {
|
|
3389
3389
|
ref: v,
|
|
3390
3390
|
...h
|
|
3391
3391
|
} = u("phoneNumber", {
|
|
3392
3392
|
required: !e.config.optional
|
|
3393
|
-
}), k = re(),
|
|
3393
|
+
}), k = re(), b = w("countryCode");
|
|
3394
3394
|
return pe(() => {
|
|
3395
3395
|
k.current && (k.current.focus(), k.current.select());
|
|
3396
3396
|
}, []), l("form", {
|
|
@@ -3412,7 +3412,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3412
3412
|
}
|
|
3413
3413
|
}) : t({
|
|
3414
3414
|
type: "string",
|
|
3415
|
-
value:
|
|
3415
|
+
value: b + S.phoneNumber
|
|
3416
3416
|
});
|
|
3417
3417
|
}),
|
|
3418
3418
|
children: [l("div", {
|
|
@@ -3423,7 +3423,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3423
3423
|
class: "text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",
|
|
3424
3424
|
htmlFor: `isdk_phone_${e.key}`,
|
|
3425
3425
|
children: [l("span", {
|
|
3426
|
-
children: ["+",
|
|
3426
|
+
children: ["+", b]
|
|
3427
3427
|
}), l("select", {
|
|
3428
3428
|
...u("countryCode", {}),
|
|
3429
3429
|
id: `isdk_phone_${e.key}`,
|
|
@@ -3450,18 +3450,18 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3450
3450
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3451
3451
|
}),
|
|
3452
3452
|
placeholder: e.config.placeholder
|
|
3453
|
-
}), e.config.optional && l(
|
|
3453
|
+
}), e.config.optional && l(xe, {
|
|
3454
3454
|
class: "absolute bottom-0 right-0 top-0",
|
|
3455
3455
|
onClick: () => t(null)
|
|
3456
3456
|
})]
|
|
3457
|
-
}), l(
|
|
3457
|
+
}), l(ve, {})]
|
|
3458
3458
|
}), l(Ce, {
|
|
3459
3459
|
error: p.countryCode || p.phoneNumber || {
|
|
3460
3460
|
message: s
|
|
3461
3461
|
}
|
|
3462
3462
|
})]
|
|
3463
3463
|
});
|
|
3464
|
-
},
|
|
3464
|
+
}, Ss = ({
|
|
3465
3465
|
input: e,
|
|
3466
3466
|
onSubmitSuccess: t
|
|
3467
3467
|
}) => l("div", {
|
|
@@ -3493,7 +3493,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3493
3493
|
})]
|
|
3494
3494
|
})
|
|
3495
3495
|
})
|
|
3496
|
-
}),
|
|
3496
|
+
}), Cs = {
|
|
3497
3497
|
email: {
|
|
3498
3498
|
type: "email",
|
|
3499
3499
|
inputMode: "email",
|
|
@@ -3508,7 +3508,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3508
3508
|
inputMode: "url",
|
|
3509
3509
|
formNoValidate: !0
|
|
3510
3510
|
}
|
|
3511
|
-
},
|
|
3511
|
+
}, Es = Se("string"), As = (e, t) => {
|
|
3512
3512
|
const r = {
|
|
3513
3513
|
maxLength: t("validation_max_chars", {
|
|
3514
3514
|
count: e.maxChars ?? 999
|
|
@@ -3524,7 +3524,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3524
3524
|
url: ee([Kr(t("validation_url")), Te(e.minChars ?? 1, r.minLength), je(e.maxChars ?? 1 / 0, r.maxLength)])
|
|
3525
3525
|
}[e.format]
|
|
3526
3526
|
}));
|
|
3527
|
-
},
|
|
3527
|
+
}, Vs = ({
|
|
3528
3528
|
input: e,
|
|
3529
3529
|
onSubmitSuccess: t
|
|
3530
3530
|
}) => {
|
|
@@ -3539,9 +3539,9 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3539
3539
|
}
|
|
3540
3540
|
} = Qe({
|
|
3541
3541
|
defaultValues: {
|
|
3542
|
-
text: s || (
|
|
3542
|
+
text: s || (Es(n) ? n.value : "")
|
|
3543
3543
|
},
|
|
3544
|
-
resolver:
|
|
3544
|
+
resolver: As(e.config, r)
|
|
3545
3545
|
}), {
|
|
3546
3546
|
ref: d,
|
|
3547
3547
|
...p
|
|
@@ -3566,7 +3566,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3566
3566
|
children: [l("input", {
|
|
3567
3567
|
id: "chat-input",
|
|
3568
3568
|
...p,
|
|
3569
|
-
...
|
|
3569
|
+
...Cs[e.config.format],
|
|
3570
3570
|
autocomplete: "off",
|
|
3571
3571
|
autoCapitalize: "off",
|
|
3572
3572
|
autoCorrect: "off",
|
|
@@ -3579,29 +3579,29 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3579
3579
|
optional: !!e.config.optional,
|
|
3580
3580
|
className: "w-full rounded-full"
|
|
3581
3581
|
})
|
|
3582
|
-
}), e.config.optional && l(
|
|
3582
|
+
}), e.config.optional && l(xe, {
|
|
3583
3583
|
class: "absolute right-0 top-0",
|
|
3584
3584
|
onClick: () => t(null)
|
|
3585
3585
|
})]
|
|
3586
|
-
}), l(
|
|
3586
|
+
}), l(ve, {})]
|
|
3587
3587
|
}), l(Ce, {
|
|
3588
3588
|
error: u.text
|
|
3589
3589
|
})]
|
|
3590
3590
|
});
|
|
3591
|
-
},
|
|
3592
|
-
text:
|
|
3593
|
-
phone:
|
|
3594
|
-
"multiple-choice":
|
|
3595
|
-
boolean:
|
|
3596
|
-
file:
|
|
3597
|
-
submit:
|
|
3598
|
-
address:
|
|
3599
|
-
number:
|
|
3600
|
-
},
|
|
3591
|
+
}, Is = {
|
|
3592
|
+
text: Vs,
|
|
3593
|
+
phone: ks,
|
|
3594
|
+
"multiple-choice": hs,
|
|
3595
|
+
boolean: Nn,
|
|
3596
|
+
file: $n,
|
|
3597
|
+
submit: Ss,
|
|
3598
|
+
address: In,
|
|
3599
|
+
number: gs
|
|
3600
|
+
}, Ms = ({
|
|
3601
3601
|
logger: e
|
|
3602
3602
|
}) => {
|
|
3603
3603
|
var a;
|
|
3604
|
-
const t = (a = I.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] =
|
|
3604
|
+
const t = (a = I.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] = yn(), s = re(null);
|
|
3605
3605
|
return I.inputHeight$.value = n.height, ue(() => {
|
|
3606
3606
|
const i = s.current;
|
|
3607
3607
|
if (i)
|
|
@@ -3618,7 +3618,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3618
3618
|
ref: r,
|
|
3619
3619
|
class: "border-divider flex flex-col justify-end border-t",
|
|
3620
3620
|
children: t ? (() => {
|
|
3621
|
-
const i =
|
|
3621
|
+
const i = Is[t.type];
|
|
3622
3622
|
return l(i, {
|
|
3623
3623
|
logger: e,
|
|
3624
3624
|
onSubmitSuccess: z.onSubmitSuccessFn$.value,
|
|
@@ -3634,7 +3634,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3634
3634
|
className: "flex-grow rounded-full"
|
|
3635
3635
|
}),
|
|
3636
3636
|
disabled: !0
|
|
3637
|
-
}), l(
|
|
3637
|
+
}), l(ve, {
|
|
3638
3638
|
disabled: !0,
|
|
3639
3639
|
"aria-hidden": "true",
|
|
3640
3640
|
tabIndex: -1
|
|
@@ -3643,27 +3643,27 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3643
3643
|
})
|
|
3644
3644
|
});
|
|
3645
3645
|
};
|
|
3646
|
-
var
|
|
3646
|
+
var Fs = function(e) {
|
|
3647
3647
|
return e instanceof RegExp;
|
|
3648
|
-
},
|
|
3648
|
+
}, Ls = function(t) {
|
|
3649
3649
|
var r = /[\\^$.*+?()[\]{}|]/g, n = RegExp(r.source);
|
|
3650
3650
|
return t && n.test(t) ? t.replace(r, "\\$&") : t;
|
|
3651
3651
|
}, wr = function(e) {
|
|
3652
3652
|
return typeof e == "string";
|
|
3653
|
-
},
|
|
3653
|
+
}, Ns = function(e) {
|
|
3654
3654
|
var t = [];
|
|
3655
3655
|
return e.forEach(function(r) {
|
|
3656
3656
|
Array.isArray(r) ? t = t.concat(r) : t.push(r);
|
|
3657
3657
|
}), t;
|
|
3658
3658
|
};
|
|
3659
|
-
function
|
|
3659
|
+
function Ts(e, t, r) {
|
|
3660
3660
|
var n = 0, s = 0;
|
|
3661
3661
|
if (e === "")
|
|
3662
3662
|
return e;
|
|
3663
3663
|
if (!e || !wr(e))
|
|
3664
3664
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
3665
3665
|
var a = t;
|
|
3666
|
-
|
|
3666
|
+
Fs(a) || (a = new RegExp("(" + Ls(a) + ")", "gi"));
|
|
3667
3667
|
for (var i = e.split(a), u = 1, d = i.length; u < d; u += 2) {
|
|
3668
3668
|
if (i[u] === void 0 || i[u - 1] === void 0) {
|
|
3669
3669
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
@@ -3673,14 +3673,14 @@ function Ns(e, t, r) {
|
|
|
3673
3673
|
}
|
|
3674
3674
|
return i;
|
|
3675
3675
|
}
|
|
3676
|
-
var
|
|
3677
|
-
return Array.isArray(t) || (t = [t]),
|
|
3678
|
-
return wr(s) ?
|
|
3676
|
+
var Ds = function(t, r, n) {
|
|
3677
|
+
return Array.isArray(t) || (t = [t]), Ns(t.map(function(s) {
|
|
3678
|
+
return wr(s) ? Ts(s, r, n) : s;
|
|
3679
3679
|
}));
|
|
3680
3680
|
};
|
|
3681
|
-
const Me = /* @__PURE__ */ tr(
|
|
3682
|
-
const t = Me(e,
|
|
3683
|
-
const [, d, p] = i.match(
|
|
3681
|
+
const Me = /* @__PURE__ */ tr(Ds), Rs = /(\[[^\]]+\]\([^)]+\))/g, Os = /\[([^\]]+)\]\(([^)]+)\)/, Bs = /(https?:\/\/[^\s]+)/g, Ps = /_(.*?)_/g, $s = /\*\*(.*?)\*\*/g, js = /\\n|\n/g, Qt = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", zs = (e) => {
|
|
3682
|
+
const t = Me(e, Rs, (i, u) => {
|
|
3683
|
+
const [, d, p] = i.match(Os) ?? [];
|
|
3684
3684
|
return p ? l("a", {
|
|
3685
3685
|
class: Qt,
|
|
3686
3686
|
href: p,
|
|
@@ -3688,17 +3688,17 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3688
3688
|
}, p + u) : l("span", {
|
|
3689
3689
|
children: "INVALID LINK"
|
|
3690
3690
|
});
|
|
3691
|
-
}), r = Me(t,
|
|
3691
|
+
}), r = Me(t, Bs, (i, u) => l("a", {
|
|
3692
3692
|
class: Qt,
|
|
3693
3693
|
href: i,
|
|
3694
3694
|
children: i
|
|
3695
|
-
}, i + u)), n = Me(r,
|
|
3695
|
+
}, i + u)), n = Me(r, Ps, (i, u) => l("em", {
|
|
3696
3696
|
children: i
|
|
3697
|
-
}, i + u)), s = Me(n,
|
|
3697
|
+
}, i + u)), s = Me(n, $s, (i, u) => l("strong", {
|
|
3698
3698
|
children: i
|
|
3699
3699
|
}, i + u));
|
|
3700
|
-
return Me(s,
|
|
3701
|
-
},
|
|
3700
|
+
return Me(s, js, (i, u) => l("br", {}, `br-${u}`));
|
|
3701
|
+
}, qs = Ze("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
|
|
3702
3702
|
variants: {
|
|
3703
3703
|
side: {
|
|
3704
3704
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -3712,7 +3712,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3712
3712
|
defaultVariants: {
|
|
3713
3713
|
side: "left"
|
|
3714
3714
|
}
|
|
3715
|
-
}),
|
|
3715
|
+
}), Us = ({
|
|
3716
3716
|
children: e,
|
|
3717
3717
|
className: t,
|
|
3718
3718
|
animate: r,
|
|
@@ -3722,14 +3722,14 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3722
3722
|
style: {
|
|
3723
3723
|
transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
|
|
3724
3724
|
},
|
|
3725
|
-
class:
|
|
3725
|
+
class: qs({
|
|
3726
3726
|
className: t,
|
|
3727
3727
|
side: n,
|
|
3728
3728
|
animate: r
|
|
3729
3729
|
}),
|
|
3730
3730
|
...s,
|
|
3731
3731
|
children: e
|
|
3732
|
-
}),
|
|
3732
|
+
}), Ks = ({
|
|
3733
3733
|
message: e
|
|
3734
3734
|
}) => l("div", {
|
|
3735
3735
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -3753,7 +3753,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3753
3753
|
})
|
|
3754
3754
|
})]
|
|
3755
3755
|
})
|
|
3756
|
-
}),
|
|
3756
|
+
}), Gs = ({
|
|
3757
3757
|
className: e,
|
|
3758
3758
|
...t
|
|
3759
3759
|
}) => (ue(() => {
|
|
@@ -3773,10 +3773,10 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3773
3773
|
}
|
|
3774
3774
|
}))
|
|
3775
3775
|
}) : void 0
|
|
3776
|
-
})),
|
|
3776
|
+
})), Hs = {
|
|
3777
3777
|
bot: "left",
|
|
3778
3778
|
user: "right"
|
|
3779
|
-
},
|
|
3779
|
+
}, Ws = Ze("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]", {
|
|
3780
3780
|
variants: {
|
|
3781
3781
|
variant: {
|
|
3782
3782
|
info: "text-neutral-8",
|
|
@@ -3785,7 +3785,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3785
3785
|
success: "text-[#4CAF50]"
|
|
3786
3786
|
}
|
|
3787
3787
|
}
|
|
3788
|
-
}),
|
|
3788
|
+
}), Js = ({
|
|
3789
3789
|
lastSentMessageFooter: e
|
|
3790
3790
|
}) => {
|
|
3791
3791
|
var r;
|
|
@@ -3795,13 +3795,13 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3795
3795
|
}, [t.length]), l("ol", {
|
|
3796
3796
|
"aria-label": "Chat messages",
|
|
3797
3797
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
3798
|
-
children: [t.map((n, s) => l(
|
|
3798
|
+
children: [t.map((n, s) => l(be, {
|
|
3799
3799
|
children: l("li", {
|
|
3800
3800
|
class: "flex",
|
|
3801
3801
|
children: Ke(n).with({
|
|
3802
3802
|
type: "system"
|
|
3803
3803
|
}, (a) => l("p", {
|
|
3804
|
-
class:
|
|
3804
|
+
class: Ws({
|
|
3805
3805
|
variant: a.variant
|
|
3806
3806
|
}),
|
|
3807
3807
|
children: a.text
|
|
@@ -3809,15 +3809,17 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3809
3809
|
type: "text",
|
|
3810
3810
|
author: D.union("bot", "user")
|
|
3811
3811
|
}, (a) => {
|
|
3812
|
-
const i = a.author === "user" && !t.slice(s + 1).some((p) => p.type === "text" && p.author === "user"), u = s === t.length - 1, d = a.author === "bot" ?
|
|
3813
|
-
return l(
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3812
|
+
const i = a.author === "user" && !t.slice(s + 1).some((p) => p.type === "text" && p.author === "user"), u = s === t.length - 1, d = a.author === "bot" ? zs(a.text) : a.text;
|
|
3813
|
+
return l(be, {
|
|
3814
|
+
children: [i ? e : null, l(Us, {
|
|
3815
|
+
animate: u,
|
|
3816
|
+
side: Hs[a.author],
|
|
3817
|
+
children: d
|
|
3818
|
+
}, s)]
|
|
3819
|
+
});
|
|
3818
3820
|
}).with({
|
|
3819
3821
|
type: "link"
|
|
3820
|
-
}, (a) => l(
|
|
3822
|
+
}, (a) => l(Ks, {
|
|
3821
3823
|
message: a
|
|
3822
3824
|
})).with({
|
|
3823
3825
|
type: "image"
|
|
@@ -3829,7 +3831,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3829
3831
|
}
|
|
3830
3832
|
})).with({
|
|
3831
3833
|
type: "file"
|
|
3832
|
-
}, (a) => l(
|
|
3834
|
+
}, (a) => l(On, {
|
|
3833
3835
|
class: a.author === "bot" ? void 0 : "ml-auto",
|
|
3834
3836
|
file: {
|
|
3835
3837
|
name: a.fileName,
|
|
@@ -3847,9 +3849,9 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3847
3849
|
});
|
|
3848
3850
|
}).exhaustive()
|
|
3849
3851
|
})
|
|
3850
|
-
}, s)), l(
|
|
3852
|
+
}, s)), l(Gs, {}, "typing")]
|
|
3851
3853
|
});
|
|
3852
|
-
},
|
|
3854
|
+
}, sa = ({
|
|
3853
3855
|
logger: e,
|
|
3854
3856
|
apiClient: t,
|
|
3855
3857
|
analytics: r
|
|
@@ -3861,7 +3863,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3861
3863
|
const s = I.viewState$.value, {
|
|
3862
3864
|
chatRef: a,
|
|
3863
3865
|
chatService: i
|
|
3864
|
-
} =
|
|
3866
|
+
} = kn(), {
|
|
3865
3867
|
t: u
|
|
3866
3868
|
} = G(), [d, p] = Y();
|
|
3867
3869
|
return pe(() => {
|
|
@@ -3890,9 +3892,9 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3890
3892
|
})) : I.removeMessagesSentByNodeIds([h]);
|
|
3891
3893
|
const {
|
|
3892
3894
|
interpret: k,
|
|
3893
|
-
abort:
|
|
3895
|
+
abort: b,
|
|
3894
3896
|
undo: A
|
|
3895
|
-
} =
|
|
3897
|
+
} = Zr({
|
|
3896
3898
|
context: n.context,
|
|
3897
3899
|
analytics: {
|
|
3898
3900
|
service: r,
|
|
@@ -3943,8 +3945,8 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3943
3945
|
});
|
|
3944
3946
|
}
|
|
3945
3947
|
});
|
|
3946
|
-
return p(() => A), k(h),
|
|
3947
|
-
}, [r, t, i, e, n, u]), l(
|
|
3948
|
+
return p(() => A), k(h), b;
|
|
3949
|
+
}, [r, t, i, e, n, u]), l(be, {
|
|
3948
3950
|
children: [l("div", {
|
|
3949
3951
|
ref: a,
|
|
3950
3952
|
className: "hide-scrollbars relative flex w-full max-w-full flex-grow flex-col overflow-y-scroll",
|
|
@@ -3952,41 +3954,41 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3952
3954
|
WebkitOverflowScrolling: "touch",
|
|
3953
3955
|
paddingBottom: I.inputHeight$.value
|
|
3954
3956
|
},
|
|
3955
|
-
children: l(
|
|
3956
|
-
lastSentMessageFooter: n.data.isFinished || !d ? null : l(
|
|
3957
|
+
children: l(Js, {
|
|
3958
|
+
lastSentMessageFooter: n.data.isFinished || !d ? null : l(Xs, {
|
|
3957
3959
|
undoFn: d
|
|
3958
3960
|
})
|
|
3959
3961
|
})
|
|
3960
|
-
}), l(
|
|
3962
|
+
}), l(Ms, {
|
|
3961
3963
|
logger: e
|
|
3962
3964
|
})]
|
|
3963
3965
|
});
|
|
3964
|
-
},
|
|
3966
|
+
}, Zs = (e) => "key" in e.data && e.data.key ? [e.data.key] : "keys" in e.data ? Object.values(e.data.keys).filter((t) => typeof t == "string") : [], Xs = ({
|
|
3965
3967
|
undoFn: e
|
|
3966
3968
|
}) => {
|
|
3967
3969
|
const {
|
|
3968
3970
|
t
|
|
3969
3971
|
} = G();
|
|
3970
|
-
return l(
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
});
|
|
3985
|
-
},
|
|
3972
|
+
return l(Hr, {
|
|
3973
|
+
onClick: async () => {
|
|
3974
|
+
const {
|
|
3975
|
+
flow: r
|
|
3976
|
+
} = I.current$.peek();
|
|
3977
|
+
le(r);
|
|
3978
|
+
const {
|
|
3979
|
+
removed: n
|
|
3980
|
+
} = e(r.data.nodeHistory), s = r.data.nodeHistory.splice(-n);
|
|
3981
|
+
s.length !== 0 && (I.removeMessagesSentByNodeIds(s), I.setInput(void 0), s.pop(), s.map((a) => r.nodes.find((i) => i.id === a)).filter(Boolean).flatMap(Zs).forEach((a) => delete r.data.submissions[a]), I.current$.value = {
|
|
3982
|
+
...I.current$.value
|
|
3983
|
+
});
|
|
3984
|
+
},
|
|
3985
|
+
children: [l("title", {
|
|
3986
3986
|
children: t("undo")
|
|
3987
|
-
})
|
|
3987
|
+
}), l("path", {
|
|
3988
|
+
d: "M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"
|
|
3989
|
+
})]
|
|
3988
3990
|
});
|
|
3989
3991
|
};
|
|
3990
3992
|
export {
|
|
3991
|
-
|
|
3993
|
+
sa as ChatbotBody
|
|
3992
3994
|
};
|