@versini/sassysaint 1.0.4 → 1.0.6

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,49 +1,339 @@
1
- import { jsx as c, jsxs as T, Fragment as q } from "react/jsx-runtime";
2
- import B, { createContext as xt, useRef as j, useState as H, useCallback as z, useEffect as V, useContext as Xe, useSyncExternalStore as Nt, useMemo as Ct, useId as Rt, useReducer as Ot, useLayoutEffect as Dt, lazy as Ze, Suspense as et } from "react";
3
- import g from "clsx";
4
- var Mt = Object.defineProperty, Lt = (e, t, r) => t in e ? Mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ye = (e, t, r) => Lt(e, typeof t != "symbol" ? t + "" : t, r);
1
+ import { jsx as c, jsxs as T, Fragment as ne } from "react/jsx-runtime";
2
+ import H, { createContext as Qt, useReducer as ht, useRef as V, useCallback as re, useEffect as z, useContext as pt, useSyncExternalStore as Xt, useId as gt, useMemo as Zt, useState as G, useLayoutEffect as er, lazy as ft, Suspense as yt } from "react";
3
+ import f from "clsx";
4
+ var tr = Object.defineProperty, rr = (e, t, r) => t in e ? tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ce = (e, t, r) => rr(e, typeof t != "symbol" ? t + "" : t, r);
5
5
  /*!
6
- @versini/auth-provider v5.1.3
6
+ @versini/auth-provider v6.0.0
7
7
  © 2024 gizmette.com
8
8
  */
9
9
  try {
10
10
  window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
11
- version: "5.1.3",
12
- buildTime: "07/09/2024 03:32 PM EDT",
11
+ version: "6.0.0",
12
+ buildTime: "07/15/2024 12:46 PM EDT",
13
13
  homepage: "https://github.com/aversini/auth-client",
14
14
  license: "MIT"
15
15
  });
16
16
  } catch {
17
17
  }
