@versini/sassysaint 5.3.8 → 5.3.10

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,7 +1,7 @@
1
1
  import { jsx as l, jsxs as I, Fragment as ye } from "react/jsx-runtime";
2
- import O, { createContext as lr, useReducer as St, useRef as L, useCallback as q, useEffect as Q, useContext as Ze, useSyncExternalStore as dr, useId as kt, useState as j, useLayoutEffect as ct, useMemo as _t, lazy as Nt, Suspense as Rt } from "react";
2
+ import O, { createContext as cr, useReducer as St, useRef as L, useCallback as q, useEffect as Q, useContext as Qe, useSyncExternalStore as lr, useId as kt, useState as j, useLayoutEffect as it, useMemo as At, lazy as _t, Suspense as Nt } from "react";
3
3
  import f from "clsx";
4
- var ur = Object.defineProperty, mr = (e, t, r) => t in e ? ur(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, He = (e, t, r) => mr(e, typeof t != "symbol" ? t + "" : t, r);
4
+ var dr = Object.defineProperty, ur = (e, t, r) => t in e ? dr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, He = (e, t, r) => ur(e, typeof t != "symbol" ? t + "" : t, r);
5
5
  /*!
6
6
  @versini/auth-provider v7.3.3
7
7
  © 2024 gizmette.com
@@ -28,10 +28,10 @@ function xe(e) {
28
28
  s[i] = n.charCodeAt(i);
29
29
  return o;
30
30
  }
31
- function et() {
31
+ function Ze() {
32
32
  return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
33
33
  }
34
- function xt(e) {
34
+ function Rt(e) {
35
35
  const { id: t } = e;
36
36
  return {
37
37
  ...e,
@@ -39,7 +39,7 @@ function xt(e) {
39
39
  transports: e.transports
40
40
  };
41
41
  }
42
- function Ct(e) {
42
+ function xt(e) {
43
43
  return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
44
44
  }
45
45
  class x extends Error {
@@ -47,7 +47,7 @@ class x extends Error {
47
47
  super(t, { cause: a }), this.name = n ?? a.name, this.code = r;
48
48
  }
49
49
  }
50
- function hr({ error: e, options: t }) {
50
+ function mr({ error: e, options: t }) {
51
51
  var a, n;
52
52
  const { publicKey: r } = t;
53
53
  if (!r)
@@ -97,7 +97,7 @@ function hr({ error: e, options: t }) {
97
97
  });
98
98
  if (e.name === "SecurityError") {
99
99
  const o = window.location.hostname;
100
- if (Ct(o)) {
100
+ if (xt(o)) {
101
101
  if (r.rp.id !== o)
102
102
  return new x({
103
103
  message: `The RP ID "${r.rp.id}" is invalid for this domain`,
@@ -125,7 +125,7 @@ function hr({ error: e, options: t }) {
125
125
  }
126
126
  return e;
127
127
  }
128
- class pr {
128
+ class hr {
129
129
  createNewAbortSignal() {
130
130
  if (this.controller) {
131
131
  const r = new Error("Cancelling existing WebAuthn API call for new one");
@@ -141,14 +141,14 @@ class pr {
141
141
  }
142
142
  }
143
143
  }
144
- const Ot = new pr(), gr = ["cross-platform", "platform"];
145
- function Pt(e) {
146
- if (e && !(gr.indexOf(e) < 0))
144
+ const Ct = new hr(), pr = ["cross-platform", "platform"];
145
+ function Ot(e) {
146
+ if (e && !(pr.indexOf(e) < 0))
147
147
  return e;
148
148
  }
149
- async function fr(e) {
149
+ async function gr(e) {
150
150
  var m;
151
- if (!et())
151
+ if (!Ze())
152
152
  throw new Error("WebAuthn is not supported in this browser");
153
153
  const t = { publicKey: {
154
154
  ...e,
@@ -157,14 +157,14 @@ async function fr(e) {
157
157
  ...e.user,
158
158
  id: xe(e.user.id)
159
159
  },
160
- excludeCredentials: (m = e.excludeCredentials) == null ? void 0 : m.map(xt)
160
+ excludeCredentials: (m = e.excludeCredentials) == null ? void 0 : m.map(Rt)
161
161
  } };
162
- t.signal = Ot.createNewAbortSignal();
162
+ t.signal = Ct.createNewAbortSignal();
163
163
  let r;
164
164
  try {
165
165
  r = await navigator.credentials.create(t);
166
166
  } catch (c) {
167
- throw hr({ error: c, options: t });
167
+ throw mr({ error: c, options: t });
168
168
  }
169
169
  if (!r)
170
170
  throw new Error("Registration was not completed");
@@ -176,7 +176,7 @@ async function fr(e) {
176
176
  try {
177
177
  u = o.getPublicKeyAlgorithm();
178
178
  } catch (c) {
179
- Ge("getPublicKeyAlgorithm()", c);
179
+ We("getPublicKeyAlgorithm()", c);
180
180
  }
181
181
  let h;
182
182
  if (typeof o.getPublicKey == "function")
@@ -184,14 +184,14 @@ async function fr(e) {
184
184
  const c = o.getPublicKey();
185
185
  c !== null && (h = H(c));
186
186
  } catch (c) {
187
- Ge("getPublicKey()", c);
187
+ We("getPublicKey()", c);
188
188
  }
189
189
  let p;
190
190
  if (typeof o.getAuthenticatorData == "function")
191
191
  try {
192
192
  p = H(o.getAuthenticatorData());
193
193
  } catch (c) {
194
- Ge("getAuthenticatorData()", c);
194
+ We("getAuthenticatorData()", c);
195
195
  }
196
196
  return {
197
197
  id: a,
@@ -206,20 +206,20 @@ async function fr(e) {
206
206
  },
207
207
  type: s,
208
208
  clientExtensionResults: r.getClientExtensionResults(),
209
- authenticatorAttachment: Pt(r.authenticatorAttachment)
209
+ authenticatorAttachment: Ot(r.authenticatorAttachment)
210
210
  };
211
211
  }
212
- function Ge(e, t) {
212
+ function We(e, t) {
213
213
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
214
214
  `, t);
215
215
  }
216
- function yr() {
217
- if (!et())
216
+ function fr() {
217
+ if (!Ze())
218
218
  return new Promise((t) => t(!1));
219
219
  const e = window.PublicKeyCredential;
220
220
  return e.isConditionalMediationAvailable === void 0 ? new Promise((t) => t(!1)) : e.isConditionalMediationAvailable();
221
221
  }
222
- function br({ error: e, options: t }) {
222
+ function yr({ error: e, options: t }) {
223
223
  const { publicKey: r } = t;
224
224
  if (!r)
225
225
  throw Error("options was missing required publicKey property");
@@ -239,7 +239,7 @@ function br({ error: e, options: t }) {
239
239
  });
240
240
  if (e.name === "SecurityError") {
241
241
  const a = window.location.hostname;
242
- if (Ct(a)) {
242
+ if (xt(a)) {
243
243
  if (r.rpId !== a)
244
244
  return new x({
245
245
  message: `The RP ID "${r.rpId}" is invalid for this domain`,
@@ -260,30 +260,30 @@ function br({ error: e, options: t }) {
260
260
  }
261
261
  return e;
262
262
  }
263
- async function Er(e, t = !1) {
263
+ async function br(e, t = !1) {
264
264
  var m, c;
265
- if (!et())
265
+ if (!Ze())
266
266
  throw new Error("WebAuthn is not supported in this browser");
267
267
  let r;
268
- ((m = e.allowCredentials) == null ? void 0 : m.length) !== 0 && (r = (c = e.allowCredentials) == null ? void 0 : c.map(xt));
268
+ ((m = e.allowCredentials) == null ? void 0 : m.length) !== 0 && (r = (c = e.allowCredentials) == null ? void 0 : c.map(Rt));
269
269
  const a = {
270
270
  ...e,
271
271
  challenge: xe(e.challenge),
272
272
  allowCredentials: r
273
273
  }, n = {};
274
274
  if (t) {
275
- if (!await yr())
275
+ if (!await fr())
276
276
  throw Error("Browser does not support WebAuthn autofill");
277
277
  if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1)
278
278
  throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
279
279
  n.mediation = "conditional", a.allowCredentials = [];
280
280
  }
281
- n.publicKey = a, n.signal = Ot.createNewAbortSignal();
281
+ n.publicKey = a, n.signal = Ct.createNewAbortSignal();
282
282
  let o;
283
283
  try {
284
284
  o = await navigator.credentials.get(n);
285
285
  } catch (d) {
286
- throw br({ error: d, options: n });
286
+ throw yr({ error: d, options: n });
287
287
  }
288
288
  if (!o)
289
289
  throw new Error("Authentication was not completed");
@@ -300,7 +300,7 @@ async function Er(e, t = !1) {
300
300
  },
301
301
  type: h,
302
302
  clientExtensionResults: o.getClientExtensionResults(),
303
- authenticatorAttachment: Pt(o.authenticatorAttachment)
303
+ authenticatorAttachment: Ot(o.authenticatorAttachment)
304
304
  };
305
305
  }
306
306
  /*!
@@ -323,7 +323,7 @@ const ue = {
323
323
  CODE: "code",
324
324
  REFRESH_TOKEN: "refresh_token",
325
325
  PASSKEY: "passkey"
326
- }, Dt = {
326
+ }, Pt = {
327
327
  CLIENT_ID: "X-Auth-ClientId"
328
328
  }, _ = {
329
329
  ALG: "RS256",
@@ -338,7 +338,7 @@ const ue = {
338
338
  SCOPES_KEY: "scopes",
339
339
  CLIENT_ID_KEY: "aud",
340
340
  ISSUER: "gizmette.com"
341
- }, wr = `-----BEGIN PUBLIC KEY-----
341
+ }, Er = `-----BEGIN PUBLIC KEY-----
342
342
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
343
343
  w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
344
344
  i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
@@ -351,15 +351,15 @@ awIDAQAB
351
351
  LOGOUT: "logout",
352
352
  LOGIN: "login",
353
353
  REFRESH: "refresh"
354
- }, Le = crypto, $t = (e) => e instanceof CryptoKey, we = new TextEncoder(), be = new TextDecoder();
355
- function Tr(...e) {
354
+ }, Le = crypto, Dt = (e) => e instanceof CryptoKey, we = new TextEncoder(), be = new TextDecoder();
355
+ function wr(...e) {
356
356
  const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
357
357
  let a = 0;
358
358
  for (const n of e)
359
359
  r.set(n, a), a += n.length;
360
360
  return r;
361
361
  }
362
- const Ir = (e) => {
362
+ const Tr = (e) => {
363
363
  const t = atob(e), r = new Uint8Array(t.length);
364
364
  for (let a = 0; a < t.length; a++)
365
365
  r[a] = t.charCodeAt(a);
@@ -368,7 +368,7 @@ const Ir = (e) => {
368
368
  let t = e;
369
369
  t instanceof Uint8Array && (t = be.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
370
370
  try {
371
- return Ir(t);
371
+ return Tr(t);
372
372
  } catch {
373
373
  throw new TypeError("The input to be decoded is not correctly encoded.");
374
374
  }
@@ -389,7 +389,7 @@ let te = class extends Error {
389
389
  super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = a, this.reason = n, this.payload = r;
390
390
  }
391
391
  };
392
- class lt extends te {
392
+ class ct extends te {
393
393
  static get code() {
394
394
  return "ERR_JWT_EXPIRED";
395
395
  }
@@ -397,7 +397,7 @@ class lt extends te {
397
397
  super(t), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
398
398
  }
399
399
  }
400
- class vr extends te {
400
+ class Ir extends te {
401
401
  constructor() {
402
402
  super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
403
403
  }
@@ -405,14 +405,14 @@ class vr extends te {
405
405
  return "ERR_JOSE_ALG_NOT_ALLOWED";
406
406
  }
407
407
  }
408
- let G = class extends te {
408
+ let W = class extends te {
409
409
  constructor() {
410
410
  super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
411
411
  }
412
412
  static get code() {
413
413
  return "ERR_JOSE_NOT_SUPPORTED";
414
414
  }
415
- }, k = class extends te {
415
+ }, A = class extends te {
416
416
  constructor() {
417
417
  super(...arguments), this.code = "ERR_JWS_INVALID";
418
418
  }
@@ -427,7 +427,7 @@ let G = class extends te {
427
427
  return "ERR_JWT_INVALID";
428
428
  }
429
429
  };
430
- class Ar extends te {
430
+ class vr extends te {
431
431
  constructor() {
432
432
  super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
433
433
  }
@@ -466,7 +466,7 @@ function kr(e, t) {
466
466
  throw new TypeError(r);
467
467
  }
468
468
  }
469
- function _r(e, t, ...r) {
469
+ function Ar(e, t, ...r) {
470
470
  switch (t) {
471
471
  case "HS256":
472
472
  case "HS384":
@@ -518,7 +518,7 @@ function _r(e, t, ...r) {
518
518
  }
519
519
  kr(e, r);
520
520
  }
521
- function Lt(e, t, ...r) {
521
+ function $t(e, t, ...r) {
522
522
  var a;
523
523
  if (r = r.filter(Boolean), r.length > 2) {
524
524
  const n = r.pop();
@@ -526,11 +526,11 @@ function Lt(e, t, ...r) {
526
526
  } else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
527
527
  return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (a = t.constructor) != null && a.name && (e += ` Received an instance of ${t.constructor.name}`), e;
528
528
  }
529
- const dt = (e, ...t) => Lt("Key must be ", e, ...t);
530
- function Mt(e, t, ...r) {
531
- return Lt(`Key for the ${e} algorithm must be `, t, ...r);
529
+ const lt = (e, ...t) => $t("Key must be ", e, ...t);
530
+ function Lt(e, t, ...r) {
531
+ return $t(`Key for the ${e} algorithm must be `, t, ...r);
532
532
  }
533
- const Ut = (e) => $t(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Ce = ["CryptoKey"], Nr = (...e) => {
533
+ const Mt = (e) => Dt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Ce = ["CryptoKey"], _r = (...e) => {
534
534
  const t = e.filter(Boolean);
535
535
  if (t.length === 0 || t.length === 1)
536
536
  return !0;
@@ -549,11 +549,11 @@ const Ut = (e) => $t(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
549
549
  }
550
550
  return !0;
551
551
  };
552
- function Rr(e) {
552
+ function Nr(e) {
553
553
  return typeof e == "object" && e !== null;
554
554
  }
555
555
  function me(e) {
556
- if (!Rr(e) || Object.prototype.toString.call(e) !== "[object Object]")
556
+ if (!Nr(e) || Object.prototype.toString.call(e) !== "[object Object]")
557
557
  return !1;
558
558
  if (Object.getPrototypeOf(e) === null)
559
559
  return !0;
@@ -562,7 +562,7 @@ function me(e) {
562
562
  t = Object.getPrototypeOf(t);
563
563
  return Object.getPrototypeOf(e) === t;
564
564
  }
565
- const xr = (e, t) => {
565
+ const Rr = (e, t) => {
566
566
  if (e.startsWith("RS") || e.startsWith("PS")) {
567
567
  const { modulusLength: r } = t.algorithm;
568
568
  if (typeof r != "number" || r < 2048)
@@ -572,16 +572,16 @@ const xr = (e, t) => {
572
572
  function he(e) {
573
573
  return me(e) && typeof e.kty == "string";
574
574
  }
575
- function Cr(e) {
575
+ function xr(e) {
576
576
  return e.kty !== "oct" && typeof e.d == "string";
577
577
  }
578
- function Or(e) {
578
+ function Cr(e) {
579
579
  return e.kty !== "oct" && typeof e.d > "u";
580
580
  }
581
- function Pr(e) {
581
+ function Or(e) {
582
582
  return he(e) && e.kty === "oct" && typeof e.k == "string";
583
583
  }
584
- function Dr(e) {
584
+ function Pr(e) {
585
585
  let t, r;
586
586
  switch (e.kty) {
587
587
  case "RSA": {
@@ -606,7 +606,7 @@ function Dr(e) {
606
606
  }, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
607
607
  break;
608
608
  default:
609
- throw new G('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
609
+ throw new W('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
610
610
  }
611
611
  break;
612
612
  }
@@ -628,7 +628,7 @@ function Dr(e) {
628
628
  t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
629
629
  break;
630
630
  default:
631
- throw new G('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
631
+ throw new W('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
632
632
  }
633
633
  break;
634
634
  }
@@ -644,52 +644,52 @@ function Dr(e) {
644
644
  t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
645
645
  break;
646
646
  default:
647
- throw new G('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
647
+ throw new W('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
648
648
  }
649
649
  break;
650
650
  }
651
651
  default:
652
- throw new G('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
652
+ throw new W('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
653
653
  }
654
654
  return { algorithm: t, keyUsages: r };
655
655
  }
656
- const Kt = async (e) => {
656
+ const Ut = async (e) => {
657
657
  if (!e.alg)
658
658
  throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
659
- const { algorithm: t, keyUsages: r } = Dr(e), a = [
659
+ const { algorithm: t, keyUsages: r } = Pr(e), a = [
660
660
  t,
661
661
  e.ext ?? !1,
662
662
  e.key_ops ?? r
663
663
  ], n = { ...e };
664
664
  return delete n.alg, delete n.use, Le.subtle.importKey("jwk", n, ...a);
665
- }, Ht = (e) => X(e);
665
+ }, Kt = (e) => X(e);
666
666
  let ae, ne;
667
- const Gt = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Oe = async (e, t, r, a, n = !1) => {
667
+ const Ht = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Oe = async (e, t, r, a, n = !1) => {
668
668
  let o = e.get(t);
669
669
  if (o != null && o[a])
670
670
  return o[a];
671
- const s = await Kt({ ...r, alg: a });
671
+ const s = await Ut({ ...r, alg: a });
672
672
  return n && Object.freeze(t), o ? o[a] = s : e.set(t, { [a]: s }), s;
673
- }, $r = (e, t) => {
674
- if (Gt(e)) {
673
+ }, Dr = (e, t) => {
674
+ if (Ht(e)) {
675
675
  let r = e.export({ format: "jwk" });
676
- return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Ht(r.k) : (ne || (ne = /* @__PURE__ */ new WeakMap()), Oe(ne, e, r, t));
676
+ return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Kt(r.k) : (ne || (ne = /* @__PURE__ */ new WeakMap()), Oe(ne, e, r, t));
677
677
  }
