@versini/sassysaint 1.0.3 → 1.0.4
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.pFoMWtnP.js → App.llFW8bC9.js} +54 -54
- package/dist/chunks/{LazyHeader.D3qbUck7.js → LazyHeader.DioQirr-.js} +5 -5
- package/dist/chunks/{LazyMarkdownWithExtra.BruyCOAi.js → LazyMarkdownWithExtra.BaT61Fa1.js} +1 -1
- package/dist/chunks/{LazyMessageAssistant.Dm0Ytsu1.js → LazyMessageAssistant.B7gvwGML.js} +4 -4
- package/dist/chunks/{index.DruzEDnN.9U25cgur.js → index.DruzEDnN.CBkxdLma.js} +1 -1
- package/dist/chunks/{index.B6xSbzQS.js → index.zwPPEvIR.js} +575 -570
- package/dist/chunks/{useLocalStorage.D6vdElMS.js → useLocalStorage.BhJXBYm7.js} +1 -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 -3
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsx as c, jsxs as T, Fragment as q } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
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";
|
|
2
|
+
import B, { createContext as xt, useRef as j, useState as H, useCallback as z, useEffect as V, useContext as Xe, useSyncExternalStore as Nt, useMemo as Ct, useId as Rt, useReducer as Ot, useLayoutEffect as Dt, lazy as Ze, Suspense as et } from "react";
|
|
4
3
|
import g from "clsx";
|
|
5
|
-
var
|
|
4
|
+
var Mt = Object.defineProperty, Lt = (e, t, r) => t in e ? Mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ye = (e, t, r) => Lt(e, typeof t != "symbol" ? t + "" : t, r);
|
|
6
5
|
/*!
|
|
7
|
-
@versini/auth-provider v5.1.
|
|
6
|
+
@versini/auth-provider v5.1.3
|
|
8
7
|
© 2024 gizmette.com
|
|
9
8
|
*/
|
|
10
9
|
try {
|
|
11
10
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
12
|
-
version: "5.1.
|
|
13
|
-
buildTime: "07/
|
|
11
|
+
version: "5.1.3",
|
|
12
|
+
buildTime: "07/09/2024 03:32 PM EDT",
|
|
14
13
|
homepage: "https://github.com/aversini/auth-client",
|
|
15
14
|
license: "MIT"
|
|
16
15
|
});
|
|
@@ -23,7 +22,7 @@ try {
|
|
|
23
22
|
try {
|
|
24
23
|
window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
|
|
25
24
|
version: "2.11.0",
|
|
26
|
-
buildTime: "07/
|
|
25
|
+
buildTime: "07/09/2024 03:32 PM EDT",
|
|
27
26
|
homepage: "https://github.com/aversini/auth-client",
|
|
28
27
|
license: "MIT"
|
|
29
28
|
});
|
|
@@ -35,16 +34,16 @@ const Q = {
|
|
|
35
34
|
ID_AND_ACCESS_TOKEN: "id_token token",
|
|
36
35
|
CODE: "code",
|
|
37
36
|
REFRESH_TOKEN: "refresh_token"
|
|
38
|
-
},
|
|
37
|
+
}, Pt = {
|
|
39
38
|
CLIENT_ID: "X-Auth-ClientId"
|
|
40
|
-
},
|
|
39
|
+
}, _ = {
|
|
41
40
|
ALG: "RS256",
|
|
42
41
|
USER_ID_KEY: "sub",
|
|
43
42
|
TOKEN_ID_KEY: "__raw",
|
|
44
43
|
NONCE_KEY: "_nonce",
|
|
45
44
|
USERNAME_KEY: "username",
|
|
46
45
|
ISSUER: "gizmette.com"
|
|
47
|
-
},
|
|
46
|
+
}, $t = `-----BEGIN PUBLIC KEY-----
|
|
48
47
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
|
|
49
48
|
w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
|
|
50
49
|
i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
|
|
@@ -56,15 +55,15 @@ awIDAQAB
|
|
|
56
55
|
AUTHENTICATE: "authenticate",
|
|
57
56
|
CODE: "code",
|
|
58
57
|
LOGOUT: "logout"
|
|
59
|
-
}, he = crypto,
|
|
60
|
-
function
|
|
58
|
+
}, he = crypto, tt = (e) => e instanceof CryptoKey, X = new TextEncoder(), pe = new TextDecoder();
|
|
59
|
+
function Ut(...e) {
|
|
61
60
|
const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
|
|
62
61
|
let a = 0;
|
|
63
62
|
for (const n of e)
|
|
64
63
|
r.set(n, a), a += n.length;
|
|
65
64
|
return r;
|
|
66
65
|
}
|
|
67
|
-
const
|
|
66
|
+
const Ht = (e) => {
|
|
68
67
|
const t = atob(e), r = new Uint8Array(t.length);
|
|
69
68
|
for (let a = 0; a < t.length; a++)
|
|
70
69
|
r[a] = t.charCodeAt(a);
|
|
@@ -73,12 +72,12 @@ const Ut = (e) => {
|
|
|
73
72
|
let t = e;
|
|
74
73
|
t instanceof Uint8Array && (t = pe.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
75
74
|
try {
|
|
76
|
-
return
|
|
75
|
+
return Ht(t);
|
|
77
76
|
} catch {
|
|
78
77
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
79
78
|
}
|
|
80
79
|
};
|
|
81
|
-
|
|
80
|
+
class G extends Error {
|
|
82
81
|
static get code() {
|
|
83
82
|
return "ERR_JOSE_GENERIC";
|
|
84
83
|
}
|
|
@@ -86,7 +85,8 @@ let j = class extends Error {
|
|
|
86
85
|
var r;
|
|
87
86
|
super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
|
|
88
87
|
}
|
|
89
|
-
}
|
|
88
|
+
}
|
|
89
|
+
let L = class extends G {
|
|
90
90
|
static get code() {
|
|
91
91
|
return "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ let j = 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 Le extends
|
|
97
|
+
class Le extends G {
|
|
98
98
|
static get code() {
|
|
99
99
|
return "ERR_JWT_EXPIRED";
|
|
100
100
|
}
|
|
@@ -102,7 +102,7 @@ class Le extends j {
|
|
|
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 Kt extends G {
|
|
106
106
|
constructor() {
|
|
107
107
|
super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
108
108
|
}
|
|
@@ -110,30 +110,29 @@ class Ht extends j {
|
|
|
110
110
|
return "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
let
|
|
113
|
+
let K = class extends G {
|
|
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
|
-
},
|
|
120
|
+
}, S = class extends G {
|
|
121
121
|
constructor() {
|
|
122
122
|
super(...arguments), this.code = "ERR_JWS_INVALID";
|
|
123
123
|
}
|
|
124
124
|
static get code() {
|
|
125
125
|
return "ERR_JWS_INVALID";
|
|
126
126
|
}
|
|
127
|
-
}
|
|
128
|
-
class at extends j {
|
|
127
|
+
}, rt = class extends G {
|
|
129
128
|
constructor() {
|
|
130
129
|
super(...arguments), this.code = "ERR_JWT_INVALID";
|
|
131
130
|
}
|
|
132
131
|
static get code() {
|
|
133
132
|
return "ERR_JWT_INVALID";
|
|
134
133
|
}
|
|
135
|
-
}
|
|
136
|
-
class
|
|
134
|
+
};
|
|
135
|
+
class Bt extends G {
|
|
137
136
|
constructor() {
|
|
138
137
|
super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
|
|
139
138
|
}
|
|
@@ -141,7 +140,7 @@ class Kt extends j {
|
|
|
141
140
|
return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
|
-
function
|
|
143
|
+
function P(e, t = "algorithm.name") {
|
|
145
144
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
|
146
145
|
}
|
|
147
146
|
function Z(e, t) {
|
|
@@ -150,7 +149,7 @@ function Z(e, t) {
|
|
|
150
149
|
function be(e) {
|
|
151
150
|
return parseInt(e.name.slice(4), 10);
|
|
152
151
|
}
|
|
153
|
-
function
|
|
152
|
+
function Wt(e) {
|
|
154
153
|
switch (e) {
|
|
155
154
|
case "ES256":
|
|
156
155
|
return "P-256";
|
|
@@ -162,83 +161,81 @@ function Bt(e) {
|
|
|
162
161
|
throw new Error("unreachable");
|
|
163
162
|
}
|
|
164
163
|
}
|
|
165
|
-
function
|
|
164
|
+
function jt(e, t) {
|
|
166
165
|
if (t.length && !t.some((r) => e.usages.includes(r))) {
|
|
167
166
|
let r = "CryptoKey does not support this operation, its usages must include ";
|
|
168
167
|
if (t.length > 2) {
|
|
169
168
|
const a = t.pop();
|
|
170
169
|
r += `one of ${t.join(", ")}, or ${a}.`;
|
|
171
|
-
} else
|
|
172
|
-
t.length === 2 ? r += `one of ${t[0]} or ${t[1]}.` : r += `${t[0]}.`;
|
|
170
|
+
} else t.length === 2 ? r += `one of ${t[0]} or ${t[1]}.` : r += `${t[0]}.`;
|
|
173
171
|
throw new TypeError(r);
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
|
-
function
|
|
174
|
+
function Gt(e, t, ...r) {
|
|
177
175
|
switch (t) {
|
|
178
176
|
case "HS256":
|
|
179
177
|
case "HS384":
|
|
180
178
|
case "HS512": {
|
|
181
179
|
if (!Z(e.algorithm, "HMAC"))
|
|
182
|
-
throw
|
|
180
|
+
throw P("HMAC");
|
|
183
181
|
const a = parseInt(t.slice(2), 10);
|
|
184
182
|
if (be(e.algorithm.hash) !== a)
|
|
185
|
-
throw
|
|
183
|
+
throw P(`SHA-${a}`, "algorithm.hash");
|
|
186
184
|
break;
|
|
187
185
|
}
|
|
188
186
|
case "RS256":
|
|
189
187
|
case "RS384":
|
|
190
188
|
case "RS512": {
|
|
191
189
|
if (!Z(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
192
|
-
throw
|
|
190
|
+
throw P("RSASSA-PKCS1-v1_5");
|
|
193
191
|
const a = parseInt(t.slice(2), 10);
|
|
194
192
|
if (be(e.algorithm.hash) !== a)
|
|
195
|
-
throw
|
|
193
|
+
throw P(`SHA-${a}`, "algorithm.hash");
|
|
196
194
|
break;
|
|
197
195
|
}
|
|
198
196
|
case "PS256":
|
|
199
197
|
case "PS384":
|
|
200
198
|
case "PS512": {
|
|
201
199
|
if (!Z(e.algorithm, "RSA-PSS"))
|
|
202
|
-
throw
|
|
200
|
+
throw P("RSA-PSS");
|
|
203
201
|
const a = parseInt(t.slice(2), 10);
|
|
204
202
|
if (be(e.algorithm.hash) !== a)
|
|
205
|
-
throw
|
|
203
|
+
throw P(`SHA-${a}`, "algorithm.hash");
|
|
206
204
|
break;
|
|
207
205
|
}
|
|
208
206
|
case "EdDSA": {
|
|
209
207
|
if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448")
|
|
210
|
-
throw
|
|
208
|
+
throw P("Ed25519 or Ed448");
|
|
211
209
|
break;
|
|
212
210
|
}
|
|
213
211
|
case "ES256":
|
|
214
212
|
case "ES384":
|
|
215
213
|
case "ES512": {
|
|
216
214
|
if (!Z(e.algorithm, "ECDSA"))
|
|
217
|
-
throw
|
|
218
|
-
const a =
|
|
215
|
+
throw P("ECDSA");
|
|
216
|
+
const a = Wt(t);
|
|
219
217
|
if (e.algorithm.namedCurve !== a)
|
|
220
|
-
throw
|
|
218
|
+
throw P(a, "algorithm.namedCurve");
|
|
221
219
|
break;
|
|
222
220
|
}
|
|
223
221
|
default:
|
|
224
222
|
throw new TypeError("CryptoKey does not support this operation");
|
|
225
223
|
}
|
|
226
|
-
|
|
224
|
+
jt(e, r);
|
|
227
225
|
}
|
|
228
|
-
function
|
|
226
|
+
function at(e, t, ...r) {
|
|
229
227
|
var a;
|
|
230
228
|
if (r.length > 2) {
|
|
231
229
|
const n = r.pop();
|
|
232
230
|
e += `one of type ${r.join(", ")}, or ${n}.`;
|
|
233
|
-
} else
|
|
234
|
-
r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
|
|
231
|
+
} else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
|
|
235
232
|
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
233
|
}
|
|
237
|
-
const Pe = (e, ...t) =>
|
|
238
|
-
function
|
|
239
|
-
return
|
|
234
|
+
const Pe = (e, ...t) => at("Key must be ", e, ...t);
|
|
235
|
+
function nt(e, t, ...r) {
|
|
236
|
+
return at(`Key for the ${e} algorithm must be `, t, ...r);
|
|
240
237
|
}
|
|
241
|
-
const
|
|
238
|
+
const ot = (e) => tt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", de = ["CryptoKey"], Vt = (...e) => {
|
|
242
239
|
const t = e.filter(Boolean);
|
|
243
240
|
if (t.length === 0 || t.length === 1)
|
|
244
241
|
return !0;
|
|
@@ -257,11 +254,11 @@ const st = (e) => rt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
|
|
|
257
254
|
}
|
|
258
255
|
return !0;
|
|
259
256
|
};
|
|
260
|
-
function
|
|
257
|
+
function Jt(e) {
|
|
261
258
|
return typeof e == "object" && e !== null;
|
|
262
259
|
}
|
|
263
|
-
function
|
|
264
|
-
if (!
|
|
260
|
+
function Ie(e) {
|
|
261
|
+
if (!Jt(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
265
262
|
return !1;
|
|
266
263
|
if (Object.getPrototypeOf(e) === null)
|
|
267
264
|
return !0;
|
|
@@ -270,14 +267,14 @@ function _e(e) {
|
|
|
270
267
|
t = Object.getPrototypeOf(t);
|
|
271
268
|
return Object.getPrototypeOf(e) === t;
|
|
272
269
|
}
|
|
273
|
-
const
|
|
270
|
+
const Ft = (e, t) => {
|
|
274
271
|
if (e.startsWith("RS") || e.startsWith("PS")) {
|
|
275
272
|
const { modulusLength: r } = t.algorithm;
|
|
276
273
|
if (typeof r != "number" || r < 2048)
|
|
277
274
|
throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
|
|
278
275
|
}
|
|
279
276
|
};
|
|
280
|
-
function
|
|
277
|
+
function zt(e) {
|
|
281
278
|
let t, r;
|
|
282
279
|
switch (e.kty) {
|
|
283
280
|
case "RSA": {
|
|
@@ -302,7 +299,7 @@ function Ft(e) {
|
|
|
302
299
|
}, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
|
303
300
|
break;
|
|
304
301
|
default:
|
|
305
|
-
throw new
|
|
302
|
+
throw new K('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
306
303
|
}
|
|
307
304
|
break;
|
|
308
305
|
}
|
|
@@ -324,7 +321,7 @@ function Ft(e) {
|
|
|
324
321
|
t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
325
322
|
break;
|
|
326
323
|
default:
|
|
327
|
-
throw new
|
|
324
|
+
throw new K('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
328
325
|
}
|
|
329
326
|
break;
|
|
330
327
|
}
|
|
@@ -340,71 +337,71 @@ function Ft(e) {
|
|
|
340
337
|
t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
341
338
|
break;
|
|
342
339
|
default:
|
|
343
|
-
throw new
|
|
340
|
+
throw new K('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
344
341
|
}
|
|
345
342
|
break;
|
|
346
343
|
}
|
|
347
344
|
default:
|
|
348
|
-
throw new
|
|
345
|
+
throw new K('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
349
346
|
}
|
|
350
347
|
return { algorithm: t, keyUsages: r };
|
|
351
348
|
}
|
|
352
|
-
const
|
|
349
|
+
const Yt = async (e) => {
|
|
353
350
|
if (!e.alg)
|
|
354
351
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
355
|
-
const { algorithm: t, keyUsages: r } =
|
|
352
|
+
const { algorithm: t, keyUsages: r } = zt(e), a = [
|
|
356
353
|
t,
|
|
357
354
|
e.ext ?? !1,
|
|
358
355
|
e.key_ops ?? r
|
|
359
356
|
], n = { ...e };
|
|
360
357
|
return delete n.alg, delete n.use, he.subtle.importKey("jwk", n, ...a);
|
|
361
|
-
},
|
|
358
|
+
}, st = (e) => ce(e);
|
|
362
359
|
let we, Ee;
|
|
363
|
-
const
|
|
360
|
+
const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", ct = async (e, t, r, a) => {
|
|
364
361
|
let n = e.get(t);
|
|
365
362
|
if (n != null && n[a])
|
|
366
363
|
return n[a];
|
|
367
|
-
const o = await
|
|
364
|
+
const o = await Yt({ ...r, alg: a });
|
|
368
365
|
return n ? n[a] = o : e.set(t, { [a]: o }), o;
|
|
369
|
-
},
|
|
370
|
-
if (
|
|
366
|
+
}, qt = (e, t) => {
|
|
367
|
+
if (it(e)) {
|
|
371
368
|
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 ?
|
|
369
|
+
return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? st(r.k) : (Ee || (Ee = /* @__PURE__ */ new WeakMap()), ct(Ee, e, r, t));
|
|
373
370
|
}
|
|
374
371
|
return e;
|
|
375
|
-
},
|
|
376
|
-
if (
|
|
372
|
+
}, Qt = (e, t) => {
|
|
373
|
+
if (it(e)) {
|
|
377
374
|
let r = e.export({ format: "jwk" });
|
|
378
|
-
return r.k ?
|
|
375
|
+
return r.k ? st(r.k) : (we || (we = /* @__PURE__ */ new WeakMap()), ct(we, e, r, t));
|
|
379
376
|
}
|
|
380
377
|
return e;
|
|
381
|
-
},
|
|
378
|
+
}, Xt = { normalizePublicKey: qt, normalizePrivateKey: Qt }, U = (e, t, r = 0) => {
|
|
382
379
|
r === 0 && (t.unshift(t.length), t.unshift(6));
|
|
383
380
|
const a = e.indexOf(t[0], r);
|
|
384
381
|
if (a === -1)
|
|
385
382
|
return !1;
|
|
386
383
|
const n = e.subarray(a, a + t.length);
|
|
387
|
-
return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) ||
|
|
388
|
-
},
|
|
384
|
+
return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || U(e, t, a + 1);
|
|
385
|
+
}, $e = (e) => {
|
|
389
386
|
switch (!0) {
|
|
390
|
-
case
|
|
387
|
+
case U(e, [42, 134, 72, 206, 61, 3, 1, 7]):
|
|
391
388
|
return "P-256";
|
|
392
|
-
case
|
|
389
|
+
case U(e, [43, 129, 4, 0, 34]):
|
|
393
390
|
return "P-384";
|
|
394
|
-
case
|
|
391
|
+
case U(e, [43, 129, 4, 0, 35]):
|
|
395
392
|
return "P-521";
|
|
396
|
-
case
|
|
393
|
+
case U(e, [43, 101, 110]):
|
|
397
394
|
return "X25519";
|
|
398
|
-
case
|
|
395
|
+
case U(e, [43, 101, 111]):
|
|
399
396
|
return "X448";
|
|
400
|
-
case
|
|
397
|
+
case U(e, [43, 101, 112]):
|
|
401
398
|
return "Ed25519";
|
|
402
|
-
case
|
|
399
|
+
case U(e, [43, 101, 113]):
|
|
403
400
|
return "Ed448";
|
|
404
401
|
default:
|
|
405
|
-
throw new
|
|
402
|
+
throw new K("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
406
403
|
}
|
|
407
|
-
},
|
|
404
|
+
}, Zt = async (e, t, r, a, n) => {
|
|
408
405
|
let o, s;
|
|
409
406
|
const i = new Uint8Array(atob(r.replace(e, "")).split("").map((l) => l.charCodeAt(0)));
|
|
410
407
|
switch (a) {
|
|
@@ -440,43 +437,43 @@ const ct = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
|
440
437
|
case "ECDH-ES+A128KW":
|
|
441
438
|
case "ECDH-ES+A192KW":
|
|
442
439
|
case "ECDH-ES+A256KW": {
|
|
443
|
-
const l =
|
|
440
|
+
const l = $e(i);
|
|
444
441
|
o = l.startsWith("P-") ? { name: "ECDH", namedCurve: l } : { name: l }, s = [];
|
|
445
442
|
break;
|
|
446
443
|
}
|
|
447
444
|
case "EdDSA":
|
|
448
|
-
o = { name:
|
|
445
|
+
o = { name: $e(i) }, s = ["verify"];
|
|
449
446
|
break;
|
|
450
447
|
default:
|
|
451
|
-
throw new
|
|
448
|
+
throw new K('Invalid or unsupported "alg" (Algorithm) value');
|
|
452
449
|
}
|
|
453
450
|
return he.subtle.importKey(t, i, o, !1, s);
|
|
454
|
-
},
|
|
455
|
-
async function
|
|
451
|
+
}, er = (e, t, r) => Zt(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
|
|
452
|
+
async function tr(e, t, r) {
|
|
456
453
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
457
454
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
458
|
-
return
|
|
455
|
+
return er(e, t);
|
|
459
456
|
}
|
|
460
|
-
const le = (e) => e == null ? void 0 : e[Symbol.toStringTag],
|
|
457
|
+
const le = (e) => e == null ? void 0 : e[Symbol.toStringTag], rr = (e, t) => {
|
|
461
458
|
if (!(t instanceof Uint8Array)) {
|
|
462
|
-
if (!
|
|
463
|
-
throw new TypeError(
|
|
459
|
+
if (!ot(t))
|
|
460
|
+
throw new TypeError(nt(e, t, ...de, "Uint8Array"));
|
|
464
461
|
if (t.type !== "secret")
|
|
465
462
|
throw new TypeError(`${le(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
466
463
|
}
|
|
467
|
-
},
|
|
468
|
-
if (!
|
|
469
|
-
throw new TypeError(
|
|
464
|
+
}, ar = (e, t, r) => {
|
|
465
|
+
if (!ot(t))
|
|
466
|
+
throw new TypeError(nt(e, t, ...de));
|
|
470
467
|
if (t.type === "secret")
|
|
471
468
|
throw new TypeError(`${le(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
472
469
|
if (t.algorithm && r === "verify" && t.type === "private")
|
|
473
470
|
throw new TypeError(`${le(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
474
471
|
if (t.algorithm && r === "encrypt" && t.type === "private")
|
|
475
472
|
throw new TypeError(`${le(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
476
|
-
},
|
|
477
|
-
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ?
|
|
473
|
+
}, nr = (e, t, r) => {
|
|
474
|
+
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? rr(e, t) : ar(e, t, r);
|
|
478
475
|
};
|
|
479
|
-
function
|
|
476
|
+
function or(e, t, r, a, n) {
|
|
480
477
|
if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
|
|
481
478
|
throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
482
479
|
if (!a || a.crit === void 0)
|
|
@@ -487,7 +484,7 @@ function nr(e, t, r, a, n) {
|
|
|
487
484
|
r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
|
|
488
485
|
for (const s of a.crit) {
|
|
489
486
|
if (!o.has(s))
|
|
490
|
-
throw new
|
|
487
|
+
throw new K(`Extension Header Parameter "${s}" is not recognized`);
|
|
491
488
|
if (n[s] === void 0)
|
|
492
489
|
throw new e(`Extension Header Parameter "${s}" is missing`);
|
|
493
490
|
if (o.get(s) && a[s] === void 0)
|
|
@@ -495,13 +492,13 @@ function nr(e, t, r, a, n) {
|
|
|
495
492
|
}
|
|
496
493
|
return new Set(a.crit);
|
|
497
494
|
}
|
|
498
|
-
const
|
|
495
|
+
const sr = (e, t) => {
|
|
499
496
|
if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
|
|
500
497
|
throw new TypeError(`"${e}" option must be an array of strings`);
|
|
501
498
|
if (t)
|
|
502
499
|
return new Set(t);
|
|
503
500
|
};
|
|
504
|
-
function
|
|
501
|
+
function ir(e, t) {
|
|
505
502
|
const r = `SHA-${e.slice(-3)}`;
|
|
506
503
|
switch (e) {
|
|
507
504
|
case "HS256":
|
|
@@ -523,12 +520,12 @@ function sr(e, t) {
|
|
|
523
520
|
case "EdDSA":
|
|
524
521
|
return { name: t.name };
|
|
525
522
|
default:
|
|
526
|
-
throw new
|
|
523
|
+
throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
527
524
|
}
|
|
528
525
|
}
|
|
529
|
-
async function
|
|
530
|
-
if (t = await
|
|
531
|
-
return
|
|
526
|
+
async function cr(e, t, r) {
|
|
527
|
+
if (t = await Xt.normalizePublicKey(t, e), tt(t))
|
|
528
|
+
return Gt(t, e, r), t;
|
|
532
529
|
if (t instanceof Uint8Array) {
|
|
533
530
|
if (!e.startsWith("HS"))
|
|
534
531
|
throw new TypeError(Pe(t, ...de));
|
|
@@ -536,91 +533,90 @@ async function ir(e, t, r) {
|
|
|
536
533
|
}
|
|
537
534
|
throw new TypeError(Pe(t, ...de, "Uint8Array"));
|
|
538
535
|
}
|
|
539
|
-
const
|
|
540
|
-
const n = await
|
|
541
|
-
|
|
542
|
-
const o =
|
|
536
|
+
const lr = async (e, t, r, a) => {
|
|
537
|
+
const n = await cr(e, t, "verify");
|
|
538
|
+
Ft(e, n);
|
|
539
|
+
const o = ir(e, n.algorithm);
|
|
543
540
|
try {
|
|
544
541
|
return await he.subtle.verify(o, n, r, a);
|
|
545
542
|
} catch {
|
|
546
543
|
return !1;
|
|
547
544
|
}
|
|
548
545
|
};
|
|
549
|
-
async function
|
|
550
|
-
if (!
|
|
551
|
-
throw new
|
|
546
|
+
async function dr(e, t, r) {
|
|
547
|
+
if (!Ie(e))
|
|
548
|
+
throw new S("Flattened JWS must be an object");
|
|
552
549
|
if (e.protected === void 0 && e.header === void 0)
|
|
553
|
-
throw new
|
|
550
|
+
throw new S('Flattened JWS must have either of the "protected" or "header" members');
|
|
554
551
|
if (e.protected !== void 0 && typeof e.protected != "string")
|
|
555
|
-
throw new
|
|
552
|
+
throw new S("JWS Protected Header incorrect type");
|
|
556
553
|
if (e.payload === void 0)
|
|
557
|
-
throw new
|
|
554
|
+
throw new S("JWS Payload missing");
|
|
558
555
|
if (typeof e.signature != "string")
|
|
559
|
-
throw new
|
|
560
|
-
if (e.header !== void 0 && !
|
|
561
|
-
throw new
|
|
556
|
+
throw new S("JWS Signature missing or incorrect type");
|
|
557
|
+
if (e.header !== void 0 && !Ie(e.header))
|
|
558
|
+
throw new S("JWS Unprotected Header incorrect type");
|
|
562
559
|
let a = {};
|
|
563
560
|
if (e.protected)
|
|
564
561
|
try {
|
|
565
562
|
const f = ce(e.protected);
|
|
566
563
|
a = JSON.parse(pe.decode(f));
|
|
567
564
|
} catch {
|
|
568
|
-
throw new
|
|
565
|
+
throw new S("JWS Protected Header is invalid");
|
|
569
566
|
}
|
|
570
|
-
if (!
|
|
571
|
-
throw new
|
|
567
|
+
if (!Vt(a, e.header))
|
|
568
|
+
throw new S("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
572
569
|
const n = {
|
|
573
570
|
...a,
|
|
574
571
|
...e.header
|
|
575
|
-
}, o =
|
|
572
|
+
}, o = or(S, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
|
|
576
573
|
let s = !0;
|
|
577
574
|
if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
|
|
578
|
-
throw new
|
|
575
|
+
throw new S('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
579
576
|
const { alg: i } = n;
|
|
580
577
|
if (typeof i != "string" || !i)
|
|
581
|
-
throw new
|
|
582
|
-
const l = r &&
|
|
578
|
+
throw new S('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
579
|
+
const l = r && sr("algorithms", r.algorithms);
|
|
583
580
|
if (l && !l.has(i))
|
|
584
|
-
throw new
|
|
581
|
+
throw new Kt('"alg" (Algorithm) Header Parameter value not allowed');
|
|
585
582
|
if (s) {
|
|
586
583
|
if (typeof e.payload != "string")
|
|
587
|
-
throw new
|
|
584
|
+
throw new S("JWS Payload must be a string");
|
|
588
585
|
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
|
|
589
|
-
throw new
|
|
586
|
+
throw new S("JWS Payload must be a string or an Uint8Array instance");
|
|
590
587
|
let d = !1;
|
|
591
|
-
typeof t == "function" && (t = await t(a, e), d = !0),
|
|
592
|
-
const h =
|
|
588
|
+
typeof t == "function" && (t = await t(a, e), d = !0), nr(i, t, "verify");
|
|
589
|
+
const h = Ut(X.encode(e.protected ?? ""), X.encode("."), typeof e.payload == "string" ? X.encode(e.payload) : e.payload);
|
|
593
590
|
let u;
|
|
594
591
|
try {
|
|
595
592
|
u = ce(e.signature);
|
|
596
593
|
} catch {
|
|
597
|
-
throw new
|
|
594
|
+
throw new S("Failed to base64url decode the signature");
|
|
598
595
|
}
|
|
599
|
-
if (!await
|
|
600
|
-
throw new
|
|
596
|
+
if (!await lr(i, t, u, h))
|
|
597
|
+
throw new Bt();
|
|
601
598
|
let m;
|
|
602
599
|
if (s)
|
|
603
600
|
try {
|
|
604
601
|
m = ce(e.payload);
|
|
605
602
|
} catch {
|
|
606
|
-
throw new
|
|
603
|
+
throw new S("Failed to base64url decode the payload");
|
|
607
604
|
}
|
|
608
|
-
else
|
|
609
|
-
typeof e.payload == "string" ? m = X.encode(e.payload) : m = e.payload;
|
|
605
|
+
else typeof e.payload == "string" ? m = X.encode(e.payload) : m = e.payload;
|
|
610
606
|
const p = { payload: m };
|
|
611
607
|
return e.protected !== void 0 && (p.protectedHeader = a), e.header !== void 0 && (p.unprotectedHeader = e.header), d ? { ...p, key: t } : p;
|
|
612
608
|
}
|
|
613
|
-
async function
|
|
609
|
+
async function ur(e, t, r) {
|
|
614
610
|
if (e instanceof Uint8Array && (e = pe.decode(e)), typeof e != "string")
|
|
615
|
-
throw new
|
|
611
|
+
throw new S("Compact JWS must be a string or Uint8Array");
|
|
616
612
|
const { 0: a, 1: n, 2: o, length: s } = e.split(".");
|
|
617
613
|
if (s !== 3)
|
|
618
|
-
throw new
|
|
619
|
-
const i = await
|
|
614
|
+
throw new S("Invalid Compact JWS");
|
|
615
|
+
const i = await dr({ payload: n, protected: a, signature: o }, t, r), l = { payload: i.payload, protectedHeader: i.protectedHeader };
|
|
620
616
|
return typeof t == "function" ? { ...l, key: i.key } : l;
|
|
621
617
|
}
|
|
622
|
-
const
|
|
623
|
-
const t =
|
|
618
|
+
const mr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, _e = dt * 24, hr = _e * 7, pr = _e * 365.25, gr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, Ue = (e) => {
|
|
619
|
+
const t = gr.exec(e);
|
|
624
620
|
if (!t || t[4] && t[1])
|
|
625
621
|
throw new TypeError("Invalid time period format");
|
|
626
622
|
const r = parseFloat(t[2]), a = t[3].toLowerCase();
|
|
@@ -638,56 +634,56 @@ const ur = (e) => Math.floor(e.getTime() / 1e3), dt = 60, ut = dt * 60, Ie = ut
|
|
|
638
634
|
case "min":
|
|
639
635
|
case "mins":
|
|
640
636
|
case "m":
|
|
641
|
-
n = Math.round(r *
|
|
637
|
+
n = Math.round(r * lt);
|
|
642
638
|
break;
|
|
643
639
|
case "hour":
|
|
644
640
|
case "hours":
|
|
645
641
|
case "hr":
|
|
646
642
|
case "hrs":
|
|
647
643
|
case "h":
|
|
648
|
-
n = Math.round(r *
|
|
644
|
+
n = Math.round(r * dt);
|
|
649
645
|
break;
|
|
650
646
|
case "day":
|
|
651
647
|
case "days":
|
|
652
648
|
case "d":
|
|
653
|
-
n = Math.round(r *
|
|
649
|
+
n = Math.round(r * _e);
|
|
654
650
|
break;
|
|
655
651
|
case "week":
|
|
656
652
|
case "weeks":
|
|
657
653
|
case "w":
|
|
658
|
-
n = Math.round(r *
|
|
654
|
+
n = Math.round(r * hr);
|
|
659
655
|
break;
|
|
660
656
|
default:
|
|
661
|
-
n = Math.round(r *
|
|
657
|
+
n = Math.round(r * pr);
|
|
662
658
|
break;
|
|
663
659
|
}
|
|
664
660
|
return t[1] === "-" || t[4] === "ago" ? -n : n;
|
|
665
|
-
},
|
|
661
|
+
}, He = (e) => e.toLowerCase().replace(/^application\//, ""), fr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, yr = (e, t, r = {}) => {
|
|
666
662
|
let a;
|
|
667
663
|
try {
|
|
668
664
|
a = JSON.parse(pe.decode(t));
|
|
669
665
|
} catch {
|
|
670
666
|
}
|
|
671
|
-
if (!
|
|
672
|
-
throw new
|
|
667
|
+
if (!Ie(a))
|
|
668
|
+
throw new rt("JWT Claims Set must be a top-level JSON object");
|
|
673
669
|
const { typ: n } = r;
|
|
674
|
-
if (n && (typeof e.typ != "string" ||
|
|
675
|
-
throw new
|
|
670
|
+
if (n && (typeof e.typ != "string" || He(e.typ) !== He(n)))
|
|
671
|
+
throw new L('unexpected "typ" JWT header value', a, "typ", "check_failed");
|
|
676
672
|
const { requiredClaims: o = [], issuer: s, subject: i, audience: l, maxTokenAge: d } = r, h = [...o];
|
|
677
673
|
d !== void 0 && h.push("iat"), l !== void 0 && h.push("aud"), i !== void 0 && h.push("sub"), s !== void 0 && h.push("iss");
|
|
678
674
|
for (const f of new Set(h.reverse()))
|
|
679
675
|
if (!(f in a))
|
|
680
|
-
throw new
|
|
676
|
+
throw new L(`missing required "${f}" claim`, a, f, "missing");
|
|
681
677
|
if (s && !(Array.isArray(s) ? s : [s]).includes(a.iss))
|
|
682
|
-
throw new
|
|
678
|
+
throw new L('unexpected "iss" claim value', a, "iss", "check_failed");
|
|
683
679
|
if (i && a.sub !== i)
|
|
684
|
-
throw new
|
|
685
|
-
if (l && !
|
|
686
|
-
throw new
|
|
680
|
+
throw new L('unexpected "sub" claim value', a, "sub", "check_failed");
|
|
681
|
+
if (l && !fr(a.aud, typeof l == "string" ? [l] : l))
|
|
682
|
+
throw new L('unexpected "aud" claim value', a, "aud", "check_failed");
|
|
687
683
|
let u;
|
|
688
684
|
switch (typeof r.clockTolerance) {
|
|
689
685
|
case "string":
|
|
690
|
-
u =
|
|
686
|
+
u = Ue(r.clockTolerance);
|
|
691
687
|
break;
|
|
692
688
|
case "number":
|
|
693
689
|
u = r.clockTolerance;
|
|
@@ -698,170 +694,167 @@ const ur = (e) => Math.floor(e.getTime() / 1e3), dt = 60, ut = dt * 60, Ie = ut
|
|
|
698
694
|
default:
|
|
699
695
|
throw new TypeError("Invalid clockTolerance option type");
|
|
700
696
|
}
|
|
701
|
-
const { currentDate: m } = r, p =
|
|
697
|
+
const { currentDate: m } = r, p = mr(m || /* @__PURE__ */ new Date());
|
|
702
698
|
if ((a.iat !== void 0 || d) && typeof a.iat != "number")
|
|
703
|
-
throw new
|
|
699
|
+
throw new L('"iat" claim must be a number', a, "iat", "invalid");
|
|
704
700
|
if (a.nbf !== void 0) {
|
|
705
701
|
if (typeof a.nbf != "number")
|
|
706
|
-
throw new
|
|
702
|
+
throw new L('"nbf" claim must be a number', a, "nbf", "invalid");
|
|
707
703
|
if (a.nbf > p + u)
|
|
708
|
-
throw new
|
|
704
|
+
throw new L('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
|
|
709
705
|
}
|
|
710
706
|
if (a.exp !== void 0) {
|
|
711
707
|
if (typeof a.exp != "number")
|
|
712
|
-
throw new
|
|
708
|
+
throw new L('"exp" claim must be a number', a, "exp", "invalid");
|
|
713
709
|
if (a.exp <= p - u)
|
|
714
710
|
throw new Le('"exp" claim timestamp check failed', a, "exp", "check_failed");
|
|
715
711
|
}
|
|
716
712
|
if (d) {
|
|
717
|
-
const f = p - a.iat,
|
|
718
|
-
if (f - u >
|
|
713
|
+
const f = p - a.iat, E = typeof d == "number" ? d : Ue(d);
|
|
714
|
+
if (f - u > E)
|
|
719
715
|
throw new Le('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
|
|
720
716
|
if (f < 0 - u)
|
|
721
|
-
throw new
|
|
717
|
+
throw new L('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
|
|
722
718
|
}
|
|
723
719
|
return a;
|
|
724
720
|
};
|
|
725
|
-
async function
|
|
721
|
+
async function br(e, t, r) {
|
|
726
722
|
var a;
|
|
727
|
-
const n = await
|
|
723
|
+
const n = await ur(e, t, r);
|
|
728
724
|
if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
|
|
729
|
-
throw new
|
|
730
|
-
const o = { payload:
|
|
725
|
+
throw new rt("JWTs MUST NOT use unencoded payload");
|
|
726
|
+
const o = { payload: yr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
|
|
731
727
|
return typeof t == "function" ? { ...o, key: n.key } : o;
|
|
732
728
|
}
|
|
733
729
|
const Y = async (e) => {
|
|
734
730
|
try {
|
|
735
|
-
const t =
|
|
736
|
-
return await
|
|
737
|
-
issuer:
|
|
731
|
+
const t = _.ALG, r = await tr($t, t);
|
|
732
|
+
return await br(e, r, {
|
|
733
|
+
issuer: _.ISSUER
|
|
738
734
|
});
|
|
739
735
|
} catch {
|
|
740
736
|
return;
|
|
741
737
|
}
|
|
742
738
|
};
|
|
743
|
-
var
|
|
739
|
+
var v = [];
|
|
744
740
|
for (var ve = 0; ve < 256; ++ve)
|
|
745
|
-
|
|
746
|
-
function
|
|
747
|
-
return (
|
|
741
|
+
v.push((ve + 256).toString(16).slice(1));
|
|
742
|
+
function wr(e, t = 0) {
|
|
743
|
+
return (v[e[t + 0]] + v[e[t + 1]] + v[e[t + 2]] + v[e[t + 3]] + "-" + v[e[t + 4]] + v[e[t + 5]] + "-" + v[e[t + 6]] + v[e[t + 7]] + "-" + v[e[t + 8]] + v[e[t + 9]] + "-" + v[e[t + 10]] + v[e[t + 11]] + v[e[t + 12]] + v[e[t + 13]] + v[e[t + 14]] + v[e[t + 15]]).toLowerCase();
|
|
748
744
|
}
|
|
749
|
-
var ee,
|
|
750
|
-
function
|
|
745
|
+
var ee, Er = new Uint8Array(16);
|
|
746
|
+
function vr() {
|
|
751
747
|
if (!ee && (ee = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ee))
|
|
752
748
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
753
|
-
return ee(
|
|
749
|
+
return ee(Er);
|
|
754
750
|
}
|
|
755
|
-
var
|
|
756
|
-
const
|
|
757
|
-
randomUUID:
|
|
751
|
+
var kr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
752
|
+
const Ke = {
|
|
753
|
+
randomUUID: kr
|
|
758
754
|
};
|
|
759
|
-
function
|
|
760
|
-
if (
|
|
761
|
-
return
|
|
755
|
+
function Be(e, t, r) {
|
|
756
|
+
if (Ke.randomUUID && !t && !e)
|
|
757
|
+
return Ke.randomUUID();
|
|
762
758
|
e = e || {};
|
|
763
|
-
var a = e.random || (e.rng ||
|
|
764
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
759
|
+
var a = e.random || (e.rng || vr)();
|
|
760
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, wr(a);
|
|
765
761
|
}
|
|
766
|
-
const
|
|
762
|
+
const We = globalThis.crypto, Sr = (e) => `${Be()}${Be()}`.slice(0, e), Tr = (e) => btoa(
|
|
767
763
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
768
764
|
);
|
|
769
|
-
async function
|
|
770
|
-
if (!
|
|
765
|
+
async function Ar(e) {
|
|
766
|
+
if (!We.subtle)
|
|
771
767
|
throw new Error(
|
|
772
768
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
773
769
|
);
|
|
774
|
-
const t = new TextEncoder().encode(e), r = await
|
|
775
|
-
return
|
|
770
|
+
const t = new TextEncoder().encode(e), r = await We.subtle.digest("SHA-256", t);
|
|
771
|
+
return Tr(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
776
772
|
}
|
|
777
|
-
async function
|
|
778
|
-
const t =
|
|
773
|
+
async function Ir(e) {
|
|
774
|
+
const t = Sr(43), r = await Ar(t);
|
|
779
775
|
return {
|
|
780
776
|
code_verifier: t,
|
|
781
777
|
code_challenge: r
|
|
782
778
|
};
|
|
783
779
|
}
|
|
784
|
-
function
|
|
780
|
+
function ut(e, t) {
|
|
785
781
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
|
786
782
|
}
|
|
787
|
-
const
|
|
783
|
+
const je = (e, t) => {
|
|
788
784
|
const r = JSON.stringify(
|
|
789
785
|
typeof t == "function" ? t() : t
|
|
790
786
|
);
|
|
791
|
-
window.localStorage.setItem(e, r),
|
|
787
|
+
window.localStorage.setItem(e, r), ut(e, r);
|
|
792
788
|
}, _r = (e) => {
|
|
793
|
-
window.localStorage.removeItem(e),
|
|
794
|
-
},
|
|
789
|
+
window.localStorage.removeItem(e), ut(e, null);
|
|
790
|
+
}, Ge = (e) => window.localStorage.getItem(e), xr = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
795
791
|
function te({
|
|
796
792
|
key: e,
|
|
797
793
|
initialValue: t
|
|
798
794
|
}) {
|
|
799
|
-
const r = () =>
|
|
800
|
-
|
|
801
|
-
r
|
|
802
|
-
), n = F.useCallback(
|
|
803
|
-
(i) => {
|
|
795
|
+
const r = Nt(xr, () => Ge(e)), a = z(
|
|
796
|
+
(s) => {
|
|
804
797
|
try {
|
|
805
|
-
const
|
|
806
|
-
|
|
807
|
-
} catch (
|
|
808
|
-
console.warn(
|
|
798
|
+
const i = typeof s == "function" ? s(JSON.parse(r)) : s;
|
|
799
|
+
i == null ? _r(e) : je(e, i);
|
|
800
|
+
} catch (i) {
|
|
801
|
+
console.warn(i);
|
|
809
802
|
}
|
|
810
803
|
},
|
|
811
|
-
[e,
|
|
812
|
-
),
|
|
813
|
-
|
|
814
|
-
}, [t,
|
|
815
|
-
|
|
816
|
-
}, [
|
|
817
|
-
return
|
|
804
|
+
[e, r]
|
|
805
|
+
), n = z(() => {
|
|
806
|
+
a(t);
|
|
807
|
+
}, [t, a]), o = z(() => {
|
|
808
|
+
a(null);
|
|
809
|
+
}, [a]);
|
|
810
|
+
return V(() => {
|
|
818
811
|
try {
|
|
819
|
-
|
|
820
|
-
} catch (
|
|
821
|
-
console.warn(
|
|
812
|
+
Ge(e) === null && typeof t < "u" && je(e, t);
|
|
813
|
+
} catch (s) {
|
|
814
|
+
console.warn(s);
|
|
822
815
|
}
|
|
823
|
-
}, [e, t]), [
|
|
816
|
+
}, [e, t]), [r ? JSON.parse(r) : null, a, n, o];
|
|
824
817
|
}
|
|
825
|
-
var
|
|
818
|
+
var k = [];
|
|
826
819
|
for (var ke = 0; ke < 256; ++ke)
|
|
827
|
-
|
|
828
|
-
function
|
|
829
|
-
return (
|
|
820
|
+
k.push((ke + 256).toString(16).slice(1));
|
|
821
|
+
function Nr(e, t = 0) {
|
|
822
|
+
return (k[e[t + 0]] + k[e[t + 1]] + k[e[t + 2]] + k[e[t + 3]] + "-" + k[e[t + 4]] + k[e[t + 5]] + "-" + k[e[t + 6]] + k[e[t + 7]] + "-" + k[e[t + 8]] + k[e[t + 9]] + "-" + k[e[t + 10]] + k[e[t + 11]] + k[e[t + 12]] + k[e[t + 13]] + k[e[t + 14]] + k[e[t + 15]]).toLowerCase();
|
|
830
823
|
}
|
|
831
|
-
var re,
|
|
832
|
-
function
|
|
824
|
+
var re, Cr = new Uint8Array(16);
|
|
825
|
+
function Rr() {
|
|
833
826
|
if (!re && (re = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !re))
|
|
834
827
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
835
|
-
return re(
|
|
828
|
+
return re(Cr);
|
|
836
829
|
}
|
|
837
|
-
var
|
|
838
|
-
const
|
|
839
|
-
randomUUID:
|
|
830
|
+
var Or = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
831
|
+
const Ve = {
|
|
832
|
+
randomUUID: Or
|
|
840
833
|
};
|
|
841
|
-
function
|
|
842
|
-
if (
|
|
843
|
-
return
|
|
834
|
+
function Dr(e, t, r) {
|
|
835
|
+
if (Ve.randomUUID && !t && !e)
|
|
836
|
+
return Ve.randomUUID();
|
|
844
837
|
e = e || {};
|
|
845
|
-
var a = e.random || (e.rng ||
|
|
846
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
838
|
+
var a = e.random || (e.rng || Rr)();
|
|
839
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Nr(a);
|
|
847
840
|
}
|
|
848
|
-
const ae = "Oops! It looks like your session has expired. For your security, please log in again to continue.",
|
|
841
|
+
const ae = "Oops! It looks like your session has expired. For your security, please log in again to continue.", Mr = "Your session has been successfully terminated.", Je = "Login failed. Please try again.", Se = "Error getting access token, please re-authenticate.", Lr = "You forgot to wrap your component in <AuthProvider>.", Fe = {
|
|
849
842
|
dev: "https://auth.gizmette.local.com:3003",
|
|
850
843
|
prod: "https://mylogin.gizmette.com"
|
|
851
|
-
}, ne = "@@auth@@",
|
|
844
|
+
}, ne = "@@auth@@", Pr = process.env.NODE_ENV === "production", $r = !Pr, ge = async ({
|
|
852
845
|
type: e,
|
|
853
846
|
clientId: t,
|
|
854
847
|
params: r = {}
|
|
855
848
|
}) => {
|
|
856
849
|
try {
|
|
857
850
|
const a = await fetch(
|
|
858
|
-
|
|
851
|
+
$r ? `${Fe.dev}/${e}` : `${Fe.prod}/${e}`,
|
|
859
852
|
{
|
|
860
853
|
credentials: "include",
|
|
861
854
|
method: "POST",
|
|
862
855
|
headers: {
|
|
863
856
|
"Content-Type": "application/json",
|
|
864
|
-
[
|
|
857
|
+
[Pt.CLIENT_ID]: `${t}`
|
|
865
858
|
},
|
|
866
859
|
body: JSON.stringify(r)
|
|
867
860
|
}
|
|
@@ -877,23 +870,25 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
|
|
|
877
870
|
} catch (a) {
|
|
878
871
|
return console.error(a), { status: 500, data: [] };
|
|
879
872
|
}
|
|
880
|
-
},
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
873
|
+
}, Ur = async ({
|
|
874
|
+
userId: e,
|
|
875
|
+
idToken: t,
|
|
876
|
+
accessToken: r,
|
|
877
|
+
refreshToken: a,
|
|
878
|
+
clientId: n,
|
|
879
|
+
domain: o
|
|
886
880
|
}) => {
|
|
887
881
|
try {
|
|
888
882
|
return {
|
|
889
883
|
status: (await ge({
|
|
890
884
|
type: me.LOGOUT,
|
|
891
|
-
clientId:
|
|
885
|
+
clientId: n,
|
|
892
886
|
params: {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
887
|
+
userId: e,
|
|
888
|
+
idToken: t,
|
|
889
|
+
accessToken: r,
|
|
890
|
+
refreshToken: a,
|
|
891
|
+
domain: o
|
|
897
892
|
}
|
|
898
893
|
})).status === 200
|
|
899
894
|
};
|
|
@@ -902,7 +897,7 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
|
|
|
902
897
|
status: !1
|
|
903
898
|
};
|
|
904
899
|
}
|
|
905
|
-
},
|
|
900
|
+
}, ze = async ({
|
|
906
901
|
username: e,
|
|
907
902
|
password: t,
|
|
908
903
|
clientId: r,
|
|
@@ -928,11 +923,11 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
|
|
|
928
923
|
domain: l
|
|
929
924
|
}
|
|
930
925
|
}), h = await Y(d.data.idToken);
|
|
931
|
-
return h && h.payload[
|
|
926
|
+
return h && h.payload[_.USER_ID_KEY] !== "" && h.payload[_.NONCE_KEY] === a ? {
|
|
932
927
|
idToken: d.data.idToken,
|
|
933
928
|
accessToken: d.data.accessToken,
|
|
934
929
|
refreshToken: d.data.refreshToken,
|
|
935
|
-
userId: h.payload[
|
|
930
|
+
userId: h.payload[_.USER_ID_KEY],
|
|
936
931
|
status: !0
|
|
937
932
|
} : {
|
|
938
933
|
status: !1
|
|
@@ -942,7 +937,7 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
|
|
|
942
937
|
status: !1
|
|
943
938
|
};
|
|
944
939
|
}
|
|
945
|
-
},
|
|
940
|
+
}, Hr = async ({
|
|
946
941
|
nonce: e,
|
|
947
942
|
clientId: t,
|
|
948
943
|
code_challenge: r
|
|
@@ -968,7 +963,7 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
|
|
|
968
963
|
status: !1
|
|
969
964
|
};
|
|
970
965
|
}
|
|
971
|
-
},
|
|
966
|
+
}, Kr = async ({
|
|
972
967
|
clientId: e,
|
|
973
968
|
userId: t,
|
|
974
969
|
nonce: r,
|
|
@@ -989,10 +984,10 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
|
|
|
989
984
|
domain: o
|
|
990
985
|
}
|
|
991
986
|
}), i = await Y(s.data.accessToken);
|
|
992
|
-
return i && i.payload[
|
|
987
|
+
return i && i.payload[_.USER_ID_KEY] !== "" && i.payload[_.NONCE_KEY] === r ? {
|
|
993
988
|
accessToken: s.data.accessToken,
|
|
994
989
|
refreshToken: s.data.refreshToken,
|
|
995
|
-
userId: i.payload[
|
|
990
|
+
userId: i.payload[_.USER_ID_KEY],
|
|
996
991
|
status: !0
|
|
997
992
|
} : {
|
|
998
993
|
status: !1
|
|
@@ -1003,7 +998,7 @@ const ae = "Oops! It looks like your session has expired. For your security, ple
|
|
|
1003
998
|
};
|
|
1004
999
|
}
|
|
1005
1000
|
};
|
|
1006
|
-
class
|
|
1001
|
+
class Br {
|
|
1007
1002
|
constructor(t = null, r = null) {
|
|
1008
1003
|
ye(this, "refreshTokenPromise", null), ye(this, "accessToken"), ye(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
|
|
1009
1004
|
}
|
|
@@ -1032,8 +1027,8 @@ class Kr {
|
|
|
1032
1027
|
domain: n
|
|
1033
1028
|
}) {
|
|
1034
1029
|
const o = await Y(this.refreshToken);
|
|
1035
|
-
if (o && o.payload[
|
|
1036
|
-
const s = await
|
|
1030
|
+
if (o && o.payload[_.USER_ID_KEY] !== "") {
|
|
1031
|
+
const s = await Kr({
|
|
1037
1032
|
clientId: t,
|
|
1038
1033
|
userId: r,
|
|
1039
1034
|
nonce: a,
|
|
@@ -1055,8 +1050,8 @@ class Kr {
|
|
|
1055
1050
|
}
|
|
1056
1051
|
}
|
|
1057
1052
|
const oe = () => {
|
|
1058
|
-
throw new Error(
|
|
1059
|
-
},
|
|
1053
|
+
throw new Error(Lr);
|
|
1054
|
+
}, mt = xt({
|
|
1060
1055
|
isAuthenticated: !1,
|
|
1061
1056
|
isLoading: !1,
|
|
1062
1057
|
login: oe,
|
|
@@ -1064,13 +1059,13 @@ const oe = () => {
|
|
|
1064
1059
|
getAccessToken: oe,
|
|
1065
1060
|
getIdToken: oe,
|
|
1066
1061
|
logoutReason: ""
|
|
1067
|
-
}),
|
|
1062
|
+
}), Wr = ({
|
|
1068
1063
|
children: e,
|
|
1069
1064
|
sessionExpiration: t,
|
|
1070
1065
|
clientId: r,
|
|
1071
1066
|
domain: a = ""
|
|
1072
1067
|
}) => {
|
|
1073
|
-
const n =
|
|
1068
|
+
const n = j(!1), [o, s, , i] = te({
|
|
1074
1069
|
key: `${ne}::${r}::@@user@@`
|
|
1075
1070
|
}), [l, d, , h] = te({
|
|
1076
1071
|
key: `${ne}::${r}::@@access@@`
|
|
@@ -1078,16 +1073,16 @@ const oe = () => {
|
|
|
1078
1073
|
{
|
|
1079
1074
|
key: `${ne}::${r}::@@refresh@@`
|
|
1080
1075
|
}
|
|
1081
|
-
), [f,
|
|
1076
|
+
), [f, E, , x] = te({
|
|
1082
1077
|
key: `${ne}::${r}::@@nonce@@`
|
|
1083
|
-
}),
|
|
1078
|
+
}), D = new Br(l, u), [A, w] = H({
|
|
1084
1079
|
isLoading: !0,
|
|
1085
1080
|
isAuthenticated: !1,
|
|
1086
1081
|
user: void 0,
|
|
1087
1082
|
logoutReason: ""
|
|
1088
|
-
}),
|
|
1083
|
+
}), M = z(
|
|
1089
1084
|
(y) => {
|
|
1090
|
-
console.warn(y),
|
|
1085
|
+
console.warn(y), w({
|
|
1091
1086
|
isLoading: !0,
|
|
1092
1087
|
isAuthenticated: !1,
|
|
1093
1088
|
user: void 0,
|
|
@@ -1095,118 +1090,127 @@ const oe = () => {
|
|
|
1095
1090
|
}), i(), h(), p(), x();
|
|
1096
1091
|
},
|
|
1097
1092
|
[h, i, x, p]
|
|
1098
|
-
), C =
|
|
1093
|
+
), C = z(
|
|
1099
1094
|
async (y) => {
|
|
1100
|
-
|
|
1095
|
+
const { user: O } = A;
|
|
1096
|
+
M(y || ae), await Ur({
|
|
1097
|
+
userId: (O == null ? void 0 : O.userId) || "",
|
|
1101
1098
|
idToken: o,
|
|
1102
1099
|
accessToken: l,
|
|
1103
1100
|
refreshToken: u,
|
|
1104
1101
|
clientId: r,
|
|
1105
1102
|
domain: a
|
|
1106
|
-
}),
|
|
1107
|
-
|
|
1103
|
+
}), w((b) => ({
|
|
1104
|
+
...b,
|
|
1108
1105
|
isLoading: !1
|
|
1109
1106
|
}));
|
|
1110
1107
|
},
|
|
1111
1108
|
[
|
|
1112
1109
|
l,
|
|
1110
|
+
A,
|
|
1113
1111
|
r,
|
|
1114
1112
|
a,
|
|
1115
1113
|
o,
|
|
1116
1114
|
u,
|
|
1117
|
-
|
|
1115
|
+
M
|
|
1118
1116
|
]
|
|
1119
1117
|
);
|
|
1120
|
-
|
|
1118
|
+
V(() => {
|
|
1121
1119
|
if (!n.current)
|
|
1122
|
-
return
|
|
1120
|
+
return A.isLoading && o !== null ? (async () => {
|
|
1123
1121
|
try {
|
|
1124
1122
|
const y = await Y(o);
|
|
1125
|
-
y && y.payload[
|
|
1123
|
+
y && y.payload[_.USER_ID_KEY] !== "" ? w({
|
|
1126
1124
|
isLoading: !1,
|
|
1127
1125
|
isAuthenticated: !0,
|
|
1128
1126
|
user: {
|
|
1129
|
-
userId: y.payload[
|
|
1130
|
-
username: y.payload[
|
|
1127
|
+
userId: y.payload[_.USER_ID_KEY],
|
|
1128
|
+
username: y.payload[_.USERNAME_KEY]
|
|
1131
1129
|
},
|
|
1132
1130
|
logoutReason: ""
|
|
1133
1131
|
}) : await C(ae);
|
|
1134
1132
|
} catch {
|
|
1135
1133
|
await C(ae);
|
|
1136
1134
|
}
|
|
1137
|
-
})() :
|
|
1135
|
+
})() : w((y) => ({
|
|
1138
1136
|
...y,
|
|
1139
1137
|
isLoading: !1
|
|
1140
1138
|
})), () => {
|
|
1141
1139
|
n.current = !0;
|
|
1142
1140
|
};
|
|
1143
|
-
}, [
|
|
1144
|
-
const N = async (y,
|
|
1145
|
-
const
|
|
1146
|
-
if (
|
|
1147
|
-
|
|
1141
|
+
}, [A.isLoading, o, C]);
|
|
1142
|
+
const N = async (y, O, b) => {
|
|
1143
|
+
const I = Dr();
|
|
1144
|
+
if (E(I), w(($) => ({
|
|
1145
|
+
...$,
|
|
1148
1146
|
isLoading: !0
|
|
1149
1147
|
})), i(), h(), p(), b === Q.CODE) {
|
|
1150
|
-
const { code_verifier:
|
|
1151
|
-
nonce:
|
|
1148
|
+
const { code_verifier: $, code_challenge: It } = await Ir(), Me = await Hr({
|
|
1149
|
+
nonce: I,
|
|
1152
1150
|
clientId: r,
|
|
1153
1151
|
code_challenge: It
|
|
1154
1152
|
});
|
|
1155
|
-
if (
|
|
1156
|
-
const
|
|
1153
|
+
if (Me.status) {
|
|
1154
|
+
const F = await ze({
|
|
1157
1155
|
username: y,
|
|
1158
|
-
password:
|
|
1156
|
+
password: O,
|
|
1159
1157
|
clientId: r,
|
|
1160
1158
|
sessionExpiration: t,
|
|
1161
|
-
nonce:
|
|
1159
|
+
nonce: I,
|
|
1162
1160
|
type: b,
|
|
1163
|
-
code:
|
|
1164
|
-
code_verifier:
|
|
1161
|
+
code: Me.code,
|
|
1162
|
+
code_verifier: $,
|
|
1165
1163
|
domain: a
|
|
1166
1164
|
});
|
|
1167
|
-
return
|
|
1165
|
+
return F.status ? (s(F.idToken), d(F.accessToken), m(F.refreshToken), w({
|
|
1168
1166
|
isLoading: !1,
|
|
1169
1167
|
isAuthenticated: !0,
|
|
1170
1168
|
user: {
|
|
1171
|
-
userId:
|
|
1169
|
+
userId: F.userId,
|
|
1172
1170
|
username: y
|
|
1173
1171
|
},
|
|
1174
1172
|
logoutReason: ""
|
|
1175
|
-
}), !0) : (
|
|
1173
|
+
}), !0) : (M(Je), w((_t) => ({
|
|
1174
|
+
..._t,
|
|
1175
|
+
isLoading: !1
|
|
1176
|
+
})), !1);
|
|
1176
1177
|
}
|
|
1177
1178
|
return !1;
|
|
1178
1179
|
}
|
|
1179
|
-
const
|
|
1180
|
+
const W = await ze({
|
|
1180
1181
|
username: y,
|
|
1181
|
-
password:
|
|
1182
|
+
password: O,
|
|
1182
1183
|
clientId: r,
|
|
1183
1184
|
sessionExpiration: t,
|
|
1184
|
-
nonce:
|
|
1185
|
+
nonce: I,
|
|
1185
1186
|
type: b,
|
|
1186
1187
|
domain: a
|
|
1187
1188
|
});
|
|
1188
|
-
return
|
|
1189
|
+
return W.status ? (s(W.idToken), d(W.accessToken), m(W.refreshToken), w({
|
|
1189
1190
|
isLoading: !1,
|
|
1190
1191
|
isAuthenticated: !0,
|
|
1191
1192
|
user: {
|
|
1192
|
-
userId:
|
|
1193
|
+
userId: W.userId,
|
|
1193
1194
|
username: y
|
|
1194
1195
|
}
|
|
1195
|
-
}), !0) : (
|
|
1196
|
-
|
|
1197
|
-
|
|
1196
|
+
}), !0) : (M(Je), w(($) => ({
|
|
1197
|
+
...$,
|
|
1198
|
+
isLoading: !1
|
|
1199
|
+
})), !1);
|
|
1200
|
+
}, J = async (y) => {
|
|
1201
|
+
y == null || y.preventDefault(), await C(Mr);
|
|
1198
1202
|
}, R = async () => {
|
|
1199
|
-
const { isAuthenticated: y, user:
|
|
1203
|
+
const { isAuthenticated: y, user: O } = A;
|
|
1200
1204
|
try {
|
|
1201
|
-
if (y &&
|
|
1205
|
+
if (y && O && O.userId) {
|
|
1202
1206
|
if (l) {
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1207
|
+
const I = await Y(l);
|
|
1208
|
+
if (I && I.payload[_.USER_ID_KEY] !== "")
|
|
1205
1209
|
return l;
|
|
1206
1210
|
}
|
|
1207
|
-
const b = await
|
|
1211
|
+
const b = await D.refreshtoken({
|
|
1208
1212
|
clientId: r,
|
|
1209
|
-
userId:
|
|
1213
|
+
userId: O.userId,
|
|
1210
1214
|
nonce: f,
|
|
1211
1215
|
domain: a
|
|
1212
1216
|
});
|
|
@@ -1217,29 +1221,29 @@ const oe = () => {
|
|
|
1217
1221
|
return await C(Se), "";
|
|
1218
1222
|
}
|
|
1219
1223
|
}, fe = () => {
|
|
1220
|
-
if (
|
|
1224
|
+
if (A.isAuthenticated && o)
|
|
1221
1225
|
return o;
|
|
1222
1226
|
};
|
|
1223
1227
|
return /* @__PURE__ */ c(
|
|
1224
|
-
|
|
1228
|
+
mt.Provider,
|
|
1225
1229
|
{
|
|
1226
|
-
value: { ...
|
|
1230
|
+
value: { ...A, login: N, logout: J, getAccessToken: R, getIdToken: fe },
|
|
1227
1231
|
children: e
|
|
1228
1232
|
}
|
|
1229
1233
|
);
|
|
1230
|
-
}, xe = (e =
|
|
1231
|
-
function
|
|
1234
|
+
}, xe = (e = mt) => Xe(e), an = "user", nn = "assistant", on = "system", sn = "internal", cn = "hidden", ln = "I'm having trouble right now. Please try again later.", dn = "gpt-4", un = 128e3, mn = "action-message", hn = "action-reset", pn = "action-model", gn = "action-restore", fn = "action-location", yn = "action-streaming", bn = "action-search", wn = "action-sort", En = "sassy-saint-", vn = "details", kn = "search", Sn = "sort", Tn = "location", An = "==stats==", jr = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", Ye = (e) => Number.isFinite(e) ? e : 0;
|
|
1235
|
+
function Gr(e) {
|
|
1232
1236
|
return {
|
|
1233
1237
|
days: Math.trunc(e / 864e5),
|
|
1234
1238
|
hours: Math.trunc(e / 36e5 % 24),
|
|
1235
1239
|
minutes: Math.trunc(e / 6e4 % 60),
|
|
1236
1240
|
seconds: Math.trunc(e / 1e3 % 60),
|
|
1237
1241
|
milliseconds: Math.trunc(e % 1e3),
|
|
1238
|
-
microseconds: Math.trunc(
|
|
1239
|
-
nanoseconds: Math.trunc(
|
|
1242
|
+
microseconds: Math.trunc(Ye(e * 1e3) % 1e3),
|
|
1243
|
+
nanoseconds: Math.trunc(Ye(e * 1e6) % 1e3)
|
|
1240
1244
|
};
|
|
1241
1245
|
}
|
|
1242
|
-
function
|
|
1246
|
+
function Vr(e) {
|
|
1243
1247
|
return {
|
|
1244
1248
|
days: e / 86400000n,
|
|
1245
1249
|
hours: e / 3600000n % 24n,
|
|
@@ -1250,44 +1254,44 @@ function Gr(e) {
|
|
|
1250
1254
|
nanoseconds: 0n
|
|
1251
1255
|
};
|
|
1252
1256
|
}
|
|
1253
|
-
function
|
|
1257
|
+
function Jr(e) {
|
|
1254
1258
|
switch (typeof e) {
|
|
1255
1259
|
case "number": {
|
|
1256
1260
|
if (Number.isFinite(e))
|
|
1257
|
-
return
|
|
1261
|
+
return Gr(e);
|
|
1258
1262
|
break;
|
|
1259
1263
|
}
|
|
1260
1264
|
case "bigint":
|
|
1261
|
-
return
|
|
1265
|
+
return Vr(e);
|
|
1262
1266
|
}
|
|
1263
1267
|
throw new TypeError("Expected a finite number or bigint");
|
|
1264
1268
|
}
|
|
1265
|
-
const
|
|
1266
|
-
function
|
|
1269
|
+
const Fr = (e) => e === 0 || e === 0n, zr = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Yr = 1e-7, qr = 24n * 60n * 60n * 1000n;
|
|
1270
|
+
function Qr(e, t) {
|
|
1267
1271
|
const r = typeof e == "bigint";
|
|
1268
1272
|
if (!r && !Number.isFinite(e))
|
|
1269
1273
|
throw new TypeError("Expected a finite number or bigint");
|
|
1270
1274
|
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
1275
|
let a = [];
|
|
1272
1276
|
const n = (d, h) => {
|
|
1273
|
-
const u = Math.floor(d * 10 ** h +
|
|
1277
|
+
const u = Math.floor(d * 10 ** h + Yr);
|
|
1274
1278
|
return (Math.round(u) / 10 ** h).toFixed(h);
|
|
1275
1279
|
}, o = (d, h, u, m) => {
|
|
1276
|
-
if (!((a.length === 0 || !t.colonNotation) &&
|
|
1280
|
+
if (!((a.length === 0 || !t.colonNotation) && Fr(d) && !(t.colonNotation && u === "m"))) {
|
|
1277
1281
|
if (m = m ?? String(d), t.colonNotation) {
|
|
1278
1282
|
const p = m.includes(".") ? m.split(".")[0].length : m.length, f = a.length > 0 ? 2 : 1;
|
|
1279
1283
|
m = "0".repeat(Math.max(0, f - p)) + m;
|
|
1280
1284
|
} else
|
|
1281
|
-
m += t.verbose ? " " +
|
|
1285
|
+
m += t.verbose ? " " + zr(h, d) : u;
|
|
1282
1286
|
a.push(m);
|
|
1283
1287
|
}
|
|
1284
|
-
}, s =
|
|
1288
|
+
}, s = Jr(e), i = BigInt(s.days);
|
|
1285
1289
|
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
1290
|
const d = Number(s.seconds), h = Number(s.milliseconds), u = Number(s.microseconds), m = Number(s.nanoseconds);
|
|
1287
1291
|
if (o(d, "second", "s"), t.formatSubMilliseconds)
|
|
1288
1292
|
o(h, "millisecond", "ms"), o(u, "microsecond", "µs"), o(m, "nanosecond", "ns");
|
|
1289
1293
|
else {
|
|
1290
|
-
const p = h + u / 1e3 + m / 1e6, f = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0,
|
|
1294
|
+
const p = h + u / 1e3 + m / 1e6, f = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, E = p >= 1 ? Math.round(p) : Math.ceil(p), x = f ? p.toFixed(f) : E;
|
|
1291
1295
|
o(
|
|
1292
1296
|
Number.parseFloat(x),
|
|
1293
1297
|
"millisecond",
|
|
@@ -1296,7 +1300,7 @@ function qr(e, t) {
|
|
|
1296
1300
|
);
|
|
1297
1301
|
}
|
|
1298
1302
|
} else {
|
|
1299
|
-
const d = (r ? Number(e %
|
|
1303
|
+
const d = (r ? Number(e % qr) : e) / 1e3 % 60, h = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, u = n(d, h), m = t.keepDecimalsOnWholeSeconds ? u : u.replace(/\.0+$/, "");
|
|
1300
1304
|
o(Number.parseFloat(m), "second", "s", m);
|
|
1301
1305
|
}
|
|
1302
1306
|
if (a.length === 0)
|
|
@@ -1304,7 +1308,7 @@ function qr(e, t) {
|
|
|
1304
1308
|
const l = t.colonNotation ? ":" : " ";
|
|
1305
1309
|
return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), a.join(l);
|
|
1306
1310
|
}
|
|
1307
|
-
const
|
|
1311
|
+
const Xr = process.env.NODE_ENV === "production", Ne = !Xr, Zr = Ne ? "gizmette.local.com" : "gizmette.com", In = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, ht = (e, t) => {
|
|
1308
1312
|
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
1313
|
return {
|
|
1310
1314
|
dir: r,
|
|
@@ -1315,14 +1319,14 @@ const Qr = process.env.NODE_ENV === "production", Ne = !Qr, Xr = Ne ? "gizmette.
|
|
|
1315
1319
|
}, _n = (e) => {
|
|
1316
1320
|
if (!e && e !== 0)
|
|
1317
1321
|
return "N/A";
|
|
1318
|
-
const t =
|
|
1322
|
+
const t = ht(e, !1);
|
|
1319
1323
|
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
1320
|
-
},
|
|
1324
|
+
}, xn = (e) => {
|
|
1321
1325
|
if (!e && e !== 0)
|
|
1322
1326
|
return "N/A";
|
|
1323
|
-
const t =
|
|
1327
|
+
const t = ht(e, !0);
|
|
1324
1328
|
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
1325
|
-
},
|
|
1329
|
+
}, Nn = async () => {
|
|
1326
1330
|
const e = {
|
|
1327
1331
|
/**
|
|
1328
1332
|
* A boolean value that indicates the application would
|
|
@@ -1371,11 +1375,11 @@ const Qr = process.env.NODE_ENV === "production", Ne = !Qr, Xr = Ne ? "gizmette.
|
|
|
1371
1375
|
e
|
|
1372
1376
|
);
|
|
1373
1377
|
});
|
|
1374
|
-
},
|
|
1378
|
+
}, Cn = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ T("div", { className: "flex items-center justify-between", children: [
|
|
1375
1379
|
/* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
|
|
1376
1380
|
/* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
|
|
1377
1381
|
] }) }, `${e}-${r}`)) : null;
|
|
1378
|
-
function
|
|
1382
|
+
function Rn({
|
|
1379
1383
|
data: e,
|
|
1380
1384
|
formatter: t = (r) => r
|
|
1381
1385
|
}) {
|
|
@@ -1387,18 +1391,18 @@ function Cn({
|
|
|
1387
1391
|
);
|
|
1388
1392
|
return t(a ? a / r.length : 0);
|
|
1389
1393
|
}
|
|
1390
|
-
const
|
|
1394
|
+
const On = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Dn = new Intl.NumberFormat("en", {
|
|
1391
1395
|
style: "decimal",
|
|
1392
1396
|
signDisplay: "never",
|
|
1393
1397
|
minimumFractionDigits: 0,
|
|
1394
1398
|
maximumFractionDigits: 0
|
|
1395
|
-
}),
|
|
1399
|
+
}), Mn = (e) => Qr(e, {
|
|
1396
1400
|
secondsDecimalDigits: 2,
|
|
1397
1401
|
unitCount: 2
|
|
1398
|
-
}),
|
|
1402
|
+
}), ea = (e) => g(
|
|
1399
1403
|
"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
1404
|
e || Ne ? "pt-4" : "pt-10"
|
|
1401
|
-
),
|
|
1405
|
+
), Ln = (e, t) => t === 1 ? e : `${e}s`, Ce = (e) => {
|
|
1402
1406
|
let t = "";
|
|
1403
1407
|
if (typeof e == "number" || typeof e == "string")
|
|
1404
1408
|
t = "m-" + e;
|
|
@@ -1407,7 +1411,7 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1407
1411
|
(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(" ");
|
|
1408
1412
|
}
|
|
1409
1413
|
return t;
|
|
1410
|
-
},
|
|
1414
|
+
}, Pn = "av-bubble", qe = "av-button", $n = "av-card", ta = "av-footer", ra = "av-main", Un = "av-messagebox", Hn = "av-panel", Kn = "av-spinner", pt = "icon", gt = "button", aa = "link", na = ({
|
|
1411
1415
|
type: e,
|
|
1412
1416
|
size: t,
|
|
1413
1417
|
labelRight: r,
|
|
@@ -1416,19 +1420,19 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1416
1420
|
}) => {
|
|
1417
1421
|
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";
|
|
1418
1422
|
switch (e) {
|
|
1419
|
-
case
|
|
1423
|
+
case gt:
|
|
1420
1424
|
return g("px-4", {
|
|
1421
1425
|
[o]: t === "small",
|
|
1422
1426
|
[s]: t === "medium",
|
|
1423
1427
|
[i]: t === "large"
|
|
1424
1428
|
});
|
|
1425
|
-
case
|
|
1429
|
+
case aa:
|
|
1426
1430
|
return g("px-4 text-center", {
|
|
1427
1431
|
[o]: t === "small",
|
|
1428
1432
|
[s]: t === "medium",
|
|
1429
1433
|
[i]: t === "large"
|
|
1430
1434
|
});
|
|
1431
|
-
case
|
|
1435
|
+
case pt:
|
|
1432
1436
|
return g("inline-flex items-center", {
|
|
1433
1437
|
"justify-center": n === "center",
|
|
1434
1438
|
"justify-start": n === "left",
|
|
@@ -1441,7 +1445,7 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1441
1445
|
"h-12 px-4 text-lg font-medium": t === "large" && (r || a)
|
|
1442
1446
|
});
|
|
1443
1447
|
}
|
|
1444
|
-
},
|
|
1448
|
+
}, oa = ({
|
|
1445
1449
|
mode: e,
|
|
1446
1450
|
noBackground: t,
|
|
1447
1451
|
noTruncate: r,
|
|
@@ -1473,7 +1477,7 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1473
1477
|
"bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
|
|
1474
1478
|
"bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
|
|
1475
1479
|
});
|
|
1476
|
-
},
|
|
1480
|
+
}, sa = ({
|
|
1477
1481
|
mode: e,
|
|
1478
1482
|
disabled: t,
|
|
1479
1483
|
variant: r
|
|
@@ -1501,7 +1505,7 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1501
1505
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
1502
1506
|
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
|
|
1503
1507
|
});
|
|
1504
|
-
},
|
|
1508
|
+
}, ia = ({
|
|
1505
1509
|
mode: e,
|
|
1506
1510
|
disabled: t,
|
|
1507
1511
|
variant: r
|
|
@@ -1529,7 +1533,7 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1529
1533
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
1530
1534
|
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
|
|
1531
1535
|
});
|
|
1532
|
-
},
|
|
1536
|
+
}, ca = ({
|
|
1533
1537
|
mode: e,
|
|
1534
1538
|
noBorder: t,
|
|
1535
1539
|
variant: r
|
|
@@ -1557,12 +1561,12 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1557
1561
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
1558
1562
|
"border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
|
|
1559
1563
|
});
|
|
1560
|
-
},
|
|
1564
|
+
}, la = ({ focusMode: e }) => g("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
1561
1565
|
"focus:outline-focus-dark": e === "dark",
|
|
1562
1566
|
"focus:outline-focus-light": e === "light",
|
|
1563
1567
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
1564
1568
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
1565
|
-
}),
|
|
1569
|
+
}), ft = ({
|
|
1566
1570
|
type: e,
|
|
1567
1571
|
className: t,
|
|
1568
1572
|
raw: r,
|
|
@@ -1578,25 +1582,25 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1578
1582
|
noBackground: m,
|
|
1579
1583
|
variant: p,
|
|
1580
1584
|
noTruncate: f,
|
|
1581
|
-
align:
|
|
1582
|
-
}) => (p || (p = "primary"), r ? g(
|
|
1583
|
-
|
|
1585
|
+
align: E
|
|
1586
|
+
}) => (p || (p = "primary"), r ? g(qe, t) : g(
|
|
1587
|
+
qe,
|
|
1584
1588
|
t,
|
|
1585
1589
|
Ce(u),
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
oa({ mode: a, variant: p, disabled: o }),
|
|
1590
|
+
oa({ mode: a, variant: p, noBackground: m, noTruncate: f }),
|
|
1591
|
+
na({ type: e, size: i, labelRight: d, labelLeft: h, align: E }),
|
|
1592
|
+
ca({ mode: a, variant: p, noBorder: l }),
|
|
1593
|
+
la({ focusMode: n }),
|
|
1591
1594
|
sa({ mode: a, variant: p, disabled: o }),
|
|
1595
|
+
ia({ mode: a, variant: p, disabled: o }),
|
|
1592
1596
|
{
|
|
1593
1597
|
"w-full": s,
|
|
1594
1598
|
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
1595
1599
|
}
|
|
1596
|
-
)),
|
|
1600
|
+
)), da = (e, t, r) => {
|
|
1597
1601
|
var a;
|
|
1598
1602
|
!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);
|
|
1599
|
-
}, Re =
|
|
1603
|
+
}, Re = B.forwardRef(
|
|
1600
1604
|
(e, t) => {
|
|
1601
1605
|
const { onClick: r, noInternalClick: a = !1, ...n } = e;
|
|
1602
1606
|
return /* @__PURE__ */ c(
|
|
@@ -1604,7 +1608,7 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1604
1608
|
{
|
|
1605
1609
|
ref: t,
|
|
1606
1610
|
onClick: (o) => {
|
|
1607
|
-
|
|
1611
|
+
da(o, a, r);
|
|
1608
1612
|
},
|
|
1609
1613
|
...n
|
|
1610
1614
|
}
|
|
@@ -1612,7 +1616,7 @@ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1612
1616
|
}
|
|
1613
1617
|
);
|
|
1614
1618
|
Re.displayName = "BaseButton";
|
|
1615
|
-
const
|
|
1619
|
+
const yt = B.forwardRef(
|
|
1616
1620
|
({
|
|
1617
1621
|
children: e,
|
|
1618
1622
|
disabled: t = !1,
|
|
@@ -1629,12 +1633,12 @@ const bt = K.forwardRef(
|
|
|
1629
1633
|
labelRight: m,
|
|
1630
1634
|
labelLeft: p,
|
|
1631
1635
|
spacing: f,
|
|
1632
|
-
noBackground:
|
|
1636
|
+
noBackground: E = !1,
|
|
1633
1637
|
align: x = "center",
|
|
1634
|
-
...
|
|
1635
|
-
},
|
|
1636
|
-
const
|
|
1637
|
-
type:
|
|
1638
|
+
...D
|
|
1639
|
+
}, A) => {
|
|
1640
|
+
const w = ft({
|
|
1641
|
+
type: pt,
|
|
1638
1642
|
mode: r,
|
|
1639
1643
|
focusMode: a,
|
|
1640
1644
|
fullWidth: n,
|
|
@@ -1646,9 +1650,9 @@ const bt = K.forwardRef(
|
|
|
1646
1650
|
labelRight: m,
|
|
1647
1651
|
labelLeft: p,
|
|
1648
1652
|
spacing: f,
|
|
1649
|
-
noBackground:
|
|
1653
|
+
noBackground: E,
|
|
1650
1654
|
align: x
|
|
1651
|
-
}),
|
|
1655
|
+
}), M = g({
|
|
1652
1656
|
"text-copy-accent-dark": r === "light" && !i,
|
|
1653
1657
|
"text-copy-light": r === "dark" && !i,
|
|
1654
1658
|
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
|
|
@@ -1657,23 +1661,23 @@ const bt = K.forwardRef(
|
|
|
1657
1661
|
return /* @__PURE__ */ T(
|
|
1658
1662
|
Re,
|
|
1659
1663
|
{
|
|
1660
|
-
ref:
|
|
1661
|
-
className:
|
|
1664
|
+
ref: A,
|
|
1665
|
+
className: w,
|
|
1662
1666
|
disabled: t,
|
|
1663
1667
|
type: s,
|
|
1664
1668
|
"aria-label": d || h,
|
|
1665
|
-
...
|
|
1669
|
+
...D,
|
|
1666
1670
|
children: [
|
|
1667
1671
|
p && /* @__PURE__ */ c("span", { className: "pr-2", children: p }),
|
|
1668
|
-
/* @__PURE__ */ c("div", { className:
|
|
1672
|
+
/* @__PURE__ */ c("div", { className: M, children: e }),
|
|
1669
1673
|
m && /* @__PURE__ */ c("span", { className: "pl-2", children: m })
|
|
1670
1674
|
]
|
|
1671
1675
|
}
|
|
1672
1676
|
);
|
|
1673
1677
|
}
|
|
1674
1678
|
);
|
|
1675
|
-
|
|
1676
|
-
const
|
|
1679
|
+
yt.displayName = "ButtonIcon";
|
|
1680
|
+
const bt = B.forwardRef(
|
|
1677
1681
|
({
|
|
1678
1682
|
children: e,
|
|
1679
1683
|
disabled: t = !1,
|
|
@@ -1689,8 +1693,8 @@ const wt = K.forwardRef(
|
|
|
1689
1693
|
noTruncate: u = !1,
|
|
1690
1694
|
...m
|
|
1691
1695
|
}, p) => {
|
|
1692
|
-
const f =
|
|
1693
|
-
type:
|
|
1696
|
+
const f = ft({
|
|
1697
|
+
type: gt,
|
|
1694
1698
|
mode: r,
|
|
1695
1699
|
focusMode: a,
|
|
1696
1700
|
fullWidth: n,
|
|
@@ -1715,8 +1719,8 @@ const wt = K.forwardRef(
|
|
|
1715
1719
|
);
|
|
1716
1720
|
}
|
|
1717
1721
|
);
|
|
1718
|
-
|
|
1719
|
-
const
|
|
1722
|
+
bt.displayName = "Button";
|
|
1723
|
+
const ua = ({
|
|
1720
1724
|
className: e,
|
|
1721
1725
|
mode: t = "system",
|
|
1722
1726
|
row1: r,
|
|
@@ -1725,7 +1729,7 @@ const da = ({
|
|
|
1725
1729
|
spacing: o,
|
|
1726
1730
|
raw: s = !1
|
|
1727
1731
|
}) => {
|
|
1728
|
-
const i = g(
|
|
1732
|
+
const i = g(ta, e, Ce(o), {
|
|
1729
1733
|
"text-copy-dark": !s && t === "dark",
|
|
1730
1734
|
"text-copy-lighter": !s && t === "light",
|
|
1731
1735
|
"text-copy-dark dark:text-copy-lighter": !s && t === "system",
|
|
@@ -1737,13 +1741,13 @@ const da = ({
|
|
|
1737
1741
|
r && /* @__PURE__ */ c("div", { children: r }),
|
|
1738
1742
|
a && /* @__PURE__ */ c("div", { children: a })
|
|
1739
1743
|
] });
|
|
1740
|
-
},
|
|
1744
|
+
}, ma = ({
|
|
1741
1745
|
children: e,
|
|
1742
1746
|
className: t,
|
|
1743
1747
|
raw: r = !1,
|
|
1744
1748
|
spacing: a
|
|
1745
1749
|
}) => {
|
|
1746
|
-
const n = g(t,
|
|
1750
|
+
const n = g(t, ra, Ce(a), {
|
|
1747
1751
|
"mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
|
|
1748
1752
|
});
|
|
1749
1753
|
return /* @__PURE__ */ c("main", { className: n, children: e });
|
|
@@ -1761,16 +1765,16 @@ try {
|
|
|
1761
1765
|
});
|
|
1762
1766
|
} catch {
|
|
1763
1767
|
}
|
|
1764
|
-
function
|
|
1765
|
-
return
|
|
1768
|
+
function ha(e) {
|
|
1769
|
+
return Ct(() => e.every((t) => t == null) ? () => {
|
|
1766
1770
|
} : (t) => {
|
|
1767
1771
|
e.forEach((r) => {
|
|
1768
1772
|
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
1769
1773
|
});
|
|
1770
1774
|
}, e);
|
|
1771
1775
|
}
|
|
1772
|
-
function
|
|
1773
|
-
const t =
|
|
1776
|
+
function pa(e) {
|
|
1777
|
+
const t = Rt();
|
|
1774
1778
|
if (!e)
|
|
1775
1779
|
return t;
|
|
1776
1780
|
if (typeof e == "number" || typeof e == "string")
|
|
@@ -1780,7 +1784,7 @@ function ha(e) {
|
|
|
1780
1784
|
return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
|
|
1781
1785
|
}
|
|
1782
1786
|
}
|
|
1783
|
-
const
|
|
1787
|
+
const wt = "SET_ANNOUNCEMENT", Et = "CLEAR_ANNOUNCEMENT", ga = {
|
|
1784
1788
|
alert: null,
|
|
1785
1789
|
alertdialog: null,
|
|
1786
1790
|
log: "polite",
|
|
@@ -1788,14 +1792,14 @@ const Et = "SET_ANNOUNCEMENT", vt = "CLEAR_ANNOUNCEMENT", pa = {
|
|
|
1788
1792
|
progressbar: null,
|
|
1789
1793
|
status: "polite",
|
|
1790
1794
|
timer: "assertive"
|
|
1791
|
-
},
|
|
1795
|
+
}, fa = (e, t) => {
|
|
1792
1796
|
switch (t == null ? void 0 : t.type) {
|
|
1793
|
-
case
|
|
1797
|
+
case wt:
|
|
1794
1798
|
return {
|
|
1795
1799
|
...e,
|
|
1796
1800
|
announcement: t.payload
|
|
1797
1801
|
};
|
|
1798
|
-
case
|
|
1802
|
+
case Et:
|
|
1799
1803
|
return {
|
|
1800
1804
|
...e,
|
|
1801
1805
|
announcement: null
|
|
@@ -1803,14 +1807,14 @@ const Et = "SET_ANNOUNCEMENT", vt = "CLEAR_ANNOUNCEMENT", pa = {
|
|
|
1803
1807
|
default:
|
|
1804
1808
|
return e;
|
|
1805
1809
|
}
|
|
1806
|
-
},
|
|
1810
|
+
}, ya = ({
|
|
1807
1811
|
onAnnouncementClear: e,
|
|
1808
1812
|
dispatch: t
|
|
1809
1813
|
}) => {
|
|
1810
1814
|
t({
|
|
1811
|
-
type:
|
|
1815
|
+
type: Et
|
|
1812
1816
|
}), typeof e == "function" && e();
|
|
1813
|
-
},
|
|
1817
|
+
}, Qe = ({
|
|
1814
1818
|
children: e,
|
|
1815
1819
|
clearAnnouncementDelay: t,
|
|
1816
1820
|
clearAnnouncementTimeoutRef: r,
|
|
@@ -1818,16 +1822,16 @@ const Et = "SET_ANNOUNCEMENT", vt = "CLEAR_ANNOUNCEMENT", pa = {
|
|
|
1818
1822
|
dispatch: n
|
|
1819
1823
|
}) => {
|
|
1820
1824
|
(r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && n({
|
|
1821
|
-
type:
|
|
1825
|
+
type: wt,
|
|
1822
1826
|
payload: e
|
|
1823
1827
|
}), t && (r.current = setTimeout(
|
|
1824
|
-
() =>
|
|
1828
|
+
() => ya({
|
|
1825
1829
|
onAnnouncementClear: a,
|
|
1826
1830
|
dispatch: n
|
|
1827
1831
|
}),
|
|
1828
1832
|
t
|
|
1829
1833
|
));
|
|
1830
|
-
},
|
|
1834
|
+
}, ba = ({
|
|
1831
1835
|
children: e,
|
|
1832
1836
|
announcementTimeoutRef: t,
|
|
1833
1837
|
announcementDelay: r,
|
|
@@ -1836,13 +1840,13 @@ const Et = "SET_ANNOUNCEMENT", vt = "CLEAR_ANNOUNCEMENT", pa = {
|
|
|
1836
1840
|
onAnnouncementClear: o,
|
|
1837
1841
|
dispatch: s
|
|
1838
1842
|
}) => {
|
|
1839
|
-
clearTimeout(t.current), r ? t.current = setTimeout(
|
|
1843
|
+
clearTimeout(t.current), r ? t.current = setTimeout(Qe, r, {
|
|
1840
1844
|
children: e,
|
|
1841
1845
|
clearAnnouncementDelay: a,
|
|
1842
1846
|
clearAnnouncementTimeoutRef: n,
|
|
1843
1847
|
onAnnouncementClear: o,
|
|
1844
1848
|
dispatch: s
|
|
1845
|
-
}) :
|
|
1849
|
+
}) : Qe({
|
|
1846
1850
|
children: e,
|
|
1847
1851
|
clearAnnouncementDelay: a,
|
|
1848
1852
|
clearAnnouncementTimeoutRef: n,
|
|
@@ -1850,7 +1854,7 @@ const Et = "SET_ANNOUNCEMENT", vt = "CLEAR_ANNOUNCEMENT", pa = {
|
|
|
1850
1854
|
dispatch: s
|
|
1851
1855
|
});
|
|
1852
1856
|
};
|
|
1853
|
-
function
|
|
1857
|
+
function vt({
|
|
1854
1858
|
children: e,
|
|
1855
1859
|
className: t,
|
|
1856
1860
|
politeness: r,
|
|
@@ -1861,12 +1865,12 @@ function kt({
|
|
|
1861
1865
|
visible: i,
|
|
1862
1866
|
...l
|
|
1863
1867
|
}) {
|
|
1864
|
-
const d =
|
|
1868
|
+
const d = j(), h = j(), [u, m] = Ot(fa, {
|
|
1865
1869
|
announcement: null
|
|
1866
1870
|
});
|
|
1867
1871
|
let p = r;
|
|
1868
|
-
typeof p > "u" && (p = a ?
|
|
1869
|
-
|
|
1872
|
+
typeof p > "u" && (p = a ? ga[a] : "assertive"), V(() => {
|
|
1873
|
+
ba({
|
|
1870
1874
|
announcementTimeoutRef: d,
|
|
1871
1875
|
announcementDelay: n,
|
|
1872
1876
|
children: e,
|
|
@@ -1896,19 +1900,19 @@ function kt({
|
|
|
1896
1900
|
);
|
|
1897
1901
|
}
|
|
1898
1902
|
/*!
|
|
1899
|
-
@versini/ui-private v1.4.
|
|
1903
|
+
@versini/ui-private v1.4.6
|
|
1900
1904
|
© 2024 gizmette.com
|
|
1901
1905
|
*/
|
|
1902
1906
|
try {
|
|
1903
1907
|
window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
|
|
1904
|
-
version: "1.4.
|
|
1905
|
-
buildTime: "07/
|
|
1908
|
+
version: "1.4.6",
|
|
1909
|
+
buildTime: "07/08/2024 04:31 PM EDT",
|
|
1906
1910
|
homepage: "https://github.com/aversini/ui-components",
|
|
1907
1911
|
license: "MIT"
|
|
1908
1912
|
});
|
|
1909
1913
|
} catch {
|
|
1910
1914
|
}
|
|
1911
|
-
const
|
|
1915
|
+
const wa = (e) => {
|
|
1912
1916
|
let t = "";
|
|
1913
1917
|
if (typeof e == "number" || typeof e == "string")
|
|
1914
1918
|
t = "m-" + e;
|
|
@@ -1917,21 +1921,21 @@ const ba = (e) => {
|
|
|
1917
1921
|
(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(" ");
|
|
1918
1922
|
}
|
|
1919
1923
|
return t;
|
|
1920
|
-
},
|
|
1924
|
+
}, kt = "av-text-input", Ea = "av-text-input-wrapper", Te = "av-text-input-helper-text", Bn = "av-text-area", Wn = "av-text-area-wrapper", jn = "av-text-area-helper-text", Gn = "av-text-area__control--right", Vn = "av-toggle", va = ({
|
|
1921
1925
|
mode: e
|
|
1922
1926
|
}) => g({
|
|
1923
1927
|
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
1924
1928
|
"bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
|
|
1925
1929
|
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
|
|
1926
1930
|
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
|
|
1927
|
-
}),
|
|
1931
|
+
}), ka = ({
|
|
1928
1932
|
focusMode: e
|
|
1929
1933
|
}) => g("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
1930
1934
|
"focus:outline-focus-dark": e === "dark",
|
|
1931
1935
|
"focus:outline-focus-light": e === "light",
|
|
1932
1936
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
1933
1937
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
1934
|
-
}),
|
|
1938
|
+
}), Sa = ({
|
|
1935
1939
|
noBorder: e,
|
|
1936
1940
|
error: t
|
|
1937
1941
|
}) => g("border-2", {
|
|
@@ -1939,7 +1943,7 @@ const ba = (e) => {
|
|
|
1939
1943
|
"focus:border-border-dark": !e && t,
|
|
1940
1944
|
"border-border-error-dark": !e && t,
|
|
1941
1945
|
"border-transparent": e
|
|
1942
|
-
}),
|
|
1946
|
+
}), Ta = ({
|
|
1943
1947
|
disabled: e,
|
|
1944
1948
|
raw: t,
|
|
1945
1949
|
error: r,
|
|
@@ -1963,7 +1967,7 @@ const ba = (e) => {
|
|
|
1963
1967
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
|
|
1964
1968
|
"text-copy-lighter dark:text-copy-error-dark": a === "alt-system"
|
|
1965
1969
|
});
|
|
1966
|
-
},
|
|
1970
|
+
}, Aa = ({
|
|
1967
1971
|
error: e,
|
|
1968
1972
|
raw: t,
|
|
1969
1973
|
mode: r,
|
|
@@ -1990,7 +1994,7 @@ const ba = (e) => {
|
|
|
1990
1994
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
|
|
1991
1995
|
"dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
|
|
1992
1996
|
});
|
|
1993
|
-
},
|
|
1997
|
+
}, Ia = ({
|
|
1994
1998
|
className: e,
|
|
1995
1999
|
inputClassName: t,
|
|
1996
2000
|
raw: r,
|
|
@@ -2003,25 +2007,25 @@ const ba = (e) => {
|
|
|
2003
2007
|
}) => {
|
|
2004
2008
|
const d = r ? e : g(
|
|
2005
2009
|
"relative flex w-full flex-col justify-center",
|
|
2006
|
-
|
|
2010
|
+
Ea,
|
|
2007
2011
|
e,
|
|
2008
|
-
|
|
2012
|
+
wa(s)
|
|
2009
2013
|
), h = r ? g(t) : g(
|
|
2010
|
-
|
|
2014
|
+
kt,
|
|
2011
2015
|
t,
|
|
2012
2016
|
"h-12 rounded-md px-4 text-base",
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2017
|
+
va({ mode: i }),
|
|
2018
|
+
ka({ focusMode: l }),
|
|
2019
|
+
Sa({ noBorder: n, error: o }),
|
|
2016
2020
|
{
|
|
2017
2021
|
"disabled:cursor-not-allowed disabled:opacity-50": a
|
|
2018
2022
|
}
|
|
2019
|
-
), u = r ? void 0 : "sr-only", m =
|
|
2023
|
+
), u = r ? void 0 : "sr-only", m = Ta({
|
|
2020
2024
|
disabled: a,
|
|
2021
2025
|
raw: r,
|
|
2022
2026
|
error: o,
|
|
2023
2027
|
mode: i
|
|
2024
|
-
}), p =
|
|
2028
|
+
}), p = Aa({
|
|
2025
2029
|
error: o,
|
|
2026
2030
|
raw: r,
|
|
2027
2031
|
mode: i,
|
|
@@ -2035,7 +2039,7 @@ const ba = (e) => {
|
|
|
2035
2039
|
helperText: p,
|
|
2036
2040
|
rightElement: r ? void 0 : "absolute right-3"
|
|
2037
2041
|
};
|
|
2038
|
-
}, Oe =
|
|
2042
|
+
}, Oe = B.forwardRef(
|
|
2039
2043
|
({
|
|
2040
2044
|
id: e,
|
|
2041
2045
|
name: t,
|
|
@@ -2052,11 +2056,11 @@ const ba = (e) => {
|
|
|
2052
2056
|
labelHidden: m = !1,
|
|
2053
2057
|
type: p = "text",
|
|
2054
2058
|
helperText: f = "",
|
|
2055
|
-
rightElement:
|
|
2059
|
+
rightElement: E,
|
|
2056
2060
|
spacing: x,
|
|
2057
|
-
...
|
|
2058
|
-
},
|
|
2059
|
-
const
|
|
2061
|
+
...D
|
|
2062
|
+
}, A) => {
|
|
2063
|
+
const w = j(null), [M, C] = H(0), N = pa({ id: e, prefix: `${kt}-` }), J = `${t} error, ${f}`, R = Ia({
|
|
2060
2064
|
className: o,
|
|
2061
2065
|
inputClassName: s,
|
|
2062
2066
|
error: a,
|
|
@@ -2067,8 +2071,8 @@ const ba = (e) => {
|
|
|
2067
2071
|
spacing: x,
|
|
2068
2072
|
mode: i
|
|
2069
2073
|
});
|
|
2070
|
-
return
|
|
2071
|
-
|
|
2074
|
+
return Dt(() => {
|
|
2075
|
+
w.current && C(w.current.offsetWidth + 18 + 10);
|
|
2072
2076
|
}, []), /* @__PURE__ */ T("div", { className: R.wrapper, children: [
|
|
2073
2077
|
/* @__PURE__ */ c(
|
|
2074
2078
|
"label",
|
|
@@ -2082,7 +2086,7 @@ const ba = (e) => {
|
|
|
2082
2086
|
/* @__PURE__ */ c(
|
|
2083
2087
|
"input",
|
|
2084
2088
|
{
|
|
2085
|
-
ref:
|
|
2089
|
+
ref: A,
|
|
2086
2090
|
id: N,
|
|
2087
2091
|
name: t,
|
|
2088
2092
|
type: p,
|
|
@@ -2091,8 +2095,8 @@ const ba = (e) => {
|
|
|
2091
2095
|
className: R.input,
|
|
2092
2096
|
...f && { "aria-describedby": `${N}-helper` },
|
|
2093
2097
|
...a && { "aria-invalid": "true" },
|
|
2094
|
-
...
|
|
2095
|
-
...
|
|
2098
|
+
...E && !n && { style: { paddingRight: M } },
|
|
2099
|
+
...D
|
|
2096
2100
|
}
|
|
2097
2101
|
),
|
|
2098
2102
|
!n && !m && /* @__PURE__ */ c(
|
|
@@ -2112,20 +2116,20 @@ const ba = (e) => {
|
|
|
2112
2116
|
children: f
|
|
2113
2117
|
}
|
|
2114
2118
|
),
|
|
2115
|
-
|
|
2119
|
+
E && /* @__PURE__ */ c(
|
|
2116
2120
|
"div",
|
|
2117
2121
|
{
|
|
2118
|
-
ref:
|
|
2122
|
+
ref: w,
|
|
2119
2123
|
className: R.rightElement,
|
|
2120
|
-
children:
|
|
2124
|
+
children: E
|
|
2121
2125
|
}
|
|
2122
2126
|
),
|
|
2123
|
-
a && f && /* @__PURE__ */ c(
|
|
2127
|
+
a && f && /* @__PURE__ */ c(vt, { politeness: "polite", clearAnnouncementDelay: 500, children: J })
|
|
2124
2128
|
] });
|
|
2125
2129
|
}
|
|
2126
2130
|
);
|
|
2127
2131
|
Oe.displayName = "TextInput";
|
|
2128
|
-
const _a = 500,
|
|
2132
|
+
const _a = 500, xa = 5e3, Na = 2e4, St = B.forwardRef(
|
|
2129
2133
|
({
|
|
2130
2134
|
name: e,
|
|
2131
2135
|
disabled: t,
|
|
@@ -2140,43 +2144,43 @@ const _a = 500, Ia = 5e3, xa = 2e4, Tt = K.forwardRef(
|
|
|
2140
2144
|
spacing: h,
|
|
2141
2145
|
...u
|
|
2142
2146
|
}, m) => {
|
|
2143
|
-
const [p, f] =
|
|
2147
|
+
const [p, f] = H(!0), [E, x] = H({
|
|
2144
2148
|
message: null,
|
|
2145
2149
|
politeness: null
|
|
2146
|
-
}),
|
|
2147
|
-
clearTimeout(
|
|
2148
|
-
|
|
2149
|
-
announcementTimeout:
|
|
2150
|
+
}), D = j(!0), A = j(), w = j(null), M = ha([m, w]), C = p ? "Show" : "Hide", N = () => {
|
|
2151
|
+
clearTimeout(A.current), D.current || (A.current = window.setTimeout(() => {
|
|
2152
|
+
D.current = !0, f(!0), x({
|
|
2153
|
+
announcementTimeout: xa,
|
|
2150
2154
|
politeness: "polite",
|
|
2151
2155
|
message: `${r} hiding characters`
|
|
2152
2156
|
}), n && n(!0);
|
|
2153
|
-
},
|
|
2154
|
-
},
|
|
2157
|
+
}, Na));
|
|
2158
|
+
}, J = (b) => {
|
|
2155
2159
|
b.preventDefault();
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2160
|
+
const I = !D.current;
|
|
2161
|
+
D.current = I, N(), f(I), x({
|
|
2158
2162
|
announcementTimeout: _a,
|
|
2159
2163
|
politeness: "assertive",
|
|
2160
|
-
message:
|
|
2161
|
-
}), n && n(
|
|
2164
|
+
message: I ? "Characters hidden" : "Characters showing"
|
|
2165
|
+
}), n && n(I);
|
|
2162
2166
|
}, R = (b) => {
|
|
2163
|
-
var
|
|
2164
|
-
const { relatedTarget:
|
|
2165
|
-
|
|
2167
|
+
var I;
|
|
2168
|
+
const { relatedTarget: W } = b, $ = (I = w.current) == null ? void 0 : I.parentElement;
|
|
2169
|
+
$ != null && $.contains(W) || l && l();
|
|
2166
2170
|
}, fe = (b) => {
|
|
2167
2171
|
N(), s && s(b), R(b);
|
|
2168
2172
|
}, y = (b) => {
|
|
2169
2173
|
N(), i && i(b);
|
|
2170
|
-
},
|
|
2174
|
+
}, O = (b) => {
|
|
2171
2175
|
N(), o && o(b);
|
|
2172
2176
|
};
|
|
2173
|
-
return
|
|
2174
|
-
clearTimeout(
|
|
2177
|
+
return V(() => () => {
|
|
2178
|
+
clearTimeout(A.current);
|
|
2175
2179
|
}, []), /* @__PURE__ */ T(q, { children: [
|
|
2176
2180
|
/* @__PURE__ */ c(
|
|
2177
2181
|
Oe,
|
|
2178
2182
|
{
|
|
2179
|
-
ref:
|
|
2183
|
+
ref: M,
|
|
2180
2184
|
name: e,
|
|
2181
2185
|
label: r,
|
|
2182
2186
|
labelHidden: a,
|
|
@@ -2185,11 +2189,11 @@ const _a = 500, Ia = 5e3, xa = 2e4, Tt = K.forwardRef(
|
|
|
2185
2189
|
spacing: h,
|
|
2186
2190
|
onBlur: fe,
|
|
2187
2191
|
onFocus: y,
|
|
2188
|
-
onChange:
|
|
2189
|
-
rightElement:
|
|
2192
|
+
onChange: O,
|
|
2193
|
+
rightElement: B.cloneElement(d, {
|
|
2190
2194
|
ref: m,
|
|
2191
2195
|
label: C,
|
|
2192
|
-
onClick:
|
|
2196
|
+
onClick: J,
|
|
2193
2197
|
onBlur: R,
|
|
2194
2198
|
disabled: t
|
|
2195
2199
|
}),
|
|
@@ -2197,32 +2201,32 @@ const _a = 500, Ia = 5e3, xa = 2e4, Tt = K.forwardRef(
|
|
|
2197
2201
|
}
|
|
2198
2202
|
),
|
|
2199
2203
|
/* @__PURE__ */ c(
|
|
2200
|
-
|
|
2204
|
+
vt,
|
|
2201
2205
|
{
|
|
2202
2206
|
role: "status",
|
|
2203
|
-
politeness:
|
|
2204
|
-
clearAnnouncementDelay:
|
|
2205
|
-
children:
|
|
2207
|
+
politeness: E.politeness,
|
|
2208
|
+
clearAnnouncementDelay: E.announcementTimeout,
|
|
2209
|
+
children: E.message
|
|
2206
2210
|
}
|
|
2207
2211
|
)
|
|
2208
2212
|
] });
|
|
2209
2213
|
}
|
|
2210
2214
|
);
|
|
2211
|
-
|
|
2215
|
+
St.displayName = "TextInputMask";
|
|
2212
2216
|
/*!
|
|
2213
|
-
@versini/ui-form v1.3.
|
|
2217
|
+
@versini/ui-form v1.3.6
|
|
2214
2218
|
© 2024 gizmette.com
|
|
2215
2219
|
*/
|
|
2216
2220
|
try {
|
|
2217
2221
|
window.__VERSINI_UI_FORM__ || (window.__VERSINI_UI_FORM__ = {
|
|
2218
|
-
version: "1.3.
|
|
2219
|
-
buildTime: "07/
|
|
2222
|
+
version: "1.3.6",
|
|
2223
|
+
buildTime: "07/08/2024 04:31 PM EDT",
|
|
2220
2224
|
homepage: "https://github.com/aversini/ui-components",
|
|
2221
2225
|
license: "MIT"
|
|
2222
2226
|
});
|
|
2223
2227
|
} catch {
|
|
2224
2228
|
}
|
|
2225
|
-
const
|
|
2229
|
+
const Ca = (e) => {
|
|
2226
2230
|
let t = "";
|
|
2227
2231
|
if (typeof e == "number" || typeof e == "string")
|
|
2228
2232
|
t = "m-" + e;
|
|
@@ -2243,7 +2247,7 @@ const Na = (e) => {
|
|
|
2243
2247
|
semantic: l = !1,
|
|
2244
2248
|
...d
|
|
2245
2249
|
}) => {
|
|
2246
|
-
const h =
|
|
2250
|
+
const h = Ca(s), u = g(
|
|
2247
2251
|
h,
|
|
2248
2252
|
a || o
|
|
2249
2253
|
);
|
|
@@ -2278,7 +2282,7 @@ try {
|
|
|
2278
2282
|
});
|
|
2279
2283
|
} catch {
|
|
2280
2284
|
}
|
|
2281
|
-
const
|
|
2285
|
+
const Ra = ({
|
|
2282
2286
|
className: e,
|
|
2283
2287
|
viewBox: t,
|
|
2284
2288
|
spacing: r,
|
|
@@ -2303,7 +2307,7 @@ const Ca = ({
|
|
|
2303
2307
|
}
|
|
2304
2308
|
) })
|
|
2305
2309
|
}
|
|
2306
|
-
),
|
|
2310
|
+
), Oa = ({
|
|
2307
2311
|
className: e,
|
|
2308
2312
|
viewBox: t,
|
|
2309
2313
|
spacing: r,
|
|
@@ -2331,7 +2335,7 @@ const Ca = ({
|
|
|
2331
2335
|
/* @__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" })
|
|
2332
2336
|
]
|
|
2333
2337
|
}
|
|
2334
|
-
),
|
|
2338
|
+
), Da = ({
|
|
2335
2339
|
className: e,
|
|
2336
2340
|
viewBox: t,
|
|
2337
2341
|
spacing: r,
|
|
@@ -2373,7 +2377,7 @@ try {
|
|
|
2373
2377
|
});
|
|
2374
2378
|
} catch {
|
|
2375
2379
|
}
|
|
2376
|
-
const
|
|
2380
|
+
const Ma = (e) => {
|
|
2377
2381
|
let t = "";
|
|
2378
2382
|
if (typeof e == "number" || typeof e == "string")
|
|
2379
2383
|
t = "m-" + e;
|
|
@@ -2382,10 +2386,10 @@ const Da = (e) => {
|
|
|
2382
2386
|
(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(" ");
|
|
2383
2387
|
}
|
|
2384
2388
|
return t;
|
|
2385
|
-
},
|
|
2389
|
+
}, La = "av-flexgrid", se = "av-flexgrid-item", ue = 0.25, Tt = B.createContext({
|
|
2386
2390
|
columnGap: 0,
|
|
2387
2391
|
rowGap: 0
|
|
2388
|
-
}),
|
|
2392
|
+
}), Pa = ({
|
|
2389
2393
|
children: e,
|
|
2390
2394
|
className: t,
|
|
2391
2395
|
columnGap: r = 1,
|
|
@@ -2412,11 +2416,11 @@ const Da = (e) => {
|
|
|
2412
2416
|
marginLeft: r * -1 * ue + "rem",
|
|
2413
2417
|
marginTop: a * -1 * ue + "rem"
|
|
2414
2418
|
}, m = g(
|
|
2415
|
-
|
|
2419
|
+
La,
|
|
2416
2420
|
t,
|
|
2417
2421
|
"box-border flex flex-wrap"
|
|
2418
|
-
), p = { columnGap: r, rowGap: a }, f = d ? "div" :
|
|
2419
|
-
return /* @__PURE__ */ c(f, { ...d ? { className:
|
|
2422
|
+
), p = { columnGap: r, rowGap: a }, f = d ? "div" : B.Fragment;
|
|
2423
|
+
return /* @__PURE__ */ c(f, { ...d ? { className: Ma(d) } : {}, children: /* @__PURE__ */ c("div", { className: m, style: u, ...h, children: /* @__PURE__ */ c(Tt.Provider, { value: p, children: e }) }) });
|
|
2420
2424
|
}, Ae = (e, t) => g({
|
|
2421
2425
|
"basis-1/12": e === 1 && !t,
|
|
2422
2426
|
"sm:basis-1/12": e === 1 && t === "sm",
|
|
@@ -2490,7 +2494,7 @@ const Da = (e) => {
|
|
|
2490
2494
|
"lg:basis-full": e === 12 && t === "lg",
|
|
2491
2495
|
"xl:basis-full": e === 12 && t === "xl",
|
|
2492
2496
|
"2xl:basis-full": e === 12 && t === "2xl"
|
|
2493
|
-
}),
|
|
2497
|
+
}), $a = ({
|
|
2494
2498
|
className: e,
|
|
2495
2499
|
span: t
|
|
2496
2500
|
}) => {
|
|
@@ -2519,10 +2523,10 @@ const Da = (e) => {
|
|
|
2519
2523
|
span: r,
|
|
2520
2524
|
...a
|
|
2521
2525
|
}) => {
|
|
2522
|
-
const { columnGap: n, rowGap: o } =
|
|
2526
|
+
const { columnGap: n, rowGap: o } = Xe(Tt), s = {
|
|
2523
2527
|
paddingLeft: n * ue + "rem",
|
|
2524
2528
|
paddingTop: o * ue + "rem"
|
|
2525
|
-
}, i =
|
|
2529
|
+
}, i = $a({
|
|
2526
2530
|
className: t,
|
|
2527
2531
|
span: r
|
|
2528
2532
|
});
|
|
@@ -2541,7 +2545,7 @@ try {
|
|
|
2541
2545
|
});
|
|
2542
2546
|
} catch {
|
|
2543
2547
|
}
|
|
2544
|
-
const
|
|
2548
|
+
const Ua = "ASK! ME! ANYTHING!", At = "Sassy Saint", Ha = "gizmette.com", Ka = "Log in", Jn = "Log out", Ba = "Password", Wa = "Powered by OpenAI", Fn = "Send", zn = "Profile", Yn = "Statistics", qn = "Chat history", Qn = "About", Xn = "Type your question here", Zn = "Clear chat", eo = "Cancel chat", to = "N/A", ro = {
|
|
2545
2549
|
PREFERENCES: {
|
|
2546
2550
|
TITLE: "User preferences",
|
|
2547
2551
|
NAME: "Name",
|
|
@@ -2573,41 +2577,41 @@ const Pa = "ASK! ME! ANYTHING!", _t = "Sassy Saint", Ua = "gizmette.com", Ha = "
|
|
|
2573
2577
|
ENGINE: "OpenAI model",
|
|
2574
2578
|
PLUGIN: "Plugin"
|
|
2575
2579
|
}
|
|
2576
|
-
},
|
|
2580
|
+
}, ja = ({
|
|
2577
2581
|
serverStats: e
|
|
2578
2582
|
}) => /* @__PURE__ */ c(
|
|
2579
|
-
|
|
2583
|
+
ua,
|
|
2580
2584
|
{
|
|
2581
2585
|
mode: "light",
|
|
2582
2586
|
row1: /* @__PURE__ */ T("div", { children: [
|
|
2583
|
-
|
|
2587
|
+
At,
|
|
2584
2588
|
" v",
|
|
2585
|
-
"3.2.
|
|
2589
|
+
"3.2.2",
|
|
2586
2590
|
" - ",
|
|
2587
|
-
|
|
2591
|
+
Wa,
|
|
2588
2592
|
Ne && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
|
|
2589
2593
|
] }),
|
|
2590
2594
|
row2: /* @__PURE__ */ T("div", { children: [
|
|
2591
2595
|
"© ",
|
|
2592
2596
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
2593
2597
|
" ",
|
|
2594
|
-
|
|
2598
|
+
Ha
|
|
2595
2599
|
] })
|
|
2596
2600
|
}
|
|
2597
|
-
),
|
|
2601
|
+
), Ga = Ze(() => import("./LazyHeader.DioQirr-.js")), Va = () => {
|
|
2598
2602
|
const { isAuthenticated: e } = xe();
|
|
2599
2603
|
return /* @__PURE__ */ T(q, { children: [
|
|
2600
|
-
e && /* @__PURE__ */ c(
|
|
2604
|
+
e && /* @__PURE__ */ c(et, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Ga, {}) }),
|
|
2601
2605
|
/* @__PURE__ */ T("div", { className: "flex items-center justify-center", children: [
|
|
2602
|
-
/* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(
|
|
2606
|
+
/* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(Ra, {}) }),
|
|
2603
2607
|
/* @__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:
|
|
2605
|
-
/* @__PURE__ */ c("h2", { children:
|
|
2608
|
+
/* @__PURE__ */ c("h1", { children: At }),
|
|
2609
|
+
/* @__PURE__ */ c("h2", { children: Ua })
|
|
2606
2610
|
] })
|
|
2607
2611
|
] })
|
|
2608
2612
|
] });
|
|
2609
|
-
},
|
|
2610
|
-
const { login: e, logoutReason: t } = xe(), [r, a] =
|
|
2613
|
+
}, Ja = () => {
|
|
2614
|
+
const { login: e, logoutReason: t } = xe(), [r, a] = H(""), [n, o] = H(""), [s, i] = H(!0), [l, d] = H({
|
|
2611
2615
|
username: "",
|
|
2612
2616
|
password: ""
|
|
2613
2617
|
}), h = async (u) => {
|
|
@@ -2617,18 +2621,18 @@ const Pa = "ASK! ME! ANYTHING!", _t = "Sassy Saint", Ua = "gizmette.com", Ha = "
|
|
|
2617
2621
|
Q.CODE
|
|
2618
2622
|
) || (o(""), a("Invalid username or password"));
|
|
2619
2623
|
};
|
|
2620
|
-
return
|
|
2624
|
+
return V(() => {
|
|
2621
2625
|
var u;
|
|
2622
2626
|
(u = document.getElementById("logo")) == null || u.classList.add("fadeOut"), setTimeout(() => {
|
|
2623
2627
|
var m;
|
|
2624
2628
|
(m = document.getElementById("root")) == null || m.classList.replace("app-hidden", "fadeIn");
|
|
2625
2629
|
}, 500);
|
|
2626
|
-
}),
|
|
2630
|
+
}), V(() => {
|
|
2627
2631
|
t && o(t);
|
|
2628
2632
|
}, [t]), /* @__PURE__ */ T(q, { children: [
|
|
2629
|
-
/* @__PURE__ */ T(
|
|
2630
|
-
/* @__PURE__ */ c("div", { className:
|
|
2631
|
-
/* @__PURE__ */ c("form", { className: "mx-auto mt-5", onSubmit: h, children: /* @__PURE__ */ T(
|
|
2633
|
+
/* @__PURE__ */ T(ma, { children: [
|
|
2634
|
+
/* @__PURE__ */ c("div", { className: ea(), children: /* @__PURE__ */ c(Va, {}) }),
|
|
2635
|
+
/* @__PURE__ */ c("form", { className: "mx-auto mt-5", onSubmit: h, children: /* @__PURE__ */ T(Pa, { rowGap: 7, width: "350px", children: [
|
|
2632
2636
|
/* @__PURE__ */ c(ie, { span: 12, children: n && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: n }) }),
|
|
2633
2637
|
/* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
|
|
2634
2638
|
Oe,
|
|
@@ -2651,7 +2655,7 @@ const Pa = "ASK! ME! ANYTHING!", _t = "Sassy Saint", Ua = "gizmette.com", Ha = "
|
|
|
2651
2655
|
}
|
|
2652
2656
|
) }),
|
|
2653
2657
|
/* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
|
|
2654
|
-
|
|
2658
|
+
St,
|
|
2655
2659
|
{
|
|
2656
2660
|
required: !0,
|
|
2657
2661
|
autoCapitalize: "off",
|
|
@@ -2660,8 +2664,8 @@ const Pa = "ASK! ME! ANYTHING!", _t = "Sassy Saint", Ua = "gizmette.com", Ha = "
|
|
|
2660
2664
|
mode: "dark",
|
|
2661
2665
|
focusMode: "light",
|
|
2662
2666
|
name: "password",
|
|
2663
|
-
label:
|
|
2664
|
-
rightElement: /* @__PURE__ */ c(
|
|
2667
|
+
label: Ba,
|
|
2668
|
+
rightElement: /* @__PURE__ */ c(yt, { focusMode: "light", children: s ? /* @__PURE__ */ c(Da, {}) : /* @__PURE__ */ c(Oa, {}) }),
|
|
2665
2669
|
onMaskChange: i,
|
|
2666
2670
|
onChange: (u) => {
|
|
2667
2671
|
d({
|
|
@@ -2674,99 +2678,100 @@ const Pa = "ASK! ME! ANYTHING!", _t = "Sassy Saint", Ua = "gizmette.com", Ha = "
|
|
|
2674
2678
|
}
|
|
2675
2679
|
) }),
|
|
2676
2680
|
/* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
|
|
2677
|
-
|
|
2681
|
+
bt,
|
|
2678
2682
|
{
|
|
2679
2683
|
focusMode: "light",
|
|
2680
2684
|
fullWidth: !0,
|
|
2681
2685
|
noBorder: !0,
|
|
2682
2686
|
type: "submit",
|
|
2683
2687
|
className: "mb-4 mt-6",
|
|
2684
|
-
children:
|
|
2688
|
+
children: Ka
|
|
2685
2689
|
}
|
|
2686
2690
|
) })
|
|
2687
2691
|
] }) })
|
|
2688
2692
|
] }),
|
|
2689
|
-
/* @__PURE__ */ c(
|
|
2693
|
+
/* @__PURE__ */ c(ja, {})
|
|
2690
2694
|
] });
|
|
2691
|
-
},
|
|
2695
|
+
}, Fa = Ze(() => import("./App.llFW8bC9.js").then((e) => e.App)), za = ({ isComponent: e }) => {
|
|
2692
2696
|
const { isAuthenticated: t } = xe();
|
|
2693
|
-
return t ? /* @__PURE__ */ c(
|
|
2694
|
-
},
|
|
2697
|
+
return t ? /* @__PURE__ */ c(et, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Fa, { isComponent: e }) }) : /* @__PURE__ */ c(Ja, {});
|
|
2698
|
+
}, Ya = ({
|
|
2695
2699
|
isComponent: e = !1,
|
|
2696
|
-
domain: t =
|
|
2697
|
-
}) => /* @__PURE__ */ c(q, { children: /* @__PURE__ */ c(
|
|
2700
|
+
domain: t = Zr
|
|
2701
|
+
}) => /* @__PURE__ */ c(q, { children: /* @__PURE__ */ c(Wr, { clientId: jr, domain: t, children: /* @__PURE__ */ c(za, { isComponent: e }) }) }), qa = ({ domain: e }) => /* @__PURE__ */ c(Ya, { isComponent: !0, domain: e });
|
|
2702
|
+
qa.displayName = "SassySaint-3.2.2";
|
|
2698
2703
|
export {
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2704
|
+
ft as A,
|
|
2705
|
+
Qn as ABOUT_TITLE,
|
|
2706
|
+
fn as ACTION_LOCATION,
|
|
2707
|
+
mn as ACTION_MESSAGE,
|
|
2708
|
+
pn as ACTION_MODEL,
|
|
2709
|
+
hn as ACTION_RESET,
|
|
2710
|
+
gn as ACTION_RESTORE,
|
|
2711
|
+
bn as ACTION_SEARCH,
|
|
2712
|
+
wn as ACTION_SORT,
|
|
2713
|
+
yn as ACTION_STREAMING,
|
|
2714
|
+
ja as AppFooter,
|
|
2715
|
+
eo as CANCEL,
|
|
2716
|
+
ro as CARDS,
|
|
2717
|
+
Zn as CLEAR,
|
|
2718
|
+
$n as E,
|
|
2719
|
+
ln as ERROR_MESSAGE,
|
|
2715
2720
|
Oe as G,
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2721
|
+
un as GPT4_MAX_TOKENS,
|
|
2722
|
+
qn as HISTORY_TITLE,
|
|
2723
|
+
vn as LOCAL_STORAGE_CHAT_DETAILS,
|
|
2724
|
+
Tn as LOCAL_STORAGE_LOCATION,
|
|
2725
|
+
En as LOCAL_STORAGE_PREFIX,
|
|
2726
|
+
kn as LOCAL_STORAGE_SEARCH,
|
|
2727
|
+
Sn as LOCAL_STORAGE_SORT,
|
|
2728
|
+
Jn as LOG_OUT,
|
|
2729
|
+
pa as M,
|
|
2730
|
+
dn as MODEL_GPT4,
|
|
2731
|
+
Va as MessagesContainerHeader,
|
|
2732
|
+
Un as N,
|
|
2733
|
+
to as NA,
|
|
2734
|
+
yt as O,
|
|
2735
|
+
zn as PROFILE_TITLE,
|
|
2736
|
+
nn as ROLE_ASSISTANT,
|
|
2737
|
+
cn as ROLE_HIDDEN,
|
|
2738
|
+
sn as ROLE_INTERNAL,
|
|
2739
|
+
on as ROLE_SYSTEM,
|
|
2740
|
+
an as ROLE_USER,
|
|
2736
2741
|
Ce as S,
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2742
|
+
Fn as SEND,
|
|
2743
|
+
Yn as STATS,
|
|
2744
|
+
An as STATS_SEPARATOR,
|
|
2745
|
+
qa as SassySaint,
|
|
2746
|
+
Xn as TYPE_QUESTION,
|
|
2747
|
+
vt as U,
|
|
2748
|
+
jn as a,
|
|
2749
|
+
Pa as b,
|
|
2750
|
+
ma as c,
|
|
2751
|
+
Kn as c$1,
|
|
2747
2752
|
_n as convertLatitudeToDMS,
|
|
2748
|
-
|
|
2753
|
+
xn as convertLongitudeToDMS,
|
|
2749
2754
|
xe as dr,
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2755
|
+
Mn as durationFormatter,
|
|
2756
|
+
Rn as extractAverage,
|
|
2757
|
+
pt as f,
|
|
2758
|
+
ha as f$1,
|
|
2754
2759
|
De as g,
|
|
2755
|
-
|
|
2756
|
-
|
|
2760
|
+
Nn as getCurrentGeoLocation,
|
|
2761
|
+
ea as getMessageContaintWrapperClass,
|
|
2757
2762
|
Re as i,
|
|
2758
|
-
|
|
2759
|
-
|
|
2763
|
+
Hn as i$1,
|
|
2764
|
+
On as isLastMessageFromRole,
|
|
2760
2765
|
ie as j,
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2766
|
+
Gn as l,
|
|
2767
|
+
Bn as n,
|
|
2768
|
+
Dn as numberFormatter,
|
|
2769
|
+
wa as o,
|
|
2770
|
+
Vn as p,
|
|
2771
|
+
Ln as pluralize,
|
|
2772
|
+
Wn as r,
|
|
2773
|
+
Cn as renderDataAsList,
|
|
2774
|
+
Pn as s,
|
|
2775
|
+
In as truncate,
|
|
2776
|
+
bt as x
|
|
2772
2777
|
};
|