18
+ function M(e) {
19
+ const t = new Uint8Array(e);
20
+ let r = "";
21
+ for (const a of t)
22
+ r += String.fromCharCode(a);
23
+ return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
24
+ }
25
+ function be(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
+ return o;
30
+ }
31
+ function We() {
32
+ return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
33
+ }
34
+ function bt(e) {
35
+ const { id: t } = e;
36
+ return {
37
+ ...e,
38
+ id: be(t),
39
+ transports: e.transports
40
+ };
41
+ }
42
+ function Et(e) {
43
+ return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
44
+ }
45
+ let S = 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
+ }
49
+ };
50
+ function ar({ error: e, options: t }) {
51
+ var r, a;
52
+ const { publicKey: n } = t;
53
+ if (!n)
54
+ throw Error("options was missing required publicKey property");
55
+ if (e.name === "AbortError") {
56
+ if (t.signal instanceof AbortSignal)
57
+ return new S({
58
+ message: "Registration ceremony was sent an abort signal",
59
+ code: "ERROR_CEREMONY_ABORTED",
60
+ cause: e
61
+ });
62
+ } else if (e.name === "ConstraintError") {
63
+ if (((r = n.authenticatorSelection) == null ? void 0 : r.requireResidentKey) === !0)
64
+ return new S({
65
+ message: "Discoverable credentials were required but no available authenticator supported it",
66
+ code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
67
+ cause: e
68
+ });
69
+ if (((a = n.authenticatorSelection) == null ? void 0 : a.userVerification) === "required")
70
+ return new S({
71
+ message: "User verification was required but no available authenticator supported it",
72
+ code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
73
+ cause: e
74
+ });
75
+ } else {
76
+ if (e.name === "InvalidStateError")
77
+ return new S({
78
+ message: "The authenticator was previously registered",
79
+ code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
80
+ cause: e
81
+ });
82
+ if (e.name === "NotAllowedError")
83
+ return new S({
84
+ message: e.message,
85
+ code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
86
+ cause: e
87
+ });
88
+ if (e.name === "NotSupportedError")
89
+ return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new S({
90
+ message: 'No entry in pubKeyCredParams was of type "public-key"',
91
+ code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
92
+ cause: e
93
+ }) : new S({
94
+ message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
95
+ code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
96
+ cause: e
97
+ });
98
+ if (e.name === "SecurityError") {
99
+ const o = window.location.hostname;
100
+ if (Et(o)) {
101
+ if (n.rp.id !== o)
102
+ return new S({
103
+ message: `The RP ID "${n.rp.id}" is invalid for this domain`,
104
+ code: "ERROR_INVALID_RP_ID",
105
+ cause: e
106
+ });
107
+ } else return new S({
108
+ message: `${window.location.hostname} is an invalid domain`,
109
+ code: "ERROR_INVALID_DOMAIN",
110
+ cause: e
111
+ });
112
+ } else if (e.name === "TypeError") {
113
+ if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64)
114
+ return new S({
115
+ message: "User ID was not between 1 and 64 characters",
116
+ code: "ERROR_INVALID_USER_ID_LENGTH",
117
+ cause: e
118
+ });
119
+ } else if (e.name === "UnknownError")
120
+ return new S({
121
+ message: "The authenticator was unable to process the specified options, or could not create a new credential",
122
+ code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
123
+ cause: e
124
+ });
125
+ }
126
+ return e;
127
+ }
128
+ class nr {
129
+ createNewAbortSignal() {
130
+ if (this.controller) {
131
+ const r = new Error("Cancelling existing WebAuthn API call for new one");
132
+ r.name = "AbortError", this.controller.abort(r);
133
+ }
134
+ const t = new AbortController();
135
+ return this.controller = t, t.signal;
136
+ }
137
+ cancelCeremony() {
138
+ if (this.controller) {
139
+ const t = new Error("Manually cancelling existing WebAuthn API call");
140
+ t.name = "AbortError", this.controller.abort(t), this.controller = void 0;
141
+ }
142
+ }
143
+ }
144
+ const wt = new nr(), or = ["cross-platform", "platform"];
145
+ function Tt(e) {
146
+ if (e && !(or.indexOf(e) < 0))
147
+ return e;
148
+ }
149
+ async function sr(e) {
150
+ var t;
151
+ if (!We())
152
+ throw new Error("WebAuthn is not supported in this browser");
153
+ const r = { publicKey: {
154
+ ...e,
155
+ challenge: be(e.challenge),
156
+ user: {
157
+ ...e.user,
158
+ id: be(e.user.id)
159
+ },
160
+ excludeCredentials: (t = e.excludeCredentials) == null ? void 0 : t.map(bt)
161
+ } };
162
+ r.signal = wt.createNewAbortSignal();
163
+ let a;
164
+ try {
165
+ a = await navigator.credentials.create(r);
166
+ } catch (l) {
167
+ throw ar({ error: l, options: r });
168
+ }
169
+ if (!a)
170
+ throw new Error("Registration was not completed");
171
+ const { id: n, rawId: o, response: s, type: i } = a;
172
+ let h;
173
+ typeof s.getTransports == "function" && (h = s.getTransports());
174
+ let u;
175
+ if (typeof s.getPublicKeyAlgorithm == "function")
176
+ try {
177
+ u = s.getPublicKeyAlgorithm();
178
+ } catch (l) {
179
+ Oe("getPublicKeyAlgorithm()", l);
180
+ }
181
+ let d;
182
+ if (typeof s.getPublicKey == "function")
183
+ try {
184
+ const l = s.getPublicKey();
185
+ l !== null && (d = M(l));
186
+ } catch (l) {
187
+ Oe("getPublicKey()", l);
188
+ }
189
+ let p;
190
+ if (typeof s.getAuthenticatorData == "function")
191
+ try {
192
+ p = M(s.getAuthenticatorData());
193
+ } catch (l) {
194
+ Oe("getAuthenticatorData()", l);
195
+ }
196
+ return {
197
+ id: n,
198
+ rawId: M(o),
199
+ response: {
200
+ attestationObject: M(s.attestationObject),
201
+ clientDataJSON: M(s.clientDataJSON),
202
+ transports: h,
203
+ publicKeyAlgorithm: u,
204
+ publicKey: d,
205
+ authenticatorData: p
206
+ },
207
+ type: i,
208
+ clientExtensionResults: a.getClientExtensionResults(),
209
+ authenticatorAttachment: Tt(a.authenticatorAttachment)
210
+ };
211
+ }
212
+ function Oe(e, t) {
213
+ console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
214
+ `, t);
215
+ }
216
+ function ir() {
217
+ if (!We())
218
+ return new Promise((t) => t(!1));
219
+ const e = window.PublicKeyCredential;
220
+ return e.isConditionalMediationAvailable === void 0 ? new Promise((t) => t(!1)) : e.isConditionalMediationAvailable();
221
+ }
222
+ function cr({ error: e, options: t }) {
223
+ const { publicKey: r } = t;
224
+ if (!r)
225
+ throw Error("options was missing required publicKey property");
226
+ if (e.name === "AbortError") {
227
+ if (t.signal instanceof AbortSignal)
228
+ return new S({
229
+ message: "Authentication ceremony was sent an abort signal",
230
+ code: "ERROR_CEREMONY_ABORTED",
231
+ cause: e
232
+ });
233
+ } else {
234
+ if (e.name === "NotAllowedError")
235
+ return new S({
236
+ message: e.message,
237
+ code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
238
+ cause: e
239
+ });
240
+ if (e.name === "SecurityError") {
241
+ const a = window.location.hostname;
242
+ if (Et(a)) {
243
+ if (r.rpId !== a)
244
+ return new S({
245
+ message: `The RP ID "${r.rpId}" is invalid for this domain`,
246
+ code: "ERROR_INVALID_RP_ID",
247
+ cause: e
248
+ });
249
+ } else return new S({
250
+ message: `${window.location.hostname} is an invalid domain`,
251
+ code: "ERROR_INVALID_DOMAIN",
252
+ cause: e
253
+ });
254
+ } else if (e.name === "UnknownError")
255
+ return new S({
256
+ message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
257
+ code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
258
+ cause: e
259
+ });
260
+ }
261
+ return e;
262
+ }
263
+ async function lr(e, t = !1) {
264
+ var r, a;
265
+ if (!We())
266
+ throw new Error("WebAuthn is not supported in this browser");
267
+ let n;
268
+ ((r = e.allowCredentials) == null ? void 0 : r.length) !== 0 && (n = (a = e.allowCredentials) == null ? void 0 : a.map(bt));
269
+ const o = {
270
+ ...e,
271
+ challenge: be(e.challenge),
272
+ allowCredentials: n
273
+ }, s = {};
274
+ if (t) {
275
+ if (!await ir())
276
+ throw Error("Browser does not support WebAuthn autofill");
277
+ if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1)
278
+ throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
279
+ s.mediation = "conditional", o.allowCredentials = [];
280
+ }
281
+ s.publicKey = o, s.signal = wt.createNewAbortSignal();
282
+ let i;
283
+ try {
284
+ i = await navigator.credentials.get(s);
285
+ } catch (m) {
286
+ throw cr({ error: m, options: s });
287
+ }
288
+ if (!i)
289
+ throw new Error("Authentication was not completed");
290
+ const { id: h, rawId: u, response: d, type: p } = i;
291
+ let l;
292
+ return d.userHandle && (l = M(d.userHandle)), {
293
+ id: h,
294
+ rawId: M(u),
295
+ response: {
296
+ authenticatorData: M(d.authenticatorData),
297
+ clientDataJSON: M(d.clientDataJSON),
298
+ signature: M(d.signature),
299
+ userHandle: l
300
+ },
301
+ type: p,
302
+ clientExtensionResults: i.getClientExtensionResults(),
303
+ authenticatorAttachment: Tt(i.authenticatorAttachment)
304
+ };
305
+ }
18
306
  /*!
19
- @versini/auth-common v2.11.0
307
+ @versini/auth-common v2.12.1
20
308
  © 2024 gizmette.com
21
309
  */
22
310
  try {
23
311
  window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
24
- version: "2.11.0",
25
- buildTime: "07/09/2024 03:32 PM EDT",
312
+ version: "2.12.1",
313
+ buildTime: "07/15/2024 12:46 PM EDT",
26
314
  homepage: "https://github.com/aversini/auth-client",
27
315
  license: "MIT"
28
316
  });
29
317
  } catch {
30
318
  }
31
- const Q = {
319
+ const q = {
32
320
  ID_TOKEN: "id_token",
33
321
  ACCESS_TOKEN: "token",
34
322
  ID_AND_ACCESS_TOKEN: "id_token token",
35
323
  CODE: "code",
36
- REFRESH_TOKEN: "refresh_token"
37
- }, Pt = {
324
+ REFRESH_TOKEN: "refresh_token",
325
+ PASSKEY: "passkey"
326
+ }, It = {
38
327
  CLIENT_ID: "X-Auth-ClientId"
39
- }, _ = {
328
+ }, R = {
40
329
  ALG: "RS256",
41
330
  USER_ID_KEY: "sub",
42
331
  TOKEN_ID_KEY: "__raw",
43
332
  NONCE_KEY: "_nonce",
44
333
  USERNAME_KEY: "username",
334
+ AUTH_TYPE_KEY: "auth_type",
45
335
  ISSUER: "gizmette.com"
46
- }, $t = `-----BEGIN PUBLIC KEY-----
336
+ }, dr = `-----BEGIN PUBLIC KEY-----
47
337
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
48
338
  w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
49
339
  i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
@@ -51,33 +341,33 @@ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
51
341
  l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
52
342
  sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
53
343
  awIDAQAB
54
- -----END PUBLIC KEY-----`, me = {
344
+ -----END PUBLIC KEY-----`, Ie = {
55
345
  AUTHENTICATE: "authenticate",
56
346
  CODE: "code",
57
347
  LOGOUT: "logout"
58
- }, he = crypto, tt = (e) => e instanceof CryptoKey, X = new TextEncoder(), pe = new TextDecoder();
59
- function Ut(...e) {
348
+ }, ve = crypto, vt = (e) => e instanceof CryptoKey, oe = new TextEncoder(), Ae = new TextDecoder();
349
+ function ur(...e) {
60
350
  const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
61
351
  let a = 0;
62
352
  for (const n of e)
63
353
  r.set(n, a), a += n.length;
64
354
  return r;
65
355
  }
66
- const Ht = (e) => {
356
+ const mr = (e) => {
67
357
  const t = atob(e), r = new Uint8Array(t.length);
68
358
  for (let a = 0; a < t.length; a++)
69
359
  r[a] = t.charCodeAt(a);
70
360
  return r;
71
- }, ce = (e) => {
361
+ }, ge = (e) => {
72
362
  let t = e;
73
- t instanceof Uint8Array && (t = pe.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
363
+ t instanceof Uint8Array && (t = Ae.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
74
364
  try {
75
- return Ht(t);
365
+ return mr(t);
76
366
  } catch {
77
367
  throw new TypeError("The input to be decoded is not correctly encoded.");
78
368
  }
79
369
  };
80
- class G extends Error {
370
+ let W = class extends Error {
81
371
  static get code() {
82
372
  return "ERR_JOSE_GENERIC";
83
373
  }
@@ -85,8 +375,7 @@ class G extends Error {
85
375
  var r;
86
376
  super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
87
377
  }
88
- }
89
- let L = class extends G {
378
+ }, L = class extends W {
90
379
  static get code() {
91
380
  return "ERR_JWT_CLAIM_VALIDATION_FAILED";
92
381
  }
@@ -94,7 +383,7 @@ let L = class extends G {
94
383
  super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = a, this.reason = n, this.payload = r;
95
384
  }
96
385
  };
97
- class Le extends G {
386
+ class Qe extends W {
98
387
  static get code() {
99
388
  return "ERR_JWT_EXPIRED";
100
389
  }
@@ -102,7 +391,7 @@ class Le extends G {
102
391
  super(t), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
103
392
  }
104
393
  }
105
- class Kt extends G {
394
+ class hr extends W {
106
395
  constructor() {
107
396
  super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
108
397
  }
@@ -110,21 +399,21 @@ class Kt extends G {
110
399
  return "ERR_JOSE_ALG_NOT_ALLOWED";
111
400
  }
112
401
  }
113
- let K = class extends G {
402
+ let B = class extends W {
114
403
  constructor() {
115
404
  super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
116
405
  }
117
406
  static get code() {
118
407
  return "ERR_JOSE_NOT_SUPPORTED";
119
408
  }
120
- }, S = class extends G {
409
+ }, A = class extends W {
121
410
  constructor() {
122
411
  super(...arguments), this.code = "ERR_JWS_INVALID";
123
412
  }
124
413
  static get code() {
125
414
  return "ERR_JWS_INVALID";
126
415
  }
127
- }, rt = class extends G {
416
+ }, At = class extends W {
128
417
  constructor() {
129
418
  super(...arguments), this.code = "ERR_JWT_INVALID";
130
419
  }
@@ -132,7 +421,7 @@ let K = class extends G {
132
421
  return "ERR_JWT_INVALID";
133
422
  }
134
423
  };
135
- class Bt extends G {
424
+ class pr extends W {
136
425
  constructor() {
137
426
  super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
138
427
  }
@@ -140,16 +429,16 @@ class Bt extends G {
140
429
  return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
141
430
  }
142
431
  }
143
- function P(e, t = "algorithm.name") {
432
+ function U(e, t = "algorithm.name") {
144
433
  return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
145
434
  }
146
- function Z(e, t) {
435
+ function se(e, t) {
147
436
  return e.name === t;
148
437
  }
149
- function be(e) {
438
+ function Pe(e) {
150
439
  return parseInt(e.name.slice(4), 10);
151
440
  }
152
- function Wt(e) {
441
+ function gr(e) {
153
442
  switch (e) {
154
443
  case "ES256":
155
444
  return "P-256";
@@ -161,7 +450,7 @@ function Wt(e) {
161
450
  throw new Error("unreachable");
162
451
  }
163
452
  }
164
- function jt(e, t) {
453
+ function fr(e, t) {
165
454
  if (t.length && !t.some((r) => e.usages.includes(r))) {
166
455
  let r = "CryptoKey does not support this operation, its usages must include ";
167
456
  if (t.length > 2) {
@@ -171,59 +460,59 @@ function jt(e, t) {
171
460
  throw new TypeError(r);
172
461
  }
173
462
  }
174
- function Gt(e, t, ...r) {
463
+ function yr(e, t, ...r) {
175
464
  switch (t) {
176
465
  case "HS256":
177
466
  case "HS384":
178
467
  case "HS512": {
179
- if (!Z(e.algorithm, "HMAC"))
180
- throw P("HMAC");
468
+ if (!se(e.algorithm, "HMAC"))
469
+ throw U("HMAC");
181
470
  const a = parseInt(t.slice(2), 10);
182
- if (be(e.algorithm.hash) !== a)
183
- throw P(`SHA-${a}`, "algorithm.hash");
471
+ if (Pe(e.algorithm.hash) !== a)
472
+ throw U(`SHA-${a}`, "algorithm.hash");
184
473
  break;
185
474
  }
186
475
  case "RS256":
187
476
  case "RS384":
188
477
  case "RS512": {
189
- if (!Z(e.algorithm, "RSASSA-PKCS1-v1_5"))
190
- throw P("RSASSA-PKCS1-v1_5");
478
+ if (!se(e.algorithm, "RSASSA-PKCS1-v1_5"))
479
+ throw U("RSASSA-PKCS1-v1_5");
191
480
  const a = parseInt(t.slice(2), 10);
192
- if (be(e.algorithm.hash) !== a)
193
- throw P(`SHA-${a}`, "algorithm.hash");
481
+ if (Pe(e.algorithm.hash) !== a)
482
+ throw U(`SHA-${a}`, "algorithm.hash");
194
483
  break;
195
484
  }
196
485
  case "PS256":
197
486
  case "PS384":
198
487
  case "PS512": {
199
- if (!Z(e.algorithm, "RSA-PSS"))
200
- throw P("RSA-PSS");
488
+ if (!se(e.algorithm, "RSA-PSS"))
489
+ throw U("RSA-PSS");
201
490
  const a = parseInt(t.slice(2), 10);
202
- if (be(e.algorithm.hash) !== a)
203
- throw P(`SHA-${a}`, "algorithm.hash");
491
+ if (Pe(e.algorithm.hash) !== a)
492
+ throw U(`SHA-${a}`, "algorithm.hash");
204
493
  break;
205
494
  }
206
495
  case "EdDSA": {
207
496
  if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448")
208
- throw P("Ed25519 or Ed448");
497
+ throw U("Ed25519 or Ed448");
209
498
  break;
210
499
  }
211
500
  case "ES256":
212
501
  case "ES384":
213
502
  case "ES512": {
214
- if (!Z(e.algorithm, "ECDSA"))
215
- throw P("ECDSA");
216
- const a = Wt(t);
503
+ if (!se(e.algorithm, "ECDSA"))
504
+ throw U("ECDSA");
505
+ const a = gr(t);
217
506
  if (e.algorithm.namedCurve !== a)
218
- throw P(a, "algorithm.namedCurve");
507
+ throw U(a, "algorithm.namedCurve");
219
508
  break;
220
509
  }
221
510
  default:
222
511
  throw new TypeError("CryptoKey does not support this operation");
223
512
  }
224
- jt(e, r);
513
+ fr(e, r);
225
514
  }
226
- function at(e, t, ...r) {
515
+ function kt(e, t, ...r) {
227
516
  var a;
228
517
  if (r.length > 2) {
229
518
  const n = r.pop();
@@ -231,11 +520,11 @@ function at(e, t, ...r) {
231
520
  } else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
232
521
  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;
233
522
  }
234
- const Pe = (e, ...t) => at("Key must be ", e, ...t);
235
- function nt(e, t, ...r) {
236
- return at(`Key for the ${e} algorithm must be `, t, ...r);
523
+ const Xe = (e, ...t) => kt("Key must be ", e, ...t);
524
+ function St(e, t, ...r) {
525
+ return kt(`Key for the ${e} algorithm must be `, t, ...r);
237
526
  }
238
- const ot = (e) => tt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", de = ["CryptoKey"], Vt = (...e) => {
527
+ const _t = (e) => vt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Ee = ["CryptoKey"], br = (...e) => {
239
528
  const t = e.filter(Boolean);
240
529
  if (t.length === 0 || t.length === 1)
241
530
  return !0;
@@ -254,11 +543,11 @@ const ot = (e) => tt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
254
543
  }
255
544
  return !0;
256
545
  };
257
- function Jt(e) {
546
+ function Er(e) {
258
547
  return typeof e == "object" && e !== null;
259
548
  }
260
- function Ie(e) {
261
- if (!Jt(e) || Object.prototype.toString.call(e) !== "[object Object]")
549
+ function Ge(e) {
550
+ if (!Er(e) || Object.prototype.toString.call(e) !== "[object Object]")
262
551
  return !1;
263
552
  if (Object.getPrototypeOf(e) === null)
264
553
  return !0;
@@ -267,14 +556,14 @@ function Ie(e) {
267
556
  t = Object.getPrototypeOf(t);
268
557
  return Object.getPrototypeOf(e) === t;
269
558
  }
270
- const Ft = (e, t) => {
559
+ const wr = (e, t) => {
271
560
  if (e.startsWith("RS") || e.startsWith("PS")) {
272
561
  const { modulusLength: r } = t.algorithm;
273
562
  if (typeof r != "number" || r < 2048)
274
563
  throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
275
564
  }
276
565
  };
277
- function zt(e) {
566
+ function Tr(e) {
278
567
  let t, r;
279
568
  switch (e.kty) {
280
569
  case "RSA": {
@@ -299,7 +588,7 @@ function zt(e) {
299
588
  }, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
300
589
  break;
301
590
  default:
302
- throw new K('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
591
+ throw new B('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
303
592
  }
304
593
  break;
305
594
  }
@@ -321,7 +610,7 @@ function zt(e) {
321
610
  t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
322
611
  break;
323
612
  default:
324
- throw new K('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
613
+ throw new B('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
325
614
  }
326
615
  break;
327
616
  }
@@ -337,73 +626,73 @@ function zt(e) {
337
626
  t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
338
627
  break;
339
628
  default:
340
- throw new K('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
629
+ throw new B('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
341
630
  }
342
631
  break;
343
632
  }
344
633
  default:
345
- throw new K('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
634
+ throw new B('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
346
635
  }
347
636
  return { algorithm: t, keyUsages: r };
348
637
  }
349
- const Yt = async (e) => {
638
+ const Ir = async (e) => {
350
639
  if (!e.alg)
351
640
  throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
352
- const { algorithm: t, keyUsages: r } = zt(e), a = [
641
+ const { algorithm: t, keyUsages: r } = Tr(e), a = [
353
642
  t,
354
643
  e.ext ?? !1,
355
644
  e.key_ops ?? r
356
645
  ], n = { ...e };
357
- return delete n.alg, delete n.use, he.subtle.importKey("jwk", n, ...a);
358
- }, st = (e) => ce(e);
359
- let we, Ee;
360
- const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", ct = async (e, t, r, a) => {
646
+ return delete n.alg, delete n.use, ve.subtle.importKey("jwk", n, ...a);
647
+ }, Rt = (e) => ge(e);
648
+ let De, $e;
649
+ const Nt = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", xt = async (e, t, r, a) => {
361
650
  let n = e.get(t);
362
651
  if (n != null && n[a])
363
652
  return n[a];
364
- const o = await Yt({ ...r, alg: a });
653
+ const o = await Ir({ ...r, alg: a });
365
654
  return n ? n[a] = o : e.set(t, { [a]: o }), o;
366
- }, qt = (e, t) => {
367
- if (it(e)) {
655
+ }, vr = (e, t) => {
656
+ if (Nt(e)) {
368
657
  let r = e.export({ format: "jwk" });
369
- return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? st(r.k) : (Ee || (Ee = /* @__PURE__ */ new WeakMap()), ct(Ee, e, r, t));
658
+ return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Rt(r.k) : ($e || ($e = /* @__PURE__ */ new WeakMap()), xt($e, e, r, t));
370
659
  }
371
660
  return e;
372
- }, Qt = (e, t) => {
373
- if (it(e)) {
661
+ }, Ar = (e, t) => {
662
+ if (Nt(e)) {
374
663
  let r = e.export({ format: "jwk" });
375
- return r.k ? st(r.k) : (we || (we = /* @__PURE__ */ new WeakMap()), ct(we, e, r, t));
664
+ return r.k ? Rt(r.k) : (De || (De = /* @__PURE__ */ new WeakMap()), xt(De, e, r, t));
376
665
  }
377
666
  return e;
378
- }, Xt = { normalizePublicKey: qt, normalizePrivateKey: Qt }, U = (e, t, r = 0) => {
667
+ }, kr = { normalizePublicKey: vr, normalizePrivateKey: Ar }, K = (e, t, r = 0) => {
379
668
  r === 0 && (t.unshift(t.length), t.unshift(6));
380
669
  const a = e.indexOf(t[0], r);
381
670
  if (a === -1)
382
671
  return !1;
383
672
  const n = e.subarray(a, a + t.length);
384
- return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || U(e, t, a + 1);
385
- }, $e = (e) => {
673
+ return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || K(e, t, a + 1);
674
+ }, Ze = (e) => {
386
675
  switch (!0) {
387
- case U(e, [42, 134, 72, 206, 61, 3, 1, 7]):
676
+ case K(e, [42, 134, 72, 206, 61, 3, 1, 7]):
388
677
  return "P-256";
389
- case U(e, [43, 129, 4, 0, 34]):
678
+ case K(e, [43, 129, 4, 0, 34]):
390
679
  return "P-384";
391
- case U(e, [43, 129, 4, 0, 35]):
680
+ case K(e, [43, 129, 4, 0, 35]):
392
681
  return "P-521";
393
- case U(e, [43, 101, 110]):
682
+ case K(e, [43, 101, 110]):
394
683
  return "X25519";
395
- case U(e, [43, 101, 111]):
684
+ case K(e, [43, 101, 111]):
396
685
  return "X448";
397
- case U(e, [43, 101, 112]):
686
+ case K(e, [43, 101, 112]):
398
687
  return "Ed25519";
399
- case U(e, [43, 101, 113]):
688
+ case K(e, [43, 101, 113]):
400
689
  return "Ed448";
401
690
  default:
402
- throw new K("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
691
+ throw new B("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
403
692
  }
404
- }, Zt = async (e, t, r, a, n) => {
693
+ }, Sr = async (e, t, r, a, n) => {
405
694
  let o, s;
406
- const i = new Uint8Array(atob(r.replace(e, "")).split("").map((l) => l.charCodeAt(0)));
695
+ const i = new Uint8Array(atob(r.replace(e, "")).split("").map((h) => h.charCodeAt(0)));
407
696
  switch (a) {
408
697
  case "PS256":
409
698
  case "PS384":
@@ -437,43 +726,43 @@ const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
437
726
  case "ECDH-ES+A128KW":
438
727
  case "ECDH-ES+A192KW":
439
728
  case "ECDH-ES+A256KW": {
440
- const l = $e(i);
441
- o = l.startsWith("P-") ? { name: "ECDH", namedCurve: l } : { name: l }, s = [];
729
+ const h = Ze(i);
730
+ o = h.startsWith("P-") ? { name: "ECDH", namedCurve: h } : { name: h }, s = [];
442
731
  break;
443
732
  }
444
733
  case "EdDSA":
445
- o = { name: $e(i) }, s = ["verify"];
734
+ o = { name: Ze(i) }, s = ["verify"];
446
735
  break;
447
736
  default:
448
- throw new K('Invalid or unsupported "alg" (Algorithm) value');
737
+ throw new B('Invalid or unsupported "alg" (Algorithm) value');
449
738
  }
450
- return he.subtle.importKey(t, i, o, !1, s);
451
- }, er = (e, t, r) => Zt(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
452
- async function tr(e, t, r) {
739
+ return ve.subtle.importKey(t, i, o, !1, s);
740
+ }, _r = (e, t, r) => Sr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
741
+ async function Rr(e, t, r) {
453
742
  if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
454
743
  throw new TypeError('"spki" must be SPKI formatted string');
455
- return er(e, t);
744
+ return _r(e, t);
456
745
  }
457
- const le = (e) => e == null ? void 0 : e[Symbol.toStringTag], rr = (e, t) => {
746
+ const fe = (e) => e == null ? void 0 : e[Symbol.toStringTag], Nr = (e, t) => {
458
747
  if (!(t instanceof Uint8Array)) {
459
- if (!ot(t))
460
- throw new TypeError(nt(e, t, ...de, "Uint8Array"));
748
+ if (!_t(t))
749
+ throw new TypeError(St(e, t, ...Ee, "Uint8Array"));
461
750
  if (t.type !== "secret")
462
- throw new TypeError(`${le(t)} instances for symmetric algorithms must be of type "secret"`);
751
+ throw new TypeError(`${fe(t)} instances for symmetric algorithms must be of type "secret"`);
463
752
  }
464
- }, ar = (e, t, r) => {
465
- if (!ot(t))
466
- throw new TypeError(nt(e, t, ...de));
753
+ }, xr = (e, t, r) => {
754
+ if (!_t(t))
755
+ throw new TypeError(St(e, t, ...Ee));
467
756
  if (t.type === "secret")
468
- throw new TypeError(`${le(t)} instances for asymmetric algorithms must not be of type "secret"`);
757
+ throw new TypeError(`${fe(t)} instances for asymmetric algorithms must not be of type "secret"`);
469
758
  if (t.algorithm && r === "verify" && t.type === "private")
470
- throw new TypeError(`${le(t)} instances for asymmetric algorithm verifying must be of type "public"`);
759
+ throw new TypeError(`${fe(t)} instances for asymmetric algorithm verifying must be of type "public"`);
471
760
  if (t.algorithm && r === "encrypt" && t.type === "private")
472
- throw new TypeError(`${le(t)} instances for asymmetric algorithm encryption must be of type "public"`);
473
- }, nr = (e, t, r) => {
474
- e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? rr(e, t) : ar(e, t, r);
761
+ throw new TypeError(`${fe(t)} instances for asymmetric algorithm encryption must be of type "public"`);
762
+ }, Cr = (e, t, r) => {
763
+ e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? Nr(e, t) : xr(e, t, r);
475
764
  };
476
- function or(e, t, r, a, n) {
765
+ function Or(e, t, r, a, n) {
477
766
  if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
478
767
  throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
479
768
  if (!a || a.crit === void 0)
@@ -484,7 +773,7 @@ function or(e, t, r, a, n) {
484
773
  r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
485
774
  for (const s of a.crit) {
486
775
  if (!o.has(s))
487
- throw new K(`Extension Header Parameter "${s}" is not recognized`);
776
+ throw new B(`Extension Header Parameter "${s}" is not recognized`);
488
777
  if (n[s] === void 0)
489
778
  throw new e(`Extension Header Parameter "${s}" is missing`);
490
779
  if (o.get(s) && a[s] === void 0)
@@ -492,13 +781,13 @@ function or(e, t, r, a, n) {
492
781
  }
493
782
  return new Set(a.crit);
494
783
  }
495
- const sr = (e, t) => {
784
+ const Pr = (e, t) => {
496
785
  if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
497
786
  throw new TypeError(`"${e}" option must be an array of strings`);
498
787
  if (t)
499
788
  return new Set(t);
500
789
  };
501
- function ir(e, t) {
790
+ function Dr(e, t) {
502
791
  const r = `SHA-${e.slice(-3)}`;
503
792
  switch (e) {
504
793
  case "HS256":
@@ -520,103 +809,103 @@ function ir(e, t) {
520
809
  case "EdDSA":
521
810
  return { name: t.name };
522
811
  default:
523
- throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);
812
+ throw new B(`alg ${e} is not supported either by JOSE or your javascript runtime`);
524
813
  }
525
814
  }
526
- async function cr(e, t, r) {
527
- if (t = await Xt.normalizePublicKey(t, e), tt(t))
528
- return Gt(t, e, r), t;
815
+ async function $r(e, t, r) {
816
+ if (t = await kr.normalizePublicKey(t, e), vt(t))
817
+ return yr(t, e, r), t;
529
818
  if (t instanceof Uint8Array) {
530
819
  if (!e.startsWith("HS"))
531
- throw new TypeError(Pe(t, ...de));
532
- return he.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
820
+ throw new TypeError(Xe(t, ...Ee));
821
+ return ve.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
533
822
  }
534
- throw new TypeError(Pe(t, ...de, "Uint8Array"));
823
+ throw new TypeError(Xe(t, ...Ee, "Uint8Array"));
535
824
  }
536
- const lr = async (e, t, r, a) => {
537
- const n = await cr(e, t, "verify");
538
- Ft(e, n);
539
- const o = ir(e, n.algorithm);
825
+ const Lr = async (e, t, r, a) => {
826
+ const n = await $r(e, t, "verify");
827
+ wr(e, n);
828
+ const o = Dr(e, n.algorithm);
540
829
  try {
541
- return await he.subtle.verify(o, n, r, a);
830
+ return await ve.subtle.verify(o, n, r, a);
542
831
  } catch {
543
832
  return !1;
544
833
  }
545
834
  };
546
- async function dr(e, t, r) {
547
- if (!Ie(e))
548
- throw new S("Flattened JWS must be an object");
835
+ async function Mr(e, t, r) {
836
+ if (!Ge(e))
837
+ throw new A("Flattened JWS must be an object");
549
838
  if (e.protected === void 0 && e.header === void 0)
550
- throw new S('Flattened JWS must have either of the "protected" or "header" members');
839
+ throw new A('Flattened JWS must have either of the "protected" or "header" members');
551
840
  if (e.protected !== void 0 && typeof e.protected != "string")
552
- throw new S("JWS Protected Header incorrect type");
841
+ throw new A("JWS Protected Header incorrect type");
553
842
  if (e.payload === void 0)
554
- throw new S("JWS Payload missing");
843
+ throw new A("JWS Payload missing");
555
844
  if (typeof e.signature != "string")
556
- throw new S("JWS Signature missing or incorrect type");
557
- if (e.header !== void 0 && !Ie(e.header))
558
- throw new S("JWS Unprotected Header incorrect type");
845
+ throw new A("JWS Signature missing or incorrect type");
846
+ if (e.header !== void 0 && !Ge(e.header))
847
+ throw new A("JWS Unprotected Header incorrect type");
559
848
  let a = {};
560
849
  if (e.protected)
561
850
  try {
562
- const f = ce(e.protected);
563
- a = JSON.parse(pe.decode(f));
851
+ const y = ge(e.protected);
852
+ a = JSON.parse(Ae.decode(y));
564
853
  } catch {
565
- throw new S("JWS Protected Header is invalid");
854
+ throw new A("JWS Protected Header is invalid");
566
855
  }
567
- if (!Vt(a, e.header))
568
- throw new S("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
856
+ if (!br(a, e.header))
857
+ throw new A("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
569
858
  const n = {
570
859
  ...a,
571
860
  ...e.header
572
- }, o = or(S, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
861
+ }, o = Or(A, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
573
862
  let s = !0;
574
863
  if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
575
- throw new S('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
864
+ throw new A('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
576
865
  const { alg: i } = n;
577
866
  if (typeof i != "string" || !i)
578
- throw new S('JWS "alg" (Algorithm) Header Parameter missing or invalid');
579
- const l = r && sr("algorithms", r.algorithms);
580
- if (l && !l.has(i))
581
- throw new Kt('"alg" (Algorithm) Header Parameter value not allowed');
867
+ throw new A('JWS "alg" (Algorithm) Header Parameter missing or invalid');
868
+ const h = r && Pr("algorithms", r.algorithms);
869
+ if (h && !h.has(i))
870
+ throw new hr('"alg" (Algorithm) Header Parameter value not allowed');
582
871
  if (s) {
583
872
  if (typeof e.payload != "string")
584
- throw new S("JWS Payload must be a string");
873
+ throw new A("JWS Payload must be a string");
585
874
  } else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
586
- throw new S("JWS Payload must be a string or an Uint8Array instance");
587
- let d = !1;
588
- typeof t == "function" && (t = await t(a, e), d = !0), nr(i, t, "verify");
589
- const h = Ut(X.encode(e.protected ?? ""), X.encode("."), typeof e.payload == "string" ? X.encode(e.payload) : e.payload);
590
- let u;
875
+ throw new A("JWS Payload must be a string or an Uint8Array instance");
876
+ let u = !1;
877
+ typeof t == "function" && (t = await t(a, e), u = !0), Cr(i, t, "verify");
878
+ const d = ur(oe.encode(e.protected ?? ""), oe.encode("."), typeof e.payload == "string" ? oe.encode(e.payload) : e.payload);
879
+ let p;
591
880
  try {
592
- u = ce(e.signature);
881
+ p = ge(e.signature);
593
882
  } catch {
594
- throw new S("Failed to base64url decode the signature");
883
+ throw new A("Failed to base64url decode the signature");
595
884
  }
596
- if (!await lr(i, t, u, h))
597
- throw new Bt();
598
- let m;
885
+ if (!await Lr(i, t, p, d))
886
+ throw new pr();
887
+ let l;
599
888
  if (s)
600
889
  try {
601
- m = ce(e.payload);
890
+ l = ge(e.payload);
602
891
  } catch {
603
- throw new S("Failed to base64url decode the payload");
892
+ throw new A("Failed to base64url decode the payload");
604
893
  }
605
- else typeof e.payload == "string" ? m = X.encode(e.payload) : m = e.payload;
606
- const p = { payload: m };
607
- return e.protected !== void 0 && (p.protectedHeader = a), e.header !== void 0 && (p.unprotectedHeader = e.header), d ? { ...p, key: t } : p;
894
+ else typeof e.payload == "string" ? l = oe.encode(e.payload) : l = e.payload;
895
+ const m = { payload: l };
896
+ return e.protected !== void 0 && (m.protectedHeader = a), e.header !== void 0 && (m.unprotectedHeader = e.header), u ? { ...m, key: t } : m;
608
897
  }
609
- async function ur(e, t, r) {
610
- if (e instanceof Uint8Array && (e = pe.decode(e)), typeof e != "string")
611
- throw new S("Compact JWS must be a string or Uint8Array");
898
+ async function Ur(e, t, r) {
899
+ if (e instanceof Uint8Array && (e = Ae.decode(e)), typeof e != "string")
900
+ throw new A("Compact JWS must be a string or Uint8Array");
612
901
  const { 0: a, 1: n, 2: o, length: s } = e.split(".");
613
902
  if (s !== 3)
614
- throw new S("Invalid Compact JWS");
615
- const i = await dr({ payload: n, protected: a, signature: o }, t, r), l = { payload: i.payload, protectedHeader: i.protectedHeader };
616
- return typeof t == "function" ? { ...l, key: i.key } : l;
903
+ throw new A("Invalid Compact JWS");
904
+ const i = await Mr({ payload: n, protected: a, signature: o }, t, r), h = { payload: i.payload, protectedHeader: i.protectedHeader };
905
+ return typeof t == "function" ? { ...h, key: i.key } : h;
617
906
  }
618
- const mr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, _e = dt * 24, hr = _e * 7, pr = _e * 365.25, gr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, Ue = (e) => {
619
- const t = gr.exec(e);
907
+ const Hr = (e) => Math.floor(e.getTime() / 1e3), Ct = 60, Ot = Ct * 60, Ye = Ot * 24, Kr = Ye * 7, Br = Ye * 365.25, Gr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, et = (e) => {
908
+ const t = Gr.exec(e);
620
909
  if (!t || t[4] && t[1])
621
910
  throw new TypeError("Invalid time period format");
622
911
  const r = parseFloat(t[2]), a = t[3].toLowerCase();
@@ -634,227 +923,227 @@ const mr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, _e = dt
634
923
  case "min":
635
924
  case "mins":
636
925
  case "m":
637
- n = Math.round(r * lt);
926
+ n = Math.round(r * Ct);
638
927
  break;
639
928
  case "hour":
640
929
  case "hours":
641
930
  case "hr":
642
931
  case "hrs":
643
932
  case "h":
644
- n = Math.round(r * dt);
933
+ n = Math.round(r * Ot);
645
934
  break;
646
935
  case "day":
647
936
  case "days":
648
937
  case "d":
649
- n = Math.round(r * _e);
938
+ n = Math.round(r * Ye);
650
939
  break;
651
940
  case "week":
652
941
  case "weeks":
653
942
  case "w":
654
- n = Math.round(r * hr);
943
+ n = Math.round(r * Kr);
655
944
  break;
656
945
  default:
657
- n = Math.round(r * pr);
946
+ n = Math.round(r * Br);
658
947
  break;
659
948
  }
660
949
  return t[1] === "-" || t[4] === "ago" ? -n : n;
661
- }, He = (e) => e.toLowerCase().replace(/^application\//, ""), fr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, yr = (e, t, r = {}) => {
950
+ }, tt = (e) => e.toLowerCase().replace(/^application\//, ""), Vr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, Wr = (e, t, r = {}) => {
662
951
  let a;
663
952
  try {
664
- a = JSON.parse(pe.decode(t));
953
+ a = JSON.parse(Ae.decode(t));
665
954
  } catch {
666
955
  }
667
- if (!Ie(a))
668
- throw new rt("JWT Claims Set must be a top-level JSON object");
956
+ if (!Ge(a))
957
+ throw new At("JWT Claims Set must be a top-level JSON object");
669
958
  const { typ: n } = r;
670
- if (n && (typeof e.typ != "string" || He(e.typ) !== He(n)))
959
+ if (n && (typeof e.typ != "string" || tt(e.typ) !== tt(n)))
671
960
  throw new L('unexpected "typ" JWT header value', a, "typ", "check_failed");
672
- const { requiredClaims: o = [], issuer: s, subject: i, audience: l, maxTokenAge: d } = r, h = [...o];
673
- d !== void 0 && h.push("iat"), l !== void 0 && h.push("aud"), i !== void 0 && h.push("sub"), s !== void 0 && h.push("iss");
674
- for (const f of new Set(h.reverse()))
675
- if (!(f in a))
676
- throw new L(`missing required "${f}" claim`, a, f, "missing");
961
+ const { requiredClaims: o = [], issuer: s, subject: i, audience: h, maxTokenAge: u } = r, d = [...o];
962
+ u !== void 0 && d.push("iat"), h !== void 0 && d.push("aud"), i !== void 0 && d.push("sub"), s !== void 0 && d.push("iss");
963
+ for (const y of new Set(d.reverse()))
964
+ if (!(y in a))
965
+ throw new L(`missing required "${y}" claim`, a, y, "missing");
677
966
  if (s && !(Array.isArray(s) ? s : [s]).includes(a.iss))
678
967
  throw new L('unexpected "iss" claim value', a, "iss", "check_failed");
679
968
  if (i && a.sub !== i)
680
969
  throw new L('unexpected "sub" claim value', a, "sub", "check_failed");
681
- if (l && !fr(a.aud, typeof l == "string" ? [l] : l))
970
+ if (h && !Vr(a.aud, typeof h == "string" ? [h] : h))
682
971
  throw new L('unexpected "aud" claim value', a, "aud", "check_failed");
683
- let u;
972
+ let p;
684
973
  switch (typeof r.clockTolerance) {
685
974
  case "string":
686
- u = Ue(r.clockTolerance);
975
+ p = et(r.clockTolerance);
687
976
  break;
688
977
  case "number":
689
- u = r.clockTolerance;
978
+ p = r.clockTolerance;
690
979
  break;
691
980
  case "undefined":
692
- u = 0;
981
+ p = 0;
693
982
  break;
694
983
  default:
695
984
  throw new TypeError("Invalid clockTolerance option type");
696
985
  }
697
- const { currentDate: m } = r, p = mr(m || /* @__PURE__ */ new Date());
698
- if ((a.iat !== void 0 || d) && typeof a.iat != "number")
986
+ const { currentDate: l } = r, m = Hr(l || /* @__PURE__ */ new Date());
987
+ if ((a.iat !== void 0 || u) && typeof a.iat != "number")
699
988
  throw new L('"iat" claim must be a number', a, "iat", "invalid");
700
989
  if (a.nbf !== void 0) {
701
990
  if (typeof a.nbf != "number")
702
991
  throw new L('"nbf" claim must be a number', a, "nbf", "invalid");
703
- if (a.nbf > p + u)
992
+ if (a.nbf > m + p)
704
993
  throw new L('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
705
994
  }
706
995
  if (a.exp !== void 0) {
707
996
  if (typeof a.exp != "number")
708
997
  throw new L('"exp" claim must be a number', a, "exp", "invalid");
709
- if (a.exp <= p - u)
710
- throw new Le('"exp" claim timestamp check failed', a, "exp", "check_failed");
711
- }
712
- if (d) {
713
- const f = p - a.iat, E = typeof d == "number" ? d : Ue(d);
714
- if (f - u > E)
715
- throw new Le('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
716
- if (f < 0 - u)
998
+ if (a.exp <= m - p)
999
+ throw new Qe('"exp" claim timestamp check failed', a, "exp", "check_failed");
1000
+ }
1001
+ if (u) {
1002
+ const y = m - a.iat, w = typeof u == "number" ? u : et(u);
1003
+ if (y - p > w)
1004
+ throw new Qe('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
1005
+ if (y < 0 - p)
717
1006
  throw new L('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
718
1007
  }
719
1008
  return a;
720
1009
  };
721
- async function br(e, t, r) {
1010
+ async function Yr(e, t, r) {
722
1011
  var a;
723
- const n = await ur(e, t, r);
1012
+ const n = await Ur(e, t, r);
724
1013
  if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
725
- throw new rt("JWTs MUST NOT use unencoded payload");
726
- const o = { payload: yr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
1014
+ throw new At("JWTs MUST NOT use unencoded payload");
1015
+ const o = { payload: Wr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
727
1016
  return typeof t == "function" ? { ...o, key: n.key } : o;
728
1017
  }
729
- const Y = async (e) => {
1018
+ const ae = async (e) => {
730
1019
  try {
731
- const t = _.ALG, r = await tr($t, t);
732
- return await br(e, r, {
733
- issuer: _.ISSUER
1020
+ const t = R.ALG, r = await Rr(dr, t);
1021
+ return await Yr(e, r, {
1022
+ issuer: R.ISSUER
734
1023
  });
735
1024
  } catch {
736
1025
  return;
737
1026
  }
738
1027
  };
739
- var v = [];
740
- for (var ve = 0; ve < 256; ++ve)
741
- v.push((ve + 256).toString(16).slice(1));
742
- function wr(e, t = 0) {
743
- return (v[e[t + 0]] + v[e[t + 1]] + v[e[t + 2]] + v[e[t + 3]] + "-" + v[e[t + 4]] + v[e[t + 5]] + "-" + v[e[t + 6]] + v[e[t + 7]] + "-" + v[e[t + 8]] + v[e[t + 9]] + "-" + v[e[t + 10]] + v[e[t + 11]] + v[e[t + 12]] + v[e[t + 13]] + v[e[t + 14]] + v[e[t + 15]]).toLowerCase();
1028
+ var I = [];
1029
+ for (var Le = 0; Le < 256; ++Le)
1030
+ I.push((Le + 256).toString(16).slice(1));
1031
+ function jr(e, t = 0) {
1032
+ 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();
744
1033
  }
745
- var ee, Er = new Uint8Array(16);
746
- function vr() {
747
- if (!ee && (ee = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ee))
1034
+ var ie, Fr = new Uint8Array(16);
1035
+ function Jr() {
1036
+ if (!ie && (ie = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ie))
748
1037
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
749
- return ee(Er);
1038
+ return ie(Fr);
750
1039
  }
751
- var kr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
752
- const Ke = {
753
- randomUUID: kr
1040
+ var zr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1041
+ const rt = {
1042
+ randomUUID: zr
754
1043
  };
755
- function Be(e, t, r) {
756
- if (Ke.randomUUID && !t && !e)
757
- return Ke.randomUUID();
1044
+ function at(e, t, r) {
1045
+ if (rt.randomUUID && !t && !e)
1046
+ return rt.randomUUID();
758
1047
  e = e || {};
759
- var a = e.random || (e.rng || vr)();
760
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, wr(a);
1048
+ var a = e.random || (e.rng || Jr)();
1049
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, jr(a);
761
1050
  }
762
- const We = globalThis.crypto, Sr = (e) => `${Be()}${Be()}`.slice(0, e), Tr = (e) => btoa(
1051
+ const nt = globalThis.crypto, qr = (e) => `${at()}${at()}`.slice(0, e), Qr = (e) => btoa(
763
1052
  [...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
764
1053
  );
765
- async function Ar(e) {
766
- if (!We.subtle)
1054
+ async function Xr(e) {
1055
+ if (!nt.subtle)
767
1056
  throw new Error(
768
1057
  "crypto.subtle is available only in secure contexts (HTTPS)."
769
1058
  );
770
- const t = new TextEncoder().encode(e), r = await We.subtle.digest("SHA-256", t);
771
- return Tr(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1059
+ const t = new TextEncoder().encode(e), r = await nt.subtle.digest("SHA-256", t);
1060
+ return Qr(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
772
1061
  }
773
- async function Ir(e) {
774
- const t = Sr(43), r = await Ar(t);
1062
+ async function Zr(e) {
1063
+ const t = qr(43), r = await Xr(t);
775
1064
  return {
776
1065
  code_verifier: t,
777
1066
  code_challenge: r
778
1067
  };
779
1068
  }
780
- function ut(e, t) {
1069
+ function Pt(e, t) {
781
1070
  window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
782
1071
  }
783
- const je = (e, t) => {
1072
+ const ot = (e, t) => {
784
1073
  const r = JSON.stringify(
785
1074
  typeof t == "function" ? t() : t
786
1075
  );
787
- window.localStorage.setItem(e, r), ut(e, r);
788
- }, _r = (e) => {
789
- window.localStorage.removeItem(e), ut(e, null);
790
- }, Ge = (e) => window.localStorage.getItem(e), xr = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
791
- function te({
1076
+ window.localStorage.setItem(e, r), Pt(e, r);
1077
+ }, ea = (e) => {
1078
+ window.localStorage.removeItem(e), Pt(e, null);
1079
+ }, st = (e) => window.localStorage.getItem(e), ta = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
1080
+ function ce({
792
1081
  key: e,
793
1082
  initialValue: t
794
1083
  }) {
795
- const r = Nt(xr, () => Ge(e)), a = z(
1084
+ const r = Xt(ta, () => st(e)), a = re(
796
1085
  (s) => {
797
1086
  try {
798
1087
  const i = typeof s == "function" ? s(JSON.parse(r)) : s;
799
- i == null ? _r(e) : je(e, i);
1088
+ i == null ? ea(e) : ot(e, i);
800
1089
  } catch (i) {
801
1090
  console.warn(i);
802
1091
  }
803
1092
  },
804
1093
  [e, r]
805
- ), n = z(() => {
1094
+ ), n = re(() => {
806
1095
  a(t);
807
- }, [t, a]), o = z(() => {
1096
+ }, [t, a]), o = re(() => {
808
1097
  a(null);
809
1098
  }, [a]);
810
- return V(() => {
1099
+ return z(() => {
811
1100
  try {
812
- Ge(e) === null && typeof t < "u" && je(e, t);
1101
+ st(e) === null && typeof t < "u" && ot(e, t);
813
1102
  } catch (s) {
814
1103
  console.warn(s);
815
1104
  }
816
1105
  }, [e, t]), [r ? JSON.parse(r) : null, a, n, o];
817
1106
  }
818
- var k = [];
819
- for (var ke = 0; ke < 256; ++ke)
820
- k.push((ke + 256).toString(16).slice(1));
821
- function Nr(e, t = 0) {
822
- return (k[e[t + 0]] + k[e[t + 1]] + k[e[t + 2]] + k[e[t + 3]] + "-" + k[e[t + 4]] + k[e[t + 5]] + "-" + k[e[t + 6]] + k[e[t + 7]] + "-" + k[e[t + 8]] + k[e[t + 9]] + "-" + k[e[t + 10]] + k[e[t + 11]] + k[e[t + 12]] + k[e[t + 13]] + k[e[t + 14]] + k[e[t + 15]]).toLowerCase();
1107
+ var v = [];
1108
+ for (var Me = 0; Me < 256; ++Me)
1109
+ v.push((Me + 256).toString(16).slice(1));
1110
+ function ra(e, t = 0) {
1111
+ return (v[e[t + 0]] + v[e[t + 1]] + v[e[t + 2]] + v[e[t + 3]] + "-" + v[e[t + 4]] + v[e[t + 5]] + "-" + v[e[t + 6]] + v[e[t + 7]] + "-" + v[e[t + 8]] + v[e[t + 9]] + "-" + v[e[t + 10]] + v[e[t + 11]] + v[e[t + 12]] + v[e[t + 13]] + v[e[t + 14]] + v[e[t + 15]]).toLowerCase();
823
1112
  }
824
- var re, Cr = new Uint8Array(16);
825
- function Rr() {
826
- if (!re && (re = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !re))
1113
+ var le, aa = new Uint8Array(16);
1114
+ function na() {
1115
+ if (!le && (le = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !le))
827
1116
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
828
- return re(Cr);
1117
+ return le(aa);
829
1118
  }
830
- var Or = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
831
- const Ve = {
832
- randomUUID: Or
1119
+ var oa = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1120
+ const it = {
1121
+ randomUUID: oa
833
1122
  };
834
- function Dr(e, t, r) {
835
- if (Ve.randomUUID && !t && !e)
836
- return Ve.randomUUID();
1123
+ function Ue(e, t, r) {
1124
+ if (it.randomUUID && !t && !e)
1125
+ return it.randomUUID();
837
1126
  e = e || {};
838
- var a = e.random || (e.rng || Rr)();
839
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Nr(a);
1127
+ var a = e.random || (e.rng || na)();
1128
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ra(a);
840
1129
  }
841
- const ae = "Oops! It looks like your session has expired. For your security, please log in again to continue.", Mr = "Your session has been successfully terminated.", Je = "Login failed. Please try again.", Se = "Error getting access token, please re-authenticate.", Lr = "You forgot to wrap your component in <AuthProvider>.", Fe = {
1130
+ const de = "Oops! It looks like your session has expired. For your security, please log in again to continue.", sa = "Your session has been successfully terminated.", ue = "Login failed. Please try again.", He = "Error getting access token, please re-authenticate.", ia = "You forgot to wrap your component in <AuthProvider>.", we = {
842
1131
  dev: "https://auth.gizmette.local.com:3003",
843
- prod: "https://mylogin.gizmette.com"
844
- }, ne = "@@auth@@", Pr = process.env.NODE_ENV === "production", $r = !Pr, ge = async ({
1132
+ prod: "https://mylogin.gizmette.com/auth"
1133
+ }, me = "@@auth@@", ee = "LOADING", te = "LOGIN", Dt = "LOGOUT", ca = process.env.NODE_ENV === "production", $t = !ca, ke = async ({
845
1134
  type: e,
846
1135
  clientId: t,
847
1136
  params: r = {}
848
1137
  }) => {
849
1138
  try {
850
1139
  const a = await fetch(
851
- $r ? `${Fe.dev}/${e}` : `${Fe.prod}/${e}`,
1140
+ $t ? `${we.dev}/${e}` : `${we.prod}/${e}`,
852
1141
  {
853
1142
  credentials: "include",
854
1143
  method: "POST",
855
1144
  headers: {
856
1145
  "Content-Type": "application/json",
857
- [Pt.CLIENT_ID]: `${t}`
1146
+ [It.CLIENT_ID]: `${t}`
858
1147
  },
859
1148
  body: JSON.stringify(r)
860
1149
  }
@@ -870,7 +1159,7 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
870
1159
  } catch (a) {
871
1160
  return console.error(a), { status: 500, data: [] };
872
1161
  }
873
- }, Ur = async ({
1162
+ }, la = async ({
874
1163
  userId: e,
875
1164
  idToken: t,
876
1165
  accessToken: r,
@@ -880,8 +1169,8 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
880
1169
  }) => {
881
1170
  try {
882
1171
  return {
883
- status: (await ge({
884
- type: me.LOGOUT,
1172
+ status: (await ke({
1173
+ type: Ie.LOGOUT,
885
1174
  clientId: n,
886
1175
  params: {
887
1176
  userId: e,
@@ -897,7 +1186,7 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
897
1186
  status: !1
898
1187
  };
899
1188
  }
900
- }, ze = async ({
1189
+ }, ct = async ({
901
1190
  username: e,
902
1191
  password: t,
903
1192
  clientId: r,
@@ -906,28 +1195,28 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
906
1195
  sessionExpiration: o,
907
1196
  code: s,
908
1197
  code_verifier: i,
909
- domain: l
1198
+ domain: h
910
1199
  }) => {
911
1200
  try {
912
- const d = await ge({
913
- type: me.AUTHENTICATE,
1201
+ const u = await ke({
1202
+ type: Ie.AUTHENTICATE,
914
1203
  clientId: r,
915
1204
  params: {
916
- type: n || Q.ID_AND_ACCESS_TOKEN,
1205
+ type: n || q.ID_AND_ACCESS_TOKEN,
917
1206
  username: e,
918
1207
  password: t,
919
1208
  sessionExpiration: o,
920
1209
  nonce: a,
921
1210
  code: s,
922
1211
  code_verifier: i,
923
- domain: l
1212
+ domain: h
924
1213
  }
925
- }), h = await Y(d.data.idToken);
926
- return h && h.payload[_.USER_ID_KEY] !== "" && h.payload[_.NONCE_KEY] === a ? {
927
- idToken: d.data.idToken,
928
- accessToken: d.data.accessToken,
929
- refreshToken: d.data.refreshToken,
930
- userId: h.payload[_.USER_ID_KEY],
1214
+ }), d = await ae(u.data.idToken);
1215
+ return d && d.payload[R.USER_ID_KEY] !== "" && d.payload[R.NONCE_KEY] === a ? {
1216
+ idToken: u.data.idToken,
1217
+ accessToken: u.data.accessToken,
1218
+ refreshToken: u.data.refreshToken,
1219
+ userId: d.payload[R.USER_ID_KEY],
931
1220
  status: !0
932
1221
  } : {
933
1222
  status: !1
@@ -937,17 +1226,17 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
937
1226
  status: !1
938
1227
  };
939
1228
  }
940
- }, Hr = async ({
1229
+ }, da = async ({
941
1230
  nonce: e,
942
1231
  clientId: t,
943
1232
  code_challenge: r
944
1233
  }) => {
945
1234
  try {
946
- const a = await ge({
947
- type: me.CODE,
1235
+ const a = await ke({
1236
+ type: Ie.CODE,
948
1237
  clientId: t,
949
1238
  params: {
950
- type: Q.CODE,
1239
+ type: q.CODE,
951
1240
  nonce: e,
952
1241
  code_challenge: r
953
1242
  }
@@ -963,7 +1252,7 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
963
1252
  status: !1
964
1253
  };
965
1254
  }
966
- }, Kr = async ({
1255
+ }, ua = async ({
967
1256
  clientId: e,
968
1257
  userId: t,
969
1258
  nonce: r,
@@ -972,22 +1261,22 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
972
1261
  domain: o
973
1262
  }) => {
974
1263
  try {
975
- const s = await ge({
976
- type: me.AUTHENTICATE,
1264
+ const s = await ke({
1265
+ type: Ie.AUTHENTICATE,
977
1266
  clientId: e,
978
1267
  params: {
979
- type: Q.REFRESH_TOKEN,
1268
+ type: q.REFRESH_TOKEN,
980
1269
  userId: t,
981
1270
  nonce: r,
982
1271
  refreshToken: a,
983
1272
  accessToken: n,
984
1273
  domain: o
985
1274
  }
986
- }), i = await Y(s.data.accessToken);
987
- return i && i.payload[_.USER_ID_KEY] !== "" && i.payload[_.NONCE_KEY] === r ? {
1275
+ }), i = await ae(s.data.accessToken);
1276
+ return i && i.payload[R.USER_ID_KEY] !== "" && i.payload[R.NONCE_KEY] === r ? {
988
1277
  accessToken: s.data.accessToken,
989
1278
  refreshToken: s.data.refreshToken,
990
- userId: i.payload[_.USER_ID_KEY],
1279
+ userId: i.payload[R.USER_ID_KEY],
991
1280
  status: !0
992
1281
  } : {
993
1282
  status: !1
@@ -997,10 +1286,135 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
997
1286
  status: !1
998
1287
  };
999
1288
  }
1289
+ }, he = {
1290
+ GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
1291
+ $clientId: String!,
1292
+ $username: String!,
1293
+ $id: String!) {
1294
+ getPasskeyRegistrationOptions(clientId: $clientId, username: $username, id: $id) {
1295
+ challenge
1296
+ rp {
1297
+ id
1298
+ name
1299
+ }
1300
+ user {
1301
+ id
1302
+ name
1303
+ displayName
1304
+ }
1305
+ pubKeyCredParams {
1306
+ type
1307
+ alg
1308
+ }
1309
+ timeout
1310
+
1311
+ attestation
1312
+ }
1313
+ }`,
1314
+ VERIFY_REGISTRATION: `mutation VerifyPasskeyRegistration(
1315
+ $clientId: String!,
1316
+ $username: String!,
1317
+ $id: String!,
1318
+ $registration: RegistrationOptionsInput!) {
1319
+ verifyPasskeyRegistration(
1320
+ clientId: $clientId,
1321
+ username: $username,
1322
+ id: $id,
1323
+ registration: $registration) {
1324
+ status
1325
+ message
1326
+ }
1327
+ }`,
1328
+ GET_AUTHENTICATION_OPTIONS: `mutation GetPasskeyAuthenticationOptions(
1329
+ $id: String!,
1330
+ $clientId: String!,
1331
+ ) {
1332
+ getPasskeyAuthenticationOptions(
1333
+ id: $id,
1334
+ clientId: $clientId) {
1335
+ rpId,
1336
+ challenge,
1337
+ allowCredentials,
1338
+ timeout,
1339
+ userVerification,
1340
+ }
1341
+ }`,
1342
+ VERIFY_AUTHENTICATION: `mutation VerifyPasskeyAuthentication(
1343
+ $clientId: String!,
1344
+ $id: String!,
1345
+ $authentication: AuthenticationOptionsInput!,
1346
+ $nonce: String!,
1347
+ $domain: String) {
1348
+ verifyPasskeyAuthentication(
1349
+ clientId: $clientId,
1350
+ id: $id,
1351
+ authentication: $authentication,
1352
+ nonce: $nonce,
1353
+ domain: $domain) {
1354
+ status,
1355
+ idToken,
1356
+ accessToken,
1357
+ refreshToken,
1358
+ userId,
1359
+ username,
1360
+ }
1361
+ }`
1362
+ }, Y = {
1363
+ GET_REGISTRATION_OPTIONS: {
1364
+ schema: he.GET_REGISTRATION_OPTIONS,
1365
+ method: "getPasskeyRegistrationOptions"
1366
+ },
1367
+ VERIFY_REGISTRATION: {
1368
+ schema: he.VERIFY_REGISTRATION,
1369
+ method: "verifyPasskeyRegistration"
1370
+ },
1371
+ GET_AUTHENTICATION_OPTIONS: {
1372
+ schema: he.GET_AUTHENTICATION_OPTIONS,
1373
+ method: "getPasskeyAuthenticationOptions"
1374
+ },
1375
+ VERIFY_AUTHENTICATION: {
1376
+ schema: he.VERIFY_AUTHENTICATION,
1377
+ method: "verifyPasskeyAuthentication"
1378
+ }
1379
+ }, j = async ({
1380
+ accessToken: e,
1381
+ type: t,
1382
+ clientId: r,
1383
+ params: a = {}
1384
+ }) => {
1385
+ try {
1386
+ const n = t != null && t.data ? t.data(a) : a, o = `Bearer ${e}`, s = await fetch(
1387
+ $t ? `${we.dev}/graphql` : `${we.prod}/graphql`,
1388
+ {
1389
+ method: "POST",
1390
+ credentials: "include",
1391
+ headers: {
1392
+ authorization: o,
1393
+ "Content-Type": "application/json",
1394
+ Accept: "application/json",
1395
+ [It.CLIENT_ID]: `${r}`
1396
+ },
1397
+ body: JSON.stringify({
1398
+ query: t.schema,
1399
+ variables: n
1400
+ })
1401
+ }
1402
+ );
1403
+ if (s.status !== 200)
1404
+ return { status: s.status, data: [] };
1405
+ const { data: i, errors: h } = await s.json();
1406
+ return {
1407
+ status: s.status,
1408
+ data: i[t.method],
1409
+ errors: h
1410
+ };
1411
+ } catch (n) {
1412
+ return console.error(n), { status: 500, data: [] };
1413
+ }
1000
1414
  };
