@inploi/plugin-chatbot 14.6.0 → 14.7.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.
@@ -1,4 +1,4 @@
1
- import { W as yr, Z as st, P as xt, Y as We, t as mr, g as gr, a as kt, A as ss, Q as ns, I as is, j as br, _ as as, J as os, n as ls, C as $t, V as us, u as se, o as u, c as Oe, b as nt, h as be, d as fe, i as Me, y as Ie, k as xe, L as Ct, F as cs, s as $, p as vr, e as xr, f as ds, l as Re, X as qt, m as Q, q as ae, M as fs, z as hs, r as ps, S as wr, v as ys } from "./index-aa94ec24.js";
1
+ import { W as yr, Z as ot, P as wt, Y as Ge, t as mr, g as gr, a as Ct, A as ss, Q as ns, I as as, j as br, _ as is, J as os, n as ls, C as $t, V as us, u as se, o as u, c as Oe, b as lt, h as ve, d as pe, i as Me, y as Ie, k as we, L as St, F as cs, s as $, p as vr, e as xr, f as ds, l as Re, X as qt, m as Q, q as ie, M as fs, z as ps, r as hs, S as wr, v as ys } from "./index-8090d2e3.js";
2
2
  import { isApiErrorWithData as ms, ApiError as gs } from "@inploi/sdk";
3
3
  const Ut = (e, r, t) => {
4
4
  var s;
@@ -16,15 +16,15 @@ const Ut = (e, r, t) => {
16
16
  });
17
17
  };
18
18
  var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
19
- let [i, ...a] = e.compareKey.split(".");
20
- if (!i)
19
+ let [a, ...i] = e.compareKey.split(".");
20
+ if (!a)
21
21
  return !1;
22
- let n = yr({ context: r, key: i, path: a, submissions: t });
22
+ let n = yr({ context: r, key: a, path: i, submissions: t });
23
23
  if (!n)
24
24
  return !1;
