@vezham/hooks 0.2.0-poc-env-1 → 0.2.0-poc-env-1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +19 -21
- package/index.mjs +1320 -1520
- package/package.json +9 -9
package/index.mjs
CHANGED
|
@@ -1,268 +1,64 @@
|
|
|
1
|
-
import w, { forwardRef as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
n = n.replace(/\r\n?/mg, `
|
|
37
|
-
`);
|
|
38
|
-
let r;
|
|
39
|
-
for (; (r = kr.exec(n)) != null; ) {
|
|
40
|
-
const o = r[1];
|
|
41
|
-
let s = r[2] || "";
|
|
42
|
-
s = s.trim();
|
|
43
|
-
const a = s[0];
|
|
44
|
-
s = s.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), a === '"' && (s = s.replace(/\\n/g, `
|
|
45
|
-
`), s = s.replace(/\\r/g, "\r")), t[o] = s;
|
|
46
|
-
}
|
|
47
|
-
return t;
|
|
48
|
-
}
|
|
49
|
-
function Dr(e) {
|
|
50
|
-
const t = Nn(e), n = B.configDotenv({ path: t });
|
|
51
|
-
if (!n.parsed) {
|
|
52
|
-
const a = new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);
|
|
53
|
-
throw a.code = "MISSING_DATA", a;
|
|
54
|
-
}
|
|
55
|
-
const r = On(e).split(","), o = r.length;
|
|
56
|
-
let s;
|
|
57
|
-
for (let a = 0; a < o; a++)
|
|
58
|
-
try {
|
|
59
|
-
const i = r[a].trim(), u = Pr(n, i);
|
|
60
|
-
s = B.decrypt(u.ciphertext, u.key);
|
|
61
|
-
break;
|
|
62
|
-
} catch (i) {
|
|
63
|
-
if (a + 1 >= o)
|
|
64
|
-
throw i;
|
|
65
|
-
}
|
|
66
|
-
return B.parse(s);
|
|
67
|
-
}
|
|
68
|
-
function Mr(e) {
|
|
69
|
-
console.log(`[dotenv@${Ft}][INFO] ${e}`);
|
|
70
|
-
}
|
|
71
|
-
function Ir(e) {
|
|
72
|
-
console.log(`[dotenv@${Ft}][WARN] ${e}`);
|
|
73
|
-
}
|
|
74
|
-
function Ze(e) {
|
|
75
|
-
console.log(`[dotenv@${Ft}][DEBUG] ${e}`);
|
|
76
|
-
}
|
|
77
|
-
function On(e) {
|
|
78
|
-
return e && e.DOTENV_KEY && e.DOTENV_KEY.length > 0 ? e.DOTENV_KEY : process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0 ? process.env.DOTENV_KEY : "";
|
|
79
|
-
}
|
|
80
|
-
function Pr(e, t) {
|
|
81
|
-
let n;
|
|
82
|
-
try {
|
|
83
|
-
n = new URL(t);
|
|
84
|
-
} catch (i) {
|
|
85
|
-
if (i.code === "ERR_INVALID_URL") {
|
|
86
|
-
const u = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
87
|
-
throw u.code = "INVALID_DOTENV_KEY", u;
|
|
88
|
-
}
|
|
89
|
-
throw i;
|
|
90
|
-
}
|
|
91
|
-
const r = n.password;
|
|
92
|
-
if (!r) {
|
|
93
|
-
const i = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
94
|
-
throw i.code = "INVALID_DOTENV_KEY", i;
|
|
95
|
-
}
|
|
96
|
-
const o = n.searchParams.get("environment");
|
|
97
|
-
if (!o) {
|
|
98
|
-
const i = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
99
|
-
throw i.code = "INVALID_DOTENV_KEY", i;
|
|
100
|
-
}
|
|
101
|
-
const s = `DOTENV_VAULT_${o.toUpperCase()}`, a = e.parsed[s];
|
|
102
|
-
if (!a) {
|
|
103
|
-
const i = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);
|
|
104
|
-
throw i.code = "NOT_FOUND_DOTENV_ENVIRONMENT", i;
|
|
105
|
-
}
|
|
106
|
-
return { ciphertext: a, key: r };
|
|
107
|
-
}
|
|
108
|
-
function Nn(e) {
|
|
109
|
-
let t = null;
|
|
110
|
-
if (e && e.path && e.path.length > 0)
|
|
111
|
-
if (Array.isArray(e.path))
|
|
112
|
-
for (const n of e.path)
|
|
113
|
-
Ot.existsSync(n) && (t = n.endsWith(".vault") ? n : `${n}.vault`);
|
|
114
|
-
else
|
|
115
|
-
t = e.path.endsWith(".vault") ? e.path : `${e.path}.vault`;
|
|
116
|
-
else
|
|
117
|
-
t = Bt.resolve(process.cwd(), ".env.vault");
|
|
118
|
-
return Ot.existsSync(t) ? t : null;
|
|
119
|
-
}
|
|
120
|
-
function Xt(e) {
|
|
121
|
-
return e[0] === "~" ? Bt.join(Nr.homedir(), e.slice(1)) : e;
|
|
122
|
-
}
|
|
123
|
-
function Br(e) {
|
|
124
|
-
Mr("Loading env from encrypted .env.vault");
|
|
125
|
-
const t = B._parseVault(e);
|
|
126
|
-
let n = process.env;
|
|
127
|
-
return e && e.processEnv != null && (n = e.processEnv), B.populate(n, t, e), { parsed: t };
|
|
128
|
-
}
|
|
129
|
-
function Fr(e) {
|
|
130
|
-
const t = Bt.resolve(process.cwd(), ".env");
|
|
131
|
-
let n = "utf8";
|
|
132
|
-
const r = !!(e && e.debug);
|
|
133
|
-
e && e.encoding ? n = e.encoding : r && Ze("No encoding is specified. UTF-8 is used by default");
|
|
134
|
-
let o = [t];
|
|
135
|
-
if (e && e.path)
|
|
136
|
-
if (!Array.isArray(e.path))
|
|
137
|
-
o = [Xt(e.path)];
|
|
138
|
-
else {
|
|
139
|
-
o = [];
|
|
140
|
-
for (const u of e.path)
|
|
141
|
-
o.push(Xt(u));
|
|
142
|
-
}
|
|
143
|
-
let s;
|
|
144
|
-
const a = {};
|
|
145
|
-
for (const u of o)
|
|
146
|
-
try {
|
|
147
|
-
const c = B.parse(Ot.readFileSync(u, { encoding: n }));
|
|
148
|
-
B.populate(a, c, e);
|
|
149
|
-
} catch (c) {
|
|
150
|
-
r && Ze(`Failed to load ${u} ${c.message}`), s = c;
|
|
151
|
-
}
|
|
152
|
-
let i = process.env;
|
|
153
|
-
return e && e.processEnv != null && (i = e.processEnv), B.populate(i, a, e), s ? { parsed: a, error: s } : { parsed: a };
|
|
154
|
-
}
|
|
155
|
-
function Ur(e) {
|
|
156
|
-
if (On(e).length === 0)
|
|
157
|
-
return B.configDotenv(e);
|
|
158
|
-
const t = Nn(e);
|
|
159
|
-
return t ? B._configVault(e) : (Ir(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`), B.configDotenv(e));
|
|
160
|
-
}
|
|
161
|
-
function jr(e, t) {
|
|
162
|
-
const n = Buffer.from(t.slice(-64), "hex");
|
|
163
|
-
let r = Buffer.from(e, "base64");
|
|
164
|
-
const o = r.subarray(0, 12), s = r.subarray(-16);
|
|
165
|
-
r = r.subarray(12, -16);
|
|
166
|
-
try {
|
|
167
|
-
const a = Ar.createDecipheriv("aes-256-gcm", n, o);
|
|
168
|
-
return a.setAuthTag(s), `${a.update(r)}${a.final()}`;
|
|
169
|
-
} catch (a) {
|
|
170
|
-
const i = a instanceof RangeError, u = a.message === "Invalid key length", c = a.message === "Unsupported state or unable to authenticate data";
|
|
171
|
-
if (i || u) {
|
|
172
|
-
const d = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
173
|
-
throw d.code = "INVALID_DOTENV_KEY", d;
|
|
174
|
-
} else if (c) {
|
|
175
|
-
const d = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
176
|
-
throw d.code = "DECRYPTION_FAILED", d;
|
|
177
|
-
} else
|
|
178
|
-
throw a;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
function $r(e, t, n = {}) {
|
|
182
|
-
const r = !!(n && n.debug), o = !!(n && n.override);
|
|
183
|
-
if (typeof t != "object") {
|
|
184
|
-
const s = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
185
|
-
throw s.code = "OBJECT_REQUIRED", s;
|
|
186
|
-
}
|
|
187
|
-
for (const s of Object.keys(t))
|
|
188
|
-
Object.prototype.hasOwnProperty.call(e, s) ? (o === !0 && (e[s] = t[s]), r && Ze(o === !0 ? `"${s}" is already defined and WAS overwritten` : `"${s}" is already defined and was NOT overwritten`)) : e[s] = t[s];
|
|
189
|
-
}
|
|
190
|
-
const B = {
|
|
191
|
-
configDotenv: Fr,
|
|
192
|
-
_configVault: Br,
|
|
193
|
-
_parseVault: Dr,
|
|
194
|
-
config: Ur,
|
|
195
|
-
decrypt: jr,
|
|
196
|
-
parse: Lr,
|
|
197
|
-
populate: $r
|
|
198
|
-
};
|
|
199
|
-
ue.exports.configDotenv = B.configDotenv;
|
|
200
|
-
ue.exports._configVault = B._configVault;
|
|
201
|
-
ue.exports._parseVault = B._parseVault;
|
|
202
|
-
ue.exports.config = B.config;
|
|
203
|
-
ue.exports.decrypt = B.decrypt;
|
|
204
|
-
ue.exports.parse = B.parse;
|
|
205
|
-
ue.exports.populate = B.populate;
|
|
206
|
-
ue.exports = B;
|
|
207
|
-
var Hr = ue.exports;
|
|
208
|
-
const Re = {};
|
|
209
|
-
process.env.DOTENV_CONFIG_ENCODING != null && (Re.encoding = process.env.DOTENV_CONFIG_ENCODING);
|
|
210
|
-
process.env.DOTENV_CONFIG_PATH != null && (Re.path = process.env.DOTENV_CONFIG_PATH);
|
|
211
|
-
process.env.DOTENV_CONFIG_DEBUG != null && (Re.debug = process.env.DOTENV_CONFIG_DEBUG);
|
|
212
|
-
process.env.DOTENV_CONFIG_OVERRIDE != null && (Re.override = process.env.DOTENV_CONFIG_OVERRIDE);
|
|
213
|
-
process.env.DOTENV_CONFIG_DOTENV_KEY != null && (Re.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY);
|
|
214
|
-
var zr = Re;
|
|
215
|
-
const Vr = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;
|
|
216
|
-
var qr = function(t) {
|
|
217
|
-
return t.reduce(function(n, r) {
|
|
218
|
-
const o = r.match(Vr);
|
|
219
|
-
return o && (n[o[1]] = o[2]), n;
|
|
220
|
-
}, {});
|
|
221
|
-
};
|
|
222
|
-
(function() {
|
|
223
|
-
Hr.config(
|
|
224
|
-
Object.assign(
|
|
225
|
-
{},
|
|
226
|
-
zr,
|
|
227
|
-
qr(process.argv)
|
|
228
|
-
)
|
|
229
|
-
);
|
|
230
|
-
})();
|
|
231
|
-
const Wr = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
|
|
232
|
-
console.log("import");
|
|
233
|
-
console.table({ ...Wr });
|
|
234
|
-
console.log("process");
|
|
235
|
-
console.table({ ...process.env });
|
|
236
|
-
const ie = { ...process.env };
|
|
237
|
-
console.table(ie);
|
|
238
|
-
const Kr = ie.NODE_ENV !== "production", Yr = ie.V_IS_DEBUG === "true", Le = ie.V_APP_NAME || "v0xapp", Qt = ie.V_BASE_API_URL || "api", Jr = () => Qt === "local" ? ie.V_MOCK_LOCAL_API_URL : Qt === "mock" ? ie.V_MOCK_API_URL : config.domain_type === IAM.DomainType.SANDBOX ? ie.V_APP_SANDBOX_API_URL : config.domain_type === IAM.DomainType.DC ? ie.V_APP_DC_API_URL : ie.V_APP_API_URL, Gr = () => (/* @__PURE__ */ new Date()).toISOString(), De = (e, t, n) => `[vezham] [${Gr()}] [${e}] [${t}] ${n}`, yt = () => !Kr, j = {
|
|
239
|
-
log: (e = Le, t, n) => {
|
|
1
|
+
import w, { forwardRef as ir, isValidElement as ft, useLayoutEffect as lr, useEffect as z, useState as D, useCallback as _, useRef as H, useMemo as cr } from "react";
|
|
2
|
+
import ur from "react-dom";
|
|
3
|
+
const dr = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
|
|
4
|
+
try {
|
|
5
|
+
console.log("V_APP_NAME: ", process.env.V_APP_NAME);
|
|
6
|
+
} catch {
|
|
7
|
+
console.log(
|
|
8
|
+
"isVite:",
|
|
9
|
+
typeof import.meta < "u" && "env" in import.meta
|
|
10
|
+
), console.log("V_APP_NAME:fb");
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
console.log("NODE_ENV: ", process.env.NODE_ENV);
|
|
14
|
+
} catch {
|
|
15
|
+
console.log("NODE_ENV:fb");
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
console.table(import.meta), console.table(dr);
|
|
19
|
+
} catch {
|
|
20
|
+
console.log("import:fb");
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
console.table(process.env);
|
|
24
|
+
} catch {
|
|
25
|
+
console.log("process:fb");
|
|
26
|
+
}
|
|
27
|
+
let K = process.env || import.meta || {};
|
|
28
|
+
const fr = K.NODE_ENV !== "production";
|
|
29
|
+
K.NODE_ENV;
|
|
30
|
+
K.NODE_ENV;
|
|
31
|
+
K.V_IS_PREVIEW;
|
|
32
|
+
const pr = K.V_IS_DEBUG === "true";
|
|
33
|
+
K.V_IS_BETA;
|
|
34
|
+
const Ce = K.V_APP_NAME || "v0xapp", qt = K.V_BASE_API_URL || "api", hr = () => qt === "local" ? K.V_MOCK_LOCAL_API_URL : qt === "mock" ? K.V_MOCK_API_URL : config.domain_type === IAM.DomainType.SANDBOX ? K.V_APP_SANDBOX_API_URL : config.domain_type === IAM.DomainType.DC ? K.V_APP_DC_API_URL : K.V_APP_API_URL, mr = () => (/* @__PURE__ */ new Date()).toISOString(), ke = (e, t, n) => `[vezham] [${mr()}] [${e}] [${t}] ${n}`, pt = () => !fr, U = {
|
|
35
|
+
log: (e = Ce, t, n) => {
|
|
240
36
|
console.log(
|
|
241
|
-
|
|
37
|
+
ke("LOG", e, t),
|
|
242
38
|
n || ""
|
|
243
39
|
);
|
|
244
40
|
},
|
|
245
|
-
debug: (e =
|
|
246
|
-
|
|
247
|
-
|
|
41
|
+
debug: (e = Ce, t, n) => {
|
|
42
|
+
pr && console.info(
|
|
43
|
+
ke("DEBUG", e, t),
|
|
248
44
|
n || ""
|
|
249
45
|
);
|
|
250
46
|
},
|
|
251
|
-
info: (e =
|
|
252
|
-
|
|
253
|
-
|
|
47
|
+
info: (e = Ce, t, n) => {
|
|
48
|
+
pt() || console.info(
|
|
49
|
+
ke("INFO", e, t),
|
|
254
50
|
n || ""
|
|
255
51
|
);
|
|
256
52
|
},
|
|
257
|
-
warn: (e =
|
|
258
|
-
|
|
259
|
-
|
|
53
|
+
warn: (e = Ce, t, n) => {
|
|
54
|
+
pt() || console.warn(
|
|
55
|
+
ke("WARN", e, t),
|
|
260
56
|
n || ""
|
|
261
57
|
);
|
|
262
58
|
},
|
|
263
|
-
error: (e =
|
|
264
|
-
|
|
265
|
-
|
|
59
|
+
error: (e = Ce, t, n) => {
|
|
60
|
+
pt() || console.error(
|
|
61
|
+
ke("ERROR", e, t),
|
|
266
62
|
n || ""
|
|
267
63
|
);
|
|
268
64
|
}
|
|
@@ -273,20 +69,20 @@ const Kr = ie.NODE_ENV !== "production", Yr = ie.V_IS_DEBUG === "true", Le = ie.
|
|
|
273
69
|
// else console.trace(log_msg, object)
|
|
274
70
|
// }
|
|
275
71
|
};
|
|
276
|
-
var
|
|
72
|
+
var gr = (e) => {
|
|
277
73
|
switch (e) {
|
|
278
74
|
case "success":
|
|
279
|
-
return
|
|
75
|
+
return br;
|
|
280
76
|
case "info":
|
|
281
|
-
return
|
|
77
|
+
return Er;
|
|
282
78
|
case "warning":
|
|
283
|
-
return
|
|
79
|
+
return vr;
|
|
284
80
|
case "error":
|
|
285
|
-
return
|
|
81
|
+
return Sr;
|
|
286
82
|
default:
|
|
287
83
|
return null;
|
|
288
84
|
}
|
|
289
|
-
},
|
|
85
|
+
}, wr = Array(12).fill(0), yr = ({ visible: e, className: t }) => w.createElement("div", { className: ["sonner-loading-wrapper", t].filter(Boolean).join(" "), "data-visible": e }, w.createElement("div", { className: "sonner-spinner" }, wr.map((n, r) => w.createElement("div", { className: "sonner-loading-bar", key: `spinner-bar-${r}` })))), br = w.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, w.createElement("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" })), vr = w.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", height: "20", width: "20" }, w.createElement("path", { fillRule: "evenodd", d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" })), Er = w.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, w.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" })), Sr = w.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, w.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" })), xr = w.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }, w.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), w.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" })), Rr = () => {
|
|
290
86
|
let [e, t] = w.useState(document.hidden);
|
|
291
87
|
return w.useEffect(() => {
|
|
292
88
|
let n = () => {
|
|
@@ -294,7 +90,7 @@ var Xr = (e) => {
|
|
|
294
90
|
};
|
|
295
91
|
return document.addEventListener("visibilitychange", n), () => window.removeEventListener("visibilitychange", n);
|
|
296
92
|
}, []), e;
|
|
297
|
-
},
|
|
93
|
+
}, St = 1, Tr = class {
|
|
298
94
|
constructor() {
|
|
299
95
|
this.subscribe = (e) => (this.subscribers.push(e), () => {
|
|
300
96
|
let t = this.subscribers.indexOf(e);
|
|
@@ -305,233 +101,233 @@ var Xr = (e) => {
|
|
|
305
101
|
this.publish(e), this.toasts = [...this.toasts, e];
|
|
306
102
|
}, this.create = (e) => {
|
|
307
103
|
var t;
|
|
308
|
-
let { message: n, ...r } = e, o = typeof (e == null ? void 0 : e.id) == "number" || ((t = e.id) == null ? void 0 : t.length) > 0 ? e.id :
|
|
309
|
-
return this.dismissedToasts.has(o) && this.dismissedToasts.delete(o),
|
|
104
|
+
let { message: n, ...r } = e, o = typeof (e == null ? void 0 : e.id) == "number" || ((t = e.id) == null ? void 0 : t.length) > 0 ? e.id : St++, a = this.toasts.find((i) => i.id === o), s = e.dismissible === void 0 ? !0 : e.dismissible;
|
|
105
|
+
return this.dismissedToasts.has(o) && this.dismissedToasts.delete(o), a ? this.toasts = this.toasts.map((i) => i.id === o ? (this.publish({ ...i, ...e, id: o, title: n }), { ...i, ...e, id: o, dismissible: s, title: n }) : i) : this.addToast({ title: n, ...r, dismissible: s, id: o }), o;
|
|
310
106
|
}, this.dismiss = (e) => (this.dismissedToasts.add(e), e || this.toasts.forEach((t) => {
|
|
311
107
|
this.subscribers.forEach((n) => n({ id: t.id, dismiss: !0 }));
|
|
312
108
|
}), this.subscribers.forEach((t) => t({ id: e, dismiss: !0 })), e), this.message = (e, t) => this.create({ ...t, message: e }), this.error = (e, t) => this.create({ ...t, message: e, type: "error" }), this.success = (e, t) => this.create({ ...t, type: "success", message: e }), this.info = (e, t) => this.create({ ...t, type: "info", message: e }), this.warning = (e, t) => this.create({ ...t, type: "warning", message: e }), this.loading = (e, t) => this.create({ ...t, type: "loading", message: e }), this.promise = (e, t) => {
|
|
313
109
|
if (!t) return;
|
|
314
110
|
let n;
|
|
315
111
|
t.loading !== void 0 && (n = this.create({ ...t, promise: e, type: "loading", message: t.loading, description: typeof t.description != "function" ? t.description : void 0 }));
|
|
316
|
-
let r = e instanceof Promise ? e : e(), o = n !== void 0,
|
|
317
|
-
if (
|
|
318
|
-
else if (
|
|
112
|
+
let r = e instanceof Promise ? e : e(), o = n !== void 0, a, s = r.then(async (u) => {
|
|
113
|
+
if (a = ["resolve", u], w.isValidElement(u)) o = !1, this.create({ id: n, type: "default", message: u });
|
|
114
|
+
else if (Ar(u) && !u.ok) {
|
|
319
115
|
o = !1;
|
|
320
|
-
let c = typeof t.error == "function" ? await t.error(`HTTP error! status: ${u.status}`) : t.error,
|
|
321
|
-
this.create({ id: n, type: "error", message: c, description:
|
|
116
|
+
let c = typeof t.error == "function" ? await t.error(`HTTP error! status: ${u.status}`) : t.error, f = typeof t.description == "function" ? await t.description(`HTTP error! status: ${u.status}`) : t.description;
|
|
117
|
+
this.create({ id: n, type: "error", message: c, description: f });
|
|
322
118
|
} else if (t.success !== void 0) {
|
|
323
119
|
o = !1;
|
|
324
|
-
let c = typeof t.success == "function" ? await t.success(u) : t.success,
|
|
325
|
-
this.create({ id: n, type: "success", message: c, description:
|
|
120
|
+
let c = typeof t.success == "function" ? await t.success(u) : t.success, f = typeof t.description == "function" ? await t.description(u) : t.description;
|
|
121
|
+
this.create({ id: n, type: "success", message: c, description: f });
|
|
326
122
|
}
|
|
327
123
|
}).catch(async (u) => {
|
|
328
|
-
if (
|
|
124
|
+
if (a = ["reject", u], t.error !== void 0) {
|
|
329
125
|
o = !1;
|
|
330
|
-
let c = typeof t.error == "function" ? await t.error(u) : t.error,
|
|
331
|
-
this.create({ id: n, type: "error", message: c, description:
|
|
126
|
+
let c = typeof t.error == "function" ? await t.error(u) : t.error, f = typeof t.description == "function" ? await t.description(u) : t.description;
|
|
127
|
+
this.create({ id: n, type: "error", message: c, description: f });
|
|
332
128
|
}
|
|
333
129
|
}).finally(() => {
|
|
334
130
|
var u;
|
|
335
131
|
o && (this.dismiss(n), n = void 0), (u = t.finally) == null || u.call(t);
|
|
336
|
-
}), i = () => new Promise((u, c) =>
|
|
132
|
+
}), i = () => new Promise((u, c) => s.then(() => a[0] === "reject" ? c(a[1]) : u(a[1])).catch(c));
|
|
337
133
|
return typeof n != "string" && typeof n != "number" ? { unwrap: i } : Object.assign(n, { unwrap: i });
|
|
338
134
|
}, this.custom = (e, t) => {
|
|
339
|
-
let n = (t == null ? void 0 : t.id) ||
|
|
135
|
+
let n = (t == null ? void 0 : t.id) || St++;
|
|
340
136
|
return this.create({ jsx: e(n), id: n, ...t }), n;
|
|
341
137
|
}, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
342
138
|
}
|
|
343
|
-
},
|
|
344
|
-
let n = (t == null ? void 0 : t.id) ||
|
|
345
|
-
return
|
|
346
|
-
},
|
|
347
|
-
function
|
|
139
|
+
}, V = new Tr(), _r = (e, t) => {
|
|
140
|
+
let n = (t == null ? void 0 : t.id) || St++;
|
|
141
|
+
return V.addToast({ title: e, ...t, id: n }), n;
|
|
142
|
+
}, Ar = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", Or = _r, Cr = () => V.toasts, kr = () => V.getActiveToasts(), Nr = Object.assign(Or, { success: V.success, info: V.info, warning: V.warning, error: V.error, custom: V.custom, message: V.message, promise: V.promise, dismiss: V.dismiss, loading: V.loading }, { getHistory: Cr, getToasts: kr });
|
|
143
|
+
function Lr(e, { insertAt: t } = {}) {
|
|
348
144
|
if (typeof document > "u") return;
|
|
349
145
|
let n = document.head || document.getElementsByTagName("head")[0], r = document.createElement("style");
|
|
350
146
|
r.type = "text/css", t === "top" && n.firstChild ? n.insertBefore(r, n.firstChild) : n.appendChild(r), r.styleSheet ? r.styleSheet.cssText = e : r.appendChild(document.createTextNode(e));
|
|
351
147
|
}
|
|
352
|
-
ho(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
148
|
+
Lr(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
353
149
|
`);
|
|
354
|
-
function
|
|
150
|
+
function He(e) {
|
|
355
151
|
return e.label !== void 0;
|
|
356
152
|
}
|
|
357
|
-
var
|
|
153
|
+
var Mr = 3, Pr = "32px", Ir = "16px", $t = 4e3, Dr = 356, Br = 14, Fr = 20, Ur = 200;
|
|
358
154
|
function ne(...e) {
|
|
359
155
|
return e.filter(Boolean).join(" ");
|
|
360
156
|
}
|
|
361
|
-
function
|
|
157
|
+
function jr(e) {
|
|
362
158
|
let [t, n] = e.split("-"), r = [];
|
|
363
159
|
return t && r.push(t), n && r.push(n), r;
|
|
364
160
|
}
|
|
365
|
-
var
|
|
366
|
-
var t, n, r, o,
|
|
367
|
-
let { invert: p, toast: l, unstyled: g, interacting: m, setHeights: y, visibleToasts:
|
|
161
|
+
var zr = (e) => {
|
|
162
|
+
var t, n, r, o, a, s, i, u, c, f, h;
|
|
163
|
+
let { invert: p, toast: l, unstyled: g, interacting: m, setHeights: y, visibleToasts: R, heights: S, index: T, toasts: F, expanded: N, removeToast: E, defaultRichColors: P, closeButton: q, style: se, cancelButtonStyle: st, actionButtonStyle: De, className: ie = "", descriptionClassName: Be = "", duration: ye, position: Fe, gap: fe, loadingIcon: le, expandByDefault: Ue, classNames: x, icons: J, closeButtonAriaLabel: at = "Close toast", pauseWhenPageIsHidden: C } = e, [k, M] = w.useState(null), [$, be] = w.useState(null), [I, it] = w.useState(!1), [_e, je] = w.useState(!1), [Ae, lt] = w.useState(!1), [It, Kn] = w.useState(!1), [Yn, Dt] = w.useState(!1), [Gn, ct] = w.useState(0), [Xn, Bt] = w.useState(0), Oe = w.useRef(l.duration || ye || $t), Ft = w.useRef(null), pe = w.useRef(null), Qn = T === 0, Zn = T + 1 <= R, X = l.type, ve = l.dismissible !== !1, er = l.className || "", tr = l.descriptionClassName || "", ze = w.useMemo(() => S.findIndex((b) => b.toastId === l.id) || 0, [S, l.id]), nr = w.useMemo(() => {
|
|
368
164
|
var b;
|
|
369
|
-
return (b = l.closeButton) != null ? b :
|
|
370
|
-
}, [l.closeButton,
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}, [
|
|
374
|
-
|
|
165
|
+
return (b = l.closeButton) != null ? b : q;
|
|
166
|
+
}, [l.closeButton, q]), Ut = w.useMemo(() => l.duration || ye || $t, [l.duration, ye]), ut = w.useRef(0), Ee = w.useRef(0), jt = w.useRef(0), Se = w.useRef(null), [rr, or] = Fe.split("-"), zt = w.useMemo(() => S.reduce((b, A, L) => L >= ze ? b : b + A.height, 0), [S, ze]), Ht = Rr(), sr = l.invert || p, dt = X === "loading";
|
|
167
|
+
Ee.current = w.useMemo(() => ze * fe + zt, [ze, zt]), w.useEffect(() => {
|
|
168
|
+
Oe.current = Ut;
|
|
169
|
+
}, [Ut]), w.useEffect(() => {
|
|
170
|
+
it(!0);
|
|
375
171
|
}, []), w.useEffect(() => {
|
|
376
|
-
let b =
|
|
172
|
+
let b = pe.current;
|
|
377
173
|
if (b) {
|
|
378
|
-
let
|
|
379
|
-
return
|
|
174
|
+
let A = b.getBoundingClientRect().height;
|
|
175
|
+
return Bt(A), y((L) => [{ toastId: l.id, height: A, position: l.position }, ...L]), () => y((L) => L.filter((Z) => Z.toastId !== l.id));
|
|
380
176
|
}
|
|
381
177
|
}, [y, l.id]), w.useLayoutEffect(() => {
|
|
382
178
|
if (!I) return;
|
|
383
|
-
let b =
|
|
179
|
+
let b = pe.current, A = b.style.height;
|
|
384
180
|
b.style.height = "auto";
|
|
385
181
|
let L = b.getBoundingClientRect().height;
|
|
386
|
-
b.style.height =
|
|
182
|
+
b.style.height = A, Bt(L), y((Z) => Z.find((ee) => ee.toastId === l.id) ? Z.map((ee) => ee.toastId === l.id ? { ...ee, height: L } : ee) : [{ toastId: l.id, height: L, position: l.position }, ...Z]);
|
|
387
183
|
}, [I, l.title, l.description, y, l.id]);
|
|
388
|
-
let
|
|
389
|
-
|
|
184
|
+
let ce = w.useCallback(() => {
|
|
185
|
+
je(!0), ct(Ee.current), y((b) => b.filter((A) => A.toastId !== l.id)), setTimeout(() => {
|
|
390
186
|
E(l);
|
|
391
|
-
},
|
|
392
|
-
}, [l, E, y,
|
|
187
|
+
}, Ur);
|
|
188
|
+
}, [l, E, y, Ee]);
|
|
393
189
|
w.useEffect(() => {
|
|
394
190
|
if (l.promise && X === "loading" || l.duration === 1 / 0 || l.type === "loading") return;
|
|
395
191
|
let b;
|
|
396
|
-
return
|
|
397
|
-
if (
|
|
398
|
-
let
|
|
399
|
-
|
|
192
|
+
return N || m || C && Ht ? (() => {
|
|
193
|
+
if (jt.current < ut.current) {
|
|
194
|
+
let A = (/* @__PURE__ */ new Date()).getTime() - ut.current;
|
|
195
|
+
Oe.current = Oe.current - A;
|
|
400
196
|
}
|
|
401
|
-
|
|
402
|
-
})() :
|
|
403
|
-
var
|
|
404
|
-
(
|
|
405
|
-
},
|
|
406
|
-
}, [
|
|
407
|
-
l.delete &&
|
|
408
|
-
}, [
|
|
409
|
-
function
|
|
410
|
-
var b,
|
|
411
|
-
return
|
|
412
|
-
}
|
|
413
|
-
return w.createElement("li", { tabIndex: 0, ref:
|
|
414
|
-
|
|
197
|
+
jt.current = (/* @__PURE__ */ new Date()).getTime();
|
|
198
|
+
})() : Oe.current !== 1 / 0 && (ut.current = (/* @__PURE__ */ new Date()).getTime(), b = setTimeout(() => {
|
|
199
|
+
var A;
|
|
200
|
+
(A = l.onAutoClose) == null || A.call(l, l), ce();
|
|
201
|
+
}, Oe.current)), () => clearTimeout(b);
|
|
202
|
+
}, [N, m, l, X, C, Ht, ce]), w.useEffect(() => {
|
|
203
|
+
l.delete && ce();
|
|
204
|
+
}, [ce, l.delete]);
|
|
205
|
+
function ar() {
|
|
206
|
+
var b, A, L;
|
|
207
|
+
return J != null && J.loading ? w.createElement("div", { className: ne(x == null ? void 0 : x.loader, (b = l == null ? void 0 : l.classNames) == null ? void 0 : b.loader, "sonner-loader"), "data-visible": X === "loading" }, J.loading) : le ? w.createElement("div", { className: ne(x == null ? void 0 : x.loader, (A = l == null ? void 0 : l.classNames) == null ? void 0 : A.loader, "sonner-loader"), "data-visible": X === "loading" }, le) : w.createElement(yr, { className: ne(x == null ? void 0 : x.loader, (L = l == null ? void 0 : l.classNames) == null ? void 0 : L.loader), visible: X === "loading" });
|
|
208
|
+
}
|
|
209
|
+
return w.createElement("li", { tabIndex: 0, ref: pe, className: ne(ie, er, x == null ? void 0 : x.toast, (t = l == null ? void 0 : l.classNames) == null ? void 0 : t.toast, x == null ? void 0 : x.default, x == null ? void 0 : x[X], (n = l == null ? void 0 : l.classNames) == null ? void 0 : n[X]), "data-sonner-toast": "", "data-rich-colors": (r = l.richColors) != null ? r : P, "data-styled": !(l.jsx || l.unstyled || g), "data-mounted": I, "data-promise": !!l.promise, "data-swiped": Yn, "data-removed": _e, "data-visible": Zn, "data-y-position": rr, "data-x-position": or, "data-index": T, "data-front": Qn, "data-swiping": Ae, "data-dismissible": ve, "data-type": X, "data-invert": sr, "data-swipe-out": It, "data-swipe-direction": $, "data-expanded": !!(N || Ue && I), style: { "--index": T, "--toasts-before": T, "--z-index": F.length - T, "--offset": `${_e ? Gn : Ee.current}px`, "--initial-height": Ue ? "auto" : `${Xn}px`, ...se, ...l.style }, onDragEnd: () => {
|
|
210
|
+
lt(!1), M(null), Se.current = null;
|
|
415
211
|
}, onPointerDown: (b) => {
|
|
416
|
-
|
|
212
|
+
dt || !ve || (Ft.current = /* @__PURE__ */ new Date(), ct(Ee.current), b.target.setPointerCapture(b.pointerId), b.target.tagName !== "BUTTON" && (lt(!0), Se.current = { x: b.clientX, y: b.clientY }));
|
|
417
213
|
}, onPointerUp: () => {
|
|
418
|
-
var b,
|
|
419
|
-
if (
|
|
420
|
-
|
|
421
|
-
let ee = Number(((b =
|
|
422
|
-
if (Math.abs(te) >=
|
|
423
|
-
|
|
214
|
+
var b, A, L, Z;
|
|
215
|
+
if (It || !ve) return;
|
|
216
|
+
Se.current = null;
|
|
217
|
+
let ee = Number(((b = pe.current) == null ? void 0 : b.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), ue = Number(((A = pe.current) == null ? void 0 : A.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), he = (/* @__PURE__ */ new Date()).getTime() - ((L = Ft.current) == null ? void 0 : L.getTime()), te = k === "x" ? ee : ue, de = Math.abs(te) / he;
|
|
218
|
+
if (Math.abs(te) >= Fr || de > 0.11) {
|
|
219
|
+
ct(Ee.current), (Z = l.onDismiss) == null || Z.call(l, l), be(k === "x" ? ee > 0 ? "right" : "left" : ue > 0 ? "down" : "up"), ce(), Kn(!0), Dt(!1);
|
|
424
220
|
return;
|
|
425
221
|
}
|
|
426
|
-
|
|
222
|
+
lt(!1), M(null);
|
|
427
223
|
}, onPointerMove: (b) => {
|
|
428
|
-
var
|
|
429
|
-
if (!
|
|
430
|
-
let
|
|
431
|
-
!
|
|
432
|
-
let
|
|
433
|
-
|
|
434
|
-
} },
|
|
224
|
+
var A, L, Z, ee;
|
|
225
|
+
if (!Se.current || !ve || ((A = window.getSelection()) == null ? void 0 : A.toString().length) > 0) return;
|
|
226
|
+
let ue = b.clientY - Se.current.y, he = b.clientX - Se.current.x, te = (L = e.swipeDirections) != null ? L : jr(Fe);
|
|
227
|
+
!k && (Math.abs(he) > 1 || Math.abs(ue) > 1) && M(Math.abs(he) > Math.abs(ue) ? "x" : "y");
|
|
228
|
+
let de = { x: 0, y: 0 };
|
|
229
|
+
k === "y" ? (te.includes("top") || te.includes("bottom")) && (te.includes("top") && ue < 0 || te.includes("bottom") && ue > 0) && (de.y = ue) : k === "x" && (te.includes("left") || te.includes("right")) && (te.includes("left") && he < 0 || te.includes("right") && he > 0) && (de.x = he), (Math.abs(de.x) > 0 || Math.abs(de.y) > 0) && Dt(!0), (Z = pe.current) == null || Z.style.setProperty("--swipe-amount-x", `${de.x}px`), (ee = pe.current) == null || ee.style.setProperty("--swipe-amount-y", `${de.y}px`);
|
|
230
|
+
} }, nr && !l.jsx ? w.createElement("button", { "aria-label": at, "data-disabled": dt, "data-close-button": !0, onClick: dt || !ve ? () => {
|
|
435
231
|
} : () => {
|
|
436
232
|
var b;
|
|
437
|
-
|
|
438
|
-
}, className: ne(x == null ? void 0 : x.closeButton, (o = l == null ? void 0 : l.classNames) == null ? void 0 : o.closeButton) }, (
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
}, className: ne(x == null ? void 0 : x.cancelButton, (
|
|
442
|
-
var
|
|
443
|
-
|
|
233
|
+
ce(), (b = l.onDismiss) == null || b.call(l, l);
|
|
234
|
+
}, className: ne(x == null ? void 0 : x.closeButton, (o = l == null ? void 0 : l.classNames) == null ? void 0 : o.closeButton) }, (a = J == null ? void 0 : J.close) != null ? a : xr) : null, l.jsx || ft(l.title) ? l.jsx ? l.jsx : typeof l.title == "function" ? l.title() : l.title : w.createElement(w.Fragment, null, X || l.icon || l.promise ? w.createElement("div", { "data-icon": "", className: ne(x == null ? void 0 : x.icon, (s = l == null ? void 0 : l.classNames) == null ? void 0 : s.icon) }, l.promise || l.type === "loading" && !l.icon ? l.icon || ar() : null, l.type !== "loading" ? l.icon || (J == null ? void 0 : J[X]) || gr(X) : null) : null, w.createElement("div", { "data-content": "", className: ne(x == null ? void 0 : x.content, (i = l == null ? void 0 : l.classNames) == null ? void 0 : i.content) }, w.createElement("div", { "data-title": "", className: ne(x == null ? void 0 : x.title, (u = l == null ? void 0 : l.classNames) == null ? void 0 : u.title) }, typeof l.title == "function" ? l.title() : l.title), l.description ? w.createElement("div", { "data-description": "", className: ne(Be, tr, x == null ? void 0 : x.description, (c = l == null ? void 0 : l.classNames) == null ? void 0 : c.description) }, typeof l.description == "function" ? l.description() : l.description) : null), ft(l.cancel) ? l.cancel : l.cancel && He(l.cancel) ? w.createElement("button", { "data-button": !0, "data-cancel": !0, style: l.cancelButtonStyle || st, onClick: (b) => {
|
|
235
|
+
var A, L;
|
|
236
|
+
He(l.cancel) && ve && ((L = (A = l.cancel).onClick) == null || L.call(A, b), ce());
|
|
237
|
+
}, className: ne(x == null ? void 0 : x.cancelButton, (f = l == null ? void 0 : l.classNames) == null ? void 0 : f.cancelButton) }, l.cancel.label) : null, ft(l.action) ? l.action : l.action && He(l.action) ? w.createElement("button", { "data-button": !0, "data-action": !0, style: l.actionButtonStyle || De, onClick: (b) => {
|
|
238
|
+
var A, L;
|
|
239
|
+
He(l.action) && ((L = (A = l.action).onClick) == null || L.call(A, b), !b.defaultPrevented && ce());
|
|
444
240
|
}, className: ne(x == null ? void 0 : x.actionButton, (h = l == null ? void 0 : l.classNames) == null ? void 0 : h.actionButton) }, l.action.label) : null));
|
|
445
241
|
};
|
|
446
|
-
function
|
|
242
|
+
function Vt() {
|
|
447
243
|
if (typeof window > "u" || typeof document > "u") return "ltr";
|
|
448
244
|
let e = document.documentElement.getAttribute("dir");
|
|
449
245
|
return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
|
|
450
246
|
}
|
|
451
|
-
function
|
|
247
|
+
function Hr(e, t) {
|
|
452
248
|
let n = {};
|
|
453
249
|
return [e, t].forEach((r, o) => {
|
|
454
|
-
let
|
|
250
|
+
let a = o === 1, s = a ? "--mobile-offset" : "--offset", i = a ? Ir : Pr;
|
|
455
251
|
function u(c) {
|
|
456
|
-
["top", "right", "bottom", "left"].forEach((
|
|
457
|
-
n[`${
|
|
252
|
+
["top", "right", "bottom", "left"].forEach((f) => {
|
|
253
|
+
n[`${s}-${f}`] = typeof c == "number" ? `${c}px` : c;
|
|
458
254
|
});
|
|
459
255
|
}
|
|
460
256
|
typeof r == "number" || typeof r == "string" ? u(r) : typeof r == "object" ? ["top", "right", "bottom", "left"].forEach((c) => {
|
|
461
|
-
r[c] === void 0 ? n[`${
|
|
257
|
+
r[c] === void 0 ? n[`${s}-${c}`] = i : n[`${s}-${c}`] = typeof r[c] == "number" ? `${r[c]}px` : r[c];
|
|
462
258
|
}) : u(i);
|
|
463
259
|
}), n;
|
|
464
260
|
}
|
|
465
|
-
|
|
466
|
-
let { invert: n, position: r = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand:
|
|
467
|
-
|
|
468
|
-
var
|
|
469
|
-
return (
|
|
261
|
+
ir(function(e, t) {
|
|
262
|
+
let { invert: n, position: r = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand: a, closeButton: s, className: i, offset: u, mobileOffset: c, theme: f = "light", richColors: h, duration: p, style: l, visibleToasts: g = Mr, toastOptions: m, dir: y = Vt(), gap: R = Br, loadingIcon: S, icons: T, containerAriaLabel: F = "Notifications", pauseWhenPageIsHidden: N } = e, [E, P] = w.useState([]), q = w.useMemo(() => Array.from(new Set([r].concat(E.filter((C) => C.position).map((C) => C.position)))), [E, r]), [se, st] = w.useState([]), [De, ie] = w.useState(!1), [Be, ye] = w.useState(!1), [Fe, fe] = w.useState(f !== "system" ? f : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), le = w.useRef(null), Ue = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), x = w.useRef(null), J = w.useRef(!1), at = w.useCallback((C) => {
|
|
263
|
+
P((k) => {
|
|
264
|
+
var M;
|
|
265
|
+
return (M = k.find(($) => $.id === C.id)) != null && M.delete || V.dismiss(C.id), k.filter(({ id: $ }) => $ !== C.id);
|
|
470
266
|
});
|
|
471
267
|
}, []);
|
|
472
|
-
return w.useEffect(() =>
|
|
473
|
-
if (
|
|
474
|
-
|
|
268
|
+
return w.useEffect(() => V.subscribe((C) => {
|
|
269
|
+
if (C.dismiss) {
|
|
270
|
+
P((k) => k.map((M) => M.id === C.id ? { ...M, delete: !0 } : M));
|
|
475
271
|
return;
|
|
476
272
|
}
|
|
477
273
|
setTimeout(() => {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
let
|
|
481
|
-
return
|
|
274
|
+
ur.flushSync(() => {
|
|
275
|
+
P((k) => {
|
|
276
|
+
let M = k.findIndex(($) => $.id === C.id);
|
|
277
|
+
return M !== -1 ? [...k.slice(0, M), { ...k[M], ...C }, ...k.slice(M + 1)] : [C, ...k];
|
|
482
278
|
});
|
|
483
279
|
});
|
|
484
280
|
});
|
|
485
281
|
}), []), w.useEffect(() => {
|
|
486
|
-
if (
|
|
487
|
-
|
|
282
|
+
if (f !== "system") {
|
|
283
|
+
fe(f);
|
|
488
284
|
return;
|
|
489
285
|
}
|
|
490
|
-
if (
|
|
491
|
-
let
|
|
286
|
+
if (f === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? fe("dark") : fe("light")), typeof window > "u") return;
|
|
287
|
+
let C = window.matchMedia("(prefers-color-scheme: dark)");
|
|
492
288
|
try {
|
|
493
|
-
|
|
494
|
-
|
|
289
|
+
C.addEventListener("change", ({ matches: k }) => {
|
|
290
|
+
fe(k ? "dark" : "light");
|
|
495
291
|
});
|
|
496
292
|
} catch {
|
|
497
|
-
|
|
293
|
+
C.addListener(({ matches: M }) => {
|
|
498
294
|
try {
|
|
499
|
-
|
|
500
|
-
} catch (
|
|
501
|
-
console.error(
|
|
295
|
+
fe(M ? "dark" : "light");
|
|
296
|
+
} catch ($) {
|
|
297
|
+
console.error($);
|
|
502
298
|
}
|
|
503
299
|
});
|
|
504
300
|
}
|
|
505
|
-
}, [
|
|
506
|
-
E.length <= 1 &&
|
|
301
|
+
}, [f]), w.useEffect(() => {
|
|
302
|
+
E.length <= 1 && ie(!1);
|
|
507
303
|
}, [E]), w.useEffect(() => {
|
|
508
|
-
let
|
|
509
|
-
var
|
|
510
|
-
o.every((
|
|
304
|
+
let C = (k) => {
|
|
305
|
+
var M, $;
|
|
306
|
+
o.every((be) => k[be] || k.code === be) && (ie(!0), (M = le.current) == null || M.focus()), k.code === "Escape" && (document.activeElement === le.current || ($ = le.current) != null && $.contains(document.activeElement)) && ie(!1);
|
|
511
307
|
};
|
|
512
|
-
return document.addEventListener("keydown",
|
|
308
|
+
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
513
309
|
}, [o]), w.useEffect(() => {
|
|
514
|
-
if (
|
|
515
|
-
x.current && (x.current.focus({ preventScroll: !0 }), x.current = null,
|
|
310
|
+
if (le.current) return () => {
|
|
311
|
+
x.current && (x.current.focus({ preventScroll: !0 }), x.current = null, J.current = !1);
|
|
516
312
|
};
|
|
517
|
-
}, [
|
|
518
|
-
var
|
|
519
|
-
let [
|
|
520
|
-
return E.length ? w.createElement("ol", { key:
|
|
521
|
-
|
|
313
|
+
}, [le.current]), w.createElement("section", { ref: t, "aria-label": `${F} ${Ue}`, tabIndex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", suppressHydrationWarning: !0 }, q.map((C, k) => {
|
|
314
|
+
var M;
|
|
315
|
+
let [$, be] = C.split("-");
|
|
316
|
+
return E.length ? w.createElement("ol", { key: C, dir: y === "auto" ? Vt() : y, tabIndex: -1, ref: le, className: i, "data-sonner-toaster": !0, "data-theme": Fe, "data-y-position": $, "data-lifted": De && E.length > 1 && !a, "data-x-position": be, style: { "--front-toast-height": `${((M = se[0]) == null ? void 0 : M.height) || 0}px`, "--width": `${Dr}px`, "--gap": `${R}px`, ...l, ...Hr(u, c) }, onBlur: (I) => {
|
|
317
|
+
J.current && !I.currentTarget.contains(I.relatedTarget) && (J.current = !1, x.current && (x.current.focus({ preventScroll: !0 }), x.current = null));
|
|
522
318
|
}, onFocus: (I) => {
|
|
523
|
-
I.target instanceof HTMLElement && I.target.dataset.dismissible === "false" ||
|
|
524
|
-
}, onMouseEnter: () =>
|
|
525
|
-
|
|
526
|
-
}, onDragEnd: () =>
|
|
527
|
-
I.target instanceof HTMLElement && I.target.dataset.dismissible === "false" ||
|
|
528
|
-
}, onPointerUp: () =>
|
|
529
|
-
var
|
|
530
|
-
return w.createElement(
|
|
319
|
+
I.target instanceof HTMLElement && I.target.dataset.dismissible === "false" || J.current || (J.current = !0, x.current = I.relatedTarget);
|
|
320
|
+
}, onMouseEnter: () => ie(!0), onMouseMove: () => ie(!0), onMouseLeave: () => {
|
|
321
|
+
Be || ie(!1);
|
|
322
|
+
}, onDragEnd: () => ie(!1), onPointerDown: (I) => {
|
|
323
|
+
I.target instanceof HTMLElement && I.target.dataset.dismissible === "false" || ye(!0);
|
|
324
|
+
}, onPointerUp: () => ye(!1) }, E.filter((I) => !I.position && k === 0 || I.position === C).map((I, it) => {
|
|
325
|
+
var _e, je;
|
|
326
|
+
return w.createElement(zr, { key: I.id, icons: T, index: it, toast: I, defaultRichColors: h, duration: (_e = m == null ? void 0 : m.duration) != null ? _e : p, className: m == null ? void 0 : m.className, descriptionClassName: m == null ? void 0 : m.descriptionClassName, invert: n, visibleToasts: g, closeButton: (je = m == null ? void 0 : m.closeButton) != null ? je : s, interacting: Be, position: C, style: m == null ? void 0 : m.style, unstyled: m == null ? void 0 : m.unstyled, classNames: m == null ? void 0 : m.classNames, cancelButtonStyle: m == null ? void 0 : m.cancelButtonStyle, actionButtonStyle: m == null ? void 0 : m.actionButtonStyle, removeToast: at, toasts: E.filter((Ae) => Ae.position == I.position), heights: se.filter((Ae) => Ae.position == I.position), setHeights: st, expandByDefault: a, gap: R, loadingIcon: S, expanded: De, pauseWhenPageIsHidden: N, swipeDirections: e.swipeDirections });
|
|
531
327
|
})) : null;
|
|
532
328
|
}));
|
|
533
329
|
});
|
|
534
|
-
function
|
|
330
|
+
function qr() {
|
|
535
331
|
return { toast: async ({
|
|
536
332
|
id: t,
|
|
537
333
|
title: n,
|
|
@@ -541,159 +337,163 @@ function _o() {
|
|
|
541
337
|
onClick: () => {
|
|
542
338
|
}
|
|
543
339
|
},
|
|
544
|
-
...
|
|
340
|
+
...a
|
|
545
341
|
}) => {
|
|
546
|
-
const
|
|
547
|
-
o.label && (
|
|
342
|
+
const s = { description: r };
|
|
343
|
+
o.label && (s.action = { label: o.label, onClick: o.onClick }), Nr(n, s);
|
|
548
344
|
} };
|
|
549
345
|
}
|
|
550
|
-
var
|
|
551
|
-
|
|
346
|
+
var qe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
347
|
+
function $r(e) {
|
|
348
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
349
|
+
}
|
|
350
|
+
var Vr = "Expected a function", Wt = NaN, Wr = "[object Symbol]", Jr = /^\s+|\s+$/g, Kr = /^[-+]0x[0-9a-f]+$/i, Yr = /^0b[01]+$/i, Gr = /^0o[0-7]+$/i, Xr = parseInt, Qr = typeof qe == "object" && qe && qe.Object === Object && qe, Zr = typeof self == "object" && self && self.Object === Object && self, eo = Qr || Zr || Function("return this")(), to = Object.prototype, no = to.toString, ro = Math.max, oo = Math.min, ht = function() {
|
|
351
|
+
return eo.Date.now();
|
|
552
352
|
};
|
|
553
|
-
function
|
|
554
|
-
var r, o,
|
|
353
|
+
function so(e, t, n) {
|
|
354
|
+
var r, o, a, s, i, u, c = 0, f = !1, h = !1, p = !0;
|
|
555
355
|
if (typeof e != "function")
|
|
556
|
-
throw new TypeError(
|
|
557
|
-
t =
|
|
356
|
+
throw new TypeError(Vr);
|
|
357
|
+
t = Jt(t) || 0, xt(n) && (f = !!n.leading, h = "maxWait" in n, a = h ? ro(Jt(n.maxWait) || 0, t) : a, p = "trailing" in n ? !!n.trailing : p);
|
|
558
358
|
function l(E) {
|
|
559
|
-
var
|
|
560
|
-
return r = o = void 0, c = E,
|
|
359
|
+
var P = r, q = o;
|
|
360
|
+
return r = o = void 0, c = E, s = e.apply(q, P), s;
|
|
561
361
|
}
|
|
562
362
|
function g(E) {
|
|
563
|
-
return c = E, i = setTimeout(
|
|
363
|
+
return c = E, i = setTimeout(R, t), f ? l(E) : s;
|
|
564
364
|
}
|
|
565
365
|
function m(E) {
|
|
566
|
-
var
|
|
567
|
-
return h ?
|
|
366
|
+
var P = E - u, q = E - c, se = t - P;
|
|
367
|
+
return h ? oo(se, a - q) : se;
|
|
568
368
|
}
|
|
569
369
|
function y(E) {
|
|
570
|
-
var
|
|
571
|
-
return u === void 0 ||
|
|
370
|
+
var P = E - u, q = E - c;
|
|
371
|
+
return u === void 0 || P >= t || P < 0 || h && q >= a;
|
|
572
372
|
}
|
|
573
|
-
function
|
|
574
|
-
var E =
|
|
373
|
+
function R() {
|
|
374
|
+
var E = ht();
|
|
575
375
|
if (y(E))
|
|
576
376
|
return S(E);
|
|
577
|
-
i = setTimeout(
|
|
377
|
+
i = setTimeout(R, m(E));
|
|
578
378
|
}
|
|
579
379
|
function S(E) {
|
|
580
|
-
return i = void 0, p && r ? l(E) : (r = o = void 0,
|
|
380
|
+
return i = void 0, p && r ? l(E) : (r = o = void 0, s);
|
|
581
381
|
}
|
|
582
|
-
function
|
|
382
|
+
function T() {
|
|
583
383
|
i !== void 0 && clearTimeout(i), c = 0, r = u = o = i = void 0;
|
|
584
384
|
}
|
|
585
|
-
function
|
|
586
|
-
return i === void 0 ?
|
|
385
|
+
function F() {
|
|
386
|
+
return i === void 0 ? s : S(ht());
|
|
587
387
|
}
|
|
588
|
-
function
|
|
589
|
-
var E =
|
|
590
|
-
if (r = arguments, o = this, u = E,
|
|
388
|
+
function N() {
|
|
389
|
+
var E = ht(), P = y(E);
|
|
390
|
+
if (r = arguments, o = this, u = E, P) {
|
|
591
391
|
if (i === void 0)
|
|
592
392
|
return g(u);
|
|
593
393
|
if (h)
|
|
594
|
-
return i = setTimeout(
|
|
394
|
+
return i = setTimeout(R, t), l(u);
|
|
595
395
|
}
|
|
596
|
-
return i === void 0 && (i = setTimeout(
|
|
396
|
+
return i === void 0 && (i = setTimeout(R, t)), s;
|
|
597
397
|
}
|
|
598
|
-
return
|
|
398
|
+
return N.cancel = T, N.flush = F, N;
|
|
599
399
|
}
|
|
600
|
-
function
|
|
400
|
+
function xt(e) {
|
|
601
401
|
var t = typeof e;
|
|
602
402
|
return !!e && (t == "object" || t == "function");
|
|
603
403
|
}
|
|
604
|
-
function
|
|
404
|
+
function ao(e) {
|
|
605
405
|
return !!e && typeof e == "object";
|
|
606
406
|
}
|
|
607
|
-
function
|
|
608
|
-
return typeof e == "symbol" ||
|
|
407
|
+
function io(e) {
|
|
408
|
+
return typeof e == "symbol" || ao(e) && no.call(e) == Wr;
|
|
609
409
|
}
|
|
610
|
-
function
|
|
410
|
+
function Jt(e) {
|
|
611
411
|
if (typeof e == "number")
|
|
612
412
|
return e;
|
|
613
|
-
if (
|
|
614
|
-
return
|
|
615
|
-
if (
|
|
413
|
+
if (io(e))
|
|
414
|
+
return Wt;
|
|
415
|
+
if (xt(e)) {
|
|
616
416
|
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
617
|
-
e =
|
|
417
|
+
e = xt(t) ? t + "" : t;
|
|
618
418
|
}
|
|
619
419
|
if (typeof e != "string")
|
|
620
420
|
return e === 0 ? e : +e;
|
|
621
|
-
e = e.replace(
|
|
622
|
-
var n =
|
|
623
|
-
return n ||
|
|
421
|
+
e = e.replace(Jr, "");
|
|
422
|
+
var n = Yr.test(e);
|
|
423
|
+
return n || Gr.test(e) ? Xr(e.slice(2), n ? 2 : 8) : Kr.test(e) ? Wt : +e;
|
|
624
424
|
}
|
|
625
|
-
var
|
|
626
|
-
const
|
|
627
|
-
function
|
|
425
|
+
var lo = so;
|
|
426
|
+
const Kt = /* @__PURE__ */ $r(lo);
|
|
427
|
+
function co(e = !1) {
|
|
628
428
|
if (typeof e != "boolean")
|
|
629
429
|
throw new Error("defaultValue must be `true` or `false`");
|
|
630
|
-
const [t, n] =
|
|
430
|
+
const [t, n] = D(e), r = _(() => {
|
|
631
431
|
n(!0);
|
|
632
|
-
}, []), o =
|
|
432
|
+
}, []), o = _(() => {
|
|
633
433
|
n(!1);
|
|
634
|
-
}, []),
|
|
635
|
-
n((
|
|
434
|
+
}, []), a = _(() => {
|
|
435
|
+
n((s) => !s);
|
|
636
436
|
}, []);
|
|
637
|
-
return { value: t, setValue: n, setTrue: r, setFalse: o, toggle:
|
|
437
|
+
return { value: t, setValue: n, setTrue: r, setFalse: o, toggle: a };
|
|
638
438
|
}
|
|
639
|
-
var re = typeof window < "u" ?
|
|
439
|
+
var re = typeof window < "u" ? lr : z;
|
|
640
440
|
function G(e, t, n, r) {
|
|
641
|
-
const o =
|
|
441
|
+
const o = H(t);
|
|
642
442
|
re(() => {
|
|
643
443
|
o.current = t;
|
|
644
|
-
}, [t]),
|
|
645
|
-
const
|
|
646
|
-
if (!(
|
|
647
|
-
const
|
|
444
|
+
}, [t]), z(() => {
|
|
445
|
+
const a = (n == null ? void 0 : n.current) ?? window;
|
|
446
|
+
if (!(a && a.addEventListener)) return;
|
|
447
|
+
const s = (i) => {
|
|
648
448
|
o.current(i);
|
|
649
449
|
};
|
|
650
|
-
return
|
|
651
|
-
|
|
450
|
+
return a.addEventListener(e, s, r), () => {
|
|
451
|
+
a.removeEventListener(e, s, r);
|
|
652
452
|
};
|
|
653
453
|
}, [e, n, r]);
|
|
654
454
|
}
|
|
655
|
-
function
|
|
455
|
+
function ca(e) {
|
|
656
456
|
G("click", (t) => {
|
|
657
457
|
e(t);
|
|
658
458
|
});
|
|
659
459
|
}
|
|
660
|
-
var
|
|
661
|
-
function
|
|
662
|
-
const [e, t] =
|
|
460
|
+
var mt = "useCopyToClipboard";
|
|
461
|
+
function ua() {
|
|
462
|
+
const [e, t] = D(null), { toast: n } = qr(), r = _(async (a) => {
|
|
663
463
|
if (!(navigator != null && navigator.clipboard))
|
|
664
|
-
return
|
|
464
|
+
return U.log(mt, "not supported"), !1;
|
|
665
465
|
try {
|
|
666
|
-
return await navigator.clipboard.writeText(
|
|
667
|
-
} catch (
|
|
668
|
-
return
|
|
466
|
+
return await navigator.clipboard.writeText(a), t(a), !0;
|
|
467
|
+
} catch (s) {
|
|
468
|
+
return U.error(mt, "Copy failed", s), t(null), !1;
|
|
669
469
|
}
|
|
670
470
|
}, []);
|
|
671
|
-
return { value: e, copy: r, copyWithToast: async (
|
|
672
|
-
const i = await r(
|
|
673
|
-
return i && (
|
|
471
|
+
return { value: e, copy: r, copyWithToast: async (a = "", s = "copied to clipboard") => {
|
|
472
|
+
const i = await r(a);
|
|
473
|
+
return i && (U.debug(mt, s), n({ title: s })), i;
|
|
674
474
|
} };
|
|
675
475
|
}
|
|
676
|
-
function
|
|
677
|
-
const [t, n] =
|
|
678
|
-
n((
|
|
679
|
-
}, []), o =
|
|
680
|
-
n((
|
|
681
|
-
}, []),
|
|
476
|
+
function uo(e) {
|
|
477
|
+
const [t, n] = D(e ?? 0), r = _(() => {
|
|
478
|
+
n((s) => s + 1);
|
|
479
|
+
}, []), o = _(() => {
|
|
480
|
+
n((s) => s - 1);
|
|
481
|
+
}, []), a = _(() => {
|
|
682
482
|
n(e ?? 0);
|
|
683
483
|
}, [e]);
|
|
684
484
|
return {
|
|
685
485
|
count: t,
|
|
686
486
|
increment: r,
|
|
687
487
|
decrement: o,
|
|
688
|
-
reset:
|
|
488
|
+
reset: a,
|
|
689
489
|
setCount: n
|
|
690
490
|
};
|
|
691
491
|
}
|
|
692
|
-
function
|
|
693
|
-
const n =
|
|
492
|
+
function fo(e, t) {
|
|
493
|
+
const n = H(e);
|
|
694
494
|
re(() => {
|
|
695
495
|
n.current = e;
|
|
696
|
-
}, [e]),
|
|
496
|
+
}, [e]), z(() => {
|
|
697
497
|
if (t === null)
|
|
698
498
|
return;
|
|
699
499
|
const r = setInterval(() => {
|
|
@@ -704,7 +504,7 @@ function Wo(e, t) {
|
|
|
704
504
|
};
|
|
705
505
|
}, [t]);
|
|
706
506
|
}
|
|
707
|
-
function
|
|
507
|
+
function da({
|
|
708
508
|
countStart: e,
|
|
709
509
|
countStop: t = 0,
|
|
710
510
|
intervalMs: n = 1e3,
|
|
@@ -712,41 +512,41 @@ function qa({
|
|
|
712
512
|
}) {
|
|
713
513
|
const {
|
|
714
514
|
count: o,
|
|
715
|
-
increment:
|
|
716
|
-
decrement:
|
|
515
|
+
increment: a,
|
|
516
|
+
decrement: s,
|
|
717
517
|
reset: i
|
|
718
|
-
} =
|
|
518
|
+
} = uo(e), {
|
|
719
519
|
value: u,
|
|
720
520
|
setTrue: c,
|
|
721
|
-
setFalse:
|
|
722
|
-
} =
|
|
723
|
-
|
|
724
|
-
}, [
|
|
521
|
+
setFalse: f
|
|
522
|
+
} = co(!1), h = _(() => {
|
|
523
|
+
f(), i();
|
|
524
|
+
}, [f, i]), p = _(() => {
|
|
725
525
|
if (o === t) {
|
|
726
|
-
|
|
526
|
+
f();
|
|
727
527
|
return;
|
|
728
528
|
}
|
|
729
|
-
r ?
|
|
730
|
-
}, [o, t,
|
|
731
|
-
return
|
|
529
|
+
r ? a() : s();
|
|
530
|
+
}, [o, t, s, a, r, f]);
|
|
531
|
+
return fo(p, u ? n : null), [o, { startCountdown: c, stopCountdown: f, resetCountdown: h }];
|
|
732
532
|
}
|
|
733
|
-
function
|
|
734
|
-
const t =
|
|
533
|
+
function Ge(e) {
|
|
534
|
+
const t = H(() => {
|
|
735
535
|
throw new Error("Cannot call an event handler while rendering.");
|
|
736
536
|
});
|
|
737
537
|
return re(() => {
|
|
738
538
|
t.current = e;
|
|
739
|
-
}, [e]),
|
|
539
|
+
}, [e]), _((...n) => {
|
|
740
540
|
var r;
|
|
741
541
|
return (r = t.current) == null ? void 0 : r.call(t, ...n);
|
|
742
542
|
}, [t]);
|
|
743
543
|
}
|
|
744
|
-
var
|
|
745
|
-
function
|
|
746
|
-
const { initializeWithValue: r = !0 } = n, o =
|
|
544
|
+
var Ne = "useLocalStorage", gt = typeof window > "u";
|
|
545
|
+
function yn(e, t, n = {}) {
|
|
546
|
+
const { initializeWithValue: r = !0 } = n, o = _(
|
|
747
547
|
(p) => n.serializer ? n.serializer(p) : JSON.stringify(p),
|
|
748
548
|
[n]
|
|
749
|
-
),
|
|
549
|
+
), a = _(
|
|
750
550
|
(p) => {
|
|
751
551
|
if (n.deserializer)
|
|
752
552
|
return n.deserializer(p);
|
|
@@ -757,191 +557,191 @@ function An(e, t, n = {}) {
|
|
|
757
557
|
try {
|
|
758
558
|
g = JSON.parse(p);
|
|
759
559
|
} catch (m) {
|
|
760
|
-
return
|
|
560
|
+
return U.error(Ne, "Error parsing JSON:", m), l;
|
|
761
561
|
}
|
|
762
562
|
return g;
|
|
763
563
|
},
|
|
764
564
|
[n, t]
|
|
765
|
-
),
|
|
565
|
+
), s = _(() => {
|
|
766
566
|
const p = t instanceof Function ? t() : t;
|
|
767
|
-
if (
|
|
567
|
+
if (gt)
|
|
768
568
|
return p;
|
|
769
569
|
try {
|
|
770
570
|
const l = window.localStorage.getItem(e);
|
|
771
|
-
return l ?
|
|
571
|
+
return l ? a(l) : p;
|
|
772
572
|
} catch (l) {
|
|
773
|
-
return
|
|
774
|
-
|
|
573
|
+
return U.error(
|
|
574
|
+
Ne,
|
|
775
575
|
`Error reading localStorage key “${e}”:`,
|
|
776
576
|
l
|
|
777
577
|
), p;
|
|
778
578
|
}
|
|
779
|
-
}, [t, e,
|
|
780
|
-
|
|
781
|
-
|
|
579
|
+
}, [t, e, a]), [i, u] = D(() => r ? s() : t instanceof Function ? t() : t), c = Ge((p) => {
|
|
580
|
+
gt && U.warn(
|
|
581
|
+
Ne,
|
|
782
582
|
`Tried setting localStorage key “${e}” even though environment is not a client`
|
|
783
583
|
);
|
|
784
584
|
try {
|
|
785
|
-
const l = p instanceof Function ? p(
|
|
585
|
+
const l = p instanceof Function ? p(s()) : p;
|
|
786
586
|
window.localStorage.setItem(e, o(l)), u(l), window.dispatchEvent(new StorageEvent("local-storage", { key: e }));
|
|
787
587
|
} catch (l) {
|
|
788
|
-
|
|
789
|
-
|
|
588
|
+
U.warn(
|
|
589
|
+
Ne,
|
|
790
590
|
`Error setting localStorage key “${e}”:`,
|
|
791
591
|
l
|
|
792
592
|
);
|
|
793
593
|
}
|
|
794
|
-
}),
|
|
795
|
-
|
|
796
|
-
|
|
594
|
+
}), f = Ge(() => {
|
|
595
|
+
gt && U.warn(
|
|
596
|
+
Ne,
|
|
797
597
|
`Tried removing localStorage key “${e}” even though environment is not a client`
|
|
798
598
|
);
|
|
799
599
|
const p = t instanceof Function ? t() : t;
|
|
800
600
|
window.localStorage.removeItem(e), u(p), window.dispatchEvent(new StorageEvent("local-storage", { key: e }));
|
|
801
601
|
});
|
|
802
|
-
|
|
803
|
-
u(
|
|
602
|
+
z(() => {
|
|
603
|
+
u(s());
|
|
804
604
|
}, [e]);
|
|
805
|
-
const h =
|
|
605
|
+
const h = _(
|
|
806
606
|
(p) => {
|
|
807
|
-
p.key && p.key !== e || u(
|
|
607
|
+
p.key && p.key !== e || u(s());
|
|
808
608
|
},
|
|
809
|
-
[e,
|
|
609
|
+
[e, s]
|
|
810
610
|
);
|
|
811
|
-
return G("storage", h), G("local-storage", h), [i, c,
|
|
611
|
+
return G("storage", h), G("local-storage", h), [i, c, f];
|
|
812
612
|
}
|
|
813
|
-
var
|
|
814
|
-
function
|
|
613
|
+
var po = typeof window > "u";
|
|
614
|
+
function bn(e, {
|
|
815
615
|
defaultValue: t = !1,
|
|
816
616
|
initializeWithValue: n = !0
|
|
817
617
|
} = {}) {
|
|
818
|
-
const r = (i) =>
|
|
819
|
-
function
|
|
820
|
-
|
|
618
|
+
const r = (i) => po ? t : window.matchMedia(i).matches, [o, a] = D(() => n ? r(e) : t);
|
|
619
|
+
function s() {
|
|
620
|
+
a(r(e));
|
|
821
621
|
}
|
|
822
622
|
return re(() => {
|
|
823
623
|
const i = window.matchMedia(e);
|
|
824
|
-
return
|
|
825
|
-
i.removeListener ? i.removeListener(
|
|
624
|
+
return s(), i.addListener ? i.addListener(s) : i.addEventListener("change", s), () => {
|
|
625
|
+
i.removeListener ? i.removeListener(s) : i.removeEventListener("change", s);
|
|
826
626
|
};
|
|
827
627
|
}, [e]), o;
|
|
828
628
|
}
|
|
829
|
-
var
|
|
830
|
-
function
|
|
629
|
+
var ho = "(prefers-color-scheme: dark)", mo = "usehooks-ts-dark-mode";
|
|
630
|
+
function fa(e = {}) {
|
|
831
631
|
const {
|
|
832
632
|
defaultValue: t,
|
|
833
|
-
localStorageKey: n =
|
|
633
|
+
localStorageKey: n = mo,
|
|
834
634
|
initializeWithValue: r = !0
|
|
835
|
-
} = e, o =
|
|
635
|
+
} = e, o = bn(ho, {
|
|
836
636
|
initializeWithValue: r,
|
|
837
637
|
defaultValue: t
|
|
838
|
-
}), [
|
|
638
|
+
}), [a, s] = yn(
|
|
839
639
|
n,
|
|
840
640
|
t ?? o ?? !1,
|
|
841
641
|
{ initializeWithValue: r }
|
|
842
642
|
);
|
|
843
643
|
return re(() => {
|
|
844
|
-
o !==
|
|
644
|
+
o !== a && s(o);
|
|
845
645
|
}, [o]), {
|
|
846
|
-
isDarkMode:
|
|
646
|
+
isDarkMode: a,
|
|
847
647
|
toggle: () => {
|
|
848
|
-
|
|
648
|
+
s((i) => !i);
|
|
849
649
|
},
|
|
850
650
|
enable: () => {
|
|
851
|
-
|
|
651
|
+
s(!0);
|
|
852
652
|
},
|
|
853
653
|
disable: () => {
|
|
854
|
-
|
|
654
|
+
s(!1);
|
|
855
655
|
},
|
|
856
656
|
set: (i) => {
|
|
857
|
-
|
|
657
|
+
s(i);
|
|
858
658
|
}
|
|
859
659
|
};
|
|
860
660
|
}
|
|
861
|
-
function
|
|
862
|
-
const t =
|
|
863
|
-
t.current = e,
|
|
661
|
+
function vn(e) {
|
|
662
|
+
const t = H(e);
|
|
663
|
+
t.current = e, z(
|
|
864
664
|
() => () => {
|
|
865
665
|
t.current();
|
|
866
666
|
},
|
|
867
667
|
[]
|
|
868
668
|
);
|
|
869
669
|
}
|
|
870
|
-
function
|
|
871
|
-
const r =
|
|
872
|
-
|
|
670
|
+
function Nt(e, t = 500, n) {
|
|
671
|
+
const r = H();
|
|
672
|
+
vn(() => {
|
|
873
673
|
r.current && r.current.cancel();
|
|
874
674
|
});
|
|
875
|
-
const o =
|
|
876
|
-
const
|
|
877
|
-
return
|
|
878
|
-
|
|
879
|
-
},
|
|
675
|
+
const o = cr(() => {
|
|
676
|
+
const a = Kt(e, t, n), s = (...i) => a(...i);
|
|
677
|
+
return s.cancel = () => {
|
|
678
|
+
a.cancel();
|
|
679
|
+
}, s.isPending = () => !!r.current, s.flush = () => a.flush(), s;
|
|
880
680
|
}, [e, t, n]);
|
|
881
|
-
return
|
|
882
|
-
r.current =
|
|
681
|
+
return z(() => {
|
|
682
|
+
r.current = Kt(e, t, n);
|
|
883
683
|
}, [e, t, n]), o;
|
|
884
684
|
}
|
|
885
|
-
function
|
|
886
|
-
const r = (n == null ? void 0 : n.equalityFn) ?? ((c,
|
|
887
|
-
|
|
685
|
+
function pa(e, t, n) {
|
|
686
|
+
const r = (n == null ? void 0 : n.equalityFn) ?? ((c, f) => c === f), o = e instanceof Function ? e() : e, [a, s] = D(o), i = H(o), u = Nt(
|
|
687
|
+
s,
|
|
888
688
|
t,
|
|
889
689
|
n
|
|
890
690
|
);
|
|
891
|
-
return r(i.current, o) || (u(o), i.current = o), [
|
|
691
|
+
return r(i.current, o) || (u(o), i.current = o), [a, u];
|
|
892
692
|
}
|
|
893
|
-
function
|
|
894
|
-
const { preserveTitleOnUnmount: n = !0 } = t, r =
|
|
693
|
+
function ha(e, t = {}) {
|
|
694
|
+
const { preserveTitleOnUnmount: n = !0 } = t, r = H(null);
|
|
895
695
|
re(() => {
|
|
896
696
|
r.current = window.document.title;
|
|
897
697
|
}, []), re(() => {
|
|
898
698
|
window.document.title = e;
|
|
899
|
-
}, [e]),
|
|
699
|
+
}, [e]), vn(() => {
|
|
900
700
|
!n && r.current && (window.document.title = r.current);
|
|
901
701
|
});
|
|
902
702
|
}
|
|
903
|
-
function
|
|
904
|
-
const e =
|
|
703
|
+
function go() {
|
|
704
|
+
const e = H(!0);
|
|
905
705
|
return e.current ? (e.current = !1, !0) : e.current;
|
|
906
706
|
}
|
|
907
|
-
function
|
|
908
|
-
const n =
|
|
909
|
-
|
|
707
|
+
function ma(e, t) {
|
|
708
|
+
const n = go();
|
|
709
|
+
z(() => {
|
|
910
710
|
if (!n)
|
|
911
711
|
return e();
|
|
912
712
|
}, t);
|
|
913
713
|
}
|
|
914
|
-
function
|
|
915
|
-
const [t, n] =
|
|
714
|
+
function ga(e) {
|
|
715
|
+
const [t, n] = D(!1), r = () => {
|
|
916
716
|
n(!0);
|
|
917
717
|
}, o = () => {
|
|
918
718
|
n(!1);
|
|
919
719
|
};
|
|
920
720
|
return G("mouseenter", r, e), G("mouseleave", o, e), t;
|
|
921
721
|
}
|
|
922
|
-
function
|
|
722
|
+
function wa({
|
|
923
723
|
threshold: e = 0,
|
|
924
724
|
root: t = null,
|
|
925
725
|
rootMargin: n = "0%",
|
|
926
726
|
freezeOnceVisible: r = !1,
|
|
927
727
|
initialIsIntersecting: o = !1,
|
|
928
|
-
onChange:
|
|
728
|
+
onChange: a
|
|
929
729
|
} = {}) {
|
|
930
|
-
var
|
|
931
|
-
const [i, u] =
|
|
730
|
+
var s;
|
|
731
|
+
const [i, u] = D(null), [c, f] = D(() => ({
|
|
932
732
|
isIntersecting: o,
|
|
933
733
|
entry: void 0
|
|
934
|
-
})), h =
|
|
935
|
-
h.current =
|
|
936
|
-
const p = ((
|
|
937
|
-
|
|
734
|
+
})), h = H();
|
|
735
|
+
h.current = a;
|
|
736
|
+
const p = ((s = c.entry) == null ? void 0 : s.isIntersecting) && r;
|
|
737
|
+
z(() => {
|
|
938
738
|
if (!i || !("IntersectionObserver" in window) || p) return;
|
|
939
739
|
const m = new IntersectionObserver(
|
|
940
740
|
(y) => {
|
|
941
|
-
const
|
|
741
|
+
const R = Array.isArray(m.thresholds) ? m.thresholds : [m.thresholds];
|
|
942
742
|
y.forEach((S) => {
|
|
943
|
-
const
|
|
944
|
-
|
|
743
|
+
const T = S.isIntersecting && R.some((F) => S.intersectionRatio >= F);
|
|
744
|
+
f({ isIntersecting: T, entry: S }), h.current && h.current(T, S);
|
|
945
745
|
});
|
|
946
746
|
},
|
|
947
747
|
{ threshold: e, root: t, rootMargin: n }
|
|
@@ -958,10 +758,10 @@ function Xa({
|
|
|
958
758
|
p,
|
|
959
759
|
r
|
|
960
760
|
]);
|
|
961
|
-
const l =
|
|
962
|
-
|
|
761
|
+
const l = H(null);
|
|
762
|
+
z(() => {
|
|
963
763
|
var m;
|
|
964
|
-
!i && ((m = c.entry) != null && m.target) && !r && !p && l.current !== c.entry.target && (l.current = c.entry.target,
|
|
764
|
+
!i && ((m = c.entry) != null && m.target) && !r && !p && l.current !== c.entry.target && (l.current = c.entry.target, f({ isIntersecting: o, entry: void 0 }));
|
|
965
765
|
}, [i, c.entry, r, p, o]);
|
|
966
766
|
const g = [
|
|
967
767
|
u,
|
|
@@ -970,59 +770,59 @@ function Xa({
|
|
|
970
770
|
];
|
|
971
771
|
return g.ref = g[0], g.isIntersecting = g[1], g.entry = g[2], g;
|
|
972
772
|
}
|
|
973
|
-
function
|
|
974
|
-
const [e, t] =
|
|
975
|
-
return
|
|
773
|
+
function ya() {
|
|
774
|
+
const [e, t] = D(!1);
|
|
775
|
+
return z(() => {
|
|
976
776
|
t(!0);
|
|
977
777
|
}, []), e;
|
|
978
778
|
}
|
|
979
|
-
function
|
|
980
|
-
const e =
|
|
981
|
-
return
|
|
779
|
+
function wo() {
|
|
780
|
+
const e = H(!1);
|
|
781
|
+
return z(() => (e.current = !0, () => {
|
|
982
782
|
e.current = !1;
|
|
983
|
-
}), []),
|
|
783
|
+
}), []), _(() => e.current, []);
|
|
984
784
|
}
|
|
985
|
-
function
|
|
986
|
-
const [t, n] =
|
|
987
|
-
set:
|
|
988
|
-
n((
|
|
989
|
-
const i = new Map(
|
|
990
|
-
return i.set(o,
|
|
785
|
+
function ba(e = /* @__PURE__ */ new Map()) {
|
|
786
|
+
const [t, n] = D(new Map(e)), r = {
|
|
787
|
+
set: _((o, a) => {
|
|
788
|
+
n((s) => {
|
|
789
|
+
const i = new Map(s);
|
|
790
|
+
return i.set(o, a), i;
|
|
991
791
|
});
|
|
992
792
|
}, []),
|
|
993
|
-
setAll:
|
|
793
|
+
setAll: _((o) => {
|
|
994
794
|
n(() => new Map(o));
|
|
995
795
|
}, []),
|
|
996
|
-
remove:
|
|
997
|
-
n((
|
|
998
|
-
const
|
|
999
|
-
return
|
|
796
|
+
remove: _((o) => {
|
|
797
|
+
n((a) => {
|
|
798
|
+
const s = new Map(a);
|
|
799
|
+
return s.delete(o), s;
|
|
1000
800
|
});
|
|
1001
801
|
}, []),
|
|
1002
|
-
reset:
|
|
802
|
+
reset: _(() => {
|
|
1003
803
|
n(() => /* @__PURE__ */ new Map());
|
|
1004
804
|
}, [])
|
|
1005
805
|
};
|
|
1006
806
|
return [t, r];
|
|
1007
807
|
}
|
|
1008
|
-
function
|
|
808
|
+
function va(e, t, n = "mousedown", r = {}) {
|
|
1009
809
|
G(
|
|
1010
810
|
n,
|
|
1011
811
|
(o) => {
|
|
1012
|
-
const
|
|
1013
|
-
if (!(
|
|
812
|
+
const a = o.target;
|
|
813
|
+
if (!(a != null && a.isConnected))
|
|
1014
814
|
return;
|
|
1015
|
-
(Array.isArray(e) ? e.filter((i) => !!i.current).every((i) => i.current && !i.current.contains(
|
|
815
|
+
(Array.isArray(e) ? e.filter((i) => !!i.current).every((i) => i.current && !i.current.contains(a)) : e.current && !e.current.contains(a)) && t(o);
|
|
1016
816
|
},
|
|
1017
817
|
void 0,
|
|
1018
818
|
r
|
|
1019
819
|
);
|
|
1020
820
|
}
|
|
1021
|
-
var
|
|
1022
|
-
function
|
|
821
|
+
var Yt = typeof window > "u";
|
|
822
|
+
function Ea(e, t = {}) {
|
|
1023
823
|
let { initializeWithValue: n = !0 } = t;
|
|
1024
|
-
|
|
1025
|
-
const r =
|
|
824
|
+
Yt && (n = !1);
|
|
825
|
+
const r = _(
|
|
1026
826
|
(u) => {
|
|
1027
827
|
if (t.deserializer)
|
|
1028
828
|
return t.deserializer(u);
|
|
@@ -1031,14 +831,14 @@ function ti(e, t = {}) {
|
|
|
1031
831
|
let c;
|
|
1032
832
|
try {
|
|
1033
833
|
c = JSON.parse(u);
|
|
1034
|
-
} catch (
|
|
1035
|
-
return console.error("Error parsing JSON:",
|
|
834
|
+
} catch (f) {
|
|
835
|
+
return console.error("Error parsing JSON:", f), null;
|
|
1036
836
|
}
|
|
1037
837
|
return c;
|
|
1038
838
|
},
|
|
1039
839
|
[t]
|
|
1040
|
-
), o =
|
|
1041
|
-
if (
|
|
840
|
+
), o = _(() => {
|
|
841
|
+
if (Yt)
|
|
1042
842
|
return null;
|
|
1043
843
|
try {
|
|
1044
844
|
const u = window.localStorage.getItem(e);
|
|
@@ -1046,42 +846,42 @@ function ti(e, t = {}) {
|
|
|
1046
846
|
} catch (u) {
|
|
1047
847
|
return console.warn(`Error reading localStorage key “${e}”:`, u), null;
|
|
1048
848
|
}
|
|
1049
|
-
}, [e, r]), [
|
|
849
|
+
}, [e, r]), [a, s] = D(() => {
|
|
1050
850
|
if (n)
|
|
1051
851
|
return o();
|
|
1052
852
|
});
|
|
1053
|
-
|
|
1054
|
-
|
|
853
|
+
z(() => {
|
|
854
|
+
s(o());
|
|
1055
855
|
}, [e]);
|
|
1056
|
-
const i =
|
|
856
|
+
const i = _(
|
|
1057
857
|
(u) => {
|
|
1058
|
-
u.key && u.key !== e ||
|
|
858
|
+
u.key && u.key !== e || s(o());
|
|
1059
859
|
},
|
|
1060
860
|
[e, o]
|
|
1061
861
|
);
|
|
1062
|
-
return G("storage", i), G("local-storage", i),
|
|
862
|
+
return G("storage", i), G("local-storage", i), a;
|
|
1063
863
|
}
|
|
1064
|
-
var
|
|
864
|
+
var Gt = {
|
|
1065
865
|
width: void 0,
|
|
1066
866
|
height: void 0
|
|
1067
867
|
};
|
|
1068
|
-
function
|
|
1069
|
-
const { ref: t, box: n = "content-box" } = e, [{ width: r, height: o },
|
|
1070
|
-
return u.current = e.onResize,
|
|
868
|
+
function Sa(e) {
|
|
869
|
+
const { ref: t, box: n = "content-box" } = e, [{ width: r, height: o }, a] = D(Gt), s = wo(), i = H({ ...Gt }), u = H(void 0);
|
|
870
|
+
return u.current = e.onResize, z(() => {
|
|
1071
871
|
if (!t.current || typeof window > "u" || !("ResizeObserver" in window)) return;
|
|
1072
|
-
const c = new ResizeObserver(([
|
|
1073
|
-
const h = n === "border-box" ? "borderBoxSize" : n === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", p =
|
|
872
|
+
const c = new ResizeObserver(([f]) => {
|
|
873
|
+
const h = n === "border-box" ? "borderBoxSize" : n === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", p = Xt(f, h, "inlineSize"), l = Xt(f, h, "blockSize");
|
|
1074
874
|
if (i.current.width !== p || i.current.height !== l) {
|
|
1075
875
|
const m = { width: p, height: l };
|
|
1076
|
-
i.current.width = p, i.current.height = l, u.current ? u.current(m) :
|
|
876
|
+
i.current.width = p, i.current.height = l, u.current ? u.current(m) : s() && a(m);
|
|
1077
877
|
}
|
|
1078
878
|
});
|
|
1079
879
|
return c.observe(t.current, { box: n }), () => {
|
|
1080
880
|
c.disconnect();
|
|
1081
881
|
};
|
|
1082
|
-
}, [n, t,
|
|
882
|
+
}, [n, t, s]), { width: r, height: o };
|
|
1083
883
|
}
|
|
1084
|
-
function
|
|
884
|
+
function Xt(e, t, n) {
|
|
1085
885
|
return e[t] ? Array.isArray(e[t]) ? (
|
|
1086
886
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1087
887
|
e[t][0][n]
|
|
@@ -1090,26 +890,26 @@ function an(e, t, n) {
|
|
|
1090
890
|
e[t][n]
|
|
1091
891
|
) : t === "contentBoxSize" ? e.contentRect[n === "inlineSize" ? "width" : "height"] : void 0;
|
|
1092
892
|
}
|
|
1093
|
-
var
|
|
1094
|
-
function
|
|
893
|
+
var Qt = typeof window > "u";
|
|
894
|
+
function xa(e = {}) {
|
|
1095
895
|
let { initializeWithValue: t = !0 } = e;
|
|
1096
|
-
|
|
896
|
+
Qt && (t = !1);
|
|
1097
897
|
const n = () => {
|
|
1098
|
-
if (!
|
|
898
|
+
if (!Qt)
|
|
1099
899
|
return window.screen;
|
|
1100
|
-
}, [r, o] =
|
|
900
|
+
}, [r, o] = D(() => {
|
|
1101
901
|
if (t)
|
|
1102
902
|
return n();
|
|
1103
|
-
}),
|
|
903
|
+
}), a = Nt(
|
|
1104
904
|
o,
|
|
1105
905
|
e.debounceDelay
|
|
1106
906
|
);
|
|
1107
|
-
function
|
|
1108
|
-
const i = n(), u = e.debounceDelay ?
|
|
907
|
+
function s() {
|
|
908
|
+
const i = n(), u = e.debounceDelay ? a : o;
|
|
1109
909
|
if (i) {
|
|
1110
910
|
const {
|
|
1111
911
|
width: c,
|
|
1112
|
-
height:
|
|
912
|
+
height: f,
|
|
1113
913
|
availHeight: h,
|
|
1114
914
|
availWidth: p,
|
|
1115
915
|
colorDepth: l,
|
|
@@ -1118,7 +918,7 @@ function ri(e = {}) {
|
|
|
1118
918
|
} = i;
|
|
1119
919
|
u({
|
|
1120
920
|
width: c,
|
|
1121
|
-
height:
|
|
921
|
+
height: f,
|
|
1122
922
|
availHeight: h,
|
|
1123
923
|
availWidth: p,
|
|
1124
924
|
colorDepth: l,
|
|
@@ -1127,12 +927,12 @@ function ri(e = {}) {
|
|
|
1127
927
|
});
|
|
1128
928
|
}
|
|
1129
929
|
}
|
|
1130
|
-
return G("resize",
|
|
1131
|
-
|
|
930
|
+
return G("resize", s), re(() => {
|
|
931
|
+
s();
|
|
1132
932
|
}, []), r;
|
|
1133
933
|
}
|
|
1134
|
-
var
|
|
1135
|
-
function
|
|
934
|
+
var $e = /* @__PURE__ */ new Map();
|
|
935
|
+
function yo(e) {
|
|
1136
936
|
const t = document.querySelector(
|
|
1137
937
|
`script[src="${e}"]`
|
|
1138
938
|
), n = t == null ? void 0 : t.getAttribute("data-status");
|
|
@@ -1141,64 +941,64 @@ function Qo(e) {
|
|
|
1141
941
|
status: n
|
|
1142
942
|
};
|
|
1143
943
|
}
|
|
1144
|
-
function
|
|
1145
|
-
const [n, r] =
|
|
1146
|
-
return
|
|
944
|
+
function Ra(e, t) {
|
|
945
|
+
const [n, r] = D(() => !e || t != null && t.shouldPreventLoad ? "idle" : typeof window > "u" ? "loading" : $e.get(e) ?? "loading");
|
|
946
|
+
return z(() => {
|
|
1147
947
|
if (!e || t != null && t.shouldPreventLoad)
|
|
1148
948
|
return;
|
|
1149
|
-
const o =
|
|
949
|
+
const o = $e.get(e);
|
|
1150
950
|
if (o === "ready" || o === "error") {
|
|
1151
951
|
r(o);
|
|
1152
952
|
return;
|
|
1153
953
|
}
|
|
1154
|
-
const
|
|
1155
|
-
let
|
|
1156
|
-
if (
|
|
1157
|
-
r(
|
|
954
|
+
const a = yo(e);
|
|
955
|
+
let s = a.node;
|
|
956
|
+
if (s)
|
|
957
|
+
r(a.status ?? o ?? "loading");
|
|
1158
958
|
else {
|
|
1159
|
-
|
|
959
|
+
s = document.createElement("script"), s.src = e, s.async = !0, t != null && t.id && (s.id = t.id), s.setAttribute("data-status", "loading"), document.body.appendChild(s);
|
|
1160
960
|
const u = (c) => {
|
|
1161
|
-
const
|
|
1162
|
-
|
|
961
|
+
const f = c.type === "load" ? "ready" : "error";
|
|
962
|
+
s == null || s.setAttribute("data-status", f);
|
|
1163
963
|
};
|
|
1164
|
-
|
|
964
|
+
s.addEventListener("load", u), s.addEventListener("error", u);
|
|
1165
965
|
}
|
|
1166
966
|
const i = (u) => {
|
|
1167
967
|
const c = u.type === "load" ? "ready" : "error";
|
|
1168
|
-
r(c),
|
|
968
|
+
r(c), $e.set(e, c);
|
|
1169
969
|
};
|
|
1170
|
-
return
|
|
1171
|
-
|
|
970
|
+
return s.addEventListener("load", i), s.addEventListener("error", i), () => {
|
|
971
|
+
s && (s.removeEventListener("load", i), s.removeEventListener("error", i)), s && (t != null && t.removeOnUnmount) && (s.remove(), $e.delete(e));
|
|
1172
972
|
};
|
|
1173
973
|
}, [e, t == null ? void 0 : t.shouldPreventLoad, t == null ? void 0 : t.removeOnUnmount, t == null ? void 0 : t.id]), n;
|
|
1174
974
|
}
|
|
1175
|
-
var
|
|
1176
|
-
function
|
|
1177
|
-
const { autoLock: t = !0, lockTarget: n, widthReflow: r = !0 } = e, [o,
|
|
1178
|
-
if (
|
|
1179
|
-
const { overflow:
|
|
1180
|
-
if (i.current = { overflow:
|
|
1181
|
-
const p =
|
|
1182
|
-
|
|
975
|
+
var bo = typeof window > "u";
|
|
976
|
+
function Ta(e = {}) {
|
|
977
|
+
const { autoLock: t = !0, lockTarget: n, widthReflow: r = !0 } = e, [o, a] = D(!1), s = H(null), i = H(null), u = () => {
|
|
978
|
+
if (s.current) {
|
|
979
|
+
const { overflow: f, paddingRight: h } = s.current.style;
|
|
980
|
+
if (i.current = { overflow: f, paddingRight: h }, r) {
|
|
981
|
+
const p = s.current === document.body ? window.innerWidth : s.current.offsetWidth, l = parseInt(window.getComputedStyle(s.current).paddingRight, 10) || 0, g = p - s.current.scrollWidth;
|
|
982
|
+
s.current.style.paddingRight = `${g + l}px`;
|
|
1183
983
|
}
|
|
1184
|
-
|
|
984
|
+
s.current.style.overflow = "hidden", a(!0);
|
|
1185
985
|
}
|
|
1186
986
|
}, c = () => {
|
|
1187
|
-
|
|
987
|
+
s.current && i.current && (s.current.style.overflow = i.current.overflow, r && (s.current.style.paddingRight = i.current.paddingRight)), a(!1);
|
|
1188
988
|
};
|
|
1189
989
|
return re(() => {
|
|
1190
|
-
if (!
|
|
1191
|
-
return n && (
|
|
990
|
+
if (!bo)
|
|
991
|
+
return n && (s.current = typeof n == "string" ? document.querySelector(n) : n), s.current || (s.current = document.body), t && u(), () => {
|
|
1192
992
|
c();
|
|
1193
993
|
};
|
|
1194
994
|
}, [t, n, r]), { isLocked: o, lock: u, unlock: c };
|
|
1195
995
|
}
|
|
1196
|
-
var
|
|
1197
|
-
function
|
|
1198
|
-
const { initializeWithValue: r = !0 } = n, o =
|
|
996
|
+
var wt = typeof window > "u";
|
|
997
|
+
function _a(e, t, n = {}) {
|
|
998
|
+
const { initializeWithValue: r = !0 } = n, o = _(
|
|
1199
999
|
(p) => n.serializer ? n.serializer(p) : JSON.stringify(p),
|
|
1200
1000
|
[n]
|
|
1201
|
-
),
|
|
1001
|
+
), a = _(
|
|
1202
1002
|
(p) => {
|
|
1203
1003
|
if (n.deserializer)
|
|
1204
1004
|
return n.deserializer(p);
|
|
@@ -1214,101 +1014,101 @@ function ai(e, t, n = {}) {
|
|
|
1214
1014
|
return g;
|
|
1215
1015
|
},
|
|
1216
1016
|
[n, t]
|
|
1217
|
-
),
|
|
1017
|
+
), s = _(() => {
|
|
1218
1018
|
const p = t instanceof Function ? t() : t;
|
|
1219
|
-
if (
|
|
1019
|
+
if (wt)
|
|
1220
1020
|
return p;
|
|
1221
1021
|
try {
|
|
1222
1022
|
const l = window.sessionStorage.getItem(e);
|
|
1223
|
-
return l ?
|
|
1023
|
+
return l ? a(l) : p;
|
|
1224
1024
|
} catch (l) {
|
|
1225
1025
|
return console.warn(`Error reading sessionStorage key “${e}”:`, l), p;
|
|
1226
1026
|
}
|
|
1227
|
-
}, [t, e,
|
|
1228
|
-
|
|
1027
|
+
}, [t, e, a]), [i, u] = D(() => r ? s() : t instanceof Function ? t() : t), c = Ge((p) => {
|
|
1028
|
+
wt && console.warn(
|
|
1229
1029
|
`Tried setting sessionStorage key “${e}” even though environment is not a client`
|
|
1230
1030
|
);
|
|
1231
1031
|
try {
|
|
1232
|
-
const l = p instanceof Function ? p(
|
|
1032
|
+
const l = p instanceof Function ? p(s()) : p;
|
|
1233
1033
|
window.sessionStorage.setItem(e, o(l)), u(l), window.dispatchEvent(new StorageEvent("session-storage", { key: e }));
|
|
1234
1034
|
} catch (l) {
|
|
1235
1035
|
console.warn(`Error setting sessionStorage key “${e}”:`, l);
|
|
1236
1036
|
}
|
|
1237
|
-
}),
|
|
1238
|
-
|
|
1037
|
+
}), f = Ge(() => {
|
|
1038
|
+
wt && console.warn(
|
|
1239
1039
|
`Tried removing sessionStorage key “${e}” even though environment is not a client`
|
|
1240
1040
|
);
|
|
1241
1041
|
const p = t instanceof Function ? t() : t;
|
|
1242
1042
|
window.sessionStorage.removeItem(e), u(p), window.dispatchEvent(new StorageEvent("session-storage", { key: e }));
|
|
1243
1043
|
});
|
|
1244
|
-
|
|
1245
|
-
u(
|
|
1044
|
+
z(() => {
|
|
1045
|
+
u(s());
|
|
1246
1046
|
}, [e]);
|
|
1247
|
-
const h =
|
|
1047
|
+
const h = _(
|
|
1248
1048
|
(p) => {
|
|
1249
|
-
p.key && p.key !== e || u(
|
|
1049
|
+
p.key && p.key !== e || u(s());
|
|
1250
1050
|
},
|
|
1251
|
-
[e,
|
|
1051
|
+
[e, s]
|
|
1252
1052
|
);
|
|
1253
|
-
return G("storage", h), G("session-storage", h), [i, c,
|
|
1053
|
+
return G("storage", h), G("session-storage", h), [i, c, f];
|
|
1254
1054
|
}
|
|
1255
|
-
function
|
|
1256
|
-
const [t, n] =
|
|
1055
|
+
function Aa(e) {
|
|
1056
|
+
const [t, n] = D(1), r = t + 1 <= e, o = t - 1 > 0, a = _(
|
|
1257
1057
|
(c) => {
|
|
1258
|
-
const
|
|
1259
|
-
if (
|
|
1260
|
-
n(
|
|
1058
|
+
const f = c instanceof Function ? c(t) : c;
|
|
1059
|
+
if (f >= 1 && f <= e) {
|
|
1060
|
+
n(f);
|
|
1261
1061
|
return;
|
|
1262
1062
|
}
|
|
1263
1063
|
throw new Error("Step not valid");
|
|
1264
1064
|
},
|
|
1265
1065
|
[e, t]
|
|
1266
|
-
),
|
|
1066
|
+
), s = _(() => {
|
|
1267
1067
|
r && n((c) => c + 1);
|
|
1268
|
-
}, [r]), i =
|
|
1068
|
+
}, [r]), i = _(() => {
|
|
1269
1069
|
o && n((c) => c - 1);
|
|
1270
|
-
}, [o]), u =
|
|
1070
|
+
}, [o]), u = _(() => {
|
|
1271
1071
|
n(1);
|
|
1272
1072
|
}, []);
|
|
1273
1073
|
return [
|
|
1274
1074
|
t,
|
|
1275
1075
|
{
|
|
1276
|
-
goToNextStep:
|
|
1076
|
+
goToNextStep: s,
|
|
1277
1077
|
goToPrevStep: i,
|
|
1278
1078
|
canGoToNextStep: r,
|
|
1279
1079
|
canGoToPrevStep: o,
|
|
1280
|
-
setStep:
|
|
1080
|
+
setStep: a,
|
|
1281
1081
|
reset: u
|
|
1282
1082
|
}
|
|
1283
1083
|
];
|
|
1284
1084
|
}
|
|
1285
|
-
var
|
|
1286
|
-
function
|
|
1085
|
+
var vo = "(prefers-color-scheme: dark)", Eo = "usehooks-ts-ternary-dark-mode";
|
|
1086
|
+
function Oa({
|
|
1287
1087
|
defaultValue: e = "system",
|
|
1288
|
-
localStorageKey: t =
|
|
1088
|
+
localStorageKey: t = Eo,
|
|
1289
1089
|
initializeWithValue: n = !0
|
|
1290
1090
|
} = {}) {
|
|
1291
|
-
const r =
|
|
1091
|
+
const r = bn(vo, { initializeWithValue: n }), [o, a] = yn(t, e, {
|
|
1292
1092
|
initializeWithValue: n
|
|
1293
1093
|
});
|
|
1294
1094
|
return {
|
|
1295
1095
|
isDarkMode: o === "dark" || o === "system" && r,
|
|
1296
1096
|
ternaryDarkMode: o,
|
|
1297
|
-
setTernaryDarkMode:
|
|
1097
|
+
setTernaryDarkMode: a,
|
|
1298
1098
|
toggleTernaryDarkMode: () => {
|
|
1299
1099
|
const u = ["light", "system", "dark"];
|
|
1300
|
-
|
|
1301
|
-
const
|
|
1302
|
-
return u[
|
|
1100
|
+
a((c) => {
|
|
1101
|
+
const f = (u.indexOf(c) + 1) % u.length;
|
|
1102
|
+
return u[f];
|
|
1303
1103
|
});
|
|
1304
1104
|
}
|
|
1305
1105
|
};
|
|
1306
1106
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const n =
|
|
1107
|
+
function Ca(e, t) {
|
|
1108
|
+
const n = H(e);
|
|
1309
1109
|
re(() => {
|
|
1310
1110
|
n.current = e;
|
|
1311
|
-
}, [e]),
|
|
1111
|
+
}, [e]), z(() => {
|
|
1312
1112
|
if (!t && t !== 0)
|
|
1313
1113
|
return;
|
|
1314
1114
|
const r = setTimeout(() => {
|
|
@@ -1319,78 +1119,78 @@ function ci(e, t) {
|
|
|
1319
1119
|
};
|
|
1320
1120
|
}, [t]);
|
|
1321
1121
|
}
|
|
1322
|
-
function
|
|
1323
|
-
const [t, n] =
|
|
1122
|
+
function ka(e) {
|
|
1123
|
+
const [t, n] = D(!!e), r = _(() => {
|
|
1324
1124
|
n((o) => !o);
|
|
1325
1125
|
}, []);
|
|
1326
1126
|
return [t, r, n];
|
|
1327
1127
|
}
|
|
1328
|
-
var
|
|
1329
|
-
function
|
|
1128
|
+
var So = typeof window > "u";
|
|
1129
|
+
function Na(e = {}) {
|
|
1330
1130
|
let { initializeWithValue: t = !0 } = e;
|
|
1331
|
-
|
|
1332
|
-
const [n, r] =
|
|
1131
|
+
So && (t = !1);
|
|
1132
|
+
const [n, r] = D(() => t ? {
|
|
1333
1133
|
width: window.innerWidth,
|
|
1334
1134
|
height: window.innerHeight
|
|
1335
1135
|
} : {
|
|
1336
1136
|
width: void 0,
|
|
1337
1137
|
height: void 0
|
|
1338
|
-
}), o =
|
|
1138
|
+
}), o = Nt(
|
|
1339
1139
|
r,
|
|
1340
1140
|
e.debounceDelay
|
|
1341
1141
|
);
|
|
1342
|
-
function
|
|
1142
|
+
function a() {
|
|
1343
1143
|
(e.debounceDelay ? o : r)({
|
|
1344
1144
|
width: window.innerWidth,
|
|
1345
1145
|
height: window.innerHeight
|
|
1346
1146
|
});
|
|
1347
1147
|
}
|
|
1348
|
-
return G("resize",
|
|
1349
|
-
|
|
1148
|
+
return G("resize", a), re(() => {
|
|
1149
|
+
a();
|
|
1350
1150
|
}, []), n;
|
|
1351
1151
|
}
|
|
1352
|
-
function
|
|
1152
|
+
function En(e, t) {
|
|
1353
1153
|
return function() {
|
|
1354
1154
|
return e.apply(t, arguments);
|
|
1355
1155
|
};
|
|
1356
1156
|
}
|
|
1357
|
-
const { toString:
|
|
1358
|
-
const n =
|
|
1157
|
+
const { toString: xo } = Object.prototype, { getPrototypeOf: Lt } = Object, Ze = /* @__PURE__ */ ((e) => (t) => {
|
|
1158
|
+
const n = xo.call(t);
|
|
1359
1159
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
1360
|
-
})(/* @__PURE__ */ Object.create(null)), oe = (e) => (e = e.toLowerCase(), (t) =>
|
|
1361
|
-
function
|
|
1362
|
-
return e !== null && !
|
|
1160
|
+
})(/* @__PURE__ */ Object.create(null)), oe = (e) => (e = e.toLowerCase(), (t) => Ze(t) === e), et = (e) => (t) => typeof t === e, { isArray: Re } = Array, Me = et("undefined");
|
|
1161
|
+
function Ro(e) {
|
|
1162
|
+
return e !== null && !Me(e) && e.constructor !== null && !Me(e.constructor) && Y(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
1363
1163
|
}
|
|
1364
|
-
const
|
|
1365
|
-
function
|
|
1164
|
+
const Sn = oe("ArrayBuffer");
|
|
1165
|
+
function To(e) {
|
|
1366
1166
|
let t;
|
|
1367
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
1167
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Sn(e.buffer), t;
|
|
1368
1168
|
}
|
|
1369
|
-
const
|
|
1370
|
-
if (
|
|
1169
|
+
const _o = et("string"), Y = et("function"), xn = et("number"), tt = (e) => e !== null && typeof e == "object", Ao = (e) => e === !0 || e === !1, Je = (e) => {
|
|
1170
|
+
if (Ze(e) !== "object")
|
|
1371
1171
|
return !1;
|
|
1372
|
-
const t =
|
|
1172
|
+
const t = Lt(e);
|
|
1373
1173
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
1374
|
-
},
|
|
1174
|
+
}, Oo = oe("Date"), Co = oe("File"), ko = oe("Blob"), No = oe("FileList"), Lo = (e) => tt(e) && Y(e.pipe), Mo = (e) => {
|
|
1375
1175
|
let t;
|
|
1376
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
1377
|
-
t === "object" &&
|
|
1378
|
-
},
|
|
1379
|
-
function
|
|
1176
|
+
return e && (typeof FormData == "function" && e instanceof FormData || Y(e.append) && ((t = Ze(e)) === "formdata" || // detect form-data instance
|
|
1177
|
+
t === "object" && Y(e.toString) && e.toString() === "[object FormData]"));
|
|
1178
|
+
}, Po = oe("URLSearchParams"), [Io, Do, Bo, Fo] = ["ReadableStream", "Request", "Response", "Headers"].map(oe), Uo = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1179
|
+
function Pe(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
1380
1180
|
if (e === null || typeof e > "u")
|
|
1381
1181
|
return;
|
|
1382
1182
|
let r, o;
|
|
1383
|
-
if (typeof e != "object" && (e = [e]),
|
|
1183
|
+
if (typeof e != "object" && (e = [e]), Re(e))
|
|
1384
1184
|
for (r = 0, o = e.length; r < o; r++)
|
|
1385
1185
|
t.call(null, e[r], r, e);
|
|
1386
1186
|
else {
|
|
1387
|
-
const
|
|
1187
|
+
const a = n ? Object.getOwnPropertyNames(e) : Object.keys(e), s = a.length;
|
|
1388
1188
|
let i;
|
|
1389
|
-
for (r = 0; r <
|
|
1390
|
-
i =
|
|
1189
|
+
for (r = 0; r < s; r++)
|
|
1190
|
+
i = a[r], t.call(null, e[i], i, e);
|
|
1391
1191
|
}
|
|
1392
1192
|
}
|
|
1393
|
-
function
|
|
1193
|
+
function Rn(e, t) {
|
|
1394
1194
|
t = t.toLowerCase();
|
|
1395
1195
|
const n = Object.keys(e);
|
|
1396
1196
|
let r = n.length, o;
|
|
@@ -1399,75 +1199,75 @@ function In(e, t) {
|
|
|
1399
1199
|
return o;
|
|
1400
1200
|
return null;
|
|
1401
1201
|
}
|
|
1402
|
-
const
|
|
1403
|
-
function
|
|
1404
|
-
const { caseless: e } =
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1202
|
+
const me = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Tn = (e) => !Me(e) && e !== me;
|
|
1203
|
+
function Rt() {
|
|
1204
|
+
const { caseless: e } = Tn(this) && this || {}, t = {}, n = (r, o) => {
|
|
1205
|
+
const a = e && Rn(t, o) || o;
|
|
1206
|
+
Je(t[a]) && Je(r) ? t[a] = Rt(t[a], r) : Je(r) ? t[a] = Rt({}, r) : Re(r) ? t[a] = r.slice() : t[a] = r;
|
|
1407
1207
|
};
|
|
1408
1208
|
for (let r = 0, o = arguments.length; r < o; r++)
|
|
1409
|
-
arguments[r] &&
|
|
1209
|
+
arguments[r] && Pe(arguments[r], n);
|
|
1410
1210
|
return t;
|
|
1411
1211
|
}
|
|
1412
|
-
const
|
|
1413
|
-
n &&
|
|
1414
|
-
}, { allOwnKeys: r }), e),
|
|
1212
|
+
const jo = (e, t, n, { allOwnKeys: r } = {}) => (Pe(t, (o, a) => {
|
|
1213
|
+
n && Y(o) ? e[a] = En(o, n) : e[a] = o;
|
|
1214
|
+
}, { allOwnKeys: r }), e), zo = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Ho = (e, t, n, r) => {
|
|
1415
1215
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
1416
1216
|
value: t.prototype
|
|
1417
1217
|
}), n && Object.assign(e.prototype, n);
|
|
1418
|
-
},
|
|
1419
|
-
let o,
|
|
1218
|
+
}, qo = (e, t, n, r) => {
|
|
1219
|
+
let o, a, s;
|
|
1420
1220
|
const i = {};
|
|
1421
1221
|
if (t = t || {}, e == null) return t;
|
|
1422
1222
|
do {
|
|
1423
|
-
for (o = Object.getOwnPropertyNames(e),
|
|
1424
|
-
|
|
1425
|
-
e = n !== !1 &&
|
|
1223
|
+
for (o = Object.getOwnPropertyNames(e), a = o.length; a-- > 0; )
|
|
1224
|
+
s = o[a], (!r || r(s, e, t)) && !i[s] && (t[s] = e[s], i[s] = !0);
|
|
1225
|
+
e = n !== !1 && Lt(e);
|
|
1426
1226
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
1427
1227
|
return t;
|
|
1428
|
-
},
|
|
1228
|
+
}, $o = (e, t, n) => {
|
|
1429
1229
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
1430
1230
|
const r = e.indexOf(t, n);
|
|
1431
1231
|
return r !== -1 && r === n;
|
|
1432
|
-
},
|
|
1232
|
+
}, Vo = (e) => {
|
|
1433
1233
|
if (!e) return null;
|
|
1434
|
-
if (
|
|
1234
|
+
if (Re(e)) return e;
|
|
1435
1235
|
let t = e.length;
|
|
1436
|
-
if (!
|
|
1236
|
+
if (!xn(t)) return null;
|
|
1437
1237
|
const n = new Array(t);
|
|
1438
1238
|
for (; t-- > 0; )
|
|
1439
1239
|
n[t] = e[t];
|
|
1440
1240
|
return n;
|
|
1441
|
-
},
|
|
1241
|
+
}, Wo = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Lt(Uint8Array)), Jo = (e, t) => {
|
|
1442
1242
|
const r = (e && e[Symbol.iterator]).call(e);
|
|
1443
1243
|
let o;
|
|
1444
1244
|
for (; (o = r.next()) && !o.done; ) {
|
|
1445
|
-
const
|
|
1446
|
-
t.call(e,
|
|
1245
|
+
const a = o.value;
|
|
1246
|
+
t.call(e, a[0], a[1]);
|
|
1447
1247
|
}
|
|
1448
|
-
},
|
|
1248
|
+
}, Ko = (e, t) => {
|
|
1449
1249
|
let n;
|
|
1450
1250
|
const r = [];
|
|
1451
1251
|
for (; (n = e.exec(t)) !== null; )
|
|
1452
1252
|
r.push(n);
|
|
1453
1253
|
return r;
|
|
1454
|
-
},
|
|
1254
|
+
}, Yo = oe("HTMLFormElement"), Go = (e) => e.toLowerCase().replace(
|
|
1455
1255
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
1456
1256
|
function(n, r, o) {
|
|
1457
1257
|
return r.toUpperCase() + o;
|
|
1458
1258
|
}
|
|
1459
|
-
),
|
|
1259
|
+
), Zt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Xo = oe("RegExp"), _n = (e, t) => {
|
|
1460
1260
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
1461
|
-
|
|
1462
|
-
let
|
|
1463
|
-
(
|
|
1261
|
+
Pe(n, (o, a) => {
|
|
1262
|
+
let s;
|
|
1263
|
+
(s = t(o, a, e)) !== !1 && (r[a] = s || o);
|
|
1464
1264
|
}), Object.defineProperties(e, r);
|
|
1465
|
-
},
|
|
1466
|
-
|
|
1467
|
-
if (
|
|
1265
|
+
}, Qo = (e) => {
|
|
1266
|
+
_n(e, (t, n) => {
|
|
1267
|
+
if (Y(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
1468
1268
|
return !1;
|
|
1469
1269
|
const r = e[n];
|
|
1470
|
-
if (
|
|
1270
|
+
if (Y(r)) {
|
|
1471
1271
|
if (t.enumerable = !1, "writable" in t) {
|
|
1472
1272
|
t.writable = !1;
|
|
1473
1273
|
return;
|
|
@@ -1477,104 +1277,104 @@ const vs = (e, t, n, { allOwnKeys: r } = {}) => (Be(t, (o, s) => {
|
|
|
1477
1277
|
});
|
|
1478
1278
|
}
|
|
1479
1279
|
});
|
|
1480
|
-
},
|
|
1280
|
+
}, Zo = (e, t) => {
|
|
1481
1281
|
const n = {}, r = (o) => {
|
|
1482
|
-
o.forEach((
|
|
1483
|
-
n[
|
|
1282
|
+
o.forEach((a) => {
|
|
1283
|
+
n[a] = !0;
|
|
1484
1284
|
});
|
|
1485
1285
|
};
|
|
1486
|
-
return
|
|
1487
|
-
},
|
|
1488
|
-
},
|
|
1489
|
-
function
|
|
1490
|
-
return !!(e &&
|
|
1286
|
+
return Re(e) ? r(e) : r(String(e).split(t)), n;
|
|
1287
|
+
}, es = () => {
|
|
1288
|
+
}, ts = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
1289
|
+
function ns(e) {
|
|
1290
|
+
return !!(e && Y(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
1491
1291
|
}
|
|
1492
|
-
const
|
|
1292
|
+
const rs = (e) => {
|
|
1493
1293
|
const t = new Array(10), n = (r, o) => {
|
|
1494
|
-
if (
|
|
1294
|
+
if (tt(r)) {
|
|
1495
1295
|
if (t.indexOf(r) >= 0)
|
|
1496
1296
|
return;
|
|
1497
1297
|
if (!("toJSON" in r)) {
|
|
1498
1298
|
t[o] = r;
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1501
|
-
const u = n(
|
|
1502
|
-
!
|
|
1503
|
-
}), t[o] = void 0,
|
|
1299
|
+
const a = Re(r) ? [] : {};
|
|
1300
|
+
return Pe(r, (s, i) => {
|
|
1301
|
+
const u = n(s, o + 1);
|
|
1302
|
+
!Me(u) && (a[i] = u);
|
|
1303
|
+
}), t[o] = void 0, a;
|
|
1504
1304
|
}
|
|
1505
1305
|
}
|
|
1506
1306
|
return r;
|
|
1507
1307
|
};
|
|
1508
1308
|
return n(e, 0);
|
|
1509
|
-
},
|
|
1510
|
-
o ===
|
|
1309
|
+
}, os = oe("AsyncFunction"), ss = (e) => e && (tt(e) || Y(e)) && Y(e.then) && Y(e.catch), An = ((e, t) => e ? setImmediate : t ? ((n, r) => (me.addEventListener("message", ({ source: o, data: a }) => {
|
|
1310
|
+
o === me && a === n && r.length && r.shift()();
|
|
1511
1311
|
}, !1), (o) => {
|
|
1512
|
-
r.push(o),
|
|
1312
|
+
r.push(o), me.postMessage(n, "*");
|
|
1513
1313
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
1514
1314
|
typeof setImmediate == "function",
|
|
1515
|
-
|
|
1516
|
-
),
|
|
1517
|
-
isArray:
|
|
1518
|
-
isArrayBuffer:
|
|
1519
|
-
isBuffer:
|
|
1520
|
-
isFormData:
|
|
1521
|
-
isArrayBufferView:
|
|
1522
|
-
isString:
|
|
1523
|
-
isNumber:
|
|
1524
|
-
isBoolean:
|
|
1525
|
-
isObject:
|
|
1526
|
-
isPlainObject:
|
|
1527
|
-
isReadableStream:
|
|
1528
|
-
isRequest:
|
|
1529
|
-
isResponse:
|
|
1530
|
-
isHeaders:
|
|
1531
|
-
isUndefined:
|
|
1532
|
-
isDate:
|
|
1533
|
-
isFile:
|
|
1534
|
-
isBlob:
|
|
1535
|
-
isRegExp:
|
|
1536
|
-
isFunction:
|
|
1537
|
-
isStream:
|
|
1538
|
-
isURLSearchParams:
|
|
1539
|
-
isTypedArray:
|
|
1540
|
-
isFileList:
|
|
1541
|
-
forEach:
|
|
1542
|
-
merge:
|
|
1543
|
-
extend:
|
|
1544
|
-
trim:
|
|
1545
|
-
stripBOM:
|
|
1546
|
-
inherits:
|
|
1547
|
-
toFlatObject:
|
|
1548
|
-
kindOf:
|
|
1315
|
+
Y(me.postMessage)
|
|
1316
|
+
), as = typeof queueMicrotask < "u" ? queueMicrotask.bind(me) : typeof process < "u" && process.nextTick || An, d = {
|
|
1317
|
+
isArray: Re,
|
|
1318
|
+
isArrayBuffer: Sn,
|
|
1319
|
+
isBuffer: Ro,
|
|
1320
|
+
isFormData: Mo,
|
|
1321
|
+
isArrayBufferView: To,
|
|
1322
|
+
isString: _o,
|
|
1323
|
+
isNumber: xn,
|
|
1324
|
+
isBoolean: Ao,
|
|
1325
|
+
isObject: tt,
|
|
1326
|
+
isPlainObject: Je,
|
|
1327
|
+
isReadableStream: Io,
|
|
1328
|
+
isRequest: Do,
|
|
1329
|
+
isResponse: Bo,
|
|
1330
|
+
isHeaders: Fo,
|
|
1331
|
+
isUndefined: Me,
|
|
1332
|
+
isDate: Oo,
|
|
1333
|
+
isFile: Co,
|
|
1334
|
+
isBlob: ko,
|
|
1335
|
+
isRegExp: Xo,
|
|
1336
|
+
isFunction: Y,
|
|
1337
|
+
isStream: Lo,
|
|
1338
|
+
isURLSearchParams: Po,
|
|
1339
|
+
isTypedArray: Wo,
|
|
1340
|
+
isFileList: No,
|
|
1341
|
+
forEach: Pe,
|
|
1342
|
+
merge: Rt,
|
|
1343
|
+
extend: jo,
|
|
1344
|
+
trim: Uo,
|
|
1345
|
+
stripBOM: zo,
|
|
1346
|
+
inherits: Ho,
|
|
1347
|
+
toFlatObject: qo,
|
|
1348
|
+
kindOf: Ze,
|
|
1549
1349
|
kindOfTest: oe,
|
|
1550
|
-
endsWith:
|
|
1551
|
-
toArray:
|
|
1552
|
-
forEachEntry:
|
|
1553
|
-
matchAll:
|
|
1554
|
-
isHTMLForm:
|
|
1555
|
-
hasOwnProperty:
|
|
1556
|
-
hasOwnProp:
|
|
1350
|
+
endsWith: $o,
|
|
1351
|
+
toArray: Vo,
|
|
1352
|
+
forEachEntry: Jo,
|
|
1353
|
+
matchAll: Ko,
|
|
1354
|
+
isHTMLForm: Yo,
|
|
1355
|
+
hasOwnProperty: Zt,
|
|
1356
|
+
hasOwnProp: Zt,
|
|
1557
1357
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1558
|
-
reduceDescriptors:
|
|
1559
|
-
freezeMethods:
|
|
1560
|
-
toObjectSet:
|
|
1561
|
-
toCamelCase:
|
|
1562
|
-
noop:
|
|
1563
|
-
toFiniteNumber:
|
|
1564
|
-
findKey:
|
|
1565
|
-
global:
|
|
1566
|
-
isContextDefined:
|
|
1567
|
-
isSpecCompliantForm:
|
|
1568
|
-
toJSONObject:
|
|
1569
|
-
isAsyncFn:
|
|
1570
|
-
isThenable:
|
|
1571
|
-
setImmediate:
|
|
1572
|
-
asap:
|
|
1358
|
+
reduceDescriptors: _n,
|
|
1359
|
+
freezeMethods: Qo,
|
|
1360
|
+
toObjectSet: Zo,
|
|
1361
|
+
toCamelCase: Go,
|
|
1362
|
+
noop: es,
|
|
1363
|
+
toFiniteNumber: ts,
|
|
1364
|
+
findKey: Rn,
|
|
1365
|
+
global: me,
|
|
1366
|
+
isContextDefined: Tn,
|
|
1367
|
+
isSpecCompliantForm: ns,
|
|
1368
|
+
toJSONObject: rs,
|
|
1369
|
+
isAsyncFn: os,
|
|
1370
|
+
isThenable: ss,
|
|
1371
|
+
setImmediate: An,
|
|
1372
|
+
asap: as
|
|
1573
1373
|
};
|
|
1574
1374
|
function v(e, t, n, r, o) {
|
|
1575
1375
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
1576
1376
|
}
|
|
1577
|
-
|
|
1377
|
+
d.inherits(v, Error, {
|
|
1578
1378
|
toJSON: function() {
|
|
1579
1379
|
return {
|
|
1580
1380
|
// Standard
|
|
@@ -1589,13 +1389,13 @@ f.inherits(v, Error, {
|
|
|
1589
1389
|
columnNumber: this.columnNumber,
|
|
1590
1390
|
stack: this.stack,
|
|
1591
1391
|
// Axios
|
|
1592
|
-
config:
|
|
1392
|
+
config: d.toJSONObject(this.config),
|
|
1593
1393
|
code: this.code,
|
|
1594
1394
|
status: this.status
|
|
1595
1395
|
};
|
|
1596
1396
|
}
|
|
1597
1397
|
});
|
|
1598
|
-
const
|
|
1398
|
+
const On = v.prototype, Cn = {};
|
|
1599
1399
|
[
|
|
1600
1400
|
"ERR_BAD_OPTION_VALUE",
|
|
1601
1401
|
"ERR_BAD_OPTION",
|
|
@@ -1611,96 +1411,96 @@ const Un = v.prototype, jn = {};
|
|
|
1611
1411
|
"ERR_INVALID_URL"
|
|
1612
1412
|
// eslint-disable-next-line func-names
|
|
1613
1413
|
].forEach((e) => {
|
|
1614
|
-
|
|
1414
|
+
Cn[e] = { value: e };
|
|
1615
1415
|
});
|
|
1616
|
-
Object.defineProperties(v,
|
|
1617
|
-
Object.defineProperty(
|
|
1618
|
-
v.from = (e, t, n, r, o,
|
|
1619
|
-
const
|
|
1620
|
-
return
|
|
1416
|
+
Object.defineProperties(v, Cn);
|
|
1417
|
+
Object.defineProperty(On, "isAxiosError", { value: !0 });
|
|
1418
|
+
v.from = (e, t, n, r, o, a) => {
|
|
1419
|
+
const s = Object.create(On);
|
|
1420
|
+
return d.toFlatObject(e, s, function(u) {
|
|
1621
1421
|
return u !== Error.prototype;
|
|
1622
|
-
}, (i) => i !== "isAxiosError"), v.call(
|
|
1422
|
+
}, (i) => i !== "isAxiosError"), v.call(s, e.message, t, n, r, o), s.cause = e, s.name = e.name, a && Object.assign(s, a), s;
|
|
1623
1423
|
};
|
|
1624
|
-
const
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1424
|
+
const is = null;
|
|
1425
|
+
function Tt(e) {
|
|
1426
|
+
return d.isPlainObject(e) || d.isArray(e);
|
|
1627
1427
|
}
|
|
1628
|
-
function
|
|
1629
|
-
return
|
|
1428
|
+
function kn(e) {
|
|
1429
|
+
return d.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
1630
1430
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return e ? e.concat(t).map(function(o,
|
|
1633
|
-
return o =
|
|
1431
|
+
function en(e, t, n) {
|
|
1432
|
+
return e ? e.concat(t).map(function(o, a) {
|
|
1433
|
+
return o = kn(o), !n && a ? "[" + o + "]" : o;
|
|
1634
1434
|
}).join(n ? "." : "") : t;
|
|
1635
1435
|
}
|
|
1636
|
-
function
|
|
1637
|
-
return
|
|
1436
|
+
function ls(e) {
|
|
1437
|
+
return d.isArray(e) && !e.some(Tt);
|
|
1638
1438
|
}
|
|
1639
|
-
const
|
|
1439
|
+
const cs = d.toFlatObject(d, {}, null, function(t) {
|
|
1640
1440
|
return /^is[A-Z]/.test(t);
|
|
1641
1441
|
});
|
|
1642
|
-
function
|
|
1643
|
-
if (!
|
|
1442
|
+
function nt(e, t, n) {
|
|
1443
|
+
if (!d.isObject(e))
|
|
1644
1444
|
throw new TypeError("target must be an object");
|
|
1645
|
-
t = t || new FormData(), n =
|
|
1445
|
+
t = t || new FormData(), n = d.toFlatObject(n, {
|
|
1646
1446
|
metaTokens: !0,
|
|
1647
1447
|
dots: !1,
|
|
1648
1448
|
indexes: !1
|
|
1649
1449
|
}, !1, function(m, y) {
|
|
1650
|
-
return !
|
|
1450
|
+
return !d.isUndefined(y[m]);
|
|
1651
1451
|
});
|
|
1652
|
-
const r = n.metaTokens, o = n.visitor ||
|
|
1653
|
-
if (!
|
|
1452
|
+
const r = n.metaTokens, o = n.visitor || f, a = n.dots, s = n.indexes, u = (n.Blob || typeof Blob < "u" && Blob) && d.isSpecCompliantForm(t);
|
|
1453
|
+
if (!d.isFunction(o))
|
|
1654
1454
|
throw new TypeError("visitor must be a function");
|
|
1655
1455
|
function c(g) {
|
|
1656
1456
|
if (g === null) return "";
|
|
1657
|
-
if (
|
|
1457
|
+
if (d.isDate(g))
|
|
1658
1458
|
return g.toISOString();
|
|
1659
|
-
if (!u &&
|
|
1459
|
+
if (!u && d.isBlob(g))
|
|
1660
1460
|
throw new v("Blob is not supported. Use a Buffer instead.");
|
|
1661
|
-
return
|
|
1461
|
+
return d.isArrayBuffer(g) || d.isTypedArray(g) ? u && typeof Blob == "function" ? new Blob([g]) : Buffer.from(g) : g;
|
|
1662
1462
|
}
|
|
1663
|
-
function
|
|
1664
|
-
let
|
|
1463
|
+
function f(g, m, y) {
|
|
1464
|
+
let R = g;
|
|
1665
1465
|
if (g && !y && typeof g == "object") {
|
|
1666
|
-
if (
|
|
1466
|
+
if (d.endsWith(m, "{}"))
|
|
1667
1467
|
m = r ? m : m.slice(0, -2), g = JSON.stringify(g);
|
|
1668
|
-
else if (
|
|
1669
|
-
return m =
|
|
1670
|
-
!(
|
|
1468
|
+
else if (d.isArray(g) && ls(g) || (d.isFileList(g) || d.endsWith(m, "[]")) && (R = d.toArray(g)))
|
|
1469
|
+
return m = kn(m), R.forEach(function(T, F) {
|
|
1470
|
+
!(d.isUndefined(T) || T === null) && t.append(
|
|
1671
1471
|
// eslint-disable-next-line no-nested-ternary
|
|
1672
|
-
|
|
1673
|
-
c(
|
|
1472
|
+
s === !0 ? en([m], F, a) : s === null ? m : m + "[]",
|
|
1473
|
+
c(T)
|
|
1674
1474
|
);
|
|
1675
1475
|
}), !1;
|
|
1676
1476
|
}
|
|
1677
|
-
return
|
|
1477
|
+
return Tt(g) ? !0 : (t.append(en(y, m, a), c(g)), !1);
|
|
1678
1478
|
}
|
|
1679
|
-
const h = [], p = Object.assign(
|
|
1680
|
-
defaultVisitor:
|
|
1479
|
+
const h = [], p = Object.assign(cs, {
|
|
1480
|
+
defaultVisitor: f,
|
|
1681
1481
|
convertValue: c,
|
|
1682
|
-
isVisitable:
|
|
1482
|
+
isVisitable: Tt
|
|
1683
1483
|
});
|
|
1684
1484
|
function l(g, m) {
|
|
1685
|
-
if (!
|
|
1485
|
+
if (!d.isUndefined(g)) {
|
|
1686
1486
|
if (h.indexOf(g) !== -1)
|
|
1687
1487
|
throw Error("Circular reference detected in " + m.join("."));
|
|
1688
|
-
h.push(g),
|
|
1689
|
-
(!(
|
|
1488
|
+
h.push(g), d.forEach(g, function(R, S) {
|
|
1489
|
+
(!(d.isUndefined(R) || R === null) && o.call(
|
|
1690
1490
|
t,
|
|
1691
|
-
|
|
1692
|
-
|
|
1491
|
+
R,
|
|
1492
|
+
d.isString(S) ? S.trim() : S,
|
|
1693
1493
|
m,
|
|
1694
1494
|
p
|
|
1695
|
-
)) === !0 && l(
|
|
1495
|
+
)) === !0 && l(R, m ? m.concat(S) : [S]);
|
|
1696
1496
|
}), h.pop();
|
|
1697
1497
|
}
|
|
1698
1498
|
}
|
|
1699
|
-
if (!
|
|
1499
|
+
if (!d.isObject(e))
|
|
1700
1500
|
throw new TypeError("data must be an object");
|
|
1701
1501
|
return l(e), t;
|
|
1702
1502
|
}
|
|
1703
|
-
function
|
|
1503
|
+
function tn(e) {
|
|
1704
1504
|
const t = {
|
|
1705
1505
|
"!": "%21",
|
|
1706
1506
|
"'": "%27",
|
|
@@ -1714,40 +1514,40 @@ function dn(e) {
|
|
|
1714
1514
|
return t[r];
|
|
1715
1515
|
});
|
|
1716
1516
|
}
|
|
1717
|
-
function
|
|
1718
|
-
this._pairs = [], e &&
|
|
1517
|
+
function Mt(e, t) {
|
|
1518
|
+
this._pairs = [], e && nt(e, this, t);
|
|
1719
1519
|
}
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1520
|
+
const Nn = Mt.prototype;
|
|
1521
|
+
Nn.append = function(t, n) {
|
|
1722
1522
|
this._pairs.push([t, n]);
|
|
1723
1523
|
};
|
|
1724
|
-
|
|
1524
|
+
Nn.toString = function(t) {
|
|
1725
1525
|
const n = t ? function(r) {
|
|
1726
|
-
return t.call(this, r,
|
|
1727
|
-
} :
|
|
1526
|
+
return t.call(this, r, tn);
|
|
1527
|
+
} : tn;
|
|
1728
1528
|
return this._pairs.map(function(o) {
|
|
1729
1529
|
return n(o[0]) + "=" + n(o[1]);
|
|
1730
1530
|
}, "").join("&");
|
|
1731
1531
|
};
|
|
1732
|
-
function
|
|
1532
|
+
function us(e) {
|
|
1733
1533
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
1734
1534
|
}
|
|
1735
|
-
function
|
|
1535
|
+
function Ln(e, t, n) {
|
|
1736
1536
|
if (!t)
|
|
1737
1537
|
return e;
|
|
1738
|
-
const r = n && n.encode ||
|
|
1739
|
-
|
|
1538
|
+
const r = n && n.encode || us;
|
|
1539
|
+
d.isFunction(n) && (n = {
|
|
1740
1540
|
serialize: n
|
|
1741
1541
|
});
|
|
1742
1542
|
const o = n && n.serialize;
|
|
1743
|
-
let
|
|
1744
|
-
if (o ?
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1543
|
+
let a;
|
|
1544
|
+
if (o ? a = o(t, n) : a = d.isURLSearchParams(t) ? t.toString() : new Mt(t, n).toString(r), a) {
|
|
1545
|
+
const s = e.indexOf("#");
|
|
1546
|
+
s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + a;
|
|
1747
1547
|
}
|
|
1748
1548
|
return e;
|
|
1749
1549
|
}
|
|
1750
|
-
class
|
|
1550
|
+
class nn {
|
|
1751
1551
|
constructor() {
|
|
1752
1552
|
this.handlers = [];
|
|
1753
1553
|
}
|
|
@@ -1796,117 +1596,117 @@ class fn {
|
|
|
1796
1596
|
* @returns {void}
|
|
1797
1597
|
*/
|
|
1798
1598
|
forEach(t) {
|
|
1799
|
-
|
|
1599
|
+
d.forEach(this.handlers, function(r) {
|
|
1800
1600
|
r !== null && t(r);
|
|
1801
1601
|
});
|
|
1802
1602
|
}
|
|
1803
1603
|
}
|
|
1804
|
-
const
|
|
1604
|
+
const Mn = {
|
|
1805
1605
|
silentJSONParsing: !0,
|
|
1806
1606
|
forcedJSONParsing: !0,
|
|
1807
1607
|
clarifyTimeoutError: !1
|
|
1808
|
-
},
|
|
1608
|
+
}, ds = typeof URLSearchParams < "u" ? URLSearchParams : Mt, fs = typeof FormData < "u" ? FormData : null, ps = typeof Blob < "u" ? Blob : null, hs = {
|
|
1809
1609
|
isBrowser: !0,
|
|
1810
1610
|
classes: {
|
|
1811
|
-
URLSearchParams:
|
|
1812
|
-
FormData:
|
|
1813
|
-
Blob:
|
|
1611
|
+
URLSearchParams: ds,
|
|
1612
|
+
FormData: fs,
|
|
1613
|
+
Blob: ps
|
|
1814
1614
|
},
|
|
1815
1615
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
1816
|
-
},
|
|
1817
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
1616
|
+
}, Pt = typeof window < "u" && typeof document < "u", _t = typeof navigator == "object" && navigator || void 0, ms = Pt && (!_t || ["ReactNative", "NativeScript", "NS"].indexOf(_t.product) < 0), gs = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
1617
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", ws = Pt && window.location.href || "http://localhost", ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1818
1618
|
__proto__: null,
|
|
1819
|
-
hasBrowserEnv:
|
|
1820
|
-
hasStandardBrowserEnv:
|
|
1821
|
-
hasStandardBrowserWebWorkerEnv:
|
|
1822
|
-
navigator:
|
|
1823
|
-
origin:
|
|
1824
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1825
|
-
...
|
|
1826
|
-
...
|
|
1619
|
+
hasBrowserEnv: Pt,
|
|
1620
|
+
hasStandardBrowserEnv: ms,
|
|
1621
|
+
hasStandardBrowserWebWorkerEnv: gs,
|
|
1622
|
+
navigator: _t,
|
|
1623
|
+
origin: ws
|
|
1624
|
+
}, Symbol.toStringTag, { value: "Module" })), j = {
|
|
1625
|
+
...ys,
|
|
1626
|
+
...hs
|
|
1827
1627
|
};
|
|
1828
|
-
function
|
|
1829
|
-
return
|
|
1830
|
-
visitor: function(n, r, o,
|
|
1831
|
-
return
|
|
1628
|
+
function bs(e, t) {
|
|
1629
|
+
return nt(e, new j.classes.URLSearchParams(), Object.assign({
|
|
1630
|
+
visitor: function(n, r, o, a) {
|
|
1631
|
+
return j.isNode && d.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : a.defaultVisitor.apply(this, arguments);
|
|
1832
1632
|
}
|
|
1833
1633
|
}, t));
|
|
1834
1634
|
}
|
|
1835
|
-
function
|
|
1836
|
-
return
|
|
1635
|
+
function vs(e) {
|
|
1636
|
+
return d.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
1837
1637
|
}
|
|
1838
|
-
function
|
|
1638
|
+
function Es(e) {
|
|
1839
1639
|
const t = {}, n = Object.keys(e);
|
|
1840
1640
|
let r;
|
|
1841
1641
|
const o = n.length;
|
|
1842
|
-
let
|
|
1642
|
+
let a;
|
|
1843
1643
|
for (r = 0; r < o; r++)
|
|
1844
|
-
|
|
1644
|
+
a = n[r], t[a] = e[a];
|
|
1845
1645
|
return t;
|
|
1846
1646
|
}
|
|
1847
|
-
function
|
|
1848
|
-
function t(n, r, o,
|
|
1849
|
-
let
|
|
1850
|
-
if (
|
|
1851
|
-
const i = Number.isFinite(+
|
|
1852
|
-
return
|
|
1647
|
+
function Pn(e) {
|
|
1648
|
+
function t(n, r, o, a) {
|
|
1649
|
+
let s = n[a++];
|
|
1650
|
+
if (s === "__proto__") return !0;
|
|
1651
|
+
const i = Number.isFinite(+s), u = a >= n.length;
|
|
1652
|
+
return s = !s && d.isArray(o) ? o.length : s, u ? (d.hasOwnProp(o, s) ? o[s] = [o[s], r] : o[s] = r, !i) : ((!o[s] || !d.isObject(o[s])) && (o[s] = []), t(n, r, o[s], a) && d.isArray(o[s]) && (o[s] = Es(o[s])), !i);
|
|
1853
1653
|
}
|
|
1854
|
-
if (
|
|
1654
|
+
if (d.isFormData(e) && d.isFunction(e.entries)) {
|
|
1855
1655
|
const n = {};
|
|
1856
|
-
return
|
|
1857
|
-
t(
|
|
1656
|
+
return d.forEachEntry(e, (r, o) => {
|
|
1657
|
+
t(vs(r), o, n, 0);
|
|
1858
1658
|
}), n;
|
|
1859
1659
|
}
|
|
1860
1660
|
return null;
|
|
1861
1661
|
}
|
|
1862
|
-
function
|
|
1863
|
-
if (
|
|
1662
|
+
function Ss(e, t, n) {
|
|
1663
|
+
if (d.isString(e))
|
|
1864
1664
|
try {
|
|
1865
|
-
return (t || JSON.parse)(e),
|
|
1665
|
+
return (t || JSON.parse)(e), d.trim(e);
|
|
1866
1666
|
} catch (r) {
|
|
1867
1667
|
if (r.name !== "SyntaxError")
|
|
1868
1668
|
throw r;
|
|
1869
1669
|
}
|
|
1870
1670
|
return (n || JSON.stringify)(e);
|
|
1871
1671
|
}
|
|
1872
|
-
const
|
|
1873
|
-
transitional:
|
|
1672
|
+
const Ie = {
|
|
1673
|
+
transitional: Mn,
|
|
1874
1674
|
adapter: ["xhr", "http", "fetch"],
|
|
1875
1675
|
transformRequest: [function(t, n) {
|
|
1876
|
-
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1,
|
|
1877
|
-
if (
|
|
1878
|
-
return o ? JSON.stringify(
|
|
1879
|
-
if (
|
|
1676
|
+
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, a = d.isObject(t);
|
|
1677
|
+
if (a && d.isHTMLForm(t) && (t = new FormData(t)), d.isFormData(t))
|
|
1678
|
+
return o ? JSON.stringify(Pn(t)) : t;
|
|
1679
|
+
if (d.isArrayBuffer(t) || d.isBuffer(t) || d.isStream(t) || d.isFile(t) || d.isBlob(t) || d.isReadableStream(t))
|
|
1880
1680
|
return t;
|
|
1881
|
-
if (
|
|
1681
|
+
if (d.isArrayBufferView(t))
|
|
1882
1682
|
return t.buffer;
|
|
1883
|
-
if (
|
|
1683
|
+
if (d.isURLSearchParams(t))
|
|
1884
1684
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
1885
1685
|
let i;
|
|
1886
|
-
if (
|
|
1686
|
+
if (a) {
|
|
1887
1687
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
1888
|
-
return
|
|
1889
|
-
if ((i =
|
|
1688
|
+
return bs(t, this.formSerializer).toString();
|
|
1689
|
+
if ((i = d.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
1890
1690
|
const u = this.env && this.env.FormData;
|
|
1891
|
-
return
|
|
1691
|
+
return nt(
|
|
1892
1692
|
i ? { "files[]": t } : t,
|
|
1893
1693
|
u && new u(),
|
|
1894
1694
|
this.formSerializer
|
|
1895
1695
|
);
|
|
1896
1696
|
}
|
|
1897
1697
|
}
|
|
1898
|
-
return
|
|
1698
|
+
return a || o ? (n.setContentType("application/json", !1), Ss(t)) : t;
|
|
1899
1699
|
}],
|
|
1900
1700
|
transformResponse: [function(t) {
|
|
1901
|
-
const n = this.transitional ||
|
|
1902
|
-
if (
|
|
1701
|
+
const n = this.transitional || Ie.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
|
|
1702
|
+
if (d.isResponse(t) || d.isReadableStream(t))
|
|
1903
1703
|
return t;
|
|
1904
|
-
if (t &&
|
|
1905
|
-
const
|
|
1704
|
+
if (t && d.isString(t) && (r && !this.responseType || o)) {
|
|
1705
|
+
const s = !(n && n.silentJSONParsing) && o;
|
|
1906
1706
|
try {
|
|
1907
1707
|
return JSON.parse(t);
|
|
1908
1708
|
} catch (i) {
|
|
1909
|
-
if (
|
|
1709
|
+
if (s)
|
|
1910
1710
|
throw i.name === "SyntaxError" ? v.from(i, v.ERR_BAD_RESPONSE, this, null, this.response) : i;
|
|
1911
1711
|
}
|
|
1912
1712
|
}
|
|
@@ -1922,8 +1722,8 @@ const Fe = {
|
|
|
1922
1722
|
maxContentLength: -1,
|
|
1923
1723
|
maxBodyLength: -1,
|
|
1924
1724
|
env: {
|
|
1925
|
-
FormData:
|
|
1926
|
-
Blob:
|
|
1725
|
+
FormData: j.classes.FormData,
|
|
1726
|
+
Blob: j.classes.Blob
|
|
1927
1727
|
},
|
|
1928
1728
|
validateStatus: function(t) {
|
|
1929
1729
|
return t >= 200 && t < 300;
|
|
@@ -1935,10 +1735,10 @@ const Fe = {
|
|
|
1935
1735
|
}
|
|
1936
1736
|
}
|
|
1937
1737
|
};
|
|
1938
|
-
|
|
1939
|
-
|
|
1738
|
+
d.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
1739
|
+
Ie.headers[e] = {};
|
|
1940
1740
|
});
|
|
1941
|
-
const
|
|
1741
|
+
const xs = d.toObjectSet([
|
|
1942
1742
|
"age",
|
|
1943
1743
|
"authorization",
|
|
1944
1744
|
"content-length",
|
|
@@ -1956,131 +1756,131 @@ const ra = f.toObjectSet([
|
|
|
1956
1756
|
"referer",
|
|
1957
1757
|
"retry-after",
|
|
1958
1758
|
"user-agent"
|
|
1959
|
-
]),
|
|
1759
|
+
]), Rs = (e) => {
|
|
1960
1760
|
const t = {};
|
|
1961
1761
|
let n, r, o;
|
|
1962
1762
|
return e && e.split(`
|
|
1963
|
-
`).forEach(function(
|
|
1964
|
-
o =
|
|
1763
|
+
`).forEach(function(s) {
|
|
1764
|
+
o = s.indexOf(":"), n = s.substring(0, o).trim().toLowerCase(), r = s.substring(o + 1).trim(), !(!n || t[n] && xs[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
1965
1765
|
}), t;
|
|
1966
|
-
},
|
|
1967
|
-
function
|
|
1766
|
+
}, rn = Symbol("internals");
|
|
1767
|
+
function Le(e) {
|
|
1968
1768
|
return e && String(e).trim().toLowerCase();
|
|
1969
1769
|
}
|
|
1970
|
-
function
|
|
1971
|
-
return e === !1 || e == null ? e :
|
|
1770
|
+
function Ke(e) {
|
|
1771
|
+
return e === !1 || e == null ? e : d.isArray(e) ? e.map(Ke) : String(e);
|
|
1972
1772
|
}
|
|
1973
|
-
function
|
|
1773
|
+
function Ts(e) {
|
|
1974
1774
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1975
1775
|
let r;
|
|
1976
1776
|
for (; r = n.exec(e); )
|
|
1977
1777
|
t[r[1]] = r[2];
|
|
1978
1778
|
return t;
|
|
1979
1779
|
}
|
|
1980
|
-
const
|
|
1981
|
-
function
|
|
1982
|
-
if (
|
|
1780
|
+
const _s = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1781
|
+
function yt(e, t, n, r, o) {
|
|
1782
|
+
if (d.isFunction(r))
|
|
1983
1783
|
return r.call(this, t, n);
|
|
1984
|
-
if (o && (t = n), !!
|
|
1985
|
-
if (
|
|
1784
|
+
if (o && (t = n), !!d.isString(t)) {
|
|
1785
|
+
if (d.isString(r))
|
|
1986
1786
|
return t.indexOf(r) !== -1;
|
|
1987
|
-
if (
|
|
1787
|
+
if (d.isRegExp(r))
|
|
1988
1788
|
return r.test(t);
|
|
1989
1789
|
}
|
|
1990
1790
|
}
|
|
1991
|
-
function
|
|
1791
|
+
function As(e) {
|
|
1992
1792
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
1993
1793
|
}
|
|
1994
|
-
function
|
|
1995
|
-
const n =
|
|
1794
|
+
function Os(e, t) {
|
|
1795
|
+
const n = d.toCamelCase(" " + t);
|
|
1996
1796
|
["get", "set", "has"].forEach((r) => {
|
|
1997
1797
|
Object.defineProperty(e, r + n, {
|
|
1998
|
-
value: function(o,
|
|
1999
|
-
return this[r].call(this, t, o,
|
|
1798
|
+
value: function(o, a, s) {
|
|
1799
|
+
return this[r].call(this, t, o, a, s);
|
|
2000
1800
|
},
|
|
2001
1801
|
configurable: !0
|
|
2002
1802
|
});
|
|
2003
1803
|
});
|
|
2004
1804
|
}
|
|
2005
|
-
let
|
|
1805
|
+
let W = class {
|
|
2006
1806
|
constructor(t) {
|
|
2007
1807
|
t && this.set(t);
|
|
2008
1808
|
}
|
|
2009
1809
|
set(t, n, r) {
|
|
2010
1810
|
const o = this;
|
|
2011
|
-
function
|
|
2012
|
-
const
|
|
2013
|
-
if (!
|
|
1811
|
+
function a(i, u, c) {
|
|
1812
|
+
const f = Le(u);
|
|
1813
|
+
if (!f)
|
|
2014
1814
|
throw new Error("header name must be a non-empty string");
|
|
2015
|
-
const h =
|
|
2016
|
-
(!h || o[h] === void 0 || c === !0 || c === void 0 && o[h] !== !1) && (o[h || u] =
|
|
2017
|
-
}
|
|
2018
|
-
const
|
|
2019
|
-
if (
|
|
2020
|
-
|
|
2021
|
-
else if (
|
|
2022
|
-
|
|
2023
|
-
else if (
|
|
1815
|
+
const h = d.findKey(o, f);
|
|
1816
|
+
(!h || o[h] === void 0 || c === !0 || c === void 0 && o[h] !== !1) && (o[h || u] = Ke(i));
|
|
1817
|
+
}
|
|
1818
|
+
const s = (i, u) => d.forEach(i, (c, f) => a(c, f, u));
|
|
1819
|
+
if (d.isPlainObject(t) || t instanceof this.constructor)
|
|
1820
|
+
s(t, n);
|
|
1821
|
+
else if (d.isString(t) && (t = t.trim()) && !_s(t))
|
|
1822
|
+
s(Rs(t), n);
|
|
1823
|
+
else if (d.isHeaders(t))
|
|
2024
1824
|
for (const [i, u] of t.entries())
|
|
2025
|
-
|
|
1825
|
+
a(u, i, r);
|
|
2026
1826
|
else
|
|
2027
|
-
t != null &&
|
|
1827
|
+
t != null && a(n, t, r);
|
|
2028
1828
|
return this;
|
|
2029
1829
|
}
|
|
2030
1830
|
get(t, n) {
|
|
2031
|
-
if (t =
|
|
2032
|
-
const r =
|
|
1831
|
+
if (t = Le(t), t) {
|
|
1832
|
+
const r = d.findKey(this, t);
|
|
2033
1833
|
if (r) {
|
|
2034
1834
|
const o = this[r];
|
|
2035
1835
|
if (!n)
|
|
2036
1836
|
return o;
|
|
2037
1837
|
if (n === !0)
|
|
2038
|
-
return
|
|
2039
|
-
if (
|
|
1838
|
+
return Ts(o);
|
|
1839
|
+
if (d.isFunction(n))
|
|
2040
1840
|
return n.call(this, o, r);
|
|
2041
|
-
if (
|
|
1841
|
+
if (d.isRegExp(n))
|
|
2042
1842
|
return n.exec(o);
|
|
2043
1843
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
2044
1844
|
}
|
|
2045
1845
|
}
|
|
2046
1846
|
}
|
|
2047
1847
|
has(t, n) {
|
|
2048
|
-
if (t =
|
|
2049
|
-
const r =
|
|
2050
|
-
return !!(r && this[r] !== void 0 && (!n ||
|
|
1848
|
+
if (t = Le(t), t) {
|
|
1849
|
+
const r = d.findKey(this, t);
|
|
1850
|
+
return !!(r && this[r] !== void 0 && (!n || yt(this, this[r], r, n)));
|
|
2051
1851
|
}
|
|
2052
1852
|
return !1;
|
|
2053
1853
|
}
|
|
2054
1854
|
delete(t, n) {
|
|
2055
1855
|
const r = this;
|
|
2056
1856
|
let o = !1;
|
|
2057
|
-
function s
|
|
2058
|
-
if (
|
|
2059
|
-
const i =
|
|
2060
|
-
i && (!n ||
|
|
1857
|
+
function a(s) {
|
|
1858
|
+
if (s = Le(s), s) {
|
|
1859
|
+
const i = d.findKey(r, s);
|
|
1860
|
+
i && (!n || yt(r, r[i], i, n)) && (delete r[i], o = !0);
|
|
2061
1861
|
}
|
|
2062
1862
|
}
|
|
2063
|
-
return
|
|
1863
|
+
return d.isArray(t) ? t.forEach(a) : a(t), o;
|
|
2064
1864
|
}
|
|
2065
1865
|
clear(t) {
|
|
2066
1866
|
const n = Object.keys(this);
|
|
2067
1867
|
let r = n.length, o = !1;
|
|
2068
1868
|
for (; r--; ) {
|
|
2069
|
-
const
|
|
2070
|
-
(!t ||
|
|
1869
|
+
const a = n[r];
|
|
1870
|
+
(!t || yt(this, this[a], a, t, !0)) && (delete this[a], o = !0);
|
|
2071
1871
|
}
|
|
2072
1872
|
return o;
|
|
2073
1873
|
}
|
|
2074
1874
|
normalize(t) {
|
|
2075
1875
|
const n = this, r = {};
|
|
2076
|
-
return
|
|
2077
|
-
const
|
|
2078
|
-
if (
|
|
2079
|
-
n[
|
|
1876
|
+
return d.forEach(this, (o, a) => {
|
|
1877
|
+
const s = d.findKey(r, a);
|
|
1878
|
+
if (s) {
|
|
1879
|
+
n[s] = Ke(o), delete n[a];
|
|
2080
1880
|
return;
|
|
2081
1881
|
}
|
|
2082
|
-
const i = t ?
|
|
2083
|
-
i !==
|
|
1882
|
+
const i = t ? As(a) : String(a).trim();
|
|
1883
|
+
i !== a && delete n[a], n[i] = Ke(o), r[i] = !0;
|
|
2084
1884
|
}), this;
|
|
2085
1885
|
}
|
|
2086
1886
|
concat(...t) {
|
|
@@ -2088,8 +1888,8 @@ let K = class {
|
|
|
2088
1888
|
}
|
|
2089
1889
|
toJSON(t) {
|
|
2090
1890
|
const n = /* @__PURE__ */ Object.create(null);
|
|
2091
|
-
return
|
|
2092
|
-
r != null && r !== !1 && (n[o] = t &&
|
|
1891
|
+
return d.forEach(this, (r, o) => {
|
|
1892
|
+
r != null && r !== !1 && (n[o] = t && d.isArray(r) ? r.join(", ") : r);
|
|
2093
1893
|
}), n;
|
|
2094
1894
|
}
|
|
2095
1895
|
[Symbol.iterator]() {
|
|
@@ -2110,18 +1910,18 @@ let K = class {
|
|
|
2110
1910
|
return n.forEach((o) => r.set(o)), r;
|
|
2111
1911
|
}
|
|
2112
1912
|
static accessor(t) {
|
|
2113
|
-
const r = (this[
|
|
1913
|
+
const r = (this[rn] = this[rn] = {
|
|
2114
1914
|
accessors: {}
|
|
2115
1915
|
}).accessors, o = this.prototype;
|
|
2116
|
-
function s
|
|
2117
|
-
const i =
|
|
2118
|
-
r[i] || (
|
|
1916
|
+
function a(s) {
|
|
1917
|
+
const i = Le(s);
|
|
1918
|
+
r[i] || (Os(o, s), r[i] = !0);
|
|
2119
1919
|
}
|
|
2120
|
-
return
|
|
1920
|
+
return d.isArray(t) ? t.forEach(a) : a(t), this;
|
|
2121
1921
|
}
|
|
2122
1922
|
};
|
|
2123
|
-
|
|
2124
|
-
|
|
1923
|
+
W.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1924
|
+
d.reduceDescriptors(W.prototype, ({ value: e }, t) => {
|
|
2125
1925
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
2126
1926
|
return {
|
|
2127
1927
|
get: () => e,
|
|
@@ -2130,24 +1930,24 @@ f.reduceDescriptors(K.prototype, ({ value: e }, t) => {
|
|
|
2130
1930
|
}
|
|
2131
1931
|
};
|
|
2132
1932
|
});
|
|
2133
|
-
|
|
2134
|
-
function
|
|
2135
|
-
const n = this ||
|
|
2136
|
-
let
|
|
2137
|
-
return
|
|
2138
|
-
|
|
2139
|
-
}), o.normalize(),
|
|
2140
|
-
}
|
|
2141
|
-
function
|
|
1933
|
+
d.freezeMethods(W);
|
|
1934
|
+
function bt(e, t) {
|
|
1935
|
+
const n = this || Ie, r = t || n, o = W.from(r.headers);
|
|
1936
|
+
let a = r.data;
|
|
1937
|
+
return d.forEach(e, function(i) {
|
|
1938
|
+
a = i.call(n, a, o.normalize(), t ? t.status : void 0);
|
|
1939
|
+
}), o.normalize(), a;
|
|
1940
|
+
}
|
|
1941
|
+
function In(e) {
|
|
2142
1942
|
return !!(e && e.__CANCEL__);
|
|
2143
1943
|
}
|
|
2144
|
-
function
|
|
1944
|
+
function Te(e, t, n) {
|
|
2145
1945
|
v.call(this, e ?? "canceled", v.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
2146
1946
|
}
|
|
2147
|
-
|
|
1947
|
+
d.inherits(Te, v, {
|
|
2148
1948
|
__CANCEL__: !0
|
|
2149
1949
|
});
|
|
2150
|
-
function
|
|
1950
|
+
function Dn(e, t, n) {
|
|
2151
1951
|
const r = n.config.validateStatus;
|
|
2152
1952
|
!n.status || !r || r(n.status) ? e(n) : t(new v(
|
|
2153
1953
|
"Request failed with status code " + n.status,
|
|
@@ -2157,73 +1957,73 @@ function Kn(e, t, n) {
|
|
|
2157
1957
|
n
|
|
2158
1958
|
));
|
|
2159
1959
|
}
|
|
2160
|
-
function
|
|
1960
|
+
function Cs(e) {
|
|
2161
1961
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
2162
1962
|
return t && t[1] || "";
|
|
2163
1963
|
}
|
|
2164
|
-
function
|
|
1964
|
+
function ks(e, t) {
|
|
2165
1965
|
e = e || 10;
|
|
2166
1966
|
const n = new Array(e), r = new Array(e);
|
|
2167
|
-
let o = 0,
|
|
1967
|
+
let o = 0, a = 0, s;
|
|
2168
1968
|
return t = t !== void 0 ? t : 1e3, function(u) {
|
|
2169
|
-
const c = Date.now(),
|
|
2170
|
-
|
|
2171
|
-
let h =
|
|
1969
|
+
const c = Date.now(), f = r[a];
|
|
1970
|
+
s || (s = c), n[o] = u, r[o] = c;
|
|
1971
|
+
let h = a, p = 0;
|
|
2172
1972
|
for (; h !== o; )
|
|
2173
1973
|
p += n[h++], h = h % e;
|
|
2174
|
-
if (o = (o + 1) % e, o ===
|
|
1974
|
+
if (o = (o + 1) % e, o === a && (a = (a + 1) % e), c - s < t)
|
|
2175
1975
|
return;
|
|
2176
|
-
const l =
|
|
1976
|
+
const l = f && c - f;
|
|
2177
1977
|
return l ? Math.round(p * 1e3 / l) : void 0;
|
|
2178
1978
|
};
|
|
2179
1979
|
}
|
|
2180
|
-
function
|
|
2181
|
-
let n = 0, r = 1e3 / t, o,
|
|
2182
|
-
const
|
|
2183
|
-
n =
|
|
1980
|
+
function Ns(e, t) {
|
|
1981
|
+
let n = 0, r = 1e3 / t, o, a;
|
|
1982
|
+
const s = (c, f = Date.now()) => {
|
|
1983
|
+
n = f, o = null, a && (clearTimeout(a), a = null), e.apply(null, c);
|
|
2184
1984
|
};
|
|
2185
1985
|
return [(...c) => {
|
|
2186
|
-
const
|
|
2187
|
-
h >= r ?
|
|
2188
|
-
|
|
1986
|
+
const f = Date.now(), h = f - n;
|
|
1987
|
+
h >= r ? s(c, f) : (o = c, a || (a = setTimeout(() => {
|
|
1988
|
+
a = null, s(o);
|
|
2189
1989
|
}, r - h)));
|
|
2190
|
-
}, () => o &&
|
|
1990
|
+
}, () => o && s(o)];
|
|
2191
1991
|
}
|
|
2192
|
-
const
|
|
1992
|
+
const Xe = (e, t, n = 3) => {
|
|
2193
1993
|
let r = 0;
|
|
2194
|
-
const o =
|
|
2195
|
-
return
|
|
2196
|
-
const
|
|
2197
|
-
r =
|
|
1994
|
+
const o = ks(50, 250);
|
|
1995
|
+
return Ns((a) => {
|
|
1996
|
+
const s = a.loaded, i = a.lengthComputable ? a.total : void 0, u = s - r, c = o(u), f = s <= i;
|
|
1997
|
+
r = s;
|
|
2198
1998
|
const h = {
|
|
2199
|
-
loaded:
|
|
1999
|
+
loaded: s,
|
|
2200
2000
|
total: i,
|
|
2201
|
-
progress: i ?
|
|
2001
|
+
progress: i ? s / i : void 0,
|
|
2202
2002
|
bytes: u,
|
|
2203
2003
|
rate: c || void 0,
|
|
2204
|
-
estimated: c && i &&
|
|
2205
|
-
event:
|
|
2004
|
+
estimated: c && i && f ? (i - s) / c : void 0,
|
|
2005
|
+
event: a,
|
|
2206
2006
|
lengthComputable: i != null,
|
|
2207
2007
|
[t ? "download" : "upload"]: !0
|
|
2208
2008
|
};
|
|
2209
2009
|
e(h);
|
|
2210
2010
|
}, n);
|
|
2211
|
-
},
|
|
2011
|
+
}, on = (e, t) => {
|
|
2212
2012
|
const n = e != null;
|
|
2213
2013
|
return [(r) => t[0]({
|
|
2214
2014
|
lengthComputable: n,
|
|
2215
2015
|
total: e,
|
|
2216
2016
|
loaded: r
|
|
2217
2017
|
}), t[1]];
|
|
2218
|
-
},
|
|
2219
|
-
new URL(
|
|
2220
|
-
|
|
2221
|
-
) : () => !0,
|
|
2018
|
+
}, sn = (e) => (...t) => d.asap(() => e(...t)), Ls = j.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, j.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
2019
|
+
new URL(j.origin),
|
|
2020
|
+
j.navigator && /(msie|trident)/i.test(j.navigator.userAgent)
|
|
2021
|
+
) : () => !0, Ms = j.hasStandardBrowserEnv ? (
|
|
2222
2022
|
// Standard browser envs support document.cookie
|
|
2223
2023
|
{
|
|
2224
|
-
write(e, t, n, r, o,
|
|
2225
|
-
const
|
|
2226
|
-
|
|
2024
|
+
write(e, t, n, r, o, a) {
|
|
2025
|
+
const s = [e + "=" + encodeURIComponent(t)];
|
|
2026
|
+
d.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), d.isString(r) && s.push("path=" + r), d.isString(o) && s.push("domain=" + o), a === !0 && s.push("secure"), document.cookie = s.join("; ");
|
|
2227
2027
|
},
|
|
2228
2028
|
read(e) {
|
|
2229
2029
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -2245,183 +2045,183 @@ const tt = (e, t, n = 3) => {
|
|
|
2245
2045
|
}
|
|
2246
2046
|
}
|
|
2247
2047
|
);
|
|
2248
|
-
function
|
|
2048
|
+
function Ps(e) {
|
|
2249
2049
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
2250
2050
|
}
|
|
2251
|
-
function
|
|
2051
|
+
function Is(e, t) {
|
|
2252
2052
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
2253
2053
|
}
|
|
2254
|
-
function
|
|
2255
|
-
let r = !
|
|
2256
|
-
return e && r || n == !1 ?
|
|
2054
|
+
function Bn(e, t, n) {
|
|
2055
|
+
let r = !Ps(t);
|
|
2056
|
+
return e && r || n == !1 ? Is(e, t) : t;
|
|
2257
2057
|
}
|
|
2258
|
-
const
|
|
2259
|
-
function
|
|
2058
|
+
const an = (e) => e instanceof W ? { ...e } : e;
|
|
2059
|
+
function we(e, t) {
|
|
2260
2060
|
t = t || {};
|
|
2261
2061
|
const n = {};
|
|
2262
|
-
function r(c,
|
|
2263
|
-
return
|
|
2062
|
+
function r(c, f, h, p) {
|
|
2063
|
+
return d.isPlainObject(c) && d.isPlainObject(f) ? d.merge.call({ caseless: p }, c, f) : d.isPlainObject(f) ? d.merge({}, f) : d.isArray(f) ? f.slice() : f;
|
|
2264
2064
|
}
|
|
2265
|
-
function o(c,
|
|
2266
|
-
if (
|
|
2267
|
-
if (!
|
|
2065
|
+
function o(c, f, h, p) {
|
|
2066
|
+
if (d.isUndefined(f)) {
|
|
2067
|
+
if (!d.isUndefined(c))
|
|
2268
2068
|
return r(void 0, c, h, p);
|
|
2269
|
-
} else return r(c,
|
|
2069
|
+
} else return r(c, f, h, p);
|
|
2270
2070
|
}
|
|
2271
|
-
function
|
|
2272
|
-
if (!
|
|
2273
|
-
return r(void 0,
|
|
2071
|
+
function a(c, f) {
|
|
2072
|
+
if (!d.isUndefined(f))
|
|
2073
|
+
return r(void 0, f);
|
|
2274
2074
|
}
|
|
2275
|
-
function
|
|
2276
|
-
if (
|
|
2277
|
-
if (!
|
|
2075
|
+
function s(c, f) {
|
|
2076
|
+
if (d.isUndefined(f)) {
|
|
2077
|
+
if (!d.isUndefined(c))
|
|
2278
2078
|
return r(void 0, c);
|
|
2279
|
-
} else return r(void 0,
|
|
2079
|
+
} else return r(void 0, f);
|
|
2280
2080
|
}
|
|
2281
|
-
function i(c,
|
|
2081
|
+
function i(c, f, h) {
|
|
2282
2082
|
if (h in t)
|
|
2283
|
-
return r(c,
|
|
2083
|
+
return r(c, f);
|
|
2284
2084
|
if (h in e)
|
|
2285
2085
|
return r(void 0, c);
|
|
2286
2086
|
}
|
|
2287
2087
|
const u = {
|
|
2288
|
-
url:
|
|
2289
|
-
method:
|
|
2290
|
-
data:
|
|
2291
|
-
baseURL:
|
|
2292
|
-
transformRequest:
|
|
2293
|
-
transformResponse:
|
|
2294
|
-
paramsSerializer:
|
|
2295
|
-
timeout:
|
|
2296
|
-
timeoutMessage:
|
|
2297
|
-
withCredentials:
|
|
2298
|
-
withXSRFToken:
|
|
2299
|
-
adapter:
|
|
2300
|
-
responseType:
|
|
2301
|
-
xsrfCookieName:
|
|
2302
|
-
xsrfHeaderName:
|
|
2303
|
-
onUploadProgress:
|
|
2304
|
-
onDownloadProgress:
|
|
2305
|
-
decompress:
|
|
2306
|
-
maxContentLength:
|
|
2307
|
-
maxBodyLength:
|
|
2308
|
-
beforeRedirect:
|
|
2309
|
-
transport:
|
|
2310
|
-
httpAgent:
|
|
2311
|
-
httpsAgent:
|
|
2312
|
-
cancelToken:
|
|
2313
|
-
socketPath:
|
|
2314
|
-
responseEncoding:
|
|
2088
|
+
url: a,
|
|
2089
|
+
method: a,
|
|
2090
|
+
data: a,
|
|
2091
|
+
baseURL: s,
|
|
2092
|
+
transformRequest: s,
|
|
2093
|
+
transformResponse: s,
|
|
2094
|
+
paramsSerializer: s,
|
|
2095
|
+
timeout: s,
|
|
2096
|
+
timeoutMessage: s,
|
|
2097
|
+
withCredentials: s,
|
|
2098
|
+
withXSRFToken: s,
|
|
2099
|
+
adapter: s,
|
|
2100
|
+
responseType: s,
|
|
2101
|
+
xsrfCookieName: s,
|
|
2102
|
+
xsrfHeaderName: s,
|
|
2103
|
+
onUploadProgress: s,
|
|
2104
|
+
onDownloadProgress: s,
|
|
2105
|
+
decompress: s,
|
|
2106
|
+
maxContentLength: s,
|
|
2107
|
+
maxBodyLength: s,
|
|
2108
|
+
beforeRedirect: s,
|
|
2109
|
+
transport: s,
|
|
2110
|
+
httpAgent: s,
|
|
2111
|
+
httpsAgent: s,
|
|
2112
|
+
cancelToken: s,
|
|
2113
|
+
socketPath: s,
|
|
2114
|
+
responseEncoding: s,
|
|
2315
2115
|
validateStatus: i,
|
|
2316
|
-
headers: (c,
|
|
2116
|
+
headers: (c, f, h) => o(an(c), an(f), h, !0)
|
|
2317
2117
|
};
|
|
2318
|
-
return
|
|
2319
|
-
const h = u[
|
|
2320
|
-
|
|
2118
|
+
return d.forEach(Object.keys(Object.assign({}, e, t)), function(f) {
|
|
2119
|
+
const h = u[f] || o, p = h(e[f], t[f], f);
|
|
2120
|
+
d.isUndefined(p) && h !== i || (n[f] = p);
|
|
2321
2121
|
}), n;
|
|
2322
2122
|
}
|
|
2323
|
-
const
|
|
2324
|
-
const t =
|
|
2325
|
-
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName:
|
|
2326
|
-
t.headers =
|
|
2123
|
+
const Fn = (e) => {
|
|
2124
|
+
const t = we({}, e);
|
|
2125
|
+
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: a, headers: s, auth: i } = t;
|
|
2126
|
+
t.headers = s = W.from(s), t.url = Ln(Bn(t.baseURL, t.url), e.params, e.paramsSerializer), i && s.set(
|
|
2327
2127
|
"Authorization",
|
|
2328
2128
|
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
|
|
2329
2129
|
);
|
|
2330
2130
|
let u;
|
|
2331
|
-
if (
|
|
2332
|
-
if (
|
|
2333
|
-
|
|
2334
|
-
else if ((u =
|
|
2335
|
-
const [c, ...
|
|
2336
|
-
|
|
2131
|
+
if (d.isFormData(n)) {
|
|
2132
|
+
if (j.hasStandardBrowserEnv || j.hasStandardBrowserWebWorkerEnv)
|
|
2133
|
+
s.setContentType(void 0);
|
|
2134
|
+
else if ((u = s.getContentType()) !== !1) {
|
|
2135
|
+
const [c, ...f] = u ? u.split(";").map((h) => h.trim()).filter(Boolean) : [];
|
|
2136
|
+
s.setContentType([c || "multipart/form-data", ...f].join("; "));
|
|
2337
2137
|
}
|
|
2338
2138
|
}
|
|
2339
|
-
if (
|
|
2340
|
-
const c = o &&
|
|
2341
|
-
c &&
|
|
2139
|
+
if (j.hasStandardBrowserEnv && (r && d.isFunction(r) && (r = r(t)), r || r !== !1 && Ls(t.url))) {
|
|
2140
|
+
const c = o && a && Ms.read(a);
|
|
2141
|
+
c && s.set(o, c);
|
|
2342
2142
|
}
|
|
2343
2143
|
return t;
|
|
2344
|
-
},
|
|
2144
|
+
}, Ds = typeof XMLHttpRequest < "u", Bs = Ds && function(e) {
|
|
2345
2145
|
return new Promise(function(n, r) {
|
|
2346
|
-
const o =
|
|
2347
|
-
let
|
|
2348
|
-
const
|
|
2349
|
-
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } = o,
|
|
2146
|
+
const o = Fn(e);
|
|
2147
|
+
let a = o.data;
|
|
2148
|
+
const s = W.from(o.headers).normalize();
|
|
2149
|
+
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } = o, f, h, p, l, g;
|
|
2350
2150
|
function m() {
|
|
2351
|
-
l && l(), g && g(), o.cancelToken && o.cancelToken.unsubscribe(
|
|
2151
|
+
l && l(), g && g(), o.cancelToken && o.cancelToken.unsubscribe(f), o.signal && o.signal.removeEventListener("abort", f);
|
|
2352
2152
|
}
|
|
2353
2153
|
let y = new XMLHttpRequest();
|
|
2354
2154
|
y.open(o.method.toUpperCase(), o.url, !0), y.timeout = o.timeout;
|
|
2355
|
-
function
|
|
2155
|
+
function R() {
|
|
2356
2156
|
if (!y)
|
|
2357
2157
|
return;
|
|
2358
|
-
const
|
|
2158
|
+
const T = W.from(
|
|
2359
2159
|
"getAllResponseHeaders" in y && y.getAllResponseHeaders()
|
|
2360
|
-
),
|
|
2160
|
+
), N = {
|
|
2361
2161
|
data: !i || i === "text" || i === "json" ? y.responseText : y.response,
|
|
2362
2162
|
status: y.status,
|
|
2363
2163
|
statusText: y.statusText,
|
|
2364
|
-
headers:
|
|
2164
|
+
headers: T,
|
|
2365
2165
|
config: e,
|
|
2366
2166
|
request: y
|
|
2367
2167
|
};
|
|
2368
|
-
|
|
2369
|
-
n(
|
|
2370
|
-
}, function(
|
|
2371
|
-
r(
|
|
2372
|
-
},
|
|
2373
|
-
}
|
|
2374
|
-
"onloadend" in y ? y.onloadend =
|
|
2375
|
-
!y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
2168
|
+
Dn(function(P) {
|
|
2169
|
+
n(P), m();
|
|
2170
|
+
}, function(P) {
|
|
2171
|
+
r(P), m();
|
|
2172
|
+
}, N), y = null;
|
|
2173
|
+
}
|
|
2174
|
+
"onloadend" in y ? y.onloadend = R : y.onreadystatechange = function() {
|
|
2175
|
+
!y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.indexOf("file:") === 0) || setTimeout(R);
|
|
2376
2176
|
}, y.onabort = function() {
|
|
2377
2177
|
y && (r(new v("Request aborted", v.ECONNABORTED, e, y)), y = null);
|
|
2378
2178
|
}, y.onerror = function() {
|
|
2379
2179
|
r(new v("Network Error", v.ERR_NETWORK, e, y)), y = null;
|
|
2380
2180
|
}, y.ontimeout = function() {
|
|
2381
|
-
let
|
|
2382
|
-
const
|
|
2383
|
-
o.timeoutErrorMessage && (
|
|
2384
|
-
|
|
2385
|
-
|
|
2181
|
+
let F = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
2182
|
+
const N = o.transitional || Mn;
|
|
2183
|
+
o.timeoutErrorMessage && (F = o.timeoutErrorMessage), r(new v(
|
|
2184
|
+
F,
|
|
2185
|
+
N.clarifyTimeoutError ? v.ETIMEDOUT : v.ECONNABORTED,
|
|
2386
2186
|
e,
|
|
2387
2187
|
y
|
|
2388
2188
|
)), y = null;
|
|
2389
|
-
},
|
|
2390
|
-
y.setRequestHeader(
|
|
2391
|
-
}),
|
|
2392
|
-
y && (r(!
|
|
2393
|
-
}, o.cancelToken && o.cancelToken.subscribe(
|
|
2394
|
-
const S =
|
|
2395
|
-
if (S &&
|
|
2189
|
+
}, a === void 0 && s.setContentType(null), "setRequestHeader" in y && d.forEach(s.toJSON(), function(F, N) {
|
|
2190
|
+
y.setRequestHeader(N, F);
|
|
2191
|
+
}), d.isUndefined(o.withCredentials) || (y.withCredentials = !!o.withCredentials), i && i !== "json" && (y.responseType = o.responseType), c && ([p, g] = Xe(c, !0), y.addEventListener("progress", p)), u && y.upload && ([h, l] = Xe(u), y.upload.addEventListener("progress", h), y.upload.addEventListener("loadend", l)), (o.cancelToken || o.signal) && (f = (T) => {
|
|
2192
|
+
y && (r(!T || T.type ? new Te(null, e, y) : T), y.abort(), y = null);
|
|
2193
|
+
}, o.cancelToken && o.cancelToken.subscribe(f), o.signal && (o.signal.aborted ? f() : o.signal.addEventListener("abort", f)));
|
|
2194
|
+
const S = Cs(o.url);
|
|
2195
|
+
if (S && j.protocols.indexOf(S) === -1) {
|
|
2396
2196
|
r(new v("Unsupported protocol " + S + ":", v.ERR_BAD_REQUEST, e));
|
|
2397
2197
|
return;
|
|
2398
2198
|
}
|
|
2399
|
-
y.send(
|
|
2199
|
+
y.send(a || null);
|
|
2400
2200
|
});
|
|
2401
|
-
},
|
|
2201
|
+
}, Fs = (e, t) => {
|
|
2402
2202
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
2403
2203
|
if (t || n) {
|
|
2404
2204
|
let r = new AbortController(), o;
|
|
2405
|
-
const
|
|
2205
|
+
const a = function(c) {
|
|
2406
2206
|
if (!o) {
|
|
2407
2207
|
o = !0, i();
|
|
2408
|
-
const
|
|
2409
|
-
r.abort(
|
|
2208
|
+
const f = c instanceof Error ? c : this.reason;
|
|
2209
|
+
r.abort(f instanceof v ? f : new Te(f instanceof Error ? f.message : f));
|
|
2410
2210
|
}
|
|
2411
2211
|
};
|
|
2412
|
-
let
|
|
2413
|
-
|
|
2212
|
+
let s = t && setTimeout(() => {
|
|
2213
|
+
s = null, a(new v(`timeout ${t} of ms exceeded`, v.ETIMEDOUT));
|
|
2414
2214
|
}, t);
|
|
2415
2215
|
const i = () => {
|
|
2416
|
-
e && (
|
|
2417
|
-
c.unsubscribe ? c.unsubscribe(
|
|
2216
|
+
e && (s && clearTimeout(s), s = null, e.forEach((c) => {
|
|
2217
|
+
c.unsubscribe ? c.unsubscribe(a) : c.removeEventListener("abort", a);
|
|
2418
2218
|
}), e = null);
|
|
2419
2219
|
};
|
|
2420
|
-
e.forEach((c) => c.addEventListener("abort",
|
|
2220
|
+
e.forEach((c) => c.addEventListener("abort", a));
|
|
2421
2221
|
const { signal: u } = r;
|
|
2422
|
-
return u.unsubscribe = () =>
|
|
2222
|
+
return u.unsubscribe = () => d.asap(i), u;
|
|
2423
2223
|
}
|
|
2424
|
-
},
|
|
2224
|
+
}, Us = function* (e, t) {
|
|
2425
2225
|
let n = e.byteLength;
|
|
2426
2226
|
if (n < t) {
|
|
2427
2227
|
yield e;
|
|
@@ -2430,10 +2230,10 @@ const Jn = (e) => {
|
|
|
2430
2230
|
let r = 0, o;
|
|
2431
2231
|
for (; r < n; )
|
|
2432
2232
|
o = r + t, yield e.slice(r, o), r = o;
|
|
2433
|
-
},
|
|
2434
|
-
for await (const n of
|
|
2435
|
-
yield*
|
|
2436
|
-
},
|
|
2233
|
+
}, js = async function* (e, t) {
|
|
2234
|
+
for await (const n of zs(e))
|
|
2235
|
+
yield* Us(n, t);
|
|
2236
|
+
}, zs = async function* (e) {
|
|
2437
2237
|
if (e[Symbol.asyncIterator]) {
|
|
2438
2238
|
yield* e;
|
|
2439
2239
|
return;
|
|
@@ -2449,25 +2249,25 @@ const Jn = (e) => {
|
|
|
2449
2249
|
} finally {
|
|
2450
2250
|
await t.cancel();
|
|
2451
2251
|
}
|
|
2452
|
-
},
|
|
2453
|
-
const o =
|
|
2454
|
-
let
|
|
2455
|
-
|
|
2252
|
+
}, ln = (e, t, n, r) => {
|
|
2253
|
+
const o = js(e, t);
|
|
2254
|
+
let a = 0, s, i = (u) => {
|
|
2255
|
+
s || (s = !0, r && r(u));
|
|
2456
2256
|
};
|
|
2457
2257
|
return new ReadableStream({
|
|
2458
2258
|
async pull(u) {
|
|
2459
2259
|
try {
|
|
2460
|
-
const { done: c, value:
|
|
2260
|
+
const { done: c, value: f } = await o.next();
|
|
2461
2261
|
if (c) {
|
|
2462
2262
|
i(), u.close();
|
|
2463
2263
|
return;
|
|
2464
2264
|
}
|
|
2465
|
-
let h =
|
|
2265
|
+
let h = f.byteLength;
|
|
2466
2266
|
if (n) {
|
|
2467
|
-
let p =
|
|
2267
|
+
let p = a += h;
|
|
2468
2268
|
n(p);
|
|
2469
2269
|
}
|
|
2470
|
-
u.enqueue(new Uint8Array(
|
|
2270
|
+
u.enqueue(new Uint8Array(f));
|
|
2471
2271
|
} catch (c) {
|
|
2472
2272
|
throw i(c), c;
|
|
2473
2273
|
}
|
|
@@ -2478,15 +2278,15 @@ const Jn = (e) => {
|
|
|
2478
2278
|
}, {
|
|
2479
2279
|
highWaterMark: 2
|
|
2480
2280
|
});
|
|
2481
|
-
},
|
|
2281
|
+
}, rt = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Un = rt && typeof ReadableStream == "function", Hs = rt && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), jn = (e, ...t) => {
|
|
2482
2282
|
try {
|
|
2483
2283
|
return !!e(...t);
|
|
2484
2284
|
} catch {
|
|
2485
2285
|
return !1;
|
|
2486
2286
|
}
|
|
2487
|
-
},
|
|
2287
|
+
}, qs = Un && jn(() => {
|
|
2488
2288
|
let e = !1;
|
|
2489
|
-
const t = new Request(
|
|
2289
|
+
const t = new Request(j.origin, {
|
|
2490
2290
|
body: new ReadableStream(),
|
|
2491
2291
|
method: "POST",
|
|
2492
2292
|
get duplex() {
|
|
@@ -2494,124 +2294,124 @@ const Jn = (e) => {
|
|
|
2494
2294
|
}
|
|
2495
2295
|
}).headers.has("Content-Type");
|
|
2496
2296
|
return e && !t;
|
|
2497
|
-
}),
|
|
2498
|
-
stream:
|
|
2297
|
+
}), cn = 64 * 1024, At = Un && jn(() => d.isReadableStream(new Response("").body)), Qe = {
|
|
2298
|
+
stream: At && ((e) => e.body)
|
|
2499
2299
|
};
|
|
2500
|
-
|
|
2300
|
+
rt && ((e) => {
|
|
2501
2301
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
2502
|
-
!
|
|
2302
|
+
!Qe[t] && (Qe[t] = d.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
|
|
2503
2303
|
throw new v(`Response type '${t}' is not supported`, v.ERR_NOT_SUPPORT, r);
|
|
2504
2304
|
});
|
|
2505
2305
|
});
|
|
2506
2306
|
})(new Response());
|
|
2507
|
-
const
|
|
2307
|
+
const $s = async (e) => {
|
|
2508
2308
|
if (e == null)
|
|
2509
2309
|
return 0;
|
|
2510
|
-
if (
|
|
2310
|
+
if (d.isBlob(e))
|
|
2511
2311
|
return e.size;
|
|
2512
|
-
if (
|
|
2513
|
-
return (await new Request(
|
|
2312
|
+
if (d.isSpecCompliantForm(e))
|
|
2313
|
+
return (await new Request(j.origin, {
|
|
2514
2314
|
method: "POST",
|
|
2515
2315
|
body: e
|
|
2516
2316
|
}).arrayBuffer()).byteLength;
|
|
2517
|
-
if (
|
|
2317
|
+
if (d.isArrayBufferView(e) || d.isArrayBuffer(e))
|
|
2518
2318
|
return e.byteLength;
|
|
2519
|
-
if (
|
|
2520
|
-
return (await
|
|
2521
|
-
},
|
|
2522
|
-
const n =
|
|
2523
|
-
return n ??
|
|
2524
|
-
},
|
|
2319
|
+
if (d.isURLSearchParams(e) && (e = e + ""), d.isString(e))
|
|
2320
|
+
return (await Hs(e)).byteLength;
|
|
2321
|
+
}, Vs = async (e, t) => {
|
|
2322
|
+
const n = d.toFiniteNumber(e.getContentLength());
|
|
2323
|
+
return n ?? $s(t);
|
|
2324
|
+
}, Ws = rt && (async (e) => {
|
|
2525
2325
|
let {
|
|
2526
2326
|
url: t,
|
|
2527
2327
|
method: n,
|
|
2528
2328
|
data: r,
|
|
2529
2329
|
signal: o,
|
|
2530
|
-
cancelToken:
|
|
2531
|
-
timeout:
|
|
2330
|
+
cancelToken: a,
|
|
2331
|
+
timeout: s,
|
|
2532
2332
|
onDownloadProgress: i,
|
|
2533
2333
|
onUploadProgress: u,
|
|
2534
2334
|
responseType: c,
|
|
2535
|
-
headers:
|
|
2335
|
+
headers: f,
|
|
2536
2336
|
withCredentials: h = "same-origin",
|
|
2537
2337
|
fetchOptions: p
|
|
2538
|
-
} =
|
|
2338
|
+
} = Fn(e);
|
|
2539
2339
|
c = c ? (c + "").toLowerCase() : "text";
|
|
2540
|
-
let l =
|
|
2340
|
+
let l = Fs([o, a && a.toAbortSignal()], s), g;
|
|
2541
2341
|
const m = l && l.unsubscribe && (() => {
|
|
2542
2342
|
l.unsubscribe();
|
|
2543
2343
|
});
|
|
2544
2344
|
let y;
|
|
2545
2345
|
try {
|
|
2546
|
-
if (u &&
|
|
2547
|
-
let
|
|
2346
|
+
if (u && qs && n !== "get" && n !== "head" && (y = await Vs(f, r)) !== 0) {
|
|
2347
|
+
let N = new Request(t, {
|
|
2548
2348
|
method: "POST",
|
|
2549
2349
|
body: r,
|
|
2550
2350
|
duplex: "half"
|
|
2551
2351
|
}), E;
|
|
2552
|
-
if (
|
|
2553
|
-
const [
|
|
2352
|
+
if (d.isFormData(r) && (E = N.headers.get("content-type")) && f.setContentType(E), N.body) {
|
|
2353
|
+
const [P, q] = on(
|
|
2554
2354
|
y,
|
|
2555
|
-
|
|
2355
|
+
Xe(sn(u))
|
|
2556
2356
|
);
|
|
2557
|
-
r =
|
|
2357
|
+
r = ln(N.body, cn, P, q);
|
|
2558
2358
|
}
|
|
2559
2359
|
}
|
|
2560
|
-
|
|
2561
|
-
const
|
|
2360
|
+
d.isString(h) || (h = h ? "include" : "omit");
|
|
2361
|
+
const R = "credentials" in Request.prototype;
|
|
2562
2362
|
g = new Request(t, {
|
|
2563
2363
|
...p,
|
|
2564
2364
|
signal: l,
|
|
2565
2365
|
method: n.toUpperCase(),
|
|
2566
|
-
headers:
|
|
2366
|
+
headers: f.normalize().toJSON(),
|
|
2567
2367
|
body: r,
|
|
2568
2368
|
duplex: "half",
|
|
2569
|
-
credentials:
|
|
2369
|
+
credentials: R ? h : void 0
|
|
2570
2370
|
});
|
|
2571
2371
|
let S = await fetch(g);
|
|
2572
|
-
const
|
|
2573
|
-
if (
|
|
2574
|
-
const
|
|
2372
|
+
const T = At && (c === "stream" || c === "response");
|
|
2373
|
+
if (At && (i || T && m)) {
|
|
2374
|
+
const N = {};
|
|
2575
2375
|
["status", "statusText", "headers"].forEach((se) => {
|
|
2576
|
-
|
|
2376
|
+
N[se] = S[se];
|
|
2577
2377
|
});
|
|
2578
|
-
const E =
|
|
2378
|
+
const E = d.toFiniteNumber(S.headers.get("content-length")), [P, q] = i && on(
|
|
2579
2379
|
E,
|
|
2580
|
-
|
|
2380
|
+
Xe(sn(i), !0)
|
|
2581
2381
|
) || [];
|
|
2582
2382
|
S = new Response(
|
|
2583
|
-
|
|
2584
|
-
|
|
2383
|
+
ln(S.body, cn, P, () => {
|
|
2384
|
+
q && q(), m && m();
|
|
2585
2385
|
}),
|
|
2586
|
-
|
|
2386
|
+
N
|
|
2587
2387
|
);
|
|
2588
2388
|
}
|
|
2589
2389
|
c = c || "text";
|
|
2590
|
-
let
|
|
2591
|
-
return !
|
|
2592
|
-
|
|
2593
|
-
data:
|
|
2594
|
-
headers:
|
|
2390
|
+
let F = await Qe[d.findKey(Qe, c) || "text"](S, e);
|
|
2391
|
+
return !T && m && m(), await new Promise((N, E) => {
|
|
2392
|
+
Dn(N, E, {
|
|
2393
|
+
data: F,
|
|
2394
|
+
headers: W.from(S.headers),
|
|
2595
2395
|
status: S.status,
|
|
2596
2396
|
statusText: S.statusText,
|
|
2597
2397
|
config: e,
|
|
2598
2398
|
request: g
|
|
2599
2399
|
});
|
|
2600
2400
|
});
|
|
2601
|
-
} catch (
|
|
2602
|
-
throw m && m(),
|
|
2401
|
+
} catch (R) {
|
|
2402
|
+
throw m && m(), R && R.name === "TypeError" && /fetch/i.test(R.message) ? Object.assign(
|
|
2603
2403
|
new v("Network Error", v.ERR_NETWORK, e, g),
|
|
2604
2404
|
{
|
|
2605
|
-
cause:
|
|
2405
|
+
cause: R.cause || R
|
|
2606
2406
|
}
|
|
2607
|
-
) : v.from(
|
|
2407
|
+
) : v.from(R, R && R.code, e, g);
|
|
2608
2408
|
}
|
|
2609
|
-
}),
|
|
2610
|
-
http:
|
|
2611
|
-
xhr:
|
|
2612
|
-
fetch:
|
|
2409
|
+
}), Ot = {
|
|
2410
|
+
http: is,
|
|
2411
|
+
xhr: Bs,
|
|
2412
|
+
fetch: Ws
|
|
2613
2413
|
};
|
|
2614
|
-
|
|
2414
|
+
d.forEach(Ot, (e, t) => {
|
|
2615
2415
|
if (e) {
|
|
2616
2416
|
try {
|
|
2617
2417
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -2620,113 +2420,113 @@ f.forEach(Mt, (e, t) => {
|
|
|
2620
2420
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
2621
2421
|
}
|
|
2622
2422
|
});
|
|
2623
|
-
const
|
|
2423
|
+
const un = (e) => `- ${e}`, Js = (e) => d.isFunction(e) || e === null || e === !1, zn = {
|
|
2624
2424
|
getAdapter: (e) => {
|
|
2625
|
-
e =
|
|
2425
|
+
e = d.isArray(e) ? e : [e];
|
|
2626
2426
|
const { length: t } = e;
|
|
2627
2427
|
let n, r;
|
|
2628
2428
|
const o = {};
|
|
2629
|
-
for (let
|
|
2630
|
-
n = e[
|
|
2631
|
-
let
|
|
2632
|
-
if (r = n, !
|
|
2633
|
-
throw new v(`Unknown adapter '${
|
|
2429
|
+
for (let a = 0; a < t; a++) {
|
|
2430
|
+
n = e[a];
|
|
2431
|
+
let s;
|
|
2432
|
+
if (r = n, !Js(n) && (r = Ot[(s = String(n)).toLowerCase()], r === void 0))
|
|
2433
|
+
throw new v(`Unknown adapter '${s}'`);
|
|
2634
2434
|
if (r)
|
|
2635
2435
|
break;
|
|
2636
|
-
o[
|
|
2436
|
+
o[s || "#" + a] = r;
|
|
2637
2437
|
}
|
|
2638
2438
|
if (!r) {
|
|
2639
|
-
const
|
|
2439
|
+
const a = Object.entries(o).map(
|
|
2640
2440
|
([i, u]) => `adapter ${i} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
2641
2441
|
);
|
|
2642
|
-
let
|
|
2643
|
-
` +
|
|
2644
|
-
`) : " " +
|
|
2442
|
+
let s = t ? a.length > 1 ? `since :
|
|
2443
|
+
` + a.map(un).join(`
|
|
2444
|
+
`) : " " + un(a[0]) : "as no adapter specified";
|
|
2645
2445
|
throw new v(
|
|
2646
|
-
"There is no suitable adapter to dispatch the request " +
|
|
2446
|
+
"There is no suitable adapter to dispatch the request " + s,
|
|
2647
2447
|
"ERR_NOT_SUPPORT"
|
|
2648
2448
|
);
|
|
2649
2449
|
}
|
|
2650
2450
|
return r;
|
|
2651
2451
|
},
|
|
2652
|
-
adapters:
|
|
2452
|
+
adapters: Ot
|
|
2653
2453
|
};
|
|
2654
|
-
function
|
|
2454
|
+
function vt(e) {
|
|
2655
2455
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
2656
|
-
throw new
|
|
2456
|
+
throw new Te(null, e);
|
|
2657
2457
|
}
|
|
2658
|
-
function
|
|
2659
|
-
return
|
|
2458
|
+
function dn(e) {
|
|
2459
|
+
return vt(e), e.headers = W.from(e.headers), e.data = bt.call(
|
|
2660
2460
|
e,
|
|
2661
2461
|
e.transformRequest
|
|
2662
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
2663
|
-
return
|
|
2462
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), zn.getAdapter(e.adapter || Ie.adapter)(e).then(function(r) {
|
|
2463
|
+
return vt(e), r.data = bt.call(
|
|
2664
2464
|
e,
|
|
2665
2465
|
e.transformResponse,
|
|
2666
2466
|
r
|
|
2667
|
-
), r.headers =
|
|
2467
|
+
), r.headers = W.from(r.headers), r;
|
|
2668
2468
|
}, function(r) {
|
|
2669
|
-
return
|
|
2469
|
+
return In(r) || (vt(e), r && r.response && (r.response.data = bt.call(
|
|
2670
2470
|
e,
|
|
2671
2471
|
e.transformResponse,
|
|
2672
2472
|
r.response
|
|
2673
|
-
), r.response.headers =
|
|
2473
|
+
), r.response.headers = W.from(r.response.headers))), Promise.reject(r);
|
|
2674
2474
|
});
|
|
2675
2475
|
}
|
|
2676
|
-
const
|
|
2476
|
+
const Hn = "1.8.2", ot = {};
|
|
2677
2477
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
2678
|
-
|
|
2478
|
+
ot[e] = function(r) {
|
|
2679
2479
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
2680
2480
|
};
|
|
2681
2481
|
});
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2684
|
-
function o(
|
|
2685
|
-
return "[Axios v" +
|
|
2482
|
+
const fn = {};
|
|
2483
|
+
ot.transitional = function(t, n, r) {
|
|
2484
|
+
function o(a, s) {
|
|
2485
|
+
return "[Axios v" + Hn + "] Transitional option '" + a + "'" + s + (r ? ". " + r : "");
|
|
2686
2486
|
}
|
|
2687
|
-
return (
|
|
2487
|
+
return (a, s, i) => {
|
|
2688
2488
|
if (t === !1)
|
|
2689
2489
|
throw new v(
|
|
2690
|
-
o(
|
|
2490
|
+
o(s, " has been removed" + (n ? " in " + n : "")),
|
|
2691
2491
|
v.ERR_DEPRECATED
|
|
2692
2492
|
);
|
|
2693
|
-
return n && !
|
|
2493
|
+
return n && !fn[s] && (fn[s] = !0, console.warn(
|
|
2694
2494
|
o(
|
|
2695
|
-
|
|
2495
|
+
s,
|
|
2696
2496
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
2697
2497
|
)
|
|
2698
|
-
)), t ? t(
|
|
2498
|
+
)), t ? t(a, s, i) : !0;
|
|
2699
2499
|
};
|
|
2700
2500
|
};
|
|
2701
|
-
|
|
2501
|
+
ot.spelling = function(t) {
|
|
2702
2502
|
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
|
|
2703
2503
|
};
|
|
2704
|
-
function
|
|
2504
|
+
function Ks(e, t, n) {
|
|
2705
2505
|
if (typeof e != "object")
|
|
2706
2506
|
throw new v("options must be an object", v.ERR_BAD_OPTION_VALUE);
|
|
2707
2507
|
const r = Object.keys(e);
|
|
2708
2508
|
let o = r.length;
|
|
2709
2509
|
for (; o-- > 0; ) {
|
|
2710
|
-
const
|
|
2711
|
-
if (
|
|
2712
|
-
const i = e[
|
|
2510
|
+
const a = r[o], s = t[a];
|
|
2511
|
+
if (s) {
|
|
2512
|
+
const i = e[a], u = i === void 0 || s(i, a, e);
|
|
2713
2513
|
if (u !== !0)
|
|
2714
|
-
throw new v("option " +
|
|
2514
|
+
throw new v("option " + a + " must be " + u, v.ERR_BAD_OPTION_VALUE);
|
|
2715
2515
|
continue;
|
|
2716
2516
|
}
|
|
2717
2517
|
if (n !== !0)
|
|
2718
|
-
throw new v("Unknown option " +
|
|
2518
|
+
throw new v("Unknown option " + a, v.ERR_BAD_OPTION);
|
|
2719
2519
|
}
|
|
2720
2520
|
}
|
|
2721
|
-
const
|
|
2722
|
-
assertOptions:
|
|
2723
|
-
validators:
|
|
2724
|
-
}, ae =
|
|
2725
|
-
let
|
|
2521
|
+
const Ye = {
|
|
2522
|
+
assertOptions: Ks,
|
|
2523
|
+
validators: ot
|
|
2524
|
+
}, ae = Ye.validators;
|
|
2525
|
+
let ge = class {
|
|
2726
2526
|
constructor(t) {
|
|
2727
2527
|
this.defaults = t, this.interceptors = {
|
|
2728
|
-
request: new
|
|
2729
|
-
response: new
|
|
2528
|
+
request: new nn(),
|
|
2529
|
+
response: new nn()
|
|
2730
2530
|
};
|
|
2731
2531
|
}
|
|
2732
2532
|
/**
|
|
@@ -2744,10 +2544,10 @@ let ye = class {
|
|
|
2744
2544
|
if (r instanceof Error) {
|
|
2745
2545
|
let o = {};
|
|
2746
2546
|
Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
|
|
2747
|
-
const
|
|
2547
|
+
const a = o.stack ? o.stack.replace(/^.+\n/, "") : "";
|
|
2748
2548
|
try {
|
|
2749
|
-
r.stack ?
|
|
2750
|
-
` +
|
|
2549
|
+
r.stack ? a && !String(r.stack).endsWith(a.replace(/^.+\n.+\n/, "")) && (r.stack += `
|
|
2550
|
+
` + a) : r.stack = a;
|
|
2751
2551
|
} catch {
|
|
2752
2552
|
}
|
|
2753
2553
|
}
|
|
@@ -2755,31 +2555,31 @@ let ye = class {
|
|
|
2755
2555
|
}
|
|
2756
2556
|
}
|
|
2757
2557
|
_request(t, n) {
|
|
2758
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
2759
|
-
const { transitional: r, paramsSerializer: o, headers:
|
|
2760
|
-
r !== void 0 &&
|
|
2558
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = we(this.defaults, n);
|
|
2559
|
+
const { transitional: r, paramsSerializer: o, headers: a } = n;
|
|
2560
|
+
r !== void 0 && Ye.assertOptions(r, {
|
|
2761
2561
|
silentJSONParsing: ae.transitional(ae.boolean),
|
|
2762
2562
|
forcedJSONParsing: ae.transitional(ae.boolean),
|
|
2763
2563
|
clarifyTimeoutError: ae.transitional(ae.boolean)
|
|
2764
|
-
}, !1), o != null && (
|
|
2564
|
+
}, !1), o != null && (d.isFunction(o) ? n.paramsSerializer = {
|
|
2765
2565
|
serialize: o
|
|
2766
|
-
} :
|
|
2566
|
+
} : Ye.assertOptions(o, {
|
|
2767
2567
|
encode: ae.function,
|
|
2768
2568
|
serialize: ae.function
|
|
2769
|
-
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0),
|
|
2569
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Ye.assertOptions(n, {
|
|
2770
2570
|
baseUrl: ae.spelling("baseURL"),
|
|
2771
2571
|
withXsrfToken: ae.spelling("withXSRFToken")
|
|
2772
2572
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
2773
|
-
let
|
|
2774
|
-
|
|
2775
|
-
|
|
2573
|
+
let s = a && d.merge(
|
|
2574
|
+
a.common,
|
|
2575
|
+
a[n.method]
|
|
2776
2576
|
);
|
|
2777
|
-
|
|
2577
|
+
a && d.forEach(
|
|
2778
2578
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2779
2579
|
(g) => {
|
|
2780
|
-
delete
|
|
2580
|
+
delete a[g];
|
|
2781
2581
|
}
|
|
2782
|
-
), n.headers =
|
|
2582
|
+
), n.headers = W.concat(s, a);
|
|
2783
2583
|
const i = [];
|
|
2784
2584
|
let u = !0;
|
|
2785
2585
|
this.interceptors.request.forEach(function(m) {
|
|
@@ -2789,12 +2589,12 @@ let ye = class {
|
|
|
2789
2589
|
this.interceptors.response.forEach(function(m) {
|
|
2790
2590
|
c.push(m.fulfilled, m.rejected);
|
|
2791
2591
|
});
|
|
2792
|
-
let
|
|
2592
|
+
let f, h = 0, p;
|
|
2793
2593
|
if (!u) {
|
|
2794
|
-
const g = [
|
|
2795
|
-
for (g.unshift.apply(g, i), g.push.apply(g, c), p = g.length,
|
|
2796
|
-
|
|
2797
|
-
return
|
|
2594
|
+
const g = [dn.bind(this), void 0];
|
|
2595
|
+
for (g.unshift.apply(g, i), g.push.apply(g, c), p = g.length, f = Promise.resolve(n); h < p; )
|
|
2596
|
+
f = f.then(g[h++], g[h++]);
|
|
2597
|
+
return f;
|
|
2798
2598
|
}
|
|
2799
2599
|
p = i.length;
|
|
2800
2600
|
let l = n;
|
|
@@ -2808,69 +2608,69 @@ let ye = class {
|
|
|
2808
2608
|
}
|
|
2809
2609
|
}
|
|
2810
2610
|
try {
|
|
2811
|
-
|
|
2611
|
+
f = dn.call(this, l);
|
|
2812
2612
|
} catch (g) {
|
|
2813
2613
|
return Promise.reject(g);
|
|
2814
2614
|
}
|
|
2815
2615
|
for (h = 0, p = c.length; h < p; )
|
|
2816
|
-
|
|
2817
|
-
return
|
|
2616
|
+
f = f.then(c[h++], c[h++]);
|
|
2617
|
+
return f;
|
|
2818
2618
|
}
|
|
2819
2619
|
getUri(t) {
|
|
2820
|
-
t =
|
|
2821
|
-
const n =
|
|
2822
|
-
return
|
|
2620
|
+
t = we(this.defaults, t);
|
|
2621
|
+
const n = Bn(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
2622
|
+
return Ln(n, t.params, t.paramsSerializer);
|
|
2823
2623
|
}
|
|
2824
2624
|
};
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
return this.request(
|
|
2625
|
+
d.forEach(["delete", "get", "head", "options"], function(t) {
|
|
2626
|
+
ge.prototype[t] = function(n, r) {
|
|
2627
|
+
return this.request(we(r || {}, {
|
|
2828
2628
|
method: t,
|
|
2829
2629
|
url: n,
|
|
2830
2630
|
data: (r || {}).data
|
|
2831
2631
|
}));
|
|
2832
2632
|
};
|
|
2833
2633
|
});
|
|
2834
|
-
|
|
2634
|
+
d.forEach(["post", "put", "patch"], function(t) {
|
|
2835
2635
|
function n(r) {
|
|
2836
|
-
return function(
|
|
2837
|
-
return this.request(
|
|
2636
|
+
return function(a, s, i) {
|
|
2637
|
+
return this.request(we(i || {}, {
|
|
2838
2638
|
method: t,
|
|
2839
2639
|
headers: r ? {
|
|
2840
2640
|
"Content-Type": "multipart/form-data"
|
|
2841
2641
|
} : {},
|
|
2842
|
-
url:
|
|
2843
|
-
data:
|
|
2642
|
+
url: a,
|
|
2643
|
+
data: s
|
|
2844
2644
|
}));
|
|
2845
2645
|
};
|
|
2846
2646
|
}
|
|
2847
|
-
|
|
2647
|
+
ge.prototype[t] = n(), ge.prototype[t + "Form"] = n(!0);
|
|
2848
2648
|
});
|
|
2849
|
-
let
|
|
2649
|
+
let Ys = class qn {
|
|
2850
2650
|
constructor(t) {
|
|
2851
2651
|
if (typeof t != "function")
|
|
2852
2652
|
throw new TypeError("executor must be a function.");
|
|
2853
2653
|
let n;
|
|
2854
|
-
this.promise = new Promise(function(
|
|
2855
|
-
n =
|
|
2654
|
+
this.promise = new Promise(function(a) {
|
|
2655
|
+
n = a;
|
|
2856
2656
|
});
|
|
2857
2657
|
const r = this;
|
|
2858
2658
|
this.promise.then((o) => {
|
|
2859
2659
|
if (!r._listeners) return;
|
|
2860
|
-
let
|
|
2861
|
-
for (;
|
|
2862
|
-
r._listeners[
|
|
2660
|
+
let a = r._listeners.length;
|
|
2661
|
+
for (; a-- > 0; )
|
|
2662
|
+
r._listeners[a](o);
|
|
2863
2663
|
r._listeners = null;
|
|
2864
2664
|
}), this.promise.then = (o) => {
|
|
2865
|
-
let
|
|
2866
|
-
const
|
|
2867
|
-
r.subscribe(i),
|
|
2665
|
+
let a;
|
|
2666
|
+
const s = new Promise((i) => {
|
|
2667
|
+
r.subscribe(i), a = i;
|
|
2868
2668
|
}).then(o);
|
|
2869
|
-
return
|
|
2870
|
-
r.unsubscribe(
|
|
2871
|
-
},
|
|
2872
|
-
}, t(function(
|
|
2873
|
-
r.reason || (r.reason = new
|
|
2669
|
+
return s.cancel = function() {
|
|
2670
|
+
r.unsubscribe(a);
|
|
2671
|
+
}, s;
|
|
2672
|
+
}, t(function(a, s, i) {
|
|
2673
|
+
r.reason || (r.reason = new Te(a, s, i), n(r.reason));
|
|
2874
2674
|
});
|
|
2875
2675
|
}
|
|
2876
2676
|
/**
|
|
@@ -2912,22 +2712,22 @@ let Aa = class er {
|
|
|
2912
2712
|
static source() {
|
|
2913
2713
|
let t;
|
|
2914
2714
|
return {
|
|
2915
|
-
token: new
|
|
2715
|
+
token: new qn(function(o) {
|
|
2916
2716
|
t = o;
|
|
2917
2717
|
}),
|
|
2918
2718
|
cancel: t
|
|
2919
2719
|
};
|
|
2920
2720
|
}
|
|
2921
2721
|
};
|
|
2922
|
-
function
|
|
2722
|
+
function Gs(e) {
|
|
2923
2723
|
return function(n) {
|
|
2924
2724
|
return e.apply(null, n);
|
|
2925
2725
|
};
|
|
2926
2726
|
}
|
|
2927
|
-
function
|
|
2928
|
-
return
|
|
2727
|
+
function Xs(e) {
|
|
2728
|
+
return d.isObject(e) && e.isAxiosError === !0;
|
|
2929
2729
|
}
|
|
2930
|
-
const
|
|
2730
|
+
const Ct = {
|
|
2931
2731
|
Continue: 100,
|
|
2932
2732
|
SwitchingProtocols: 101,
|
|
2933
2733
|
Processing: 102,
|
|
@@ -2992,83 +2792,83 @@ const It = {
|
|
|
2992
2792
|
NotExtended: 510,
|
|
2993
2793
|
NetworkAuthenticationRequired: 511
|
|
2994
2794
|
};
|
|
2995
|
-
Object.entries(
|
|
2996
|
-
|
|
2795
|
+
Object.entries(Ct).forEach(([e, t]) => {
|
|
2796
|
+
Ct[t] = e;
|
|
2997
2797
|
});
|
|
2998
|
-
function
|
|
2999
|
-
const t = new
|
|
3000
|
-
return
|
|
3001
|
-
return
|
|
2798
|
+
function $n(e) {
|
|
2799
|
+
const t = new ge(e), n = En(ge.prototype.request, t);
|
|
2800
|
+
return d.extend(n, ge.prototype, t, { allOwnKeys: !0 }), d.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
2801
|
+
return $n(we(e, o));
|
|
3002
2802
|
}, n;
|
|
3003
2803
|
}
|
|
3004
|
-
const
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
2804
|
+
const O = $n(Ie);
|
|
2805
|
+
O.Axios = ge;
|
|
2806
|
+
O.CanceledError = Te;
|
|
2807
|
+
O.CancelToken = Ys;
|
|
2808
|
+
O.isCancel = In;
|
|
2809
|
+
O.VERSION = Hn;
|
|
2810
|
+
O.toFormData = nt;
|
|
2811
|
+
O.AxiosError = v;
|
|
2812
|
+
O.Cancel = O.CanceledError;
|
|
2813
|
+
O.all = function(t) {
|
|
3014
2814
|
return Promise.all(t);
|
|
3015
2815
|
};
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
2816
|
+
O.spread = Gs;
|
|
2817
|
+
O.isAxiosError = Xs;
|
|
2818
|
+
O.mergeConfig = we;
|
|
2819
|
+
O.AxiosHeaders = W;
|
|
2820
|
+
O.formToJSON = (e) => Pn(d.isHTMLForm(e) ? new FormData(e) : e);
|
|
2821
|
+
O.getAdapter = zn.getAdapter;
|
|
2822
|
+
O.HttpStatusCode = Ct;
|
|
2823
|
+
O.default = O;
|
|
3024
2824
|
const {
|
|
3025
|
-
Axios:
|
|
3026
|
-
AxiosError:
|
|
3027
|
-
CanceledError:
|
|
3028
|
-
isCancel:
|
|
3029
|
-
CancelToken:
|
|
3030
|
-
VERSION:
|
|
3031
|
-
all:
|
|
3032
|
-
Cancel:
|
|
3033
|
-
isAxiosError:
|
|
3034
|
-
spread:
|
|
3035
|
-
toFormData:
|
|
3036
|
-
AxiosHeaders:
|
|
3037
|
-
HttpStatusCode:
|
|
3038
|
-
formToJSON:
|
|
3039
|
-
getAdapter:
|
|
3040
|
-
mergeConfig:
|
|
3041
|
-
} =
|
|
3042
|
-
}, t) => (t.baseURL =
|
|
2825
|
+
Axios: Pa,
|
|
2826
|
+
AxiosError: Ia,
|
|
2827
|
+
CanceledError: Da,
|
|
2828
|
+
isCancel: Ba,
|
|
2829
|
+
CancelToken: Fa,
|
|
2830
|
+
VERSION: Ua,
|
|
2831
|
+
all: ja,
|
|
2832
|
+
Cancel: za,
|
|
2833
|
+
isAxiosError: Ha,
|
|
2834
|
+
spread: qa,
|
|
2835
|
+
toFormData: $a,
|
|
2836
|
+
AxiosHeaders: Va,
|
|
2837
|
+
HttpStatusCode: Wa,
|
|
2838
|
+
formToJSON: Ja,
|
|
2839
|
+
getAdapter: Ka,
|
|
2840
|
+
mergeConfig: Ya
|
|
2841
|
+
} = O, kt = "useAxios", Qs = async (e = (n) => {
|
|
2842
|
+
}, t) => (t.baseURL = hr(), U.debug(kt, `baseURL::${t.baseURL}`), e(t), t), Zs = async (e = (n) => {
|
|
3043
2843
|
}, t) => {
|
|
3044
2844
|
var r;
|
|
3045
2845
|
if (e(t), t.response.status !== 500) {
|
|
3046
2846
|
if (t.response.status <= 401)
|
|
3047
|
-
return
|
|
2847
|
+
return U.info(kt, t.response.data.meta), Promise.reject(t.response.data.meta);
|
|
3048
2848
|
if (t.response.status === 404)
|
|
3049
|
-
return
|
|
2849
|
+
return U.info(kt, t.response.data.meta), Promise.reject(t.response.data.meta);
|
|
3050
2850
|
}
|
|
3051
2851
|
let n;
|
|
3052
2852
|
try {
|
|
3053
2853
|
let o = "";
|
|
3054
|
-
t.request.config && t.request.config.token_type ? o = t.request.config.token_type : t.response.config && t.response.config.token_type && (o = t.response.config.token_type), n =
|
|
2854
|
+
t.request.config && t.request.config.token_type ? o = t.request.config.token_type : t.response.config && t.response.config.token_type && (o = t.response.config.token_type), n = O(t.response.config);
|
|
3055
2855
|
} catch (o) {
|
|
3056
2856
|
(r = o == null ? void 0 : o.data) != null && r.meta ? n = Promise.reject(o.data.meta) : o.data ? n = Promise.reject(o.data) : n = Promise.reject(o);
|
|
3057
2857
|
}
|
|
3058
2858
|
return n;
|
|
3059
|
-
},
|
|
3060
|
-
|
|
2859
|
+
}, Ve = "useAxios", Ga = ({ onRequest: e, onError: t }) => {
|
|
2860
|
+
O.interceptors.request.use((n) => Qs(e, n)), O.interceptors.response.use(
|
|
3061
2861
|
(n) => n.data.data,
|
|
3062
|
-
(n) =>
|
|
3063
|
-
),
|
|
3064
|
-
},
|
|
3065
|
-
get: async (e, t) => (
|
|
3066
|
-
post: async (e, t, n) => (
|
|
3067
|
-
put: async (e, t, n) => (
|
|
3068
|
-
delete: async (e, t) => (
|
|
2862
|
+
(n) => Zs(t, n)
|
|
2863
|
+
), O.defaults.headers.common["content-type"] = "application/json";
|
|
2864
|
+
}, Xa = {
|
|
2865
|
+
get: async (e, t) => (U.debug(Ve, `[get] url | ${e}`), O.get(e, t)),
|
|
2866
|
+
post: async (e, t, n) => (U.debug(Ve, `[post] url | ${e} | payload | ${t}`), O.post(e, t, n)),
|
|
2867
|
+
put: async (e, t, n) => (U.debug(Ve, `[put] url | ${e} | payload | ${t}`), O.put(e, t, n)),
|
|
2868
|
+
delete: async (e, t) => (U.debug(Ve, `[delete] url | ${e}`), O.delete(e, t))
|
|
3069
2869
|
};
|
|
3070
2870
|
var Q = /* @__PURE__ */ ((e) => (e.MINI_MOBILE = "mob-sm", e.MOBILE_PORTRAIT = "mob", e.MOBILE_LANDSCAPE = "mob-l", e.MOBILE_LANDSCAPE_XL = "mob-xl", e.TAB_PORTRAIT = "tab", e.TAB_LANDSCAPE = "tab-l", e.LAPTOP = "lap", e.DESKTOP = "desk", e))(Q || {});
|
|
3071
|
-
const
|
|
2871
|
+
const pn = {
|
|
3072
2872
|
/* suresh/NOTE: iPhone 15 device size */
|
|
3073
2873
|
iphone_15: { width: { min: 850, max: 854 }, height: { min: 390, max: 395 } },
|
|
3074
2874
|
/* suresh/NOTE: Iphone 14 pro max device size */
|
|
@@ -3134,18 +2934,18 @@ const Sn = {
|
|
|
3134
2934
|
},
|
|
3135
2935
|
/* suresh/NOTE: Nokia N9 device size */
|
|
3136
2936
|
nokia_n9: { width: { min: 853, max: 855 }, height: { min: 478, max: 482 } }
|
|
3137
|
-
},
|
|
3138
|
-
const { width: n, height: r } =
|
|
2937
|
+
}, Vn = () => ({ width: window.innerWidth, height: window.innerHeight }), ea = ({ width: e, height: t }) => {
|
|
2938
|
+
const { width: n, height: r } = Vn();
|
|
3139
2939
|
return e.min <= n && e.max >= n && t.min <= r && t.max >= r;
|
|
3140
|
-
},
|
|
3141
|
-
for (const r of Object.keys(
|
|
3142
|
-
const o =
|
|
3143
|
-
if (
|
|
2940
|
+
}, ta = () => {
|
|
2941
|
+
for (const r of Object.keys(pn)) {
|
|
2942
|
+
const o = pn[r];
|
|
2943
|
+
if (ea(o))
|
|
3144
2944
|
return o.vdevice || Q.MOBILE_LANDSCAPE_XL;
|
|
3145
2945
|
}
|
|
3146
|
-
const { width: e, height: t } =
|
|
2946
|
+
const { width: e, height: t } = Vn(), n = t >= e;
|
|
3147
2947
|
return e <= 320 ? Q.MINI_MOBILE : e <= 480 && e >= 320 ? Q.MOBILE_PORTRAIT : e <= 767 && e >= 481 ? Q.MOBILE_LANDSCAPE : e <= 1024 && e >= 768 ? n ? Q.TAB_PORTRAIT : Q.TAB_LANDSCAPE : e <= 1280 && e >= 1025 ? Q.LAPTOP : (e >= 1281, Q.DESKTOP);
|
|
3148
|
-
},
|
|
2948
|
+
}, na = ["h1", "h3", "blockquote", "br"], ra = {
|
|
3149
2949
|
strong: "*",
|
|
3150
2950
|
b: "*",
|
|
3151
2951
|
i: "_",
|
|
@@ -3158,7 +2958,7 @@ const Sn = {
|
|
|
3158
2958
|
h3: "### ",
|
|
3159
2959
|
br: `
|
|
3160
2960
|
`
|
|
3161
|
-
},
|
|
2961
|
+
}, B = {
|
|
3162
2962
|
bold: /(^|\s|[{\[])\*{1,2}(.*?\S *)?\*{1,2}(?=$|\s|[\.,\?:;\-}\]](?:$|\s))/g,
|
|
3163
2963
|
// *md*
|
|
3164
2964
|
italic: /(^|\s|[{\[])\_(.*?\S *)?\_(?=$|\s|[\.,\?:;\-}\]](?:$|\s))/g,
|
|
@@ -3200,13 +3000,13 @@ const Sn = {
|
|
|
3200
3000
|
// vtypes
|
|
3201
3001
|
gdrive_url: /(?:https:\/\/drive\.google\.com\/file\/d\/(.*?)\/view)/,
|
|
3202
3002
|
vtype: /(?:vtype=(?:'|"|")(image|audio|video)(?:'|"|"))/
|
|
3203
|
-
},
|
|
3003
|
+
}, Et = (e) => e.replace(/\*/g, "*").replace(/\_/g, "_").replace(/\~/g, "~"), oa = (e) => e.replace(/*/g, "*").replace(/_/g, "_").replace(/~/g, "~"), hn = (e) => (e && typeof e == "string" && (e = e.replace(/'|'/g, "'").replace(/"/g, '"').replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&").replace(///g, "/").replace(/ /g, " ").replace(/%2C/g, ",")), e), xe = (e, t) => {
|
|
3204
3004
|
let n = "", r = "";
|
|
3205
3005
|
return (e[0] === `
|
|
3206
3006
|
` || e[0] === " ") && (n = e[0]), (e[e.length - 1] === `
|
|
3207
3007
|
` || e[e.length - 1] === " ") && (r = e[e.length - 1]), n + t + r;
|
|
3208
|
-
},
|
|
3209
|
-
let t = e.match(
|
|
3008
|
+
}, mn = (e) => new RegExp(`<${e}.*?/?>`, "gm"), gn = (e) => {
|
|
3009
|
+
let t = e.match(B.gdrive_url);
|
|
3210
3010
|
if (t && t.length > 1 && t[1])
|
|
3211
3011
|
return `http://docs.google.com/uc?export=open&id=${t[1]}`;
|
|
3212
3012
|
if (e.startsWith("@")) {
|
|
@@ -3215,58 +3015,58 @@ const Sn = {
|
|
|
3215
3015
|
return `http://docs.google.com/uc?export=open&id=${n[1]}`;
|
|
3216
3016
|
}
|
|
3217
3017
|
return e;
|
|
3218
|
-
},
|
|
3018
|
+
}, wn = (e = "", t = "", n = "", r = "") => {
|
|
3219
3019
|
let o = "image";
|
|
3220
3020
|
if (r.length) {
|
|
3221
|
-
let
|
|
3222
|
-
|
|
3021
|
+
let a = r.match(B.vtype);
|
|
3022
|
+
a && a.length > 1 && a[1] && (o = a[1]);
|
|
3223
3023
|
}
|
|
3224
3024
|
return o == "audio" ? `<audio vmd="audio" controls ${r}>
|
|
3225
3025
|
<source src="${n}" type="audio/mp3"/>
|
|
3226
3026
|
</audio>` : o == "video" ? `<video vmd="video" controls ${r}>
|
|
3227
3027
|
<source src="${n}" type="video/mp4"/>
|
|
3228
3028
|
</video>` : `<img vmd="image" src="${n}" alt="${e}" title="${t}" ${r}>`;
|
|
3229
|
-
},
|
|
3230
|
-
applyReverseMarkdown: (e) => (e = e.replace(
|
|
3231
|
-
`), e =
|
|
3029
|
+
}, Qa = {
|
|
3030
|
+
applyReverseMarkdown: (e) => (e = e.replace(mn("br"), `
|
|
3031
|
+
`), e = hn(e), e = Markdown.reverseAnchor(e), e = e.replace(mn("hr"), " --- "), e = Markdown.reverseRecursive(e), e.trim()),
|
|
3232
3032
|
reverseRecursive: (e) => {
|
|
3233
3033
|
let n = new DOMParser().parseFromString(e, "text/html").body.childNodes, r = e === `
|
|
3234
3034
|
` ? `
|
|
3235
3035
|
` : "";
|
|
3236
3036
|
return Array.from(n).forEach((o) => {
|
|
3237
|
-
let
|
|
3037
|
+
let a = o.nodeType === Node.TEXT_NODE, s = !a && o.tagName.toLowerCase();
|
|
3238
3038
|
const i = o.innerText;
|
|
3239
3039
|
if (i && (i.trim() || i.includes(`
|
|
3240
|
-
`)) ||
|
|
3241
|
-
if (
|
|
3040
|
+
`)) || a || s === "br") {
|
|
3041
|
+
if (a)
|
|
3242
3042
|
return r += o.data;
|
|
3243
|
-
let u =
|
|
3043
|
+
let u = ra[s] || "", c = o.childNodes.length ? Markdown.reverseRecursive(o.innerHTML) : i;
|
|
3244
3044
|
r += !c.trim() && c.includes(`
|
|
3245
3045
|
`) ? `
|
|
3246
3046
|
` : "";
|
|
3247
|
-
let
|
|
3248
|
-
`, h =
|
|
3249
|
-
r += u + (
|
|
3047
|
+
let f = c[c.length - 1] === `
|
|
3048
|
+
`, h = na.includes(s) ? "" : u;
|
|
3049
|
+
r += u + (f ? c.slice(0, c.length - 1) + h + `
|
|
3250
3050
|
` : c + h);
|
|
3251
3051
|
}
|
|
3252
3052
|
}), r;
|
|
3253
3053
|
},
|
|
3254
3054
|
reverseAnchor: (e) => {
|
|
3255
|
-
let { anchor_tag: t, href: n } =
|
|
3256
|
-
return e.replace(t, (r, o,
|
|
3257
|
-
const
|
|
3055
|
+
let { anchor_tag: t, href: n } = B;
|
|
3056
|
+
return e.replace(t, (r, o, a) => {
|
|
3057
|
+
const s = a;
|
|
3258
3058
|
let i;
|
|
3259
3059
|
return o.replace(n, (u, c) => {
|
|
3260
3060
|
i = c;
|
|
3261
|
-
}), i.includes("mailto:") ? i.replace("mailto:", "") : `${e[e.indexOf(r) - 1] !== " " ? " " : ""}[${
|
|
3061
|
+
}), i.includes("mailto:") ? i.replace("mailto:", "") : `${e[e.indexOf(r) - 1] !== " " ? " " : ""}[${s}](${encodeURI(i)})`;
|
|
3262
3062
|
});
|
|
3263
3063
|
},
|
|
3264
3064
|
// md-apply
|
|
3265
|
-
applyMarkdown: (e, t = !1) => typeof e != "string" ? e : (e =
|
|
3266
|
-
`).trim(), e = Markdown.applyRecursive(e, t), e = Markdown.applyOnce(e), e = Markdown.applyNextLine(e), e =
|
|
3267
|
-
applyRecursive: (e, t = !1) => (e = e.replace(
|
|
3268
|
-
applyOnce: (e) => (e = e.replace(
|
|
3269
|
-
applyNextLine: (e) => e.replace(
|
|
3065
|
+
applyMarkdown: (e, t = !1) => typeof e != "string" ? e : (e = hn(e), e = e.replace(/</g, "<").replace(/>/g, ">").replace(/<br>/g, `
|
|
3066
|
+
`).trim(), e = Markdown.applyRecursive(e, t), e = Markdown.applyOnce(e), e = Markdown.applyNextLine(e), e = oa(e), '<div class="vmd">' + e + "</div>"),
|
|
3067
|
+
applyRecursive: (e, t = !1) => (e = e.replace(B.bold, Markdown.getBoldHTML), e = e.replace(B.italic, Markdown.getItalicHTML), e = e.replace(B.underline, Markdown.getUnderLineHTML), e = e.replace(B.strike, Markdown.getStrikeHTML), e = e.replace(B.line, Markdown.getLineHTML), e = e.replace(B.bullet, Markdown.getBulletHTML), e = e.replace(B.numlist, Markdown.getNumlistHTML), t || (e = e.replace(B.video, Markdown.getVideoHTML), e = e.replace(B.image, Markdown.getImageHTML)), e = e.replace(B.link, Markdown.getLinkHTML), e),
|
|
3068
|
+
applyOnce: (e) => (e = e.replace(B.blockquote, Markdown.getBlockQuoteHTML), e = e.replace(B.heading, Markdown.getHeadingHTML), e = e.replace(B.codeblock, Markdown.getCodeblockHTML), e = e.replace(B.monospace, Markdown.getMonoSpaceHTML), e),
|
|
3069
|
+
applyNextLine: (e) => e.replace(B.nextline, Markdown.getNextLineHTML),
|
|
3270
3070
|
// md-helper
|
|
3271
3071
|
getBoldHTML: (e, t, n) => !n || !n.match(/[^_*`~]/) || n[0] === "*" || n[n.length - 1] === "*" || n[0] === " " && n[n.length - 1] === " " || !n ? e : t + ' <strong vmd="bold">' + Markdown.applyRecursive(n) + "</strong> ",
|
|
3272
3072
|
getItalicHTML: (e, t, n) => !n || !n.match(/[^_*`~]/) || n[0] === "_" || n[n.length - 1] === "_" || n[0] === " " && n[n.length - 1] === " " || !n ? e : t + ' <i vmd="italic">' + Markdown.applyRecursive(n) + "</i> ",
|
|
@@ -3274,34 +3074,34 @@ const Sn = {
|
|
|
3274
3074
|
getStrikeHTML: (e, t, n) => !n || !n.match(/[^_*`~]/) || n[0] === "~" || n[n.length - 1] === "~" || n[0] === " " && n[n.length - 1] === " " || !n ? e : t + ' <strike vmd="strike">' + Markdown.applyRecursive(n) + "</strike> ",
|
|
3275
3075
|
getHeadingHTML: (e, t, n) => {
|
|
3276
3076
|
let r = t.length;
|
|
3277
|
-
return
|
|
3077
|
+
return xe(
|
|
3278
3078
|
e,
|
|
3279
|
-
" <h" + r + ` vmd="h${r}">` +
|
|
3079
|
+
" <h" + r + ` vmd="h${r}">` + Et(n) + "</h" + r + "> "
|
|
3280
3080
|
);
|
|
3281
3081
|
},
|
|
3282
|
-
getBlockQuoteHTML: (e, t) => (t = t.trim(), t.length ?
|
|
3082
|
+
getBlockQuoteHTML: (e, t) => (t = t.trim(), t.length ? xe(
|
|
3283
3083
|
e,
|
|
3284
3084
|
' <blockquote vmd="blockquote"><p>' + Markdown.applyRecursive(t) + "</p></blockquote> "
|
|
3285
3085
|
) : e),
|
|
3286
|
-
getMonoSpaceHTML: (e, t, n) => !n || !n.match(/[^_*`~]/) || n[0] === "`" || n[n.length - 1] === "`" || n[0] === " " && n[n.length - 1] === " " ? e : t + ' <code vmd="monospace" class="code">“' +
|
|
3086
|
+
getMonoSpaceHTML: (e, t, n) => !n || !n.match(/[^_*`~]/) || n[0] === "`" || n[n.length - 1] === "`" || n[0] === " " && n[n.length - 1] === " " ? e : t + ' <code vmd="monospace" class="code">“' + Et(n) + "”</code> ",
|
|
3287
3087
|
getCodeblockHTML: (e, t, n) => n.trim().length === 0 ? e : t + ' <pre vmd="codeblock"> ' + Markdown.applyRecursive(n) + "</pre>",
|
|
3288
3088
|
getNextLineHTML: (e, t, n, r) => t + ' <br vmd="br" > ' + r,
|
|
3289
3089
|
getLineHTML: (e, t, n, r) => t + '<hr vmd="line" class="hr w100">' + Markdown.applyRecursive(r.trim()),
|
|
3290
3090
|
getLinkHTML: (e, t, n, r, o) => {
|
|
3291
|
-
var
|
|
3091
|
+
var a = r.startsWith("www.") ? "http://" + r : r;
|
|
3292
3092
|
return t + ` <a vmd="link" href="${encodeURI(
|
|
3293
|
-
|
|
3294
|
-
)}" rel="noopener noreferrer" ${o}>${
|
|
3093
|
+
a
|
|
3094
|
+
)}" rel="noopener noreferrer" ${o}>${Et(n)}</a>`;
|
|
3295
3095
|
},
|
|
3296
3096
|
getImageHTML: (e, t, n, r, o) => {
|
|
3297
|
-
let
|
|
3298
|
-
return
|
|
3097
|
+
let a = wn(t, r, gn(n), o);
|
|
3098
|
+
return xe(e, a);
|
|
3299
3099
|
},
|
|
3300
|
-
getVideoHTML: (e, t, n, r, o,
|
|
3301
|
-
let u =
|
|
3302
|
-
return
|
|
3100
|
+
getVideoHTML: (e, t, n, r, o, a, s, i) => {
|
|
3101
|
+
let u = wn(t, r, gn(n), o);
|
|
3102
|
+
return xe(
|
|
3303
3103
|
e,
|
|
3304
|
-
`<a vmd="hyperlink" href="${
|
|
3104
|
+
`<a vmd="hyperlink" href="${a}" title="${s}" rel="noreferrer" ${i}>${u}</a>`
|
|
3305
3105
|
);
|
|
3306
3106
|
},
|
|
3307
3107
|
getBulletHTML: (e) => {
|
|
@@ -3309,29 +3109,29 @@ const Sn = {
|
|
|
3309
3109
|
if (e.replace(/\s/g, "").replace(/\*/g, "").length == 0)
|
|
3310
3110
|
return e;
|
|
3311
3111
|
} else return e;
|
|
3312
|
-
return
|
|
3112
|
+
return xe(
|
|
3313
3113
|
e,
|
|
3314
3114
|
' <ul vmd="list-bullet" style="list-style-type: disc; list-style: inherit;">' + ((n) => {
|
|
3315
3115
|
let r = "";
|
|
3316
3116
|
for (var o = n.split(`
|
|
3317
|
-
`),
|
|
3318
|
-
o[
|
|
3117
|
+
`), a = 0; a < o.length; a++)
|
|
3118
|
+
o[a] = o[a].replace(/[\-|●|○]/, "-"), o[a].includes("-") && (r += o[a].replace(/\-/, ' <li style="list-style: inherit"> ') + "</li> ");
|
|
3319
3119
|
return r;
|
|
3320
3120
|
})(e) + "</ul> "
|
|
3321
3121
|
);
|
|
3322
3122
|
},
|
|
3323
|
-
getNumlistHTML: (e) => isNaN(e) ?
|
|
3123
|
+
getNumlistHTML: (e) => isNaN(e) ? xe(
|
|
3324
3124
|
e,
|
|
3325
3125
|
' <ol vmd="list-number">' + ((n) => {
|
|
3326
3126
|
let r = "";
|
|
3327
3127
|
for (var o = n.split(`
|
|
3328
|
-
`),
|
|
3329
|
-
o[
|
|
3128
|
+
`), a = 0; a < o.length; a++)
|
|
3129
|
+
o[a] = o[a].replace(/(\d)*(\.)/, "-"), o[a].includes("-") && (r += o[a].replace(/\-/, '<li style="list-style: decimal"> ') + "</li>");
|
|
3330
3130
|
return r;
|
|
3331
3131
|
})(e) + "</ol> "
|
|
3332
3132
|
) : e
|
|
3333
3133
|
};
|
|
3334
|
-
function
|
|
3134
|
+
function Za() {
|
|
3335
3135
|
return { toTop: () => {
|
|
3336
3136
|
window.scrollTo({
|
|
3337
3137
|
top: 0,
|
|
@@ -3342,106 +3142,106 @@ function Di() {
|
|
|
3342
3142
|
top: window.innerHeight,
|
|
3343
3143
|
behavior: "smooth"
|
|
3344
3144
|
});
|
|
3345
|
-
}, byId: (o = "",
|
|
3346
|
-
const
|
|
3145
|
+
}, byId: (o = "", a = !0) => {
|
|
3146
|
+
const s = document.getElementById(o);
|
|
3347
3147
|
let i = "start";
|
|
3348
|
-
if (
|
|
3349
|
-
const u =
|
|
3148
|
+
if (a) {
|
|
3149
|
+
const u = ta();
|
|
3350
3150
|
i = u === Q.MINI_MOBILE || u === Q.MOBILE_PORTRAIT ? "start" : "center";
|
|
3351
3151
|
}
|
|
3352
|
-
|
|
3152
|
+
s == null || s.scrollIntoView({
|
|
3353
3153
|
behavior: "smooth",
|
|
3354
3154
|
block: i
|
|
3355
3155
|
});
|
|
3356
3156
|
}, byIdOffSet: (o = "") => {
|
|
3357
|
-
const
|
|
3157
|
+
const a = document.getElementById(o), s = 75, i = document.body.getBoundingClientRect().top, f = a.getBoundingClientRect().top - i - s;
|
|
3358
3158
|
window.scroll({
|
|
3359
|
-
top:
|
|
3159
|
+
top: f,
|
|
3360
3160
|
behavior: "smooth"
|
|
3361
3161
|
});
|
|
3362
3162
|
} };
|
|
3363
3163
|
}
|
|
3364
|
-
function
|
|
3164
|
+
function ei({
|
|
3365
3165
|
meta: e = !1,
|
|
3366
3166
|
ctrl: t = !1,
|
|
3367
3167
|
shift: n = !1,
|
|
3368
3168
|
key: r,
|
|
3369
3169
|
handler: o
|
|
3370
3170
|
}) {
|
|
3371
|
-
G("keydown", (
|
|
3372
|
-
if (
|
|
3373
|
-
if (
|
|
3374
|
-
if (
|
|
3375
|
-
|
|
3171
|
+
G("keydown", (a) => {
|
|
3172
|
+
if (a.metaKey === e) {
|
|
3173
|
+
if (a.ctrlKey !== t) return;
|
|
3174
|
+
if (a.shiftKey !== n) return;
|
|
3175
|
+
a.key === r && (a.stopImmediatePropagation(), a.preventDefault(), a.stopPropagation(), o());
|
|
3376
3176
|
}
|
|
3377
3177
|
});
|
|
3378
3178
|
}
|
|
3379
|
-
const
|
|
3380
|
-
let
|
|
3381
|
-
function
|
|
3382
|
-
return `vezham-ls-${
|
|
3179
|
+
const sa = "useStore";
|
|
3180
|
+
let Wn = "v0xapp", Jn = "1.0.5-alpha";
|
|
3181
|
+
function We(e) {
|
|
3182
|
+
return `vezham-ls-${Wn}-${Jn}-${e}`;
|
|
3383
3183
|
}
|
|
3384
|
-
const
|
|
3385
|
-
e.pretext && (
|
|
3386
|
-
},
|
|
3184
|
+
const ti = (e) => {
|
|
3185
|
+
e.pretext && (Wn = e.pretext), e.version && (Jn = e.version);
|
|
3186
|
+
}, aa = {
|
|
3387
3187
|
get: (e, t) => {
|
|
3388
3188
|
try {
|
|
3389
|
-
const n = window.localStorage.getItem(
|
|
3189
|
+
const n = window.localStorage.getItem(We(e));
|
|
3390
3190
|
return n && n !== "undefined" ? n : t || "";
|
|
3391
3191
|
} catch (n) {
|
|
3392
|
-
return
|
|
3192
|
+
return U.error(sa, `key | ${We(e)} | err: `, n), t || "";
|
|
3393
3193
|
}
|
|
3394
3194
|
},
|
|
3395
|
-
has: (e) => !!
|
|
3396
|
-
set: (e, t) => window.localStorage.setItem(
|
|
3397
|
-
delete: (e) => window.localStorage.removeItem(
|
|
3195
|
+
has: (e) => !!aa.get(e),
|
|
3196
|
+
set: (e, t) => window.localStorage.setItem(We(e), t),
|
|
3197
|
+
delete: (e) => window.localStorage.removeItem(We(e)),
|
|
3398
3198
|
purge: () => window.localStorage.clear()
|
|
3399
3199
|
};
|
|
3400
3200
|
export {
|
|
3401
|
-
|
|
3201
|
+
ta as GetDevice,
|
|
3402
3202
|
Q as Vdevice,
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3203
|
+
Ga as defineAxios,
|
|
3204
|
+
ti as defineStore,
|
|
3205
|
+
Xa as useAxios,
|
|
3206
|
+
co as useBoolean,
|
|
3207
|
+
ca as useClickAnyWhere,
|
|
3208
|
+
ua as useCopyToClipboard,
|
|
3209
|
+
da as useCountdown,
|
|
3210
|
+
uo as useCounter,
|
|
3211
|
+
fa as useDarkMode,
|
|
3212
|
+
Nt as useDebounceCallback,
|
|
3213
|
+
pa as useDebounceValue,
|
|
3214
|
+
ha as useDocumentTitle,
|
|
3215
|
+
ma as useEffect,
|
|
3216
|
+
Ge as useEventCallback,
|
|
3417
3217
|
G as useEventListener,
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3218
|
+
ga as useHover,
|
|
3219
|
+
wa as useIntersectionObserver,
|
|
3220
|
+
fo as useInterval,
|
|
3221
|
+
ya as useIsClient,
|
|
3222
|
+
go as useIsFirstRender,
|
|
3223
|
+
wo as useIsMounted,
|
|
3424
3224
|
re as useIsomorphicLayoutEffect,
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3225
|
+
yn as useLocalStorage,
|
|
3226
|
+
U as useLogger,
|
|
3227
|
+
ba as useMap,
|
|
3228
|
+
Qa as useMarkdown,
|
|
3229
|
+
bn as useMediaQuery,
|
|
3230
|
+
va as useOnClickOutside,
|
|
3231
|
+
Ea as useReadLocalStorage,
|
|
3232
|
+
Sa as useResizeObserver,
|
|
3233
|
+
xa as useScreen,
|
|
3234
|
+
Ra as useScript,
|
|
3235
|
+
Ta as useScrollLock,
|
|
3236
|
+
Za as useScrollTo,
|
|
3237
|
+
_a as useSessionStorage,
|
|
3238
|
+
ei as useShortcut,
|
|
3239
|
+
Aa as useStep,
|
|
3240
|
+
aa as useStore,
|
|
3241
|
+
Oa as useTernaryDarkMode,
|
|
3242
|
+
Ca as useTimeout,
|
|
3243
|
+
qr as useToast,
|
|
3244
|
+
ka as useToggle,
|
|
3245
|
+
vn as useUnmount,
|
|
3246
|
+
Na as useWindowSize
|
|
3447
3247
|
};
|