1001
- class Br {
1415
+ class ma {
1002
1416
  constructor(t = null, r = null) {
1003
- ye(this, "refreshTokenPromise", null), ye(this, "accessToken"), ye(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1417
+ Ce(this, "refreshTokenPromise", null), Ce(this, "accessToken"), Ce(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1004
1418
  }
1005
1419
  async refreshtoken({
1006
1420
  clientId: t,
@@ -1026,9 +1440,9 @@ class Br {
1026
1440
  nonce: a,
1027
1441
  domain: n
1028
1442
  }) {
1029
- const o = await Y(this.refreshToken);
1030
- if (o && o.payload[_.USER_ID_KEY] !== "") {
1031
- const s = await Kr({
1443
+ const o = await ae(this.refreshToken);
1444
+ if (o && o.payload[R.USER_ID_KEY] !== "") {
1445
+ const s = await ua({
1032
1446
  clientId: t,
1033
1447
  userId: r,
1034
1448
  nonce: a,
@@ -1049,201 +1463,319 @@ class Br {
1049
1463
  };
1050
1464
  }
1051
1465
  }
1052
- const oe = () => {
1053
- throw new Error(Lr);
1054
- }, mt = xt({
1466
+ const F = () => {
1467
+ throw new Error(ia);
1468
+ }, Lt = Qt({
1055
1469
  isAuthenticated: !1,
1056
1470
  isLoading: !1,
1057
- login: oe,
1058
- logout: oe,
1059
- getAccessToken: oe,
1060
- getIdToken: oe,
1471
+ authenticationType: null,
1472
+ login: F,
1473
+ logout: F,
1474
+ getAccessToken: F,
1475
+ getIdToken: F,
1476
+ registeringForPasskey: F,
1477
+ loginWithPasskey: F,
1478
+ logoutReason: ""
1479
+ }), ha = H.createContext({
1480
+ state: {
1481
+ isLoading: !0,
1482
+ isAuthenticated: !1,
1483
+ authenticationType: null,
1484
+ user: void 0,
1485
+ logoutReason: ""
1486
+ },
1487
+ dispatch: () => {
1488
+ }
1489
+ }), pa = (e, t) => (t == null ? void 0 : t.type) === ee ? {
1490
+ ...e,
1491
+ isLoading: t.payload.isLoading
1492
+ } : (t == null ? void 0 : t.type) === te ? {
1493
+ ...e,
1494
+ isLoading: !1,
1495
+ isAuthenticated: !0,
1496
+ user: t.payload.user,
1497
+ authenticationType: t.payload.authenticationType,
1061
1498
  logoutReason: ""
1062
- }), Wr = ({
1499
+ } : (t == null ? void 0 : t.type) === Dt ? {
1500
+ ...e,
1501
+ isLoading: !1,
1502
+ isAuthenticated: !1,
1503
+ user: void 0,
1504
+ authenticationType: null,
1505
+ logoutReason: t.payload.logoutReason
1506
+ } : e, ga = ({
1063
1507
  children: e,
1064
1508
  sessionExpiration: t,
1065
1509
  clientId: r,
1066
1510
  domain: a = ""
1067
1511
  }) => {
1068
- const n = j(!1), [o, s, , i] = te({
1069
- key: `${ne}::${r}::@@user@@`
1070
- }), [l, d, , h] = te({
1071
- key: `${ne}::${r}::@@access@@`
1072
- }), [u, m, , p] = te(
1073
- {
1074
- key: `${ne}::${r}::@@refresh@@`
1075
- }
1076
- ), [f, E, , x] = te({
1077
- key: `${ne}::${r}::@@nonce@@`
1078
- }), D = new Br(l, u), [A, w] = H({
1512
+ const [n, o] = ht(pa, {
1079
1513
  isLoading: !0,
1080
1514
  isAuthenticated: !1,
1515
+ authenticationType: null,
1081
1516
  user: void 0,
1082
1517
  logoutReason: ""
1083
- }), M = z(
1084
- (y) => {
1085
- console.warn(y), w({
1086
- isLoading: !0,
1087
- isAuthenticated: !1,
1088
- user: void 0,
1089
- logoutReason: y || ae
1090
- }), i(), h(), p(), x();
1518
+ }), s = V(!1), [i, h, , u] = ce({
1519
+ key: `${me}::${r}::@@user@@`
1520
+ }), [d, p, , l] = ce({
1521
+ key: `${me}::${r}::@@access@@`
1522
+ }), [m, y, , w] = ce(
1523
+ {
1524
+ key: `${me}::${r}::@@refresh@@`
1525
+ }
1526
+ ), [_, k, , D] = ce({
1527
+ key: `${me}::${r}::@@nonce@@`
1528
+ }), $ = new ma(d, m), N = re(
1529
+ (g) => {
1530
+ console.warn(g), o({
1531
+ type: Dt,
1532
+ payload: {
1533
+ logoutReason: g || de
1534
+ }
1535
+ }), u(), l(), w(), D(), o({ type: ee, payload: { isLoading: !1 } });
1091
1536
  },
1092
- [h, i, x, p]
1093
- ), C = z(
1094
- async (y) => {
1095
- const { user: O } = A;
1096
- M(y || ae), await Ur({
1097
- userId: (O == null ? void 0 : O.userId) || "",
1098
- idToken: o,
1099
- accessToken: l,
1100
- refreshToken: u,
1537
+ [l, u, D, w]
1538
+ ), O = re(
1539
+ async (g) => {
1540
+ const { user: b } = n;
1541
+ await la({
1542
+ userId: (b == null ? void 0 : b.userId) || "",
1543
+ idToken: i,
1544
+ accessToken: d,
1545
+ refreshToken: m,
1101
1546
  clientId: r,
1102
1547
  domain: a
1103
- }), w((b) => ({
1104
- ...b,
1105
- isLoading: !1
1106
- }));
1548
+ }), N(g || de);
1107
1549
  },
1108
1550
  [
1109
- l,
1110
- A,
1551
+ d,
1552
+ n,
1111
1553
  r,
1112
1554
  a,
1113
- o,
1114
- u,
1115
- M
1555
+ i,
1556
+ m,
1557
+ N
1116
1558
  ]
1117
1559
  );
1118
- V(() => {
1119
- if (!n.current)
1120
- return A.isLoading && o !== null ? (async () => {
1560
+ z(() => {
1561
+ if (!s.current)
1562
+ return n.isLoading && i !== null ? (async () => {
1121
1563
  try {
1122
- const y = await Y(o);
1123
- y && y.payload[_.USER_ID_KEY] !== "" ? w({
1124
- isLoading: !1,
1125
- isAuthenticated: !0,
1126
- user: {
1127
- userId: y.payload[_.USER_ID_KEY],
1128
- username: y.payload[_.USERNAME_KEY]
1129
- },
1130
- logoutReason: ""
1131
- }) : await C(ae);
1564
+ const g = await ae(i);
1565
+ g && g.payload[R.USER_ID_KEY] !== "" ? o({
1566
+ type: te,
1567
+ payload: {
1568
+ authenticationType: g.payload[R.AUTH_TYPE_KEY],
1569
+ user: {
1570
+ userId: g.payload[R.USER_ID_KEY],
1571
+ username: g.payload[R.USERNAME_KEY]
1572
+ }
1573
+ }
1574
+ }) : await O(de);
1132
1575
  } catch {
1133
- await C(ae);
1576
+ await O(de);
1134
1577
  }
1135
- })() : w((y) => ({
1136
- ...y,
1137
- isLoading: !1
1138
- })), () => {
1139
- n.current = !0;
1578
+ })() : o({ type: ee, payload: { isLoading: !1 } }), () => {
1579
+ s.current = !0;
1140
1580
  };
1141
- }, [A.isLoading, o, C]);
1142
- const N = async (y, O, b) => {
1143
- const I = Dr();
1144
- if (E(I), w(($) => ({
1145
- ...$,
1146
- isLoading: !0
1147
- })), i(), h(), p(), b === Q.CODE) {
1148
- const { code_verifier: $, code_challenge: It } = await Ir(), Me = await Hr({
1149
- nonce: I,
1581
+ }, [n.isLoading, i, O]);
1582
+ const x = async (g, b, E) => {
1583
+ const C = Ue();
1584
+ if (k(C), o({ type: ee, payload: { isLoading: !0 } }), u(), l(), w(), E === q.CODE) {
1585
+ const { code_verifier: zt, code_challenge: qt } = await Zr(), qe = await da({
1586
+ nonce: C,
1150
1587
  clientId: r,
1151
- code_challenge: It
1588
+ code_challenge: qt
1152
1589
  });
1153
- if (Me.status) {
1154
- const F = await ze({
1155
- username: y,
1156
- password: O,
1590
+ if (qe.status) {
1591
+ const Z = await ct({
1592
+ username: g,
1593
+ password: b,
1157
1594
  clientId: r,
1158
1595
  sessionExpiration: t,
1159
- nonce: I,
1160
- type: b,
1161
- code: Me.code,
1162
- code_verifier: $,
1596
+ nonce: C,
1597
+ type: E,
1598
+ code: qe.code,
1599
+ code_verifier: zt,
1163
1600
  domain: a
1164
1601
  });
1165
- return F.status ? (s(F.idToken), d(F.accessToken), m(F.refreshToken), w({
1166
- isLoading: !1,
1167
- isAuthenticated: !0,
1168
- user: {
1169
- userId: F.userId,
1170
- username: y
1171
- },
1172
- logoutReason: ""
1173
- }), !0) : (M(Je), w((_t) => ({
1174
- ..._t,
1175
- isLoading: !1
1176
- })), !1);
1602
+ return Z.status ? (h(Z.idToken), p(Z.accessToken), y(Z.refreshToken), o({
1603
+ type: te,
1604
+ payload: {
1605
+ authenticationType: E,
1606
+ user: {
1607
+ userId: Z.userId,
1608
+ username: g
1609
+ }
1610
+ }
1611
+ }), !0) : (N(ue), !1);
1177
1612
  }
1178
1613
  return !1;
1179
1614
  }
1180
- const W = await ze({
1181
- username: y,
1182
- password: O,
1615
+ const X = await ct({
1616
+ username: g,
1617
+ password: b,
1183
1618
  clientId: r,
1184
1619
  sessionExpiration: t,
1185
- nonce: I,
1186
- type: b,
1620
+ nonce: C,
1621
+ type: E,
1187
1622
  domain: a
1188
1623
  });
1189
- return W.status ? (s(W.idToken), d(W.accessToken), m(W.refreshToken), w({
1190
- isLoading: !1,
1191
- isAuthenticated: !0,
1192
- user: {
1193
- userId: W.userId,
1194
- username: y
1624
+ return X.status ? (h(X.idToken), p(X.accessToken), y(X.refreshToken), o({
1625
+ type: te,
1626
+ payload: {
1627
+ authenticationType: E,
1628
+ user: {
1629
+ userId: X.userId,
1630
+ username: g
1631
+ }
1195
1632
  }
1196
- }), !0) : (M(Je), w(($) => ({
1197
- ...$,
1198
- isLoading: !1
1199
- })), !1);
1200
- }, J = async (y) => {
1201
- y == null || y.preventDefault(), await C(Mr);
1202
- }, R = async () => {
1203
- const { isAuthenticated: y, user: O } = A;
1633
+ }), !0) : (N(ue), !1);
1634
+ }, Q = async (g) => {
1635
+ g == null || g.preventDefault(), await O(sa);
1636
+ }, P = async () => {
1637
+ const { isAuthenticated: g, user: b } = n;
1204
1638
  try {
1205
- if (y && O && O.userId) {
1206
- if (l) {
1207
- const I = await Y(l);
1208
- if (I && I.payload[_.USER_ID_KEY] !== "")
1209
- return l;
1639
+ if (g && b && b.userId) {
1640
+ if (d) {
1641
+ const C = await ae(d);
1642
+ if (C && C.payload[R.USER_ID_KEY] !== "")
1643
+ return d;
1210
1644
  }
1211
- const b = await D.refreshtoken({
1645
+ const E = await $.refreshtoken({
1212
1646
  clientId: r,
1213
- userId: O.userId,
1214
- nonce: f,
1647
+ userId: b.userId,
1648
+ nonce: _,
1215
1649
  domain: a
1216
1650
  });
1217
- return b.status && b.status === "success" ? (d(b.newAccessToken), m(b.newRefreshToken), b.newAccessToken) : (await C(Se), "");
1651
+ return E.status && E.status === "success" ? (p(E.newAccessToken), y(E.newRefreshToken), E.newAccessToken) : (await O(He), "");
1218
1652
  }
1219
- return await C(Se), "";
1653
+ return await O(He), "";
1220
1654
  } catch {
1221
- return await C(Se), "";
1655
+ return await O(He), "";
1222
1656
  }
1223
- }, fe = () => {
1224
- if (A.isAuthenticated && o)
1225
- return o;
1657
+ }, Re = () => {
1658
+ if (n.isAuthenticated && i)
1659
+ return i;
1660
+ }, Ne = async () => {
1661
+ const { user: g } = n;
1662
+ let b = await j({
1663
+ accessToken: d,
1664
+ clientId: r,
1665
+ type: Y.GET_REGISTRATION_OPTIONS,
1666
+ params: {
1667
+ clientId: r,
1668
+ id: g == null ? void 0 : g.userId,
1669
+ username: g == null ? void 0 : g.username
1670
+ }
1671
+ });
1672
+ if (b.status)
1673
+ try {
1674
+ const E = await sr(b.data);
1675
+ b = await j({
1676
+ accessToken: d,
1677
+ clientId: r,
1678
+ type: Y.VERIFY_REGISTRATION,
1679
+ params: {
1680
+ clientId: r,
1681
+ id: g == null ? void 0 : g.userId,
1682
+ username: g == null ? void 0 : g.username,
1683
+ registration: E
1684
+ }
1685
+ });
1686
+ } catch {
1687
+ return await j({
1688
+ accessToken: d,
1689
+ clientId: r,
1690
+ type: Y.VERIFY_REGISTRATION,
1691
+ params: {
1692
+ clientId: r,
1693
+ id: g == null ? void 0 : g.userId,
1694
+ username: g == null ? void 0 : g.username,
1695
+ registration: {}
1696
+ }
1697
+ }), !1;
1698
+ }
1699
+ }, xe = async () => {
1700
+ const g = Ue();
1701
+ k(g), o({ type: ee, payload: { isLoading: !0 } }), u(), l(), w();
1702
+ const b = Ue();
1703
+ let E = await j({
1704
+ accessToken: d,
1705
+ clientId: r,
1706
+ type: Y.GET_AUTHENTICATION_OPTIONS,
1707
+ params: {
1708
+ id: b,
1709
+ clientId: r
1710
+ }
1711
+ });
1712
+ if (E.status)
1713
+ try {
1714
+ const C = await lr(E.data);
1715
+ return E = await j({
1716
+ accessToken: d,
1717
+ clientId: r,
1718
+ type: Y.VERIFY_AUTHENTICATION,
1719
+ params: {
1720
+ clientId: r,
1721
+ id: b,
1722
+ authentication: C,
1723
+ nonce: g,
1724
+ domain: a
1725
+ }
1726
+ }), E.data.status === "success" ? (h(E.data.idToken), p(E.data.accessToken), y(E.data.refreshToken), o({
1727
+ type: te,
1728
+ payload: {
1729
+ authenticationType: q.PASSKEY,
1730
+ user: {
1731
+ userId: E.data.userId,
1732
+ username: E.data.username
1733
+ }
1734
+ }
1735
+ }), !0) : (N(ue), !1);
1736
+ } catch {
1737
+ return await j({
1738
+ accessToken: d,
1739
+ clientId: r,
1740
+ type: Y.VERIFY_AUTHENTICATION,
1741
+ params: {
1742
+ clientId: r,
1743
+ id: b,
1744
+ authentication: {},
1745
+ nonce: g,
1746
+ domain: a
1747
+ }
1748
+ }), N(ue), !1;
1749
+ }
1226
1750
  };
1227
- return /* @__PURE__ */ c(
1228
- mt.Provider,
1751
+ return /* @__PURE__ */ c(ha.Provider, { value: { state: n, dispatch: o }, children: /* @__PURE__ */ c(
1752
+ Lt.Provider,
1229
1753
  {
1230
- value: { ...A, login: N, logout: J, getAccessToken: R, getIdToken: fe },
1754
+ value: {
1755
+ ...n,
1756
+ login: x,
1757
+ logout: Q,
1758
+ getAccessToken: P,
1759
+ getIdToken: Re,
1760
+ registeringForPasskey: Ne,
1761
+ loginWithPasskey: xe
1762
+ },
1231
1763
  children: e
1232
1764
  }
1233
- );
1234
- }, xe = (e = mt) => Xe(e), an = "user", nn = "assistant", on = "system", sn = "internal", cn = "hidden", ln = "I'm having trouble right now. Please try again later.", dn = "gpt-4", un = 128e3, mn = "action-message", hn = "action-reset", pn = "action-model", gn = "action-restore", fn = "action-location", yn = "action-streaming", bn = "action-search", wn = "action-sort", En = "sassy-saint-", vn = "details", kn = "search", Sn = "sort", Tn = "location", An = "==stats==", jr = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", Ye = (e) => Number.isFinite(e) ? e : 0;
1235
- function Gr(e) {
1765
+ ) });
1766
+ }, je = (e = Lt) => pt(e), Un = "user", Hn = "assistant", Kn = "system", Bn = "internal", Gn = "hidden", Vn = "I'm having trouble right now. Please try again later.", Wn = "gpt-4", Yn = 128e3, jn = "action-message", Fn = "action-reset", Jn = "action-model", zn = "action-restore", qn = "action-location", Qn = "action-streaming", Xn = "action-search", Zn = "action-sort", eo = "sassy-saint-", to = "details", ro = "search", ao = "sort", no = "location", oo = "==stats==", fa = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", lt = (e) => Number.isFinite(e) ? e : 0;
1767
+ function ya(e) {
1236
1768
  return {
1237
1769
  days: Math.trunc(e / 864e5),
1238
1770
  hours: Math.trunc(e / 36e5 % 24),
1239
1771
  minutes: Math.trunc(e / 6e4 % 60),
1240
1772
  seconds: Math.trunc(e / 1e3 % 60),
1241
1773
  milliseconds: Math.trunc(e % 1e3),
1242
- microseconds: Math.trunc(Ye(e * 1e3) % 1e3),
1243
- nanoseconds: Math.trunc(Ye(e * 1e6) % 1e3)
1774
+ microseconds: Math.trunc(lt(e * 1e3) % 1e3),
1775
+ nanoseconds: Math.trunc(lt(e * 1e6) % 1e3)
1244
1776
  };
1245
1777
  }
1246
- function Vr(e) {
1778
+ function ba(e) {
1247
1779
  return {
1248
1780
  days: e / 86400000n,
1249
1781
  hours: e / 3600000n % 24n,
@@ -1254,61 +1786,61 @@ function Vr(e) {
1254
1786
  nanoseconds: 0n
1255
1787
  };
1256
1788
  }
1257
- function Jr(e) {
1789
+ function Ea(e) {
1258
1790
  switch (typeof e) {
1259
1791
  case "number": {
1260
1792
  if (Number.isFinite(e))
1261
- return Gr(e);
1793
+ return ya(e);
1262
1794
  break;
1263
1795
  }
1264
1796
  case "bigint":
1265
- return Vr(e);
1797
+ return ba(e);
1266
1798
  }
1267
1799
  throw new TypeError("Expected a finite number or bigint");
1268
1800
  }
1269
- const Fr = (e) => e === 0 || e === 0n, zr = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Yr = 1e-7, qr = 24n * 60n * 60n * 1000n;
1270
- function Qr(e, t) {
1801
+ const wa = (e) => e === 0 || e === 0n, Ta = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Ia = 1e-7, va = 24n * 60n * 60n * 1000n;
1802
+ function Aa(e, t) {
1271
1803
  const r = typeof e == "bigint";
1272
1804
  if (!r && !Number.isFinite(e))
1273
1805
  throw new TypeError("Expected a finite number or bigint");
1274
1806
  t = { ...t }, 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);
1275
1807
  let a = [];
1276
- const n = (d, h) => {
1277
- const u = Math.floor(d * 10 ** h + Yr);
1278
- return (Math.round(u) / 10 ** h).toFixed(h);
1279
- }, o = (d, h, u, m) => {
1280
- if (!((a.length === 0 || !t.colonNotation) && Fr(d) && !(t.colonNotation && u === "m"))) {
1281
- if (m = m ?? String(d), t.colonNotation) {
1282
- const p = m.includes(".") ? m.split(".")[0].length : m.length, f = a.length > 0 ? 2 : 1;
1283
- m = "0".repeat(Math.max(0, f - p)) + m;
1808
+ const n = (u, d) => {
1809
+ const p = Math.floor(u * 10 ** d + Ia);
1810
+ return (Math.round(p) / 10 ** d).toFixed(d);
1811
+ }, o = (u, d, p, l) => {
1812
+ if (!((a.length === 0 || !t.colonNotation) && wa(u) && !(t.colonNotation && p === "m"))) {
1813
+ if (l = l ?? String(u), t.colonNotation) {
1814
+ const m = l.includes(".") ? l.split(".")[0].length : l.length, y = a.length > 0 ? 2 : 1;
1815
+ l = "0".repeat(Math.max(0, y - m)) + l;
1284
1816
  } else
1285
- m += t.verbose ? " " + zr(h, d) : u;
1286
- a.push(m);
1817
+ l += t.verbose ? " " + Ta(d, u) : p;
1818
+ a.push(l);
1287
1819
  }
1288
- }, s = Jr(e), i = BigInt(s.days);
1820
+ }, s = Ea(e), i = BigInt(s.days);
1289
1821
  if (o(i / 365n, "year", "y"), o(i % 365n, "day", "d"), o(Number(s.hours), "hour", "h"), o(Number(s.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
1290
- const d = Number(s.seconds), h = Number(s.milliseconds), u = Number(s.microseconds), m = Number(s.nanoseconds);
1291
- if (o(d, "second", "s"), t.formatSubMilliseconds)
1292
- o(h, "millisecond", "ms"), o(u, "microsecond", "µs"), o(m, "nanosecond", "ns");
1822
+ const u = Number(s.seconds), d = Number(s.milliseconds), p = Number(s.microseconds), l = Number(s.nanoseconds);
1823
+ if (o(u, "second", "s"), t.formatSubMilliseconds)
1824
+ o(d, "millisecond", "ms"), o(p, "microsecond", "µs"), o(l, "nanosecond", "ns");
1293
1825
  else {
1294
- const p = h + u / 1e3 + m / 1e6, f = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, E = p >= 1 ? Math.round(p) : Math.ceil(p), x = f ? p.toFixed(f) : E;
1826
+ const m = d + p / 1e3 + l / 1e6, y = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, w = m >= 1 ? Math.round(m) : Math.ceil(m), _ = y ? m.toFixed(y) : w;
1295
1827
  o(
1296
- Number.parseFloat(x),
1828
+ Number.parseFloat(_),
1297
1829
  "millisecond",
1298
1830
  "ms",
1299
- x
1831
+ _
1300
1832
  );
1301
1833
  }
1302
1834
  } else {
1303
- const d = (r ? Number(e % qr) : e) / 1e3 % 60, h = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, u = n(d, h), m = t.keepDecimalsOnWholeSeconds ? u : u.replace(/\.0+$/, "");
1304
- o(Number.parseFloat(m), "second", "s", m);
1835
+ const u = (r ? Number(e % va) : e) / 1e3 % 60, d = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, p = n(u, d), l = t.keepDecimalsOnWholeSeconds ? p : p.replace(/\.0+$/, "");
1836
+ o(Number.parseFloat(l), "second", "s", l);
1305
1837
  }
1306
1838
  if (a.length === 0)
1307
1839
  return "0" + (t.verbose ? " milliseconds" : "ms");
1308
- const l = t.colonNotation ? ":" : " ";
1309
- return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), a.join(l);
1840
+ const h = t.colonNotation ? ":" : " ";
1841
+ return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), a.join(h);
1310
1842
  }
1311
- const Xr = process.env.NODE_ENV === "production", Ne = !Xr, Zr = Ne ? "gizmette.local.com" : "gizmette.com", In = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, ht = (e, t) => {
1843
+ const ka = process.env.NODE_ENV === "production", Fe = !ka, Sa = Fe ? "gizmette.local.com" : "gizmette.com", so = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, Mt = (e, t) => {
1312
1844
  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;
1313
1845
  return {
1314
1846
  dir: r,
@@ -1316,17 +1848,17 @@ const Xr = process.env.NODE_ENV === "production", Ne = !Xr, Zr = Ne ? "gizmette.
1316
1848
  min: n,
1317
1849
  sec: o
1318
1850
  };
1319
- }, _n = (e) => {
1851
+ }, io = (e) => {
1320
1852
  if (!e && e !== 0)
1321
1853
  return "N/A";
1322
- const t = ht(e, !1);
1854
+ const t = Mt(e, !1);
1323
1855
  return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
1324
- }, xn = (e) => {
1856
+ }, co = (e) => {
1325
1857
  if (!e && e !== 0)
1326
1858
  return "N/A";
1327
- const t = ht(e, !0);
1859
+ const t = Mt(e, !0);
1328
1860
  return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
1329
- }, Nn = async () => {
1861
+ }, lo = async () => {
1330
1862
  const e = {
1331
1863
  /**
1332
1864
  * A boolean value that indicates the application would
@@ -1375,11 +1907,11 @@ const Xr = process.env.NODE_ENV === "production", Ne = !Xr, Zr = Ne ? "gizmette.
1375
1907
  e
1376
1908
  );
1377
1909
  });
1378
- }, Cn = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ T("div", { className: "flex items-center justify-between", children: [
1910
+ }, uo = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ T("div", { className: "flex items-center justify-between", children: [
1379
1911
  /* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
1380
1912
  /* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
1381
1913
  ] }) }, `${e}-${r}`)) : null;
1382
- function Rn({
1914
+ function mo({
1383
1915
  data: e,
1384
1916
  formatter: t = (r) => r
1385
1917
  }) {
@@ -1391,18 +1923,18 @@ function Rn({
1391
1923
  );
1392
1924
  return t(a ? a / r.length : 0);
1393
1925
  }
1394
- const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Dn = new Intl.NumberFormat("en", {
1926
+ const ho = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, po = new Intl.NumberFormat("en", {
1395
1927
  style: "decimal",
1396
1928
  signDisplay: "never",
1397
1929
  minimumFractionDigits: 0,
1398
1930
  maximumFractionDigits: 0
1399
- }), Mn = (e) => Qr(e, {
1931
+ }), go = (e) => Aa(e, {
1400
1932
  secondsDecimalDigits: 2,
1401
1933
  unitCount: 2
1402
- }), ea = (e) => g(
1934
+ }), _a = (e) => f(
1403
1935
  "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",
1404
- e || Ne ? "pt-4" : "pt-10"
1405
- ), Ln = (e, t) => t === 1 ? e : `${e}s`, Ce = (e) => {
1936
+ e || Fe ? "pt-4" : "pt-10"
1937
+ ), fo = (e, t) => t === 1 ? e : `${e}s`, Se = (e) => {
1406
1938
  let t = "";
1407
1939
  if (typeof e == "number" || typeof e == "string")
1408
1940
  t = "m-" + e;
@@ -1411,7 +1943,7 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1411
1943
  (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(" ");
1412
1944
  }
1413
1945
  return t;
1414
- }, Pn = "av-bubble", qe = "av-button", $n = "av-card", ta = "av-footer", ra = "av-main", Un = "av-messagebox", Hn = "av-panel", Kn = "av-spinner", pt = "icon", gt = "button", aa = "link", na = ({
1946
+ }, yo = "av-bubble", dt = "av-button", ye = "av-card", Ra = "av-footer", Na = "av-main", bo = "av-messagebox", Eo = "av-panel", wo = "av-spinner", Ut = "icon", Ht = "button", xa = "link", Ca = ({
1415
1947
  type: e,
1416
1948
  size: t,
1417
1949
  labelRight: r,
@@ -1420,20 +1952,20 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1420
1952
  }) => {
1421
1953
  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";
1422
1954
  switch (e) {
1423
- case gt:
1424
- return g("px-4", {
1955
+ case Ht:
1956
+ return f("px-4", {
1425
1957
  [o]: t === "small",
1426
1958
  [s]: t === "medium",
1427
1959
  [i]: t === "large"
1428
1960
  });
1429
- case aa:
1430
- return g("px-4 text-center", {
1961
+ case xa:
1962
+ return f("px-4 text-center", {
1431
1963
  [o]: t === "small",
1432
1964
  [s]: t === "medium",
1433
1965
  [i]: t === "large"
1434
1966
  });
1435
- case pt:
1436
- return g("inline-flex items-center", {
1967
+ case Ut:
1968
+ return f("inline-flex items-center", {
1437
1969
  "justify-center": n === "center",
1438
1970
  "justify-start": n === "left",
1439
1971
  "justify-end": n === "right",
@@ -1445,7 +1977,7 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1445
1977
  "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
1446
1978
  });
1447
1979
  }
1448
- }, oa = ({
1980
+ }, Oa = ({
1449
1981
  mode: e,
1450
1982
  noBackground: t,
1451
1983
  noTruncate: r,
@@ -1454,7 +1986,7 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1454
1986
  if (t)
1455
1987
  return "not-prose rounded-full";
1456
1988
  if (a === "primary")
1457
- return g("not-prose rounded-full", {
1989
+ return f("not-prose rounded-full", {
1458
1990
  truncate: !r,
1459
1991
  "bg-action-dark text-copy-light": e === "dark",
1460
1992
  "bg-action-light text-copy-lighter": e === "light",
@@ -1462,7 +1994,7 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1462
1994
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
1463
1995
  });
1464
1996
  if (a === "secondary")
1465
- return g("not-prose rounded-full", {
1997
+ return f("not-prose rounded-full", {
1466
1998
  truncate: !r,
1467
1999
  "bg-action-dark text-copy-light": e === "light",
1468
2000
  "bg-action-light text-copy-lighter": e === "dark",
@@ -1470,14 +2002,14 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1470
2002
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
1471
2003
  });
1472
2004
  if (a === "danger")
1473
- return g("not-prose rounded-full", {
2005
+ return f("not-prose rounded-full", {
1474
2006
  truncate: !r,
1475
2007
  "bg-action-danger-dark text-copy-light": e === "dark",
1476
2008
  "bg-action-danger-light text-copy-lighter": e === "light",
1477
2009
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
1478
2010
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
1479
2011
  });
1480
- }, sa = ({
2012
+ }, Pa = ({
1481
2013
  mode: e,
1482
2014
  disabled: t,
1483
2015
  variant: r
@@ -1485,27 +2017,27 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1485
2017
  if (t)
1486
2018
  return "";
1487
2019
  if (r === "primary")
1488
- return g("hover:text-copy-light-hover", {
2020
+ return f("hover:text-copy-light-hover", {
1489
2021
  "hover:bg-action-dark-hover": e === "dark",
1490
2022
  "hover:bg-action-light-hover": e === "light",
1491
2023
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
1492
2024
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
1493
2025
  });
1494
2026
  if (r === "secondary")
1495
- return g("hover:text-copy-light-hover", {
2027
+ return f("hover:text-copy-light-hover", {
1496
2028
  "hover:bg-action-dark-hover": e === "light",
1497
2029
  "hover:bg-action-light-hover": e === "dark",
1498
2030
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
1499
2031
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
1500
2032
  });
1501
2033
  if (r === "danger")
1502
- return g("hover:text-copy-light-hover", {
2034
+ return f("hover:text-copy-light-hover", {
1503
2035
  "hover:bg-action-danger-dark-hover": e === "dark",
1504
2036
  "hover:bg-action-danger-light-hover": e === "light",
1505
2037
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
1506
2038
  "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
1507
2039
  });
1508
- }, ia = ({
2040
+ }, Da = ({
1509
2041
  mode: e,
1510
2042
  disabled: t,
1511
2043
  variant: r
@@ -1513,27 +2045,27 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1513
2045
  if (t)
1514
2046
  return "";
1515
2047
  if (r === "primary")
1516
- return g("active:text-copy-light-active", {
2048
+ return f("active:text-copy-light-active", {
1517
2049
  "active:bg-action-dark-active": e === "dark",
1518
2050
  "active:bg-action-light-active": e === "light",
1519
2051
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
1520
2052
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
1521
2053
  });
1522
2054
  if (r === "secondary")
1523
- return g("active:text-copy-light-active", {
2055
+ return f("active:text-copy-light-active", {
1524
2056
  "active:bg-action-dark-active": e === "light",
1525
2057
  "active:bg-action-light-active": e === "dark",
1526
2058
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
1527
2059
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
1528
2060
  });
1529
2061
  if (r === "danger")
1530
- return g("active:text-copy-lighter-active", {
2062
+ return f("active:text-copy-lighter-active", {
1531
2063
  "active:bg-action-danger-dark-active": e === "dark",
1532
2064
  "active:bg-action-danger-light-active": e === "light",
1533
2065
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
1534
2066
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
1535
2067
  });
1536
- }, ca = ({
2068
+ }, $a = ({
1537
2069
  mode: e,
1538
2070
  noBorder: t,
1539
2071
  variant: r
@@ -1541,32 +2073,32 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1541
2073
  if (t)
1542
2074
  return "border border-transparent";
1543
2075
  if (r === "primary")
1544
- return g("border", {
2076
+ return f("border", {
1545
2077
  "border-border-dark": e === "dark",
1546
2078
  "border-border-accent": e === "light",
1547
2079
  "border-border-dark dark:border-border-accent": e === "system",
1548
2080
  "border-border-accent dark:border-border-dark": e === "alt-system"
1549
2081
  });
1550
2082
  if (r === "secondary")
1551
- return g("border", {
2083
+ return f("border", {
1552
2084
  "border-border-dark": e === "light",
1553
2085
  "border-border-accent": e === "dark",
1554
2086
  "border-border-dark dark:border-border-accent": e === "alt-system",
1555
2087
  "border-border-accent dark:border-border-dark": e === "system"
1556
2088
  });
1557
2089
  if (r === "danger")
1558
- return g("border", {
2090
+ return f("border", {
1559
2091
  "border-border-danger-dark": e === "dark",
1560
2092
  "border-border-danger-medium": e === "light",
1561
2093
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
1562
2094
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
1563
2095
  });
1564
- }, la = ({ focusMode: e }) => g("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2096
+ }, La = ({ focusMode: e }) => f("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
1565
2097
  "focus:outline-focus-dark": e === "dark",
1566
2098
  "focus:outline-focus-light": e === "light",
1567
2099
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1568
2100
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1569
- }), ft = ({
2101
+ }), Kt = ({
1570
2102
  type: e,
1571
2103
  className: t,
1572
2104
  raw: r,
@@ -1575,32 +2107,32 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1575
2107
  disabled: o,
1576
2108
  fullWidth: s,
1577
2109
  size: i,
1578
- noBorder: l,
1579
- labelRight: d,
1580
- labelLeft: h,
1581
- spacing: u,
1582
- noBackground: m,
1583
- variant: p,
1584
- noTruncate: f,
1585
- align: E
1586
- }) => (p || (p = "primary"), r ? g(qe, t) : g(
1587
- qe,
2110
+ noBorder: h,
2111
+ labelRight: u,
2112
+ labelLeft: d,
2113
+ spacing: p,
2114
+ noBackground: l,
2115
+ variant: m,
2116
+ noTruncate: y,
2117
+ align: w
2118
+ }) => (m || (m = "primary"), r ? f(dt, t) : f(
2119
+ dt,
1588
2120
  t,
1589
- Ce(u),
1590
- oa({ mode: a, variant: p, noBackground: m, noTruncate: f }),
1591
- na({ type: e, size: i, labelRight: d, labelLeft: h, align: E }),
1592
- ca({ mode: a, variant: p, noBorder: l }),
1593
- la({ focusMode: n }),
1594
- sa({ mode: a, variant: p, disabled: o }),
1595
- ia({ mode: a, variant: p, disabled: o }),
2121
+ Se(p),
2122
+ Oa({ mode: a, variant: m, noBackground: l, noTruncate: y }),
2123
+ Ca({ type: e, size: i, labelRight: u, labelLeft: d, align: w }),
2124
+ $a({ mode: a, variant: m, noBorder: h }),
2125
+ La({ focusMode: n }),
2126
+ Pa({ mode: a, variant: m, disabled: o }),
2127
+ Da({ mode: a, variant: m, disabled: o }),
1596
2128
  {
1597
2129
  "w-full": s,
1598
2130
  "disabled:cursor-not-allowed disabled:opacity-50": o
1599
2131
  }
1600
- )), da = (e, t, r) => {
2132
+ )), Ma = (e, t, r) => {
1601
2133
  var a;
1602
2134
  !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);
1603
- }, Re = B.forwardRef(
2135
+ }, Je = H.forwardRef(
1604
2136
  (e, t) => {
1605
2137
  const { onClick: r, noInternalClick: a = !1, ...n } = e;
1606
2138
  return /* @__PURE__ */ c(
@@ -1608,15 +2140,15 @@ const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
1608
2140
  {
1609
2141
  ref: t,
1610
2142
  onClick: (o) => {
1611
- da(o, a, r);
2143
+ Ma(o, a, r);
1612
2144
  },
1613
2145
  ...n
1614
2146
  }
1615
2147
  );
1616
2148
  }
1617
2149
  );
1618
- Re.displayName = "BaseButton";
1619
- const yt = B.forwardRef(
2150
+ Je.displayName = "BaseButton";
2151
+ const Ve = H.forwardRef(
1620
2152
  ({
1621
2153
  children: e,
1622
2154
  disabled: t = !1,
@@ -1626,58 +2158,58 @@ const yt = B.forwardRef(
1626
2158
  className: o,
1627
2159
  type: s = "button",
1628
2160
  raw: i = !1,
1629
- noBorder: l = !1,
1630
- "aria-label": d,
1631
- label: h,
1632
- size: u = "medium",
1633
- labelRight: m,
1634
- labelLeft: p,
1635
- spacing: f,
1636
- noBackground: E = !1,
1637
- align: x = "center",
1638
- ...D
1639
- }, A) => {
1640
- const w = ft({
1641
- type: pt,
2161
+ noBorder: h = !1,
2162
+ "aria-label": u,
2163
+ label: d,
2164
+ size: p = "medium",
2165
+ labelRight: l,
2166
+ labelLeft: m,
2167
+ spacing: y,
2168
+ noBackground: w = !1,
2169
+ align: _ = "center",
2170
+ ...k
2171
+ }, D) => {
2172
+ const $ = Kt({
2173
+ type: Ut,
1642
2174
  mode: r,
1643
2175
  focusMode: a,
1644
2176
  fullWidth: n,
1645
2177
  disabled: t,
1646
2178
  raw: i,
1647
2179
  className: o,
1648
- noBorder: l,
1649
- size: u,
1650
- labelRight: m,
1651
- labelLeft: p,
1652
- spacing: f,
1653
- noBackground: E,
1654
- align: x
1655
- }), M = g({
2180
+ noBorder: h,
2181
+ size: p,
2182
+ labelRight: l,
2183
+ labelLeft: m,
2184
+ spacing: y,
2185
+ noBackground: w,
2186
+ align: _
2187
+ }), N = f({
1656
2188
  "text-copy-accent-dark": r === "light" && !i,
1657
2189
  "text-copy-light": r === "dark" && !i,
1658
2190
  "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
1659
2191
  "text-copy-light dark:text-copy-accent-dark": r === "system" && !i
1660
2192
  });
1661
2193
  return /* @__PURE__ */ T(
1662
- Re,
2194
+ Je,
1663
2195
  {
1664
- ref: A,
1665
- className: w,
2196
+ ref: D,
2197
+ className: $,
1666
2198
  disabled: t,
1667
2199
  type: s,
1668
- "aria-label": d || h,
1669
- ...D,
2200
+ "aria-label": u || d,
2201
+ ...k,
1670
2202
  children: [
1671
- p && /* @__PURE__ */ c("span", { className: "pr-2", children: p }),
1672
- /* @__PURE__ */ c("div", { className: M, children: e }),
1673
- m && /* @__PURE__ */ c("span", { className: "pl-2", children: m })
2203
+ m && /* @__PURE__ */ c("span", { className: "pr-2", children: m }),
2204
+ /* @__PURE__ */ c("div", { className: N, children: e }),
2205
+ l && /* @__PURE__ */ c("span", { className: "pl-2", children: l })
1674
2206
  ]
1675
2207
  }
1676
2208
  );
1677
2209
  }
1678
2210
  );
1679
- yt.displayName = "ButtonIcon";
1680
- const bt = B.forwardRef(
2211
+ Ve.displayName = "ButtonIcon";
2212
+ const Bt = H.forwardRef(
1681
2213
  ({
1682
2214
  children: e,
1683
2215
  disabled: t = !1,
@@ -1687,14 +2219,14 @@ const bt = B.forwardRef(
1687
2219
  className: o,
1688
2220
  size: s = "medium",
1689
2221
  raw: i = !1,
1690
- noBorder: l = !1,
1691
- spacing: d,
1692
- variant: h = "primary",
1693
- noTruncate: u = !1,
1694
- ...m
1695
- }, p) => {
1696
- const f = ft({
1697
- type: gt,
2222
+ noBorder: h = !1,
2223
+ spacing: u,
2224
+ variant: d = "primary",
2225
+ noTruncate: p = !1,
2226
+ ...l
2227
+ }, m) => {
2228
+ const y = Kt({
2229
+ type: Ht,
1698
2230
  mode: r,
1699
2231
  focusMode: a,
1700
2232
  fullWidth: n,
@@ -1702,25 +2234,128 @@ const bt = B.forwardRef(
1702
2234
  raw: i,
1703
2235
  className: o,
1704
2236
  size: s,
1705
- noBorder: l,
1706
- spacing: d,
1707
- variant: h,
1708
- noTruncate: u
2237
+ noBorder: h,
2238
+ spacing: u,
2239
+ variant: d,
2240
+ noTruncate: p
1709
2241
  });
1710
2242
  return /* @__PURE__ */ c(
1711
- Re,
2243
+ Je,
1712
2244
  {
1713
- ref: p,
1714
- className: f,
2245
+ ref: m,
2246
+ className: y,
1715
2247
  disabled: t,
1716
- ...m,
2248
+ ...l,
1717
2249
  children: e
1718
2250
  }
1719
2251
  );
1720
2252
  }
1721
2253
  );
1722
- bt.displayName = "Button";
1723
- const ua = ({
2254
+ Bt.displayName = "Button";
2255
+ function Ua(e) {
2256
+ const t = gt();
2257
+ return `${e}${t}`;
2258
+ }
2259
+ const Ha = ({
2260
+ className: e,
2261
+ headerClassName: t,
2262
+ bodyClassName: r,
2263
+ footerClassName: a,
2264
+ spacing: n,
2265
+ mode: o,
2266
+ compact: s,
2267
+ noBorder: i
2268
+ }) => {
2269
+ const h = f(
2270
+ ye,
2271
+ e,
2272
+ "rounded-md",
2273
+ Se(n),
2274
+ {
2275
+ "border-none": i,
2276
+ "border-2": !i,
2277
+ "p-4": !s,
2278
+ "p-1 sm:p-2": s,
2279
+ "border-border-accent bg-surface-darker text-copy-light": o === "darker",
2280
+ "border-border-accent bg-surface-dark text-copy-light": o === "dark",
2281
+ "border-border-dark bg-surface-lighter text-copy-dark": o === "light",
2282
+ "border-border-dark bg-surface-lighter text-copy-dark dark:border-border-accent dark:bg-surface-dark dark:text-copy-light": o === "system",
2283
+ "border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": o === "alt-system"
2284
+ }
2285
+ ), u = t || f(`${ye}__header mt-0 border-b-2`, {
2286
+ "text-copy-light border-border-accent": o === "darker",
2287
+ "border-border-accent": o === "dark",
2288
+ "border-border-medium": o === "light",
2289
+ "border-border-medium dark:border-border-accent": o === "system",
2290
+ "border-border-accent dark:border-border-medium": o === "alt-system",
2291
+ "mb-4": !s,
2292
+ "mb-2": s
2293
+ }), d = f(r), p = a || f(`${ye}__footer pt-2`);
2294
+ return {
2295
+ wrapper: h,
2296
+ header: u,
2297
+ body: d,
2298
+ footer: p
2299
+ };
2300
+ };
2301
+ function Ka({
2302
+ id: e,
2303
+ content: t,
2304
+ userAriaLabelledby: r,
2305
+ className: a
2306
+ }) {
2307
+ 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;
2308
+ }
2309
+ const Ba = ({
2310
+ header: e,
2311
+ headerClassName: t,
2312
+ footer: r,
2313
+ footerClassName: a,
2314
+ children: n,
2315
+ className: o,
2316
+ bodyClassName: s,
2317
+ "aria-labelledby": i,
2318
+ spacing: h,
2319
+ mode: u = "system",
2320
+ compact: d = !1,
2321
+ noBorder: p = !1,
2322
+ ...l
2323
+ }) => {
2324
+ let m = null, y = null;
2325
+ const w = typeof e == "string", _ = Ua(ye), k = Ha({
2326
+ className: o,
2327
+ headerClassName: t,
2328
+ bodyClassName: s,
2329
+ footerClassName: a,
2330
+ spacing: h,
2331
+ mode: u,
2332
+ compact: d,
2333
+ noBorder: p
2334
+ });
2335
+ return w ? (m = _, y = m) : !w && e && i ? (m = null, y = i) : !w && e && !i ? (m = _, y = m) : (m = null, y = i || null), /* @__PURE__ */ c("div", { className: k.wrapper, children: /* @__PURE__ */ T(
2336
+ "section",
2337
+ {
2338
+ ...y && {
2339
+ "aria-labelledby": y
2340
+ },
2341
+ className: k.body,
2342
+ ...l,
2343
+ children: [
2344
+ /* @__PURE__ */ c(
2345
+ Ka,
2346
+ {
2347
+ ...m && { id: m },
2348
+ content: e,
2349
+ className: k.header,
2350
+ userAriaLabelledby: i
2351
+ }
2352
+ ),
2353
+ /* @__PURE__ */ c("div", { children: n }),
2354
+ r ? /* @__PURE__ */ c("div", { className: k.footer, children: r }) : null
2355
+ ]
2356
+ }
2357
+ ) });
2358
+ }, Ga = ({
1724
2359
  className: e,
1725
2360
  mode: t = "system",
1726
2361
  row1: r,
@@ -1729,7 +2364,7 @@ const ua = ({
1729
2364
  spacing: o,
1730
2365
  raw: s = !1
1731
2366
  }) => {
1732
- const i = g(ta, e, Ce(o), {
2367
+ const i = f(Ra, e, Se(o), {
1733
2368
  "text-copy-dark": !s && t === "dark",
1734
2369
  "text-copy-lighter": !s && t === "light",
1735
2370
  "text-copy-dark dark:text-copy-lighter": !s && t === "system",
@@ -1741,13 +2376,13 @@ const ua = ({
1741
2376
  r && /* @__PURE__ */ c("div", { children: r }),
1742
2377
  a && /* @__PURE__ */ c("div", { children: a })
1743
2378
  ] });
1744
- }, ma = ({
2379
+ }, Va = ({
1745
2380
  children: e,
1746
2381
  className: t,
1747
2382
  raw: r = !1,
1748
2383
  spacing: a
1749
2384
  }) => {
1750
- const n = g(t, ra, Ce(a), {
2385
+ const n = f(t, Na, Se(a), {
1751
2386
  "mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
1752
2387
  });
1753
2388
  return /* @__PURE__ */ c("main", { className: n, children: e });
@@ -1765,16 +2400,16 @@ try {
1765
2400
  });
1766
2401
  } catch {
1767
2402
  }
1768
- function ha(e) {
1769
- return Ct(() => e.every((t) => t == null) ? () => {
2403
+ function Wa(e) {
2404
+ return Zt(() => e.every((t) => t == null) ? () => {
1770
2405
  } : (t) => {
1771
2406
  e.forEach((r) => {
1772
2407
  typeof r == "function" ? r(t) : r != null && (r.current = t);
1773
2408
  });
1774
2409
  }, e);
1775
2410
  }
1776
- function pa(e) {
1777
- const t = Rt();
2411
+ function Ya(e) {
2412
+ const t = gt();
1778
2413
  if (!e)
1779
2414
  return t;
1780
2415
  if (typeof e == "number" || typeof e == "string")
@@ -1784,7 +2419,7 @@ function pa(e) {
1784
2419
  return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
1785
2420
  }
1786
2421
  }
1787
- const wt = "SET_ANNOUNCEMENT", Et = "CLEAR_ANNOUNCEMENT", ga = {
2422
+ const Gt = "SET_ANNOUNCEMENT", Vt = "CLEAR_ANNOUNCEMENT", ja = {
1788
2423
  alert: null,
1789
2424
  alertdialog: null,
1790
2425
  log: "polite",
@@ -1792,14 +2427,14 @@ const wt = "SET_ANNOUNCEMENT", Et = "CLEAR_ANNOUNCEMENT", ga = {
1792
2427
  progressbar: null,
1793
2428
  status: "polite",
1794
2429
  timer: "assertive"
1795
- }, fa = (e, t) => {
2430
+ }, Fa = (e, t) => {
1796
2431
  switch (t == null ? void 0 : t.type) {
1797
- case wt:
2432
+ case Gt:
1798
2433
  return {
1799
2434
  ...e,
1800
2435
  announcement: t.payload
1801
2436
  };
1802
- case Et:
2437
+ case Vt:
1803
2438
  return {
1804
2439
  ...e,
1805
2440
  announcement: null
@@ -1807,14 +2442,14 @@ const wt = "SET_ANNOUNCEMENT", Et = "CLEAR_ANNOUNCEMENT", ga = {
1807
2442
  default:
1808
2443
  return e;
1809
2444
  }
1810
- }, ya = ({
2445
+ }, Ja = ({
1811
2446
  onAnnouncementClear: e,
1812
2447
  dispatch: t
1813
2448
  }) => {
1814
2449
  t({
1815
- type: Et
2450
+ type: Vt
1816
2451
  }), typeof e == "function" && e();
1817
- }, Qe = ({
2452
+ }, ut = ({
1818
2453
  children: e,
1819
2454
  clearAnnouncementDelay: t,
1820
2455
  clearAnnouncementTimeoutRef: r,
@@ -1822,16 +2457,16 @@ const wt = "SET_ANNOUNCEMENT", Et = "CLEAR_ANNOUNCEMENT", ga = {
1822
2457
  dispatch: n
1823
2458
  }) => {
1824
2459
  (r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && n({
1825
- type: wt,
2460
+ type: Gt,
1826
2461
  payload: e
1827
2462
  }), t && (r.current = setTimeout(
1828
- () => ya({
2463
+ () => Ja({
1829
2464
  onAnnouncementClear: a,
1830
2465
  dispatch: n
1831
2466
  }),
1832
2467
  t
1833
2468
  ));
1834
- }, ba = ({
2469
+ }, za = ({
1835
2470
  children: e,
1836
2471
  announcementTimeoutRef: t,
1837
2472
  announcementDelay: r,
@@ -1840,13 +2475,13 @@ const wt = "SET_ANNOUNCEMENT", Et = "CLEAR_ANNOUNCEMENT", ga = {
1840
2475
  onAnnouncementClear: o,
1841
2476
  dispatch: s
1842
2477
  }) => {
1843
- clearTimeout(t.current), r ? t.current = setTimeout(Qe, r, {
2478
+ clearTimeout(t.current), r ? t.current = setTimeout(ut, r, {
1844
2479
  children: e,
1845
2480
  clearAnnouncementDelay: a,
1846
2481
  clearAnnouncementTimeoutRef: n,
1847
2482
  onAnnouncementClear: o,
1848
2483
  dispatch: s
1849
- }) : Qe({
2484
+ }) : ut({
1850
2485
  children: e,
1851
2486
  clearAnnouncementDelay: a,
1852
2487
  clearAnnouncementTimeoutRef: n,
@@ -1854,7 +2489,7 @@ const wt = "SET_ANNOUNCEMENT", Et = "CLEAR_ANNOUNCEMENT", ga = {
1854
2489
  dispatch: s
1855
2490
  });
1856
2491
  };
1857
- function vt({
2492
+ function Wt({
1858
2493
  children: e,
1859
2494
  className: t,
1860
2495
  politeness: r,
@@ -1863,21 +2498,21 @@ function vt({
1863
2498
  clearAnnouncementDelay: o,
1864
2499
  onAnnouncementClear: s,
1865
2500
  visible: i,
1866
- ...l
2501
+ ...h
1867
2502
  }) {
1868
- const d = j(), h = j(), [u, m] = Ot(fa, {
2503
+ const u = V(), d = V(), [p, l] = ht(Fa, {
1869
2504
  announcement: null
1870
2505
  });
1871
- let p = r;
1872
- typeof p > "u" && (p = a ? ga[a] : "assertive"), V(() => {
1873
- ba({
1874
- announcementTimeoutRef: d,
2506
+ let m = r;
2507
+ typeof m > "u" && (m = a ? ja[a] : "assertive"), z(() => {
2508
+ za({
2509
+ announcementTimeoutRef: u,
1875
2510
  announcementDelay: n,
1876
2511
  children: e,
1877
2512
  clearAnnouncementDelay: o,
1878
- clearAnnouncementTimeoutRef: h,
2513
+ clearAnnouncementTimeoutRef: d,
1879
2514
  onAnnouncementClear: s,
1880
- dispatch: m
2515
+ dispatch: l
1881
2516
  });
1882
2517
  }, [
1883
2518
  e,
@@ -1885,17 +2520,17 @@ function vt({
1885
2520
  o,
1886
2521
  s
1887
2522
  ]);
1888
- const f = g(t, {
2523
+ const y = f(t, {
1889
2524
  "sr-only": !i
1890
2525
  });
1891
2526
  return /* @__PURE__ */ c(
1892
2527
  "div",
1893
2528
  {
1894
- "aria-live": p,
2529
+ "aria-live": m,
1895
2530
  ...a && { role: a },
1896
- className: f,
1897
- ...l,
1898
- children: u.announcement
2531
+ className: y,
2532
+ ...h,
2533
+ children: p.announcement
1899
2534
  }
1900
2535
  );
1901
2536
  }
@@ -1912,7 +2547,7 @@ try {
1912
2547
  });
1913
2548
  } catch {
1914
2549
  }
1915
- const wa = (e) => {
2550
+ const qa = (e) => {
1916
2551
  let t = "";
1917
2552
  if (typeof e == "number" || typeof e == "string")
1918
2553
  t = "m-" + e;
@@ -1921,29 +2556,29 @@ const wa = (e) => {
1921
2556
  (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(" ");
1922
2557
  }
1923
2558
  return t;
1924
- }, kt = "av-text-input", Ea = "av-text-input-wrapper", Te = "av-text-input-helper-text", Bn = "av-text-area", Wn = "av-text-area-wrapper", jn = "av-text-area-helper-text", Gn = "av-text-area__control--right", Vn = "av-toggle", va = ({
2559
+ }, Yt = "av-text-input", Qa = "av-text-input-wrapper", Ke = "av-text-input-helper-text", To = "av-text-area", Io = "av-text-area-wrapper", vo = "av-text-area-helper-text", Ao = "av-text-area__control--right", ko = "av-toggle", Xa = ({
1925
2560
  mode: e
1926
- }) => g({
2561
+ }) => f({
1927
2562
  "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
1928
2563
  "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
1929
2564
  "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
1930
2565
  "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
1931
- }), ka = ({
2566
+ }), Za = ({
1932
2567
  focusMode: e
1933
- }) => g("focus:outline focus:outline-2 focus:outline-offset-2", {
2568
+ }) => f("focus:outline focus:outline-2 focus:outline-offset-2", {
1934
2569
  "focus:outline-focus-dark": e === "dark",
1935
2570
  "focus:outline-focus-light": e === "light",
1936
2571
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1937
2572
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1938
- }), Sa = ({
2573
+ }), en = ({
1939
2574
  noBorder: e,
1940
2575
  error: t
1941
- }) => g("border-2", {
2576
+ }) => f("border-2", {
1942
2577
  "border-border-dark": !e && !t,
1943
2578
  "focus:border-border-dark": !e && t,
1944
2579
  "border-border-error-dark": !e && t,
1945
2580
  "border-transparent": e
1946
- }), Ta = ({
2581
+ }), tn = ({
1947
2582
  disabled: e,
1948
2583
  raw: t,
1949
2584
  error: r,
@@ -1952,22 +2587,22 @@ const wa = (e) => {
1952
2587
  if (t)
1953
2588
  return "";
1954
2589
  if (e)
1955
- return g("absolute px-2 cursor-not-allowed opacity-50 font-medium");
2590
+ return f("absolute px-2 cursor-not-allowed opacity-50 font-medium");
1956
2591
  if (!r)
1957
- return g("absolute px-2 cursor-text font-medium", {
2592
+ return f("absolute px-2 cursor-text font-medium", {
1958
2593
  "text-copy-lighter": a === "dark",
1959
2594
  "text-copy-dark": a === "light",
1960
2595
  "text-copy-dark dark:text-copy-lighter": a === "system",
1961
2596
  "text-copy-lighter dark:text-copy-dark": a === "alt-system"
1962
2597
  });
1963
2598
  if (r)
1964
- return g("absolute px-2 cursor-text font-medium", {
2599
+ return f("absolute px-2 cursor-text font-medium", {
1965
2600
  "text-copy-lighter": a === "dark",
1966
2601
  "text-copy-error-dark": a === "light",
1967
2602
  "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
1968
2603
  "text-copy-lighter dark:text-copy-error-dark": a === "alt-system"
1969
2604
  });
1970
- }, Aa = ({
2605
+ }, rn = ({
1971
2606
  error: e,
1972
2607
  raw: t,
1973
2608
  mode: r,
@@ -1976,25 +2611,25 @@ const wa = (e) => {
1976
2611
  if (t)
1977
2612
  return "";
1978
2613
  if (a)
1979
- return g(
1980
- Te,
2614
+ return f(
2615
+ Ke,
1981
2616
  "absolute px-2 cursor-not-allowed opacity-50 font-medium"
1982
2617
  );
1983
2618
  if (!e)
1984
- return g(Te, "absolute px-2 font-medium", {
2619
+ return f(Ke, "absolute px-2 font-medium", {
1985
2620
  "text-copy-lighter": r === "dark",
1986
2621
  "text-copy-dark": r === "light",
1987
2622
  "text-copy-dark dark:text-copy-lighter": r === "system",
1988
2623
  "text-copy-lighter dark:text-copy-dark": r === "alt-system"
1989
2624
  });
1990
2625
  if (e)
1991
- return g(Te, "absolute px-2 font-medium", {
2626
+ return f(Ke, "absolute px-2 font-medium", {
1992
2627
  "text-copy-error-light bg-surface-darker": r === "dark",
1993
2628
  "text-copy-error-dark": r === "light",
1994
2629
  "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
1995
2630
  "dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
1996
2631
  });
1997
- }, Ia = ({
2632
+ }, an = ({
1998
2633
  className: e,
1999
2634
  inputClassName: t,
2000
2635
  raw: r,
@@ -2003,43 +2638,43 @@ const wa = (e) => {
2003
2638
  error: o,
2004
2639
  spacing: s,
2005
2640
  mode: i,
2006
- focusMode: l
2641
+ focusMode: h
2007
2642
  }) => {
2008
- const d = r ? e : g(
2643
+ const u = r ? e : f(
2009
2644
  "relative flex w-full flex-col justify-center",
2010
- Ea,
2645
+ Qa,
2011
2646
  e,
2012
- wa(s)
2013
- ), h = r ? g(t) : g(
2014
- kt,
2647
+ qa(s)
2648
+ ), d = r ? f(t) : f(
2649
+ Yt,
2015
2650
  t,
2016
2651
  "h-12 rounded-md px-4 text-base",
2017
- va({ mode: i }),
2018
- ka({ focusMode: l }),
2019
- Sa({ noBorder: n, error: o }),
2652
+ Xa({ mode: i }),
2653
+ Za({ focusMode: h }),
2654
+ en({ noBorder: n, error: o }),
2020
2655
  {
2021
2656
  "disabled:cursor-not-allowed disabled:opacity-50": a
2022
2657
  }
2023
- ), u = r ? void 0 : "sr-only", m = Ta({
2658
+ ), p = r ? void 0 : "sr-only", l = tn({
2024
2659
  disabled: a,
2025
2660
  raw: r,
2026
2661
  error: o,
2027
2662
  mode: i
2028
- }), p = Aa({
2663
+ }), m = rn({
2029
2664
  error: o,
2030
2665
  raw: r,
2031
2666
  mode: i,
2032
2667
  disabled: a
2033
2668
  });
2034
2669
  return {
2035
- wrapper: d,
2036
- input: h,
2037
- accessibleLabel: u,
2038
- visibleLabel: m,
2039
- helperText: p,
2670
+ wrapper: u,
2671
+ input: d,
2672
+ accessibleLabel: p,
2673
+ visibleLabel: l,
2674
+ helperText: m,
2040
2675
  rightElement: r ? void 0 : "absolute right-3"
2041
2676
  };
2042
- }, Oe = B.forwardRef(
2677
+ }, ze = H.forwardRef(
2043
2678
  ({
2044
2679
  id: e,
2045
2680
  name: t,
@@ -2049,87 +2684,87 @@ const wa = (e) => {
2049
2684
  className: o,
2050
2685
  inputClassName: s,
2051
2686
  mode: i = "system",
2052
- focusMode: l = "system",
2053
- disabled: d = !1,
2054
- noBorder: h = !1,
2055
- labelId: u,
2056
- labelHidden: m = !1,
2057
- type: p = "text",
2058
- helperText: f = "",
2059
- rightElement: E,
2060
- spacing: x,
2061
- ...D
2062
- }, A) => {
2063
- const w = j(null), [M, C] = H(0), N = pa({ id: e, prefix: `${kt}-` }), J = `${t} error, ${f}`, R = Ia({
2687
+ focusMode: h = "system",
2688
+ disabled: u = !1,
2689
+ noBorder: d = !1,
2690
+ labelId: p,
2691
+ labelHidden: l = !1,
2692
+ type: m = "text",
2693
+ helperText: y = "",
2694
+ rightElement: w,
2695
+ spacing: _,
2696
+ ...k
2697
+ }, D) => {
2698
+ const $ = V(null), [N, O] = G(0), x = Ya({ id: e, prefix: `${Yt}-` }), Q = `${t} error, ${y}`, P = an({
2064
2699
  className: o,
2065
2700
  inputClassName: s,
2066
2701
  error: a,
2067
2702
  raw: n,
2068
- focusMode: l,
2069
- disabled: d,
2070
- noBorder: h,
2071
- spacing: x,
2703
+ focusMode: h,
2704
+ disabled: u,
2705
+ noBorder: d,
2706
+ spacing: _,
2072
2707
  mode: i
2073
2708
  });
2074
- return Dt(() => {
2075
- w.current && C(w.current.offsetWidth + 18 + 10);
2076
- }, []), /* @__PURE__ */ T("div", { className: R.wrapper, children: [
2709
+ return er(() => {
2710
+ $.current && O($.current.offsetWidth + 18 + 10);
2711
+ }, []), /* @__PURE__ */ T("div", { className: P.wrapper, children: [
2077
2712
  /* @__PURE__ */ c(
2078
2713
  "label",
2079
2714
  {
2080
- htmlFor: N,
2081
- id: u,
2082
- className: R.accessibleLabel,
2715
+ htmlFor: x,
2716
+ id: p,
2717
+ className: P.accessibleLabel,
2083
2718
  children: r
2084
2719
  }
2085
2720
  ),
2086
2721
  /* @__PURE__ */ c(
2087
2722
  "input",
2088
2723
  {
2089
- ref: A,
2090
- id: N,
2724
+ ref: D,
2725
+ id: x,
2091
2726
  name: t,
2092
- type: p,
2093
- disabled: d,
2727
+ type: m,
2728
+ disabled: u,
2094
2729
  placeholder: n ? void 0 : " ",
2095
- className: R.input,
2096
- ...f && { "aria-describedby": `${N}-helper` },
2730
+ className: P.input,
2731
+ ...y && { "aria-describedby": `${x}-helper` },
2097
2732
  ...a && { "aria-invalid": "true" },
2098
- ...E && !n && { style: { paddingRight: M } },
2099
- ...D
2733
+ ...w && !n && { style: { paddingRight: N } },
2734
+ ...k
2100
2735
  }
2101
2736
  ),
2102
- !n && !m && /* @__PURE__ */ c(
2737
+ !n && !l && /* @__PURE__ */ c(
2103
2738
  "label",
2104
2739
  {
2105
2740
  "aria-hidden": !0,
2106
- htmlFor: N,
2107
- className: R.visibleLabel,
2741
+ htmlFor: x,
2742
+ className: P.visibleLabel,
2108
2743
  children: r
2109
2744
  }
2110
2745
  ),
2111
- f && /* @__PURE__ */ c(
2746
+ y && /* @__PURE__ */ c(
2112
2747
  "div",
2113
2748
  {
2114
- id: `${N}-helper`,
2115
- className: R.helperText,
2116
- children: f
2749
+ id: `${x}-helper`,
2750
+ className: P.helperText,
2751
+ children: y
2117
2752
  }
2118
2753
  ),
2119
- E && /* @__PURE__ */ c(
2754
+ w && /* @__PURE__ */ c(
2120
2755
  "div",
2121
2756
  {
2122
- ref: w,
2123
- className: R.rightElement,
2124
- children: E
2757
+ ref: $,
2758
+ className: P.rightElement,
2759
+ children: w
2125
2760
  }
2126
2761
  ),
2127
- a && f && /* @__PURE__ */ c(vt, { politeness: "polite", clearAnnouncementDelay: 500, children: J })
2762
+ a && y && /* @__PURE__ */ c(Wt, { politeness: "polite", clearAnnouncementDelay: 500, children: Q })
2128
2763
  ] });
2129
2764
  }
2130
2765
  );
2131
- Oe.displayName = "TextInput";
2132
- const _a = 500, xa = 5e3, Na = 2e4, St = B.forwardRef(
2766
+ ze.displayName = "TextInput";
2767
+ const nn = 500, on = 5e3, sn = 2e4, jt = H.forwardRef(
2133
2768
  ({
2134
2769
  name: e,
2135
2770
  disabled: t,
@@ -2139,80 +2774,80 @@ const _a = 500, xa = 5e3, Na = 2e4, St = B.forwardRef(
2139
2774
  onChange: o,
2140
2775
  onBlur: s,
2141
2776
  onFocus: i,
2142
- onTextInputMaskBlur: l,
2143
- rightElement: d,
2144
- spacing: h,
2145
- ...u
2146
- }, m) => {
2147
- const [p, f] = H(!0), [E, x] = H({
2777
+ onTextInputMaskBlur: h,
2778
+ rightElement: u,
2779
+ spacing: d,
2780
+ ...p
2781
+ }, l) => {
2782
+ const [m, y] = G(!0), [w, _] = G({
2148
2783
  message: null,
2149
2784
  politeness: null
2150
- }), D = j(!0), A = j(), w = j(null), M = ha([m, w]), C = p ? "Show" : "Hide", N = () => {
2151
- clearTimeout(A.current), D.current || (A.current = window.setTimeout(() => {
2152
- D.current = !0, f(!0), x({
2153
- announcementTimeout: xa,
2785
+ }), k = V(!0), D = V(), $ = V(null), N = Wa([l, $]), O = m ? "Show" : "Hide", x = () => {
2786
+ clearTimeout(D.current), k.current || (D.current = window.setTimeout(() => {
2787
+ k.current = !0, y(!0), _({
2788
+ announcementTimeout: on,
2154
2789
  politeness: "polite",
2155
2790
  message: `${r} hiding characters`
2156
2791
  }), n && n(!0);
2157
- }, Na));
2158
- }, J = (b) => {
2159
- b.preventDefault();
2160
- const I = !D.current;
2161
- D.current = I, N(), f(I), x({
2162
- announcementTimeout: _a,
2792
+ }, sn));
2793
+ }, Q = (g) => {
2794
+ g.preventDefault();
2795
+ const b = !k.current;
2796
+ k.current = b, x(), y(b), _({
2797
+ announcementTimeout: nn,
2163
2798
  politeness: "assertive",
2164
- message: I ? "Characters hidden" : "Characters showing"
2165
- }), n && n(I);
2166
- }, R = (b) => {
2167
- var I;
2168
- const { relatedTarget: W } = b, $ = (I = w.current) == null ? void 0 : I.parentElement;
2169
- $ != null && $.contains(W) || l && l();
2170
- }, fe = (b) => {
2171
- N(), s && s(b), R(b);
2172
- }, y = (b) => {
2173
- N(), i && i(b);
2174
- }, O = (b) => {
2175
- N(), o && o(b);
2799
+ message: b ? "Characters hidden" : "Characters showing"
2800
+ }), n && n(b);
2801
+ }, P = (g) => {
2802
+ var b;
2803
+ const { relatedTarget: E } = g, C = (b = $.current) == null ? void 0 : b.parentElement;
2804
+ C != null && C.contains(E) || h && h();
2805
+ }, Re = (g) => {
2806
+ x(), s && s(g), P(g);
2807
+ }, Ne = (g) => {
2808
+ x(), i && i(g);
2809
+ }, xe = (g) => {
2810
+ x(), o && o(g);
2176
2811
  };
2177
- return V(() => () => {
2178
- clearTimeout(A.current);
2179
- }, []), /* @__PURE__ */ T(q, { children: [
2812
+ return z(() => () => {
2813
+ clearTimeout(D.current);
2814
+ }, []), /* @__PURE__ */ T(ne, { children: [
2180
2815
  /* @__PURE__ */ c(
2181
- Oe,
2816
+ ze,
2182
2817
  {
2183
- ref: M,
2818
+ ref: N,
2184
2819
  name: e,
2185
2820
  label: r,
2186
2821
  labelHidden: a,
2187
- type: p ? "password" : "text",
2822
+ type: m ? "password" : "text",
2188
2823
  disabled: t,
2189
- spacing: h,
2190
- onBlur: fe,
2191
- onFocus: y,
2192
- onChange: O,
2193
- rightElement: B.cloneElement(d, {
2194
- ref: m,
2195
- label: C,
2196
- onClick: J,
2197
- onBlur: R,
2824
+ spacing: d,
2825
+ onBlur: Re,
2826
+ onFocus: Ne,
2827
+ onChange: xe,
2828
+ rightElement: H.cloneElement(u, {
2829
+ ref: l,
2830
+ label: O,
2831
+ onClick: Q,
2832
+ onBlur: P,
2198
2833
  disabled: t
2199
2834
  }),
2200
- ...u
2835
+ ...p
2201
2836
  }
2202
2837
  ),
2203
2838
  /* @__PURE__ */ c(
2204
- vt,
2839
+ Wt,
2205
2840
  {
2206
2841
  role: "status",
2207
- politeness: E.politeness,
2208
- clearAnnouncementDelay: E.announcementTimeout,
2209
- children: E.message
2842
+ politeness: w.politeness,
2843
+ clearAnnouncementDelay: w.announcementTimeout,
2844
+ children: w.message
2210
2845
  }
2211
2846
  )
2212
2847
  ] });
2213
2848
  }
2214
2849
  );
2215
- St.displayName = "TextInputMask";
2850
+ jt.displayName = "TextInputMask";
2216
2851
  /*!
2217
2852
  @versini/ui-form v1.3.6
2218
2853
  © 2024 gizmette.com
@@ -2226,7 +2861,7 @@ try {
2226
2861
  });
2227
2862
  } catch {
2228
2863
  }
2229
- const Ca = (e) => {
2864
+ const cn = (e) => {
2230
2865
  let t = "";
2231
2866
  if (typeof e == "number" || typeof e == "string")
2232
2867
  t = "m-" + e;
@@ -2235,7 +2870,7 @@ const Ca = (e) => {
2235
2870
  (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(" ");
2236
2871
  }
2237
2872
  return t;
2238
- }, De = ({
2873
+ }, _e = ({
2239
2874
  children: e,
2240
2875
  fill: t,
2241
2876
  viewBox: r,
@@ -2244,29 +2879,29 @@ const Ca = (e) => {
2244
2879
  defaultClassName: o,
2245
2880
  spacing: s,
2246
2881
  title: i,
2247
- semantic: l = !1,
2248
- ...d
2882
+ semantic: h = !1,
2883
+ ...u
2249
2884
  }) => {
2250
- const h = Ca(s), u = g(
2251
- h,
2885
+ const d = cn(s), p = f(
2886
+ d,
2252
2887
  a || o
2253
2888
  );
2254
- return /* @__PURE__ */ T(q, { children: [
2889
+ return /* @__PURE__ */ T(ne, { children: [
2255
2890
  /* @__PURE__ */ c(
2256
2891
  "svg",
2257
2892
  {
2258
2893
  xmlns: "http://www.w3.org/2000/svg",
2259
- className: u,
2894
+ className: p,
2260
2895
  viewBox: r || n,
2261
2896
  fill: t || "currentColor",
2262
2897
  role: "img",
2263
- "aria-hidden": !l,
2898
+ "aria-hidden": !h,
2264
2899
  focusable: !1,
2265
- ...d,
2900
+ ...u,
2266
2901
  children: e
2267
2902
  }
2268
2903
  ),
2269
- i && l && /* @__PURE__ */ c("span", { className: "sr-only", children: i })
2904
+ i && h && /* @__PURE__ */ c("span", { className: "sr-only", children: i })
2270
2905
  ] });
2271
2906
  };
2272
2907
  /*!
@@ -2276,19 +2911,19 @@ const Ca = (e) => {
2276
2911
  try {
2277
2912
  window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
2278
2913
  version: "1.4.6",
2279
- buildTime: "07/05/2024 05:27 PM EDT",
2914
+ buildTime: "07/14/2024 07:45 PM EDT",
2280
2915
  homepage: "https://github.com/aversini/ui-components",
2281
2916
  license: "MIT"
2282
2917
  });
2283
2918
  } catch {
2284
2919
  }
2285
- const Ra = ({
2920
+ const ln = ({
2286
2921
  className: e,
2287
2922
  viewBox: t,
2288
2923
  spacing: r,
2289
2924
  ...a
2290
2925
  }) => /* @__PURE__ */ c(
2291
- De,
2926
+ _e,
2292
2927
  {
2293
2928
  defaultViewBox: "0 0 1200 500",
2294
2929
  defaultClassName: "w-full",
@@ -2307,7 +2942,7 @@ const Ra = ({
2307
2942
  }
2308
2943
  ) })
2309
2944
  }
2310
- ), Oa = ({
2945
+ ), dn = ({
2311
2946
  className: e,
2312
2947
  viewBox: t,
2313
2948
  spacing: r,
@@ -2315,7 +2950,7 @@ const Ra = ({
2315
2950
  monotone: n,
2316
2951
  ...o
2317
2952
  }) => /* @__PURE__ */ T(
2318
- De,
2953
+ _e,
2319
2954
  {
2320
2955
  defaultViewBox: "0 0 640 512",
2321
2956
  defaultClassName: "size-5",
@@ -2335,7 +2970,42 @@ const Ra = ({
2335
2970
  /* @__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" })
2336
2971
  ]
2337
2972
  }
2338
- ), Da = ({
2973
+ ), un = ({
2974
+ className: e,
2975
+ viewBox: t,
2976
+ spacing: r,
2977
+ title: a,
2978
+ monotone: n,
2979
+ ...o
2980
+ }) => /* @__PURE__ */ T(
2981
+ _e,
2982
+ {
2983
+ defaultViewBox: "0 0 512 512",
2984
+ defaultClassName: "size-5",
2985
+ viewBox: t,
2986
+ className: e,
2987
+ spacing: r,
2988
+ title: a || "Key",
2989
+ ...o,
2990
+ children: [
2991
+ /* @__PURE__ */ c(
2992
+ "path",
2993
+ {
2994
+ className: "fa-secondary",
2995
+ opacity: n ? "1" : "0.4",
2996
+ 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"
2997
+ }
2998
+ ),
2999
+ /* @__PURE__ */ c(
3000
+ "path",
3001
+ {
3002
+ className: "fa-primary",
3003
+ d: "M168.3 229.7L282.3 343.7l0 0c16.9 5.4 35 8.3 53.7 8.3c97.2 0 176-78.8 176-176S433.2 0 336 0S160 78.8 160 176c0 18.7 2.9 36.8 8.3 53.7l0 0zM336 136a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z"
3004
+ }
3005
+ )
3006
+ ]
3007
+ }
3008
+ ), mn = ({
2339
3009
  className: e,
2340
3010
  viewBox: t,
2341
3011
  spacing: r,
@@ -2343,7 +3013,7 @@ const Ra = ({
2343
3013
  monotone: n,
2344
3014
  ...o
2345
3015
  }) => /* @__PURE__ */ T(
2346
- De,
3016
+ _e,
2347
3017
  {
2348
3018
  defaultViewBox: "0 0 576 512",
2349
3019
  defaultClassName: "size-5",
@@ -2365,19 +3035,19 @@ const Ra = ({
2365
3035
  }
2366
3036
  );
2367
3037
  /*!
2368
- @versini/ui-icons v1.10.0
3038
+ @versini/ui-icons v1.11.0
2369
3039
  © 2024 gizmette.com
2370
3040
  */
2371
3041
  try {
2372
3042
  window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
2373
- version: "1.10.0",
2374
- buildTime: "07/05/2024 05:27 PM EDT",
3043
+ version: "1.11.0",
3044
+ buildTime: "07/14/2024 07:45 PM EDT",
2375
3045
  homepage: "https://github.com/aversini/ui-components",
2376
3046
  license: "MIT"
2377
3047
  });
2378
3048
  } catch {
2379
3049
  }
2380
- const Ma = (e) => {
3050
+ const hn = (e) => {
2381
3051
  let t = "";
2382
3052
  if (typeof e == "number" || typeof e == "string")
2383
3053
  t = "m-" + e;
@@ -2386,10 +3056,10 @@ const Ma = (e) => {
2386
3056
  (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(" ");
2387
3057
  }
2388
3058
  return t;
2389
- }, La = "av-flexgrid", se = "av-flexgrid-item", ue = 0.25, Tt = B.createContext({
3059
+ }, pn = "av-flexgrid", pe = "av-flexgrid-item", Te = 0.25, Ft = H.createContext({
2390
3060
  columnGap: 0,
2391
3061
  rowGap: 0
2392
- }), Pa = ({
3062
+ }), mt = ({
2393
3063
  children: e,
2394
3064
  className: t,
2395
3065
  columnGap: r = 1,
@@ -2398,14 +3068,14 @@ const Ma = (e) => {
2398
3068
  width: o = "auto",
2399
3069
  direction: s = "row",
2400
3070
  alignHorizontal: i = "normal",
2401
- alignVertical: l = "normal",
2402
- spacing: d,
2403
- ...h
3071
+ alignVertical: h = "normal",
3072
+ spacing: u,
3073
+ ...d
2404
3074
  }) => {
2405
- const u = {
3075
+ const p = {
2406
3076
  flexDirection: s,
2407
3077
  justifyContent: i,
2408
- alignItems: l,
3078
+ alignItems: h,
2409
3079
  height: n,
2410
3080
  width: o,
2411
3081
  /**
@@ -2413,15 +3083,15 @@ const Ma = (e) => {
2413
3083
  * by the columnGap and rowGap that will be applied
2414
3084
  * to all FlexgridItems (see context and paddings).
2415
3085
  */
2416
- marginLeft: r * -1 * ue + "rem",
2417
- marginTop: a * -1 * ue + "rem"
2418
- }, m = g(
2419
- La,
3086
+ marginLeft: r * -1 * Te + "rem",
3087
+ marginTop: a * -1 * Te + "rem"
3088
+ }, l = f(
3089
+ pn,
2420
3090
  t,
2421
3091
  "box-border flex flex-wrap"
2422
- ), p = { columnGap: r, rowGap: a }, f = d ? "div" : B.Fragment;
2423
- return /* @__PURE__ */ c(f, { ...d ? { className: Ma(d) } : {}, children: /* @__PURE__ */ c("div", { className: m, style: u, ...h, children: /* @__PURE__ */ c(Tt.Provider, { value: p, children: e }) }) });
2424
- }, Ae = (e, t) => g({
3092
+ ), m = { columnGap: r, rowGap: a }, y = u ? "div" : H.Fragment;
3093
+ return /* @__PURE__ */ c(y, { ...u ? { className: hn(u) } : {}, children: /* @__PURE__ */ c("div", { className: l, style: p, ...d, children: /* @__PURE__ */ c(Ft.Provider, { value: m, children: e }) }) });
3094
+ }, Be = (e, t) => f({
2425
3095
  "basis-1/12": e === 1 && !t,
2426
3096
  "sm:basis-1/12": e === 1 && t === "sm",
2427
3097
  "md:basis-1/12": e === 1 && t === "md",
@@ -2494,39 +3164,39 @@ const Ma = (e) => {
2494
3164
  "lg:basis-full": e === 12 && t === "lg",
2495
3165
  "xl:basis-full": e === 12 && t === "xl",
2496
3166
  "2xl:basis-full": e === 12 && t === "2xl"
2497
- }), $a = ({
3167
+ }), gn = ({
2498
3168
  className: e,
2499
3169
  span: t
2500
3170
  }) => {
2501
3171
  if (!t)
2502
- return g(e, se, "box-border basis-auto");
3172
+ return f(e, pe, "box-border basis-auto");
2503
3173
  if (typeof t == "number")
2504
- return g(e, se, "box-border max-w-full", {
2505
- [`${Ae(t)}`]: !0
3174
+ return f(e, pe, "box-border max-w-full", {
3175
+ [`${Be(t)}`]: !0
2506
3176
  });
2507
3177
  if (typeof t == "string")
2508
- return g(e, se, "box-border basis-auto", {
3178
+ return f(e, pe, "box-border basis-auto", {
2509
3179
  "max-w-full grow": t === "auto"
2510
3180
  });
2511
3181
  if (typeof t == "object") {
2512
- const r = Object.entries(t).map(([a, n]) => a === "fallback" ? Ae(n) : Ae(n, a));
2513
- return g(
3182
+ const r = Object.entries(t).map(([a, n]) => a === "fallback" ? Be(n) : Be(n, a));
3183
+ return f(
2514
3184
  e,
2515
- se,
3185
+ pe,
2516
3186
  "box-border",
2517
3187
  r
2518
3188
  );
2519
3189
  }
2520
- }, ie = ({
3190
+ }, J = ({
2521
3191
  children: e,
2522
3192
  className: t,
2523
3193
  span: r,
2524
3194
  ...a
2525
3195
  }) => {
2526
- const { columnGap: n, rowGap: o } = Xe(Tt), s = {
2527
- paddingLeft: n * ue + "rem",
2528
- paddingTop: o * ue + "rem"
2529
- }, i = $a({
3196
+ const { columnGap: n, rowGap: o } = pt(Ft), s = {
3197
+ paddingLeft: n * Te + "rem",
3198
+ paddingTop: o * Te + "rem"
3199
+ }, i = gn({
2530
3200
  className: t,
2531
3201
  span: r
2532
3202
  });
@@ -2545,7 +3215,7 @@ try {
2545
3215
  });
2546
3216
  } catch {
2547
3217
  }
2548
- const Ua = "ASK! ME! ANYTHING!", At = "Sassy Saint", Ha = "gizmette.com", Ka = "Log in", Jn = "Log out", Ba = "Password", Wa = "Powered by OpenAI", Fn = "Send", zn = "Profile", Yn = "Statistics", qn = "Chat history", Qn = "About", Xn = "Type your question here", Zn = "Clear chat", eo = "Cancel chat", to = "N/A", ro = {
3218
+ const fn = "ASK! ME! ANYTHING!", Jt = "Sassy Saint", yn = "gizmette.com", bn = "Log in", En = "Sign in with a Passkey", So = "Log out", wn = "Password", Tn = "Powered by OpenAI", _o = "Send", Ro = "Profile", No = "Statistics", xo = "Chat history", Co = "About", Oo = "Type your question here", Po = "Clear chat", Do = "Cancel chat", $o = "N/A", Lo = {
2549
3219
  PREFERENCES: {
2550
3220
  TITLE: "User preferences",
2551
3221
  NAME: "Name",
@@ -2577,201 +3247,220 @@ const Ua = "ASK! ME! ANYTHING!", At = "Sassy Saint", Ha = "gizmette.com", Ka = "
2577
3247
  ENGINE: "OpenAI model",
2578
3248
  PLUGIN: "Plugin"
2579
3249
  }
2580
- }, ja = ({
3250
+ }, In = ({
2581
3251
  serverStats: e
2582
3252
  }) => /* @__PURE__ */ c(
2583
- ua,
3253
+ Ga,
2584
3254
  {
2585
3255
  mode: "light",
2586
3256
  row1: /* @__PURE__ */ T("div", { children: [
2587
- At,
3257
+ Jt,
2588
3258
  " v",
2589
- "3.2.2",
3259
+ "3.4.0",
2590
3260
  " - ",
2591
- Wa,
2592
- Ne && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
3261
+ Tn,
3262
+ Fe && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
2593
3263
  ] }),
2594
3264
  row2: /* @__PURE__ */ T("div", { children: [
2595
3265
  "© ",
2596
3266
  (/* @__PURE__ */ new Date()).getFullYear(),
2597
3267
  " ",
2598
- Ha
3268
+ yn
2599
3269
  ] })
2600
3270
  }
2601
- ), Ga = Ze(() => import("./LazyHeader.DioQirr-.js")), Va = () => {
2602
- const { isAuthenticated: e } = xe();
2603
- return /* @__PURE__ */ T(q, { children: [
2604
- e && /* @__PURE__ */ c(et, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Ga, {}) }),
3271
+ ), vn = ft(() => import("./LazyHeader.C1RUIYBp.js")), An = () => {
3272
+ const { isAuthenticated: e } = je();
3273
+ return /* @__PURE__ */ T(ne, { children: [
3274
+ e && /* @__PURE__ */ c(yt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(vn, {}) }),
2605
3275
  /* @__PURE__ */ T("div", { className: "flex items-center justify-center", children: [
2606
- /* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(Ra, {}) }),
3276
+ /* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(ln, {}) }),
2607
3277
  /* @__PURE__ */ T("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
2608
- /* @__PURE__ */ c("h1", { children: At }),
2609
- /* @__PURE__ */ c("h2", { children: Ua })
3278
+ /* @__PURE__ */ c("h1", { children: Jt }),
3279
+ /* @__PURE__ */ c("h2", { children: fn })
2610
3280
  ] })
2611
3281
  ] })
2612
3282
  ] });
2613
- }, Ja = () => {
2614
- const { login: e, logoutReason: t } = xe(), [r, a] = H(""), [n, o] = H(""), [s, i] = H(!0), [l, d] = H({
3283
+ }, kn = () => {
3284
+ const { login: e, logoutReason: t, loginWithPasskey: r } = je(), [a, n] = G(""), [o, s] = G(""), [i, h] = G(!0), [u, d] = G({
2615
3285
  username: "",
2616
3286
  password: ""
2617
- }), h = async (u) => {
2618
- u.preventDefault(), await e(
2619
- l.username,
2620
- l.password,
2621
- Q.CODE
2622
- ) || (o(""), a("Invalid username or password"));
3287
+ }), p = async (l) => {
3288
+ l.preventDefault(), await e(
3289
+ u.username,
3290
+ u.password,
3291
+ q.CODE
3292
+ ) || (s(""), n("Invalid username or password"));
2623
3293
  };
2624
- return V(() => {
2625
- var u;
2626
- (u = document.getElementById("logo")) == null || u.classList.add("fadeOut"), setTimeout(() => {
3294
+ return z(() => {
3295
+ var l;
3296
+ (l = document.getElementById("logo")) == null || l.classList.add("fadeOut"), setTimeout(() => {
2627
3297
  var m;
2628
3298
  (m = document.getElementById("root")) == null || m.classList.replace("app-hidden", "fadeIn");
2629
3299
  }, 500);
2630
- }), V(() => {
2631
- t && o(t);
2632
- }, [t]), /* @__PURE__ */ T(q, { children: [
2633
- /* @__PURE__ */ T(ma, { children: [
2634
- /* @__PURE__ */ c("div", { className: ea(), children: /* @__PURE__ */ c(Va, {}) }),
2635
- /* @__PURE__ */ c("form", { className: "mx-auto mt-5", onSubmit: h, children: /* @__PURE__ */ T(Pa, { rowGap: 7, width: "350px", children: [
2636
- /* @__PURE__ */ c(ie, { span: 12, children: n && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: n }) }),
2637
- /* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
2638
- Oe,
3300
+ }), z(() => {
3301
+ t && s(t);
3302
+ }, [t]), /* @__PURE__ */ T(ne, { children: [
3303
+ /* @__PURE__ */ T(Va, { children: [
3304
+ /* @__PURE__ */ c("div", { className: _a(), children: /* @__PURE__ */ c(An, {}) }),
3305
+ /* @__PURE__ */ T("form", { className: "mt-5", onSubmit: p, children: [
3306
+ /* @__PURE__ */ c(mt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ c(J, { span: 6, children: /* @__PURE__ */ T(Ba, { mode: "dark", children: [
3307
+ /* @__PURE__ */ c(J, { span: 12, children: o && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
3308
+ /* @__PURE__ */ c(J, { span: 12, children: /* @__PURE__ */ c(
3309
+ ze,
3310
+ {
3311
+ required: !0,
3312
+ autoCapitalize: "off",
3313
+ autoComplete: "off",
3314
+ autoCorrect: "off",
3315
+ mode: "dark",
3316
+ focusMode: "light",
3317
+ name: "username",
3318
+ label: "Username",
3319
+ onChange: (l) => {
3320
+ d({
3321
+ ...u,
3322
+ username: l.target.value
3323
+ }), n("");
3324
+ },
3325
+ error: a !== ""
3326
+ }
3327
+ ) }),
3328
+ /* @__PURE__ */ c(J, { span: 12, children: /* @__PURE__ */ c(
3329
+ jt,
3330
+ {
3331
+ required: !0,
3332
+ autoCapitalize: "off",
3333
+ autoComplete: "off",
3334
+ autoCorrect: "off",
3335
+ mode: "dark",
3336
+ focusMode: "light",
3337
+ name: "password",
3338
+ label: wn,
3339
+ rightElement: /* @__PURE__ */ c(Ve, { focusMode: "light", mode: "dark", children: i ? /* @__PURE__ */ c(mn, {}) : /* @__PURE__ */ c(dn, {}) }),
3340
+ onMaskChange: h,
3341
+ onChange: (l) => {
3342
+ d({
3343
+ ...u,
3344
+ password: l.target.value
3345
+ }), n("");
3346
+ },
3347
+ error: a !== "",
3348
+ helperText: a
3349
+ }
3350
+ ) }),
3351
+ /* @__PURE__ */ c(J, { span: 12, children: /* @__PURE__ */ c(
3352
+ Bt,
3353
+ {
3354
+ mode: "light",
3355
+ focusMode: "light",
3356
+ fullWidth: !0,
3357
+ noBorder: !0,
3358
+ type: "submit",
3359
+ className: "mb-4 mt-6",
3360
+ children: bn
3361
+ }
3362
+ ) })
3363
+ ] }) }) }),
3364
+ /* @__PURE__ */ c("div", { className: "text-center text-copy-light", children: "or" }),
3365
+ /* @__PURE__ */ c(mt, { alignHorizontal: "center", children: /* @__PURE__ */ c(J, { span: 6, children: /* @__PURE__ */ c(
3366
+ Ve,
2639
3367
  {
2640
- required: !0,
2641
- autoCapitalize: "off",
2642
- autoComplete: "off",
2643
- autoCorrect: "off",
2644
3368
  mode: "dark",
2645
- focusMode: "light",
2646
- name: "username",
2647
- label: "Username",
2648
- onChange: (u) => {
2649
- d({
2650
- ...l,
2651
- username: u.target.value
2652
- }), a("");
2653
- },
2654
- error: r !== ""
2655
- }
2656
- ) }),
2657
- /* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
2658
- St,
2659
- {
2660
- required: !0,
2661
- autoCapitalize: "off",
2662
- autoComplete: "off",
2663
- autoCorrect: "off",
2664
- mode: "dark",
2665
- focusMode: "light",
2666
- name: "password",
2667
- label: Ba,
2668
- rightElement: /* @__PURE__ */ c(yt, { focusMode: "light", children: s ? /* @__PURE__ */ c(Da, {}) : /* @__PURE__ */ c(Oa, {}) }),
2669
- onMaskChange: i,
2670
- onChange: (u) => {
2671
- d({
2672
- ...l,
2673
- password: u.target.value
2674
- }), a("");
2675
- },
2676
- error: r !== "",
2677
- helperText: r
2678
- }
2679
- ) }),
2680
- /* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
2681
- bt,
2682
- {
2683
3369
  focusMode: "light",
2684
3370
  fullWidth: !0,
2685
3371
  noBorder: !0,
2686
- type: "submit",
2687
- className: "mb-4 mt-6",
2688
- children: Ka
3372
+ className: "mb-4 mt-1",
3373
+ labelRight: En,
3374
+ onClick: r,
3375
+ children: /* @__PURE__ */ c(un, { className: "size-4" })
2689
3376
  }
2690
- ) })
2691
- ] }) })
3377
+ ) }) })
3378
+ ] })
2692
3379
  ] }),
2693
- /* @__PURE__ */ c(ja, {})
3380
+ /* @__PURE__ */ c(In, {})
2694
3381
  ] });
2695
- }, Fa = Ze(() => import("./App.llFW8bC9.js").then((e) => e.App)), za = ({ isComponent: e }) => {
2696
- const { isAuthenticated: t } = xe();
2697
- return t ? /* @__PURE__ */ c(et, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Fa, { isComponent: e }) }) : /* @__PURE__ */ c(Ja, {});
2698
- }, Ya = ({
3382
+ }, Sn = ft(() => import("./App.DpwMzH8A.js").then((e) => e.App)), _n = ({ isComponent: e }) => {
3383
+ const { isAuthenticated: t } = je();
3384
+ return t ? /* @__PURE__ */ c(yt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Sn, { isComponent: e }) }) : /* @__PURE__ */ c(kn, {});
3385
+ }, Rn = ({
2699
3386
  isComponent: e = !1,
2700
- domain: t = Zr
2701
- }) => /* @__PURE__ */ c(q, { children: /* @__PURE__ */ c(Wr, { clientId: jr, domain: t, children: /* @__PURE__ */ c(za, { isComponent: e }) }) }), qa = ({ domain: e }) => /* @__PURE__ */ c(Ya, { isComponent: !0, domain: e });
2702
- qa.displayName = "SassySaint-3.2.2";
3387
+ domain: t = Sa
3388
+ }) => /* @__PURE__ */ c(ne, { children: /* @__PURE__ */ c(ga, { clientId: fa, domain: t, children: /* @__PURE__ */ c(_n, { isComponent: e }) }) }), Nn = ({ domain: e }) => /* @__PURE__ */ c(Rn, { isComponent: !0, domain: e });
3389
+ Nn.displayName = "SassySaint-3.4.0";
2703
3390
  export {
2704
- ft as A,
2705
- Qn as ABOUT_TITLE,
2706
- fn as ACTION_LOCATION,
2707
- mn as ACTION_MESSAGE,
2708
- pn as ACTION_MODEL,
2709
- hn as ACTION_RESET,
2710
- gn as ACTION_RESTORE,
2711
- bn as ACTION_SEARCH,
2712
- wn as ACTION_SORT,
2713
- yn as ACTION_STREAMING,
2714
- ja as AppFooter,
2715
- eo as CANCEL,
2716
- ro as CARDS,
2717
- Zn as CLEAR,
2718
- $n as E,
2719
- ln as ERROR_MESSAGE,
2720
- Oe as G,
2721
- un as GPT4_MAX_TOKENS,
2722
- qn as HISTORY_TITLE,
2723
- vn as LOCAL_STORAGE_CHAT_DETAILS,
2724
- Tn as LOCAL_STORAGE_LOCATION,
2725
- En as LOCAL_STORAGE_PREFIX,
2726
- kn as LOCAL_STORAGE_SEARCH,
2727
- Sn as LOCAL_STORAGE_SORT,
2728
- Jn as LOG_OUT,
2729
- pa as M,
2730
- dn as MODEL_GPT4,
2731
- Va as MessagesContainerHeader,
2732
- Un as N,
2733
- to as NA,
2734
- yt as O,
2735
- zn as PROFILE_TITLE,
2736
- nn as ROLE_ASSISTANT,
2737
- cn as ROLE_HIDDEN,
2738
- sn as ROLE_INTERNAL,
2739
- on as ROLE_SYSTEM,
2740
- an as ROLE_USER,
2741
- Ce as S,
2742
- Fn as SEND,
2743
- Yn as STATS,
2744
- An as STATS_SEPARATOR,
2745
- qa as SassySaint,
2746
- Xn as TYPE_QUESTION,
2747
- vt as U,
2748
- jn as a,
2749
- Pa as b,
2750
- ma as c,
2751
- Kn as c$1,
2752
- _n as convertLatitudeToDMS,
2753
- xn as convertLongitudeToDMS,
2754
- xe as dr,
2755
- Mn as durationFormatter,
2756
- Rn as extractAverage,
2757
- pt as f,
2758
- ha as f$1,
2759
- De as g,
2760
- Nn as getCurrentGeoLocation,
2761
- ea as getMessageContaintWrapperClass,
2762
- Re as i,
2763
- Hn as i$1,
2764
- On as isLastMessageFromRole,
2765
- ie as j,
2766
- Gn as l,
2767
- Bn as n,
2768
- Dn as numberFormatter,
2769
- wa as o,
2770
- Vn as p,
2771
- Ln as pluralize,
2772
- Wn as r,
2773
- Cn as renderDataAsList,
2774
- Pn as s,
2775
- In as truncate,
2776
- bt as x
3391
+ Kt as A,
3392
+ Co as ABOUT_TITLE,
3393
+ qn as ACTION_LOCATION,
3394
+ jn as ACTION_MESSAGE,
3395
+ Jn as ACTION_MODEL,
3396
+ Fn as ACTION_RESET,
3397
+ zn as ACTION_RESTORE,
3398
+ Xn as ACTION_SEARCH,
3399
+ Zn as ACTION_SORT,
3400
+ Qn as ACTION_STREAMING,
3401
+ In as AppFooter,
3402
+ Do as CANCEL,
3403
+ Lo as CARDS,
3404
+ Po as CLEAR,
3405
+ Vn as ERROR_MESSAGE,
3406
+ ze as G,
3407
+ Yn as GPT4_MAX_TOKENS,
3408
+ xo as HISTORY_TITLE,
3409
+ je as Hr,
3410
+ to as LOCAL_STORAGE_CHAT_DETAILS,
3411
+ no as LOCAL_STORAGE_LOCATION,
3412
+ eo as LOCAL_STORAGE_PREFIX,
3413
+ ro as LOCAL_STORAGE_SEARCH,
3414
+ ao as LOCAL_STORAGE_SORT,
3415
+ So as LOG_OUT,
3416
+ Ya as M,
3417
+ Wn as MODEL_GPT4,
3418
+ An as MessagesContainerHeader,
3419
+ bo as N,
3420
+ Ba as N$1,
3421
+ $o as NA,
3422
+ Ve as O,
3423
+ Ro as PROFILE_TITLE,
3424
+ Hn as ROLE_ASSISTANT,
3425
+ Gn as ROLE_HIDDEN,
3426
+ Bn as ROLE_INTERNAL,
3427
+ Kn as ROLE_SYSTEM,
3428
+ Un as ROLE_USER,
3429
+ Se as S,
3430
+ _o as SEND,
3431
+ No as STATS,
3432
+ oo as STATS_SEPARATOR,
3433
+ Nn as SassySaint,
3434
+ Oo as TYPE_QUESTION,
3435
+ Wt as U,
3436
+ q as Y,
3437
+ vo as a,
3438
+ mt as b,
3439
+ Va as c,
3440
+ wo as c$1,
3441
+ io as convertLatitudeToDMS,
3442
+ co as convertLongitudeToDMS,
3443
+ go as durationFormatter,
3444
+ mo as extractAverage,
3445
+ Ut as f,
3446
+ Wa as f$1,
3447
+ un as f$2,
3448
+ _e as g,
3449
+ lo as getCurrentGeoLocation,
3450
+ _a as getMessageContaintWrapperClass,
3451
+ Je as i,
3452
+ Eo as i$1,
3453
+ ho as isLastMessageFromRole,
3454
+ J as j,
3455
+ Ao as l,
3456
+ To as n,
3457
+ po as numberFormatter,
3458
+ qa as o,
3459
+ ko as p,
3460
+ fo as pluralize,
3461
+ Io as r,
3462
+ uo as renderDataAsList,
3463
+ yo as s,
3464
+ so as truncate,
3465
+ Bt as x
2777
3466
  };