@versini/sassysaint 1.0.13 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- import { jsx as l, jsxs as S, Fragment as me } from "react/jsx-runtime";
2
- import W, { createContext as br, useReducer as vt, useRef as M, useCallback as q, useEffect as V, useContext as St, useSyncExternalStore as wr, useId as It, useMemo as At, useState as j, useLayoutEffect as Er, lazy as kt, Suspense as _t } from "react";
3
- import f from "clsx";
4
- var Tr = Object.defineProperty, vr = (e, t, r) => t in e ? Tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ke = (e, t, r) => vr(e, typeof t != "symbol" ? t + "" : t, r);
1
+ import { jsx as c, jsxs as I, Fragment as ce } from "react/jsx-runtime";
2
+ import V, { createContext as nr, useReducer as ft, useRef as W, useCallback as z, useEffect as j, useContext as yt, useSyncExternalStore as or, useId as bt, useMemo as Et, useState as F, useLayoutEffect as sr, lazy as wt, Suspense as Tt } from "react";
3
+ import g from "clsx";
4
+ var ir = Object.defineProperty, cr = (e, t, r) => t in e ? ir(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Le = (e, t, r) => cr(e, typeof t != "symbol" ? t + "" : t, r);
5
5
  /*!
6
- @versini/auth-provider v6.4.4
6
+ @versini/auth-provider v7.0.0
7
7
  © 2024 gizmette.com
8
8
  */
9
9
  try {
10
10
  window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
11
- version: "6.4.4",
12
- buildTime: "07/31/2024 08:11 PM EDT",
11
+ version: "7.0.0",
12
+ buildTime: "08/19/2024 06:11 PM EDT",
13
13
  homepage: "https://github.com/aversini/auth-client",
14
14
  license: "MIT"
15
15
  });
@@ -18,106 +18,106 @@ try {
18
18
  function L(e) {
19
19
  const t = new Uint8Array(e);
20
20
  let r = "";
21
- for (const n of t)
22
- r += String.fromCharCode(n);
21
+ for (const a of t)
22
+ r += String.fromCharCode(a);
23
23
  return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
24
24
  }
25
- function ke(e) {
26
- const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - t.length % 4) % 4, n = t.padEnd(t.length + r, "="), a = atob(n), o = new ArrayBuffer(a.length), s = new Uint8Array(o);
27
- for (let i = 0; i < a.length; i++)
28
- s[i] = a.charCodeAt(i);
25
+ function Ie(e) {
26
+ const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - t.length % 4) % 4, a = t.padEnd(t.length + r, "="), n = atob(a), o = new ArrayBuffer(n.length), s = new Uint8Array(o);
27
+ for (let i = 0; i < n.length; i++)
28
+ s[i] = n.charCodeAt(i);
29
29
  return o;
30
30
  }