25
25
  switch (n.type) {
26
26
  case "address": {
27
- let o = xt(n.value, a);
27
+ let o = wt(n.value, i);
28
28
  switch (e.compare) {
29
29
  case "equals":
30
30
  return o === e.compareValue;
@@ -40,16 +40,16 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
40
40
  case "integration": {
41
41
  if (typeof n.value != "object" || Array.isArray(n.value))
42
42
  return !1;
43
- let o = xt(n.value, a), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
43
+ let o = wt(n.value, i), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
44
44
  switch (typeof o) {
45
45
  case "boolean":
46
- return ze(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
46
+ return Ke(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
47
47
  case "string":
48
- return ze(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
48
+ return Ke(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
49
49
  case "number":
50
- return ze(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
50
+ return Ke(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
51
51
  case "object":
52
- return Array.isArray(o) && o.every((h) => typeof h == "string") ? ze(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
52
+ return Array.isArray(o) && o.every((p) => typeof p == "string") ? Ke(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
53
53
  }
54
54
  break;
55
55
  }
@@ -65,7 +65,7 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
65
65
  }
66
66
  case "phone":
67
67
  case "string": {
68
- let o = n.type === "phone" ? st(n.value) : n.value;
68
+ let o = n.type === "phone" ? ot(n.value) : n.value;
69
69
  switch (e.compare) {
70
70
  case "equals":
71
71
  return o === e.compareValue;
@@ -113,56 +113,56 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
113
113
  }
114
114
  break;
115
115
  }
116
- }, ze = (e, { context: r, submissions: t }) => {
116
+ }, Ke = (e, { context: r, submissions: t }) => {
117
117
  let s = "combinator" in e.data ? e.data.conditions : [e.data];
118
118
  if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
119
- for (let i of s)
120
- if (zt({ condition: i, context: r, submissions: t, ifBlock: e }))
119
+ for (let a of s)
120
+ if (zt({ condition: a, context: r, submissions: t, ifBlock: e }))
121
121
  return !0;
122
122
  return !1;
123
123
  } else {
124
- for (let i of s)
125
- if (!zt({ condition: i, context: r, submissions: t, ifBlock: e }))
124
+ for (let a of s)
125
+ if (!zt({ condition: a, context: r, submissions: t, ifBlock: e }))
126
126
  return !1;
127
127
  return !0;
128
128
  }
129
- }, bs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, vs = (e, { context: r, submissions: t }) => e.replace(bs, (s, i, a = "") => {
130
- let [n, ...o] = i.trim().split("."), c = yr({ key: n, path: o, submissions: t, context: r });
129
+ }, bs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, vs = (e, { context: r, submissions: t }) => e.replace(bs, (s, a, i = "") => {
130
+ let [n, ...o] = a.trim().split("."), c = yr({ key: n, path: o, submissions: t, context: r });
131
131
  if (!c)
132
- return a;
132
+ return i;
133
133
  switch (c.type) {
134
134
  case "boolean":
135
135
  return c.value === !0 ? "true" : "false";
136
136
  case "file":
137
- return c.value.map((h) => `${h.name} (${We(h.sizeKb)})`).join(", ");
137
+ return c.value.map((p) => `${p.name} (${Ge(p.sizeKb)})`).join(", ");
138
138
  case "enum":
139
139
  return c.value.join(", ");
140
140
  case "address":
141
- return Object.values(c.value).filter((h) => h && h.trim().length > 0).join(", ");
141
+ return Object.values(c.value).filter((p) => p && p.trim().length > 0).join(", ");
142
142
  case "number":
143
143
  case "string":
144
- return c.value ? c.value.toString() : a;
144
+ return c.value ? c.value.toString() : i;
145
145
  case "phone":
146
- return st(c.value);
146
+ return ot(c.value);
147
147
  case "integration": {
148
148
  if (typeof c.value != "object" || Array.isArray(c.value))
149
149
  break;
150
- let h = xt(c.value, o);
151
- switch (typeof h) {
150
+ let p = wt(c.value, o);
151
+ switch (typeof p) {
152
152
  case "boolean":
153
- return h === !0 ? "true" : "false";
153
+ return p === !0 ? "true" : "false";
154
154
  case "string":
155
- return h;
155
+ return p;
156
156
  case "number":
157
- return h.toString();
157
+ return p.toString();
158
158
  case "object":
159
- if (Array.isArray(h) && h.every((b) => typeof b == "string"))
160
- return h.join(", ");
159
+ if (Array.isArray(p) && p.every((b) => typeof b == "string"))
160
+ return p.join(", ");
161
161
  }
162
162
  break;
163
163
  }
164
164
  }
165
- return a;
165
+ return i;
166
166
  });
167
167
  const _r = ({
168
168
  context: e,
@@ -170,14 +170,14 @@ const _r = ({
170
170
  }) => ({
171
171
  context: e,
172
172
  submissions: r ?? {}
173
- }), he = (e, r) => vs(e, _r(r)), xs = (e, r) => ze(e, _r(r)), kr = ({
173
+ }), he = (e, r) => vs(e, _r(r)), xs = (e, r) => Ke(e, _r(r)), kr = ({
174
174
  node: e,
175
175
  nodes: r,
176
176
  stopWhen: t
177
177
  }) => {
178
178
  if ((t == null ? void 0 : t(e)) === !0)
179
179
  return e;
180
- const s = e.nextId ? r.find((i) => i.id === e.nextId) : void 0;
180
+ const s = e.nextId ? r.find((a) => a.id === e.nextId) : void 0;
181
181
  if (s)
182
182
  return kr({
183
183
  node: s,
@@ -188,35 +188,35 @@ const _r = ({
188
188
  childNode: e,
189
189
  nodes: r
190
190
  }) => {
191
- const s = r.filter((i) => i.type === "if-block").find((i) => {
192
- if (!i.branchId)
191
+ const s = r.filter((a) => a.type === "if-block").find((a) => {
192
+ if (!a.branchId)
193
193
  return !1;
194
- const a = r.find((o) => o.id === i.branchId);
195
- if (!a)
194
+ const i = r.find((o) => o.id === a.branchId);
195
+ if (!i)
196
196
  return !1;
197
197
  const n = kr({
198
- node: a,
198
+ node: i,
199
199
  nodes: r,
200
200
  stopWhen: (o) => o.id === e.id
201
201
  });
202
202
  return !(!n || n.id !== e.id);
203
203
  });
204
204
  if (s != null && s.nextId)
205
- return r.find((i) => i.id === s.nextId);
205
+ return r.find((a) => a.id === s.nextId);
206
206
  }, _s = ({
207
207
  flow: e,
208
208
  analytics: r,
209
209
  logger: t,
210
210
  talentBankClient: s,
211
- context: i,
212
- apiClient: a,
211
+ context: a,
212
+ apiClient: i,
213
213
  getSubmissions: n,
214
214
  getApplicationRecovery: o,
215
215
  setApplicationRecovery: c,
216
- chatService: h,
216
+ chatService: p,
217
217
  persistWriteBarrier: b,
218
218
  onFlowEnd: x,
219
- onInterpret: p,
219
+ onInterpret: h,
220
220
  t: m
221
221
  }) => {
222
222
  var I;
@@ -237,77 +237,77 @@ const _r = ({
237
237
  ...r.customProperties
238
238
  }
239
239
  })
240
- }, A = async (y, _) => {
241
- const V = C.signal;
242
- if (V.aborted)
240
+ }, V = async (y, _) => {
241
+ const F = C.signal;
242
+ if (F.aborted)
243
243
  return;
244
- const M = n(), O = o(), G = (O == null ? void 0 : O.submitNodeId) === y.id ? e.nodes.find((N) => {
244
+ const M = n(), O = o(), G = (O == null ? void 0 : O.submitNodeId) === y.id ? e.nodes.find((L) => {
245
245
  var U;
246
- return N.id === O.fileQuestionNodeId && N.type === "question-file" && ((U = M == null ? void 0 : M[N.data.key]) == null ? void 0 : U.type) !== "file";
246
+ return L.id === O.fileQuestionNodeId && L.type === "question-file" && ((U = M == null ? void 0 : M[L.data.key]) == null ? void 0 : U.type) !== "file";
247
247
  }) : void 0;
248
248
  if (G)
249
- return A(G, _);
250
- p == null || p(y, _);
249
+ return V(G, _);
250
+ h == null || h(y, _);
251
251
  try {
252
252
  await ks({
253
253
  flow: e,
254
254
  analytics: E,
255
255
  logger: t,
256
256
  talentBankClient: s,
257
- apiClient: a,
258
- context: i,
257
+ apiClient: i,
258
+ context: a,
259
259
  node: y,
260
260
  submissions: M,
261
261
  applicationRecovery: O,
262
- setApplicationRecovery: async (N) => {
263
- if (!V.aborted)
262
+ setApplicationRecovery: async (L) => {
263
+ if (!F.aborted)
264
264
  try {
265
- await c(N);
265
+ await c(L);
266
266
  } catch (U) {
267
267
  t.error("Failed to persist application recovery", U);
268
268
  }
269
269
  },
270
270
  forceSubmitConfirmation: (O == null ? void 0 : O.submitNodeId) === y.id,
271
271
  persistWriteBarrier: b,
272
- signal: V,
272
+ signal: F,
273
273
  t: m,
274
274
  chat: {
275
- sendMessage: async (N) => h.send({
275
+ sendMessage: async (L) => p.send({
276
276
  groupId: y.id,
277
- message: N,
278
- signal: V
277
+ message: L,
278
+ signal: F
279
279
  }),
280
- userInput: async (N) => h.input({
281
- input: N,
282
- signal: V
280
+ userInput: async (L) => p.input({
281
+ input: L,
282
+ signal: F
283
283
  }),
284
- setSubmission: (N, U) => {
285
- V.aborted || h.setSubmission(N, U);
284
+ setSubmission: (L, U) => {
285
+ F.aborted || p.setSubmission(L, U);
286
286
  }
287
287
  },
288
- next: (N) => {
289
- if (V.aborted)
288
+ next: (L) => {
289
+ if (F.aborted)
290
290
  return;
291
- const U = (O == null ? void 0 : O.fileQuestionNodeId) === y.id ? O.submitNodeId : N, L = U ? e.nodes.find((D) => D.id === U) : ws({
291
+ const U = (O == null ? void 0 : O.fileQuestionNodeId) === y.id ? O.submitNodeId : L, D = U ? e.nodes.find((T) => T.id === U) : ws({
292
292
  childNode: y,
293
293
  nodes: e.nodes
294
294
  });
295
- return L ? A(L, y) : x == null ? void 0 : x(y);
295
+ return D ? V(D, y) : x == null ? void 0 : x(y);
296
296
  },
297
297
  end: () => {
298
- V.aborted || x == null || x(y);
298
+ F.aborted || x == null || x(y);
299
299
  }
300
300
  });
301
- } catch (N) {
302
- if (N instanceof ss)
301
+ } catch (L) {
302
+ if (L instanceof ss)
303
303
  return;
304
- throw N;
304
+ throw L;
305
305
  }
306
306
  };
307
307
  return {
308
308
  interpret: async (y) => {
309
- const _ = e.nodes.find((V) => V.id === y) ?? gr(e.nodes);
310
- return A(_);
309
+ const _ = e.nodes.find((F) => F.id === y) ?? gr(e.nodes);
310
+ return V(_);
311
311
  },
312
312
  undo: (y) => {
313
313
  var U;
@@ -315,23 +315,23 @@ const _r = ({
315
315
  return {
316
316
  removed: 0
317
317
  };
318
- const _ = kt(e), V = _ ? y.lastIndexOf(_) : -1, M = e.nodes.find((L) => L.id === _);
319
- if (V === -1 || !M)
318
+ const _ = Ct(e), F = _ ? y.lastIndexOf(_) : -1, M = e.nodes.find((D) => D.id === _);
319
+ if (F === -1 || !M)
320
320
  return {
321
321
  removed: 0
322
322
  };
323
- const O = e.nodes.find((L) => L.id === y[y.length - 1]);
323
+ const O = e.nodes.find((D) => D.id === y[y.length - 1]);
324
324
  C.abort();
325
- const G = y.splice(V);
326
- e.data.messages = e.data.messages.filter((L) => !L.groupId || !G.includes(L.groupId)), e.data.currentInput = null;
327
- const N = n();
328
- for (const L of G.slice(1)) {
329
- const D = e.nodes.find((w) => w.id === L);
330
- if (!(!D || !N || D.id === _) && ("key" in D.data && D.data.key && delete N[D.data.key], "keys" in D.data))
331
- for (const w of Object.values(D.data.keys))
332
- typeof w == "string" && delete N[w];
325
+ const G = y.splice(F);
326
+ e.data.messages = e.data.messages.filter((D) => !D.groupId || !G.includes(D.groupId)), e.data.currentInput = null;
327
+ const L = n();
328
+ for (const D of G.slice(1)) {
329
+ const T = e.nodes.find((w) => w.id === D);
330
+ if (!(!T || !L || T.id === _) && ("key" in T.data && T.data.key && delete L[T.data.key], "keys" in T.data))
331
+ for (const w of Object.values(T.data.keys))
332
+ typeof w == "string" && delete L[w];
333
333
  }
334
- return C = new AbortController(), A(M, O), {
334
+ return C = new AbortController(), V(M, O), {
335
335
  removed: G.length
336
336
  };
337
337
  },
@@ -350,57 +350,57 @@ async function ks(e) {
350
350
  text: r.data.title
351
351
  }), e.next(r.nextId);
352
352
  case "pre-apply-result":
353
- return Ws({
353
+ return Ks({
354
354
  ...e,
355
355
  node: r
356
356
  });
357
357
  case "text":
358
- return Ds({
358
+ return Os({
359
359
  ...e,
360
360
  node: r
361
361
  });
362
362
  case "image":
363
- return Os({
363
+ return Rs({
364
364
  ...e,
365
365
  node: r
366
366
  });
367
367
  case "question-text":
368
- return Rs({
368
+ return Ps({
369
369
  ...e,
370
370
  node: r
371
371
  });
372
372
  case "question-enum":
373
- return js({
373
+ return $s({
374
374
  ...e,
375
375
  node: r
376
376
  });
377
377
  case "question-number":
378
- return Ps({
378
+ return Bs({
379
379
  ...e,
380
380
  node: r
381
381
  });
382
382
  case "question-phone":
383
- return Bs({
383
+ return js({
384
384
  ...e,
385
385
  node: r
386
386
  });
387
387
  case "question-boolean":
388
- return $s({
388
+ return qs({
389
389
  ...e,
390
390
  node: r
391
391
  });
392
392
  case "question-file":
393
- return Us({
393
+ return zs({
394
394
  ...e,
395
395
  node: r
396
396
  });
397
397
  case "question-address":
398
- return qs({
398
+ return Us({
399
399
  ...e,
400
400
  node: r
401
401
  });
402
402
  case "end-flow":
403
- return zs({
403
+ return Ws({
404
404
  ...e,
405
405
  node: r
406
406
  });
@@ -415,17 +415,17 @@ async function ks(e) {
415
415
  node: r
416
416
  });
417
417
  case "link":
418
- return Ls({
418
+ return Ds({
419
419
  ...e,
420
420
  node: r
421
421
  });
422
422
  case "integration-application-submit":
423
- return Ns({
423
+ return Ls({
424
424
  ...e,
425
425
  node: r
426
426
  });
427
427
  case "add-submission":
428
- return Fs({
428
+ return As({
429
429
  ...e,
430
430
  node: r
431
431
  });
@@ -456,8 +456,8 @@ async function Ss({
456
456
  node: r,
457
457
  talentBankClient: t,
458
458
  submissions: s,
459
- flow: i,
460
- logger: a,
459
+ flow: a,
460
+ logger: i,
461
461
  chat: n
462
462
  }) {
463
463
  var c;
@@ -465,19 +465,19 @@ async function Ss({
465
465
  isDuplicate: !1
466
466
  };
467
467
  if (s && t) {
468
- const h = r.data.scope === "job" ? (c = i.job) == null ? void 0 : c.id : void 0;
469
- if (r.data.scope === "company" || h != null)
468
+ const p = r.data.scope === "job" ? (c = a.job) == null ? void 0 : c.id : void 0;
469
+ if (r.data.scope === "company" || p != null)
470
470
  try {
471
471
  o = await t.checkDuplicate({
472
472
  email: ns({
473
473
  key: r.data.email,
474
474
  submissions: s
475
475
  }).toString(),
476
- jobId: h,
476
+ jobId: p,
477
477
  scope: r.data.scope
478
478
  });
479
479
  } catch (b) {
480
- a.error("[check-duplicate]", b);
480
+ i.error("[check-duplicate]", b);
481
481
  }
482
482
  }
483
483
  n.setSubmission(r.data.key, {
@@ -491,12 +491,12 @@ async function Is({
491
491
  }) {
492
492
  e(r.data.targetId);
493
493
  }
494
- async function Fs({
494
+ async function As({
495
495
  next: e,
496
496
  node: r,
497
497
  logger: t,
498
498
  submissions: s,
499
- context: i
499
+ context: a
500
500
  }) {
501
501
  if (!s) {
502
502
  t.error("Submissions not found");
@@ -506,59 +506,59 @@ async function Fs({
506
506
  type: "string",
507
507
  value: he(r.data.value, {
508
508
  submissions: s,
509
- context: i
509
+ context: a
510
510
  })
511
511
  }, e(r.nextId);
512
512
  }
513
- const Vs = 5e3, Cr = 3e4, As = 2e4, Ms = 6e4, Sr = 12e4, Es = (e, r, t) => {
513
+ const Fs = 5e3, Cr = 3e4, Vs = 2e4, Ms = 6e4, Sr = 12e4, Es = 60 * 6e4, Ns = (e, r, t) => {
514
514
  if (!((t == null ? void 0 : t.retryable) === !0 && (t.providerStatus === 429 || t.providerStatus !== void 0 && t.providerStatus >= 500 || t.phase === "workflow" && t.verdict === "not_submitted")))
515
515
  return {
516
516
  key: e,
517
517
  until: Date.now() + Cr
518
518
  };
519
- const i = ((r == null ? void 0 : r.throttles) ?? 0) + 1, a = Math.min(i * As, Ms), n = (t.retryAfterSeconds ?? 0) * 1e3;
519
+ const a = ((r == null ? void 0 : r.throttles) ?? 0) + 1, i = Math.min(a * Vs, Ms), n = (t.retryAfterSeconds ?? 0) * 1e3;
520
520
  return {
521
521
  key: e,
522
- until: Date.now() + Math.min(Math.max(a, n), Sr),
523
- throttles: i
522
+ until: Date.now() + Math.min(Math.max(i, n), Sr),
523
+ throttles: a
524
524
  };
525
525
  };
526
- async function Ns({
526
+ async function Ls({
527
527
  chat: e,
528
528
  next: r,
529
529
  end: t,
530
530
  node: s,
531
- logger: i,
532
- apiClient: a,
531
+ logger: a,
532
+ apiClient: i,
533
533
  submissions: n,
534
534
  analytics: o,
535
535
  flow: c,
536
- applicationRecovery: h,
536
+ applicationRecovery: p,
537
537
  setApplicationRecovery: b,
538
538
  forceSubmitConfirmation: x,
539
- persistWriteBarrier: p,
539
+ persistWriteBarrier: h,
540
540
  signal: m,
541
541
  t: C
542
542
  }) {
543
543
  var I;
544
- if ((I = c.data.startedWriteNodeIds) != null && I.includes(s.id) && (h == null ? void 0 : h.submitNodeId) !== s.id)
544
+ if ((I = c.data.startedWriteNodeIds) != null && I.includes(s.id) && (p == null ? void 0 : p.submitNodeId) !== s.id)
545
545
  return await e.sendMessage({
546
546
  type: "system",
547
547
  variant: "warning",
548
548
  text: C("submission_unknown")
549
549
  }), t();
550
- const E = c.job ? `${s.id}@${c.job.id_type}:${c.job.id}` : s.id, A = async (y) => {
551
- var we, _e, Be, je, Ye, $e;
552
- const _ = ((we = c.data.submitCooldown) == null ? void 0 : we.key) === E ? c.data.submitCooldown : void 0;
550
+ const E = c.job ? `${s.id}@${c.job.id_type}:${c.job.id}` : s.id, V = async (y) => {
551
+ var Be, je, et, $e, tt, qe, rt;
552
+ const _ = ((Be = c.data.submitCooldown) == null ? void 0 : Be.key) === E ? c.data.submitCooldown : void 0;
553
553
  _ && (_.until = Math.min(_.until, Date.now() + (_.throttles ? Sr : Cr)));
554
- const V = _ == null ? void 0 : _.until;
555
- (y !== !0 || V !== void 0 && V > Date.now()) && await e.userInput({
554
+ const F = _ == null ? void 0 : _.until;
555
+ (y !== !0 || F !== void 0 && F > Date.now()) && await e.userInput({
556
556
  type: "submit",
557
557
  key: void 0,
558
558
  config: {
559
559
  label: s.data.submitLabel,
560
- ...V !== void 0 && {
561
- availableAt: V
560
+ ...F !== void 0 && {
561
+ availableAt: F
562
562
  }
563
563
  }
564
564
  }), await e.sendMessage({
@@ -571,12 +571,12 @@ async function Ns({
571
571
  } = o.getSessionInfo();
572
572
  if (m.aborted)
573
573
  return;
574
- const G = ((_e = c.data.startedWriteNodeIds) == null ? void 0 : _e.includes(s.id)) === !0;
575
- if ((h == null ? void 0 : h.submitNodeId) === s.id && await b(void 0), G || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await p().catch((j) => i.error("Failed to persist application write barrier", j)), m.aborted)
574
+ const G = ((je = c.data.startedWriteNodeIds) == null ? void 0 : je.includes(s.id)) === !0;
575
+ if ((p == null ? void 0 : p.submitNodeId) === s.id && await b(void 0), G || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await h().catch((B) => a.error("Failed to persist application write barrier", B)), m.aborted)
576
576
  return;
577
- let N;
577
+ let L;
578
578
  const U = setTimeout(() => {
579
- N = (async () => {
579
+ L = (async () => {
580
580
  await e.sendMessage({
581
581
  type: "text",
582
582
  author: "bot",
@@ -585,10 +585,10 @@ async function Ns({
585
585
  type: "loading",
586
586
  text: C("submitting")
587
587
  });
588
- })().catch((j) => i.error("Failed to send submission progress message", j));
589
- }, Vs);
590
- let L;
591
- const D = await a.fetch("/flow/submit", {
588
+ })().catch((B) => a.error("Failed to send submission progress message", B));
589
+ }, Fs);
590
+ let D;
591
+ const T = await i.fetch("/flow/submit", {
592
592
  method: "POST",
593
593
  body: JSON.stringify({
594
594
  log_submit: !1,
@@ -597,56 +597,60 @@ async function Ns({
597
597
  session_id: O,
598
598
  job: c.job,
599
599
  flow_build: c.build,
600
- submissions: as(c.nodes, os(n || {}, s.data.submitKeys)),
600
+ submissions: is(c.nodes, os(n || {}, s.data.submitKeys)),
601
601
  pre_apply: br(c.nodes, n || {}, c.data.flowSessionId)
602
602
  })
603
- }).catch((j) => (L = j, ms(j) ? j.data : j));
604
- if (clearTimeout(U), await N, m.aborted)
603
+ }).catch((B) => (D = B, ms(B) ? B.data : B));
604
+ if (clearTimeout(U), await L, m.aborted)
605
605
  return;
606
606
  s.data.key && e.setSubmission(s.data.key, {
607
607
  type: "integration",
608
- value: D
608
+ value: T
609
609
  });
610
- const w = mr(D, L instanceof gs ? L.status : void 0), T = ((Be = c.data.unconfirmedAttemptKeys) == null ? void 0 : Be.includes(E)) === !0, q = ls(D);
611
- if (q && o.log({
610
+ const w = mr(T, D instanceof gs ? D.status : void 0), N = c.data.failedAttemptAt;
611
+ let q = N == null ? void 0 : N[E];
612
+ N && q !== void 0 && q > Date.now() && (q = N[E] = Date.now());
613
+ const H = q !== void 0 && Date.now() - q < Es || ((et = c.data.unconfirmedAttemptKeys) == null ? void 0 : et.includes(E)) === !0, X = ls(T);
614
+ if (X && o.log({
612
615
  event: "FLOW_SUBMIT",
613
616
  properties: {
614
617
  flow_id: c.id,
615
618
  flow_version: c.version,
616
619
  flow_session_id: c.data.flowSessionId,
617
620
  flow_build: c.build,
618
- service: q.service,
619
- response: q.response,
621
+ service: X.service,
622
+ response: X.response,
620
623
  flow_type: "CHATBOT_DRAWER",
621
624
  job: c.job,
622
- // Measures how many duplicates follow the candidate's own unconfirmed attempt.
625
+ // Measures how many duplicates follow the candidate's own recent failed attempt; set exactly when
626
+ // the earlier-attempt copy is shown.
623
627
  ...(w == null ? void 0 : w.outcome) === "duplicate" && {
624
- outcome: T ? "duplicate_after_own_attempt" : "duplicate"
628
+ outcome: H ? "duplicate_after_own_attempt" : "duplicate"
625
629
  },
626
- ...q.outcome && {
627
- outcome: q.outcome
630
+ ...X.outcome && {
631
+ outcome: X.outcome
628
632
  }
629
633
  }
630
- }), ($t(D) || (D == null ? void 0 : D.success) === !0) && ((je = c.data.submitCooldown) == null ? void 0 : je.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await p().catch((j) => i.error("Failed to persist submit cooldown reset", j))), $t(D)) {
634
+ }), ($t(T) || (T == null ? void 0 : T.success) === !0) && (($e = c.data.submitCooldown) == null ? void 0 : $e.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await h().catch((B) => a.error("Failed to persist submit cooldown reset", B))), $t(T)) {
631
635
  const {
632
- redirect_url: j,
633
- message: Qe,
634
- button_text: ct
635
- } = D.integration_response.data;
636
+ redirect_url: B,
637
+ message: st,
638
+ button_text: Ue
639
+ } = T.integration_response.data;
636
640
  await e.sendMessage({
637
641
  type: "text",
638
642
  author: "bot",
639
- text: Qe ?? C("submission_redirect_message")
643
+ text: st ?? C("submission_redirect_message")
640
644
  });
641
645
  try {
642
- const ce = new URL(j);
643
- M && !ce.searchParams.has("anonymous_id") && ce.searchParams.set("anonymous_id", M), await e.sendMessage({
646
+ const de = new URL(B);
647
+ M && !de.searchParams.has("anonymous_id") && de.searchParams.set("anonymous_id", M), await e.sendMessage({
644
648
  type: "link",
645
- href: ce.toString(),
646
- text: ct ?? C("complete_submission"),
649
+ href: de.toString(),
650
+ text: Ue ?? C("complete_submission"),
647
651
  onClick: () => {
648
652
  if (!O) {
649
- i.error("session_id not set, cannot log FLOW_REDIRECT event");
653
+ a.error("session_id not set, cannot log FLOW_REDIRECT event");
650
654
  return;
651
655
  }
652
656
  o.log({
@@ -656,14 +660,14 @@ async function Ns({
656
660
  flow_id: c.id,
657
661
  flow_session_id: O,
658
662
  flow_version: c.version,
659
- href: ce.toString(),
663
+ href: de.toString(),
660
664
  job: c.job
661
665
  }
662
666
  });
663
667
  }
664
668
  });
665
- } catch (ce) {
666
- i.error(`Invalid redirect URL: ${j}`, ce), e.sendMessage({
669
+ } catch (de) {
670
+ a.error(`Invalid redirect URL: ${B}`, de), e.sendMessage({
667
671
  type: "system",
668
672
  variant: "error",
669
673
  text: C("redirect_url_error")
@@ -671,71 +675,74 @@ async function Ns({
671
675
  }
672
676
  return r(s.nextId);
673
677
  }
674
- const te = us(D);
675
- if (te)
678
+ const _e = us(T);
679
+ if (_e)
676
680
  return await e.sendMessage({
677
681
  type: "system",
678
682
  variant: "success",
679
- text: te.message ?? C("submission_pending")
683
+ text: _e.message ?? C("submission_pending")
680
684
  }), r(s.nextId);
681
- if ((D == null ? void 0 : D.success) === !0)
685
+ if ((T == null ? void 0 : T.success) === !0)
682
686
  return s.data.skipConfirmation !== !0 && await e.sendMessage({
683
687
  type: "system",
684
688
  variant: "success",
685
689
  text: C("submission_completed")
686
690
  }), r(s.nextId);
687
- const J = (w == null ? void 0 : w.phase) === "submit" && w.verdict === "confirmed" && w.code === "unreadable_document" && typeof w.field == "string" && w.status !== void 0 && w.status >= 400 && w.status < 500 && ((Ye = n == null ? void 0 : n[w.field]) == null ? void 0 : Ye.type) === "file" ? w.field : void 0, ue = J === void 0 ? void 0 : c.nodes.find((j) => j.type === "question-file" && j.data.key === J);
688
- return ue || (c.data.submitCooldown = Es(E, _, w)), (w == null ? void 0 : w.verdict) === "not_submitted" || (w == null ? void 0 : w.outcome) === "duplicate" || (w == null ? void 0 : w.outcome) === "closed" ? (G || (c.data.startedWriteNodeIds = ($e = c.data.startedWriteNodeIds) == null ? void 0 : $e.filter((j) => j !== s.id)), (h == null ? void 0 : h.submitNodeId) === s.id && await b(h), await p().catch((j) => i.error("Failed to persist application write barrier release", j))) : (w == null ? void 0 : w.verdict) !== "confirmed" && !T ? (c.data.unconfirmedAttemptKeys = [...c.data.unconfirmedAttemptKeys ?? [], E], await p().catch((j) => i.error("Failed to persist unconfirmed attempt", j))) : await p().catch((j) => i.error("Failed to persist submit cooldown", j)), w ? (i.error(L ?? w.message), ue && J !== void 0 ? (e.setSubmission(J, null), await b({
689
- fileQuestionNodeId: ue.id,
691
+ const ue = (w == null ? void 0 : w.phase) === "submit" && w.verdict === "confirmed" && w.code === "unreadable_document" && typeof w.field == "string" && w.status !== void 0 && w.status >= 400 && w.status < 500 && ((tt = n == null ? void 0 : n[w.field]) == null ? void 0 : tt.type) === "file" ? w.field : void 0, ce = ue === void 0 ? void 0 : c.nodes.find((B) => B.type === "question-file" && B.data.key === ue);
692
+ return ce || (c.data.submitCooldown = Ns(E, _, w)), (w == null ? void 0 : w.outcome) !== "duplicate" && (c.data.failedAttemptAt = {
693
+ ...c.data.failedAttemptAt,
694
+ [E]: Date.now()
695
+ }, (qe = c.data.unconfirmedAttemptKeys) != null && qe.includes(E) && (c.data.unconfirmedAttemptKeys = c.data.unconfirmedAttemptKeys.filter((B) => B !== E))), (w == null ? void 0 : w.verdict) === "not_submitted" || (w == null ? void 0 : w.outcome) === "duplicate" || (w == null ? void 0 : w.outcome) === "closed" ? (G || (c.data.startedWriteNodeIds = (rt = c.data.startedWriteNodeIds) == null ? void 0 : rt.filter((B) => B !== s.id)), (p == null ? void 0 : p.submitNodeId) === s.id && await b(p), await h().catch((B) => a.error("Failed to persist application write barrier release", B))) : await h().catch((B) => a.error("Failed to persist submit cooldown", B)), w ? (a.error(D ?? w.message), ce && ue !== void 0 ? (e.setSubmission(ue, null), await b({
696
+ fileQuestionNodeId: ce.id,
690
697
  submitNodeId: s.id
691
698
  }), await e.sendMessage({
692
699
  type: "system",
693
700
  variant: "error",
694
701
  text: C("submission_unreadable_document")
695
- }), r(ue.id)) : w.outcome === "duplicate" ? (await e.sendMessage({
702
+ }), r(ce.id)) : w.outcome === "duplicate" ? (await e.sendMessage({
696
703
  type: "system",
697
704
  variant: "info",
698
- text: C(T ? "submission_duplicate_earlier_attempt" : "submission_duplicate")
699
- }), A(!1)) : w.outcome === "closed" ? (await e.sendMessage({
705
+ text: C(H ? "submission_duplicate_earlier_attempt" : "submission_duplicate")
706
+ }), V(!1)) : w.outcome === "closed" ? (await e.sendMessage({
700
707
  type: "system",
701
708
  variant: "info",
702
709
  text: C("submission_closed")
703
- }), A(!1)) : w.outcome === "unknown" ? (await e.sendMessage({
710
+ }), V(!1)) : w.outcome === "unknown" ? (await e.sendMessage({
704
711
  type: "system",
705
712
  variant: "warning",
706
713
  text: C("submission_unknown")
707
- }), A(!1)) : (w.phase === "workflow" || w.phase === "authentication") && w.retryable === !0 && w.verdict === "not_submitted" ? (await e.sendMessage({
714
+ }), V(!1)) : (w.phase === "workflow" || w.phase === "authentication") && w.retryable === !0 && w.verdict === "not_submitted" ? (await e.sendMessage({
708
715
  type: "system",
709
716
  variant: "error",
710
717
  text: C("submission_retryable")
711
- }), A(!1)) : (await e.sendMessage({
718
+ }), V(!1)) : (await e.sendMessage({
712
719
  type: "system",
713
720
  variant: "error",
714
721
  text: C("submission_failed")
715
- }), t())) : (i.error(L ?? D), await e.sendMessage({
722
+ }), t())) : (a.error(D ?? T), await e.sendMessage({
716
723
  type: "system",
717
724
  variant: "error",
718
725
  text: C("submission_failed")
719
726
  }), t());
720
727
  };
721
- await A(x === !0 ? !1 : s.data.skipConfirmation);
728
+ await V(x === !0 ? !1 : s.data.skipConfirmation);
722
729
  }
723
- async function Ls({
730
+ async function Ds({
724
731
  chat: e,
725
732
  next: r,
726
733
  node: t,
727
734
  submissions: s,
728
- context: i
735
+ context: a
729
736
  }) {
730
737
  await e.sendMessage({
731
738
  type: "link",
732
739
  href: he(t.data.href, {
733
740
  submissions: s,
734
- context: i
741
+ context: a
735
742
  }),
736
743
  text: he(t.data.cta, {
737
744
  submissions: s,
738
- context: i
745
+ context: a
739
746
  })
740
747
  }), r(t.nextId);
741
748
  }
@@ -750,23 +757,23 @@ async function Ts({
750
757
  context: s
751
758
  }) ? t.branchId : t.nextId);
752
759
  }
753
- async function Ds({
760
+ async function Os({
754
761
  chat: e,
755
762
  next: r,
756
763
  node: t,
757
764
  submissions: s,
758
- context: i
765
+ context: a
759
766
  }) {
760
767
  await e.sendMessage({
761
768
  author: "bot",
762
769
  type: "text",
763
770
  text: he(t.data.text, {
764
771
  submissions: s,
765
- context: i
772
+ context: a
766
773
  })
767
774
  }), r(t.nextId);
768
775
  }
769
- async function Os({
776
+ async function Rs({
770
777
  chat: e,
771
778
  next: r,
772
779
  node: t
@@ -779,20 +786,20 @@ async function Os({
779
786
  width: t.data.width
780
787
  }), r(t.nextId);
781
788
  }
782
- async function Rs({
789
+ async function Ps({
783
790
  chat: e,
784
791
  next: r,
785
792
  node: t,
786
793
  submissions: s,
787
- context: i,
788
- t: a
794
+ context: a,
795
+ t: i
789
796
  }) {
790
797
  await e.sendMessage({
791
798
  author: "bot",
792
799
  type: "text",
793
800
  text: he(t.data.question, {
794
801
  submissions: s,
795
- context: i
802
+ context: a
796
803
  })
797
804
  });
798
805
  const n = t.data.format === "phone" ? await e.userInput({
@@ -820,27 +827,27 @@ async function Rs({
820
827
  n === null ? await e.sendMessage({
821
828
  type: "system",
822
829
  variant: "info",
823
- text: a("skipped")
830
+ text: i("skipped")
824
831
  }) : await e.sendMessage({
825
832
  author: "user",
826
833
  type: "text",
827
- text: n.type === "phone" ? st(n.value) : n.value
834
+ text: n.type === "phone" ? ot(n.value) : n.value
828
835
  }), r(t.nextId);
829
836
  }
830
- async function Ps({
837
+ async function Bs({
831
838
  chat: e,
832
839
  next: r,
833
840
  node: t,
834
841
  submissions: s,
835
- context: i,
836
- t: a
842
+ context: a,
843
+ t: i
837
844
  }) {
838
845
  await e.sendMessage({
839
846
  author: "bot",
840
847
  type: "text",
841
848
  text: he(t.data.question, {
842
849
  submissions: s,
843
- context: i
850
+ context: a
844
851
  })
845
852
  });
846
853
  const n = await e.userInput({
@@ -857,27 +864,27 @@ async function Ps({
857
864
  n === null ? await e.sendMessage({
858
865
  type: "system",
859
866
  variant: "info",
860
- text: a("skipped")
867
+ text: i("skipped")
861
868
  }) : await e.sendMessage({
862
869
  author: "user",
863
870
  type: "text",
864
871
  text: n.value.toString()
865
872
  }), r(t.nextId);
866
873
  }
867
- async function Bs({
874
+ async function js({
868
875
  chat: e,
869
876
  next: r,
870
877
  node: t,
871
878
  submissions: s,
872
- context: i,
873
- t: a
879
+ context: a,
880
+ t: i
874
881
  }) {
875
882
  await e.sendMessage({
876
883
  author: "bot",
877
884
  type: "text",
878
885
  text: he(t.data.question, {
879
886
  submissions: s,
880
- context: i
887
+ context: a
881
888
  })
882
889
  });
883
890
  const n = await e.userInput({
@@ -896,27 +903,27 @@ async function Bs({
896
903
  n === null ? await e.sendMessage({
897
904
  type: "system",
898
905
  variant: "info",
899
- text: a("skipped")
906
+ text: i("skipped")
900
907
  }) : await e.sendMessage({
901
908
  author: "user",
902
909
  type: "text",
903
- text: n.type === "phone" ? st(n.value) : n.value
910
+ text: n.type === "phone" ? ot(n.value) : n.value
904
911
  }), r(t.nextId);
905
912
  }
906
- async function js({
913
+ async function $s({
907
914
  chat: e,
908
915
  next: r,
909
916
  node: t,
910
917
  submissions: s,
911
- context: i,
912
- t: a
918
+ context: a,
919
+ t: i
913
920
  }) {
914
921
  await e.sendMessage({
915
922
  author: "bot",
916
923
  type: "text",
917
924
  text: he(t.data.question, {
918
925
  submissions: s,
919
- context: i
926
+ context: a
920
927
  })
921
928
  });
922
929
  const n = await e.userInput({
@@ -927,27 +934,27 @@ async function js({
927
934
  n.value.length === 0 ? await e.sendMessage({
928
935
  type: "system",
929
936
  variant: "info",
930
- text: a("skipped")
937
+ text: i("skipped")
931
938
  }) : await e.sendMessage({
932
939
  author: "user",
933
940
  type: "text",
934
941
  text: t.data.options.filter((o) => n.value.includes(o.value)).map((o) => o.label).join(", ")
935
942
  }), r(t.nextId);
936
943
  }
937
- async function $s({
944
+ async function qs({
938
945
  chat: e,
939
946
  next: r,
940
947
  node: t,
941
948
  submissions: s,
942
- context: i,
943
- t: a
949
+ context: a,
950
+ t: i
944
951
  }) {
945
952
  await e.sendMessage({
946
953
  author: "bot",
947
954
  type: "text",
948
955
  text: he(t.data.question, {
949
956
  submissions: s,
950
- context: i
957
+ context: a
951
958
  })
952
959
  });
953
960
  const n = await e.userInput({
@@ -964,14 +971,14 @@ async function $s({
964
971
  n === null ? await e.sendMessage({
965
972
  type: "system",
966
973
  variant: "info",
967
- text: a("skipped")
974
+ text: i("skipped")
968
975
  }) : await e.sendMessage({
969
976
  author: "user",
970
977
  type: "text",
971
978
  text: n.value === !0 ? t.data.trueLabel : t.data.falseLabel
972
979
  }), r(t.nextId);
973
980
  }
974
- async function qs({
981
+ async function Us({
975
982
  chat: e,
976
983
  next: r,
977
984
  node: t,
@@ -982,7 +989,7 @@ async function qs({
982
989
  type: "text",
983
990
  text: t.data.question
984
991
  });
985
- const i = await e.userInput({
992
+ const a = await e.userInput({
986
993
  type: "address",
987
994
  key: t.data.key,
988
995
  config: {
@@ -992,36 +999,36 @@ async function qs({
992
999
  placeholder: t.data.placeholder
993
1000
  }
994
1001
  });
995
- if (i === null)
1002
+ if (a === null)
996
1003
  await e.sendMessage({
997
1004
  type: "system",
998
1005
  variant: "info",
999
1006
  text: s("skipped")
1000
1007
  });
1001
1008
  else {
1002
- const a = Object.values(i.value).filter((n) => n && n.trim().length > 0).join(", ");
1009
+ const i = Object.values(a.value).filter((n) => n && n.trim().length > 0).join(", ");
1003
1010
  await e.sendMessage({
1004
1011
  author: "user",
1005
1012
  type: "text",
1006
- text: a
1013
+ text: i
1007
1014
  });
1008
1015
  }
1009
1016
  return r(t.nextId);
1010
1017
  }
1011
- async function Us({
1018
+ async function zs({
1012
1019
  node: e,
1013
1020
  chat: r,
1014
1021
  next: t,
1015
1022
  submissions: s,
1016
- context: i,
1017
- t: a
1023
+ context: a,
1024
+ t: i
1018
1025
  }) {
1019
1026
  await r.sendMessage({
1020
1027
  author: "bot",
1021
1028
  type: "text",
1022
1029
  text: he(e.data.question, {
1023
1030
  submissions: s,
1024
- context: i
1031
+ context: a
1025
1032
  })
1026
1033
  });
1027
1034
  const n = await r.userInput({
@@ -1039,7 +1046,7 @@ async function Us({
1039
1046
  await r.sendMessage({
1040
1047
  type: "system",
1041
1048
  variant: "info",
1042
- text: a("skipped")
1049
+ text: i("skipped")
1043
1050
  });
1044
1051
  else
1045
1052
  for (const o of n.value)
@@ -1051,7 +1058,7 @@ async function Us({
1051
1058
  });
1052
1059
  return t(e.nextId);
1053
1060
  }
1054
- async function zs({
1061
+ async function Ws({
1055
1062
  chat: e,
1056
1063
  end: r,
1057
1064
  node: t
@@ -1062,25 +1069,25 @@ async function zs({
1062
1069
  text: t.data.systemMessage
1063
1070
  }), r();
1064
1071
  }
1065
- async function Ws({
1072
+ async function Ks({
1066
1073
  node: e,
1067
1074
  flow: r,
1068
1075
  submissions: t,
1069
1076
  chat: s,
1070
- next: i,
1071
- apiClient: a,
1077
+ next: a,
1078
+ apiClient: i,
1072
1079
  analytics: n
1073
1080
  }) {
1074
- const o = is(r.nodes, t || {}), {
1081
+ const o = as(r.nodes, t || {}), {
1075
1082
  answers: c,
1076
- ...h
1083
+ ...p
1077
1084
  } = o;
1078
1085
  s.setSubmission(e.data.key, {
1079
1086
  type: "integration",
1080
- value: h
1087
+ value: p
1081
1088
  });
1082
1089
  const b = new AbortController(), x = setTimeout(() => b.abort(), 5e3);
1083
- if (a.fetch("/flow/pre-apply", {
1090
+ if (i.fetch("/flow/pre-apply", {
1084
1091
  method: "POST",
1085
1092
  signal: b.signal,
1086
1093
  body: JSON.stringify({
@@ -1093,9 +1100,9 @@ async function Ws({
1093
1100
  }).finally(() => clearTimeout(x)), o.status !== "skipped") {
1094
1101
  const m = [o.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : o.hasHardConcerns ? e.data.messages.hard : o.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
1095
1102
  for (const C of ["hard", "advisory"]) {
1096
- const E = c.filter((A) => !A.matched && A.severity === C);
1103
+ const E = c.filter((V) => !V.matched && V.severity === C);
1097
1104
  E.length && m.push((C === "hard" ? "Role requirements" : "Other things to consider") + `
1098
- ` + E.map((A) => `• ${A.message}`).join(`
1105
+ ` + E.map((V) => `• ${V.message}`).join(`
1099
1106
  `));
1100
1107
  }
1101
1108
  await s.sendMessage({
@@ -1116,7 +1123,7 @@ async function Ws({
1116
1123
  }
1117
1124
  });
1118
1125
  }
1119
- return i(e.nextId);
1126
+ return a(e.nextId);
1120
1127
  }
1121
1128
  const Ee = ({
1122
1129
  class: e,
@@ -1148,21 +1155,16 @@ const Ee = ({
1148
1155
  })
1149
1156
  });
1150
1157
  };
1151
- var ye;
1158
+ var me;
1152
1159
  // @__NO_SIDE_EFFECTS__
1153
- function it(e) {
1160
+ function ut(e) {
1154
1161
  return {
1155
- lang: (e == null ? void 0 : e.lang) ?? (ye == null ? void 0 : ye.lang),
1162
+ lang: (e == null ? void 0 : e.lang) ?? (me == null ? void 0 : me.lang),
1156
1163
  message: e == null ? void 0 : e.message,
1157
- abortEarly: (e == null ? void 0 : e.abortEarly) ?? (ye == null ? void 0 : ye.abortEarly),
1158
- abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (ye == null ? void 0 : ye.abortPipeEarly)
1164
+ abortEarly: (e == null ? void 0 : e.abortEarly) ?? (me == null ? void 0 : me.abortEarly),
1165
+ abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (me == null ? void 0 : me.abortPipeEarly)
1159
1166
  };
1160
1167
  }
1161
- var yt;
1162
- // @__NO_SIDE_EFFECTS__
1163
- function Ks(e) {
1164
- return yt == null ? void 0 : yt.get(e);
1165
- }
1166
1168
  var mt;
1167
1169
  // @__NO_SIDE_EFFECTS__
1168
1170
  function Gs(e) {
@@ -1170,57 +1172,62 @@ function Gs(e) {
1170
1172
  }
1171
1173
  var gt;
1172
1174
  // @__NO_SIDE_EFFECTS__
1173
- function Hs(e, r) {
1175
+ function Hs(e) {
1176
+ return gt == null ? void 0 : gt.get(e);
1177
+ }
1178
+ var bt;
1179
+ // @__NO_SIDE_EFFECTS__
1180
+ function Js(e, r) {
1174
1181
  var t;
1175
- return (t = gt == null ? void 0 : gt.get(e)) == null ? void 0 : t.get(r);
1182
+ return (t = bt == null ? void 0 : bt.get(e)) == null ? void 0 : t.get(r);
1176
1183
  }
1177
1184
  // @__NO_SIDE_EFFECTS__
1178
- function De(e) {
1185
+ function Te(e) {
1179
1186
  var t, s;
1180
1187
  const r = typeof e;
1181
1188
  return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((s = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : s.name)) ?? "null" : r;
1182
1189
  }
1183
- function Z(e, r, t, s, i) {
1184
- const a = i && "input" in i ? i.input : t.value, n = (i == null ? void 0 : i.expected) ?? e.expects ?? null, o = (i == null ? void 0 : i.received) ?? /* @__PURE__ */ De(a), c = {
1190
+ function Z(e, r, t, s, a) {
1191
+ const i = a && "input" in a ? a.input : t.value, n = (a == null ? void 0 : a.expected) ?? e.expects ?? null, o = (a == null ? void 0 : a.received) ?? /* @__PURE__ */ Te(i), c = {
1185
1192
  kind: e.kind,
1186
1193
  type: e.type,
1187
- input: a,
1194
+ input: i,
1188
1195
  expected: n,
1189
1196
  received: o,
1190
1197
  message: `Invalid ${r}: ${n ? `Expected ${n} but r` : "R"}eceived ${o}`,
1191
1198
  requirement: e.requirement,
1192
- path: i == null ? void 0 : i.path,
1193
- issues: i == null ? void 0 : i.issues,
1199
+ path: a == null ? void 0 : a.path,
1200
+ issues: a == null ? void 0 : a.issues,
1194
1201
  lang: s.lang,
1195
1202
  abortEarly: s.abortEarly,
1196
1203
  abortPipeEarly: s.abortPipeEarly
1197
- }, h = e.kind === "schema", b = (i == null ? void 0 : i.message) ?? e.message ?? /* @__PURE__ */ Hs(e.reference, c.lang) ?? (h ? /* @__PURE__ */ Gs(c.lang) : null) ?? s.message ?? /* @__PURE__ */ Ks(c.lang);
1204
+ }, p = e.kind === "schema", b = (a == null ? void 0 : a.message) ?? e.message ?? /* @__PURE__ */ Js(e.reference, c.lang) ?? (p ? /* @__PURE__ */ Hs(c.lang) : null) ?? s.message ?? /* @__PURE__ */ Gs(c.lang);
1198
1205
  b !== void 0 && (c.message = typeof b == "function" ? (
1199
1206
  // @ts-expect-error
1200
1207
  b(c)
1201
- ) : b), h && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
1208
+ ) : b), p && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
1202
1209
  }
1203
1210
  // @__NO_SIDE_EFFECTS__
1204
- function pe(e) {
1211
+ function ye(e) {
1205
1212
  return {
1206
1213
  version: 1,
1207
1214
  vendor: "valibot",
1208
1215
  validate(r) {
1209
- return e["~run"]({ value: r }, /* @__PURE__ */ it());
1216
+ return e["~run"]({ value: r }, /* @__PURE__ */ ut());
1210
1217
  }
1211
1218
  };
1212
1219
  }
1213
1220
  // @__NO_SIDE_EFFECTS__
1214
- function Js(e, r) {
1221
+ function Xs(e, r) {
1215
1222
  return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
1216
1223
  }
1217
1224
  // @__NO_SIDE_EFFECTS__
1218
- function Xs(e, r) {
1225
+ function Zs(e, r) {
1219
1226
  const t = [...new Set(e)];
1220
1227
  return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
1221
1228
  }
1222
1229
  // @__NO_SIDE_EFFECTS__
1223
- function Zs(e) {
1230
+ function Ys(e) {
1224
1231
  if (e.path) {
1225
1232
  let r = "";
1226
1233
  for (const t of e.path)
@@ -1232,7 +1239,7 @@ function Zs(e) {
1232
1239
  }
1233
1240
  return null;
1234
1241
  }
1235
- var Ys = class extends Error {
1242
+ var Qs = class extends Error {
1236
1243
  /**
1237
1244
  * Creates a Valibot error with useful information.
1238
1245
  *
@@ -1241,7 +1248,7 @@ var Ys = class extends Error {
1241
1248
  constructor(e) {
1242
1249
  super(e[0].message), this.name = "ValiError", this.issues = e;
1243
1250
  }
1244
- }, Qs = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
1251
+ }, en = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
1245
1252
  // @__NO_SIDE_EFFECTS__
1246
1253
  function Ir(e, r) {
1247
1254
  return {
@@ -1258,14 +1265,14 @@ function Ir(e, r) {
1258
1265
  };
1259
1266
  }
1260
1267
  // @__NO_SIDE_EFFECTS__
1261
- function Fr(e) {
1268
+ function Ar(e) {
1262
1269
  return {
1263
1270
  kind: "validation",
1264
1271
  type: "email",
1265
- reference: Fr,
1272
+ reference: Ar,
1266
1273
  expects: null,
1267
1274
  async: !1,
1268
- requirement: Qs,
1275
+ requirement: en,
1269
1276
  message: e,
1270
1277
  "~run"(r, t) {
1271
1278
  return r.typed && !this.requirement.test(r.value) && Z(this, "email", r, t), r;
@@ -1273,11 +1280,11 @@ function Fr(e) {
1273
1280
  };
1274
1281
  }
1275
1282
  // @__NO_SIDE_EFFECTS__
1276
- function Ke(e, r) {
1283
+ function He(e, r) {
1277
1284
  return {
1278
1285
  kind: "validation",
1279
1286
  type: "max_length",
1280
- reference: Ke,
1287
+ reference: He,
1281
1288
  async: !1,
1282
1289
  expects: `<=${e}`,
1283
1290
  requirement: e,
@@ -1290,28 +1297,28 @@ function Ke(e, r) {
1290
1297
  };
1291
1298
  }
1292
1299
  // @__NO_SIDE_EFFECTS__
1293
- function Vr(e, r) {
1300
+ function Fr(e, r) {
1294
1301
  return {
1295
1302
  kind: "validation",
1296
1303
  type: "max_value",
1297
- reference: Vr,
1304
+ reference: Fr,
1298
1305
  async: !1,
1299
- expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ De(e)}`,
1306
+ expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Te(e)}`,
1300
1307
  requirement: e,
1301
1308
  message: r,
1302
1309
  "~run"(t, s) {
1303
1310
  return t.typed && !(t.value <= this.requirement) && Z(this, "value", t, s, {
1304
- received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ De(t.value)
1311
+ received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Te(t.value)
1305
1312
  }), t;
1306
1313
  }
1307
1314
  };
1308
1315
  }
1309
1316
  // @__NO_SIDE_EFFECTS__
1310
- function Te(e, r) {
1317
+ function De(e, r) {
1311
1318
  return {
1312
1319
  kind: "validation",
1313
1320
  type: "min_length",
1314
- reference: Te,
1321
+ reference: De,
1315
1322
  async: !1,
1316
1323
  expects: `>=${e}`,
1317
1324
  requirement: e,
@@ -1324,28 +1331,28 @@ function Te(e, r) {
1324
1331
  };
1325
1332
  }
1326
1333
  // @__NO_SIDE_EFFECTS__
1327
- function Ar(e, r) {
1334
+ function Vr(e, r) {
1328
1335
  return {
1329
1336
  kind: "validation",
1330
1337
  type: "min_value",
1331
- reference: Ar,
1338
+ reference: Vr,
1332
1339
  async: !1,
1333
- expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ De(e)}`,
1340
+ expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Te(e)}`,
1334
1341
  requirement: e,
1335
1342
  message: r,
1336
1343
  "~run"(t, s) {
1337
1344
  return t.typed && !(t.value >= this.requirement) && Z(this, "value", t, s, {
1338
- received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ De(t.value)
1345
+ received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Te(t.value)
1339
1346
  }), t;
1340
1347
  }
1341
1348
  };
1342
1349
  }
1343
1350
  // @__NO_SIDE_EFFECTS__
1344
- function St(e, r) {
1351
+ function It(e, r) {
1345
1352
  return {
1346
1353
  kind: "validation",
1347
1354
  type: "regex",
1348
- reference: St,
1355
+ reference: It,
1349
1356
  async: !1,
1350
1357
  expects: `${e}`,
1351
1358
  requirement: e,
@@ -1356,11 +1363,11 @@ function St(e, r) {
1356
1363
  };
1357
1364
  }
1358
1365
  // @__NO_SIDE_EFFECTS__
1359
- function It(e) {
1366
+ function At(e) {
1360
1367
  return {
1361
1368
  kind: "transformation",
1362
1369
  type: "transform",
1363
- reference: It,
1370
+ reference: At,
1364
1371
  async: !1,
1365
1372
  operation: e,
1366
1373
  "~run"(r) {
@@ -1390,7 +1397,7 @@ function Mr(e) {
1390
1397
  };
1391
1398
  }
1392
1399
  // @__NO_SIDE_EFFECTS__
1393
- function en(e, r, t) {
1400
+ function tn(e, r, t) {
1394
1401
  return typeof e.fallback == "function" ? (
1395
1402
  // @ts-expect-error
1396
1403
  e.fallback(r, t)
@@ -1420,25 +1427,25 @@ function Nr(e, r) {
1420
1427
  item: e,
1421
1428
  message: r,
1422
1429
  get "~standard"() {
1423
- return /* @__PURE__ */ pe(this);
1430
+ return /* @__PURE__ */ ye(this);
1424
1431
  },
1425
1432
  "~run"(t, s) {
1426
- var a;
1427
- const i = t.value;
1428
- if (Array.isArray(i)) {
1433
+ var i;
1434
+ const a = t.value;
1435
+ if (Array.isArray(a)) {
1429
1436
  t.typed = !0, t.value = [];
1430
- for (let n = 0; n < i.length; n++) {
1431
- const o = i[n], c = this.item["~run"]({ value: o }, s);
1437
+ for (let n = 0; n < a.length; n++) {
1438
+ const o = a[n], c = this.item["~run"]({ value: o }, s);
1432
1439
  if (c.issues) {
1433
- const h = {
1440
+ const p = {
1434
1441
  type: "array",
1435
1442
  origin: "value",
1436
- input: i,
1443
+ input: a,
1437
1444
  key: n,
1438
1445
  value: o
1439
1446
  };
1440
1447
  for (const b of c.issues)
1441
- b.path ? b.path.unshift(h) : b.path = [h], (a = t.issues) == null || a.push(b);
1448
+ b.path ? b.path.unshift(p) : b.path = [p], (i = t.issues) == null || i.push(b);
1442
1449
  if (t.issues || (t.issues = c.issues), s.abortEarly) {
1443
1450
  t.typed = !1;
1444
1451
  break;
@@ -1462,7 +1469,7 @@ function Lr(e) {
1462
1469
  async: !1,
1463
1470
  message: e,
1464
1471
  get "~standard"() {
1465
- return /* @__PURE__ */ pe(this);
1472
+ return /* @__PURE__ */ ye(this);
1466
1473
  },
1467
1474
  "~run"(r, t) {
1468
1475
  return typeof r.value == "boolean" ? r.typed = !0 : Z(this, "type", r, t), r;
@@ -1470,16 +1477,16 @@ function Lr(e) {
1470
1477
  };
1471
1478
  }
1472
1479
  // @__NO_SIDE_EFFECTS__
1473
- function Tr(e) {
1480
+ function Dr(e) {
1474
1481
  return {
1475
1482
  kind: "schema",
1476
1483
  type: "number",
1477
- reference: Tr,
1484
+ reference: Dr,
1478
1485
  expects: "number",
1479
1486
  async: !1,
1480
1487
  message: e,
1481
1488
  get "~standard"() {
1482
- return /* @__PURE__ */ pe(this);
1489
+ return /* @__PURE__ */ ye(this);
1483
1490
  },
1484
1491
  "~run"(r, t) {
1485
1492
  return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : Z(this, "type", r, t), r;
@@ -1487,49 +1494,49 @@ function Tr(e) {
1487
1494
  };
1488
1495
  }
1489
1496
  // @__NO_SIDE_EFFECTS__
1490
- function ve(e, r) {
1497
+ function xe(e, r) {
1491
1498
  return {
1492
1499
  kind: "schema",
1493
1500
  type: "object",
1494
- reference: ve,
1501
+ reference: xe,
1495
1502
  expects: "Object",
1496
1503
  async: !1,
1497
1504
  entries: e,
1498
1505
  message: r,
1499
1506
  get "~standard"() {
1500
- return /* @__PURE__ */ pe(this);
1507
+ return /* @__PURE__ */ ye(this);
1501
1508
  },
1502
1509
  "~run"(t, s) {
1503
- var a;
1504
- const i = t.value;
1505
- if (i && typeof i == "object") {
1510
+ var i;
1511
+ const a = t.value;
1512
+ if (a && typeof a == "object") {
1506
1513
  t.typed = !0, t.value = {};
1507
1514
  for (const n in this.entries) {
1508
1515
  const o = this.entries[n];
1509
- if (n in i || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
1516
+ if (n in a || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
1510
1517
  o.default !== void 0) {
1511
- const c = n in i ? (
1518
+ const c = n in a ? (
1512
1519
  // @ts-expect-error
1513
- i[n]
1514
- ) : /* @__PURE__ */ Er(o), h = o["~run"]({ value: c }, s);
1515
- if (h.issues) {
1520
+ a[n]
1521
+ ) : /* @__PURE__ */ Er(o), p = o["~run"]({ value: c }, s);
1522
+ if (p.issues) {
1516
1523
  const b = {
1517
1524
  type: "object",
1518
1525
  origin: "value",
1519
- input: i,
1526
+ input: a,
1520
1527
  key: n,
1521
1528
  value: c
1522
1529
  };
1523
- for (const x of h.issues)
1524
- x.path ? x.path.unshift(b) : x.path = [b], (a = t.issues) == null || a.push(x);
1525
- if (t.issues || (t.issues = h.issues), s.abortEarly) {
1530
+ for (const x of p.issues)
1531
+ x.path ? x.path.unshift(b) : x.path = [b], (i = t.issues) == null || i.push(x);
1532
+ if (t.issues || (t.issues = p.issues), s.abortEarly) {
1526
1533
  t.typed = !1;
1527
1534
  break;
1528
1535
  }
1529
1536
  }
1530
- h.typed || (t.typed = !1), t.value[n] = h.value;
1537
+ p.typed || (t.typed = !1), t.value[n] = p.value;
1531
1538
  } else if (o.fallback !== void 0)
1532
- t.value[n] = /* @__PURE__ */ en(o);
1539
+ t.value[n] = /* @__PURE__ */ tn(o);
1533
1540
  else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (Z(this, "key", t, s, {
1534
1541
  input: void 0,
1535
1542
  expected: `"${n}"`,
@@ -1537,10 +1544,10 @@ function ve(e, r) {
1537
1544
  {
1538
1545
  type: "object",
1539
1546
  origin: "key",
1540
- input: i,
1547
+ input: a,
1541
1548
  key: n,
1542
1549
  // @ts-expect-error
1543
- value: i[n]
1550
+ value: a[n]
1544
1551
  }
1545
1552
  ]
1546
1553
  }), s.abortEarly))
@@ -1553,17 +1560,17 @@ function ve(e, r) {
1553
1560
  };
1554
1561
  }
1555
1562
  // @__NO_SIDE_EFFECTS__
1556
- function Ge(e, r) {
1563
+ function Je(e, r) {
1557
1564
  return {
1558
1565
  kind: "schema",
1559
1566
  type: "optional",
1560
- reference: Ge,
1567
+ reference: Je,
1561
1568
  expects: `(${e.expects} | undefined)`,
1562
1569
  async: !1,
1563
1570
  wrapped: e,
1564
1571
  default: r,
1565
1572
  get "~standard"() {
1566
- return /* @__PURE__ */ pe(this);
1573
+ return /* @__PURE__ */ ye(this);
1567
1574
  },
1568
1575
  "~run"(t, s) {
1569
1576
  return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ Er(this, t, s)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, s);
@@ -1571,17 +1578,17 @@ function Ge(e, r) {
1571
1578
  };
1572
1579
  }
1573
1580
  // @__NO_SIDE_EFFECTS__
1574
- function Dr(e, r) {
1581
+ function Tr(e, r) {
1575
1582
  return {
1576
1583
  kind: "schema",
1577
1584
  type: "picklist",
1578
- reference: Dr,
1579
- expects: /* @__PURE__ */ Xs(e.map(De), "|"),
1585
+ reference: Tr,
1586
+ expects: /* @__PURE__ */ Zs(e.map(Te), "|"),
1580
1587
  async: !1,
1581
1588
  options: e,
1582
1589
  message: r,
1583
1590
  get "~standard"() {
1584
- return /* @__PURE__ */ pe(this);
1591
+ return /* @__PURE__ */ ye(this);
1585
1592
  },
1586
1593
  "~run"(t, s) {
1587
1594
  return this.options.includes(t.value) ? t.typed = !0 : Z(this, "type", t, s), t;
@@ -1600,46 +1607,46 @@ function Or(e, r, t) {
1600
1607
  value: r,
1601
1608
  message: t,
1602
1609
  get "~standard"() {
1603
- return /* @__PURE__ */ pe(this);
1610
+ return /* @__PURE__ */ ye(this);
1604
1611
  },
1605
- "~run"(s, i) {
1612
+ "~run"(s, a) {
1606
1613
  var n, o;
1607
- const a = s.value;
1608
- if (a && typeof a == "object") {
1614
+ const i = s.value;
1615
+ if (i && typeof i == "object") {
1609
1616
  s.typed = !0, s.value = {};
1610
- for (const c in a)
1611
- if (/* @__PURE__ */ Js(a, c)) {
1612
- const h = a[c], b = this.key["~run"]({ value: c }, i);
1617
+ for (const c in i)
1618
+ if (/* @__PURE__ */ Xs(i, c)) {
1619
+ const p = i[c], b = this.key["~run"]({ value: c }, a);
1613
1620
  if (b.issues) {
1614
- const p = {
1621
+ const h = {
1615
1622
  type: "object",
1616
1623
  origin: "key",
1617
- input: a,
1624
+ input: i,
1618
1625
  key: c,
1619
- value: h
1626
+ value: p
1620
1627
  };
1621
1628
  for (const m of b.issues)
1622
- m.path = [p], (n = s.issues) == null || n.push(m);
1623
- if (s.issues || (s.issues = b.issues), i.abortEarly) {
1629
+ m.path = [h], (n = s.issues) == null || n.push(m);
1630
+ if (s.issues || (s.issues = b.issues), a.abortEarly) {
1624
1631
  s.typed = !1;
1625
1632
  break;
1626
1633
  }
1627
1634
  }
1628
1635
  const x = this.value["~run"](
1629
- { value: h },
1630
- i
1636
+ { value: p },
1637
+ a
1631
1638
  );
1632
1639
  if (x.issues) {
1633
- const p = {
1640
+ const h = {
1634
1641
  type: "object",
1635
1642
  origin: "value",
1636
- input: a,
1643
+ input: i,
1637
1644
  key: c,
1638
- value: h
1645
+ value: p
1639
1646
  };
1640
1647
  for (const m of x.issues)
1641
- m.path ? m.path.unshift(p) : m.path = [p], (o = s.issues) == null || o.push(m);
1642
- if (s.issues || (s.issues = x.issues), i.abortEarly) {
1648
+ m.path ? m.path.unshift(h) : m.path = [h], (o = s.issues) == null || o.push(m);
1649
+ if (s.issues || (s.issues = x.issues), a.abortEarly) {
1643
1650
  s.typed = !1;
1644
1651
  break;
1645
1652
  }
@@ -1647,44 +1654,44 @@ function Or(e, r, t) {
1647
1654
  (!b.typed || !x.typed) && (s.typed = !1), b.typed && (s.value[b.value] = x.value);
1648
1655
  }
1649
1656
  } else
1650
- Z(this, "type", s, i);
1657
+ Z(this, "type", s, a);
1651
1658
  return s;
1652
1659
  }
1653
1660
  };
1654
1661
  }
1655
1662
  // @__NO_SIDE_EFFECTS__
1656
- function ie(e) {
1663
+ function ae(e) {
1657
1664
  return {
1658
1665
  kind: "schema",
1659
1666
  type: "string",
1660
- reference: ie,
1667
+ reference: ae,
1661
1668
  expects: "string",
1662
1669
  async: !1,
1663
1670
  message: e,
1664
1671
  get "~standard"() {
1665
- return /* @__PURE__ */ pe(this);
1672
+ return /* @__PURE__ */ ye(this);
1666
1673
  },
1667
1674
  "~run"(r, t) {
1668
1675
  return typeof r.value == "string" ? r.typed = !0 : Z(this, "type", r, t), r;
1669
1676
  }
1670
1677
  };
1671
1678
  }
1672
- function tn(e, r, t) {
1673
- const s = e["~run"]({ value: r }, /* @__PURE__ */ it(t));
1679
+ function rn(e, r, t) {
1680
+ const s = e["~run"]({ value: r }, /* @__PURE__ */ ut(t));
1674
1681
  if (s.issues)
1675
- throw new Ys(s.issues);
1682
+ throw new Qs(s.issues);
1676
1683
  return s.value;
1677
1684
  }
1678
1685
  // @__NO_SIDE_EFFECTS__
1679
- function rn(e, r) {
1686
+ function sn(e, r) {
1680
1687
  const t = {};
1681
1688
  for (const s in e.entries)
1682
- t[s] = !r || r.includes(s) ? /* @__PURE__ */ Ge(e.entries[s]) : e.entries[s];
1689
+ t[s] = !r || r.includes(s) ? /* @__PURE__ */ Je(e.entries[s]) : e.entries[s];
1683
1690
  return {
1684
1691
  ...e,
1685
1692
  entries: t,
1686
1693
  get "~standard"() {
1687
- return /* @__PURE__ */ pe(this);
1694
+ return /* @__PURE__ */ ye(this);
1688
1695
  }
1689
1696
  };
1690
1697
  }
@@ -1694,7 +1701,7 @@ function Se(...e) {
1694
1701
  ...e[0],
1695
1702
  pipe: e,
1696
1703
  get "~standard"() {
1697
- return /* @__PURE__ */ pe(this);
1704
+ return /* @__PURE__ */ ye(this);
1698
1705
  },
1699
1706
  "~run"(r, t) {
1700
1707
  for (const s of e)
@@ -1710,8 +1717,8 @@ function Se(...e) {
1710
1717
  };
1711
1718
  }
1712
1719
  // @__NO_SIDE_EFFECTS__
1713
- function sn(e, r, t) {
1714
- const s = e["~run"]({ value: r }, /* @__PURE__ */ it(t));
1720
+ function nn(e, r, t) {
1721
+ const s = e["~run"]({ value: r }, /* @__PURE__ */ ut(t));
1715
1722
  return {
1716
1723
  typed: s.typed,
1717
1724
  success: !s.issues,
@@ -1720,10 +1727,10 @@ function sn(e, r, t) {
1720
1727
  };
1721
1728
  }
1722
1729
  // @__NO_SIDE_EFFECTS__
1723
- async function nn(e, r, t) {
1730
+ async function an(e, r, t) {
1724
1731
  const s = await e["~run"](
1725
1732
  { value: r },
1726
- /* @__PURE__ */ it(t)
1733
+ /* @__PURE__ */ ut(t)
1727
1734
  );
1728
1735
  return {
1729
1736
  typed: s.typed,
@@ -1765,7 +1772,7 @@ const Pe = ({
1765
1772
  class: "break-words pr-1 text-sm",
1766
1773
  children: e.message
1767
1774
  })]
1768
- }), Fe = ({
1775
+ }), Ae = ({
1769
1776
  class: e,
1770
1777
  ...r
1771
1778
  }) => {
@@ -1797,7 +1804,7 @@ const Pe = ({
1797
1804
  });
1798
1805
  };
1799
1806
  var Ft = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" };
1800
- const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
1807
+ const Ye = lt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
1801
1808
  variants: {
1802
1809
  optional: {
1803
1810
  true: "pr-16 pl-3",
@@ -1807,27 +1814,27 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1807
1814
  defaultVariants: {
1808
1815
  optional: !1
1809
1816
  }
1810
- }), an = "https://api.mapbox.com/search/searchbox/v1/suggest", on = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", ln = (e) => atob(e).split("").reverse().join(""), me = /* @__PURE__ */ ve({
1811
- name: /* @__PURE__ */ ie()
1812
- }), un = /* @__PURE__ */ ve({
1813
- suggestions: /* @__PURE__ */ Nr(/* @__PURE__ */ ve({
1814
- full_address: /* @__PURE__ */ Ge(/* @__PURE__ */ ie()),
1815
- place_formatted: /* @__PURE__ */ Ge(/* @__PURE__ */ ie()),
1816
- name: /* @__PURE__ */ Ge(/* @__PURE__ */ ie()),
1817
- mapbox_id: /* @__PURE__ */ ie(),
1818
- context: /* @__PURE__ */ rn(/* @__PURE__ */ ve({
1819
- address: me,
1820
- street: me,
1821
- neighborhood: me,
1822
- locality: me,
1823
- district: me,
1824
- place: me,
1825
- region: me,
1826
- postcode: me,
1827
- country: me
1817
+ }), on = "https://api.mapbox.com/search/searchbox/v1/suggest", ln = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", un = (e) => atob(e).split("").reverse().join(""), ge = /* @__PURE__ */ xe({
1818
+ name: /* @__PURE__ */ ae()
1819
+ }), cn = /* @__PURE__ */ xe({
1820
+ suggestions: /* @__PURE__ */ Nr(/* @__PURE__ */ xe({
1821
+ full_address: /* @__PURE__ */ Je(/* @__PURE__ */ ae()),
1822
+ place_formatted: /* @__PURE__ */ Je(/* @__PURE__ */ ae()),
1823
+ name: /* @__PURE__ */ Je(/* @__PURE__ */ ae()),
1824
+ mapbox_id: /* @__PURE__ */ ae(),
1825
+ context: /* @__PURE__ */ sn(/* @__PURE__ */ xe({
1826
+ address: ge,
1827
+ street: ge,
1828
+ neighborhood: ge,
1829
+ locality: ge,
1830
+ district: ge,
1831
+ place: ge,
1832
+ region: ge,
1833
+ postcode: ge,
1834
+ country: ge
1828
1835
  }))
1829
1836
  }))
1830
- }), cn = ({
1837
+ }), dn = ({
1831
1838
  logger: e,
1832
1839
  t: r
1833
1840
  }) => cs(() => {
@@ -1835,42 +1842,42 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1835
1842
  const t = (s = $.current$.peek().flow) == null ? void 0 : s.data.flowSessionId;
1836
1843
  return t ? {
1837
1844
  enabled: !0,
1838
- getPredictions: async (i) => {
1845
+ getPredictions: async (a) => {
1839
1846
  var x;
1840
- const a = new URL(an);
1841
- a.searchParams.set("q", i), a.searchParams.set("session_token", t);
1847
+ const i = new URL(on);
1848
+ i.searchParams.set("q", a), i.searchParams.set("session_token", t);
1842
1849
  const n = (x = $.current$.peek().flow) == null ? void 0 : x.locationOrigin;
1843
- n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 && a.searchParams.set("proximity", `${n.lng},${n.lat}`), a.searchParams.set("access_token", ln(on));
1844
- const c = await fetch(a);
1850
+ n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 && i.searchParams.set("proximity", `${n.lng},${n.lat}`), i.searchParams.set("access_token", un(ln));
1851
+ const c = await fetch(i);
1845
1852
  if (!c.ok)
1846
1853
  return e.error("Failed to get address details", c), {
1847
1854
  ok: !1,
1848
1855
  error: r("address_error")
1849
1856
  };
1850
- const h = /* @__PURE__ */ sn(un, await c.json());
1851
- if (h.success === !1)
1852
- return e.error("Failed to parse address details", h.issues), {
1857
+ const p = /* @__PURE__ */ nn(cn, await c.json());
1858
+ if (p.success === !1)
1859
+ return e.error("Failed to parse address details", p.issues), {
1853
1860
  ok: !1,
1854
1861
  error: r("address_error")
1855
1862
  };
1856
1863
  const {
1857
1864
  suggestions: b
1858
- } = h.output;
1865
+ } = p.output;
1859
1866
  return {
1860
1867
  ok: !0,
1861
- data: b.map((p) => {
1862
- var m, C, E, A, I, y, _, V, M;
1868
+ data: b.map((h) => {
1869
+ var m, C, E, V, I, y, _, F, M;
1863
1870
  return {
1864
- label: p.full_address ?? p.place_formatted ?? p.name ?? p.mapbox_id,
1865
- id: p.mapbox_id,
1871
+ label: h.full_address ?? h.place_formatted ?? h.name ?? h.mapbox_id,
1872
+ id: h.mapbox_id,
1866
1873
  address: {
1867
- line1: ((m = p.context.address) == null ? void 0 : m.name) ?? ((C = p.context.street) == null ? void 0 : C.name),
1874
+ line1: ((m = h.context.address) == null ? void 0 : m.name) ?? ((C = h.context.street) == null ? void 0 : C.name),
1868
1875
  line2: void 0,
1869
- line3: ((E = p.context.neighborhood) == null ? void 0 : E.name) ?? ((A = p.context.locality) == null ? void 0 : A.name),
1870
- city: ((I = p.context.place) == null ? void 0 : I.name) ?? ((y = p.context.district) == null ? void 0 : y.name),
1871
- state: (_ = p.context.region) == null ? void 0 : _.name,
1872
- postcode: (V = p.context.postcode) == null ? void 0 : V.name,
1873
- country: (M = p.context.country) == null ? void 0 : M.name
1876
+ line3: ((E = h.context.neighborhood) == null ? void 0 : E.name) ?? ((V = h.context.locality) == null ? void 0 : V.name),
1877
+ city: ((I = h.context.place) == null ? void 0 : I.name) ?? ((y = h.context.district) == null ? void 0 : y.name),
1878
+ state: (_ = h.context.region) == null ? void 0 : _.name,
1879
+ postcode: (F = h.context.postcode) == null ? void 0 : F.name,
1880
+ country: (M = h.context.country) == null ? void 0 : M.name
1874
1881
  }
1875
1882
  };
1876
1883
  })
@@ -1902,22 +1909,22 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1902
1909
  children: r("back")
1903
1910
  })]
1904
1911
  });
1905
- }, dn = ({
1912
+ }, fn = ({
1906
1913
  input: e,
1907
1914
  onSubmitSuccess: r,
1908
1915
  logger: t
1909
1916
  }) => {
1910
1917
  const {
1911
1918
  t: s
1912
- } = se(), [i, a] = be(), {
1919
+ } = se(), [a, i] = ve(), {
1913
1920
  enabled: n,
1914
1921
  getPredictions: o
1915
- } = cn({
1922
+ } = dn({
1916
1923
  logger: t,
1917
1924
  t: s
1918
- }), [c, h] = be(n ? "query" : "manual"), [b, x] = be(""), [p, m] = be(), C = fe(), E = fe(), A = (y) => {
1919
- var V;
1920
- if (Me(n, "Query state should not be enabled"), y = y.trim(), y === ((V = C.current) == null ? void 0 : V.query) || y === (p == null ? void 0 : p.query) && p.status === "done")
1925
+ }), [c, p] = ve(n ? "query" : "manual"), [b, x] = ve(""), [h, m] = ve(), C = pe(), E = pe(), V = (y) => {
1926
+ var F;
1927
+ if (Me(n, "Query state should not be enabled"), y = y.trim(), y === ((F = C.current) == null ? void 0 : F.query) || y === (h == null ? void 0 : h.query) && h.status === "done")
1921
1928
  return;
1922
1929
  if (x(y), y === "") {
1923
1930
  C.current = void 0, m(void 0);
@@ -1947,38 +1954,38 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1947
1954
  }));
1948
1955
  });
1949
1956
  }, I = (y, _) => {
1950
- a((V) => ({
1951
- ...V,
1957
+ i((F) => ({
1958
+ ...F,
1952
1959
  [y]: _
1953
1960
  }));
1954
1961
  };
1955
1962
  switch (c) {
1956
1963
  case "query":
1957
- return Me(n, "Query state should not be enabled"), u(fn, {
1964
+ return Me(n, "Query state should not be enabled"), u(pn, {
1958
1965
  input: e,
1959
1966
  onSkip: () => r(null),
1960
1967
  onAddressSelect: (y) => {
1961
1968
  if (y === "") {
1962
- C.current && (C.current = void 0, m(void 0)), h("manual");
1969
+ C.current && (C.current = void 0, m(void 0)), p("manual");
1963
1970
  return;
1964
1971
  }
1965
- const _ = (p == null ? void 0 : p.status) === "done" ? p.items.find((V) => V.id === y) : void 0;
1966
- _ && (E.current !== y && a(_.address), E.current = y, h("details"));
1972
+ const _ = (h == null ? void 0 : h.status) === "done" ? h.items.find((F) => F.id === y) : void 0;
1973
+ _ && (E.current !== y && i(_.address), E.current = y, p("details"));
1967
1974
  },
1968
- onAddressSearch: A,
1969
- lookup: p,
1975
+ onAddressSearch: V,
1976
+ lookup: h,
1970
1977
  query: b
1971
1978
  });
1972
1979
  case "details":
1973
- return Me(i !== void 0), u(Kt, {
1980
+ return Me(a !== void 0), u(Kt, {
1974
1981
  input: e,
1975
1982
  logger: t,
1976
1983
  onSubmitSuccess: r,
1977
- addressFields: i,
1984
+ addressFields: a,
1978
1985
  onFieldChange: I,
1979
1986
  actions: u(Wt, {
1980
1987
  onClick: () => {
1981
- h("query");
1988
+ p("query");
1982
1989
  }
1983
1990
  })
1984
1991
  });
@@ -1987,40 +1994,40 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1987
1994
  logger: t,
1988
1995
  input: e,
1989
1996
  onSubmitSuccess: r,
1990
- addressFields: i ?? {},
1997
+ addressFields: a ?? {},
1991
1998
  onFieldChange: I,
1992
1999
  actions: n ? u(Wt, {
1993
2000
  onClick: () => {
1994
- h("query");
2001
+ p("query");
1995
2002
  }
1996
2003
  }) : e.config.optional ? (
1997
2004
  // Without address search this is the only screen, so an optional question needs its own way past.
1998
- u(Fe, {
2005
+ u(Ae, {
1999
2006
  onClick: () => r(null)
2000
2007
  })
2001
2008
  ) : void 0
2002
2009
  });
2003
2010
  }
2004
- }, fn = ({
2011
+ }, pn = ({
2005
2012
  input: e,
2006
2013
  onSkip: r,
2007
2014
  lookup: t,
2008
2015
  onAddressSelect: s,
2009
- query: i,
2010
- onAddressSearch: a
2016
+ query: a,
2017
+ onAddressSearch: i
2011
2018
  }) => {
2012
2019
  const {
2013
2020
  t: n
2014
- } = se(), o = fe(null);
2021
+ } = se(), o = pe(null);
2015
2022
  return Ie(() => {
2016
2023
  o.current && (o.current.focus(), o.current.select());
2017
- }, []), u(xe, {
2024
+ }, []), u(we, {
2018
2025
  children: [u("form", {
2019
2026
  noValidate: !0,
2020
2027
  onSubmit: (c) => {
2021
2028
  c.preventDefault();
2022
2029
  const b = new FormData(c.currentTarget).get("address");
2023
- typeof b == "string" && a(b);
2030
+ typeof b == "string" && i(b);
2024
2031
  },
2025
2032
  class: "flex gap-2 p-2.5",
2026
2033
  children: [u("div", {
@@ -2032,8 +2039,8 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2032
2039
  autocomplete: "address-line1 country-name postal-code",
2033
2040
  autoFocus: !0,
2034
2041
  placeholder: e.config.placeholder || n("address_search"),
2035
- defaultValue: i,
2036
- class: Xe({
2042
+ defaultValue: a,
2043
+ class: Ye({
2037
2044
  optional: !!e.config.optional,
2038
2045
  className: "w-full rounded-full"
2039
2046
  })
@@ -2066,7 +2073,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2066
2073
  children: n("search")
2067
2074
  })]
2068
2075
  })]
2069
- }), e.config.optional && u(Fe, {
2076
+ }), e.config.optional && u(Ae, {
2070
2077
  class: "relative",
2071
2078
  onClick: r
2072
2079
  })]
@@ -2077,8 +2084,8 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2077
2084
  }) : null, u("p", {
2078
2085
  role: "status",
2079
2086
  class: (t == null ? void 0 : t.status) === "pending" || (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? "text-neutral-10 flex items-center gap-2 px-4 py-2 text-sm" : "sr-only",
2080
- children: (t == null ? void 0 : t.status) === "pending" ? u(xe, {
2081
- children: [u(Ct, {
2087
+ children: (t == null ? void 0 : t.status) === "pending" ? u(we, {
2088
+ children: [u(St, {
2082
2089
  "aria-hidden": "true",
2083
2090
  class: "h-4 w-4 shrink-0"
2084
2091
  }), n("address_searching")]
@@ -2121,17 +2128,17 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2121
2128
  }, "")]
2122
2129
  })]
2123
2130
  });
2124
- }, bt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], Kt = ({
2131
+ }, vt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], Kt = ({
2125
2132
  addressFields: e,
2126
2133
  onFieldChange: r,
2127
2134
  onSubmitSuccess: t,
2128
2135
  actions: s,
2129
- input: i
2136
+ input: a
2130
2137
  }) => {
2131
- const a = fe(null);
2138
+ const i = pe(null);
2132
2139
  Ie(() => {
2133
- if (a.current) {
2134
- const c = a.current.querySelector("input");
2140
+ if (i.current) {
2141
+ const c = i.current.querySelector("input");
2135
2142
  c && (c.focus(), c.select());
2136
2143
  }
2137
2144
  }, []);
@@ -2141,28 +2148,28 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2141
2148
  return u("form", {
2142
2149
  class: "flex flex-col px-2 pt-2",
2143
2150
  onSubmit: (c) => {
2144
- const h = c.currentTarget, b = [...h.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
2151
+ const p = c.currentTarget, b = [...p.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
2145
2152
  for (const m of b) {
2146
2153
  m.value = "";
2147
- const C = bt.find((E) => i.config.keys[E] === m.name);
2154
+ const C = vt.find((E) => a.config.keys[E] === m.name);
2148
2155
  C && r(C, "");
2149
2156
  }
2150
- if (b.length > 0 && !h.checkValidity()) {
2151
- c.preventDefault(), h.reportValidity();
2157
+ if (b.length > 0 && !p.checkValidity()) {
2158
+ c.preventDefault(), p.reportValidity();
2152
2159
  return;
2153
2160
  }
2154
- const x = new FormData(h), p = Object.fromEntries(x.entries());
2161
+ const x = new FormData(p), h = Object.fromEntries(x.entries());
2155
2162
  t({
2156
2163
  type: "address",
2157
- value: p
2164
+ value: h
2158
2165
  });
2159
2166
  },
2160
2167
  children: [u("div", {
2161
2168
  class: "bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",
2162
- ref: a,
2163
- children: bt.map((c, h) => {
2164
- const b = `isdk_${c}`, x = i.config.keys[c];
2165
- return x ? u(xe, {
2169
+ ref: i,
2170
+ children: vt.map((c, p) => {
2171
+ const b = `isdk_${c}`, x = a.config.keys[c];
2172
+ return x ? u(we, {
2166
2173
  children: [u("label", {
2167
2174
  for: b,
2168
2175
  class: "text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
@@ -2176,7 +2183,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2176
2183
  name: x,
2177
2184
  id: b,
2178
2185
  defaultValue: e[c],
2179
- onChange: (p) => r(c, p.currentTarget.value),
2186
+ onChange: (h) => r(c, h.currentTarget.value),
2180
2187
  required: !0,
2181
2188
  children: [e.country && !n.includes(e.country) ? u("option", {
2182
2189
  value: e[c],
@@ -2184,10 +2191,10 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2184
2191
  }) : u("option", {
2185
2192
  value: "",
2186
2193
  children: o("select_country")
2187
- }), n.map((p) => u("option", {
2188
- value: p,
2189
- children: p
2190
- }, p))]
2194
+ }), n.map((h) => u("option", {
2195
+ value: h,
2196
+ children: h
2197
+ }, h))]
2191
2198
  }), u("svg", {
2192
2199
  class: "text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",
2193
2200
  width: "16",
@@ -2204,14 +2211,14 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2204
2211
  })
2205
2212
  })]
2206
2213
  }) : u("input", {
2207
- autoFocus: h === 0 ? !0 : void 0,
2214
+ autoFocus: p === 0 ? !0 : void 0,
2208
2215
  class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",
2209
2216
  name: x,
2210
2217
  id: b,
2211
2218
  defaultValue: e[c],
2212
- onInput: (p) => r(c, p.currentTarget.value),
2213
- required: c !== "line2" || i.config.line2Required === !0
2214
- }), h === bt.length - 1 ? u("hr", {
2219
+ onInput: (h) => r(c, h.currentTarget.value),
2220
+ required: c !== "line2" || a.config.line2Required === !0
2221
+ }), p === vt.length - 1 ? u("hr", {
2215
2222
  class: "m-0 w-full border-b border-b-transparent"
2216
2223
  }) : u("hr", {
2217
2224
  class: "border-b-neutral-5 m-0 w-full border-b border-solid"
@@ -2227,12 +2234,12 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2227
2234
  })]
2228
2235
  });
2229
2236
  }, Vt = () => {
2230
- const e = fe(null);
2237
+ const e = pe(null);
2231
2238
  return vr(() => {
2232
2239
  var r;
2233
2240
  (r = e.current) == null || r.focus();
2234
2241
  }, []), e;
2235
- }, Rr = ["true", "false"], hn = /* @__PURE__ */ Dr(Rr), pn = "answer", Pr = "flex items-center flex-wrap gap-2 p-2.5", Br = "min-w-0 max-w-full flex-auto", jr = xr(({
2242
+ }, Rr = ["true", "false"], hn = /* @__PURE__ */ Tr(Rr), yn = "answer", Pr = "flex items-center flex-wrap gap-2 p-2.5", Br = "min-w-0 max-w-full flex-auto", jr = xr(({
2236
2243
  label: e,
2237
2244
  ...r
2238
2245
  }, t) => u("button", {
@@ -2243,7 +2250,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2243
2250
  class: "text-center text-base",
2244
2251
  children: e
2245
2252
  })
2246
- })), yn = ({
2253
+ })), mn = ({
2247
2254
  input: e,
2248
2255
  onSubmitSuccess: r
2249
2256
  }) => {
@@ -2253,49 +2260,49 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2253
2260
  class: "",
2254
2261
  onSubmit: (s) => {
2255
2262
  s.preventDefault();
2256
- const i = ds(s).value, a = tn(hn, i);
2263
+ const a = ds(s).value, i = rn(hn, a);
2257
2264
  r({
2258
2265
  type: "boolean",
2259
- value: a === "true"
2266
+ value: i === "true"
2260
2267
  });
2261
2268
  },
2262
2269
  children: [u("ul", {
2263
2270
  class: Pr,
2264
- children: Rr.map((s, i) => u("li", {
2271
+ children: Rr.map((s, a) => u("li", {
2265
2272
  class: Br,
2266
2273
  children: u(jr, {
2267
- ref: i === 0 ? t : null,
2274
+ ref: a === 0 ? t : null,
2268
2275
  type: "submit",
2269
- name: pn,
2276
+ name: yn,
2270
2277
  value: s,
2271
2278
  label: e.config.labels[s]
2272
2279
  }, s)
2273
2280
  }))
2274
2281
  }), e.config.optional && u("div", {
2275
2282
  class: "px-2 pb-2",
2276
- children: u(Fe, {
2283
+ children: u(Ae, {
2277
2284
  class: "relative w-full",
2278
2285
  type: "button",
2279
2286
  onClick: () => r(null)
2280
2287
  })
2281
2288
  })]
2282
2289
  });
2283
- }, mn = (e) => new Promise((r, t) => {
2290
+ }, gn = (e) => new Promise((r, t) => {
2284
2291
  const s = new FileReader();
2285
2292
  s.onload = () => {
2286
2293
  if (typeof s.result != "string" || !s.result)
2287
2294
  return t(new Error("Invalid file"));
2288
2295
  r(s.result);
2289
2296
  }, s.onerror = t, s.readAsDataURL(e);
2290
- }), Gt = (e) => e.reduce((r, t) => r + t.sizeKb, 0), gn = Re("file"), Ht = 3, at = (e) => {
2297
+ }), Gt = (e) => e.reduce((r, t) => r + t.sizeKb, 0), bn = Re("file"), Ht = 3, ct = (e) => {
2291
2298
  const r = e.lastIndexOf(".");
2292
2299
  return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
2293
- }, bn = ({
2300
+ }, vn = ({
2294
2301
  file: e,
2295
2302
  class: r,
2296
2303
  ...t
2297
2304
  }) => {
2298
- const [s, i] = at(e.name);
2305
+ const [s, a] = ct(e.name);
2299
2306
  return u("div", {
2300
2307
  class: Oe("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
2301
2308
  ...t,
@@ -2306,12 +2313,12 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2306
2313
  class: "block truncate",
2307
2314
  children: s
2308
2315
  }), u("span", {
2309
- children: i
2316
+ children: a
2310
2317
  })]
2311
2318
  }), u("p", {
2312
2319
  "aria-label": "File size",
2313
2320
  class: "text-accent-11",
2314
- children: We(e.sizeKb)
2321
+ children: Ge(e.sizeKb)
2315
2322
  })]
2316
2323
  });
2317
2324
  }, Jt = ({
@@ -2320,27 +2327,27 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2320
2327
  }) => u("li", {
2321
2328
  class: Oe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
2322
2329
  ...r
2323
- }), vn = (e, r) => {
2324
- const [t, s] = at(e);
2330
+ }), xn = (e, r) => {
2331
+ const [t, s] = ct(e);
2325
2332
  return `${t.slice(0, r)}${s}`;
2326
2333
  }, Xt = (e) => ({
2327
- name: vn(e.name, 42),
2334
+ name: xn(e.name, 42),
2328
2335
  sizeKb: e.size / 1e3
2329
- }), xn = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], wn = (e, r, t) => {
2330
- const s = at(r.name)[1].toLowerCase(), i = [...t.map((n) => n.toLowerCase()), ...xn], a = s === "" ? "none" : i.includes(s) ? s : "other";
2331
- return `chatbot-file-refused:${e}:${a}`;
2332
- }, _n = ({
2336
+ }), wn = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], _n = (e, r, t) => {
2337
+ const s = ct(r.name)[1].toLowerCase(), a = [...t.map((n) => n.toLowerCase()), ...wn], i = s === "" ? "none" : a.includes(s) ? s : "other";
2338
+ return `chatbot-file-refused:${e}:${i}`;
2339
+ }, kn = ({
2333
2340
  input: e,
2334
2341
  onSubmitSuccess: r,
2335
2342
  analytics: t
2336
2343
  }) => {
2337
- var A;
2338
- const s = (A = $.current$.value.flow) == null ? void 0 : A.data.submissions[e.key], [i, a] = be(gn(s) && s.value.length ? {
2344
+ var V;
2345
+ const s = (V = $.current$.value.flow) == null ? void 0 : V.data.submissions[e.key], [a, i] = ve(bn(s) && s.value.length ? {
2339
2346
  status: "ready",
2340
2347
  files: s.value
2341
2348
  } : {
2342
2349
  status: "empty"
2343
- }), n = fe(0), o = i.status === "ready" ? i.files : [], c = i.status === "ready" || i.status === "pending" ? i.files : [], h = i.status === "error" ? i.error : void 0, b = c.length - Ht, x = Gt(c), p = Vt(), {
2350
+ }), n = pe(0), o = a.status === "ready" ? a.files : [], c = a.status === "ready" || a.status === "pending" ? a.files : [], p = a.status === "error" ? a.error : void 0, b = c.length - Ht, x = Gt(c), h = Vt(), {
2344
2351
  t: m
2345
2352
  } = se(), C = (I) => {
2346
2353
  if (!I.length)
@@ -2368,7 +2375,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2368
2375
  error: {
2369
2376
  type: "max",
2370
2377
  message: m("validation_file_size", {
2371
- size: We(e.config.fileSizeLimitKib)
2378
+ size: Ge(e.config.fileSizeLimitKib)
2372
2379
  })
2373
2380
  }
2374
2381
  };
@@ -2383,22 +2390,22 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2383
2390
  }
2384
2391
  };
2385
2392
  }, E = (I, y) => {
2386
- var _, V;
2393
+ var _, F;
2387
2394
  return t.log({
2388
2395
  event: "INTERACTION",
2389
2396
  properties: {
2390
- tag: wn(I, y, e.config.extensions)
2397
+ tag: _n(I, y, e.config.extensions)
2391
2398
  },
2392
- customProperties: (V = (_ = $.current$.peek().flow) == null ? void 0 : _.analytics) == null ? void 0 : V.customProperties
2399
+ customProperties: (F = (_ = $.current$.peek().flow) == null ? void 0 : _.analytics) == null ? void 0 : F.customProperties
2393
2400
  });
2394
2401
  };
2395
2402
  return u("form", {
2396
2403
  class: "flex flex-col gap-1 p-2.5",
2397
2404
  onSubmit: (I) => {
2398
- if (I.preventDefault(), i.status === "pending" || i.status === "error")
2405
+ if (I.preventDefault(), a.status === "pending" || a.status === "error")
2399
2406
  return;
2400
2407
  const y = C(o);
2401
- y ? a({
2408
+ y ? i({
2402
2409
  status: "error",
2403
2410
  error: y.error
2404
2411
  }) : r({
@@ -2409,13 +2416,13 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2409
2416
  children: [u("div", {
2410
2417
  class: "flex items-center gap-2",
2411
2418
  children: [u("label", {
2412
- ref: p,
2419
+ ref: h,
2413
2420
  for: "dropzone-file",
2414
2421
  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",
2415
2422
  children: [c.length > 0 ? u("ul", {
2416
2423
  class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
2417
2424
  children: [c.slice(0, Ht).map((I) => {
2418
- const [y, _] = at(I.name);
2425
+ const [y, _] = ct(I.name);
2419
2426
  return u(Jt, {
2420
2427
  class: "flex overflow-hidden",
2421
2428
  children: [u("span", {
@@ -2453,7 +2460,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2453
2460
  }), e.config.fileSizeLimitKib ? u("p", {
2454
2461
  class: "text-neutral-10 text-xs",
2455
2462
  children: ["(", m("file_max_size", {
2456
- size: We(e.config.fileSizeLimitKib)
2463
+ size: Ge(e.config.fileSizeLimitKib)
2457
2464
  }), ")"]
2458
2465
  }) : null]
2459
2466
  }), u("aside", {
@@ -2474,15 +2481,15 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2474
2481
  }), u("p", {
2475
2482
  role: "status",
2476
2483
  class: Oe("text-neutral-11 flex items-center gap-1.5 text-xs", c.length === 0 && "sr-only"),
2477
- children: i.status === "pending" ? u(xe, {
2478
- children: [u(Ct, {
2484
+ children: a.status === "pending" ? u(we, {
2485
+ children: [u(St, {
2479
2486
  "aria-hidden": "true",
2480
2487
  class: "h-4 w-4"
2481
2488
  }), m("file_preparing", {
2482
2489
  count: c.length
2483
2490
  })]
2484
- }) : i.status === "ready" ? u(xe, {
2485
- children: [We(x), " ", o.length > 1 ? "total" : "", u("span", {
2491
+ }) : a.status === "ready" ? u(we, {
2492
+ children: [Ge(x), " ", o.length > 1 ? "total" : "", u("span", {
2486
2493
  class: "sr-only",
2487
2494
  children: [". ", m("file_ready", {
2488
2495
  count: o.length
@@ -2498,36 +2505,36 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2498
2505
  const [_] = y;
2499
2506
  if (!_)
2500
2507
  return;
2501
- const V = ++n.current, M = i.status === "ready", O = y.map(Xt), G = C(O);
2508
+ const F = ++n.current, M = a.status === "ready", O = y.map(Xt), G = C(O);
2502
2509
  if (G)
2503
- return E(G.reason, G.file ?? _), a({
2510
+ return E(G.reason, G.file ?? _), i({
2504
2511
  status: "error",
2505
2512
  error: G.error
2506
2513
  });
2507
- a({
2514
+ i({
2508
2515
  status: "pending",
2509
2516
  files: O
2510
2517
  });
2511
- let N;
2518
+ let L;
2512
2519
  try {
2513
- const U = await Promise.all(y.map(async (L) => {
2520
+ const U = await Promise.all(y.map(async (D) => {
2514
2521
  try {
2515
2522
  return {
2516
- ...Xt(L),
2517
- data: await mn(L)
2523
+ ...Xt(D),
2524
+ data: await gn(D)
2518
2525
  };
2519
- } catch (D) {
2520
- throw N ?? (N = L), D;
2526
+ } catch (T) {
2527
+ throw L ?? (L = D), T;
2521
2528
  }
2522
2529
  }));
2523
- n.current === V && a({
2530
+ n.current === F && i({
2524
2531
  status: "ready",
2525
2532
  files: U
2526
2533
  });
2527
2534
  } catch {
2528
- if (n.current !== V)
2535
+ if (n.current !== F)
2529
2536
  return;
2530
- E("unreadable", N ?? _), a({
2537
+ E("unreadable", L ?? _), i({
2531
2538
  status: "error",
2532
2539
  error: {
2533
2540
  type: "invalid",
@@ -2545,50 +2552,50 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2545
2552
  class: "flex h-full flex-col items-center gap-2",
2546
2553
  children: [u(Ee, {
2547
2554
  disabled: o.length === 0
2548
- }), e.config.optional && u(Fe, {
2555
+ }), e.config.optional && u(Ae, {
2549
2556
  class: "relative",
2550
2557
  onClick: () => r(null)
2551
2558
  })]
2552
2559
  })]
2553
2560
  }), u(Pe, {
2554
- error: h
2561
+ error: p
2555
2562
  })]
2556
2563
  });
2557
2564
  };
2558
- var Ze = (e) => e.type === "checkbox", Ae = (e) => e instanceof Date, re = (e) => e == null;
2565
+ var Qe = (e) => e.type === "checkbox", Ve = (e) => e instanceof Date, re = (e) => e == null;
2559
2566
  const $r = (e) => typeof e == "object";
2560
- var K = (e) => !re(e) && !Array.isArray(e) && $r(e) && !Ae(e), kn = (e) => K(e) && e.target ? Ze(e.target) ? e.target.checked : e.target.value : e, Cn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Sn = (e, r) => e.has(Cn(r)), In = (e) => {
2567
+ var K = (e) => !re(e) && !Array.isArray(e) && $r(e) && !Ve(e), Cn = (e) => K(e) && e.target ? Qe(e.target) ? e.target.checked : e.target.value : e, Sn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, In = (e, r) => e.has(Sn(r)), An = (e) => {
2561
2568
  const r = e.constructor && e.constructor.prototype;
2562
2569
  return K(r) && r.hasOwnProperty("isPrototypeOf");
2563
- }, At = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2564
- function H(e) {
2570
+ }, Mt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2571
+ function J(e) {
2565
2572
  if (e instanceof Date)
2566
2573
  return new Date(e);
2567
2574
  const r = typeof FileList < "u" && e instanceof FileList;
2568
- if (At && (e instanceof Blob || r))
2575
+ if (Mt && (e instanceof Blob || r))
2569
2576
  return e;
2570
2577
  const t = Array.isArray(e);
2571
- if (!t && !(K(e) && In(e)))
2578
+ if (!t && !(K(e) && An(e)))
2572
2579
  return e;
2573
2580
  const s = t ? [] : Object.create(Object.getPrototypeOf(e));
2574
- for (const i in e)
2575
- Object.prototype.hasOwnProperty.call(e, i) && (s[i] = H(e[i]));
2581
+ for (const a in e)
2582
+ Object.prototype.hasOwnProperty.call(e, a) && (s[a] = J(e[a]));
2576
2583
  return s;
2577
2584
  }
2578
- var ot = (e) => /^\w*$/.test(e), z = (e) => e === void 0, Mt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Et = (e) => Mt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2585
+ var dt = (e) => /^\w*$/.test(e), z = (e) => e === void 0, Et = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Nt = (e) => Et(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2579
2586
  if (!r || !K(e))
2580
2587
  return t;
2581
- const s = (ot(r) ? [r] : Et(r)).reduce((i, a) => re(i) ? i : i[a], e);
2588
+ const s = (dt(r) ? [r] : Nt(r)).reduce((a, i) => re(a) ? a : a[i], e);
2582
2589
  return z(s) || s === e ? z(e[r]) ? t : e[r] : s;
2583
- }, de = (e) => typeof e == "boolean", oe = (e) => typeof e == "function", B = (e, r, t) => {
2590
+ }, fe = (e) => typeof e == "boolean", oe = (e) => typeof e == "function", j = (e, r, t) => {
2584
2591
  let s = -1;
2585
- const i = ot(r) ? [r] : Et(r), a = i.length, n = a - 1;
2586
- for (; ++s < a; ) {
2587
- const o = i[s];
2592
+ const a = dt(r) ? [r] : Nt(r), i = a.length, n = i - 1;
2593
+ for (; ++s < i; ) {
2594
+ const o = a[s];
2588
2595
  let c = t;
2589
2596
  if (s !== n) {
2590
- const h = e[o];
2591
- c = K(h) || Array.isArray(h) ? h : isNaN(+i[s + 1]) ? {} : [];
2597
+ const p = e[o];
2598
+ c = K(p) || Array.isArray(p) ? p : isNaN(+a[s + 1]) ? {} : [];
2592
2599
  }
2593
2600
  if (o === "__proto__" || o === "constructor" || o === "prototype")
2594
2601
  return;
@@ -2605,7 +2612,7 @@ const Zt = {
2605
2612
  onSubmit: "onSubmit",
2606
2613
  onTouched: "onTouched",
2607
2614
  all: "all"
2608
- }, ge = {
2615
+ }, be = {
2609
2616
  max: "max",
2610
2617
  min: "min",
2611
2618
  maxLength: "maxLength",
@@ -2616,64 +2623,64 @@ const Zt = {
2616
2623
  }, Fn = Q.createContext(null);
2617
2624
  Fn.displayName = "HookFormControlContext";
2618
2625
  var Vn = (e, r, t, s = !0) => {
2619
- const i = {
2626
+ const a = {
2620
2627
  defaultValues: r._defaultValues
2621
2628
  };
2622
- for (const a in e)
2623
- Object.defineProperty(i, a, {
2629
+ for (const i in e)
2630
+ Object.defineProperty(a, i, {
2624
2631
  get: () => {
2625
- const n = a;
2632
+ const n = i;
2626
2633
  return r._proxyFormState[n] !== le.all && (r._proxyFormState[n] = !s || le.all), t && (t[n] = !0), e[n];
2627
2634
  }
2628
2635
  });
2629
- return i;
2636
+ return a;
2630
2637
  };
2631
- const An = typeof window < "u" ? Q.useLayoutEffect : Q.useEffect;
2632
- var ne = (e) => typeof e == "string", Mn = (e, r, t, s, i) => ne(e) ? (s && r.watch.add(e), S(t, e, i)) : Array.isArray(e) ? e.map((a) => (s && r.watch.add(a), S(t, a))) : (s && (r.watchAll = !0), t), wt = (e) => re(e) || !$r(e);
2638
+ const Mn = typeof window < "u" ? Q.useLayoutEffect : Q.useEffect;
2639
+ var ne = (e) => typeof e == "string", En = (e, r, t, s, a) => ne(e) ? (s && r.watch.add(e), S(t, e, a)) : Array.isArray(e) ? e.map((i) => (s && r.watch.add(i), S(t, i))) : (s && (r.watchAll = !0), t), _t = (e) => re(e) || !$r(e);
2633
2640
  function Ce(e, r, t = /* @__PURE__ */ new WeakSet()) {
2634
- if (wt(e) || wt(r))
2641
+ if (_t(e) || _t(r))
2635
2642
  return Object.is(e, r);
2636
- if (Ae(e) && Ae(r))
2643
+ if (Ve(e) && Ve(r))
2637
2644
  return Object.is(e.getTime(), r.getTime());
2638
- const s = Object.keys(e), i = Object.keys(r);
2639
- if (s.length !== i.length)
2645
+ const s = Object.keys(e), a = Object.keys(r);
2646
+ if (s.length !== a.length)
2640
2647
  return !1;
2641
2648
  if (t.has(e) || t.has(r))
2642
2649
  return !0;
2643
2650
  t.add(e), t.add(r);
2644
- for (const a of s) {
2645
- const n = e[a];
2646
- if (!i.includes(a))
2651
+ for (const i of s) {
2652
+ const n = e[i];
2653
+ if (!a.includes(i))
2647
2654
  return !1;
2648
- if (a !== "ref") {
2649
- const o = r[a];
2650
- if (Ae(n) && Ae(o) || K(n) && K(o) || Array.isArray(n) && Array.isArray(o) ? !Ce(n, o, t) : !Object.is(n, o))
2655
+ if (i !== "ref") {
2656
+ const o = r[i];
2657
+ if (Ve(n) && Ve(o) || K(n) && K(o) || Array.isArray(n) && Array.isArray(o) ? !Ce(n, o, t) : !Object.is(n, o))
2651
2658
  return !1;
2652
2659
  }
2653
2660
  }
2654
2661
  return !0;
2655
2662
  }
2656
- const En = Q.createContext(null);
2657
- En.displayName = "HookFormContext";
2658
- var qr = (e, r, t, s, i) => r ? {
2663
+ const Nn = Q.createContext(null);
2664
+ Nn.displayName = "HookFormContext";
2665
+ var qr = (e, r, t, s, a) => r ? {
2659
2666
  ...t[e],
2660
2667
  types: {
2661
2668
  ...t[e] && t[e].types ? t[e].types : {},
2662
- [s]: i || !0
2669
+ [s]: a || !0
2663
2670
  }
2664
- } : {}, He = (e) => Array.isArray(e) ? e : [e], Yt = () => {
2671
+ } : {}, Xe = (e) => Array.isArray(e) ? e : [e], Yt = () => {
2665
2672
  let e = [];
2666
2673
  return {
2667
2674
  get observers() {
2668
2675
  return e;
2669
2676
  },
2670
- next: (i) => {
2671
- for (const a of e)
2672
- a.next && a.next(i);
2677
+ next: (a) => {
2678
+ for (const i of e)
2679
+ i.next && i.next(a);
2673
2680
  },
2674
- subscribe: (i) => (e.push(i), {
2681
+ subscribe: (a) => (e.push(a), {
2675
2682
  unsubscribe: () => {
2676
- e = e.filter((a) => a !== i);
2683
+ e = e.filter((i) => i !== a);
2677
2684
  }
2678
2685
  }),
2679
2686
  unsubscribe: () => {
@@ -2685,22 +2692,22 @@ function Ur(e, r) {
2685
2692
  const t = {};
2686
2693
  for (const s in e)
2687
2694
  if (e.hasOwnProperty(s)) {
2688
- const i = e[s], a = r[s];
2689
- if (i && K(i) && a) {
2690
- const n = Ur(i, a);
2695
+ const a = e[s], i = r[s];
2696
+ if (a && K(a) && i) {
2697
+ const n = Ur(a, i);
2691
2698
  K(n) && (t[s] = n);
2692
2699
  } else
2693
- e[s] && (t[s] = a);
2700
+ e[s] && (t[s] = i);
2694
2701
  }
2695
2702
  return t;
2696
2703
  }
2697
- var ee = (e) => K(e) && !Object.keys(e).length, Nt = (e) => e.type === "file", tt = (e) => {
2698
- if (!At)
2704
+ var ee = (e) => K(e) && !Object.keys(e).length, Lt = (e) => e.type === "file", at = (e) => {
2705
+ if (!Mt)
2699
2706
  return !1;
2700
2707
  const r = e ? e.ownerDocument : 0;
2701
2708
  return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
2702
- }, zr = (e) => e.type === "select-multiple", Lt = (e) => e.type === "radio", Nn = (e) => Lt(e) || Ze(e), vt = (e) => tt(e) && e.isConnected;
2703
- function Ln(e, r) {
2709
+ }, zr = (e) => e.type === "select-multiple", Dt = (e) => e.type === "radio", Ln = (e) => Dt(e) || Qe(e), xt = (e) => at(e) && e.isConnected;
2710
+ function Dn(e, r) {
2704
2711
  const t = r.slice(0, -1).length;
2705
2712
  let s = 0;
2706
2713
  for (; s < t; )
@@ -2714,34 +2721,34 @@ function Tn(e) {
2714
2721
  return !0;
2715
2722
  }
2716
2723
  function W(e, r) {
2717
- const t = Array.isArray(r) ? r : ot(r) ? [r] : Et(r), s = t.length === 1 ? e : Ln(e, t), i = t.length - 1, a = t[i];
2718
- return s && delete s[a], i !== 0 && (K(s) && ee(s) || Array.isArray(s) && Tn(s)) && W(e, t.slice(0, -1)), e;
2724
+ const t = Array.isArray(r) ? r : dt(r) ? [r] : Nt(r), s = t.length === 1 ? e : Dn(e, t), a = t.length - 1, i = t[a];
2725
+ return s && delete s[i], a !== 0 && (K(s) && ee(s) || Array.isArray(s) && Tn(s)) && W(e, t.slice(0, -1)), e;
2719
2726
  }
2720
- var Dn = (e) => {
2727
+ var On = (e) => {
2721
2728
  for (const r in e)
2722
2729
  if (oe(e[r]))
2723
2730
  return !0;
2724
2731
  return !1;
2725
2732
  };
2726
2733
  function Wr(e) {
2727
- return Array.isArray(e) || K(e) && !Dn(e);
2734
+ return Array.isArray(e) || K(e) && !On(e);
2728
2735
  }
2729
- function _t(e, r = {}) {
2736
+ function kt(e, r = {}) {
2730
2737
  for (const t in e) {
2731
2738
  const s = e[t];
2732
- Wr(s) ? (r[t] = Array.isArray(s) ? [] : {}, _t(s, r[t])) : z(s) || (r[t] = !0);
2739
+ Wr(s) ? (r[t] = Array.isArray(s) ? [] : {}, kt(s, r[t])) : z(s) || (r[t] = !0);
2733
2740
  }
2734
2741
  return r;
2735
2742
  }
2736
2743
  function Le(e, r, t) {
2737
- t || (t = _t(r));
2744
+ t || (t = kt(r));
2738
2745
  for (const s in e) {
2739
- const i = e[s];
2740
- if (Wr(i))
2741
- z(r) || wt(t[s]) ? t[s] = _t(i, Array.isArray(i) ? [] : {}) : Le(i, re(r) ? {} : r[s], t[s]);
2746
+ const a = e[s];
2747
+ if (Wr(a))
2748
+ z(r) || _t(t[s]) ? t[s] = kt(a, Array.isArray(a) ? [] : {}) : Le(a, re(r) ? {} : r[s], t[s]);
2742
2749
  else {
2743
- const a = r[s];
2744
- t[s] = !Ce(i, a);
2750
+ const i = r[s];
2751
+ t[s] = !Ce(a, i);
2745
2752
  }
2746
2753
  }
2747
2754
  return t;
@@ -2773,21 +2780,21 @@ var Hr = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
2773
2780
  } : r, tr) : tr;
2774
2781
  function rr(e) {
2775
2782
  const r = e.ref;
2776
- return Nt(r) ? r.files : Lt(r) ? Hr(e.refs).value : zr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Ze(r) ? Kr(e.refs).value : Gr(z(r.value) ? e.ref.value : r.value, e);
2783
+ return Lt(r) ? r.files : Dt(r) ? Hr(e.refs).value : zr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Qe(r) ? Kr(e.refs).value : Gr(z(r.value) ? e.ref.value : r.value, e);
2777
2784
  }
2778
- var On = (e, r, t, s) => {
2779
- const i = {};
2780
- for (const a of e) {
2781
- const n = S(r, a);
2782
- n && B(i, a, n._f);
2785
+ var Rn = (e, r, t, s) => {
2786
+ const a = {};
2787
+ for (const i of e) {
2788
+ const n = S(r, i);
2789
+ n && j(a, i, n._f);
2783
2790
  }
2784
2791
  return {
2785
2792
  criteriaMode: t,
2786
2793
  names: [...e],
2787
- fields: i,
2794
+ fields: a,
2788
2795
  shouldUseNativeValidation: s
2789
2796
  };
2790
- }, rt = (e) => e instanceof RegExp, qe = (e) => z(e) ? e : rt(e) ? e.source : K(e) ? rt(e.value) ? e.value.source : e.value : e, sr = (e) => ({
2797
+ }, it = (e) => e instanceof RegExp, ze = (e) => z(e) ? e : it(e) ? e.source : K(e) ? it(e.value) ? e.value.source : e.value : e, sr = (e) => ({
2791
2798
  isOnSubmit: !e || e === le.onSubmit,
2792
2799
  isOnBlur: e === le.onBlur,
2793
2800
  isOnChange: e === le.onChange,
@@ -2795,142 +2802,142 @@ var On = (e, r, t, s) => {
2795
2802
  isOnTouch: e === le.onTouched
2796
2803
  });
2797
2804
  const nr = "AsyncFunction";
2798
- var Rn = (e) => !!e && !!e.validate && !!(oe(e.validate) && e.validate.constructor.name === nr || K(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === nr)), Pn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), ir = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
2799
- const Je = (e, r, t, s) => {
2800
- for (const i of t || Object.keys(e)) {
2801
- const a = S(e, i);
2802
- if (a) {
2803
- const { _f: n, ...o } = a;
2805
+ var Pn = (e) => !!e && !!e.validate && !!(oe(e.validate) && e.validate.constructor.name === nr || K(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === nr)), Bn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), ar = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
2806
+ const Ze = (e, r, t, s) => {
2807
+ for (const a of t || Object.keys(e)) {
2808
+ const i = S(e, a);
2809
+ if (i) {
2810
+ const { _f: n, ...o } = i;
2804
2811
  if (n) {
2805
- if (n.refs && n.refs[0] && r(n.refs[0], i) && !s)
2812
+ if (n.refs && n.refs[0] && r(n.refs[0], a) && !s)
2806
2813
  return !0;
2807
2814
  if (n.ref && r(n.ref, n.name) && !s)
2808
2815
  return !0;
2809
- if (Je(o, r))
2816
+ if (Ze(o, r))
2810
2817
  break;
2811
- } else if (K(o) && Je(o, r))
2818
+ } else if (K(o) && Ze(o, r))
2812
2819
  break;
2813
2820
  }
2814
2821
  }
2815
2822
  };
2816
- function ar(e, r, t) {
2823
+ function ir(e, r, t) {
2817
2824
  const s = S(e, t);
2818
- if (s || ot(t))
2825
+ if (s || dt(t))
2819
2826
  return {
2820
2827
  error: s,
2821
2828
  name: t
2822
2829
  };
2823
- const i = t.split(".");
2824
- for (; i.length; ) {
2825
- const a = i.join("."), n = S(r, a), o = S(e, a);
2826
- if (n && !Array.isArray(n) && t !== a)
2830
+ const a = t.split(".");
2831
+ for (; a.length; ) {
2832
+ const i = a.join("."), n = S(r, i), o = S(e, i);
2833
+ if (n && !Array.isArray(n) && t !== i)
2827
2834
  return { name: t };
2828
2835
  if (o && o.type)
2829
2836
  return {
2830
- name: a,
2837
+ name: i,
2831
2838
  error: o
2832
2839
  };
2833
2840
  if (o && o.root && o.root.type)
2834
2841
  return {
2835
- name: `${a}.root`,
2842
+ name: `${i}.root`,
2836
2843
  error: o.root
2837
2844
  };
2838
- i.pop();
2845
+ a.pop();
2839
2846
  }
2840
2847
  return {
2841
2848
  name: t
2842
2849
  };
2843
2850
  }
2844
- var Bn = (e, r, t, s) => {
2851
+ var jn = (e, r, t, s) => {
2845
2852
  t(e);
2846
- const { name: i, ...a } = e;
2847
- return ee(a) || Object.keys(a).length >= Object.keys(r).length || Object.keys(a).find((n) => r[n] === (!s || le.all));
2848
- }, jn = (e, r, t) => !e || !r || e === r || He(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), $n = (e, r, t, s, i) => i.isOnAll ? !1 : !t && i.isOnTouch ? !(r || e) : (t ? s.isOnBlur : i.isOnBlur) ? !e : (t ? s.isOnChange : i.isOnChange) ? e : !0, qn = (e, r) => !Mt(S(e, r)).length && W(e, r), Un = (e, r, t) => {
2849
- const s = He(S(e, t));
2850
- return B(s, "root", r[t]), B(e, t, s), e;
2853
+ const { name: a, ...i } = e;
2854
+ return ee(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((n) => r[n] === (!s || le.all));
2855
+ }, $n = (e, r, t) => !e || !r || e === r || Xe(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), qn = (e, r, t, s, a) => a.isOnAll ? !1 : !t && a.isOnTouch ? !(r || e) : (t ? s.isOnBlur : a.isOnBlur) ? !e : (t ? s.isOnChange : a.isOnChange) ? e : !0, Un = (e, r) => !Et(S(e, r)).length && W(e, r), zn = (e, r, t) => {
2856
+ const s = Xe(S(e, t));
2857
+ return j(s, "root", r[t]), j(e, t, s), e;
2851
2858
  };
2852
2859
  function or(e, r, t = "validate") {
2853
- if (ne(e) || Array.isArray(e) && e.every(ne) || de(e) && !e)
2860
+ if (ne(e) || Array.isArray(e) && e.every(ne) || fe(e) && !e)
2854
2861
  return {
2855
2862
  type: t,
2856
2863
  message: ne(e) ? e : "",
2857
2864
  ref: r
2858
2865
  };
2859
2866
  }
2860
- var Ne = (e) => K(e) && !rt(e) ? e : {
2867
+ var Ne = (e) => K(e) && !it(e) ? e : {
2861
2868
  value: e,
2862
2869
  message: ""
2863
- }, lr = async (e, r, t, s, i, a) => {
2864
- const { ref: n, refs: o, required: c, maxLength: h, minLength: b, min: x, max: p, pattern: m, validate: C, name: E, valueAsNumber: A, mount: I } = e._f, y = S(t, E);
2870
+ }, lr = async (e, r, t, s, a, i) => {
2871
+ const { ref: n, refs: o, required: c, maxLength: p, minLength: b, min: x, max: h, pattern: m, validate: C, name: E, valueAsNumber: V, mount: I } = e._f, y = S(t, E);
2865
2872
  if (!I || r.has(E))
2866
2873
  return {};
2867
- const _ = o ? o[0] : n, V = (w) => {
2868
- i && _.reportValidity && (_.setCustomValidity(de(w) ? "" : w || ""), _.reportValidity());
2869
- }, M = {}, O = Lt(n), G = Ze(n), N = O || G, U = (A || Nt(n)) && z(n.value) && z(y) || tt(n) && n.value === "" || y === "" || Array.isArray(y) && !y.length, L = qr.bind(null, E, s, M), D = (w, T, q, X = ge.maxLength, te = ge.minLength) => {
2870
- const J = w ? T : q;
2874
+ const _ = o ? o[0] : n, F = (w) => {
2875
+ a && _.reportValidity && (_.setCustomValidity(fe(w) ? "" : w || ""), _.reportValidity());
2876
+ }, M = {}, O = Dt(n), G = Qe(n), L = O || G, U = (V || Lt(n)) && z(n.value) && z(y) || at(n) && n.value === "" || y === "" || Array.isArray(y) && !y.length, D = qr.bind(null, E, s, M), T = (w, N, q, H = be.maxLength, X = be.minLength) => {
2877
+ const te = w ? N : q;
2871
2878
  M[E] = {
2872
- type: w ? X : te,
2873
- message: J,
2879
+ type: w ? H : X,
2880
+ message: te,
2874
2881
  ref: n,
2875
- ...L(w ? X : te, J)
2882
+ ...D(w ? H : X, te)
2876
2883
  };
2877
2884
  };
2878
- if (a ? !Array.isArray(y) || !y.length : c && (!N && (U || re(y)) || de(y) && !y || G && !Kr(o).isValid || O && !Hr(o).isValid)) {
2879
- const { value: w, message: T } = ne(c) ? { value: !!c, message: c } : Ne(c);
2885
+ if (i ? !Array.isArray(y) || !y.length : c && (!L && (U || re(y)) || fe(y) && !y || G && !Kr(o).isValid || O && !Hr(o).isValid)) {
2886
+ const { value: w, message: N } = ne(c) ? { value: !!c, message: c } : Ne(c);
2880
2887
  if (w && (M[E] = {
2881
- type: ge.required,
2882
- message: T,
2888
+ type: be.required,
2889
+ message: N,
2883
2890
  ref: _,
2884
- ...L(ge.required, T)
2891
+ ...D(be.required, N)
2885
2892
  }, !s))
2886
- return V(T), M;
2893
+ return F(N), M;
2887
2894
  }
2888
- if (!U && (!re(x) || !re(p))) {
2889
- let w, T;
2890
- const q = Ne(p), X = Ne(x);
2895
+ if (!U && (!re(x) || !re(h))) {
2896
+ let w, N;
2897
+ const q = Ne(h), H = Ne(x);
2891
2898
  if (!re(y) && !isNaN(y)) {
2892
- const te = n.valueAsNumber || y && +y;
2893
- re(q.value) || (w = te > q.value), re(X.value) || (T = te < X.value);
2899
+ const X = n.valueAsNumber || y && +y;
2900
+ re(q.value) || (w = X > q.value), re(H.value) || (N = X < H.value);
2894
2901
  } else {
2895
- const te = n.valueAsDate || new Date(y), J = (_e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + _e), ue = n.type == "time", we = n.type == "week";
2896
- ne(q.value) && y && (w = ue ? J(y) > J(q.value) : we ? y > q.value : te > new Date(q.value)), ne(X.value) && y && (T = ue ? J(y) < J(X.value) : we ? y < X.value : te < new Date(X.value));
2902
+ const X = n.valueAsDate || new Date(y), te = (ce) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ce), _e = n.type == "time", ue = n.type == "week";
2903
+ ne(q.value) && y && (w = _e ? te(y) > te(q.value) : ue ? y > q.value : X > new Date(q.value)), ne(H.value) && y && (N = _e ? te(y) < te(H.value) : ue ? y < H.value : X < new Date(H.value));
2897
2904
  }
2898
- if ((w || T) && (D(!!w, q.message, X.message, ge.max, ge.min), !s))
2899
- return V(M[E].message), M;
2905
+ if ((w || N) && (T(!!w, q.message, H.message, be.max, be.min), !s))
2906
+ return F(M[E].message), M;
2900
2907
  }
2901
- if ((h || b) && !U && (ne(y) || a && Array.isArray(y))) {
2902
- const w = Ne(h), T = Ne(b), q = !re(w.value) && y.length > +w.value, X = !re(T.value) && y.length < +T.value;
2903
- if ((q || X) && (D(q, w.message, T.message), !s))
2904
- return V(M[E].message), M;
2908
+ if ((p || b) && !U && (ne(y) || i && Array.isArray(y))) {
2909
+ const w = Ne(p), N = Ne(b), q = !re(w.value) && y.length > +w.value, H = !re(N.value) && y.length < +N.value;
2910
+ if ((q || H) && (T(q, w.message, N.message), !s))
2911
+ return F(M[E].message), M;
2905
2912
  }
2906
2913
  if (m && !U && ne(y)) {
2907
- const { value: w, message: T } = Ne(m);
2908
- if (rt(w) && !y.match(w) && (M[E] = {
2909
- type: ge.pattern,
2910
- message: T,
2914
+ const { value: w, message: N } = Ne(m);
2915
+ if (it(w) && !y.match(w) && (M[E] = {
2916
+ type: be.pattern,
2917
+ message: N,
2911
2918
  ref: n,
2912
- ...L(ge.pattern, T)
2919
+ ...D(be.pattern, N)
2913
2920
  }, !s))
2914
- return V(T), M;
2921
+ return F(N), M;
2915
2922
  }
2916
2923
  if (C) {
2917
2924
  if (oe(C)) {
2918
- const w = await C(y, t), T = or(w, _);
2919
- if (T && (M[E] = {
2920
- ...T,
2921
- ...L(ge.validate, T.message)
2925
+ const w = await C(y, t), N = or(w, _);
2926
+ if (N && (M[E] = {
2927
+ ...N,
2928
+ ...D(be.validate, N.message)
2922
2929
  }, !s))
2923
- return V(T.message), M;
2930
+ return F(N.message), M;
2924
2931
  } else if (K(C)) {
2925
2932
  let w = {};
2926
- for (const T in C) {
2933
+ for (const N in C) {
2927
2934
  if (!ee(w) && !s)
2928
2935
  break;
2929
- const q = or(await C[T](y, t), _, T);
2936
+ const q = or(await C[N](y, t), _, N);
2930
2937
  q && (w = {
2931
2938
  ...q,
2932
- ...L(T, q.message)
2933
- }, V(q.message), s && (M[E] = w));
2939
+ ...D(N, q.message)
2940
+ }, F(q.message), s && (M[E] = w));
2934
2941
  }
2935
2942
  if (!ee(w) && (M[E] = {
2936
2943
  ref: _,
@@ -2939,16 +2946,16 @@ var Ne = (e) => K(e) && !rt(e) ? e : {
2939
2946
  return M;
2940
2947
  }
2941
2948
  }
2942
- return V(!0), M;
2949
+ return F(!0), M;
2943
2950
  };
2944
- const zn = {
2951
+ const Wn = {
2945
2952
  mode: le.onSubmit,
2946
2953
  reValidateMode: le.onChange,
2947
2954
  shouldFocusError: !0
2948
2955
  };
2949
- function Wn(e = {}) {
2956
+ function Kn(e = {}) {
2950
2957
  let r = {
2951
- ...zn,
2958
+ ...Wn,
2952
2959
  ...e
2953
2960
  }, t = {
2954
2961
  submitCount: 0,
@@ -2965,7 +2972,7 @@ function Wn(e = {}) {
2965
2972
  validatingFields: {},
2966
2973
  errors: r.errors || {},
2967
2974
  disabled: r.disabled || !1
2968
- }, s = {}, i = K(r.defaultValues) || K(r.values) ? H(r.defaultValues || r.values) || {} : {}, a = r.shouldUnregister ? {} : H(i), n = {
2975
+ }, s = {}, a = K(r.defaultValues) || K(r.values) ? J(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : J(a), n = {
2969
2976
  action: !1,
2970
2977
  mount: !1,
2971
2978
  watch: !1,
@@ -2976,7 +2983,7 @@ function Wn(e = {}) {
2976
2983
  unMount: /* @__PURE__ */ new Set(),
2977
2984
  array: /* @__PURE__ */ new Set(),
2978
2985
  watch: /* @__PURE__ */ new Set()
2979
- }, c, h = 0;
2986
+ }, c, p = 0;
2980
2987
  const b = {
2981
2988
  isDirty: !1,
2982
2989
  dirtyFields: !1,
@@ -2988,24 +2995,24 @@ function Wn(e = {}) {
2988
2995
  }, x = {
2989
2996
  ...b
2990
2997
  };
2991
- let p = {
2998
+ let h = {
2992
2999
  ...x
2993
3000
  };
2994
3001
  const m = {
2995
3002
  array: Yt(),
2996
3003
  state: Yt()
2997
3004
  }, C = r.criteriaMode === le.all, E = (l) => (d) => {
2998
- clearTimeout(h), h = setTimeout(l, d);
2999
- }, A = async (l) => {
3000
- if (!n.keepIsValid && !r.disabled && (x.isValid || p.isValid || l)) {
3005
+ clearTimeout(p), p = setTimeout(l, d);
3006
+ }, V = async (l) => {
3007
+ if (!n.keepIsValid && !r.disabled && (x.isValid || h.isValid || l)) {
3001
3008
  let d;
3002
- r.resolver ? (d = ee((await N()).errors), I()) : d = await L(s, !0), d !== t.isValid && m.state.next({
3009
+ r.resolver ? (d = ee((await L()).errors), I()) : d = await D(s, !0), d !== t.isValid && m.state.next({
3003
3010
  isValid: d
3004
3011
  });
3005
3012
  }
3006
3013
  }, I = (l, d) => {
3007
- !r.disabled && (x.isValidating || x.validatingFields || p.isValidating || p.validatingFields) && ((l || Array.from(o.mount)).forEach((f) => {
3008
- f && (d ? B(t.validatingFields, f, d) : W(t.validatingFields, f));
3014
+ !r.disabled && (x.isValidating || x.validatingFields || h.isValidating || h.validatingFields) && ((l || Array.from(o.mount)).forEach((f) => {
3015
+ f && (d ? j(t.validatingFields, f, d) : W(t.validatingFields, f));
3009
3016
  }), m.state.next({
3010
3017
  validatingFields: t.validatingFields,
3011
3018
  isValidating: !ee(t.validatingFields)
@@ -3013,18 +3020,18 @@ function Wn(e = {}) {
3013
3020
  }, y = (l, d = [], f, k, v = !0, g = !0) => {
3014
3021
  if (k && f && !r.disabled) {
3015
3022
  if (n.action = !0, g && Array.isArray(S(s, l))) {
3016
- const F = f(S(s, l), k.argA, k.argB);
3017
- v && B(s, l, F);
3023
+ const A = f(S(s, l), k.argA, k.argB);
3024
+ v && j(s, l, A);
3018
3025
  }
3019
3026
  if (g && Array.isArray(S(t.errors, l))) {
3020
- const F = f(S(t.errors, l), k.argA, k.argB);
3021
- v && B(t.errors, l, F), qn(t.errors, l);
3027
+ const A = f(S(t.errors, l), k.argA, k.argB);
3028
+ v && j(t.errors, l, A), Un(t.errors, l);
3022
3029
  }
3023
- if ((x.touchedFields || p.touchedFields) && g && Array.isArray(S(t.touchedFields, l))) {
3024
- const F = f(S(t.touchedFields, l), k.argA, k.argB);
3025
- v && B(t.touchedFields, l, F);
3030
+ if ((x.touchedFields || h.touchedFields) && g && Array.isArray(S(t.touchedFields, l))) {
3031
+ const A = f(S(t.touchedFields, l), k.argA, k.argB);
3032
+ v && j(t.touchedFields, l, A);
3026
3033
  }
3027
- (x.dirtyFields || p.dirtyFields) && (t.dirtyFields = Le(i, a)), m.state.next({
3034
+ (x.dirtyFields || h.dirtyFields) && (t.dirtyFields = Le(a, i)), m.state.next({
3028
3035
  name: l,
3029
3036
  isDirty: w(l, d),
3030
3037
  dirtyFields: t.dirtyFields,
@@ -3032,12 +3039,12 @@ function Wn(e = {}) {
3032
3039
  isValid: t.isValid
3033
3040
  });
3034
3041
  } else
3035
- B(a, l, d);
3042
+ j(i, l, d);
3036
3043
  }, _ = (l, d) => {
3037
- B(t.errors, l, d), m.state.next({
3044
+ j(t.errors, l, d), m.state.next({
3038
3045
  errors: t.errors
3039
3046
  });
3040
- }, V = (l) => {
3047
+ }, F = (l) => {
3041
3048
  t.errors = l, m.state.next({
3042
3049
  errors: t.errors,
3043
3050
  isValid: !1
@@ -3045,165 +3052,165 @@ function Wn(e = {}) {
3045
3052
  }, M = (l, d, f, k) => {
3046
3053
  const v = S(s, l);
3047
3054
  if (v) {
3048
- const g = S(a, l, z(f) ? S(i, l) : f);
3049
- z(g) || k && k.defaultChecked || d ? B(a, l, d ? g : rr(v._f)) : X(l, g), n.mount && !n.action && A();
3055
+ const g = S(i, l, z(f) ? S(a, l) : f);
3056
+ z(g) || k && k.defaultChecked || d ? j(i, l, d ? g : rr(v._f)) : H(l, g), n.mount && !n.action && V();
3050
3057
  }
3051
3058
  }, O = (l, d, f, k, v) => {
3052
- let g = !1, F = !1;
3059
+ let g = !1, A = !1;
3053
3060
  const R = {
3054
3061
  name: l
3055
3062
  };
3056
3063
  if (!r.disabled) {
3057
3064
  if (!f || k) {
3058
- (x.isDirty || p.isDirty) && (F = t.isDirty, t.isDirty = R.isDirty = w(), g = F !== R.isDirty);
3059
- const P = Ce(S(i, l), d);
3060
- F = !!S(t.dirtyFields, l), P ? W(t.dirtyFields, l) : B(t.dirtyFields, l, !0), R.dirtyFields = t.dirtyFields, g = g || (x.dirtyFields || p.dirtyFields) && F !== !P;
3065
+ (x.isDirty || h.isDirty) && (A = t.isDirty, t.isDirty = R.isDirty = w(), g = A !== R.isDirty);
3066
+ const P = Ce(S(a, l), d);
3067
+ A = !!S(t.dirtyFields, l), P ? W(t.dirtyFields, l) : j(t.dirtyFields, l, !0), R.dirtyFields = t.dirtyFields, g = g || (x.dirtyFields || h.dirtyFields) && A !== !P;
3061
3068
  }
3062
3069
  if (f) {
3063
3070
  const P = S(t.touchedFields, l);
3064
- P || (B(t.touchedFields, l, f), R.touchedFields = t.touchedFields, g = g || (x.touchedFields || p.touchedFields) && P !== f);
3071
+ P || (j(t.touchedFields, l, f), R.touchedFields = t.touchedFields, g = g || (x.touchedFields || h.touchedFields) && P !== f);
3065
3072
  }
3066
3073
  g && v && m.state.next(R);
3067
3074
  }
3068
3075
  return g ? R : {};
3069
3076
  }, G = (l, d, f, k) => {
3070
- const v = S(t.errors, l), g = (x.isValid || p.isValid) && de(d) && t.isValid !== d;
3071
- if (r.delayError && f ? (c = E(() => _(l, f)), c(r.delayError)) : (clearTimeout(h), c = null, f ? B(t.errors, l, f) : W(t.errors, l)), (f ? !Ce(v, f) : v) || !ee(k) || g) {
3072
- const F = {
3077
+ const v = S(t.errors, l), g = (x.isValid || h.isValid) && fe(d) && t.isValid !== d;
3078
+ if (r.delayError && f ? (c = E(() => _(l, f)), c(r.delayError)) : (clearTimeout(p), c = null, f ? j(t.errors, l, f) : W(t.errors, l)), (f ? !Ce(v, f) : v) || !ee(k) || g) {
3079
+ const A = {
3073
3080
  ...k,
3074
- ...g && de(d) ? { isValid: d } : {},
3081
+ ...g && fe(d) ? { isValid: d } : {},
3075
3082
  errors: t.errors,
3076
3083
  name: l
3077
3084
  };
3078
3085
  t = {
3079
3086
  ...t,
3080
- ...F
3081
- }, m.state.next(F);
3087
+ ...A
3088
+ }, m.state.next(A);
3082
3089
  }
3083
- }, N = async (l) => (I(l, !0), await r.resolver(a, r.context, On(l || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), U = async (l) => {
3084
- const { errors: d } = await N(l);
3090
+ }, L = async (l) => (I(l, !0), await r.resolver(i, r.context, Rn(l || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), U = async (l) => {
3091
+ const { errors: d } = await L(l);
3085
3092
  if (I(l), l)
3086
3093
  for (const f of l) {
3087
3094
  const k = S(d, f);
3088
- k ? B(t.errors, f, k) : W(t.errors, f);
3095
+ k ? j(t.errors, f, k) : W(t.errors, f);
3089
3096
  }
3090
3097
  else
3091
3098
  t.errors = d;
3092
3099
  return d;
3093
- }, L = async (l, d, f = {
3100
+ }, D = async (l, d, f = {
3094
3101
  valid: !0
3095
3102
  }) => {
3096
3103
  for (const k in l) {
3097
3104
  const v = l[k];
3098
3105
  if (v) {
3099
- const { _f: g, ...F } = v;
3106
+ const { _f: g, ...A } = v;
3100
3107
  if (g) {
3101
- const R = o.array.has(g.name), P = v._f && Rn(v._f);
3108
+ const R = o.array.has(g.name), P = v._f && Pn(v._f);
3102
3109
  P && x.validatingFields && I([g.name], !0);
3103
- const Y = await lr(v, o.disabled, a, C, r.shouldUseNativeValidation && !d, R);
3110
+ const Y = await lr(v, o.disabled, i, C, r.shouldUseNativeValidation && !d, R);
3104
3111
  if (P && x.validatingFields && I([g.name]), Y[g.name] && (f.valid = !1, d || e.shouldUseNativeValidation))
3105
3112
  break;
3106
- !d && (S(Y, g.name) ? R ? Un(t.errors, Y, g.name) : B(t.errors, g.name, Y[g.name]) : W(t.errors, g.name));
3113
+ !d && (S(Y, g.name) ? R ? zn(t.errors, Y, g.name) : j(t.errors, g.name, Y[g.name]) : W(t.errors, g.name));
3107
3114
  }
3108
- !ee(F) && await L(F, d, f);
3115
+ !ee(A) && await D(A, d, f);
3109
3116
  }
3110
3117
  }
3111
3118
  return f.valid;
3112
- }, D = () => {
3119
+ }, T = () => {
3113
3120
  for (const l of o.unMount) {
3114
3121
  const d = S(s, l);
3115
- d && (d._f.refs ? d._f.refs.every((f) => !vt(f)) : !vt(d._f.ref)) && ce(l);
3122
+ d && (d._f.refs ? d._f.refs.every((f) => !xt(f)) : !xt(d._f.ref)) && B(l);
3116
3123
  }
3117
3124
  o.unMount = /* @__PURE__ */ new Set();
3118
- }, w = (l, d) => !r.disabled && (l && d && B(a, l, d), !Ce(Be(), i)), T = (l, d, f) => Mn(l, o, {
3119
- ...n.mount ? a : z(d) ? i : ne(l) ? { [l]: d } : d
3120
- }, f, d), q = (l) => Mt(S(n.mount ? a : i, l, r.shouldUnregister ? S(i, l, []) : [])), X = (l, d, f = {}) => {
3125
+ }, w = (l, d) => !r.disabled && (l && d && j(i, l, d), !Ce(Be(), a)), N = (l, d, f) => En(l, o, {
3126
+ ...n.mount ? i : z(d) ? a : ne(l) ? { [l]: d } : d
3127
+ }, f, d), q = (l) => Et(S(n.mount ? i : a, l, r.shouldUnregister ? S(a, l, []) : [])), H = (l, d, f = {}) => {
3121
3128
  const k = S(s, l);
3122
3129
  let v = d;
3123
3130
  if (k) {
3124
3131
  const g = k._f;
3125
- g && (!g.disabled && B(a, l, Gr(d, g)), v = tt(g.ref) && re(d) ? "" : d, zr(g.ref) ? [...g.ref.options].forEach((F) => F.selected = v.includes(F.value)) : g.refs ? Ze(g.ref) ? g.refs.forEach((F) => {
3126
- (!F.defaultChecked || !F.disabled) && (Array.isArray(v) ? F.checked = !!v.find((R) => R === F.value) : F.checked = v === F.value || !!v);
3127
- }) : g.refs.forEach((F) => F.checked = F.value === v) : Nt(g.ref) ? g.ref.value = "" : (g.ref.value = v, g.ref.type || m.state.next({
3132
+ g && (!g.disabled && j(i, l, Gr(d, g)), v = at(g.ref) && re(d) ? "" : d, zr(g.ref) ? [...g.ref.options].forEach((A) => A.selected = v.includes(A.value)) : g.refs ? Qe(g.ref) ? g.refs.forEach((A) => {
3133
+ (!A.defaultChecked || !A.disabled) && (Array.isArray(v) ? A.checked = !!v.find((R) => R === A.value) : A.checked = v === A.value || !!v);
3134
+ }) : g.refs.forEach((A) => A.checked = A.value === v) : Lt(g.ref) ? g.ref.value = "" : (g.ref.value = v, g.ref.type || m.state.next({
3128
3135
  name: l,
3129
- values: H(a)
3136
+ values: J(i)
3130
3137
  })));
3131
3138
  }
3132
- (f.shouldDirty || f.shouldTouch) && O(l, v, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && _e(l);
3133
- }, te = (l, d, f) => {
3139
+ (f.shouldDirty || f.shouldTouch) && O(l, v, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && ce(l);
3140
+ }, X = (l, d, f) => {
3134
3141
  for (const k in d) {
3135
3142
  if (!d.hasOwnProperty(k))
3136
3143
  return;
3137
- const v = d[k], g = l + "." + k, F = S(s, g);
3138
- (o.array.has(l) || K(v) || F && !F._f) && !Ae(v) ? te(g, v, f) : X(g, v, f);
3144
+ const v = d[k], g = l + "." + k, A = S(s, g);
3145
+ (o.array.has(l) || K(v) || A && !A._f) && !Ve(v) ? X(g, v, f) : H(g, v, f);
3139
3146
  }
3140
- }, J = (l, d, f = {}) => {
3141
- const k = S(s, l), v = o.array.has(l), g = H(d);
3142
- B(a, l, g), v ? (m.array.next({
3147
+ }, te = (l, d, f = {}) => {
3148
+ const k = S(s, l), v = o.array.has(l), g = J(d);
3149
+ j(i, l, g), v ? (m.array.next({
3143
3150
  name: l,
3144
- values: H(a)
3145
- }), (x.isDirty || x.dirtyFields || p.isDirty || p.dirtyFields) && f.shouldDirty && m.state.next({
3151
+ values: J(i)
3152
+ }), (x.isDirty || x.dirtyFields || h.isDirty || h.dirtyFields) && f.shouldDirty && m.state.next({
3146
3153
  name: l,
3147
- dirtyFields: Le(i, a),
3154
+ dirtyFields: Le(a, i),
3148
3155
  isDirty: w(l, g)
3149
- })) : k && !k._f && !re(g) ? te(l, g, f) : X(l, g, f), ir(l, o) ? m.state.next({
3156
+ })) : k && !k._f && !re(g) ? X(l, g, f) : H(l, g, f), ar(l, o) ? m.state.next({
3150
3157
  ...t,
3151
3158
  name: l,
3152
- values: H(a)
3159
+ values: J(i)
3153
3160
  }) : m.state.next({
3154
3161
  name: n.mount ? l : void 0,
3155
- values: H(a)
3162
+ values: J(i)
3156
3163
  });
3157
- }, ue = async (l) => {
3164
+ }, _e = async (l) => {
3158
3165
  n.mount = !0;
3159
3166
  const d = l.target;
3160
3167
  let f = d.name, k = !0;
3161
3168
  const v = S(s, f), g = (P) => {
3162
- k = Number.isNaN(P) || Ae(P) && isNaN(P.getTime()) || Ce(P, S(a, f, P));
3163
- }, F = sr(r.mode), R = sr(r.reValidateMode);
3169
+ k = Number.isNaN(P) || Ve(P) && isNaN(P.getTime()) || Ce(P, S(i, f, P));
3170
+ }, A = sr(r.mode), R = sr(r.reValidateMode);
3164
3171
  if (v) {
3165
3172
  let P, Y;
3166
- const Ve = d.type ? rr(v._f) : kn(l), ke = l.type === Zt.BLUR || l.type === Zt.FOCUS_OUT, es = !Pn(v._f) && !r.resolver && !S(t.errors, f) && !v._f.deps || $n(ke, S(t.touchedFields, f), t.isSubmitted, R, F), ht = ir(f, o, ke);
3167
- B(a, f, Ve), ke ? (!d || !d.readOnly) && (v._f.onBlur && v._f.onBlur(l), c && c(0)) : v._f.onChange && v._f.onChange(l);
3168
- const pt = O(f, Ve, ke), ts = !ee(pt) || ht;
3173
+ const Fe = d.type ? rr(v._f) : Cn(l), ke = l.type === Zt.BLUR || l.type === Zt.FOCUS_OUT, es = !Bn(v._f) && !r.resolver && !S(t.errors, f) && !v._f.deps || qn(ke, S(t.touchedFields, f), t.isSubmitted, R, A), ht = ar(f, o, ke);
3174
+ j(i, f, Fe), ke ? (!d || !d.readOnly) && (v._f.onBlur && v._f.onBlur(l), c && c(0)) : v._f.onChange && v._f.onChange(l);
3175
+ const yt = O(f, Fe, ke), ts = !ee(yt) || ht;
3169
3176
  if (!ke && m.state.next({
3170
3177
  name: f,
3171
3178
  type: l.type,
3172
- values: H(a)
3179
+ values: J(i)
3173
3180
  }), es)
3174
- return (x.isValid || p.isValid) && (r.mode === "onBlur" ? ke && A() : ke || A()), ts && m.state.next({ name: f, ...ht ? {} : pt });
3181
+ return (x.isValid || h.isValid) && (r.mode === "onBlur" ? ke && V() : ke || V()), ts && m.state.next({ name: f, ...ht ? {} : yt });
3175
3182
  if (!ke && ht && m.state.next({ ...t }), r.resolver) {
3176
- const { errors: Bt } = await N([f]);
3177
- if (I([f]), g(Ve), k) {
3178
- const rs = ar(t.errors, s, f), jt = ar(Bt, s, rs.name || f);
3183
+ const { errors: Bt } = await L([f]);
3184
+ if (I([f]), g(Fe), k) {
3185
+ const rs = ir(t.errors, s, f), jt = ir(Bt, s, rs.name || f);
3179
3186
  P = jt.error, f = jt.name, Y = ee(Bt);
3180
3187
  }
3181
3188
  } else
3182
- I([f], !0), P = (await lr(v, o.disabled, a, C, r.shouldUseNativeValidation))[f], I([f]), g(Ve), k && (P ? Y = !1 : (x.isValid || p.isValid) && (Y = await L(s, !0)));
3183
- k && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) && _e(v._f.deps), G(f, Y, P, pt));
3189
+ I([f], !0), P = (await lr(v, o.disabled, i, C, r.shouldUseNativeValidation))[f], I([f]), g(Fe), k && (P ? Y = !1 : (x.isValid || h.isValid) && (Y = await D(s, !0)));
3190
+ k && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) && ce(v._f.deps), G(f, Y, P, yt));
3184
3191
  }
3185
- }, we = (l, d) => {
3192
+ }, ue = (l, d) => {
3186
3193
  if (S(t.errors, d) && l.focus)
3187
3194
  return l.focus(), 1;
3188
- }, _e = async (l, d = {}) => {
3195
+ }, ce = async (l, d = {}) => {
3189
3196
  let f, k;
3190
- const v = He(l);
3197
+ const v = Xe(l);
3191
3198
  if (r.resolver) {
3192
3199
  const g = await U(z(l) ? l : v);
3193
- f = ee(g), k = l ? !v.some((F) => S(g, F)) : f;
3200
+ f = ee(g), k = l ? !v.some((A) => S(g, A)) : f;
3194
3201
  } else
3195
3202
  l ? (k = (await Promise.all(v.map(async (g) => {
3196
- const F = S(s, g);
3197
- return await L(F && F._f ? { [g]: F } : F);
3198
- }))).every(Boolean), !(!k && !t.isValid) && A()) : k = f = await L(s);
3203
+ const A = S(s, g);
3204
+ return await D(A && A._f ? { [g]: A } : A);
3205
+ }))).every(Boolean), !(!k && !t.isValid) && V()) : k = f = await D(s);
3199
3206
  return m.state.next({
3200
- ...!ne(l) || (x.isValid || p.isValid) && f !== t.isValid ? {} : { name: l },
3207
+ ...!ne(l) || (x.isValid || h.isValid) && f !== t.isValid ? {} : { name: l },
3201
3208
  ...r.resolver || !l ? { isValid: f } : {},
3202
3209
  errors: t.errors
3203
- }), d.shouldFocus && !k && Je(s, we, l ? v : o.mount), k;
3210
+ }), d.shouldFocus && !k && Ze(s, ue, l ? v : o.mount), k;
3204
3211
  }, Be = (l, d) => {
3205
3212
  let f = {
3206
- ...n.mount ? a : i
3213
+ ...n.mount ? i : a
3207
3214
  };
3208
3215
  return d && (f = Ur(d.dirtyFields ? t.dirtyFields : t.touchedFields, f)), z(l) ? f : ne(l) ? S(f, l) : l.map((k) => S(f, k));
3209
3216
  }, je = (l, d) => ({
@@ -3212,8 +3219,8 @@ function Wn(e = {}) {
3212
3219
  error: S((d || t).errors, l),
3213
3220
  isValidating: !!S(t.validatingFields, l),
3214
3221
  isTouched: !!S((d || t).touchedFields, l)
3215
- }), Ye = (l) => {
3216
- const d = l ? He(l) : void 0;
3222
+ }), et = (l) => {
3223
+ const d = l ? Xe(l) : void 0;
3217
3224
  d == null || d.forEach((f) => W(t.errors, f)), d ? d.forEach((f) => {
3218
3225
  m.state.next({
3219
3226
  name: f,
@@ -3223,8 +3230,8 @@ function Wn(e = {}) {
3223
3230
  errors: {}
3224
3231
  });
3225
3232
  }, $e = (l, d, f) => {
3226
- const k = (S(s, l, { _f: {} })._f || {}).ref, v = S(t.errors, l) || {}, { ref: g, message: F, type: R, ...P } = v;
3227
- B(t.errors, l, {
3233
+ const k = (S(s, l, { _f: {} })._f || {}).ref, v = S(t.errors, l) || {}, { ref: g, message: A, type: R, ...P } = v;
3234
+ j(t.errors, l, {
3228
3235
  ...P,
3229
3236
  ...d,
3230
3237
  ref: k
@@ -3233,44 +3240,44 @@ function Wn(e = {}) {
3233
3240
  errors: t.errors,
3234
3241
  isValid: !1
3235
3242
  }), f && f.shouldFocus && k && k.focus && k.focus();
3236
- }, j = (l, d) => oe(l) ? m.state.subscribe({
3237
- next: (f) => "values" in f && l(T(void 0, d), f)
3238
- }) : T(l, d, !0), Qe = (l) => m.state.subscribe({
3243
+ }, tt = (l, d) => oe(l) ? m.state.subscribe({
3244
+ next: (f) => "values" in f && l(N(void 0, d), f)
3245
+ }) : N(l, d, !0), qe = (l) => m.state.subscribe({
3239
3246
  next: (d) => {
3240
- jn(l.name, d.name, l.exact) && Bn(d, l.formState || x, Qr, l.reRenderRoot) && l.callback({
3241
- values: { ...a },
3247
+ $n(l.name, d.name, l.exact) && jn(d, l.formState || x, Qr, l.reRenderRoot) && l.callback({
3248
+ values: { ...i },
3242
3249
  ...t,
3243
3250
  ...d,
3244
- defaultValues: i
3251
+ defaultValues: a
3245
3252
  });
3246
3253
  }
3247
- }).unsubscribe, ct = (l) => (n.mount = !0, p = {
3248
- ...p,
3254
+ }).unsubscribe, rt = (l) => (n.mount = !0, h = {
3255
+ ...h,
3249
3256
  ...l.formState
3250
- }, Qe({
3257
+ }, qe({
3251
3258
  ...l,
3252
3259
  formState: {
3253
3260
  ...b,
3254
3261
  ...l.formState
3255
3262
  }
3256
- })), ce = (l, d = {}) => {
3257
- for (const f of l ? He(l) : o.mount)
3258
- o.mount.delete(f), o.array.delete(f), d.keepValue || (W(s, f), W(a, f)), !d.keepError && W(t.errors, f), !d.keepDirty && W(t.dirtyFields, f), !d.keepTouched && W(t.touchedFields, f), !d.keepIsValidating && W(t.validatingFields, f), !r.shouldUnregister && !d.keepDefaultValue && W(i, f);
3263
+ })), B = (l, d = {}) => {
3264
+ for (const f of l ? Xe(l) : o.mount)
3265
+ o.mount.delete(f), o.array.delete(f), d.keepValue || (W(s, f), W(i, f)), !d.keepError && W(t.errors, f), !d.keepDirty && W(t.dirtyFields, f), !d.keepTouched && W(t.touchedFields, f), !d.keepIsValidating && W(t.validatingFields, f), !r.shouldUnregister && !d.keepDefaultValue && W(a, f);
3259
3266
  m.state.next({
3260
- values: H(a)
3267
+ values: J(i)
3261
3268
  }), m.state.next({
3262
3269
  ...t,
3263
3270
  ...d.keepDirty ? { isDirty: w() } : {}
3264
- }), !d.keepIsValid && A();
3265
- }, Tt = ({ disabled: l, name: d }) => {
3266
- if (de(l) && n.mount || l || o.disabled.has(d)) {
3271
+ }), !d.keepIsValid && V();
3272
+ }, st = ({ disabled: l, name: d }) => {
3273
+ if (fe(l) && n.mount || l || o.disabled.has(d)) {
3267
3274
  const v = o.disabled.has(d) !== !!l;
3268
- l ? o.disabled.add(d) : o.disabled.delete(d), v && n.mount && !n.action && A();
3275
+ l ? o.disabled.add(d) : o.disabled.delete(d), v && n.mount && !n.action && V();
3269
3276
  }
3270
- }, dt = (l, d = {}) => {
3277
+ }, Ue = (l, d = {}) => {
3271
3278
  let f = S(s, l);
3272
- const k = de(d.disabled) || de(r.disabled);
3273
- return B(s, l, {
3279
+ const k = fe(d.disabled) || fe(r.disabled);
3280
+ return j(s, l, {
3274
3281
  ...f || {},
3275
3282
  _f: {
3276
3283
  ...f && f._f ? f._f : { ref: { name: l } },
@@ -3278,63 +3285,63 @@ function Wn(e = {}) {
3278
3285
  mount: !0,
3279
3286
  ...d
3280
3287
  }
3281
- }), o.mount.add(l), f ? Tt({
3282
- disabled: de(d.disabled) ? d.disabled : r.disabled,
3288
+ }), o.mount.add(l), f ? st({
3289
+ disabled: fe(d.disabled) ? d.disabled : r.disabled,
3283
3290
  name: l
3284
3291
  }) : M(l, !0, d.value), {
3285
3292
  ...k ? { disabled: d.disabled || r.disabled } : {},
3286
3293
  ...r.progressive ? {
3287
3294
  required: !!d.required,
3288
- min: qe(d.min),
3289
- max: qe(d.max),
3290
- minLength: qe(d.minLength),
3291
- maxLength: qe(d.maxLength),
3292
- pattern: qe(d.pattern)
3295
+ min: ze(d.min),
3296
+ max: ze(d.max),
3297
+ minLength: ze(d.minLength),
3298
+ maxLength: ze(d.maxLength),
3299
+ pattern: ze(d.pattern)
3293
3300
  } : {},
3294
3301
  name: l,
3295
- onChange: ue,
3296
- onBlur: ue,
3302
+ onChange: _e,
3303
+ onBlur: _e,
3297
3304
  ref: (v) => {
3298
3305
  if (v) {
3299
- dt(l, d), f = S(s, l);
3300
- const g = z(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, F = Nn(g), R = f._f.refs || [];
3301
- if (F ? R.find((P) => P === g) : g === f._f.ref)
3306
+ Ue(l, d), f = S(s, l);
3307
+ const g = z(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, A = Ln(g), R = f._f.refs || [];
3308
+ if (A ? R.find((P) => P === g) : g === f._f.ref)
3302
3309
  return;
3303
- B(s, l, {
3310
+ j(s, l, {
3304
3311
  _f: {
3305
3312
  ...f._f,
3306
- ...F ? {
3313
+ ...A ? {
3307
3314
  refs: [
3308
- ...R.filter(vt),
3315
+ ...R.filter(xt),
3309
3316
  g,
3310
- ...Array.isArray(S(i, l)) ? [{}] : []
3317
+ ...Array.isArray(S(a, l)) ? [{}] : []
3311
3318
  ],
3312
3319
  ref: { type: g.type, name: l }
3313
3320
  } : { ref: g }
3314
3321
  }
3315
3322
  }), M(l, !1, void 0, g);
3316
3323
  } else
3317
- f = S(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Sn(o.array, l) && n.action) && o.unMount.add(l);
3324
+ f = S(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(In(o.array, l) && n.action) && o.unMount.add(l);
3318
3325
  }
3319
3326
  };
3320
- }, ft = () => r.shouldFocusError && Je(s, we, o.mount), Xr = (l) => {
3321
- de(l) && (m.state.next({ disabled: l }), Je(s, (d, f) => {
3327
+ }, de = () => r.shouldFocusError && Ze(s, ue, o.mount), Xr = (l) => {
3328
+ fe(l) && (m.state.next({ disabled: l }), Ze(s, (d, f) => {
3322
3329
  const k = S(s, f);
3323
3330
  k && (d.disabled = k._f.disabled || l, Array.isArray(k._f.refs) && k._f.refs.forEach((v) => {
3324
3331
  v.disabled = k._f.disabled || l;
3325
3332
  }));
3326
3333
  }, 0, !1));
3327
- }, Dt = (l, d) => async (f) => {
3334
+ }, Tt = (l, d) => async (f) => {
3328
3335
  let k;
3329
3336
  f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
3330
- let v = H(a);
3337
+ let v = J(i);
3331
3338
  if (m.state.next({
3332
3339
  isSubmitting: !0
3333
3340
  }), r.resolver) {
3334
- const { errors: g, values: F } = await N();
3335
- I(), t.errors = g, v = H(F);
3341
+ const { errors: g, values: A } = await L();
3342
+ I(), t.errors = g, v = J(A);
3336
3343
  } else
3337
- await L(s);
3344
+ await D(s);
3338
3345
  if (o.disabled.size)
3339
3346
  for (const g of o.disabled)
3340
3347
  W(v, g);
@@ -3348,7 +3355,7 @@ function Wn(e = {}) {
3348
3355
  k = g;
3349
3356
  }
3350
3357
  } else
3351
- d && await d({ ...t.errors }, f), ft(), setTimeout(ft);
3358
+ d && await d({ ...t.errors }, f), de(), setTimeout(de);
3352
3359
  if (m.state.next({
3353
3360
  isSubmitted: !0,
3354
3361
  isSubmitting: !1,
@@ -3358,26 +3365,26 @@ function Wn(e = {}) {
3358
3365
  }), k)
3359
3366
  throw k;
3360
3367
  }, Zr = (l, d = {}) => {
3361
- S(s, l) && (z(d.defaultValue) ? J(l, H(S(i, l))) : (J(l, d.defaultValue), B(i, l, H(d.defaultValue))), d.keepTouched || W(t.touchedFields, l), d.keepDirty || (W(t.dirtyFields, l), t.isDirty = d.defaultValue ? w(l, H(S(i, l))) : w()), d.keepError || (W(t.errors, l), x.isValid && A()), m.state.next({ ...t }));
3368
+ S(s, l) && (z(d.defaultValue) ? te(l, J(S(a, l))) : (te(l, d.defaultValue), j(a, l, J(d.defaultValue))), d.keepTouched || W(t.touchedFields, l), d.keepDirty || (W(t.dirtyFields, l), t.isDirty = d.defaultValue ? w(l, J(S(a, l))) : w()), d.keepError || (W(t.errors, l), x.isValid && V()), m.state.next({ ...t }));
3362
3369
  }, Ot = (l, d = {}) => {
3363
- const f = l ? H(l) : i, k = H(f), v = ee(l), g = v ? i : k;
3364
- if (d.keepDefaultValues || (i = f), !d.keepValues) {
3370
+ const f = l ? J(l) : a, k = J(f), v = ee(l), g = v ? a : k;
3371
+ if (d.keepDefaultValues || (a = f), !d.keepValues) {
3365
3372
  if (d.keepDirtyValues) {
3366
- const F = /* @__PURE__ */ new Set([
3373
+ const A = /* @__PURE__ */ new Set([
3367
3374
  ...o.mount,
3368
- ...Object.keys(Le(i, a))
3375
+ ...Object.keys(Le(a, i))
3369
3376
  ]);
3370
- for (const R of Array.from(F)) {
3371
- const P = S(t.dirtyFields, R), Y = S(a, R), Ve = S(g, R);
3372
- P && !z(Y) ? B(g, R, Y) : !P && !z(Ve) && J(R, Ve);
3377
+ for (const R of Array.from(A)) {
3378
+ const P = S(t.dirtyFields, R), Y = S(i, R), Fe = S(g, R);
3379
+ P && !z(Y) ? j(g, R, Y) : !P && !z(Fe) && te(R, Fe);
3373
3380
  }
3374
3381
  } else {
3375
- if (At && z(l))
3376
- for (const F of o.mount) {
3377
- const R = S(s, F);
3382
+ if (Mt && z(l))
3383
+ for (const A of o.mount) {
3384
+ const R = S(s, A);
3378
3385
  if (R && R._f) {
3379
3386
  const P = Array.isArray(R._f.refs) ? R._f.refs[0] : R._f.ref;
3380
- if (tt(P)) {
3387
+ if (at(P)) {
3381
3388
  const Y = P.closest("form");
3382
3389
  if (Y) {
3383
3390
  Y.reset();
@@ -3387,12 +3394,12 @@ function Wn(e = {}) {
3387
3394
  }
3388
3395
  }
3389
3396
  if (d.keepFieldsRef)
3390
- for (const F of o.mount)
3391
- J(F, S(g, F));
3397
+ for (const A of o.mount)
3398
+ te(A, S(g, A));
3392
3399
  else
3393
3400
  s = {};
3394
3401
  }
3395
- a = r.shouldUnregister ? d.keepDefaultValues ? H(i) : {} : H(g), m.array.next({
3402
+ i = r.shouldUnregister ? d.keepDefaultValues ? J(a) : {} : J(g), m.array.next({
3396
3403
  values: { ...g }
3397
3404
  }), m.state.next({
3398
3405
  values: { ...g }
@@ -3408,16 +3415,16 @@ function Wn(e = {}) {
3408
3415
  focus: ""
3409
3416
  }, n.mount = !x.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ee(g), n.watch = !!r.shouldUnregister, n.keepIsValid = !!d.keepIsValid, n.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
3410
3417
  submitCount: d.keepSubmitCount ? t.submitCount : 0,
3411
- isDirty: v ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ce(l, i)),
3418
+ isDirty: v ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ce(l, a)),
3412
3419
  isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
3413
- dirtyFields: v ? {} : d.keepDirtyValues ? d.keepDefaultValues && a ? Le(i, a) : t.dirtyFields : d.keepDefaultValues && l ? Le(i, l) : d.keepDirty ? t.dirtyFields : {},
3420
+ dirtyFields: v ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Le(a, i) : t.dirtyFields : d.keepDefaultValues && l ? Le(a, l) : d.keepDirty ? t.dirtyFields : {},
3414
3421
  touchedFields: d.keepTouched ? t.touchedFields : {},
3415
3422
  errors: d.keepErrors ? t.errors : {},
3416
3423
  isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
3417
3424
  isSubmitting: !1,
3418
- defaultValues: i
3425
+ defaultValues: a
3419
3426
  });
3420
- }, Rt = (l, d) => Ot(oe(l) ? l(a) : l, { ...r.resetOptions, ...d }), Yr = (l, d = {}) => {
3427
+ }, Rt = (l, d) => Ot(oe(l) ? l(i) : l, { ...r.resetOptions, ...d }), Yr = (l, d = {}) => {
3421
3428
  const f = S(s, l), k = f && f._f;
3422
3429
  if (k) {
3423
3430
  const v = k.refs ? k.refs[0] : k.ref;
@@ -3432,21 +3439,21 @@ function Wn(e = {}) {
3432
3439
  };
3433
3440
  }, Pt = {
3434
3441
  control: {
3435
- register: dt,
3436
- unregister: ce,
3442
+ register: Ue,
3443
+ unregister: B,
3437
3444
  getFieldState: je,
3438
- handleSubmit: Dt,
3445
+ handleSubmit: Tt,
3439
3446
  setError: $e,
3440
- _subscribe: Qe,
3441
- _runSchema: N,
3447
+ _subscribe: qe,
3448
+ _runSchema: L,
3442
3449
  _updateIsValidating: I,
3443
- _focusError: ft,
3444
- _getWatch: T,
3450
+ _focusError: de,
3451
+ _getWatch: N,
3445
3452
  _getDirty: w,
3446
- _setValid: A,
3453
+ _setValid: V,
3447
3454
  _setFieldArray: y,
3448
- _setDisabledField: Tt,
3449
- _setErrors: V,
3455
+ _setDisabledField: st,
3456
+ _setErrors: F,
3450
3457
  _getFieldArray: q,
3451
3458
  _reset: Ot,
3452
3459
  _resetDefaultValues: () => oe(r.defaultValues) && r.defaultValues().then((l) => {
@@ -3454,7 +3461,7 @@ function Wn(e = {}) {
3454
3461
  isLoading: !1
3455
3462
  });
3456
3463
  }),
3457
- _removeUnmounted: D,
3464
+ _removeUnmounted: T,
3458
3465
  _disableForm: Xr,
3459
3466
  _subjects: m,
3460
3467
  _proxyFormState: x,
@@ -3462,7 +3469,7 @@ function Wn(e = {}) {
3462
3469
  return s;
3463
3470
  },
3464
3471
  get _formValues() {
3465
- return a;
3472
+ return i;
3466
3473
  },
3467
3474
  get _state() {
3468
3475
  return n;
@@ -3471,7 +3478,7 @@ function Wn(e = {}) {
3471
3478
  n = l;
3472
3479
  },
3473
3480
  get _defaultValues() {
3474
- return i;
3481
+ return a;
3475
3482
  },
3476
3483
  get _names() {
3477
3484
  return o;
@@ -3492,17 +3499,17 @@ function Wn(e = {}) {
3492
3499
  };
3493
3500
  }
3494
3501
  },
3495
- subscribe: ct,
3496
- trigger: _e,
3497
- register: dt,
3498
- handleSubmit: Dt,
3499
- watch: j,
3500
- setValue: J,
3502
+ subscribe: rt,
3503
+ trigger: ce,
3504
+ register: Ue,
3505
+ handleSubmit: Tt,
3506
+ watch: tt,
3507
+ setValue: te,
3501
3508
  getValues: Be,
3502
3509
  reset: Rt,
3503
3510
  resetField: Zr,
3504
- clearErrors: Ye,
3505
- unregister: ce,
3511
+ clearErrors: et,
3512
+ unregister: B,
3506
3513
  setError: $e,
3507
3514
  setFocus: Yr,
3508
3515
  getFieldState: je
@@ -3512,8 +3519,8 @@ function Wn(e = {}) {
3512
3519
  formControl: Pt
3513
3520
  };
3514
3521
  }
3515
- function lt(e = {}) {
3516
- const r = Q.useRef(void 0), t = Q.useRef(void 0), [s, i] = Q.useState({
3522
+ function ft(e = {}) {
3523
+ const r = Q.useRef(void 0), t = Q.useRef(void 0), [s, a] = Q.useState({
3517
3524
  isDirty: !1,
3518
3525
  isValidating: !1,
3519
3526
  isLoading: oe(e.defaultValues),
@@ -3537,86 +3544,86 @@ function lt(e = {}) {
3537
3544
  formState: s
3538
3545
  }, e.defaultValues && !oe(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
3539
3546
  else {
3540
- const { formControl: n, ...o } = Wn(e);
3547
+ const { formControl: n, ...o } = Kn(e);
3541
3548
  r.current = {
3542
3549
  ...o,
3543
3550
  formState: s
3544
3551
  };
3545
3552
  }
3546
- const a = r.current.control;
3547
- return a._options = e, An(() => {
3548
- const n = a._subscribe({
3549
- formState: a._proxyFormState,
3550
- callback: () => i({ ...a._formState }),
3553
+ const i = r.current.control;
3554
+ return i._options = e, Mn(() => {
3555
+ const n = i._subscribe({
3556
+ formState: i._proxyFormState,
3557
+ callback: () => a({ ...i._formState }),
3551
3558
  reRenderRoot: !0
3552
3559
  });
3553
- return i((o) => ({
3560
+ return a((o) => ({
3554
3561
  ...o,
3555
3562
  isReady: !0
3556
- })), a._formState.isReady = !0, n;
3557
- }, [a]), Q.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), Q.useEffect(() => {
3558
- e.mode && (a._options.mode = e.mode), e.reValidateMode && (a._options.reValidateMode = e.reValidateMode);
3559
- }, [a, e.mode, e.reValidateMode]), Q.useEffect(() => {
3560
- e.errors && (a._setErrors(e.errors), a._focusError());
3561
- }, [a, e.errors]), Q.useEffect(() => {
3562
- e.shouldUnregister && a._subjects.state.next({
3563
- values: a._getWatch()
3563
+ })), i._formState.isReady = !0, n;
3564
+ }, [i]), Q.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), Q.useEffect(() => {
3565
+ e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode);
3566
+ }, [i, e.mode, e.reValidateMode]), Q.useEffect(() => {
3567
+ e.errors && (i._setErrors(e.errors), i._focusError());
3568
+ }, [i, e.errors]), Q.useEffect(() => {
3569
+ e.shouldUnregister && i._subjects.state.next({
3570
+ values: i._getWatch()
3564
3571
  });
3565
- }, [a, e.shouldUnregister]), Q.useEffect(() => {
3566
- if (a._proxyFormState.isDirty) {
3567
- const n = a._getDirty();
3568
- n !== s.isDirty && a._subjects.state.next({
3572
+ }, [i, e.shouldUnregister]), Q.useEffect(() => {
3573
+ if (i._proxyFormState.isDirty) {
3574
+ const n = i._getDirty();
3575
+ n !== s.isDirty && i._subjects.state.next({
3569
3576
  isDirty: n
3570
3577
  });
3571
3578
  }
3572
- }, [a, s.isDirty]), Q.useEffect(() => {
3579
+ }, [i, s.isDirty]), Q.useEffect(() => {
3573
3580
  var n;
3574
- e.values && !Ce(e.values, t.current) ? (a._reset(e.values, {
3581
+ e.values && !Ce(e.values, t.current) ? (i._reset(e.values, {
3575
3582
  keepFieldsRef: !0,
3576
- ...a._options.resetOptions
3577
- }), !((n = a._options.resetOptions) === null || n === void 0) && n.keepIsValid || a._setValid(), t.current = e.values, i((o) => ({ ...o }))) : a._resetDefaultValues();
3578
- }, [a, e.values]), Q.useEffect(() => {
3579
- a._state.mount || (a._setValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
3580
- }), r.current.formState = Q.useMemo(() => Vn(s, a), [a, s]), r.current;
3583
+ ...i._options.resetOptions
3584
+ }), !((n = i._options.resetOptions) === null || n === void 0) && n.keepIsValid || i._setValid(), t.current = e.values, a((o) => ({ ...o }))) : i._resetDefaultValues();
3585
+ }, [i, e.values]), Q.useEffect(() => {
3586
+ i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
3587
+ }), r.current.formState = Q.useMemo(() => Vn(s, i), [i, s]), r.current;
3581
3588
  }
3582
3589
  const ur = (e, r, t) => {
3583
3590
  if (e && "reportValidity" in e) {
3584
3591
  const s = S(t, r);
3585
3592
  e.setCustomValidity(s && s.message || ""), e.reportValidity();
3586
3593
  }
3587
- }, Kn = (e, r) => {
3594
+ }, Gn = (e, r) => {
3588
3595
  for (const t in r.fields) {
3589
3596
  const s = r.fields[t];
3590
- s && s.ref && "reportValidity" in s.ref ? ur(s.ref, t, e) : s.refs && s.refs.forEach((i) => ur(i, t, e));
3597
+ s && s.ref && "reportValidity" in s.ref ? ur(s.ref, t, e) : s.refs && s.refs.forEach((a) => ur(a, t, e));
3591
3598
  }
3592
- }, Gn = (e, r) => {
3593
- r.shouldUseNativeValidation && Kn(e, r);
3599
+ }, Hn = (e, r) => {
3600
+ r.shouldUseNativeValidation && Gn(e, r);
3594
3601
  const t = {};
3595
3602
  for (const s in e) {
3596
- const i = S(r.fields, s), a = Object.assign(e[s] || {}, { ref: i && i.ref });
3597
- if (Hn(r.names || Object.keys(e), s)) {
3603
+ const a = S(r.fields, s), i = Object.assign(e[s] || {}, { ref: a && a.ref });
3604
+ if (Jn(r.names || Object.keys(e), s)) {
3598
3605
  const n = Object.assign({}, S(t, s));
3599
- B(n, "root", a), B(t, s, n);
3606
+ j(n, "root", i), j(t, s, n);
3600
3607
  } else
3601
- B(t, s, a);
3608
+ j(t, s, i);
3602
3609
  }
3603
3610
  return t;
3604
- }, Hn = (e, r) => e.some((t) => t.startsWith(r + "."));
3605
- var ut = function(e, r, t) {
3606
- return t === void 0 && (t = {}), function(s, i, a) {
3611
+ }, Jn = (e, r) => e.some((t) => t.startsWith(r + "."));
3612
+ var pt = function(e, r, t) {
3613
+ return t === void 0 && (t = {}), function(s, a, i) {
3607
3614
  try {
3608
- var n = !a.shouldUseNativeValidation && a.criteriaMode === "all";
3609
- return Promise.resolve(/* @__PURE__ */ nn(e, s, Object.assign({}, r, { abortPipeEarly: !n }))).then(function(o) {
3615
+ var n = !i.shouldUseNativeValidation && i.criteriaMode === "all";
3616
+ return Promise.resolve(/* @__PURE__ */ an(e, s, Object.assign({}, r, { abortPipeEarly: !n }))).then(function(o) {
3610
3617
  if (o.issues) {
3611
3618
  for (var c = {}; o.issues.length; ) {
3612
- var h = o.issues[0], b = /* @__PURE__ */ Zs(h);
3613
- if (b && (c[b] || (c[b] = { message: h.message, type: h.type }), n)) {
3614
- var x = c[b].types, p = x && x[h.type];
3615
- c[b] = qr(b, n, c, h.type, p ? [].concat(p, h.message) : h.message);
3619
+ var p = o.issues[0], b = /* @__PURE__ */ Ys(p);
3620
+ if (b && (c[b] || (c[b] = { message: p.message, type: p.type }), n)) {
3621
+ var x = c[b].types, h = x && x[p.type];
3622
+ c[b] = qr(b, n, c, p.type, h ? [].concat(h, p.message) : p.message);
3616
3623
  }
3617
3624
  o.issues.shift();
3618
3625
  }
3619
- return { values: {}, errors: Gn(c, a) };
3626
+ return { values: {}, errors: Hn(c, i) };
3620
3627
  }
3621
3628
  return { values: t.raw ? s : o.output, errors: {} };
3622
3629
  });
@@ -3625,22 +3632,22 @@ var ut = function(e, r, t) {
3625
3632
  }
3626
3633
  };
3627
3634
  };
3628
- const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3635
+ const cr = 27, dr = 12, fr = 10, Xn = Re("enum"), Zn = (e, r) => {
3629
3636
  const t = {
3630
3637
  min: e.minSelected ?? 0,
3631
3638
  max: e.maxSelected ?? e.options.length
3632
3639
  };
3633
- return ut(/* @__PURE__ */ ve({
3634
- checked: /* @__PURE__ */ Se(/* @__PURE__ */ Or(/* @__PURE__ */ ie(), /* @__PURE__ */ Lr()), /* @__PURE__ */ It((s) => Object.entries(s).filter(([i, a]) => a).map(([i, a]) => i)), /* @__PURE__ */ Ke(t.max, r("validation_multiple_choice_max", {
3640
+ return pt(/* @__PURE__ */ xe({
3641
+ checked: /* @__PURE__ */ Se(/* @__PURE__ */ Or(/* @__PURE__ */ ae(), /* @__PURE__ */ Lr()), /* @__PURE__ */ At((s) => Object.entries(s).filter(([a, i]) => i).map(([a, i]) => a)), /* @__PURE__ */ He(t.max, r("validation_multiple_choice_max", {
3635
3642
  count: t.max
3636
- })), /* @__PURE__ */ Te(t.min, r("validation_multiple_choice_min", {
3643
+ })), /* @__PURE__ */ De(t.min, r("validation_multiple_choice_min", {
3637
3644
  count: t.min
3638
3645
  })))
3639
3646
  }));
3640
- }, Zn = xr(({
3647
+ }, Yn = xr(({
3641
3648
  option: e,
3642
3649
  ...r
3643
- }, t) => u(xe, {
3650
+ }, t) => u(we, {
3644
3651
  children: [u("input", {
3645
3652
  class: "peer sr-only h-full",
3646
3653
  type: "checkbox",
@@ -3651,7 +3658,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3651
3658
  htmlFor: r.id,
3652
3659
  children: e.label
3653
3660
  })]
3654
- })), hr = nt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
3661
+ })), pr = lt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
3655
3662
  variants: {
3656
3663
  variant: {
3657
3664
  // In cases where there is only one option, we want to center it
@@ -3660,90 +3667,90 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3660
3667
  booleanLike: Pr
3661
3668
  }
3662
3669
  }
3663
- }), Yn = ({
3670
+ }), Qn = ({
3664
3671
  input: e,
3665
3672
  onSubmitSuccess: r
3666
3673
  }) => {
3667
3674
  var b, x;
3668
- const t = e.key ? (b = $.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, i = s && e.config.options.length === 2, {
3669
- t: a
3675
+ const t = e.key ? (b = $.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, a = s && e.config.options.length === 2, {
3676
+ t: i
3670
3677
  } = se(), {
3671
3678
  register: n,
3672
3679
  handleSubmit: o,
3673
3680
  formState: {
3674
3681
  errors: c
3675
3682
  }
3676
- } = lt({
3683
+ } = ft({
3677
3684
  defaultValues: {
3678
- checked: s ? {} : Jn(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
3685
+ checked: s ? {} : Xn(t) ? Object.fromEntries(t.value.map((h) => [h, !0])) : {}
3679
3686
  },
3680
- resolver: Xn(e.config, a)
3681
- }), h = Vt();
3682
- return i ? u("ul", {
3687
+ resolver: Zn(e.config, i)
3688
+ }), p = Vt();
3689
+ return a ? u("ul", {
3683
3690
  style: {
3684
3691
  maxHeight: 6.5 * cr + 5 * dr + 2 * fr
3685
3692
  },
3686
- class: hr({
3693
+ class: pr({
3687
3694
  variant: "booleanLike"
3688
3695
  }),
3689
- children: e.config.options.map((p, m) => u("li", {
3696
+ children: e.config.options.map((h, m) => u("li", {
3690
3697
  class: Br,
3691
3698
  children: u(jr, {
3692
3699
  type: "submit",
3693
3700
  ref: (C) => {
3694
- C && m === 0 && (h.current = C);
3701
+ C && m === 0 && (p.current = C);
3695
3702
  },
3696
- label: p.label,
3703
+ label: h.label,
3697
3704
  value: "true",
3698
3705
  onClick: () => r({
3699
3706
  type: "enum",
3700
- value: [p.value]
3707
+ value: [h.value]
3701
3708
  })
3702
3709
  })
3703
- }, p.value))
3710
+ }, h.value))
3704
3711
  }) : u("form", {
3705
3712
  noValidate: !0,
3706
- onSubmit: (p) => o((m) => {
3713
+ onSubmit: (h) => o((m) => {
3707
3714
  const C = m.checked;
3708
3715
  r({
3709
3716
  type: "enum",
3710
3717
  value: C
3711
3718
  });
3712
- })(p),
3719
+ })(h),
3713
3720
  children: [u("div", {
3714
3721
  class: "flex items-center gap-1",
3715
3722
  children: [u("ul", {
3716
3723
  style: {
3717
3724
  maxHeight: 6.5 * cr + 5 * dr + 2 * fr
3718
3725
  },
3719
- class: hr({
3726
+ class: pr({
3720
3727
  variant: e.config.options.length === 1 ? "singleOption" : void 0
3721
3728
  }),
3722
- children: e.config.options.map((p, m) => {
3723
- const C = `checked.${p.value}`, {
3729
+ children: e.config.options.map((h, m) => {
3730
+ const C = `checked.${h.value}`, {
3724
3731
  ref: E,
3725
- ...A
3732
+ ...V
3726
3733
  } = n(C);
3727
3734
  return u("li", {
3728
3735
  class: "relative",
3729
- children: u(Zn, {
3730
- option: p,
3736
+ children: u(Yn, {
3737
+ option: h,
3731
3738
  autoFocus: m === 0,
3732
3739
  ref: (I) => {
3733
- I && m === 0 && (h.current = I), E(I);
3740
+ I && m === 0 && (p.current = I), E(I);
3734
3741
  },
3735
3742
  id: C,
3736
- ...A,
3743
+ ...V,
3737
3744
  onClick: s ? () => r({
3738
3745
  type: "enum",
3739
- value: [p.value]
3746
+ value: [h.value]
3740
3747
  }) : void 0
3741
3748
  })
3742
- }, p.value);
3749
+ }, h.value);
3743
3750
  })
3744
3751
  }), u("div", {
3745
3752
  class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
3746
- children: [s ? null : u(Ee, {}), e.config.minSelected === 0 && u(Fe, {
3753
+ children: [s ? null : u(Ee, {}), e.config.minSelected === 0 && u(Ae, {
3747
3754
  class: "relative",
3748
3755
  type: "button",
3749
3756
  onClick: () => r({
@@ -3759,50 +3766,50 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3759
3766
  })
3760
3767
  })]
3761
3768
  });
3762
- }, Qn = Re("number"), ei = (e, r) => {
3763
- const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, i = e.decimalCases ?? 0;
3764
- return ut(/* @__PURE__ */ ve({
3765
- number: /* @__PURE__ */ Se(/* @__PURE__ */ Tr(r("validation_number")), /* @__PURE__ */ Ar(t, r("validation_number_min", {
3769
+ }, ea = Re("number"), ta = (e, r) => {
3770
+ const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, a = e.decimalCases ?? 0;
3771
+ return pt(/* @__PURE__ */ xe({
3772
+ number: /* @__PURE__ */ Se(/* @__PURE__ */ Dr(r("validation_number")), /* @__PURE__ */ Vr(t, r("validation_number_min", {
3766
3773
  min: t
3767
- })), /* @__PURE__ */ Vr(s, r("validation_number_max", {
3774
+ })), /* @__PURE__ */ Fr(s, r("validation_number_max", {
3768
3775
  max: s
3769
- })), /* @__PURE__ */ Ir((a) => a === Number(a.toFixed(i)), r("validation_number_decimal_cases", {
3770
- count: i
3776
+ })), /* @__PURE__ */ Ir((i) => i === Number(i.toFixed(a)), r("validation_number_decimal_cases", {
3777
+ count: a
3771
3778
  })))
3772
3779
  }));
3773
- }, ti = ({
3780
+ }, ra = ({
3774
3781
  input: e,
3775
3782
  onSubmitSuccess: r
3776
3783
  }) => {
3777
3784
  var x;
3778
3785
  const t = e.config.defaultValue, s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, {
3779
- t: i
3786
+ t: a
3780
3787
  } = se(), {
3781
- register: a,
3788
+ register: i,
3782
3789
  handleSubmit: n,
3783
3790
  formState: {
3784
3791
  errors: o
3785
3792
  }
3786
- } = lt({
3793
+ } = ft({
3787
3794
  defaultValues: {
3788
- number: Qn(s) ? s.value : t ? Number(t) : void 0
3795
+ number: ea(s) ? s.value : t ? Number(t) : void 0
3789
3796
  },
3790
- resolver: ei(e.config, i)
3797
+ resolver: ta(e.config, a)
3791
3798
  }), {
3792
3799
  ref: c,
3793
- ...h
3794
- } = a("number", {
3800
+ ...p
3801
+ } = i("number", {
3795
3802
  required: !e.config.optional,
3796
3803
  valueAsNumber: !0
3797
- }), b = fe();
3804
+ }), b = pe();
3798
3805
  return Ie(() => {
3799
3806
  b.current && (b.current.focus(), b.current.select());
3800
3807
  }, []), u("form", {
3801
3808
  class: "flex flex-col gap-1 p-2.5",
3802
- onSubmit: n((p) => {
3803
- p.number !== void 0 && r({
3809
+ onSubmit: n((h) => {
3810
+ h.number !== void 0 && r({
3804
3811
  type: "number",
3805
- value: p.number
3812
+ value: h.number
3806
3813
  });
3807
3814
  }),
3808
3815
  children: [u("div", {
@@ -3810,24 +3817,24 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3810
3817
  children: [u("div", {
3811
3818
  class: "relative min-w-0 flex-grow",
3812
3819
  children: [u("input", {
3813
- ...h,
3820
+ ...p,
3814
3821
  id: "chat-input",
3815
3822
  autocomplete: "off",
3816
3823
  autoCapitalize: "off",
3817
3824
  autoCorrect: "off",
3818
3825
  autoFocus: !0,
3819
- ref: (p) => {
3820
- p && (b.current = p), c(p);
3826
+ ref: (h) => {
3827
+ h && (b.current = h), c(h);
3821
3828
  },
3822
3829
  type: "text",
3823
3830
  min: e.config.min,
3824
3831
  max: e.config.max,
3825
- class: Xe({
3832
+ class: Ye({
3826
3833
  optional: e.config.optional,
3827
3834
  className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
3828
3835
  }),
3829
3836
  placeholder: e.config.placeholder
3830
- }), e.config.optional && u(Fe, {
3837
+ }), e.config.optional && u(Ae, {
3831
3838
  class: "absolute bottom-0 right-0.5 top-0",
3832
3839
  onClick: () => r(null)
3833
3840
  })]
@@ -3836,13 +3843,13 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3836
3843
  error: o.number
3837
3844
  })]
3838
3845
  });
3839
- }, ri = (e) => {
3846
+ }, sa = (e) => {
3840
3847
  if (e === "")
3841
3848
  return {
3842
3849
  countryCode: "",
3843
3850
  phoneNumber: ""
3844
3851
  };
3845
- const r = Object.entries(Ft).find((i) => e.startsWith(i[1])), t = r ? r[1] : "", s = e.replace(t, "");
3852
+ const r = Object.entries(Ft).find((a) => e.startsWith(a[1])), t = r ? r[1] : "", s = e.replace(t, "");
3846
3853
  return /^\d+$/.test(s) ? {
3847
3854
  countryCode: t,
3848
3855
  phoneNumber: s
@@ -3850,54 +3857,54 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3850
3857
  countryCode: "",
3851
3858
  phoneNumber: ""
3852
3859
  };
3853
- }, si = "44", ni = /^[0-9 ]+$/, ii = Re("string"), ai = Re("phone"), oi = (e) => {
3854
- const r = /* @__PURE__ */ Se(/* @__PURE__ */ ie(e("validation_country_code")), /* @__PURE__ */ St(ni, e("validation_country_code"))), t = /* @__PURE__ */ Se(/* @__PURE__ */ ie(e("validation_phone")), /* @__PURE__ */ Te(1, e("validation_phone")), /* @__PURE__ */ It((s) => s.replace(/[^0-9]/g, "")));
3855
- return ut(/* @__PURE__ */ ve({
3860
+ }, na = "44", aa = /^[0-9 ]+$/, ia = Re("string"), oa = Re("phone"), la = (e) => {
3861
+ const r = /* @__PURE__ */ Se(/* @__PURE__ */ ae(e("validation_country_code")), /* @__PURE__ */ It(aa, e("validation_country_code"))), t = /* @__PURE__ */ Se(/* @__PURE__ */ ae(e("validation_phone")), /* @__PURE__ */ De(1, e("validation_phone")), /* @__PURE__ */ At((s) => s.replace(/[^0-9]/g, "")));
3862
+ return pt(/* @__PURE__ */ xe({
3856
3863
  countryCode: r,
3857
3864
  phoneNumber: t
3858
3865
  }));
3859
- }, li = ({
3866
+ }, ua = ({
3860
3867
  input: e,
3861
3868
  onSubmitSuccess: r
3862
3869
  }) => {
3863
3870
  var E;
3864
3871
  const t = e.key ? (E = $.current$.value.flow) == null ? void 0 : E.data.submissions[e.key] : void 0, {
3865
3872
  t: s
3866
- } = se(), [i, a] = be(), n = ii(t) ? ri(t.value) : ai(t) ? t.value : void 0, {
3873
+ } = se(), [a, i] = ve(), n = ia(t) ? sa(t.value) : oa(t) ? t.value : void 0, {
3867
3874
  register: o,
3868
3875
  handleSubmit: c,
3869
3876
  formState: {
3870
- errors: h
3877
+ errors: p
3871
3878
  },
3872
3879
  watch: b
3873
- } = lt({
3880
+ } = ft({
3874
3881
  defaultValues: {
3875
- countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ?? si,
3882
+ countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ?? na,
3876
3883
  phoneNumber: (n == null ? void 0 : n.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
3877
3884
  },
3878
- resolver: oi(s)
3885
+ resolver: la(s)
3879
3886
  }), {
3880
3887
  ref: x,
3881
- ...p
3888
+ ...h
3882
3889
  } = o("phoneNumber", {
3883
3890
  required: !e.config.optional
3884
- }), m = fe(), C = b("countryCode");
3891
+ }), m = pe(), C = b("countryCode");
3885
3892
  return Ie(() => {
3886
3893
  m.current && (m.current.focus(), m.current.select());
3887
3894
  }, []), u("form", {
3888
3895
  noValidate: !0,
3889
3896
  class: "flex flex-col gap-1 p-2.5",
3890
- onSubmit: c((A) => {
3891
- const I = A.phoneNumber.replace(/[^0-9]/g, ""), y = A.countryCode.replace(/[^0-9]/g, "");
3892
- a(void 0);
3893
- const _ = e.config.minChars ?? 7, V = I.length + y.length;
3894
- if (V < _)
3895
- return a(s("validation_phone_min_chars", {
3897
+ onSubmit: c((V) => {
3898
+ const I = V.phoneNumber.replace(/[^0-9]/g, ""), y = V.countryCode.replace(/[^0-9]/g, "");
3899
+ i(void 0);
3900
+ const _ = e.config.minChars ?? 7, F = I.length + y.length;
3901
+ if (F < _)
3902
+ return i(s("validation_phone_min_chars", {
3896
3903
  count: _
3897
3904
  }));
3898
3905
  const M = e.config.maxChars;
3899
- if (M != null && V > M)
3900
- return a(s("validation_max_chars", {
3906
+ if (M != null && F > M)
3907
+ return i(s("validation_max_chars", {
3901
3908
  count: M
3902
3909
  }));
3903
3910
  e.config.submissionFormat === "phone" ? r({
@@ -3908,7 +3915,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3908
3915
  }
3909
3916
  }) : r({
3910
3917
  type: "string",
3911
- value: C + A.phoneNumber
3918
+ value: C + V.phoneNumber
3912
3919
  });
3913
3920
  }),
3914
3921
  children: [u("div", {
@@ -3924,13 +3931,13 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3924
3931
  ...o("countryCode", {}),
3925
3932
  id: `isdk_phone_${e.key}`,
3926
3933
  class: "absolute inset-0 opacity-0",
3927
- children: Object.entries(Ft).map(([A, I]) => u("option", {
3934
+ children: Object.entries(Ft).map(([V, I]) => u("option", {
3928
3935
  value: I,
3929
- children: [A, " (+", I, ")"]
3930
- }, A))
3936
+ children: [V, " (+", I, ")"]
3937
+ }, V))
3931
3938
  })]
3932
3939
  }), u("input", {
3933
- ...p,
3940
+ ...h,
3934
3941
  id: "chat-input",
3935
3942
  type: "tel",
3936
3943
  inputMode: "tel",
@@ -3938,26 +3945,26 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3938
3945
  autoCapitalize: "off",
3939
3946
  autoCorrect: "off",
3940
3947
  autoFocus: !0,
3941
- ref: (A) => {
3942
- A && (m.current = A), x(A);
3948
+ ref: (V) => {
3949
+ V && (m.current = V), x(V);
3943
3950
  },
3944
- class: Xe({
3951
+ class: Ye({
3945
3952
  optional: e.config.optional,
3946
3953
  className: "min-w-0 flex-1 rounded-r-full"
3947
3954
  }),
3948
3955
  placeholder: e.config.placeholder
3949
- }), e.config.optional && u(Fe, {
3956
+ }), e.config.optional && u(Ae, {
3950
3957
  class: "absolute bottom-0 right-1 top-0",
3951
3958
  onClick: () => r(null)
3952
3959
  })]
3953
3960
  }), u(Ee, {})]
3954
3961
  }), u(Pe, {
3955
- error: h.countryCode || h.phoneNumber || {
3956
- message: i
3962
+ error: p.countryCode || p.phoneNumber || {
3963
+ message: a
3957
3964
  }
3958
3965
  })]
3959
3966
  });
3960
- }, et = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), ui = ({
3967
+ }, nt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), ca = ({
3961
3968
  input: e,
3962
3969
  onSubmitSuccess: r
3963
3970
  }) => {
@@ -3965,21 +3972,21 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3965
3972
  t
3966
3973
  } = se(), {
3967
3974
  availableAt: s
3968
- } = e.config, [i, a] = be(() => et(s)), [n, o] = be("");
3975
+ } = e.config, [a, i] = ve(() => nt(s)), [n, o] = ve("");
3969
3976
  vr(() => {
3970
- const h = et(s);
3971
- if (a(h), h === 0)
3977
+ const p = nt(s);
3978
+ if (i(p), p === 0)
3972
3979
  return;
3973
3980
  o(t("submission_cooldown", {
3974
- count: h
3981
+ count: p
3975
3982
  }));
3976
3983
  const b = setInterval(() => {
3977
- const x = et(s);
3978
- a(x), !(x > 0) && (clearInterval(b), o(t("submission_cooldown_ready")));
3984
+ const x = nt(s);
3985
+ i(x), !(x > 0) && (clearInterval(b), o(t("submission_cooldown_ready")));
3979
3986
  }, 250);
3980
3987
  return () => clearInterval(b);
3981
3988
  }, [s, t]);
3982
- const c = i > 0;
3989
+ const c = a > 0;
3983
3990
  return u("div", {
3984
3991
  class: "flex flex-col items-center gap-2 py-3",
3985
3992
  children: [u("button", {
@@ -3988,7 +3995,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3988
3995
  "aria-disabled": c,
3989
3996
  "aria-describedby": c ? "submit-cooldown" : void 0,
3990
3997
  onClick: () => {
3991
- et(s) > 0 || r(null);
3998
+ nt(s) > 0 || r(null);
3992
3999
  },
3993
4000
  children: u("span", {
3994
4001
  class: "flex items-center gap-1.5",
@@ -4015,7 +4022,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4015
4022
  "aria-hidden": "true",
4016
4023
  class: "text-neutral-11 text-xs",
4017
4024
  children: t("submission_cooldown", {
4018
- count: i
4025
+ count: a
4019
4026
  })
4020
4027
  }), u("p", {
4021
4028
  role: "status",
@@ -4023,7 +4030,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4023
4030
  children: n
4024
4031
  })]
4025
4032
  });
4026
- }, ci = {
4033
+ }, da = {
4027
4034
  date: {
4028
4035
  type: "date",
4029
4036
  inputMode: "text"
@@ -4042,7 +4049,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4042
4049
  inputMode: "url",
4043
4050
  formNoValidate: !0
4044
4051
  }
4045
- }, di = Re("string"), fi = (e, r) => {
4052
+ }, fa = Re("string"), pa = (e, r) => {
4046
4053
  const t = {
4047
4054
  maxLength: r("validation_max_chars", {
4048
4055
  count: e.maxChars ?? 999
@@ -4051,47 +4058,47 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4051
4058
  count: e.minChars ?? 1
4052
4059
  })
4053
4060
  };
4054
- return ut(/* @__PURE__ */ ve({
4061
+ return pt(/* @__PURE__ */ xe({
4055
4062
  text: {
4056
- date: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_date")), /* @__PURE__ */ St(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
4057
- email: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_email")), /* @__PURE__ */ Fr(r("validation_email")), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength)),
4058
- text: /* @__PURE__ */ Se(/* @__PURE__ */ ie(), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength)),
4059
- url: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_url")), /* @__PURE__ */ Mr(r("validation_url")), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength))
4063
+ date: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_date")), /* @__PURE__ */ It(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
4064
+ email: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_email")), /* @__PURE__ */ Ar(r("validation_email")), /* @__PURE__ */ De(e.minChars ?? 1, t.minLength), /* @__PURE__ */ He(e.maxChars ?? 1 / 0, t.maxLength)),
4065
+ text: /* @__PURE__ */ Se(/* @__PURE__ */ ae(), /* @__PURE__ */ De(e.minChars ?? 1, t.minLength), /* @__PURE__ */ He(e.maxChars ?? 1 / 0, t.maxLength)),
4066
+ url: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_url")), /* @__PURE__ */ Mr(r("validation_url")), /* @__PURE__ */ De(e.minChars ?? 1, t.minLength), /* @__PURE__ */ He(e.maxChars ?? 1 / 0, t.maxLength))
4060
4067
  }[e.format]
4061
4068
  }));
4062
- }, hi = ({
4069
+ }, ha = ({
4063
4070
  input: e,
4064
4071
  onSubmitSuccess: r
4065
4072
  }) => {
4066
4073
  var x;
4067
4074
  const {
4068
4075
  t
4069
- } = se(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, i = e.config.defaultValue, {
4070
- register: a,
4076
+ } = se(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, a = e.config.defaultValue, {
4077
+ register: i,
4071
4078
  handleSubmit: n,
4072
4079
  formState: {
4073
4080
  errors: o
4074
4081
  }
4075
- } = lt({
4082
+ } = ft({
4076
4083
  defaultValues: {
4077
- text: di(s) ? s.value : i ?? ""
4084
+ text: fa(s) ? s.value : a ?? ""
4078
4085
  },
4079
- resolver: fi(e.config, t)
4086
+ resolver: pa(e.config, t)
4080
4087
  }), {
4081
4088
  ref: c,
4082
- ...h
4083
- } = a("text", {
4089
+ ...p
4090
+ } = i("text", {
4084
4091
  required: !e.config.optional
4085
- }), b = fe();
4092
+ }), b = pe();
4086
4093
  return Ie(() => {
4087
4094
  b.current && (b.current.focus(), b.current.select());
4088
4095
  }, []), u("form", {
4089
4096
  noValidate: !0,
4090
4097
  class: "flex flex-col gap-1 p-2.5",
4091
- onSubmit: n((p) => {
4098
+ onSubmit: n((h) => {
4092
4099
  r({
4093
4100
  type: "string",
4094
- value: p.text
4101
+ value: h.text
4095
4102
  });
4096
4103
  }),
4097
4104
  children: [u("div", {
@@ -4100,21 +4107,21 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4100
4107
  class: "relative min-w-0 flex-1",
4101
4108
  children: [u("input", {
4102
4109
  id: "chat-input",
4103
- ...h,
4104
- ...ci[e.config.format],
4110
+ ...p,
4111
+ ...da[e.config.format],
4105
4112
  autocomplete: "off",
4106
4113
  autoCapitalize: "off",
4107
4114
  autoCorrect: "off",
4108
4115
  autoFocus: !0,
4109
- ref: (p) => {
4110
- p && (b.current = p), c(p);
4116
+ ref: (h) => {
4117
+ h && (b.current = h), c(h);
4111
4118
  },
4112
4119
  placeholder: e.config.placeholder,
4113
- class: Xe({
4120
+ class: Ye({
4114
4121
  optional: !!e.config.optional,
4115
4122
  className: "w-full rounded-full"
4116
4123
  })
4117
- }), e.config.optional && u(Fe, {
4124
+ }), e.config.optional && u(Ae, {
4118
4125
  class: "absolute bottom-0 right-0.5 top-0",
4119
4126
  onClick: () => r(null)
4120
4127
  })]
@@ -4123,21 +4130,21 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4123
4130
  error: o.text
4124
4131
  })]
4125
4132
  });
4126
- }, pi = {
4127
- text: hi,
4128
- phone: li,
4129
- "multiple-choice": Yn,
4130
- boolean: yn,
4131
- file: _n,
4132
- submit: ui,
4133
- address: dn,
4134
- number: ti
4135
- }, yi = ({
4133
+ }, ya = {
4134
+ text: ha,
4135
+ phone: ua,
4136
+ "multiple-choice": Qn,
4137
+ boolean: mn,
4138
+ file: kn,
4139
+ submit: ca,
4140
+ address: fn,
4141
+ number: ra
4142
+ }, ma = ({
4136
4143
  logger: e,
4137
4144
  analytics: r
4138
4145
  }) => {
4139
- var a;
4140
- const t = (a = $.current$.value.flow) == null ? void 0 : a.data.currentInput, s = fe(null), i = () => ae.onInteractionFn$.value();
4146
+ var i;
4147
+ const t = (i = $.current$.value.flow) == null ? void 0 : i.data.currentInput, s = pe(null), a = () => ie.onInteractionFn$.value();
4141
4148
  return Ie(() => {
4142
4149
  var n;
4143
4150
  (n = s.current) == null || n.scrollTo({
@@ -4148,14 +4155,14 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4148
4155
  class: "border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",
4149
4156
  children: u("div", {
4150
4157
  class: "flex flex-col",
4151
- onPointerDownCapture: t ? i : void 0,
4152
- onKeyDownCapture: t ? i : void 0,
4158
+ onPointerDownCapture: t ? a : void 0,
4159
+ onKeyDownCapture: t ? a : void 0,
4153
4160
  children: t ? (() => {
4154
- const n = pi[t.type];
4161
+ const n = ya[t.type];
4155
4162
  return u(n, {
4156
4163
  logger: e,
4157
4164
  analytics: r,
4158
- onSubmitSuccess: ae.onSubmitSuccessFn$.value,
4165
+ onSubmitSuccess: ie.onSubmitSuccessFn$.value,
4159
4166
  input: t
4160
4167
  });
4161
4168
  })() : u("div", {
@@ -4163,7 +4170,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4163
4170
  children: [u("input", {
4164
4171
  "aria-hidden": "true",
4165
4172
  id: "chat-input",
4166
- class: Xe({
4173
+ class: Ye({
4167
4174
  optional: !1,
4168
4175
  className: "flex-grow rounded-full"
4169
4176
  }),
@@ -4177,65 +4184,65 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
4177
4184
  })
4178
4185
  });
4179
4186
  };
4180
- function mi(e) {
4187
+ function ga(e) {
4181
4188
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4182
4189
  }
4183
- var gi = function(e) {
4190
+ var ba = function(e) {
4184
4191
  return e instanceof RegExp;
4185
- }, bi = function(r) {
4192
+ }, va = function(r) {
4186
4193
  var t = /[\\^$.*+?()[\]{}|]/g, s = RegExp(t.source);
4187
4194
  return r && s.test(r) ? r.replace(t, "\\$&") : r;
4188
4195
  }, Jr = function(e) {
4189
4196
  return typeof e == "string";
4190
- }, vi = function(e) {
4197
+ }, xa = function(e) {
4191
4198
  var r = [];
4192
4199
  return e.forEach(function(t) {
4193
4200
  Array.isArray(t) ? r = r.concat(t) : r.push(t);
4194
4201
  }), r;
4195
4202
  };
4196
- function xi(e, r, t) {
4197
- var s = 0, i = 0;
4203
+ function wa(e, r, t) {
4204
+ var s = 0, a = 0;
4198
4205
  if (e === "")
4199
4206
  return e;
4200
4207
  if (!e || !Jr(e))
4201
4208
  throw new TypeError("First argument to react-string-replace#replaceString must be a string");
4202
- var a = r;
4203
- gi(a) || (a = new RegExp("(" + bi(a) + ")", "gi"));
4204
- for (var n = e.split(a), o = 1, c = n.length; o < c; o += 2) {
4209
+ var i = r;
4210
+ ba(i) || (i = new RegExp("(" + va(i) + ")", "gi"));
4211
+ for (var n = e.split(i), o = 1, c = n.length; o < c; o += 2) {
4205
4212
  if (n[o] === void 0 || n[o - 1] === void 0) {
4206
4213
  console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
4207
4214
  continue;
4208
4215
  }
4209
- i = n[o].length, s += n[o - 1].length, n[o] = t(n[o], o, s), s += i;
4216
+ a = n[o].length, s += n[o - 1].length, n[o] = t(n[o], o, s), s += a;
4210
4217
  }
4211
4218
  return n;
4212
4219
  }
4213
- var wi = function(r, t, s) {
4214
- return Array.isArray(r) || (r = [r]), vi(r.map(function(i) {
4215
- return Jr(i) ? xi(i, t, s) : i;
4220
+ var _a = function(r, t, s) {
4221
+ return Array.isArray(r) || (r = [r]), xa(r.map(function(a) {
4222
+ return Jr(a) ? wa(a, t, s) : a;
4216
4223
  }));
4217
4224
  };
4218
- const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]+)\]\(([^)]+)\)/, Ci = /(https?:\/\/[^\s]+)/g, Si = /_(.*?)_/g, Ii = /\*\*(.*?)\*\*/g, Fi = /\\n|\n/g, pr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Vi = (e) => {
4219
- const r = Ue(e, _i, (n, o) => {
4220
- const [, c, h] = n.match(ki) ?? [];
4221
- return h ? u("a", {
4222
- class: pr,
4223
- href: h,
4224
- children: c ?? h
4225
- }, h + o) : u("span", {
4225
+ const We = /* @__PURE__ */ ga(_a), ka = /(\[[^\]]+\]\([^)]+\))/g, Ca = /\[([^\]]+)\]\(([^)]+)\)/, Sa = /(https?:\/\/[^\s]+)/g, Ia = /_(.*?)_/g, Aa = /\*\*(.*?)\*\*/g, Fa = /\\n|\n/g, hr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Va = (e) => {
4226
+ const r = We(e, ka, (n, o) => {
4227
+ const [, c, p] = n.match(Ca) ?? [];
4228
+ return p ? u("a", {
4229
+ class: hr,
4230
+ href: p,
4231
+ children: c ?? p
4232
+ }, p + o) : u("span", {
4226
4233
  children: "INVALID LINK"
4227
4234
  });
4228
- }), t = Ue(r, Ci, (n, o) => u("a", {
4229
- class: pr,
4235
+ }), t = We(r, Sa, (n, o) => u("a", {
4236
+ class: hr,
4230
4237
  href: n,
4231
4238
  children: n
4232
- }, n + o)), s = Ue(t, Si, (n, o) => u("em", {
4239
+ }, n + o)), s = We(t, Ia, (n, o) => u("em", {
4233
4240
  children: n
4234
- }, n + o)), i = Ue(s, Ii, (n, o) => u("strong", {
4241
+ }, n + o)), a = We(s, Aa, (n, o) => u("strong", {
4235
4242
  children: n
4236
4243
  }, n + o));
4237
- return Ue(i, Fi, (n, o) => u("br", {}, `br-${o}`));
4238
- }, Ai = nt("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", {
4244
+ return We(a, Fa, (n, o) => u("br", {}, `br-${o}`));
4245
+ }, Ma = lt("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", {
4239
4246
  variants: {
4240
4247
  side: {
4241
4248
  left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
@@ -4249,24 +4256,24 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4249
4256
  defaultVariants: {
4250
4257
  side: "left"
4251
4258
  }
4252
- }), Mi = ({
4259
+ }), Ea = ({
4253
4260
  children: e,
4254
4261
  className: r,
4255
4262
  animate: t,
4256
4263
  side: s,
4257
- ...i
4264
+ ...a
4258
4265
  }) => u("p", {
4259
4266
  style: {
4260
4267
  transformOrigin: s === "left" ? "0% 50%" : "100% 50%"
4261
4268
  },
4262
- class: Ai({
4269
+ class: Ma({
4263
4270
  className: r,
4264
4271
  side: s,
4265
4272
  animate: t
4266
4273
  }),
4267
- ...i,
4274
+ ...a,
4268
4275
  children: e
4269
- }), Ei = ({
4276
+ }), Na = ({
4270
4277
  message: e
4271
4278
  }) => u("div", {
4272
4279
  class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
@@ -4290,12 +4297,12 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4290
4297
  })
4291
4298
  })]
4292
4299
  })
4293
- }), Ni = ({
4300
+ }), La = ({
4294
4301
  className: e,
4295
4302
  ...r
4296
4303
  }) => u("div", {
4297
4304
  "aria-hidden": !0,
4298
- children: ae.isBotTyping$.value === !0 ? u("div", {
4305
+ children: ie.isBotTyping$.value === !0 ? u("div", {
4299
4306
  "aria-label": "Typing…",
4300
4307
  class: Oe("flex gap-1 p-4", e),
4301
4308
  ...r,
@@ -4308,10 +4315,10 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4308
4315
  }
4309
4316
  }))
4310
4317
  }) : void 0
4311
- }), Li = {
4318
+ }), Da = {
4312
4319
  bot: "left",
4313
4320
  user: "right"
4314
- }, Ti = nt("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)]", {
4321
+ }, Ta = lt("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)]", {
4315
4322
  variants: {
4316
4323
  variant: {
4317
4324
  info: "text-neutral-8",
@@ -4320,40 +4327,40 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4320
4327
  success: "text-[#4CAF50]"
4321
4328
  }
4322
4329
  }
4323
- }), Di = ({
4330
+ }), Oa = ({
4324
4331
  lastSentMessageFooter: e
4325
4332
  }) => {
4326
- const r = $.current$.value.flow, t = (r == null ? void 0 : r.data.messages) ?? [], s = r ? kt(r) : void 0;
4333
+ const r = $.current$.value.flow, t = (r == null ? void 0 : r.data.messages) ?? [], s = r ? Ct(r) : void 0;
4327
4334
  return u("ol", {
4328
4335
  "aria-label": "Chat messages",
4329
4336
  "aria-live": "polite",
4330
4337
  class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
4331
- children: [t.map((i, a) => u(xe, {
4338
+ children: [t.map((a, i) => u(we, {
4332
4339
  children: u("li", {
4333
4340
  class: "flex",
4334
- tabIndex: a === t.length - 1 ? -1 : void 0,
4335
- children: [s && i.groupId === s && !t.slice(a + 1).some((n) => n.groupId === s) ? e : null, fs(i).with({
4341
+ tabIndex: i === t.length - 1 ? -1 : void 0,
4342
+ children: [s && a.groupId === s && !t.slice(i + 1).some((n) => n.groupId === s) ? e : null, fs(a).with({
4336
4343
  type: "system"
4337
4344
  }, (n) => u("p", {
4338
- class: Ti({
4345
+ class: Ta({
4339
4346
  variant: n.variant
4340
4347
  }),
4341
4348
  children: n.text
4342
4349
  })).with({
4343
4350
  type: "text",
4344
- author: hs.union("bot", "user")
4351
+ author: ps.union("bot", "user")
4345
4352
  }, (n) => {
4346
- const o = a === t.length - 1, c = n.author === "bot" ? Vi(n.text) : n.text;
4347
- return u(xe, {
4348
- children: u(Mi, {
4353
+ const o = i === t.length - 1, c = n.author === "bot" ? Va(n.text) : n.text;
4354
+ return u(we, {
4355
+ children: u(Ea, {
4349
4356
  animate: o,
4350
- side: Li[n.author],
4357
+ side: Da[n.author],
4351
4358
  children: c
4352
- }, a)
4359
+ }, i)
4353
4360
  });
4354
4361
  }).with({
4355
4362
  type: "link"
4356
- }, (n) => u(Ei, {
4363
+ }, (n) => u(Na, {
4357
4364
  message: n
4358
4365
  })).with({
4359
4366
  type: "image"
@@ -4365,7 +4372,7 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4365
4372
  }
4366
4373
  })).with({
4367
4374
  type: "file"
4368
- }, (n) => u(bn, {
4375
+ }, (n) => u(vn, {
4369
4376
  class: n.author === "bot" ? void 0 : "ml-auto",
4370
4377
  file: {
4371
4378
  name: n.fileName,
@@ -4375,9 +4382,9 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4375
4382
  type: "loading"
4376
4383
  }, (n) => {
4377
4384
  const o = t[t.length - 1];
4378
- return !(n === o) || ae.isBotTyping$.value ? null : u("div", {
4385
+ return !(n === o) || ie.isBotTyping$.value ? null : u("div", {
4379
4386
  class: "flex flex-grow flex-col items-center justify-center gap-2",
4380
- children: [u(Ct, {
4387
+ children: [u(St, {
4381
4388
  "aria-hidden": n.text ? "true" : void 0,
4382
4389
  class: "text-neutral-6 h-8 w-8"
4383
4390
  }), n.text ? u("p", {
@@ -4388,56 +4395,56 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4388
4395
  });
4389
4396
  }).exhaustive()]
4390
4397
  })
4391
- }, a)), u(Ni, {}, "typing")]
4398
+ }, i)), u(La, {}, "typing")]
4392
4399
  });
4393
- }, ji = ({
4400
+ }, $a = ({
4394
4401
  logger: e,
4395
4402
  apiClient: r,
4396
4403
  analytics: t,
4397
4404
  talentBankClient: s
4398
4405
  }) => {
4399
4406
  const {
4400
- flow: i
4407
+ flow: a
4401
4408
  } = $.current$.value;
4402
- Me(i, "Flow is required to exist to show chatbot body");
4403
- const a = $.viewState$.value, {
4409
+ Me(a, "Flow is required to exist to show chatbot body");
4410
+ const i = $.viewState$.value, {
4404
4411
  chatRef: n,
4405
4412
  chatService: o
4406
- } = ps(), {
4413
+ } = hs(), {
4407
4414
  t: c
4408
- } = se(), [h, b] = be();
4415
+ } = se(), [p, b] = ve();
4409
4416
  return Ie(() => {
4410
- a === "maximised" && ae.scrollToEnd();
4411
- }, [a]), Ie(() => {
4417
+ i === "maximised" && ie.scrollToEnd();
4418
+ }, [i]), Ie(() => {
4412
4419
  var y;
4413
4420
  const {
4414
4421
  state: x,
4415
- flow: p
4422
+ flow: h
4416
4423
  } = $.current$.peek();
4417
4424
  if (x !== "loaded")
4418
4425
  throw new Error(c("invalid_state"));
4419
- let m = p.data.nodeHistory.at(-1);
4420
- if (ae.scrollToEnd(), $.setInput(void 0), p.data.isFinished)
4426
+ let m = h.data.nodeHistory.at(-1);
4427
+ if (ie.scrollToEnd(), $.setInput(void 0), h.data.isFinished)
4421
4428
  return;
4422
4429
  const C = () => {
4423
4430
  const _ = $.current$.peek().flow;
4424
4431
  !_ || _.data.hasInteracted || ($.markAsInteracted(), Ut(t, _, "FLOW_INTERACT"));
4425
4432
  };
4426
- ae.onInteractionFn$.value = C, m === void 0 ? (m = gr(i.nodes).id, $.setCurrentNodeId(m), Ut(t, p, "FLOW_START")) : $.removeMessagesSentByNodeIds([m]);
4433
+ ie.onInteractionFn$.value = C, m === void 0 ? (m = gr(a.nodes).id, $.setCurrentNodeId(m), Ut(t, h, "FLOW_START")) : $.removeMessagesSentByNodeIds([m]);
4427
4434
  const {
4428
4435
  interpret: E,
4429
- abort: A,
4436
+ abort: V,
4430
4437
  undo: I
4431
4438
  } = _s({
4432
- context: i.context,
4439
+ context: a.context,
4433
4440
  analytics: {
4434
4441
  service: t,
4435
- customProperties: (y = i.analytics) == null ? void 0 : y.customProperties
4442
+ customProperties: (y = a.analytics) == null ? void 0 : y.customProperties
4436
4443
  },
4437
4444
  apiClient: r,
4438
4445
  logger: e,
4439
4446
  talentBankClient: s,
4440
- flow: i,
4447
+ flow: a,
4441
4448
  chatService: o,
4442
4449
  t: c,
4443
4450
  getApplicationRecovery: () => {
@@ -4445,7 +4452,7 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4445
4452
  return (_ = $.current$.peek().flow) == null ? void 0 : _.data.applicationRecovery;
4446
4453
  },
4447
4454
  setApplicationRecovery: $.setApplicationRecovery,
4448
- persistWriteBarrier: () => $.persistWriteBarrier(p),
4455
+ persistWriteBarrier: () => $.persistWriteBarrier(h),
4449
4456
  // We need to get fresh submissions, that’s why we call `peek` here.
4450
4457
  getSubmissions: () => {
4451
4458
  var _;
@@ -4453,27 +4460,27 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4453
4460
  },
4454
4461
  onInterpret: (_) => $.setCurrentNodeId(_.id),
4455
4462
  onFlowEnd: async () => {
4456
- var V;
4463
+ var F;
4457
4464
  $.markAsFinished();
4458
4465
  const _ = $.current$.peek().flow;
4459
4466
  Me(_), t.log({
4460
4467
  event: "FLOW_END",
4461
4468
  properties: {
4462
- flow_id: i.id,
4463
- flow_version: i.version,
4469
+ flow_id: a.id,
4470
+ flow_version: a.version,
4464
4471
  flow_session_id: _.data.flowSessionId,
4465
- flow_build: i.build,
4466
- job: i.job
4472
+ flow_build: a.build,
4473
+ job: a.job
4467
4474
  },
4468
- customProperties: (V = i.analytics) == null ? void 0 : V.customProperties
4475
+ customProperties: (F = a.analytics) == null ? void 0 : F.customProperties
4469
4476
  });
4470
4477
  }
4471
4478
  });
4472
4479
  return b(() => I), E(m), () => {
4473
- ae.onInteractionFn$.value === C && (ae.onInteractionFn$.value = () => {
4474
- }), A();
4480
+ ie.onInteractionFn$.value === C && (ie.onInteractionFn$.value = () => {
4481
+ }), V();
4475
4482
  };
4476
- }, [t, r, o, e, i, s, c]), u(xe, {
4483
+ }, [t, r, o, e, a, s, c]), u(we, {
4477
4484
  children: [u("div", {
4478
4485
  class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
4479
4486
  children: [u("div", {
@@ -4485,31 +4492,31 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4485
4492
  style: {
4486
4493
  WebkitOverflowScrolling: "touch"
4487
4494
  },
4488
- children: u(Di, {
4489
- lastSentMessageFooter: !kt(i) || !h ? null : u(Oi, {
4490
- undoFn: h
4495
+ children: u(Oa, {
4496
+ lastSentMessageFooter: !Ct(a) || !p ? null : u(Ra, {
4497
+ undoFn: p
4491
4498
  })
4492
4499
  })
4493
- }), ae.isReadingHistory$.value && !i.data.isFinished && !ae.isBotTyping$.value && u("div", {
4500
+ }), ie.isReadingHistory$.value && !a.data.isFinished && !ie.isBotTyping$.value && u("div", {
4494
4501
  class: "absolute bottom-2 left-1/2 -translate-x-1/2",
4495
4502
  children: u(wr, {
4496
4503
  class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
4497
4504
  "aria-label": c("jump_to_current"),
4498
4505
  onClick: () => {
4499
- var p, m;
4500
- ae.scrollToEnd(), (m = ((p = n.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? n.current) == null || m.focus({
4506
+ var h, m;
4507
+ ie.scrollToEnd(), (m = ((h = n.current) == null ? void 0 : h.querySelector('li[tabindex="-1"]')) ?? n.current) == null || m.focus({
4501
4508
  preventScroll: !0
4502
4509
  });
4503
4510
  },
4504
4511
  children: u(ys, {})
4505
4512
  })
4506
4513
  })]
4507
- }), u(yi, {
4514
+ }), u(ma, {
4508
4515
  logger: e,
4509
4516
  analytics: t
4510
4517
  })]
4511
4518
  });
4512
- }, Oi = ({
4519
+ }, Ra = ({
4513
4520
  undoFn: e
4514
4521
  }) => {
4515
4522
  const {
@@ -4532,5 +4539,5 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4532
4539
  });
4533
4540
  };
4534
4541
  export {
4535
- ji as ChatbotBody
4542
+ $a as ChatbotBody
4536
4543
  };