@inploi/plugin-chatbot 14.10.2 → 14.10.3

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,9 +1,9 @@
1
1
  var Sn = Object.defineProperty;
2
- var En = (e, r, t) => r in e ? Sn(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var Y = (e, r, t) => (En(e, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { a as Or, p as xt, D as Tt, c as He, d as Br, I as jr, i as An, S as In, N as Fn, T as Pr, Z as Vn, X as $r, W as Mn, C as Ln, r as Dn, m as Nn, k as Rn, U as rr, V as nr, h as Tn, b as sr, f as On, g as qr, x as Bn, v as jn, w as Pn, y as $n, s as H, u as te, o as c, e as Xe, j as wt, l as _e, _ as ye, n as Be, q as De, t as Ce, L as qt, F as qn, z as Ur, A as Wr, B as Un, E as Ye, G as ar, H as ne, J as oe, M as Wn, K as zn, O as Hn, P as Kn, Q as zr, R as Gn } from "./index-fd318f9f.js";
2
+ var In = (e, r, t) => r in e ? Sn(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var Q = (e, r, t) => (In(e, typeof r != "symbol" ? r + "" : r, t), t);
4
+ import { u as Or, p as vt, D as Tt, l as ze, f as Br, I as jr, a as An, E as En, N as Fn, T as $r, z as Vn, Z as Pr, H as Mn, C as Ln, s as Nn, g as Rn, S as Dn, U as rr, $ as nr, R as Tn, w as sr, m as On, y as Bn, b as qr, k as jn, x as $n, h as Pn, v as qn, c as U, d as re, o as c, e as Ze, i as xt, j as we, _ as ye, n as je, q as Re, r as ke, L as qt, F as Un, t as Ur, A as Wr, B as Wn, G as Xe, J as ar, K as se, M as ce, O as zn, P as Hn, Q as Kn, V as Gn, W as zr, X as Jn } from "./index-74999c44.js";
5
5
  import "@inploi/sdk";
6
- var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/index.html`, Zn = new URL(Hr).origin, ir = 3e4, Xn = 5 * 6e4, Yn = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), Qn = (e) => {
6
+ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/index.html`, Xn = new URL(Hr).origin, ir = 3e4, Yn = 5 * 6e4, Qn = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), es = (e) => {
7
7
  let r = Ft.get(e);
8
8
  return r || (r = e.fetch("/flow/captcha").then((t) => {
9
9
  let n = t == null ? void 0 : t.site_key;
@@ -11,39 +11,39 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
11
11
  }).catch((t) => {
12
12
  throw Ft.delete(e), t;
13
13
  }), Ft.set(e, r)), r;
14
- }, es = (e, r = {}) => new Promise((t, n) => {
14
+ }, ts = (e, r = {}) => new Promise((t, n) => {
15
15
  let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, u = !1, f = () => {
16
- }, g = (E) => {
17
- u || (u = !0, clearTimeout(m), s == null || s.removeEventListener("abort", p), f(), E());
18
- }, y = (E) => g(() => n(new Error(E))), p = () => y("Captcha aborted"), m, _ = (E) => {
19
- clearTimeout(m), m = setTimeout(() => y("Captcha timed out"), E);
16
+ }, b = (I) => {
17
+ u || (u = !0, clearTimeout(m), s == null || s.removeEventListener("abort", p), f(), I());
18
+ }, y = (I) => b(() => n(new Error(I))), p = () => y("Captcha aborted"), m, k = (I) => {
19
+ clearTimeout(m), m = setTimeout(() => y("Captcha timed out"), I);
20
20
  };
21
- if (_(ir), s == null ? void 0 : s.aborted)
21
+ if (k(ir), s == null ? void 0 : s.aborted)
22
22
  return p();
23
23
  s == null || s.addEventListener("abort", p), (async () => {
24
- let E = await Qn(e);
25
- if (E === void 0)
26
- return g(() => t(void 0));
24
+ let I = await es(e);
25
+ if (I === void 0)
26
+ return b(() => t(void 0));
27
27
  if (u)
28
28
  return;
29
29
  let C = document.createElement("iframe");
30
- C.src = `${Hr}?${new URLSearchParams({ sitekey: E, origin: window.location.origin, ...a && { theme: a } }).toString()}`, C.title = "Cloudflare security check", C.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(C) : (C.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(C));
31
- let x = !1, b = (F) => {
32
- if (!C.contentWindow || F.source !== C.contentWindow || F.origin !== Zn || !Yn(F.data))
30
+ C.src = `${Hr}?${new URLSearchParams({ sitekey: I, origin: window.location.origin, ...a && { theme: a } }).toString()}`, C.title = "Cloudflare security check", C.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(C) : (C.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(C));
31
+ let x = !1, v = (E) => {
32
+ if (!C.contentWindow || E.source !== C.contentWindow || E.origin !== Xn || !Qn(E.data))
33
33
  return;
34
- let L = F.data;
35
- switch (L.type) {
34
+ let N = E.data;
35
+ switch (N.type) {
36
36
  case "token":
37
- return g(() => t(L.token));
37
+ return b(() => t(N.token));
38
38
  case "resize":
39
- C.style.height = `${Math.max(0, Math.ceil(L.height))}px`;
39
+ C.style.height = `${Math.max(0, Math.ceil(N.height))}px`;
40
40
  return;
41
41
  case "before-interactive":
42
- return x = !0, _(Xn), o == null ? void 0 : o();
42
+ return x = !0, k(Yn), o == null ? void 0 : o();
43
43
  case "after-interactive":
44
- return x = !1, _(ir);
44
+ return x = !1, k(ir);
45
45
  case "error":
46
- !x && !L.interactive && y("Captcha failed");
46
+ !x && !N.interactive && y("Captcha failed");
47
47
  return;
48
48
  case "expired":
49
49
  return y("Captcha expired");
@@ -51,10 +51,10 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
51
51
  return y("Captcha timed out");
52
52
  }
53
53
  };
54
- window.addEventListener("message", b), f = () => {
55
- window.removeEventListener("message", b), C.remove();
54
+ window.addEventListener("message", v), f = () => {
55
+ window.removeEventListener("message", v), C.remove();
56
56
  };
57
- })().catch((E) => g(() => n(E)));
57
+ })().catch((I) => b(() => n(I)));
58
58
  }), or = ({ condition: e, context: r, submissions: t, ifBlock: n }) => {
59
59
  let [s, ...i] = e.compareKey.split(".");
60
60
  if (!s)
@@ -83,13 +83,13 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
83
83
  let o = Tt(a.value, i), u = { ...n, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
84
84
  switch (typeof o) {
85
85
  case "boolean":
86
- return lt(u, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
86
+ return at(u, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
87
87
  case "string":
88
- return lt(u, { submissions: { _temp: { value: o, type: "string" } }, context: r });
88
+ return at(u, { submissions: { _temp: { value: o, type: "string" } }, context: r });
89
89
  case "number":
90
- return lt(u, { submissions: { _temp: { value: o, type: "number" } }, context: r });
90
+ return at(u, { submissions: { _temp: { value: o, type: "number" } }, context: r });
91
91
  case "object":
92
- return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(u, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
92
+ return Array.isArray(o) && o.every((f) => typeof f == "string") ? at(u, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
93
93
  }
94
94
  break;
95
95
  }
@@ -105,7 +105,7 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
105
105
  }
106
106
  case "phone":
107
107
  case "string": {
108
- let o = a.type === "phone" ? xt(a.value) : a.value;
108
+ let o = a.type === "phone" ? vt(a.value) : a.value;
109
109
  switch (e.compare) {
110
110
  case "equals":
111
111
  return o === e.compareValue;
@@ -153,7 +153,7 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
153
153
  }
154
154
  break;
155
155
  }
156
- }, lt = (e, { context: r, submissions: t }) => {
156
+ }, at = (e, { context: r, submissions: t }) => {
157
157
  let n = "combinator" in e.data ? e.data.conditions : [e.data];
158
158
  if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
159
159
  for (let s of n)
@@ -166,7 +166,7 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
166
166
  return !1;
167
167
  return !0;
168
168
  }
169
- }, ts = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, rs = (e, { context: r, submissions: t }) => e.replace(ts, (n, s, i = "") => {
169
+ }, rs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ns = (e, { context: r, submissions: t }) => e.replace(rs, (n, s, i = "") => {
170
170
  let [a, ...o] = s.trim().split("."), u = Or({ key: a, path: o, submissions: t, context: r });
171
171
  if (!u)
172
172
  return i;
@@ -174,7 +174,7 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
174
174
  case "boolean":
175
175
  return u.value === !0 ? "true" : "false";
176
176
  case "file":
177
- return u.value.map((f) => `${f.name} (${He(f.sizeKb)})`).join(", ");
177
+ return u.value.map((f) => `${f.name} (${ze(f.sizeKb)})`).join(", ");
178
178
  case "enum":
179
179
  return u.value.join(", ");
180
180
  case "address":
@@ -183,7 +183,7 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
183
183
  case "string":
184
184
  return u.value ? u.value.toString() : i;
185
185
  case "phone":
186
- return xt(u.value);
186
+ return vt(u.value);
187
187
  case "integration": {
188
188
  if (typeof u.value != "object" || Array.isArray(u.value))
189
189
  break;
@@ -196,7 +196,7 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
196
196
  case "number":
197
197
  return f.toString();
198
198
  case "object":
199
- if (Array.isArray(f) && f.every((g) => typeof g == "string"))
199
+ if (Array.isArray(f) && f.every((b) => typeof b == "string"))
200
200
  return f.join(", ");
201
201
  }
202
202
  break;
@@ -205,11 +205,11 @@ var Jn = "9.8.1", Hr = `https://sdk.inploi.com/@inploi/flows@${Jn}/cdn/captcha/i
205
205
  return i;
206
206
  });
207
207
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
208
- function ns(e) {
208
+ function ss(e) {
209
209
  return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
210
210
  }
211
211
  function Ut(e, r, t = "") {
212
- const n = ns(e), s = e == null ? void 0 : e.length, i = r !== void 0;
212
+ const n = ss(e), s = e == null ? void 0 : e.length, i = r !== void 0;
213
213
  if (!n || i && s !== r) {
214
214
  const a = t && `"${t}" `, o = i ? ` of length ${r}` : "", u = n ? `length=${s}` : `type=${typeof e}`;
215
215
  throw new Error(a + "expected Uint8Array" + o + ", got " + u);
@@ -222,7 +222,7 @@ function lr(e, r = !0) {
222
222
  if (r && e.finished)
223
223
  throw new Error("Hash#digest() has already been called");
224
224
  }
225
- function ss(e, r) {
225
+ function as(e, r) {
226
226
  Ut(e, void 0, "digestInto() output");
227
227
  const t = r.outputLen;
228
228
  if (e.length < t)
@@ -238,44 +238,44 @@ function Vt(e) {
238
238
  function pe(e, r) {
239
239
  return e << 32 - r | e >>> r;
240
240
  }
241
- const as = /* @__PURE__ */ (() => (
241
+ const is = /* @__PURE__ */ (() => (
242
242
  // @ts-ignore
243
243
  typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
244
- ))(), is = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
245
- function os(e) {
246
- if (Ut(e), as)
244
+ ))(), os = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
245
+ function ls(e) {
246
+ if (Ut(e), is)
247
247
  return e.toHex();
248
248
  let r = "";
249
249
  for (let t = 0; t < e.length; t++)
250
- r += is[e[t]];
250
+ r += os[e[t]];
251
251
  return r;
252
252
  }
253
- function ls(e, r = {}) {
253
+ function cs(e, r = {}) {
254
254
  const t = (s, i) => e(i).update(s).digest(), n = e(void 0);
255
255
  return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (s) => e(s), Object.assign(t, r), Object.freeze(t);
256
256
  }
257
- const cs = (e) => ({
257
+ const us = (e) => ({
258
258
  oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, e])
259
259
  });
260
- function us(e, r, t) {
260
+ function ds(e, r, t) {
261
261
  return e & r ^ ~e & t;
262
262
  }
263
- function ds(e, r, t) {
263
+ function fs(e, r, t) {
264
264
  return e & r ^ e & t ^ r & t;
265
265
  }
266
- class fs {
266
+ class hs {
267
267
  constructor(r, t, n, s) {
268
- Y(this, "blockLen");
269
- Y(this, "outputLen");
270
- Y(this, "padOffset");
271
- Y(this, "isLE");
268
+ Q(this, "blockLen");
269
+ Q(this, "outputLen");
270
+ Q(this, "padOffset");
271
+ Q(this, "isLE");
272
272
  // For partial updates less than block size
273
- Y(this, "buffer");
274
- Y(this, "view");
275
- Y(this, "finished", !1);
276
- Y(this, "length", 0);
277
- Y(this, "pos", 0);
278
- Y(this, "destroyed", !1);
273
+ Q(this, "buffer");
274
+ Q(this, "view");
275
+ Q(this, "finished", !1);
276
+ Q(this, "length", 0);
277
+ Q(this, "pos", 0);
278
+ Q(this, "destroyed", !1);
279
279
  this.blockLen = r, this.outputLen = t, this.padOffset = n, this.isLE = s, this.buffer = new Uint8Array(r), this.view = Vt(this.buffer);
280
280
  }
281
281
  update(r) {
@@ -294,7 +294,7 @@ class fs {
294
294
  return this.length += r.length, this.roundClean(), this;
295
295
  }
296
296
  digestInto(r) {
297
- lr(this), ss(r, this), this.finished = !0;
297
+ lr(this), as(r, this), this.finished = !0;
298
298
  const { buffer: t, view: n, blockLen: s, isLE: i } = this;
299
299
  let { pos: a } = this;
300
300
  t[a++] = 128, Ot(this.buffer.subarray(a)), this.padOffset > s - a && (this.process(n, 0), a = 0);
@@ -304,11 +304,11 @@ class fs {
304
304
  const o = Vt(r), u = this.outputLen;
305
305
  if (u % 4)
306
306
  throw new Error("_sha2: outputLen must be aligned to 32bit");
307
- const f = u / 4, g = this.get();
308
- if (f > g.length)
307
+ const f = u / 4, b = this.get();
308
+ if (f > b.length)
309
309
  throw new Error("_sha2: outputLen bigger than state");
310
310
  for (let y = 0; y < f; y++)
311
- o.setUint32(4 * y, g[y], i);
311
+ o.setUint32(4 * y, b[y], i);
312
312
  }
313
313
  digest() {
314
314
  const { buffer: r, outputLen: t } = this;
@@ -325,7 +325,7 @@ class fs {
325
325
  return this._cloneInto();
326
326
  }
327
327
  }
328
- const Fe = /* @__PURE__ */ Uint32Array.from([
328
+ const Ve = /* @__PURE__ */ Uint32Array.from([
329
329
  1779033703,
330
330
  3144134277,
331
331
  1013904242,
@@ -334,7 +334,7 @@ const Fe = /* @__PURE__ */ Uint32Array.from([
334
334
  2600822924,
335
335
  528734635,
336
336
  1541459225
337
- ]), hs = /* @__PURE__ */ Uint32Array.from([
337
+ ]), ps = /* @__PURE__ */ Uint32Array.from([
338
338
  1116352408,
339
339
  1899447441,
340
340
  3049323471,
@@ -399,8 +399,8 @@ const Fe = /* @__PURE__ */ Uint32Array.from([
399
399
  2756734187,
400
400
  3204031479,
401
401
  3329325298
402
- ]), Ve = /* @__PURE__ */ new Uint32Array(64);
403
- class ps extends fs {
402
+ ]), Me = /* @__PURE__ */ new Uint32Array(64);
403
+ class ms extends hs {
404
404
  constructor(r) {
405
405
  super(64, r, 8, !1);
406
406
  }
@@ -414,43 +414,43 @@ class ps extends fs {
414
414
  }
415
415
  process(r, t) {
416
416
  for (let y = 0; y < 16; y++, t += 4)
417
- Ve[y] = r.getUint32(t, !1);
417
+ Me[y] = r.getUint32(t, !1);
418
418
  for (let y = 16; y < 64; y++) {
419
- const p = Ve[y - 15], m = Ve[y - 2], _ = pe(p, 7) ^ pe(p, 18) ^ p >>> 3, E = pe(m, 17) ^ pe(m, 19) ^ m >>> 10;
420
- Ve[y] = E + Ve[y - 7] + _ + Ve[y - 16] | 0;
419
+ const p = Me[y - 15], m = Me[y - 2], k = pe(p, 7) ^ pe(p, 18) ^ p >>> 3, I = pe(m, 17) ^ pe(m, 19) ^ m >>> 10;
420
+ Me[y] = I + Me[y - 7] + k + Me[y - 16] | 0;
421
421
  }
422
- let { A: n, B: s, C: i, D: a, E: o, F: u, G: f, H: g } = this;
422
+ let { A: n, B: s, C: i, D: a, E: o, F: u, G: f, H: b } = this;
423
423
  for (let y = 0; y < 64; y++) {
424
- const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), m = g + p + us(o, u, f) + hs[y] + Ve[y] | 0, E = (pe(n, 2) ^ pe(n, 13) ^ pe(n, 22)) + ds(n, s, i) | 0;
425
- g = f, f = u, u = o, o = a + m | 0, a = i, i = s, s = n, n = m + E | 0;
424
+ const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), m = b + p + ds(o, u, f) + ps[y] + Me[y] | 0, I = (pe(n, 2) ^ pe(n, 13) ^ pe(n, 22)) + fs(n, s, i) | 0;
425
+ b = f, f = u, u = o, o = a + m | 0, a = i, i = s, s = n, n = m + I | 0;
426
426
  }
427
- n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, u = u + this.F | 0, f = f + this.G | 0, g = g + this.H | 0, this.set(n, s, i, a, o, u, f, g);
427
+ n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, u = u + this.F | 0, f = f + this.G | 0, b = b + this.H | 0, this.set(n, s, i, a, o, u, f, b);
428
428
  }
429
429
  roundClean() {
430
- Ot(Ve);
430
+ Ot(Me);
431
431
  }
432
432
  destroy() {
433
433
  this.set(0, 0, 0, 0, 0, 0, 0, 0), Ot(this.buffer);
434
434
  }
435
435
  }
436
- class ms extends ps {
436
+ class ys extends ms {
437
437
  constructor() {
438
438
  super(32);
439
439
  // We cannot use array here since array allows indexing by variable
440
440
  // which means optimizer/compiler cannot use registers.
441
- Y(this, "A", Fe[0] | 0);
442
- Y(this, "B", Fe[1] | 0);
443
- Y(this, "C", Fe[2] | 0);
444
- Y(this, "D", Fe[3] | 0);
445
- Y(this, "E", Fe[4] | 0);
446
- Y(this, "F", Fe[5] | 0);
447
- Y(this, "G", Fe[6] | 0);
448
- Y(this, "H", Fe[7] | 0);
441
+ Q(this, "A", Ve[0] | 0);
442
+ Q(this, "B", Ve[1] | 0);
443
+ Q(this, "C", Ve[2] | 0);
444
+ Q(this, "D", Ve[3] | 0);
445
+ Q(this, "E", Ve[4] | 0);
446
+ Q(this, "F", Ve[5] | 0);
447
+ Q(this, "G", Ve[6] | 0);
448
+ Q(this, "H", Ve[7] | 0);
449
449
  }
450
450
  }
451
- const ys = /* @__PURE__ */ ls(
452
- () => new ms(),
453
- /* @__PURE__ */ cs(1)
451
+ const bs = /* @__PURE__ */ cs(
452
+ () => new ys(),
453
+ /* @__PURE__ */ us(1)
454
454
  );
455
455
  var Kr = (e) => {
456
456
  let r = e.find((t) => t.isHead);
@@ -461,8 +461,8 @@ var Kr = (e) => {
461
461
  var r, t;
462
462
  if (!(e.data.isFinished || (r = e.data.startedWriteNodeIds) != null && r.length))
463
463
  return (t = [...e.data.messages].reverse().find((n) => n.groupId && e.nodes.some((s) => s.id === n.groupId && s.type.startsWith("question-")) && (n.type === "system" || "author" in n && n.author === "user"))) == null ? void 0 : t.groupId;
464
- }, Bt = (e) => Array.isArray(e) ? e.map(Bt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Bt(t)])) : typeof e == "function" ? void 0 : e, gs = (e) => os(ys(new TextEncoder().encode(JSON.stringify(Bt(e)))));
465
- function bs(e, r, t, n) {
464
+ }, Bt = (e) => Array.isArray(e) ? e.map(Bt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Bt(t)])) : typeof e == "function" ? void 0 : e, gs = (e) => ls(bs(new TextEncoder().encode(JSON.stringify(Bt(e)))));
465
+ function vs(e, r, t, n) {
466
466
  var s;
467
467
  if (n != null && n.aborted)
468
468
  return;
@@ -478,13 +478,13 @@ function bs(e, r, t, n) {
478
478
  clearTimeout(u);
479
479
  });
480
480
  }
481
- var Gr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => rs(e, Gr(r)), vs = (e, r) => lt(e, Gr(r)), Jr = ({ node: e, nodes: r, stopWhen: t }) => {
481
+ var Gr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ns(e, Gr(r)), xs = (e, r) => at(e, Gr(r)), Jr = ({ node: e, nodes: r, stopWhen: t }) => {
482
482
  if ((t == null ? void 0 : t(e)) === !0)
483
483
  return e;
484
484
  let n = e.nextId ? r.find((s) => s.id === e.nextId) : void 0;
485
485
  if (n)
486
486
  return Jr({ node: n, nodes: r, stopWhen: t });
487
- }, xs = ({ childNode: e, nodes: r }) => {
487
+ }, ws = ({ childNode: e, nodes: r }) => {
488
488
  let t = r.filter((n) => n.type === "if-block").find((n) => {
489
489
  if (!n.branchId)
490
490
  return !1;
@@ -496,44 +496,44 @@ var Gr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
496
496
  });
497
497
  if (t != null && t.nextId)
498
498
  return r.find((n) => n.id === t.nextId);
499
- }, ws = 3, _s = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: u, chatService: f, persistWriteBarrier: g, onSubmitNetworkError: y, closedRoleBehaviour: p, dateEchoLocale: m, onFlowEnd: _, onInterpret: E, forceSubmitConfirmation: C, t: x }) => {
500
- var b;
501
- let F = new AbortController(), L = { submitAccepted: !1 };
502
- (b = e.data).startedWriteNodeIds ?? (b.startedWriteNodeIds = e.nodes.flatMap((N) => {
503
- var $, P;
504
- if (N.type !== "integration-application-submit" || !e.data.nodeHistory.includes(N.id))
499
+ }, _s = 3, ks = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: u, chatService: f, persistWriteBarrier: b, onSubmitNetworkError: y, closedRoleBehaviour: p, dateEchoLocale: m, onFlowEnd: k, onInterpret: I, forceSubmitConfirmation: C, t: x }) => {
500
+ var v;
501
+ let E = new AbortController(), N = { submitAccepted: !1 };
502
+ (v = e.data).startedWriteNodeIds ?? (v.startedWriteNodeIds = e.nodes.flatMap((R) => {
503
+ var j, O;
504
+ if (R.type !== "integration-application-submit" || !e.data.nodeHistory.includes(R.id))
505
505
  return [];
506
- let O = N.data.key ? ($ = a()) == null ? void 0 : $[N.data.key] : void 0;
507
- return (O == null ? void 0 : O.type) === "integration" && ((P = Br(O.value)) == null ? void 0 : P.verdict) === "not_submitted" ? [] : [N.id];
506
+ let W = R.data.key ? (j = a()) == null ? void 0 : j[R.data.key] : void 0;
507
+ return (W == null ? void 0 : W.type) === "integration" && ((O = Br(W.value)) == null ? void 0 : O.verdict) === "not_submitted" ? [] : [R.id];
508
508
  }));
509
- let V = { ...r.service, log: (N) => r.service.log({ ...N, customProperties: { ...N.customProperties, ...r.customProperties } }) }, T = async (N, O) => {
510
- let $ = F.signal;
511
- if ($.aborted)
509
+ let M = { ...r.service, log: (R) => r.service.log({ ...R, customProperties: { ...R.customProperties, ...r.customProperties } }) }, L = async (R, W) => {
510
+ let j = E.signal;
511
+ if (j.aborted)
512
512
  return;
513
- let P = a(), G = o(), M = (G == null ? void 0 : G.submitNodeId) === N.id ? e.nodes.find((A) => {
514
- var B;
515
- return A.id === G.fileQuestionNodeId && A.type === "question-file" && ((B = P == null ? void 0 : P[A.data.key]) == null ? void 0 : B.type) !== "file";
513
+ let O = a(), z = o(), V = (z == null ? void 0 : z.submitNodeId) === R.id ? e.nodes.find((A) => {
514
+ var T;
515
+ return A.id === z.fileQuestionNodeId && A.type === "question-file" && ((T = O == null ? void 0 : O[A.data.key]) == null ? void 0 : T.type) !== "file";
516
516
  }) : void 0;
517
- if (M)
518
- return T(M, O);
519
- E == null || E(N, O);
517
+ if (V)
518
+ return L(V, W);
519
+ I == null || I(R, W);
520
520
  try {
521
- await ks({ flow: e, analytics: V, logger: t, talentBankClient: n, apiClient: i, context: s, node: N, submissions: P, applicationRecovery: G, setApplicationRecovery: async (A) => {
522
- if (!$.aborted)
521
+ await Cs({ flow: e, analytics: M, logger: t, talentBankClient: n, apiClient: i, context: s, node: R, submissions: O, applicationRecovery: z, setApplicationRecovery: async (A) => {
522
+ if (!j.aborted)
523
523
  try {
524
524
  await u(A);
525
- } catch (B) {
526
- t.error("Failed to persist application recovery", B);
525
+ } catch (T) {
526
+ t.error("Failed to persist application recovery", T);
527
527
  }
528
- }, forceSubmitConfirmation: C || (G == null ? void 0 : G.submitNodeId) === N.id, run: L, persistWriteBarrier: g, onSubmitNetworkError: y, closedRoleBehaviour: p, dateEchoLocale: m, signal: $, t: x, chat: { sendMessage: async (A) => f.send({ groupId: N.id, message: A, signal: $ }), userInput: async (A) => f.input({ input: A, signal: $ }), setSubmission: (A, B) => {
529
- $.aborted || f.setSubmission(A, B);
528
+ }, forceSubmitConfirmation: C || (z == null ? void 0 : z.submitNodeId) === R.id, run: N, persistWriteBarrier: b, onSubmitNetworkError: y, closedRoleBehaviour: p, dateEchoLocale: m, signal: j, t: x, chat: { sendMessage: async (A) => f.send({ groupId: R.id, message: A, signal: j }), userInput: async (A) => f.input({ input: A, signal: j }), setSubmission: (A, T) => {
529
+ j.aborted || f.setSubmission(A, T);
530
530
  }, captcha: f.captcha }, next: (A) => {
531
- if ($.aborted)
531
+ if (j.aborted)
532
532
  return;
533
- let B = (G == null ? void 0 : G.fileQuestionNodeId) === N.id ? G.submitNodeId : A, q = B ? e.nodes.find((U) => U.id === B) : xs({ childNode: N, nodes: e.nodes });
534
- return q ? T(q, N) : _ == null ? void 0 : _(N);
533
+ let T = (z == null ? void 0 : z.fileQuestionNodeId) === R.id ? z.submitNodeId : A, $ = T ? e.nodes.find((K) => K.id === T) : ws({ childNode: R, nodes: e.nodes });
534
+ return $ ? L($, R) : k == null ? void 0 : k(R);
535
535
  }, end: () => {
536
- $.aborted || (_ == null || _(N));
536
+ j.aborted || (k == null || k(R));
537
537
  } });
538
538
  } catch (A) {
539
539
  if (A instanceof jr)
@@ -541,83 +541,83 @@ var Gr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
541
541
  throw A;
542
542
  }
543
543
  };
544
- return { interpret: async (N) => {
545
- let O = e.nodes.find(($) => $.id === N) ?? Kr(e.nodes);
546
- return T(O);
547
- }, undo: (N) => {
548
- var B;
549
- if (delete e.data.reviewReplay, ((B = e.data.startedWriteNodeIds) == null ? void 0 : B.length) || e.data.isFinished)
544
+ return { interpret: async (R) => {
545
+ let W = e.nodes.find((j) => j.id === R) ?? Kr(e.nodes);
546
+ return L(W);
547
+ }, undo: (R) => {
548
+ var T;
549
+ if (delete e.data.reviewReplay, ((T = e.data.startedWriteNodeIds) == null ? void 0 : T.length) || e.data.isFinished)
550
550
  return { removed: 0 };
551
- let O = Wt(e), $ = O ? N.lastIndexOf(O) : -1, P = e.nodes.find((q) => q.id === O);
552
- if ($ === -1 || !P)
551
+ let W = Wt(e), j = W ? R.lastIndexOf(W) : -1, O = e.nodes.find(($) => $.id === W);
552
+ if (j === -1 || !O)
553
553
  return { removed: 0 };
554
- let G = e.nodes.find((q) => q.id === N[N.length - 1]);
555
- F.abort();
556
- let M = N.splice($);
557
- e.data.messages = e.data.messages.filter((q) => !q.groupId || !M.includes(q.groupId)), e.data.currentInput = null;
554
+ let z = e.nodes.find(($) => $.id === R[R.length - 1]);
555
+ E.abort();
556
+ let V = R.splice(j);
557
+ e.data.messages = e.data.messages.filter(($) => !$.groupId || !V.includes($.groupId)), e.data.currentInput = null;
558
558
  let A = a();
559
- for (let q of M.slice(1)) {
560
- let U = e.nodes.find((j) => j.id === q);
561
- if (!(!U || !A || U.id === O) && ("key" in U.data && U.data.key && delete A[U.data.key], "keys" in U.data))
562
- for (let j of Object.values(U.data.keys))
563
- typeof j == "string" && delete A[j];
559
+ for (let $ of V.slice(1)) {
560
+ let K = e.nodes.find((Z) => Z.id === $);
561
+ if (!(!K || !A || K.id === W) && ("key" in K.data && K.data.key && delete A[K.data.key], "keys" in K.data))
562
+ for (let Z of Object.values(K.data.keys))
563
+ typeof Z == "string" && delete A[Z];
564
564
  }
565
- return F = new AbortController(), T(P, G), { removed: M.length };
565
+ return E = new AbortController(), L(O, z), { removed: V.length };
566
566
  }, abort: () => {
567
- F.abort();
567
+ E.abort();
568
568
  } };
569
569
  };
570
- async function ks(e) {
570
+ async function Cs(e) {
571
571
  let r = e.node;
572
572
  switch (r.type) {
573
573
  case "flow-section":
574
574
  return await e.chat.sendMessage({ type: "system", variant: "info", text: r.data.title }), e.next(r.nextId);
575
575
  case "pre-apply-result":
576
- return Ws({ ...e, node: r });
576
+ return zs({ ...e, node: r });
577
577
  case "text":
578
- return Ns({ ...e, node: r });
578
+ return Ds({ ...e, node: r });
579
579
  case "image":
580
- return Rs({ ...e, node: r });
581
- case "question-text":
582
580
  return Ts({ ...e, node: r });
581
+ case "question-text":
582
+ return Os({ ...e, node: r });
583
583
  case "question-enum":
584
- return js({ ...e, node: r });
584
+ return $s({ ...e, node: r });
585
585
  case "question-number":
586
- return Os({ ...e, node: r });
587
- case "question-phone":
588
586
  return Bs({ ...e, node: r });
587
+ case "question-phone":
588
+ return js({ ...e, node: r });
589
589
  case "question-boolean":
590
590
  return Ps({ ...e, node: r });
591
591
  case "question-file":
592
- return qs({ ...e, node: r });
592
+ return Us({ ...e, node: r });
593
593
  case "question-address":
594
- return $s({ ...e, node: r });
594
+ return qs({ ...e, node: r });
595
595
  case "end-flow":
596
- return Us({ ...e, node: r });
596
+ return Ws({ ...e, node: r });
597
597
  case "if-block":
598
- return Ds({ ...e, node: r });
598
+ return Rs({ ...e, node: r });
599
599
  case "jump":
600
- return Es({ ...e, node: r });
600
+ return As({ ...e, node: r });
601
601
  case "link":
602
- return Ls({ ...e, node: r });
602
+ return Ns({ ...e, node: r });
603
603
  case "integration-application-submit":
604
- return Ms({ ...e, node: r });
604
+ return Ls({ ...e, node: r });
605
605
  case "add-submission":
606
- return As({ ...e, node: r });
606
+ return Es({ ...e, node: r });
607
607
  case "integration-workflow-get":
608
608
  throw Error("Workflow should be unreachable");
609
609
  case "check-duplicate":
610
- return Ss({ ...e, node: r });
610
+ return Is({ ...e, node: r });
611
611
  case "feedback":
612
- return Cs({ ...e, node: r });
612
+ return Ss({ ...e, node: r });
613
613
  default:
614
614
  throw new Error(`Unknown node: ${JSON.stringify(r)}`);
615
615
  }
616
616
  }
617
- async function Cs({ next: e, node: r }) {
617
+ async function Ss({ next: e, node: r }) {
618
618
  e(r.nextId);
619
619
  }
620
- async function Ss({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
620
+ async function Is({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
621
621
  var u;
622
622
  let o = { isDuplicate: !1 };
623
623
  if (n && t) {
@@ -625,147 +625,152 @@ async function Ss({ next: e, node: r, talentBankClient: t, submissions: n, flow:
625
625
  if (r.data.scope === "company" || f != null)
626
626
  try {
627
627
  o = await t.checkDuplicate({ email: An({ key: r.data.email, submissions: n }).toString(), jobId: f, scope: r.data.scope });
628
- } catch (g) {
629
- i.error("[check-duplicate]", g);
628
+ } catch (b) {
629
+ i.error("[check-duplicate]", b);
630
630
  }
631
631
  }
632
632
  a.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
633
633
  }
634
- async function Es({ next: e, node: r }) {
634
+ async function As({ next: e, node: r }) {
635
635
  e(r.data.targetId);
636
636
  }
637
- async function As({ next: e, node: r, logger: t, submissions: n, context: s }) {
637
+ async function Es({ next: e, node: r, logger: t, submissions: n, context: s }) {
638
638
  if (!n) {
639
639
  t.error("Submissions not found");
640
640
  return;
641
641
  }
642
642
  n[r.data.key] = { type: "string", value: he(r.data.value, { submissions: n, context: s }) }, e(r.nextId);
643
643
  }
644
- var Is = 5e3, Fs = (e, r, t) => {
645
- let { waitMs: n, throttles: s, maintenance: i } = $n(r == null ? void 0 : r.throttles, t);
644
+ var Fs = 5e3, Vs = (e, r, t) => {
645
+ let { waitMs: n, throttles: s, maintenance: i } = qn(r == null ? void 0 : r.throttles, t);
646
646
  return { key: e, until: Date.now() + n, ...s !== void 0 && { throttles: s }, ...i && { maintenance: i } };
647
- }, Vs = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], Zr = (e) => e instanceof Error && Vs.includes(e.name) ? e : void 0, cr = (e) => {
647
+ }, Ms = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], Zr = (e) => e instanceof Error && Ms.includes(e.name) ? e : void 0, cr = (e) => {
648
648
  let r = Zr(e);
649
649
  return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
650
650
  };
651
- async function Ms({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: u, applicationRecovery: f, setApplicationRecovery: g, forceSubmitConfirmation: y, run: p, persistWriteBarrier: m, signal: _, onSubmitNetworkError: E, closedRoleBehaviour: C, t: x }) {
652
- var T;
653
- if ((T = u.data.startedWriteNodeIds) != null && T.includes(n.id) && (f == null ? void 0 : f.submitNodeId) !== n.id)
654
- return await e.sendMessage({ type: "system", variant: "warning", text: x("submission_unknown") }), t();
655
- let b = u.job ? `${n.id}@${u.job.id_type}:${u.job.id}` : n.id, F = 0, L = p.submitAccepted && n.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== n.id, V = async (N) => {
656
- var rt, qe, Ue, pt, nt, mt, st, at;
657
- let O = ((rt = u.data.submitCooldown) == null ? void 0 : rt.key) === b ? u.data.submitCooldown : void 0;
658
- O && (O.until = Math.min(O.until, Date.now() + (O.maintenance ? Vn : O.throttles ? $r : Mn)));
659
- let $ = O == null ? void 0 : O.until;
660
- (u.data.reviewRequiresSend === !0 && !L || N !== !0 || $ !== void 0 && $ > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: n.data.submitLabel, ...$ !== void 0 && { availableAt: $ } } }), L = !1;
661
- let P;
651
+ async function Ls({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: u, applicationRecovery: f, setApplicationRecovery: b, forceSubmitConfirmation: y, run: p, persistWriteBarrier: m, signal: k, onSubmitNetworkError: I, closedRoleBehaviour: C, t: x }) {
652
+ var R, W;
653
+ let v = async ({ redirect_url: j, message: O, button_text: z }) => {
654
+ let { anonymous_id: V, session_id: A } = o.getSessionInfo();
655
+ await e.sendMessage({ type: "text", author: "bot", text: O ?? x("submission_redirect_message") });
656
+ try {
657
+ let T = new URL(j);
658
+ V && !T.searchParams.has("anonymous_id") && T.searchParams.set("anonymous_id", V), await e.sendMessage({ type: "link", href: T.toString(), text: z ?? x("complete_submission"), onClick: () => {
659
+ if (!A) {
660
+ s.error("session_id not set, cannot log FLOW_REDIRECT event");
661
+ return;
662
+ }
663
+ o.log({ event: "FLOW_REDIRECT", properties: { flow_build: u.build, flow_id: u.id, flow_session_id: A, flow_version: u.version, href: T.toString(), job: u.job } });
664
+ } });
665
+ } catch (T) {
666
+ s.error(`Invalid redirect URL: ${j}`, T), e.sendMessage({ type: "system", variant: "error", text: x("redirect_url_error") });
667
+ }
668
+ };
669
+ if ((R = u.data.startedWriteNodeIds) != null && R.includes(n.id) && (f == null ? void 0 : f.submitNodeId) !== n.id) {
670
+ let j = (W = u.data.submitRedirects) == null ? void 0 : W[n.id];
671
+ return j ? (await v(j), r(n.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: x("submission_unknown") }), t());
672
+ }
673
+ let E = u.job ? `${n.id}@${u.job.id_type}:${u.job.id}` : n.id, N = 0, M = p.submitAccepted && n.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== n.id, L = async (j) => {
674
+ var ft, et, ht, tt, rt, pt, mt, It;
675
+ let O = ((ft = u.data.submitCooldown) == null ? void 0 : ft.key) === E ? u.data.submitCooldown : void 0;
676
+ O && (O.until = Math.min(O.until, Date.now() + (O.maintenance ? Vn : O.throttles ? Pr : Mn)));
677
+ let z = O == null ? void 0 : O.until;
678
+ (u.data.reviewRequiresSend === !0 && !M || j !== !0 || z !== void 0 && z > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: n.data.submitLabel, ...z !== void 0 && { availableAt: z } } }), M = !1;
679
+ let V;
662
680
  if (n.data.captcha) {
663
- let D = e.captcha, ue = !0;
681
+ let D = e.captcha, l = !0;
664
682
  try {
665
- P = await es(i, { signal: _, container: (D == null ? void 0 : D.container()) ?? null, theme: D == null ? void 0 : D.theme, onInteractive: () => {
683
+ V = await ts(i, { signal: k, container: (D == null ? void 0 : D.container()) ?? null, theme: D == null ? void 0 : D.theme, onInteractive: () => {
666
684
  e.sendMessage({ type: "text", author: "bot", text: x("captcha_check") }).catch(() => {
667
685
  }).then(() => {
668
- ue && (D == null || D.reveal(!0));
686
+ l && (D == null || D.reveal(!0));
669
687
  });
670
688
  } });
671
- } catch (yt) {
672
- if (s.error("Captcha check failed", yt), _.aborted)
689
+ } catch (d) {
690
+ if (s.error("Captcha check failed", d), k.aborted)
673
691
  return;
674
692
  } finally {
675
- ue = !1, D == null || D.reveal(!1);
693
+ l = !1, D == null || D.reveal(!1);
676
694
  }
677
695
  }
678
696
  await e.sendMessage({ type: "loading", text: x("submitting") });
679
- let { anonymous_id: G, session_id: M } = o.getSessionInfo();
680
- if (_.aborted)
697
+ let { anonymous_id: A, session_id: T } = o.getSessionInfo();
698
+ if (k.aborted)
681
699
  return;
682
- let A = ((qe = u.data.startedWriteNodeIds) == null ? void 0 : qe.includes(n.id)) === !0;
683
- if ((f == null ? void 0 : f.submitNodeId) === n.id && await g(void 0), A || (u.data.startedWriteNodeIds = [...u.data.startedWriteNodeIds ?? [], n.id]), await m().catch((D) => s.error("Failed to persist application write barrier", D)), _.aborted)
700
+ let $ = ((et = u.data.startedWriteNodeIds) == null ? void 0 : et.includes(n.id)) === !0;
701
+ if ((f == null ? void 0 : f.submitNodeId) === n.id && await b(void 0), $ || (u.data.startedWriteNodeIds = [...u.data.startedWriteNodeIds ?? [], n.id]), await m().catch((D) => s.error("Failed to persist application write barrier", D)), k.aborted)
684
702
  return;
685
- let B, q = setTimeout(() => {
686
- B = (async () => {
703
+ let K, Z = setTimeout(() => {
704
+ K = (async () => {
687
705
  await e.sendMessage({ type: "text", author: "bot", text: x("submission_still_working") }), await e.sendMessage({ type: "loading", text: x("submitting") });
688
706
  })().catch((D) => s.error("Failed to send submission progress message", D));
689
- }, Is), U, j = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: n.data.integrationId, anonymous_id: G, session_id: M, job: u.job, flow_build: u.build, ...P !== void 0 && { captcha_token: P }, submissions: Ln(u.nodes, Dn(a || {}, n.data.submitKeys)), pre_apply: Pr(u.nodes, a || {}, u.data.flowSessionId) }) }).catch((D) => {
690
- U = D;
691
- let ue = cr(D);
692
- return (ue == null ? void 0 : ue.data) !== void 0 ? ue.data : D;
707
+ }, Fs), le, G = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: n.data.integrationId, anonymous_id: A, session_id: T, job: u.job, flow_build: u.build, ...V !== void 0 && { captcha_token: V }, submissions: Ln(u.nodes, Nn(a || {}, n.data.submitKeys)), pre_apply: $r(u.nodes, a || {}, u.data.flowSessionId) }) }).catch((D) => {
708
+ le = D;
709
+ let l = cr(D);
710
+ return (l == null ? void 0 : l.data) !== void 0 ? l.data : D;
693
711
  });
694
- if (clearTimeout(q), await B, _.aborted)
712
+ if (clearTimeout(Z), await K, k.aborted)
695
713
  return;
696
- if (U !== void 0 && !Zr(U) && E)
697
- return await E(U, _), V(!0);
698
- n.data.key && e.setSubmission(n.data.key, { type: "integration", value: j });
699
- let Se = (Ue = cr(U)) == null ? void 0 : Ue.status, R = Br(j, typeof Se == "number" ? Se : void 0), ce = u.data.failedAttemptAt, Ee = ce == null ? void 0 : ce[b];
700
- ce && Ee !== void 0 && Ee > Date.now() && (Ee = ce[b] = Date.now());
701
- let et = Ee !== void 0 && Date.now() - Ee < Nn || ((pt = u.data.unconfirmedAttemptKeys) == null ? void 0 : pt.includes(b)) === !0, Re = Rn(j);
702
- Re && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: u.id, flow_version: u.version, flow_session_id: u.data.flowSessionId, flow_build: u.build, service: Re.service, response: Re.response, flow_type: "CHATBOT_DRAWER", job: u.job, ...(R == null ? void 0 : R.outcome) === "duplicate" && { outcome: et ? "duplicate_after_own_attempt" : "duplicate" }, ...Re.outcome && { outcome: Re.outcome } } });
703
- let tt = rr(j) || (j == null ? void 0 : j.success) === !0;
704
- if ((tt || nr(j)) && (p.submitAccepted = !0), tt && ((nt = u.data.submitCooldown) == null ? void 0 : nt.throttles) !== void 0 && (delete u.data.submitCooldown.throttles, await m().catch((D) => s.error("Failed to persist submit cooldown reset", D))), rr(j)) {
705
- let { redirect_url: D, message: ue, button_text: yt } = j.integration_response.data;
706
- await e.sendMessage({ type: "text", author: "bot", text: ue ?? x("submission_redirect_message") });
707
- try {
708
- let be = new URL(D);
709
- G && !be.searchParams.has("anonymous_id") && be.searchParams.set("anonymous_id", G), await e.sendMessage({ type: "link", href: be.toString(), text: yt ?? x("complete_submission"), onClick: () => {
710
- if (!M) {
711
- s.error("session_id not set, cannot log FLOW_REDIRECT event");
712
- return;
713
- }
714
- o.log({ event: "FLOW_REDIRECT", properties: { flow_build: u.build, flow_id: u.id, flow_session_id: M, flow_version: u.version, href: be.toString(), job: u.job } });
715
- } });
716
- } catch (be) {
717
- s.error(`Invalid redirect URL: ${D}`, be), e.sendMessage({ type: "system", variant: "error", text: x("redirect_url_error") });
718
- }
719
- return r(n.nextId);
714
+ if (le !== void 0 && !Zr(le) && I)
715
+ return await I(le, k), L(!0);
716
+ n.data.key && e.setSubmission(n.data.key, { type: "integration", value: G });
717
+ let Ce = (ht = cr(le)) == null ? void 0 : ht.status, Qe = typeof Ce == "number" ? Ce : void 0, B = Br(G, Qe), Te = u.data.failedAttemptAt, Se = Te == null ? void 0 : Te[E];
718
+ Te && Se !== void 0 && Se > Date.now() && (Se = Te[E] = Date.now());
719
+ let ut = Se !== void 0 && Date.now() - Se < Rn || ((tt = u.data.unconfirmedAttemptKeys) == null ? void 0 : tt.includes(E)) === !0, Ie = Dn(G);
720
+ Ie && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: u.id, flow_version: u.version, flow_session_id: u.data.flowSessionId, flow_build: u.build, service: Ie.service, response: Ie.response, flow_type: "CHATBOT_DRAWER", job: u.job, ...(B == null ? void 0 : B.outcome) === "duplicate" && { outcome: ut ? "duplicate_after_own_attempt" : "duplicate" }, ...Ie.outcome && { outcome: Ie.outcome } } });
721
+ let dt = rr(G) || (G == null ? void 0 : G.success) === !0;
722
+ if ((dt || nr(G)) && (p.submitAccepted = !0), dt && ((rt = u.data.submitCooldown) == null ? void 0 : rt.throttles) !== void 0 && (delete u.data.submitCooldown.throttles, await m().catch((D) => s.error("Failed to persist submit cooldown reset", D))), rr(G)) {
723
+ let { redirect_url: D, message: l, button_text: d } = G.integration_response.data, h = { redirect_url: D, message: l, button_text: d };
724
+ return k.aborted ? void 0 : (u.data.submitRedirects = { ...u.data.submitRedirects, [n.id]: h }, await m().catch((_) => s.error("Failed to persist submit redirect", _)), await v(h), r(n.nextId));
720
725
  }
721
- let ht = nr(j);
722
- if (ht)
723
- return await e.sendMessage({ type: "system", variant: "success", text: ht.message ?? x("submission_pending") }), r(n.nextId);
724
- if ((j == null ? void 0 : j.success) === !0)
726
+ let Pe = nr(G);
727
+ if (Pe)
728
+ return await e.sendMessage({ type: "system", variant: "success", text: Pe.message ?? x("submission_pending") }), r(n.nextId);
729
+ if ((G == null ? void 0 : G.success) === !0)
725
730
  return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: x("submission_completed") }), r(n.nextId);
726
- let Pe = Tn(R), $e = Pe !== void 0 && ((mt = a == null ? void 0 : a[Pe]) == null ? void 0 : mt.type) === "file" ? Pe : void 0, Ae = $e === void 0 ? void 0 : u.nodes.find((D) => D.type === "question-file" && D.data.key === $e);
727
- if (!Ae && !(C === "terminal" && (R == null ? void 0 : R.outcome) === "closed") && !sr(R) && (u.data.submitCooldown = Fs(b, O, R)), (R == null ? void 0 : R.outcome) !== "duplicate" && (u.data.failedAttemptAt = { ...u.data.failedAttemptAt, [b]: Date.now() }, (st = u.data.unconfirmedAttemptKeys) != null && st.includes(b) && (u.data.unconfirmedAttemptKeys = u.data.unconfirmedAttemptKeys.filter((D) => D !== b))), (R == null ? void 0 : R.verdict) === "not_submitted" || (R == null ? void 0 : R.outcome) === "duplicate" || (R == null ? void 0 : R.outcome) === "closed" ? (A || (u.data.startedWriteNodeIds = (at = u.data.startedWriteNodeIds) == null ? void 0 : at.filter((D) => D !== n.id)), (f == null ? void 0 : f.submitNodeId) === n.id && await g(f), await m().catch((D) => s.error("Failed to persist application write barrier release", D))) : await m().catch((D) => s.error("Failed to persist submit cooldown", D)), R) {
728
- if (s.error(U ?? R.message), Ae && $e !== void 0)
729
- return e.setSubmission($e, null), await g({ fileQuestionNodeId: Ae.id, submitNodeId: n.id }), await e.sendMessage({ type: "system", variant: "error", text: x("submission_unreadable_document") }), r(Ae.id);
730
- if (R.outcome === "duplicate")
731
- return await e.sendMessage({ type: "system", variant: "info", text: x(et ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), V(!1);
732
- if (R.outcome === "closed")
733
- return await e.sendMessage({ type: "system", variant: "info", text: x("submission_closed") }), C === "terminal" ? (delete u.data.submitCooldown, t()) : V(!1);
734
- let D = On(R);
735
- return D ? (await e.sendMessage({ type: "system", variant: "warning", text: D.until === void 0 ? x("submission_provider_maintenance_later") : x("submission_provider_maintenance", { time: qr(D.until, void 0) }) }), V(!1)) : R.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: x(Bn(R) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), V(!1)) : sr(R) ? jn(j) ? (await e.sendMessage({ type: "text", author: "bot", text: R.message }), V(!1)) : (F === 0 && await e.sendMessage({ type: "system", variant: "warning", text: x("captcha_failed") }), F++, V(F <= ws)) : Pn(R) ? (await e.sendMessage({ type: "system", variant: "error", text: x("submission_retryable") }), V(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: x("submission_failed") }), t());
731
+ let qe = Tn(B), Ae = qe !== void 0 && ((pt = a == null ? void 0 : a[qe]) == null ? void 0 : pt.type) === "file" ? qe : void 0, Ee = Ae === void 0 ? void 0 : u.nodes.find((D) => D.type === "question-file" && D.data.key === Ae);
732
+ if (!Ee && !(C === "terminal" && (B == null ? void 0 : B.outcome) === "closed") && !sr(B) && (u.data.submitCooldown = Vs(E, O, B)), (B == null ? void 0 : B.outcome) !== "duplicate" && (u.data.failedAttemptAt = { ...u.data.failedAttemptAt, [E]: Date.now() }, (mt = u.data.unconfirmedAttemptKeys) != null && mt.includes(E) && (u.data.unconfirmedAttemptKeys = u.data.unconfirmedAttemptKeys.filter((D) => D !== E))), (B == null ? void 0 : B.verdict) === "not_submitted" || (B == null ? void 0 : B.outcome) === "duplicate" || (B == null ? void 0 : B.outcome) === "closed" || On(G, Qe) ? ($ || (u.data.startedWriteNodeIds = (It = u.data.startedWriteNodeIds) == null ? void 0 : It.filter((D) => D !== n.id)), (f == null ? void 0 : f.submitNodeId) === n.id && await b(f), await m().catch((D) => s.error("Failed to persist application write barrier release", D))) : await m().catch((D) => s.error("Failed to persist submit cooldown", D)), B) {
733
+ if (s.error(le ?? B.message), Ee && Ae !== void 0)
734
+ return e.setSubmission(Ae, null), await b({ fileQuestionNodeId: Ee.id, submitNodeId: n.id }), await e.sendMessage({ type: "system", variant: "error", text: x("submission_unreadable_document") }), r(Ee.id);
735
+ if (B.outcome === "duplicate")
736
+ return await e.sendMessage({ type: "system", variant: "info", text: x(ut ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), L(!1);
737
+ if (B.outcome === "closed")
738
+ return await e.sendMessage({ type: "system", variant: "info", text: x("submission_closed") }), C === "terminal" ? (delete u.data.submitCooldown, t()) : L(!1);
739
+ let D = Bn(B);
740
+ return D ? (await e.sendMessage({ type: "system", variant: "warning", text: D.until === void 0 ? x("submission_provider_maintenance_later") : x("submission_provider_maintenance", { time: qr(D.until, void 0) }) }), L(!1)) : B.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: x(jn(B) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), L(!1)) : sr(B) ? $n(G) ? (await e.sendMessage({ type: "text", author: "bot", text: B.message }), L(!1)) : (N === 0 && await e.sendMessage({ type: "system", variant: "warning", text: x("captcha_failed") }), N++, L(N <= _s)) : Pn(B) ? (await e.sendMessage({ type: "system", variant: "error", text: x("submission_retryable") }), L(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: x("submission_failed") }), t());
736
741
  }
737
- return s.error(U ?? j), await e.sendMessage({ type: "system", variant: "error", text: x("submission_failed") }), t();
742
+ return s.error(le ?? G), await e.sendMessage({ type: "system", variant: "error", text: x("submission_failed") }), t();
738
743
  };
739
- await V(y === !0 && !L ? !1 : n.data.skipConfirmation);
744
+ await L(y === !0 && !M ? !1 : n.data.skipConfirmation);
740
745
  }
741
- async function Ls({ chat: e, next: r, node: t, submissions: n, context: s }) {
746
+ async function Ns({ chat: e, next: r, node: t, submissions: n, context: s }) {
742
747
  await e.sendMessage({ type: "link", href: he(t.data.href, { submissions: n, context: s }), text: he(t.data.cta, { submissions: n, context: s }) }), r(t.nextId);
743
748
  }
744
- async function Ds({ submissions: e, next: r, node: t, context: n }) {
745
- r(vs(t, { submissions: e, context: n }) ? t.branchId : t.nextId);
749
+ async function Rs({ submissions: e, next: r, node: t, context: n }) {
750
+ r(xs(t, { submissions: e, context: n }) ? t.branchId : t.nextId);
746
751
  }
747
- async function Ns({ chat: e, next: r, node: t, submissions: n, context: s }) {
752
+ async function Ds({ chat: e, next: r, node: t, submissions: n, context: s }) {
748
753
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.text, { submissions: n, context: s }) }), r(t.nextId);
749
754
  }
750
- async function Rs({ chat: e, next: r, node: t }) {
755
+ async function Ts({ chat: e, next: r, node: t }) {
751
756
  await e.sendMessage({ author: "bot", type: "image", url: t.data.url, height: t.data.height, width: t.data.width }), r(t.nextId);
752
757
  }
753
- async function Ts({ chat: e, next: r, node: t, submissions: n, context: s, t: i, dateEchoLocale: a }) {
758
+ async function Os({ chat: e, next: r, node: t, submissions: n, context: s, t: i, dateEchoLocale: a }) {
754
759
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
755
760
  let o = t.data.format === "phone" ? await e.userInput({ key: t.data.key, type: "phone", config: { optional: t.data.optional, placeholder: t.data.placeholder, minChars: t.data.minChars, maxChars: t.data.maxChars, submissionFormat: "text", defaultValue: {} } }) : await e.userInput({ key: t.data.key, type: "text", config: { optional: t.data.optional, placeholder: t.data.placeholder, format: t.data.format, maxChars: t.data.maxChars, minChars: t.data.minChars, multiline: t.data.format === "text" && t.data.multiline === !0 } });
756
- o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? xt(o.value) : t.data.format === "date" && a !== void 0 ? In(o.value, a) : o.value }), r(t.nextId);
761
+ o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && a !== void 0 ? En(o.value, a) : o.value }), r(t.nextId);
757
762
  }
758
- async function Os({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
763
+ async function Bs({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
759
764
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
760
765
  let a = await e.userInput({ key: t.data.key, type: "number", config: { max: t.data.max, min: t.data.min, optional: t.data.optional, placeholder: t.data.placeholder, decimalCases: t.data.decimalCases } });
761
766
  a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value.toString() }), r(t.nextId);
762
767
  }
763
- async function Bs({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
768
+ async function js({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
764
769
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
765
770
  let a = await e.userInput({ key: t.data.key, type: "phone", config: { minChars: t.data.minChars, defaultValue: { countryCode: t.data.defaultCountryCode }, placeholder: t.data.placeholder, submissionFormat: "phone", optional: t.data.optional } });
766
- a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? xt(a.value) : a.value }), r(t.nextId);
771
+ a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? vt(a.value) : a.value }), r(t.nextId);
767
772
  }
768
- async function js({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
773
+ async function $s({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
769
774
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
770
775
  let a = await e.userInput({ key: t.data.key, type: "multiple-choice", config: t.data });
771
776
  a.value.length === 0 ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: t.data.options.filter((o) => a.value.includes(o.value)).map((o) => o.label).join(", ") }), r(t.nextId);
@@ -775,7 +780,7 @@ async function Ps({ chat: e, next: r, node: t, submissions: n, context: s, t: i
775
780
  let a = await e.userInput({ key: t.data.key, type: "boolean", config: { optional: t.data.optional, labels: { true: t.data.trueLabel, false: t.data.falseLabel } } });
776
781
  a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
777
782
  }
778
- async function $s({ chat: e, next: r, node: t, t: n }) {
783
+ async function qs({ chat: e, next: r, node: t, t: n }) {
779
784
  await e.sendMessage({ author: "bot", type: "text", text: t.data.question });
780
785
  let s = await e.userInput({ type: "address", key: t.data.key, config: { optional: t.data.optional, keys: t.data.keys, line2Required: t.data.line2Required, placeholder: t.data.placeholder } });
781
786
  if (s === null)
@@ -786,7 +791,7 @@ async function $s({ chat: e, next: r, node: t, t: n }) {
786
791
  }
787
792
  return r(t.nextId);
788
793
  }
789
- async function qs({ node: e, chat: r, next: t, submissions: n, context: s, t: i }) {
794
+ async function Us({ node: e, chat: r, next: t, submissions: n, context: s, t: i }) {
790
795
  await r.sendMessage({ author: "bot", type: "text", text: he(e.data.question, { submissions: n, context: s }) });
791
796
  let a = await r.userInput({ key: e.data.key, type: "file", config: { optional: e.data.optional, extensions: e.data.extensions, fileSizeLimitKib: e.data.maxSizeKb ?? 10 * 1024, allowMultiple: e.data.multiple === !0 } });
792
797
  if (a === null)
@@ -796,17 +801,17 @@ async function qs({ node: e, chat: r, next: t, submissions: n, context: s, t: i
796
801
  await r.sendMessage({ author: "user", type: "file", fileName: o.name, fileSizeKb: o.sizeKb });
797
802
  return t(e.nextId);
798
803
  }
799
- async function Us({ chat: e, end: r, node: t }) {
804
+ async function Ws({ chat: e, end: r, node: t }) {
800
805
  await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
801
806
  }
802
- async function Ws({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context: u }) {
803
- let f = Fn(r.nodes, t || {}), { answers: g, ...y } = f;
804
- if (n.setSubmission(e.data.key, { type: "integration", value: y }), bs(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: Pr(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
807
+ async function zs({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context: u }) {
808
+ let f = Fn(r.nodes, t || {}), { answers: b, ...y } = f;
809
+ if (n.setSubmission(e.data.key, { type: "integration", value: y }), vs(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: $r(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
805
810
  let p = [f.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : f.hasHardConcerns ? e.data.messages.hard : f.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
806
811
  for (let m of ["hard", "advisory"]) {
807
- let _ = g.filter((E) => !E.matched && E.severity === m);
808
- _.length && p.push((m === "hard" ? "Role requirements" : "Other things to consider") + `
809
- ` + _.map((E) => `• ${E.message}`).join(`
812
+ let k = b.filter((I) => !I.matched && I.severity === m);
813
+ k.length && p.push((m === "hard" ? "Role requirements" : "Other things to consider") + `
814
+ ` + k.map((I) => `• ${I.message}`).join(`
810
815
  `));
811
816
  }
812
817
  await n.sendMessage({ type: "text", author: "bot", text: p.join(`
@@ -829,7 +834,7 @@ const ur = (e, r, t) => {
829
834
  },
830
835
  customProperties: (n = r.analytics) == null ? void 0 : n.customProperties
831
836
  });
832
- }, jt = "resume-prompt", zs = async ({
837
+ }, jt = "resume-prompt", Hs = async ({
833
838
  chatService: e,
834
839
  t: r,
835
840
  signal: t
@@ -857,16 +862,16 @@ const ur = (e, r, t) => {
857
862
  },
858
863
  signal: t
859
864
  });
860
- return H.removeMessagesSentByNodeIds([jt]), (n == null ? void 0 : n.value) !== !1;
861
- }, je = ({
865
+ return U.removeMessagesSentByNodeIds([jt]), (n == null ? void 0 : n.value) !== !1;
866
+ }, $e = ({
862
867
  class: e,
863
868
  ...r
864
869
  }) => {
865
870
  const {
866
871
  t
867
- } = te();
872
+ } = re();
868
873
  return c("button", {
869
- class: Xe("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", e),
874
+ class: Ze("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", e),
870
875
  type: "submit",
871
876
  ...r,
872
877
  children: c("svg", {
@@ -888,40 +893,40 @@ const ur = (e, r, t) => {
888
893
  })
889
894
  });
890
895
  };
891
- var ve;
896
+ var ge;
892
897
  // @__NO_SIDE_EFFECTS__
893
- function _t(e) {
898
+ function wt(e) {
894
899
  return {
895
- lang: (e == null ? void 0 : e.lang) ?? (ve == null ? void 0 : ve.lang),
900
+ lang: (e == null ? void 0 : e.lang) ?? (ge == null ? void 0 : ge.lang),
896
901
  message: e == null ? void 0 : e.message,
897
- abortEarly: (e == null ? void 0 : e.abortEarly) ?? (ve == null ? void 0 : ve.abortEarly),
898
- abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (ve == null ? void 0 : ve.abortPipeEarly)
902
+ abortEarly: (e == null ? void 0 : e.abortEarly) ?? (ge == null ? void 0 : ge.abortEarly),
903
+ abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (ge == null ? void 0 : ge.abortPipeEarly)
899
904
  };
900
905
  }
901
906
  var Mt;
902
907
  // @__NO_SIDE_EFFECTS__
903
- function Hs(e) {
908
+ function Ks(e) {
904
909
  return Mt == null ? void 0 : Mt.get(e);
905
910
  }
906
911
  var Lt;
907
912
  // @__NO_SIDE_EFFECTS__
908
- function Ks(e) {
913
+ function Gs(e) {
909
914
  return Lt == null ? void 0 : Lt.get(e);
910
915
  }
911
- var Dt;
916
+ var Nt;
912
917
  // @__NO_SIDE_EFFECTS__
913
- function Gs(e, r) {
918
+ function Js(e, r) {
914
919
  var t;
915
- return (t = Dt == null ? void 0 : Dt.get(e)) == null ? void 0 : t.get(r);
920
+ return (t = Nt == null ? void 0 : Nt.get(e)) == null ? void 0 : t.get(r);
916
921
  }
917
922
  // @__NO_SIDE_EFFECTS__
918
- function Je(e) {
923
+ function Ge(e) {
919
924
  var t, n;
920
925
  const r = typeof e;
921
926
  return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((n = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : n.name)) ?? "null" : r;
922
927
  }
923
- function ee(e, r, t, n, s) {
924
- const i = s && "input" in s ? s.input : t.value, a = (s == null ? void 0 : s.expected) ?? e.expects ?? null, o = (s == null ? void 0 : s.received) ?? /* @__PURE__ */ Je(i), u = {
928
+ function te(e, r, t, n, s) {
929
+ const i = s && "input" in s ? s.input : t.value, a = (s == null ? void 0 : s.expected) ?? e.expects ?? null, o = (s == null ? void 0 : s.received) ?? /* @__PURE__ */ Ge(i), u = {
925
930
  kind: e.kind,
926
931
  type: e.type,
927
932
  input: i,
@@ -934,33 +939,33 @@ function ee(e, r, t, n, s) {
934
939
  lang: n.lang,
935
940
  abortEarly: n.abortEarly,
936
941
  abortPipeEarly: n.abortPipeEarly
937
- }, f = e.kind === "schema", g = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ Gs(e.reference, u.lang) ?? (f ? /* @__PURE__ */ Ks(u.lang) : null) ?? n.message ?? /* @__PURE__ */ Hs(u.lang);
938
- g !== void 0 && (u.message = typeof g == "function" ? (
942
+ }, f = e.kind === "schema", b = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ Js(e.reference, u.lang) ?? (f ? /* @__PURE__ */ Gs(u.lang) : null) ?? n.message ?? /* @__PURE__ */ Ks(u.lang);
943
+ b !== void 0 && (u.message = typeof b == "function" ? (
939
944
  // @ts-expect-error
940
- g(u)
941
- ) : g), f && (t.typed = !1), t.issues ? t.issues.push(u) : t.issues = [u];
945
+ b(u)
946
+ ) : b), f && (t.typed = !1), t.issues ? t.issues.push(u) : t.issues = [u];
942
947
  }
943
948
  // @__NO_SIDE_EFFECTS__
944
- function ge(e) {
949
+ function be(e) {
945
950
  return {
946
951
  version: 1,
947
952
  vendor: "valibot",
948
953
  validate(r) {
949
- return e["~run"]({ value: r }, /* @__PURE__ */ _t());
954
+ return e["~run"]({ value: r }, /* @__PURE__ */ wt());
950
955
  }
951
956
  };
952
957
  }
953
958
  // @__NO_SIDE_EFFECTS__
954
- function Js(e, r) {
959
+ function Zs(e, r) {
955
960
  return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
956
961
  }
957
962
  // @__NO_SIDE_EFFECTS__
958
- function Zs(e, r) {
963
+ function Xs(e, r) {
959
964
  const t = [...new Set(e)];
960
965
  return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
961
966
  }
962
967
  // @__NO_SIDE_EFFECTS__
963
- function Xs(e) {
968
+ function Ys(e) {
964
969
  if (e.path) {
965
970
  let r = "";
966
971
  for (const t of e.path)
@@ -972,7 +977,7 @@ function Xs(e) {
972
977
  }
973
978
  return null;
974
979
  }
975
- var Ys = class extends Error {
980
+ var Qs = class extends Error {
976
981
  /**
977
982
  * Creates a Valibot error with useful information.
978
983
  *
@@ -981,7 +986,7 @@ var Ys = class extends Error {
981
986
  constructor(e) {
982
987
  super(e[0].message), this.name = "ValiError", this.issues = e;
983
988
  }
984
- }, Qs = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
989
+ }, ea = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
985
990
  // @__NO_SIDE_EFFECTS__
986
991
  function Xr(e, r) {
987
992
  return {
@@ -993,7 +998,7 @@ function Xr(e, r) {
993
998
  requirement: e,
994
999
  message: r,
995
1000
  "~run"(t, n) {
996
- return t.typed && !this.requirement(t.value) && ee(this, "input", t, n), t;
1001
+ return t.typed && !this.requirement(t.value) && te(this, "input", t, n), t;
997
1002
  }
998
1003
  };
999
1004
  }
@@ -1005,25 +1010,25 @@ function Yr(e) {
1005
1010
  reference: Yr,
1006
1011
  expects: null,
1007
1012
  async: !1,
1008
- requirement: Qs,
1013
+ requirement: ea,
1009
1014
  message: e,
1010
1015
  "~run"(r, t) {
1011
- return r.typed && !this.requirement.test(r.value) && ee(this, "email", r, t), r;
1016
+ return r.typed && !this.requirement.test(r.value) && te(this, "email", r, t), r;
1012
1017
  }
1013
1018
  };
1014
1019
  }
1015
1020
  // @__NO_SIDE_EFFECTS__
1016
- function ct(e, r) {
1021
+ function it(e, r) {
1017
1022
  return {
1018
1023
  kind: "validation",
1019
1024
  type: "max_length",
1020
- reference: ct,
1025
+ reference: it,
1021
1026
  async: !1,
1022
1027
  expects: `<=${e}`,
1023
1028
  requirement: e,
1024
1029
  message: r,
1025
1030
  "~run"(t, n) {
1026
- return t.typed && t.value.length > this.requirement && ee(this, "length", t, n, {
1031
+ return t.typed && t.value.length > this.requirement && te(this, "length", t, n, {
1027
1032
  received: `${t.value.length}`
1028
1033
  }), t;
1029
1034
  }
@@ -1036,28 +1041,28 @@ function Qr(e, r) {
1036
1041
  type: "max_value",
1037
1042
  reference: Qr,
1038
1043
  async: !1,
1039
- expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Je(e)}`,
1044
+ expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Ge(e)}`,
1040
1045
  requirement: e,
1041
1046
  message: r,
1042
1047
  "~run"(t, n) {
1043
- return t.typed && !(t.value <= this.requirement) && ee(this, "value", t, n, {
1044
- received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Je(t.value)
1048
+ return t.typed && !(t.value <= this.requirement) && te(this, "value", t, n, {
1049
+ received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Ge(t.value)
1045
1050
  }), t;
1046
1051
  }
1047
1052
  };
1048
1053
  }
1049
1054
  // @__NO_SIDE_EFFECTS__
1050
- function Ge(e, r) {
1055
+ function Ke(e, r) {
1051
1056
  return {
1052
1057
  kind: "validation",
1053
1058
  type: "min_length",
1054
- reference: Ge,
1059
+ reference: Ke,
1055
1060
  async: !1,
1056
1061
  expects: `>=${e}`,
1057
1062
  requirement: e,
1058
1063
  message: r,
1059
1064
  "~run"(t, n) {
1060
- return t.typed && t.value.length < this.requirement && ee(this, "length", t, n, {
1065
+ return t.typed && t.value.length < this.requirement && te(this, "length", t, n, {
1061
1066
  received: `${t.value.length}`
1062
1067
  }), t;
1063
1068
  }
@@ -1070,12 +1075,12 @@ function en(e, r) {
1070
1075
  type: "min_value",
1071
1076
  reference: en,
1072
1077
  async: !1,
1073
- expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Je(e)}`,
1078
+ expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Ge(e)}`,
1074
1079
  requirement: e,
1075
1080
  message: r,
1076
1081
  "~run"(t, n) {
1077
- return t.typed && !(t.value >= this.requirement) && ee(this, "value", t, n, {
1078
- received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Je(t.value)
1082
+ return t.typed && !(t.value >= this.requirement) && te(this, "value", t, n, {
1083
+ received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Ge(t.value)
1079
1084
  }), t;
1080
1085
  }
1081
1086
  };
@@ -1091,7 +1096,7 @@ function zt(e, r) {
1091
1096
  requirement: e,
1092
1097
  message: r,
1093
1098
  "~run"(t, n) {
1094
- return t.typed && !this.requirement.test(t.value) && ee(this, "format", t, n), t;
1099
+ return t.typed && !this.requirement.test(t.value) && te(this, "format", t, n), t;
1095
1100
  }
1096
1101
  };
1097
1102
  }
@@ -1125,12 +1130,12 @@ function tn(e) {
1125
1130
  },
1126
1131
  message: e,
1127
1132
  "~run"(r, t) {
1128
- return r.typed && !this.requirement(r.value) && ee(this, "URL", r, t), r;
1133
+ return r.typed && !this.requirement(r.value) && te(this, "URL", r, t), r;
1129
1134
  }
1130
1135
  };
1131
1136
  }
1132
1137
  // @__NO_SIDE_EFFECTS__
1133
- function ea(e, r, t) {
1138
+ function ta(e, r, t) {
1134
1139
  return typeof e.fallback == "function" ? (
1135
1140
  // @ts-expect-error
1136
1141
  e.fallback(r, t)
@@ -1160,7 +1165,7 @@ function nn(e, r) {
1160
1165
  item: e,
1161
1166
  message: r,
1162
1167
  get "~standard"() {
1163
- return /* @__PURE__ */ ge(this);
1168
+ return /* @__PURE__ */ be(this);
1164
1169
  },
1165
1170
  "~run"(t, n) {
1166
1171
  var i;
@@ -1177,8 +1182,8 @@ function nn(e, r) {
1177
1182
  key: a,
1178
1183
  value: o
1179
1184
  };
1180
- for (const g of u.issues)
1181
- g.path ? g.path.unshift(f) : g.path = [f], (i = t.issues) == null || i.push(g);
1185
+ for (const b of u.issues)
1186
+ b.path ? b.path.unshift(f) : b.path = [f], (i = t.issues) == null || i.push(b);
1182
1187
  if (t.issues || (t.issues = u.issues), n.abortEarly) {
1183
1188
  t.typed = !1;
1184
1189
  break;
@@ -1187,7 +1192,7 @@ function nn(e, r) {
1187
1192
  u.typed || (t.typed = !1), t.value.push(u.value);
1188
1193
  }
1189
1194
  } else
1190
- ee(this, "type", t, n);
1195
+ te(this, "type", t, n);
1191
1196
  return t;
1192
1197
  }
1193
1198
  };
@@ -1202,10 +1207,10 @@ function sn(e) {
1202
1207
  async: !1,
1203
1208
  message: e,
1204
1209
  get "~standard"() {
1205
- return /* @__PURE__ */ ge(this);
1210
+ return /* @__PURE__ */ be(this);
1206
1211
  },
1207
1212
  "~run"(r, t) {
1208
- return typeof r.value == "boolean" ? r.typed = !0 : ee(this, "type", r, t), r;
1213
+ return typeof r.value == "boolean" ? r.typed = !0 : te(this, "type", r, t), r;
1209
1214
  }
1210
1215
  };
1211
1216
  }
@@ -1219,25 +1224,25 @@ function an(e) {
1219
1224
  async: !1,
1220
1225
  message: e,
1221
1226
  get "~standard"() {
1222
- return /* @__PURE__ */ ge(this);
1227
+ return /* @__PURE__ */ be(this);
1223
1228
  },
1224
1229
  "~run"(r, t) {
1225
- return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : ee(this, "type", r, t), r;
1230
+ return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : te(this, "type", r, t), r;
1226
1231
  }
1227
1232
  };
1228
1233
  }
1229
1234
  // @__NO_SIDE_EFFECTS__
1230
- function ke(e, r) {
1235
+ function _e(e, r) {
1231
1236
  return {
1232
1237
  kind: "schema",
1233
1238
  type: "object",
1234
- reference: ke,
1239
+ reference: _e,
1235
1240
  expects: "Object",
1236
1241
  async: !1,
1237
1242
  entries: e,
1238
1243
  message: r,
1239
1244
  get "~standard"() {
1240
- return /* @__PURE__ */ ge(this);
1245
+ return /* @__PURE__ */ be(this);
1241
1246
  },
1242
1247
  "~run"(t, n) {
1243
1248
  var i;
@@ -1253,7 +1258,7 @@ function ke(e, r) {
1253
1258
  s[a]
1254
1259
  ) : /* @__PURE__ */ rn(o), f = o["~run"]({ value: u }, n);
1255
1260
  if (f.issues) {
1256
- const g = {
1261
+ const b = {
1257
1262
  type: "object",
1258
1263
  origin: "value",
1259
1264
  input: s,
@@ -1261,7 +1266,7 @@ function ke(e, r) {
1261
1266
  value: u
1262
1267
  };
1263
1268
  for (const y of f.issues)
1264
- y.path ? y.path.unshift(g) : y.path = [g], (i = t.issues) == null || i.push(y);
1269
+ y.path ? y.path.unshift(b) : y.path = [b], (i = t.issues) == null || i.push(y);
1265
1270
  if (t.issues || (t.issues = f.issues), n.abortEarly) {
1266
1271
  t.typed = !1;
1267
1272
  break;
@@ -1269,8 +1274,8 @@ function ke(e, r) {
1269
1274
  }
1270
1275
  f.typed || (t.typed = !1), t.value[a] = f.value;
1271
1276
  } else if (o.fallback !== void 0)
1272
- t.value[a] = /* @__PURE__ */ ea(o);
1273
- else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (ee(this, "key", t, n, {
1277
+ t.value[a] = /* @__PURE__ */ ta(o);
1278
+ else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (te(this, "key", t, n, {
1274
1279
  input: void 0,
1275
1280
  expected: `"${a}"`,
1276
1281
  path: [
@@ -1287,23 +1292,23 @@ function ke(e, r) {
1287
1292
  break;
1288
1293
  }
1289
1294
  } else
1290
- ee(this, "type", t, n);
1295
+ te(this, "type", t, n);
1291
1296
  return t;
1292
1297
  }
1293
1298
  };
1294
1299
  }
1295
1300
  // @__NO_SIDE_EFFECTS__
1296
- function Ke(e, r) {
1301
+ function He(e, r) {
1297
1302
  return {
1298
1303
  kind: "schema",
1299
1304
  type: "optional",
1300
- reference: Ke,
1305
+ reference: He,
1301
1306
  expects: `(${e.expects} | undefined)`,
1302
1307
  async: !1,
1303
1308
  wrapped: e,
1304
1309
  default: r,
1305
1310
  get "~standard"() {
1306
- return /* @__PURE__ */ ge(this);
1311
+ return /* @__PURE__ */ be(this);
1307
1312
  },
1308
1313
  "~run"(t, n) {
1309
1314
  return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ rn(this, t, n)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, n);
@@ -1316,15 +1321,15 @@ function on(e, r) {
1316
1321
  kind: "schema",
1317
1322
  type: "picklist",
1318
1323
  reference: on,
1319
- expects: /* @__PURE__ */ Zs(e.map(Je), "|"),
1324
+ expects: /* @__PURE__ */ Xs(e.map(Ge), "|"),
1320
1325
  async: !1,
1321
1326
  options: e,
1322
1327
  message: r,
1323
1328
  get "~standard"() {
1324
- return /* @__PURE__ */ ge(this);
1329
+ return /* @__PURE__ */ be(this);
1325
1330
  },
1326
1331
  "~run"(t, n) {
1327
- return this.options.includes(t.value) ? t.typed = !0 : ee(this, "type", t, n), t;
1332
+ return this.options.includes(t.value) ? t.typed = !0 : te(this, "type", t, n), t;
1328
1333
  }
1329
1334
  };
1330
1335
  }
@@ -1340,7 +1345,7 @@ function ln(e, r, t) {
1340
1345
  value: r,
1341
1346
  message: t,
1342
1347
  get "~standard"() {
1343
- return /* @__PURE__ */ ge(this);
1348
+ return /* @__PURE__ */ be(this);
1344
1349
  },
1345
1350
  "~run"(n, s) {
1346
1351
  var a, o;
@@ -1348,9 +1353,9 @@ function ln(e, r, t) {
1348
1353
  if (i && typeof i == "object") {
1349
1354
  n.typed = !0, n.value = {};
1350
1355
  for (const u in i)
1351
- if (/* @__PURE__ */ Js(i, u)) {
1352
- const f = i[u], g = this.key["~run"]({ value: u }, s);
1353
- if (g.issues) {
1356
+ if (/* @__PURE__ */ Zs(i, u)) {
1357
+ const f = i[u], b = this.key["~run"]({ value: u }, s);
1358
+ if (b.issues) {
1354
1359
  const p = {
1355
1360
  type: "object",
1356
1361
  origin: "key",
@@ -1358,9 +1363,9 @@ function ln(e, r, t) {
1358
1363
  key: u,
1359
1364
  value: f
1360
1365
  };
1361
- for (const m of g.issues)
1366
+ for (const m of b.issues)
1362
1367
  m.path = [p], (a = n.issues) == null || a.push(m);
1363
- if (n.issues || (n.issues = g.issues), s.abortEarly) {
1368
+ if (n.issues || (n.issues = b.issues), s.abortEarly) {
1364
1369
  n.typed = !1;
1365
1370
  break;
1366
1371
  }
@@ -1384,57 +1389,57 @@ function ln(e, r, t) {
1384
1389
  break;
1385
1390
  }
1386
1391
  }
1387
- (!g.typed || !y.typed) && (n.typed = !1), g.typed && (n.value[g.value] = y.value);
1392
+ (!b.typed || !y.typed) && (n.typed = !1), b.typed && (n.value[b.value] = y.value);
1388
1393
  }
1389
1394
  } else
1390
- ee(this, "type", n, s);
1395
+ te(this, "type", n, s);
1391
1396
  return n;
1392
1397
  }
1393
1398
  };
1394
1399
  }
1395
1400
  // @__NO_SIDE_EFFECTS__
1396
- function ie(e) {
1401
+ function oe(e) {
1397
1402
  return {
1398
1403
  kind: "schema",
1399
1404
  type: "string",
1400
- reference: ie,
1405
+ reference: oe,
1401
1406
  expects: "string",
1402
1407
  async: !1,
1403
1408
  message: e,
1404
1409
  get "~standard"() {
1405
- return /* @__PURE__ */ ge(this);
1410
+ return /* @__PURE__ */ be(this);
1406
1411
  },
1407
1412
  "~run"(r, t) {
1408
- return typeof r.value == "string" ? r.typed = !0 : ee(this, "type", r, t), r;
1413
+ return typeof r.value == "string" ? r.typed = !0 : te(this, "type", r, t), r;
1409
1414
  }
1410
1415
  };
1411
1416
  }
1412
- function ta(e, r, t) {
1413
- const n = e["~run"]({ value: r }, /* @__PURE__ */ _t(t));
1417
+ function ra(e, r, t) {
1418
+ const n = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
1414
1419
  if (n.issues)
1415
- throw new Ys(n.issues);
1420
+ throw new Qs(n.issues);
1416
1421
  return n.value;
1417
1422
  }
1418
1423
  // @__NO_SIDE_EFFECTS__
1419
- function ra(e, r) {
1424
+ function na(e, r) {
1420
1425
  const t = {};
1421
1426
  for (const n in e.entries)
1422
- t[n] = !r || r.includes(n) ? /* @__PURE__ */ Ke(e.entries[n]) : e.entries[n];
1427
+ t[n] = !r || r.includes(n) ? /* @__PURE__ */ He(e.entries[n]) : e.entries[n];
1423
1428
  return {
1424
1429
  ...e,
1425
1430
  entries: t,
1426
1431
  get "~standard"() {
1427
- return /* @__PURE__ */ ge(this);
1432
+ return /* @__PURE__ */ be(this);
1428
1433
  }
1429
1434
  };
1430
1435
  }
1431
1436
  // @__NO_SIDE_EFFECTS__
1432
- function Le(...e) {
1437
+ function Ne(...e) {
1433
1438
  return {
1434
1439
  ...e[0],
1435
1440
  pipe: e,
1436
1441
  get "~standard"() {
1437
- return /* @__PURE__ */ ge(this);
1442
+ return /* @__PURE__ */ be(this);
1438
1443
  },
1439
1444
  "~run"(r, t) {
1440
1445
  for (const n of e)
@@ -1450,8 +1455,8 @@ function Le(...e) {
1450
1455
  };
1451
1456
  }
1452
1457
  // @__NO_SIDE_EFFECTS__
1453
- function na(e, r, t) {
1454
- const n = e["~run"]({ value: r }, /* @__PURE__ */ _t(t));
1458
+ function sa(e, r, t) {
1459
+ const n = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
1455
1460
  return {
1456
1461
  typed: n.typed,
1457
1462
  success: !n.issues,
@@ -1460,10 +1465,10 @@ function na(e, r, t) {
1460
1465
  };
1461
1466
  }
1462
1467
  // @__NO_SIDE_EFFECTS__
1463
- async function sa(e, r, t) {
1468
+ async function aa(e, r, t) {
1464
1469
  const n = await e["~run"](
1465
1470
  { value: r },
1466
- /* @__PURE__ */ _t(t)
1471
+ /* @__PURE__ */ wt(t)
1467
1472
  );
1468
1473
  return {
1469
1474
  typed: n.typed,
@@ -1472,7 +1477,7 @@ async function sa(e, r, t) {
1472
1477
  issues: n.issues
1473
1478
  };
1474
1479
  }
1475
- const Qe = ({
1480
+ const Ye = ({
1476
1481
  error: e
1477
1482
  }) => !e || !e.message ? null : c("div", {
1478
1483
  role: "alert",
@@ -1505,16 +1510,16 @@ const Qe = ({
1505
1510
  class: "break-words pr-1 text-sm",
1506
1511
  children: e.message
1507
1512
  })]
1508
- }), Ne = ({
1513
+ }), De = ({
1509
1514
  class: e,
1510
1515
  ...r
1511
1516
  }) => {
1512
1517
  const {
1513
1518
  t
1514
- } = te();
1519
+ } = re();
1515
1520
  return c("button", {
1516
1521
  type: "button",
1517
- class: Xe("fr touch-hitbox text-neutral-11 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all", e),
1522
+ class: Ze("fr touch-hitbox text-neutral-11 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all", e),
1518
1523
  ...r,
1519
1524
  children: [c("svg", {
1520
1525
  "aria-hidden": !0,
@@ -1537,7 +1542,7 @@ const Qe = ({
1537
1542
  });
1538
1543
  };
1539
1544
  var Kt = { 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" };
1540
- const Ze = wt("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", {
1545
+ const Je = xt("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", {
1541
1546
  variants: {
1542
1547
  optional: {
1543
1548
  true: "pr-16 pl-3",
@@ -1547,72 +1552,72 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1547
1552
  defaultVariants: {
1548
1553
  optional: !1
1549
1554
  }
1550
- }), aa = "https://api.mapbox.com/search/searchbox/v1/suggest", ia = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", oa = (e) => atob(e).split("").reverse().join(""), xe = /* @__PURE__ */ ke({
1551
- name: /* @__PURE__ */ ie()
1552
- }), la = /* @__PURE__ */ ke({
1553
- suggestions: /* @__PURE__ */ nn(/* @__PURE__ */ ke({
1554
- feature_type: /* @__PURE__ */ Ke(/* @__PURE__ */ ie()),
1555
- full_address: /* @__PURE__ */ Ke(/* @__PURE__ */ ie()),
1556
- place_formatted: /* @__PURE__ */ Ke(/* @__PURE__ */ ie()),
1557
- name: /* @__PURE__ */ Ke(/* @__PURE__ */ ie()),
1558
- mapbox_id: /* @__PURE__ */ ie(),
1559
- context: /* @__PURE__ */ ra(/* @__PURE__ */ ke({
1560
- address: xe,
1561
- street: xe,
1562
- neighborhood: xe,
1563
- locality: xe,
1564
- district: xe,
1565
- place: xe,
1566
- region: xe,
1567
- postcode: xe,
1568
- country: xe
1555
+ }), ia = "https://api.mapbox.com/search/searchbox/v1/suggest", oa = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", la = (e) => atob(e).split("").reverse().join(""), ve = /* @__PURE__ */ _e({
1556
+ name: /* @__PURE__ */ oe()
1557
+ }), ca = /* @__PURE__ */ _e({
1558
+ suggestions: /* @__PURE__ */ nn(/* @__PURE__ */ _e({
1559
+ feature_type: /* @__PURE__ */ He(/* @__PURE__ */ oe()),
1560
+ full_address: /* @__PURE__ */ He(/* @__PURE__ */ oe()),
1561
+ place_formatted: /* @__PURE__ */ He(/* @__PURE__ */ oe()),
1562
+ name: /* @__PURE__ */ He(/* @__PURE__ */ oe()),
1563
+ mapbox_id: /* @__PURE__ */ oe(),
1564
+ context: /* @__PURE__ */ na(/* @__PURE__ */ _e({
1565
+ address: ve,
1566
+ street: ve,
1567
+ neighborhood: ve,
1568
+ locality: ve,
1569
+ district: ve,
1570
+ place: ve,
1571
+ region: ve,
1572
+ postcode: ve,
1573
+ country: ve
1569
1574
  }))
1570
1575
  }))
1571
- }), ca = ({
1576
+ }), ua = ({
1572
1577
  logger: e,
1573
1578
  t: r
1574
- }) => qn(() => {
1579
+ }) => Un(() => {
1575
1580
  var n;
1576
- const t = (n = H.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
1581
+ const t = (n = U.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
1577
1582
  return t ? {
1578
1583
  enabled: !0,
1579
1584
  getPredictions: async (s) => {
1580
1585
  var y;
1581
- const i = new URL(aa);
1586
+ const i = new URL(ia);
1582
1587
  i.searchParams.set("q", s), i.searchParams.set("session_token", t);
1583
- const a = (y = H.current$.peek().flow) == null ? void 0 : y.locationOrigin;
1584
- a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token", oa(ia));
1588
+ const a = (y = U.current$.peek().flow) == null ? void 0 : y.locationOrigin;
1589
+ a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token", la(oa));
1585
1590
  const u = await fetch(i);
1586
1591
  if (!u.ok)
1587
1592
  return e.error("Failed to get address details", u), {
1588
1593
  ok: !1,
1589
1594
  error: r("address_error")
1590
1595
  };
1591
- const f = /* @__PURE__ */ na(la, await u.json());
1596
+ const f = /* @__PURE__ */ sa(ca, await u.json());
1592
1597
  if (f.success === !1)
1593
1598
  return e.error("Failed to parse address details", f.issues), {
1594
1599
  ok: !1,
1595
1600
  error: r("address_error")
1596
1601
  };
1597
1602
  const {
1598
- suggestions: g
1603
+ suggestions: b
1599
1604
  } = f.output;
1600
1605
  return {
1601
1606
  ok: !0,
1602
- data: g.map((p) => {
1603
- var m, _, E, C, x, b, F, L, V;
1607
+ data: b.map((p) => {
1608
+ var m, k, I, C, x, v, E, N, M;
1604
1609
  return {
1605
1610
  // A postcode result has no full address and is named by the postcode itself (PROD-7311).
1606
1611
  label: p.full_address ?? ([p.name, p.place_formatted].filter(Boolean).join(", ") || p.mapbox_id),
1607
1612
  id: p.mapbox_id,
1608
1613
  address: {
1609
- line1: ((m = p.context.address) == null ? void 0 : m.name) ?? ((_ = p.context.street) == null ? void 0 : _.name),
1614
+ line1: ((m = p.context.address) == null ? void 0 : m.name) ?? ((k = p.context.street) == null ? void 0 : k.name),
1610
1615
  line2: void 0,
1611
- line3: ((E = p.context.neighborhood) == null ? void 0 : E.name) ?? ((C = p.context.locality) == null ? void 0 : C.name),
1612
- city: ((x = p.context.place) == null ? void 0 : x.name) ?? ((b = p.context.district) == null ? void 0 : b.name),
1613
- state: (F = p.context.region) == null ? void 0 : F.name,
1614
- postcode: ((L = p.context.postcode) == null ? void 0 : L.name) ?? (p.feature_type === "postcode" ? p.name : void 0),
1615
- country: (V = p.context.country) == null ? void 0 : V.name
1616
+ line3: ((I = p.context.neighborhood) == null ? void 0 : I.name) ?? ((C = p.context.locality) == null ? void 0 : C.name),
1617
+ city: ((x = p.context.place) == null ? void 0 : x.name) ?? ((v = p.context.district) == null ? void 0 : v.name),
1618
+ state: (E = p.context.region) == null ? void 0 : E.name,
1619
+ postcode: ((N = p.context.postcode) == null ? void 0 : N.name) ?? (p.feature_type === "postcode" ? p.name : void 0),
1620
+ country: (M = p.context.country) == null ? void 0 : M.name
1616
1621
  }
1617
1622
  };
1618
1623
  })
@@ -1624,7 +1629,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1624
1629
  }, [e, r]), dr = (e) => {
1625
1630
  const {
1626
1631
  t: r
1627
- } = te();
1632
+ } = re();
1628
1633
  return c("button", {
1629
1634
  type: "button",
1630
1635
  class: "touch-hitbox text-neutral-11 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 relative flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",
@@ -1644,75 +1649,75 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1644
1649
  children: r("back")
1645
1650
  })]
1646
1651
  });
1647
- }, ua = ({
1652
+ }, da = ({
1648
1653
  input: e,
1649
1654
  onSubmitSuccess: r,
1650
1655
  logger: t
1651
1656
  }) => {
1652
1657
  const {
1653
1658
  t: n
1654
- } = te(), [s, i] = _e(), {
1659
+ } = re(), [s, i] = we(), {
1655
1660
  enabled: a,
1656
1661
  getPredictions: o
1657
- } = ca({
1662
+ } = ua({
1658
1663
  logger: t,
1659
1664
  t: n
1660
- }), [u, f] = _e(a ? "query" : "manual"), [g, y] = _e(""), [p, m] = _e(), _ = ye(), E = ye(), C = (b) => {
1661
- var L;
1662
- if (Be(a, "Query state should not be enabled"), b = b.trim(), b === ((L = _.current) == null ? void 0 : L.query) || b === (p == null ? void 0 : p.query) && p.status === "done")
1665
+ }), [u, f] = we(a ? "query" : "manual"), [b, y] = we(""), [p, m] = we(), k = ye(), I = ye(), C = (v) => {
1666
+ var N;
1667
+ if (je(a, "Query state should not be enabled"), v = v.trim(), v === ((N = k.current) == null ? void 0 : N.query) || v === (p == null ? void 0 : p.query) && p.status === "done")
1663
1668
  return;
1664
- if (y(b), b === "") {
1665
- _.current = void 0, m(void 0);
1669
+ if (y(v), v === "") {
1670
+ k.current = void 0, m(void 0);
1666
1671
  return;
1667
1672
  }
1668
- const F = _.current = {
1669
- query: b
1673
+ const E = k.current = {
1674
+ query: v
1670
1675
  };
1671
1676
  m({
1672
- query: b,
1677
+ query: v,
1673
1678
  status: "pending"
1674
- }), o(b).then((V) => {
1675
- _.current === F && (_.current = void 0, m(V.ok ? {
1676
- query: b,
1679
+ }), o(v).then((M) => {
1680
+ k.current === E && (k.current = void 0, m(M.ok ? {
1681
+ query: v,
1677
1682
  status: "done",
1678
- items: V.data
1683
+ items: M.data
1679
1684
  } : {
1680
- query: b,
1685
+ query: v,
1681
1686
  status: "failed",
1682
- error: V.error
1687
+ error: M.error
1683
1688
  }));
1684
- }, (V) => {
1685
- _.current === F && (_.current = void 0, t.error("Failed to get address details", V), m({
1686
- query: b,
1689
+ }, (M) => {
1690
+ k.current === E && (k.current = void 0, t.error("Failed to get address details", M), m({
1691
+ query: v,
1687
1692
  status: "failed",
1688
1693
  error: n("address_error")
1689
1694
  }));
1690
1695
  });
1691
- }, x = (b, F) => {
1692
- i((L) => ({
1693
- ...L,
1694
- [b]: F
1696
+ }, x = (v, E) => {
1697
+ i((N) => ({
1698
+ ...N,
1699
+ [v]: E
1695
1700
  }));
1696
1701
  };
1697
1702
  switch (u) {
1698
1703
  case "query":
1699
- return Be(a, "Query state should not be enabled"), c(da, {
1704
+ return je(a, "Query state should not be enabled"), c(fa, {
1700
1705
  input: e,
1701
1706
  onSkip: () => r(null),
1702
- onAddressSelect: (b) => {
1703
- if (b === "") {
1704
- _.current && (_.current = void 0, m(void 0)), f("manual");
1707
+ onAddressSelect: (v) => {
1708
+ if (v === "") {
1709
+ k.current && (k.current = void 0, m(void 0)), f("manual");
1705
1710
  return;
1706
1711
  }
1707
- const F = (p == null ? void 0 : p.status) === "done" ? p.items.find((L) => L.id === b) : void 0;
1708
- F && (E.current !== b && i(F.address), E.current = b, f("details"));
1712
+ const E = (p == null ? void 0 : p.status) === "done" ? p.items.find((N) => N.id === v) : void 0;
1713
+ E && (I.current !== v && i(E.address), I.current = v, f("details"));
1709
1714
  },
1710
1715
  onAddressSearch: C,
1711
1716
  lookup: p,
1712
- query: g
1717
+ query: b
1713
1718
  });
1714
1719
  case "details":
1715
- return Be(s !== void 0), c(fr, {
1720
+ return je(s !== void 0), c(fr, {
1716
1721
  input: e,
1717
1722
  logger: t,
1718
1723
  onSubmitSuccess: r,
@@ -1737,13 +1742,13 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1737
1742
  }
1738
1743
  }) : e.config.optional ? (
1739
1744
  // Without address search this is the only screen, so an optional question needs its own way past.
1740
- c(Ne, {
1745
+ c(De, {
1741
1746
  onClick: () => r(null)
1742
1747
  })
1743
1748
  ) : void 0
1744
1749
  });
1745
1750
  }
1746
- }, da = ({
1751
+ }, fa = ({
1747
1752
  input: e,
1748
1753
  onSkip: r,
1749
1754
  lookup: t,
@@ -1753,16 +1758,16 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1753
1758
  }) => {
1754
1759
  const {
1755
1760
  t: a
1756
- } = te(), o = ye(null);
1757
- return De(() => {
1761
+ } = re(), o = ye(null);
1762
+ return Re(() => {
1758
1763
  o.current && (o.current.focus(), o.current.select());
1759
- }, []), c(Ce, {
1764
+ }, []), c(ke, {
1760
1765
  children: [c("form", {
1761
1766
  noValidate: !0,
1762
1767
  onSubmit: (u) => {
1763
1768
  u.preventDefault();
1764
- const g = new FormData(u.currentTarget).get("address");
1765
- typeof g == "string" && i(g);
1769
+ const b = new FormData(u.currentTarget).get("address");
1770
+ typeof b == "string" && i(b);
1766
1771
  },
1767
1772
  class: "flex gap-2 p-2.5",
1768
1773
  children: [c("div", {
@@ -1775,7 +1780,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1775
1780
  autoFocus: !0,
1776
1781
  placeholder: e.config.placeholder || a("address_search"),
1777
1782
  defaultValue: s,
1778
- class: Ze({
1783
+ class: Je({
1779
1784
  optional: !!e.config.optional,
1780
1785
  className: "w-full rounded-full"
1781
1786
  })
@@ -1808,18 +1813,18 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1808
1813
  children: a("search")
1809
1814
  })]
1810
1815
  })]
1811
- }), e.config.optional && c(Ne, {
1816
+ }), e.config.optional && c(De, {
1812
1817
  class: "relative",
1813
1818
  onClick: r
1814
1819
  })]
1815
- }), (t == null ? void 0 : t.status) === "failed" ? c(Qe, {
1820
+ }), (t == null ? void 0 : t.status) === "failed" ? c(Ye, {
1816
1821
  error: {
1817
1822
  message: t.error
1818
1823
  }
1819
1824
  }) : null, c("p", {
1820
1825
  role: "status",
1821
1826
  class: (t == null ? void 0 : t.status) === "pending" || (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? "text-neutral-11 flex items-center gap-2 px-4 py-2 text-sm" : "sr-only",
1822
- children: (t == null ? void 0 : t.status) === "pending" ? c(Ce, {
1827
+ children: (t == null ? void 0 : t.status) === "pending" ? c(ke, {
1823
1828
  children: [c(qt, {
1824
1829
  "aria-hidden": "true",
1825
1830
  class: "h-4 w-4 shrink-0"
@@ -1863,7 +1868,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1863
1868
  }, "")]
1864
1869
  })]
1865
1870
  });
1866
- }, Nt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], fr = ({
1871
+ }, Rt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], fr = ({
1867
1872
  addressFields: e,
1868
1873
  onFieldChange: r,
1869
1874
  onSubmitSuccess: t,
@@ -1871,7 +1876,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1871
1876
  input: s
1872
1877
  }) => {
1873
1878
  const i = ye(null);
1874
- De(() => {
1879
+ Re(() => {
1875
1880
  if (i.current) {
1876
1881
  const u = i.current.querySelector("input");
1877
1882
  u && (u.focus(), u.select());
@@ -1879,17 +1884,17 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1879
1884
  }, []);
1880
1885
  const a = Object.keys(Kt), {
1881
1886
  t: o
1882
- } = te();
1887
+ } = re();
1883
1888
  return c("form", {
1884
1889
  class: "flex flex-col px-2 pt-2",
1885
1890
  onSubmit: (u) => {
1886
- const f = u.currentTarget, g = [...f.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
1887
- for (const m of g) {
1891
+ const f = u.currentTarget, b = [...f.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
1892
+ for (const m of b) {
1888
1893
  m.value = "";
1889
- const _ = Nt.find((E) => s.config.keys[E] === m.name);
1890
- _ && r(_, "");
1894
+ const k = Rt.find((I) => s.config.keys[I] === m.name);
1895
+ k && r(k, "");
1891
1896
  }
1892
- if (g.length > 0 && !f.checkValidity()) {
1897
+ if (b.length > 0 && !f.checkValidity()) {
1893
1898
  u.preventDefault(), f.reportValidity();
1894
1899
  return;
1895
1900
  }
@@ -1902,11 +1907,11 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1902
1907
  children: [c("div", {
1903
1908
  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]",
1904
1909
  ref: i,
1905
- children: Nt.map((u, f) => {
1906
- const g = `isdk_${u}`, y = s.config.keys[u];
1907
- return y ? c(Ce, {
1910
+ children: Rt.map((u, f) => {
1911
+ const b = `isdk_${u}`, y = s.config.keys[u];
1912
+ return y ? c(ke, {
1908
1913
  children: [c("label", {
1909
- for: g,
1914
+ for: b,
1910
1915
  class: "text-neutral-11 [&:has(+*>input:focus)]:text-neutral-12 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
1911
1916
  children: o(u)
1912
1917
  }), c("div", {
@@ -1916,7 +1921,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1916
1921
  children: [c("select", {
1917
1922
  class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",
1918
1923
  name: y,
1919
- id: g,
1924
+ id: b,
1920
1925
  defaultValue: e[u],
1921
1926
  onChange: (p) => r(u, p.currentTarget.value),
1922
1927
  required: !0,
@@ -1949,11 +1954,11 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1949
1954
  autoFocus: f === 0 ? !0 : void 0,
1950
1955
  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",
1951
1956
  name: y,
1952
- id: g,
1957
+ id: b,
1953
1958
  defaultValue: e[u],
1954
1959
  onInput: (p) => r(u, p.currentTarget.value),
1955
1960
  required: u === "line2" ? s.config.line2Required === !0 : u !== "line3"
1956
- }), f === Nt.length - 1 ? c("hr", {
1961
+ }), f === Rt.length - 1 ? c("hr", {
1957
1962
  class: "m-0 w-full border-b border-b-transparent"
1958
1963
  }) : c("hr", {
1959
1964
  class: "border-b-neutral-5 m-0 w-full border-b border-solid"
@@ -1963,7 +1968,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1963
1968
  })
1964
1969
  }), c("div", {
1965
1970
  class: "bg-neutral-1 sticky bottom-0 flex items-center py-2",
1966
- children: [n, c(je, {
1971
+ children: [n, c($e, {
1967
1972
  class: "ml-auto"
1968
1973
  })]
1969
1974
  })]
@@ -1974,7 +1979,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1974
1979
  var r;
1975
1980
  (r = e.current) == null || r.focus();
1976
1981
  }, []), e;
1977
- }, cn = ["true", "false"], fa = /* @__PURE__ */ on(cn), ha = "answer", un = "flex items-center flex-wrap gap-2 p-2.5", dn = "min-w-0 max-w-full flex-auto", fn = Wr(({
1982
+ }, cn = ["true", "false"], ha = /* @__PURE__ */ on(cn), pa = "answer", un = "flex items-center flex-wrap gap-2 p-2.5", dn = "min-w-0 max-w-full flex-auto", fn = Wr(({
1978
1983
  label: e,
1979
1984
  ...r
1980
1985
  }, t) => c("button", {
@@ -1985,7 +1990,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1985
1990
  class: "text-center text-base",
1986
1991
  children: e
1987
1992
  })
1988
- })), pa = ({
1993
+ })), ma = ({
1989
1994
  input: e,
1990
1995
  onSubmitSuccess: r
1991
1996
  }) => {
@@ -1995,7 +2000,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1995
2000
  class: "",
1996
2001
  onSubmit: (n) => {
1997
2002
  n.preventDefault();
1998
- const s = Un(n).value, i = ta(fa, s);
2003
+ const s = Wn(n).value, i = ra(ha, s);
1999
2004
  r({
2000
2005
  type: "boolean",
2001
2006
  value: i === "true"
@@ -2008,28 +2013,28 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2008
2013
  children: c(fn, {
2009
2014
  ref: s === 0 ? t : null,
2010
2015
  type: "submit",
2011
- name: ha,
2016
+ name: pa,
2012
2017
  value: n,
2013
2018
  label: e.config.labels[n]
2014
2019
  }, n)
2015
2020
  }))
2016
2021
  }), e.config.optional && c("div", {
2017
2022
  class: "px-2 pb-2",
2018
- children: c(Ne, {
2023
+ children: c(De, {
2019
2024
  class: "relative w-full",
2020
2025
  type: "button",
2021
2026
  onClick: () => r(null)
2022
2027
  })
2023
2028
  })]
2024
2029
  });
2025
- }, ma = (e) => new Promise((r, t) => {
2030
+ }, ya = (e) => new Promise((r, t) => {
2026
2031
  const n = new FileReader();
2027
2032
  n.onload = () => {
2028
2033
  if (typeof n.result != "string" || !n.result)
2029
2034
  return t(new Error("Invalid file"));
2030
2035
  r(n.result);
2031
2036
  }, n.onerror = t, n.readAsDataURL(e);
2032
- }), hr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), ya = Ye("file"), pr = 3, kt = (e) => {
2037
+ }), hr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), ba = Xe("file"), pr = 3, _t = (e) => {
2033
2038
  const r = e.lastIndexOf(".");
2034
2039
  return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
2035
2040
  }, ga = ({
@@ -2039,9 +2044,9 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2039
2044
  }) => {
2040
2045
  const {
2041
2046
  t: n
2042
- } = te(), [s, i] = kt(e.name);
2047
+ } = re(), [s, i] = _t(e.name);
2043
2048
  return c("div", {
2044
- class: Xe("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
2049
+ class: Ze("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
2045
2050
  ...t,
2046
2051
  children: [c("p", {
2047
2052
  class: "text-accent-12 flex flex-grow overflow-hidden",
@@ -2059,38 +2064,38 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2059
2064
  children: [c("span", {
2060
2065
  class: "sr-only",
2061
2066
  children: [n("file_size"), ": "]
2062
- }), He(e.sizeKb)]
2067
+ }), ze(e.sizeKb)]
2063
2068
  })]
2064
2069
  });
2065
2070
  }, mr = ({
2066
2071
  class: e,
2067
2072
  ...r
2068
2073
  }) => c("li", {
2069
- class: Xe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
2074
+ class: Ze("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
2070
2075
  ...r
2071
- }), ba = (e, r) => {
2072
- const [t, n] = kt(e);
2076
+ }), va = (e, r) => {
2077
+ const [t, n] = _t(e);
2073
2078
  return `${t.slice(0, r)}${n}`;
2074
2079
  }, yr = (e) => ({
2075
- name: ba(e.name, 42),
2080
+ name: va(e.name, 42),
2076
2081
  sizeKb: e.size / 1e3
2077
- }), va = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], xa = (e, r, t) => {
2078
- const n = kt(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...va], i = n === "" ? "none" : s.includes(n) ? n : "other";
2082
+ }), xa = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], wa = (e, r, t) => {
2083
+ const n = _t(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...xa], i = n === "" ? "none" : s.includes(n) ? n : "other";
2079
2084
  return `chatbot-file-refused:${e}:${i}`;
2080
- }, wa = ({
2085
+ }, _a = ({
2081
2086
  input: e,
2082
2087
  onSubmitSuccess: r,
2083
2088
  analytics: t
2084
2089
  }) => {
2085
2090
  var C;
2086
- const n = (C = H.current$.value.flow) == null ? void 0 : C.data.submissions[e.key], [s, i] = _e(ya(n) && n.value.length ? {
2091
+ const n = (C = U.current$.value.flow) == null ? void 0 : C.data.submissions[e.key], [s, i] = we(ba(n) && n.value.length ? {
2087
2092
  status: "ready",
2088
2093
  files: n.value
2089
2094
  } : {
2090
2095
  status: "empty"
2091
- }), a = ye(0), o = s.status === "ready" ? s.files : [], u = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0, g = u.length - pr, y = hr(u), p = Gt(), {
2096
+ }), a = ye(0), o = s.status === "ready" ? s.files : [], u = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0, b = u.length - pr, y = hr(u), p = Gt(), {
2092
2097
  t: m
2093
- } = te(), _ = (x) => {
2098
+ } = re(), k = (x) => {
2094
2099
  if (!x.length)
2095
2100
  return {
2096
2101
  reason: "required",
@@ -2102,7 +2107,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2102
2107
  if (!ar(x, e.config.extensions))
2103
2108
  return {
2104
2109
  reason: "type",
2105
- file: x.find((b) => !ar([b], e.config.extensions)),
2110
+ file: x.find((v) => !ar([v], e.config.extensions)),
2106
2111
  error: {
2107
2112
  type: "validate",
2108
2113
  message: m("validation_file_ext", {
@@ -2110,10 +2115,10 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2110
2115
  })
2111
2116
  }
2112
2117
  };
2113
- if (x.some((b) => b.sizeKb === 0))
2118
+ if (x.some((v) => v.sizeKb === 0))
2114
2119
  return {
2115
2120
  reason: "empty",
2116
- file: x.find((b) => b.sizeKb === 0),
2121
+ file: x.find((v) => v.sizeKb === 0),
2117
2122
  error: {
2118
2123
  type: "validate",
2119
2124
  message: m("validation_file_empty")
@@ -2125,7 +2130,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2125
2130
  error: {
2126
2131
  type: "max",
2127
2132
  message: m("validation_file_size", {
2128
- size: He(e.config.fileSizeLimitKib)
2133
+ size: ze(e.config.fileSizeLimitKib)
2129
2134
  })
2130
2135
  }
2131
2136
  };
@@ -2139,14 +2144,14 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2139
2144
  })
2140
2145
  }
2141
2146
  };
2142
- }, E = (x, b) => {
2143
- var F, L;
2147
+ }, I = (x, v) => {
2148
+ var E, N;
2144
2149
  return t.log({
2145
2150
  event: "INTERACTION",
2146
2151
  properties: {
2147
- tag: xa(x, b, e.config.extensions)
2152
+ tag: wa(x, v, e.config.extensions)
2148
2153
  },
2149
- customProperties: (L = (F = H.current$.peek().flow) == null ? void 0 : F.analytics) == null ? void 0 : L.customProperties
2154
+ customProperties: (N = (E = U.current$.peek().flow) == null ? void 0 : E.analytics) == null ? void 0 : N.customProperties
2150
2155
  });
2151
2156
  };
2152
2157
  return c("form", {
@@ -2154,10 +2159,10 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2154
2159
  onSubmit: (x) => {
2155
2160
  if (x.preventDefault(), s.status === "pending" || s.status === "error")
2156
2161
  return;
2157
- const b = _(o);
2158
- b ? i({
2162
+ const v = k(o);
2163
+ v ? i({
2159
2164
  status: "error",
2160
- error: b.error
2165
+ error: v.error
2161
2166
  }) : r({
2162
2167
  type: "file",
2163
2168
  value: o
@@ -2172,19 +2177,19 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2172
2177
  children: [u.length > 0 ? c("ul", {
2173
2178
  class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
2174
2179
  children: [u.slice(0, pr).map((x) => {
2175
- const [b, F] = kt(x.name);
2180
+ const [v, E] = _t(x.name);
2176
2181
  return c(mr, {
2177
2182
  class: "flex overflow-hidden",
2178
2183
  children: [c("span", {
2179
2184
  class: "block truncate",
2180
- children: b
2185
+ children: v
2181
2186
  }), c("span", {
2182
- children: F
2187
+ children: E
2183
2188
  })]
2184
2189
  });
2185
- }), g > 0 ? c(mr, {
2190
+ }), b > 0 ? c(mr, {
2186
2191
  children: m("file_more", {
2187
- count: g
2192
+ count: b
2188
2193
  })
2189
2194
  }) : null]
2190
2195
  }) : c("div", {
@@ -2212,7 +2217,7 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2212
2217
  }), e.config.fileSizeLimitKib ? c("p", {
2213
2218
  class: "text-neutral-11 text-xs",
2214
2219
  children: ["(", m("file_max_size", {
2215
- size: He(e.config.fileSizeLimitKib)
2220
+ size: ze(e.config.fileSizeLimitKib)
2216
2221
  }), ")"]
2217
2222
  }) : null]
2218
2223
  }), c("aside", {
@@ -2232,18 +2237,18 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2232
2237
  })]
2233
2238
  }), c("p", {
2234
2239
  role: "status",
2235
- class: Xe("text-neutral-11 flex items-center gap-1.5 text-xs", u.length === 0 && "sr-only"),
2236
- children: s.status === "pending" ? c(Ce, {
2240
+ class: Ze("text-neutral-11 flex items-center gap-1.5 text-xs", u.length === 0 && "sr-only"),
2241
+ children: s.status === "pending" ? c(ke, {
2237
2242
  children: [c(qt, {
2238
2243
  "aria-hidden": "true",
2239
2244
  class: "h-4 w-4"
2240
2245
  }), m("file_preparing", {
2241
2246
  count: u.length
2242
2247
  })]
2243
- }) : s.status === "ready" ? c(Ce, {
2248
+ }) : s.status === "ready" ? c(ke, {
2244
2249
  children: [o.length > 1 ? m("file_total_size", {
2245
- size: He(y)
2246
- }) : He(y), c("span", {
2250
+ size: ze(y)
2251
+ }) : ze(y), c("span", {
2247
2252
  class: "sr-only",
2248
2253
  children: [". ", m("file_ready", {
2249
2254
  count: o.length
@@ -2256,46 +2261,46 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2256
2261
  count: e.config.allowMultiple ? 2 : 1
2257
2262
  }),
2258
2263
  onInput: async (x) => {
2259
- Be(x.target instanceof HTMLInputElement);
2260
- const b = x.target.files ? Array.from(x.target.files) : [];
2264
+ je(x.target instanceof HTMLInputElement);
2265
+ const v = x.target.files ? Array.from(x.target.files) : [];
2261
2266
  x.target.value = "";
2262
- const [F] = b;
2263
- if (!F)
2267
+ const [E] = v;
2268
+ if (!E)
2264
2269
  return;
2265
- const L = ++a.current, V = s.status === "ready", T = b.map(yr), N = _(T);
2266
- if (N)
2267
- return E(N.reason, N.file ?? F), i({
2270
+ const N = ++a.current, M = s.status === "ready", L = v.map(yr), R = k(L);
2271
+ if (R)
2272
+ return I(R.reason, R.file ?? E), i({
2268
2273
  status: "error",
2269
- error: N.error
2274
+ error: R.error
2270
2275
  });
2271
2276
  i({
2272
2277
  status: "pending",
2273
- files: T
2278
+ files: L
2274
2279
  });
2275
- let O;
2280
+ let W;
2276
2281
  try {
2277
- const $ = await Promise.all(b.map(async (P) => {
2282
+ const j = await Promise.all(v.map(async (O) => {
2278
2283
  try {
2279
2284
  return {
2280
- ...yr(P),
2281
- data: await ma(P)
2285
+ ...yr(O),
2286
+ data: await ya(O)
2282
2287
  };
2283
- } catch (G) {
2284
- throw O ?? (O = P), G;
2288
+ } catch (z) {
2289
+ throw W ?? (W = O), z;
2285
2290
  }
2286
2291
  }));
2287
- a.current === L && i({
2292
+ a.current === N && i({
2288
2293
  status: "ready",
2289
- files: $
2294
+ files: j
2290
2295
  });
2291
2296
  } catch {
2292
- if (a.current !== L)
2297
+ if (a.current !== N)
2293
2298
  return;
2294
- E("unreadable", O ?? F), i({
2299
+ I("unreadable", W ?? E), i({
2295
2300
  status: "error",
2296
2301
  error: {
2297
2302
  type: "invalid",
2298
- message: m(V ? "file_read_error_replacement" : "file_read_error")
2303
+ message: m(M ? "file_read_error_replacement" : "file_read_error")
2299
2304
  }
2300
2305
  });
2301
2306
  }
@@ -2307,59 +2312,59 @@ const Ze = wt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2307
2312
  })]
2308
2313
  }), c("div", {
2309
2314
  class: "flex h-full flex-col items-center gap-2",
2310
- children: [c(je, {
2315
+ children: [c($e, {
2311
2316
  disabled: o.length === 0
2312
- }), e.config.optional && c(Ne, {
2317
+ }), e.config.optional && c(De, {
2313
2318
  class: "relative",
2314
2319
  onClick: () => r(null)
2315
2320
  })]
2316
2321
  })]
2317
- }), c(Qe, {
2322
+ }), c(Ye, {
2318
2323
  error: f
2319
2324
  })]
2320
2325
  });
2321
2326
  };
2322
- var ft = (e) => e.type === "checkbox", Oe = (e) => e instanceof Date, ae = (e) => e == null;
2327
+ var ct = (e) => e.type === "checkbox", Be = (e) => e instanceof Date, ie = (e) => e == null;
2323
2328
  const hn = (e) => typeof e == "object";
2324
- var X = (e) => !ae(e) && !Array.isArray(e) && hn(e) && !Oe(e), _a = (e) => X(e) && e.target ? ft(e.target) ? e.target.checked : e.target.value : e, ka = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ca = (e, r) => e.has(ka(r)), Sa = (e) => {
2329
+ var Y = (e) => !ie(e) && !Array.isArray(e) && hn(e) && !Be(e), ka = (e) => Y(e) && e.target ? ct(e.target) ? e.target.checked : e.target.value : e, Ca = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Sa = (e, r) => e.has(Ca(r)), Ia = (e) => {
2325
2330
  const r = e.constructor && e.constructor.prototype;
2326
- return X(r) && r.hasOwnProperty("isPrototypeOf");
2331
+ return Y(r) && r.hasOwnProperty("isPrototypeOf");
2327
2332
  }, Jt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2328
- function Q(e) {
2333
+ function ee(e) {
2329
2334
  if (e instanceof Date)
2330
2335
  return new Date(e);
2331
2336
  const r = typeof FileList < "u" && e instanceof FileList;
2332
2337
  if (Jt && (e instanceof Blob || r))
2333
2338
  return e;
2334
2339
  const t = Array.isArray(e);
2335
- if (!t && !(X(e) && Sa(e)))
2340
+ if (!t && !(Y(e) && Ia(e)))
2336
2341
  return e;
2337
2342
  const n = t ? [] : Object.create(Object.getPrototypeOf(e));
2338
2343
  for (const s in e)
2339
- Object.prototype.hasOwnProperty.call(e, s) && (n[s] = Q(e[s]));
2344
+ Object.prototype.hasOwnProperty.call(e, s) && (n[s] = ee(e[s]));
2340
2345
  return n;
2341
2346
  }
2342
- var Ct = (e) => /^\w*$/.test(e), J = (e) => e === void 0, Zt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Xt = (e) => Zt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2343
- if (!r || !X(e))
2347
+ var kt = (e) => /^\w*$/.test(e), J = (e) => e === void 0, Zt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Xt = (e) => Zt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2348
+ if (!r || !Y(e))
2344
2349
  return t;
2345
- const n = (Ct(r) ? [r] : Xt(r)).reduce((s, i) => ae(s) ? s : s[i], e);
2350
+ const n = (kt(r) ? [r] : Xt(r)).reduce((s, i) => ie(s) ? s : s[i], e);
2346
2351
  return J(n) || n === e ? J(e[r]) ? t : e[r] : n;
2347
- }, me = (e) => typeof e == "boolean", de = (e) => typeof e == "function", K = (e, r, t) => {
2352
+ }, me = (e) => typeof e == "boolean", de = (e) => typeof e == "function", H = (e, r, t) => {
2348
2353
  let n = -1;
2349
- const s = Ct(r) ? [r] : Xt(r), i = s.length, a = i - 1;
2354
+ const s = kt(r) ? [r] : Xt(r), i = s.length, a = i - 1;
2350
2355
  for (; ++n < i; ) {
2351
2356
  const o = s[n];
2352
2357
  let u = t;
2353
2358
  if (n !== a) {
2354
2359
  const f = e[o];
2355
- u = X(f) || Array.isArray(f) ? f : isNaN(+s[n + 1]) ? {} : [];
2360
+ u = Y(f) || Array.isArray(f) ? f : isNaN(+s[n + 1]) ? {} : [];
2356
2361
  }
2357
2362
  if (o === "__proto__" || o === "constructor" || o === "prototype")
2358
2363
  return;
2359
2364
  e[o] = u, e = e[o];
2360
2365
  }
2361
2366
  };
2362
- const gr = {
2367
+ const br = {
2363
2368
  BLUR: "blur",
2364
2369
  FOCUS_OUT: "focusout",
2365
2370
  CHANGE: "change"
@@ -2369,7 +2374,7 @@ const gr = {
2369
2374
  onSubmit: "onSubmit",
2370
2375
  onTouched: "onTouched",
2371
2376
  all: "all"
2372
- }, we = {
2377
+ }, xe = {
2373
2378
  max: "max",
2374
2379
  min: "min",
2375
2380
  maxLength: "maxLength",
@@ -2377,9 +2382,9 @@ const gr = {
2377
2382
  pattern: "pattern",
2378
2383
  required: "required",
2379
2384
  validate: "validate"
2380
- }, Ea = ne.createContext(null);
2381
- Ea.displayName = "HookFormControlContext";
2382
- var Aa = (e, r, t, n = !0) => {
2385
+ }, Aa = se.createContext(null);
2386
+ Aa.displayName = "HookFormControlContext";
2387
+ var Ea = (e, r, t, n = !0) => {
2383
2388
  const s = {
2384
2389
  defaultValues: r._defaultValues
2385
2390
  };
@@ -2392,12 +2397,12 @@ var Aa = (e, r, t, n = !0) => {
2392
2397
  });
2393
2398
  return s;
2394
2399
  };
2395
- const Ia = typeof window < "u" ? ne.useLayoutEffect : ne.useEffect;
2396
- var le = (e) => typeof e == "string", Fa = (e, r, t, n, s) => le(e) ? (n && r.watch.add(e), S(t, e, s)) : Array.isArray(e) ? e.map((i) => (n && r.watch.add(i), S(t, i))) : (n && (r.watchAll = !0), t), Pt = (e) => ae(e) || !hn(e);
2397
- function Me(e, r, t = /* @__PURE__ */ new WeakSet()) {
2398
- if (Pt(e) || Pt(r))
2400
+ const Fa = typeof window < "u" ? se.useLayoutEffect : se.useEffect;
2401
+ var ue = (e) => typeof e == "string", Va = (e, r, t, n, s) => ue(e) ? (n && r.watch.add(e), S(t, e, s)) : Array.isArray(e) ? e.map((i) => (n && r.watch.add(i), S(t, i))) : (n && (r.watchAll = !0), t), $t = (e) => ie(e) || !hn(e);
2402
+ function Le(e, r, t = /* @__PURE__ */ new WeakSet()) {
2403
+ if ($t(e) || $t(r))
2399
2404
  return Object.is(e, r);
2400
- if (Oe(e) && Oe(r))
2405
+ if (Be(e) && Be(r))
2401
2406
  return Object.is(e.getTime(), r.getTime());
2402
2407
  const n = Object.keys(e), s = Object.keys(r);
2403
2408
  if (n.length !== s.length)
@@ -2411,21 +2416,21 @@ function Me(e, r, t = /* @__PURE__ */ new WeakSet()) {
2411
2416
  return !1;
2412
2417
  if (i !== "ref") {
2413
2418
  const o = r[i];
2414
- if (Oe(a) && Oe(o) || X(a) && X(o) || Array.isArray(a) && Array.isArray(o) ? !Me(a, o, t) : !Object.is(a, o))
2419
+ if (Be(a) && Be(o) || Y(a) && Y(o) || Array.isArray(a) && Array.isArray(o) ? !Le(a, o, t) : !Object.is(a, o))
2415
2420
  return !1;
2416
2421
  }
2417
2422
  }
2418
2423
  return !0;
2419
2424
  }
2420
- const Va = ne.createContext(null);
2421
- Va.displayName = "HookFormContext";
2425
+ const Ma = se.createContext(null);
2426
+ Ma.displayName = "HookFormContext";
2422
2427
  var pn = (e, r, t, n, s) => r ? {
2423
2428
  ...t[e],
2424
2429
  types: {
2425
2430
  ...t[e] && t[e].types ? t[e].types : {},
2426
2431
  [n]: s || !0
2427
2432
  }
2428
- } : {}, ut = (e) => Array.isArray(e) ? e : [e], br = () => {
2433
+ } : {}, ot = (e) => Array.isArray(e) ? e : [e], gr = () => {
2429
2434
  let e = [];
2430
2435
  return {
2431
2436
  get observers() {
@@ -2450,62 +2455,62 @@ function mn(e, r) {
2450
2455
  for (const n in e)
2451
2456
  if (e.hasOwnProperty(n)) {
2452
2457
  const s = e[n], i = r[n];
2453
- if (s && X(s) && i) {
2458
+ if (s && Y(s) && i) {
2454
2459
  const a = mn(s, i);
2455
- X(a) && (t[n] = a);
2460
+ Y(a) && (t[n] = a);
2456
2461
  } else
2457
2462
  e[n] && (t[n] = i);
2458
2463
  }
2459
2464
  return t;
2460
2465
  }
2461
- var se = (e) => X(e) && !Object.keys(e).length, Yt = (e) => e.type === "file", bt = (e) => {
2466
+ var ae = (e) => Y(e) && !Object.keys(e).length, Yt = (e) => e.type === "file", bt = (e) => {
2462
2467
  if (!Jt)
2463
2468
  return !1;
2464
2469
  const r = e ? e.ownerDocument : 0;
2465
2470
  return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
2466
- }, yn = (e) => e.type === "select-multiple", Qt = (e) => e.type === "radio", Ma = (e) => Qt(e) || ft(e), Rt = (e) => bt(e) && e.isConnected;
2467
- function La(e, r) {
2471
+ }, yn = (e) => e.type === "select-multiple", Qt = (e) => e.type === "radio", La = (e) => Qt(e) || ct(e), Dt = (e) => bt(e) && e.isConnected;
2472
+ function Na(e, r) {
2468
2473
  const t = r.slice(0, -1).length;
2469
2474
  let n = 0;
2470
2475
  for (; n < t; )
2471
2476
  e = J(e) ? n++ : e[r[n++]];
2472
2477
  return e;
2473
2478
  }
2474
- function Da(e) {
2479
+ function Ra(e) {
2475
2480
  for (const r in e)
2476
2481
  if (e.hasOwnProperty(r) && !J(e[r]))
2477
2482
  return !1;
2478
2483
  return !0;
2479
2484
  }
2480
- function Z(e, r) {
2481
- const t = Array.isArray(r) ? r : Ct(r) ? [r] : Xt(r), n = t.length === 1 ? e : La(e, t), s = t.length - 1, i = t[s];
2482
- return n && delete n[i], s !== 0 && (X(n) && se(n) || Array.isArray(n) && Da(n)) && Z(e, t.slice(0, -1)), e;
2485
+ function X(e, r) {
2486
+ const t = Array.isArray(r) ? r : kt(r) ? [r] : Xt(r), n = t.length === 1 ? e : Na(e, t), s = t.length - 1, i = t[s];
2487
+ return n && delete n[i], s !== 0 && (Y(n) && ae(n) || Array.isArray(n) && Ra(n)) && X(e, t.slice(0, -1)), e;
2483
2488
  }
2484
- var Na = (e) => {
2489
+ var Da = (e) => {
2485
2490
  for (const r in e)
2486
2491
  if (de(e[r]))
2487
2492
  return !0;
2488
2493
  return !1;
2489
2494
  };
2490
- function gn(e) {
2491
- return Array.isArray(e) || X(e) && !Na(e);
2495
+ function bn(e) {
2496
+ return Array.isArray(e) || Y(e) && !Da(e);
2492
2497
  }
2493
- function $t(e, r = {}) {
2498
+ function Pt(e, r = {}) {
2494
2499
  for (const t in e) {
2495
2500
  const n = e[t];
2496
- gn(n) ? (r[t] = Array.isArray(n) ? [] : {}, $t(n, r[t])) : J(n) || (r[t] = !0);
2501
+ bn(n) ? (r[t] = Array.isArray(n) ? [] : {}, Pt(n, r[t])) : J(n) || (r[t] = !0);
2497
2502
  }
2498
2503
  return r;
2499
2504
  }
2500
- function ze(e, r, t) {
2501
- t || (t = $t(r));
2505
+ function We(e, r, t) {
2506
+ t || (t = Pt(r));
2502
2507
  for (const n in e) {
2503
2508
  const s = e[n];
2504
- if (gn(s))
2505
- J(r) || Pt(t[n]) ? t[n] = $t(s, Array.isArray(s) ? [] : {}) : ze(s, ae(r) ? {} : r[n], t[n]);
2509
+ if (bn(s))
2510
+ J(r) || $t(t[n]) ? t[n] = Pt(s, Array.isArray(s) ? [] : {}) : We(s, ie(r) ? {} : r[n], t[n]);
2506
2511
  else {
2507
2512
  const i = r[n];
2508
- t[n] = !Me(s, i);
2513
+ t[n] = !Le(s, i);
2509
2514
  }
2510
2515
  }
2511
2516
  return t;
@@ -2514,7 +2519,7 @@ const vr = {
2514
2519
  value: !1,
2515
2520
  isValid: !1
2516
2521
  }, xr = { value: !0, isValid: !0 };
2517
- var bn = (e) => {
2522
+ var gn = (e) => {
2518
2523
  if (Array.isArray(e)) {
2519
2524
  if (e.length > 1) {
2520
2525
  const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
@@ -2526,7 +2531,7 @@ var bn = (e) => {
2526
2531
  ) : vr;
2527
2532
  }
2528
2533
  return vr;
2529
- }, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => J(e) ? e : r ? e === "" ? NaN : e && +e : t && le(e) ? new Date(e) : n ? n(e) : e;
2534
+ }, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => J(e) ? e : r ? e === "" ? NaN : e && +e : t && ue(e) ? new Date(e) : n ? n(e) : e;
2530
2535
  const wr = {
2531
2536
  isValid: !1,
2532
2537
  value: null
@@ -2537,13 +2542,13 @@ var xn = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
2537
2542
  } : r, wr) : wr;
2538
2543
  function _r(e) {
2539
2544
  const r = e.ref;
2540
- return Yt(r) ? r.files : Qt(r) ? xn(e.refs).value : yn(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ft(r) ? bn(e.refs).value : vn(J(r.value) ? e.ref.value : r.value, e);
2545
+ return Yt(r) ? r.files : Qt(r) ? xn(e.refs).value : yn(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ct(r) ? gn(e.refs).value : vn(J(r.value) ? e.ref.value : r.value, e);
2541
2546
  }
2542
- var Ra = (e, r, t, n) => {
2547
+ var Ta = (e, r, t, n) => {
2543
2548
  const s = {};
2544
2549
  for (const i of e) {
2545
2550
  const a = S(r, i);
2546
- a && K(s, i, a._f);
2551
+ a && H(s, i, a._f);
2547
2552
  }
2548
2553
  return {
2549
2554
  criteriaMode: t,
@@ -2551,7 +2556,7 @@ var Ra = (e, r, t, n) => {
2551
2556
  fields: s,
2552
2557
  shouldUseNativeValidation: n
2553
2558
  };
2554
- }, vt = (e) => e instanceof RegExp, it = (e) => J(e) ? e : vt(e) ? e.source : X(e) ? vt(e.value) ? e.value.source : e.value : e, kr = (e) => ({
2559
+ }, gt = (e) => e instanceof RegExp, nt = (e) => J(e) ? e : gt(e) ? e.source : Y(e) ? gt(e.value) ? e.value.source : e.value : e, kr = (e) => ({
2555
2560
  isOnSubmit: !e || e === fe.onSubmit,
2556
2561
  isOnBlur: e === fe.onBlur,
2557
2562
  isOnChange: e === fe.onChange,
@@ -2559,8 +2564,8 @@ var Ra = (e, r, t, n) => {
2559
2564
  isOnTouch: e === fe.onTouched
2560
2565
  });
2561
2566
  const Cr = "AsyncFunction";
2562
- var Ta = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Cr || X(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Cr)), Oa = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Sr = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
2563
- const dt = (e, r, t, n) => {
2567
+ var Oa = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Cr || Y(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Cr)), Ba = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Sr = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
2568
+ const lt = (e, r, t, n) => {
2564
2569
  for (const s of t || Object.keys(e)) {
2565
2570
  const i = S(e, s);
2566
2571
  if (i) {
@@ -2570,16 +2575,16 @@ const dt = (e, r, t, n) => {
2570
2575
  return !0;
2571
2576
  if (a.ref && r(a.ref, a.name) && !n)
2572
2577
  return !0;
2573
- if (dt(o, r))
2578
+ if (lt(o, r))
2574
2579
  break;
2575
- } else if (X(o) && dt(o, r))
2580
+ } else if (Y(o) && lt(o, r))
2576
2581
  break;
2577
2582
  }
2578
2583
  }
2579
2584
  };
2580
- function Er(e, r, t) {
2585
+ function Ir(e, r, t) {
2581
2586
  const n = S(e, t);
2582
- if (n || Ct(t))
2587
+ if (n || kt(t))
2583
2588
  return {
2584
2589
  error: n,
2585
2590
  name: t
@@ -2605,114 +2610,114 @@ function Er(e, r, t) {
2605
2610
  name: t
2606
2611
  };
2607
2612
  }
2608
- var Ba = (e, r, t, n) => {
2613
+ var ja = (e, r, t, n) => {
2609
2614
  t(e);
2610
2615
  const { name: s, ...i } = e;
2611
- return se(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || fe.all));
2612
- }, ja = (e, r, t) => !e || !r || e === r || ut(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), Pa = (e, r, t, n, s) => s.isOnAll ? !1 : !t && s.isOnTouch ? !(r || e) : (t ? n.isOnBlur : s.isOnBlur) ? !e : (t ? n.isOnChange : s.isOnChange) ? e : !0, $a = (e, r) => !Zt(S(e, r)).length && Z(e, r), qa = (e, r, t) => {
2613
- const n = ut(S(e, t));
2614
- return K(n, "root", r[t]), K(e, t, n), e;
2616
+ return ae(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || fe.all));
2617
+ }, $a = (e, r, t) => !e || !r || e === r || ot(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), Pa = (e, r, t, n, s) => s.isOnAll ? !1 : !t && s.isOnTouch ? !(r || e) : (t ? n.isOnBlur : s.isOnBlur) ? !e : (t ? n.isOnChange : s.isOnChange) ? e : !0, qa = (e, r) => !Zt(S(e, r)).length && X(e, r), Ua = (e, r, t) => {
2618
+ const n = ot(S(e, t));
2619
+ return H(n, "root", r[t]), H(e, t, n), e;
2615
2620
  };
2616
2621
  function Ar(e, r, t = "validate") {
2617
- if (le(e) || Array.isArray(e) && e.every(le) || me(e) && !e)
2622
+ if (ue(e) || Array.isArray(e) && e.every(ue) || me(e) && !e)
2618
2623
  return {
2619
2624
  type: t,
2620
- message: le(e) ? e : "",
2625
+ message: ue(e) ? e : "",
2621
2626
  ref: r
2622
2627
  };
2623
2628
  }
2624
- var We = (e) => X(e) && !vt(e) ? e : {
2629
+ var Ue = (e) => Y(e) && !gt(e) ? e : {
2625
2630
  value: e,
2626
2631
  message: ""
2627
- }, Ir = async (e, r, t, n, s, i) => {
2628
- const { ref: a, refs: o, required: u, maxLength: f, minLength: g, min: y, max: p, pattern: m, validate: _, name: E, valueAsNumber: C, mount: x } = e._f, b = S(t, E);
2629
- if (!x || r.has(E))
2632
+ }, Er = async (e, r, t, n, s, i) => {
2633
+ const { ref: a, refs: o, required: u, maxLength: f, minLength: b, min: y, max: p, pattern: m, validate: k, name: I, valueAsNumber: C, mount: x } = e._f, v = S(t, I);
2634
+ if (!x || r.has(I))
2630
2635
  return {};
2631
- const F = o ? o[0] : a, L = (M) => {
2632
- s && F.reportValidity && (F.setCustomValidity(me(M) ? "" : M || ""), F.reportValidity());
2633
- }, V = {}, T = Qt(a), N = ft(a), O = T || N, $ = (C || Yt(a)) && J(a.value) && J(b) || bt(a) && a.value === "" || b === "" || Array.isArray(b) && !b.length, P = pn.bind(null, E, n, V), G = (M, A, B, q = we.maxLength, U = we.minLength) => {
2634
- const j = M ? A : B;
2635
- V[E] = {
2636
- type: M ? q : U,
2637
- message: j,
2636
+ const E = o ? o[0] : a, N = (V) => {
2637
+ s && E.reportValidity && (E.setCustomValidity(me(V) ? "" : V || ""), E.reportValidity());
2638
+ }, M = {}, L = Qt(a), R = ct(a), W = L || R, j = (C || Yt(a)) && J(a.value) && J(v) || bt(a) && a.value === "" || v === "" || Array.isArray(v) && !v.length, O = pn.bind(null, I, n, M), z = (V, A, T, $ = xe.maxLength, K = xe.minLength) => {
2639
+ const Z = V ? A : T;
2640
+ M[I] = {
2641
+ type: V ? $ : K,
2642
+ message: Z,
2638
2643
  ref: a,
2639
- ...P(M ? q : U, j)
2644
+ ...O(V ? $ : K, Z)
2640
2645
  };
2641
2646
  };
2642
- if (i ? !Array.isArray(b) || !b.length : u && (!O && ($ || ae(b)) || me(b) && !b || N && !bn(o).isValid || T && !xn(o).isValid)) {
2643
- const { value: M, message: A } = le(u) ? { value: !!u, message: u } : We(u);
2644
- if (M && (V[E] = {
2645
- type: we.required,
2647
+ if (i ? !Array.isArray(v) || !v.length : u && (!W && (j || ie(v)) || me(v) && !v || R && !gn(o).isValid || L && !xn(o).isValid)) {
2648
+ const { value: V, message: A } = ue(u) ? { value: !!u, message: u } : Ue(u);
2649
+ if (V && (M[I] = {
2650
+ type: xe.required,
2646
2651
  message: A,
2647
- ref: F,
2648
- ...P(we.required, A)
2652
+ ref: E,
2653
+ ...O(xe.required, A)
2649
2654
  }, !n))
2650
- return L(A), V;
2655
+ return N(A), M;
2651
2656
  }
2652
- if (!$ && (!ae(y) || !ae(p))) {
2653
- let M, A;
2654
- const B = We(p), q = We(y);
2655
- if (!ae(b) && !isNaN(b)) {
2656
- const U = a.valueAsNumber || b && +b;
2657
- ae(B.value) || (M = U > B.value), ae(q.value) || (A = U < q.value);
2657
+ if (!j && (!ie(y) || !ie(p))) {
2658
+ let V, A;
2659
+ const T = Ue(p), $ = Ue(y);
2660
+ if (!ie(v) && !isNaN(v)) {
2661
+ const K = a.valueAsNumber || v && +v;
2662
+ ie(T.value) || (V = K > T.value), ie($.value) || (A = K < $.value);
2658
2663
  } else {
2659
- const U = a.valueAsDate || new Date(b), j = (ce) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ce), Se = a.type == "time", R = a.type == "week";
2660
- le(B.value) && b && (M = Se ? j(b) > j(B.value) : R ? b > B.value : U > new Date(B.value)), le(q.value) && b && (A = Se ? j(b) < j(q.value) : R ? b < q.value : U < new Date(q.value));
2664
+ const K = a.valueAsDate || new Date(v), Z = (Ce) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Ce), le = a.type == "time", G = a.type == "week";
2665
+ ue(T.value) && v && (V = le ? Z(v) > Z(T.value) : G ? v > T.value : K > new Date(T.value)), ue($.value) && v && (A = le ? Z(v) < Z($.value) : G ? v < $.value : K < new Date($.value));
2661
2666
  }
2662
- if ((M || A) && (G(!!M, B.message, q.message, we.max, we.min), !n))
2663
- return L(V[E].message), V;
2667
+ if ((V || A) && (z(!!V, T.message, $.message, xe.max, xe.min), !n))
2668
+ return N(M[I].message), M;
2664
2669
  }
2665
- if ((f || g) && !$ && (le(b) || i && Array.isArray(b))) {
2666
- const M = We(f), A = We(g), B = !ae(M.value) && b.length > +M.value, q = !ae(A.value) && b.length < +A.value;
2667
- if ((B || q) && (G(B, M.message, A.message), !n))
2668
- return L(V[E].message), V;
2670
+ if ((f || b) && !j && (ue(v) || i && Array.isArray(v))) {
2671
+ const V = Ue(f), A = Ue(b), T = !ie(V.value) && v.length > +V.value, $ = !ie(A.value) && v.length < +A.value;
2672
+ if ((T || $) && (z(T, V.message, A.message), !n))
2673
+ return N(M[I].message), M;
2669
2674
  }
2670
- if (m && !$ && le(b)) {
2671
- const { value: M, message: A } = We(m);
2672
- if (vt(M) && !b.match(M) && (V[E] = {
2673
- type: we.pattern,
2675
+ if (m && !j && ue(v)) {
2676
+ const { value: V, message: A } = Ue(m);
2677
+ if (gt(V) && !v.match(V) && (M[I] = {
2678
+ type: xe.pattern,
2674
2679
  message: A,
2675
2680
  ref: a,
2676
- ...P(we.pattern, A)
2681
+ ...O(xe.pattern, A)
2677
2682
  }, !n))
2678
- return L(A), V;
2683
+ return N(A), M;
2679
2684
  }
2680
- if (_) {
2681
- if (de(_)) {
2682
- const M = await _(b, t), A = Ar(M, F);
2683
- if (A && (V[E] = {
2685
+ if (k) {
2686
+ if (de(k)) {
2687
+ const V = await k(v, t), A = Ar(V, E);
2688
+ if (A && (M[I] = {
2684
2689
  ...A,
2685
- ...P(we.validate, A.message)
2690
+ ...O(xe.validate, A.message)
2686
2691
  }, !n))
2687
- return L(A.message), V;
2688
- } else if (X(_)) {
2689
- let M = {};
2690
- for (const A in _) {
2691
- if (!se(M) && !n)
2692
+ return N(A.message), M;
2693
+ } else if (Y(k)) {
2694
+ let V = {};
2695
+ for (const A in k) {
2696
+ if (!ae(V) && !n)
2692
2697
  break;
2693
- const B = Ar(await _[A](b, t), F, A);
2694
- B && (M = {
2695
- ...B,
2696
- ...P(A, B.message)
2697
- }, L(B.message), n && (V[E] = M));
2698
+ const T = Ar(await k[A](v, t), E, A);
2699
+ T && (V = {
2700
+ ...T,
2701
+ ...O(A, T.message)
2702
+ }, N(T.message), n && (M[I] = V));
2698
2703
  }
2699
- if (!se(M) && (V[E] = {
2700
- ref: F,
2701
- ...M
2704
+ if (!ae(V) && (M[I] = {
2705
+ ref: E,
2706
+ ...V
2702
2707
  }, !n))
2703
- return V;
2708
+ return M;
2704
2709
  }
2705
2710
  }
2706
- return L(!0), V;
2711
+ return N(!0), M;
2707
2712
  };
2708
- const Ua = {
2713
+ const Wa = {
2709
2714
  mode: fe.onSubmit,
2710
2715
  reValidateMode: fe.onChange,
2711
2716
  shouldFocusError: !0
2712
2717
  };
2713
- function Wa(e = {}) {
2718
+ function za(e = {}) {
2714
2719
  let r = {
2715
- ...Ua,
2720
+ ...Wa,
2716
2721
  ...e
2717
2722
  }, t = {
2718
2723
  submitCount: 0,
@@ -2729,7 +2734,7 @@ function Wa(e = {}) {
2729
2734
  validatingFields: {},
2730
2735
  errors: r.errors || {},
2731
2736
  disabled: r.disabled || !1
2732
- }, n = {}, s = X(r.defaultValues) || X(r.values) ? Q(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : Q(s), a = {
2737
+ }, n = {}, s = Y(r.defaultValues) || Y(r.values) ? ee(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : ee(s), a = {
2733
2738
  action: !1,
2734
2739
  mount: !1,
2735
2740
  watch: !1,
@@ -2741,7 +2746,7 @@ function Wa(e = {}) {
2741
2746
  array: /* @__PURE__ */ new Set(),
2742
2747
  watch: /* @__PURE__ */ new Set()
2743
2748
  }, u, f = 0;
2744
- const g = {
2749
+ const b = {
2745
2750
  isDirty: !1,
2746
2751
  dirtyFields: !1,
2747
2752
  validatingFields: !1,
@@ -2750,235 +2755,235 @@ function Wa(e = {}) {
2750
2755
  isValid: !1,
2751
2756
  errors: !1
2752
2757
  }, y = {
2753
- ...g
2758
+ ...b
2754
2759
  };
2755
2760
  let p = {
2756
2761
  ...y
2757
2762
  };
2758
2763
  const m = {
2759
- array: br(),
2760
- state: br()
2761
- }, _ = r.criteriaMode === fe.all, E = (l) => (d) => {
2764
+ array: gr(),
2765
+ state: gr()
2766
+ }, k = r.criteriaMode === fe.all, I = (l) => (d) => {
2762
2767
  clearTimeout(f), f = setTimeout(l, d);
2763
2768
  }, C = async (l) => {
2764
2769
  if (!a.keepIsValid && !r.disabled && (y.isValid || p.isValid || l)) {
2765
2770
  let d;
2766
- r.resolver ? (d = se((await O()).errors), x()) : d = await P(n, !0), d !== t.isValid && m.state.next({
2771
+ r.resolver ? (d = ae((await W()).errors), x()) : d = await O(n, !0), d !== t.isValid && m.state.next({
2767
2772
  isValid: d
2768
2773
  });
2769
2774
  }
2770
2775
  }, x = (l, d) => {
2771
2776
  !r.disabled && (y.isValidating || y.validatingFields || p.isValidating || p.validatingFields) && ((l || Array.from(o.mount)).forEach((h) => {
2772
- h && (d ? K(t.validatingFields, h, d) : Z(t.validatingFields, h));
2777
+ h && (d ? H(t.validatingFields, h, d) : X(t.validatingFields, h));
2773
2778
  }), m.state.next({
2774
2779
  validatingFields: t.validatingFields,
2775
- isValidating: !se(t.validatingFields)
2780
+ isValidating: !ae(t.validatingFields)
2776
2781
  }));
2777
- }, b = (l, d = [], h, k, w = !0, v = !0) => {
2778
- if (k && h && !r.disabled) {
2779
- if (a.action = !0, v && Array.isArray(S(n, l))) {
2780
- const I = h(S(n, l), k.argA, k.argB);
2781
- w && K(n, l, I);
2782
+ }, v = (l, d = [], h, _, w = !0, g = !0) => {
2783
+ if (_ && h && !r.disabled) {
2784
+ if (a.action = !0, g && Array.isArray(S(n, l))) {
2785
+ const F = h(S(n, l), _.argA, _.argB);
2786
+ w && H(n, l, F);
2782
2787
  }
2783
- if (v && Array.isArray(S(t.errors, l))) {
2784
- const I = h(S(t.errors, l), k.argA, k.argB);
2785
- w && K(t.errors, l, I), $a(t.errors, l);
2788
+ if (g && Array.isArray(S(t.errors, l))) {
2789
+ const F = h(S(t.errors, l), _.argA, _.argB);
2790
+ w && H(t.errors, l, F), qa(t.errors, l);
2786
2791
  }
2787
- if ((y.touchedFields || p.touchedFields) && v && Array.isArray(S(t.touchedFields, l))) {
2788
- const I = h(S(t.touchedFields, l), k.argA, k.argB);
2789
- w && K(t.touchedFields, l, I);
2792
+ if ((y.touchedFields || p.touchedFields) && g && Array.isArray(S(t.touchedFields, l))) {
2793
+ const F = h(S(t.touchedFields, l), _.argA, _.argB);
2794
+ w && H(t.touchedFields, l, F);
2790
2795
  }
2791
- (y.dirtyFields || p.dirtyFields) && (t.dirtyFields = ze(s, i)), m.state.next({
2796
+ (y.dirtyFields || p.dirtyFields) && (t.dirtyFields = We(s, i)), m.state.next({
2792
2797
  name: l,
2793
- isDirty: M(l, d),
2798
+ isDirty: V(l, d),
2794
2799
  dirtyFields: t.dirtyFields,
2795
2800
  errors: t.errors,
2796
2801
  isValid: t.isValid
2797
2802
  });
2798
2803
  } else
2799
- K(i, l, d);
2800
- }, F = (l, d) => {
2801
- K(t.errors, l, d), m.state.next({
2804
+ H(i, l, d);
2805
+ }, E = (l, d) => {
2806
+ H(t.errors, l, d), m.state.next({
2802
2807
  errors: t.errors
2803
2808
  });
2804
- }, L = (l) => {
2809
+ }, N = (l) => {
2805
2810
  t.errors = l, m.state.next({
2806
2811
  errors: t.errors,
2807
2812
  isValid: !1
2808
2813
  });
2809
- }, V = (l, d, h, k) => {
2814
+ }, M = (l, d, h, _) => {
2810
2815
  const w = S(n, l);
2811
2816
  if (w) {
2812
- const v = S(i, l, J(h) ? S(s, l) : h);
2813
- J(v) || k && k.defaultChecked || d ? K(i, l, d ? v : _r(w._f)) : q(l, v), a.mount && !a.action && C();
2817
+ const g = S(i, l, J(h) ? S(s, l) : h);
2818
+ J(g) || _ && _.defaultChecked || d ? H(i, l, d ? g : _r(w._f)) : $(l, g), a.mount && !a.action && C();
2814
2819
  }
2815
- }, T = (l, d, h, k, w) => {
2816
- let v = !1, I = !1;
2817
- const W = {
2820
+ }, L = (l, d, h, _, w) => {
2821
+ let g = !1, F = !1;
2822
+ const P = {
2818
2823
  name: l
2819
2824
  };
2820
2825
  if (!r.disabled) {
2821
- if (!h || k) {
2822
- (y.isDirty || p.isDirty) && (I = t.isDirty, t.isDirty = W.isDirty = M(), v = I !== W.isDirty);
2823
- const z = Me(S(s, l), d);
2824
- I = !!S(t.dirtyFields, l), z ? Z(t.dirtyFields, l) : K(t.dirtyFields, l, !0), W.dirtyFields = t.dirtyFields, v = v || (y.dirtyFields || p.dirtyFields) && I !== !z;
2826
+ if (!h || _) {
2827
+ (y.isDirty || p.isDirty) && (F = t.isDirty, t.isDirty = P.isDirty = V(), g = F !== P.isDirty);
2828
+ const q = Le(S(s, l), d);
2829
+ F = !!S(t.dirtyFields, l), q ? X(t.dirtyFields, l) : H(t.dirtyFields, l, !0), P.dirtyFields = t.dirtyFields, g = g || (y.dirtyFields || p.dirtyFields) && F !== !q;
2825
2830
  }
2826
2831
  if (h) {
2827
- const z = S(t.touchedFields, l);
2828
- z || (K(t.touchedFields, l, h), W.touchedFields = t.touchedFields, v = v || (y.touchedFields || p.touchedFields) && z !== h);
2832
+ const q = S(t.touchedFields, l);
2833
+ q || (H(t.touchedFields, l, h), P.touchedFields = t.touchedFields, g = g || (y.touchedFields || p.touchedFields) && q !== h);
2829
2834
  }
2830
- v && w && m.state.next(W);
2835
+ g && w && m.state.next(P);
2831
2836
  }
2832
- return v ? W : {};
2833
- }, N = (l, d, h, k) => {
2834
- const w = S(t.errors, l), v = (y.isValid || p.isValid) && me(d) && t.isValid !== d;
2835
- if (r.delayError && h ? (u = E(() => F(l, h)), u(r.delayError)) : (clearTimeout(f), u = null, h ? K(t.errors, l, h) : Z(t.errors, l)), (h ? !Me(w, h) : w) || !se(k) || v) {
2836
- const I = {
2837
- ...k,
2838
- ...v && me(d) ? { isValid: d } : {},
2837
+ return g ? P : {};
2838
+ }, R = (l, d, h, _) => {
2839
+ const w = S(t.errors, l), g = (y.isValid || p.isValid) && me(d) && t.isValid !== d;
2840
+ if (r.delayError && h ? (u = I(() => E(l, h)), u(r.delayError)) : (clearTimeout(f), u = null, h ? H(t.errors, l, h) : X(t.errors, l)), (h ? !Le(w, h) : w) || !ae(_) || g) {
2841
+ const F = {
2842
+ ..._,
2843
+ ...g && me(d) ? { isValid: d } : {},
2839
2844
  errors: t.errors,
2840
2845
  name: l
2841
2846
  };
2842
2847
  t = {
2843
2848
  ...t,
2844
- ...I
2845
- }, m.state.next(I);
2849
+ ...F
2850
+ }, m.state.next(F);
2846
2851
  }
2847
- }, O = async (l) => (x(l, !0), await r.resolver(i, r.context, Ra(l || o.mount, n, r.criteriaMode, r.shouldUseNativeValidation))), $ = async (l) => {
2848
- const { errors: d } = await O(l);
2852
+ }, W = async (l) => (x(l, !0), await r.resolver(i, r.context, Ta(l || o.mount, n, r.criteriaMode, r.shouldUseNativeValidation))), j = async (l) => {
2853
+ const { errors: d } = await W(l);
2849
2854
  if (x(l), l)
2850
2855
  for (const h of l) {
2851
- const k = S(d, h);
2852
- k ? K(t.errors, h, k) : Z(t.errors, h);
2856
+ const _ = S(d, h);
2857
+ _ ? H(t.errors, h, _) : X(t.errors, h);
2853
2858
  }
2854
2859
  else
2855
2860
  t.errors = d;
2856
2861
  return d;
2857
- }, P = async (l, d, h = {
2862
+ }, O = async (l, d, h = {
2858
2863
  valid: !0
2859
2864
  }) => {
2860
- for (const k in l) {
2861
- const w = l[k];
2865
+ for (const _ in l) {
2866
+ const w = l[_];
2862
2867
  if (w) {
2863
- const { _f: v, ...I } = w;
2864
- if (v) {
2865
- const W = o.array.has(v.name), z = w._f && Ta(w._f);
2866
- z && y.validatingFields && x([v.name], !0);
2867
- const re = await Ir(w, o.disabled, i, _, r.shouldUseNativeValidation && !d, W);
2868
- if (z && y.validatingFields && x([v.name]), re[v.name] && (h.valid = !1, d || e.shouldUseNativeValidation))
2868
+ const { _f: g, ...F } = w;
2869
+ if (g) {
2870
+ const P = o.array.has(g.name), q = w._f && Oa(w._f);
2871
+ q && y.validatingFields && x([g.name], !0);
2872
+ const ne = await Er(w, o.disabled, i, k, r.shouldUseNativeValidation && !d, P);
2873
+ if (q && y.validatingFields && x([g.name]), ne[g.name] && (h.valid = !1, d || e.shouldUseNativeValidation))
2869
2874
  break;
2870
- !d && (S(re, v.name) ? W ? qa(t.errors, re, v.name) : K(t.errors, v.name, re[v.name]) : Z(t.errors, v.name));
2875
+ !d && (S(ne, g.name) ? P ? Ua(t.errors, ne, g.name) : H(t.errors, g.name, ne[g.name]) : X(t.errors, g.name));
2871
2876
  }
2872
- !se(I) && await P(I, d, h);
2877
+ !ae(F) && await O(F, d, h);
2873
2878
  }
2874
2879
  }
2875
2880
  return h.valid;
2876
- }, G = () => {
2881
+ }, z = () => {
2877
2882
  for (const l of o.unMount) {
2878
2883
  const d = S(n, l);
2879
- d && (d._f.refs ? d._f.refs.every((h) => !Rt(h)) : !Rt(d._f.ref)) && Ae(l);
2884
+ d && (d._f.refs ? d._f.refs.every((h) => !Dt(h)) : !Dt(d._f.ref)) && Pe(l);
2880
2885
  }
2881
2886
  o.unMount = /* @__PURE__ */ new Set();
2882
- }, M = (l, d) => !r.disabled && (l && d && K(i, l, d), !Me(Ee(), s)), A = (l, d, h) => Fa(l, o, {
2883
- ...a.mount ? i : J(d) ? s : le(l) ? { [l]: d } : d
2884
- }, h, d), B = (l) => Zt(S(a.mount ? i : s, l, r.shouldUnregister ? S(s, l, []) : [])), q = (l, d, h = {}) => {
2885
- const k = S(n, l);
2887
+ }, V = (l, d) => !r.disabled && (l && d && H(i, l, d), !Le(Qe(), s)), A = (l, d, h) => Va(l, o, {
2888
+ ...a.mount ? i : J(d) ? s : ue(l) ? { [l]: d } : d
2889
+ }, h, d), T = (l) => Zt(S(a.mount ? i : s, l, r.shouldUnregister ? S(s, l, []) : [])), $ = (l, d, h = {}) => {
2890
+ const _ = S(n, l);
2886
2891
  let w = d;
2887
- if (k) {
2888
- const v = k._f;
2889
- v && (!v.disabled && K(i, l, vn(d, v)), w = bt(v.ref) && ae(d) ? "" : d, yn(v.ref) ? [...v.ref.options].forEach((I) => I.selected = w.includes(I.value)) : v.refs ? ft(v.ref) ? v.refs.forEach((I) => {
2890
- (!I.defaultChecked || !I.disabled) && (Array.isArray(w) ? I.checked = !!w.find((W) => W === I.value) : I.checked = w === I.value || !!w);
2891
- }) : v.refs.forEach((I) => I.checked = I.value === w) : Yt(v.ref) ? v.ref.value = "" : (v.ref.value = w, v.ref.type || m.state.next({
2892
+ if (_) {
2893
+ const g = _._f;
2894
+ g && (!g.disabled && H(i, l, vn(d, g)), w = bt(g.ref) && ie(d) ? "" : d, yn(g.ref) ? [...g.ref.options].forEach((F) => F.selected = w.includes(F.value)) : g.refs ? ct(g.ref) ? g.refs.forEach((F) => {
2895
+ (!F.defaultChecked || !F.disabled) && (Array.isArray(w) ? F.checked = !!w.find((P) => P === F.value) : F.checked = w === F.value || !!w);
2896
+ }) : g.refs.forEach((F) => F.checked = F.value === w) : Yt(g.ref) ? g.ref.value = "" : (g.ref.value = w, g.ref.type || m.state.next({
2892
2897
  name: l,
2893
- values: Q(i)
2898
+ values: ee(i)
2894
2899
  })));
2895
2900
  }
2896
- (h.shouldDirty || h.shouldTouch) && T(l, w, h.shouldTouch, h.shouldDirty, !0), h.shouldValidate && ce(l);
2897
- }, U = (l, d, h) => {
2898
- for (const k in d) {
2899
- if (!d.hasOwnProperty(k))
2901
+ (h.shouldDirty || h.shouldTouch) && L(l, w, h.shouldTouch, h.shouldDirty, !0), h.shouldValidate && Ce(l);
2902
+ }, K = (l, d, h) => {
2903
+ for (const _ in d) {
2904
+ if (!d.hasOwnProperty(_))
2900
2905
  return;
2901
- const w = d[k], v = l + "." + k, I = S(n, v);
2902
- (o.array.has(l) || X(w) || I && !I._f) && !Oe(w) ? U(v, w, h) : q(v, w, h);
2906
+ const w = d[_], g = l + "." + _, F = S(n, g);
2907
+ (o.array.has(l) || Y(w) || F && !F._f) && !Be(w) ? K(g, w, h) : $(g, w, h);
2903
2908
  }
2904
- }, j = (l, d, h = {}) => {
2905
- const k = S(n, l), w = o.array.has(l), v = Q(d);
2906
- K(i, l, v), w ? (m.array.next({
2909
+ }, Z = (l, d, h = {}) => {
2910
+ const _ = S(n, l), w = o.array.has(l), g = ee(d);
2911
+ H(i, l, g), w ? (m.array.next({
2907
2912
  name: l,
2908
- values: Q(i)
2913
+ values: ee(i)
2909
2914
  }), (y.isDirty || y.dirtyFields || p.isDirty || p.dirtyFields) && h.shouldDirty && m.state.next({
2910
2915
  name: l,
2911
- dirtyFields: ze(s, i),
2912
- isDirty: M(l, v)
2913
- })) : k && !k._f && !ae(v) ? U(l, v, h) : q(l, v, h), Sr(l, o) ? m.state.next({
2916
+ dirtyFields: We(s, i),
2917
+ isDirty: V(l, g)
2918
+ })) : _ && !_._f && !ie(g) ? K(l, g, h) : $(l, g, h), Sr(l, o) ? m.state.next({
2914
2919
  ...t,
2915
2920
  name: l,
2916
- values: Q(i)
2921
+ values: ee(i)
2917
2922
  }) : m.state.next({
2918
2923
  name: a.mount ? l : void 0,
2919
- values: Q(i)
2924
+ values: ee(i)
2920
2925
  });
2921
- }, Se = async (l) => {
2926
+ }, le = async (l) => {
2922
2927
  a.mount = !0;
2923
2928
  const d = l.target;
2924
- let h = d.name, k = !0;
2925
- const w = S(n, h), v = (z) => {
2926
- k = Number.isNaN(z) || Oe(z) && isNaN(z.getTime()) || Me(z, S(i, h, z));
2927
- }, I = kr(r.mode), W = kr(r.reValidateMode);
2929
+ let h = d.name, _ = !0;
2930
+ const w = S(n, h), g = (q) => {
2931
+ _ = Number.isNaN(q) || Be(q) && isNaN(q.getTime()) || Le(q, S(i, h, q));
2932
+ }, F = kr(r.mode), P = kr(r.reValidateMode);
2928
2933
  if (w) {
2929
- let z, re;
2930
- const Te = d.type ? _r(w._f) : _a(l), Ie = l.type === gr.BLUR || l.type === gr.FOCUS_OUT, _n = !Oa(w._f) && !r.resolver && !S(t.errors, h) && !w._f.deps || Pa(Ie, S(t.touchedFields, h), t.isSubmitted, W, I), At = Sr(h, o, Ie);
2931
- K(i, h, Te), Ie ? (!d || !d.readOnly) && (w._f.onBlur && w._f.onBlur(l), u && u(0)) : w._f.onChange && w._f.onChange(l);
2932
- const It = T(h, Te, Ie), kn = !se(It) || At;
2933
- if (!Ie && m.state.next({
2934
+ let q, ne;
2935
+ const Oe = d.type ? _r(w._f) : ka(l), Fe = l.type === br.BLUR || l.type === br.FOCUS_OUT, _n = !Ba(w._f) && !r.resolver && !S(t.errors, h) && !w._f.deps || Pa(Fe, S(t.touchedFields, h), t.isSubmitted, P, F), At = Sr(h, o, Fe);
2936
+ H(i, h, Oe), Fe ? (!d || !d.readOnly) && (w._f.onBlur && w._f.onBlur(l), u && u(0)) : w._f.onChange && w._f.onChange(l);
2937
+ const Et = L(h, Oe, Fe), kn = !ae(Et) || At;
2938
+ if (!Fe && m.state.next({
2934
2939
  name: h,
2935
2940
  type: l.type,
2936
- values: Q(i)
2941
+ values: ee(i)
2937
2942
  }), _n)
2938
- return (y.isValid || p.isValid) && (r.mode === "onBlur" ? Ie && C() : Ie || C()), kn && m.state.next({ name: h, ...At ? {} : It });
2939
- if (!Ie && At && m.state.next({ ...t }), r.resolver) {
2940
- const { errors: er } = await O([h]);
2941
- if (x([h]), v(Te), k) {
2942
- const Cn = Er(t.errors, n, h), tr = Er(er, n, Cn.name || h);
2943
- z = tr.error, h = tr.name, re = se(er);
2943
+ return (y.isValid || p.isValid) && (r.mode === "onBlur" ? Fe && C() : Fe || C()), kn && m.state.next({ name: h, ...At ? {} : Et });
2944
+ if (!Fe && At && m.state.next({ ...t }), r.resolver) {
2945
+ const { errors: er } = await W([h]);
2946
+ if (x([h]), g(Oe), _) {
2947
+ const Cn = Ir(t.errors, n, h), tr = Ir(er, n, Cn.name || h);
2948
+ q = tr.error, h = tr.name, ne = ae(er);
2944
2949
  }
2945
2950
  } else
2946
- x([h], !0), z = (await Ir(w, o.disabled, i, _, r.shouldUseNativeValidation))[h], x([h]), v(Te), k && (z ? re = !1 : (y.isValid || p.isValid) && (re = await P(n, !0)));
2947
- k && (w._f.deps && (!Array.isArray(w._f.deps) || w._f.deps.length > 0) && ce(w._f.deps), N(h, re, z, It));
2951
+ x([h], !0), q = (await Er(w, o.disabled, i, k, r.shouldUseNativeValidation))[h], x([h]), g(Oe), _ && (q ? ne = !1 : (y.isValid || p.isValid) && (ne = await O(n, !0)));
2952
+ _ && (w._f.deps && (!Array.isArray(w._f.deps) || w._f.deps.length > 0) && Ce(w._f.deps), R(h, ne, q, Et));
2948
2953
  }
2949
- }, R = (l, d) => {
2954
+ }, G = (l, d) => {
2950
2955
  if (S(t.errors, d) && l.focus)
2951
2956
  return l.focus(), 1;
2952
- }, ce = async (l, d = {}) => {
2953
- let h, k;
2954
- const w = ut(l);
2957
+ }, Ce = async (l, d = {}) => {
2958
+ let h, _;
2959
+ const w = ot(l);
2955
2960
  if (r.resolver) {
2956
- const v = await $(J(l) ? l : w);
2957
- h = se(v), k = l ? !w.some((I) => S(v, I)) : h;
2961
+ const g = await j(J(l) ? l : w);
2962
+ h = ae(g), _ = l ? !w.some((F) => S(g, F)) : h;
2958
2963
  } else
2959
- l ? (k = (await Promise.all(w.map(async (v) => {
2960
- const I = S(n, v);
2961
- return await P(I && I._f ? { [v]: I } : I);
2962
- }))).every(Boolean), !(!k && !t.isValid) && C()) : k = h = await P(n);
2964
+ l ? (_ = (await Promise.all(w.map(async (g) => {
2965
+ const F = S(n, g);
2966
+ return await O(F && F._f ? { [g]: F } : F);
2967
+ }))).every(Boolean), !(!_ && !t.isValid) && C()) : _ = h = await O(n);
2963
2968
  return m.state.next({
2964
- ...!le(l) || (y.isValid || p.isValid) && h !== t.isValid ? {} : { name: l },
2969
+ ...!ue(l) || (y.isValid || p.isValid) && h !== t.isValid ? {} : { name: l },
2965
2970
  ...r.resolver || !l ? { isValid: h } : {},
2966
2971
  errors: t.errors
2967
- }), d.shouldFocus && !k && dt(n, R, l ? w : o.mount), k;
2968
- }, Ee = (l, d) => {
2972
+ }), d.shouldFocus && !_ && lt(n, G, l ? w : o.mount), _;
2973
+ }, Qe = (l, d) => {
2969
2974
  let h = {
2970
2975
  ...a.mount ? i : s
2971
2976
  };
2972
- return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), J(l) ? h : le(l) ? S(h, l) : l.map((k) => S(h, k));
2973
- }, et = (l, d) => ({
2977
+ return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), J(l) ? h : ue(l) ? S(h, l) : l.map((_) => S(h, _));
2978
+ }, B = (l, d) => ({
2974
2979
  invalid: !!S((d || t).errors, l),
2975
2980
  isDirty: !!S((d || t).dirtyFields, l),
2976
2981
  error: S((d || t).errors, l),
2977
2982
  isValidating: !!S(t.validatingFields, l),
2978
2983
  isTouched: !!S((d || t).touchedFields, l)
2979
- }), Re = (l) => {
2980
- const d = l ? ut(l) : void 0;
2981
- d == null || d.forEach((h) => Z(t.errors, h)), d ? d.forEach((h) => {
2984
+ }), Te = (l) => {
2985
+ const d = l ? ot(l) : void 0;
2986
+ d == null || d.forEach((h) => X(t.errors, h)), d ? d.forEach((h) => {
2982
2987
  m.state.next({
2983
2988
  name: h,
2984
2989
  errors: t.errors
@@ -2986,55 +2991,55 @@ function Wa(e = {}) {
2986
2991
  }) : m.state.next({
2987
2992
  errors: {}
2988
2993
  });
2989
- }, tt = (l, d, h) => {
2990
- const k = (S(n, l, { _f: {} })._f || {}).ref, w = S(t.errors, l) || {}, { ref: v, message: I, type: W, ...z } = w;
2991
- K(t.errors, l, {
2992
- ...z,
2994
+ }, Se = (l, d, h) => {
2995
+ const _ = (S(n, l, { _f: {} })._f || {}).ref, w = S(t.errors, l) || {}, { ref: g, message: F, type: P, ...q } = w;
2996
+ H(t.errors, l, {
2997
+ ...q,
2993
2998
  ...d,
2994
- ref: k
2999
+ ref: _
2995
3000
  }), m.state.next({
2996
3001
  name: l,
2997
3002
  errors: t.errors,
2998
3003
  isValid: !1
2999
- }), h && h.shouldFocus && k && k.focus && k.focus();
3000
- }, ht = (l, d) => de(l) ? m.state.subscribe({
3004
+ }), h && h.shouldFocus && _ && _.focus && _.focus();
3005
+ }, ut = (l, d) => de(l) ? m.state.subscribe({
3001
3006
  next: (h) => "values" in h && l(A(void 0, d), h)
3002
- }) : A(l, d, !0), Pe = (l) => m.state.subscribe({
3007
+ }) : A(l, d, !0), Ie = (l) => m.state.subscribe({
3003
3008
  next: (d) => {
3004
- ja(l.name, d.name, l.exact) && Ba(d, l.formState || y, ue, l.reRenderRoot) && l.callback({
3009
+ $a(l.name, d.name, l.exact) && ja(d, l.formState || y, mt, l.reRenderRoot) && l.callback({
3005
3010
  values: { ...i },
3006
3011
  ...t,
3007
3012
  ...d,
3008
3013
  defaultValues: s
3009
3014
  });
3010
3015
  }
3011
- }).unsubscribe, $e = (l) => (a.mount = !0, p = {
3016
+ }).unsubscribe, dt = (l) => (a.mount = !0, p = {
3012
3017
  ...p,
3013
3018
  ...l.formState
3014
- }, Pe({
3019
+ }, Ie({
3015
3020
  ...l,
3016
3021
  formState: {
3017
- ...g,
3022
+ ...b,
3018
3023
  ...l.formState
3019
3024
  }
3020
- })), Ae = (l, d = {}) => {
3021
- for (const h of l ? ut(l) : o.mount)
3022
- o.mount.delete(h), o.array.delete(h), d.keepValue || (Z(n, h), Z(i, h)), !d.keepError && Z(t.errors, h), !d.keepDirty && Z(t.dirtyFields, h), !d.keepTouched && Z(t.touchedFields, h), !d.keepIsValidating && Z(t.validatingFields, h), !r.shouldUnregister && !d.keepDefaultValue && Z(s, h);
3025
+ })), Pe = (l, d = {}) => {
3026
+ for (const h of l ? ot(l) : o.mount)
3027
+ o.mount.delete(h), o.array.delete(h), d.keepValue || (X(n, h), X(i, h)), !d.keepError && X(t.errors, h), !d.keepDirty && X(t.dirtyFields, h), !d.keepTouched && X(t.touchedFields, h), !d.keepIsValidating && X(t.validatingFields, h), !r.shouldUnregister && !d.keepDefaultValue && X(s, h);
3023
3028
  m.state.next({
3024
- values: Q(i)
3029
+ values: ee(i)
3025
3030
  }), m.state.next({
3026
3031
  ...t,
3027
- ...d.keepDirty ? { isDirty: M() } : {}
3032
+ ...d.keepDirty ? { isDirty: V() } : {}
3028
3033
  }), !d.keepIsValid && C();
3029
- }, rt = ({ disabled: l, name: d }) => {
3034
+ }, qe = ({ disabled: l, name: d }) => {
3030
3035
  if (me(l) && a.mount || l || o.disabled.has(d)) {
3031
3036
  const w = o.disabled.has(d) !== !!l;
3032
3037
  l ? o.disabled.add(d) : o.disabled.delete(d), w && a.mount && !a.action && C();
3033
3038
  }
3034
- }, qe = (l, d = {}) => {
3039
+ }, Ae = (l, d = {}) => {
3035
3040
  let h = S(n, l);
3036
- const k = me(d.disabled) || me(r.disabled);
3037
- return K(n, l, {
3041
+ const _ = me(d.disabled) || me(r.disabled);
3042
+ return H(n, l, {
3038
3043
  ...h || {},
3039
3044
  _f: {
3040
3045
  ...h && h._f ? h._f : { ref: { name: l } },
@@ -3042,124 +3047,124 @@ function Wa(e = {}) {
3042
3047
  mount: !0,
3043
3048
  ...d
3044
3049
  }
3045
- }), o.mount.add(l), h ? rt({
3050
+ }), o.mount.add(l), h ? qe({
3046
3051
  disabled: me(d.disabled) ? d.disabled : r.disabled,
3047
3052
  name: l
3048
- }) : V(l, !0, d.value), {
3049
- ...k ? { disabled: d.disabled || r.disabled } : {},
3053
+ }) : M(l, !0, d.value), {
3054
+ ..._ ? { disabled: d.disabled || r.disabled } : {},
3050
3055
  ...r.progressive ? {
3051
3056
  required: !!d.required,
3052
- min: it(d.min),
3053
- max: it(d.max),
3054
- minLength: it(d.minLength),
3055
- maxLength: it(d.maxLength),
3056
- pattern: it(d.pattern)
3057
+ min: nt(d.min),
3058
+ max: nt(d.max),
3059
+ minLength: nt(d.minLength),
3060
+ maxLength: nt(d.maxLength),
3061
+ pattern: nt(d.pattern)
3057
3062
  } : {},
3058
3063
  name: l,
3059
- onChange: Se,
3060
- onBlur: Se,
3064
+ onChange: le,
3065
+ onBlur: le,
3061
3066
  ref: (w) => {
3062
3067
  if (w) {
3063
- qe(l, d), h = S(n, l);
3064
- const v = J(w.value) && w.querySelectorAll && w.querySelectorAll("input,select,textarea")[0] || w, I = Ma(v), W = h._f.refs || [];
3065
- if (I ? W.find((z) => z === v) : v === h._f.ref)
3068
+ Ae(l, d), h = S(n, l);
3069
+ const g = J(w.value) && w.querySelectorAll && w.querySelectorAll("input,select,textarea")[0] || w, F = La(g), P = h._f.refs || [];
3070
+ if (F ? P.find((q) => q === g) : g === h._f.ref)
3066
3071
  return;
3067
- K(n, l, {
3072
+ H(n, l, {
3068
3073
  _f: {
3069
3074
  ...h._f,
3070
- ...I ? {
3075
+ ...F ? {
3071
3076
  refs: [
3072
- ...W.filter(Rt),
3073
- v,
3077
+ ...P.filter(Dt),
3078
+ g,
3074
3079
  ...Array.isArray(S(s, l)) ? [{}] : []
3075
3080
  ],
3076
- ref: { type: v.type, name: l }
3077
- } : { ref: v }
3081
+ ref: { type: g.type, name: l }
3082
+ } : { ref: g }
3078
3083
  }
3079
- }), V(l, !1, void 0, v);
3084
+ }), M(l, !1, void 0, g);
3080
3085
  } else
3081
- h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Ca(o.array, l) && a.action) && o.unMount.add(l);
3086
+ h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Sa(o.array, l) && a.action) && o.unMount.add(l);
3082
3087
  }
3083
3088
  };
3084
- }, Ue = () => r.shouldFocusError && dt(n, R, o.mount), pt = (l) => {
3085
- me(l) && (m.state.next({ disabled: l }), dt(n, (d, h) => {
3086
- const k = S(n, h);
3087
- k && (d.disabled = k._f.disabled || l, Array.isArray(k._f.refs) && k._f.refs.forEach((w) => {
3088
- w.disabled = k._f.disabled || l;
3089
+ }, Ee = () => r.shouldFocusError && lt(n, G, o.mount), ft = (l) => {
3090
+ me(l) && (m.state.next({ disabled: l }), lt(n, (d, h) => {
3091
+ const _ = S(n, h);
3092
+ _ && (d.disabled = _._f.disabled || l, Array.isArray(_._f.refs) && _._f.refs.forEach((w) => {
3093
+ w.disabled = _._f.disabled || l;
3089
3094
  }));
3090
3095
  }, 0, !1));
3091
- }, nt = (l, d) => async (h) => {
3092
- let k;
3096
+ }, et = (l, d) => async (h) => {
3097
+ let _;
3093
3098
  h && (h.preventDefault && h.preventDefault(), h.persist && h.persist());
3094
- let w = Q(i);
3099
+ let w = ee(i);
3095
3100
  if (m.state.next({
3096
3101
  isSubmitting: !0
3097
3102
  }), r.resolver) {
3098
- const { errors: v, values: I } = await O();
3099
- x(), t.errors = v, w = Q(I);
3103
+ const { errors: g, values: F } = await W();
3104
+ x(), t.errors = g, w = ee(F);
3100
3105
  } else
3101
- await P(n);
3106
+ await O(n);
3102
3107
  if (o.disabled.size)
3103
- for (const v of o.disabled)
3104
- Z(w, v);
3105
- if (Z(t.errors, "root"), se(t.errors)) {
3108
+ for (const g of o.disabled)
3109
+ X(w, g);
3110
+ if (X(t.errors, "root"), ae(t.errors)) {
3106
3111
  m.state.next({
3107
3112
  errors: {}
3108
3113
  });
3109
3114
  try {
3110
3115
  await l(w, h);
3111
- } catch (v) {
3112
- k = v;
3116
+ } catch (g) {
3117
+ _ = g;
3113
3118
  }
3114
3119
  } else
3115
- d && await d({ ...t.errors }, h), Ue(), setTimeout(Ue);
3120
+ d && await d({ ...t.errors }, h), Ee(), setTimeout(Ee);
3116
3121
  if (m.state.next({
3117
3122
  isSubmitted: !0,
3118
3123
  isSubmitting: !1,
3119
- isSubmitSuccessful: se(t.errors) && !k,
3124
+ isSubmitSuccessful: ae(t.errors) && !_,
3120
3125
  submitCount: t.submitCount + 1,
3121
3126
  errors: t.errors
3122
- }), k)
3123
- throw k;
3124
- }, mt = (l, d = {}) => {
3125
- S(n, l) && (J(d.defaultValue) ? j(l, Q(S(s, l))) : (j(l, d.defaultValue), K(s, l, Q(d.defaultValue))), d.keepTouched || Z(t.touchedFields, l), d.keepDirty || (Z(t.dirtyFields, l), t.isDirty = d.defaultValue ? M(l, Q(S(s, l))) : M()), d.keepError || (Z(t.errors, l), y.isValid && C()), m.state.next({ ...t }));
3126
- }, st = (l, d = {}) => {
3127
- const h = l ? Q(l) : s, k = Q(h), w = se(l), v = w ? s : k;
3127
+ }), _)
3128
+ throw _;
3129
+ }, ht = (l, d = {}) => {
3130
+ S(n, l) && (J(d.defaultValue) ? Z(l, ee(S(s, l))) : (Z(l, d.defaultValue), H(s, l, ee(d.defaultValue))), d.keepTouched || X(t.touchedFields, l), d.keepDirty || (X(t.dirtyFields, l), t.isDirty = d.defaultValue ? V(l, ee(S(s, l))) : V()), d.keepError || (X(t.errors, l), y.isValid && C()), m.state.next({ ...t }));
3131
+ }, tt = (l, d = {}) => {
3132
+ const h = l ? ee(l) : s, _ = ee(h), w = ae(l), g = w ? s : _;
3128
3133
  if (d.keepDefaultValues || (s = h), !d.keepValues) {
3129
3134
  if (d.keepDirtyValues) {
3130
- const I = /* @__PURE__ */ new Set([
3135
+ const F = /* @__PURE__ */ new Set([
3131
3136
  ...o.mount,
3132
- ...Object.keys(ze(s, i))
3137
+ ...Object.keys(We(s, i))
3133
3138
  ]);
3134
- for (const W of Array.from(I)) {
3135
- const z = S(t.dirtyFields, W), re = S(i, W), Te = S(v, W);
3136
- z && !J(re) ? K(v, W, re) : !z && !J(Te) && j(W, Te);
3139
+ for (const P of Array.from(F)) {
3140
+ const q = S(t.dirtyFields, P), ne = S(i, P), Oe = S(g, P);
3141
+ q && !J(ne) ? H(g, P, ne) : !q && !J(Oe) && Z(P, Oe);
3137
3142
  }
3138
3143
  } else {
3139
3144
  if (Jt && J(l))
3140
- for (const I of o.mount) {
3141
- const W = S(n, I);
3142
- if (W && W._f) {
3143
- const z = Array.isArray(W._f.refs) ? W._f.refs[0] : W._f.ref;
3144
- if (bt(z)) {
3145
- const re = z.closest("form");
3146
- if (re) {
3147
- re.reset();
3145
+ for (const F of o.mount) {
3146
+ const P = S(n, F);
3147
+ if (P && P._f) {
3148
+ const q = Array.isArray(P._f.refs) ? P._f.refs[0] : P._f.ref;
3149
+ if (bt(q)) {
3150
+ const ne = q.closest("form");
3151
+ if (ne) {
3152
+ ne.reset();
3148
3153
  break;
3149
3154
  }
3150
3155
  }
3151
3156
  }
3152
3157
  }
3153
3158
  if (d.keepFieldsRef)
3154
- for (const I of o.mount)
3155
- j(I, S(v, I));
3159
+ for (const F of o.mount)
3160
+ Z(F, S(g, F));
3156
3161
  else
3157
3162
  n = {};
3158
3163
  }
3159
- i = r.shouldUnregister ? d.keepDefaultValues ? Q(s) : {} : Q(v), m.array.next({
3160
- values: { ...v }
3164
+ i = r.shouldUnregister ? d.keepDefaultValues ? ee(s) : {} : ee(g), m.array.next({
3165
+ values: { ...g }
3161
3166
  }), m.state.next({
3162
- values: { ...v }
3167
+ values: { ...g }
3163
3168
  });
3164
3169
  }
3165
3170
  o = {
@@ -3170,56 +3175,56 @@ function Wa(e = {}) {
3170
3175
  watch: /* @__PURE__ */ new Set(),
3171
3176
  watchAll: !1,
3172
3177
  focus: ""
3173
- }, a.mount = !y.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !se(v), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
3178
+ }, a.mount = !y.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ae(g), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
3174
3179
  submitCount: d.keepSubmitCount ? t.submitCount : 0,
3175
- isDirty: w ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Me(l, s)),
3180
+ isDirty: w ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Le(l, s)),
3176
3181
  isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
3177
- dirtyFields: w ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? ze(s, i) : t.dirtyFields : d.keepDefaultValues && l ? ze(s, l) : d.keepDirty ? t.dirtyFields : {},
3182
+ dirtyFields: w ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? We(s, i) : t.dirtyFields : d.keepDefaultValues && l ? We(s, l) : d.keepDirty ? t.dirtyFields : {},
3178
3183
  touchedFields: d.keepTouched ? t.touchedFields : {},
3179
3184
  errors: d.keepErrors ? t.errors : {},
3180
3185
  isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
3181
3186
  isSubmitting: !1,
3182
3187
  defaultValues: s
3183
3188
  });
3184
- }, at = (l, d) => st(de(l) ? l(i) : l, { ...r.resetOptions, ...d }), D = (l, d = {}) => {
3185
- const h = S(n, l), k = h && h._f;
3186
- if (k) {
3187
- const w = k.refs ? k.refs[0] : k.ref;
3189
+ }, rt = (l, d) => tt(de(l) ? l(i) : l, { ...r.resetOptions, ...d }), pt = (l, d = {}) => {
3190
+ const h = S(n, l), _ = h && h._f;
3191
+ if (_) {
3192
+ const w = _.refs ? _.refs[0] : _.ref;
3188
3193
  w.focus && setTimeout(() => {
3189
3194
  w.focus(), d.shouldSelect && de(w.select) && w.select();
3190
3195
  });
3191
3196
  }
3192
- }, ue = (l) => {
3197
+ }, mt = (l) => {
3193
3198
  t = {
3194
3199
  ...t,
3195
3200
  ...l
3196
3201
  };
3197
- }, be = {
3202
+ }, D = {
3198
3203
  control: {
3199
- register: qe,
3200
- unregister: Ae,
3201
- getFieldState: et,
3202
- handleSubmit: nt,
3203
- setError: tt,
3204
- _subscribe: Pe,
3205
- _runSchema: O,
3204
+ register: Ae,
3205
+ unregister: Pe,
3206
+ getFieldState: B,
3207
+ handleSubmit: et,
3208
+ setError: Se,
3209
+ _subscribe: Ie,
3210
+ _runSchema: W,
3206
3211
  _updateIsValidating: x,
3207
- _focusError: Ue,
3212
+ _focusError: Ee,
3208
3213
  _getWatch: A,
3209
- _getDirty: M,
3214
+ _getDirty: V,
3210
3215
  _setValid: C,
3211
- _setFieldArray: b,
3212
- _setDisabledField: rt,
3213
- _setErrors: L,
3214
- _getFieldArray: B,
3215
- _reset: st,
3216
+ _setFieldArray: v,
3217
+ _setDisabledField: qe,
3218
+ _setErrors: N,
3219
+ _getFieldArray: T,
3220
+ _reset: tt,
3216
3221
  _resetDefaultValues: () => de(r.defaultValues) && r.defaultValues().then((l) => {
3217
- at(l, r.resetOptions), m.state.next({
3222
+ rt(l, r.resetOptions), m.state.next({
3218
3223
  isLoading: !1
3219
3224
  });
3220
3225
  }),
3221
- _removeUnmounted: G,
3222
- _disableForm: pt,
3226
+ _removeUnmounted: z,
3227
+ _disableForm: ft,
3223
3228
  _subjects: m,
3224
3229
  _proxyFormState: y,
3225
3230
  get _fields() {
@@ -3256,28 +3261,28 @@ function Wa(e = {}) {
3256
3261
  };
3257
3262
  }
3258
3263
  },
3259
- subscribe: $e,
3260
- trigger: ce,
3261
- register: qe,
3262
- handleSubmit: nt,
3263
- watch: ht,
3264
- setValue: j,
3265
- getValues: Ee,
3266
- reset: at,
3267
- resetField: mt,
3268
- clearErrors: Re,
3269
- unregister: Ae,
3270
- setError: tt,
3271
- setFocus: D,
3272
- getFieldState: et
3264
+ subscribe: dt,
3265
+ trigger: Ce,
3266
+ register: Ae,
3267
+ handleSubmit: et,
3268
+ watch: ut,
3269
+ setValue: Z,
3270
+ getValues: Qe,
3271
+ reset: rt,
3272
+ resetField: ht,
3273
+ clearErrors: Te,
3274
+ unregister: Pe,
3275
+ setError: Se,
3276
+ setFocus: pt,
3277
+ getFieldState: B
3273
3278
  };
3274
3279
  return {
3275
- ...be,
3276
- formControl: be
3280
+ ...D,
3281
+ formControl: D
3277
3282
  };
3278
3283
  }
3279
- function St(e = {}) {
3280
- const r = ne.useRef(void 0), t = ne.useRef(void 0), [n, s] = ne.useState({
3284
+ function Ct(e = {}) {
3285
+ const r = se.useRef(void 0), t = se.useRef(void 0), [n, s] = se.useState({
3281
3286
  isDirty: !1,
3282
3287
  isValidating: !1,
3283
3288
  isLoading: de(e.defaultValues),
@@ -3301,14 +3306,14 @@ function St(e = {}) {
3301
3306
  formState: n
3302
3307
  }, e.defaultValues && !de(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
3303
3308
  else {
3304
- const { formControl: a, ...o } = Wa(e);
3309
+ const { formControl: a, ...o } = za(e);
3305
3310
  r.current = {
3306
3311
  ...o,
3307
3312
  formState: n
3308
3313
  };
3309
3314
  }
3310
3315
  const i = r.current.control;
3311
- return i._options = e, Ia(() => {
3316
+ return i._options = e, Fa(() => {
3312
3317
  const a = i._subscribe({
3313
3318
  formState: i._proxyFormState,
3314
3319
  callback: () => s({ ...i._formState }),
@@ -3318,69 +3323,69 @@ function St(e = {}) {
3318
3323
  ...o,
3319
3324
  isReady: !0
3320
3325
  })), i._formState.isReady = !0, a;
3321
- }, [i]), ne.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), ne.useEffect(() => {
3326
+ }, [i]), se.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), se.useEffect(() => {
3322
3327
  e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode);
3323
- }, [i, e.mode, e.reValidateMode]), ne.useEffect(() => {
3328
+ }, [i, e.mode, e.reValidateMode]), se.useEffect(() => {
3324
3329
  e.errors && (i._setErrors(e.errors), i._focusError());
3325
- }, [i, e.errors]), ne.useEffect(() => {
3330
+ }, [i, e.errors]), se.useEffect(() => {
3326
3331
  e.shouldUnregister && i._subjects.state.next({
3327
3332
  values: i._getWatch()
3328
3333
  });
3329
- }, [i, e.shouldUnregister]), ne.useEffect(() => {
3334
+ }, [i, e.shouldUnregister]), se.useEffect(() => {
3330
3335
  if (i._proxyFormState.isDirty) {
3331
3336
  const a = i._getDirty();
3332
3337
  a !== n.isDirty && i._subjects.state.next({
3333
3338
  isDirty: a
3334
3339
  });
3335
3340
  }
3336
- }, [i, n.isDirty]), ne.useEffect(() => {
3341
+ }, [i, n.isDirty]), se.useEffect(() => {
3337
3342
  var a;
3338
- e.values && !Me(e.values, t.current) ? (i._reset(e.values, {
3343
+ e.values && !Le(e.values, t.current) ? (i._reset(e.values, {
3339
3344
  keepFieldsRef: !0,
3340
3345
  ...i._options.resetOptions
3341
3346
  }), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, s((o) => ({ ...o }))) : i._resetDefaultValues();
3342
- }, [i, e.values]), ne.useEffect(() => {
3347
+ }, [i, e.values]), se.useEffect(() => {
3343
3348
  i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
3344
- }), r.current.formState = ne.useMemo(() => Aa(n, i), [i, n]), r.current;
3349
+ }), r.current.formState = se.useMemo(() => Ea(n, i), [i, n]), r.current;
3345
3350
  }
3346
3351
  const Fr = (e, r, t) => {
3347
3352
  if (e && "reportValidity" in e) {
3348
3353
  const n = S(t, r);
3349
3354
  e.setCustomValidity(n && n.message || ""), e.reportValidity();
3350
3355
  }
3351
- }, za = (e, r) => {
3356
+ }, Ha = (e, r) => {
3352
3357
  for (const t in r.fields) {
3353
3358
  const n = r.fields[t];
3354
3359
  n && n.ref && "reportValidity" in n.ref ? Fr(n.ref, t, e) : n.refs && n.refs.forEach((s) => Fr(s, t, e));
3355
3360
  }
3356
- }, Ha = (e, r) => {
3357
- r.shouldUseNativeValidation && za(e, r);
3361
+ }, Ka = (e, r) => {
3362
+ r.shouldUseNativeValidation && Ha(e, r);
3358
3363
  const t = {};
3359
3364
  for (const n in e) {
3360
3365
  const s = S(r.fields, n), i = Object.assign(e[n] || {}, { ref: s && s.ref });
3361
- if (Ka(r.names || Object.keys(e), n)) {
3366
+ if (Ga(r.names || Object.keys(e), n)) {
3362
3367
  const a = Object.assign({}, S(t, n));
3363
- K(a, "root", i), K(t, n, a);
3368
+ H(a, "root", i), H(t, n, a);
3364
3369
  } else
3365
- K(t, n, i);
3370
+ H(t, n, i);
3366
3371
  }
3367
3372
  return t;
3368
- }, Ka = (e, r) => e.some((t) => t.startsWith(r + "."));
3369
- var Et = function(e, r, t) {
3373
+ }, Ga = (e, r) => e.some((t) => t.startsWith(r + "."));
3374
+ var St = function(e, r, t) {
3370
3375
  return t === void 0 && (t = {}), function(n, s, i) {
3371
3376
  try {
3372
3377
  var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
3373
- return Promise.resolve(/* @__PURE__ */ sa(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
3378
+ return Promise.resolve(/* @__PURE__ */ aa(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
3374
3379
  if (o.issues) {
3375
3380
  for (var u = {}; o.issues.length; ) {
3376
- var f = o.issues[0], g = /* @__PURE__ */ Xs(f);
3377
- if (g && (u[g] || (u[g] = { message: f.message, type: f.type }), a)) {
3378
- var y = u[g].types, p = y && y[f.type];
3379
- u[g] = pn(g, a, u, f.type, p ? [].concat(p, f.message) : f.message);
3381
+ var f = o.issues[0], b = /* @__PURE__ */ Ys(f);
3382
+ if (b && (u[b] || (u[b] = { message: f.message, type: f.type }), a)) {
3383
+ var y = u[b].types, p = y && y[f.type];
3384
+ u[b] = pn(b, a, u, f.type, p ? [].concat(p, f.message) : f.message);
3380
3385
  }
3381
3386
  o.issues.shift();
3382
3387
  }
3383
- return { values: {}, errors: Ha(u, i) };
3388
+ return { values: {}, errors: Ka(u, i) };
3384
3389
  }
3385
3390
  return { values: t.raw ? n : o.output, errors: {} };
3386
3391
  });
@@ -3389,22 +3394,22 @@ var Et = function(e, r, t) {
3389
3394
  }
3390
3395
  };
3391
3396
  };
3392
- const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3397
+ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
3393
3398
  const t = {
3394
3399
  min: e.minSelected ?? 0,
3395
3400
  max: e.maxSelected ?? e.options.length
3396
3401
  };
3397
- return Et(/* @__PURE__ */ ke({
3398
- checked: /* @__PURE__ */ Le(/* @__PURE__ */ ln(/* @__PURE__ */ ie(), /* @__PURE__ */ sn()), /* @__PURE__ */ Ht((n) => Object.entries(n).filter(([s, i]) => i).map(([s, i]) => s)), /* @__PURE__ */ ct(t.max, r("validation_multiple_choice_max", {
3402
+ return St(/* @__PURE__ */ _e({
3403
+ checked: /* @__PURE__ */ Ne(/* @__PURE__ */ ln(/* @__PURE__ */ oe(), /* @__PURE__ */ sn()), /* @__PURE__ */ Ht((n) => Object.entries(n).filter(([s, i]) => i).map(([s, i]) => s)), /* @__PURE__ */ it(t.max, r("validation_multiple_choice_max", {
3399
3404
  count: t.max
3400
- })), /* @__PURE__ */ Ge(t.min, r("validation_multiple_choice_min", {
3405
+ })), /* @__PURE__ */ Ke(t.min, r("validation_multiple_choice_min", {
3401
3406
  count: t.min
3402
3407
  })))
3403
3408
  }));
3404
- }, Za = Wr(({
3409
+ }, Xa = Wr(({
3405
3410
  option: e,
3406
3411
  ...r
3407
- }, t) => c(Ce, {
3412
+ }, t) => c(ke, {
3408
3413
  children: [c("input", {
3409
3414
  class: "peer sr-only h-full",
3410
3415
  type: "checkbox",
@@ -3415,7 +3420,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3415
3420
  htmlFor: r.id,
3416
3421
  children: e.label
3417
3422
  })]
3418
- })), Dr = wt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
3423
+ })), Nr = xt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
3419
3424
  variants: {
3420
3425
  variant: {
3421
3426
  // In cases where there is only one option, we want to center it
@@ -3424,38 +3429,38 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3424
3429
  booleanLike: un
3425
3430
  }
3426
3431
  }
3427
- }), Xa = ({
3432
+ }), Ya = ({
3428
3433
  input: e,
3429
3434
  onSubmitSuccess: r
3430
3435
  }) => {
3431
- var g, y;
3432
- const t = e.key ? (g = H.current$.value.flow) == null ? void 0 : g.data.submissions[e.key] : void 0, n = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, s = n && e.config.options.length === 2, {
3436
+ var b, y;
3437
+ const t = e.key ? (b = U.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, n = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, s = n && e.config.options.length === 2, {
3433
3438
  t: i
3434
- } = te(), {
3439
+ } = re(), {
3435
3440
  register: a,
3436
3441
  handleSubmit: o,
3437
3442
  formState: {
3438
3443
  errors: u
3439
3444
  }
3440
- } = St({
3445
+ } = Ct({
3441
3446
  defaultValues: {
3442
- checked: n ? {} : Ga(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
3447
+ checked: n ? {} : Ja(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
3443
3448
  },
3444
- resolver: Ja(e.config, i)
3449
+ resolver: Za(e.config, i)
3445
3450
  }), f = Gt();
3446
3451
  return s ? c("ul", {
3447
3452
  style: {
3448
3453
  maxHeight: 6.5 * Vr + 5 * Mr + 2 * Lr
3449
3454
  },
3450
- class: Dr({
3455
+ class: Nr({
3451
3456
  variant: "booleanLike"
3452
3457
  }),
3453
3458
  children: e.config.options.map((p, m) => c("li", {
3454
3459
  class: dn,
3455
3460
  children: c(fn, {
3456
3461
  type: "submit",
3457
- ref: (_) => {
3458
- _ && m === 0 && (f.current = _);
3462
+ ref: (k) => {
3463
+ k && m === 0 && (f.current = k);
3459
3464
  },
3460
3465
  label: p.label,
3461
3466
  value: "true",
@@ -3468,10 +3473,10 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3468
3473
  }) : c("form", {
3469
3474
  noValidate: !0,
3470
3475
  onSubmit: (p) => o((m) => {
3471
- const _ = m.checked;
3476
+ const k = m.checked;
3472
3477
  r({
3473
3478
  type: "enum",
3474
- value: _
3479
+ value: k
3475
3480
  });
3476
3481
  })(p),
3477
3482
  children: [c("div", {
@@ -3480,23 +3485,23 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3480
3485
  style: {
3481
3486
  maxHeight: 6.5 * Vr + 5 * Mr + 2 * Lr
3482
3487
  },
3483
- class: Dr({
3488
+ class: Nr({
3484
3489
  variant: e.config.options.length === 1 ? "singleOption" : void 0
3485
3490
  }),
3486
3491
  children: e.config.options.map((p, m) => {
3487
- const _ = `checked.${p.value}`, {
3488
- ref: E,
3492
+ const k = `checked.${p.value}`, {
3493
+ ref: I,
3489
3494
  ...C
3490
- } = a(_);
3495
+ } = a(k);
3491
3496
  return c("li", {
3492
3497
  class: "relative",
3493
- children: c(Za, {
3498
+ children: c(Xa, {
3494
3499
  option: p,
3495
3500
  autoFocus: m === 0,
3496
3501
  ref: (x) => {
3497
- x && m === 0 && (f.current = x), E(x);
3502
+ x && m === 0 && (f.current = x), I(x);
3498
3503
  },
3499
- id: _,
3504
+ id: k,
3500
3505
  ...C,
3501
3506
  onClick: n ? () => r({
3502
3507
  type: "enum",
@@ -3507,7 +3512,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3507
3512
  })
3508
3513
  }), c("div", {
3509
3514
  class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
3510
- children: [n ? null : c(je, {}), e.config.minSelected === 0 && c(Ne, {
3515
+ children: [n ? null : c($e, {}), e.config.minSelected === 0 && c(De, {
3511
3516
  class: "relative",
3512
3517
  type: "button",
3513
3518
  onClick: () => r({
@@ -3518,15 +3523,15 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3518
3523
  })]
3519
3524
  }), c("div", {
3520
3525
  class: "px-1",
3521
- children: c(Qe, {
3526
+ children: c(Ye, {
3522
3527
  error: (y = u.checked) == null ? void 0 : y.root
3523
3528
  })
3524
3529
  })]
3525
3530
  });
3526
- }, Ya = Ye("number"), Qa = (e, r) => {
3531
+ }, Qa = Xe("number"), ei = (e, r) => {
3527
3532
  const t = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
3528
- return Et(/* @__PURE__ */ ke({
3529
- number: /* @__PURE__ */ Le(/* @__PURE__ */ an(r("validation_number")), /* @__PURE__ */ en(t, r("validation_number_min", {
3533
+ return St(/* @__PURE__ */ _e({
3534
+ number: /* @__PURE__ */ Ne(/* @__PURE__ */ an(r("validation_number")), /* @__PURE__ */ en(t, r("validation_number_min", {
3530
3535
  min: t
3531
3536
  })), /* @__PURE__ */ Qr(n, r("validation_number_max", {
3532
3537
  max: n
@@ -3534,33 +3539,33 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3534
3539
  count: s
3535
3540
  })))
3536
3541
  }));
3537
- }, ei = ({
3542
+ }, ti = ({
3538
3543
  input: e,
3539
3544
  onSubmitSuccess: r
3540
3545
  }) => {
3541
3546
  var y;
3542
- const t = e.config.defaultValue, n = e.key ? (y = H.current$.value.flow) == null ? void 0 : y.data.submissions[e.key] : void 0, {
3547
+ const t = e.config.defaultValue, n = e.key ? (y = U.current$.value.flow) == null ? void 0 : y.data.submissions[e.key] : void 0, {
3543
3548
  t: s
3544
- } = te(), {
3549
+ } = re(), {
3545
3550
  register: i,
3546
3551
  handleSubmit: a,
3547
3552
  formState: {
3548
3553
  errors: o
3549
3554
  }
3550
- } = St({
3555
+ } = Ct({
3551
3556
  defaultValues: {
3552
- number: Ya(n) ? n.value : t ? Number(t) : void 0
3557
+ number: Qa(n) ? n.value : t ? Number(t) : void 0
3553
3558
  },
3554
- resolver: Qa(e.config, s)
3559
+ resolver: ei(e.config, s)
3555
3560
  }), {
3556
3561
  ref: u,
3557
3562
  ...f
3558
3563
  } = i("number", {
3559
3564
  required: !e.config.optional,
3560
3565
  valueAsNumber: !0
3561
- }), g = ye();
3562
- return De(() => {
3563
- g.current && (g.current.focus(), g.current.select());
3566
+ }), b = ye();
3567
+ return Re(() => {
3568
+ b.current && (b.current.focus(), b.current.select());
3564
3569
  }, []), c("form", {
3565
3570
  class: "flex flex-col gap-1 p-2.5",
3566
3571
  onSubmit: a((p) => {
@@ -3581,26 +3586,26 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3581
3586
  autoCorrect: "off",
3582
3587
  autoFocus: !0,
3583
3588
  ref: (p) => {
3584
- p && (g.current = p), u(p);
3589
+ p && (b.current = p), u(p);
3585
3590
  },
3586
3591
  type: "text",
3587
3592
  min: e.config.min,
3588
3593
  max: e.config.max,
3589
- class: Ze({
3594
+ class: Je({
3590
3595
  optional: e.config.optional,
3591
3596
  className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
3592
3597
  }),
3593
3598
  placeholder: e.config.placeholder
3594
- }), e.config.optional && c(Ne, {
3599
+ }), e.config.optional && c(De, {
3595
3600
  class: "absolute bottom-0 right-0.5 top-0",
3596
3601
  onClick: () => r(null)
3597
3602
  })]
3598
- }), c(je, {})]
3599
- }), c(Qe, {
3603
+ }), c($e, {})]
3604
+ }), c(Ye, {
3600
3605
  error: o.number
3601
3606
  })]
3602
3607
  });
3603
- }, ti = (e) => {
3608
+ }, ri = (e) => {
3604
3609
  if (e === "")
3605
3610
  return {
3606
3611
  countryCode: "",
@@ -3614,65 +3619,65 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3614
3619
  countryCode: "",
3615
3620
  phoneNumber: ""
3616
3621
  };
3617
- }, ri = "44", ni = /^[0-9 ]+$/, si = Ye("string"), ai = Ye("phone"), ii = (e) => {
3618
- const r = /* @__PURE__ */ Le(/* @__PURE__ */ ie(e("validation_country_code")), /* @__PURE__ */ zt(ni, e("validation_country_code"))), t = /* @__PURE__ */ Le(/* @__PURE__ */ ie(e("validation_phone")), /* @__PURE__ */ Ge(1, e("validation_phone")), /* @__PURE__ */ Ht((n) => n.replace(/[^0-9]/g, "")));
3619
- return Et(/* @__PURE__ */ ke({
3622
+ }, ni = "44", si = /^[0-9 ]+$/, ai = Xe("string"), ii = Xe("phone"), oi = (e) => {
3623
+ const r = /* @__PURE__ */ Ne(/* @__PURE__ */ oe(e("validation_country_code")), /* @__PURE__ */ zt(si, e("validation_country_code"))), t = /* @__PURE__ */ Ne(/* @__PURE__ */ oe(e("validation_phone")), /* @__PURE__ */ Ke(1, e("validation_phone")), /* @__PURE__ */ Ht((n) => n.replace(/[^0-9]/g, "")));
3624
+ return St(/* @__PURE__ */ _e({
3620
3625
  countryCode: r,
3621
3626
  phoneNumber: t
3622
3627
  }));
3623
- }, oi = ({
3628
+ }, li = ({
3624
3629
  input: e,
3625
3630
  onSubmitSuccess: r
3626
3631
  }) => {
3627
- var E;
3628
- const t = e.key ? (E = H.current$.value.flow) == null ? void 0 : E.data.submissions[e.key] : void 0, {
3632
+ var I;
3633
+ const t = e.key ? (I = U.current$.value.flow) == null ? void 0 : I.data.submissions[e.key] : void 0, {
3629
3634
  t: n
3630
- } = te(), [s, i] = _e(), a = si(t) ? ti(t.value) : ai(t) ? t.value : void 0, {
3635
+ } = re(), [s, i] = we(), a = ai(t) ? ri(t.value) : ii(t) ? t.value : void 0, {
3631
3636
  register: o,
3632
3637
  handleSubmit: u,
3633
3638
  formState: {
3634
3639
  errors: f
3635
3640
  },
3636
- watch: g
3637
- } = St({
3641
+ watch: b
3642
+ } = Ct({
3638
3643
  defaultValues: {
3639
- countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? ri,
3644
+ countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? ni,
3640
3645
  phoneNumber: (a == null ? void 0 : a.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
3641
3646
  },
3642
- resolver: ii(n)
3647
+ resolver: oi(n)
3643
3648
  }), {
3644
3649
  ref: y,
3645
3650
  ...p
3646
3651
  } = o("phoneNumber", {
3647
3652
  required: !e.config.optional
3648
- }), m = ye(), _ = g("countryCode");
3649
- return De(() => {
3653
+ }), m = ye(), k = b("countryCode");
3654
+ return Re(() => {
3650
3655
  m.current && (m.current.focus(), m.current.select());
3651
3656
  }, []), c("form", {
3652
3657
  noValidate: !0,
3653
3658
  class: "flex flex-col gap-1 p-2.5",
3654
3659
  onSubmit: u((C) => {
3655
- const x = C.phoneNumber.replace(/[^0-9]/g, ""), b = C.countryCode.replace(/[^0-9]/g, "");
3660
+ const x = C.phoneNumber.replace(/[^0-9]/g, ""), v = C.countryCode.replace(/[^0-9]/g, "");
3656
3661
  i(void 0);
3657
- const F = e.config.minChars ?? 7, L = x.length + b.length;
3658
- if (L < F)
3662
+ const E = e.config.minChars ?? 7, N = x.length + v.length;
3663
+ if (N < E)
3659
3664
  return i(n("validation_phone_min_chars", {
3660
- count: F
3665
+ count: E
3661
3666
  }));
3662
- const V = e.config.maxChars;
3663
- if (V != null && L > V)
3667
+ const M = e.config.maxChars;
3668
+ if (M != null && N > M)
3664
3669
  return i(n("validation_max_chars", {
3665
- count: V
3670
+ count: M
3666
3671
  }));
3667
3672
  e.config.submissionFormat === "phone" ? r({
3668
3673
  type: "phone",
3669
3674
  value: {
3670
- countryCode: b,
3675
+ countryCode: v,
3671
3676
  phoneNumber: x
3672
3677
  }
3673
3678
  }) : r({
3674
3679
  type: "string",
3675
- value: _ + C.phoneNumber
3680
+ value: k + C.phoneNumber
3676
3681
  });
3677
3682
  }),
3678
3683
  children: [c("div", {
@@ -3683,7 +3688,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3683
3688
  class: "text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",
3684
3689
  htmlFor: `isdk_phone_${e.key}`,
3685
3690
  children: [c("span", {
3686
- children: ["+", _]
3691
+ children: ["+", k]
3687
3692
  }), c("select", {
3688
3693
  ...o("countryCode", {}),
3689
3694
  id: `isdk_phone_${e.key}`,
@@ -3705,43 +3710,43 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3705
3710
  ref: (C) => {
3706
3711
  C && (m.current = C), y(C);
3707
3712
  },
3708
- class: Ze({
3713
+ class: Je({
3709
3714
  optional: e.config.optional,
3710
3715
  className: "min-w-0 flex-1 rounded-r-full"
3711
3716
  }),
3712
3717
  placeholder: e.config.placeholder
3713
- }), e.config.optional && c(Ne, {
3718
+ }), e.config.optional && c(De, {
3714
3719
  class: "absolute bottom-0 right-1 top-0",
3715
3720
  onClick: () => r(null)
3716
3721
  })]
3717
- }), c(je, {})]
3718
- }), c(Qe, {
3722
+ }), c($e, {})]
3723
+ }), c(Ye, {
3719
3724
  error: f.countryCode || f.phoneNumber || {
3720
3725
  message: s
3721
3726
  }
3722
3727
  })]
3723
3728
  });
3724
- }, gt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), Nr = (e, r, t, n) => t !== void 0 && n * 1e3 > $r ? e("submission_available_at", {
3729
+ }, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), Rr = (e, r, t, n) => t !== void 0 && n * 1e3 > Pr ? e("submission_available_at", {
3725
3730
  time: qr(t, r)
3726
3731
  }) : e("submission_cooldown", {
3727
3732
  count: n
3728
- }), li = ({
3733
+ }), ci = ({
3729
3734
  input: e,
3730
3735
  onSubmitSuccess: r
3731
3736
  }) => {
3732
3737
  const {
3733
3738
  t,
3734
3739
  locale: n
3735
- } = te(), {
3740
+ } = re(), {
3736
3741
  availableAt: s
3737
- } = e.config, [i, a] = _e(() => gt(s)), [o, u] = _e("");
3742
+ } = e.config, [i, a] = we(() => yt(s)), [o, u] = we("");
3738
3743
  Ur(() => {
3739
- const g = gt(s);
3740
- if (a(g), g === 0)
3744
+ const b = yt(s);
3745
+ if (a(b), b === 0)
3741
3746
  return;
3742
- u(Nr(t, n, s, g));
3747
+ u(Rr(t, n, s, b));
3743
3748
  const y = setInterval(() => {
3744
- const p = gt(s);
3749
+ const p = yt(s);
3745
3750
  a(p), !(p > 0) && (clearInterval(y), u(t("submission_cooldown_ready")));
3746
3751
  }, 250);
3747
3752
  return () => clearInterval(y);
@@ -3755,7 +3760,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3755
3760
  "aria-disabled": f,
3756
3761
  "aria-describedby": f ? "submit-cooldown" : void 0,
3757
3762
  onClick: () => {
3758
- gt(s) > 0 || r(null);
3763
+ yt(s) > 0 || r(null);
3759
3764
  },
3760
3765
  children: c("span", {
3761
3766
  class: "flex items-center gap-1.5",
@@ -3781,16 +3786,16 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3781
3786
  id: "submit-cooldown",
3782
3787
  "aria-hidden": "true",
3783
3788
  class: "text-neutral-11 text-xs",
3784
- children: Nr(t, n, s, i)
3789
+ children: Rr(t, n, s, i)
3785
3790
  }), c("p", {
3786
3791
  role: "status",
3787
3792
  class: "sr-only",
3788
3793
  children: o
3789
3794
  })]
3790
3795
  });
3791
- }, ci = 160, Rr = (e) => {
3792
- e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, ci)}px`;
3793
- }, ui = {
3796
+ }, ui = 160, Dr = (e) => {
3797
+ e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, ui)}px`;
3798
+ }, di = {
3794
3799
  date: {
3795
3800
  type: "date",
3796
3801
  inputMode: "text"
@@ -3809,7 +3814,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3809
3814
  inputMode: "url",
3810
3815
  formNoValidate: !0
3811
3816
  }
3812
- }, di = Ye("string"), fi = (e, r) => {
3817
+ }, fi = Xe("string"), hi = (e, r) => {
3813
3818
  const t = {
3814
3819
  maxLength: r("validation_max_chars", {
3815
3820
  count: e.maxChars ?? 999
@@ -3818,43 +3823,43 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3818
3823
  count: e.minChars ?? 1
3819
3824
  })
3820
3825
  };
3821
- return Et(/* @__PURE__ */ ke({
3826
+ return St(/* @__PURE__ */ _e({
3822
3827
  text: {
3823
- date: /* @__PURE__ */ Le(/* @__PURE__ */ ie(r("validation_date")), /* @__PURE__ */ zt(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
3824
- email: /* @__PURE__ */ Le(/* @__PURE__ */ ie(r("validation_email")), /* @__PURE__ */ Yr(r("validation_email")), /* @__PURE__ */ Ge(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength)),
3825
- text: /* @__PURE__ */ Le(/* @__PURE__ */ ie(), /* @__PURE__ */ Ge(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength)),
3826
- url: /* @__PURE__ */ Le(/* @__PURE__ */ ie(r("validation_url")), /* @__PURE__ */ tn(r("validation_url")), /* @__PURE__ */ Ge(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength))
3828
+ date: /* @__PURE__ */ Ne(/* @__PURE__ */ oe(r("validation_date")), /* @__PURE__ */ zt(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
3829
+ email: /* @__PURE__ */ Ne(/* @__PURE__ */ oe(r("validation_email")), /* @__PURE__ */ Yr(r("validation_email")), /* @__PURE__ */ Ke(e.minChars ?? 1, t.minLength), /* @__PURE__ */ it(e.maxChars ?? 1 / 0, t.maxLength)),
3830
+ text: /* @__PURE__ */ Ne(/* @__PURE__ */ oe(), /* @__PURE__ */ Ke(e.minChars ?? 1, t.minLength), /* @__PURE__ */ it(e.maxChars ?? 1 / 0, t.maxLength)),
3831
+ url: /* @__PURE__ */ Ne(/* @__PURE__ */ oe(r("validation_url")), /* @__PURE__ */ tn(r("validation_url")), /* @__PURE__ */ Ke(e.minChars ?? 1, t.minLength), /* @__PURE__ */ it(e.maxChars ?? 1 / 0, t.maxLength))
3827
3832
  }[e.format]
3828
3833
  }));
3829
- }, hi = ({
3834
+ }, pi = ({
3830
3835
  input: e,
3831
3836
  onSubmitSuccess: r
3832
3837
  }) => {
3833
- var E;
3838
+ var I;
3834
3839
  const {
3835
3840
  t
3836
- } = te(), n = e.key ? (E = H.current$.value.flow) == null ? void 0 : E.data.submissions[e.key] : void 0, s = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
3841
+ } = re(), n = e.key ? (I = U.current$.value.flow) == null ? void 0 : I.data.submissions[e.key] : void 0, s = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
3837
3842
  register: a,
3838
3843
  handleSubmit: o,
3839
3844
  watch: u,
3840
3845
  formState: {
3841
3846
  errors: f
3842
3847
  }
3843
- } = St({
3848
+ } = Ct({
3844
3849
  defaultValues: {
3845
- text: di(n) ? n.value : s ?? ""
3850
+ text: fi(n) ? n.value : s ?? ""
3846
3851
  },
3847
- resolver: fi(e.config, t)
3852
+ resolver: hi(e.config, t)
3848
3853
  }), {
3849
- ref: g,
3854
+ ref: b,
3850
3855
  ...y
3851
3856
  } = a("text", {
3852
3857
  required: !e.config.optional
3853
3858
  }), p = ye();
3854
- De(() => {
3855
- p.current && (p.current instanceof HTMLTextAreaElement && Rr(p.current), p.current.focus(), p.current.select());
3859
+ Re(() => {
3860
+ p.current && (p.current instanceof HTMLTextAreaElement && Dr(p.current), p.current.focus(), p.current.select());
3856
3861
  }, []);
3857
- const m = e.config.maxChars, _ = i && m !== void 0 ? u("text").length : void 0;
3862
+ const m = e.config.maxChars, k = i && m !== void 0 ? u("text").length : void 0;
3858
3863
  return c("form", {
3859
3864
  noValidate: !0,
3860
3865
  class: "flex flex-col gap-1 p-2.5",
@@ -3874,68 +3879,68 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3874
3879
  rows: 2,
3875
3880
  maxLength: m,
3876
3881
  autoFocus: !0,
3877
- "aria-describedby": _ !== void 0 ? "chat-input-count" : void 0,
3878
- onInput: (C) => Rr(C.currentTarget),
3882
+ "aria-describedby": k !== void 0 ? "chat-input-count" : void 0,
3883
+ onInput: (C) => Dr(C.currentTarget),
3879
3884
  onKeyDown: (C) => {
3880
3885
  var x;
3881
3886
  C.key === "Enter" && (C.ctrlKey || C.metaKey) && (C.preventDefault(), (x = C.currentTarget.form) == null || x.requestSubmit());
3882
3887
  },
3883
3888
  ref: (C) => {
3884
- C && (p.current = C), g(C);
3889
+ C && (p.current = C), b(C);
3885
3890
  },
3886
3891
  placeholder: e.config.placeholder,
3887
- class: Ze({
3892
+ class: Je({
3888
3893
  optional: !!e.config.optional,
3889
3894
  className: "block w-full resize-none overflow-y-auto rounded-2xl"
3890
3895
  })
3891
3896
  }) : c("input", {
3892
3897
  id: "chat-input",
3893
3898
  ...y,
3894
- ...ui[e.config.format],
3899
+ ...di[e.config.format],
3895
3900
  autocomplete: "off",
3896
3901
  autoCapitalize: "off",
3897
3902
  autoCorrect: "off",
3898
3903
  autoFocus: !0,
3899
3904
  ref: (C) => {
3900
- C && (p.current = C), g(C);
3905
+ C && (p.current = C), b(C);
3901
3906
  },
3902
3907
  placeholder: e.config.placeholder,
3903
- class: Ze({
3908
+ class: Je({
3904
3909
  optional: !!e.config.optional,
3905
3910
  className: "w-full rounded-full"
3906
3911
  })
3907
3912
  }), e.config.optional && c(
3908
- Ne,
3913
+ De,
3909
3914
  {
3910
3915
  class: i ? "absolute bottom-1 right-0.5" : "absolute bottom-0 right-0.5 top-0",
3911
3916
  onClick: () => r(null)
3912
3917
  }
3913
3918
  )]
3914
- }), c(je, {})]
3915
- }), _ !== void 0 && m !== void 0 && c("p", {
3919
+ }), c($e, {})]
3920
+ }), k !== void 0 && m !== void 0 && c("p", {
3916
3921
  id: "chat-input-count",
3917
3922
  class: "text-neutral-10 px-3 text-right text-xs",
3918
- children: [_, "/", m]
3919
- }), c(Qe, {
3923
+ children: [k, "/", m]
3924
+ }), c(Ye, {
3920
3925
  error: f.text
3921
3926
  })]
3922
3927
  });
3923
- }, pi = {
3924
- text: hi,
3925
- phone: oi,
3926
- "multiple-choice": Xa,
3927
- boolean: pa,
3928
- file: wa,
3929
- submit: li,
3930
- address: ua,
3931
- number: ei
3932
- }, mi = ({
3928
+ }, mi = {
3929
+ text: pi,
3930
+ phone: li,
3931
+ "multiple-choice": Ya,
3932
+ boolean: ma,
3933
+ file: _a,
3934
+ submit: ci,
3935
+ address: da,
3936
+ number: ti
3937
+ }, yi = ({
3933
3938
  logger: e,
3934
3939
  analytics: r
3935
3940
  }) => {
3936
3941
  var i;
3937
- const t = (i = H.current$.value.flow) == null ? void 0 : i.data.currentInput, n = ye(null), s = () => oe.onInteractionFn$.value();
3938
- return De(() => {
3942
+ const t = (i = U.current$.value.flow) == null ? void 0 : i.data.currentInput, n = ye(null), s = () => ce.onInteractionFn$.value();
3943
+ return Re(() => {
3939
3944
  var a;
3940
3945
  (a = n.current) == null || a.scrollTo({
3941
3946
  top: 0
@@ -3948,11 +3953,11 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3948
3953
  onPointerDownCapture: t ? s : void 0,
3949
3954
  onKeyDownCapture: t ? s : void 0,
3950
3955
  children: t ? (() => {
3951
- const a = pi[t.type];
3956
+ const a = mi[t.type];
3952
3957
  return c(a, {
3953
3958
  logger: e,
3954
3959
  analytics: r,
3955
- onSubmitSuccess: oe.onSubmitSuccessFn$.value,
3960
+ onSubmitSuccess: ce.onSubmitSuccessFn$.value,
3956
3961
  input: t
3957
3962
  });
3958
3963
  })() : c("div", {
@@ -3960,12 +3965,12 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3960
3965
  children: [c("input", {
3961
3966
  "aria-hidden": "true",
3962
3967
  id: "chat-input",
3963
- class: Ze({
3968
+ class: Je({
3964
3969
  optional: !1,
3965
3970
  className: "flex-grow rounded-full"
3966
3971
  }),
3967
3972
  disabled: !0
3968
- }), c(je, {
3973
+ }), c($e, {
3969
3974
  disabled: !0,
3970
3975
  "aria-hidden": "true",
3971
3976
  tabIndex: -1
@@ -3974,30 +3979,30 @@ const Vr = 27, Mr = 12, Lr = 10, Ga = Ye("enum"), Ja = (e, r) => {
3974
3979
  })
3975
3980
  });
3976
3981
  };
3977
- function yi(e) {
3982
+ function bi(e) {
3978
3983
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3979
3984
  }
3980
3985
  var gi = function(e) {
3981
3986
  return e instanceof RegExp;
3982
- }, bi = function(r) {
3987
+ }, vi = function(r) {
3983
3988
  var t = /[\\^$.*+?()[\]{}|]/g, n = RegExp(t.source);
3984
3989
  return r && n.test(r) ? r.replace(t, "\\$&") : r;
3985
3990
  }, wn = function(e) {
3986
3991
  return typeof e == "string";
3987
- }, vi = function(e) {
3992
+ }, xi = function(e) {
3988
3993
  var r = [];
3989
3994
  return e.forEach(function(t) {
3990
3995
  Array.isArray(t) ? r = r.concat(t) : r.push(t);
3991
3996
  }), r;
3992
3997
  };
3993
- function xi(e, r, t) {
3998
+ function wi(e, r, t) {
3994
3999
  var n = 0, s = 0;
3995
4000
  if (e === "")
3996
4001
  return e;
3997
4002
  if (!e || !wn(e))
3998
4003
  throw new TypeError("First argument to react-string-replace#replaceString must be a string");
3999
4004
  var i = r;
4000
- gi(i) || (i = new RegExp("(" + bi(i) + ")", "gi"));
4005
+ gi(i) || (i = new RegExp("(" + vi(i) + ")", "gi"));
4001
4006
  for (var a = e.split(i), o = 1, u = a.length; o < u; o += 2) {
4002
4007
  if (a[o] === void 0 || a[o - 1] === void 0) {
4003
4008
  console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
@@ -4007,33 +4012,33 @@ function xi(e, r, t) {
4007
4012
  }
4008
4013
  return a;
4009
4014
  }
4010
- var wi = function(r, t, n) {
4011
- return Array.isArray(r) || (r = [r]), vi(r.map(function(s) {
4012
- return wn(s) ? xi(s, t, n) : s;
4015
+ var _i = function(r, t, n) {
4016
+ return Array.isArray(r) || (r = [r]), xi(r.map(function(s) {
4017
+ return wn(s) ? wi(s, t, n) : s;
4013
4018
  }));
4014
4019
  };
4015
- const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]+)\]\(([^)]+)\)/, Ci = /(https?:\/\/[^\s]+)/g, Si = /_(.*?)_/g, Ei = /\*\*(.*?)\*\*/g, Ai = /(\\n|\n)/g, Tr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Ii = (e) => {
4016
- const r = ot(e, _i, (o, u) => {
4017
- const [, f, g] = o.match(ki) ?? [];
4018
- return g ? c("a", {
4020
+ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]+)\]\(([^)]+)\)/, Si = /(https?:\/\/[^\s]+)/g, Ii = /_(.*?)_/g, Ai = /\*\*(.*?)\*\*/g, Ei = /(\\n|\n)/g, Tr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Fi = (e) => {
4021
+ const r = st(e, ki, (o, u) => {
4022
+ const [, f, b] = o.match(Ci) ?? [];
4023
+ return b ? c("a", {
4019
4024
  class: Tr,
4020
- href: g,
4021
- children: f ?? g
4022
- }, g + u) : c("span", {
4025
+ href: b,
4026
+ children: f ?? b
4027
+ }, b + u) : c("span", {
4023
4028
  children: "INVALID LINK"
4024
4029
  });
4025
- }), t = ot(r, Ci, (o, u) => c("a", {
4030
+ }), t = st(r, Si, (o, u) => c("a", {
4026
4031
  class: Tr,
4027
4032
  href: o,
4028
4033
  children: o
4029
- }, o + u)), n = ot(t, Si, (o, u) => c("em", {
4034
+ }, o + u)), n = st(t, Ii, (o, u) => c("em", {
4030
4035
  children: o
4031
- }, o + u)), s = ot(n, Ei, (o, u) => c("strong", {
4036
+ }, o + u)), s = st(n, Ai, (o, u) => c("strong", {
4032
4037
  children: o
4033
4038
  }, o + u));
4034
4039
  let i = 0;
4035
- return ot(s, Ai, () => c("br", {}, `br-${i++}`));
4036
- }, Fi = wt("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", {
4040
+ return st(s, Ei, () => c("br", {}, `br-${i++}`));
4041
+ }, Vi = xt("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", {
4037
4042
  variants: {
4038
4043
  side: {
4039
4044
  left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
@@ -4047,7 +4052,7 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4047
4052
  defaultVariants: {
4048
4053
  side: "left"
4049
4054
  }
4050
- }), Vi = ({
4055
+ }), Mi = ({
4051
4056
  children: e,
4052
4057
  className: r,
4053
4058
  animate: t,
@@ -4057,14 +4062,14 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4057
4062
  style: {
4058
4063
  transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
4059
4064
  },
4060
- class: Fi({
4065
+ class: Vi({
4061
4066
  className: r,
4062
4067
  side: n,
4063
4068
  animate: t
4064
4069
  }),
4065
4070
  ...s,
4066
4071
  children: e
4067
- }), Mi = ({
4072
+ }), Li = ({
4068
4073
  message: e
4069
4074
  }) => c("div", {
4070
4075
  class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
@@ -4088,14 +4093,14 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4088
4093
  })
4089
4094
  })]
4090
4095
  })
4091
- }), Li = ({
4096
+ }), Ni = ({
4092
4097
  className: e,
4093
4098
  ...r
4094
4099
  }) => c("div", {
4095
4100
  "aria-hidden": !0,
4096
- children: oe.isBotTyping$.value === !0 ? c("div", {
4101
+ children: ce.isBotTyping$.value === !0 ? c("div", {
4097
4102
  "data-testid": "typing-indicator",
4098
- class: Xe("flex gap-1 p-4", e),
4103
+ class: Ze("flex gap-1 p-4", e),
4099
4104
  ...r,
4100
4105
  children: Array.from({
4101
4106
  length: 3
@@ -4106,10 +4111,10 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4106
4111
  }
4107
4112
  }))
4108
4113
  }) : void 0
4109
- }), Di = {
4114
+ }), Ri = {
4110
4115
  bot: "left",
4111
4116
  user: "right"
4112
- }, Ni = wt("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)]", {
4117
+ }, Di = xt("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)]", {
4113
4118
  variants: {
4114
4119
  variant: {
4115
4120
  info: "text-neutral-11",
@@ -4118,42 +4123,42 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4118
4123
  success: "text-system-success"
4119
4124
  }
4120
4125
  }
4121
- }), Ri = ({
4126
+ }), Ti = ({
4122
4127
  lastSentMessageFooter: e
4123
4128
  }) => {
4124
4129
  const {
4125
4130
  t: r
4126
- } = te(), t = H.current$.value.flow, n = (t == null ? void 0 : t.data.messages) ?? [], s = t ? Wt(t) : void 0;
4131
+ } = re(), t = U.current$.value.flow, n = (t == null ? void 0 : t.data.messages) ?? [], s = t ? Wt(t) : void 0;
4127
4132
  return c("ol", {
4128
4133
  "aria-label": r("chat_messages"),
4129
4134
  "aria-live": "polite",
4130
4135
  class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
4131
- children: [n.map((i, a) => c(Ce, {
4136
+ children: [n.map((i, a) => c(ke, {
4132
4137
  children: c("li", {
4133
4138
  class: "flex",
4134
4139
  tabIndex: a === n.length - 1 ? -1 : void 0,
4135
- children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null, Wn(i).with({
4140
+ children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null, zn(i).with({
4136
4141
  type: "system"
4137
4142
  }, (o) => c("p", {
4138
- class: Ni({
4143
+ class: Di({
4139
4144
  variant: o.variant
4140
4145
  }),
4141
4146
  children: o.text
4142
4147
  })).with({
4143
4148
  type: "text",
4144
- author: zn.union("bot", "user")
4149
+ author: Hn.union("bot", "user")
4145
4150
  }, (o) => {
4146
- const u = a === n.length - 1, f = o.author === "bot" ? Ii(o.text) : o.text;
4147
- return c(Ce, {
4148
- children: c(Vi, {
4151
+ const u = a === n.length - 1, f = o.author === "bot" ? Fi(o.text) : o.text;
4152
+ return c(ke, {
4153
+ children: c(Mi, {
4149
4154
  animate: u,
4150
- side: Di[o.author],
4155
+ side: Ri[o.author],
4151
4156
  children: f
4152
4157
  }, a)
4153
4158
  });
4154
4159
  }).with({
4155
4160
  type: "link"
4156
- }, (o) => c(Mi, {
4161
+ }, (o) => c(Li, {
4157
4162
  message: o
4158
4163
  })).with({
4159
4164
  type: "image"
@@ -4175,7 +4180,7 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4175
4180
  type: "loading"
4176
4181
  }, (o) => {
4177
4182
  const u = n[n.length - 1];
4178
- return !(o === u) || oe.isBotTyping$.value ? null : c("div", {
4183
+ return !(o === u) || ce.isBotTyping$.value ? null : c("div", {
4179
4184
  class: "flex flex-grow flex-col items-center justify-center gap-2",
4180
4185
  children: [c(qt, {
4181
4186
  "aria-hidden": o.text ? "true" : void 0,
@@ -4189,7 +4194,7 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4189
4194
  }).exhaustive()]
4190
4195
  })
4191
4196
  }, a)), c("li", {
4192
- class: oe.captchaVisible$.value ? "flex" : "hidden",
4197
+ class: ce.captchaVisible$.value ? "flex" : "hidden",
4193
4198
  children: c("div", {
4194
4199
  "data-captcha-slot": !0,
4195
4200
  tabIndex: -1,
@@ -4197,7 +4202,7 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4197
4202
  "aria-label": r("captcha_check"),
4198
4203
  class: "w-full max-w-[min(100%,24rem)] rounded-md"
4199
4204
  })
4200
- }, "captcha"), c(Li, {}, "typing")]
4205
+ }, "captcha"), c(Ni, {}, "typing")]
4201
4206
  });
4202
4207
  }, Pi = ({
4203
4208
  logger: e,
@@ -4207,41 +4212,41 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4207
4212
  }) => {
4208
4213
  const {
4209
4214
  flow: s
4210
- } = H.current$.value;
4211
- Be(s, "Flow is required to exist to show chatbot body");
4212
- const i = H.viewState$.value, {
4215
+ } = U.current$.value;
4216
+ je(s, "Flow is required to exist to show chatbot body");
4217
+ const i = U.viewState$.value, {
4213
4218
  chatRef: a,
4214
4219
  chatService: o
4215
- } = Hn(), {
4220
+ } = Kn(), {
4216
4221
  t: u
4217
- } = te(), [f, g] = _e();
4218
- return De(() => {
4219
- i === "maximised" && oe.scrollToEnd();
4220
- }, [i]), De(() => {
4221
- var V;
4222
+ } = re(), [f, b] = we();
4223
+ return Re(() => {
4224
+ i === "maximised" && ce.scrollToEnd();
4225
+ }, [i]), Re(() => {
4226
+ var M;
4222
4227
  const {
4223
4228
  state: y,
4224
4229
  flow: p
4225
- } = H.current$.peek();
4230
+ } = U.current$.peek();
4226
4231
  if (y !== "loaded")
4227
4232
  throw new Error(u("invalid_state"));
4228
4233
  let m = p.data.nodeHistory.at(-1);
4229
- if (oe.scrollToEnd(), H.setInput(void 0), p.data.isFinished)
4234
+ if (ce.scrollToEnd(), U.setInput(void 0), p.data.isFinished)
4230
4235
  return;
4231
- const _ = () => {
4232
- const T = H.current$.peek().flow;
4233
- !T || T.data.hasInteracted || (H.markAsInteracted(), ur(t, T, "FLOW_INTERACT"));
4236
+ const k = () => {
4237
+ const L = U.current$.peek().flow;
4238
+ !L || L.data.hasInteracted || (U.markAsInteracted(), ur(t, L, "FLOW_INTERACT"));
4234
4239
  };
4235
- oe.onInteractionFn$.value = _, m === void 0 ? (m = Kr(s.nodes).id, H.setCurrentNodeId(m), ur(t, p, "FLOW_START")) : H.removeMessagesSentByNodeIds([m, jt]);
4240
+ ce.onInteractionFn$.value = k, m === void 0 ? (m = Kr(s.nodes).id, U.setCurrentNodeId(m), ur(t, p, "FLOW_START")) : U.removeMessagesSentByNodeIds([m, jt]);
4236
4241
  const {
4237
- interpret: E,
4242
+ interpret: I,
4238
4243
  abort: C,
4239
4244
  undo: x
4240
- } = _s({
4245
+ } = ks({
4241
4246
  context: s.context,
4242
4247
  analytics: {
4243
4248
  service: t,
4244
- customProperties: (V = s.analytics) == null ? void 0 : V.customProperties
4249
+ customProperties: (M = s.analytics) == null ? void 0 : M.customProperties
4245
4250
  },
4246
4251
  apiClient: r,
4247
4252
  logger: e,
@@ -4250,47 +4255,47 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4250
4255
  chatService: o,
4251
4256
  t: u,
4252
4257
  getApplicationRecovery: () => {
4253
- var T;
4254
- return (T = H.current$.peek().flow) == null ? void 0 : T.data.applicationRecovery;
4258
+ var L;
4259
+ return (L = U.current$.peek().flow) == null ? void 0 : L.data.applicationRecovery;
4255
4260
  },
4256
- setApplicationRecovery: H.setApplicationRecovery,
4257
- persistWriteBarrier: () => H.persistWriteBarrier(p),
4261
+ setApplicationRecovery: U.setApplicationRecovery,
4262
+ persistWriteBarrier: () => U.persistWriteBarrier(p),
4258
4263
  // We need to get fresh submissions, that’s why we call `peek` here.
4259
4264
  getSubmissions: () => {
4260
- var T;
4261
- return (T = H.current$.peek().flow) == null ? void 0 : T.data.submissions;
4265
+ var L;
4266
+ return (L = U.current$.peek().flow) == null ? void 0 : L.data.submissions;
4262
4267
  },
4263
- onInterpret: (T) => H.setCurrentNodeId(T.id),
4268
+ onInterpret: (L) => U.setCurrentNodeId(L.id),
4264
4269
  onFlowEnd: async () => {
4265
- var N;
4266
- H.markAsFinished();
4267
- const T = H.current$.peek().flow;
4268
- Be(T), t.log({
4270
+ var R;
4271
+ U.markAsFinished();
4272
+ const L = U.current$.peek().flow;
4273
+ je(L), t.log({
4269
4274
  event: "FLOW_END",
4270
4275
  properties: {
4271
4276
  flow_id: s.id,
4272
4277
  flow_version: s.version,
4273
- flow_session_id: T.data.flowSessionId,
4278
+ flow_session_id: L.data.flowSessionId,
4274
4279
  flow_build: s.build,
4275
4280
  job: s.job
4276
4281
  },
4277
- customProperties: (N = s.analytics) == null ? void 0 : N.customProperties
4282
+ customProperties: (R = s.analytics) == null ? void 0 : R.customProperties
4278
4283
  });
4279
4284
  }
4280
- }), b = m, F = () => {
4281
- g(() => x), E(b);
4282
- }, L = new AbortController();
4283
- return p.offerResume ? zs({
4285
+ }), v = m, E = () => {
4286
+ b(() => x), I(v);
4287
+ }, N = new AbortController();
4288
+ return p.offerResume ? Hs({
4284
4289
  chatService: o,
4285
4290
  t: u,
4286
- signal: L.signal
4287
- }).then((T) => (H.settleResume(p), T ? F() : (H.restart(), Kn.flushStateData()))).catch((T) => {
4288
- T instanceof jr || e.error("Resume prompt failed", T);
4289
- }) : F(), () => {
4290
- L.abort(), oe.onInteractionFn$.value === _ && (oe.onInteractionFn$.value = () => {
4291
+ signal: N.signal
4292
+ }).then((L) => (U.settleResume(p), L ? E() : (U.restart(), Gn.flushStateData()))).catch((L) => {
4293
+ L instanceof jr || e.error("Resume prompt failed", L);
4294
+ }) : E(), () => {
4295
+ N.abort(), ce.onInteractionFn$.value === k && (ce.onInteractionFn$.value = () => {
4291
4296
  }), C();
4292
4297
  };
4293
- }, [t, r, o, e, s, n, u]), c(Ce, {
4298
+ }, [t, r, o, e, s, n, u]), c(ke, {
4294
4299
  children: [c("div", {
4295
4300
  class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
4296
4301
  children: [c("div", {
@@ -4302,36 +4307,36 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4302
4307
  style: {
4303
4308
  WebkitOverflowScrolling: "touch"
4304
4309
  },
4305
- children: c(Ri, {
4306
- lastSentMessageFooter: !Wt(s) || !f ? null : c(Ti, {
4310
+ children: c(Ti, {
4311
+ lastSentMessageFooter: !Wt(s) || !f ? null : c(Oi, {
4307
4312
  undoFn: f
4308
4313
  })
4309
4314
  })
4310
- }), oe.isReadingHistory$.value && !s.data.isFinished && !oe.isBotTyping$.value && c("div", {
4315
+ }), ce.isReadingHistory$.value && !s.data.isFinished && !ce.isBotTyping$.value && c("div", {
4311
4316
  class: "absolute bottom-2 left-1/2 -translate-x-1/2",
4312
4317
  children: c(zr, {
4313
4318
  class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
4314
4319
  "aria-label": u("jump_to_current"),
4315
4320
  onClick: () => {
4316
4321
  var p, m;
4317
- oe.scrollToEnd(), (m = ((p = a.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? a.current) == null || m.focus({
4322
+ ce.scrollToEnd(), (m = ((p = a.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? a.current) == null || m.focus({
4318
4323
  preventScroll: !0
4319
4324
  });
4320
4325
  },
4321
- children: c(Gn, {})
4326
+ children: c(Jn, {})
4322
4327
  })
4323
4328
  })]
4324
- }), c(mi, {
4329
+ }), c(yi, {
4325
4330
  logger: e,
4326
4331
  analytics: t
4327
4332
  })]
4328
4333
  });
4329
- }, Ti = ({
4334
+ }, Oi = ({
4330
4335
  undoFn: e
4331
4336
  }) => {
4332
4337
  const {
4333
4338
  t: r
4334
- } = te();
4339
+ } = re();
4335
4340
  return c("div", {
4336
4341
  class: "flex flex-1 items-center justify-end px-1",
4337
4342
  children: c(zr, {
@@ -4339,8 +4344,8 @@ const ot = /* @__PURE__ */ yi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
4339
4344
  onClick: async () => {
4340
4345
  const {
4341
4346
  flow: t
4342
- } = H.current$.peek();
4343
- Be(t), e(t.data.nodeHistory);
4347
+ } = U.current$.peek();
4348
+ je(t), e(t.data.nodeHistory);
4344
4349
  },
4345
4350
  children: c("path", {
4346
4351
  d: "M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"