678
678
  return he(e) ? e.k ? X(e.k) : (ne || (ne = /* @__PURE__ */ new WeakMap()), Oe(ne, e, e, t, !0)) : e;
679
- }, Lr = (e, t) => {
680
- if (Gt(e)) {
679
+ }, $r = (e, t) => {
680
+ if (Ht(e)) {
681
681
  let r = e.export({ format: "jwk" });
682
- return r.k ? Ht(r.k) : (ae || (ae = /* @__PURE__ */ new WeakMap()), Oe(ae, e, r, t));
682
+ return r.k ? Kt(r.k) : (ae || (ae = /* @__PURE__ */ new WeakMap()), Oe(ae, e, r, t));
683
683
  }
684
684
  return he(e) ? e.k ? X(e.k) : (ae || (ae = /* @__PURE__ */ new WeakMap()), Oe(ae, e, e, t, !0)) : e;
685
- }, Mr = { normalizePublicKey: $r, normalizePrivateKey: Lr }, z = (e, t, r = 0) => {
685
+ }, Lr = { normalizePublicKey: Dr, normalizePrivateKey: $r }, z = (e, t, r = 0) => {
686
686
  r === 0 && (t.unshift(t.length), t.unshift(6));
687
687
  const a = e.indexOf(t[0], r);
688
688
  if (a === -1)
689
689
  return !1;
690
690
  const n = e.subarray(a, a + t.length);
691
691
  return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || z(e, t, a + 1);
692
- }, ut = (e) => {
692
+ }, dt = (e) => {
693
693
  switch (!0) {
694
694
  case z(e, [42, 134, 72, 206, 61, 3, 1, 7]):
695
695
  return "P-256";
@@ -706,9 +706,9 @@ const Gt = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
706
706
  case z(e, [43, 101, 113]):
707
707
  return "Ed448";
708
708
  default:
709
- throw new G("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
709
+ throw new W("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
710
710
  }
711
- }, Ur = async (e, t, r, a, n) => {
711
+ }, Mr = async (e, t, r, a, n) => {
712
712
  let o, s;
713
713
  const i = new Uint8Array(atob(r.replace(e, "")).split("").map((u) => u.charCodeAt(0)));
714
714
  switch (a) {
@@ -744,24 +744,24 @@ const Gt = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
744
744
  case "ECDH-ES+A128KW":
745
745
  case "ECDH-ES+A192KW":
746
746
  case "ECDH-ES+A256KW": {
747
- const u = ut(i);
747
+ const u = dt(i);
748
748
  o = u.startsWith("P-") ? { name: "ECDH", namedCurve: u } : { name: u }, s = [];
749
749
  break;
750
750
  }
751
751
  case "EdDSA":
752
- o = { name: ut(i) }, s = ["verify"];
752
+ o = { name: dt(i) }, s = ["verify"];
753
753
  break;
754
754
  default:
755
- throw new G('Invalid or unsupported "alg" (Algorithm) value');
755
+ throw new W('Invalid or unsupported "alg" (Algorithm) value');
756
756
  }
757
757
  return Le.subtle.importKey(t, i, o, !1, s);
758
- }, Kr = (e, t, r) => Ur(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
759
- async function Hr(e, t, r) {
758
+ }, Ur = (e, t, r) => Mr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
759
+ async function Kr(e, t, r) {
760
760
  if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
761
761
  throw new TypeError('"spki" must be SPKI formatted string');
762
- return Kr(e, t);
762
+ return Ur(e, t);
763
763
  }
764
- async function Gr(e, t) {
764
+ async function Hr(e, t) {
765
765
  if (!me(e))
766
766
  throw new TypeError("JWK must be an object");
767
767
  switch (t || (t = e.alg), e.kty) {
@@ -771,15 +771,15 @@ async function Gr(e, t) {
771
771
  return X(e.k);
772
772
  case "RSA":
773
773
  if (e.oth !== void 0)
774
- throw new G('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
774
+ throw new W('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
775
775
  case "EC":
776
776
  case "OKP":
777
- return Kt({ ...e, alg: t });
777
+ return Ut({ ...e, alg: t });
778
778
  default:
779
- throw new G('Unsupported "kty" (Key Type) Parameter value');
779
+ throw new W('Unsupported "kty" (Key Type) Parameter value');
780
780
  }
781
781
  }
782
- const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], Xe = (e, t, r) => {
782
+ const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], qe = (e, t, r) => {
783
783
  var a, n;
784
784
  if (t.use !== void 0 && t.use !== "sig")
785
785
  throw new TypeError("Invalid key for this operation, when present its use must be sig");
@@ -788,32 +788,32 @@ const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], Xe = (e, t, r) =>
788
788
  if (t.alg !== void 0 && t.alg !== e)
789
789
  throw new TypeError(`Invalid key for this operation, when present its alg must be ${e}`);
790
790
  return !0;
791
- }, Br = (e, t, r, a) => {
791
+ }, Wr = (e, t, r, a) => {
792
792
  if (!(t instanceof Uint8Array)) {
793
793
  if (a && he(t)) {
794
- if (Pr(t) && Xe(e, t, r))
794
+ if (Or(t) && qe(e, t, r))
795
795
  return;
796
796
  throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');
797
797
  }
798
- if (!Ut(t))
799
- throw new TypeError(Mt(e, t, ...Ce, "Uint8Array", a ? "JSON Web Key" : null));
798
+ if (!Mt(t))
799
+ throw new TypeError(Lt(e, t, ...Ce, "Uint8Array", a ? "JSON Web Key" : null));
800
800
  if (t.type !== "secret")
801
801
  throw new TypeError(`${de(t)} instances for symmetric algorithms must be of type "secret"`);
802
802
  }
803
- }, Wr = (e, t, r, a) => {
803
+ }, Br = (e, t, r, a) => {
804
804
  if (a && he(t))
805
805
  switch (r) {
806
806
  case "sign":
807
- if (Cr(t) && Xe(e, t, r))
807
+ if (xr(t) && qe(e, t, r))
808
808
  return;
809
809
  throw new TypeError("JSON Web Key for this operation be a private JWK");
810
810
  case "verify":
811
- if (Or(t) && Xe(e, t, r))
811
+ if (Cr(t) && qe(e, t, r))
812
812
  return;
813
813
  throw new TypeError("JSON Web Key for this operation be a public JWK");
814
814
  }
815
- if (!Ut(t))
816
- throw new TypeError(Mt(e, t, ...Ce, a ? "JSON Web Key" : null));
815
+ if (!Mt(t))
816
+ throw new TypeError(Lt(e, t, ...Ce, a ? "JSON Web Key" : null));
817
817
  if (t.type === "secret")
818
818
  throw new TypeError(`${de(t)} instances for asymmetric algorithms must not be of type "secret"`);
819
819
  if (r === "sign" && t.type === "public")
@@ -825,12 +825,12 @@ const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], Xe = (e, t, r) =>
825
825
  if (t.algorithm && r === "encrypt" && t.type === "private")
826
826
  throw new TypeError(`${de(t)} instances for asymmetric algorithm encryption must be of type "public"`);
827
827
  };
828
- function Bt(e, t, r, a) {
829
- t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ? Br(t, r, a, e) : Wr(t, r, a, e);
828
+ function Wt(e, t, r, a) {
829
+ t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ? Wr(t, r, a, e) : Br(t, r, a, e);
830
830
  }
831
- Bt.bind(void 0, !1);
832
- const mt = Bt.bind(void 0, !0);
833
- function Vr(e, t, r, a, n) {
831
+ Wt.bind(void 0, !1);
832
+ const ut = Wt.bind(void 0, !0);
833
+ function Gr(e, t, r, a, n) {
834
834
  if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
835
835
  throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
836
836
  if (!a || a.crit === void 0)
@@ -841,7 +841,7 @@ function Vr(e, t, r, a, n) {
841
841
  r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
842
842
  for (const s of a.crit) {
843
843
  if (!o.has(s))
844
- throw new G(`Extension Header Parameter "${s}" is not recognized`);
844
+ throw new W(`Extension Header Parameter "${s}" is not recognized`);
845
845
  if (n[s] === void 0)
846
846
  throw new e(`Extension Header Parameter "${s}" is missing`);
847
847
  if (o.get(s) && a[s] === void 0)
@@ -849,13 +849,13 @@ function Vr(e, t, r, a, n) {
849
849
  }
850
850
  return new Set(a.crit);
851
851
  }
852
- const Jr = (e, t) => {
852
+ const Vr = (e, t) => {
853
853
  if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
854
854
  throw new TypeError(`"${e}" option must be an array of strings`);
855
855
  if (t)
856
856
  return new Set(t);
857
857
  };
858
- function Yr(e, t) {
858
+ function Jr(e, t) {
859
859
  const r = `SHA-${e.slice(-3)}`;
860
860
  switch (e) {
861
861
  case "HS256":
@@ -877,103 +877,103 @@ function Yr(e, t) {
877
877
  case "EdDSA":
878
878
  return { name: t.name };
879
879
  default:
880
- throw new G(`alg ${e} is not supported either by JOSE or your javascript runtime`);
880
+ throw new W(`alg ${e} is not supported either by JOSE or your javascript runtime`);
881
881
  }
882
882
  }
883
- async function Fr(e, t, r) {
884
- if (t = await Mr.normalizePublicKey(t, e), $t(t))
885
- return _r(t, e, r), t;
883
+ async function Yr(e, t, r) {
884
+ if (t = await Lr.normalizePublicKey(t, e), Dt(t))
885
+ return Ar(t, e, r), t;
886
886
  if (t instanceof Uint8Array) {
887
887
  if (!e.startsWith("HS"))
888
- throw new TypeError(dt(t, ...Ce));
888
+ throw new TypeError(lt(t, ...Ce));
889
889
  return Le.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
890
890
  }
891
- throw new TypeError(dt(t, ...Ce, "Uint8Array", "JSON Web Key"));
891
+ throw new TypeError(lt(t, ...Ce, "Uint8Array", "JSON Web Key"));
892
892
  }
893
- const zr = async (e, t, r, a) => {
894
- const n = await Fr(e, t, "verify");
895
- xr(e, n);
896
- const o = Yr(e, n.algorithm);
893
+ const Fr = async (e, t, r, a) => {
894
+ const n = await Yr(e, t, "verify");
895
+ Rr(e, n);
896
+ const o = Jr(e, n.algorithm);
897
897
  try {
898
898
  return await Le.subtle.verify(o, n, r, a);
899
899
  } catch {
900
900
  return !1;
901
901
  }
902
902
  };
903
- async function jr(e, t, r) {
903
+ async function zr(e, t, r) {
904
904
  if (!me(e))
905
- throw new k("Flattened JWS must be an object");
905
+ throw new A("Flattened JWS must be an object");
906
906
  if (e.protected === void 0 && e.header === void 0)
907
- throw new k('Flattened JWS must have either of the "protected" or "header" members');
907
+ throw new A('Flattened JWS must have either of the "protected" or "header" members');
908
908
  if (e.protected !== void 0 && typeof e.protected != "string")
909
- throw new k("JWS Protected Header incorrect type");
909
+ throw new A("JWS Protected Header incorrect type");
910
910
  if (e.payload === void 0)
911
- throw new k("JWS Payload missing");
911
+ throw new A("JWS Payload missing");
912
912
  if (typeof e.signature != "string")
913
- throw new k("JWS Signature missing or incorrect type");
913
+ throw new A("JWS Signature missing or incorrect type");
914
914
  if (e.header !== void 0 && !me(e.header))
915
- throw new k("JWS Unprotected Header incorrect type");
915
+ throw new A("JWS Unprotected Header incorrect type");
916
916
  let a = {};
917
917
  if (e.protected)
918
918
  try {
919
919
  const y = X(e.protected);
920
920
  a = JSON.parse(be.decode(y));
921
921
  } catch {
922
- throw new k("JWS Protected Header is invalid");
922
+ throw new A("JWS Protected Header is invalid");
923
923
  }
924
- if (!Nr(a, e.header))
925
- throw new k("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
924
+ if (!_r(a, e.header))
925
+ throw new A("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
926
926
  const n = {
927
927
  ...a,
928
928
  ...e.header
929
- }, o = Vr(k, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
929
+ }, o = Gr(A, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
930
930
  let s = !0;
931
931
  if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
932
- throw new k('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
932
+ throw new A('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
933
933
  const { alg: i } = n;
934
934
  if (typeof i != "string" || !i)
935
- throw new k('JWS "alg" (Algorithm) Header Parameter missing or invalid');
936
- const u = r && Jr("algorithms", r.algorithms);
935
+ throw new A('JWS "alg" (Algorithm) Header Parameter missing or invalid');
936
+ const u = r && Vr("algorithms", r.algorithms);
937
937
  if (u && !u.has(i))
938
- throw new vr('"alg" (Algorithm) Header Parameter value not allowed');
938
+ throw new Ir('"alg" (Algorithm) Header Parameter value not allowed');
939
939
  if (s) {
940
940
  if (typeof e.payload != "string")
941
- throw new k("JWS Payload must be a string");
941
+ throw new A("JWS Payload must be a string");
942
942
  } else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
943
- throw new k("JWS Payload must be a string or an Uint8Array instance");
943
+ throw new A("JWS Payload must be a string or an Uint8Array instance");
944
944
  let h = !1;
945
- typeof t == "function" ? (t = await t(a, e), h = !0, mt(i, t, "verify"), he(t) && (t = await Gr(t, i))) : mt(i, t, "verify");
946
- const p = Tr(we.encode(e.protected ?? ""), we.encode("."), typeof e.payload == "string" ? we.encode(e.payload) : e.payload);
945
+ typeof t == "function" ? (t = await t(a, e), h = !0, ut(i, t, "verify"), he(t) && (t = await Hr(t, i))) : ut(i, t, "verify");
946
+ const p = wr(we.encode(e.protected ?? ""), we.encode("."), typeof e.payload == "string" ? we.encode(e.payload) : e.payload);
947
947
  let m;
948
948
  try {
949
949
  m = X(e.signature);
950
950
  } catch {
951
- throw new k("Failed to base64url decode the signature");
951
+ throw new A("Failed to base64url decode the signature");
952
952
  }
953
- if (!await zr(i, t, m, p))
954
- throw new Ar();
953
+ if (!await Fr(i, t, m, p))
954
+ throw new vr();
955
955
  let c;
956
956
  if (s)
957
957
  try {
958
958
  c = X(e.payload);
959
959
  } catch {
960
- throw new k("Failed to base64url decode the payload");
960
+ throw new A("Failed to base64url decode the payload");
961
961
  }
962
962
  else typeof e.payload == "string" ? c = we.encode(e.payload) : c = e.payload;
963
963
  const d = { payload: c };
964
964
  return e.protected !== void 0 && (d.protectedHeader = a), e.header !== void 0 && (d.unprotectedHeader = e.header), h ? { ...d, key: t } : d;
965
965
  }
966
- async function qr(e, t, r) {
966
+ async function jr(e, t, r) {
967
967
  if (e instanceof Uint8Array && (e = be.decode(e)), typeof e != "string")
968
- throw new k("Compact JWS must be a string or Uint8Array");
968
+ throw new A("Compact JWS must be a string or Uint8Array");
969
969
  const { 0: a, 1: n, 2: o, length: s } = e.split(".");
970
970
  if (s !== 3)
971
- throw new k("Invalid Compact JWS");
972
- const i = await jr({ payload: n, protected: a, signature: o }, t, r), u = { payload: i.payload, protectedHeader: i.protectedHeader };
971
+ throw new A("Invalid Compact JWS");
972
+ const i = await zr({ payload: n, protected: a, signature: o }, t, r), u = { payload: i.payload, protectedHeader: i.protectedHeader };
973
973
  return typeof t == "function" ? { ...u, key: i.key } : u;
974
974
  }
975
- const Xr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Vt = Wt * 60, tt = Vt * 24, Qr = tt * 7, Zr = tt * 365.25, ea = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, ht = (e) => {
976
- const t = ea.exec(e);
975
+ const qr = (e) => Math.floor(e.getTime() / 1e3), Bt = 60, Gt = Bt * 60, et = Gt * 24, Xr = et * 7, Qr = et * 365.25, Zr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, mt = (e) => {
976
+ const t = Zr.exec(e);
977
977
  if (!t || t[4] && t[1])
978
978
  throw new TypeError("Invalid time period format");
979
979
  const r = parseFloat(t[2]), a = t[3].toLowerCase();
@@ -991,31 +991,31 @@ const Xr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Vt = Wt * 60, tt = Vt
991
991
  case "min":
992
992
  case "mins":
993
993
  case "m":
994
- n = Math.round(r * Wt);
994
+ n = Math.round(r * Bt);
995
995
  break;
996
996
  case "hour":
997
997
  case "hours":
998
998
  case "hr":
999
999
  case "hrs":
1000
1000
  case "h":
1001
- n = Math.round(r * Vt);
1001
+ n = Math.round(r * Gt);
1002
1002
  break;
1003
1003
  case "day":
1004
1004
  case "days":
1005
1005
  case "d":
1006
- n = Math.round(r * tt);
1006
+ n = Math.round(r * et);
1007
1007
  break;
1008
1008
  case "week":
1009
1009
  case "weeks":
1010
1010
  case "w":
1011
- n = Math.round(r * Qr);
1011
+ n = Math.round(r * Xr);
1012
1012
  break;
1013
1013
  default:
1014
- n = Math.round(r * Zr);
1014
+ n = Math.round(r * Qr);
1015
1015
  break;
1016
1016
  }
1017
1017
  return t[1] === "-" || t[4] === "ago" ? -n : n;
1018
- }, pt = (e) => e.toLowerCase().replace(/^application\//, ""), ta = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, ra = (e, t, r = {}) => {
1018
+ }, ht = (e) => e.toLowerCase().replace(/^application\//, ""), ea = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, ta = (e, t, r = {}) => {
1019
1019
  let a;
1020
1020
  try {
1021
1021
  a = JSON.parse(be.decode(t));
@@ -1024,7 +1024,7 @@ const Xr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Vt = Wt * 60, tt = Vt
1024
1024
  if (!me(a))
1025
1025
  throw new Y("JWT Claims Set must be a top-level JSON object");
1026
1026
  const { typ: n } = r;
1027
- if (n && (typeof e.typ != "string" || pt(e.typ) !== pt(n)))
1027
+ if (n && (typeof e.typ != "string" || ht(e.typ) !== ht(n)))
1028
1028
  throw new K('unexpected "typ" JWT header value', a, "typ", "check_failed");
1029
1029
  const { requiredClaims: o = [], issuer: s, subject: i, audience: u, maxTokenAge: h } = r, p = [...o];
1030
1030
  h !== void 0 && p.push("iat"), u !== void 0 && p.push("aud"), i !== void 0 && p.push("sub"), s !== void 0 && p.push("iss");
@@ -1035,12 +1035,12 @@ const Xr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Vt = Wt * 60, tt = Vt
1035
1035
  throw new K('unexpected "iss" claim value', a, "iss", "check_failed");
1036
1036
  if (i && a.sub !== i)
1037
1037
  throw new K('unexpected "sub" claim value', a, "sub", "check_failed");
1038
- if (u && !ta(a.aud, typeof u == "string" ? [u] : u))
1038
+ if (u && !ea(a.aud, typeof u == "string" ? [u] : u))
1039
1039
  throw new K('unexpected "aud" claim value', a, "aud", "check_failed");
1040
1040
  let m;
1041
1041
  switch (typeof r.clockTolerance) {
1042
1042
  case "string":
1043
- m = ht(r.clockTolerance);
1043
+ m = mt(r.clockTolerance);
1044
1044
  break;
1045
1045
  case "number":
1046
1046
  m = r.clockTolerance;
@@ -1051,7 +1051,7 @@ const Xr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Vt = Wt * 60, tt = Vt
1051
1051
  default:
1052
1052
  throw new TypeError("Invalid clockTolerance option type");
1053
1053
  }
1054
- const { currentDate: c } = r, d = Xr(c || /* @__PURE__ */ new Date());
1054
+ const { currentDate: c } = r, d = qr(c || /* @__PURE__ */ new Date());
1055
1055
  if ((a.iat !== void 0 || h) && typeof a.iat != "number")
1056
1056
  throw new K('"iat" claim must be a number', a, "iat", "invalid");
1057
1057
  if (a.nbf !== void 0) {
@@ -1064,27 +1064,27 @@ const Xr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Vt = Wt * 60, tt = Vt
1064
1064
  if (typeof a.exp != "number")
1065
1065
  throw new K('"exp" claim must be a number', a, "exp", "invalid");
1066
1066
  if (a.exp <= d - m)
1067
- throw new lt('"exp" claim timestamp check failed', a, "exp", "check_failed");
1067
+ throw new ct('"exp" claim timestamp check failed', a, "exp", "check_failed");
1068
1068
  }
1069
1069
  if (h) {
1070
- const y = d - a.iat, b = typeof h == "number" ? h : ht(h);
1070
+ const y = d - a.iat, b = typeof h == "number" ? h : mt(h);
1071
1071
  if (y - m > b)
1072
- throw new lt('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
1072
+ throw new ct('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
1073
1073
  if (y < 0 - m)
1074
1074
  throw new K('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
1075
1075
  }
1076
1076
  return a;
1077
1077
  };
1078
- async function aa(e, t, r) {
1078
+ async function ra(e, t, r) {
1079
1079
  var a;
1080
- const n = await qr(e, t, r);
1080
+ const n = await jr(e, t, r);
1081
1081
  if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
1082
1082
  throw new Y("JWTs MUST NOT use unencoded payload");
1083
- const o = { payload: ra(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
1083
+ const o = { payload: ta(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
1084
1084
  return typeof t == "function" ? { ...o, key: n.key } : o;
1085
1085
  }
1086
- const na = X;
1087
- function oa(e) {
1086
+ const aa = X;
1087
+ function na(e) {
1088
1088
  if (typeof e != "string")
1089
1089
  throw new Y("JWTs must use Compact JWS serialization, JWT must be a string");
1090
1090
  const { 1: t, length: r } = e.split(".");
@@ -1096,7 +1096,7 @@ function oa(e) {
1096
1096
  throw new Y("JWTs must contain a payload");
1097
1097
  let a;
1098
1098
  try {
1099
- a = na(t);
1099
+ a = aa(t);
1100
1100
  } catch {
1101
1101
  throw new Y("Failed to base64url decode the payload");
1102
1102
  }
@@ -1112,81 +1112,81 @@ function oa(e) {
1112
1112
  }
1113
1113
  const fe = async (e) => {
1114
1114
  try {
1115
- const t = _.ALG, r = await Hr(wr, t);
1116
- return await aa(e, r, {
1115
+ const t = _.ALG, r = await Kr(Er, t);
1116
+ return await ra(e, r, {
1117
1117
  issuer: _.ISSUER
1118
1118
  });
1119
1119
  } catch {
1120
1120
  return;
1121
1121
  }
1122
- }, sa = (e) => {
1122
+ }, oa = (e) => {
1123
1123
  try {
1124
- return oa(e);
1124
+ return na(e);
1125
1125
  } catch {
1126
1126
  return;
1127
1127
  }
1128
1128
  };
1129
- var A = [];
1130
- for (var We = 0; We < 256; ++We)
1131
- A.push((We + 256).toString(16).slice(1));
1132
- function ia(e, t = 0) {
1133
- return (A[e[t + 0]] + A[e[t + 1]] + A[e[t + 2]] + A[e[t + 3]] + "-" + A[e[t + 4]] + A[e[t + 5]] + "-" + A[e[t + 6]] + A[e[t + 7]] + "-" + A[e[t + 8]] + A[e[t + 9]] + "-" + A[e[t + 10]] + A[e[t + 11]] + A[e[t + 12]] + A[e[t + 13]] + A[e[t + 14]] + A[e[t + 15]]).toLowerCase();
1134
- }
1135
- var Ie, ca = new Uint8Array(16);
1136
- function la() {
1129
+ var S = [];
1130
+ for (var Ge = 0; Ge < 256; ++Ge)
1131
+ S.push((Ge + 256).toString(16).slice(1));
1132
+ function sa(e, t = 0) {
1133
+ return (S[e[t + 0]] + S[e[t + 1]] + S[e[t + 2]] + S[e[t + 3]] + "-" + S[e[t + 4]] + S[e[t + 5]] + "-" + S[e[t + 6]] + S[e[t + 7]] + "-" + S[e[t + 8]] + S[e[t + 9]] + "-" + S[e[t + 10]] + S[e[t + 11]] + S[e[t + 12]] + S[e[t + 13]] + S[e[t + 14]] + S[e[t + 15]]).toLowerCase();
1134
+ }
1135
+ var Ie, ia = new Uint8Array(16);
1136
+ function ca() {
1137
1137
  if (!Ie && (Ie = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ie))
1138
1138
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1139
- return Ie(ca);
1139
+ return Ie(ia);
1140
1140
  }
1141
- var da = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1142
- const gt = {
1143
- randomUUID: da
1141
+ var la = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1142
+ const pt = {
1143
+ randomUUID: la
1144
1144
  };
1145
- function ft(e, t, r) {
1146
- if (gt.randomUUID && !t && !e)
1147
- return gt.randomUUID();
1145
+ function gt(e, t, r) {
1146
+ if (pt.randomUUID && !t && !e)
1147
+ return pt.randomUUID();
1148
1148
  e = e || {};
1149
- var a = e.random || (e.rng || la)();
1150
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ia(a);
1149
+ var a = e.random || (e.rng || ca)();
1150
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, sa(a);
1151
1151
  }
1152
- const yt = globalThis.crypto, ua = (e) => `${ft()}${ft()}`.slice(0, e), ma = (e) => btoa(
1152
+ const ft = globalThis.crypto, da = (e) => `${gt()}${gt()}`.slice(0, e), ua = (e) => btoa(
1153
1153
  [...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
1154
1154
  );
1155
- async function ha(e) {
1156
- if (!yt.subtle)
1155
+ async function ma(e) {
1156
+ if (!ft.subtle)
1157
1157
  throw new Error(
1158
1158
  "crypto.subtle is available only in secure contexts (HTTPS)."
1159
1159
  );
1160
- const t = new TextEncoder().encode(e), r = await yt.subtle.digest("SHA-256", t);
1161
- return ma(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1160
+ const t = new TextEncoder().encode(e), r = await ft.subtle.digest("SHA-256", t);
1161
+ return ua(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1162
1162
  }
1163
- async function pa(e) {
1164
- const t = ua(43), r = await ha(t);
1163
+ async function ha(e) {
1164
+ const t = da(43), r = await ma(t);
1165
1165
  return {
1166
1166
  code_verifier: t,
1167
1167
  code_challenge: r
1168
1168
  };
1169
1169
  }
1170
- function Jt(e, t) {
1170
+ function Vt(e, t) {
1171
1171
  window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
1172
1172
  }
1173
- const bt = (e, t) => {
1173
+ const yt = (e, t) => {
1174
1174
  const r = JSON.stringify(
1175
1175
  typeof t == "function" ? t() : t
1176
1176
  );
1177
- window.localStorage.setItem(e, r), Jt(e, r);
1178
- }, ga = (e) => {
1179
- window.localStorage.removeItem(e), Jt(e, null);
1180
- }, Et = (e) => window.localStorage.getItem(e), fa = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
1177
+ window.localStorage.setItem(e, r), Vt(e, r);
1178
+ }, pa = (e) => {
1179
+ window.localStorage.removeItem(e), Vt(e, null);
1180
+ }, bt = (e) => window.localStorage.getItem(e), ga = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
1181
1181
  function ve({
1182
1182
  key: e,
1183
1183
  initialValue: t
1184
1184
  }) {
1185
- const r = dr(fa, () => Et(e)), a = q(
1185
+ const r = lr(ga, () => bt(e)), a = q(
1186
1186
  (s) => {
1187
1187
  try {
1188
1188
  const i = typeof s == "function" ? s(JSON.parse(r)) : s;
1189
- i == null ? ga(e) : bt(e, i);
1189
+ i == null ? pa(e) : yt(e, i);
1190
1190
  } catch (i) {
1191
1191
  console.warn(i);
1192
1192
  }
@@ -1199,39 +1199,39 @@ function ve({
1199
1199
  }, [a]);
1200
1200
  return Q(() => {
1201
1201
  try {
1202
- Et(e) === null && typeof t < "u" && bt(e, t);
1202
+ bt(e) === null && typeof t < "u" && yt(e, t);
1203
1203
  } catch (s) {
1204
1204
  console.warn(s);
1205
1205
  }
1206
1206
  }, [e, t]), [r ? JSON.parse(r) : null, a, n, o];
1207
1207
  }
1208
- var S = [];
1208
+ var k = [];
1209
1209
  for (var Ve = 0; Ve < 256; ++Ve)
1210
- S.push((Ve + 256).toString(16).slice(1));
1211
- function ya(e, t = 0) {
1212
- return (S[e[t + 0]] + S[e[t + 1]] + S[e[t + 2]] + S[e[t + 3]] + "-" + S[e[t + 4]] + S[e[t + 5]] + "-" + S[e[t + 6]] + S[e[t + 7]] + "-" + S[e[t + 8]] + S[e[t + 9]] + "-" + S[e[t + 10]] + S[e[t + 11]] + S[e[t + 12]] + S[e[t + 13]] + S[e[t + 14]] + S[e[t + 15]]).toLowerCase();
1210
+ k.push((Ve + 256).toString(16).slice(1));
1211
+ function fa(e, t = 0) {
1212
+ return (k[e[t + 0]] + k[e[t + 1]] + k[e[t + 2]] + k[e[t + 3]] + "-" + k[e[t + 4]] + k[e[t + 5]] + "-" + k[e[t + 6]] + k[e[t + 7]] + "-" + k[e[t + 8]] + k[e[t + 9]] + "-" + k[e[t + 10]] + k[e[t + 11]] + k[e[t + 12]] + k[e[t + 13]] + k[e[t + 14]] + k[e[t + 15]]).toLowerCase();
1213
1213
  }
1214
- var Ae, ba = new Uint8Array(16);
1215
- function Ea() {
1216
- if (!Ae && (Ae = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ae))
1214
+ var Se, ya = new Uint8Array(16);
1215
+ function ba() {
1216
+ if (!Se && (Se = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Se))
1217
1217
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1218
- return Ae(ba);
1218
+ return Se(ya);
1219
1219
  }
1220
- var wa = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1221
- const wt = {
1222
- randomUUID: wa
1220
+ var Ea = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1221
+ const Et = {
1222
+ randomUUID: Ea
1223
1223
  };
1224
1224
  function Je(e, t, r) {
1225
- if (wt.randomUUID && !t && !e)
1226
- return wt.randomUUID();
1225
+ if (Et.randomUUID && !t && !e)
1226
+ return Et.randomUUID();
1227
1227
  e = e || {};
1228
- var a = e.random || (e.rng || Ea)();
1229
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ya(a);
1228
+ var a = e.random || (e.rng || ba)();
1229
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, fa(a);
1230
1230
  }
1231
- const oe = "Your session has expired. For your security, please log in again to continue.", Ta = "Your session has been successfully terminated.", Ye = "Login failed. Please try again.", Ia = "Error getting access token, please re-authenticate.", va = "You forgot to wrap your component in <AuthProvider>.", Pe = {
1231
+ const oe = "Your session has expired. For your security, please log in again to continue.", wa = "Your session has been successfully terminated.", Ye = "Login failed. Please try again.", Ta = "Error getting access token, please re-authenticate.", Ia = "You forgot to wrap your component in <AuthProvider>.", Pe = {
1232
1232
  dev: "https://auth.gizmette.local.com:3003",
1233
1233
  prod: "https://mylogin.gizmette.com/auth"
1234
- }, Se = "@@auth@@", ge = "LOADING", Ne = "LOGIN", Yt = "LOGOUT", Ee = "success", B = "failure", Ft = "include", zt = "POST", jt = "application/json", ke = {
1234
+ }, ke = "@@auth@@", ge = "LOADING", Ne = "LOGIN", Jt = "LOGOUT", Ee = "success", B = "failure", Yt = "include", Ft = "POST", zt = "application/json", Ae = {
1235
1235
  GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
1236
1236
  $clientId: String!,
1237
1237
  $username: String!,
@@ -1314,19 +1314,19 @@ const oe = "Your session has expired. For your security, please log in again to
1314
1314
  }`
1315
1315
  }, se = {
1316
1316
  GET_REGISTRATION_OPTIONS: {
1317
- schema: ke.GET_REGISTRATION_OPTIONS,
1317
+ schema: Ae.GET_REGISTRATION_OPTIONS,
1318
1318
  method: "getPasskeyRegistrationOptions"
1319
1319
  },
1320
1320
  VERIFY_REGISTRATION: {
1321
- schema: ke.VERIFY_REGISTRATION,
1321
+ schema: Ae.VERIFY_REGISTRATION,
1322
1322
  method: "verifyPasskeyRegistration"
1323
1323
  },
1324
1324
  GET_AUTHENTICATION_OPTIONS: {
1325
- schema: ke.GET_AUTHENTICATION_OPTIONS,
1325
+ schema: Ae.GET_AUTHENTICATION_OPTIONS,
1326
1326
  method: "getPasskeyAuthenticationOptions"
1327
1327
  },
1328
1328
  VERIFY_AUTHENTICATION: {
1329
- schema: ke.VERIFY_AUTHENTICATION,
1329
+ schema: Ae.VERIFY_AUTHENTICATION,
1330
1330
  method: "verifyPasskeyAuthentication"
1331
1331
  }
1332
1332
  }, ie = async ({
@@ -1337,14 +1337,14 @@ const oe = "Your session has expired. For your security, please log in again to
1337
1337
  }) => {
1338
1338
  try {
1339
1339
  const n = `Bearer ${e}`, o = await fetch(
1340
- qt ? `${Pe.dev}/graphql` : `${Pe.prod}/graphql`,
1340
+ jt ? `${Pe.dev}/graphql` : `${Pe.prod}/graphql`,
1341
1341
  {
1342
- credentials: Ft,
1343
- method: zt,
1342
+ credentials: Yt,
1343
+ method: Ft,
1344
1344
  headers: {
1345
1345
  authorization: n,
1346
- "Content-Type": jt,
1347
- [Dt.CLIENT_ID]: `${r}`
1346
+ "Content-Type": zt,
1347
+ [Pt.CLIENT_ID]: `${r}`
1348
1348
  },
1349
1349
  body: JSON.stringify({
1350
1350
  query: t.schema,
@@ -1369,13 +1369,13 @@ const oe = "Your session has expired. For your security, please log in again to
1369
1369
  }) => {
1370
1370
  try {
1371
1371
  const a = await fetch(
1372
- qt ? `${Pe.dev}/${e}` : `${Pe.prod}/${e}`,
1372
+ jt ? `${Pe.dev}/${e}` : `${Pe.prod}/${e}`,
1373
1373
  {
1374
- credentials: Ft,
1375
- method: zt,
1374
+ credentials: Yt,
1375
+ method: Ft,
1376
1376
  headers: {
1377
- "Content-Type": jt,
1378
- [Dt.CLIENT_ID]: `${t}`
1377
+ "Content-Type": zt,
1378
+ [Pt.CLIENT_ID]: `${t}`
1379
1379
  },
1380
1380
  body: JSON.stringify(r)
1381
1381
  }
@@ -1390,7 +1390,7 @@ const oe = "Your session has expired. For your security, please log in again to
1390
1390
  } catch (a) {
1391
1391
  return console.error(a), { status: B, data: [] };
1392
1392
  }
1393
- }, Aa = process.env.NODE_ENV === "production", qt = !Aa, Xt = {
1393
+ }, va = process.env.NODE_ENV === "production", jt = !va, qt = {
1394
1394
  isLoading: !0,
1395
1395
  isAuthenticated: !1,
1396
1396
  user: void 0,
@@ -1399,7 +1399,7 @@ const oe = "Your session has expired. For your security, please log in again to
1399
1399
  authenticationType: ""
1400
1400
  }, Sa = (e) => {
1401
1401
  try {
1402
- const t = sa(e);
1402
+ const t = oa(e);
1403
1403
  return t ? t[_.USER_ID_KEY] : "";
1404
1404
  } catch {
1405
1405
  return "";
@@ -1428,7 +1428,7 @@ const oe = "Your session has expired. For your security, please log in again to
1428
1428
  status: B
1429
1429
  };
1430
1430
  }
1431
- }, _a = async ({
1431
+ }, Aa = async ({
1432
1432
  username: e,
1433
1433
  password: t,
1434
1434
  clientId: r,
@@ -1472,7 +1472,7 @@ const oe = "Your session has expired. For your security, please log in again to
1472
1472
  status: !1
1473
1473
  };
1474
1474
  }
1475
- }, Na = async ({
1475
+ }, _a = async ({
1476
1476
  nonce: e,
1477
1477
  clientId: t,
1478
1478
  code_challenge: r
@@ -1501,7 +1501,7 @@ const oe = "Your session has expired. For your security, please log in again to
1501
1501
  data: ""
1502
1502
  };
1503
1503
  }
1504
- }, Ra = async ({
1504
+ }, Na = async ({
1505
1505
  clientId: e,
1506
1506
  userId: t,
1507
1507
  nonce: r,
@@ -1537,7 +1537,7 @@ const oe = "Your session has expired. For your security, please log in again to
1537
1537
  };
1538
1538
  }
1539
1539
  };
1540
- class xa {
1540
+ class Ra {
1541
1541
  constructor(t = null, r = null) {
1542
1542
  He(this, "refreshTokenPromise", null), He(this, "accessToken"), He(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1543
1543
  }
@@ -1567,7 +1567,7 @@ class xa {
1567
1567
  }) {
1568
1568
  const o = await fe(this.refreshToken);
1569
1569
  if (o && o.payload[_.USER_ID_KEY] !== "") {
1570
- const s = await Ra({
1570
+ const s = await Na({
1571
1571
  clientId: t,
1572
1572
  userId: r,
1573
1573
  nonce: a,
@@ -1588,14 +1588,14 @@ class xa {
1588
1588
  };
1589
1589
  }
1590
1590
  }
1591
- const Ca = (e) => q(
1591
+ const xa = (e) => q(
1592
1592
  (...t) => {
1593
1593
  e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
1594
1594
  },
1595
1595
  [e]
1596
1596
  ), ce = () => {
1597
- throw new Error(va);
1598
- }, Qt = lr({
1597
+ throw new Error(Ia);
1598
+ }, Xt = cr({
1599
1599
  isAuthenticated: !1,
1600
1600
  isLoading: !1,
1601
1601
  login: ce,
@@ -1606,11 +1606,11 @@ const Ca = (e) => q(
1606
1606
  loginWithPasskey: ce,
1607
1607
  logoutReason: "",
1608
1608
  authenticationType: ""
1609
- }), Oa = O.createContext({
1610
- state: Xt,
1609
+ }), Ca = O.createContext({
1610
+ state: qt,
1611
1611
  dispatch: () => {
1612
1612
  }
1613
- }), Pa = (e, t) => (t == null ? void 0 : t.type) === ge ? {
1613
+ }), Oa = (e, t) => (t == null ? void 0 : t.type) === ge ? {
1614
1614
  ...e,
1615
1615
  isLoading: t.payload.isLoading
1616
1616
  } : (t == null ? void 0 : t.type) === Ne ? {
@@ -1620,34 +1620,34 @@ const Ca = (e) => q(
1620
1620
  user: t.payload.user,
1621
1621
  authenticationType: t.payload.authenticationType,
1622
1622
  logoutReason: ""
1623
- } : (t == null ? void 0 : t.type) === Yt ? {
1623
+ } : (t == null ? void 0 : t.type) === Jt ? {
1624
1624
  ...e,
1625
1625
  isLoading: !1,
1626
1626
  isAuthenticated: !1,
1627
1627
  user: void 0,
1628
1628
  authenticationType: "",
1629
1629
  logoutReason: t.payload.logoutReason
1630
- } : e, Da = ({
1630
+ } : e, Pa = ({
1631
1631
  children: e,
1632
1632
  sessionExpiration: t,
1633
1633
  clientId: r,
1634
1634
  domain: a = "",
1635
1635
  debug: n = !1
1636
1636
  }) => {
1637
- const [o, s] = St(Pa, {
1638
- ...Xt,
1637
+ const [o, s] = St(Oa, {
1638
+ ...qt,
1639
1639
  debug: n
1640
- }), i = Ca(n), u = L(!1), [h, p, , m] = ve({
1641
- key: `${Se}::${r}::@@user@@`
1640
+ }), i = xa(n), u = L(!1), [h, p, , m] = ve({
1641
+ key: `${ke}::${r}::@@user@@`
1642
1642
  }), [c, d, , y] = ve({
1643
- key: `${Se}::${r}::@@access@@`
1643
+ key: `${ke}::${r}::@@access@@`
1644
1644
  }), [b, v, , w] = ve(
1645
1645
  {
1646
- key: `${Se}::${r}::@@refresh@@`
1646
+ key: `${ke}::${r}::@@refresh@@`
1647
1647
  }
1648
1648
  ), [C, D, , M] = ve({
1649
- key: `${Se}::${r}::@@nonce@@`
1650
- }), Z = new xa(c, b), N = q(() => {
1649
+ key: `${ke}::${r}::@@nonce@@`
1650
+ }), Z = new Ra(c, b), N = q(() => {
1651
1651
  i("removeLocalStorage: removing local storage"), m(), y(), w(), M();
1652
1652
  }, [
1653
1653
  y,
@@ -1655,13 +1655,13 @@ const Ca = (e) => q(
1655
1655
  M,
1656
1656
  w,
1657
1657
  i
1658
- ]), W = q(
1658
+ ]), G = q(
1659
1659
  (g) => {
1660
1660
  i(
1661
1661
  "removeStateAndLocalStorage: removing state and local storage with reason: ",
1662
1662
  g
1663
1663
  ), s({
1664
- type: Yt,
1664
+ type: Jt,
1665
1665
  payload: {
1666
1666
  logoutReason: g || oe
1667
1667
  }
@@ -1679,9 +1679,9 @@ const Ca = (e) => q(
1679
1679
  clientId: r,
1680
1680
  domain: a,
1681
1681
  idToken: h
1682
- }), W(g || oe);
1682
+ }), G(g || oe);
1683
1683
  },
1684
- [h, o, r, a, W, i]
1684
+ [h, o, r, a, G, i]
1685
1685
  );
1686
1686
  Q(() => {
1687
1687
  if (!u.current)
@@ -1712,20 +1712,20 @@ const Ca = (e) => q(
1712
1712
  s({ type: ge, payload: { isLoading: !0 } }), N();
1713
1713
  const E = Je();
1714
1714
  D(E), i("login: Logging in with password");
1715
- const { code_verifier: F, code_challenge: cr } = await pa(), it = await Na({
1715
+ const { code_verifier: F, code_challenge: ir } = await ha(), st = await _a({
1716
1716
  nonce: E,
1717
1717
  clientId: r,
1718
- code_challenge: cr
1718
+ code_challenge: ir
1719
1719
  });
1720
- if (it.status) {
1721
- const re = await _a({
1720
+ if (st.status) {
1721
+ const re = await Aa({
1722
1722
  username: g,
1723
1723
  password: T,
1724
1724
  clientId: r,
1725
1725
  sessionExpiration: t,
1726
1726
  nonce: E,
1727
1727
  type: ue.CODE,
1728
- code: it.data,
1728
+ code: st.data,
1729
1729
  code_verifier: F,
1730
1730
  domain: a,
1731
1731
  ua: navigator.userAgent
@@ -1740,11 +1740,11 @@ const Ca = (e) => q(
1740
1740
  email: re.email
1741
1741
  }
1742
1742
  }
1743
- }), !0) : (W(Ye), !1);
1743
+ }), !0) : (G(Ye), !1);
1744
1744
  }
1745
1745
  return !1;
1746
1746
  }, pe = async (g) => {
1747
- g == null || g.preventDefault(), await P(Ta);
1747
+ g == null || g.preventDefault(), await P(wa);
1748
1748
  }, ee = async () => {
1749
1749
  const { isAuthenticated: g, user: T } = o;
1750
1750
  try {
@@ -1772,7 +1772,7 @@ const Ca = (e) => q(
1772
1772
  } catch {
1773
1773
  return i(
1774
1774
  "getAccessToken: exception occurred, invalidating and logging out"
1775
- ), await P(Ia), "";
1775
+ ), await P(Ta), "";
1776
1776
  }
1777
1777
  }, R = () => o.isAuthenticated && h ? h : "", $ = async () => {
1778
1778
  const { user: g } = o;
@@ -1788,7 +1788,7 @@ const Ca = (e) => q(
1788
1788
  });
1789
1789
  if (T.status)
1790
1790
  try {
1791
- const E = await fr(T.data);
1791
+ const E = await gr(T.data);
1792
1792
  return T = await ie({
1793
1793
  accessToken: c,
1794
1794
  clientId: r,
@@ -1830,7 +1830,7 @@ const Ca = (e) => q(
1830
1830
  });
1831
1831
  if (E.status)
1832
1832
  try {
1833
- const F = await Er(E.data);
1833
+ const F = await br(E.data);
1834
1834
  return E = await ie({
1835
1835
  accessToken: c,
1836
1836
  clientId: r,
@@ -1854,7 +1854,7 @@ const Ca = (e) => q(
1854
1854
  email: E.data.email
1855
1855
  }
1856
1856
  }
1857
- }), !0) : (W(Ye), !1);
1857
+ }), !0) : (G(Ye), !1);
1858
1858
  } catch {
1859
1859
  return await ie({
1860
1860
  accessToken: c,
@@ -1868,12 +1868,12 @@ const Ca = (e) => q(
1868
1868
  domain: a,
1869
1869
  sessionExpiration: t
1870
1870
  }
1871
- }), W(Ye), !1;
1871
+ }), G(Ye), !1;
1872
1872
  }
1873
1873
  return !1;
1874
1874
  };
1875
- return /* @__PURE__ */ l(Oa.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ l(
1876
- Qt.Provider,
1875
+ return /* @__PURE__ */ l(Ca.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ l(
1876
+ Xt.Provider,
1877
1877
  {
1878
1878
  value: {
1879
1879
  ...o,
@@ -1887,33 +1887,19 @@ const Ca = (e) => q(
1887
1887
  children: e
1888
1888
  }
1889
1889
  ) });
1890
- }, rt = (e = Qt) => Ze(e), po = "user", go = "assistant", fo = "system", yo = "internal", bo = "hidden", Eo = "I'm having trouble right now. Please try again later.", Fe = "OpenAI", wo = "OpenAI", To = "Anthropic", Io = 128e3, vo = "action-message", Ao = "action-reset", So = "action-model", ko = "action-restore", _o = "action-streaming", No = "action-engine", Ro = "action-search", xo = "action-sort", Co = "action-toggle-tag", Oo = "action-reset-tags", ze = {
1891
- SUMMARIZE_ARTICLE: "summarize-article",
1892
- PROOFREAD_CONTENT: "proofread-content",
1893
- REPHRASE_CONTENT: "rephrase-content"
1894
- }, Po = {
1895
- [ze.SUMMARIZE_ARTICLE]: {
1896
- label: "Summarize...",
1897
- content: "Summarize this article: "
1898
- },
1899
- [ze.PROOFREAD_CONTENT]: {
1900
- label: "Proofread...",
1901
- content: "Proofread this: "
1902
- },
1903
- [ze.REPHRASE_CONTENT]: { label: "Rephrase...", content: "Rephrase this: " }
1904
- }, Do = "sassy-saint-", $o = "details", Lo = "search", Mo = "sort", Uo = "summarize-article", Ko = "proofread-content", Ho = "rephrase-content", Go = "engine-toggle", Bo = "==stats==", $a = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", Tt = (e) => Number.isFinite(e) ? e : 0;
1905
- function La(e) {
1890
+ }, tt = (e = Xt) => Qe(e), ho = "user", po = "assistant", go = "system", fo = "internal", yo = "hidden", bo = "I'm having trouble right now. Please try again later.", Fe = "OpenAI", Eo = "OpenAI", wo = "Anthropic", To = 128e3, Io = "action-message", vo = "action-reset", So = "action-model", ko = "action-restore", Ao = "action-streaming", _o = "action-engine", No = "action-search", Ro = "action-sort", xo = "action-toggle-tag", Co = "action-reset-tags", Oo = "action-set-tags", Po = "sassy-saint-", Do = "details", $o = "search", Lo = "sort", Mo = "engine-toggle", Uo = "==stats==", Da = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", wt = (e) => Number.isFinite(e) ? e : 0;
1891
+ function $a(e) {
1906
1892
  return {
1907
1893
  days: Math.trunc(e / 864e5),
1908
1894
  hours: Math.trunc(e / 36e5 % 24),
1909
1895
  minutes: Math.trunc(e / 6e4 % 60),
1910
1896
  seconds: Math.trunc(e / 1e3 % 60),
1911
1897
  milliseconds: Math.trunc(e % 1e3),
1912
- microseconds: Math.trunc(Tt(e * 1e3) % 1e3),
1913
- nanoseconds: Math.trunc(Tt(e * 1e6) % 1e3)
1898
+ microseconds: Math.trunc(wt(e * 1e3) % 1e3),
1899
+ nanoseconds: Math.trunc(wt(e * 1e6) % 1e3)
1914
1900
  };
1915
1901
  }
1916
- function Ma(e) {
1902
+ function La(e) {
1917
1903
  return {
1918
1904
  days: e / 86400000n,
1919
1905
  hours: e / 3600000n % 24n,
@@ -1924,20 +1910,20 @@ function Ma(e) {
1924
1910
  nanoseconds: 0n
1925
1911
  };
1926
1912
  }
1927
- function Ua(e) {
1913
+ function Ma(e) {
1928
1914
  switch (typeof e) {
1929
1915
  case "number": {
1930
1916
  if (Number.isFinite(e))
1931
- return La(e);
1917
+ return $a(e);
1932
1918
  break;
1933
1919
  }
1934
1920
  case "bigint":
1935
- return Ma(e);
1921
+ return La(e);
1936
1922
  }
1937
1923
  throw new TypeError("Expected a finite number or bigint");
1938
1924
  }
1939
- const Ka = (e) => e === 0 || e === 0n, Ha = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Ga = 1e-7, Ba = 24n * 60n * 60n * 1000n;
1940
- function Wa(e, t) {
1925
+ const Ua = (e) => e === 0 || e === 0n, Ka = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Ha = 1e-7, Wa = 24n * 60n * 60n * 1000n;
1926
+ function Ba(e, t) {
1941
1927
  const r = typeof e == "bigint";
1942
1928
  if (!r && !Number.isFinite(e))
1943
1929
  throw new TypeError("Expected a finite number or bigint");
@@ -1946,18 +1932,18 @@ function Wa(e, t) {
1946
1932
  e = e < 0 ? -e : e, t.colonNotation && (t.compact = !1, t.formatSubMilliseconds = !1, t.separateMilliseconds = !1, t.verbose = !1), t.compact && (t.unitCount = 1, t.secondsDecimalDigits = 0, t.millisecondsDecimalDigits = 0);
1947
1933
  let n = [];
1948
1934
  const o = (p, m) => {
1949
- const c = Math.floor(p * 10 ** m + Ga);
1935
+ const c = Math.floor(p * 10 ** m + Ha);
1950
1936
  return (Math.round(c) / 10 ** m).toFixed(m);
1951
1937
  }, s = (p, m, c, d) => {
1952
- if (!((n.length === 0 || !t.colonNotation) && Ka(p) && !(t.colonNotation && c === "m"))) {
1938
+ if (!((n.length === 0 || !t.colonNotation) && Ua(p) && !(t.colonNotation && c === "m"))) {
1953
1939
  if (d ?? (d = String(p)), t.colonNotation) {
1954
1940
  const y = d.includes(".") ? d.split(".")[0].length : d.length, b = n.length > 0 ? 2 : 1;
1955
1941
  d = "0".repeat(Math.max(0, b - y)) + d;
1956
1942
  } else
1957
- d += t.verbose ? " " + Ha(m, p) : c;
1943
+ d += t.verbose ? " " + Ka(m, p) : c;
1958
1944
  n.push(d);
1959
1945
  }
1960
- }, i = Ua(e), u = BigInt(i.days);
1946
+ }, i = Ma(e), u = BigInt(i.days);
1961
1947
  if (t.hideYearAndDays ? s(BigInt(u) * 24n + BigInt(i.hours), "hour", "h") : (t.hideYear ? s(u, "day", "d") : (s(u / 365n, "year", "y"), s(u % 365n, "day", "d")), s(Number(i.hours), "hour", "h")), s(Number(i.minutes), "minute", "m"), !t.hideSeconds)
1962
1948
  if (t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
1963
1949
  const p = Number(i.seconds), m = Number(i.milliseconds), c = Number(i.microseconds), d = Number(i.nanoseconds);
@@ -1973,7 +1959,7 @@ function Wa(e, t) {
1973
1959
  );
1974
1960
  }
1975
1961
  } else {
1976
- const p = (r ? Number(e % Ba) : e) / 1e3 % 60, m = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, c = o(p, m), d = t.keepDecimalsOnWholeSeconds ? c : c.replace(/\.0+$/, "");
1962
+ const p = (r ? Number(e % Wa) : e) / 1e3 % 60, m = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, c = o(p, m), d = t.keepDecimalsOnWholeSeconds ? c : c.replace(/\.0+$/, "");
1977
1963
  s(Number.parseFloat(d), "second", "s", d);
1978
1964
  }
1979
1965
  if (n.length === 0)
@@ -1981,7 +1967,7 @@ function Wa(e, t) {
1981
1967
  const h = t.colonNotation ? ":" : " ";
1982
1968
  return typeof t.unitCount == "number" && (n = n.slice(0, Math.max(t.unitCount, 1))), a + n.join(h);
1983
1969
  }
1984
- const Va = process.env.NODE_ENV === "production", at = !Va, Ja = at ? "gizmette.local.com" : "gizmette.com", Wo = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, Vo = async () => {
1970
+ const Ga = process.env.NODE_ENV === "production", rt = !Ga, Va = rt ? "gizmette.local.com" : "gizmette.com", Ko = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, Ho = async () => {
1985
1971
  const e = {
1986
1972
  /**
1987
1973
  * A boolean value that indicates the application would
@@ -2030,11 +2016,11 @@ const Va = process.env.NODE_ENV === "production", at = !Va, Ja = at ? "gizmette.
2030
2016
  e
2031
2017
  );
2032
2018
  });
2033
- }, Jo = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ l("dl", { className: "my-0", children: /* @__PURE__ */ I("div", { className: "flex items-center justify-between", children: [
2019
+ }, Wo = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ l("dl", { className: "my-0", children: /* @__PURE__ */ I("div", { className: "flex items-center justify-between", children: [
2034
2020
  /* @__PURE__ */ l("dt", { className: "my-1 inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
2035
2021
  /* @__PURE__ */ l("dd", { className: "my-1 inline-block", children: t[r] })
2036
2022
  ] }) }, `${e}-${r}`)) : null;
2037
- function Yo({
2023
+ function Bo({
2038
2024
  data: e,
2039
2025
  formatter: t = (r) => r
2040
2026
  }) {
@@ -2046,18 +2032,18 @@ function Yo({
2046
2032
  );
2047
2033
  return t(a ? a / r.length : 0);
2048
2034
  }
2049
- const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, zo = new Intl.NumberFormat("en", {
2035
+ const Go = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Vo = new Intl.NumberFormat("en", {
2050
2036
  style: "decimal",
2051
2037
  signDisplay: "never",
2052
2038
  minimumFractionDigits: 0,
2053
2039
  maximumFractionDigits: 0
2054
- }), jo = (e) => e > 0 ? Wa(e, {
2040
+ }), Jo = (e) => e > 0 ? Ba(e, {
2055
2041
  secondsDecimalDigits: 2,
2056
2042
  unitCount: 2
2057
- }) : "N/A", Ya = (e) => f(
2043
+ }) : "N/A", Ja = (e) => f(
2058
2044
  "flex-1 space-y-6 overflow-y-auto rounded-md bg-slate-900 px-4 pb-10 text-base leading-6 text-slate-300 shadow-sm sm:text-base sm:leading-7",
2059
- e || at ? "pt-4" : "pt-10"
2060
- ), qo = (e, t) => t === 1 ? e : `${e}s`, It = "av-button", Fa = (e) => {
2045
+ e || rt ? "pt-4" : "pt-10"
2046
+ ), Yo = (e, t) => t === 1 ? e : `${e}s`, Tt = "av-button", Ya = (e) => {
2061
2047
  let t = "";
2062
2048
  if (typeof e == "number" || typeof e == "string")
2063
2049
  t = "m-" + e;
@@ -2066,7 +2052,7 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2066
2052
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
2067
2053
  }
2068
2054
  return t;
2069
- }, nt = "icon", Zt = "button", za = "link", ja = ({
2055
+ }, at = "icon", Qt = "button", Fa = "link", za = ({
2070
2056
  type: e,
2071
2057
  size: t,
2072
2058
  labelRight: r,
@@ -2075,19 +2061,19 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2075
2061
  }) => {
2076
2062
  const o = "text-sm font-medium max-h-8 py-0", s = "text-base font-medium max-h-9 py-1", i = "text-lg font-medium max-h-12 py-2";
2077
2063
  switch (e) {
2078
- case Zt:
2064
+ case Qt:
2079
2065
  return f("px-4", {
2080
2066
  [o]: t === "small",
2081
2067
  [s]: t === "medium",
2082
2068
  [i]: t === "large"
2083
2069
  });
2084
- case za:
2070
+ case Fa:
2085
2071
  return f("px-4 text-center", {
2086
2072
  [o]: t === "small",
2087
2073
  [s]: t === "medium",
2088
2074
  [i]: t === "large"
2089
2075
  });
2090
- case nt:
2076
+ case at:
2091
2077
  return f("inline-flex items-center", {
2092
2078
  "justify-center": n === "center",
2093
2079
  "justify-start": n === "left",
@@ -2100,7 +2086,7 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2100
2086
  "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
2101
2087
  });
2102
2088
  }
2103
- }, qa = ({
2089
+ }, ja = ({
2104
2090
  mode: e,
2105
2091
  noBackground: t,
2106
2092
  noTruncate: r,
@@ -2132,7 +2118,7 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2132
2118
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
2133
2119
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
2134
2120
  });
2135
- }, Xa = ({
2121
+ }, qa = ({
2136
2122
  mode: e,
2137
2123
  disabled: t,
2138
2124
  variant: r
@@ -2160,7 +2146,7 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2160
2146
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
2161
2147
  "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
2162
2148
  });
2163
- }, Qa = ({
2149
+ }, Xa = ({
2164
2150
  mode: e,
2165
2151
  disabled: t,
2166
2152
  variant: r
@@ -2188,7 +2174,7 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2188
2174
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
2189
2175
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
2190
2176
  });
2191
- }, Za = ({
2177
+ }, Qa = ({
2192
2178
  mode: e,
2193
2179
  noBorder: t,
2194
2180
  variant: r
@@ -2216,12 +2202,12 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2216
2202
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
2217
2203
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
2218
2204
  });
2219
- }, en = ({ focusMode: e }) => f("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2205
+ }, Za = ({ focusMode: e }) => f("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2220
2206
  "focus:outline-focus-dark": e === "dark",
2221
2207
  "focus:outline-focus-light": e === "light",
2222
2208
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
2223
2209
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
2224
- }), ot = ({
2210
+ }), nt = ({
2225
2211
  type: e,
2226
2212
  className: t,
2227
2213
  raw: r,
@@ -2238,21 +2224,21 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2238
2224
  variant: d,
2239
2225
  noTruncate: y,
2240
2226
  align: b
2241
- }) => (d || (d = "primary"), r ? f(It, t) : f(
2242
- It,
2227
+ }) => (d || (d = "primary"), r ? f(Tt, t) : f(
2228
+ Tt,
2243
2229
  t,
2244
- Fa(m),
2245
- qa({ mode: a, variant: d, noBackground: c, noTruncate: y }),
2246
- ja({ type: e, size: i, labelRight: h, labelLeft: p, align: b }),
2247
- Za({ mode: a, variant: d, noBorder: u }),
2248
- en({ focusMode: n }),
2230
+ Ya(m),
2231
+ ja({ mode: a, variant: d, noBackground: c, noTruncate: y }),
2232
+ za({ type: e, size: i, labelRight: h, labelLeft: p, align: b }),
2233
+ Qa({ mode: a, variant: d, noBorder: u }),
2234
+ Za({ focusMode: n }),
2235
+ qa({ mode: a, variant: d, disabled: o }),
2249
2236
  Xa({ mode: a, variant: d, disabled: o }),
2250
- Qa({ mode: a, variant: d, disabled: o }),
2251
2237
  {
2252
2238
  "w-full": s,
2253
2239
  "disabled:cursor-not-allowed disabled:opacity-50": o
2254
2240
  }
2255
- )), tn = (e, t, r) => {
2241
+ )), en = (e, t, r) => {
2256
2242
  var a;
2257
2243
  !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
2258
2244
  }, Ue = O.forwardRef((e, t) => {
@@ -2262,14 +2248,14 @@ const Fo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2262
2248
  {
2263
2249
  ref: t,
2264
2250
  onClick: (o) => {
2265
- tn(o, a, r);
2251
+ en(o, a, r);
2266
2252
  },
2267
2253
  ...n
2268
2254
  }
2269
2255
  );
2270
2256
  });
2271
2257
  Ue.displayName = "BaseButton";
2272
- const er = O.forwardRef(
2258
+ const Zt = O.forwardRef(
2273
2259
  ({
2274
2260
  children: e,
2275
2261
  disabled: t = !1,
@@ -2285,8 +2271,8 @@ const er = O.forwardRef(
2285
2271
  noTruncate: m = !1,
2286
2272
  ...c
2287
2273
  }, d) => {
2288
- const y = ot({
2289
- type: Zt,
2274
+ const y = nt({
2275
+ type: Qt,
2290
2276
  mode: r,
2291
2277
  focusMode: a,
2292
2278
  fullWidth: n,
@@ -2311,8 +2297,8 @@ const er = O.forwardRef(
2311
2297
  );
2312
2298
  }
2313
2299
  );
2314
- er.displayName = "Button";
2315
- const Qe = O.forwardRef(
2300
+ Zt.displayName = "Button";
2301
+ const Xe = O.forwardRef(
2316
2302
  ({
2317
2303
  children: e,
2318
2304
  disabled: t = !1,
@@ -2333,8 +2319,8 @@ const Qe = O.forwardRef(
2333
2319
  align: v = "center",
2334
2320
  ...w
2335
2321
  }, C) => {
2336
- const D = ot({
2337
- type: nt,
2322
+ const D = nt({
2323
+ type: at,
2338
2324
  mode: r,
2339
2325
  focusMode: a,
2340
2326
  fullWidth: n,
@@ -2372,7 +2358,7 @@ const Qe = O.forwardRef(
2372
2358
  );
2373
2359
  }
2374
2360
  );
2375
- Qe.displayName = "ButtonIcon";
2361
+ Xe.displayName = "ButtonIcon";
2376
2362
  /*!
2377
2363
  @versini/ui-button v1.1.11
2378
2364
  © 2024 gizmette.com
@@ -2386,7 +2372,7 @@ try {
2386
2372
  });
2387
2373
  } catch {
2388
2374
  }
2389
- const rn = O.forwardRef(
2375
+ const tn = O.forwardRef(
2390
2376
  ({
2391
2377
  children: e,
2392
2378
  disabled: t = !1,
@@ -2408,8 +2394,8 @@ const rn = O.forwardRef(
2408
2394
  active: w = !1,
2409
2395
  ...C
2410
2396
  }, D) => {
2411
- const M = ot({
2412
- type: nt,
2397
+ const M = nt({
2398
+ type: at,
2413
2399
  mode: r,
2414
2400
  focusMode: a,
2415
2401
  fullWidth: n,
@@ -2463,7 +2449,7 @@ const rn = O.forwardRef(
2463
2449
  ) });
2464
2450
  }
2465
2451
  );
2466
- rn.displayName = "ButtonSort";
2452
+ tn.displayName = "ButtonSort";
2467
2453
  /*!
2468
2454
  @versini/ui-card v1.0.10
2469
2455
  © 2024 gizmette.com
@@ -2478,11 +2464,11 @@ try {
2478
2464
  } catch {
2479
2465
  }
2480
2466
  const Re = "av-card";
2481
- function an(e) {
2467
+ function rn(e) {
2482
2468
  const t = kt();
2483
2469
  return `${e}${t}`;
2484
2470
  }
2485
- const nn = (e) => {
2471
+ const an = (e) => {
2486
2472
  let t = "";
2487
2473
  if (typeof e == "number" || typeof e == "string")
2488
2474
  t = "m-" + e;
@@ -2491,7 +2477,7 @@ const nn = (e) => {
2491
2477
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
2492
2478
  }
2493
2479
  return t;
2494
- }, on = ({
2480
+ }, nn = ({
2495
2481
  className: e,
2496
2482
  headerClassName: t,
2497
2483
  bodyClassName: r,
@@ -2505,7 +2491,7 @@ const nn = (e) => {
2505
2491
  Re,
2506
2492
  e,
2507
2493
  "rounded-md",
2508
- nn(n),
2494
+ an(n),
2509
2495
  {
2510
2496
  "border-none": i,
2511
2497
  "border-2": !i,
@@ -2533,7 +2519,7 @@ const nn = (e) => {
2533
2519
  footer: m
2534
2520
  };
2535
2521
  };
2536
- function sn({
2522
+ function on({
2537
2523
  id: e,
2538
2524
  content: t,
2539
2525
  userAriaLabelledby: r,
@@ -2541,7 +2527,7 @@ function sn({
2541
2527
  }) {
2542
2528
  return typeof t == "string" ? /* @__PURE__ */ l("h2", { id: e, className: a, children: t }) : r ? /* @__PURE__ */ l("div", { className: a, children: t }) : t ? /* @__PURE__ */ l("div", { className: a, id: e, children: t }) : null;
2543
2529
  }
2544
- const cn = ({
2530
+ const sn = ({
2545
2531
  header: e,
2546
2532
  headerClassName: t,
2547
2533
  footer: r,
@@ -2557,7 +2543,7 @@ const cn = ({
2557
2543
  ...c
2558
2544
  }) => {
2559
2545
  let d = null, y = null;
2560
- const b = typeof e == "string", v = an(Re), w = on({
2546
+ const b = typeof e == "string", v = rn(Re), w = nn({
2561
2547
  className: o,
2562
2548
  headerClassName: t,
2563
2549
  bodyClassName: s,
@@ -2577,7 +2563,7 @@ const cn = ({
2577
2563
  ...c,
2578
2564
  children: [
2579
2565
  /* @__PURE__ */ l(
2580
- sn,
2566
+ on,
2581
2567
  {
2582
2568
  ...d && { id: d },
2583
2569
  content: e,
@@ -2590,7 +2576,7 @@ const cn = ({
2590
2576
  ]
2591
2577
  }
2592
2578
  ) });
2593
- }, ln = (e) => {
2579
+ }, cn = (e) => {
2594
2580
  let t = "";
2595
2581
  if (typeof e == "number" || typeof e == "string")
2596
2582
  t = "m-" + e;
@@ -2611,7 +2597,7 @@ const cn = ({
2611
2597
  semantic: u = !1,
2612
2598
  ...h
2613
2599
  }) => {
2614
- const p = ln(s), m = f(
2600
+ const p = cn(s), m = f(
2615
2601
  p,
2616
2602
  a || o
2617
2603
  );
@@ -2646,7 +2632,7 @@ try {
2646
2632
  });
2647
2633
  } catch {
2648
2634
  }
2649
- const dn = ({
2635
+ const ln = ({
2650
2636
  className: e,
2651
2637
  viewBox: t,
2652
2638
  spacing: r,
@@ -2671,7 +2657,7 @@ const dn = ({
2671
2657
  }
2672
2658
  ) })
2673
2659
  }
2674
- ), un = ({
2660
+ ), dn = ({
2675
2661
  className: e,
2676
2662
  viewBox: t,
2677
2663
  spacing: r,
@@ -2699,7 +2685,7 @@ const dn = ({
2699
2685
  /* @__PURE__ */ l("path", { d: "M5.1 9.2C13.3-1.2 28.4-3.1 38.8 5.1l592 464c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2z" })
2700
2686
  ]
2701
2687
  }
2702
- ), mn = ({
2688
+ ), un = ({
2703
2689
  className: e,
2704
2690
  viewBox: t,
2705
2691
  spacing: r,
@@ -2738,7 +2724,7 @@ const dn = ({
2738
2724
  ]
2739
2725
  }
2740
2726
  );
2741
- }, hn = ({
2727
+ }, mn = ({
2742
2728
  className: e,
2743
2729
  viewBox: t,
2744
2730
  spacing: r,
@@ -2793,7 +2779,7 @@ try {
2793
2779
  });
2794
2780
  } catch {
2795
2781
  }
2796
- const pn = "av-main", gn = (e) => {
2782
+ const hn = "av-main", pn = (e) => {
2797
2783
  let t = "";
2798
2784
  if (typeof e == "number" || typeof e == "string")
2799
2785
  t = "m-" + e;
@@ -2802,17 +2788,17 @@ const pn = "av-main", gn = (e) => {
2802
2788
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
2803
2789
  }
2804
2790
  return t;
2805
- }, fn = ({
2791
+ }, gn = ({
2806
2792
  children: e,
2807
2793
  className: t,
2808
2794
  raw: r = !1,
2809
2795
  spacing: a
2810
2796
  }) => {
2811
- const n = f(t, pn, gn(a), {
2797
+ const n = f(t, hn, pn(a), {
2812
2798
  "mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
2813
2799
  });
2814
2800
  return /* @__PURE__ */ l("main", { className: n, children: e });
2815
- }, yn = (e) => {
2801
+ }, fn = (e) => {
2816
2802
  let t = "";
2817
2803
  if (typeof e == "number" || typeof e == "string")
2818
2804
  t = "m-" + e;
@@ -2821,10 +2807,10 @@ const pn = "av-main", gn = (e) => {
2821
2807
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
2822
2808
  }
2823
2809
  return t;
2824
- }, bn = "av-flexgrid", _e = "av-flexgrid-item", De = 0.25, tr = O.createContext({
2810
+ }, yn = "av-flexgrid", _e = "av-flexgrid-item", De = 0.25, er = O.createContext({
2825
2811
  columnGap: 0,
2826
2812
  rowGap: 0
2827
- }), vt = ({
2813
+ }), It = ({
2828
2814
  children: e,
2829
2815
  className: t,
2830
2816
  columnGap: r = 1,
@@ -2851,12 +2837,12 @@ const pn = "av-main", gn = (e) => {
2851
2837
  marginLeft: r * -1 * De + "rem",
2852
2838
  marginTop: a * -1 * De + "rem"
2853
2839
  }, c = f(
2854
- bn,
2840
+ yn,
2855
2841
  t,
2856
2842
  "box-border flex flex-wrap"
2857
2843
  ), d = { columnGap: r, rowGap: a }, y = h ? "div" : O.Fragment;
2858
- return /* @__PURE__ */ l(y, { ...h ? { className: yn(h) } : {}, children: /* @__PURE__ */ l("div", { className: c, style: m, ...p, children: /* @__PURE__ */ l(tr.Provider, { value: d, children: e }) }) });
2859
- }, je = (e, t) => f({
2844
+ return /* @__PURE__ */ l(y, { ...h ? { className: fn(h) } : {}, children: /* @__PURE__ */ l("div", { className: c, style: m, ...p, children: /* @__PURE__ */ l(er.Provider, { value: d, children: e }) }) });
2845
+ }, ze = (e, t) => f({
2860
2846
  "basis-1/12": e === 1 && !t,
2861
2847
  "sm:basis-1/12": e === 1 && t === "sm",
2862
2848
  "md:basis-1/12": e === 1 && t === "md",
@@ -2929,7 +2915,7 @@ const pn = "av-main", gn = (e) => {
2929
2915
  "lg:basis-full": e === 12 && t === "lg",
2930
2916
  "xl:basis-full": e === 12 && t === "xl",
2931
2917
  "2xl:basis-full": e === 12 && t === "2xl"
2932
- }), En = ({
2918
+ }), bn = ({
2933
2919
  className: e,
2934
2920
  span: t
2935
2921
  }) => {
@@ -2937,14 +2923,14 @@ const pn = "av-main", gn = (e) => {
2937
2923
  return f(e, _e, "box-border basis-auto");
2938
2924
  if (typeof t == "number")
2939
2925
  return f(e, _e, "box-border max-w-full", {
2940
- [`${je(t)}`]: !0
2926
+ [`${ze(t)}`]: !0
2941
2927
  });
2942
2928
  if (typeof t == "string")
2943
2929
  return f(e, _e, "box-border basis-auto", {
2944
2930
  "max-w-full grow": t === "auto"
2945
2931
  });
2946
2932
  if (typeof t == "object") {
2947
- const r = Object.entries(t).map(([a, n]) => a === "fallback" ? je(n) : je(n, a));
2933
+ const r = Object.entries(t).map(([a, n]) => a === "fallback" ? ze(n) : ze(n, a));
2948
2934
  return f(
2949
2935
  e,
2950
2936
  _e,
@@ -2958,10 +2944,10 @@ const pn = "av-main", gn = (e) => {
2958
2944
  span: r,
2959
2945
  ...a
2960
2946
  }) => {
2961
- const { columnGap: n, rowGap: o } = Ze(tr), s = {
2947
+ const { columnGap: n, rowGap: o } = Qe(er), s = {
2962
2948
  paddingLeft: n * De + "rem",
2963
2949
  paddingTop: o * De + "rem"
2964
- }, i = En({
2950
+ }, i = bn({
2965
2951
  className: t,
2966
2952
  span: r
2967
2953
  });
@@ -2980,14 +2966,14 @@ try {
2980
2966
  });
2981
2967
  } catch {
2982
2968
  }
2983
- const rr = "av-text-input", wn = "av-text-input-wrapper", qe = "av-text-input-helper-text";
2984
- function Tn() {
2969
+ const tr = "av-text-input", En = "av-text-input-wrapper", je = "av-text-input-helper-text";
2970
+ function wn() {
2985
2971
  const e = L(!1);
2986
2972
  return Q(() => (e.current = !0, () => {
2987
2973
  e.current = !1;
2988
2974
  }), []), q(() => e.current, []);
2989
2975
  }
2990
- const In = {
2976
+ const Tn = {
2991
2977
  x: 0,
2992
2978
  y: 0,
2993
2979
  width: 0,
@@ -2997,8 +2983,8 @@ const In = {
2997
2983
  bottom: 0,
2998
2984
  right: 0
2999
2985
  };
3000
- function vn(e) {
3001
- const t = Tn(), r = L(0), a = L(null), [n, o] = j(In), s = _t(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((i) => {
2986
+ function In(e) {
2987
+ const t = wn(), r = L(0), a = L(null), [n, o] = j(Tn), s = At(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((i) => {
3002
2988
  const u = i[0];
3003
2989
  u && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
3004
2990
  a.current && t() && o(u.contentRect);
@@ -3008,7 +2994,7 @@ function vn(e) {
3008
2994
  s == null || s.disconnect(), r.current && cancelAnimationFrame(r.current);
3009
2995
  }), [s, e]), [a, n];
3010
2996
  }
3011
- function An(e) {
2997
+ function vn(e) {
3012
2998
  const t = kt();
3013
2999
  if (!e)
3014
3000
  return t;
@@ -3019,7 +3005,7 @@ function An(e) {
3019
3005
  return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
3020
3006
  }
3021
3007
  }
3022
- const ar = "SET_ANNOUNCEMENT", nr = "CLEAR_ANNOUNCEMENT", Sn = {
3008
+ const rr = "SET_ANNOUNCEMENT", ar = "CLEAR_ANNOUNCEMENT", Sn = {
3023
3009
  alert: null,
3024
3010
  alertdialog: null,
3025
3011
  log: "polite",
@@ -3029,12 +3015,12 @@ const ar = "SET_ANNOUNCEMENT", nr = "CLEAR_ANNOUNCEMENT", Sn = {
3029
3015
  timer: "assertive"
3030
3016
  }, kn = (e, t) => {
3031
3017
  switch (t == null ? void 0 : t.type) {
3032
- case ar:
3018
+ case rr:
3033
3019
  return {
3034
3020
  ...e,
3035
3021
  announcement: t.payload
3036
3022
  };
3037
- case nr:
3023
+ case ar:
3038
3024
  return {
3039
3025
  ...e,
3040
3026
  announcement: null
@@ -3042,14 +3028,14 @@ const ar = "SET_ANNOUNCEMENT", nr = "CLEAR_ANNOUNCEMENT", Sn = {
3042
3028
  default:
3043
3029
  return e;
3044
3030
  }
3045
- }, _n = ({
3031
+ }, An = ({
3046
3032
  onAnnouncementClear: e,
3047
3033
  dispatch: t
3048
3034
  }) => {
3049
3035
  t({
3050
- type: nr
3036
+ type: ar
3051
3037
  }), typeof e == "function" && e();
3052
- }, At = ({
3038
+ }, vt = ({
3053
3039
  children: e,
3054
3040
  clearAnnouncementDelay: t,
3055
3041
  clearAnnouncementTimeoutRef: r,
@@ -3057,16 +3043,16 @@ const ar = "SET_ANNOUNCEMENT", nr = "CLEAR_ANNOUNCEMENT", Sn = {
3057
3043
  dispatch: n
3058
3044
  }) => {
3059
3045
  (r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && n({
3060
- type: ar,
3046
+ type: rr,
3061
3047
  payload: e
3062
3048
  }), t && (r.current = setTimeout(
3063
- () => _n({
3049
+ () => An({
3064
3050
  onAnnouncementClear: a,
3065
3051
  dispatch: n
3066
3052
  }),
3067
3053
  t
3068
3054
  ));
3069
- }, Nn = ({
3055
+ }, _n = ({
3070
3056
  children: e,
3071
3057
  announcementTimeoutRef: t,
3072
3058
  announcementDelay: r,
@@ -3075,13 +3061,13 @@ const ar = "SET_ANNOUNCEMENT", nr = "CLEAR_ANNOUNCEMENT", Sn = {
3075
3061
  onAnnouncementClear: o,
3076
3062
  dispatch: s
3077
3063
  }) => {
3078
- clearTimeout(t.current), r ? t.current = setTimeout(At, r, {
3064
+ clearTimeout(t.current), r ? t.current = setTimeout(vt, r, {
3079
3065
  children: e,
3080
3066
  clearAnnouncementDelay: a,
3081
3067
  clearAnnouncementTimeoutRef: n,
3082
3068
  onAnnouncementClear: o,
3083
3069
  dispatch: s
3084
- }) : At({
3070
+ }) : vt({
3085
3071
  children: e,
3086
3072
  clearAnnouncementDelay: a,
3087
3073
  clearAnnouncementTimeoutRef: n,
@@ -3089,7 +3075,7 @@ const ar = "SET_ANNOUNCEMENT", nr = "CLEAR_ANNOUNCEMENT", Sn = {
3089
3075
  dispatch: s
3090
3076
  });
3091
3077
  };
3092
- function or({
3078
+ function nr({
3093
3079
  children: e,
3094
3080
  className: t,
3095
3081
  politeness: r,
@@ -3105,7 +3091,7 @@ function or({
3105
3091
  });
3106
3092
  let d = r;
3107
3093
  typeof d > "u" && (d = a ? Sn[a] : "assertive"), Q(() => {
3108
- Nn({
3094
+ _n({
3109
3095
  announcementTimeoutRef: h,
3110
3096
  announcementDelay: n,
3111
3097
  children: e,
@@ -3134,7 +3120,7 @@ function or({
3134
3120
  }
3135
3121
  );
3136
3122
  }
3137
- const Rn = (e) => {
3123
+ const Nn = (e) => {
3138
3124
  let t = "";
3139
3125
  if (typeof e == "number" || typeof e == "string")
3140
3126
  t = "m-" + e;
@@ -3157,21 +3143,21 @@ try {
3157
3143
  });
3158
3144
  } catch {
3159
3145
  }
3160
- const xn = ({
3146
+ const Rn = ({
3161
3147
  mode: e
3162
3148
  }) => f({
3163
3149
  "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
3164
3150
  "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
3165
3151
  "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
3166
3152
  "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
3167
- }), Cn = ({
3153
+ }), xn = ({
3168
3154
  focusMode: e
3169
3155
  }) => f("focus:outline focus:outline-2 focus:outline-offset-2", {
3170
3156
  "focus:outline-focus-dark": e === "dark",
3171
3157
  "focus:outline-focus-light": e === "light",
3172
3158
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
3173
3159
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
3174
- }), On = ({
3160
+ }), Cn = ({
3175
3161
  noBorder: e,
3176
3162
  error: t
3177
3163
  }) => f("border-2", {
@@ -3179,7 +3165,7 @@ const xn = ({
3179
3165
  "focus:border-border-dark": !e && t,
3180
3166
  "border-border-error-dark": !e && t,
3181
3167
  "border-transparent": e
3182
- }), Pn = ({
3168
+ }), On = ({
3183
3169
  disabled: e,
3184
3170
  raw: t,
3185
3171
  error: r,
@@ -3203,7 +3189,7 @@ const xn = ({
3203
3189
  "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
3204
3190
  "text-copy-lighter dark:text-copy-error-dark": a === "alt-system"
3205
3191
  });
3206
- }, Dn = ({
3192
+ }, Pn = ({
3207
3193
  error: e,
3208
3194
  raw: t,
3209
3195
  mode: r,
@@ -3213,24 +3199,24 @@ const xn = ({
3213
3199
  return "";
3214
3200
  if (a)
3215
3201
  return f(
3216
- qe,
3202
+ je,
3217
3203
  "absolute px-2 cursor-not-allowed opacity-50 font-medium"
3218
3204
  );
3219
3205
  if (!e)
3220
- return f(qe, "absolute px-2 font-medium", {
3206
+ return f(je, "absolute px-2 font-medium", {
3221
3207
  "text-copy-lighter": r === "dark",
3222
3208
  "text-copy-dark": r === "light",
3223
3209
  "text-copy-dark dark:text-copy-lighter": r === "system",
3224
3210
  "text-copy-lighter dark:text-copy-dark": r === "alt-system"
3225
3211
  });
3226
3212
  if (e)
3227
- return f(qe, "absolute px-2 font-medium", {
3213
+ return f(je, "absolute px-2 font-medium", {
3228
3214
  "text-copy-error-light bg-surface-darker": r === "dark",
3229
3215
  "text-copy-error-dark": r === "light",
3230
3216
  "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
3231
3217
  "dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
3232
3218
  });
3233
- }, $n = ({
3219
+ }, Dn = ({
3234
3220
  className: e,
3235
3221
  inputClassName: t,
3236
3222
  raw: r,
@@ -3245,9 +3231,9 @@ const xn = ({
3245
3231
  }) => {
3246
3232
  const m = r ? e : f(
3247
3233
  "relative flex w-full flex-col justify-center",
3248
- wn,
3234
+ En,
3249
3235
  e,
3250
- Rn(s)
3236
+ Nn(s)
3251
3237
  );
3252
3238
  let c = "";
3253
3239
  switch (h) {
@@ -3268,22 +3254,22 @@ const xn = ({
3268
3254
  break;
3269
3255
  }
3270
3256
  const d = r ? f(t) : f(
3271
- rr,
3257
+ tr,
3272
3258
  t,
3273
3259
  c,
3274
3260
  "rounded-md text-base px-4",
3275
- xn({ mode: i }),
3276
- Cn({ focusMode: u }),
3277
- On({ noBorder: n, error: o }),
3261
+ Rn({ mode: i }),
3262
+ xn({ focusMode: u }),
3263
+ Cn({ noBorder: n, error: o }),
3278
3264
  {
3279
3265
  "disabled:cursor-not-allowed disabled:opacity-50": a
3280
3266
  }
3281
- ), y = r ? void 0 : "sr-only", b = Pn({
3267
+ ), y = r ? void 0 : "sr-only", b = On({
3282
3268
  disabled: a,
3283
3269
  raw: r,
3284
3270
  error: o,
3285
3271
  mode: i
3286
- }), v = Dn({
3272
+ }), v = Pn({
3287
3273
  error: o,
3288
3274
  raw: r,
3289
3275
  mode: i,
@@ -3297,7 +3283,7 @@ const xn = ({
3297
3283
  helperText: v,
3298
3284
  rightElement: w
3299
3285
  };
3300
- }, st = O.forwardRef(
3286
+ }, ot = O.forwardRef(
3301
3287
  ({
3302
3288
  id: e,
3303
3289
  name: t,
@@ -3320,13 +3306,13 @@ const xn = ({
3320
3306
  size: C = "md",
3321
3307
  ...D
3322
3308
  }, M) => {
3323
- const [Z, N] = vn(), [W, P] = j(0), V = An({ id: e, prefix: `${rr}-` }), pe = `${t} error, ${y}`, ee = L(null), R = L(null), $ = {
3309
+ const [Z, N] = In(), [G, P] = j(0), V = vn({ id: e, prefix: `${tr}-` }), pe = `${t} error, ${y}`, ee = L(null), R = L(null), $ = {
3324
3310
  xs: { label: "-25px", helperText: "30px" },
3325
3311
  sm: { label: "-29px", helperText: "34px" },
3326
3312
  md: { label: "-33px", helperText: "38px" },
3327
3313
  lg: { label: "-15px", helperText: "22px" },
3328
3314
  xl: { label: "-19px", helperText: "25px" }
3329
- }, U = $n({
3315
+ }, U = Dn({
3330
3316
  className: o,
3331
3317
  inputClassName: s,
3332
3318
  error: a,
@@ -3339,9 +3325,9 @@ const xn = ({
3339
3325
  size: C,
3340
3326
  rightElementClassName: v
3341
3327
  });
3342
- return ct(() => {
3328
+ return it(() => {
3343
3329
  N && N.width && P(N.width + 18 + 10);
3344
- }, [N]), ct(() => {
3330
+ }, [N]), it(() => {
3345
3331
  var g, T;
3346
3332
  const { label: E, helperText: F } = $[C];
3347
3333
  (g = ee == null ? void 0 : ee.current) == null || g.style.setProperty("--av-text-input-label", E), (T = R == null ? void 0 : R.current) == null || T.style.setProperty(
@@ -3370,7 +3356,7 @@ const xn = ({
3370
3356
  className: U.input,
3371
3357
  ...y && { "aria-describedby": `${V}-helper` },
3372
3358
  ...a && { "aria-invalid": "true" },
3373
- ...b && !n && { style: { paddingRight: W } },
3359
+ ...b && !n && { style: { paddingRight: G } },
3374
3360
  ...D
3375
3361
  }
3376
3362
  ),
@@ -3401,20 +3387,20 @@ const xn = ({
3401
3387
  children: b
3402
3388
  }
3403
3389
  ),
3404
- a && y && /* @__PURE__ */ l(or, { politeness: "polite", clearAnnouncementDelay: 500, children: pe })
3390
+ a && y && /* @__PURE__ */ l(nr, { politeness: "polite", clearAnnouncementDelay: 500, children: pe })
3405
3391
  ] });
3406
3392
  }
3407
3393
  );
3408
- st.displayName = "TextInput";
3409
- function Ln(e) {
3410
- return _t(() => e.every((t) => t == null) ? () => {
3394
+ ot.displayName = "TextInput";
3395
+ function $n(e) {
3396
+ return At(() => e.every((t) => t == null) ? () => {
3411
3397
  } : (t) => {
3412
3398
  e.forEach((r) => {
3413
3399
  typeof r == "function" ? r(t) : r != null && (r.current = t);
3414
3400
  });
3415
3401
  }, e);
3416
3402
  }
3417
- const Mn = 500, Un = 5e3, Kn = 2e4, sr = O.forwardRef(
3403
+ const Ln = 500, Mn = 5e3, Un = 2e4, or = O.forwardRef(
3418
3404
  ({
3419
3405
  name: e,
3420
3406
  disabled: t,
@@ -3432,19 +3418,19 @@ const Mn = 500, Un = 5e3, Kn = 2e4, sr = O.forwardRef(
3432
3418
  const [d, y] = j(!0), [b, v] = j({
3433
3419
  message: null,
3434
3420
  politeness: null
3435
- }), w = L(!0), C = L(), D = L(null), M = Ln([c, D]), Z = d ? "Show" : "Hide", N = () => {
3421
+ }), w = L(!0), C = L(), D = L(null), M = $n([c, D]), Z = d ? "Show" : "Hide", N = () => {
3436
3422
  clearTimeout(C.current), w.current || (C.current = window.setTimeout(() => {
3437
3423
  w.current = !0, y(!0), v({
3438
- announcementTimeout: Un,
3424
+ announcementTimeout: Mn,
3439
3425
  politeness: "polite",
3440
3426
  message: `${r} hiding characters`
3441
3427
  }), n && n(!0);
3442
- }, Kn));
3443
- }, W = (R) => {
3428
+ }, Un));
3429
+ }, G = (R) => {
3444
3430
  R.preventDefault();
3445
3431
  const $ = !w.current;
3446
3432
  w.current = $, N(), y($), v({
3447
- announcementTimeout: Mn,
3433
+ announcementTimeout: Ln,
3448
3434
  politeness: "assertive",
3449
3435
  message: $ ? "Characters hidden" : "Characters showing"
3450
3436
  }), n && n($);
@@ -3463,7 +3449,7 @@ const Mn = 500, Un = 5e3, Kn = 2e4, sr = O.forwardRef(
3463
3449
  clearTimeout(C.current);
3464
3450
  }, []), /* @__PURE__ */ I(ye, { children: [
3465
3451
  /* @__PURE__ */ l(
3466
- st,
3452
+ ot,
3467
3453
  {
3468
3454
  ref: M,
3469
3455
  name: e,
@@ -3478,7 +3464,7 @@ const Mn = 500, Un = 5e3, Kn = 2e4, sr = O.forwardRef(
3478
3464
  rightElement: O.cloneElement(h, {
3479
3465
  ref: c,
3480
3466
  label: Z,
3481
- onClick: W,
3467
+ onClick: G,
3482
3468
  onBlur: P,
3483
3469
  disabled: t
3484
3470
  }),
@@ -3486,7 +3472,7 @@ const Mn = 500, Un = 5e3, Kn = 2e4, sr = O.forwardRef(
3486
3472
  }
3487
3473
  ),
3488
3474
  /* @__PURE__ */ l(
3489
- or,
3475
+ nr,
3490
3476
  {
3491
3477
  role: "status",
3492
3478
  politeness: b.politeness,
@@ -3497,7 +3483,7 @@ const Mn = 500, Un = 5e3, Kn = 2e4, sr = O.forwardRef(
3497
3483
  ] });
3498
3484
  }
3499
3485
  );
3500
- sr.displayName = "TextInputMask";
3486
+ or.displayName = "TextInputMask";
3501
3487
  /*!
3502
3488
  @versini/ui-textinput v1.2.2
3503
3489
  © 2024 gizmette.com
@@ -3511,11 +3497,14 @@ try {
3511
3497
  });
3512
3498
  } catch {
3513
3499
  }
3514
- const Hn = "ASK! ME! ANYTHING!", ir = "Sassy Saint", Gn = "gizmette.com", Bn = "Log in", Wn = "Sign in with a Passkey", Xo = "Log out", Vn = "Password", Jn = "Powered by ", Qo = "Send", Zo = "Profile", es = "Statistics", ts = "Chat history", rs = "About", as = "Type your question here", ns = "Clear chat", os = "Cancel chat", ss = "N/A", is = {
3515
- TAGS: {
3516
- TITLE: "Pre-filled tags",
3517
- DESCRIPTION: "Tags are pre-filled buttons available on the main screen, to help you quickly start requests."
3500
+ const Kn = "ASK! ME! ANYTHING!", sr = "Sassy Saint", Hn = "gizmette.com", Wn = "Log in", Bn = "Sign in with a Passkey", Fo = "Log out", Gn = "Password", Vn = "Powered by ", zo = "Send", jo = "Profile", qo = "Statistics", Xo = "Chat history", Qo = "About", Zo = "Type your question here", es = {
3501
+ ACTION_WHILE_STREAMING: {
3502
+ content: "Cancel chat"
3518
3503
  },
3504
+ ACTION_WHILE_NOT_STREAMING: {
3505
+ content: "New chat"
3506
+ }
3507
+ }, ts = "N/A", rs = "Tags are pre-filled buttons available on the main screen, to help you quickly start requests. The label is used for the button, and the content is what will be inserted in the chat when the button is pressed.", as = {
3519
3508
  PREFERENCES: {
3520
3509
  TITLE: "User settings",
3521
3510
  NAME: "Name",
@@ -3563,7 +3552,7 @@ try {
3563
3552
  });
3564
3553
  } catch {
3565
3554
  }
3566
- const Yn = "av-footer", Fn = (e) => {
3555
+ const Jn = "av-footer", Yn = (e) => {
3567
3556
  let t = "";
3568
3557
  if (typeof e == "number" || typeof e == "string")
3569
3558
  t = "m-" + e;
@@ -3572,7 +3561,7 @@ const Yn = "av-footer", Fn = (e) => {
3572
3561
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
3573
3562
  }
3574
3563
  return t;
3575
- }, zn = ({
3564
+ }, Fn = ({
3576
3565
  className: e,
3577
3566
  mode: t = "system",
3578
3567
  row1: r,
@@ -3581,7 +3570,7 @@ const Yn = "av-footer", Fn = (e) => {
3581
3570
  spacing: o,
3582
3571
  raw: s = !1
3583
3572
  }) => {
3584
- const i = f(Yn, e, Fn(o), {
3573
+ const i = f(Jn, e, Yn(o), {
3585
3574
  "text-copy-dark": !s && t === "dark",
3586
3575
  "text-copy-lighter": !s && t === "light",
3587
3576
  "text-copy-dark dark:text-copy-lighter": !s && t === "system",
@@ -3593,14 +3582,15 @@ const Yn = "av-footer", Fn = (e) => {
3593
3582
  r && /* @__PURE__ */ l("div", { children: r }),
3594
3583
  a && /* @__PURE__ */ l("div", { children: a })
3595
3584
  ] });
3596
- }, jn = O.createContext({
3585
+ }, zn = O.createContext({
3597
3586
  state: {
3598
3587
  id: "",
3599
3588
  model: Fe,
3600
3589
  engine: Fe,
3601
3590
  usage: 0,
3602
3591
  messages: [],
3603
- isComponent: !1
3592
+ isComponent: !1,
3593
+ tags: []
3604
3594
  },
3605
3595
  dispatch: () => {
3606
3596
  },
@@ -3611,58 +3601,58 @@ const Yn = "av-footer", Fn = (e) => {
3611
3601
  engine: Fe,
3612
3602
  engines: []
3613
3603
  }
3614
- }), cs = O.createContext({
3604
+ }), ns = O.createContext({
3615
3605
  state: { searchString: "", sortedCell: "", sortDirection: "" },
3616
3606
  dispatch: () => {
3617
3607
  }
3618
- }), ls = O.createContext({
3608
+ }), os = O.createContext({
3619
3609
  state: { tag: "" },
3620
3610
  dispatch: () => {
3621
3611
  }
3622
- }), qn = ({
3612
+ }), jn = ({
3623
3613
  serverStats: e
3624
3614
  }) => {
3625
- const { state: t } = Ze(jn);
3615
+ const { state: t } = Qe(zn);
3626
3616
  return /* @__PURE__ */ l(
3627
- zn,
3617
+ Fn,
3628
3618
  {
3629
3619
  mode: "light",
3630
3620
  row1: /* @__PURE__ */ I("div", { children: [
3631
- ir,
3621
+ sr,
3632
3622
  " v",
3633
- "5.5.0",
3623
+ "5.5.2",
3634
3624
  " - ",
3635
- Jn,
3625
+ Vn,
3636
3626
  t && t.engine,
3637
- at && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
3627
+ rt && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
3638
3628
  ] }),
3639
3629
  row2: /* @__PURE__ */ I("div", { children: [
3640
3630
  "© ",
3641
3631
  (/* @__PURE__ */ new Date()).getFullYear(),
3642
3632
  " ",
3643
- Gn
3633
+ Hn
3644
3634
  ] })
3645
3635
  }
3646
3636
  );
3647
- }, Xn = Nt(
3637
+ }, qn = _t(
3648
3638
  () => import(
3649
3639
  /* webpackChunkName: "LazyHeader" */
3650
- "./LazyHeader.DqDJRIjX.js"
3640
+ "./LazyHeader.Bt3Z4u-6.js"
3651
3641
  )
3652
- ), Qn = () => {
3653
- const { isAuthenticated: e } = rt();
3642
+ ), Xn = () => {
3643
+ const { isAuthenticated: e } = tt();
3654
3644
  return /* @__PURE__ */ I(ye, { children: [
3655
- e && /* @__PURE__ */ l(Rt, { fallback: /* @__PURE__ */ l("div", {}), children: /* @__PURE__ */ l(Xn, {}) }),
3645
+ e && /* @__PURE__ */ l(Nt, { fallback: /* @__PURE__ */ l("div", {}), children: /* @__PURE__ */ l(qn, {}) }),
3656
3646
  /* @__PURE__ */ I("div", { className: "flex items-center justify-center", children: [
3657
- /* @__PURE__ */ l("div", { className: "basis-1/4", children: /* @__PURE__ */ l(dn, {}) }),
3647
+ /* @__PURE__ */ l("div", { className: "basis-1/4", children: /* @__PURE__ */ l(ln, {}) }),
3658
3648
  /* @__PURE__ */ I("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
3659
- /* @__PURE__ */ l("h1", { children: ir }),
3660
- /* @__PURE__ */ l("h2", { children: Hn })
3649
+ /* @__PURE__ */ l("h1", { children: sr }),
3650
+ /* @__PURE__ */ l("h2", { children: Kn })
3661
3651
  ] })
3662
3652
  ] })
3663
3653
  ] });
3664
- }, Zn = () => {
3665
- const { login: e, logoutReason: t, loginWithPasskey: r } = rt(), [a, n] = j(""), [o, s] = j(""), [i, u] = j(!0), [h, p] = j({
3654
+ }, Qn = () => {
3655
+ const { login: e, logoutReason: t, loginWithPasskey: r } = tt(), [a, n] = j(""), [o, s] = j(""), [i, u] = j(!0), [h, p] = j({
3666
3656
  username: "",
3667
3657
  password: ""
3668
3658
  }), m = async (c) => {
@@ -3677,13 +3667,13 @@ const Yn = "av-footer", Fn = (e) => {
3677
3667
  }), Q(() => {
3678
3668
  t && s(t);
3679
3669
  }, [t]), /* @__PURE__ */ I(ye, { children: [
3680
- /* @__PURE__ */ I(fn, { children: [
3681
- /* @__PURE__ */ l("div", { className: Ya(), children: /* @__PURE__ */ l(Qn, {}) }),
3670
+ /* @__PURE__ */ I(gn, { children: [
3671
+ /* @__PURE__ */ l("div", { className: Ja(), children: /* @__PURE__ */ l(Xn, {}) }),
3682
3672
  /* @__PURE__ */ I("form", { className: "mt-5", onSubmit: m, children: [
3683
- /* @__PURE__ */ l(vt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ l(le, { span: 6, children: /* @__PURE__ */ I(cn, { mode: "dark", children: [
3673
+ /* @__PURE__ */ l(It, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ l(le, { span: 6, children: /* @__PURE__ */ I(sn, { mode: "dark", children: [
3684
3674
  /* @__PURE__ */ l(le, { span: 12, children: o && /* @__PURE__ */ l("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
3685
3675
  /* @__PURE__ */ l(le, { span: 12, children: /* @__PURE__ */ l(
3686
- st,
3676
+ ot,
3687
3677
  {
3688
3678
  required: !0,
3689
3679
  autoCapitalize: "off",
@@ -3703,7 +3693,7 @@ const Yn = "av-footer", Fn = (e) => {
3703
3693
  }
3704
3694
  ) }),
3705
3695
  /* @__PURE__ */ l(le, { span: 12, children: /* @__PURE__ */ l(
3706
- sr,
3696
+ or,
3707
3697
  {
3708
3698
  required: !0,
3709
3699
  autoCapitalize: "off",
@@ -3712,8 +3702,8 @@ const Yn = "av-footer", Fn = (e) => {
3712
3702
  mode: "dark",
3713
3703
  focusMode: "light",
3714
3704
  name: "password",
3715
- label: Vn,
3716
- rightElement: /* @__PURE__ */ l(Qe, { focusMode: "light", mode: "dark", children: i ? /* @__PURE__ */ l(hn, {}) : /* @__PURE__ */ l(un, {}) }),
3705
+ label: Gn,
3706
+ rightElement: /* @__PURE__ */ l(Xe, { focusMode: "light", mode: "dark", children: i ? /* @__PURE__ */ l(mn, {}) : /* @__PURE__ */ l(dn, {}) }),
3717
3707
  onMaskChange: u,
3718
3708
  onChange: (c) => {
3719
3709
  p({
@@ -3726,7 +3716,7 @@ const Yn = "av-footer", Fn = (e) => {
3726
3716
  }
3727
3717
  ) }),
3728
3718
  /* @__PURE__ */ l(le, { span: 12, children: /* @__PURE__ */ l(
3729
- er,
3719
+ Zt,
3730
3720
  {
3731
3721
  mode: "light",
3732
3722
  focusMode: "light",
@@ -3734,105 +3724,101 @@ const Yn = "av-footer", Fn = (e) => {
3734
3724
  noBorder: !0,
3735
3725
  type: "submit",
3736
3726
  className: "mb-4 mt-6",
3737
- children: Bn
3727
+ children: Wn
3738
3728
  }
3739
3729
  ) })
3740
3730
  ] }) }) }),
3741
3731
  /* @__PURE__ */ l("div", { className: "text-center text-copy-light", children: "or" }),
3742
- /* @__PURE__ */ l(vt, { alignHorizontal: "center", children: /* @__PURE__ */ l(le, { span: 6, children: /* @__PURE__ */ l(
3743
- Qe,
3732
+ /* @__PURE__ */ l(It, { alignHorizontal: "center", children: /* @__PURE__ */ l(le, { span: 6, children: /* @__PURE__ */ l(
3733
+ Xe,
3744
3734
  {
3745
3735
  mode: "dark",
3746
3736
  focusMode: "light",
3747
3737
  fullWidth: !0,
3748
3738
  noBorder: !0,
3749
3739
  className: "mb-4 mt-1",
3750
- labelRight: Wn,
3740
+ labelRight: Bn,
3751
3741
  onClick: r,
3752
- children: /* @__PURE__ */ l(mn, { className: "size-7" })
3742
+ children: /* @__PURE__ */ l(un, { className: "size-7" })
3753
3743
  }
3754
3744
  ) }) })
3755
3745
  ] })
3756
3746
  ] }),
3757
- /* @__PURE__ */ l(qn, {})
3747
+ /* @__PURE__ */ l(jn, {})
3758
3748
  ] });
3759
- }, eo = new URL(document.location.href).searchParams, to = !!eo.get("debug") || !1, ro = Nt(() => import(
3749
+ }, Zn = new URL(document.location.href).searchParams, eo = !!Zn.get("debug") || !1, to = _t(() => import(
3760
3750
  /* webpackChunkName: "LazyApp" */
3761
- "./App.DlhiXCoz.js"
3762
- ).then((e) => e.App)), ao = ({ isComponent: e }) => {
3763
- const { isAuthenticated: t } = rt();
3764
- return t ? /* @__PURE__ */ l(Rt, { fallback: /* @__PURE__ */ l("div", {}), children: /* @__PURE__ */ l(ro, { isComponent: e }) }) : /* @__PURE__ */ l(Zn, {});
3765
- }, no = ({
3751
+ "./App.wwhSvbRQ.js"
3752
+ ).then((e) => e.App)), ro = ({ isComponent: e }) => {
3753
+ const { isAuthenticated: t } = tt();
3754
+ return t ? /* @__PURE__ */ l(Nt, { fallback: /* @__PURE__ */ l("div", {}), children: /* @__PURE__ */ l(to, { isComponent: e }) }) : /* @__PURE__ */ l(Qn, {});
3755
+ }, ao = ({
3766
3756
  isComponent: e = !1,
3767
- domain: t = Ja
3768
- }) => /* @__PURE__ */ l(ye, { children: /* @__PURE__ */ l(Da, { clientId: $a, domain: t, debug: to, children: /* @__PURE__ */ l(ao, { isComponent: e }) }) }), ds = ({ domain: e }) => /* @__PURE__ */ l(no, { isComponent: !0, domain: e });
3757
+ domain: t = Va
3758
+ }) => /* @__PURE__ */ l(ye, { children: /* @__PURE__ */ l(Pa, { clientId: Da, domain: t, debug: eo, children: /* @__PURE__ */ l(ro, { isComponent: e }) }) }), ss = ({ domain: e }) => /* @__PURE__ */ l(ao, { isComponent: !0, domain: e });
3769
3759
  export {
3770
- rs as ABOUT_TITLE,
3771
- No as ACTION_ENGINE,
3772
- vo as ACTION_MESSAGE,
3760
+ Qo as ABOUT_TITLE,
3761
+ _o as ACTION_ENGINE,
3762
+ Io as ACTION_MESSAGE,
3773
3763
  So as ACTION_MODEL,
3774
- Ao as ACTION_RESET,
3775
- Oo as ACTION_RESET_TAGS,
3764
+ vo as ACTION_RESET,
3765
+ Co as ACTION_RESET_TAGS,
3776
3766
  ko as ACTION_RESTORE,
3777
- Ro as ACTION_SEARCH,
3778
- xo as ACTION_SORT,
3779
- _o as ACTION_STREAMING,
3780
- Co as ACTION_TOGGLE_TAG,
3781
- jn as AppContext,
3782
- qn as AppFooter,
3783
- os as CANCEL,
3784
- is as CARDS,
3785
- ns as CLEAR,
3767
+ No as ACTION_SEARCH,
3768
+ Oo as ACTION_SET_TAGS,
3769
+ Ro as ACTION_SORT,
3770
+ Ao as ACTION_STREAMING,
3771
+ xo as ACTION_TOGGLE_TAG,
3772
+ zn as AppContext,
3773
+ jn as AppFooter,
3774
+ as as CARDS,
3786
3775
  Fe as DEFAULT_AI_ENGINE,
3787
- cn as E,
3788
- To as ENGINE_ANTHROPIC,
3789
- wo as ENGINE_OPENAI,
3790
- Eo as ERROR_MESSAGE,
3776
+ sn as E,
3777
+ wo as ENGINE_ANTHROPIC,
3778
+ Eo as ENGINE_OPENAI,
3779
+ bo as ERROR_MESSAGE,
3791
3780
  ue as G,
3792
- Io as GPT4_MAX_TOKENS,
3793
- ts as HISTORY_TITLE,
3794
- cs as HistoryContext,
3795
- $o as LOCAL_STORAGE_CHAT_DETAILS,
3796
- Go as LOCAL_STORAGE_ENGINE_TOGGLE,
3797
- Do as LOCAL_STORAGE_PREFIX,
3798
- Lo as LOCAL_STORAGE_SEARCH,
3799
- Mo as LOCAL_STORAGE_SORT,
3800
- Ko as LOCAL_STORAGE_TAG_PROOFREAD,
3801
- Ho as LOCAL_STORAGE_TAG_REPHRASE,
3802
- Uo as LOCAL_STORAGE_TAG_SUMMARIZE,
3803
- Xo as LOG_OUT,
3804
- Qn as MessagesContainerHeader,
3805
- ss as NA,
3806
- Qe as O,
3807
- Zo as PROFILE_TITLE,
3808
- er as R,
3809
- go as ROLE_ASSISTANT,
3810
- bo as ROLE_HIDDEN,
3811
- yo as ROLE_INTERNAL,
3812
- fo as ROLE_SYSTEM,
3813
- po as ROLE_USER,
3814
- Qo as SEND,
3815
- es as STATS,
3816
- Bo as STATS_SEPARATOR,
3817
- ds as SassySaint,
3818
- ze as TAGS,
3819
- Po as TAG_CONTENT,
3820
- as as TYPE_QUESTION,
3821
- ls as TagsContext,
3822
- vt as b,
3823
- fn as d,
3824
- jo as durationFormatter,
3825
- Yo as extractAverage,
3781
+ To as GPT4_MAX_TOKENS,
3782
+ Xo as HISTORY_TITLE,
3783
+ ns as HistoryContext,
3784
+ Do as LOCAL_STORAGE_CHAT_DETAILS,
3785
+ Mo as LOCAL_STORAGE_ENGINE_TOGGLE,
3786
+ Po as LOCAL_STORAGE_PREFIX,
3787
+ $o as LOCAL_STORAGE_SEARCH,
3788
+ Lo as LOCAL_STORAGE_SORT,
3789
+ Fo as LOG_OUT,
3790
+ Xn as MessagesContainerHeader,
3791
+ ts as NA,
3792
+ Xe as O,
3793
+ jo as PROFILE_TITLE,
3794
+ Zt as R,
3795
+ po as ROLE_ASSISTANT,
3796
+ yo as ROLE_HIDDEN,
3797
+ fo as ROLE_INTERNAL,
3798
+ go as ROLE_SYSTEM,
3799
+ ho as ROLE_USER,
3800
+ zo as SEND,
3801
+ qo as STATS,
3802
+ Uo as STATS_SEPARATOR,
3803
+ ss as SassySaint,
3804
+ rs as TAGS_DESCRIPTION,
3805
+ es as TOOLBOX,
3806
+ Zo as TYPE_QUESTION,
3807
+ os as TagsContext,
3808
+ It as b,
3809
+ gn as d,
3810
+ Jo as durationFormatter,
3811
+ Bo as extractAverage,
3826
3812
  Ke as g,
3827
- Vo as getCurrentGeoLocation,
3828
- Ya as getMessageContaintWrapperClass,
3829
- Fo as isLastMessageFromRole,
3813
+ Ho as getCurrentGeoLocation,
3814
+ Ja as getMessageContaintWrapperClass,
3815
+ Go as isLastMessageFromRole,
3830
3816
  le as j,
3831
- st as me,
3832
- zo as numberFormatter,
3833
- qo as pluralize,
3834
- Jo as renderDataAsList,
3835
- rt as rn,
3836
- Wo as truncate,
3837
- mn as v
3817
+ ot as me,
3818
+ Vo as numberFormatter,
3819
+ Yo as pluralize,
3820
+ Wo as renderDataAsList,
3821
+ tt as rn,
3822
+ Ko as truncate,
3823
+ un as v
3838
3824
  };