@versini/sassysaint 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{App.cLV1bpwK.js → App.pFoMWtnP.js} +3 -3
- package/dist/chunks/{LazyHeader.IkHWXL63.js → LazyHeader.D3qbUck7.js} +7 -7
- package/dist/chunks/{LazyMarkdownWithExtra.CbkyblK3.js → LazyMarkdownWithExtra.BruyCOAi.js} +1 -1
- package/dist/chunks/{LazyMessageAssistant.D1gHF9UN.js → LazyMessageAssistant.Dm0Ytsu1.js} +4 -4
- package/dist/chunks/{index.5k1aFm13.js → index.B6xSbzQS.js} +841 -818
- package/dist/chunks/{index.DruzEDnN.CpJnm_FK.js → index.DruzEDnN.9U25cgur.js} +1 -1
- package/dist/chunks/{useLocalStorage.CgBXkOng.js → useLocalStorage.D6vdElMS.js} +3 -1
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -4
- package/package.json +3 -2
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
1
|
+
import { jsx as c, jsxs as T, Fragment as q } from "react/jsx-runtime";
|
|
2
2
|
import * as F from "react";
|
|
3
|
-
import K, { createContext as
|
|
3
|
+
import K, { createContext as xt, useRef as W, useState as U, useCallback as Me, useEffect as z, useContext as Ze, useMemo as Nt, useId as Ct, useReducer as Rt, useLayoutEffect as Ot, lazy as et, Suspense as tt } from "react";
|
|
4
4
|
import g from "clsx";
|
|
5
|
-
var
|
|
5
|
+
var Dt = Object.defineProperty, $t = (e, t, r) => t in e ? Dt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ye = (e, t, r) => ($t(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
6
6
|
/*!
|
|
7
|
-
@versini/auth-provider v5.
|
|
7
|
+
@versini/auth-provider v5.1.1
|
|
8
8
|
© 2024 gizmette.com
|
|
9
9
|
*/
|
|
10
10
|
try {
|
|
11
11
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
12
|
-
version: "5.
|
|
13
|
-
buildTime: "07/
|
|
12
|
+
version: "5.1.1",
|
|
13
|
+
buildTime: "07/07/2024 10:59 AM EDT",
|
|
14
14
|
homepage: "https://github.com/aversini/auth-client",
|
|
15
15
|
license: "MIT"
|
|
16
16
|
});
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
19
|
/*!
|
|
20
|
-
@versini/auth-common v2.
|
|
20
|
+
@versini/auth-common v2.11.0
|
|
21
21
|
© 2024 gizmette.com
|
|
22
22
|
*/
|
|
23
23
|
try {
|
|
24
24
|
window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
|
|
25
|
-
version: "2.
|
|
26
|
-
buildTime: "07/
|
|
25
|
+
version: "2.11.0",
|
|
26
|
+
buildTime: "07/07/2024 10:59 AM EDT",
|
|
27
27
|
homepage: "https://github.com/aversini/auth-client",
|
|
28
28
|
license: "MIT"
|
|
29
29
|
});
|
|
@@ -37,14 +37,14 @@ const Q = {
|
|
|
37
37
|
REFRESH_TOKEN: "refresh_token"
|
|
38
38
|
}, Mt = {
|
|
39
39
|
CLIENT_ID: "X-Auth-ClientId"
|
|
40
|
-
},
|
|
40
|
+
}, I = {
|
|
41
41
|
ALG: "RS256",
|
|
42
42
|
USER_ID_KEY: "sub",
|
|
43
43
|
TOKEN_ID_KEY: "__raw",
|
|
44
44
|
NONCE_KEY: "_nonce",
|
|
45
45
|
USERNAME_KEY: "username",
|
|
46
46
|
ISSUER: "gizmette.com"
|
|
47
|
-
},
|
|
47
|
+
}, Lt = `-----BEGIN PUBLIC KEY-----
|
|
48
48
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
|
|
49
49
|
w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
|
|
50
50
|
i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
|
|
@@ -52,33 +52,33 @@ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
|
|
|
52
52
|
l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
|
|
53
53
|
sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
|
|
54
54
|
awIDAQAB
|
|
55
|
-
-----END PUBLIC KEY-----`,
|
|
55
|
+
-----END PUBLIC KEY-----`, me = {
|
|
56
56
|
AUTHENTICATE: "authenticate",
|
|
57
57
|
CODE: "code",
|
|
58
58
|
LOGOUT: "logout"
|
|
59
|
-
},
|
|
60
|
-
function
|
|
59
|
+
}, he = crypto, rt = (e) => e instanceof CryptoKey, X = new TextEncoder(), pe = new TextDecoder();
|
|
60
|
+
function Pt(...e) {
|
|
61
61
|
const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
|
|
62
62
|
let a = 0;
|
|
63
63
|
for (const n of e)
|
|
64
64
|
r.set(n, a), a += n.length;
|
|
65
65
|
return r;
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const Ut = (e) => {
|
|
68
68
|
const t = atob(e), r = new Uint8Array(t.length);
|
|
69
69
|
for (let a = 0; a < t.length; a++)
|
|
70
70
|
r[a] = t.charCodeAt(a);
|
|
71
71
|
return r;
|
|
72
|
-
},
|
|
72
|
+
}, ce = (e) => {
|
|
73
73
|
let t = e;
|
|
74
|
-
t instanceof Uint8Array && (t =
|
|
74
|
+
t instanceof Uint8Array && (t = pe.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
75
75
|
try {
|
|
76
|
-
return
|
|
76
|
+
return Ut(t);
|
|
77
77
|
} catch {
|
|
78
78
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
let
|
|
81
|
+
let j = class extends Error {
|
|
82
82
|
static get code() {
|
|
83
83
|
return "ERR_JOSE_GENERIC";
|
|
84
84
|
}
|
|
@@ -86,7 +86,7 @@ let W = class extends Error {
|
|
|
86
86
|
var r;
|
|
87
87
|
super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
|
|
88
88
|
}
|
|
89
|
-
},
|
|
89
|
+
}, M = class extends j {
|
|
90
90
|
static get code() {
|
|
91
91
|
return "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ let W = class extends Error {
|
|
|
94
94
|
super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = a, this.reason = n, this.payload = r;
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
class
|
|
97
|
+
class Le extends j {
|
|
98
98
|
static get code() {
|
|
99
99
|
return "ERR_JWT_EXPIRED";
|
|
100
100
|
}
|
|
@@ -102,7 +102,7 @@ class $e extends W {
|
|
|
102
102
|
super(t), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
class
|
|
105
|
+
class Ht extends j {
|
|
106
106
|
constructor() {
|
|
107
107
|
super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
108
108
|
}
|
|
@@ -110,14 +110,14 @@ class Ut extends W {
|
|
|
110
110
|
return "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
let H = class extends
|
|
113
|
+
let H = class extends j {
|
|
114
114
|
constructor() {
|
|
115
115
|
super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
|
|
116
116
|
}
|
|
117
117
|
static get code() {
|
|
118
118
|
return "ERR_JOSE_NOT_SUPPORTED";
|
|
119
119
|
}
|
|
120
|
-
}, k = class extends
|
|
120
|
+
}, k = class extends j {
|
|
121
121
|
constructor() {
|
|
122
122
|
super(...arguments), this.code = "ERR_JWS_INVALID";
|
|
123
123
|
}
|
|
@@ -125,7 +125,7 @@ let H = class extends W {
|
|
|
125
125
|
return "ERR_JWS_INVALID";
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
class
|
|
128
|
+
class at extends j {
|
|
129
129
|
constructor() {
|
|
130
130
|
super(...arguments), this.code = "ERR_JWT_INVALID";
|
|
131
131
|
}
|
|
@@ -133,7 +133,7 @@ class rt extends W {
|
|
|
133
133
|
return "ERR_JWT_INVALID";
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
class
|
|
136
|
+
class Kt extends j {
|
|
137
137
|
constructor() {
|
|
138
138
|
super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
|
|
139
139
|
}
|
|
@@ -144,13 +144,13 @@ class Ht extends W {
|
|
|
144
144
|
function L(e, t = "algorithm.name") {
|
|
145
145
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Z(e, t) {
|
|
148
148
|
return e.name === t;
|
|
149
149
|
}
|
|
150
150
|
function be(e) {
|
|
151
151
|
return parseInt(e.name.slice(4), 10);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Bt(e) {
|
|
154
154
|
switch (e) {
|
|
155
155
|
case "ES256":
|
|
156
156
|
return "P-256";
|
|
@@ -162,7 +162,7 @@ function Kt(e) {
|
|
|
162
162
|
throw new Error("unreachable");
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function Wt(e, t) {
|
|
166
166
|
if (t.length && !t.some((r) => e.usages.includes(r))) {
|
|
167
167
|
let r = "CryptoKey does not support this operation, its usages must include ";
|
|
168
168
|
if (t.length > 2) {
|
|
@@ -173,12 +173,12 @@ function Bt(e, t) {
|
|
|
173
173
|
throw new TypeError(r);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function jt(e, t, ...r) {
|
|
177
177
|
switch (t) {
|
|
178
178
|
case "HS256":
|
|
179
179
|
case "HS384":
|
|
180
180
|
case "HS512": {
|
|
181
|
-
if (!
|
|
181
|
+
if (!Z(e.algorithm, "HMAC"))
|
|
182
182
|
throw L("HMAC");
|
|
183
183
|
const a = parseInt(t.slice(2), 10);
|
|
184
184
|
if (be(e.algorithm.hash) !== a)
|
|
@@ -188,7 +188,7 @@ function Wt(e, t, ...r) {
|
|
|
188
188
|
case "RS256":
|
|
189
189
|
case "RS384":
|
|
190
190
|
case "RS512": {
|
|
191
|
-
if (!
|
|
191
|
+
if (!Z(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
192
192
|
throw L("RSASSA-PKCS1-v1_5");
|
|
193
193
|
const a = parseInt(t.slice(2), 10);
|
|
194
194
|
if (be(e.algorithm.hash) !== a)
|
|
@@ -198,7 +198,7 @@ function Wt(e, t, ...r) {
|
|
|
198
198
|
case "PS256":
|
|
199
199
|
case "PS384":
|
|
200
200
|
case "PS512": {
|
|
201
|
-
if (!
|
|
201
|
+
if (!Z(e.algorithm, "RSA-PSS"))
|
|
202
202
|
throw L("RSA-PSS");
|
|
203
203
|
const a = parseInt(t.slice(2), 10);
|
|
204
204
|
if (be(e.algorithm.hash) !== a)
|
|
@@ -213,9 +213,9 @@ function Wt(e, t, ...r) {
|
|
|
213
213
|
case "ES256":
|
|
214
214
|
case "ES384":
|
|
215
215
|
case "ES512": {
|
|
216
|
-
if (!
|
|
216
|
+
if (!Z(e.algorithm, "ECDSA"))
|
|
217
217
|
throw L("ECDSA");
|
|
218
|
-
const a =
|
|
218
|
+
const a = Bt(t);
|
|
219
219
|
if (e.algorithm.namedCurve !== a)
|
|
220
220
|
throw L(a, "algorithm.namedCurve");
|
|
221
221
|
break;
|
|
@@ -223,9 +223,9 @@ function Wt(e, t, ...r) {
|
|
|
223
223
|
default:
|
|
224
224
|
throw new TypeError("CryptoKey does not support this operation");
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
Wt(e, r);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function nt(e, t, ...r) {
|
|
229
229
|
var a;
|
|
230
230
|
if (r.length > 2) {
|
|
231
231
|
const n = r.pop();
|
|
@@ -234,11 +234,11 @@ function at(e, t, ...r) {
|
|
|
234
234
|
r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
|
|
235
235
|
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;
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
function
|
|
239
|
-
return
|
|
237
|
+
const Pe = (e, ...t) => nt("Key must be ", e, ...t);
|
|
238
|
+
function ot(e, t, ...r) {
|
|
239
|
+
return nt(`Key for the ${e} algorithm must be `, t, ...r);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const st = (e) => rt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", de = ["CryptoKey"], Gt = (...e) => {
|
|
242
242
|
const t = e.filter(Boolean);
|
|
243
243
|
if (t.length === 0 || t.length === 1)
|
|
244
244
|
return !0;
|
|
@@ -257,11 +257,11 @@ const ot = (e) => tt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
|
|
|
257
257
|
}
|
|
258
258
|
return !0;
|
|
259
259
|
};
|
|
260
|
-
function
|
|
260
|
+
function Vt(e) {
|
|
261
261
|
return typeof e == "object" && e !== null;
|
|
262
262
|
}
|
|
263
263
|
function _e(e) {
|
|
264
|
-
if (!
|
|
264
|
+
if (!Vt(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
265
265
|
return !1;
|
|
266
266
|
if (Object.getPrototypeOf(e) === null)
|
|
267
267
|
return !0;
|
|
@@ -270,14 +270,14 @@ function _e(e) {
|
|
|
270
270
|
t = Object.getPrototypeOf(t);
|
|
271
271
|
return Object.getPrototypeOf(e) === t;
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const Jt = (e, t) => {
|
|
274
274
|
if (e.startsWith("RS") || e.startsWith("PS")) {
|
|
275
275
|
const { modulusLength: r } = t.algorithm;
|
|
276
276
|
if (typeof r != "number" || r < 2048)
|
|
277
277
|
throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
|
-
function
|
|
280
|
+
function Ft(e) {
|
|
281
281
|
let t, r;
|
|
282
282
|
switch (e.kty) {
|
|
283
283
|
case "RSA": {
|
|
@@ -349,43 +349,43 @@ function Jt(e) {
|
|
|
349
349
|
}
|
|
350
350
|
return { algorithm: t, keyUsages: r };
|
|
351
351
|
}
|
|
352
|
-
const
|
|
352
|
+
const zt = async (e) => {
|
|
353
353
|
if (!e.alg)
|
|
354
354
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
355
|
-
const { algorithm: t, keyUsages: r } =
|
|
355
|
+
const { algorithm: t, keyUsages: r } = Ft(e), a = [
|
|
356
356
|
t,
|
|
357
357
|
e.ext ?? !1,
|
|
358
358
|
e.key_ops ?? r
|
|
359
359
|
], n = { ...e };
|
|
360
|
-
return delete n.alg, delete n.use,
|
|
361
|
-
},
|
|
360
|
+
return delete n.alg, delete n.use, he.subtle.importKey("jwk", n, ...a);
|
|
361
|
+
}, it = (e) => ce(e);
|
|
362
362
|
let we, Ee;
|
|
363
|
-
const
|
|
363
|
+
const ct = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", lt = async (e, t, r, a) => {
|
|
364
364
|
let n = e.get(t);
|
|
365
365
|
if (n != null && n[a])
|
|
366
366
|
return n[a];
|
|
367
|
-
const o = await
|
|
367
|
+
const o = await zt({ ...r, alg: a });
|
|
368
368
|
return n ? n[a] = o : e.set(t, { [a]: o }), o;
|
|
369
|
-
},
|
|
370
|
-
if (
|
|
369
|
+
}, Yt = (e, t) => {
|
|
370
|
+
if (ct(e)) {
|
|
371
371
|
let r = e.export({ format: "jwk" });
|
|
372
|
-
return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ?
|
|
372
|
+
return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? it(r.k) : (Ee || (Ee = /* @__PURE__ */ new WeakMap()), lt(Ee, e, r, t));
|
|
373
373
|
}
|
|
374
374
|
return e;
|
|
375
|
-
},
|
|
376
|
-
if (
|
|
375
|
+
}, qt = (e, t) => {
|
|
376
|
+
if (ct(e)) {
|
|
377
377
|
let r = e.export({ format: "jwk" });
|
|
378
|
-
return r.k ?
|
|
378
|
+
return r.k ? it(r.k) : (we || (we = /* @__PURE__ */ new WeakMap()), lt(we, e, r, t));
|
|
379
379
|
}
|
|
380
380
|
return e;
|
|
381
|
-
},
|
|
381
|
+
}, Qt = { normalizePublicKey: Yt, normalizePrivateKey: qt }, P = (e, t, r = 0) => {
|
|
382
382
|
r === 0 && (t.unshift(t.length), t.unshift(6));
|
|
383
383
|
const a = e.indexOf(t[0], r);
|
|
384
384
|
if (a === -1)
|
|
385
385
|
return !1;
|
|
386
386
|
const n = e.subarray(a, a + t.length);
|
|
387
387
|
return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || P(e, t, a + 1);
|
|
388
|
-
},
|
|
388
|
+
}, Ue = (e) => {
|
|
389
389
|
switch (!0) {
|
|
390
390
|
case P(e, [42, 134, 72, 206, 61, 3, 1, 7]):
|
|
391
391
|
return "P-256";
|
|
@@ -404,7 +404,7 @@ const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
|
404
404
|
default:
|
|
405
405
|
throw new H("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
406
406
|
}
|
|
407
|
-
},
|
|
407
|
+
}, Xt = async (e, t, r, a, n) => {
|
|
408
408
|
let o, s;
|
|
409
409
|
const i = new Uint8Array(atob(r.replace(e, "")).split("").map((l) => l.charCodeAt(0)));
|
|
410
410
|
switch (a) {
|
|
@@ -440,43 +440,43 @@ const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
|
440
440
|
case "ECDH-ES+A128KW":
|
|
441
441
|
case "ECDH-ES+A192KW":
|
|
442
442
|
case "ECDH-ES+A256KW": {
|
|
443
|
-
const l =
|
|
443
|
+
const l = Ue(i);
|
|
444
444
|
o = l.startsWith("P-") ? { name: "ECDH", namedCurve: l } : { name: l }, s = [];
|
|
445
445
|
break;
|
|
446
446
|
}
|
|
447
447
|
case "EdDSA":
|
|
448
|
-
o = { name:
|
|
448
|
+
o = { name: Ue(i) }, s = ["verify"];
|
|
449
449
|
break;
|
|
450
450
|
default:
|
|
451
451
|
throw new H('Invalid or unsupported "alg" (Algorithm) value');
|
|
452
452
|
}
|
|
453
|
-
return
|
|
454
|
-
},
|
|
455
|
-
async function
|
|
453
|
+
return he.subtle.importKey(t, i, o, !1, s);
|
|
454
|
+
}, Zt = (e, t, r) => Xt(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
|
|
455
|
+
async function er(e, t, r) {
|
|
456
456
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
457
457
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
458
|
-
return
|
|
458
|
+
return Zt(e, t);
|
|
459
459
|
}
|
|
460
|
-
const
|
|
460
|
+
const le = (e) => e == null ? void 0 : e[Symbol.toStringTag], tr = (e, t) => {
|
|
461
461
|
if (!(t instanceof Uint8Array)) {
|
|
462
|
-
if (!
|
|
463
|
-
throw new TypeError(
|
|
462
|
+
if (!st(t))
|
|
463
|
+
throw new TypeError(ot(e, t, ...de, "Uint8Array"));
|
|
464
464
|
if (t.type !== "secret")
|
|
465
|
-
throw new TypeError(`${
|
|
465
|
+
throw new TypeError(`${le(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
466
466
|
}
|
|
467
|
-
},
|
|
468
|
-
if (!
|
|
469
|
-
throw new TypeError(
|
|
467
|
+
}, rr = (e, t, r) => {
|
|
468
|
+
if (!st(t))
|
|
469
|
+
throw new TypeError(ot(e, t, ...de));
|
|
470
470
|
if (t.type === "secret")
|
|
471
|
-
throw new TypeError(`${
|
|
471
|
+
throw new TypeError(`${le(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
472
472
|
if (t.algorithm && r === "verify" && t.type === "private")
|
|
473
|
-
throw new TypeError(`${
|
|
473
|
+
throw new TypeError(`${le(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
474
474
|
if (t.algorithm && r === "encrypt" && t.type === "private")
|
|
475
|
-
throw new TypeError(`${
|
|
476
|
-
},
|
|
477
|
-
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ?
|
|
475
|
+
throw new TypeError(`${le(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
476
|
+
}, ar = (e, t, r) => {
|
|
477
|
+
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? tr(e, t) : rr(e, t, r);
|
|
478
478
|
};
|
|
479
|
-
function
|
|
479
|
+
function nr(e, t, r, a, n) {
|
|
480
480
|
if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
|
|
481
481
|
throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
482
482
|
if (!a || a.crit === void 0)
|
|
@@ -495,13 +495,13 @@ function ar(e, t, r, a, n) {
|
|
|
495
495
|
}
|
|
496
496
|
return new Set(a.crit);
|
|
497
497
|
}
|
|
498
|
-
const
|
|
498
|
+
const or = (e, t) => {
|
|
499
499
|
if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
|
|
500
500
|
throw new TypeError(`"${e}" option must be an array of strings`);
|
|
501
501
|
if (t)
|
|
502
502
|
return new Set(t);
|
|
503
503
|
};
|
|
504
|
-
function
|
|
504
|
+
function sr(e, t) {
|
|
505
505
|
const r = `SHA-${e.slice(-3)}`;
|
|
506
506
|
switch (e) {
|
|
507
507
|
case "HS256":
|
|
@@ -526,27 +526,27 @@ function or(e, t) {
|
|
|
526
526
|
throw new H(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
async function
|
|
530
|
-
if (t = await
|
|
531
|
-
return
|
|
529
|
+
async function ir(e, t, r) {
|
|
530
|
+
if (t = await Qt.normalizePublicKey(t, e), rt(t))
|
|
531
|
+
return jt(t, e, r), t;
|
|
532
532
|
if (t instanceof Uint8Array) {
|
|
533
533
|
if (!e.startsWith("HS"))
|
|
534
|
-
throw new TypeError(
|
|
535
|
-
return
|
|
534
|
+
throw new TypeError(Pe(t, ...de));
|
|
535
|
+
return he.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
|
|
536
536
|
}
|
|
537
|
-
throw new TypeError(
|
|
537
|
+
throw new TypeError(Pe(t, ...de, "Uint8Array"));
|
|
538
538
|
}
|
|
539
|
-
const
|
|
540
|
-
const n = await
|
|
541
|
-
|
|
542
|
-
const o =
|
|
539
|
+
const cr = async (e, t, r, a) => {
|
|
540
|
+
const n = await ir(e, t, "verify");
|
|
541
|
+
Jt(e, n);
|
|
542
|
+
const o = sr(e, n.algorithm);
|
|
543
543
|
try {
|
|
544
|
-
return await
|
|
544
|
+
return await he.subtle.verify(o, n, r, a);
|
|
545
545
|
} catch {
|
|
546
546
|
return !1;
|
|
547
547
|
}
|
|
548
548
|
};
|
|
549
|
-
async function
|
|
549
|
+
async function lr(e, t, r) {
|
|
550
550
|
if (!_e(e))
|
|
551
551
|
throw new k("Flattened JWS must be an object");
|
|
552
552
|
if (e.protected === void 0 && e.header === void 0)
|
|
@@ -562,65 +562,65 @@ async function cr(e, t, r) {
|
|
|
562
562
|
let a = {};
|
|
563
563
|
if (e.protected)
|
|
564
564
|
try {
|
|
565
|
-
const f =
|
|
566
|
-
a = JSON.parse(
|
|
565
|
+
const f = ce(e.protected);
|
|
566
|
+
a = JSON.parse(pe.decode(f));
|
|
567
567
|
} catch {
|
|
568
568
|
throw new k("JWS Protected Header is invalid");
|
|
569
569
|
}
|
|
570
|
-
if (!
|
|
570
|
+
if (!Gt(a, e.header))
|
|
571
571
|
throw new k("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
572
572
|
const n = {
|
|
573
573
|
...a,
|
|
574
574
|
...e.header
|
|
575
|
-
}, o =
|
|
575
|
+
}, o = nr(k, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
|
|
576
576
|
let s = !0;
|
|
577
577
|
if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
|
|
578
578
|
throw new k('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
579
579
|
const { alg: i } = n;
|
|
580
580
|
if (typeof i != "string" || !i)
|
|
581
581
|
throw new k('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
582
|
-
const l = r &&
|
|
582
|
+
const l = r && or("algorithms", r.algorithms);
|
|
583
583
|
if (l && !l.has(i))
|
|
584
|
-
throw new
|
|
584
|
+
throw new Ht('"alg" (Algorithm) Header Parameter value not allowed');
|
|
585
585
|
if (s) {
|
|
586
586
|
if (typeof e.payload != "string")
|
|
587
587
|
throw new k("JWS Payload must be a string");
|
|
588
588
|
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
|
|
589
589
|
throw new k("JWS Payload must be a string or an Uint8Array instance");
|
|
590
590
|
let d = !1;
|
|
591
|
-
typeof t == "function" && (t = await t(a, e), d = !0),
|
|
592
|
-
const
|
|
591
|
+
typeof t == "function" && (t = await t(a, e), d = !0), ar(i, t, "verify");
|
|
592
|
+
const h = Pt(X.encode(e.protected ?? ""), X.encode("."), typeof e.payload == "string" ? X.encode(e.payload) : e.payload);
|
|
593
593
|
let u;
|
|
594
594
|
try {
|
|
595
|
-
u =
|
|
595
|
+
u = ce(e.signature);
|
|
596
596
|
} catch {
|
|
597
597
|
throw new k("Failed to base64url decode the signature");
|
|
598
598
|
}
|
|
599
|
-
if (!await
|
|
600
|
-
throw new
|
|
599
|
+
if (!await cr(i, t, u, h))
|
|
600
|
+
throw new Kt();
|
|
601
601
|
let m;
|
|
602
602
|
if (s)
|
|
603
603
|
try {
|
|
604
|
-
m =
|
|
604
|
+
m = ce(e.payload);
|
|
605
605
|
} catch {
|
|
606
606
|
throw new k("Failed to base64url decode the payload");
|
|
607
607
|
}
|
|
608
608
|
else
|
|
609
|
-
typeof e.payload == "string" ? m =
|
|
610
|
-
const
|
|
611
|
-
return e.protected !== void 0 && (
|
|
609
|
+
typeof e.payload == "string" ? m = X.encode(e.payload) : m = e.payload;
|
|
610
|
+
const p = { payload: m };
|
|
611
|
+
return e.protected !== void 0 && (p.protectedHeader = a), e.header !== void 0 && (p.unprotectedHeader = e.header), d ? { ...p, key: t } : p;
|
|
612
612
|
}
|
|
613
|
-
async function
|
|
614
|
-
if (e instanceof Uint8Array && (e =
|
|
613
|
+
async function dr(e, t, r) {
|
|
614
|
+
if (e instanceof Uint8Array && (e = pe.decode(e)), typeof e != "string")
|
|
615
615
|
throw new k("Compact JWS must be a string or Uint8Array");
|
|
616
616
|
const { 0: a, 1: n, 2: o, length: s } = e.split(".");
|
|
617
617
|
if (s !== 3)
|
|
618
618
|
throw new k("Invalid Compact JWS");
|
|
619
|
-
const i = await
|
|
619
|
+
const i = await lr({ payload: n, protected: a, signature: o }, t, r), l = { payload: i.payload, protectedHeader: i.protectedHeader };
|
|
620
620
|
return typeof t == "function" ? { ...l, key: i.key } : l;
|
|
621
621
|
}
|
|
622
|
-
const
|
|
623
|
-
const t =
|
|
622
|
+
const ur = (e) => Math.floor(e.getTime() / 1e3), dt = 60, ut = dt * 60, Ie = ut * 24, mr = Ie * 7, hr = Ie * 365.25, pr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, He = (e) => {
|
|
623
|
+
const t = pr.exec(e);
|
|
624
624
|
if (!t || t[4] && t[1])
|
|
625
625
|
throw new TypeError("Invalid time period format");
|
|
626
626
|
const r = parseFloat(t[2]), a = t[3].toLowerCase();
|
|
@@ -638,14 +638,14 @@ const dr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, Ie = dt
|
|
|
638
638
|
case "min":
|
|
639
639
|
case "mins":
|
|
640
640
|
case "m":
|
|
641
|
-
n = Math.round(r *
|
|
641
|
+
n = Math.round(r * dt);
|
|
642
642
|
break;
|
|
643
643
|
case "hour":
|
|
644
644
|
case "hours":
|
|
645
645
|
case "hr":
|
|
646
646
|
case "hrs":
|
|
647
647
|
case "h":
|
|
648
|
-
n = Math.round(r *
|
|
648
|
+
n = Math.round(r * ut);
|
|
649
649
|
break;
|
|
650
650
|
case "day":
|
|
651
651
|
case "days":
|
|
@@ -655,39 +655,39 @@ const dr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, Ie = dt
|
|
|
655
655
|
case "week":
|
|
656
656
|
case "weeks":
|
|
657
657
|
case "w":
|
|
658
|
-
n = Math.round(r *
|
|
658
|
+
n = Math.round(r * mr);
|
|
659
659
|
break;
|
|
660
660
|
default:
|
|
661
|
-
n = Math.round(r *
|
|
661
|
+
n = Math.round(r * hr);
|
|
662
662
|
break;
|
|
663
663
|
}
|
|
664
664
|
return t[1] === "-" || t[4] === "ago" ? -n : n;
|
|
665
|
-
},
|
|
665
|
+
}, Ke = (e) => e.toLowerCase().replace(/^application\//, ""), gr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, fr = (e, t, r = {}) => {
|
|
666
666
|
let a;
|
|
667
667
|
try {
|
|
668
|
-
a = JSON.parse(
|
|
668
|
+
a = JSON.parse(pe.decode(t));
|
|
669
669
|
} catch {
|
|
670
670
|
}
|
|
671
671
|
if (!_e(a))
|
|
672
|
-
throw new
|
|
672
|
+
throw new at("JWT Claims Set must be a top-level JSON object");
|
|
673
673
|
const { typ: n } = r;
|
|
674
|
-
if (n && (typeof e.typ != "string" ||
|
|
675
|
-
throw new
|
|
676
|
-
const { requiredClaims: o = [], issuer: s, subject: i, audience: l, maxTokenAge: d } = r,
|
|
677
|
-
d !== void 0 &&
|
|
678
|
-
for (const f of new Set(
|
|
674
|
+
if (n && (typeof e.typ != "string" || Ke(e.typ) !== Ke(n)))
|
|
675
|
+
throw new M('unexpected "typ" JWT header value', a, "typ", "check_failed");
|
|
676
|
+
const { requiredClaims: o = [], issuer: s, subject: i, audience: l, maxTokenAge: d } = r, h = [...o];
|
|
677
|
+
d !== void 0 && h.push("iat"), l !== void 0 && h.push("aud"), i !== void 0 && h.push("sub"), s !== void 0 && h.push("iss");
|
|
678
|
+
for (const f of new Set(h.reverse()))
|
|
679
679
|
if (!(f in a))
|
|
680
|
-
throw new
|
|
680
|
+
throw new M(`missing required "${f}" claim`, a, f, "missing");
|
|
681
681
|
if (s && !(Array.isArray(s) ? s : [s]).includes(a.iss))
|
|
682
|
-
throw new
|
|
682
|
+
throw new M('unexpected "iss" claim value', a, "iss", "check_failed");
|
|
683
683
|
if (i && a.sub !== i)
|
|
684
|
-
throw new
|
|
685
|
-
if (l && !
|
|
686
|
-
throw new
|
|
684
|
+
throw new M('unexpected "sub" claim value', a, "sub", "check_failed");
|
|
685
|
+
if (l && !gr(a.aud, typeof l == "string" ? [l] : l))
|
|
686
|
+
throw new M('unexpected "aud" claim value', a, "aud", "check_failed");
|
|
687
687
|
let u;
|
|
688
688
|
switch (typeof r.clockTolerance) {
|
|
689
689
|
case "string":
|
|
690
|
-
u =
|
|
690
|
+
u = He(r.clockTolerance);
|
|
691
691
|
break;
|
|
692
692
|
case "number":
|
|
693
693
|
u = r.clockTolerance;
|
|
@@ -698,43 +698,43 @@ const dr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, Ie = dt
|
|
|
698
698
|
default:
|
|
699
699
|
throw new TypeError("Invalid clockTolerance option type");
|
|
700
700
|
}
|
|
701
|
-
const { currentDate: m } = r,
|
|
701
|
+
const { currentDate: m } = r, p = ur(m || /* @__PURE__ */ new Date());
|
|
702
702
|
if ((a.iat !== void 0 || d) && typeof a.iat != "number")
|
|
703
|
-
throw new
|
|
703
|
+
throw new M('"iat" claim must be a number', a, "iat", "invalid");
|
|
704
704
|
if (a.nbf !== void 0) {
|
|
705
705
|
if (typeof a.nbf != "number")
|
|
706
|
-
throw new
|
|
707
|
-
if (a.nbf >
|
|
708
|
-
throw new
|
|
706
|
+
throw new M('"nbf" claim must be a number', a, "nbf", "invalid");
|
|
707
|
+
if (a.nbf > p + u)
|
|
708
|
+
throw new M('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
|
|
709
709
|
}
|
|
710
710
|
if (a.exp !== void 0) {
|
|
711
711
|
if (typeof a.exp != "number")
|
|
712
|
-
throw new
|
|
713
|
-
if (a.exp <=
|
|
714
|
-
throw new
|
|
712
|
+
throw new M('"exp" claim must be a number', a, "exp", "invalid");
|
|
713
|
+
if (a.exp <= p - u)
|
|
714
|
+
throw new Le('"exp" claim timestamp check failed', a, "exp", "check_failed");
|
|
715
715
|
}
|
|
716
716
|
if (d) {
|
|
717
|
-
const f =
|
|
718
|
-
if (f - u >
|
|
719
|
-
throw new
|
|
717
|
+
const f = p - a.iat, w = typeof d == "number" ? d : He(d);
|
|
718
|
+
if (f - u > w)
|
|
719
|
+
throw new Le('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
|
|
720
720
|
if (f < 0 - u)
|
|
721
|
-
throw new
|
|
721
|
+
throw new M('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
|
|
722
722
|
}
|
|
723
723
|
return a;
|
|
724
724
|
};
|
|
725
|
-
async function
|
|
725
|
+
async function yr(e, t, r) {
|
|
726
726
|
var a;
|
|
727
|
-
const n = await
|
|
727
|
+
const n = await dr(e, t, r);
|
|
728
728
|
if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
|
|
729
|
-
throw new
|
|
730
|
-
const o = { payload:
|
|
729
|
+
throw new at("JWTs MUST NOT use unencoded payload");
|
|
730
|
+
const o = { payload: fr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
|
|
731
731
|
return typeof t == "function" ? { ...o, key: n.key } : o;
|
|
732
732
|
}
|
|
733
733
|
const Y = async (e) => {
|
|
734
734
|
try {
|
|
735
|
-
const t =
|
|
736
|
-
return await
|
|
737
|
-
issuer:
|
|
735
|
+
const t = I.ALG, r = await er(Lt, t);
|
|
736
|
+
return await yr(e, r, {
|
|
737
|
+
issuer: I.ISSUER
|
|
738
738
|
});
|
|
739
739
|
} catch {
|
|
740
740
|
return;
|
|
@@ -743,67 +743,67 @@ const Y = async (e) => {
|
|
|
743
743
|
var E = [];
|
|
744
744
|
for (var ve = 0; ve < 256; ++ve)
|
|
745
745
|
E.push((ve + 256).toString(16).slice(1));
|
|
746
|
-
function
|
|
746
|
+
function br(e, t = 0) {
|
|
747
747
|
return (E[e[t + 0]] + E[e[t + 1]] + E[e[t + 2]] + E[e[t + 3]] + "-" + E[e[t + 4]] + E[e[t + 5]] + "-" + E[e[t + 6]] + E[e[t + 7]] + "-" + E[e[t + 8]] + E[e[t + 9]] + "-" + E[e[t + 10]] + E[e[t + 11]] + E[e[t + 12]] + E[e[t + 13]] + E[e[t + 14]] + E[e[t + 15]]).toLowerCase();
|
|
748
748
|
}
|
|
749
|
-
var
|
|
750
|
-
function
|
|
751
|
-
if (!
|
|
749
|
+
var ee, wr = new Uint8Array(16);
|
|
750
|
+
function Er() {
|
|
751
|
+
if (!ee && (ee = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ee))
|
|
752
752
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
753
|
-
return
|
|
753
|
+
return ee(wr);
|
|
754
754
|
}
|
|
755
|
-
var
|
|
756
|
-
const
|
|
757
|
-
randomUUID:
|
|
755
|
+
var vr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
756
|
+
const Be = {
|
|
757
|
+
randomUUID: vr
|
|
758
758
|
};
|
|
759
|
-
function
|
|
760
|
-
if (
|
|
761
|
-
return
|
|
759
|
+
function We(e, t, r) {
|
|
760
|
+
if (Be.randomUUID && !t && !e)
|
|
761
|
+
return Be.randomUUID();
|
|
762
762
|
e = e || {};
|
|
763
|
-
var a = e.random || (e.rng ||
|
|
764
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
763
|
+
var a = e.random || (e.rng || Er)();
|
|
764
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, br(a);
|
|
765
765
|
}
|
|
766
|
-
const
|
|
766
|
+
const je = globalThis.crypto, kr = (e) => `${We()}${We()}`.slice(0, e), Sr = (e) => btoa(
|
|
767
767
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
768
768
|
);
|
|
769
|
-
async function
|
|
770
|
-
if (!
|
|
769
|
+
async function Tr(e) {
|
|
770
|
+
if (!je.subtle)
|
|
771
771
|
throw new Error(
|
|
772
772
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
773
773
|
);
|
|
774
|
-
const t = new TextEncoder().encode(e), r = await
|
|
775
|
-
return
|
|
774
|
+
const t = new TextEncoder().encode(e), r = await je.subtle.digest("SHA-256", t);
|
|
775
|
+
return Sr(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
776
776
|
}
|
|
777
|
-
async function
|
|
778
|
-
const t =
|
|
777
|
+
async function Ar(e) {
|
|
778
|
+
const t = kr(43), r = await Tr(t);
|
|
779
779
|
return {
|
|
780
780
|
code_verifier: t,
|
|
781
781
|
code_challenge: r
|
|
782
782
|
};
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function mt(e, t) {
|
|
785
785
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
|
786
786
|
}
|
|
787
|
-
const
|
|
787
|
+
const Ge = (e, t) => {
|
|
788
788
|
const r = JSON.stringify(
|
|
789
789
|
typeof t == "function" ? t() : t
|
|
790
790
|
);
|
|
791
|
-
window.localStorage.setItem(e, r),
|
|
792
|
-
},
|
|
793
|
-
window.localStorage.removeItem(e),
|
|
794
|
-
},
|
|
795
|
-
function
|
|
791
|
+
window.localStorage.setItem(e, r), mt(e, r);
|
|
792
|
+
}, _r = (e) => {
|
|
793
|
+
window.localStorage.removeItem(e), mt(e, null);
|
|
794
|
+
}, Ve = (e) => window.localStorage.getItem(e), Ir = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
795
|
+
function te({
|
|
796
796
|
key: e,
|
|
797
797
|
initialValue: t
|
|
798
798
|
}) {
|
|
799
|
-
const r = () =>
|
|
800
|
-
|
|
799
|
+
const r = () => Ve(e), a = F.useSyncExternalStore(
|
|
800
|
+
Ir,
|
|
801
801
|
r
|
|
802
802
|
), n = F.useCallback(
|
|
803
803
|
(i) => {
|
|
804
804
|
try {
|
|
805
805
|
const l = typeof i == "function" ? i(JSON.parse(a)) : i;
|
|
806
|
-
l == null ?
|
|
806
|
+
l == null ? _r(e) : Ge(e, l);
|
|
807
807
|
} catch (l) {
|
|
808
808
|
console.warn(l);
|
|
809
809
|
}
|
|
@@ -816,7 +816,7 @@ function re({
|
|
|
816
816
|
}, [n]);
|
|
817
817
|
return F.useEffect(() => {
|
|
818
818
|
try {
|
|
819
|
-
|
|
819
|
+
Ve(e) === null && typeof t < "u" && Ge(e, t);
|
|
820
820
|
} catch (i) {
|
|
821
821
|
console.warn(i);
|
|
822
822
|
}
|
|
@@ -825,37 +825,37 @@ function re({
|
|
|
825
825
|
var v = [];
|
|
826
826
|
for (var ke = 0; ke < 256; ++ke)
|
|
827
827
|
v.push((ke + 256).toString(16).slice(1));
|
|
828
|
-
function
|
|
828
|
+
function xr(e, t = 0) {
|
|
829
829
|
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();
|
|
830
830
|
}
|
|
831
|
-
var
|
|
832
|
-
function
|
|
833
|
-
if (!
|
|
831
|
+
var re, Nr = new Uint8Array(16);
|
|
832
|
+
function Cr() {
|
|
833
|
+
if (!re && (re = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !re))
|
|
834
834
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
835
|
-
return
|
|
835
|
+
return re(Nr);
|
|
836
836
|
}
|
|
837
|
-
var
|
|
838
|
-
const
|
|
839
|
-
randomUUID:
|
|
837
|
+
var Rr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
838
|
+
const Je = {
|
|
839
|
+
randomUUID: Rr
|
|
840
840
|
};
|
|
841
|
-
function
|
|
842
|
-
if (
|
|
843
|
-
return
|
|
841
|
+
function Or(e, t, r) {
|
|
842
|
+
if (Je.randomUUID && !t && !e)
|
|
843
|
+
return Je.randomUUID();
|
|
844
844
|
e = e || {};
|
|
845
|
-
var a = e.random || (e.rng ||
|
|
846
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
845
|
+
var a = e.random || (e.rng || Cr)();
|
|
846
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, xr(a);
|
|
847
847
|
}
|
|
848
|
-
const
|
|
848
|
+
const ae = "Oops! It looks like your session has expired. For your security, please log in again to continue.", Dr = "Your session has been successfully terminated.", Fe = "Login failed. Please try again.", Se = "Error getting access token, please re-authenticate.", $r = "You forgot to wrap your component in <AuthProvider>.", ze = {
|
|
849
849
|
dev: "https://auth.gizmette.local.com:3003",
|
|
850
850
|
prod: "https://mylogin.gizmette.com"
|
|
851
|
-
},
|
|
851
|
+
}, ne = "@@auth@@", Mr = process.env.NODE_ENV === "production", Lr = !Mr, ge = async ({
|
|
852
852
|
type: e,
|
|
853
853
|
clientId: t,
|
|
854
854
|
params: r = {}
|
|
855
855
|
}) => {
|
|
856
856
|
try {
|
|
857
857
|
const a = await fetch(
|
|
858
|
-
|
|
858
|
+
Lr ? `${ze.dev}/${e}` : `${ze.prod}/${e}`,
|
|
859
859
|
{
|
|
860
860
|
credentials: "include",
|
|
861
861
|
method: "POST",
|
|
@@ -877,21 +877,23 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
877
877
|
} catch (a) {
|
|
878
878
|
return console.error(a), { status: 500, data: [] };
|
|
879
879
|
}
|
|
880
|
-
},
|
|
880
|
+
}, Pr = async ({
|
|
881
881
|
idToken: e,
|
|
882
882
|
accessToken: t,
|
|
883
883
|
refreshToken: r,
|
|
884
|
-
clientId: a
|
|
884
|
+
clientId: a,
|
|
885
|
+
domain: n
|
|
885
886
|
}) => {
|
|
886
887
|
try {
|
|
887
888
|
return {
|
|
888
|
-
status: (await
|
|
889
|
-
type:
|
|
889
|
+
status: (await ge({
|
|
890
|
+
type: me.LOGOUT,
|
|
890
891
|
clientId: a,
|
|
891
892
|
params: {
|
|
892
893
|
idToken: e,
|
|
893
894
|
accessToken: t,
|
|
894
|
-
refreshToken: r
|
|
895
|
+
refreshToken: r,
|
|
896
|
+
domain: n
|
|
895
897
|
}
|
|
896
898
|
})).status === 200
|
|
897
899
|
};
|
|
@@ -900,7 +902,7 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
900
902
|
status: !1
|
|
901
903
|
};
|
|
902
904
|
}
|
|
903
|
-
},
|
|
905
|
+
}, Ye = async ({
|
|
904
906
|
username: e,
|
|
905
907
|
password: t,
|
|
906
908
|
clientId: r,
|
|
@@ -908,11 +910,12 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
908
910
|
type: n,
|
|
909
911
|
sessionExpiration: o,
|
|
910
912
|
code: s,
|
|
911
|
-
code_verifier: i
|
|
913
|
+
code_verifier: i,
|
|
914
|
+
domain: l
|
|
912
915
|
}) => {
|
|
913
916
|
try {
|
|
914
|
-
const
|
|
915
|
-
type:
|
|
917
|
+
const d = await ge({
|
|
918
|
+
type: me.AUTHENTICATE,
|
|
916
919
|
clientId: r,
|
|
917
920
|
params: {
|
|
918
921
|
type: n || Q.ID_AND_ACCESS_TOKEN,
|
|
@@ -921,14 +924,15 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
921
924
|
sessionExpiration: o,
|
|
922
925
|
nonce: a,
|
|
923
926
|
code: s,
|
|
924
|
-
code_verifier: i
|
|
927
|
+
code_verifier: i,
|
|
928
|
+
domain: l
|
|
925
929
|
}
|
|
926
|
-
}),
|
|
927
|
-
return
|
|
928
|
-
idToken:
|
|
929
|
-
accessToken:
|
|
930
|
-
refreshToken:
|
|
931
|
-
userId:
|
|
930
|
+
}), h = await Y(d.data.idToken);
|
|
931
|
+
return h && h.payload[I.USER_ID_KEY] !== "" && h.payload[I.NONCE_KEY] === a ? {
|
|
932
|
+
idToken: d.data.idToken,
|
|
933
|
+
accessToken: d.data.accessToken,
|
|
934
|
+
refreshToken: d.data.refreshToken,
|
|
935
|
+
userId: h.payload[I.USER_ID_KEY],
|
|
932
936
|
status: !0
|
|
933
937
|
} : {
|
|
934
938
|
status: !1
|
|
@@ -938,14 +942,14 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
938
942
|
status: !1
|
|
939
943
|
};
|
|
940
944
|
}
|
|
941
|
-
},
|
|
945
|
+
}, Ur = async ({
|
|
942
946
|
nonce: e,
|
|
943
947
|
clientId: t,
|
|
944
948
|
code_challenge: r
|
|
945
949
|
}) => {
|
|
946
950
|
try {
|
|
947
|
-
const a = await
|
|
948
|
-
type:
|
|
951
|
+
const a = await ge({
|
|
952
|
+
type: me.CODE,
|
|
949
953
|
clientId: t,
|
|
950
954
|
params: {
|
|
951
955
|
type: Q.CODE,
|
|
@@ -964,29 +968,31 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
964
968
|
status: !1
|
|
965
969
|
};
|
|
966
970
|
}
|
|
967
|
-
},
|
|
971
|
+
}, Hr = async ({
|
|
968
972
|
clientId: e,
|
|
969
973
|
userId: t,
|
|
970
974
|
nonce: r,
|
|
971
975
|
refreshToken: a,
|
|
972
|
-
accessToken: n
|
|
976
|
+
accessToken: n,
|
|
977
|
+
domain: o
|
|
973
978
|
}) => {
|
|
974
979
|
try {
|
|
975
|
-
const
|
|
976
|
-
type:
|
|
980
|
+
const s = await ge({
|
|
981
|
+
type: me.AUTHENTICATE,
|
|
977
982
|
clientId: e,
|
|
978
983
|
params: {
|
|
979
984
|
type: Q.REFRESH_TOKEN,
|
|
980
985
|
userId: t,
|
|
981
986
|
nonce: r,
|
|
982
987
|
refreshToken: a,
|
|
983
|
-
accessToken: n
|
|
988
|
+
accessToken: n,
|
|
989
|
+
domain: o
|
|
984
990
|
}
|
|
985
|
-
}),
|
|
986
|
-
return
|
|
987
|
-
accessToken:
|
|
988
|
-
refreshToken:
|
|
989
|
-
userId:
|
|
991
|
+
}), i = await Y(s.data.accessToken);
|
|
992
|
+
return i && i.payload[I.USER_ID_KEY] !== "" && i.payload[I.NONCE_KEY] === r ? {
|
|
993
|
+
accessToken: s.data.accessToken,
|
|
994
|
+
refreshToken: s.data.refreshToken,
|
|
995
|
+
userId: i.payload[I.USER_ID_KEY],
|
|
990
996
|
status: !0
|
|
991
997
|
} : {
|
|
992
998
|
status: !1
|
|
@@ -997,19 +1003,21 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
997
1003
|
};
|
|
998
1004
|
}
|
|
999
1005
|
};
|
|
1000
|
-
class
|
|
1006
|
+
class Kr {
|
|
1001
1007
|
constructor(t = null, r = null) {
|
|
1002
1008
|
ye(this, "refreshTokenPromise", null), ye(this, "accessToken"), ye(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
|
|
1003
1009
|
}
|
|
1004
1010
|
async refreshtoken({
|
|
1005
1011
|
clientId: t,
|
|
1006
1012
|
userId: r,
|
|
1007
|
-
nonce: a
|
|
1013
|
+
nonce: a,
|
|
1014
|
+
domain: n
|
|
1008
1015
|
}) {
|
|
1009
1016
|
this.refreshTokenPromise || (this.refreshTokenPromise = this._refreshToken({
|
|
1010
1017
|
clientId: t,
|
|
1011
1018
|
userId: r,
|
|
1012
|
-
nonce: a
|
|
1019
|
+
nonce: a,
|
|
1020
|
+
domain: n
|
|
1013
1021
|
}));
|
|
1014
1022
|
try {
|
|
1015
1023
|
return await this.refreshTokenPromise;
|
|
@@ -1020,21 +1028,23 @@ class Hr {
|
|
|
1020
1028
|
async _refreshToken({
|
|
1021
1029
|
clientId: t,
|
|
1022
1030
|
userId: r,
|
|
1023
|
-
nonce: a
|
|
1031
|
+
nonce: a,
|
|
1032
|
+
domain: n
|
|
1024
1033
|
}) {
|
|
1025
|
-
const
|
|
1026
|
-
if (
|
|
1027
|
-
const
|
|
1034
|
+
const o = await Y(this.refreshToken);
|
|
1035
|
+
if (o && o.payload[I.USER_ID_KEY] !== "") {
|
|
1036
|
+
const s = await Hr({
|
|
1028
1037
|
clientId: t,
|
|
1029
1038
|
userId: r,
|
|
1030
1039
|
nonce: a,
|
|
1031
1040
|
refreshToken: this.refreshToken,
|
|
1032
|
-
accessToken: this.accessToken
|
|
1041
|
+
accessToken: this.accessToken,
|
|
1042
|
+
domain: n
|
|
1033
1043
|
});
|
|
1034
|
-
return
|
|
1044
|
+
return s.status ? (this.accessToken = s.accessToken, this.refreshToken = s.refreshToken, {
|
|
1035
1045
|
status: "success",
|
|
1036
|
-
newAccessToken:
|
|
1037
|
-
newRefreshToken:
|
|
1046
|
+
newAccessToken: s.accessToken,
|
|
1047
|
+
newRefreshToken: s.refreshToken
|
|
1038
1048
|
}) : {
|
|
1039
1049
|
status: "failure"
|
|
1040
1050
|
};
|
|
@@ -1044,107 +1054,117 @@ class Hr {
|
|
|
1044
1054
|
};
|
|
1045
1055
|
}
|
|
1046
1056
|
}
|
|
1047
|
-
const
|
|
1048
|
-
throw new Error(
|
|
1049
|
-
},
|
|
1057
|
+
const oe = () => {
|
|
1058
|
+
throw new Error($r);
|
|
1059
|
+
}, ht = xt({
|
|
1050
1060
|
isAuthenticated: !1,
|
|
1051
1061
|
isLoading: !1,
|
|
1052
|
-
login:
|
|
1053
|
-
logout:
|
|
1054
|
-
getAccessToken:
|
|
1055
|
-
getIdToken:
|
|
1062
|
+
login: oe,
|
|
1063
|
+
logout: oe,
|
|
1064
|
+
getAccessToken: oe,
|
|
1065
|
+
getIdToken: oe,
|
|
1056
1066
|
logoutReason: ""
|
|
1057
|
-
}),
|
|
1067
|
+
}), Br = ({
|
|
1058
1068
|
children: e,
|
|
1059
1069
|
sessionExpiration: t,
|
|
1060
|
-
clientId: r
|
|
1070
|
+
clientId: r,
|
|
1071
|
+
domain: a = ""
|
|
1061
1072
|
}) => {
|
|
1062
|
-
const
|
|
1063
|
-
key: `${
|
|
1064
|
-
}), [
|
|
1065
|
-
key: `${
|
|
1066
|
-
}), [
|
|
1073
|
+
const n = W(!1), [o, s, , i] = te({
|
|
1074
|
+
key: `${ne}::${r}::@@user@@`
|
|
1075
|
+
}), [l, d, , h] = te({
|
|
1076
|
+
key: `${ne}::${r}::@@access@@`
|
|
1077
|
+
}), [u, m, , p] = te(
|
|
1067
1078
|
{
|
|
1068
|
-
key: `${
|
|
1079
|
+
key: `${ne}::${r}::@@refresh@@`
|
|
1069
1080
|
}
|
|
1070
|
-
), [
|
|
1071
|
-
key: `${
|
|
1072
|
-
}),
|
|
1081
|
+
), [f, w, , x] = te({
|
|
1082
|
+
key: `${ne}::${r}::@@nonce@@`
|
|
1083
|
+
}), O = new Kr(l, u), [_, S] = U({
|
|
1073
1084
|
isLoading: !0,
|
|
1074
1085
|
isAuthenticated: !1,
|
|
1075
1086
|
user: void 0,
|
|
1076
1087
|
logoutReason: ""
|
|
1077
|
-
}),
|
|
1088
|
+
}), D = Me(
|
|
1078
1089
|
(y) => {
|
|
1079
|
-
console.warn(y),
|
|
1090
|
+
console.warn(y), S({
|
|
1080
1091
|
isLoading: !0,
|
|
1081
1092
|
isAuthenticated: !1,
|
|
1082
1093
|
user: void 0,
|
|
1083
|
-
logoutReason: y ||
|
|
1084
|
-
}),
|
|
1094
|
+
logoutReason: y || ae
|
|
1095
|
+
}), i(), h(), p(), x();
|
|
1085
1096
|
},
|
|
1086
|
-
[
|
|
1087
|
-
),
|
|
1097
|
+
[h, i, x, p]
|
|
1098
|
+
), C = Me(
|
|
1088
1099
|
async (y) => {
|
|
1089
|
-
|
|
1090
|
-
idToken:
|
|
1091
|
-
accessToken:
|
|
1092
|
-
refreshToken:
|
|
1093
|
-
clientId: r
|
|
1094
|
-
|
|
1095
|
-
|
|
1100
|
+
D(y || ae), await Pr({
|
|
1101
|
+
idToken: o,
|
|
1102
|
+
accessToken: l,
|
|
1103
|
+
refreshToken: u,
|
|
1104
|
+
clientId: r,
|
|
1105
|
+
domain: a
|
|
1106
|
+
}), S(($) => ({
|
|
1107
|
+
...$,
|
|
1096
1108
|
isLoading: !1
|
|
1097
1109
|
}));
|
|
1098
1110
|
},
|
|
1099
|
-
[
|
|
1111
|
+
[
|
|
1112
|
+
l,
|
|
1113
|
+
r,
|
|
1114
|
+
a,
|
|
1115
|
+
o,
|
|
1116
|
+
u,
|
|
1117
|
+
D
|
|
1118
|
+
]
|
|
1100
1119
|
);
|
|
1101
1120
|
z(() => {
|
|
1102
|
-
if (!
|
|
1103
|
-
return
|
|
1121
|
+
if (!n.current)
|
|
1122
|
+
return _.isLoading && o !== null ? (async () => {
|
|
1104
1123
|
try {
|
|
1105
|
-
const y = await Y(
|
|
1106
|
-
y && y.payload[
|
|
1124
|
+
const y = await Y(o);
|
|
1125
|
+
y && y.payload[I.USER_ID_KEY] !== "" ? S({
|
|
1107
1126
|
isLoading: !1,
|
|
1108
1127
|
isAuthenticated: !0,
|
|
1109
1128
|
user: {
|
|
1110
|
-
userId: y.payload[
|
|
1111
|
-
username: y.payload[
|
|
1129
|
+
userId: y.payload[I.USER_ID_KEY],
|
|
1130
|
+
username: y.payload[I.USERNAME_KEY]
|
|
1112
1131
|
},
|
|
1113
1132
|
logoutReason: ""
|
|
1114
|
-
}) : await
|
|
1133
|
+
}) : await C(ae);
|
|
1115
1134
|
} catch {
|
|
1116
|
-
await
|
|
1135
|
+
await C(ae);
|
|
1117
1136
|
}
|
|
1118
|
-
})() :
|
|
1137
|
+
})() : S((y) => ({
|
|
1119
1138
|
...y,
|
|
1120
1139
|
isLoading: !1
|
|
1121
1140
|
})), () => {
|
|
1122
|
-
|
|
1141
|
+
n.current = !0;
|
|
1123
1142
|
};
|
|
1124
|
-
}, [
|
|
1125
|
-
const
|
|
1126
|
-
const
|
|
1127
|
-
if (
|
|
1128
|
-
...
|
|
1143
|
+
}, [_.isLoading, o, C]);
|
|
1144
|
+
const N = async (y, $, b) => {
|
|
1145
|
+
const A = Or();
|
|
1146
|
+
if (w(A), S((G) => ({
|
|
1147
|
+
...G,
|
|
1129
1148
|
isLoading: !0
|
|
1130
|
-
})),
|
|
1131
|
-
const { code_verifier:
|
|
1132
|
-
nonce:
|
|
1149
|
+
})), i(), h(), p(), b === Q.CODE) {
|
|
1150
|
+
const { code_verifier: G, code_challenge: It } = await Ar(), $e = await Ur({
|
|
1151
|
+
nonce: A,
|
|
1133
1152
|
clientId: r,
|
|
1134
|
-
code_challenge:
|
|
1153
|
+
code_challenge: It
|
|
1135
1154
|
});
|
|
1136
|
-
if (
|
|
1137
|
-
const J = await
|
|
1155
|
+
if ($e.status) {
|
|
1156
|
+
const J = await Ye({
|
|
1138
1157
|
username: y,
|
|
1139
|
-
password:
|
|
1158
|
+
password: $,
|
|
1140
1159
|
clientId: r,
|
|
1141
1160
|
sessionExpiration: t,
|
|
1142
|
-
nonce:
|
|
1143
|
-
type:
|
|
1144
|
-
code:
|
|
1145
|
-
code_verifier:
|
|
1161
|
+
nonce: A,
|
|
1162
|
+
type: b,
|
|
1163
|
+
code: $e.code,
|
|
1164
|
+
code_verifier: G,
|
|
1165
|
+
domain: a
|
|
1146
1166
|
});
|
|
1147
|
-
return J.status ? (
|
|
1167
|
+
return J.status ? (s(J.idToken), d(J.accessToken), m(J.refreshToken), S({
|
|
1148
1168
|
isLoading: !1,
|
|
1149
1169
|
isAuthenticated: !0,
|
|
1150
1170
|
user: {
|
|
@@ -1152,60 +1172,233 @@ const se = () => {
|
|
|
1152
1172
|
username: y
|
|
1153
1173
|
},
|
|
1154
1174
|
logoutReason: ""
|
|
1155
|
-
}), !0) : (
|
|
1175
|
+
}), !0) : (D(Fe), !1);
|
|
1156
1176
|
}
|
|
1157
1177
|
return !1;
|
|
1158
1178
|
}
|
|
1159
|
-
const
|
|
1179
|
+
const B = await Ye({
|
|
1160
1180
|
username: y,
|
|
1161
|
-
password:
|
|
1181
|
+
password: $,
|
|
1162
1182
|
clientId: r,
|
|
1163
1183
|
sessionExpiration: t,
|
|
1164
|
-
nonce:
|
|
1165
|
-
type:
|
|
1184
|
+
nonce: A,
|
|
1185
|
+
type: b,
|
|
1186
|
+
domain: a
|
|
1166
1187
|
});
|
|
1167
|
-
return
|
|
1188
|
+
return B.status ? (s(B.idToken), d(B.accessToken), m(B.refreshToken), S({
|
|
1168
1189
|
isLoading: !1,
|
|
1169
1190
|
isAuthenticated: !0,
|
|
1170
1191
|
user: {
|
|
1171
|
-
userId:
|
|
1192
|
+
userId: B.userId,
|
|
1172
1193
|
username: y
|
|
1173
1194
|
}
|
|
1174
|
-
}), !0) : (
|
|
1175
|
-
},
|
|
1176
|
-
y == null || y.preventDefault(), await
|
|
1177
|
-
},
|
|
1178
|
-
const { isAuthenticated: y, user:
|
|
1195
|
+
}), !0) : (D(Fe), !1);
|
|
1196
|
+
}, V = async (y) => {
|
|
1197
|
+
y == null || y.preventDefault(), await C(Dr);
|
|
1198
|
+
}, R = async () => {
|
|
1199
|
+
const { isAuthenticated: y, user: $ } = _;
|
|
1179
1200
|
try {
|
|
1180
|
-
if (y &&
|
|
1181
|
-
if (
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1184
|
-
return
|
|
1201
|
+
if (y && $ && $.userId) {
|
|
1202
|
+
if (l) {
|
|
1203
|
+
const A = await Y(l);
|
|
1204
|
+
if (A && A.payload[I.USER_ID_KEY] !== "")
|
|
1205
|
+
return l;
|
|
1185
1206
|
}
|
|
1186
|
-
const
|
|
1207
|
+
const b = await O.refreshtoken({
|
|
1187
1208
|
clientId: r,
|
|
1188
|
-
userId:
|
|
1189
|
-
nonce:
|
|
1209
|
+
userId: $.userId,
|
|
1210
|
+
nonce: f,
|
|
1211
|
+
domain: a
|
|
1190
1212
|
});
|
|
1191
|
-
return
|
|
1213
|
+
return b.status && b.status === "success" ? (d(b.newAccessToken), m(b.newRefreshToken), b.newAccessToken) : (await C(Se), "");
|
|
1192
1214
|
}
|
|
1193
|
-
return await
|
|
1215
|
+
return await C(Se), "";
|
|
1194
1216
|
} catch {
|
|
1195
|
-
return await
|
|
1217
|
+
return await C(Se), "";
|
|
1196
1218
|
}
|
|
1197
|
-
},
|
|
1198
|
-
if (
|
|
1199
|
-
return
|
|
1219
|
+
}, fe = () => {
|
|
1220
|
+
if (_.isAuthenticated && o)
|
|
1221
|
+
return o;
|
|
1200
1222
|
};
|
|
1201
1223
|
return /* @__PURE__ */ c(
|
|
1202
|
-
|
|
1224
|
+
ht.Provider,
|
|
1203
1225
|
{
|
|
1204
|
-
value: { ...
|
|
1226
|
+
value: { ..._, login: N, logout: V, getAccessToken: R, getIdToken: fe },
|
|
1205
1227
|
children: e
|
|
1206
1228
|
}
|
|
1207
1229
|
);
|
|
1208
|
-
}, xe = (e =
|
|
1230
|
+
}, xe = (e = ht) => Ze(e), rn = "user", an = "assistant", nn = "system", on = "internal", sn = "hidden", cn = "I'm having trouble right now. Please try again later.", ln = "gpt-4", dn = 128e3, un = "action-message", mn = "action-reset", hn = "action-model", pn = "action-restore", gn = "action-location", fn = "action-streaming", yn = "action-search", bn = "action-sort", wn = "sassy-saint-", En = "details", vn = "search", kn = "sort", Sn = "location", Tn = "==stats==", Wr = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", qe = (e) => Number.isFinite(e) ? e : 0;
|
|
1231
|
+
function jr(e) {
|
|
1232
|
+
return {
|
|
1233
|
+
days: Math.trunc(e / 864e5),
|
|
1234
|
+
hours: Math.trunc(e / 36e5 % 24),
|
|
1235
|
+
minutes: Math.trunc(e / 6e4 % 60),
|
|
1236
|
+
seconds: Math.trunc(e / 1e3 % 60),
|
|
1237
|
+
milliseconds: Math.trunc(e % 1e3),
|
|
1238
|
+
microseconds: Math.trunc(qe(e * 1e3) % 1e3),
|
|
1239
|
+
nanoseconds: Math.trunc(qe(e * 1e6) % 1e3)
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1242
|
+
function Gr(e) {
|
|
1243
|
+
return {
|
|
1244
|
+
days: e / 86400000n,
|
|
1245
|
+
hours: e / 3600000n % 24n,
|
|
1246
|
+
minutes: e / 60000n % 60n,
|
|
1247
|
+
seconds: e / 1000n % 60n,
|
|
1248
|
+
milliseconds: e % 1000n,
|
|
1249
|
+
microseconds: 0n,
|
|
1250
|
+
nanoseconds: 0n
|
|
1251
|
+
};
|
|
1252
|
+
}
|
|
1253
|
+
function Vr(e) {
|
|
1254
|
+
switch (typeof e) {
|
|
1255
|
+
case "number": {
|
|
1256
|
+
if (Number.isFinite(e))
|
|
1257
|
+
return jr(e);
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1260
|
+
case "bigint":
|
|
1261
|
+
return Gr(e);
|
|
1262
|
+
}
|
|
1263
|
+
throw new TypeError("Expected a finite number or bigint");
|
|
1264
|
+
}
|
|
1265
|
+
const Jr = (e) => e === 0 || e === 0n, Fr = (e, t) => t === 1 || t === 1n ? e : `${e}s`, zr = 1e-7, Yr = 24n * 60n * 60n * 1000n;
|
|
1266
|
+
function qr(e, t) {
|
|
1267
|
+
const r = typeof e == "bigint";
|
|
1268
|
+
if (!r && !Number.isFinite(e))
|
|
1269
|
+
throw new TypeError("Expected a finite number or bigint");
|
|
1270
|
+
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);
|
|
1271
|
+
let a = [];
|
|
1272
|
+
const n = (d, h) => {
|
|
1273
|
+
const u = Math.floor(d * 10 ** h + zr);
|
|
1274
|
+
return (Math.round(u) / 10 ** h).toFixed(h);
|
|
1275
|
+
}, o = (d, h, u, m) => {
|
|
1276
|
+
if (!((a.length === 0 || !t.colonNotation) && Jr(d) && !(t.colonNotation && u === "m"))) {
|
|
1277
|
+
if (m = m ?? String(d), t.colonNotation) {
|
|
1278
|
+
const p = m.includes(".") ? m.split(".")[0].length : m.length, f = a.length > 0 ? 2 : 1;
|
|
1279
|
+
m = "0".repeat(Math.max(0, f - p)) + m;
|
|
1280
|
+
} else
|
|
1281
|
+
m += t.verbose ? " " + Fr(h, d) : u;
|
|
1282
|
+
a.push(m);
|
|
1283
|
+
}
|
|
1284
|
+
}, s = Vr(e), i = BigInt(s.days);
|
|
1285
|
+
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) {
|
|
1286
|
+
const d = Number(s.seconds), h = Number(s.milliseconds), u = Number(s.microseconds), m = Number(s.nanoseconds);
|
|
1287
|
+
if (o(d, "second", "s"), t.formatSubMilliseconds)
|
|
1288
|
+
o(h, "millisecond", "ms"), o(u, "microsecond", "µs"), o(m, "nanosecond", "ns");
|
|
1289
|
+
else {
|
|
1290
|
+
const p = h + u / 1e3 + m / 1e6, f = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, w = p >= 1 ? Math.round(p) : Math.ceil(p), x = f ? p.toFixed(f) : w;
|
|
1291
|
+
o(
|
|
1292
|
+
Number.parseFloat(x),
|
|
1293
|
+
"millisecond",
|
|
1294
|
+
"ms",
|
|
1295
|
+
x
|
|
1296
|
+
);
|
|
1297
|
+
}
|
|
1298
|
+
} else {
|
|
1299
|
+
const d = (r ? Number(e % Yr) : e) / 1e3 % 60, h = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, u = n(d, h), m = t.keepDecimalsOnWholeSeconds ? u : u.replace(/\.0+$/, "");
|
|
1300
|
+
o(Number.parseFloat(m), "second", "s", m);
|
|
1301
|
+
}
|
|
1302
|
+
if (a.length === 0)
|
|
1303
|
+
return "0" + (t.verbose ? " milliseconds" : "ms");
|
|
1304
|
+
const l = t.colonNotation ? ":" : " ";
|
|
1305
|
+
return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), a.join(l);
|
|
1306
|
+
}
|
|
1307
|
+
const Qr = process.env.NODE_ENV === "production", Ne = !Qr, Xr = Ne ? "gizmette.local.com" : "gizmette.com", An = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, pt = (e, t) => {
|
|
1308
|
+
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;
|
|
1309
|
+
return {
|
|
1310
|
+
dir: r,
|
|
1311
|
+
deg: a,
|
|
1312
|
+
min: n,
|
|
1313
|
+
sec: o
|
|
1314
|
+
};
|
|
1315
|
+
}, _n = (e) => {
|
|
1316
|
+
if (!e && e !== 0)
|
|
1317
|
+
return "N/A";
|
|
1318
|
+
const t = pt(e, !1);
|
|
1319
|
+
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
1320
|
+
}, In = (e) => {
|
|
1321
|
+
if (!e && e !== 0)
|
|
1322
|
+
return "N/A";
|
|
1323
|
+
const t = pt(e, !0);
|
|
1324
|
+
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
1325
|
+
}, xn = async () => {
|
|
1326
|
+
const e = {
|
|
1327
|
+
/**
|
|
1328
|
+
* A boolean value that indicates the application would
|
|
1329
|
+
* like to receive the best possible results. If true
|
|
1330
|
+
* and if the device is able to provide a more accurate
|
|
1331
|
+
* position, it will do so. Note that this can result in
|
|
1332
|
+
* slower response times or increased power consumption
|
|
1333
|
+
* (with a GPS chip on a mobile device for example). On
|
|
1334
|
+
* the other hand, if false, the device can take the
|
|
1335
|
+
* liberty to save resources by responding more quickly
|
|
1336
|
+
* and/or using less power. Default: false.
|
|
1337
|
+
*/
|
|
1338
|
+
enableHighAccuracy: !1,
|
|
1339
|
+
/**
|
|
1340
|
+
* A positive long value representing the maximum length
|
|
1341
|
+
* of time (in milliseconds) the device is allowed to
|
|
1342
|
+
* take in order to return a position. The default value
|
|
1343
|
+
* is Infinity, meaning that getCurrentPosition() won't
|
|
1344
|
+
* return until the position is available.
|
|
1345
|
+
*/
|
|
1346
|
+
timeout: 1e4,
|
|
1347
|
+
/**
|
|
1348
|
+
* A positive long value indicating the maximum age in
|
|
1349
|
+
* milliseconds of a possible cached position that is
|
|
1350
|
+
* acceptable to return. If set to 0, it means that the
|
|
1351
|
+
* device cannot use a cached position and must attempt
|
|
1352
|
+
* to retrieve the real current position. If set to
|
|
1353
|
+
* Infinity the device must return a cached position
|
|
1354
|
+
* regardless of its age. Default: 0.
|
|
1355
|
+
*/
|
|
1356
|
+
maximumAge: 6e4
|
|
1357
|
+
};
|
|
1358
|
+
return new Promise((t, r) => {
|
|
1359
|
+
var a;
|
|
1360
|
+
(a = navigator == null ? void 0 : navigator.geolocation) == null || a.getCurrentPosition(
|
|
1361
|
+
(n) => {
|
|
1362
|
+
t({
|
|
1363
|
+
latitude: n.coords.latitude,
|
|
1364
|
+
longitude: n.coords.longitude,
|
|
1365
|
+
accuracy: n.coords.accuracy
|
|
1366
|
+
});
|
|
1367
|
+
},
|
|
1368
|
+
(n) => {
|
|
1369
|
+
r(n);
|
|
1370
|
+
},
|
|
1371
|
+
e
|
|
1372
|
+
);
|
|
1373
|
+
});
|
|
1374
|
+
}, Nn = (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: [
|
|
1375
|
+
/* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
|
|
1376
|
+
/* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
|
|
1377
|
+
] }) }, `${e}-${r}`)) : null;
|
|
1378
|
+
function Cn({
|
|
1379
|
+
data: e,
|
|
1380
|
+
formatter: t = (r) => r
|
|
1381
|
+
}) {
|
|
1382
|
+
const r = e.filter(
|
|
1383
|
+
(n) => typeof n == "number" && n > 0
|
|
1384
|
+
), a = r.reduce(
|
|
1385
|
+
(n, o) => (n || 0) + (o || 0),
|
|
1386
|
+
0
|
|
1387
|
+
);
|
|
1388
|
+
return t(a ? a / r.length : 0);
|
|
1389
|
+
}
|
|
1390
|
+
const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, On = new Intl.NumberFormat("en", {
|
|
1391
|
+
style: "decimal",
|
|
1392
|
+
signDisplay: "never",
|
|
1393
|
+
minimumFractionDigits: 0,
|
|
1394
|
+
maximumFractionDigits: 0
|
|
1395
|
+
}), Dn = (e) => qr(e, {
|
|
1396
|
+
secondsDecimalDigits: 2,
|
|
1397
|
+
unitCount: 2
|
|
1398
|
+
}), Zr = (e) => g(
|
|
1399
|
+
"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",
|
|
1400
|
+
e || Ne ? "pt-4" : "pt-10"
|
|
1401
|
+
), $n = (e, t) => t === 1 ? e : `${e}s`, Ce = (e) => {
|
|
1209
1402
|
let t = "";
|
|
1210
1403
|
if (typeof e == "number" || typeof e == "string")
|
|
1211
1404
|
t = "m-" + e;
|
|
@@ -1214,7 +1407,7 @@ const se = () => {
|
|
|
1214
1407
|
(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(" ");
|
|
1215
1408
|
}
|
|
1216
1409
|
return t;
|
|
1217
|
-
},
|
|
1410
|
+
}, Mn = "av-bubble", Qe = "av-button", Ln = "av-card", ea = "av-footer", ta = "av-main", Pn = "av-messagebox", Un = "av-panel", Hn = "av-spinner", gt = "icon", ft = "button", ra = "link", aa = ({
|
|
1218
1411
|
type: e,
|
|
1219
1412
|
size: t,
|
|
1220
1413
|
labelRight: r,
|
|
@@ -1223,19 +1416,19 @@ const se = () => {
|
|
|
1223
1416
|
}) => {
|
|
1224
1417
|
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";
|
|
1225
1418
|
switch (e) {
|
|
1226
|
-
case
|
|
1419
|
+
case ft:
|
|
1227
1420
|
return g("px-4", {
|
|
1228
1421
|
[o]: t === "small",
|
|
1229
1422
|
[s]: t === "medium",
|
|
1230
1423
|
[i]: t === "large"
|
|
1231
1424
|
});
|
|
1232
|
-
case
|
|
1425
|
+
case ra:
|
|
1233
1426
|
return g("px-4 text-center", {
|
|
1234
1427
|
[o]: t === "small",
|
|
1235
1428
|
[s]: t === "medium",
|
|
1236
1429
|
[i]: t === "large"
|
|
1237
1430
|
});
|
|
1238
|
-
case
|
|
1431
|
+
case gt:
|
|
1239
1432
|
return g("inline-flex items-center", {
|
|
1240
1433
|
"justify-center": n === "center",
|
|
1241
1434
|
"justify-start": n === "left",
|
|
@@ -1248,7 +1441,7 @@ const se = () => {
|
|
|
1248
1441
|
"h-12 px-4 text-lg font-medium": t === "large" && (r || a)
|
|
1249
1442
|
});
|
|
1250
1443
|
}
|
|
1251
|
-
},
|
|
1444
|
+
}, na = ({
|
|
1252
1445
|
mode: e,
|
|
1253
1446
|
noBackground: t,
|
|
1254
1447
|
noTruncate: r,
|
|
@@ -1280,7 +1473,7 @@ const se = () => {
|
|
|
1280
1473
|
"bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
|
|
1281
1474
|
"bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
|
|
1282
1475
|
});
|
|
1283
|
-
},
|
|
1476
|
+
}, oa = ({
|
|
1284
1477
|
mode: e,
|
|
1285
1478
|
disabled: t,
|
|
1286
1479
|
variant: r
|
|
@@ -1308,7 +1501,7 @@ const se = () => {
|
|
|
1308
1501
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
1309
1502
|
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
|
|
1310
1503
|
});
|
|
1311
|
-
},
|
|
1504
|
+
}, sa = ({
|
|
1312
1505
|
mode: e,
|
|
1313
1506
|
disabled: t,
|
|
1314
1507
|
variant: r
|
|
@@ -1336,7 +1529,7 @@ const se = () => {
|
|
|
1336
1529
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
1337
1530
|
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
|
|
1338
1531
|
});
|
|
1339
|
-
},
|
|
1532
|
+
}, ia = ({
|
|
1340
1533
|
mode: e,
|
|
1341
1534
|
noBorder: t,
|
|
1342
1535
|
variant: r
|
|
@@ -1364,12 +1557,12 @@ const se = () => {
|
|
|
1364
1557
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
1365
1558
|
"border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
|
|
1366
1559
|
});
|
|
1367
|
-
},
|
|
1560
|
+
}, ca = ({ focusMode: e }) => g("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
1368
1561
|
"focus:outline-focus-dark": e === "dark",
|
|
1369
1562
|
"focus:outline-focus-light": e === "light",
|
|
1370
1563
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
1371
1564
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
1372
|
-
}),
|
|
1565
|
+
}), yt = ({
|
|
1373
1566
|
type: e,
|
|
1374
1567
|
className: t,
|
|
1375
1568
|
raw: r,
|
|
@@ -1380,30 +1573,30 @@ const se = () => {
|
|
|
1380
1573
|
size: i,
|
|
1381
1574
|
noBorder: l,
|
|
1382
1575
|
labelRight: d,
|
|
1383
|
-
labelLeft:
|
|
1576
|
+
labelLeft: h,
|
|
1384
1577
|
spacing: u,
|
|
1385
1578
|
noBackground: m,
|
|
1386
|
-
variant:
|
|
1579
|
+
variant: p,
|
|
1387
1580
|
noTruncate: f,
|
|
1388
|
-
align:
|
|
1389
|
-
}) => (
|
|
1390
|
-
|
|
1581
|
+
align: w
|
|
1582
|
+
}) => (p || (p = "primary"), r ? g(Qe, t) : g(
|
|
1583
|
+
Qe,
|
|
1391
1584
|
t,
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1585
|
+
Ce(u),
|
|
1586
|
+
na({ mode: a, variant: p, noBackground: m, noTruncate: f }),
|
|
1587
|
+
aa({ type: e, size: i, labelRight: d, labelLeft: h, align: w }),
|
|
1588
|
+
ia({ mode: a, variant: p, noBorder: l }),
|
|
1589
|
+
ca({ focusMode: n }),
|
|
1590
|
+
oa({ mode: a, variant: p, disabled: o }),
|
|
1591
|
+
sa({ mode: a, variant: p, disabled: o }),
|
|
1399
1592
|
{
|
|
1400
1593
|
"w-full": s,
|
|
1401
1594
|
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
1402
1595
|
}
|
|
1403
|
-
)),
|
|
1596
|
+
)), la = (e, t, r) => {
|
|
1404
1597
|
var a;
|
|
1405
1598
|
!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);
|
|
1406
|
-
},
|
|
1599
|
+
}, Re = K.forwardRef(
|
|
1407
1600
|
(e, t) => {
|
|
1408
1601
|
const { onClick: r, noInternalClick: a = !1, ...n } = e;
|
|
1409
1602
|
return /* @__PURE__ */ c(
|
|
@@ -1411,15 +1604,15 @@ const se = () => {
|
|
|
1411
1604
|
{
|
|
1412
1605
|
ref: t,
|
|
1413
1606
|
onClick: (o) => {
|
|
1414
|
-
|
|
1607
|
+
la(o, a, r);
|
|
1415
1608
|
},
|
|
1416
1609
|
...n
|
|
1417
1610
|
}
|
|
1418
1611
|
);
|
|
1419
1612
|
}
|
|
1420
1613
|
);
|
|
1421
|
-
|
|
1422
|
-
const
|
|
1614
|
+
Re.displayName = "BaseButton";
|
|
1615
|
+
const bt = K.forwardRef(
|
|
1423
1616
|
({
|
|
1424
1617
|
children: e,
|
|
1425
1618
|
disabled: t = !1,
|
|
@@ -1431,17 +1624,17 @@ const ft = K.forwardRef(
|
|
|
1431
1624
|
raw: i = !1,
|
|
1432
1625
|
noBorder: l = !1,
|
|
1433
1626
|
"aria-label": d,
|
|
1434
|
-
label:
|
|
1627
|
+
label: h,
|
|
1435
1628
|
size: u = "medium",
|
|
1436
1629
|
labelRight: m,
|
|
1437
|
-
labelLeft:
|
|
1630
|
+
labelLeft: p,
|
|
1438
1631
|
spacing: f,
|
|
1439
|
-
noBackground:
|
|
1440
|
-
align:
|
|
1441
|
-
...
|
|
1442
|
-
},
|
|
1443
|
-
const
|
|
1444
|
-
type:
|
|
1632
|
+
noBackground: w = !1,
|
|
1633
|
+
align: x = "center",
|
|
1634
|
+
...O
|
|
1635
|
+
}, _) => {
|
|
1636
|
+
const S = yt({
|
|
1637
|
+
type: gt,
|
|
1445
1638
|
mode: r,
|
|
1446
1639
|
focusMode: a,
|
|
1447
1640
|
fullWidth: n,
|
|
@@ -1451,36 +1644,36 @@ const ft = K.forwardRef(
|
|
|
1451
1644
|
noBorder: l,
|
|
1452
1645
|
size: u,
|
|
1453
1646
|
labelRight: m,
|
|
1454
|
-
labelLeft:
|
|
1647
|
+
labelLeft: p,
|
|
1455
1648
|
spacing: f,
|
|
1456
|
-
noBackground:
|
|
1457
|
-
align:
|
|
1458
|
-
}),
|
|
1649
|
+
noBackground: w,
|
|
1650
|
+
align: x
|
|
1651
|
+
}), D = g({
|
|
1459
1652
|
"text-copy-accent-dark": r === "light" && !i,
|
|
1460
1653
|
"text-copy-light": r === "dark" && !i,
|
|
1461
1654
|
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
|
|
1462
1655
|
"text-copy-light dark:text-copy-accent-dark": r === "system" && !i
|
|
1463
1656
|
});
|
|
1464
|
-
return /* @__PURE__ */
|
|
1465
|
-
|
|
1657
|
+
return /* @__PURE__ */ T(
|
|
1658
|
+
Re,
|
|
1466
1659
|
{
|
|
1467
|
-
ref:
|
|
1468
|
-
className:
|
|
1660
|
+
ref: _,
|
|
1661
|
+
className: S,
|
|
1469
1662
|
disabled: t,
|
|
1470
1663
|
type: s,
|
|
1471
|
-
"aria-label": d ||
|
|
1472
|
-
...
|
|
1664
|
+
"aria-label": d || h,
|
|
1665
|
+
...O,
|
|
1473
1666
|
children: [
|
|
1474
|
-
|
|
1475
|
-
/* @__PURE__ */ c("div", { className:
|
|
1667
|
+
p && /* @__PURE__ */ c("span", { className: "pr-2", children: p }),
|
|
1668
|
+
/* @__PURE__ */ c("div", { className: D, children: e }),
|
|
1476
1669
|
m && /* @__PURE__ */ c("span", { className: "pl-2", children: m })
|
|
1477
1670
|
]
|
|
1478
1671
|
}
|
|
1479
1672
|
);
|
|
1480
1673
|
}
|
|
1481
1674
|
);
|
|
1482
|
-
|
|
1483
|
-
const
|
|
1675
|
+
bt.displayName = "ButtonIcon";
|
|
1676
|
+
const wt = K.forwardRef(
|
|
1484
1677
|
({
|
|
1485
1678
|
children: e,
|
|
1486
1679
|
disabled: t = !1,
|
|
@@ -1492,12 +1685,12 @@ const yt = K.forwardRef(
|
|
|
1492
1685
|
raw: i = !1,
|
|
1493
1686
|
noBorder: l = !1,
|
|
1494
1687
|
spacing: d,
|
|
1495
|
-
variant:
|
|
1688
|
+
variant: h = "primary",
|
|
1496
1689
|
noTruncate: u = !1,
|
|
1497
1690
|
...m
|
|
1498
|
-
},
|
|
1499
|
-
const f =
|
|
1500
|
-
type:
|
|
1691
|
+
}, p) => {
|
|
1692
|
+
const f = yt({
|
|
1693
|
+
type: ft,
|
|
1501
1694
|
mode: r,
|
|
1502
1695
|
focusMode: a,
|
|
1503
1696
|
fullWidth: n,
|
|
@@ -1507,13 +1700,13 @@ const yt = K.forwardRef(
|
|
|
1507
1700
|
size: s,
|
|
1508
1701
|
noBorder: l,
|
|
1509
1702
|
spacing: d,
|
|
1510
|
-
variant:
|
|
1703
|
+
variant: h,
|
|
1511
1704
|
noTruncate: u
|
|
1512
1705
|
});
|
|
1513
1706
|
return /* @__PURE__ */ c(
|
|
1514
|
-
|
|
1707
|
+
Re,
|
|
1515
1708
|
{
|
|
1516
|
-
ref:
|
|
1709
|
+
ref: p,
|
|
1517
1710
|
className: f,
|
|
1518
1711
|
disabled: t,
|
|
1519
1712
|
...m,
|
|
@@ -1522,8 +1715,8 @@ const yt = K.forwardRef(
|
|
|
1522
1715
|
);
|
|
1523
1716
|
}
|
|
1524
1717
|
);
|
|
1525
|
-
|
|
1526
|
-
const
|
|
1718
|
+
wt.displayName = "Button";
|
|
1719
|
+
const da = ({
|
|
1527
1720
|
className: e,
|
|
1528
1721
|
mode: t = "system",
|
|
1529
1722
|
row1: r,
|
|
@@ -1532,7 +1725,7 @@ const Xr = ({
|
|
|
1532
1725
|
spacing: o,
|
|
1533
1726
|
raw: s = !1
|
|
1534
1727
|
}) => {
|
|
1535
|
-
const i = g(
|
|
1728
|
+
const i = g(ea, e, Ce(o), {
|
|
1536
1729
|
"text-copy-dark": !s && t === "dark",
|
|
1537
1730
|
"text-copy-lighter": !s && t === "light",
|
|
1538
1731
|
"text-copy-dark dark:text-copy-lighter": !s && t === "system",
|
|
@@ -1540,17 +1733,17 @@ const Xr = ({
|
|
|
1540
1733
|
"mb-[100px]": !n && !s,
|
|
1541
1734
|
"mt-0 flex w-full flex-col p-2 text-center text-xs sm:mt-3 md:mx-auto md:max-w-4xl": !s
|
|
1542
1735
|
});
|
|
1543
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ T("footer", { className: i, children: [
|
|
1544
1737
|
r && /* @__PURE__ */ c("div", { children: r }),
|
|
1545
1738
|
a && /* @__PURE__ */ c("div", { children: a })
|
|
1546
1739
|
] });
|
|
1547
|
-
},
|
|
1740
|
+
}, ua = ({
|
|
1548
1741
|
children: e,
|
|
1549
1742
|
className: t,
|
|
1550
1743
|
raw: r = !1,
|
|
1551
1744
|
spacing: a
|
|
1552
1745
|
}) => {
|
|
1553
|
-
const n = g(t,
|
|
1746
|
+
const n = g(t, ta, Ce(a), {
|
|
1554
1747
|
"mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
|
|
1555
1748
|
});
|
|
1556
1749
|
return /* @__PURE__ */ c("main", { className: n, children: e });
|
|
@@ -1568,16 +1761,16 @@ try {
|
|
|
1568
1761
|
});
|
|
1569
1762
|
} catch {
|
|
1570
1763
|
}
|
|
1571
|
-
function
|
|
1572
|
-
return
|
|
1764
|
+
function ma(e) {
|
|
1765
|
+
return Nt(() => e.every((t) => t == null) ? () => {
|
|
1573
1766
|
} : (t) => {
|
|
1574
1767
|
e.forEach((r) => {
|
|
1575
1768
|
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
1576
1769
|
});
|
|
1577
1770
|
}, e);
|
|
1578
1771
|
}
|
|
1579
|
-
function
|
|
1580
|
-
const t =
|
|
1772
|
+
function ha(e) {
|
|
1773
|
+
const t = Ct();
|
|
1581
1774
|
if (!e)
|
|
1582
1775
|
return t;
|
|
1583
1776
|
if (typeof e == "number" || typeof e == "string")
|
|
@@ -1587,7 +1780,7 @@ function ta(e) {
|
|
|
1587
1780
|
return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
|
|
1588
1781
|
}
|
|
1589
1782
|
}
|
|
1590
|
-
const
|
|
1783
|
+
const Et = "SET_ANNOUNCEMENT", vt = "CLEAR_ANNOUNCEMENT", pa = {
|
|
1591
1784
|
alert: null,
|
|
1592
1785
|
alertdialog: null,
|
|
1593
1786
|
log: "polite",
|
|
@@ -1595,14 +1788,14 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
|
|
|
1595
1788
|
progressbar: null,
|
|
1596
1789
|
status: "polite",
|
|
1597
1790
|
timer: "assertive"
|
|
1598
|
-
},
|
|
1791
|
+
}, ga = (e, t) => {
|
|
1599
1792
|
switch (t == null ? void 0 : t.type) {
|
|
1600
|
-
case
|
|
1793
|
+
case Et:
|
|
1601
1794
|
return {
|
|
1602
1795
|
...e,
|
|
1603
1796
|
announcement: t.payload
|
|
1604
1797
|
};
|
|
1605
|
-
case
|
|
1798
|
+
case vt:
|
|
1606
1799
|
return {
|
|
1607
1800
|
...e,
|
|
1608
1801
|
announcement: null
|
|
@@ -1610,14 +1803,14 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
|
|
|
1610
1803
|
default:
|
|
1611
1804
|
return e;
|
|
1612
1805
|
}
|
|
1613
|
-
},
|
|
1806
|
+
}, fa = ({
|
|
1614
1807
|
onAnnouncementClear: e,
|
|
1615
1808
|
dispatch: t
|
|
1616
1809
|
}) => {
|
|
1617
1810
|
t({
|
|
1618
|
-
type:
|
|
1811
|
+
type: vt
|
|
1619
1812
|
}), typeof e == "function" && e();
|
|
1620
|
-
},
|
|
1813
|
+
}, Xe = ({
|
|
1621
1814
|
children: e,
|
|
1622
1815
|
clearAnnouncementDelay: t,
|
|
1623
1816
|
clearAnnouncementTimeoutRef: r,
|
|
@@ -1625,16 +1818,16 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
|
|
|
1625
1818
|
dispatch: n
|
|
1626
1819
|
}) => {
|
|
1627
1820
|
(r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && n({
|
|
1628
|
-
type:
|
|
1821
|
+
type: Et,
|
|
1629
1822
|
payload: e
|
|
1630
1823
|
}), t && (r.current = setTimeout(
|
|
1631
|
-
() =>
|
|
1824
|
+
() => fa({
|
|
1632
1825
|
onAnnouncementClear: a,
|
|
1633
1826
|
dispatch: n
|
|
1634
1827
|
}),
|
|
1635
1828
|
t
|
|
1636
1829
|
));
|
|
1637
|
-
},
|
|
1830
|
+
}, ya = ({
|
|
1638
1831
|
children: e,
|
|
1639
1832
|
announcementTimeoutRef: t,
|
|
1640
1833
|
announcementDelay: r,
|
|
@@ -1643,13 +1836,13 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
|
|
|
1643
1836
|
onAnnouncementClear: o,
|
|
1644
1837
|
dispatch: s
|
|
1645
1838
|
}) => {
|
|
1646
|
-
clearTimeout(t.current), r ? t.current = setTimeout(
|
|
1839
|
+
clearTimeout(t.current), r ? t.current = setTimeout(Xe, r, {
|
|
1647
1840
|
children: e,
|
|
1648
1841
|
clearAnnouncementDelay: a,
|
|
1649
1842
|
clearAnnouncementTimeoutRef: n,
|
|
1650
1843
|
onAnnouncementClear: o,
|
|
1651
1844
|
dispatch: s
|
|
1652
|
-
}) :
|
|
1845
|
+
}) : Xe({
|
|
1653
1846
|
children: e,
|
|
1654
1847
|
clearAnnouncementDelay: a,
|
|
1655
1848
|
clearAnnouncementTimeoutRef: n,
|
|
@@ -1657,7 +1850,7 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
|
|
|
1657
1850
|
dispatch: s
|
|
1658
1851
|
});
|
|
1659
1852
|
};
|
|
1660
|
-
function
|
|
1853
|
+
function kt({
|
|
1661
1854
|
children: e,
|
|
1662
1855
|
className: t,
|
|
1663
1856
|
politeness: r,
|
|
@@ -1668,17 +1861,17 @@ function Et({
|
|
|
1668
1861
|
visible: i,
|
|
1669
1862
|
...l
|
|
1670
1863
|
}) {
|
|
1671
|
-
const d =
|
|
1864
|
+
const d = W(), h = W(), [u, m] = Rt(ga, {
|
|
1672
1865
|
announcement: null
|
|
1673
1866
|
});
|
|
1674
|
-
let
|
|
1675
|
-
typeof
|
|
1676
|
-
|
|
1867
|
+
let p = r;
|
|
1868
|
+
typeof p > "u" && (p = a ? pa[a] : "assertive"), z(() => {
|
|
1869
|
+
ya({
|
|
1677
1870
|
announcementTimeoutRef: d,
|
|
1678
1871
|
announcementDelay: n,
|
|
1679
1872
|
children: e,
|
|
1680
1873
|
clearAnnouncementDelay: o,
|
|
1681
|
-
clearAnnouncementTimeoutRef:
|
|
1874
|
+
clearAnnouncementTimeoutRef: h,
|
|
1682
1875
|
onAnnouncementClear: s,
|
|
1683
1876
|
dispatch: m
|
|
1684
1877
|
});
|
|
@@ -1694,7 +1887,7 @@ function Et({
|
|
|
1694
1887
|
return /* @__PURE__ */ c(
|
|
1695
1888
|
"div",
|
|
1696
1889
|
{
|
|
1697
|
-
"aria-live":
|
|
1890
|
+
"aria-live": p,
|
|
1698
1891
|
...a && { role: a },
|
|
1699
1892
|
className: f,
|
|
1700
1893
|
...l,
|
|
@@ -1715,7 +1908,7 @@ try {
|
|
|
1715
1908
|
});
|
|
1716
1909
|
} catch {
|
|
1717
1910
|
}
|
|
1718
|
-
const
|
|
1911
|
+
const ba = (e) => {
|
|
1719
1912
|
let t = "";
|
|
1720
1913
|
if (typeof e == "number" || typeof e == "string")
|
|
1721
1914
|
t = "m-" + e;
|
|
@@ -1724,21 +1917,21 @@ const sa = (e) => {
|
|
|
1724
1917
|
(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(" ");
|
|
1725
1918
|
}
|
|
1726
1919
|
return t;
|
|
1727
|
-
},
|
|
1920
|
+
}, St = "av-text-input", wa = "av-text-input-wrapper", Te = "av-text-input-helper-text", Kn = "av-text-area", Bn = "av-text-area-wrapper", Wn = "av-text-area-helper-text", jn = "av-text-area__control--right", Gn = "av-toggle", Ea = ({
|
|
1728
1921
|
mode: e
|
|
1729
1922
|
}) => g({
|
|
1730
1923
|
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
1731
1924
|
"bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
|
|
1732
1925
|
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
|
|
1733
1926
|
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
|
|
1734
|
-
}),
|
|
1927
|
+
}), va = ({
|
|
1735
1928
|
focusMode: e
|
|
1736
1929
|
}) => g("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
1737
1930
|
"focus:outline-focus-dark": e === "dark",
|
|
1738
1931
|
"focus:outline-focus-light": e === "light",
|
|
1739
1932
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
1740
1933
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
1741
|
-
}),
|
|
1934
|
+
}), ka = ({
|
|
1742
1935
|
noBorder: e,
|
|
1743
1936
|
error: t
|
|
1744
1937
|
}) => g("border-2", {
|
|
@@ -1746,7 +1939,7 @@ const sa = (e) => {
|
|
|
1746
1939
|
"focus:border-border-dark": !e && t,
|
|
1747
1940
|
"border-border-error-dark": !e && t,
|
|
1748
1941
|
"border-transparent": e
|
|
1749
|
-
}),
|
|
1942
|
+
}), Sa = ({
|
|
1750
1943
|
disabled: e,
|
|
1751
1944
|
raw: t,
|
|
1752
1945
|
error: r,
|
|
@@ -1770,7 +1963,7 @@ const sa = (e) => {
|
|
|
1770
1963
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
|
|
1771
1964
|
"text-copy-lighter dark:text-copy-error-dark": a === "alt-system"
|
|
1772
1965
|
});
|
|
1773
|
-
},
|
|
1966
|
+
}, Ta = ({
|
|
1774
1967
|
error: e,
|
|
1775
1968
|
raw: t,
|
|
1776
1969
|
mode: r,
|
|
@@ -1797,7 +1990,7 @@ const sa = (e) => {
|
|
|
1797
1990
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
|
|
1798
1991
|
"dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
|
|
1799
1992
|
});
|
|
1800
|
-
},
|
|
1993
|
+
}, Aa = ({
|
|
1801
1994
|
className: e,
|
|
1802
1995
|
inputClassName: t,
|
|
1803
1996
|
raw: r,
|
|
@@ -1810,25 +2003,25 @@ const sa = (e) => {
|
|
|
1810
2003
|
}) => {
|
|
1811
2004
|
const d = r ? e : g(
|
|
1812
2005
|
"relative flex w-full flex-col justify-center",
|
|
1813
|
-
|
|
2006
|
+
wa,
|
|
1814
2007
|
e,
|
|
1815
|
-
|
|
1816
|
-
),
|
|
1817
|
-
|
|
2008
|
+
ba(s)
|
|
2009
|
+
), h = r ? g(t) : g(
|
|
2010
|
+
St,
|
|
1818
2011
|
t,
|
|
1819
2012
|
"h-12 rounded-md px-4 text-base",
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
2013
|
+
Ea({ mode: i }),
|
|
2014
|
+
va({ focusMode: l }),
|
|
2015
|
+
ka({ noBorder: n, error: o }),
|
|
1823
2016
|
{
|
|
1824
2017
|
"disabled:cursor-not-allowed disabled:opacity-50": a
|
|
1825
2018
|
}
|
|
1826
|
-
), u = r ? void 0 : "sr-only", m =
|
|
2019
|
+
), u = r ? void 0 : "sr-only", m = Sa({
|
|
1827
2020
|
disabled: a,
|
|
1828
2021
|
raw: r,
|
|
1829
2022
|
error: o,
|
|
1830
2023
|
mode: i
|
|
1831
|
-
}),
|
|
2024
|
+
}), p = Ta({
|
|
1832
2025
|
error: o,
|
|
1833
2026
|
raw: r,
|
|
1834
2027
|
mode: i,
|
|
@@ -1836,13 +2029,13 @@ const sa = (e) => {
|
|
|
1836
2029
|
});
|
|
1837
2030
|
return {
|
|
1838
2031
|
wrapper: d,
|
|
1839
|
-
input:
|
|
2032
|
+
input: h,
|
|
1840
2033
|
accessibleLabel: u,
|
|
1841
2034
|
visibleLabel: m,
|
|
1842
|
-
helperText:
|
|
2035
|
+
helperText: p,
|
|
1843
2036
|
rightElement: r ? void 0 : "absolute right-3"
|
|
1844
2037
|
};
|
|
1845
|
-
},
|
|
2038
|
+
}, Oe = K.forwardRef(
|
|
1846
2039
|
({
|
|
1847
2040
|
id: e,
|
|
1848
2041
|
name: t,
|
|
@@ -1854,85 +2047,85 @@ const sa = (e) => {
|
|
|
1854
2047
|
mode: i = "system",
|
|
1855
2048
|
focusMode: l = "system",
|
|
1856
2049
|
disabled: d = !1,
|
|
1857
|
-
noBorder:
|
|
2050
|
+
noBorder: h = !1,
|
|
1858
2051
|
labelId: u,
|
|
1859
2052
|
labelHidden: m = !1,
|
|
1860
|
-
type:
|
|
2053
|
+
type: p = "text",
|
|
1861
2054
|
helperText: f = "",
|
|
1862
|
-
rightElement:
|
|
1863
|
-
spacing:
|
|
1864
|
-
...
|
|
1865
|
-
},
|
|
1866
|
-
const
|
|
2055
|
+
rightElement: w,
|
|
2056
|
+
spacing: x,
|
|
2057
|
+
...O
|
|
2058
|
+
}, _) => {
|
|
2059
|
+
const S = W(null), [D, C] = U(0), N = ha({ id: e, prefix: `${St}-` }), V = `${t} error, ${f}`, R = Aa({
|
|
1867
2060
|
className: o,
|
|
1868
2061
|
inputClassName: s,
|
|
1869
2062
|
error: a,
|
|
1870
2063
|
raw: n,
|
|
1871
2064
|
focusMode: l,
|
|
1872
2065
|
disabled: d,
|
|
1873
|
-
noBorder:
|
|
1874
|
-
spacing:
|
|
2066
|
+
noBorder: h,
|
|
2067
|
+
spacing: x,
|
|
1875
2068
|
mode: i
|
|
1876
2069
|
});
|
|
1877
|
-
return
|
|
1878
|
-
|
|
1879
|
-
}, []), /* @__PURE__ */
|
|
2070
|
+
return Ot(() => {
|
|
2071
|
+
S.current && C(S.current.offsetWidth + 18 + 10);
|
|
2072
|
+
}, []), /* @__PURE__ */ T("div", { className: R.wrapper, children: [
|
|
1880
2073
|
/* @__PURE__ */ c(
|
|
1881
2074
|
"label",
|
|
1882
2075
|
{
|
|
1883
|
-
htmlFor:
|
|
2076
|
+
htmlFor: N,
|
|
1884
2077
|
id: u,
|
|
1885
|
-
className:
|
|
2078
|
+
className: R.accessibleLabel,
|
|
1886
2079
|
children: r
|
|
1887
2080
|
}
|
|
1888
2081
|
),
|
|
1889
2082
|
/* @__PURE__ */ c(
|
|
1890
2083
|
"input",
|
|
1891
2084
|
{
|
|
1892
|
-
ref:
|
|
1893
|
-
id:
|
|
2085
|
+
ref: _,
|
|
2086
|
+
id: N,
|
|
1894
2087
|
name: t,
|
|
1895
|
-
type:
|
|
2088
|
+
type: p,
|
|
1896
2089
|
disabled: d,
|
|
1897
2090
|
placeholder: n ? void 0 : " ",
|
|
1898
|
-
className:
|
|
1899
|
-
...f && { "aria-describedby": `${
|
|
2091
|
+
className: R.input,
|
|
2092
|
+
...f && { "aria-describedby": `${N}-helper` },
|
|
1900
2093
|
...a && { "aria-invalid": "true" },
|
|
1901
|
-
...
|
|
1902
|
-
...
|
|
2094
|
+
...w && !n && { style: { paddingRight: D } },
|
|
2095
|
+
...O
|
|
1903
2096
|
}
|
|
1904
2097
|
),
|
|
1905
2098
|
!n && !m && /* @__PURE__ */ c(
|
|
1906
2099
|
"label",
|
|
1907
2100
|
{
|
|
1908
2101
|
"aria-hidden": !0,
|
|
1909
|
-
htmlFor:
|
|
1910
|
-
className:
|
|
2102
|
+
htmlFor: N,
|
|
2103
|
+
className: R.visibleLabel,
|
|
1911
2104
|
children: r
|
|
1912
2105
|
}
|
|
1913
2106
|
),
|
|
1914
2107
|
f && /* @__PURE__ */ c(
|
|
1915
2108
|
"div",
|
|
1916
2109
|
{
|
|
1917
|
-
id: `${
|
|
1918
|
-
className:
|
|
2110
|
+
id: `${N}-helper`,
|
|
2111
|
+
className: R.helperText,
|
|
1919
2112
|
children: f
|
|
1920
2113
|
}
|
|
1921
2114
|
),
|
|
1922
|
-
|
|
2115
|
+
w && /* @__PURE__ */ c(
|
|
1923
2116
|
"div",
|
|
1924
2117
|
{
|
|
1925
|
-
ref:
|
|
1926
|
-
className:
|
|
1927
|
-
children:
|
|
2118
|
+
ref: S,
|
|
2119
|
+
className: R.rightElement,
|
|
2120
|
+
children: w
|
|
1928
2121
|
}
|
|
1929
2122
|
),
|
|
1930
|
-
a && f && /* @__PURE__ */ c(
|
|
2123
|
+
a && f && /* @__PURE__ */ c(kt, { politeness: "polite", clearAnnouncementDelay: 500, children: V })
|
|
1931
2124
|
] });
|
|
1932
2125
|
}
|
|
1933
2126
|
);
|
|
1934
|
-
|
|
1935
|
-
const
|
|
2127
|
+
Oe.displayName = "TextInput";
|
|
2128
|
+
const _a = 500, Ia = 5e3, xa = 2e4, Tt = K.forwardRef(
|
|
1936
2129
|
({
|
|
1937
2130
|
name: e,
|
|
1938
2131
|
disabled: t,
|
|
@@ -1944,78 +2137,78 @@ const pa = 500, ga = 5e3, fa = 2e4, kt = K.forwardRef(
|
|
|
1944
2137
|
onFocus: i,
|
|
1945
2138
|
onTextInputMaskBlur: l,
|
|
1946
2139
|
rightElement: d,
|
|
1947
|
-
spacing:
|
|
2140
|
+
spacing: h,
|
|
1948
2141
|
...u
|
|
1949
2142
|
}, m) => {
|
|
1950
|
-
const [
|
|
2143
|
+
const [p, f] = U(!0), [w, x] = U({
|
|
1951
2144
|
message: null,
|
|
1952
2145
|
politeness: null
|
|
1953
|
-
}),
|
|
1954
|
-
clearTimeout(
|
|
1955
|
-
|
|
1956
|
-
announcementTimeout:
|
|
2146
|
+
}), O = W(!0), _ = W(), S = W(null), D = ma([m, S]), C = p ? "Show" : "Hide", N = () => {
|
|
2147
|
+
clearTimeout(_.current), O.current || (_.current = window.setTimeout(() => {
|
|
2148
|
+
O.current = !0, f(!0), x({
|
|
2149
|
+
announcementTimeout: Ia,
|
|
1957
2150
|
politeness: "polite",
|
|
1958
2151
|
message: `${r} hiding characters`
|
|
1959
2152
|
}), n && n(!0);
|
|
1960
|
-
},
|
|
1961
|
-
},
|
|
1962
|
-
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1965
|
-
announcementTimeout:
|
|
2153
|
+
}, xa));
|
|
2154
|
+
}, V = (b) => {
|
|
2155
|
+
b.preventDefault();
|
|
2156
|
+
const A = !O.current;
|
|
2157
|
+
O.current = A, N(), f(A), x({
|
|
2158
|
+
announcementTimeout: _a,
|
|
1966
2159
|
politeness: "assertive",
|
|
1967
|
-
message:
|
|
1968
|
-
}), n && n(
|
|
1969
|
-
},
|
|
1970
|
-
var
|
|
1971
|
-
const { relatedTarget:
|
|
1972
|
-
|
|
1973
|
-
},
|
|
1974
|
-
|
|
1975
|
-
},
|
|
1976
|
-
|
|
1977
|
-
},
|
|
1978
|
-
|
|
2160
|
+
message: A ? "Characters hidden" : "Characters showing"
|
|
2161
|
+
}), n && n(A);
|
|
2162
|
+
}, R = (b) => {
|
|
2163
|
+
var A;
|
|
2164
|
+
const { relatedTarget: B } = b, G = (A = S.current) == null ? void 0 : A.parentElement;
|
|
2165
|
+
G != null && G.contains(B) || l && l();
|
|
2166
|
+
}, fe = (b) => {
|
|
2167
|
+
N(), s && s(b), R(b);
|
|
2168
|
+
}, y = (b) => {
|
|
2169
|
+
N(), i && i(b);
|
|
2170
|
+
}, $ = (b) => {
|
|
2171
|
+
N(), o && o(b);
|
|
1979
2172
|
};
|
|
1980
2173
|
return z(() => () => {
|
|
1981
|
-
clearTimeout(
|
|
1982
|
-
}, []), /* @__PURE__ */
|
|
2174
|
+
clearTimeout(_.current);
|
|
2175
|
+
}, []), /* @__PURE__ */ T(q, { children: [
|
|
1983
2176
|
/* @__PURE__ */ c(
|
|
1984
|
-
|
|
2177
|
+
Oe,
|
|
1985
2178
|
{
|
|
1986
|
-
ref:
|
|
2179
|
+
ref: D,
|
|
1987
2180
|
name: e,
|
|
1988
2181
|
label: r,
|
|
1989
2182
|
labelHidden: a,
|
|
1990
|
-
type:
|
|
2183
|
+
type: p ? "password" : "text",
|
|
1991
2184
|
disabled: t,
|
|
1992
|
-
spacing:
|
|
1993
|
-
onBlur:
|
|
1994
|
-
onFocus:
|
|
1995
|
-
onChange:
|
|
2185
|
+
spacing: h,
|
|
2186
|
+
onBlur: fe,
|
|
2187
|
+
onFocus: y,
|
|
2188
|
+
onChange: $,
|
|
1996
2189
|
rightElement: K.cloneElement(d, {
|
|
1997
2190
|
ref: m,
|
|
1998
|
-
label:
|
|
1999
|
-
onClick:
|
|
2000
|
-
onBlur:
|
|
2191
|
+
label: C,
|
|
2192
|
+
onClick: V,
|
|
2193
|
+
onBlur: R,
|
|
2001
2194
|
disabled: t
|
|
2002
2195
|
}),
|
|
2003
2196
|
...u
|
|
2004
2197
|
}
|
|
2005
2198
|
),
|
|
2006
2199
|
/* @__PURE__ */ c(
|
|
2007
|
-
|
|
2200
|
+
kt,
|
|
2008
2201
|
{
|
|
2009
2202
|
role: "status",
|
|
2010
|
-
politeness:
|
|
2011
|
-
clearAnnouncementDelay:
|
|
2012
|
-
children:
|
|
2203
|
+
politeness: w.politeness,
|
|
2204
|
+
clearAnnouncementDelay: w.announcementTimeout,
|
|
2205
|
+
children: w.message
|
|
2013
2206
|
}
|
|
2014
2207
|
)
|
|
2015
2208
|
] });
|
|
2016
2209
|
}
|
|
2017
2210
|
);
|
|
2018
|
-
|
|
2211
|
+
Tt.displayName = "TextInputMask";
|
|
2019
2212
|
/*!
|
|
2020
2213
|
@versini/ui-form v1.3.5
|
|
2021
2214
|
© 2024 gizmette.com
|
|
@@ -2029,7 +2222,7 @@ try {
|
|
|
2029
2222
|
});
|
|
2030
2223
|
} catch {
|
|
2031
2224
|
}
|
|
2032
|
-
const
|
|
2225
|
+
const Na = (e) => {
|
|
2033
2226
|
let t = "";
|
|
2034
2227
|
if (typeof e == "number" || typeof e == "string")
|
|
2035
2228
|
t = "m-" + e;
|
|
@@ -2038,7 +2231,7 @@ const ya = (e) => {
|
|
|
2038
2231
|
(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(" ");
|
|
2039
2232
|
}
|
|
2040
2233
|
return t;
|
|
2041
|
-
},
|
|
2234
|
+
}, De = ({
|
|
2042
2235
|
children: e,
|
|
2043
2236
|
fill: t,
|
|
2044
2237
|
viewBox: r,
|
|
@@ -2050,11 +2243,11 @@ const ya = (e) => {
|
|
|
2050
2243
|
semantic: l = !1,
|
|
2051
2244
|
...d
|
|
2052
2245
|
}) => {
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2246
|
+
const h = Na(s), u = g(
|
|
2247
|
+
h,
|
|
2055
2248
|
a || o
|
|
2056
2249
|
);
|
|
2057
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ T(q, { children: [
|
|
2058
2251
|
/* @__PURE__ */ c(
|
|
2059
2252
|
"svg",
|
|
2060
2253
|
{
|
|
@@ -2085,13 +2278,13 @@ try {
|
|
|
2085
2278
|
});
|
|
2086
2279
|
} catch {
|
|
2087
2280
|
}
|
|
2088
|
-
const
|
|
2281
|
+
const Ca = ({
|
|
2089
2282
|
className: e,
|
|
2090
2283
|
viewBox: t,
|
|
2091
2284
|
spacing: r,
|
|
2092
2285
|
...a
|
|
2093
2286
|
}) => /* @__PURE__ */ c(
|
|
2094
|
-
|
|
2287
|
+
De,
|
|
2095
2288
|
{
|
|
2096
2289
|
defaultViewBox: "0 0 1200 500",
|
|
2097
2290
|
defaultClassName: "w-full",
|
|
@@ -2110,15 +2303,15 @@ const ba = ({
|
|
|
2110
2303
|
}
|
|
2111
2304
|
) })
|
|
2112
2305
|
}
|
|
2113
|
-
),
|
|
2306
|
+
), Ra = ({
|
|
2114
2307
|
className: e,
|
|
2115
2308
|
viewBox: t,
|
|
2116
2309
|
spacing: r,
|
|
2117
2310
|
title: a,
|
|
2118
2311
|
monotone: n,
|
|
2119
2312
|
...o
|
|
2120
|
-
}) => /* @__PURE__ */
|
|
2121
|
-
|
|
2313
|
+
}) => /* @__PURE__ */ T(
|
|
2314
|
+
De,
|
|
2122
2315
|
{
|
|
2123
2316
|
defaultViewBox: "0 0 640 512",
|
|
2124
2317
|
defaultClassName: "size-5",
|
|
@@ -2138,15 +2331,15 @@ const ba = ({
|
|
|
2138
2331
|
/* @__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" })
|
|
2139
2332
|
]
|
|
2140
2333
|
}
|
|
2141
|
-
),
|
|
2334
|
+
), Oa = ({
|
|
2142
2335
|
className: e,
|
|
2143
2336
|
viewBox: t,
|
|
2144
2337
|
spacing: r,
|
|
2145
2338
|
title: a,
|
|
2146
2339
|
monotone: n,
|
|
2147
2340
|
...o
|
|
2148
|
-
}) => /* @__PURE__ */
|
|
2149
|
-
|
|
2341
|
+
}) => /* @__PURE__ */ T(
|
|
2342
|
+
De,
|
|
2150
2343
|
{
|
|
2151
2344
|
defaultViewBox: "0 0 576 512",
|
|
2152
2345
|
defaultClassName: "size-5",
|
|
@@ -2180,7 +2373,7 @@ try {
|
|
|
2180
2373
|
});
|
|
2181
2374
|
} catch {
|
|
2182
2375
|
}
|
|
2183
|
-
const
|
|
2376
|
+
const Da = (e) => {
|
|
2184
2377
|
let t = "";
|
|
2185
2378
|
if (typeof e == "number" || typeof e == "string")
|
|
2186
2379
|
t = "m-" + e;
|
|
@@ -2189,10 +2382,10 @@ const va = (e) => {
|
|
|
2189
2382
|
(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(" ");
|
|
2190
2383
|
}
|
|
2191
2384
|
return t;
|
|
2192
|
-
},
|
|
2385
|
+
}, $a = "av-flexgrid", se = "av-flexgrid-item", ue = 0.25, At = K.createContext({
|
|
2193
2386
|
columnGap: 0,
|
|
2194
2387
|
rowGap: 0
|
|
2195
|
-
}),
|
|
2388
|
+
}), Ma = ({
|
|
2196
2389
|
children: e,
|
|
2197
2390
|
className: t,
|
|
2198
2391
|
columnGap: r = 1,
|
|
@@ -2203,7 +2396,7 @@ const va = (e) => {
|
|
|
2203
2396
|
alignHorizontal: i = "normal",
|
|
2204
2397
|
alignVertical: l = "normal",
|
|
2205
2398
|
spacing: d,
|
|
2206
|
-
...
|
|
2399
|
+
...h
|
|
2207
2400
|
}) => {
|
|
2208
2401
|
const u = {
|
|
2209
2402
|
flexDirection: s,
|
|
@@ -2216,14 +2409,14 @@ const va = (e) => {
|
|
|
2216
2409
|
* by the columnGap and rowGap that will be applied
|
|
2217
2410
|
* to all FlexgridItems (see context and paddings).
|
|
2218
2411
|
*/
|
|
2219
|
-
marginLeft: r * -1 *
|
|
2220
|
-
marginTop: a * -1 *
|
|
2412
|
+
marginLeft: r * -1 * ue + "rem",
|
|
2413
|
+
marginTop: a * -1 * ue + "rem"
|
|
2221
2414
|
}, m = g(
|
|
2222
|
-
|
|
2415
|
+
$a,
|
|
2223
2416
|
t,
|
|
2224
2417
|
"box-border flex flex-wrap"
|
|
2225
|
-
),
|
|
2226
|
-
return /* @__PURE__ */ c(f, { ...d ? { className:
|
|
2418
|
+
), p = { columnGap: r, rowGap: a }, f = d ? "div" : K.Fragment;
|
|
2419
|
+
return /* @__PURE__ */ c(f, { ...d ? { className: Da(d) } : {}, children: /* @__PURE__ */ c("div", { className: m, style: u, ...h, children: /* @__PURE__ */ c(At.Provider, { value: p, children: e }) }) });
|
|
2227
2420
|
}, Ae = (e, t) => g({
|
|
2228
2421
|
"basis-1/12": e === 1 && !t,
|
|
2229
2422
|
"sm:basis-1/12": e === 1 && t === "sm",
|
|
@@ -2297,39 +2490,39 @@ const va = (e) => {
|
|
|
2297
2490
|
"lg:basis-full": e === 12 && t === "lg",
|
|
2298
2491
|
"xl:basis-full": e === 12 && t === "xl",
|
|
2299
2492
|
"2xl:basis-full": e === 12 && t === "2xl"
|
|
2300
|
-
}),
|
|
2493
|
+
}), La = ({
|
|
2301
2494
|
className: e,
|
|
2302
2495
|
span: t
|
|
2303
2496
|
}) => {
|
|
2304
2497
|
if (!t)
|
|
2305
|
-
return g(e,
|
|
2498
|
+
return g(e, se, "box-border basis-auto");
|
|
2306
2499
|
if (typeof t == "number")
|
|
2307
|
-
return g(e,
|
|
2500
|
+
return g(e, se, "box-border max-w-full", {
|
|
2308
2501
|
[`${Ae(t)}`]: !0
|
|
2309
2502
|
});
|
|
2310
2503
|
if (typeof t == "string")
|
|
2311
|
-
return g(e,
|
|
2504
|
+
return g(e, se, "box-border basis-auto", {
|
|
2312
2505
|
"max-w-full grow": t === "auto"
|
|
2313
2506
|
});
|
|
2314
2507
|
if (typeof t == "object") {
|
|
2315
2508
|
const r = Object.entries(t).map(([a, n]) => a === "fallback" ? Ae(n) : Ae(n, a));
|
|
2316
2509
|
return g(
|
|
2317
2510
|
e,
|
|
2318
|
-
|
|
2511
|
+
se,
|
|
2319
2512
|
"box-border",
|
|
2320
2513
|
r
|
|
2321
2514
|
);
|
|
2322
2515
|
}
|
|
2323
|
-
},
|
|
2516
|
+
}, ie = ({
|
|
2324
2517
|
children: e,
|
|
2325
2518
|
className: t,
|
|
2326
2519
|
span: r,
|
|
2327
2520
|
...a
|
|
2328
2521
|
}) => {
|
|
2329
|
-
const { columnGap: n, rowGap: o } =
|
|
2330
|
-
paddingLeft: n *
|
|
2331
|
-
paddingTop: o *
|
|
2332
|
-
}, i =
|
|
2522
|
+
const { columnGap: n, rowGap: o } = Ze(At), s = {
|
|
2523
|
+
paddingLeft: n * ue + "rem",
|
|
2524
|
+
paddingTop: o * ue + "rem"
|
|
2525
|
+
}, i = La({
|
|
2333
2526
|
className: t,
|
|
2334
2527
|
span: r
|
|
2335
2528
|
});
|
|
@@ -2348,7 +2541,7 @@ try {
|
|
|
2348
2541
|
});
|
|
2349
2542
|
} catch {
|
|
2350
2543
|
}
|
|
2351
|
-
const
|
|
2544
|
+
const Pa = "ASK! ME! ANYTHING!", _t = "Sassy Saint", Ua = "gizmette.com", Ha = "Log in", Vn = "Log out", Ka = "Password", Ba = "Powered by OpenAI", Jn = "Send", Fn = "Profile", zn = "Statistics", Yn = "Chat history", qn = "About", Qn = "Type your question here", Xn = "Clear chat", Zn = "Cancel chat", eo = "N/A", to = {
|
|
2352
2545
|
PREFERENCES: {
|
|
2353
2546
|
TITLE: "User preferences",
|
|
2354
2547
|
NAME: "Name",
|
|
@@ -2380,215 +2573,44 @@ const Aa = "ASK! ME! ANYTHING!", Tt = "Sassy Saint", _a = "gizmette.com", Ia = "
|
|
|
2380
2573
|
ENGINE: "OpenAI model",
|
|
2381
2574
|
PLUGIN: "Plugin"
|
|
2382
2575
|
}
|
|
2383
|
-
},
|
|
2384
|
-
function Ca(e) {
|
|
2385
|
-
return {
|
|
2386
|
-
days: Math.trunc(e / 864e5),
|
|
2387
|
-
hours: Math.trunc(e / 36e5 % 24),
|
|
2388
|
-
minutes: Math.trunc(e / 6e4 % 60),
|
|
2389
|
-
seconds: Math.trunc(e / 1e3 % 60),
|
|
2390
|
-
milliseconds: Math.trunc(e % 1e3),
|
|
2391
|
-
microseconds: Math.trunc(Qe(e * 1e3) % 1e3),
|
|
2392
|
-
nanoseconds: Math.trunc(Qe(e * 1e6) % 1e3)
|
|
2393
|
-
};
|
|
2394
|
-
}
|
|
2395
|
-
function Ra(e) {
|
|
2396
|
-
return {
|
|
2397
|
-
days: e / 86400000n,
|
|
2398
|
-
hours: e / 3600000n % 24n,
|
|
2399
|
-
minutes: e / 60000n % 60n,
|
|
2400
|
-
seconds: e / 1000n % 60n,
|
|
2401
|
-
milliseconds: e % 1000n,
|
|
2402
|
-
microseconds: 0n,
|
|
2403
|
-
nanoseconds: 0n
|
|
2404
|
-
};
|
|
2405
|
-
}
|
|
2406
|
-
function Oa(e) {
|
|
2407
|
-
switch (typeof e) {
|
|
2408
|
-
case "number": {
|
|
2409
|
-
if (Number.isFinite(e))
|
|
2410
|
-
return Ca(e);
|
|
2411
|
-
break;
|
|
2412
|
-
}
|
|
2413
|
-
case "bigint":
|
|
2414
|
-
return Ra(e);
|
|
2415
|
-
}
|
|
2416
|
-
throw new TypeError("Expected a finite number or bigint");
|
|
2417
|
-
}
|
|
2418
|
-
const Da = (e) => e === 0 || e === 0n, Ma = (e, t) => t === 1 || t === 1n ? e : `${e}s`, $a = 1e-7, La = 24n * 60n * 60n * 1000n;
|
|
2419
|
-
function Pa(e, t) {
|
|
2420
|
-
const r = typeof e == "bigint";
|
|
2421
|
-
if (!r && !Number.isFinite(e))
|
|
2422
|
-
throw new TypeError("Expected a finite number or bigint");
|
|
2423
|
-
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);
|
|
2424
|
-
let a = [];
|
|
2425
|
-
const n = (d, p) => {
|
|
2426
|
-
const u = Math.floor(d * 10 ** p + $a);
|
|
2427
|
-
return (Math.round(u) / 10 ** p).toFixed(p);
|
|
2428
|
-
}, o = (d, p, u, m) => {
|
|
2429
|
-
if (!((a.length === 0 || !t.colonNotation) && Da(d) && !(t.colonNotation && u === "m"))) {
|
|
2430
|
-
if (m = m ?? String(d), t.colonNotation) {
|
|
2431
|
-
const h = m.includes(".") ? m.split(".")[0].length : m.length, f = a.length > 0 ? 2 : 1;
|
|
2432
|
-
m = "0".repeat(Math.max(0, f - h)) + m;
|
|
2433
|
-
} else
|
|
2434
|
-
m += t.verbose ? " " + Ma(p, d) : u;
|
|
2435
|
-
a.push(m);
|
|
2436
|
-
}
|
|
2437
|
-
}, s = Oa(e), i = BigInt(s.days);
|
|
2438
|
-
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) {
|
|
2439
|
-
const d = Number(s.seconds), p = Number(s.milliseconds), u = Number(s.microseconds), m = Number(s.nanoseconds);
|
|
2440
|
-
if (o(d, "second", "s"), t.formatSubMilliseconds)
|
|
2441
|
-
o(p, "millisecond", "ms"), o(u, "microsecond", "µs"), o(m, "nanosecond", "ns");
|
|
2442
|
-
else {
|
|
2443
|
-
const h = p + u / 1e3 + m / 1e6, f = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, b = h >= 1 ? Math.round(h) : Math.ceil(h), R = f ? h.toFixed(f) : b;
|
|
2444
|
-
o(
|
|
2445
|
-
Number.parseFloat(R),
|
|
2446
|
-
"millisecond",
|
|
2447
|
-
"ms",
|
|
2448
|
-
R
|
|
2449
|
-
);
|
|
2450
|
-
}
|
|
2451
|
-
} else {
|
|
2452
|
-
const d = (r ? Number(e % La) : e) / 1e3 % 60, p = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, u = n(d, p), m = t.keepDecimalsOnWholeSeconds ? u : u.replace(/\.0+$/, "");
|
|
2453
|
-
o(Number.parseFloat(m), "second", "s", m);
|
|
2454
|
-
}
|
|
2455
|
-
if (a.length === 0)
|
|
2456
|
-
return "0" + (t.verbose ? " milliseconds" : "ms");
|
|
2457
|
-
const l = t.colonNotation ? ":" : " ";
|
|
2458
|
-
return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), a.join(l);
|
|
2459
|
-
}
|
|
2460
|
-
const Ua = process.env.NODE_ENV === "production", At = !Ua, Gn = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, _t = (e, t) => {
|
|
2461
|
-
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;
|
|
2462
|
-
return {
|
|
2463
|
-
dir: r,
|
|
2464
|
-
deg: a,
|
|
2465
|
-
min: n,
|
|
2466
|
-
sec: o
|
|
2467
|
-
};
|
|
2468
|
-
}, Vn = (e) => {
|
|
2469
|
-
if (!e && e !== 0)
|
|
2470
|
-
return "N/A";
|
|
2471
|
-
const t = _t(e, !1);
|
|
2472
|
-
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
2473
|
-
}, Jn = (e) => {
|
|
2474
|
-
if (!e && e !== 0)
|
|
2475
|
-
return "N/A";
|
|
2476
|
-
const t = _t(e, !0);
|
|
2477
|
-
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
2478
|
-
}, Fn = async () => {
|
|
2479
|
-
const e = {
|
|
2480
|
-
/**
|
|
2481
|
-
* A boolean value that indicates the application would
|
|
2482
|
-
* like to receive the best possible results. If true
|
|
2483
|
-
* and if the device is able to provide a more accurate
|
|
2484
|
-
* position, it will do so. Note that this can result in
|
|
2485
|
-
* slower response times or increased power consumption
|
|
2486
|
-
* (with a GPS chip on a mobile device for example). On
|
|
2487
|
-
* the other hand, if false, the device can take the
|
|
2488
|
-
* liberty to save resources by responding more quickly
|
|
2489
|
-
* and/or using less power. Default: false.
|
|
2490
|
-
*/
|
|
2491
|
-
enableHighAccuracy: !1,
|
|
2492
|
-
/**
|
|
2493
|
-
* A positive long value representing the maximum length
|
|
2494
|
-
* of time (in milliseconds) the device is allowed to
|
|
2495
|
-
* take in order to return a position. The default value
|
|
2496
|
-
* is Infinity, meaning that getCurrentPosition() won't
|
|
2497
|
-
* return until the position is available.
|
|
2498
|
-
*/
|
|
2499
|
-
timeout: 1e4,
|
|
2500
|
-
/**
|
|
2501
|
-
* A positive long value indicating the maximum age in
|
|
2502
|
-
* milliseconds of a possible cached position that is
|
|
2503
|
-
* acceptable to return. If set to 0, it means that the
|
|
2504
|
-
* device cannot use a cached position and must attempt
|
|
2505
|
-
* to retrieve the real current position. If set to
|
|
2506
|
-
* Infinity the device must return a cached position
|
|
2507
|
-
* regardless of its age. Default: 0.
|
|
2508
|
-
*/
|
|
2509
|
-
maximumAge: 6e4
|
|
2510
|
-
};
|
|
2511
|
-
return new Promise((t, r) => {
|
|
2512
|
-
var a;
|
|
2513
|
-
(a = navigator == null ? void 0 : navigator.geolocation) == null || a.getCurrentPosition(
|
|
2514
|
-
(n) => {
|
|
2515
|
-
t({
|
|
2516
|
-
latitude: n.coords.latitude,
|
|
2517
|
-
longitude: n.coords.longitude,
|
|
2518
|
-
accuracy: n.coords.accuracy
|
|
2519
|
-
});
|
|
2520
|
-
},
|
|
2521
|
-
(n) => {
|
|
2522
|
-
r(n);
|
|
2523
|
-
},
|
|
2524
|
-
e
|
|
2525
|
-
);
|
|
2526
|
-
});
|
|
2527
|
-
}, zn = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ S("div", { className: "flex items-center justify-between", children: [
|
|
2528
|
-
/* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
|
|
2529
|
-
/* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
|
|
2530
|
-
] }) }, `${e}-${r}`)) : null;
|
|
2531
|
-
function Yn({
|
|
2532
|
-
data: e,
|
|
2533
|
-
formatter: t = (r) => r
|
|
2534
|
-
}) {
|
|
2535
|
-
const r = e.filter(
|
|
2536
|
-
(n) => typeof n == "number" && n > 0
|
|
2537
|
-
), a = r.reduce(
|
|
2538
|
-
(n, o) => (n || 0) + (o || 0),
|
|
2539
|
-
0
|
|
2540
|
-
);
|
|
2541
|
-
return t(a ? a / r.length : 0);
|
|
2542
|
-
}
|
|
2543
|
-
const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Qn = new Intl.NumberFormat("en", {
|
|
2544
|
-
style: "decimal",
|
|
2545
|
-
signDisplay: "never",
|
|
2546
|
-
minimumFractionDigits: 0,
|
|
2547
|
-
maximumFractionDigits: 0
|
|
2548
|
-
}), Xn = (e) => Pa(e, {
|
|
2549
|
-
secondsDecimalDigits: 2,
|
|
2550
|
-
unitCount: 2
|
|
2551
|
-
}), Ha = (e) => g(
|
|
2552
|
-
"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",
|
|
2553
|
-
e || At ? "pt-4" : "pt-10"
|
|
2554
|
-
), Zn = (e, t) => t === 1 ? e : `${e}s`, Ka = ({
|
|
2576
|
+
}, Wa = ({
|
|
2555
2577
|
serverStats: e
|
|
2556
2578
|
}) => /* @__PURE__ */ c(
|
|
2557
|
-
|
|
2579
|
+
da,
|
|
2558
2580
|
{
|
|
2559
2581
|
mode: "light",
|
|
2560
|
-
row1: /* @__PURE__ */
|
|
2561
|
-
|
|
2582
|
+
row1: /* @__PURE__ */ T("div", { children: [
|
|
2583
|
+
_t,
|
|
2562
2584
|
" v",
|
|
2563
|
-
"3.
|
|
2585
|
+
"3.2.1",
|
|
2564
2586
|
" - ",
|
|
2565
|
-
|
|
2566
|
-
|
|
2587
|
+
Ba,
|
|
2588
|
+
Ne && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
|
|
2567
2589
|
] }),
|
|
2568
|
-
row2: /* @__PURE__ */
|
|
2590
|
+
row2: /* @__PURE__ */ T("div", { children: [
|
|
2569
2591
|
"© ",
|
|
2570
2592
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
2571
2593
|
" ",
|
|
2572
|
-
|
|
2594
|
+
Ua
|
|
2573
2595
|
] })
|
|
2574
2596
|
}
|
|
2575
|
-
),
|
|
2597
|
+
), ja = et(() => import("./LazyHeader.D3qbUck7.js")), Ga = () => {
|
|
2576
2598
|
const { isAuthenticated: e } = xe();
|
|
2577
|
-
return /* @__PURE__ */
|
|
2578
|
-
e && /* @__PURE__ */ c(
|
|
2579
|
-
/* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(
|
|
2581
|
-
/* @__PURE__ */
|
|
2582
|
-
/* @__PURE__ */ c("h1", { children:
|
|
2583
|
-
/* @__PURE__ */ c("h2", { children:
|
|
2599
|
+
return /* @__PURE__ */ T(q, { children: [
|
|
2600
|
+
e && /* @__PURE__ */ c(tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(ja, {}) }),
|
|
2601
|
+
/* @__PURE__ */ T("div", { className: "flex items-center justify-center", children: [
|
|
2602
|
+
/* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(Ca, {}) }),
|
|
2603
|
+
/* @__PURE__ */ T("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
|
|
2604
|
+
/* @__PURE__ */ c("h1", { children: _t }),
|
|
2605
|
+
/* @__PURE__ */ c("h2", { children: Pa })
|
|
2584
2606
|
] })
|
|
2585
2607
|
] })
|
|
2586
2608
|
] });
|
|
2587
|
-
},
|
|
2609
|
+
}, Va = () => {
|
|
2588
2610
|
const { login: e, logoutReason: t } = xe(), [r, a] = U(""), [n, o] = U(""), [s, i] = U(!0), [l, d] = U({
|
|
2589
2611
|
username: "",
|
|
2590
2612
|
password: ""
|
|
2591
|
-
}),
|
|
2613
|
+
}), h = async (u) => {
|
|
2592
2614
|
u.preventDefault(), await e(
|
|
2593
2615
|
l.username,
|
|
2594
2616
|
l.password,
|
|
@@ -2603,13 +2625,13 @@ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2603
2625
|
}, 500);
|
|
2604
2626
|
}), z(() => {
|
|
2605
2627
|
t && o(t);
|
|
2606
|
-
}, [t]), /* @__PURE__ */
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */ c("div", { className:
|
|
2609
|
-
/* @__PURE__ */ c("form", { className: "mx-auto mt-5", onSubmit:
|
|
2610
|
-
/* @__PURE__ */ c(
|
|
2611
|
-
/* @__PURE__ */ c(
|
|
2612
|
-
|
|
2628
|
+
}, [t]), /* @__PURE__ */ T(q, { children: [
|
|
2629
|
+
/* @__PURE__ */ T(ua, { children: [
|
|
2630
|
+
/* @__PURE__ */ c("div", { className: Zr(), children: /* @__PURE__ */ c(Ga, {}) }),
|
|
2631
|
+
/* @__PURE__ */ c("form", { className: "mx-auto mt-5", onSubmit: h, children: /* @__PURE__ */ T(Ma, { rowGap: 7, width: "350px", children: [
|
|
2632
|
+
/* @__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 }) }),
|
|
2633
|
+
/* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
|
|
2634
|
+
Oe,
|
|
2613
2635
|
{
|
|
2614
2636
|
required: !0,
|
|
2615
2637
|
autoCapitalize: "off",
|
|
@@ -2628,8 +2650,8 @@ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2628
2650
|
error: r !== ""
|
|
2629
2651
|
}
|
|
2630
2652
|
) }),
|
|
2631
|
-
/* @__PURE__ */ c(
|
|
2632
|
-
|
|
2653
|
+
/* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
|
|
2654
|
+
Tt,
|
|
2633
2655
|
{
|
|
2634
2656
|
required: !0,
|
|
2635
2657
|
autoCapitalize: "off",
|
|
@@ -2638,8 +2660,8 @@ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2638
2660
|
mode: "dark",
|
|
2639
2661
|
focusMode: "light",
|
|
2640
2662
|
name: "password",
|
|
2641
|
-
label:
|
|
2642
|
-
rightElement: /* @__PURE__ */ c(
|
|
2663
|
+
label: Ka,
|
|
2664
|
+
rightElement: /* @__PURE__ */ c(bt, { focusMode: "light", children: s ? /* @__PURE__ */ c(Oa, {}) : /* @__PURE__ */ c(Ra, {}) }),
|
|
2643
2665
|
onMaskChange: i,
|
|
2644
2666
|
onChange: (u) => {
|
|
2645
2667
|
d({
|
|
@@ -2651,99 +2673,100 @@ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2651
2673
|
helperText: r
|
|
2652
2674
|
}
|
|
2653
2675
|
) }),
|
|
2654
|
-
/* @__PURE__ */ c(
|
|
2655
|
-
|
|
2676
|
+
/* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
|
|
2677
|
+
wt,
|
|
2656
2678
|
{
|
|
2657
2679
|
focusMode: "light",
|
|
2658
2680
|
fullWidth: !0,
|
|
2659
2681
|
noBorder: !0,
|
|
2660
2682
|
type: "submit",
|
|
2661
2683
|
className: "mb-4 mt-6",
|
|
2662
|
-
children:
|
|
2684
|
+
children: Ha
|
|
2663
2685
|
}
|
|
2664
2686
|
) })
|
|
2665
2687
|
] }) })
|
|
2666
2688
|
] }),
|
|
2667
|
-
/* @__PURE__ */ c(
|
|
2689
|
+
/* @__PURE__ */ c(Wa, {})
|
|
2668
2690
|
] });
|
|
2669
|
-
},
|
|
2691
|
+
}, Ja = et(() => import("./App.pFoMWtnP.js").then((e) => e.App)), Fa = ({ isComponent: e }) => {
|
|
2670
2692
|
const { isAuthenticated: t } = xe();
|
|
2671
|
-
return t ? /* @__PURE__ */ c(
|
|
2672
|
-
},
|
|
2673
|
-
isComponent: e = !1
|
|
2674
|
-
|
|
2693
|
+
return t ? /* @__PURE__ */ c(tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Ja, { isComponent: e }) }) : /* @__PURE__ */ c(Va, {});
|
|
2694
|
+
}, za = ({
|
|
2695
|
+
isComponent: e = !1,
|
|
2696
|
+
domain: t = Xr
|
|
2697
|
+
}) => /* @__PURE__ */ c(q, { children: /* @__PURE__ */ c(Br, { clientId: Wr, domain: t, children: /* @__PURE__ */ c(Fa, { isComponent: e }) }) }), ro = ({ domain: e }) => /* @__PURE__ */ c(za, { isComponent: !0, domain: e });
|
|
2675
2698
|
export {
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2699
|
+
yt as A,
|
|
2700
|
+
qn as ABOUT_TITLE,
|
|
2701
|
+
gn as ACTION_LOCATION,
|
|
2702
|
+
un as ACTION_MESSAGE,
|
|
2703
|
+
hn as ACTION_MODEL,
|
|
2704
|
+
mn as ACTION_RESET,
|
|
2705
|
+
pn as ACTION_RESTORE,
|
|
2706
|
+
yn as ACTION_SEARCH,
|
|
2707
|
+
bn as ACTION_SORT,
|
|
2708
|
+
fn as ACTION_STREAMING,
|
|
2709
|
+
Wa as AppFooter,
|
|
2710
|
+
Zn as CANCEL,
|
|
2711
|
+
to as CARDS,
|
|
2712
|
+
Xn as CLEAR,
|
|
2713
|
+
Ln as E,
|
|
2714
|
+
cn as ERROR_MESSAGE,
|
|
2715
|
+
Oe as G,
|
|
2716
|
+
dn as GPT4_MAX_TOKENS,
|
|
2717
|
+
Yn as HISTORY_TITLE,
|
|
2718
|
+
En as LOCAL_STORAGE_CHAT_DETAILS,
|
|
2719
|
+
Sn as LOCAL_STORAGE_LOCATION,
|
|
2720
|
+
wn as LOCAL_STORAGE_PREFIX,
|
|
2721
|
+
vn as LOCAL_STORAGE_SEARCH,
|
|
2722
|
+
kn as LOCAL_STORAGE_SORT,
|
|
2723
|
+
Vn as LOG_OUT,
|
|
2724
|
+
ha as M,
|
|
2725
|
+
ln as MODEL_GPT4,
|
|
2726
|
+
Ga as MessagesContainerHeader,
|
|
2727
|
+
Pn as N,
|
|
2728
|
+
eo as NA,
|
|
2729
|
+
bt as O,
|
|
2730
|
+
Fn as PROFILE_TITLE,
|
|
2731
|
+
an as ROLE_ASSISTANT,
|
|
2732
|
+
sn as ROLE_HIDDEN,
|
|
2733
|
+
on as ROLE_INTERNAL,
|
|
2734
|
+
nn as ROLE_SYSTEM,
|
|
2735
|
+
rn as ROLE_USER,
|
|
2736
|
+
Ce as S,
|
|
2737
|
+
Jn as SEND,
|
|
2738
|
+
zn as STATS,
|
|
2739
|
+
Tn as STATS_SEPARATOR,
|
|
2740
|
+
ro as SassySaint,
|
|
2741
|
+
Qn as TYPE_QUESTION,
|
|
2742
|
+
kt as U,
|
|
2743
|
+
Wn as a,
|
|
2744
|
+
Ma as b,
|
|
2745
|
+
ua as c,
|
|
2746
|
+
Hn as c$1,
|
|
2747
|
+
_n as convertLatitudeToDMS,
|
|
2748
|
+
In as convertLongitudeToDMS,
|
|
2749
|
+
xe as dr,
|
|
2750
|
+
Dn as durationFormatter,
|
|
2751
|
+
Cn as extractAverage,
|
|
2752
|
+
gt as f,
|
|
2753
|
+
ma as f$1,
|
|
2754
|
+
De as g,
|
|
2755
|
+
xn as getCurrentGeoLocation,
|
|
2756
|
+
Zr as getMessageContaintWrapperClass,
|
|
2757
|
+
Re as i,
|
|
2758
|
+
Un as i$1,
|
|
2759
|
+
Rn as isLastMessageFromRole,
|
|
2760
|
+
ie as j,
|
|
2761
|
+
jn as l,
|
|
2762
|
+
Kn as n,
|
|
2763
|
+
On as numberFormatter,
|
|
2764
|
+
ba as o,
|
|
2765
|
+
Gn as p,
|
|
2766
|
+
$n as pluralize,
|
|
2767
|
+
Bn as r,
|
|
2768
|
+
Nn as renderDataAsList,
|
|
2769
|
+
Mn as s,
|
|
2770
|
+
An as truncate,
|
|
2771
|
+
wt as x
|
|
2749
2772
|
};
|