31
- function Qe() {
31
+ function ze() {
32
32
  return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
33
33
  }
34
- function Rt(e) {
34
+ function It(e) {
35
35
  const { id: t } = e;
36
36
  return {
37
37
  ...e,
38
- id: ke(t),
38
+ id: Ie(t),
39
39
  transports: e.transports
40
40
  };
41
41
  }
42
- function Nt(e) {
42
+ function St(e) {
43
43
  return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
44
44
  }
45
- let R = class extends Error {
46
- constructor({ message: t, code: r, cause: n, name: a }) {
47
- super(t, { cause: n }), this.name = a ?? n.name, this.code = r;
45
+ let k = class extends Error {
46
+ constructor({ message: t, code: r, cause: a, name: n }) {
47
+ super(t, { cause: a }), this.name = n ?? a.name, this.code = r;
48
48
  }
49
49
  };
50
- function Sr({ error: e, options: t }) {
51
- var n, a;
50
+ function lr({ error: e, options: t }) {
51
+ var a, n;
52
52
  const { publicKey: r } = t;
53
53
  if (!r)
54
54
  throw Error("options was missing required publicKey property");
55
55
  if (e.name === "AbortError") {
56
56
  if (t.signal instanceof AbortSignal)
57
- return new R({
57
+ return new k({
58
58
  message: "Registration ceremony was sent an abort signal",
59
59
  code: "ERROR_CEREMONY_ABORTED",
60
60
  cause: e
61
61
  });
62
62
  } else if (e.name === "ConstraintError") {
63
- if (((n = r.authenticatorSelection) == null ? void 0 : n.requireResidentKey) === !0)
64
- return new R({
63
+ if (((a = r.authenticatorSelection) == null ? void 0 : a.requireResidentKey) === !0)
64
+ return new k({
65
65
  message: "Discoverable credentials were required but no available authenticator supported it",
66
66
  code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
67
67
  cause: e
68
68
  });
69
- if (((a = r.authenticatorSelection) == null ? void 0 : a.userVerification) === "required")
70
- return new R({
69
+ if (((n = r.authenticatorSelection) == null ? void 0 : n.userVerification) === "required")
70
+ return new k({
71
71
  message: "User verification was required but no available authenticator supported it",
72
72
  code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
73
73
  cause: e
74
74
  });
75
75
  } else {
76
76
  if (e.name === "InvalidStateError")
77
- return new R({
77
+ return new k({
78
78
  message: "The authenticator was previously registered",
79
79
  code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
80
80
  cause: e
81
81
  });
82
82
  if (e.name === "NotAllowedError")
83
- return new R({
83
+ return new k({
84
84
  message: e.message,
85
85
  code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
86
86
  cause: e
87
87
  });
88
88
  if (e.name === "NotSupportedError")
89
- return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new R({
89
+ return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new k({
90
90
  message: 'No entry in pubKeyCredParams was of type "public-key"',
91
91
  code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
92
92
  cause: e
93
- }) : new R({
93
+ }) : new k({
94
94
  message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
95
95
  code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
96
96
  cause: e
97
97
  });
98
98
  if (e.name === "SecurityError") {
99
99
  const o = window.location.hostname;
100
- if (Nt(o)) {
100
+ if (St(o)) {
101
101
  if (r.rp.id !== o)
102
- return new R({
102
+ return new k({
103
103
  message: `The RP ID "${r.rp.id}" is invalid for this domain`,
104
104
  code: "ERROR_INVALID_RP_ID",
105
105
  cause: e
106
106
  });
107
- } else return new R({
107
+ } else return new k({
108
108
  message: `${window.location.hostname} is an invalid domain`,
109
109
  code: "ERROR_INVALID_DOMAIN",
110
110
  cause: e
111
111
  });
112
112
  } else if (e.name === "TypeError") {
113
113
  if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
114
- return new R({
114
+ return new k({
115
115
  message: "User ID was not between 1 and 64 characters",
116
116
  code: "ERROR_INVALID_USER_ID_LENGTH",
117
117
  cause: e
118
118
  });
119
119
  } else if (e.name === "UnknownError")
120
- return new R({
120
+ return new k({
121
121
  message: "The authenticator was unable to process the specified options, or could not create a new credential",
122
122
  code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
123
123
  cause: e
@@ -125,7 +125,7 @@ function Sr({ error: e, options: t }) {
125
125
  }
126
126
  return e;
127
127
  }
128
- class Ir {
128
+ class dr {
129
129
  createNewAbortSignal() {
130
130
  if (this.controller) {
131
131
  const r = new Error("Cancelling existing WebAuthn API call for new one");
@@ -141,118 +141,118 @@ class Ir {
141
141
  }
142
142
  }
143
143
  }
144
- const xt = new Ir(), Ar = ["cross-platform", "platform"];
145
- function Ct(e) {
146
- if (e && !(Ar.indexOf(e) < 0))
144
+ const At = new dr(), ur = ["cross-platform", "platform"];
145
+ function vt(e) {
146
+ if (e && !(ur.indexOf(e) < 0))
147
147
  return e;
148
148
  }
149
- async function kr(e) {
150
- var h;
151
- if (!Qe())
149
+ async function mr(e) {
150
+ var m;
151
+ if (!ze())
152
152
  throw new Error("WebAuthn is not supported in this browser");
153
153
  const t = { publicKey: {
154
154
  ...e,
155
- challenge: ke(e.challenge),
155
+ challenge: Ie(e.challenge),
156
156
  user: {
157
157
  ...e.user,
158
- id: ke(e.user.id)
158
+ id: Ie(e.user.id)
159
159
  },
160
- excludeCredentials: (h = e.excludeCredentials) == null ? void 0 : h.map(Rt)
160
+ excludeCredentials: (m = e.excludeCredentials) == null ? void 0 : m.map(It)
161
161
  } };
162
- t.signal = xt.createNewAbortSignal();
162
+ t.signal = At.createNewAbortSignal();
163
163
  let r;
164
164
  try {
165
165
  r = await navigator.credentials.create(t);
166
- } catch (u) {
167
- throw Sr({ error: u, options: t });
166
+ } catch (l) {
167
+ throw lr({ error: l, options: t });
168
168
  }
169
169
  if (!r)
170
170
  throw new Error("Registration was not completed");
171
- const { id: n, rawId: a, response: o, type: s } = r;
171
+ const { id: a, rawId: n, response: o, type: s } = r;
172
172
  let i;
173
173
  typeof o.getTransports == "function" && (i = o.getTransports());
174
- let d;
174
+ let u;
175
175
  if (typeof o.getPublicKeyAlgorithm == "function")
176
176
  try {
177
- d = o.getPublicKeyAlgorithm();
178
- } catch (u) {
179
- Ge("getPublicKeyAlgorithm()", u);
177
+ u = o.getPublicKeyAlgorithm();
178
+ } catch (l) {
179
+ Me("getPublicKeyAlgorithm()", l);
180
180
  }
181
- let g;
181
+ let p;
182
182
  if (typeof o.getPublicKey == "function")
183
183
  try {
184
- const u = o.getPublicKey();
185
- u !== null && (g = L(u));
186
- } catch (u) {
187
- Ge("getPublicKey()", u);
184
+ const l = o.getPublicKey();
185
+ l !== null && (p = L(l));
186
+ } catch (l) {
187
+ Me("getPublicKey()", l);
188
188
  }
189
- let p;
189
+ let h;
190
190
  if (typeof o.getAuthenticatorData == "function")
191
191
  try {
192
- p = L(o.getAuthenticatorData());
193
- } catch (u) {
194
- Ge("getAuthenticatorData()", u);
192
+ h = L(o.getAuthenticatorData());
193
+ } catch (l) {
194
+ Me("getAuthenticatorData()", l);
195
195
  }
196
196
  return {
197
- id: n,
198
- rawId: L(a),
197
+ id: a,
198
+ rawId: L(n),
199
199
  response: {
200
200
  attestationObject: L(o.attestationObject),
201
201
  clientDataJSON: L(o.clientDataJSON),
202
202
  transports: i,
203
- publicKeyAlgorithm: d,
204
- publicKey: g,
205
- authenticatorData: p
203
+ publicKeyAlgorithm: u,
204
+ publicKey: p,
205
+ authenticatorData: h
206
206
  },
207
207
  type: s,
208
208
  clientExtensionResults: r.getClientExtensionResults(),
209
- authenticatorAttachment: Ct(r.authenticatorAttachment)
209
+ authenticatorAttachment: vt(r.authenticatorAttachment)
210
210
  };
211
211
  }
212
- function Ge(e, t) {
212
+ function Me(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 _r() {
217
- if (!Qe())
216
+ function hr() {
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 Rr({ error: e, options: t }) {
222
+ function pr({ error: e, options: t }) {
223
223
  const { publicKey: r } = t;
224
224
  if (!r)
225
225
  throw Error("options was missing required publicKey property");
226
226
  if (e.name === "AbortError") {
227
227
  if (t.signal instanceof AbortSignal)
228
- return new R({
228
+ return new k({
229
229
  message: "Authentication ceremony was sent an abort signal",
230
230
  code: "ERROR_CEREMONY_ABORTED",
231
231
  cause: e
232
232
  });
233
233
  } else {
234
234
  if (e.name === "NotAllowedError")
235
- return new R({
235
+ return new k({
236
236
  message: e.message,
237
237
  code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
238
238
  cause: e
239
239
  });
240
240
  if (e.name === "SecurityError") {
241
- const n = window.location.hostname;
242
- if (Nt(n)) {
243
- if (r.rpId !== n)
244
- return new R({
241
+ const a = window.location.hostname;
242
+ if (St(a)) {
243
+ if (r.rpId !== a)
244
+ return new k({
245
245
  message: `The RP ID "${r.rpId}" is invalid for this domain`,
246
246
  code: "ERROR_INVALID_RP_ID",
247
247
  cause: e
248
248
  });
249
- } else return new R({
249
+ } else return new k({
250
250
  message: `${window.location.hostname} is an invalid domain`,
251
251
  code: "ERROR_INVALID_DOMAIN",
252
252
  cause: e
253
253
  });
254
254
  } else if (e.name === "UnknownError")
255
- return new R({
255
+ return new k({
256
256
  message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
257
257
  code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
258
258
  cause: e
@@ -260,72 +260,72 @@ function Rr({ error: e, options: t }) {
260
260
  }
261
261
  return e;
262
262
  }
263
- async function Nr(e, t = !1) {
264
- var h, u;
265
- if (!Qe())
263
+ async function gr(e, t = !1) {
264
+ var m, l;
265
+ if (!ze())
266
266
  throw new Error("WebAuthn is not supported in this browser");
267
267
  let r;
268
- ((h = e.allowCredentials) == null ? void 0 : h.length) !== 0 && (r = (u = e.allowCredentials) == null ? void 0 : u.map(Rt));
269
- const n = {
268
+ ((m = e.allowCredentials) == null ? void 0 : m.length) !== 0 && (r = (l = e.allowCredentials) == null ? void 0 : l.map(It));
269
+ const a = {
270
270
  ...e,
271
- challenge: ke(e.challenge),
271
+ challenge: Ie(e.challenge),
272
272
  allowCredentials: r
273
- }, a = {};
273
+ }, n = {};
274
274
  if (t) {
275
- if (!await _r())
275
+ if (!await hr())
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
- a.mediation = "conditional", n.allowCredentials = [];
279
+ n.mediation = "conditional", a.allowCredentials = [];
280
280
  }
281
- a.publicKey = n, a.signal = xt.createNewAbortSignal();
281
+ n.publicKey = a, n.signal = At.createNewAbortSignal();
282
282
  let o;
283
283
  try {
284
- o = await navigator.credentials.get(a);
285
- } catch (c) {
286
- throw Rr({ error: c, options: a });
284
+ o = await navigator.credentials.get(n);
285
+ } catch (d) {
286
+ throw pr({ error: d, options: n });
287
287
  }
288
288
  if (!o)
289
289
  throw new Error("Authentication was not completed");
290
- const { id: s, rawId: i, response: d, type: g } = o;
291
- let p;
292
- return d.userHandle && (p = L(d.userHandle)), {
290
+ const { id: s, rawId: i, response: u, type: p } = o;
291
+ let h;
292
+ return u.userHandle && (h = L(u.userHandle)), {
293
293
  id: s,
294
294
  rawId: L(i),
295
295
  response: {
296
- authenticatorData: L(d.authenticatorData),
297
- clientDataJSON: L(d.clientDataJSON),
298
- signature: L(d.signature),
299
- userHandle: p
296
+ authenticatorData: L(u.authenticatorData),
297
+ clientDataJSON: L(u.clientDataJSON),
298
+ signature: L(u.signature),
299
+ userHandle: h
300
300
  },
301
- type: g,
301
+ type: p,
302
302
  clientExtensionResults: o.getClientExtensionResults(),
303
- authenticatorAttachment: Ct(o.authenticatorAttachment)
303
+ authenticatorAttachment: vt(o.authenticatorAttachment)
304
304
  };
305
305
  }
306
306
  /*!
307
- @versini/auth-common v3.3.0
307
+ @versini/auth-common v4.0.0
308
308
  © 2024 gizmette.com
309
309
  */
310
310
  try {
311
311
  window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
312
- version: "3.3.0",
313
- buildTime: "07/31/2024 08:11 PM EDT",
312
+ version: "4.0.0",
313
+ buildTime: "08/19/2024 06:11 PM EDT",
314
314
  homepage: "https://github.com/aversini/auth-client",
315
315
  license: "MIT"
316
316
  });
317
317
  } catch {
318
318
  }
319
- const Q = {
319
+ const _e = {
320
320
  ID_TOKEN: "id_token",
321
321
  ACCESS_TOKEN: "token",
322
322
  ID_AND_ACCESS_TOKEN: "id_token token",
323
323
  CODE: "code",
324
324
  REFRESH_TOKEN: "refresh_token",
325
325
  PASSKEY: "passkey"
326
- }, Ot = {
326
+ }, kt = {
327
327
  CLIENT_ID: "X-Auth-ClientId"
328
- }, N = {
328
+ }, R = {
329
329
  ALG: "RS256",
330
330
  USER_ID_KEY: "sub",
331
331
  TOKEN_ID_KEY: "__raw",
@@ -335,8 +335,9 @@ const Q = {
335
335
  EXPIRES_AT_KEY: "exp",
336
336
  CREATED_AT_KEY: "iat",
337
337
  SCOPES_KEY: "scopes",
338
+ CLIENT_ID_KEY: "aud",
338
339
  ISSUER: "gizmette.com"
339
- }, xr = `-----BEGIN PUBLIC KEY-----
340
+ }, fr = `-----BEGIN PUBLIC KEY-----
340
341
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
341
342
  w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
342
343
  i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
@@ -344,33 +345,34 @@ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
344
345
  l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
345
346
  sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
346
347
  awIDAQAB
347
- -----END PUBLIC KEY-----`, Ce = {
348
- AUTHENTICATE: "authenticate",
348
+ -----END PUBLIC KEY-----`, Re = {
349
349
  CODE: "code",
350
- LOGOUT: "logout"
351
- }, Oe = crypto, Pt = (e) => e instanceof CryptoKey, ge = new TextEncoder(), he = new TextDecoder();
352
- function Cr(...e) {
353
- const t = e.reduce((a, { length: o }) => a + o, 0), r = new Uint8Array(t);
354
- let n = 0;
355
- for (const a of e)
356
- r.set(a, n), n += a.length;
350
+ LOGOUT: "logout",
351
+ LOGIN: "login",
352
+ REFRESH: "refresh"
353
+ }, Ne = crypto, _t = (e) => e instanceof CryptoKey, ue = new TextEncoder(), le = new TextDecoder();
354
+ function yr(...e) {
355
+ const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
356
+ let a = 0;
357
+ for (const n of e)
358
+ r.set(n, a), a += n.length;
357
359
  return r;
358
360
  }
359
- const Or = (e) => {
361
+ const br = (e) => {
360
362
  const t = atob(e), r = new Uint8Array(t.length);
361
- for (let n = 0; n < t.length; n++)
362
- r[n] = t.charCodeAt(n);
363
+ for (let a = 0; a < t.length; a++)
364
+ r[a] = t.charCodeAt(a);
363
365
  return r;
364
- }, de = (e) => {
366
+ }, se = (e) => {
365
367
  let t = e;
366
- t instanceof Uint8Array && (t = he.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
368
+ t instanceof Uint8Array && (t = le.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
367
369
  try {
368
- return Or(t);
370
+ return br(t);
369
371
  } catch {
370
372
  throw new TypeError("The input to be decoded is not correctly encoded.");
371
373
  }
372
374
  };
373
- let X = class extends Error {
375
+ let q = class extends Error {
374
376
  static get code() {
375
377
  return "ERR_JOSE_GENERIC";
376
378
  }
@@ -378,22 +380,24 @@ let X = class extends Error {
378
380
  var r;
379
381
  super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
380
382
  }
381
- }, $ = class extends X {
383
+ };
384
+ class $ extends q {
382
385
  static get code() {
383
386
  return "ERR_JWT_CLAIM_VALIDATION_FAILED";
384
387
  }
385
- constructor(t, r, n = "unspecified", a = "unspecified") {
386
- super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = n, this.reason = a, this.payload = r;
388
+ constructor(t, r, a = "unspecified", n = "unspecified") {
389
+ super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = a, this.reason = n, this.payload = r;
387
390
  }
388
- }, at = class extends X {
391
+ }
392
+ class tt extends q {
389
393
  static get code() {
390
394
  return "ERR_JWT_EXPIRED";
391
395
  }
392
- constructor(e, t, r = "unspecified", n = "unspecified") {
393
- super(e), this.code = "ERR_JWT_EXPIRED", this.claim = r, this.reason = n, this.payload = t;
396
+ constructor(t, r, a = "unspecified", n = "unspecified") {
397
+ super(t), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
394
398
  }
395
- };
396
- class Pr extends X {
399
+ }
400
+ class Er extends q {
397
401
  constructor() {
398
402
  super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
399
403
  }
@@ -401,21 +405,22 @@ class Pr extends X {
401
405
  return "ERR_JOSE_ALG_NOT_ALLOWED";
402
406
  }
403
407
  }
404
- let z = class extends X {
408
+ class Y extends q {
405
409
  constructor() {
406
410
  super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
407
411
  }
408
412
  static get code() {
409
413
  return "ERR_JOSE_NOT_SUPPORTED";
410
414
  }
411
- }, k = class extends X {
415
+ }
416
+ let v = class extends q {
412
417
  constructor() {
413
418
  super(...arguments), this.code = "ERR_JWS_INVALID";
414
419
  }
415
420
  static get code() {
416
421
  return "ERR_JWS_INVALID";
417
422
  }
418
- }, B = class extends X {
423
+ }, G = class extends q {
419
424
  constructor() {
420
425
  super(...arguments), this.code = "ERR_JWT_INVALID";
421
426
  }
@@ -423,7 +428,7 @@ let z = class extends X {
423
428
  return "ERR_JWT_INVALID";
424
429
  }
425
430
  };
426
- class Dr extends X {
431
+ class wr extends q {
427
432
  constructor() {
428
433
  super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
429
434
  }
@@ -431,16 +436,16 @@ class Dr extends X {
431
436
  return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
432
437
  }
433
438
  }
434
- function G(e, t = "algorithm.name") {
439
+ function B(e, t = "algorithm.name") {
435
440
  return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
436
441
  }
437
- function fe(e, t) {
442
+ function me(e, t) {
438
443
  return e.name === t;
439
444
  }
440
- function Be(e) {
445
+ function Ue(e) {
441
446
  return parseInt(e.name.slice(4), 10);
442
447
  }
443
- function $r(e) {
448
+ function Tr(e) {
444
449
  switch (e) {
445
450
  case "ES256":
446
451
  return "P-256";
@@ -452,92 +457,92 @@ function $r(e) {
452
457
  throw new Error("unreachable");
453
458
  }
454
459
  }
455
- function Lr(e, t) {
460
+ function Ir(e, t) {
456
461
  if (t.length && !t.some((r) => e.usages.includes(r))) {
457
462
  let r = "CryptoKey does not support this operation, its usages must include ";
458
463
  if (t.length > 2) {
459
- const n = t.pop();
460
- r += `one of ${t.join(", ")}, or ${n}.`;
464
+ const a = t.pop();
465
+ r += `one of ${t.join(", ")}, or ${a}.`;
461
466
  } else t.length === 2 ? r += `one of ${t[0]} or ${t[1]}.` : r += `${t[0]}.`;
462
467
  throw new TypeError(r);
463
468
  }
464
469
  }
465
- function Mr(e, t, ...r) {
470
+ function Sr(e, t, ...r) {
466
471
  switch (t) {
467
472
  case "HS256":
468
473
  case "HS384":
469
474
  case "HS512": {
470
- if (!fe(e.algorithm, "HMAC"))
471
- throw G("HMAC");
472
- const n = parseInt(t.slice(2), 10);
473
- if (Be(e.algorithm.hash) !== n)
474
- throw G(`SHA-${n}`, "algorithm.hash");
475
+ if (!me(e.algorithm, "HMAC"))
476
+ throw B("HMAC");
477
+ const a = parseInt(t.slice(2), 10);
478
+ if (Ue(e.algorithm.hash) !== a)
479
+ throw B(`SHA-${a}`, "algorithm.hash");
475
480
  break;
476
481
  }
477
482
  case "RS256":
478
483
  case "RS384":
479
484
  case "RS512": {
480
- if (!fe(e.algorithm, "RSASSA-PKCS1-v1_5"))
481
- throw G("RSASSA-PKCS1-v1_5");
482
- const n = parseInt(t.slice(2), 10);
483
- if (Be(e.algorithm.hash) !== n)
484
- throw G(`SHA-${n}`, "algorithm.hash");
485
+ if (!me(e.algorithm, "RSASSA-PKCS1-v1_5"))
486
+ throw B("RSASSA-PKCS1-v1_5");
487
+ const a = parseInt(t.slice(2), 10);
488
+ if (Ue(e.algorithm.hash) !== a)
489
+ throw B(`SHA-${a}`, "algorithm.hash");
485
490
  break;
486
491
  }
487
492
  case "PS256":
488
493
  case "PS384":
489
494
  case "PS512": {
490
- if (!fe(e.algorithm, "RSA-PSS"))
491
- throw G("RSA-PSS");
492
- const n = parseInt(t.slice(2), 10);
493
- if (Be(e.algorithm.hash) !== n)
494
- throw G(`SHA-${n}`, "algorithm.hash");
495
+ if (!me(e.algorithm, "RSA-PSS"))
496
+ throw B("RSA-PSS");
497
+ const a = parseInt(t.slice(2), 10);
498
+ if (Ue(e.algorithm.hash) !== a)
499
+ throw B(`SHA-${a}`, "algorithm.hash");
495
500
  break;
496
501
  }
497
502
  case "EdDSA": {
498
503
  if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448")
499
- throw G("Ed25519 or Ed448");
504
+ throw B("Ed25519 or Ed448");
500
505
  break;
501
506
  }
502
507
  case "ES256":
503
508
  case "ES384":
504
509
  case "ES512": {
505
- if (!fe(e.algorithm, "ECDSA"))
506
- throw G("ECDSA");
507
- const n = $r(t);
508
- if (e.algorithm.namedCurve !== n)
509
- throw G(n, "algorithm.namedCurve");
510
+ if (!me(e.algorithm, "ECDSA"))
511
+ throw B("ECDSA");
512
+ const a = Tr(t);
513
+ if (e.algorithm.namedCurve !== a)
514
+ throw B(a, "algorithm.namedCurve");
510
515
  break;
511
516
  }
512
517
  default:
513
518
  throw new TypeError("CryptoKey does not support this operation");
514
519
  }
515
- Lr(e, r);
520
+ Ir(e, r);
516
521
  }
517
- function Dt(e, t, ...r) {
518
- var n;
522
+ function Rt(e, t, ...r) {
523
+ var a;
519
524
  if (r.length > 2) {
520
- const a = r.pop();
521
- e += `one of type ${r.join(", ")}, or ${a}.`;
525
+ const n = r.pop();
526
+ e += `one of type ${r.join(", ")}, or ${n}.`;
522
527
  } else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
523
- return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (n = t.constructor) != null && n.name && (e += ` Received an instance of ${t.constructor.name}`), e;
528
+ 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;
524
529
  }
525
- const ot = (e, ...t) => Dt("Key must be ", e, ...t);
526
- function $t(e, t, ...r) {
527
- return Dt(`Key for the ${e} algorithm must be `, t, ...r);
530
+ const rt = (e, ...t) => Rt("Key must be ", e, ...t);
531
+ function Nt(e, t, ...r) {
532
+ return Rt(`Key for the ${e} algorithm must be `, t, ...r);
528
533
  }
529
- const Lt = (e) => Pt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", _e = ["CryptoKey"], Ur = (...e) => {
534
+ const xt = (e) => _t(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Se = ["CryptoKey"], Ar = (...e) => {
530
535
  const t = e.filter(Boolean);
531
536
  if (t.length === 0 || t.length === 1)
532
537
  return !0;
533
538
  let r;
534
- for (const n of t) {
535
- const a = Object.keys(n);
539
+ for (const a of t) {
540
+ const n = Object.keys(a);
536
541
  if (!r || r.size === 0) {
537
- r = new Set(a);
542
+ r = new Set(n);
538
543
  continue;
539
544
  }
540
- for (const o of a) {
545
+ for (const o of n) {
541
546
  if (r.has(o))
542
547
  return !1;
543
548
  r.add(o);
@@ -545,11 +550,11 @@ const Lt = (e) => Pt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
545
550
  }
546
551
  return !0;
547
552
  };
548
- function Hr(e) {
553
+ function vr(e) {
549
554
  return typeof e == "object" && e !== null;
550
555
  }
551
- function Re(e) {
552
- if (!Hr(e) || Object.prototype.toString.call(e) !== "[object Object]")
556
+ function Ae(e) {
557
+ if (!vr(e) || Object.prototype.toString.call(e) !== "[object Object]")
553
558
  return !1;
554
559
  if (Object.getPrototypeOf(e) === null)
555
560
  return !0;
@@ -558,14 +563,14 @@ function Re(e) {
558
563
  t = Object.getPrototypeOf(t);
559
564
  return Object.getPrototypeOf(e) === t;
560
565
  }
561
- const Kr = (e, t) => {
566
+ const kr = (e, t) => {
562
567
  if (e.startsWith("RS") || e.startsWith("PS")) {
563
568
  const { modulusLength: r } = t.algorithm;
564
569
  if (typeof r != "number" || r < 2048)
565
570
  throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
566
571
  }
567
572
  };
568
- function Gr(e) {
573
+ function _r(e) {
569
574
  let t, r;
570
575
  switch (e.kty) {
571
576
  case "RSA": {
@@ -590,7 +595,7 @@ function Gr(e) {
590
595
  }, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
591
596
  break;
592
597
  default:
593
- throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
598
+ throw new Y('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
594
599
  }
595
600
  break;
596
601
  }
@@ -612,7 +617,7 @@ function Gr(e) {
612
617
  t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
613
618
  break;
614
619
  default:
615
- throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
620
+ throw new Y('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
616
621
  }
617
622
  break;
618
623
  }
@@ -628,83 +633,83 @@ function Gr(e) {
628
633
  t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
629
634
  break;
630
635
  default:
631
- throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
636
+ throw new Y('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
632
637
  }
633
638
  break;
634
639
  }
635
640
  default:
636
- throw new z('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
641
+ throw new Y('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
637
642
  }
638
643
  return { algorithm: t, keyUsages: r };
639
644
  }
640
- const Br = async (e) => {
645
+ const Rr = async (e) => {
641
646
  if (!e.alg)
642
647
  throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
643
- const { algorithm: t, keyUsages: r } = Gr(e), n = [
648
+ const { algorithm: t, keyUsages: r } = _r(e), a = [
644
649
  t,
645
650
  e.ext ?? !1,
646
651
  e.key_ops ?? r
647
- ], a = { ...e };
648
- return delete a.alg, delete a.use, Oe.subtle.importKey("jwk", a, ...n);
649
- }, Mt = (e) => de(e);
650
- let We, Ve;
651
- const Ut = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Ht = async (e, t, r, n) => {
652
- let a = e.get(t);
653
- if (a != null && a[n])
654
- return a[n];
655
- const o = await Br({ ...r, alg: n });
656
- return a ? a[n] = o : e.set(t, { [n]: o }), o;
657
- }, Wr = (e, t) => {
658
- if (Ut(e)) {
652
+ ], n = { ...e };
653
+ return delete n.alg, delete n.use, Ne.subtle.importKey("jwk", n, ...a);
654
+ }, Ct = (e) => se(e);
655
+ let He, Ke;
656
+ const Ot = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Pt = async (e, t, r, a) => {
657
+ let n = e.get(t);
658
+ if (n != null && n[a])
659
+ return n[a];
660
+ const o = await Rr({ ...r, alg: a });
661
+ return n ? n[a] = o : e.set(t, { [a]: o }), o;
662
+ }, Nr = (e, t) => {
663
+ if (Ot(e)) {
659
664
  let r = e.export({ format: "jwk" });
660
- return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Mt(r.k) : (Ve || (Ve = /* @__PURE__ */ new WeakMap()), Ht(Ve, e, r, t));
665
+ return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Ct(r.k) : (Ke || (Ke = /* @__PURE__ */ new WeakMap()), Pt(Ke, e, r, t));
661
666
  }
662
667
  return e;
663
- }, Vr = (e, t) => {
664
- if (Ut(e)) {
668
+ }, xr = (e, t) => {
669
+ if (Ot(e)) {
665
670
  let r = e.export({ format: "jwk" });
666
- return r.k ? Mt(r.k) : (We || (We = /* @__PURE__ */ new WeakMap()), Ht(We, e, r, t));
671
+ return r.k ? Ct(r.k) : (He || (He = /* @__PURE__ */ new WeakMap()), Pt(He, e, r, t));
667
672
  }
668
673
  return e;
669
- }, Fr = { normalizePublicKey: Wr, normalizePrivateKey: Vr }, Y = (e, t, r = 0) => {
674
+ }, Cr = { normalizePublicKey: Nr, normalizePrivateKey: xr }, J = (e, t, r = 0) => {
670
675
  r === 0 && (t.unshift(t.length), t.unshift(6));
671
- const n = e.indexOf(t[0], r);
672
- if (n === -1)
676
+ const a = e.indexOf(t[0], r);
677
+ if (a === -1)
673
678
  return !1;
674
- const a = e.subarray(n, n + t.length);
675
- return a.length !== t.length ? !1 : a.every((o, s) => o === t[s]) || Y(e, t, n + 1);
676
- }, st = (e) => {
679
+ const n = e.subarray(a, a + t.length);
680
+ return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || J(e, t, a + 1);
681
+ }, at = (e) => {
677
682
  switch (!0) {
678
- case Y(e, [42, 134, 72, 206, 61, 3, 1, 7]):
683
+ case J(e, [42, 134, 72, 206, 61, 3, 1, 7]):
679
684
  return "P-256";
680
- case Y(e, [43, 129, 4, 0, 34]):
685
+ case J(e, [43, 129, 4, 0, 34]):
681
686
  return "P-384";
682
- case Y(e, [43, 129, 4, 0, 35]):
687
+ case J(e, [43, 129, 4, 0, 35]):
683
688
  return "P-521";
684
- case Y(e, [43, 101, 110]):
689
+ case J(e, [43, 101, 110]):
685
690
  return "X25519";
686
- case Y(e, [43, 101, 111]):
691
+ case J(e, [43, 101, 111]):
687
692
  return "X448";
688
- case Y(e, [43, 101, 112]):
693
+ case J(e, [43, 101, 112]):
689
694
  return "Ed25519";
690
- case Y(e, [43, 101, 113]):
695
+ case J(e, [43, 101, 113]):
691
696
  return "Ed448";
692
697
  default:
693
- throw new z("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
698
+ throw new Y("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
694
699
  }
695
- }, Jr = async (e, t, r, n, a) => {
700
+ }, Or = async (e, t, r, a, n) => {
696
701
  let o, s;
697
- const i = new Uint8Array(atob(r.replace(e, "")).split("").map((d) => d.charCodeAt(0)));
698
- switch (n) {
702
+ const i = new Uint8Array(atob(r.replace(e, "")).split("").map((u) => u.charCodeAt(0)));
703
+ switch (a) {
699
704
  case "PS256":
700
705
  case "PS384":
701
706
  case "PS512":
702
- o = { name: "RSA-PSS", hash: `SHA-${n.slice(-3)}` }, s = ["verify"];
707
+ o = { name: "RSA-PSS", hash: `SHA-${a.slice(-3)}` }, s = ["verify"];
703
708
  break;
704
709
  case "RS256":
705
710
  case "RS384":
706
711
  case "RS512":
707
- o = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${n.slice(-3)}` }, s = ["verify"];
712
+ o = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${a.slice(-3)}` }, s = ["verify"];
708
713
  break;
709
714
  case "RSA-OAEP":
710
715
  case "RSA-OAEP-256":
@@ -712,7 +717,7 @@ const Ut = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
712
717
  case "RSA-OAEP-512":
713
718
  o = {
714
719
  name: "RSA-OAEP",
715
- hash: `SHA-${parseInt(n.slice(-3), 10) || 1}`
720
+ hash: `SHA-${parseInt(a.slice(-3), 10) || 1}`
716
721
  }, s = ["encrypt", "wrapKey"];
717
722
  break;
718
723
  case "ES256":
@@ -728,68 +733,68 @@ const Ut = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
728
733
  case "ECDH-ES+A128KW":
729
734
  case "ECDH-ES+A192KW":
730
735
  case "ECDH-ES+A256KW": {
731
- const d = st(i);
732
- o = d.startsWith("P-") ? { name: "ECDH", namedCurve: d } : { name: d }, s = [];
736
+ const u = at(i);
737
+ o = u.startsWith("P-") ? { name: "ECDH", namedCurve: u } : { name: u }, s = [];
733
738
  break;
734
739
  }
735
740
  case "EdDSA":
736
- o = { name: st(i) }, s = ["verify"];
741
+ o = { name: at(i) }, s = ["verify"];
737
742
  break;
738
743
  default:
739
- throw new z('Invalid or unsupported "alg" (Algorithm) value');
744
+ throw new Y('Invalid or unsupported "alg" (Algorithm) value');
740
745
  }
741
- return Oe.subtle.importKey(t, i, o, !1, s);
742
- }, Yr = (e, t, r) => Jr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
743
- async function jr(e, t, r) {
746
+ return Ne.subtle.importKey(t, i, o, !1, s);
747
+ }, Pr = (e, t, r) => Or(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
748
+ async function Dr(e, t, r) {
744
749
  if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
745
750
  throw new TypeError('"spki" must be SPKI formatted string');
746
- return Yr(e, t);
751
+ return Pr(e, t);
747
752
  }
748
- const Ie = (e) => e == null ? void 0 : e[Symbol.toStringTag], zr = (e, t) => {
753
+ const Ee = (e) => e == null ? void 0 : e[Symbol.toStringTag], $r = (e, t) => {
749
754
  if (!(t instanceof Uint8Array)) {
750
- if (!Lt(t))
751
- throw new TypeError($t(e, t, ..._e, "Uint8Array"));
755
+ if (!xt(t))
756
+ throw new TypeError(Nt(e, t, ...Se, "Uint8Array"));
752
757
  if (t.type !== "secret")
753
- throw new TypeError(`${Ie(t)} instances for symmetric algorithms must be of type "secret"`);
758
+ throw new TypeError(`${Ee(t)} instances for symmetric algorithms must be of type "secret"`);
754
759
  }
755
- }, qr = (e, t, r) => {
756
- if (!Lt(t))
757
- throw new TypeError($t(e, t, ..._e));
760
+ }, Lr = (e, t, r) => {
761
+ if (!xt(t))
762
+ throw new TypeError(Nt(e, t, ...Se));
758
763
  if (t.type === "secret")
759
- throw new TypeError(`${Ie(t)} instances for asymmetric algorithms must not be of type "secret"`);
764
+ throw new TypeError(`${Ee(t)} instances for asymmetric algorithms must not be of type "secret"`);
760
765
  if (t.algorithm && r === "verify" && t.type === "private")
761
- throw new TypeError(`${Ie(t)} instances for asymmetric algorithm verifying must be of type "public"`);
766
+ throw new TypeError(`${Ee(t)} instances for asymmetric algorithm verifying must be of type "public"`);
762
767
  if (t.algorithm && r === "encrypt" && t.type === "private")
763
- throw new TypeError(`${Ie(t)} instances for asymmetric algorithm encryption must be of type "public"`);
764
- }, Qr = (e, t, r) => {
765
- e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? zr(e, t) : qr(e, t, r);
768
+ throw new TypeError(`${Ee(t)} instances for asymmetric algorithm encryption must be of type "public"`);
769
+ }, Mr = (e, t, r) => {
770
+ e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? $r(e, t) : Lr(e, t, r);
766
771
  };
767
- function Xr(e, t, r, n, a) {
768
- if (a.crit !== void 0 && (n == null ? void 0 : n.crit) === void 0)
772
+ function Ur(e, t, r, a, n) {
773
+ if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
769
774
  throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
770
- if (!n || n.crit === void 0)
775
+ if (!a || a.crit === void 0)
771
776
  return /* @__PURE__ */ new Set();
772
- if (!Array.isArray(n.crit) || n.crit.length === 0 || n.crit.some((s) => typeof s != "string" || s.length === 0))
777
+ if (!Array.isArray(a.crit) || a.crit.length === 0 || a.crit.some((s) => typeof s != "string" || s.length === 0))
773
778
  throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
774
779
  let o;
775
780
  r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
776
- for (const s of n.crit) {
781
+ for (const s of a.crit) {
777
782
  if (!o.has(s))
778
- throw new z(`Extension Header Parameter "${s}" is not recognized`);
779
- if (a[s] === void 0)
783
+ throw new Y(`Extension Header Parameter "${s}" is not recognized`);
784
+ if (n[s] === void 0)
780
785
  throw new e(`Extension Header Parameter "${s}" is missing`);
781
- if (o.get(s) && n[s] === void 0)
786
+ if (o.get(s) && a[s] === void 0)
782
787
  throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`);
783
788
  }
784
- return new Set(n.crit);
789
+ return new Set(a.crit);
785
790
  }
786
- const Zr = (e, t) => {
791
+ const Hr = (e, t) => {
787
792
  if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
788
793
  throw new TypeError(`"${e}" option must be an array of strings`);
789
794
  if (t)
790
795
  return new Set(t);
791
796
  };
792
- function en(e, t) {
797
+ function Kr(e, t) {
793
798
  const r = `SHA-${e.slice(-3)}`;
794
799
  switch (e) {
795
800
  case "HS256":
@@ -811,361 +816,361 @@ function en(e, t) {
811
816
  case "EdDSA":
812
817
  return { name: t.name };
813
818
  default:
814
- throw new z(`alg ${e} is not supported either by JOSE or your javascript runtime`);
819
+ throw new Y(`alg ${e} is not supported either by JOSE or your javascript runtime`);
815
820
  }
816
821
  }
817
- async function tn(e, t, r) {
818
- if (t = await Fr.normalizePublicKey(t, e), Pt(t))
819
- return Mr(t, e, r), t;
822
+ async function Br(e, t, r) {
823
+ if (t = await Cr.normalizePublicKey(t, e), _t(t))
824
+ return Sr(t, e, r), t;
820
825
  if (t instanceof Uint8Array) {
821
826
  if (!e.startsWith("HS"))
822
- throw new TypeError(ot(t, ..._e));
823
- return Oe.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
827
+ throw new TypeError(rt(t, ...Se));
828
+ return Ne.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
824
829
  }
825
- throw new TypeError(ot(t, ..._e, "Uint8Array"));
830
+ throw new TypeError(rt(t, ...Se, "Uint8Array"));
826
831
  }
827
- const rn = async (e, t, r, n) => {
828
- const a = await tn(e, t, "verify");
829
- Kr(e, a);
830
- const o = en(e, a.algorithm);
832
+ const Gr = async (e, t, r, a) => {
833
+ const n = await Br(e, t, "verify");
834
+ kr(e, n);
835
+ const o = Kr(e, n.algorithm);
831
836
  try {
832
- return await Oe.subtle.verify(o, a, r, n);
837
+ return await Ne.subtle.verify(o, n, r, a);
833
838
  } catch {
834
839
  return !1;
835
840
  }
836
841
  };
837
- async function nn(e, t, r) {
838
- if (!Re(e))
839
- throw new k("Flattened JWS must be an object");
842
+ async function Wr(e, t, r) {
843
+ if (!Ae(e))
844
+ throw new v("Flattened JWS must be an object");
840
845
  if (e.protected === void 0 && e.header === void 0)
841
- throw new k('Flattened JWS must have either of the "protected" or "header" members');
846
+ throw new v('Flattened JWS must have either of the "protected" or "header" members');
842
847
  if (e.protected !== void 0 && typeof e.protected != "string")
843
- throw new k("JWS Protected Header incorrect type");
848
+ throw new v("JWS Protected Header incorrect type");
844
849
  if (e.payload === void 0)
845
- throw new k("JWS Payload missing");
850
+ throw new v("JWS Payload missing");
846
851
  if (typeof e.signature != "string")
847
- throw new k("JWS Signature missing or incorrect type");
848
- if (e.header !== void 0 && !Re(e.header))
849
- throw new k("JWS Unprotected Header incorrect type");
850
- let n = {};
852
+ throw new v("JWS Signature missing or incorrect type");
853
+ if (e.header !== void 0 && !Ae(e.header))
854
+ throw new v("JWS Unprotected Header incorrect type");
855
+ let a = {};
851
856
  if (e.protected)
852
857
  try {
853
- const m = de(e.protected);
854
- n = JSON.parse(he.decode(m));
858
+ const f = se(e.protected);
859
+ a = JSON.parse(le.decode(f));
855
860
  } catch {
856
- throw new k("JWS Protected Header is invalid");
861
+ throw new v("JWS Protected Header is invalid");
857
862
  }
858
- if (!Ur(n, e.header))
859
- throw new k("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
860
- const a = {
861
- ...n,
863
+ if (!Ar(a, e.header))
864
+ throw new v("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
865
+ const n = {
866
+ ...a,
862
867
  ...e.header
863
- }, o = Xr(k, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, n, a);
868
+ }, o = Ur(v, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
864
869
  let s = !0;
865
- if (o.has("b64") && (s = n.b64, typeof s != "boolean"))
866
- throw new k('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
867
- const { alg: i } = a;
870
+ if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
871
+ throw new v('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
872
+ const { alg: i } = n;
868
873
  if (typeof i != "string" || !i)
869
- throw new k('JWS "alg" (Algorithm) Header Parameter missing or invalid');
870
- const d = r && Zr("algorithms", r.algorithms);
871
- if (d && !d.has(i))
872
- throw new Pr('"alg" (Algorithm) Header Parameter value not allowed');
874
+ throw new v('JWS "alg" (Algorithm) Header Parameter missing or invalid');
875
+ const u = r && Hr("algorithms", r.algorithms);
876
+ if (u && !u.has(i))
877
+ throw new Er('"alg" (Algorithm) Header Parameter value not allowed');
873
878
  if (s) {
874
879
  if (typeof e.payload != "string")
875
- throw new k("JWS Payload must be a string");
880
+ throw new v("JWS Payload must be a string");
876
881
  } else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
877
- throw new k("JWS Payload must be a string or an Uint8Array instance");
878
- let g = !1;
879
- typeof t == "function" && (t = await t(n, e), g = !0), Qr(i, t, "verify");
880
- const p = Cr(ge.encode(e.protected ?? ""), ge.encode("."), typeof e.payload == "string" ? ge.encode(e.payload) : e.payload);
881
- let h;
882
+ throw new v("JWS Payload must be a string or an Uint8Array instance");
883
+ let p = !1;
884
+ typeof t == "function" && (t = await t(a, e), p = !0), Mr(i, t, "verify");
885
+ const h = yr(ue.encode(e.protected ?? ""), ue.encode("."), typeof e.payload == "string" ? ue.encode(e.payload) : e.payload);
886
+ let m;
882
887
  try {
883
- h = de(e.signature);
888
+ m = se(e.signature);
884
889
  } catch {
885
- throw new k("Failed to base64url decode the signature");
890
+ throw new v("Failed to base64url decode the signature");
886
891
  }
887
- if (!await rn(i, t, h, p))
888
- throw new Dr();
889
- let u;
892
+ if (!await Gr(i, t, m, h))
893
+ throw new wr();
894
+ let l;
890
895
  if (s)
891
896
  try {
892
- u = de(e.payload);
897
+ l = se(e.payload);
893
898
  } catch {
894
- throw new k("Failed to base64url decode the payload");
899
+ throw new v("Failed to base64url decode the payload");
895
900
  }
896
- else typeof e.payload == "string" ? u = ge.encode(e.payload) : u = e.payload;
897
- const c = { payload: u };
898
- return e.protected !== void 0 && (c.protectedHeader = n), e.header !== void 0 && (c.unprotectedHeader = e.header), g ? { ...c, key: t } : c;
899
- }
900
- async function an(e, t, r) {
901
- if (e instanceof Uint8Array && (e = he.decode(e)), typeof e != "string")
902
- throw new k("Compact JWS must be a string or Uint8Array");
903
- const { 0: n, 1: a, 2: o, length: s } = e.split(".");
901
+ else typeof e.payload == "string" ? l = ue.encode(e.payload) : l = e.payload;
902
+ const d = { payload: l };
903
+ return e.protected !== void 0 && (d.protectedHeader = a), e.header !== void 0 && (d.unprotectedHeader = e.header), p ? { ...d, key: t } : d;
904
+ }
905
+ async function Vr(e, t, r) {
906
+ if (e instanceof Uint8Array && (e = le.decode(e)), typeof e != "string")
907
+ throw new v("Compact JWS must be a string or Uint8Array");
908
+ const { 0: a, 1: n, 2: o, length: s } = e.split(".");
904
909
  if (s !== 3)
905
- throw new k("Invalid Compact JWS");
906
- const i = await nn({ payload: a, protected: n, signature: o }, t, r), d = { payload: i.payload, protectedHeader: i.protectedHeader };
907
- return typeof t == "function" ? { ...d, key: i.key } : d;
910
+ throw new v("Invalid Compact JWS");
911
+ const i = await Wr({ payload: n, protected: a, signature: o }, t, r), u = { payload: i.payload, protectedHeader: i.protectedHeader };
912
+ return typeof t == "function" ? { ...u, key: i.key } : u;
908
913
  }
909
- const on = (e) => Math.floor(e.getTime() / 1e3), Kt = 60, Gt = Kt * 60, Xe = Gt * 24, sn = Xe * 7, cn = Xe * 365.25, ln = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, it = (e) => {
910
- const t = ln.exec(e);
914
+ const Jr = (e) => Math.floor(e.getTime() / 1e3), Dt = 60, $t = Dt * 60, je = $t * 24, Fr = je * 7, Yr = je * 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, nt = (e) => {
915
+ const t = zr.exec(e);
911
916
  if (!t || t[4] && t[1])
912
917
  throw new TypeError("Invalid time period format");
913
- const r = parseFloat(t[2]), n = t[3].toLowerCase();
914
- let a;
915
- switch (n) {
918
+ const r = parseFloat(t[2]), a = t[3].toLowerCase();
919
+ let n;
920
+ switch (a) {
916
921
  case "sec":
917
922
  case "secs":
918
923
  case "second":
919
924
  case "seconds":
920
925
  case "s":
921
- a = Math.round(r);
926
+ n = Math.round(r);
922
927
  break;
923
928
  case "minute":
924
929
  case "minutes":
925
930
  case "min":
926
931
  case "mins":
927
932
  case "m":
928
- a = Math.round(r * Kt);
933
+ n = Math.round(r * Dt);
929
934
  break;
930
935
  case "hour":
931
936
  case "hours":
932
937
  case "hr":
933
938
  case "hrs":
934
939
  case "h":
935
- a = Math.round(r * Gt);
940
+ n = Math.round(r * $t);
936
941
  break;
937
942
  case "day":
938
943
  case "days":
939
944
  case "d":
940
- a = Math.round(r * Xe);
945
+ n = Math.round(r * je);
941
946
  break;
942
947
  case "week":
943
948
  case "weeks":
944
949
  case "w":
945
- a = Math.round(r * sn);
950
+ n = Math.round(r * Fr);
946
951
  break;
947
952
  default:
948
- a = Math.round(r * cn);
953
+ n = Math.round(r * Yr);
949
954
  break;
950
955
  }
951
- return t[1] === "-" || t[4] === "ago" ? -a : a;
952
- }, ct = (e) => e.toLowerCase().replace(/^application\//, ""), dn = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, un = (e, t, r = {}) => {
953
- let n;
956
+ return t[1] === "-" || t[4] === "ago" ? -n : n;
957
+ }, ot = (e) => e.toLowerCase().replace(/^application\//, ""), jr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, qr = (e, t, r = {}) => {
958
+ let a;
954
959
  try {
955
- n = JSON.parse(he.decode(t));
960
+ a = JSON.parse(le.decode(t));
956
961
  } catch {
957
962
  }
958
- if (!Re(n))
959
- throw new B("JWT Claims Set must be a top-level JSON object");
960
- const { typ: a } = r;
961
- if (a && (typeof e.typ != "string" || ct(e.typ) !== ct(a)))
962
- throw new $('unexpected "typ" JWT header value', n, "typ", "check_failed");
963
- const { requiredClaims: o = [], issuer: s, subject: i, audience: d, maxTokenAge: g } = r, p = [...o];
964
- g !== void 0 && p.push("iat"), d !== void 0 && p.push("aud"), i !== void 0 && p.push("sub"), s !== void 0 && p.push("iss");
965
- for (const m of new Set(p.reverse()))
966
- if (!(m in n))
967
- throw new $(`missing required "${m}" claim`, n, m, "missing");
968
- if (s && !(Array.isArray(s) ? s : [s]).includes(n.iss))
969
- throw new $('unexpected "iss" claim value', n, "iss", "check_failed");
970
- if (i && n.sub !== i)
971
- throw new $('unexpected "sub" claim value', n, "sub", "check_failed");
972
- if (d && !dn(n.aud, typeof d == "string" ? [d] : d))
973
- throw new $('unexpected "aud" claim value', n, "aud", "check_failed");
974
- let h;
963
+ if (!Ae(a))
964
+ throw new G("JWT Claims Set must be a top-level JSON object");
965
+ const { typ: n } = r;
966
+ if (n && (typeof e.typ != "string" || ot(e.typ) !== ot(n)))
967
+ throw new $('unexpected "typ" JWT header value', a, "typ", "check_failed");
968
+ const { requiredClaims: o = [], issuer: s, subject: i, audience: u, maxTokenAge: p } = r, h = [...o];
969
+ p !== void 0 && h.push("iat"), u !== void 0 && h.push("aud"), i !== void 0 && h.push("sub"), s !== void 0 && h.push("iss");
970
+ for (const f of new Set(h.reverse()))
971
+ if (!(f in a))
972
+ throw new $(`missing required "${f}" claim`, a, f, "missing");
973
+ if (s && !(Array.isArray(s) ? s : [s]).includes(a.iss))
974
+ throw new $('unexpected "iss" claim value', a, "iss", "check_failed");
975
+ if (i && a.sub !== i)
976
+ throw new $('unexpected "sub" claim value', a, "sub", "check_failed");
977
+ if (u && !jr(a.aud, typeof u == "string" ? [u] : u))
978
+ throw new $('unexpected "aud" claim value', a, "aud", "check_failed");
979
+ let m;
975
980
  switch (typeof r.clockTolerance) {
976
981
  case "string":
977
- h = it(r.clockTolerance);
982
+ m = nt(r.clockTolerance);
978
983
  break;
979
984
  case "number":
980
- h = r.clockTolerance;
985
+ m = r.clockTolerance;
981
986
  break;
982
987
  case "undefined":
983
- h = 0;
988
+ m = 0;
984
989
  break;
985
990
  default:
986
991
  throw new TypeError("Invalid clockTolerance option type");
987
992
  }
988
- const { currentDate: u } = r, c = on(u || /* @__PURE__ */ new Date());
989
- if ((n.iat !== void 0 || g) && typeof n.iat != "number")
990
- throw new $('"iat" claim must be a number', n, "iat", "invalid");
991
- if (n.nbf !== void 0) {
992
- if (typeof n.nbf != "number")
993
- throw new $('"nbf" claim must be a number', n, "nbf", "invalid");
994
- if (n.nbf > c + h)
995
- throw new $('"nbf" claim timestamp check failed', n, "nbf", "check_failed");
996
- }
997
- if (n.exp !== void 0) {
998
- if (typeof n.exp != "number")
999
- throw new $('"exp" claim must be a number', n, "exp", "invalid");
1000
- if (n.exp <= c - h)
1001
- throw new at('"exp" claim timestamp check failed', n, "exp", "check_failed");
1002
- }
1003
- if (g) {
1004
- const m = c - n.iat, b = typeof g == "number" ? g : it(g);
1005
- if (m - h > b)
1006
- throw new at('"iat" claim timestamp check failed (too far in the past)', n, "iat", "check_failed");
1007
- if (m < 0 - h)
1008
- throw new $('"iat" claim timestamp check failed (it should be in the past)', n, "iat", "check_failed");
993
+ const { currentDate: l } = r, d = Jr(l || /* @__PURE__ */ new Date());
994
+ if ((a.iat !== void 0 || p) && typeof a.iat != "number")
995
+ throw new $('"iat" claim must be a number', a, "iat", "invalid");
996
+ if (a.nbf !== void 0) {
997
+ if (typeof a.nbf != "number")
998
+ throw new $('"nbf" claim must be a number', a, "nbf", "invalid");
999
+ if (a.nbf > d + m)
1000
+ throw new $('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
1001
+ }
1002
+ if (a.exp !== void 0) {
1003
+ if (typeof a.exp != "number")
1004
+ throw new $('"exp" claim must be a number', a, "exp", "invalid");
1005
+ if (a.exp <= d - m)
1006
+ throw new tt('"exp" claim timestamp check failed', a, "exp", "check_failed");
1007
+ }
1008
+ if (p) {
1009
+ const f = d - a.iat, E = typeof p == "number" ? p : nt(p);
1010
+ if (f - m > E)
1011
+ throw new tt('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
1012
+ if (f < 0 - m)
1013
+ throw new $('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
1009
1014
  }
1010
- return n;
1015
+ return a;
1011
1016
  };
1012
- async function mn(e, t, r) {
1013
- var n;
1014
- const a = await an(e, t, r);
1015
- if ((n = a.protectedHeader.crit) != null && n.includes("b64") && a.protectedHeader.b64 === !1)
1016
- throw new B("JWTs MUST NOT use unencoded payload");
1017
- const o = { payload: un(a.protectedHeader, a.payload, r), protectedHeader: a.protectedHeader };
1018
- return typeof t == "function" ? { ...o, key: a.key } : o;
1019
- }
1020
- const hn = de;
1021
- function pn(e) {
1017
+ async function Qr(e, t, r) {
1018
+ var a;
1019
+ const n = await Vr(e, t, r);
1020
+ if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
1021
+ throw new G("JWTs MUST NOT use unencoded payload");
1022
+ const o = { payload: qr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
1023
+ return typeof t == "function" ? { ...o, key: n.key } : o;
1024
+ }
1025
+ const Xr = se;
1026
+ function Zr(e) {
1022
1027
  if (typeof e != "string")
1023
- throw new B("JWTs must use Compact JWS serialization, JWT must be a string");
1028
+ throw new G("JWTs must use Compact JWS serialization, JWT must be a string");
1024
1029
  const { 1: t, length: r } = e.split(".");
1025
1030
  if (r === 5)
1026
- throw new B("Only JWTs using Compact JWS serialization can be decoded");
1031
+ throw new G("Only JWTs using Compact JWS serialization can be decoded");
1027
1032
  if (r !== 3)
1028
- throw new B("Invalid JWT");
1033
+ throw new G("Invalid JWT");
1029
1034
  if (!t)
1030
- throw new B("JWTs must contain a payload");
1031
- let n;
1035
+ throw new G("JWTs must contain a payload");
1036
+ let a;
1032
1037
  try {
1033
- n = hn(t);
1038
+ a = Xr(t);
1034
1039
  } catch {
1035
- throw new B("Failed to base64url decode the payload");
1040
+ throw new G("Failed to base64url decode the payload");
1036
1041
  }
1037
- let a;
1042
+ let n;
1038
1043
  try {
1039
- a = JSON.parse(he.decode(n));
1044
+ n = JSON.parse(le.decode(a));
1040
1045
  } catch {
1041
- throw new B("Failed to parse the decoded payload as JSON");
1046
+ throw new G("Failed to parse the decoded payload as JSON");
1042
1047
  }
1043
- if (!Re(a))
1044
- throw new B("Invalid JWT Claims Set");
1045
- return a;
1048
+ if (!Ae(n))
1049
+ throw new G("Invalid JWT Claims Set");
1050
+ return n;
1046
1051
  }
1047
- const ue = async (e) => {
1052
+ const ie = async (e) => {
1048
1053
  try {
1049
- const t = N.ALG, r = await jr(xr, t);
1050
- return await mn(e, r, {
1051
- issuer: N.ISSUER
1054
+ const t = R.ALG, r = await Dr(fr, t);
1055
+ return await Qr(e, r, {
1056
+ issuer: R.ISSUER
1052
1057
  });
1053
1058
  } catch {
1054
1059
  return;
1055
1060
  }
1056
- }, gn = (e) => {
1061
+ }, ea = (e) => {
1057
1062
  try {
1058
- return pn(e);
1063
+ return Zr(e);
1059
1064
  } catch {
1060
1065
  return;
1061
1066
  }
1062
1067
  };
1063
- var I = [];
1064
- for (var Fe = 0; Fe < 256; ++Fe)
1065
- I.push((Fe + 256).toString(16).slice(1));
1066
- function fn(e, t = 0) {
1067
- return (I[e[t + 0]] + I[e[t + 1]] + I[e[t + 2]] + I[e[t + 3]] + "-" + I[e[t + 4]] + I[e[t + 5]] + "-" + I[e[t + 6]] + I[e[t + 7]] + "-" + I[e[t + 8]] + I[e[t + 9]] + "-" + I[e[t + 10]] + I[e[t + 11]] + I[e[t + 12]] + I[e[t + 13]] + I[e[t + 14]] + I[e[t + 15]]).toLowerCase();
1068
- }
1069
- var ye, yn = new Uint8Array(16);
1070
- function bn() {
1071
- if (!ye && (ye = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ye))
1068
+ var S = [];
1069
+ for (var Be = 0; Be < 256; ++Be)
1070
+ S.push((Be + 256).toString(16).slice(1));
1071
+ function ta(e, t = 0) {
1072
+ 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();
1073
+ }
1074
+ var he, ra = new Uint8Array(16);
1075
+ function aa() {
1076
+ if (!he && (he = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !he))
1072
1077
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1073
- return ye(yn);
1078
+ return he(ra);
1074
1079
  }
1075
- var wn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1076
- const lt = {
1077
- randomUUID: wn
1080
+ var na = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1081
+ const st = {
1082
+ randomUUID: na
1078
1083
  };
1079
- function dt(e, t, r) {
1080
- if (lt.randomUUID && !t && !e)
1081
- return lt.randomUUID();
1084
+ function it(e, t, r) {
1085
+ if (st.randomUUID && !t && !e)
1086
+ return st.randomUUID();
1082
1087
  e = e || {};
1083
- var n = e.random || (e.rng || bn)();
1084
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, fn(n);
1088
+ var a = e.random || (e.rng || aa)();
1089
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ta(a);
1085
1090
  }
1086
- const ut = globalThis.crypto, En = (e) => `${dt()}${dt()}`.slice(0, e), Tn = (e) => btoa(
1091
+ const ct = globalThis.crypto, oa = (e) => `${it()}${it()}`.slice(0, e), sa = (e) => btoa(
1087
1092
  [...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
1088
1093
  );
1089
- async function vn(e) {
1090
- if (!ut.subtle)
1094
+ async function ia(e) {
1095
+ if (!ct.subtle)
1091
1096
  throw new Error(
1092
1097
  "crypto.subtle is available only in secure contexts (HTTPS)."
1093
1098
  );
1094
- const t = new TextEncoder().encode(e), r = await ut.subtle.digest("SHA-256", t);
1095
- return Tn(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1099
+ const t = new TextEncoder().encode(e), r = await ct.subtle.digest("SHA-256", t);
1100
+ return sa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1096
1101
  }
1097
- async function Sn(e) {
1098
- const t = En(43), r = await vn(t);
1102
+ async function ca(e) {
1103
+ const t = oa(43), r = await ia(t);
1099
1104
  return {
1100
1105
  code_verifier: t,
1101
1106
  code_challenge: r
1102
1107
  };
1103
1108
  }
1104
- function Bt(e, t) {
1109
+ function Lt(e, t) {
1105
1110
  window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
1106
1111
  }
1107
- const mt = (e, t) => {
1112
+ const lt = (e, t) => {
1108
1113
  const r = JSON.stringify(
1109
1114
  typeof t == "function" ? t() : t
1110
1115
  );
1111
- window.localStorage.setItem(e, r), Bt(e, r);
1112
- }, In = (e) => {
1113
- window.localStorage.removeItem(e), Bt(e, null);
1114
- }, ht = (e) => window.localStorage.getItem(e), An = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
1115
- function be({
1116
+ window.localStorage.setItem(e, r), Lt(e, r);
1117
+ }, la = (e) => {
1118
+ window.localStorage.removeItem(e), Lt(e, null);
1119
+ }, dt = (e) => window.localStorage.getItem(e), da = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
1120
+ function pe({
1116
1121
  key: e,
1117
1122
  initialValue: t
1118
1123
  }) {
1119
- const r = wr(An, () => ht(e)), n = q(
1124
+ const r = or(da, () => dt(e)), a = z(
1120
1125
  (s) => {
1121
1126
  try {
1122
1127
  const i = typeof s == "function" ? s(JSON.parse(r)) : s;
1123
- i == null ? In(e) : mt(e, i);
1128
+ i == null ? la(e) : lt(e, i);
1124
1129
  } catch (i) {
1125
1130
  console.warn(i);
1126
1131
  }
1127
1132
  },
1128
1133
  [e, r]
1129
- ), a = q(() => {
1130
- n(t);
1131
- }, [t, n]), o = q(() => {
1132
- n(null);
1133
- }, [n]);
1134
- return V(() => {
1134
+ ), n = z(() => {
1135
+ a(t);
1136
+ }, [t, a]), o = z(() => {
1137
+ a(null);
1138
+ }, [a]);
1139
+ return j(() => {
1135
1140
  try {
1136
- ht(e) === null && typeof t < "u" && mt(e, t);
1141
+ dt(e) === null && typeof t < "u" && lt(e, t);
1137
1142
  } catch (s) {
1138
1143
  console.warn(s);
1139
1144
  }
1140
- }, [e, t]), [r ? JSON.parse(r) : null, n, a, o];
1145
+ }, [e, t]), [r ? JSON.parse(r) : null, a, n, o];
1141
1146
  }
1142
1147
  var A = [];
1143
- for (var Je = 0; Je < 256; ++Je)
1144
- A.push((Je + 256).toString(16).slice(1));
1145
- function kn(e, t = 0) {
1148
+ for (var Ge = 0; Ge < 256; ++Ge)
1149
+ A.push((Ge + 256).toString(16).slice(1));
1150
+ function ua(e, t = 0) {
1146
1151
  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();
1147
1152
  }
1148
- var we, _n = new Uint8Array(16);
1149
- function Rn() {
1150
- if (!we && (we = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !we))
1153
+ var ge, ma = new Uint8Array(16);
1154
+ function ha() {
1155
+ if (!ge && (ge = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ge))
1151
1156
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1152
- return we(_n);
1157
+ return ge(ma);
1153
1158
  }
1154
- var Nn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1155
- const pt = {
1156
- randomUUID: Nn
1159
+ var pa = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1160
+ const ut = {
1161
+ randomUUID: pa
1157
1162
  };
1158
- function Ye(e, t, r) {
1159
- if (pt.randomUUID && !t && !e)
1160
- return pt.randomUUID();
1163
+ function We(e, t, r) {
1164
+ if (ut.randomUUID && !t && !e)
1165
+ return ut.randomUUID();
1161
1166
  e = e || {};
1162
- var n = e.random || (e.rng || Rn)();
1163
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, kn(n);
1167
+ var a = e.random || (e.rng || ha)();
1168
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ua(a);
1164
1169
  }
1165
- const ee = "Your session has expired. For your security, please log in again to continue.", xn = "Your session has been successfully terminated.", Ee = "Login failed. Please try again.", Cn = "Error getting access token, please re-authenticate.", On = "You forgot to wrap your component in <AuthProvider>.", Ne = {
1170
+ const X = "Your session has expired. For your security, please log in again to continue.", ga = "Your session has been successfully terminated.", Ve = "Login failed. Please try again.", fa = "Error getting access token, please re-authenticate.", ya = "You forgot to wrap your component in <AuthProvider>.", ve = {
1166
1171
  dev: "https://auth.gizmette.local.com:3003",
1167
1172
  prod: "https://mylogin.gizmette.com/auth"
1168
- }, Te = "@@auth@@", ce = "LOADING", le = "LOGIN", Wt = "LOGOUT", Pe = "success", U = "failure", Vt = "include", Ft = "POST", Jt = "application/json", ve = {
1173
+ }, fe = "@@auth@@", oe = "LOADING", we = "LOGIN", Mt = "LOGOUT", de = "success", M = "failure", Ut = "include", Ht = "POST", Kt = "application/json", ye = {
1169
1174
  GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
1170
1175
  $clientId: String!,
1171
1176
  $username: String!,
@@ -1227,14 +1232,14 @@ const ee = "Your session has expired. For your security, please log in again to
1227
1232
  $authentication: AuthenticationOptionsInput!,
1228
1233
  $nonce: String!,
1229
1234
  $domain: String,
1230
- $fingerprint: String) {
1235
+ $sessionExpiration: String) {
1231
1236
  verifyPasskeyAuthentication(
1232
1237
  clientId: $clientId,
1233
1238
  id: $id,
1234
1239
  authentication: $authentication,
1235
1240
  nonce: $nonce,
1236
1241
  domain: $domain,
1237
- fingerprint: $fingerprint) {
1242
+ sessionExpiration: $sessionExpiration) {
1238
1243
  status,
1239
1244
  idToken,
1240
1245
  accessToken,
@@ -1243,517 +1248,151 @@ const ee = "Your session has expired. For your security, please log in again to
1243
1248
  username,
1244
1249
  }
1245
1250
  }`
1246
- };
1247
- /*!
1248
- @versini/ui-fingerprint v1.0.1
1249
- © 2024 gizmette.com
1250
- */
1251
- try {
1252
- window.__VERSINI_UI_FINGERPRINT__ || (window.__VERSINI_UI_FINGERPRINT__ = {
1253
- version: "1.0.1",
1254
- buildTime: "07/18/2024 09:17 AM EDT",
1255
- homepage: "https://github.com/aversini/ui-components",
1256
- license: "MIT"
1257
- });
1258
- } catch {
1259
- }
1260
- const Pn = (e) => Array.from(e).map((t) => t.toString(16).padStart(2, "0")).join(""), Yt = async (e) => {
1261
- if (e === "")
1262
- return "";
1263
- const t = new TextEncoder().encode(e), r = await crypto.subtle.digest("SHA-256", t);
1264
- return Array.from(new Uint8Array(r)).map((n) => n.toString(16).padStart(2, "0")).join("");
1265
- };
1266
- function gt(e, t) {
1267
- return new Promise((r) => setTimeout(r, e, t));
1268
- }
1269
- async function Dn(e, t, r = 50) {
1270
- var n, a, o;
1271
- const s = document;
1272
- for (; !s.body; )
1273
- await gt(r);
1274
- const i = s.createElement("iframe");
1275
- try {
1276
- for (await new Promise((d, g) => {
1277
- let p = !1;
1278
- const h = () => {
1279
- p = !0, d();
1280
- }, u = (b) => {
1281
- p = !0, g(b);
1282
- };
1283
- i.onload = h, i.onerror = u;
1284
- const { style: c } = i;
1285
- c.setProperty("display", "block", "important"), c.position = "absolute", c.top = "0", c.left = "0", c.visibility = "hidden", i.src = "about:blank", s.body.appendChild(i);
1286
- const m = () => {
1287
- var b, w;
1288
- p || (((w = (b = i.contentWindow) == null ? void 0 : b.document) == null ? void 0 : w.readyState) === "complete" ? h() : setTimeout(m, 10));
1289
- };
1290
- m();
1291
- }); !((a = (n = i.contentWindow) == null ? void 0 : n.document) != null && a.body); )
1292
- await gt(r);
1293
- return await e(i, i.contentWindow);
1294
- } finally {
1295
- (o = i.parentNode) == null || o.removeChild(i);
1296
- }
1297
- }
1298
- const $n = {
1299
- audio: {
1300
- sampleHash: "",
1301
- oscillator: "",
1302
- maxChannels: 0,
1303
- channelCountMode: ""
1304
- }
1305
- }, Ln = async (e) => new Promise((t) => {
1306
- try {
1307
- const r = new window.OfflineAudioContext(1, 5e3, 44100), n = r.createBufferSource(), a = r.createOscillator();
1308
- a.frequency.value = 1e3;
1309
- const o = r.createDynamicsCompressor();
1310
- o.threshold.value = -50, o.knee.value = 40, o.ratio.value = 12, o.attack.value = 0, o.release.value = 0.2, a.connect(o), o.connect(r.destination), a.start(), r.startRendering(), r.oncomplete = (s) => {
1311
- const i = s.renderedBuffer.getChannelData(0);
1312
- a.disconnect(), o.disconnect(), t({
1313
- audio: {
1314
- sampleHash: Pn(i),
1315
- oscillator: a.type,
1316
- maxChannels: r.destination.maxChannelCount,
1317
- channelCountMode: n.channelCountMode
1318
- }
1319
- });
1320
- };
1321
- } catch {
1322
- t({
1323
- audio: {
1324
- sampleHash: "",
1325
- oscillator: "",
1326
- maxChannels: 0,
1327
- channelCountMode: ""
1328
- }
1329
- });
1330
- }
1331
- }), jt = { browser: "" }, Mn = async (e) => typeof navigator > "u" ? jt : { browser: navigator.userAgent }, zt = {
1332
- canvas: {
1333
- data: ""
1334
- }
1335
- }, Un = async (e) => {
1336
- try {
1337
- const t = Array.from(
1338
- { length: 3 },
1339
- () => Hn(300, 30)
1340
- ), r = Gn(t, 300, 30);
1341
- return {
1342
- canvas: {
1343
- data: (await Yt(r.data.toString())).toString()
1344
- }
1345
- };
1346
- } catch {
1347
- return zt;
1348
- }
1349
- }, Hn = (e, t) => {
1350
- const r = document.createElement("canvas"), n = r.getContext("2d");
1351
- if (!n)
1352
- return new ImageData(1, 1);
1353
- r.width = e, r.height = t;
1354
- const a = n.createLinearGradient(0, 0, r.width, r.height);
1355
- a.addColorStop(0, "red"), a.addColorStop(1 / 6, "orange"), a.addColorStop(2 / 6, "yellow"), a.addColorStop(3 / 6, "green"), a.addColorStop(4 / 6, "blue"), a.addColorStop(5 / 6, "indigo"), a.addColorStop(1, "violet"), n.fillStyle = a, n.fillRect(0, 0, r.width, r.height);
1356
- const o = "mmMwWLliI0O&1 - Les sanglots longs des violons de l'automne blessent mon coeur d'une langueur monotone";
1357
- return n.font = "26.321px Arial", n.fillStyle = "black", n.fillText(o, -5, 15), n.fillStyle = "rgba(0, 0, 255, 0.5)", n.fillText(o, -3.3, 17.7), n.beginPath(), n.moveTo(0, 0), n.lineTo(r.width * 2 / 7, r.height), n.strokeStyle = "white", n.lineWidth = 2, n.stroke(), n.getImageData(0, 0, r.width, r.height);
1358
- }, Kn = (e) => {
1359
- if (e.length === 0)
1360
- return 0;
1361
- const t = {};
1362
- for (const n of e)
1363
- t[n] = (t[n] || 0) + 1;
1364
- let r = e[0];
1365
- for (const n in t)
1366
- t[n] > t[r] && (r = parseInt(n, 10));
1367
- return r;
1368
- }, Gn = (e, t, r) => {
1369
- const n = [];
1370
- for (let s = 0; s < e[0].data.length; s++) {
1371
- const i = [];
1372
- for (let d = 0; d < e.length; d++)
1373
- i.push(e[d].data[s]);
1374
- n.push(Kn(i));
1375
- }
1376
- const a = n, o = new Uint8ClampedArray(a);
1377
- return new ImageData(o, t, r);
1378
- }, Bn = [], Wn = "mmMwWLliI0O&1", Vn = "48px", te = ["monospace", "sans-serif", "serif"], ft = [
1379
- "sans-serif-thin",
1380
- "ARNO PRO",
1381
- "Agency FB",
1382
- "Arabic Typesetting",
1383
- "Arial Unicode MS",
1384
- "AvantGarde Bk BT",
1385
- "BankGothic Md BT",
1386
- "Bitstream Vera Sans Mono",
1387
- "Calibri",
1388
- "Century",
1389
- "Century Gothic",
1390
- "Clarendon",
1391
- "EUROSTILE",
1392
- "Franklin Gothic",
1393
- "GOTHAM",
1394
- "Gill Sans",
1395
- "Helvetica Neue",
1396
- "Letter Gothic",
1397
- "Menlo",
1398
- "MS Outlook",
1399
- "MS Reference Specialty",
1400
- "MS UI Gothic",
1401
- "MT Extra",
1402
- "MYRIAD PRO",
1403
- "Marlett",
1404
- "Microsoft Uighur",
1405
- "Minion Pro",
1406
- "Monotype Corsiva",
1407
- "PMingLiU",
1408
- "Pristina",
1409
- "SCRIPTINA",
1410
- "SimHei",
1411
- "Small Fonts",
1412
- "Staccato222 BT",
1413
- "TRAJAN PRO",
1414
- "Univers CE 55 Medium",
1415
- "ZWAdobeF"
1416
- ], Fn = async (e) => Dn(async (t, { document: r }) => {
1417
- const n = r.body;
1418
- n.style.fontSize = Vn;
1419
- const a = r.createElement("div");
1420
- a.style.setProperty("visibility", "hidden", "important");
1421
- const o = {}, s = {}, i = (m) => {
1422
- const b = r.createElement("span"), { style: w } = b;
1423
- return w.position = "absolute", w.top = "0", w.left = "0", w.fontFamily = m, b.textContent = Wn, a.appendChild(b), b;
1424
- }, d = (m, b) => i(`'${m}',${b}`), g = () => te.map(i), p = () => {
1425
- const m = {};
1426
- for (const b of ft)
1427
- m[b] = te.map(
1428
- (w) => d(b, w)
1429
- );
1430
- return m;
1431
- }, h = (m) => te.some(
1432
- (b, w) => m[w].offsetWidth !== o[b] || m[w].offsetHeight !== s[b]
1433
- ), u = g(), c = p();
1434
- n.appendChild(a);
1435
- for (let m = 0; m < te.length; m++)
1436
- o[te[m]] = u[m].offsetWidth, s[te[m]] = u[m].offsetHeight;
1437
- return ft.filter((m) => h(c[m]));
1438
- }), qt = {
1439
- vendor: "",
1440
- vendorUnmasked: "",
1441
- renderer: "",
1442
- rendererUnmasked: "",
1443
- version: "",
1444
- shadingLanguageVersion: ""
1445
- }, Qt = {
1446
- hardware: {
1447
- videocard: qt,
1448
- architecture: 0,
1449
- deviceMemory: "undefined",
1450
- jsHeapSizeLimit: 0
1451
- }
1452
- };
1453
- function Jn() {
1454
- const e = document.createElement("canvas"), t = e.getContext("webgl") ?? e.getContext("experimental-webgl");
1455
- if (t && "getParameter" in t) {
1456
- const r = t.getExtension("WEBGL_debug_renderer_info");
1457
- return {
1458
- vendor: (t.getParameter(t.VENDOR) || "").toString(),
1459
- vendorUnmasked: r ? (t.getParameter(r.UNMASKED_VENDOR_WEBGL) || "").toString() : "",
1460
- renderer: (t.getParameter(t.RENDERER) || "").toString(),
1461
- rendererUnmasked: r ? (t.getParameter(r.UNMASKED_RENDERER_WEBGL) || "").toString() : "",
1462
- version: (t.getParameter(t.VERSION) || "").toString(),
1463
- shadingLanguageVersion: (t.getParameter(t.SHADING_LANGUAGE_VERSION) || "").toString()
1464
- };
1465
- }
1466
- return qt;
1467
- }
1468
- function Yn() {
1469
- const e = new Float32Array(1), t = new Uint8Array(e.buffer);
1470
- return e[0] = 1 / 0, e[0] = e[0] - e[0], t[3];
1471
- }
1472
- const jn = () => navigator.deviceMemory || 0, zn = () => window.performance && window.performance.memory || {
1473
- jsHeapSizeLimit: 0
1474
- }, qn = async (e) => new Promise((t) => {
1475
- try {
1476
- const r = jn(), n = zn();
1477
- t({
1478
- hardware: {
1479
- videocard: Jn(),
1480
- architecture: Yn(),
1481
- deviceMemory: r.toString() || "undefined",
1482
- jsHeapSizeLimit: n.jsHeapSizeLimit || 0
1483
- }
1484
- });
1485
- } catch {
1486
- t(Qt);
1487
- }
1488
- }), Qn = {
1489
- locales: {
1490
- languages: "",
1491
- timezone: ""
1492
- }
1493
- }, Xn = async (e) => new Promise((t) => {
1494
- t({
1495
- locales: {
1496
- languages: navigator.language,
1497
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
1498
- }
1499
- });
1500
- }), Xt = {
1501
- screen: {
1502
- colorDepth: 0,
1503
- pixelDepth: 0,
1504
- isTouchScreen: !1,
1505
- maxTouchPoints: 0,
1506
- mediaMatches: []
1507
- }
1508
- }, Zn = async (e) => new Promise((t) => {
1509
- try {
1510
- const r = window.screen, n = {
1511
- screen: {
1512
- colorDepth: r.colorDepth,
1513
- pixelDepth: r.pixelDepth,
1514
- isTouchScreen: navigator.maxTouchPoints > 0,
1515
- maxTouchPoints: navigator.maxTouchPoints,
1516
- mediaMatches: ea()
1517
- }
1518
- };
1519
- t(n);
1520
- } catch {
1521
- t(Xt);
1522
- }
1523
- });
1524
- function ea() {
1525
- const e = [], t = {
1526
- "prefers-contrast": [
1527
- "high",
1528
- "more",
1529
- "low",
1530
- "less",
1531
- "forced",
1532
- "no-preference"
1533
- ],
1534
- "any-hover": ["hover", "none"],
1535
- "any-pointer": ["none", "coarse", "fine"],
1536
- pointer: ["none", "coarse", "fine"],
1537
- hover: ["hover", "none"],
1538
- update: ["fast", "slow"],
1539
- "inverted-colors": ["inverted", "none"],
1540
- "prefers-reduced-motion": ["reduce", "no-preference"],
1541
- "prefers-reduced-transparency": ["reduce", "no-preference"],
1542
- scripting: ["none", "initial-only", "enabled"],
1543
- "forced-colors": ["active", "none"],
1544
- "color-gamut": ["srgb", "p3", "rec2020"]
1545
- };
1546
- return Object.keys(t).forEach((r) => {
1547
- t[r].forEach((n) => {
1548
- matchMedia(`(${r}: ${n})`).matches && e.push(`${r}: ${n}`);
1549
- });
1550
- }), e;
1551
- }
1552
- const ta = async (e) => {
1553
- try {
1554
- return {
1555
- system: {
1556
- platform: navigator.platform,
1557
- cookieEnabled: navigator.cookieEnabled,
1558
- productSub: navigator.productSub,
1559
- product: navigator.product
1560
- }
1561
- };
1562
- } catch {
1563
- return Zt;
1564
- }
1565
- }, Zt = {
1566
- system: {
1567
- platform: "",
1568
- cookieEnabled: !1,
1569
- productSub: "",
1570
- product: ""
1571
- }
1572
- }, ra = async (e) => {
1573
- try {
1574
- return Promise.all([
1575
- Ln(),
1576
- Mn(),
1577
- Un(),
1578
- Fn(),
1579
- qn(),
1580
- Xn(),
1581
- Zn(),
1582
- ta()
1583
- ]);
1584
- } catch {
1585
- return [
1586
- $n,
1587
- jt,
1588
- zt,
1589
- Bn,
1590
- Qt,
1591
- Qn,
1592
- Xt,
1593
- Zt
1594
- ];
1595
- }
1596
- }, na = async (e) => {
1597
- try {
1598
- const t = await ra();
1599
- return await Yt(JSON.stringify(t));
1600
- } catch {
1601
- return "";
1602
- }
1603
- }, re = {
1251
+ }, Z = {
1604
1252
  GET_REGISTRATION_OPTIONS: {
1605
- schema: ve.GET_REGISTRATION_OPTIONS,
1253
+ schema: ye.GET_REGISTRATION_OPTIONS,
1606
1254
  method: "getPasskeyRegistrationOptions"
1607
1255
  },
1608
1256
  VERIFY_REGISTRATION: {
1609
- schema: ve.VERIFY_REGISTRATION,
1257
+ schema: ye.VERIFY_REGISTRATION,
1610
1258
  method: "verifyPasskeyRegistration"
1611
1259
  },
1612
1260
  GET_AUTHENTICATION_OPTIONS: {
1613
- schema: ve.GET_AUTHENTICATION_OPTIONS,
1261
+ schema: ye.GET_AUTHENTICATION_OPTIONS,
1614
1262
  method: "getPasskeyAuthenticationOptions"
1615
1263
  },
1616
1264
  VERIFY_AUTHENTICATION: {
1617
- schema: ve.VERIFY_AUTHENTICATION,
1265
+ schema: ye.VERIFY_AUTHENTICATION,
1618
1266
  method: "verifyPasskeyAuthentication"
1619
1267
  }
1620
- }, ne = async ({
1268
+ }, ee = async ({
1621
1269
  accessToken: e,
1622
1270
  type: t,
1623
1271
  clientId: r,
1624
- params: n = {}
1272
+ params: a = {}
1625
1273
  }) => {
1626
1274
  try {
1627
- const a = n, o = `Bearer ${e}`, s = await fetch(
1628
- er ? `${Ne.dev}/graphql` : `${Ne.prod}/graphql`,
1275
+ const n = a, o = `Bearer ${e}`, s = await fetch(
1276
+ Bt ? `${ve.dev}/graphql` : `${ve.prod}/graphql`,
1629
1277
  {
1630
- credentials: Vt,
1631
- method: Ft,
1278
+ credentials: Ut,
1279
+ method: Ht,
1632
1280
  headers: {
1633
1281
  authorization: o,
1634
- "Content-Type": Jt,
1635
- [Ot.CLIENT_ID]: `${r}`
1282
+ "Content-Type": Kt,
1283
+ [kt.CLIENT_ID]: `${r}`
1636
1284
  },
1637
1285
  body: JSON.stringify({
1638
1286
  query: t.schema,
1639
- variables: a
1287
+ variables: n
1640
1288
  })
1641
1289
  }
1642
1290
  );
1643
1291
  if (s.status !== 200)
1644
- return { status: U, data: [] };
1292
+ return { status: M, data: [] };
1645
1293
  const { data: i } = await s.json();
1646
1294
  return {
1647
- status: Pe,
1295
+ status: de,
1648
1296
  data: i[t.method]
1649
1297
  };
1650
- } catch (a) {
1651
- return console.error(a), { status: U, data: [] };
1298
+ } catch (n) {
1299
+ return console.error(n), { status: M, data: [] };
1652
1300
  }
1653
- }, De = async ({
1301
+ }, xe = async ({
1654
1302
  type: e,
1655
1303
  clientId: t,
1656
1304
  params: r = {}
1657
1305
  }) => {
1658
1306
  try {
1659
- const n = await fetch(
1660
- er ? `${Ne.dev}/${e}` : `${Ne.prod}/${e}`,
1307
+ const a = await fetch(
1308
+ Bt ? `${ve.dev}/${e}` : `${ve.prod}/${e}`,
1661
1309
  {
1662
- credentials: Vt,
1663
- method: Ft,
1310
+ credentials: Ut,
1311
+ method: Ht,
1664
1312
  headers: {
1665
- "Content-Type": Jt,
1666
- [Ot.CLIENT_ID]: `${t}`
1313
+ "Content-Type": Kt,
1314
+ [kt.CLIENT_ID]: `${t}`
1667
1315
  },
1668
1316
  body: JSON.stringify(r)
1669
1317
  }
1670
1318
  );
1671
- if (n.status !== 200)
1672
- return { status: U, data: [] };
1673
- const { data: a } = await n.json();
1319
+ if (a.status !== 200)
1320
+ return { status: M, data: [] };
1321
+ const { data: n } = await a.json();
1674
1322
  return {
1675
- status: Pe,
1676
- data: a || []
1323
+ status: de,
1324
+ data: n || []
1677
1325
  };
1678
- } catch (n) {
1679
- return console.error(n), { status: U, data: [] };
1326
+ } catch (a) {
1327
+ return console.error(a), { status: M, data: [] };
1680
1328
  }
1681
- }, aa = process.env.NODE_ENV === "production", er = !aa, tr = {
1329
+ }, ba = process.env.NODE_ENV === "production", Bt = !ba, Gt = {
1682
1330
  isLoading: !0,
1683
1331
  isAuthenticated: !1,
1684
- authenticationType: null,
1685
1332
  user: void 0,
1686
1333
  logoutReason: "",
1687
1334
  debug: !1
1688
- }, oa = (e) => {
1335
+ }, Ea = (e) => {
1689
1336
  try {
1690
- const t = gn(e);
1691
- return t ? t[N.USER_ID_KEY] : "";
1337
+ const t = ea(e);
1338
+ return t ? t[R.USER_ID_KEY] : "";
1692
1339
  } catch {
1693
1340
  return "";
1694
1341
  }
1695
- }, sa = async ({
1342
+ }, wa = async ({
1696
1343
  userId: e,
1697
- idToken: t,
1698
- accessToken: r,
1699
- refreshToken: n,
1700
- clientId: a,
1701
- domain: o
1344
+ clientId: t,
1345
+ domain: r
1702
1346
  }) => {
1703
- var s;
1347
+ var a;
1704
1348
  try {
1705
1349
  return {
1706
- status: ((s = await De({
1707
- type: Ce.LOGOUT,
1708
- clientId: a,
1350
+ status: ((a = await xe({
1351
+ type: Re.LOGOUT,
1352
+ clientId: t,
1709
1353
  params: {
1710
1354
  userId: e,
1711
- idToken: t,
1712
- accessToken: r,
1713
- refreshToken: n,
1714
- domain: o
1355
+ domain: r
1715
1356
  }
1716
- })) == null ? void 0 : s.status) || U
1357
+ })) == null ? void 0 : a.status) || M
1717
1358
  };
1718
1359
  } catch {
1719
1360
  return {
1720
- status: U
1361
+ status: M
1721
1362
  };
1722
1363
  }
1723
- }, yt = async ({
1364
+ }, Ta = async ({
1724
1365
  username: e,
1725
1366
  password: t,
1726
1367
  clientId: r,
1727
- nonce: n,
1728
- type: a,
1368
+ nonce: a,
1369
+ type: n,
1729
1370
  sessionExpiration: o,
1730
1371
  code: s,
1731
1372
  code_verifier: i,
1732
- domain: d,
1733
- fingerprint: g
1373
+ domain: u
1734
1374
  }) => {
1735
1375
  var p;
1736
1376
  try {
1737
- const h = await De({
1738
- type: Ce.AUTHENTICATE,
1377
+ const h = await xe({
1378
+ type: Re.LOGIN,
1739
1379
  clientId: r,
1740
1380
  params: {
1741
- type: a || Q.ID_AND_ACCESS_TOKEN,
1381
+ type: n || _e.ID_AND_ACCESS_TOKEN,
1742
1382
  username: e,
1743
1383
  password: t,
1744
1384
  sessionExpiration: o,
1745
- nonce: n,
1385
+ nonce: a,
1746
1386
  code: s,
1747
1387
  code_verifier: i,
1748
- domain: d,
1749
- fingerprint: g
1388
+ domain: u
1750
1389
  }
1751
- }), u = await ue((p = h == null ? void 0 : h.data) == null ? void 0 : p.idToken);
1752
- return u && u.payload[N.USER_ID_KEY] !== "" && u.payload[N.NONCE_KEY] === n ? {
1390
+ }), m = await ie((p = h == null ? void 0 : h.data) == null ? void 0 : p.idToken);
1391
+ return m && m.payload[R.USER_ID_KEY] !== "" && m.payload[R.NONCE_KEY] === a ? {
1753
1392
  idToken: h.data.idToken,
1754
1393
  accessToken: h.data.accessToken,
1755
1394
  refreshToken: h.data.refreshToken,
1756
- userId: u.payload[N.USER_ID_KEY],
1395
+ userId: m.payload[R.USER_ID_KEY],
1757
1396
  status: !0
1758
1397
  } : {
1759
1398
  status: !1
@@ -1763,62 +1402,61 @@ const ta = async (e) => {
1763
1402
  status: !1
1764
1403
  };
1765
1404
  }
1766
- }, ia = async ({
1405
+ }, Ia = async ({
1767
1406
  nonce: e,
1768
1407
  clientId: t,
1769
1408
  code_challenge: r
1770
1409
  }) => {
1771
- var n;
1410
+ var a;
1772
1411
  try {
1773
- const a = await De({
1774
- type: Ce.CODE,
1412
+ const n = await xe({
1413
+ type: Re.CODE,
1775
1414
  clientId: t,
1776
1415
  params: {
1777
- type: Q.CODE,
1416
+ type: _e.CODE,
1778
1417
  nonce: e,
1779
1418
  code_challenge: r
1780
1419
  }
1781
1420
  });
1782
- return (n = a == null ? void 0 : a.data) != null && n.code ? {
1783
- status: Pe,
1784
- data: a.data.code
1421
+ return (a = n == null ? void 0 : n.data) != null && a.code ? {
1422
+ status: de,
1423
+ data: n.data.code
1785
1424
  } : {
1786
- status: U,
1425
+ status: M,
1787
1426
  data: ""
1788
1427
  };
1789
1428
  } catch {
1790
1429
  return {
1791
- status: U,
1430
+ status: M,
1792
1431
  data: ""
1793
1432
  };
1794
1433
  }
1795
- }, ca = async ({
1434
+ }, Sa = async ({
1796
1435
  clientId: e,
1797
1436
  userId: t,
1798
1437
  nonce: r,
1799
- refreshToken: n,
1800
- accessToken: a,
1438
+ refreshToken: a,
1439
+ accessToken: n,
1801
1440
  domain: o
1802
1441
  }) => {
1803
1442
  var s;
1804
1443
  try {
1805
- const i = await De({
1806
- type: Ce.AUTHENTICATE,
1444
+ const i = await xe({
1445
+ type: Re.REFRESH,
1807
1446
  clientId: e,
1808
1447
  params: {
1809
- type: Q.REFRESH_TOKEN,
1448
+ type: _e.REFRESH_TOKEN,
1810
1449
  userId: t,
1811
1450
  nonce: r,
1812
- refreshToken: n,
1813
- accessToken: a,
1814
- domain: o,
1815
- fingerprint: await rr()
1451
+ refreshToken: a,
1452
+ accessToken: n,
1453
+ domain: o
1816
1454
  }
1817
- }), d = await ue((s = i == null ? void 0 : i.data) == null ? void 0 : s.accessToken);
1818
- return d && d.payload[N.USER_ID_KEY] !== "" && d.payload[N.NONCE_KEY] === r ? {
1455
+ }), u = await ie((s = i == null ? void 0 : i.data) == null ? void 0 : s.accessToken);
1456
+ return u && u.payload[R.USER_ID_KEY] !== "" && u.payload[R.NONCE_KEY] === r ? {
1819
1457
  accessToken: i.data.accessToken,
1820
1458
  refreshToken: i.data.refreshToken,
1821
- userId: d.payload[N.USER_ID_KEY],
1459
+ userId: u.payload[R.USER_ID_KEY],
1822
1460
  status: !0
1823
1461
  } : {
1824
1462
  status: !1
@@ -1828,28 +1466,22 @@ const ta = async (e) => {
1828
1466
  status: !1
1829
1467
  };
1830
1468
  }
1831
- }, rr = async () => {
1832
- try {
1833
- return await na();
1834
- } catch {
1835
- return "";
1836
- }
1837
1469
  };
1838
- class la {
1470
+ class Aa {
1839
1471
  constructor(t = null, r = null) {
1840
- Ke(this, "refreshTokenPromise", null), Ke(this, "accessToken"), Ke(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1472
+ Le(this, "refreshTokenPromise", null), Le(this, "accessToken"), Le(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1841
1473
  }
1842
1474
  async refreshtoken({
1843
1475
  clientId: t,
1844
1476
  userId: r,
1845
- nonce: n,
1846
- domain: a
1477
+ nonce: a,
1478
+ domain: n
1847
1479
  }) {
1848
1480
  this.refreshTokenPromise || (this.refreshTokenPromise = this._refreshToken({
1849
1481
  clientId: t,
1850
1482
  userId: r,
1851
- nonce: n,
1852
- domain: a
1483
+ nonce: a,
1484
+ domain: n
1853
1485
  }));
1854
1486
  try {
1855
1487
  return await this.refreshTokenPromise;
@@ -1860,281 +1492,240 @@ class la {
1860
1492
  async _refreshToken({
1861
1493
  clientId: t,
1862
1494
  userId: r,
1863
- nonce: n,
1864
- domain: a
1495
+ nonce: a,
1496
+ domain: n
1865
1497
  }) {
1866
- const o = await ue(this.refreshToken);
1867
- if (o && o.payload[N.USER_ID_KEY] !== "") {
1868
- const s = await ca({
1498
+ const o = await ie(this.refreshToken);
1499
+ if (o && o.payload[R.USER_ID_KEY] !== "") {
1500
+ const s = await Sa({
1869
1501
  clientId: t,
1870
1502
  userId: r,
1871
- nonce: n,
1503
+ nonce: a,
1872
1504
  refreshToken: this.refreshToken,
1873
1505
  accessToken: this.accessToken,
1874
- domain: a
1506
+ domain: n
1875
1507
  });
1876
1508
  return s.status ? (this.accessToken = s.accessToken, this.refreshToken = s.refreshToken, {
1877
- status: Pe,
1509
+ status: de,
1878
1510
  newAccessToken: s.accessToken,
1879
1511
  newRefreshToken: s.refreshToken
1880
1512
  }) : {
1881
- status: U
1513
+ status: M
1882
1514
  };
1883
1515
  } else
1884
1516
  return {
1885
- status: U
1517
+ status: M
1886
1518
  };
1887
1519
  }
1888
1520
  }
1889
- const da = (e) => q(
1521
+ const va = (e) => z(
1890
1522
  (...t) => {
1891
1523
  e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
1892
1524
  },
1893
1525
  [e]
1894
- ), ae = () => {
1895
- throw new Error(On);
1896
- }, nr = br({
1526
+ ), te = () => {
1527
+ throw new Error(ya);
1528
+ }, Wt = nr({
1897
1529
  isAuthenticated: !1,
1898
1530
  isLoading: !1,
1899
- authenticationType: null,
1900
- login: ae,
1901
- logout: ae,
1902
- getAccessToken: ae,
1903
- getIdToken: ae,
1904
- registeringForPasskey: ae,
1905
- loginWithPasskey: ae,
1531
+ login: te,
1532
+ logout: te,
1533
+ getAccessToken: te,
1534
+ getIdToken: te,
1535
+ registeringForPasskey: te,
1536
+ loginWithPasskey: te,
1906
1537
  logoutReason: ""
1907
- }), ua = W.createContext({
1908
- state: tr,
1538
+ }), ka = V.createContext({
1539
+ state: Gt,
1909
1540
  dispatch: () => {
1910
1541
  }
1911
- }), ma = (e, t) => (t == null ? void 0 : t.type) === ce ? {
1542
+ }), _a = (e, t) => (t == null ? void 0 : t.type) === oe ? {
1912
1543
  ...e,
1913
1544
  isLoading: t.payload.isLoading
1914
- } : (t == null ? void 0 : t.type) === le ? {
1545
+ } : (t == null ? void 0 : t.type) === we ? {
1915
1546
  ...e,
1916
1547
  isLoading: !1,
1917
1548
  isAuthenticated: !0,
1918
1549
  user: t.payload.user,
1919
- authenticationType: t.payload.authenticationType,
1920
1550
  logoutReason: ""
1921
- } : (t == null ? void 0 : t.type) === Wt ? {
1551
+ } : (t == null ? void 0 : t.type) === Mt ? {
1922
1552
  ...e,
1923
1553
  isLoading: !1,
1924
1554
  isAuthenticated: !1,
1925
1555
  user: void 0,
1926
- authenticationType: null,
1927
1556
  logoutReason: t.payload.logoutReason
1928
- } : e, ha = ({
1557
+ } : e, Ra = ({
1929
1558
  children: e,
1930
1559
  sessionExpiration: t,
1931
1560
  clientId: r,
1932
- domain: n = "",
1933
- debug: a = !1
1561
+ domain: a = "",
1562
+ debug: n = !1
1934
1563
  }) => {
1935
- const [o, s] = vt(ma, {
1936
- ...tr,
1937
- debug: a
1938
- }), i = da(a), d = M(!1), g = M(""), [p, h, , u] = be({
1939
- key: `${Te}::${r}::@@user@@`
1940
- }), [c, m, , b] = be({
1941
- key: `${Te}::${r}::@@access@@`
1942
- }), [w, T, , D] = be(
1564
+ const [o, s] = ft(_a, {
1565
+ ...Gt,
1566
+ debug: n
1567
+ }), i = va(n), u = W(!1), [p, h, , m] = pe({
1568
+ key: `${fe}::${r}::@@user@@`
1569
+ }), [l, d, , f] = pe({
1570
+ key: `${fe}::${r}::@@access@@`
1571
+ }), [E, _, , w] = pe(
1943
1572
  {
1944
- key: `${Te}::${r}::@@refresh@@`
1573
+ key: `${fe}::${r}::@@refresh@@`
1945
1574
  }
1946
- ), [F, O, , Z] = be({
1947
- key: `${Te}::${r}::@@nonce@@`
1948
- }), J = new la(c, w), x = q(() => {
1949
- i("removeLocalStorage: removing local storage"), u(), b(), D(), Z();
1575
+ ), [U, H, , O] = pe({
1576
+ key: `${fe}::${r}::@@nonce@@`
1577
+ }), ae = new Aa(l, E), P = z(() => {
1578
+ i("removeLocalStorage: removing local storage"), m(), f(), w(), O();
1950
1579
  }, [
1951
- b,
1952
- u,
1953
- Z,
1954
- D,
1580
+ f,
1581
+ m,
1582
+ O,
1583
+ w,
1955
1584
  i
1956
- ]), P = q(
1585
+ ]), N = z(
1957
1586
  (y) => {
1958
1587
  i(
1959
1588
  "removeStateAndLocalStorage: removing state and local storage with reason: ",
1960
1589
  y
1961
1590
  ), s({
1962
- type: Wt,
1591
+ type: Mt,
1963
1592
  payload: {
1964
- logoutReason: y || ee
1593
+ logoutReason: y || X
1965
1594
  }
1966
- }), x(), s({ type: ce, payload: { isLoading: !1 } });
1595
+ }), P(), s({ type: oe, payload: { isLoading: !1 } });
1967
1596
  },
1968
- [x, i]
1969
- ), _ = q(
1597
+ [P, i]
1598
+ ), x = z(
1970
1599
  async (y) => {
1971
1600
  i("invalidateAndLogout: invalidating and logging out");
1972
- const { user: v } = o, E = (v == null ? void 0 : v.userId) || oa(p);
1973
- E || i(
1601
+ const { user: T } = o, b = (T == null ? void 0 : T.userId) || Ea(p);
1602
+ b || i(
1974
1603
  "invalidateAndLogout: user cannot be identified, logging out without userId"
1975
- ), await sa({
1976
- userId: E,
1977
- idToken: p,
1978
- accessToken: c,
1979
- refreshToken: w,
1604
+ ), await wa({
1605
+ userId: b,
1980
1606
  clientId: r,
1981
- domain: n
1982
- }), P(y || ee);
1607
+ domain: a
1608
+ }), N(y || X);
1983
1609
  },
1984
- [
1985
- c,
1986
- o,
1987
- r,
1988
- n,
1989
- p,
1990
- w,
1991
- P,
1992
- i
1993
- ]
1610
+ [p, o, r, a, N, i]
1994
1611
  );
1995
- V(() => ((async () => g.current = await rr())(), () => {
1996
- g.current = "";
1997
- }), []), V(() => {
1998
- if (!d.current)
1612
+ j(() => {
1613
+ if (!u.current)
1999
1614
  return o.isLoading && p !== null ? (async () => {
2000
1615
  try {
2001
- const y = await ue(p);
2002
- y && y.payload[N.USER_ID_KEY] !== "" ? (i("useEffect: setting the authentication state"), s({
2003
- type: le,
1616
+ const y = await ie(p);
1617
+ y && y.payload[R.USER_ID_KEY] !== "" ? (i("useEffect: setting the authentication state"), s({
1618
+ type: we,
2004
1619
  payload: {
2005
- authenticationType: y.payload[N.AUTH_TYPE_KEY],
2006
1620
  user: {
2007
- userId: y.payload[N.USER_ID_KEY],
2008
- username: y.payload[N.USERNAME_KEY]
1621
+ userId: y.payload[R.USER_ID_KEY],
1622
+ username: y.payload[R.USERNAME_KEY]
2009
1623
  }
2010
1624
  }
2011
- })) : (i("useEffect: invalid JWT, invalidating and logging out"), await _(ee));
1625
+ })) : (i("useEffect: invalid JWT, invalidating and logging out"), await x(X));
2012
1626
  } catch {
2013
1627
  i(
2014
1628
  "useEffect: exception validating JWT, invalidating and logging out"
2015
- ), await _(ee);
1629
+ ), await x(X);
2016
1630
  }
2017
- })() : (i("useEffect: setting the loading state to false"), s({ type: ce, payload: { isLoading: !1 } })), () => {
2018
- d.current = !0;
1631
+ })() : (i("useEffect: setting the loading state to false"), s({ type: oe, payload: { isLoading: !1 } })), () => {
1632
+ u.current = !0;
2019
1633
  };
2020
- }, [o.isLoading, p, _, i]);
2021
- const Me = async (y, v, E = Q.CODE) => {
2022
- s({ type: ce, payload: { isLoading: !0 } }), x();
2023
- const K = Ye();
2024
- if (O(K), i("login: Logging in with type: ", E), E === Q.CODE) {
2025
- const { code_verifier: fr, code_challenge: yr } = await Sn(), nt = await ia({
2026
- nonce: K,
1634
+ }, [o.isLoading, p, x, i]);
1635
+ const D = async (y, T) => {
1636
+ s({ type: oe, payload: { isLoading: !0 } }), P();
1637
+ const b = We();
1638
+ H(b), i("login: Logging in with password");
1639
+ const Q = _e.CODE, { code_verifier: rr, code_challenge: ar } = await ca(), et = await Ia({
1640
+ nonce: b,
1641
+ clientId: r,
1642
+ code_challenge: ar
1643
+ });
1644
+ if (et.status) {
1645
+ const ne = await Ta({
1646
+ username: y,
1647
+ password: T,
2027
1648
  clientId: r,
2028
- code_challenge: yr
1649
+ sessionExpiration: t,
1650
+ nonce: b,
1651
+ type: Q,
1652
+ code: et.data,
1653
+ code_verifier: rr,
1654
+ domain: a
2029
1655
  });
2030
- if (nt.status) {
2031
- const ie = await yt({
2032
- username: y,
2033
- password: v,
2034
- clientId: r,
2035
- sessionExpiration: t,
2036
- nonce: K,
2037
- type: E,
2038
- code: nt.data,
2039
- code_verifier: fr,
2040
- domain: n,
2041
- fingerprint: g.current
2042
- });
2043
- return ie.status ? (h(ie.idToken), m(ie.accessToken), T(ie.refreshToken), s({
2044
- type: le,
2045
- payload: {
2046
- authenticationType: E,
2047
- user: {
2048
- userId: ie.userId,
2049
- username: y
2050
- }
1656
+ return ne.status ? (h(ne.idToken), d(ne.accessToken), _(ne.refreshToken), s({
1657
+ type: we,
1658
+ payload: {
1659
+ user: {
1660
+ userId: ne.userId,
1661
+ username: y
2051
1662
  }
2052
- }), !0) : (P(Ee), !1);
2053
- }
2054
- return !1;
2055
- }
2056
- const se = await yt({
2057
- username: y,
2058
- password: v,
2059
- clientId: r,
2060
- sessionExpiration: t,
2061
- nonce: K,
2062
- type: E,
2063
- domain: n,
2064
- fingerprint: g.current
2065
- });
2066
- return se.status ? (h(se.idToken), m(se.accessToken), T(se.refreshToken), s({
2067
- type: le,
2068
- payload: {
2069
- authenticationType: E,
2070
- user: {
2071
- userId: se.userId,
2072
- username: y
2073
1663
  }
2074
- }
2075
- }), !0) : (P(Ee), !1);
2076
- }, Ue = async (y) => {
2077
- y == null || y.preventDefault(), await _(xn);
2078
- }, C = async () => {
2079
- const { isAuthenticated: y, user: v } = o;
1664
+ }), !0) : (N(Ve), !1);
1665
+ }
1666
+ return !1;
1667
+ }, Pe = async (y) => {
1668
+ y == null || y.preventDefault(), await x(ga);
1669
+ }, De = async () => {
1670
+ const { isAuthenticated: y, user: T } = o;
2080
1671
  try {
2081
- if (y && v && v.userId) {
2082
- if (c) {
1672
+ if (y && T && T.userId) {
1673
+ if (l) {
2083
1674
  i("getAccessToken");
2084
- const K = await ue(c);
2085
- if (K && K.payload[N.USER_ID_KEY] !== "")
2086
- return c;
1675
+ const Q = await ie(l);
1676
+ if (Q && Q.payload[R.USER_ID_KEY] !== "")
1677
+ return l;
2087
1678
  }
2088
1679
  i("getAccessToken: invalid access token, trying to refresh it");
2089
- const E = await J.refreshtoken({
1680
+ const b = await ae.refreshtoken({
2090
1681
  clientId: r,
2091
- userId: v.userId,
2092
- nonce: F,
2093
- domain: n
1682
+ userId: T.userId,
1683
+ nonce: U,
1684
+ domain: a
2094
1685
  });
2095
- return E.status && E.status === "success" && E.newAccessToken ? (m(E.newAccessToken), T(E.newRefreshToken), E.newAccessToken) : (i(
1686
+ return b.status && b.status === "success" && b.newAccessToken ? (d(b.newAccessToken), _(b.newRefreshToken), b.newAccessToken) : (i(
2096
1687
  "getAccessToken: invalid refresh token, need to re-authenticate"
2097
- ), await _(ee), "");
1688
+ ), await x(X), "");
2098
1689
  }
2099
1690
  return i(
2100
1691
  "getAccessToken: user is not authenticated, cannot get access token"
2101
- ), await _(ee), "";
1692
+ ), await x(X), "";
2102
1693
  } catch {
2103
1694
  return i(
2104
1695
  "getAccessToken: exception occurred, invalidating and logging out"
2105
- ), await _(Cn), "";
1696
+ ), await x(fa), "";
2106
1697
  }
2107
- }, H = () => o.isAuthenticated && p ? p : "", He = async () => {
1698
+ }, C = () => o.isAuthenticated && p ? p : "", K = async () => {
2108
1699
  const { user: y } = o;
2109
- let v = await ne({
2110
- accessToken: c,
1700
+ let T = await ee({
1701
+ accessToken: l,
2111
1702
  clientId: r,
2112
- type: re.GET_REGISTRATION_OPTIONS,
1703
+ type: Z.GET_REGISTRATION_OPTIONS,
2113
1704
  params: {
2114
1705
  clientId: r,
2115
1706
  id: y == null ? void 0 : y.userId,
2116
1707
  username: y == null ? void 0 : y.username
2117
1708
  }
2118
1709
  });
2119
- if (v.status)
1710
+ if (T.status)
2120
1711
  try {
2121
- const E = await kr(v.data);
2122
- return v = await ne({
2123
- accessToken: c,
1712
+ const b = await mr(T.data);
1713
+ return T = await ee({
1714
+ accessToken: l,
2124
1715
  clientId: r,
2125
- type: re.VERIFY_REGISTRATION,
1716
+ type: Z.VERIFY_REGISTRATION,
2126
1717
  params: {
2127
1718
  clientId: r,
2128
1719
  id: y == null ? void 0 : y.userId,
2129
1720
  username: y == null ? void 0 : y.username,
2130
- registration: E
1721
+ registration: b
2131
1722
  }
2132
- }), !!(v.status && v.data.length > 0);
1723
+ }), !!(T.status && T.data.length > 0);
2133
1724
  } catch {
2134
- return await ne({
2135
- accessToken: c,
1725
+ return await ee({
1726
+ accessToken: l,
2136
1727
  clientId: r,
2137
- type: re.VERIFY_REGISTRATION,
1728
+ type: Z.VERIFY_REGISTRATION,
2138
1729
  params: {
2139
1730
  clientId: r,
2140
1731
  id: y == null ? void 0 : y.userId,
@@ -2144,89 +1735,89 @@ const da = (e) => q(
2144
1735
  }), !1;
2145
1736
  }
2146
1737
  return !1;
2147
- }, pe = async () => {
2148
- s({ type: ce, payload: { isLoading: !0 } }), x();
2149
- const y = Ye();
2150
- O(y), i("loginWithPasskey");
2151
- const v = Ye();
2152
- let E = await ne({
2153
- accessToken: c,
1738
+ }, $e = async () => {
1739
+ s({ type: oe, payload: { isLoading: !0 } }), P();
1740
+ const y = We();
1741
+ H(y), i("loginWithPasskey");
1742
+ const T = We();
1743
+ let b = await ee({
1744
+ accessToken: l,
2154
1745
  clientId: r,
2155
- type: re.GET_AUTHENTICATION_OPTIONS,
1746
+ type: Z.GET_AUTHENTICATION_OPTIONS,
2156
1747
  params: {
2157
- id: v,
1748
+ id: T,
2158
1749
  clientId: r
2159
1750
  }
2160
1751
  });
2161
- if (E.status)
1752
+ if (b.status)
2162
1753
  try {
2163
- const K = await Nr(E.data);
2164
- return E = await ne({
2165
- accessToken: c,
1754
+ const Q = await gr(b.data);
1755
+ return b = await ee({
1756
+ accessToken: l,
2166
1757
  clientId: r,
2167
- type: re.VERIFY_AUTHENTICATION,
1758
+ type: Z.VERIFY_AUTHENTICATION,
2168
1759
  params: {
2169
1760
  clientId: r,
2170
- id: v,
2171
- authentication: K,
1761
+ id: T,
1762
+ authentication: Q,
2172
1763
  nonce: y,
2173
- domain: n,
2174
- fingerprint: g.current
1764
+ domain: a,
1765
+ sessionExpiration: t
2175
1766
  }
2176
- }), E.data.status === "success" ? (h(E.data.idToken), m(E.data.accessToken), T(E.data.refreshToken), s({
2177
- type: le,
1767
+ }), b.data.status === de ? (h(b.data.idToken), d(b.data.accessToken), _(b.data.refreshToken), s({
1768
+ type: we,
2178
1769
  payload: {
2179
- authenticationType: Q.PASSKEY,
2180
1770
  user: {
2181
- userId: E.data.userId,
2182
- username: E.data.username
1771
+ userId: b.data.userId,
1772
+ username: b.data.username
2183
1773
  }
2184
1774
  }
2185
- }), !0) : (P(Ee), !1);
1775
+ }), !0) : (N(Ve), !1);
2186
1776
  } catch {
2187
- return await ne({
2188
- accessToken: c,
1777
+ return await ee({
1778
+ accessToken: l,
2189
1779
  clientId: r,
2190
- type: re.VERIFY_AUTHENTICATION,
1780
+ type: Z.VERIFY_AUTHENTICATION,
2191
1781
  params: {
2192
1782
  clientId: r,
2193
- id: v,
1783
+ id: T,
2194
1784
  authentication: {},
2195
1785
  nonce: y,
2196
- domain: n
1786
+ domain: a,
1787
+ sessionExpiration: t
2197
1788
  }
2198
- }), P(Ee), !1;
1789
+ }), N(Ve), !1;
2199
1790
  }
2200
1791
  return !1;
2201
1792
  };
2202
- return /* @__PURE__ */ l(ua.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ l(
2203
- nr.Provider,
1793
+ return /* @__PURE__ */ c(ka.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ c(
1794
+ Wt.Provider,
2204
1795
  {
2205
1796
  value: {
2206
1797
  ...o,
2207
- login: Me,
2208
- logout: Ue,
2209
- getAccessToken: C,
2210
- getIdToken: H,
2211
- registeringForPasskey: He,
2212
- loginWithPasskey: pe
1798
+ login: D,
1799
+ logout: Pe,
1800
+ getAccessToken: De,
1801
+ getIdToken: C,
1802
+ registeringForPasskey: K,
1803
+ loginWithPasskey: $e
2213
1804
  },
2214
1805
  children: e
2215
1806
  }
2216
1807
  ) });
2217
- }, Ze = (e = nr) => St(e), Go = "user", Bo = "assistant", Wo = "system", Vo = "internal", Fo = "hidden", Jo = "I'm having trouble right now. Please try again later.", Yo = "gpt-4", jo = 128e3, zo = "action-message", qo = "action-reset", Qo = "action-model", Xo = "action-restore", Zo = "action-location", es = "action-streaming", ts = "action-search", rs = "action-sort", ns = "sassy-saint-", as = "details", os = "search", ss = "sort", is = "location", cs = "==stats==", pa = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", bt = (e) => Number.isFinite(e) ? e : 0;
2218
- function ga(e) {
1808
+ }, qe = (e = Wt) => yt(e), to = "user", ro = "assistant", ao = "system", no = "internal", oo = "hidden", so = "I'm having trouble right now. Please try again later.", io = "gpt-4", co = 128e3, lo = "action-message", uo = "action-reset", mo = "action-model", ho = "action-restore", po = "action-location", go = "action-streaming", fo = "action-search", yo = "action-sort", bo = "sassy-saint-", Eo = "details", wo = "search", To = "sort", Io = "location", So = "==stats==", Na = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", mt = (e) => Number.isFinite(e) ? e : 0;
1809
+ function xa(e) {
2219
1810
  return {
2220
1811
  days: Math.trunc(e / 864e5),
2221
1812
  hours: Math.trunc(e / 36e5 % 24),
2222
1813
  minutes: Math.trunc(e / 6e4 % 60),
2223
1814
  seconds: Math.trunc(e / 1e3 % 60),
2224
1815
  milliseconds: Math.trunc(e % 1e3),
2225
- microseconds: Math.trunc(bt(e * 1e3) % 1e3),
2226
- nanoseconds: Math.trunc(bt(e * 1e6) % 1e3)
1816
+ microseconds: Math.trunc(mt(e * 1e3) % 1e3),
1817
+ nanoseconds: Math.trunc(mt(e * 1e6) % 1e3)
2227
1818
  };
2228
1819
  }
2229
- function fa(e) {
1820
+ function Ca(e) {
2230
1821
  return {
2231
1822
  days: e / 86400000n,
2232
1823
  hours: e / 3600000n % 24n,
@@ -2237,81 +1828,81 @@ function fa(e) {
2237
1828
  nanoseconds: 0n
2238
1829
  };
2239
1830
  }
2240
- function ya(e) {
1831
+ function Oa(e) {
2241
1832
  switch (typeof e) {
2242
1833
  case "number": {
2243
1834
  if (Number.isFinite(e))
2244
- return ga(e);
1835
+ return xa(e);
2245
1836
  break;
2246
1837
  }
2247
1838
  case "bigint":
2248
- return fa(e);
1839
+ return Ca(e);
2249
1840
  }
2250
1841
  throw new TypeError("Expected a finite number or bigint");
2251
1842
  }
2252
- const ba = (e) => e === 0 || e === 0n, wa = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Ea = 1e-7, Ta = 24n * 60n * 60n * 1000n;
2253
- function va(e, t) {
1843
+ const Pa = (e) => e === 0 || e === 0n, Da = (e, t) => t === 1 || t === 1n ? e : `${e}s`, $a = 1e-7, La = 24n * 60n * 60n * 1000n;
1844
+ function Ma(e, t) {
2254
1845
  const r = typeof e == "bigint";
2255
1846
  if (!r && !Number.isFinite(e))
2256
1847
  throw new TypeError("Expected a finite number or bigint");
2257
1848
  t = { ...t };
2258
- const n = e < 0 ? "-" : "";
1849
+ const a = e < 0 ? "-" : "";
2259
1850
  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);
2260
- let a = [];
2261
- const o = (p, h) => {
2262
- const u = Math.floor(p * 10 ** h + Ea);
2263
- return (Math.round(u) / 10 ** h).toFixed(h);
2264
- }, s = (p, h, u, c) => {
2265
- if (!((a.length === 0 || !t.colonNotation) && ba(p) && !(t.colonNotation && u === "m"))) {
2266
- if (c ?? (c = String(p)), t.colonNotation) {
2267
- const m = c.includes(".") ? c.split(".")[0].length : c.length, b = a.length > 0 ? 2 : 1;
2268
- c = "0".repeat(Math.max(0, b - m)) + c;
1851
+ let n = [];
1852
+ const o = (h, m) => {
1853
+ const l = Math.floor(h * 10 ** m + $a);
1854
+ return (Math.round(l) / 10 ** m).toFixed(m);
1855
+ }, s = (h, m, l, d) => {
1856
+ if (!((n.length === 0 || !t.colonNotation) && Pa(h) && !(t.colonNotation && l === "m"))) {
1857
+ if (d ?? (d = String(h)), t.colonNotation) {
1858
+ const f = d.includes(".") ? d.split(".")[0].length : d.length, E = n.length > 0 ? 2 : 1;
1859
+ d = "0".repeat(Math.max(0, E - f)) + d;
2269
1860
  } else
2270
- c += t.verbose ? " " + wa(h, p) : u;
2271
- a.push(c);
1861
+ d += t.verbose ? " " + Da(m, h) : l;
1862
+ n.push(d);
2272
1863
  }
2273
- }, i = ya(e), d = BigInt(i.days);
2274
- if (s(d / 365n, "year", "y"), s(d % 365n, "day", "d"), s(Number(i.hours), "hour", "h"), s(Number(i.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
2275
- const p = Number(i.seconds), h = Number(i.milliseconds), u = Number(i.microseconds), c = Number(i.nanoseconds);
2276
- if (s(p, "second", "s"), t.formatSubMilliseconds)
2277
- s(h, "millisecond", "ms"), s(u, "microsecond", "µs"), s(c, "nanosecond", "ns");
1864
+ }, i = Oa(e), u = BigInt(i.days);
1865
+ if (s(u / 365n, "year", "y"), s(u % 365n, "day", "d"), s(Number(i.hours), "hour", "h"), s(Number(i.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
1866
+ const h = Number(i.seconds), m = Number(i.milliseconds), l = Number(i.microseconds), d = Number(i.nanoseconds);
1867
+ if (s(h, "second", "s"), t.formatSubMilliseconds)
1868
+ s(m, "millisecond", "ms"), s(l, "microsecond", "µs"), s(d, "nanosecond", "ns");
2278
1869
  else {
2279
- const m = h + u / 1e3 + c / 1e6, b = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, w = m >= 1 ? Math.round(m) : Math.ceil(m), T = b ? m.toFixed(b) : w;
1870
+ const f = m + l / 1e3 + d / 1e6, E = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, _ = f >= 1 ? Math.round(f) : Math.ceil(f), w = E ? f.toFixed(E) : _;
2280
1871
  s(
2281
- Number.parseFloat(T),
1872
+ Number.parseFloat(w),
2282
1873
  "millisecond",
2283
1874
  "ms",
2284
- T
1875
+ w
2285
1876
  );
2286
1877
  }
2287
1878
  } else {
2288
- const p = (r ? Number(e % Ta) : e) / 1e3 % 60, h = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, u = o(p, h), c = t.keepDecimalsOnWholeSeconds ? u : u.replace(/\.0+$/, "");
2289
- s(Number.parseFloat(c), "second", "s", c);
1879
+ const h = (r ? Number(e % La) : e) / 1e3 % 60, m = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, l = o(h, m), d = t.keepDecimalsOnWholeSeconds ? l : l.replace(/\.0+$/, "");
1880
+ s(Number.parseFloat(d), "second", "s", d);
2290
1881
  }
2291
- if (a.length === 0)
2292
- return n + "0" + (t.verbose ? " milliseconds" : "ms");
2293
- const g = t.colonNotation ? ":" : " ";
2294
- return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), n + a.join(g);
1882
+ if (n.length === 0)
1883
+ return a + "0" + (t.verbose ? " milliseconds" : "ms");
1884
+ const p = t.colonNotation ? ":" : " ";
1885
+ return typeof t.unitCount == "number" && (n = n.slice(0, Math.max(t.unitCount, 1))), a + n.join(p);
2295
1886
  }
2296
- const Sa = process.env.NODE_ENV === "production", et = !Sa, Ia = et ? "gizmette.local.com" : "gizmette.com", ls = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, ar = (e, t) => {
2297
- const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", n = 0 | Math.abs(e), a = 0 | Math.abs(e) * 60 % 60, o = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
1887
+ const Ua = process.env.NODE_ENV === "production", Qe = !Ua, Ha = Qe ? "gizmette.local.com" : "gizmette.com", Ao = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, Vt = (e, t) => {
1888
+ const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", a = 0 | Math.abs(e), n = 0 | Math.abs(e) * 60 % 60, o = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
2298
1889
  return {
2299
1890
  dir: r,
2300
- deg: n,
2301
- min: a,
1891
+ deg: a,
1892
+ min: n,
2302
1893
  sec: o
2303
1894
  };
2304
- }, ds = (e) => {
1895
+ }, vo = (e) => {
2305
1896
  if (!e && e !== 0)
2306
1897
  return "N/A";
2307
- const t = ar(e, !1);
1898
+ const t = Vt(e, !1);
2308
1899
  return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2309
- }, us = (e) => {
1900
+ }, ko = (e) => {
2310
1901
  if (!e && e !== 0)
2311
1902
  return "N/A";
2312
- const t = ar(e, !0);
1903
+ const t = Vt(e, !0);
2313
1904
  return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2314
- }, ms = async () => {
1905
+ }, _o = async () => {
2315
1906
  const e = {
2316
1907
  /**
2317
1908
  * A boolean value that indicates the application would
@@ -2345,49 +1936,49 @@ const Sa = process.env.NODE_ENV === "production", et = !Sa, Ia = et ? "gizmette.
2345
1936
  maximumAge: 6e4
2346
1937
  };
2347
1938
  return new Promise((t, r) => {
2348
- var n;
2349
- (n = navigator == null ? void 0 : navigator.geolocation) == null || n.getCurrentPosition(
2350
- (a) => {
1939
+ var a;
1940
+ (a = navigator == null ? void 0 : navigator.geolocation) == null || a.getCurrentPosition(
1941
+ (n) => {
2351
1942
  t({
2352
- latitude: a.coords.latitude,
2353
- longitude: a.coords.longitude,
2354
- accuracy: a.coords.accuracy
1943
+ latitude: n.coords.latitude,
1944
+ longitude: n.coords.longitude,
1945
+ accuracy: n.coords.accuracy
2355
1946
  });
2356
1947
  },
2357
- (a) => {
2358
- r(a);
1948
+ (n) => {
1949
+ r(n);
2359
1950
  },
2360
1951
  e
2361
1952
  );
2362
1953
  });
2363
- }, hs = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ l("dl", { className: "my-0", children: /* @__PURE__ */ S("div", { className: "flex items-center justify-between", children: [
2364
- /* @__PURE__ */ l("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
2365
- /* @__PURE__ */ l("dd", { className: "inline-block", children: t[r] })
1954
+ }, Ro = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ I("div", { className: "flex items-center justify-between", children: [
1955
+ /* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
1956
+ /* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
2366
1957
  ] }) }, `${e}-${r}`)) : null;
2367
- function ps({
1958
+ function No({
2368
1959
  data: e,
2369
1960
  formatter: t = (r) => r
2370
1961
  }) {
2371
1962
  const r = e.filter(
2372
- (a) => typeof a == "number" && a > 0
2373
- ), n = r.reduce(
2374
- (a, o) => (a || 0) + (o || 0),
1963
+ (n) => typeof n == "number" && n > 0
1964
+ ), a = r.reduce(
1965
+ (n, o) => (n || 0) + (o || 0),
2375
1966
  0
2376
1967
  );
2377
- return t(n ? n / r.length : 0);
1968
+ return t(a ? a / r.length : 0);
2378
1969
  }
2379
- const gs = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, fs = new Intl.NumberFormat("en", {
1970
+ const xo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Co = new Intl.NumberFormat("en", {
2380
1971
  style: "decimal",
2381
1972
  signDisplay: "never",
2382
1973
  minimumFractionDigits: 0,
2383
1974
  maximumFractionDigits: 0
2384
- }), ys = (e) => va(e, {
1975
+ }), Oo = (e) => e > 0 ? Ma(e, {
2385
1976
  secondsDecimalDigits: 2,
2386
1977
  unitCount: 2
2387
- }), Aa = (e) => f(
1978
+ }) : "N/A", Ka = (e) => g(
2388
1979
  "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",
2389
- e || et ? "pt-4" : "pt-10"
2390
- ), bs = (e, t) => t === 1 ? e : `${e}s`, $e = (e) => {
1980
+ e || Qe ? "pt-4" : "pt-10"
1981
+ ), Po = (e, t) => t === 1 ? e : `${e}s`, Ce = (e) => {
2391
1982
  let t = "";
2392
1983
  if (typeof e == "number" || typeof e == "string")
2393
1984
  t = "m-" + e;
@@ -2396,73 +1987,73 @@ const gs = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2396
1987
  (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(" ");
2397
1988
  }
2398
1989
  return t;
2399
- }, ws = "av-bubble", wt = "av-button", Ae = "av-card", ka = "av-footer", _a = "av-main", Es = "av-messagebox", Ts = "av-panel", vs = "av-spinner", or = "icon", sr = "button", Ra = "link", Na = ({
1990
+ }, Do = "av-bubble", ht = "av-button", Te = "av-card", Ba = "av-footer", Ga = "av-main", $o = "av-messagebox", Lo = "av-panel", Mo = "av-spinner", Jt = "icon", Ft = "button", Wa = "link", Va = ({
2400
1991
  type: e,
2401
1992
  size: t,
2402
1993
  labelRight: r,
2403
- labelLeft: n,
2404
- align: a
1994
+ labelLeft: a,
1995
+ align: n
2405
1996
  }) => {
2406
1997
  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";
2407
1998
  switch (e) {
2408
- case sr:
2409
- return f("px-4", {
1999
+ case Ft:
2000
+ return g("px-4", {
2410
2001
  [o]: t === "small",
2411
2002
  [s]: t === "medium",
2412
2003
  [i]: t === "large"
2413
2004
  });
2414
- case Ra:
2415
- return f("px-4 text-center", {
2005
+ case Wa:
2006
+ return g("px-4 text-center", {
2416
2007
  [o]: t === "small",
2417
2008
  [s]: t === "medium",
2418
2009
  [i]: t === "large"
2419
2010
  });
2420
- case or:
2421
- return f("inline-flex items-center", {
2422
- "justify-center": a === "center",
2423
- "justify-start": a === "left",
2424
- "justify-end": a === "right",
2425
- "h-6 w-6 p-0": t === "small" && !(r || n),
2426
- "h-6 px-4 text-sm font-medium": t === "small" && (r || n),
2427
- "h-8 w-8 p-1": t === "medium" && !(r || n),
2428
- "h-8 px-4 text-base font-medium": t === "medium" && (r || n),
2429
- "h-12 w-12 p-2": t === "large" && !(r || n),
2430
- "h-12 px-4 text-lg font-medium": t === "large" && (r || n)
2011
+ case Jt:
2012
+ return g("inline-flex items-center", {
2013
+ "justify-center": n === "center",
2014
+ "justify-start": n === "left",
2015
+ "justify-end": n === "right",
2016
+ "h-6 w-6 p-0": t === "small" && !(r || a),
2017
+ "h-6 px-4 text-sm font-medium": t === "small" && (r || a),
2018
+ "h-8 w-8 p-1": t === "medium" && !(r || a),
2019
+ "h-8 px-4 text-base font-medium": t === "medium" && (r || a),
2020
+ "h-12 w-12 p-2": t === "large" && !(r || a),
2021
+ "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
2431
2022
  });
2432
2023
  }
2433
- }, xa = ({
2024
+ }, Ja = ({
2434
2025
  mode: e,
2435
2026
  noBackground: t,
2436
2027
  noTruncate: r,
2437
- variant: n
2028
+ variant: a
2438
2029
  }) => {
2439
2030
  if (t)
2440
2031
  return "not-prose rounded-full";
2441
- if (n === "primary")
2442
- return f("not-prose rounded-full", {
2032
+ if (a === "primary")
2033
+ return g("not-prose rounded-full", {
2443
2034
  truncate: !r,
2444
2035
  "bg-action-dark text-copy-light": e === "dark",
2445
2036
  "bg-action-light text-copy-lighter": e === "light",
2446
2037
  "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "system",
2447
2038
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
2448
2039
  });
2449
- if (n === "secondary")
2450
- return f("not-prose rounded-full", {
2040
+ if (a === "secondary")
2041
+ return g("not-prose rounded-full", {
2451
2042
  truncate: !r,
2452
2043
  "bg-action-dark text-copy-light": e === "light",
2453
2044
  "bg-action-light text-copy-lighter": e === "dark",
2454
2045
  "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "alt-system",
2455
2046
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
2456
2047
  });
2457
- if (n === "danger")
2458
- return f("not-prose rounded-full", {
2048
+ if (a === "danger")
2049
+ return g("not-prose rounded-full", {
2459
2050
  truncate: !r,
2460
2051
  "bg-action-danger-dark text-copy-light": e === "dark",
2461
2052
  "bg-action-danger-light text-copy-lighter": e === "light",
2462
2053
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
2463
2054
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
2464
2055
  });
2465
- }, Ca = ({
2056
+ }, Fa = ({
2466
2057
  mode: e,
2467
2058
  disabled: t,
2468
2059
  variant: r
@@ -2470,27 +2061,27 @@ const gs = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2470
2061
  if (t)
2471
2062
  return "";
2472
2063
  if (r === "primary")
2473
- return f("hover:text-copy-light-hover", {
2064
+ return g("hover:text-copy-light-hover", {
2474
2065
  "hover:bg-action-dark-hover": e === "dark",
2475
2066
  "hover:bg-action-light-hover": e === "light",
2476
2067
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
2477
2068
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
2478
2069
  });
2479
2070
  if (r === "secondary")
2480
- return f("hover:text-copy-light-hover", {
2071
+ return g("hover:text-copy-light-hover", {
2481
2072
  "hover:bg-action-dark-hover": e === "light",
2482
2073
  "hover:bg-action-light-hover": e === "dark",
2483
2074
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
2484
2075
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
2485
2076
  });
2486
2077
  if (r === "danger")
2487
- return f("hover:text-copy-light-hover", {
2078
+ return g("hover:text-copy-light-hover", {
2488
2079
  "hover:bg-action-danger-dark-hover": e === "dark",
2489
2080
  "hover:bg-action-danger-light-hover": e === "light",
2490
2081
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
2491
2082
  "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
2492
2083
  });
2493
- }, Oa = ({
2084
+ }, Ya = ({
2494
2085
  mode: e,
2495
2086
  disabled: t,
2496
2087
  variant: r
@@ -2498,27 +2089,27 @@ const gs = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2498
2089
  if (t)
2499
2090
  return "";
2500
2091
  if (r === "primary")
2501
- return f("active:text-copy-light-active", {
2092
+ return g("active:text-copy-light-active", {
2502
2093
  "active:bg-action-dark-active": e === "dark",
2503
2094
  "active:bg-action-light-active": e === "light",
2504
2095
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
2505
2096
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
2506
2097
  });
2507
2098
  if (r === "secondary")
2508
- return f("active:text-copy-light-active", {
2099
+ return g("active:text-copy-light-active", {
2509
2100
  "active:bg-action-dark-active": e === "light",
2510
2101
  "active:bg-action-light-active": e === "dark",
2511
2102
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
2512
2103
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
2513
2104
  });
2514
2105
  if (r === "danger")
2515
- return f("active:text-copy-lighter-active", {
2106
+ return g("active:text-copy-lighter-active", {
2516
2107
  "active:bg-action-danger-dark-active": e === "dark",
2517
2108
  "active:bg-action-danger-light-active": e === "light",
2518
2109
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
2519
2110
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
2520
2111
  });
2521
- }, Pa = ({
2112
+ }, za = ({
2522
2113
  mode: e,
2523
2114
  noBorder: t,
2524
2115
  variant: r
@@ -2526,204 +2117,204 @@ const gs = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2526
2117
  if (t)
2527
2118
  return "border border-transparent";
2528
2119
  if (r === "primary")
2529
- return f("border", {
2120
+ return g("border", {
2530
2121
  "border-border-dark": e === "dark",
2531
2122
  "border-border-accent": e === "light",
2532
2123
  "border-border-dark dark:border-border-accent": e === "system",
2533
2124
  "border-border-accent dark:border-border-dark": e === "alt-system"
2534
2125
  });
2535
2126
  if (r === "secondary")
2536
- return f("border", {
2127
+ return g("border", {
2537
2128
  "border-border-dark": e === "light",
2538
2129
  "border-border-accent": e === "dark",
2539
2130
  "border-border-dark dark:border-border-accent": e === "alt-system",
2540
2131
  "border-border-accent dark:border-border-dark": e === "system"
2541
2132
  });
2542
2133
  if (r === "danger")
2543
- return f("border", {
2134
+ return g("border", {
2544
2135
  "border-border-danger-dark": e === "dark",
2545
2136
  "border-border-danger-medium": e === "light",
2546
2137
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
2547
2138
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
2548
2139
  });
2549
- }, Da = ({ focusMode: e }) => f("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2140
+ }, ja = ({ focusMode: e }) => g("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2550
2141
  "focus:outline-focus-dark": e === "dark",
2551
2142
  "focus:outline-focus-light": e === "light",
2552
2143
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
2553
2144
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
2554
- }), ir = ({
2145
+ }), Yt = ({
2555
2146
  type: e,
2556
2147
  className: t,
2557
2148
  raw: r,
2558
- mode: n,
2559
- focusMode: a,
2149
+ mode: a,
2150
+ focusMode: n,
2560
2151
  disabled: o,
2561
2152
  fullWidth: s,
2562
2153
  size: i,
2563
- noBorder: d,
2564
- labelRight: g,
2565
- labelLeft: p,
2566
- spacing: h,
2567
- noBackground: u,
2568
- variant: c,
2569
- noTruncate: m,
2570
- align: b
2571
- }) => (c || (c = "primary"), r ? f(wt, t) : f(
2572
- wt,
2154
+ noBorder: u,
2155
+ labelRight: p,
2156
+ labelLeft: h,
2157
+ spacing: m,
2158
+ noBackground: l,
2159
+ variant: d,
2160
+ noTruncate: f,
2161
+ align: E
2162
+ }) => (d || (d = "primary"), r ? g(ht, t) : g(
2163
+ ht,
2573
2164
  t,
2574
- $e(h),
2575
- xa({ mode: n, variant: c, noBackground: u, noTruncate: m }),
2576
- Na({ type: e, size: i, labelRight: g, labelLeft: p, align: b }),
2577
- Pa({ mode: n, variant: c, noBorder: d }),
2578
- Da({ focusMode: a }),
2579
- Ca({ mode: n, variant: c, disabled: o }),
2580
- Oa({ mode: n, variant: c, disabled: o }),
2165
+ Ce(m),
2166
+ Ja({ mode: a, variant: d, noBackground: l, noTruncate: f }),
2167
+ Va({ type: e, size: i, labelRight: p, labelLeft: h, align: E }),
2168
+ za({ mode: a, variant: d, noBorder: u }),
2169
+ ja({ focusMode: n }),
2170
+ Fa({ mode: a, variant: d, disabled: o }),
2171
+ Ya({ mode: a, variant: d, disabled: o }),
2581
2172
  {
2582
2173
  "w-full": s,
2583
2174
  "disabled:cursor-not-allowed disabled:opacity-50": o
2584
2175
  }
2585
- )), $a = (e, t, r) => {
2586
- var n;
2587
- !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((n = e == null ? void 0 : e.currentTarget) == null ? void 0 : n.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
2588
- }, tt = W.forwardRef(
2176
+ )), qa = (e, t, r) => {
2177
+ var a;
2178
+ !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);
2179
+ }, Xe = V.forwardRef(
2589
2180
  (e, t) => {
2590
- const { onClick: r, noInternalClick: n = !1, ...a } = e;
2591
- return /* @__PURE__ */ l(
2181
+ const { onClick: r, noInternalClick: a = !1, ...n } = e;
2182
+ return /* @__PURE__ */ c(
2592
2183
  "button",
2593
2184
  {
2594
2185
  ref: t,
2595
2186
  onClick: (o) => {
2596
- $a(o, n, r);
2187
+ qa(o, a, r);
2597
2188
  },
2598
- ...a
2189
+ ...n
2599
2190
  }
2600
2191
  );
2601
2192
  }
2602
2193
  );
2603
- tt.displayName = "BaseButton";
2604
- const qe = W.forwardRef(
2194
+ Xe.displayName = "BaseButton";
2195
+ const Ye = V.forwardRef(
2605
2196
  ({
2606
2197
  children: e,
2607
2198
  disabled: t = !1,
2608
2199
  mode: r = "system",
2609
- focusMode: n = "system",
2610
- fullWidth: a = !1,
2200
+ focusMode: a = "system",
2201
+ fullWidth: n = !1,
2611
2202
  className: o,
2612
2203
  type: s = "button",
2613
2204
  raw: i = !1,
2614
- noBorder: d = !1,
2615
- "aria-label": g,
2616
- label: p,
2617
- size: h = "medium",
2618
- labelRight: u,
2619
- labelLeft: c,
2620
- spacing: m,
2621
- noBackground: b = !1,
2622
- align: w = "center",
2623
- ...T
2624
- }, D) => {
2625
- const F = ir({
2626
- type: or,
2205
+ noBorder: u = !1,
2206
+ "aria-label": p,
2207
+ label: h,
2208
+ size: m = "medium",
2209
+ labelRight: l,
2210
+ labelLeft: d,
2211
+ spacing: f,
2212
+ noBackground: E = !1,
2213
+ align: _ = "center",
2214
+ ...w
2215
+ }, U) => {
2216
+ const H = Yt({
2217
+ type: Jt,
2627
2218
  mode: r,
2628
- focusMode: n,
2629
- fullWidth: a,
2219
+ focusMode: a,
2220
+ fullWidth: n,
2630
2221
  disabled: t,
2631
2222
  raw: i,
2632
2223
  className: o,
2633
- noBorder: d,
2634
- size: h,
2635
- labelRight: u,
2636
- labelLeft: c,
2637
- spacing: m,
2638
- noBackground: b,
2639
- align: w
2640
- }), O = f({
2224
+ noBorder: u,
2225
+ size: m,
2226
+ labelRight: l,
2227
+ labelLeft: d,
2228
+ spacing: f,
2229
+ noBackground: E,
2230
+ align: _
2231
+ }), O = g({
2641
2232
  "text-copy-accent-dark": r === "light" && !i,
2642
2233
  "text-copy-light": r === "dark" && !i,
2643
2234
  "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
2644
2235
  "text-copy-light dark:text-copy-accent-dark": r === "system" && !i
2645
2236
  });
2646
- return /* @__PURE__ */ S(
2647
- tt,
2237
+ return /* @__PURE__ */ I(
2238
+ Xe,
2648
2239
  {
2649
- ref: D,
2650
- className: F,
2240
+ ref: U,
2241
+ className: H,
2651
2242
  disabled: t,
2652
2243
  type: s,
2653
- "aria-label": g || p,
2654
- ...T,
2244
+ "aria-label": p || h,
2245
+ ...w,
2655
2246
  children: [
2656
- c && /* @__PURE__ */ l("span", { className: "pr-2", children: c }),
2657
- /* @__PURE__ */ l("div", { className: O, children: e }),
2658
- u && /* @__PURE__ */ l("span", { className: "pl-2", children: u })
2247
+ d && /* @__PURE__ */ c("span", { className: "pr-2", children: d }),
2248
+ /* @__PURE__ */ c("div", { className: O, children: e }),
2249
+ l && /* @__PURE__ */ c("span", { className: "pl-2", children: l })
2659
2250
  ]
2660
2251
  }
2661
2252
  );
2662
2253
  }
2663
2254
  );
2664
- qe.displayName = "ButtonIcon";
2665
- const cr = W.forwardRef(
2255
+ Ye.displayName = "ButtonIcon";
2256
+ const zt = V.forwardRef(
2666
2257
  ({
2667
2258
  children: e,
2668
2259
  disabled: t = !1,
2669
2260
  mode: r = "system",
2670
- focusMode: n = "system",
2671
- fullWidth: a = !1,
2261
+ focusMode: a = "system",
2262
+ fullWidth: n = !1,
2672
2263
  className: o,
2673
2264
  size: s = "medium",
2674
2265
  raw: i = !1,
2675
- noBorder: d = !1,
2676
- spacing: g,
2677
- variant: p = "primary",
2678
- noTruncate: h = !1,
2679
- ...u
2680
- }, c) => {
2681
- const m = ir({
2682
- type: sr,
2266
+ noBorder: u = !1,
2267
+ spacing: p,
2268
+ variant: h = "primary",
2269
+ noTruncate: m = !1,
2270
+ ...l
2271
+ }, d) => {
2272
+ const f = Yt({
2273
+ type: Ft,
2683
2274
  mode: r,
2684
- focusMode: n,
2685
- fullWidth: a,
2275
+ focusMode: a,
2276
+ fullWidth: n,
2686
2277
  disabled: t,
2687
2278
  raw: i,
2688
2279
  className: o,
2689
2280
  size: s,
2690
- noBorder: d,
2691
- spacing: g,
2692
- variant: p,
2693
- noTruncate: h
2281
+ noBorder: u,
2282
+ spacing: p,
2283
+ variant: h,
2284
+ noTruncate: m
2694
2285
  });
2695
- return /* @__PURE__ */ l(
2696
- tt,
2286
+ return /* @__PURE__ */ c(
2287
+ Xe,
2697
2288
  {
2698
- ref: c,
2699
- className: m,
2289
+ ref: d,
2290
+ className: f,
2700
2291
  disabled: t,
2701
- ...u,
2292
+ ...l,
2702
2293
  children: e
2703
2294
  }
2704
2295
  );
2705
2296
  }
2706
2297
  );
2707
- cr.displayName = "Button";
2708
- function La(e) {
2709
- const t = It();
2298
+ zt.displayName = "Button";
2299
+ function Qa(e) {
2300
+ const t = bt();
2710
2301
  return `${e}${t}`;
2711
2302
  }
2712
- const Ma = ({
2303
+ const Xa = ({
2713
2304
  className: e,
2714
2305
  headerClassName: t,
2715
2306
  bodyClassName: r,
2716
- footerClassName: n,
2717
- spacing: a,
2307
+ footerClassName: a,
2308
+ spacing: n,
2718
2309
  mode: o,
2719
2310
  compact: s,
2720
2311
  noBorder: i
2721
2312
  }) => {
2722
- const d = f(
2723
- Ae,
2313
+ const u = g(
2314
+ Te,
2724
2315
  e,
2725
2316
  "rounded-md",
2726
- $e(a),
2317
+ Ce(n),
2727
2318
  {
2728
2319
  "border-none": i,
2729
2320
  "border-2": !i,
@@ -2735,7 +2326,7 @@ const Ma = ({
2735
2326
  "border-border-dark bg-surface-lighter text-copy-dark dark:border-border-accent dark:bg-surface-dark dark:text-copy-light": o === "system",
2736
2327
  "border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": o === "alt-system"
2737
2328
  }
2738
- ), g = t || f(`${Ae}__header mt-0 border-b-2`, {
2329
+ ), p = t || g(`${Te}__header mt-0 border-b-2`, {
2739
2330
  "text-copy-light border-border-accent": o === "darker",
2740
2331
  "border-border-accent": o === "dark",
2741
2332
  "border-border-medium": o === "light",
@@ -2743,102 +2334,102 @@ const Ma = ({
2743
2334
  "border-border-accent dark:border-border-medium": o === "alt-system",
2744
2335
  "mb-4": !s,
2745
2336
  "mb-2": s
2746
- }), p = f(r), h = n || f(`${Ae}__footer pt-2`);
2337
+ }), h = g(r), m = a || g(`${Te}__footer pt-2`);
2747
2338
  return {
2748
- wrapper: d,
2749
- header: g,
2750
- body: p,
2751
- footer: h
2339
+ wrapper: u,
2340
+ header: p,
2341
+ body: h,
2342
+ footer: m
2752
2343
  };
2753
2344
  };
2754
- function Ua({
2345
+ function Za({
2755
2346
  id: e,
2756
2347
  content: t,
2757
2348
  userAriaLabelledby: r,
2758
- className: n
2349
+ className: a
2759
2350
  }) {
2760
- return typeof t == "string" ? /* @__PURE__ */ l("h2", { id: e, className: n, children: t }) : r ? /* @__PURE__ */ l("div", { className: n, children: t }) : t ? /* @__PURE__ */ l("div", { className: n, id: e, children: t }) : null;
2351
+ return typeof t == "string" ? /* @__PURE__ */ c("h2", { id: e, className: a, children: t }) : r ? /* @__PURE__ */ c("div", { className: a, children: t }) : t ? /* @__PURE__ */ c("div", { className: a, id: e, children: t }) : null;
2761
2352
  }
2762
- const Ha = ({
2353
+ const en = ({
2763
2354
  header: e,
2764
2355
  headerClassName: t,
2765
2356
  footer: r,
2766
- footerClassName: n,
2767
- children: a,
2357
+ footerClassName: a,
2358
+ children: n,
2768
2359
  className: o,
2769
2360
  bodyClassName: s,
2770
2361
  "aria-labelledby": i,
2771
- spacing: d,
2772
- mode: g = "system",
2773
- compact: p = !1,
2774
- noBorder: h = !1,
2775
- ...u
2362
+ spacing: u,
2363
+ mode: p = "system",
2364
+ compact: h = !1,
2365
+ noBorder: m = !1,
2366
+ ...l
2776
2367
  }) => {
2777
- let c = null, m = null;
2778
- const b = typeof e == "string", w = La(Ae), T = Ma({
2368
+ let d = null, f = null;
2369
+ const E = typeof e == "string", _ = Qa(Te), w = Xa({
2779
2370
  className: o,
2780
2371
  headerClassName: t,
2781
2372
  bodyClassName: s,
2782
- footerClassName: n,
2783
- spacing: d,
2784
- mode: g,
2785
- compact: p,
2786
- noBorder: h
2373
+ footerClassName: a,
2374
+ spacing: u,
2375
+ mode: p,
2376
+ compact: h,
2377
+ noBorder: m
2787
2378
  });
2788
- return b ? (c = w, m = c) : !b && e && i ? (c = null, m = i) : !b && e && !i ? (c = w, m = c) : (c = null, m = i || null), /* @__PURE__ */ l("div", { className: T.wrapper, children: /* @__PURE__ */ S(
2379
+ return E ? (d = _, f = d) : !E && e && i ? (d = null, f = i) : !E && e && !i ? (d = _, f = d) : (d = null, f = i || null), /* @__PURE__ */ c("div", { className: w.wrapper, children: /* @__PURE__ */ I(
2789
2380
  "section",
2790
2381
  {
2791
- ...m && {
2792
- "aria-labelledby": m
2382
+ ...f && {
2383
+ "aria-labelledby": f
2793
2384
  },
2794
- className: T.body,
2795
- ...u,
2385
+ className: w.body,
2386
+ ...l,
2796
2387
  children: [
2797
- /* @__PURE__ */ l(
2798
- Ua,
2388
+ /* @__PURE__ */ c(
2389
+ Za,
2799
2390
  {
2800
- ...c && { id: c },
2391
+ ...d && { id: d },
2801
2392
  content: e,
2802
- className: T.header,
2393
+ className: w.header,
2803
2394
  userAriaLabelledby: i
2804
2395
  }
2805
2396
  ),
2806
- /* @__PURE__ */ l("div", { children: a }),
2807
- r ? /* @__PURE__ */ l("div", { className: T.footer, children: r }) : null
2397
+ /* @__PURE__ */ c("div", { children: n }),
2398
+ r ? /* @__PURE__ */ c("div", { className: w.footer, children: r }) : null
2808
2399
  ]
2809
2400
  }
2810
2401
  ) });
2811
- }, Ka = ({
2402
+ }, tn = ({
2812
2403
  className: e,
2813
2404
  mode: t = "system",
2814
2405
  row1: r,
2815
- row2: n,
2816
- noMargins: a = !1,
2406
+ row2: a,
2407
+ noMargins: n = !1,
2817
2408
  spacing: o,
2818
2409
  raw: s = !1
2819
2410
  }) => {
2820
- const i = f(ka, e, $e(o), {
2411
+ const i = g(Ba, e, Ce(o), {
2821
2412
  "text-copy-dark": !s && t === "dark",
2822
2413
  "text-copy-lighter": !s && t === "light",
2823
2414
  "text-copy-dark dark:text-copy-lighter": !s && t === "system",
2824
2415
  "text-copy-lighter dark:text-copy-dark": !s && t === "alt-system",
2825
- "mb-[100px]": !a && !s,
2416
+ "mb-[100px]": !n && !s,
2826
2417
  "mt-0 flex w-full flex-col p-2 text-center text-xs sm:mt-3 md:mx-auto md:max-w-4xl": !s
2827
2418
  });
2828
- return /* @__PURE__ */ S("footer", { className: i, children: [
2829
- r && /* @__PURE__ */ l("div", { children: r }),
2830
- n && /* @__PURE__ */ l("div", { children: n })
2419
+ return /* @__PURE__ */ I("footer", { className: i, children: [
2420
+ r && /* @__PURE__ */ c("div", { children: r }),
2421
+ a && /* @__PURE__ */ c("div", { children: a })
2831
2422
  ] });
2832
- }, Ga = ({
2423
+ }, rn = ({
2833
2424
  children: e,
2834
2425
  className: t,
2835
2426
  raw: r = !1,
2836
- spacing: n
2427
+ spacing: a
2837
2428
  }) => {
2838
- const a = f(t, _a, $e(n), {
2429
+ const n = g(t, Ga, Ce(a), {
2839
2430
  "mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
2840
2431
  });
2841
- return /* @__PURE__ */ l("main", { className: a, children: e });
2432
+ return /* @__PURE__ */ c("main", { className: n, children: e });
2842
2433
  };
2843
2434
  /*!
2844
2435
  @versini/ui-components v5.21.1
@@ -2853,26 +2444,26 @@ try {
2853
2444
  });
2854
2445
  } catch {
2855
2446
  }
2856
- function Ba(e) {
2857
- return At(() => e.every((t) => t == null) ? () => {
2447
+ function an(e) {
2448
+ return Et(() => e.every((t) => t == null) ? () => {
2858
2449
  } : (t) => {
2859
2450
  e.forEach((r) => {
2860
2451
  typeof r == "function" ? r(t) : r != null && (r.current = t);
2861
2452
  });
2862
2453
  }, e);
2863
2454
  }
2864
- function Wa(e) {
2865
- const t = It();
2455
+ function nn(e) {
2456
+ const t = bt();
2866
2457
  if (!e)
2867
2458
  return t;
2868
2459
  if (typeof e == "number" || typeof e == "string")
2869
2460
  return `${e}${t}`;
2870
2461
  if (typeof e == "object") {
2871
- const { id: r, prefix: n = "" } = e;
2872
- return typeof r == "number" || typeof r == "string" ? `${n}${r}` : `${n}${t}`;
2462
+ const { id: r, prefix: a = "" } = e;
2463
+ return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
2873
2464
  }
2874
2465
  }
2875
- const lr = "SET_ANNOUNCEMENT", dr = "CLEAR_ANNOUNCEMENT", Va = {
2466
+ const jt = "SET_ANNOUNCEMENT", qt = "CLEAR_ANNOUNCEMENT", on = {
2876
2467
  alert: null,
2877
2468
  alertdialog: null,
2878
2469
  log: "polite",
@@ -2880,14 +2471,14 @@ const lr = "SET_ANNOUNCEMENT", dr = "CLEAR_ANNOUNCEMENT", Va = {
2880
2471
  progressbar: null,
2881
2472
  status: "polite",
2882
2473
  timer: "assertive"
2883
- }, Fa = (e, t) => {
2474
+ }, sn = (e, t) => {
2884
2475
  switch (t == null ? void 0 : t.type) {
2885
- case lr:
2476
+ case jt:
2886
2477
  return {
2887
2478
  ...e,
2888
2479
  announcement: t.payload
2889
2480
  };
2890
- case dr:
2481
+ case qt:
2891
2482
  return {
2892
2483
  ...e,
2893
2484
  announcement: null
@@ -2895,95 +2486,95 @@ const lr = "SET_ANNOUNCEMENT", dr = "CLEAR_ANNOUNCEMENT", Va = {
2895
2486
  default:
2896
2487
  return e;
2897
2488
  }
2898
- }, Ja = ({
2489
+ }, cn = ({
2899
2490
  onAnnouncementClear: e,
2900
2491
  dispatch: t
2901
2492
  }) => {
2902
2493
  t({
2903
- type: dr
2494
+ type: qt
2904
2495
  }), typeof e == "function" && e();
2905
- }, Et = ({
2496
+ }, pt = ({
2906
2497
  children: e,
2907
2498
  clearAnnouncementDelay: t,
2908
2499
  clearAnnouncementTimeoutRef: r,
2909
- onAnnouncementClear: n,
2910
- dispatch: a
2500
+ onAnnouncementClear: a,
2501
+ dispatch: n
2911
2502
  }) => {
2912
- (r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && a({
2913
- type: lr,
2503
+ (r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && n({
2504
+ type: jt,
2914
2505
  payload: e
2915
2506
  }), t && (r.current = setTimeout(
2916
- () => Ja({
2917
- onAnnouncementClear: n,
2918
- dispatch: a
2507
+ () => cn({
2508
+ onAnnouncementClear: a,
2509
+ dispatch: n
2919
2510
  }),
2920
2511
  t
2921
2512
  ));
2922
- }, Ya = ({
2513
+ }, ln = ({
2923
2514
  children: e,
2924
2515
  announcementTimeoutRef: t,
2925
2516
  announcementDelay: r,
2926
- clearAnnouncementDelay: n,
2927
- clearAnnouncementTimeoutRef: a,
2517
+ clearAnnouncementDelay: a,
2518
+ clearAnnouncementTimeoutRef: n,
2928
2519
  onAnnouncementClear: o,
2929
2520
  dispatch: s
2930
2521
  }) => {
2931
- clearTimeout(t.current), r ? t.current = setTimeout(Et, r, {
2522
+ clearTimeout(t.current), r ? t.current = setTimeout(pt, r, {
2932
2523
  children: e,
2933
- clearAnnouncementDelay: n,
2934
- clearAnnouncementTimeoutRef: a,
2524
+ clearAnnouncementDelay: a,
2525
+ clearAnnouncementTimeoutRef: n,
2935
2526
  onAnnouncementClear: o,
2936
2527
  dispatch: s
2937
- }) : Et({
2528
+ }) : pt({
2938
2529
  children: e,
2939
- clearAnnouncementDelay: n,
2940
- clearAnnouncementTimeoutRef: a,
2530
+ clearAnnouncementDelay: a,
2531
+ clearAnnouncementTimeoutRef: n,
2941
2532
  onAnnouncementClear: o,
2942
2533
  dispatch: s
2943
2534
  });
2944
2535
  };
2945
- function ur({
2536
+ function Qt({
2946
2537
  children: e,
2947
2538
  className: t,
2948
2539
  politeness: r,
2949
- role: n = null,
2950
- announcementDelay: a,
2540
+ role: a = null,
2541
+ announcementDelay: n,
2951
2542
  clearAnnouncementDelay: o,
2952
2543
  onAnnouncementClear: s,
2953
2544
  visible: i,
2954
- ...d
2545
+ ...u
2955
2546
  }) {
2956
- const g = M(), p = M(), [h, u] = vt(Fa, {
2547
+ const p = W(), h = W(), [m, l] = ft(sn, {
2957
2548
  announcement: null
2958
2549
  });
2959
- let c = r;
2960
- typeof c > "u" && (c = n ? Va[n] : "assertive"), V(() => {
2961
- Ya({
2962
- announcementTimeoutRef: g,
2963
- announcementDelay: a,
2550
+ let d = r;
2551
+ typeof d > "u" && (d = a ? on[a] : "assertive"), j(() => {
2552
+ ln({
2553
+ announcementTimeoutRef: p,
2554
+ announcementDelay: n,
2964
2555
  children: e,
2965
2556
  clearAnnouncementDelay: o,
2966
- clearAnnouncementTimeoutRef: p,
2557
+ clearAnnouncementTimeoutRef: h,
2967
2558
  onAnnouncementClear: s,
2968
- dispatch: u
2559
+ dispatch: l
2969
2560
  });
2970
2561
  }, [
2971
2562
  e,
2972
- a,
2563
+ n,
2973
2564
  o,
2974
2565
  s
2975
2566
  ]);
2976
- const m = f(t, {
2567
+ const f = g(t, {
2977
2568
  "sr-only": !i
2978
2569
  });
2979
- return /* @__PURE__ */ l(
2570
+ return /* @__PURE__ */ c(
2980
2571
  "div",
2981
2572
  {
2982
- "aria-live": c,
2983
- ...n && { role: n },
2984
- className: m,
2985
- ...d,
2986
- children: h.announcement
2573
+ "aria-live": d,
2574
+ ...a && { role: a },
2575
+ className: f,
2576
+ ...u,
2577
+ children: m.announcement
2987
2578
  }
2988
2579
  );
2989
2580
  }
@@ -3000,7 +2591,7 @@ try {
3000
2591
  });
3001
2592
  } catch {
3002
2593
  }
3003
- const ja = (e) => {
2594
+ const dn = (e) => {
3004
2595
  let t = "";
3005
2596
  if (typeof e == "number" || typeof e == "string")
3006
2597
  t = "m-" + e;
@@ -3009,14 +2600,14 @@ const ja = (e) => {
3009
2600
  (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(" ");
3010
2601
  }
3011
2602
  return t;
3012
- }, mr = "av-text-input", za = "av-text-input-wrapper", je = "av-text-input-helper-text", Ss = "av-text-area", Is = "av-text-area-wrapper", As = "av-text-area-helper-text", ks = "av-text-area__control--right", _s = "av-toggle";
3013
- function qa() {
3014
- const e = M(!1);
3015
- return V(() => (e.current = !0, () => {
2603
+ }, Xt = "av-text-input", un = "av-text-input-wrapper", Je = "av-text-input-helper-text", Uo = "av-text-area", Ho = "av-text-area-wrapper", Ko = "av-text-area-helper-text", Bo = "av-text-area__control--right", Go = "av-toggle";
2604
+ function mn() {
2605
+ const e = W(!1);
2606
+ return j(() => (e.current = !0, () => {
3016
2607
  e.current = !1;
3017
- }), []), q(() => e.current, []);
2608
+ }), []), z(() => e.current, []);
3018
2609
  }
3019
- const Qa = {
2610
+ const hn = {
3020
2611
  x: 0,
3021
2612
  y: 0,
3022
2613
  width: 0,
@@ -3026,312 +2617,312 @@ const Qa = {
3026
2617
  bottom: 0,
3027
2618
  right: 0
3028
2619
  };
3029
- function Xa(e) {
3030
- const t = qa(), r = M(0), n = M(null), [a, o] = j(Qa), s = At(
2620
+ function pn(e) {
2621
+ const t = mn(), r = W(0), a = W(null), [n, o] = F(hn), s = Et(
3031
2622
  () => typeof window < "u" ? new ResizeObserver((i) => {
3032
- const d = i[0];
3033
- d && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
3034
- n.current && t() && o(d.contentRect);
2623
+ const u = i[0];
2624
+ u && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
2625
+ a.current && t() && o(u.contentRect);
3035
2626
  }));
3036
2627
  }) : null,
3037
2628
  [t]
3038
2629
  );
3039
- return V(() => (n.current && (s == null || s.observe(n.current, e)), () => {
2630
+ return j(() => (a.current && (s == null || s.observe(a.current, e)), () => {
3040
2631
  s == null || s.disconnect(), r.current && cancelAnimationFrame(r.current);
3041
- }), [s, e]), [n, a];
2632
+ }), [s, e]), [a, n];
3042
2633
  }
3043
- const Za = ({
2634
+ const gn = ({
3044
2635
  mode: e
3045
- }) => f({
2636
+ }) => g({
3046
2637
  "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
3047
2638
  "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
3048
2639
  "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
3049
2640
  "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
3050
- }), eo = ({
2641
+ }), fn = ({
3051
2642
  focusMode: e
3052
- }) => f("focus:outline focus:outline-2 focus:outline-offset-2", {
2643
+ }) => g("focus:outline focus:outline-2 focus:outline-offset-2", {
3053
2644
  "focus:outline-focus-dark": e === "dark",
3054
2645
  "focus:outline-focus-light": e === "light",
3055
2646
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
3056
2647
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
3057
- }), to = ({
2648
+ }), yn = ({
3058
2649
  noBorder: e,
3059
2650
  error: t
3060
- }) => f("border-2", {
2651
+ }) => g("border-2", {
3061
2652
  "border-border-dark": !e && !t,
3062
2653
  "focus:border-border-dark": !e && t,
3063
2654
  "border-border-error-dark": !e && t,
3064
2655
  "border-transparent": e
3065
- }), ro = ({
2656
+ }), bn = ({
3066
2657
  disabled: e,
3067
2658
  raw: t,
3068
2659
  error: r,
3069
- mode: n
2660
+ mode: a
3070
2661
  }) => {
3071
2662
  if (t)
3072
2663
  return "";
3073
2664
  if (e)
3074
- return f("absolute px-2 cursor-not-allowed opacity-50 font-medium");
2665
+ return g("absolute px-2 cursor-not-allowed opacity-50 font-medium");
3075
2666
  if (!r)
3076
- return f("absolute px-2 cursor-text font-medium", {
3077
- "text-copy-lighter": n === "dark",
3078
- "text-copy-dark": n === "light",
3079
- "text-copy-dark dark:text-copy-lighter": n === "system",
3080
- "text-copy-lighter dark:text-copy-dark": n === "alt-system"
2667
+ return g("absolute px-2 cursor-text font-medium", {
2668
+ "text-copy-lighter": a === "dark",
2669
+ "text-copy-dark": a === "light",
2670
+ "text-copy-dark dark:text-copy-lighter": a === "system",
2671
+ "text-copy-lighter dark:text-copy-dark": a === "alt-system"
3081
2672
  });
3082
2673
  if (r)
3083
- return f("absolute px-2 cursor-text font-medium", {
3084
- "text-copy-lighter": n === "dark",
3085
- "text-copy-error-dark": n === "light",
3086
- "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": n === "system",
3087
- "text-copy-lighter dark:text-copy-error-dark": n === "alt-system"
2674
+ return g("absolute px-2 cursor-text font-medium", {
2675
+ "text-copy-lighter": a === "dark",
2676
+ "text-copy-error-dark": a === "light",
2677
+ "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
2678
+ "text-copy-lighter dark:text-copy-error-dark": a === "alt-system"
3088
2679
  });
3089
- }, no = ({
2680
+ }, En = ({
3090
2681
  error: e,
3091
2682
  raw: t,
3092
2683
  mode: r,
3093
- disabled: n
2684
+ disabled: a
3094
2685
  }) => {
3095
2686
  if (t)
3096
2687
  return "";
3097
- if (n)
3098
- return f(
3099
- je,
2688
+ if (a)
2689
+ return g(
2690
+ Je,
3100
2691
  "absolute px-2 cursor-not-allowed opacity-50 font-medium"
3101
2692
  );
3102
2693
  if (!e)
3103
- return f(je, "absolute px-2 font-medium", {
2694
+ return g(Je, "absolute px-2 font-medium", {
3104
2695
  "text-copy-lighter": r === "dark",
3105
2696
  "text-copy-dark": r === "light",
3106
2697
  "text-copy-dark dark:text-copy-lighter": r === "system",
3107
2698
  "text-copy-lighter dark:text-copy-dark": r === "alt-system"
3108
2699
  });
3109
2700
  if (e)
3110
- return f(je, "absolute px-2 font-medium", {
2701
+ return g(Je, "absolute px-2 font-medium", {
3111
2702
  "text-copy-error-light bg-surface-darker": r === "dark",
3112
2703
  "text-copy-error-dark": r === "light",
3113
2704
  "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
3114
2705
  "dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
3115
2706
  });
3116
- }, ao = ({
2707
+ }, wn = ({
3117
2708
  className: e,
3118
2709
  inputClassName: t,
3119
2710
  raw: r,
3120
- disabled: n,
3121
- noBorder: a,
2711
+ disabled: a,
2712
+ noBorder: n,
3122
2713
  error: o,
3123
2714
  spacing: s,
3124
2715
  mode: i,
3125
- focusMode: d
2716
+ focusMode: u
3126
2717
  }) => {
3127
- const g = r ? e : f(
2718
+ const p = r ? e : g(
3128
2719
  "relative flex w-full flex-col justify-center",
3129
- za,
2720
+ un,
3130
2721
  e,
3131
- ja(s)
3132
- ), p = r ? f(t) : f(
3133
- mr,
2722
+ dn(s)
2723
+ ), h = r ? g(t) : g(
2724
+ Xt,
3134
2725
  t,
3135
2726
  "h-12 rounded-md px-4 text-base",
3136
- Za({ mode: i }),
3137
- eo({ focusMode: d }),
3138
- to({ noBorder: a, error: o }),
2727
+ gn({ mode: i }),
2728
+ fn({ focusMode: u }),
2729
+ yn({ noBorder: n, error: o }),
3139
2730
  {
3140
- "disabled:cursor-not-allowed disabled:opacity-50": n
2731
+ "disabled:cursor-not-allowed disabled:opacity-50": a
3141
2732
  }
3142
- ), h = r ? void 0 : "sr-only", u = ro({
3143
- disabled: n,
2733
+ ), m = r ? void 0 : "sr-only", l = bn({
2734
+ disabled: a,
3144
2735
  raw: r,
3145
2736
  error: o,
3146
2737
  mode: i
3147
- }), c = no({
2738
+ }), d = En({
3148
2739
  error: o,
3149
2740
  raw: r,
3150
2741
  mode: i,
3151
- disabled: n
2742
+ disabled: a
3152
2743
  });
3153
2744
  return {
3154
- wrapper: g,
3155
- input: p,
3156
- accessibleLabel: h,
3157
- visibleLabel: u,
3158
- helperText: c,
2745
+ wrapper: p,
2746
+ input: h,
2747
+ accessibleLabel: m,
2748
+ visibleLabel: l,
2749
+ helperText: d,
3159
2750
  rightElement: r ? void 0 : "absolute right-3"
3160
2751
  };
3161
- }, rt = W.forwardRef(
2752
+ }, Ze = V.forwardRef(
3162
2753
  ({
3163
2754
  id: e,
3164
2755
  name: t,
3165
2756
  label: r,
3166
- error: n = !1,
3167
- raw: a = !1,
2757
+ error: a = !1,
2758
+ raw: n = !1,
3168
2759
  className: o,
3169
2760
  inputClassName: s,
3170
2761
  mode: i = "system",
3171
- focusMode: d = "system",
3172
- disabled: g = !1,
3173
- noBorder: p = !1,
3174
- labelId: h,
3175
- labelHidden: u = !1,
3176
- type: c = "text",
3177
- helperText: m = "",
3178
- rightElement: b,
3179
- spacing: w,
3180
- ...T
3181
- }, D) => {
3182
- const [F, O] = Xa(), [Z, J] = j(0), x = Wa({ id: e, prefix: `${mr}-` }), P = `${t} error, ${m}`, _ = ao({
2762
+ focusMode: u = "system",
2763
+ disabled: p = !1,
2764
+ noBorder: h = !1,
2765
+ labelId: m,
2766
+ labelHidden: l = !1,
2767
+ type: d = "text",
2768
+ helperText: f = "",
2769
+ rightElement: E,
2770
+ spacing: _,
2771
+ ...w
2772
+ }, U) => {
2773
+ const [H, O] = pn(), [ae, P] = F(0), N = nn({ id: e, prefix: `${Xt}-` }), x = `${t} error, ${f}`, D = wn({
3183
2774
  className: o,
3184
2775
  inputClassName: s,
3185
- error: n,
3186
- raw: a,
3187
- focusMode: d,
3188
- disabled: g,
3189
- noBorder: p,
3190
- spacing: w,
2776
+ error: a,
2777
+ raw: n,
2778
+ focusMode: u,
2779
+ disabled: p,
2780
+ noBorder: h,
2781
+ spacing: _,
3191
2782
  mode: i
3192
2783
  });
3193
- return Er(() => {
3194
- O && O.width && J(O.width + 18 + 10);
3195
- }, [O]), /* @__PURE__ */ S("div", { className: _.wrapper, children: [
3196
- /* @__PURE__ */ l(
2784
+ return sr(() => {
2785
+ O && O.width && P(O.width + 18 + 10);
2786
+ }, [O]), /* @__PURE__ */ I("div", { className: D.wrapper, children: [
2787
+ /* @__PURE__ */ c(
3197
2788
  "label",
3198
2789
  {
3199
- htmlFor: x,
3200
- id: h,
3201
- className: _.accessibleLabel,
2790
+ htmlFor: N,
2791
+ id: m,
2792
+ className: D.accessibleLabel,
3202
2793
  children: r
3203
2794
  }
3204
2795
  ),
3205
- /* @__PURE__ */ l(
2796
+ /* @__PURE__ */ c(
3206
2797
  "input",
3207
2798
  {
3208
- ref: D,
3209
- id: x,
2799
+ ref: U,
2800
+ id: N,
3210
2801
  name: t,
3211
- type: c,
3212
- disabled: g,
3213
- placeholder: a ? void 0 : " ",
3214
- className: _.input,
3215
- ...m && { "aria-describedby": `${x}-helper` },
3216
- ...n && { "aria-invalid": "true" },
3217
- ...b && !a && { style: { paddingRight: Z } },
3218
- ...T
2802
+ type: d,
2803
+ disabled: p,
2804
+ placeholder: n ? void 0 : " ",
2805
+ className: D.input,
2806
+ ...f && { "aria-describedby": `${N}-helper` },
2807
+ ...a && { "aria-invalid": "true" },
2808
+ ...E && !n && { style: { paddingRight: ae } },
2809
+ ...w
3219
2810
  }
3220
2811
  ),
3221
- !a && !u && /* @__PURE__ */ l(
2812
+ !n && !l && /* @__PURE__ */ c(
3222
2813
  "label",
3223
2814
  {
3224
2815
  "aria-hidden": !0,
3225
- htmlFor: x,
3226
- className: _.visibleLabel,
2816
+ htmlFor: N,
2817
+ className: D.visibleLabel,
3227
2818
  children: r
3228
2819
  }
3229
2820
  ),
3230
- m && /* @__PURE__ */ l(
2821
+ f && /* @__PURE__ */ c(
3231
2822
  "div",
3232
2823
  {
3233
- id: `${x}-helper`,
3234
- className: _.helperText,
3235
- children: m
2824
+ id: `${N}-helper`,
2825
+ className: D.helperText,
2826
+ children: f
3236
2827
  }
3237
2828
  ),
3238
- b && /* @__PURE__ */ l(
2829
+ E && /* @__PURE__ */ c(
3239
2830
  "div",
3240
2831
  {
3241
- ref: F,
3242
- className: _.rightElement,
3243
- children: b
2832
+ ref: H,
2833
+ className: D.rightElement,
2834
+ children: E
3244
2835
  }
3245
2836
  ),
3246
- n && m && /* @__PURE__ */ l(ur, { politeness: "polite", clearAnnouncementDelay: 500, children: P })
2837
+ a && f && /* @__PURE__ */ c(Qt, { politeness: "polite", clearAnnouncementDelay: 500, children: x })
3247
2838
  ] });
3248
2839
  }
3249
2840
  );
3250
- rt.displayName = "TextInput";
3251
- const oo = 500, so = 5e3, io = 2e4, hr = W.forwardRef(
2841
+ Ze.displayName = "TextInput";
2842
+ const Tn = 500, In = 5e3, Sn = 2e4, Zt = V.forwardRef(
3252
2843
  ({
3253
2844
  name: e,
3254
2845
  disabled: t,
3255
2846
  label: r,
3256
- labelHidden: n,
3257
- onMaskChange: a,
2847
+ labelHidden: a,
2848
+ onMaskChange: n,
3258
2849
  onChange: o,
3259
2850
  onBlur: s,
3260
2851
  onFocus: i,
3261
- onTextInputMaskBlur: d,
3262
- rightElement: g,
3263
- spacing: p,
3264
- ...h
3265
- }, u) => {
3266
- const [c, m] = j(!0), [b, w] = j({
2852
+ onTextInputMaskBlur: u,
2853
+ rightElement: p,
2854
+ spacing: h,
2855
+ ...m
2856
+ }, l) => {
2857
+ const [d, f] = F(!0), [E, _] = F({
3267
2858
  message: null,
3268
2859
  politeness: null
3269
- }), T = M(!0), D = M(), F = M(null), O = Ba([u, F]), Z = c ? "Show" : "Hide", J = () => {
3270
- clearTimeout(D.current), T.current || (D.current = window.setTimeout(() => {
3271
- T.current = !0, m(!0), w({
3272
- announcementTimeout: so,
2860
+ }), w = W(!0), U = W(), H = W(null), O = an([l, H]), ae = d ? "Show" : "Hide", P = () => {
2861
+ clearTimeout(U.current), w.current || (U.current = window.setTimeout(() => {
2862
+ w.current = !0, f(!0), _({
2863
+ announcementTimeout: In,
3273
2864
  politeness: "polite",
3274
2865
  message: `${r} hiding characters`
3275
- }), a && a(!0);
3276
- }, io));
3277
- }, x = (C) => {
2866
+ }), n && n(!0);
2867
+ }, Sn));
2868
+ }, N = (C) => {
3278
2869
  C.preventDefault();
3279
- const H = !T.current;
3280
- T.current = H, J(), m(H), w({
3281
- announcementTimeout: oo,
2870
+ const K = !w.current;
2871
+ w.current = K, P(), f(K), _({
2872
+ announcementTimeout: Tn,
3282
2873
  politeness: "assertive",
3283
- message: H ? "Characters hidden" : "Characters showing"
3284
- }), a && a(H);
3285
- }, P = (C) => {
3286
- var H;
3287
- const { relatedTarget: He } = C, pe = (H = F.current) == null ? void 0 : H.parentElement;
3288
- pe != null && pe.contains(He) || d && d();
3289
- }, _ = (C) => {
3290
- J(), s && s(C), P(C);
3291
- }, Me = (C) => {
3292
- J(), i && i(C);
3293
- }, Ue = (C) => {
3294
- J(), o && o(C);
2874
+ message: K ? "Characters hidden" : "Characters showing"
2875
+ }), n && n(K);
2876
+ }, x = (C) => {
2877
+ var K;
2878
+ const { relatedTarget: $e } = C, y = (K = H.current) == null ? void 0 : K.parentElement;
2879
+ y != null && y.contains($e) || u && u();
2880
+ }, D = (C) => {
2881
+ P(), s && s(C), x(C);
2882
+ }, Pe = (C) => {
2883
+ P(), i && i(C);
2884
+ }, De = (C) => {
2885
+ P(), o && o(C);
3295
2886
  };
3296
- return V(() => () => {
3297
- clearTimeout(D.current);
3298
- }, []), /* @__PURE__ */ S(me, { children: [
3299
- /* @__PURE__ */ l(
3300
- rt,
2887
+ return j(() => () => {
2888
+ clearTimeout(U.current);
2889
+ }, []), /* @__PURE__ */ I(ce, { children: [
2890
+ /* @__PURE__ */ c(
2891
+ Ze,
3301
2892
  {
3302
2893
  ref: O,
3303
2894
  name: e,
3304
2895
  label: r,
3305
- labelHidden: n,
3306
- type: c ? "password" : "text",
2896
+ labelHidden: a,
2897
+ type: d ? "password" : "text",
3307
2898
  disabled: t,
3308
- spacing: p,
3309
- onBlur: _,
3310
- onFocus: Me,
3311
- onChange: Ue,
3312
- rightElement: W.cloneElement(g, {
3313
- ref: u,
3314
- label: Z,
3315
- onClick: x,
3316
- onBlur: P,
2899
+ spacing: h,
2900
+ onBlur: D,
2901
+ onFocus: Pe,
2902
+ onChange: De,
2903
+ rightElement: V.cloneElement(p, {
2904
+ ref: l,
2905
+ label: ae,
2906
+ onClick: N,
2907
+ onBlur: x,
3317
2908
  disabled: t
3318
2909
  }),
3319
- ...h
2910
+ ...m
3320
2911
  }
3321
2912
  ),
3322
- /* @__PURE__ */ l(
3323
- ur,
2913
+ /* @__PURE__ */ c(
2914
+ Qt,
3324
2915
  {
3325
2916
  role: "status",
3326
- politeness: b.politeness,
3327
- clearAnnouncementDelay: b.announcementTimeout,
3328
- children: b.message
2917
+ politeness: E.politeness,
2918
+ clearAnnouncementDelay: E.announcementTimeout,
2919
+ children: E.message
3329
2920
  }
3330
2921
  )
3331
2922
  ] });
3332
2923
  }
3333
2924
  );
3334
- hr.displayName = "TextInputMask";
2925
+ Zt.displayName = "TextInputMask";
3335
2926
  /*!
3336
2927
  @versini/ui-form v1.3.7
3337
2928
  © 2024 gizmette.com
@@ -3345,7 +2936,7 @@ try {
3345
2936
  });
3346
2937
  } catch {
3347
2938
  }
3348
- const co = (e) => {
2939
+ const An = (e) => {
3349
2940
  let t = "";
3350
2941
  if (typeof e == "number" || typeof e == "string")
3351
2942
  t = "m-" + e;
@@ -3354,38 +2945,38 @@ const co = (e) => {
3354
2945
  (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(" ");
3355
2946
  }
3356
2947
  return t;
3357
- }, Le = ({
2948
+ }, Oe = ({
3358
2949
  children: e,
3359
2950
  fill: t,
3360
2951
  viewBox: r,
3361
- className: n,
3362
- defaultViewBox: a,
2952
+ className: a,
2953
+ defaultViewBox: n,
3363
2954
  defaultClassName: o,
3364
2955
  spacing: s,
3365
2956
  title: i,
3366
- semantic: d = !1,
3367
- ...g
2957
+ semantic: u = !1,
2958
+ ...p
3368
2959
  }) => {
3369
- const p = co(s), h = f(
3370
- p,
3371
- n || o
2960
+ const h = An(s), m = g(
2961
+ h,
2962
+ a || o
3372
2963
  );
3373
- return /* @__PURE__ */ S(me, { children: [
3374
- /* @__PURE__ */ l(
2964
+ return /* @__PURE__ */ I(ce, { children: [
2965
+ /* @__PURE__ */ c(
3375
2966
  "svg",
3376
2967
  {
3377
2968
  xmlns: "http://www.w3.org/2000/svg",
3378
- className: h,
3379
- viewBox: r || a,
2969
+ className: m,
2970
+ viewBox: r || n,
3380
2971
  fill: t || "currentColor",
3381
2972
  role: "img",
3382
- "aria-hidden": !d,
2973
+ "aria-hidden": !u,
3383
2974
  focusable: !1,
3384
- ...g,
2975
+ ...p,
3385
2976
  children: e
3386
2977
  }
3387
2978
  ),
3388
- i && d && /* @__PURE__ */ l("span", { className: "sr-only", children: i })
2979
+ i && u && /* @__PURE__ */ c("span", { className: "sr-only", children: i })
3389
2980
  ] });
3390
2981
  };
3391
2982
  /*!
@@ -3401,13 +2992,13 @@ try {
3401
2992
  });
3402
2993
  } catch {
3403
2994
  }
3404
- const lo = ({
2995
+ const vn = ({
3405
2996
  className: e,
3406
2997
  viewBox: t,
3407
2998
  spacing: r,
3408
- ...n
3409
- }) => /* @__PURE__ */ l(
3410
- Le,
2999
+ ...a
3000
+ }) => /* @__PURE__ */ c(
3001
+ Oe,
3411
3002
  {
3412
3003
  defaultViewBox: "0 0 1200 500",
3413
3004
  defaultClassName: "w-full",
@@ -3415,8 +3006,8 @@ const lo = ({
3415
3006
  className: e,
3416
3007
  spacing: r,
3417
3008
  title: "Sassy Dog",
3418
- ...n,
3419
- children: /* @__PURE__ */ l("g", { transform: "matrix(11.9092 0 0 11.9092 470.0017 250.0009)", id: "879221", children: /* @__PURE__ */ l(
3009
+ ...a,
3010
+ children: /* @__PURE__ */ c("g", { transform: "matrix(11.9092 0 0 11.9092 470.0017 250.0009)", id: "879221", children: /* @__PURE__ */ c(
3420
3011
  "path",
3421
3012
  {
3422
3013
  vectorEffect: "non-scaling-stroke",
@@ -3426,61 +3017,61 @@ const lo = ({
3426
3017
  }
3427
3018
  ) })
3428
3019
  }
3429
- ), uo = ({
3020
+ ), kn = ({
3430
3021
  className: e,
3431
3022
  viewBox: t,
3432
3023
  spacing: r,
3433
- title: n,
3434
- monotone: a,
3024
+ title: a,
3025
+ monotone: n,
3435
3026
  ...o
3436
- }) => /* @__PURE__ */ S(
3437
- Le,
3027
+ }) => /* @__PURE__ */ I(
3028
+ Oe,
3438
3029
  {
3439
3030
  defaultViewBox: "0 0 640 512",
3440
3031
  defaultClassName: "size-5",
3441
3032
  viewBox: t,
3442
3033
  className: e,
3443
3034
  spacing: r,
3444
- title: n || "Hide",
3035
+ title: a || "Hide",
3445
3036
  ...o,
3446
3037
  children: [
3447
- /* @__PURE__ */ l(
3038
+ /* @__PURE__ */ c(
3448
3039
  "path",
3449
3040
  {
3450
- opacity: a ? "1" : "0.4",
3041
+ opacity: n ? "1" : "0.4",
3451
3042
  d: "M360.8 380.3C339.4 392.8 314.6 400 288 400c-79.5 0-144-64.5-144-144c0-14.5 2.1-28.5 6.1-41.7L63.5 146c-29.4 34.7-49.9 70.8-61.1 97.6c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480c56.1 0 104.4-17.8 144.5-43.2l-71.7-56.5zM198.5 252.4c-3.7 .8-6.7 3.7-6.5 7.7c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9c1.9-.5 3.9-1.1 5.7-1.7l-120-94.6zm89-52.4l94.8 74.3c2.7-13.9 2.4-28.6-1.5-43.2c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 2.7-.2 5.4-.5 8zM432 256c0 17.7-3.2 34.6-9 50.2l84.1 65.9c32.3-36.6 54.6-75.4 66.4-103.9c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32c-60 0-111.1 20.3-152.8 48.7L207 136.9c23.1-15.7 51-24.9 81-24.9c79.5 0 144 64.5 144 144z"
3452
3043
  }
3453
3044
  ),
3454
- /* @__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" })
3045
+ /* @__PURE__ */ c("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" })
3455
3046
  ]
3456
3047
  }
3457
- ), mo = ({
3048
+ ), _n = ({
3458
3049
  className: e,
3459
3050
  viewBox: t,
3460
3051
  spacing: r,
3461
- title: n,
3462
- monotone: a,
3052
+ title: a,
3053
+ monotone: n,
3463
3054
  ...o
3464
- }) => /* @__PURE__ */ S(
3465
- Le,
3055
+ }) => /* @__PURE__ */ I(
3056
+ Oe,
3466
3057
  {
3467
3058
  defaultViewBox: "0 0 512 512",
3468
3059
  defaultClassName: "size-5",
3469
3060
  viewBox: t,
3470
3061
  className: e,
3471
3062
  spacing: r,
3472
- title: n || "Key",
3063
+ title: a || "Key",
3473
3064
  ...o,
3474
3065
  children: [
3475
- /* @__PURE__ */ l(
3066
+ /* @__PURE__ */ c(
3476
3067
  "path",
3477
3068
  {
3478
3069
  className: "fa-secondary",
3479
- opacity: a ? "1" : "0.4",
3070
+ opacity: n ? "1" : "0.4",
3480
3071
  d: "M168.3 229.7L282.3 343.7l0 0s0 0 0 0L249 377c-4.5 4.5-10.6 7-17 7H192v40c0 13.3-10.7 24-24 24H128v40c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V408c0-6.4 2.5-12.5 7-17L168.3 229.7s0 0 0 0l0 0z"
3481
3072
  }
3482
3073
  ),
3483
- /* @__PURE__ */ l(
3074
+ /* @__PURE__ */ c(
3484
3075
  "path",
3485
3076
  {
3486
3077
  className: "fa-primary",
@@ -3489,32 +3080,32 @@ const lo = ({
3489
3080
  )
3490
3081
  ]
3491
3082
  }
3492
- ), ho = ({
3083
+ ), Rn = ({
3493
3084
  className: e,
3494
3085
  viewBox: t,
3495
3086
  spacing: r,
3496
- title: n,
3497
- monotone: a,
3087
+ title: a,
3088
+ monotone: n,
3498
3089
  ...o
3499
- }) => /* @__PURE__ */ S(
3500
- Le,
3090
+ }) => /* @__PURE__ */ I(
3091
+ Oe,
3501
3092
  {
3502
3093
  defaultViewBox: "0 0 576 512",
3503
3094
  defaultClassName: "size-5",
3504
3095
  viewBox: t,
3505
3096
  className: e,
3506
3097
  spacing: r,
3507
- title: n || "Show",
3098
+ title: a || "Show",
3508
3099
  ...o,
3509
3100
  children: [
3510
- /* @__PURE__ */ l(
3101
+ /* @__PURE__ */ c(
3511
3102
  "path",
3512
3103
  {
3513
- opacity: a ? "1" : "0.4",
3104
+ opacity: n ? "1" : "0.4",
3514
3105
  d: "M95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 400a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"
3515
3106
  }
3516
3107
  ),
3517
- /* @__PURE__ */ l("path", { d: "M224 256c35.3 0 64-28.7 64-64c0-7.1-1.2-13.9-3.3-20.3c-1.8-5.5 1.6-11.9 7.4-11.7c40.8 1.7 77.5 29.6 88.6 71.1c13.7 51.2-16.7 103.9-67.9 117.6s-103.9-16.7-117.6-67.9c-1.9-6.9-2.9-13.9-3.2-20.7c-.3-5.8 6.1-9.2 11.7-7.4c6.4 2.1 13.2 3.3 20.3 3.3z" })
3108
+ /* @__PURE__ */ c("path", { d: "M224 256c35.3 0 64-28.7 64-64c0-7.1-1.2-13.9-3.3-20.3c-1.8-5.5 1.6-11.9 7.4-11.7c40.8 1.7 77.5 29.6 88.6 71.1c13.7 51.2-16.7 103.9-67.9 117.6s-103.9-16.7-117.6-67.9c-1.9-6.9-2.9-13.9-3.2-20.7c-.3-5.8 6.1-9.2 11.7-7.4c6.4 2.1 13.2 3.3 20.3 3.3z" })
3518
3109
  ]
3519
3110
  }
3520
3111
  );
@@ -3531,7 +3122,7 @@ try {
3531
3122
  });
3532
3123
  } catch {
3533
3124
  }
3534
- const po = (e) => {
3125
+ const Nn = (e) => {
3535
3126
  let t = "";
3536
3127
  if (typeof e == "number" || typeof e == "string")
3537
3128
  t = "m-" + e;
@@ -3540,42 +3131,42 @@ const po = (e) => {
3540
3131
  (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(" ");
3541
3132
  }
3542
3133
  return t;
3543
- }, go = "av-flexgrid", Se = "av-flexgrid-item", xe = 0.25, pr = W.createContext({
3134
+ }, xn = "av-flexgrid", be = "av-flexgrid-item", ke = 0.25, er = V.createContext({
3544
3135
  columnGap: 0,
3545
3136
  rowGap: 0
3546
- }), Tt = ({
3137
+ }), gt = ({
3547
3138
  children: e,
3548
3139
  className: t,
3549
3140
  columnGap: r = 1,
3550
- rowGap: n = 0,
3551
- height: a = "auto",
3141
+ rowGap: a = 0,
3142
+ height: n = "auto",
3552
3143
  width: o = "auto",
3553
3144
  direction: s = "row",
3554
3145
  alignHorizontal: i = "normal",
3555
- alignVertical: d = "normal",
3556
- spacing: g,
3557
- ...p
3146
+ alignVertical: u = "normal",
3147
+ spacing: p,
3148
+ ...h
3558
3149
  }) => {
3559
- const h = {
3150
+ const m = {
3560
3151
  flexDirection: s,
3561
3152
  justifyContent: i,
3562
- alignItems: d,
3563
- height: a,
3153
+ alignItems: u,
3154
+ height: n,
3564
3155
  width: o,
3565
3156
  /**
3566
3157
  * Trick to account for the extra space taken
3567
3158
  * by the columnGap and rowGap that will be applied
3568
3159
  * to all FlexgridItems (see context and paddings).
3569
3160
  */
3570
- marginLeft: r * -1 * xe + "rem",
3571
- marginTop: n * -1 * xe + "rem"
3572
- }, u = f(
3573
- go,
3161
+ marginLeft: r * -1 * ke + "rem",
3162
+ marginTop: a * -1 * ke + "rem"
3163
+ }, l = g(
3164
+ xn,
3574
3165
  t,
3575
3166
  "box-border flex flex-wrap"
3576
- ), c = { columnGap: r, rowGap: n }, m = g ? "div" : W.Fragment;
3577
- return /* @__PURE__ */ l(m, { ...g ? { className: po(g) } : {}, children: /* @__PURE__ */ l("div", { className: u, style: h, ...p, children: /* @__PURE__ */ l(pr.Provider, { value: c, children: e }) }) });
3578
- }, ze = (e, t) => f({
3167
+ ), d = { columnGap: r, rowGap: a }, f = p ? "div" : V.Fragment;
3168
+ return /* @__PURE__ */ c(f, { ...p ? { className: Nn(p) } : {}, children: /* @__PURE__ */ c("div", { className: l, style: m, ...h, children: /* @__PURE__ */ c(er.Provider, { value: d, children: e }) }) });
3169
+ }, Fe = (e, t) => g({
3579
3170
  "basis-1/12": e === 1 && !t,
3580
3171
  "sm:basis-1/12": e === 1 && t === "sm",
3581
3172
  "md:basis-1/12": e === 1 && t === "md",
@@ -3648,43 +3239,43 @@ const po = (e) => {
3648
3239
  "lg:basis-full": e === 12 && t === "lg",
3649
3240
  "xl:basis-full": e === 12 && t === "xl",
3650
3241
  "2xl:basis-full": e === 12 && t === "2xl"
3651
- }), fo = ({
3242
+ }), Cn = ({
3652
3243
  className: e,
3653
3244
  span: t
3654
3245
  }) => {
3655
3246
  if (!t)
3656
- return f(e, Se, "box-border basis-auto");
3247
+ return g(e, be, "box-border basis-auto");
3657
3248
  if (typeof t == "number")
3658
- return f(e, Se, "box-border max-w-full", {
3659
- [`${ze(t)}`]: !0
3249
+ return g(e, be, "box-border max-w-full", {
3250
+ [`${Fe(t)}`]: !0
3660
3251
  });
3661
3252
  if (typeof t == "string")
3662
- return f(e, Se, "box-border basis-auto", {
3253
+ return g(e, be, "box-border basis-auto", {
3663
3254
  "max-w-full grow": t === "auto"
3664
3255
  });
3665
3256
  if (typeof t == "object") {
3666
- const r = Object.entries(t).map(([n, a]) => n === "fallback" ? ze(a) : ze(a, n));
3667
- return f(
3257
+ const r = Object.entries(t).map(([a, n]) => a === "fallback" ? Fe(n) : Fe(n, a));
3258
+ return g(
3668
3259
  e,
3669
- Se,
3260
+ be,
3670
3261
  "box-border",
3671
3262
  r
3672
3263
  );
3673
3264
  }
3674
- }, oe = ({
3265
+ }, re = ({
3675
3266
  children: e,
3676
3267
  className: t,
3677
3268
  span: r,
3678
- ...n
3269
+ ...a
3679
3270
  }) => {
3680
- const { columnGap: a, rowGap: o } = St(pr), s = {
3681
- paddingLeft: a * xe + "rem",
3682
- paddingTop: o * xe + "rem"
3683
- }, i = fo({
3271
+ const { columnGap: n, rowGap: o } = yt(er), s = {
3272
+ paddingLeft: n * ke + "rem",
3273
+ paddingTop: o * ke + "rem"
3274
+ }, i = Cn({
3684
3275
  className: t,
3685
3276
  span: r
3686
3277
  });
3687
- return /* @__PURE__ */ l("div", { className: i, style: s, ...n, children: e });
3278
+ return /* @__PURE__ */ c("div", { className: i, style: s, ...a, children: e });
3688
3279
  };
3689
3280
  /*!
3690
3281
  @versini/ui-system v1.4.3
@@ -3699,7 +3290,7 @@ try {
3699
3290
  });
3700
3291
  } catch {
3701
3292
  }
3702
- const yo = "ASK! ME! ANYTHING!", gr = "Sassy Saint", bo = "gizmette.com", wo = "Log in", Eo = "Sign in with a Passkey", Rs = "Log out", To = "Password", vo = "Powered by OpenAI", Ns = "Send", xs = "Profile", Cs = "Statistics", Os = "Chat history", Ps = "About", Ds = "Type your question here", $s = "Clear chat", Ls = "Cancel chat", Ms = "N/A", Us = {
3293
+ const On = "ASK! ME! ANYTHING!", tr = "Sassy Saint", Pn = "gizmette.com", Dn = "Log in", $n = "Sign in with a Passkey", Wo = "Log out", Ln = "Password", Mn = "Powered by OpenAI", Vo = "Send", Jo = "Profile", Fo = "Statistics", Yo = "Chat history", zo = "About", jo = "Type your question here", qo = "Clear chat", Qo = "Cancel chat", Xo = "N/A", Zo = {
3703
3294
  PREFERENCES: {
3704
3295
  TITLE: "User preferences",
3705
3296
  NAME: "Name",
@@ -3731,66 +3322,62 @@ const yo = "ASK! ME! ANYTHING!", gr = "Sassy Saint", bo = "gizmette.com", wo = "
3731
3322
  ENGINE: "OpenAI model",
3732
3323
  PLUGIN: "Plugin"
3733
3324
  }
3734
- }, So = ({
3325
+ }, Un = ({
3735
3326
  serverStats: e
3736
- }) => /* @__PURE__ */ l(
3737
- Ka,
3327
+ }) => /* @__PURE__ */ c(
3328
+ tn,
3738
3329
  {
3739
3330
  mode: "light",
3740
- row1: /* @__PURE__ */ S("div", { children: [
3741
- gr,
3331
+ row1: /* @__PURE__ */ I("div", { children: [
3332
+ tr,
3742
3333
  " v",
3743
- "3.4.8",
3334
+ "4.0.0",
3744
3335
  " - ",
3745
- vo,
3746
- et && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
3336
+ Mn,
3337
+ Qe && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
3747
3338
  ] }),
3748
- row2: /* @__PURE__ */ S("div", { children: [
3339
+ row2: /* @__PURE__ */ I("div", { children: [
3749
3340
  "© ",
3750
3341
  (/* @__PURE__ */ new Date()).getFullYear(),
3751
3342
  " ",
3752
- bo
3343
+ Pn
3753
3344
  ] })
3754
3345
  }
3755
- ), Io = kt(() => import("./LazyHeader.CDeNMEns.js")), Ao = () => {
3756
- const { isAuthenticated: e } = Ze();
3757
- return /* @__PURE__ */ S(me, { children: [
3758
- e && /* @__PURE__ */ l(_t, { fallback: /* @__PURE__ */ l("div", {}), children: /* @__PURE__ */ l(Io, {}) }),
3759
- /* @__PURE__ */ S("div", { className: "flex items-center justify-center", children: [
3760
- /* @__PURE__ */ l("div", { className: "basis-1/4", children: /* @__PURE__ */ l(lo, {}) }),
3761
- /* @__PURE__ */ S("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
3762
- /* @__PURE__ */ l("h1", { children: gr }),
3763
- /* @__PURE__ */ l("h2", { children: yo })
3346
+ ), Hn = wt(() => import("./LazyHeader.kRDKzfpE.js")), Kn = () => {
3347
+ const { isAuthenticated: e } = qe();
3348
+ return /* @__PURE__ */ I(ce, { children: [
3349
+ e && /* @__PURE__ */ c(Tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Hn, {}) }),
3350
+ /* @__PURE__ */ I("div", { className: "flex items-center justify-center", children: [
3351
+ /* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(vn, {}) }),
3352
+ /* @__PURE__ */ I("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
3353
+ /* @__PURE__ */ c("h1", { children: tr }),
3354
+ /* @__PURE__ */ c("h2", { children: On })
3764
3355
  ] })
3765
3356
  ] })
3766
3357
  ] });
3767
- }, ko = () => {
3768
- const { login: e, logoutReason: t, loginWithPasskey: r } = Ze(), [n, a] = j(""), [o, s] = j(""), [i, d] = j(!0), [g, p] = j({
3358
+ }, Bn = () => {
3359
+ const { login: e, logoutReason: t, loginWithPasskey: r } = qe(), [a, n] = F(""), [o, s] = F(""), [i, u] = F(!0), [p, h] = F({
3769
3360
  username: "",
3770
3361
  password: ""
3771
- }), h = async (u) => {
3772
- u.preventDefault(), await e(
3773
- g.username,
3774
- g.password,
3775
- Q.CODE
3776
- ) || (s(""), a("Invalid username or password"));
3362
+ }), m = async (l) => {
3363
+ l.preventDefault(), await e(p.username, p.password) || (s(""), n("Invalid username or password"));
3777
3364
  };
3778
- return V(() => {
3779
- var u;
3780
- (u = document.getElementById("logo")) == null || u.classList.add("fadeOut"), setTimeout(() => {
3781
- var c;
3782
- (c = document.getElementById("root")) == null || c.classList.replace("app-hidden", "fadeIn");
3365
+ return j(() => {
3366
+ var l;
3367
+ (l = document.getElementById("logo")) == null || l.classList.add("fadeOut"), setTimeout(() => {
3368
+ var d;
3369
+ (d = document.getElementById("root")) == null || d.classList.replace("app-hidden", "fadeIn");
3783
3370
  }, 500);
3784
- }), V(() => {
3371
+ }), j(() => {
3785
3372
  t && s(t);
3786
- }, [t]), /* @__PURE__ */ S(me, { children: [
3787
- /* @__PURE__ */ S(Ga, { children: [
3788
- /* @__PURE__ */ l("div", { className: Aa(), children: /* @__PURE__ */ l(Ao, {}) }),
3789
- /* @__PURE__ */ S("form", { className: "mt-5", onSubmit: h, children: [
3790
- /* @__PURE__ */ l(Tt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ l(oe, { span: 6, children: /* @__PURE__ */ S(Ha, { mode: "dark", children: [
3791
- /* @__PURE__ */ l(oe, { span: 12, children: o && /* @__PURE__ */ l("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
3792
- /* @__PURE__ */ l(oe, { span: 12, children: /* @__PURE__ */ l(
3793
- rt,
3373
+ }, [t]), /* @__PURE__ */ I(ce, { children: [
3374
+ /* @__PURE__ */ I(rn, { children: [
3375
+ /* @__PURE__ */ c("div", { className: Ka(), children: /* @__PURE__ */ c(Kn, {}) }),
3376
+ /* @__PURE__ */ I("form", { className: "mt-5", onSubmit: m, children: [
3377
+ /* @__PURE__ */ c(gt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ c(re, { span: 6, children: /* @__PURE__ */ I(en, { mode: "dark", children: [
3378
+ /* @__PURE__ */ c(re, { span: 12, children: o && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
3379
+ /* @__PURE__ */ c(re, { span: 12, children: /* @__PURE__ */ c(
3380
+ Ze,
3794
3381
  {
3795
3382
  required: !0,
3796
3383
  autoCapitalize: "off",
@@ -3800,17 +3387,17 @@ const yo = "ASK! ME! ANYTHING!", gr = "Sassy Saint", bo = "gizmette.com", wo = "
3800
3387
  focusMode: "light",
3801
3388
  name: "username",
3802
3389
  label: "Username",
3803
- onChange: (u) => {
3804
- p({
3805
- ...g,
3806
- username: u.target.value
3807
- }), a("");
3390
+ onChange: (l) => {
3391
+ h({
3392
+ ...p,
3393
+ username: l.target.value
3394
+ }), n("");
3808
3395
  },
3809
- error: n !== ""
3396
+ error: a !== ""
3810
3397
  }
3811
3398
  ) }),
3812
- /* @__PURE__ */ l(oe, { span: 12, children: /* @__PURE__ */ l(
3813
- hr,
3399
+ /* @__PURE__ */ c(re, { span: 12, children: /* @__PURE__ */ c(
3400
+ Zt,
3814
3401
  {
3815
3402
  required: !0,
3816
3403
  autoCapitalize: "off",
@@ -3819,21 +3406,21 @@ const yo = "ASK! ME! ANYTHING!", gr = "Sassy Saint", bo = "gizmette.com", wo = "
3819
3406
  mode: "dark",
3820
3407
  focusMode: "light",
3821
3408
  name: "password",
3822
- label: To,
3823
- rightElement: /* @__PURE__ */ l(qe, { focusMode: "light", mode: "dark", children: i ? /* @__PURE__ */ l(ho, {}) : /* @__PURE__ */ l(uo, {}) }),
3824
- onMaskChange: d,
3825
- onChange: (u) => {
3826
- p({
3827
- ...g,
3828
- password: u.target.value
3829
- }), a("");
3409
+ label: Ln,
3410
+ rightElement: /* @__PURE__ */ c(Ye, { focusMode: "light", mode: "dark", children: i ? /* @__PURE__ */ c(Rn, {}) : /* @__PURE__ */ c(kn, {}) }),
3411
+ onMaskChange: u,
3412
+ onChange: (l) => {
3413
+ h({
3414
+ ...p,
3415
+ password: l.target.value
3416
+ }), n("");
3830
3417
  },
3831
- error: n !== "",
3832
- helperText: n
3418
+ error: a !== "",
3419
+ helperText: a
3833
3420
  }
3834
3421
  ) }),
3835
- /* @__PURE__ */ l(oe, { span: 12, children: /* @__PURE__ */ l(
3836
- cr,
3422
+ /* @__PURE__ */ c(re, { span: 12, children: /* @__PURE__ */ c(
3423
+ zt,
3837
3424
  {
3838
3425
  mode: "light",
3839
3426
  focusMode: "light",
@@ -3841,110 +3428,109 @@ const yo = "ASK! ME! ANYTHING!", gr = "Sassy Saint", bo = "gizmette.com", wo = "
3841
3428
  noBorder: !0,
3842
3429
  type: "submit",
3843
3430
  className: "mb-4 mt-6",
3844
- children: wo
3431
+ children: Dn
3845
3432
  }
3846
3433
  ) })
3847
3434
  ] }) }) }),
3848
- /* @__PURE__ */ l("div", { className: "text-center text-copy-light", children: "or" }),
3849
- /* @__PURE__ */ l(Tt, { alignHorizontal: "center", children: /* @__PURE__ */ l(oe, { span: 6, children: /* @__PURE__ */ l(
3850
- qe,
3435
+ /* @__PURE__ */ c("div", { className: "text-center text-copy-light", children: "or" }),
3436
+ /* @__PURE__ */ c(gt, { alignHorizontal: "center", children: /* @__PURE__ */ c(re, { span: 6, children: /* @__PURE__ */ c(
3437
+ Ye,
3851
3438
  {
3852
3439
  mode: "dark",
3853
3440
  focusMode: "light",
3854
3441
  fullWidth: !0,
3855
3442
  noBorder: !0,
3856
3443
  className: "mb-4 mt-1",
3857
- labelRight: Eo,
3444
+ labelRight: $n,
3858
3445
  onClick: r,
3859
- children: /* @__PURE__ */ l(mo, { className: "size-4" })
3446
+ children: /* @__PURE__ */ c(_n, { className: "size-4" })
3860
3447
  }
3861
3448
  ) }) })
3862
3449
  ] })
3863
3450
  ] }),
3864
- /* @__PURE__ */ l(So, {})
3451
+ /* @__PURE__ */ c(Un, {})
3865
3452
  ] });
3866
- }, _o = new URL(document.location.href).searchParams, Ro = !!_o.get("debug") || !1, No = kt(() => import("./App.WT_JMB-P.js").then((e) => e.App)), xo = ({ isComponent: e }) => {
3867
- const { isAuthenticated: t } = Ze();
3868
- return t ? /* @__PURE__ */ l(_t, { fallback: /* @__PURE__ */ l("div", {}), children: /* @__PURE__ */ l(No, { isComponent: e }) }) : /* @__PURE__ */ l(ko, {});
3869
- }, Co = ({
3453
+ }, Gn = new URL(document.location.href).searchParams, Wn = !!Gn.get("debug") || !1, Vn = wt(() => import("./App.B5-6f2Kg.js").then((e) => e.App)), Jn = ({ isComponent: e }) => {
3454
+ const { isAuthenticated: t } = qe();
3455
+ return t ? /* @__PURE__ */ c(Tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Vn, { isComponent: e }) }) : /* @__PURE__ */ c(Bn, {});
3456
+ }, Fn = ({
3870
3457
  isComponent: e = !1,
3871
- domain: t = Ia
3872
- }) => /* @__PURE__ */ l(me, { children: /* @__PURE__ */ l(ha, { clientId: pa, domain: t, debug: Ro, children: /* @__PURE__ */ l(xo, { isComponent: e }) }) }), Oo = ({ domain: e }) => /* @__PURE__ */ l(Co, { isComponent: !0, domain: e });
3873
- Oo.displayName = "SassySaint-3.4.8";
3458
+ domain: t = Ha
3459
+ }) => /* @__PURE__ */ c(ce, { children: /* @__PURE__ */ c(Ra, { clientId: Na, domain: t, debug: Wn, children: /* @__PURE__ */ c(Jn, { isComponent: e }) }) }), Yn = ({ domain: e }) => /* @__PURE__ */ c(Fn, { isComponent: !0, domain: e });
3460
+ Yn.displayName = "SassySaint-3.4.8";
3874
3461
  export {
3875
- ir as A,
3876
- Ps as ABOUT_TITLE,
3877
- Zo as ACTION_LOCATION,
3878
- zo as ACTION_MESSAGE,
3879
- Qo as ACTION_MODEL,
3880
- qo as ACTION_RESET,
3881
- Xo as ACTION_RESTORE,
3882
- ts as ACTION_SEARCH,
3883
- rs as ACTION_SORT,
3884
- es as ACTION_STREAMING,
3885
- So as AppFooter,
3886
- Ls as CANCEL,
3887
- Us as CARDS,
3888
- $s as CLEAR,
3889
- Jo as ERROR_MESSAGE,
3890
- Q as G,
3891
- jo as GPT4_MAX_TOKENS,
3892
- Os as HISTORY_TITLE,
3893
- as as LOCAL_STORAGE_CHAT_DETAILS,
3894
- is as LOCAL_STORAGE_LOCATION,
3895
- ns as LOCAL_STORAGE_PREFIX,
3896
- os as LOCAL_STORAGE_SEARCH,
3897
- ss as LOCAL_STORAGE_SORT,
3898
- Rs as LOG_OUT,
3899
- Wa as M,
3900
- Yo as MODEL_GPT4,
3901
- Ao as MessagesContainerHeader,
3902
- Es as N,
3903
- Ha as N$1,
3904
- Ms as NA,
3905
- qe as O,
3906
- xs as PROFILE_TITLE,
3907
- Bo as ROLE_ASSISTANT,
3908
- Fo as ROLE_HIDDEN,
3909
- Vo as ROLE_INTERNAL,
3910
- Wo as ROLE_SYSTEM,
3911
- Go as ROLE_USER,
3912
- $e as S,
3913
- Ns as SEND,
3914
- Cs as STATS,
3915
- cs as STATS_SEPARATOR,
3916
- Oo as SassySaint,
3917
- Ds as TYPE_QUESTION,
3918
- ur as U,
3919
- Ze as Wr,
3920
- rt as Y,
3921
- As as a,
3922
- Tt as b,
3923
- Ga as c,
3924
- vs as c$1,
3925
- ds as convertLatitudeToDMS,
3926
- us as convertLongitudeToDMS,
3927
- ys as durationFormatter,
3928
- ps as extractAverage,
3929
- or as f,
3930
- Ba as f$1,
3931
- mo as f$2,
3932
- Le as g,
3933
- ms as getCurrentGeoLocation,
3934
- Aa as getMessageContaintWrapperClass,
3935
- tt as i,
3936
- Ts as i$1,
3937
- gs as isLastMessageFromRole,
3938
- oe as j,
3939
- ks as l,
3940
- Ss as n,
3941
- fs as numberFormatter,
3942
- ja as o,
3943
- _s as p,
3944
- bs as pluralize,
3945
- Is as r,
3946
- hs as renderDataAsList,
3947
- ws as s,
3948
- ls as truncate,
3949
- cr as x
3462
+ Yt as A,
3463
+ zo as ABOUT_TITLE,
3464
+ po as ACTION_LOCATION,
3465
+ lo as ACTION_MESSAGE,
3466
+ mo as ACTION_MODEL,
3467
+ uo as ACTION_RESET,
3468
+ ho as ACTION_RESTORE,
3469
+ fo as ACTION_SEARCH,
3470
+ yo as ACTION_SORT,
3471
+ go as ACTION_STREAMING,
3472
+ Un as AppFooter,
3473
+ Qo as CANCEL,
3474
+ Zo as CARDS,
3475
+ qo as CLEAR,
3476
+ so as ERROR_MESSAGE,
3477
+ co as GPT4_MAX_TOKENS,
3478
+ Yo as HISTORY_TITLE,
3479
+ Eo as LOCAL_STORAGE_CHAT_DETAILS,
3480
+ Io as LOCAL_STORAGE_LOCATION,
3481
+ bo as LOCAL_STORAGE_PREFIX,
3482
+ wo as LOCAL_STORAGE_SEARCH,
3483
+ To as LOCAL_STORAGE_SORT,
3484
+ Wo as LOG_OUT,
3485
+ nn as M,
3486
+ io as MODEL_GPT4,
3487
+ Kn as MessagesContainerHeader,
3488
+ $o as N,
3489
+ en as N$1,
3490
+ Xo as NA,
3491
+ Ye as O,
3492
+ Jo as PROFILE_TITLE,
3493
+ ro as ROLE_ASSISTANT,
3494
+ oo as ROLE_HIDDEN,
3495
+ no as ROLE_INTERNAL,
3496
+ ao as ROLE_SYSTEM,
3497
+ to as ROLE_USER,
3498
+ Ce as S,
3499
+ Vo as SEND,
3500
+ Fo as STATS,
3501
+ So as STATS_SEPARATOR,
3502
+ Yn as SassySaint,
3503
+ jo as TYPE_QUESTION,
3504
+ Qt as U,
3505
+ Ze as Y,
3506
+ Ko as a,
3507
+ gt as b,
3508
+ rn as c,
3509
+ Mo as c$1,
3510
+ vo as convertLatitudeToDMS,
3511
+ ko as convertLongitudeToDMS,
3512
+ Oo as durationFormatter,
3513
+ No as extractAverage,
3514
+ Jt as f,
3515
+ an as f$1,
3516
+ _n as f$2,
3517
+ Oe as g,
3518
+ _o as getCurrentGeoLocation,
3519
+ Ka as getMessageContaintWrapperClass,
3520
+ Xe as i,
3521
+ Lo as i$1,
3522
+ xo as isLastMessageFromRole,
3523
+ re as j,
3524
+ Bo as l,
3525
+ Uo as n,
3526
+ Co as numberFormatter,
3527
+ dn as o,
3528
+ Go as p,
3529
+ Po as pluralize,
3530
+ Ho as r,
3531
+ Ro as renderDataAsList,
3532
+ Do as s,
3533
+ Ao as truncate,
3534
+ zt as x,
3535
+ qe as zr
3950
3536
  };