@qwanyx/stack 0.2.15 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/MailClient.d.ts +10 -0
- package/dist/components/SelectableList.d.ts +26 -0
- package/dist/index.cjs.js +25 -25
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +1046 -917
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var zt = Object.defineProperty;
|
|
2
2
|
var Gt = (o, e, r) => e in o ? zt(o, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[e] = r;
|
|
3
|
-
var
|
|
4
|
-
import
|
|
3
|
+
var ve = (o, e, r) => Gt(o, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import st, { useState as P, useCallback as H, useEffect as pe, useMemo as vt, useRef as ft } from "react";
|
|
5
5
|
class yr {
|
|
6
6
|
constructor(e) {
|
|
7
|
-
|
|
7
|
+
ve(this, "config");
|
|
8
8
|
// ===== FILE OPERATIONS =====
|
|
9
9
|
/**
|
|
10
10
|
* Options for file upload
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
ve(this, "defaultUploadOptions", {
|
|
13
13
|
maxSizeMB: 10,
|
|
14
14
|
maxImageDimension: 0,
|
|
15
15
|
// 0 = no resize
|
|
@@ -30,7 +30,7 @@ class yr {
|
|
|
30
30
|
params: r
|
|
31
31
|
};
|
|
32
32
|
try {
|
|
33
|
-
const
|
|
33
|
+
const s = await fetch(`${this.config.baseUrl}/spu/invoke`, {
|
|
34
34
|
method: "POST",
|
|
35
35
|
headers: {
|
|
36
36
|
"Content-Type": "application/json",
|
|
@@ -38,16 +38,16 @@ class yr {
|
|
|
38
38
|
},
|
|
39
39
|
body: JSON.stringify(u)
|
|
40
40
|
});
|
|
41
|
-
if (!
|
|
42
|
-
const t = await
|
|
43
|
-
throw new Error(`API error (${
|
|
41
|
+
if (!s.ok) {
|
|
42
|
+
const t = await s.text();
|
|
43
|
+
throw new Error(`API error (${s.status}): ${t}`);
|
|
44
44
|
}
|
|
45
|
-
const n = await
|
|
45
|
+
const n = await s.json();
|
|
46
46
|
if (!n.success && n.error)
|
|
47
47
|
throw new Error(n.error);
|
|
48
48
|
return n;
|
|
49
|
-
} catch (
|
|
50
|
-
throw console.error("Graph API call failed:",
|
|
49
|
+
} catch (s) {
|
|
50
|
+
throw console.error("Graph API call failed:", s), s;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -96,10 +96,10 @@ class yr {
|
|
|
96
96
|
...r,
|
|
97
97
|
modified: (/* @__PURE__ */ new Date()).toISOString()
|
|
98
98
|
}
|
|
99
|
-
},
|
|
100
|
-
if (!
|
|
99
|
+
}, s = await this.callGraph("update_node", u);
|
|
100
|
+
if (!s.result)
|
|
101
101
|
throw new Error("Failed to update node");
|
|
102
|
-
return
|
|
102
|
+
return s.result;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Delete a node
|
|
@@ -114,23 +114,23 @@ class yr {
|
|
|
114
114
|
/**
|
|
115
115
|
* Get children with edges (supports different display modes)
|
|
116
116
|
*/
|
|
117
|
-
async getChildrenWithEdges(e, r = "children", u,
|
|
117
|
+
async getChildrenWithEdges(e, r = "children", u, s) {
|
|
118
118
|
return (await this.callGraph("get_children_with_edges", {
|
|
119
119
|
node_id: e,
|
|
120
120
|
display_mode: r,
|
|
121
121
|
edge_type: u,
|
|
122
|
-
node_type:
|
|
122
|
+
node_type: s
|
|
123
123
|
})).result || [];
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
126
|
* Add an edge between two nodes
|
|
127
127
|
*/
|
|
128
|
-
async addEdge(e, r, u = "link",
|
|
128
|
+
async addEdge(e, r, u = "link", s) {
|
|
129
129
|
return await this.callGraph("add_edge", {
|
|
130
130
|
source_id: e,
|
|
131
131
|
target_id: r,
|
|
132
132
|
edge_type: u,
|
|
133
|
-
data:
|
|
133
|
+
data: s
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
@@ -209,11 +209,11 @@ class yr {
|
|
|
209
209
|
*/
|
|
210
210
|
fileToBase64(e) {
|
|
211
211
|
return new Promise((r, u) => {
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
const t =
|
|
212
|
+
const s = new FileReader();
|
|
213
|
+
s.onload = () => {
|
|
214
|
+
const t = s.result.split(",")[1];
|
|
215
215
|
r(t);
|
|
216
|
-
},
|
|
216
|
+
}, s.onerror = () => u(new Error("Failed to read file")), s.readAsDataURL(e);
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
/**
|
|
@@ -221,37 +221,37 @@ class yr {
|
|
|
221
221
|
* Returns the original file if not an image or no resize needed
|
|
222
222
|
*/
|
|
223
223
|
async resizeImage(e, r, u) {
|
|
224
|
-
return e.type.startsWith("image/") ? new Promise((
|
|
224
|
+
return e.type.startsWith("image/") ? new Promise((s) => {
|
|
225
225
|
const n = new Image(), t = URL.createObjectURL(e);
|
|
226
226
|
n.onload = () => {
|
|
227
227
|
if (URL.revokeObjectURL(t), n.width <= r && n.height <= r) {
|
|
228
|
-
|
|
228
|
+
s(e);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
let i, l;
|
|
232
232
|
n.width > n.height ? (i = r, l = Math.round(n.height / n.width * r)) : (l = r, i = Math.round(n.width / n.height * r));
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
if (!
|
|
237
|
-
|
|
233
|
+
const c = document.createElement("canvas");
|
|
234
|
+
c.width = i, c.height = l;
|
|
235
|
+
const d = c.getContext("2d");
|
|
236
|
+
if (!d) {
|
|
237
|
+
s(e);
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
240
|
+
d.drawImage(n, 0, 0, i, l);
|
|
241
|
+
const p = e.type === "image/png" ? "image/png" : "image/jpeg";
|
|
242
|
+
c.toBlob(
|
|
243
243
|
(m) => {
|
|
244
244
|
if (m) {
|
|
245
|
-
const
|
|
246
|
-
|
|
245
|
+
const D = new File([m], e.name, { type: p });
|
|
246
|
+
s(D);
|
|
247
247
|
} else
|
|
248
|
-
|
|
248
|
+
s(e);
|
|
249
249
|
},
|
|
250
|
-
|
|
250
|
+
p,
|
|
251
251
|
u
|
|
252
252
|
);
|
|
253
253
|
}, n.onerror = () => {
|
|
254
|
-
URL.revokeObjectURL(t),
|
|
254
|
+
URL.revokeObjectURL(t), s(e);
|
|
255
255
|
}, n.src = t;
|
|
256
256
|
}) : e;
|
|
257
257
|
}
|
|
@@ -262,8 +262,8 @@ class yr {
|
|
|
262
262
|
* @param file - The File object to upload
|
|
263
263
|
* @param options - Upload options (maxSizeMB, maxImageDimension, imageQuality)
|
|
264
264
|
*/
|
|
265
|
-
async uploadFile(e, r, u,
|
|
266
|
-
const n = { ...this.defaultUploadOptions, ...
|
|
265
|
+
async uploadFile(e, r, u, s = {}) {
|
|
266
|
+
const n = { ...this.defaultUploadOptions, ...s };
|
|
267
267
|
try {
|
|
268
268
|
let t = u;
|
|
269
269
|
n.maxImageDimension > 0 && u.type.startsWith("image/") && (t = await this.resizeImage(u, n.maxImageDimension, n.imageQuality));
|
|
@@ -273,12 +273,12 @@ class yr {
|
|
|
273
273
|
success: !1,
|
|
274
274
|
error: `File too large (${(t.size / 1024 / 1024).toFixed(1)} MB). Max: ${n.maxSizeMB} MB`
|
|
275
275
|
};
|
|
276
|
-
const l = await this.fileToBase64(t),
|
|
276
|
+
const l = await this.fileToBase64(t), c = await this.callGraph("upload_file", {
|
|
277
277
|
node_id: e,
|
|
278
278
|
filename: r,
|
|
279
279
|
content: l
|
|
280
280
|
});
|
|
281
|
-
return
|
|
281
|
+
return c.success ? { success: !0, path: c.path } : { success: !1, error: c.error || "Upload failed" };
|
|
282
282
|
} catch (t) {
|
|
283
283
|
return {
|
|
284
284
|
success: !1,
|
|
@@ -291,10 +291,10 @@ class yr {
|
|
|
291
291
|
* @param nodeId - The node to list files for
|
|
292
292
|
*/
|
|
293
293
|
async listFiles(e) {
|
|
294
|
-
var
|
|
295
|
-
return (((
|
|
294
|
+
var s;
|
|
295
|
+
return (((s = (await this.callGraph("list_files", {
|
|
296
296
|
node_id: e
|
|
297
|
-
})).result) == null ? void 0 :
|
|
297
|
+
})).result) == null ? void 0 : s.files) || []).map((n) => ({
|
|
298
298
|
filename: n.name,
|
|
299
299
|
path: n.path
|
|
300
300
|
}));
|
|
@@ -319,20 +319,20 @@ class yr {
|
|
|
319
319
|
return `${this.config.baseUrl}/files/${this.config.system_id}/${e}/${r}`;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
const he = new TextEncoder(),
|
|
323
|
-
for (var _e = 0; _e <
|
|
324
|
-
Ce[
|
|
322
|
+
const he = new TextEncoder(), pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ce = new Uint8Array(256);
|
|
323
|
+
for (var _e = 0; _e < pt.length; _e++)
|
|
324
|
+
Ce[pt.charCodeAt(_e)] = _e;
|
|
325
325
|
function rt(o) {
|
|
326
326
|
let e = Math.ceil(o.length / 4) * 3;
|
|
327
327
|
const r = o.length;
|
|
328
328
|
let u = 0;
|
|
329
329
|
o.length % 4 === 3 ? e-- : o.length % 4 === 2 ? e -= 2 : o[o.length - 1] === "=" && (e--, o[o.length - 2] === "=" && e--);
|
|
330
|
-
const
|
|
330
|
+
const s = new ArrayBuffer(e), n = new Uint8Array(s);
|
|
331
331
|
for (let t = 0; t < r; t += 4) {
|
|
332
|
-
let i = Ce[o.charCodeAt(t)], l = Ce[o.charCodeAt(t + 1)],
|
|
333
|
-
n[u++] = i << 2 | l >> 4, n[u++] = (l & 15) << 4 |
|
|
332
|
+
let i = Ce[o.charCodeAt(t)], l = Ce[o.charCodeAt(t + 1)], c = Ce[o.charCodeAt(t + 2)], d = Ce[o.charCodeAt(t + 3)];
|
|
333
|
+
n[u++] = i << 2 | l >> 4, n[u++] = (l & 15) << 4 | c >> 2, n[u++] = (c & 3) << 6 | d & 63;
|
|
334
334
|
}
|
|
335
|
-
return
|
|
335
|
+
return s;
|
|
336
336
|
}
|
|
337
337
|
function Be(o) {
|
|
338
338
|
o = o || "utf8";
|
|
@@ -349,54 +349,54 @@ async function Pe(o) {
|
|
|
349
349
|
return await o.arrayBuffer();
|
|
350
350
|
const e = new FileReader();
|
|
351
351
|
return new Promise((r, u) => {
|
|
352
|
-
e.onload = function(
|
|
353
|
-
r(
|
|
354
|
-
}, e.onerror = function(
|
|
352
|
+
e.onload = function(s) {
|
|
353
|
+
r(s.target.result);
|
|
354
|
+
}, e.onerror = function(s) {
|
|
355
355
|
u(e.error);
|
|
356
356
|
}, e.readAsArrayBuffer(o);
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function ht(o) {
|
|
360
360
|
return o >= 48 && o <= 57 || o >= 97 && o <= 102 || o >= 65 && o <= 70 ? String.fromCharCode(o) : !1;
|
|
361
361
|
}
|
|
362
362
|
function Ht(o, e, r) {
|
|
363
363
|
let u = o.indexOf("*");
|
|
364
364
|
u >= 0 && (o = o.substr(0, u)), e = e.toUpperCase();
|
|
365
|
-
let
|
|
365
|
+
let s;
|
|
366
366
|
if (e === "Q") {
|
|
367
367
|
r = r.replace(/=\s+([0-9a-fA-F])/g, "=$1").replace(/[_\s]/g, " ");
|
|
368
368
|
let n = he.encode(r), t = [];
|
|
369
|
-
for (let l = 0,
|
|
370
|
-
let
|
|
371
|
-
if (l <=
|
|
372
|
-
let
|
|
373
|
-
if (
|
|
374
|
-
let
|
|
375
|
-
t.push(
|
|
369
|
+
for (let l = 0, c = n.length; l < c; l++) {
|
|
370
|
+
let d = n[l];
|
|
371
|
+
if (l <= c - 2 && d === 61) {
|
|
372
|
+
let p = ht(n[l + 1]), m = ht(n[l + 2]);
|
|
373
|
+
if (p && m) {
|
|
374
|
+
let D = parseInt(p + m, 16);
|
|
375
|
+
t.push(D), l += 2;
|
|
376
376
|
continue;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
t.push(
|
|
379
|
+
t.push(d);
|
|
380
380
|
}
|
|
381
|
-
|
|
382
|
-
let i = new DataView(
|
|
383
|
-
for (let l = 0,
|
|
381
|
+
s = new ArrayBuffer(t.length);
|
|
382
|
+
let i = new DataView(s);
|
|
383
|
+
for (let l = 0, c = t.length; l < c; l++)
|
|
384
384
|
i.setUint8(l, t[l]);
|
|
385
|
-
} else e === "B" ?
|
|
386
|
-
return Be(o).decode(
|
|
385
|
+
} else e === "B" ? s = rt(r.replace(/[^a-zA-Z0-9\+\/=]+/g, "")) : s = he.encode(r);
|
|
386
|
+
return Be(o).decode(s);
|
|
387
387
|
}
|
|
388
388
|
function ke(o) {
|
|
389
389
|
let e = !0;
|
|
390
390
|
for (; ; ) {
|
|
391
391
|
let r = (o || "").toString().replace(
|
|
392
392
|
/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,
|
|
393
|
-
(u,
|
|
393
|
+
(u, s, n, t, i) => e && n === i && t.length % 4 === 0 && !/=$/.test(t) ? s + "__\0JOIN\0__" : u
|
|
394
394
|
).replace(
|
|
395
395
|
/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,
|
|
396
|
-
(u,
|
|
396
|
+
(u, s, n, t) => e && n === t ? s + "__\0JOIN\0__" : u
|
|
397
397
|
).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g, "").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g, "$1").replace(
|
|
398
398
|
/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,
|
|
399
|
-
(u,
|
|
399
|
+
(u, s, n, t) => Ht(s, n, t)
|
|
400
400
|
);
|
|
401
401
|
if (e && r.indexOf("�") >= 0)
|
|
402
402
|
e = !1;
|
|
@@ -419,9 +419,9 @@ function Vt(o, e) {
|
|
|
419
419
|
} else
|
|
420
420
|
r.push(t.charCodeAt(0));
|
|
421
421
|
}
|
|
422
|
-
const u = new ArrayBuffer(r.length),
|
|
422
|
+
const u = new ArrayBuffer(r.length), s = new DataView(u);
|
|
423
423
|
for (let n = 0, t = r.length; n < t; n++)
|
|
424
|
-
|
|
424
|
+
s.setUint8(n, r[n]);
|
|
425
425
|
return Be(e).decode(u);
|
|
426
426
|
}
|
|
427
427
|
function Wt(o) {
|
|
@@ -430,16 +430,16 @@ function Wt(o) {
|
|
|
430
430
|
let u = r.match(/\*((\d+)\*?)?$/);
|
|
431
431
|
if (!u)
|
|
432
432
|
return;
|
|
433
|
-
let
|
|
434
|
-
e.has(
|
|
433
|
+
let s = r.substr(0, u.index).toLowerCase(), n = Number(u[2]) || 0, t;
|
|
434
|
+
e.has(s) ? t = e.get(s) : (t = {
|
|
435
435
|
charset: !1,
|
|
436
436
|
values: []
|
|
437
|
-
}, e.set(
|
|
437
|
+
}, e.set(s, t));
|
|
438
438
|
let i = o.params[r];
|
|
439
439
|
n === 0 && u[0].charAt(u[0].length - 1) === "*" && (u = i.match(/^([^']*)'[^']*'(.*)$/)) && (t.charset = u[1] || "utf-8", i = u[2]), t.values.push({ nr: n, value: i }), delete o.params[r];
|
|
440
440
|
}), e.forEach((r, u) => {
|
|
441
441
|
o.params[u] = Vt(
|
|
442
|
-
r.values.sort((
|
|
442
|
+
r.values.sort((s, n) => s.nr - n.nr).map((s) => s.value).join(""),
|
|
443
443
|
r.charset
|
|
444
444
|
);
|
|
445
445
|
});
|
|
@@ -463,40 +463,40 @@ class Yt {
|
|
|
463
463
|
update(e) {
|
|
464
464
|
let r = this.decoder.decode(e);
|
|
465
465
|
if (/[^a-zA-Z0-9+\/]/.test(r) && (r = r.replace(/[^a-zA-Z0-9+\/]+/g, "")), this.remainder += r, this.remainder.length >= this.maxChunkSize) {
|
|
466
|
-
let u = Math.floor(this.remainder.length / 4) * 4,
|
|
467
|
-
u === this.remainder.length ? (
|
|
466
|
+
let u = Math.floor(this.remainder.length / 4) * 4, s;
|
|
467
|
+
u === this.remainder.length ? (s = this.remainder, this.remainder = "") : (s = this.remainder.substr(0, u), this.remainder = this.remainder.substr(u)), s.length && this.chunks.push(rt(s));
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
finalize() {
|
|
471
471
|
return this.remainder && !/^=+$/.test(this.remainder) && this.chunks.push(rt(this.remainder)), Pe(new Blob(this.chunks, { type: "application/octet-stream" }));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
const
|
|
474
|
+
const gt = /^=[a-f0-9]{2}$/i, Jt = /(?==[a-f0-9]{2})/i, Kt = /=\r?\n/g, Xt = /=[a-fA-F0-9]?$/;
|
|
475
475
|
class Zt {
|
|
476
476
|
constructor(e) {
|
|
477
477
|
e = e || {}, this.decoder = e.decoder || new TextDecoder(), this.maxChunkSize = 100 * 1024, this.remainder = "", this.chunks = [];
|
|
478
478
|
}
|
|
479
479
|
decodeQPBytes(e) {
|
|
480
480
|
let r = new ArrayBuffer(e.length), u = new DataView(r);
|
|
481
|
-
for (let
|
|
482
|
-
u.setUint8(
|
|
481
|
+
for (let s = 0, n = e.length; s < n; s++)
|
|
482
|
+
u.setUint8(s, parseInt(e[s], 16));
|
|
483
483
|
return r;
|
|
484
484
|
}
|
|
485
485
|
decodeChunks(e) {
|
|
486
486
|
e = e.replace(Kt, "");
|
|
487
487
|
let r = e.split(Jt), u = [];
|
|
488
|
-
for (let
|
|
489
|
-
if (
|
|
490
|
-
u.length && (this.chunks.push(this.decodeQPBytes(u)), u = []), this.chunks.push(
|
|
488
|
+
for (let s of r) {
|
|
489
|
+
if (s.charAt(0) !== "=") {
|
|
490
|
+
u.length && (this.chunks.push(this.decodeQPBytes(u)), u = []), this.chunks.push(s);
|
|
491
491
|
continue;
|
|
492
492
|
}
|
|
493
|
-
if (
|
|
494
|
-
|
|
493
|
+
if (s.length === 3) {
|
|
494
|
+
gt.test(s) ? u.push(s.substr(1)) : (u.length && (this.chunks.push(this.decodeQPBytes(u)), u = []), this.chunks.push(s));
|
|
495
495
|
continue;
|
|
496
496
|
}
|
|
497
|
-
if (
|
|
498
|
-
const n =
|
|
499
|
-
|
|
497
|
+
if (s.length > 3) {
|
|
498
|
+
const n = s.substr(0, 3);
|
|
499
|
+
gt.test(n) ? (u.push(s.substr(1, 2)), this.chunks.push(this.decodeQPBytes(u)), u = [], s = s.substr(3), this.chunks.push(s)) : (u.length && (this.chunks.push(this.decodeQPBytes(u)), u = []), this.chunks.push(s));
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
u.length && (this.chunks.push(this.decodeQPBytes(u)), u = []);
|
|
@@ -523,7 +523,7 @@ class Zt {
|
|
|
523
523
|
return this.remainder.length && (this.decodeChunks(this.remainder), this.remainder = ""), Pe(new Blob(this.chunks, { type: "application/octet-stream" }));
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
class
|
|
526
|
+
class mt {
|
|
527
527
|
constructor(e) {
|
|
528
528
|
if (this.options = e || {}, this.postalMime = this.options.postalMime, this.root = !!this.options.parentNode, this.childNodes = [], this.options.parentNode) {
|
|
529
529
|
if (this.parentNode = this.options.parentNode, this.depth = this.parentNode.depth + 1, this.depth > this.options.maxNestingDepth)
|
|
@@ -563,31 +563,31 @@ class gt {
|
|
|
563
563
|
let r = {
|
|
564
564
|
value: !1,
|
|
565
565
|
params: {}
|
|
566
|
-
}, u = !1,
|
|
567
|
-
for (let
|
|
568
|
-
switch (l = e.charAt(
|
|
566
|
+
}, u = !1, s = "", n = "value", t = !1, i = !1, l;
|
|
567
|
+
for (let c = 0, d = e.length; c < d; c++)
|
|
568
|
+
switch (l = e.charAt(c), n) {
|
|
569
569
|
case "key":
|
|
570
570
|
if (l === "=") {
|
|
571
|
-
u =
|
|
571
|
+
u = s.trim().toLowerCase(), n = "value", s = "";
|
|
572
572
|
break;
|
|
573
573
|
}
|
|
574
|
-
|
|
574
|
+
s += l;
|
|
575
575
|
break;
|
|
576
576
|
case "value":
|
|
577
577
|
if (i)
|
|
578
|
-
|
|
578
|
+
s += l;
|
|
579
579
|
else if (l === "\\") {
|
|
580
580
|
i = !0;
|
|
581
581
|
continue;
|
|
582
|
-
} else t && l === t ? t = !1 : !t && l === '"' ? t = l : !t && l === ";" ? (u === !1 ? r.value =
|
|
582
|
+
} else t && l === t ? t = !1 : !t && l === '"' ? t = l : !t && l === ";" ? (u === !1 ? r.value = s.trim() : r.params[u] = s.trim(), n = "key", s = "") : s += l;
|
|
583
583
|
i = !1;
|
|
584
584
|
break;
|
|
585
585
|
}
|
|
586
|
-
return
|
|
586
|
+
return s = s.trim(), n === "value" ? u === !1 ? r.value = s : r.params[u] = s : s && (r.params[s.toLowerCase()] = ""), r.value && (r.value = r.value.toLowerCase()), Wt(r), r;
|
|
587
587
|
}
|
|
588
588
|
decodeFlowedText(e, r) {
|
|
589
|
-
return e.split(/\r?\n/).reduce((u,
|
|
590
|
-
` +
|
|
589
|
+
return e.split(/\r?\n/).reduce((u, s) => / $/.test(u) && !/(^|\n)-- $/.test(u) ? r ? u.slice(0, -1) + s : u + s : u + `
|
|
590
|
+
` + s).replace(/^ /gm, "");
|
|
591
591
|
}
|
|
592
592
|
getTextContent() {
|
|
593
593
|
if (!this.content)
|
|
@@ -603,8 +603,8 @@ class gt {
|
|
|
603
603
|
` + r, this.headerLines.splice(e, 1);
|
|
604
604
|
else {
|
|
605
605
|
r = r.replace(/\s+/g, " ");
|
|
606
|
-
let u = r.indexOf(":"),
|
|
607
|
-
switch (this.headers.push({ key:
|
|
606
|
+
let u = r.indexOf(":"), s = u < 0 ? r.trim() : r.substr(0, u).trim(), n = u < 0 ? "" : r.substr(u + 1).trim();
|
|
607
|
+
switch (this.headers.push({ key: s.toLowerCase(), originalKey: s, value: n }), s.toLowerCase()) {
|
|
608
608
|
case "content-type":
|
|
609
609
|
this.contentType.default && (this.contentType = { value: n, parsed: {} });
|
|
610
610
|
break;
|
|
@@ -642,7 +642,7 @@ class gt {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
const
|
|
645
|
+
const Dt = {
|
|
646
646
|
"Æ": "Æ",
|
|
647
647
|
"Æ": "Æ",
|
|
648
648
|
"&": "&",
|
|
@@ -2878,24 +2878,24 @@ const mt = {
|
|
|
2878
2878
|
};
|
|
2879
2879
|
function er(o) {
|
|
2880
2880
|
return o.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi, (e, r) => {
|
|
2881
|
-
if (typeof
|
|
2882
|
-
return
|
|
2881
|
+
if (typeof Dt[e] == "string")
|
|
2882
|
+
return Dt[e];
|
|
2883
2883
|
if (r.charAt(0) !== "#" || e.charAt(e.length - 1) !== ";")
|
|
2884
2884
|
return e;
|
|
2885
2885
|
let u;
|
|
2886
2886
|
r.charAt(1) === "x" ? u = parseInt(r.substr(2), 16) : u = parseInt(r.substr(1), 10);
|
|
2887
|
-
var
|
|
2888
|
-
return u >= 55296 && u <= 57343 || u > 1114111 ? "�" : (u > 65535 && (u -= 65536,
|
|
2887
|
+
var s = "";
|
|
2888
|
+
return u >= 55296 && u <= 57343 || u > 1114111 ? "�" : (u > 65535 && (u -= 65536, s += String.fromCharCode(u >>> 10 & 1023 | 55296), u = 56320 | u & 1023), s += String.fromCharCode(u), s);
|
|
2889
2889
|
});
|
|
2890
2890
|
}
|
|
2891
|
-
function
|
|
2891
|
+
function ae(o) {
|
|
2892
2892
|
return o.trim().replace(/[<>"'?&]/g, (e) => {
|
|
2893
2893
|
let r = e.charCodeAt(0).toString(16);
|
|
2894
2894
|
return r.length < 2 && (r = "0" + r), "&#x" + r.toUpperCase() + ";";
|
|
2895
2895
|
});
|
|
2896
2896
|
}
|
|
2897
2897
|
function tr(o) {
|
|
2898
|
-
return "<div>" +
|
|
2898
|
+
return "<div>" + ae(o).replace(/\n/g, "<br />") + "</div>";
|
|
2899
2899
|
}
|
|
2900
2900
|
function rr(o) {
|
|
2901
2901
|
return o = o.replace(/\r?\n/g, "").replace(/<\!\-\-.*?\-\->/gi, " ").replace(/<br\b[^>]*>/gi, `
|
|
@@ -2910,26 +2910,26 @@ function rr(o) {
|
|
|
2910
2910
|
`).replace(/\n+$/, `
|
|
2911
2911
|
`), o = er(o), o;
|
|
2912
2912
|
}
|
|
2913
|
-
function
|
|
2913
|
+
function Et(o) {
|
|
2914
2914
|
return [].concat(o.name || []).concat(o.name ? `<${o.address}>` : o.address).join(" ");
|
|
2915
2915
|
}
|
|
2916
2916
|
function Ke(o) {
|
|
2917
|
-
let e = [], r = (u,
|
|
2918
|
-
if (
|
|
2917
|
+
let e = [], r = (u, s) => {
|
|
2918
|
+
if (s && e.push(", "), u.group) {
|
|
2919
2919
|
let n = `${u.name}:`, t = ";";
|
|
2920
2920
|
e.push(n), u.group.forEach(r), e.push(t);
|
|
2921
2921
|
} else
|
|
2922
|
-
e.push(
|
|
2922
|
+
e.push(Et(u));
|
|
2923
2923
|
};
|
|
2924
2924
|
return o.forEach(r), e.join("");
|
|
2925
2925
|
}
|
|
2926
2926
|
function wt(o) {
|
|
2927
|
-
return `<a href="mailto:${
|
|
2927
|
+
return `<a href="mailto:${ae(o.address)}" class="postal-email-address">${ae(o.name || `<${o.address}>`)}</a>`;
|
|
2928
2928
|
}
|
|
2929
2929
|
function Xe(o) {
|
|
2930
|
-
let e = [], r = (u,
|
|
2931
|
-
if (
|
|
2932
|
-
let n = `<span class="postal-email-address-group">${
|
|
2930
|
+
let e = [], r = (u, s) => {
|
|
2931
|
+
if (s && e.push('<span class="postal-email-address-separator">, </span>'), u.group) {
|
|
2932
|
+
let n = `<span class="postal-email-address-group">${ae(u.name)}:</span>`, t = '<span class="postal-email-address-group">;</span>';
|
|
2933
2933
|
e.push(n), u.group.forEach(r), e.push(t);
|
|
2934
2934
|
} else
|
|
2935
2935
|
e.push(wt(u));
|
|
@@ -2938,8 +2938,8 @@ function Xe(o) {
|
|
|
2938
2938
|
}
|
|
2939
2939
|
function ur(o, e, r) {
|
|
2940
2940
|
o = (o || "").toString(), e = e || 76;
|
|
2941
|
-
let u = 0,
|
|
2942
|
-
for (; u <
|
|
2941
|
+
let u = 0, s = o.length, n = "", t, i;
|
|
2942
|
+
for (; u < s; ) {
|
|
2943
2943
|
if (t = o.substr(u, e), t.length < e) {
|
|
2944
2944
|
n += t;
|
|
2945
2945
|
break;
|
|
@@ -2948,14 +2948,14 @@ function ur(o, e, r) {
|
|
|
2948
2948
|
t = i[0], n += t, u += t.length;
|
|
2949
2949
|
continue;
|
|
2950
2950
|
} else (i = t.match(/(\s+)[^\s]*$/)) && i[0].length - (i[1] || "").length < t.length ? t = t.substr(0, t.length - (i[0].length - (i[1] || "").length)) : (i = o.substr(u + t.length).match(/^[^\s]+(\s*)/)) && (t = t + i[0].substr(0, i[0].length - 0));
|
|
2951
|
-
n += t, u += t.length, u <
|
|
2951
|
+
n += t, u += t.length, u < s && (n += `\r
|
|
2952
2952
|
`);
|
|
2953
2953
|
}
|
|
2954
2954
|
return n;
|
|
2955
2955
|
}
|
|
2956
|
-
function
|
|
2956
|
+
function At(o) {
|
|
2957
2957
|
let e = [];
|
|
2958
|
-
if (o.from && e.push({ key: "From", val:
|
|
2958
|
+
if (o.from && e.push({ key: "From", val: Et(o.from) }), o.subject && e.push({ key: "Subject", val: o.subject }), o.date) {
|
|
2959
2959
|
let t = {
|
|
2960
2960
|
year: "numeric",
|
|
2961
2961
|
month: "numeric",
|
|
@@ -2970,23 +2970,23 @@ function Dt(o) {
|
|
|
2970
2970
|
o.to && o.to.length && e.push({ key: "To", val: Ke(o.to) }), o.cc && o.cc.length && e.push({ key: "Cc", val: Ke(o.cc) }), o.bcc && o.bcc.length && e.push({ key: "Bcc", val: Ke(o.bcc) });
|
|
2971
2971
|
let r = e.map((t) => t.key.length).reduce((t, i) => i > t ? i : t, 0);
|
|
2972
2972
|
e = e.flatMap((t) => {
|
|
2973
|
-
let i = r - t.key.length, l = `${t.key}: ${" ".repeat(i)}`,
|
|
2974
|
-
return ur(t.val, 80).split(/\r?\n/).map((
|
|
2973
|
+
let i = r - t.key.length, l = `${t.key}: ${" ".repeat(i)}`, c = `${" ".repeat(t.key.length + 1)} ${" ".repeat(i)}`;
|
|
2974
|
+
return ur(t.val, 80).split(/\r?\n/).map((p) => p.trim()).map((p, m) => `${m ? c : l}${p}`);
|
|
2975
2975
|
});
|
|
2976
|
-
let u = e.map((t) => t.length).reduce((t, i) => i > t ? i : t, 0),
|
|
2976
|
+
let u = e.map((t) => t.length).reduce((t, i) => i > t ? i : t, 0), s = "-".repeat(u);
|
|
2977
2977
|
return `
|
|
2978
|
-
${
|
|
2978
|
+
${s}
|
|
2979
2979
|
${e.join(`
|
|
2980
2980
|
`)}
|
|
2981
|
-
${
|
|
2981
|
+
${s}
|
|
2982
2982
|
`;
|
|
2983
2983
|
}
|
|
2984
|
-
function
|
|
2984
|
+
function bt(o) {
|
|
2985
2985
|
let e = [];
|
|
2986
2986
|
if (o.from && e.push(
|
|
2987
2987
|
`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${wt(o.from)}</div>`
|
|
2988
2988
|
), o.subject && e.push(
|
|
2989
|
-
`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${
|
|
2989
|
+
`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${ae(
|
|
2990
2990
|
o.subject
|
|
2991
2991
|
)}</div>`
|
|
2992
2992
|
), o.date) {
|
|
@@ -2998,11 +2998,11 @@ function At(o) {
|
|
|
2998
2998
|
minute: "numeric",
|
|
2999
2999
|
second: "numeric",
|
|
3000
3000
|
hour12: !1
|
|
3001
|
-
},
|
|
3001
|
+
}, s = typeof Intl > "u" ? o.date : new Intl.DateTimeFormat("default", u).format(new Date(o.date));
|
|
3002
3002
|
e.push(
|
|
3003
|
-
`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${
|
|
3003
|
+
`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${ae(
|
|
3004
3004
|
o.date
|
|
3005
|
-
)}">${
|
|
3005
|
+
)}">${ae(s)}</div>`
|
|
3006
3006
|
);
|
|
3007
3007
|
}
|
|
3008
3008
|
return o.to && o.to.length && e.push(
|
|
@@ -3016,45 +3016,45 @@ function At(o) {
|
|
|
3016
3016
|
<div class="postal-email-header-row">`
|
|
3017
3017
|
)}${e.length ? "</div>" : ""}</div>`;
|
|
3018
3018
|
}
|
|
3019
|
-
function
|
|
3020
|
-
let r = !1, u = "text",
|
|
3019
|
+
function sr(o, e) {
|
|
3020
|
+
let r = !1, u = "text", s, n = [], t = {
|
|
3021
3021
|
address: [],
|
|
3022
3022
|
comment: [],
|
|
3023
3023
|
group: [],
|
|
3024
3024
|
text: [],
|
|
3025
3025
|
textWasQuoted: []
|
|
3026
3026
|
// Track which text tokens came from inside quotes
|
|
3027
|
-
}, i, l,
|
|
3027
|
+
}, i, l, c = !1;
|
|
3028
3028
|
for (i = 0, l = o.length; i < l; i++) {
|
|
3029
|
-
let
|
|
3030
|
-
if (
|
|
3031
|
-
switch (
|
|
3029
|
+
let d = o[i], p = i ? o[i - 1] : null;
|
|
3030
|
+
if (d.type === "operator")
|
|
3031
|
+
switch (d.value) {
|
|
3032
3032
|
case "<":
|
|
3033
|
-
u = "address",
|
|
3033
|
+
u = "address", c = !1;
|
|
3034
3034
|
break;
|
|
3035
3035
|
case "(":
|
|
3036
|
-
u = "comment",
|
|
3036
|
+
u = "comment", c = !1;
|
|
3037
3037
|
break;
|
|
3038
3038
|
case ":":
|
|
3039
|
-
u = "group", r = !0,
|
|
3039
|
+
u = "group", r = !0, c = !1;
|
|
3040
3040
|
break;
|
|
3041
3041
|
case '"':
|
|
3042
|
-
|
|
3042
|
+
c = !c, u = "text";
|
|
3043
3043
|
break;
|
|
3044
3044
|
default:
|
|
3045
|
-
u = "text",
|
|
3045
|
+
u = "text", c = !1;
|
|
3046
3046
|
break;
|
|
3047
3047
|
}
|
|
3048
|
-
else
|
|
3048
|
+
else d.value && (u === "address" && (d.value = d.value.replace(/^[^<]*<\s*/, "")), p && p.noBreak && t[u].length ? (t[u][t[u].length - 1] += d.value, u === "text" && c && (t.textWasQuoted[t.textWasQuoted.length - 1] = !0)) : (t[u].push(d.value), u === "text" && t.textWasQuoted.push(c)));
|
|
3049
3049
|
}
|
|
3050
3050
|
if (!t.text.length && t.comment.length && (t.text = t.comment, t.comment = []), r) {
|
|
3051
3051
|
t.text = t.text.join(" ");
|
|
3052
|
-
let
|
|
3052
|
+
let d = [];
|
|
3053
3053
|
t.group.length && Fe(t.group.join(","), { _depth: e + 1 }).forEach((m) => {
|
|
3054
|
-
m.group ?
|
|
3054
|
+
m.group ? d = d.concat(m.group) : d.push(m);
|
|
3055
3055
|
}), n.push({
|
|
3056
|
-
name: ke(t.text ||
|
|
3057
|
-
group:
|
|
3056
|
+
name: ke(t.text || s && s.name),
|
|
3057
|
+
group: d
|
|
3058
3058
|
});
|
|
3059
3059
|
} else {
|
|
3060
3060
|
if (!t.address.length && t.text.length) {
|
|
@@ -3063,28 +3063,28 @@ function ar(o, e) {
|
|
|
3063
3063
|
t.address = t.text.splice(i, 1), t.textWasQuoted.splice(i, 1);
|
|
3064
3064
|
break;
|
|
3065
3065
|
}
|
|
3066
|
-
let
|
|
3067
|
-
return t.address.length ?
|
|
3066
|
+
let d = function(p) {
|
|
3067
|
+
return t.address.length ? p : (t.address = [p.trim()], " ");
|
|
3068
3068
|
};
|
|
3069
3069
|
if (!t.address.length)
|
|
3070
|
-
for (i = t.text.length - 1; i >= 0 && !(!t.textWasQuoted[i] && (t.text[i] = t.text[i].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,
|
|
3070
|
+
for (i = t.text.length - 1; i >= 0 && !(!t.textWasQuoted[i] && (t.text[i] = t.text[i].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/, d).trim(), t.address.length)); i--)
|
|
3071
3071
|
;
|
|
3072
3072
|
}
|
|
3073
3073
|
if (!t.text.length && t.comment.length && (t.text = t.comment, t.comment = []), t.address.length > 1 && (t.text = t.text.concat(t.address.splice(1))), t.text = t.text.join(" "), t.address = t.address.join(" "), !t.address && /^=\?[^=]+?=$/.test(t.text.trim())) {
|
|
3074
|
-
const
|
|
3075
|
-
if (
|
|
3076
|
-
return
|
|
3074
|
+
const d = Fe(ke(t.text));
|
|
3075
|
+
if (d && d.length)
|
|
3076
|
+
return d;
|
|
3077
3077
|
}
|
|
3078
3078
|
if (!t.address && r)
|
|
3079
3079
|
return [];
|
|
3080
|
-
|
|
3080
|
+
s = {
|
|
3081
3081
|
address: t.address || t.text || "",
|
|
3082
3082
|
name: ke(t.text || t.address || "")
|
|
3083
|
-
},
|
|
3083
|
+
}, s.address === s.name && ((s.address || "").match(/@/) ? s.name = "" : s.address = ""), n.push(s);
|
|
3084
3084
|
}
|
|
3085
3085
|
return n;
|
|
3086
3086
|
}
|
|
3087
|
-
class
|
|
3087
|
+
class ar {
|
|
3088
3088
|
constructor(e) {
|
|
3089
3089
|
this.str = (e || "").toString(), this.operatorCurrent = "", this.operatorExpecting = "", this.node = null, this.escaped = !1, this.list = [], this.operators = {
|
|
3090
3090
|
'"': '"',
|
|
@@ -3109,8 +3109,8 @@ class sr {
|
|
|
3109
3109
|
tokenize() {
|
|
3110
3110
|
let e = [];
|
|
3111
3111
|
for (let r = 0, u = this.str.length; r < u; r++) {
|
|
3112
|
-
let
|
|
3113
|
-
this.checkChar(
|
|
3112
|
+
let s = this.str.charAt(r), n = r < u - 1 ? this.str.charAt(r + 1) : null;
|
|
3113
|
+
this.checkChar(s, n);
|
|
3114
3114
|
}
|
|
3115
3115
|
return this.list.forEach((r) => {
|
|
3116
3116
|
r.value = (r.value || "").toString().trim(), r.value && e.push(r);
|
|
@@ -3154,27 +3154,27 @@ function Fe(o, e) {
|
|
|
3154
3154
|
let r = e._depth || 0;
|
|
3155
3155
|
if (r > nr)
|
|
3156
3156
|
return [];
|
|
3157
|
-
let
|
|
3158
|
-
if (
|
|
3157
|
+
let s = new ar(o).tokenize(), n = [], t = [], i = [];
|
|
3158
|
+
if (s.forEach((l) => {
|
|
3159
3159
|
l.type === "operator" && (l.value === "," || l.value === ";") ? (t.length && n.push(t), t = []) : t.push(l);
|
|
3160
3160
|
}), t.length && n.push(t), n.forEach((l) => {
|
|
3161
|
-
l =
|
|
3161
|
+
l = sr(l, r), l.length && (i = i.concat(l));
|
|
3162
3162
|
}), e.flatten) {
|
|
3163
|
-
let l = [],
|
|
3164
|
-
|
|
3165
|
-
if (
|
|
3166
|
-
return
|
|
3167
|
-
l.push(
|
|
3163
|
+
let l = [], c = (d) => {
|
|
3164
|
+
d.forEach((p) => {
|
|
3165
|
+
if (p.group)
|
|
3166
|
+
return c(p.group);
|
|
3167
|
+
l.push(p);
|
|
3168
3168
|
});
|
|
3169
3169
|
};
|
|
3170
|
-
return
|
|
3170
|
+
return c(i), l;
|
|
3171
3171
|
}
|
|
3172
3172
|
return i;
|
|
3173
3173
|
}
|
|
3174
3174
|
function ir(o) {
|
|
3175
|
-
for (var e = "", r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", u = new Uint8Array(o),
|
|
3176
|
-
|
|
3177
|
-
return n == 1 ? (
|
|
3175
|
+
for (var e = "", r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", u = new Uint8Array(o), s = u.byteLength, n = s % 3, t = s - n, i, l, c, d, p, m = 0; m < t; m = m + 3)
|
|
3176
|
+
p = u[m] << 16 | u[m + 1] << 8 | u[m + 2], i = (p & 16515072) >> 18, l = (p & 258048) >> 12, c = (p & 4032) >> 6, d = p & 63, e += r[i] + r[l] + r[c] + r[d];
|
|
3177
|
+
return n == 1 ? (p = u[t], i = (p & 252) >> 2, l = (p & 3) << 4, e += r[i] + r[l] + "==") : n == 2 && (p = u[t] << 8 | u[t + 1], i = (p & 64512) >> 10, l = (p & 1008) >> 4, c = (p & 15) << 2, e += r[i] + r[l] + r[c] + "="), e;
|
|
3178
3178
|
}
|
|
3179
3179
|
const or = 256, lr = 2 * 1024 * 1024;
|
|
3180
3180
|
class Le {
|
|
@@ -3185,7 +3185,7 @@ class Le {
|
|
|
3185
3185
|
this.options = e || {}, this.mimeOptions = {
|
|
3186
3186
|
maxNestingDepth: this.options.maxNestingDepth || or,
|
|
3187
3187
|
maxHeadersSize: this.options.maxHeadersSize || lr
|
|
3188
|
-
}, this.root = this.currentNode = new
|
|
3188
|
+
}, this.root = this.currentNode = new mt({
|
|
3189
3189
|
postalMime: this,
|
|
3190
3190
|
...this.mimeOptions
|
|
3191
3191
|
}), this.boundaries = [], this.textContent = {}, this.attachments = [], this.attachmentEncoding = (this.options.attachmentEncoding || "").toString().replace(/[-_\s]/g, "").trim().toLowerCase() || "arraybuffer", this.started = !1;
|
|
@@ -3196,8 +3196,8 @@ class Le {
|
|
|
3196
3196
|
async processLine(e, r) {
|
|
3197
3197
|
let u = this.boundaries;
|
|
3198
3198
|
if (u.length && e.length > 2 && e[0] === 45 && e[1] === 45)
|
|
3199
|
-
for (let
|
|
3200
|
-
let n = u[
|
|
3199
|
+
for (let s = u.length - 1; s >= 0; s--) {
|
|
3200
|
+
let n = u[s];
|
|
3201
3201
|
if (e.length !== n.value.length + 2 && e.length !== n.value.length + 4)
|
|
3202
3202
|
continue;
|
|
3203
3203
|
let t = e.length === n.value.length + 4;
|
|
@@ -3210,7 +3210,7 @@ class Le {
|
|
|
3210
3210
|
break;
|
|
3211
3211
|
}
|
|
3212
3212
|
if (i)
|
|
3213
|
-
return t ? (await n.node.finalize(), this.currentNode = n.node.parentNode || this.root) : (await n.node.finalizeChildNodes(), this.currentNode = new
|
|
3213
|
+
return t ? (await n.node.finalize(), this.currentNode = n.node.parentNode || this.root) : (await n.node.finalizeChildNodes(), this.currentNode = new mt({
|
|
3214
3214
|
postalMime: this,
|
|
3215
3215
|
parentNode: n.node,
|
|
3216
3216
|
...this.mimeOptions
|
|
@@ -3225,53 +3225,53 @@ class Le {
|
|
|
3225
3225
|
done: this.readPos >= this.av.length
|
|
3226
3226
|
});
|
|
3227
3227
|
for (; this.readPos < this.av.length; ) {
|
|
3228
|
-
const
|
|
3229
|
-
if (
|
|
3228
|
+
const s = this.av[this.readPos++];
|
|
3229
|
+
if (s !== 13 && s !== 10 && (r = this.readPos), s === 10)
|
|
3230
3230
|
return u();
|
|
3231
3231
|
}
|
|
3232
3232
|
return u();
|
|
3233
3233
|
}
|
|
3234
3234
|
async processNodeTree() {
|
|
3235
|
-
let e = {}, r = /* @__PURE__ */ new Set(), u = this.textMap = /* @__PURE__ */ new Map(),
|
|
3235
|
+
let e = {}, r = /* @__PURE__ */ new Set(), u = this.textMap = /* @__PURE__ */ new Map(), s = this.forceRfc822Attachments(), n = async (t, i, l) => {
|
|
3236
3236
|
if (i = i || !1, l = l || !1, t.contentType.multipart)
|
|
3237
3237
|
t.contentType.multipart === "alternative" ? i = t : t.contentType.multipart === "related" && (l = t);
|
|
3238
|
-
else if (this.isInlineMessageRfc822(t) && !
|
|
3239
|
-
const
|
|
3240
|
-
t.subMessage = await
|
|
3241
|
-
let
|
|
3242
|
-
(t.subMessage.text || !t.subMessage.html) && (
|
|
3243
|
-
u.set(m,
|
|
3238
|
+
else if (this.isInlineMessageRfc822(t) && !s) {
|
|
3239
|
+
const c = new Le();
|
|
3240
|
+
t.subMessage = await c.parse(t.content), u.has(t) || u.set(t, {});
|
|
3241
|
+
let d = u.get(t);
|
|
3242
|
+
(t.subMessage.text || !t.subMessage.html) && (d.plain = d.plain || [], d.plain.push({ type: "subMessage", value: t.subMessage }), r.add("plain")), t.subMessage.html && (d.html = d.html || [], d.html.push({ type: "subMessage", value: t.subMessage }), r.add("html")), c.textMap && c.textMap.forEach((p, m) => {
|
|
3243
|
+
u.set(m, p);
|
|
3244
3244
|
});
|
|
3245
|
-
for (let
|
|
3246
|
-
this.attachments.push(
|
|
3245
|
+
for (let p of t.subMessage.attachments || [])
|
|
3246
|
+
this.attachments.push(p);
|
|
3247
3247
|
} else if (this.isInlineTextNode(t)) {
|
|
3248
|
-
let
|
|
3249
|
-
u.has(
|
|
3250
|
-
let
|
|
3251
|
-
|
|
3248
|
+
let c = t.contentType.parsed.value.substr(t.contentType.parsed.value.indexOf("/") + 1), d = i || t;
|
|
3249
|
+
u.has(d) || u.set(d, {});
|
|
3250
|
+
let p = u.get(d);
|
|
3251
|
+
p[c] = p[c] || [], p[c].push({ type: "text", value: t.getTextContent() }), r.add(c);
|
|
3252
3252
|
} else if (t.content) {
|
|
3253
|
-
const
|
|
3254
|
-
filename:
|
|
3253
|
+
const c = t.contentDisposition.parsed.params.filename || t.contentType.parsed.params.name || null, d = {
|
|
3254
|
+
filename: c ? ke(c) : null,
|
|
3255
3255
|
mimeType: t.contentType.parsed.value,
|
|
3256
3256
|
disposition: t.contentDisposition.parsed.value || null
|
|
3257
3257
|
};
|
|
3258
|
-
switch (l && t.contentId && (
|
|
3258
|
+
switch (l && t.contentId && (d.related = !0), t.contentDescription && (d.description = t.contentDescription), t.contentId && (d.contentId = t.contentId), t.contentType.parsed.value) {
|
|
3259
3259
|
case "text/calendar":
|
|
3260
3260
|
case "application/ics": {
|
|
3261
|
-
t.contentType.parsed.params.method && (
|
|
3262
|
-
const
|
|
3261
|
+
t.contentType.parsed.params.method && (d.method = t.contentType.parsed.params.method.toString().toUpperCase().trim());
|
|
3262
|
+
const p = t.getTextContent().replace(/\r?\n/g, `
|
|
3263
3263
|
`).replace(/\n*$/, `
|
|
3264
3264
|
`);
|
|
3265
|
-
|
|
3265
|
+
d.content = he.encode(p);
|
|
3266
3266
|
break;
|
|
3267
3267
|
}
|
|
3268
3268
|
default:
|
|
3269
|
-
|
|
3269
|
+
d.content = t.content;
|
|
3270
3270
|
}
|
|
3271
|
-
this.attachments.push(
|
|
3271
|
+
this.attachments.push(d);
|
|
3272
3272
|
}
|
|
3273
|
-
for (let
|
|
3274
|
-
await n(
|
|
3273
|
+
for (let c of t.childNodes)
|
|
3274
|
+
await n(c, i, l);
|
|
3275
3275
|
};
|
|
3276
3276
|
await n(this.root, !1, []), u.forEach((t) => {
|
|
3277
3277
|
r.forEach((i) => {
|
|
@@ -3284,10 +3284,10 @@ class Le {
|
|
|
3284
3284
|
case "subMessage":
|
|
3285
3285
|
switch (i) {
|
|
3286
3286
|
case "html":
|
|
3287
|
-
e[i].push(
|
|
3287
|
+
e[i].push(bt(l.value));
|
|
3288
3288
|
break;
|
|
3289
3289
|
case "plain":
|
|
3290
|
-
e[i].push(
|
|
3290
|
+
e[i].push(At(l.value));
|
|
3291
3291
|
break;
|
|
3292
3292
|
}
|
|
3293
3293
|
break;
|
|
@@ -3303,25 +3303,25 @@ class Le {
|
|
|
3303
3303
|
l = "html";
|
|
3304
3304
|
break;
|
|
3305
3305
|
}
|
|
3306
|
-
(t[l] || []).forEach((
|
|
3307
|
-
switch (
|
|
3306
|
+
(t[l] || []).forEach((c) => {
|
|
3307
|
+
switch (c.type) {
|
|
3308
3308
|
case "text":
|
|
3309
3309
|
switch (i) {
|
|
3310
3310
|
case "html":
|
|
3311
|
-
e[i].push(tr(
|
|
3311
|
+
e[i].push(tr(c.value));
|
|
3312
3312
|
break;
|
|
3313
3313
|
case "plain":
|
|
3314
|
-
e[i].push(rr(
|
|
3314
|
+
e[i].push(rr(c.value));
|
|
3315
3315
|
break;
|
|
3316
3316
|
}
|
|
3317
3317
|
break;
|
|
3318
3318
|
case "subMessage":
|
|
3319
3319
|
switch (i) {
|
|
3320
3320
|
case "html":
|
|
3321
|
-
e[i].push(
|
|
3321
|
+
e[i].push(bt(c.value));
|
|
3322
3322
|
break;
|
|
3323
3323
|
case "plain":
|
|
3324
|
-
e[i].push(
|
|
3324
|
+
e[i].push(At(c.value));
|
|
3325
3325
|
break;
|
|
3326
3326
|
}
|
|
3327
3327
|
break;
|
|
@@ -3356,16 +3356,16 @@ class Le {
|
|
|
3356
3356
|
return !0;
|
|
3357
3357
|
let e = !1, r = (u) => {
|
|
3358
3358
|
u.contentType.multipart || ["message/delivery-status", "message/feedback-report"].includes(u.contentType.parsed.value) && (e = !0);
|
|
3359
|
-
for (let
|
|
3360
|
-
r(
|
|
3359
|
+
for (let s of u.childNodes)
|
|
3360
|
+
r(s);
|
|
3361
3361
|
};
|
|
3362
3362
|
return r(this.root), e;
|
|
3363
3363
|
}
|
|
3364
3364
|
async resolveStream(e) {
|
|
3365
3365
|
let r = 0, u = [];
|
|
3366
|
-
const
|
|
3366
|
+
const s = e.getReader();
|
|
3367
3367
|
for (; ; ) {
|
|
3368
|
-
const { done: i, value: l } = await
|
|
3368
|
+
const { done: i, value: l } = await s.read();
|
|
3369
3369
|
if (i)
|
|
3370
3370
|
break;
|
|
3371
3371
|
u.push(l), r += l.length;
|
|
@@ -3377,7 +3377,7 @@ class Le {
|
|
|
3377
3377
|
return n;
|
|
3378
3378
|
}
|
|
3379
3379
|
async parse(e) {
|
|
3380
|
-
var
|
|
3380
|
+
var s, n;
|
|
3381
3381
|
if (this.started)
|
|
3382
3382
|
throw new Error("Can not reuse parser, create a new PostalMime object");
|
|
3383
3383
|
for (this.started = !0, e && typeof e.getReader == "function" && (e = await this.resolveStream(e)), e = e || new ArrayBuffer(0), typeof e == "string" && (e = he.encode(e)), (e instanceof Blob || Object.prototype.toString.call(e) === "[object Blob]") && (e = await Pe(e)), e.buffer instanceof ArrayBuffer && (e = new Uint8Array(e).buffer), this.buf = e, this.av = new Uint8Array(e), this.readPos = 0; this.readPos < this.av.length; ) {
|
|
@@ -3400,23 +3400,23 @@ class Le {
|
|
|
3400
3400
|
if (i && i.value) {
|
|
3401
3401
|
const l = Fe(i.value);
|
|
3402
3402
|
if (l && l.length && l[0].address) {
|
|
3403
|
-
const
|
|
3404
|
-
r[
|
|
3403
|
+
const c = t.replace(/\-(.)/g, (d, p) => p.toUpperCase());
|
|
3404
|
+
r[c] = l[0].address;
|
|
3405
3405
|
}
|
|
3406
3406
|
}
|
|
3407
3407
|
}
|
|
3408
3408
|
for (const t of ["to", "cc", "bcc", "reply-to"]) {
|
|
3409
|
-
const i = this.root.headers.filter((
|
|
3409
|
+
const i = this.root.headers.filter((c) => c.key === t);
|
|
3410
3410
|
let l = [];
|
|
3411
|
-
if (i.filter((
|
|
3412
|
-
const
|
|
3413
|
-
r[
|
|
3411
|
+
if (i.filter((c) => c && c.value).map((c) => Fe(c.value)).forEach((c) => l = l.concat(c || [])), l && l.length) {
|
|
3412
|
+
const c = t.replace(/\-(.)/g, (d, p) => p.toUpperCase());
|
|
3413
|
+
r[c] = l;
|
|
3414
3414
|
}
|
|
3415
3415
|
}
|
|
3416
3416
|
for (const t of ["subject", "message-id", "in-reply-to", "references"]) {
|
|
3417
3417
|
const i = this.root.headers.find((l) => l.key === t);
|
|
3418
3418
|
if (i && i.value) {
|
|
3419
|
-
const l = t.replace(/\-(.)/g, (
|
|
3419
|
+
const l = t.replace(/\-(.)/g, (c, d) => d.toUpperCase());
|
|
3420
3420
|
r[l] = ke(i.value);
|
|
3421
3421
|
}
|
|
3422
3422
|
}
|
|
@@ -3425,7 +3425,7 @@ class Le {
|
|
|
3425
3425
|
let t = new Date(u.value);
|
|
3426
3426
|
!t || t.toString() === "Invalid Date" ? t = u.value : t = t.toISOString(), r.date = t;
|
|
3427
3427
|
}
|
|
3428
|
-
switch ((
|
|
3428
|
+
switch ((s = this.textContent) != null && s.html && (r.html = this.textContent.html), (n = this.textContent) != null && n.plain && (r.text = this.textContent.plain), r.attachments = this.attachments, this.attachmentEncoding) {
|
|
3429
3429
|
case "arraybuffer":
|
|
3430
3430
|
break;
|
|
3431
3431
|
case "base64":
|
|
@@ -3445,7 +3445,7 @@ class Le {
|
|
|
3445
3445
|
}
|
|
3446
3446
|
class cr {
|
|
3447
3447
|
constructor(e) {
|
|
3448
|
-
|
|
3448
|
+
ve(this, "config");
|
|
3449
3449
|
if (!e.system_id)
|
|
3450
3450
|
throw new Error("MailClient: system_id is REQUIRED");
|
|
3451
3451
|
this.config = e;
|
|
@@ -3454,7 +3454,7 @@ class cr {
|
|
|
3454
3454
|
* Call a coprocessor (default: mail)
|
|
3455
3455
|
*/
|
|
3456
3456
|
async callCoprocessor(e, r, u = {}) {
|
|
3457
|
-
const
|
|
3457
|
+
const s = {
|
|
3458
3458
|
coprocessor: e,
|
|
3459
3459
|
method: r,
|
|
3460
3460
|
system_id: this.config.system_id,
|
|
@@ -3470,7 +3470,7 @@ class cr {
|
|
|
3470
3470
|
"Content-Type": "application/json",
|
|
3471
3471
|
Authorization: `Bearer ${this.getToken()}`
|
|
3472
3472
|
},
|
|
3473
|
-
body: JSON.stringify(
|
|
3473
|
+
body: JSON.stringify(s)
|
|
3474
3474
|
});
|
|
3475
3475
|
if (!n.ok) {
|
|
3476
3476
|
const i = await n.text();
|
|
@@ -3560,10 +3560,10 @@ class cr {
|
|
|
3560
3560
|
*/
|
|
3561
3561
|
async trashEmails(e, r) {
|
|
3562
3562
|
const u = ["[Gmail]/Trash", "[Gmail]/Corbeille", "[Gmail]/Bin", "Trash"];
|
|
3563
|
-
for (const
|
|
3563
|
+
for (const s of u) {
|
|
3564
3564
|
const n = [
|
|
3565
3565
|
"SELECT INBOX",
|
|
3566
|
-
...r.map((l) => `UID MOVE ${l} ${
|
|
3566
|
+
...r.map((l) => `UID MOVE ${l} ${s}`)
|
|
3567
3567
|
], i = (await this.imapExec(e, n)).responses.filter((l) => l.ok && l.command === "UID MOVE").length;
|
|
3568
3568
|
if (i > 0)
|
|
3569
3569
|
return { success: !0, moved: i };
|
|
@@ -3585,7 +3585,7 @@ class cr {
|
|
|
3585
3585
|
* List available folders
|
|
3586
3586
|
*/
|
|
3587
3587
|
async listFolders(e) {
|
|
3588
|
-
const u = (await this.imapExec(e, ['LIST "" *'])).responses.find((
|
|
3588
|
+
const u = (await this.imapExec(e, ['LIST "" *'])).responses.find((s) => s.command === "LIST");
|
|
3589
3589
|
return u != null && u.ok && u.folders ? { success: !0, folders: u.folders } : { success: !1, folders: [] };
|
|
3590
3590
|
}
|
|
3591
3591
|
/**
|
|
@@ -3593,44 +3593,44 @@ class cr {
|
|
|
3593
3593
|
* This is the preferred method - all logic in TypeScript, backend is just a proxy
|
|
3594
3594
|
*/
|
|
3595
3595
|
async listEmailsSorted(e, r = "INBOX", u = 20) {
|
|
3596
|
-
const
|
|
3596
|
+
const s = await this.imapExec(e, [
|
|
3597
3597
|
`SELECT ${r}`,
|
|
3598
3598
|
"FETCH 1:* (UID INTERNALDATE)"
|
|
3599
|
-
]), n =
|
|
3599
|
+
]), n = s.responses.find((D) => D.command === "SELECT");
|
|
3600
3600
|
if (!(n != null && n.ok))
|
|
3601
3601
|
throw new Error(`Failed to select folder: ${(n == null ? void 0 : n.error) || "Unknown error"}`);
|
|
3602
|
-
const t =
|
|
3602
|
+
const t = s.responses.find((D) => D.command === "FETCH");
|
|
3603
3603
|
if (!(t != null && t.ok) || !t.messages)
|
|
3604
3604
|
return {
|
|
3605
3605
|
account: { id: e, label: "", email: "" },
|
|
3606
3606
|
mailbox: { name: r, total: n.exists || 0 },
|
|
3607
3607
|
messages: []
|
|
3608
3608
|
};
|
|
3609
|
-
const l = [...t.messages].sort((
|
|
3610
|
-
const B =
|
|
3611
|
-
return (
|
|
3612
|
-
}).slice(0, u).map((
|
|
3609
|
+
const l = [...t.messages].sort((D, E) => {
|
|
3610
|
+
const B = D.internalDate ? new Date(D.internalDate).getTime() : 0;
|
|
3611
|
+
return (E.internalDate ? new Date(E.internalDate).getTime() : 0) - B;
|
|
3612
|
+
}).slice(0, u).map((D) => D.uid).filter(Boolean);
|
|
3613
3613
|
if (l.length === 0)
|
|
3614
3614
|
return {
|
|
3615
3615
|
account: { id: e, label: "", email: "" },
|
|
3616
3616
|
mailbox: { name: r, total: n.exists || 0 },
|
|
3617
3617
|
messages: []
|
|
3618
3618
|
};
|
|
3619
|
-
const
|
|
3619
|
+
const d = (await this.imapExec(e, [
|
|
3620
3620
|
`SELECT ${r}`,
|
|
3621
3621
|
`UID FETCH ${l.join(",")} (UID FLAGS ENVELOPE)`
|
|
3622
|
-
])).responses.find((
|
|
3623
|
-
if (!(
|
|
3624
|
-
throw new Error(`Failed to fetch details: ${(
|
|
3625
|
-
const
|
|
3626
|
-
for (const
|
|
3627
|
-
|
|
3628
|
-
const m = l.map((
|
|
3629
|
-
var
|
|
3630
|
-
const
|
|
3631
|
-
if (!
|
|
3632
|
-
const B = ((
|
|
3633
|
-
return { uid:
|
|
3622
|
+
])).responses.find((D) => D.command === "UID FETCH");
|
|
3623
|
+
if (!(d != null && d.ok) || !d.messages)
|
|
3624
|
+
throw new Error(`Failed to fetch details: ${(d == null ? void 0 : d.error) || "Unknown error"}`);
|
|
3625
|
+
const p = /* @__PURE__ */ new Map();
|
|
3626
|
+
for (const D of d.messages)
|
|
3627
|
+
D.uid && p.set(D.uid, D);
|
|
3628
|
+
const m = l.map((D) => {
|
|
3629
|
+
var U, g, k, y, q;
|
|
3630
|
+
const E = p.get(D);
|
|
3631
|
+
if (!E) return null;
|
|
3632
|
+
const B = ((U = E.flags) == null ? void 0 : U.some((O) => O.includes("Seen"))) || !1, M = ((k = (g = E.envelope) == null ? void 0 : g.from) == null ? void 0 : k.email) || "Unknown", L = ((y = E.envelope) == null ? void 0 : y.subject) || "(No subject)", C = ((q = E.envelope) == null ? void 0 : q.date) || "";
|
|
3633
|
+
return { uid: D, from: M, subject: L, date: C, seen: B };
|
|
3634
3634
|
}).filter(Boolean);
|
|
3635
3635
|
return {
|
|
3636
3636
|
account: { id: e, label: "", email: "" },
|
|
@@ -3648,43 +3648,55 @@ class cr {
|
|
|
3648
3648
|
folder: u
|
|
3649
3649
|
});
|
|
3650
3650
|
}
|
|
3651
|
+
/**
|
|
3652
|
+
* Get a specific attachment from an email
|
|
3653
|
+
* Returns base64-encoded content for download
|
|
3654
|
+
*/
|
|
3655
|
+
async getAttachment(e, r, u, s = "INBOX") {
|
|
3656
|
+
return this.callMail("get_attachment", {
|
|
3657
|
+
account_id: e,
|
|
3658
|
+
uid: r,
|
|
3659
|
+
attachment_index: u,
|
|
3660
|
+
folder: s
|
|
3661
|
+
});
|
|
3662
|
+
}
|
|
3651
3663
|
/**
|
|
3652
3664
|
* Get email with client-side parsing using postal-mime
|
|
3653
3665
|
* This handles CID embedded images by converting them to base64 data URIs
|
|
3654
3666
|
*/
|
|
3655
3667
|
async getEmailParsed(e, r, u = "INBOX") {
|
|
3656
|
-
var
|
|
3668
|
+
var E, B, M, L;
|
|
3657
3669
|
const n = (await this.imapExec(e, [
|
|
3658
3670
|
`SELECT "${u}"`,
|
|
3659
3671
|
`UID FETCH ${r} (FLAGS BODY[])`
|
|
3660
3672
|
])).responses.find((C) => C.command === "UID FETCH");
|
|
3661
|
-
if (!(n != null && n.ok) || !((
|
|
3673
|
+
if (!(n != null && n.ok) || !((E = n.messages) != null && E[0]))
|
|
3662
3674
|
return console.error("Failed to fetch raw email:", n == null ? void 0 : n.error), null;
|
|
3663
3675
|
const t = n.messages[0], i = t.body || t.raw;
|
|
3664
3676
|
if (!i)
|
|
3665
3677
|
return console.error("No raw email content in response"), null;
|
|
3666
|
-
const
|
|
3667
|
-
for (const C of
|
|
3678
|
+
const c = await new Le().parse(i), d = /* @__PURE__ */ new Map();
|
|
3679
|
+
for (const C of c.attachments || [])
|
|
3668
3680
|
if (C.contentId) {
|
|
3669
|
-
const
|
|
3670
|
-
|
|
3681
|
+
const U = this.contentToBase64(C.content), g = `data:${C.mimeType};base64,${U}`, k = C.contentId.replace(/^<|>$/g, "");
|
|
3682
|
+
d.set(k, g), d.set(`<${k}>`, g);
|
|
3671
3683
|
}
|
|
3672
|
-
let
|
|
3673
|
-
|
|
3674
|
-
const
|
|
3675
|
-
return
|
|
3684
|
+
let p = c.html || "";
|
|
3685
|
+
p && d.size > 0 && (p = p.replace(/src=["']cid:([^"']+)["']/gi, (C, U) => {
|
|
3686
|
+
const g = d.get(U) || d.get(`<${U}>`);
|
|
3687
|
+
return g ? `src="${g}"` : C;
|
|
3676
3688
|
}));
|
|
3677
|
-
const m = ((B = t.flags) == null ? void 0 : B.some((C) => C.toLowerCase().includes("seen"))) || !1,
|
|
3689
|
+
const m = ((B = t.flags) == null ? void 0 : B.some((C) => C.toLowerCase().includes("seen"))) || !1, D = ((M = c.from) == null ? void 0 : M.address) || ((L = c.from) == null ? void 0 : L.name) || "Unknown";
|
|
3678
3690
|
return {
|
|
3679
3691
|
uid: r,
|
|
3680
|
-
from:
|
|
3681
|
-
subject:
|
|
3682
|
-
date:
|
|
3683
|
-
body:
|
|
3684
|
-
html:
|
|
3685
|
-
text:
|
|
3692
|
+
from: D,
|
|
3693
|
+
subject: c.subject || "(No subject)",
|
|
3694
|
+
date: c.date || "",
|
|
3695
|
+
body: p || c.text || "",
|
|
3696
|
+
html: p,
|
|
3697
|
+
text: c.text || "",
|
|
3686
3698
|
seen: m,
|
|
3687
|
-
attachments: (
|
|
3699
|
+
attachments: (c.attachments || []).map((C) => ({
|
|
3688
3700
|
filename: C.filename || "attachment",
|
|
3689
3701
|
mimeType: C.mimeType || "application/octet-stream",
|
|
3690
3702
|
size: this.getContentSize(C.content)
|
|
@@ -3703,8 +3715,8 @@ class cr {
|
|
|
3703
3715
|
}
|
|
3704
3716
|
const r = e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
3705
3717
|
let u = "";
|
|
3706
|
-
for (let
|
|
3707
|
-
u += String.fromCharCode(r[
|
|
3718
|
+
for (let s = 0; s < r.byteLength; s++)
|
|
3719
|
+
u += String.fromCharCode(r[s]);
|
|
3708
3720
|
return btoa(u);
|
|
3709
3721
|
}
|
|
3710
3722
|
/**
|
|
@@ -3775,7 +3787,7 @@ class dr {
|
|
|
3775
3787
|
}
|
|
3776
3788
|
class fr {
|
|
3777
3789
|
constructor(e) {
|
|
3778
|
-
|
|
3790
|
+
ve(this, "config");
|
|
3779
3791
|
this.config = {
|
|
3780
3792
|
timeout: 3e4,
|
|
3781
3793
|
headers: {
|
|
@@ -3791,8 +3803,8 @@ class fr {
|
|
|
3791
3803
|
if (!e || Object.keys(e).length === 0)
|
|
3792
3804
|
return "";
|
|
3793
3805
|
const r = new URLSearchParams();
|
|
3794
|
-
Object.entries(e).forEach(([
|
|
3795
|
-
n != null && r.append(
|
|
3806
|
+
Object.entries(e).forEach(([s, n]) => {
|
|
3807
|
+
n != null && r.append(s, String(n));
|
|
3796
3808
|
});
|
|
3797
3809
|
const u = r.toString();
|
|
3798
3810
|
return u ? `?${u}` : "";
|
|
@@ -3803,32 +3815,32 @@ class fr {
|
|
|
3803
3815
|
async request(e, r = {}) {
|
|
3804
3816
|
const {
|
|
3805
3817
|
method: u = "GET",
|
|
3806
|
-
headers:
|
|
3818
|
+
headers: s = {},
|
|
3807
3819
|
body: n,
|
|
3808
3820
|
params: t
|
|
3809
3821
|
} = r, i = `${this.config.baseUrl}/${e}${this.buildQueryString(t)}`, l = {
|
|
3810
3822
|
...this.config.headers,
|
|
3811
3823
|
...dr.getAuthHeader(),
|
|
3812
|
-
...
|
|
3813
|
-
},
|
|
3824
|
+
...s
|
|
3825
|
+
}, c = {
|
|
3814
3826
|
method: u,
|
|
3815
3827
|
headers: l
|
|
3816
3828
|
};
|
|
3817
|
-
n && u !== "GET" && (
|
|
3829
|
+
n && u !== "GET" && (c.body = JSON.stringify(n));
|
|
3818
3830
|
try {
|
|
3819
|
-
const
|
|
3820
|
-
...
|
|
3821
|
-
signal:
|
|
3831
|
+
const d = new AbortController(), p = setTimeout(() => d.abort(), this.config.timeout), m = await fetch(i, {
|
|
3832
|
+
...c,
|
|
3833
|
+
signal: d.signal
|
|
3822
3834
|
});
|
|
3823
|
-
if (clearTimeout(
|
|
3824
|
-
const
|
|
3835
|
+
if (clearTimeout(p), !m.ok) {
|
|
3836
|
+
const D = await m.json().catch(() => ({
|
|
3825
3837
|
message: m.statusText
|
|
3826
3838
|
}));
|
|
3827
|
-
throw new Error(
|
|
3839
|
+
throw new Error(D.message || `HTTP ${m.status}`);
|
|
3828
3840
|
}
|
|
3829
3841
|
return await m.json();
|
|
3830
|
-
} catch (
|
|
3831
|
-
throw
|
|
3842
|
+
} catch (d) {
|
|
3843
|
+
throw d instanceof Error ? d : new Error("An unexpected error occurred");
|
|
3832
3844
|
}
|
|
3833
3845
|
}
|
|
3834
3846
|
/**
|
|
@@ -3875,7 +3887,7 @@ class fr {
|
|
|
3875
3887
|
}
|
|
3876
3888
|
}
|
|
3877
3889
|
let Oe = null;
|
|
3878
|
-
function
|
|
3890
|
+
function xr(o) {
|
|
3879
3891
|
return Oe = new fr(o), Oe;
|
|
3880
3892
|
}
|
|
3881
3893
|
function Ct() {
|
|
@@ -3886,76 +3898,76 @@ function Ct() {
|
|
|
3886
3898
|
function pr(o, e, r = {}) {
|
|
3887
3899
|
const {
|
|
3888
3900
|
enabled: u = !0,
|
|
3889
|
-
refetchOnMount:
|
|
3901
|
+
refetchOnMount: s = !0,
|
|
3890
3902
|
onSuccess: n,
|
|
3891
3903
|
onError: t
|
|
3892
|
-
} = r, [i, l] =
|
|
3904
|
+
} = r, [i, l] = P(null), [c, d] = P(u), [p, m] = P(null), D = H(async () => {
|
|
3893
3905
|
if (u) {
|
|
3894
|
-
|
|
3906
|
+
d(!0), m(null);
|
|
3895
3907
|
try {
|
|
3896
3908
|
const B = await Ct().get(o, e);
|
|
3897
3909
|
l(B), n == null || n(B);
|
|
3898
|
-
} catch (
|
|
3899
|
-
const B =
|
|
3910
|
+
} catch (E) {
|
|
3911
|
+
const B = E instanceof Error ? E : new Error("Unknown error");
|
|
3900
3912
|
m(B), t == null || t(B);
|
|
3901
3913
|
} finally {
|
|
3902
|
-
|
|
3914
|
+
d(!1);
|
|
3903
3915
|
}
|
|
3904
3916
|
}
|
|
3905
3917
|
}, [o, JSON.stringify(e), u, n, t]);
|
|
3906
3918
|
return pe(() => {
|
|
3907
|
-
|
|
3908
|
-
}, [
|
|
3919
|
+
s && D();
|
|
3920
|
+
}, [D, s]), {
|
|
3909
3921
|
data: i,
|
|
3910
|
-
loading:
|
|
3911
|
-
error:
|
|
3912
|
-
refetch:
|
|
3922
|
+
loading: c,
|
|
3923
|
+
error: p,
|
|
3924
|
+
refetch: D
|
|
3913
3925
|
};
|
|
3914
3926
|
}
|
|
3915
|
-
function
|
|
3916
|
-
const { onSuccess: u, onError:
|
|
3917
|
-
async (
|
|
3918
|
-
l(!0),
|
|
3927
|
+
function vr(o, e = "POST", r = {}) {
|
|
3928
|
+
const { onSuccess: u, onError: s } = r, [n, t] = P(null), [i, l] = P(!1), [c, d] = P(null), p = H(
|
|
3929
|
+
async (D) => {
|
|
3930
|
+
l(!0), d(null);
|
|
3919
3931
|
try {
|
|
3920
|
-
const
|
|
3932
|
+
const E = Ct();
|
|
3921
3933
|
let B;
|
|
3922
3934
|
switch (e) {
|
|
3923
3935
|
case "POST":
|
|
3924
|
-
B = await
|
|
3936
|
+
B = await E.post(o, D);
|
|
3925
3937
|
break;
|
|
3926
3938
|
case "PUT":
|
|
3927
|
-
B = await
|
|
3939
|
+
B = await E.put(o, D);
|
|
3928
3940
|
break;
|
|
3929
3941
|
case "PATCH":
|
|
3930
|
-
B = await
|
|
3942
|
+
B = await E.patch(o, D);
|
|
3931
3943
|
break;
|
|
3932
3944
|
case "DELETE":
|
|
3933
|
-
B = await
|
|
3945
|
+
B = await E.delete(o);
|
|
3934
3946
|
break;
|
|
3935
3947
|
default:
|
|
3936
3948
|
throw new Error(`Unsupported method: ${e}`);
|
|
3937
3949
|
}
|
|
3938
|
-
return t(B), u == null || u(B,
|
|
3939
|
-
} catch (
|
|
3940
|
-
const B =
|
|
3941
|
-
return
|
|
3950
|
+
return t(B), u == null || u(B, D), B;
|
|
3951
|
+
} catch (E) {
|
|
3952
|
+
const B = E instanceof Error ? E : new Error("Unknown error");
|
|
3953
|
+
return d(B), s == null || s(B, D), null;
|
|
3942
3954
|
} finally {
|
|
3943
3955
|
l(!1);
|
|
3944
3956
|
}
|
|
3945
3957
|
},
|
|
3946
|
-
[o, e, u,
|
|
3947
|
-
), m =
|
|
3948
|
-
t(null),
|
|
3958
|
+
[o, e, u, s]
|
|
3959
|
+
), m = H(() => {
|
|
3960
|
+
t(null), d(null), l(!1);
|
|
3949
3961
|
}, []);
|
|
3950
3962
|
return {
|
|
3951
3963
|
data: n,
|
|
3952
3964
|
loading: i,
|
|
3953
|
-
error:
|
|
3954
|
-
mutate:
|
|
3965
|
+
error: c,
|
|
3966
|
+
mutate: p,
|
|
3955
3967
|
reset: m
|
|
3956
3968
|
};
|
|
3957
3969
|
}
|
|
3958
|
-
var ut = { exports: {} },
|
|
3970
|
+
var ut = { exports: {} }, Ee = {};
|
|
3959
3971
|
/**
|
|
3960
3972
|
* @license React
|
|
3961
3973
|
* react-jsx-runtime.production.min.js
|
|
@@ -3965,19 +3977,19 @@ var ut = { exports: {} }, xe = {};
|
|
|
3965
3977
|
* This source code is licensed under the MIT license found in the
|
|
3966
3978
|
* LICENSE file in the root directory of this source tree.
|
|
3967
3979
|
*/
|
|
3968
|
-
var
|
|
3980
|
+
var yt;
|
|
3969
3981
|
function hr() {
|
|
3970
|
-
if (
|
|
3971
|
-
|
|
3972
|
-
var o =
|
|
3973
|
-
function t(i, l,
|
|
3974
|
-
var
|
|
3975
|
-
|
|
3976
|
-
for (
|
|
3977
|
-
if (i && i.defaultProps) for (
|
|
3978
|
-
return { $$typeof: e, type: i, key: m, ref:
|
|
3982
|
+
if (yt) return Ee;
|
|
3983
|
+
yt = 1;
|
|
3984
|
+
var o = st, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, s = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
3985
|
+
function t(i, l, c) {
|
|
3986
|
+
var d, p = {}, m = null, D = null;
|
|
3987
|
+
c !== void 0 && (m = "" + c), l.key !== void 0 && (m = "" + l.key), l.ref !== void 0 && (D = l.ref);
|
|
3988
|
+
for (d in l) u.call(l, d) && !n.hasOwnProperty(d) && (p[d] = l[d]);
|
|
3989
|
+
if (i && i.defaultProps) for (d in l = i.defaultProps, l) p[d] === void 0 && (p[d] = l[d]);
|
|
3990
|
+
return { $$typeof: e, type: i, key: m, ref: D, props: p, _owner: s.current };
|
|
3979
3991
|
}
|
|
3980
|
-
return
|
|
3992
|
+
return Ee.Fragment = r, Ee.jsx = t, Ee.jsxs = t, Ee;
|
|
3981
3993
|
}
|
|
3982
3994
|
var we = {};
|
|
3983
3995
|
/**
|
|
@@ -3989,91 +4001,91 @@ var we = {};
|
|
|
3989
4001
|
* This source code is licensed under the MIT license found in the
|
|
3990
4002
|
* LICENSE file in the root directory of this source tree.
|
|
3991
4003
|
*/
|
|
3992
|
-
var
|
|
4004
|
+
var xt;
|
|
3993
4005
|
function gr() {
|
|
3994
|
-
return
|
|
3995
|
-
var o =
|
|
3996
|
-
function
|
|
3997
|
-
if (
|
|
4006
|
+
return xt || (xt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
4007
|
+
var o = st, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), n = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), i = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), E = Symbol.iterator, B = "@@iterator";
|
|
4008
|
+
function M(a) {
|
|
4009
|
+
if (a === null || typeof a != "object")
|
|
3998
4010
|
return null;
|
|
3999
|
-
var
|
|
4000
|
-
return typeof
|
|
4011
|
+
var h = E && a[E] || a[B];
|
|
4012
|
+
return typeof h == "function" ? h : null;
|
|
4001
4013
|
}
|
|
4002
|
-
var
|
|
4003
|
-
function C(
|
|
4014
|
+
var L = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
4015
|
+
function C(a) {
|
|
4004
4016
|
{
|
|
4005
|
-
for (var
|
|
4006
|
-
|
|
4007
|
-
|
|
4017
|
+
for (var h = arguments.length, A = new Array(h > 1 ? h - 1 : 0), v = 1; v < h; v++)
|
|
4018
|
+
A[v - 1] = arguments[v];
|
|
4019
|
+
U("error", a, A);
|
|
4008
4020
|
}
|
|
4009
4021
|
}
|
|
4010
|
-
function
|
|
4022
|
+
function U(a, h, A) {
|
|
4011
4023
|
{
|
|
4012
|
-
var
|
|
4013
|
-
|
|
4014
|
-
var
|
|
4015
|
-
return String(
|
|
4024
|
+
var v = L.ReactDebugCurrentFrame, _ = v.getStackAddendum();
|
|
4025
|
+
_ !== "" && (h += "%s", A = A.concat([_]));
|
|
4026
|
+
var R = A.map(function(j) {
|
|
4027
|
+
return String(j);
|
|
4016
4028
|
});
|
|
4017
|
-
|
|
4029
|
+
R.unshift("Warning: " + h), Function.prototype.apply.call(console[a], console, R);
|
|
4018
4030
|
}
|
|
4019
4031
|
}
|
|
4020
|
-
var
|
|
4021
|
-
|
|
4022
|
-
function
|
|
4023
|
-
return !!(typeof
|
|
4032
|
+
var g = !1, k = !1, y = !1, q = !1, O = !1, F;
|
|
4033
|
+
F = Symbol.for("react.module.reference");
|
|
4034
|
+
function N(a) {
|
|
4035
|
+
return !!(typeof a == "string" || typeof a == "function" || a === u || a === n || O || a === s || a === c || a === d || q || a === D || g || k || y || typeof a == "object" && a !== null && (a.$$typeof === m || a.$$typeof === p || a.$$typeof === t || a.$$typeof === i || a.$$typeof === l || // This needs to include all possible module reference object
|
|
4024
4036
|
// types supported by any Flight configuration anywhere since
|
|
4025
4037
|
// we don't know which Flight build this will end up being used
|
|
4026
4038
|
// with.
|
|
4027
|
-
|
|
4039
|
+
a.$$typeof === F || a.getModuleId !== void 0));
|
|
4028
4040
|
}
|
|
4029
|
-
function
|
|
4030
|
-
var
|
|
4031
|
-
if (
|
|
4032
|
-
return
|
|
4033
|
-
var
|
|
4034
|
-
return
|
|
4041
|
+
function x(a, h, A) {
|
|
4042
|
+
var v = a.displayName;
|
|
4043
|
+
if (v)
|
|
4044
|
+
return v;
|
|
4045
|
+
var _ = h.displayName || h.name || "";
|
|
4046
|
+
return _ !== "" ? A + "(" + _ + ")" : A;
|
|
4035
4047
|
}
|
|
4036
|
-
function
|
|
4037
|
-
return
|
|
4048
|
+
function V(a) {
|
|
4049
|
+
return a.displayName || "Context";
|
|
4038
4050
|
}
|
|
4039
|
-
function
|
|
4040
|
-
if (
|
|
4051
|
+
function z(a) {
|
|
4052
|
+
if (a == null)
|
|
4041
4053
|
return null;
|
|
4042
|
-
if (typeof
|
|
4043
|
-
return
|
|
4044
|
-
if (typeof
|
|
4045
|
-
return
|
|
4046
|
-
switch (
|
|
4054
|
+
if (typeof a.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof a == "function")
|
|
4055
|
+
return a.displayName || a.name || null;
|
|
4056
|
+
if (typeof a == "string")
|
|
4057
|
+
return a;
|
|
4058
|
+
switch (a) {
|
|
4047
4059
|
case u:
|
|
4048
4060
|
return "Fragment";
|
|
4049
4061
|
case r:
|
|
4050
4062
|
return "Portal";
|
|
4051
4063
|
case n:
|
|
4052
4064
|
return "Profiler";
|
|
4053
|
-
case
|
|
4065
|
+
case s:
|
|
4054
4066
|
return "StrictMode";
|
|
4055
|
-
case d:
|
|
4056
|
-
return "Suspense";
|
|
4057
4067
|
case c:
|
|
4068
|
+
return "Suspense";
|
|
4069
|
+
case d:
|
|
4058
4070
|
return "SuspenseList";
|
|
4059
4071
|
}
|
|
4060
|
-
if (typeof
|
|
4061
|
-
switch (
|
|
4072
|
+
if (typeof a == "object")
|
|
4073
|
+
switch (a.$$typeof) {
|
|
4062
4074
|
case i:
|
|
4063
|
-
var
|
|
4064
|
-
return
|
|
4075
|
+
var h = a;
|
|
4076
|
+
return V(h) + ".Consumer";
|
|
4065
4077
|
case t:
|
|
4066
|
-
var
|
|
4067
|
-
return
|
|
4078
|
+
var A = a;
|
|
4079
|
+
return V(A._context) + ".Provider";
|
|
4068
4080
|
case l:
|
|
4069
|
-
return
|
|
4070
|
-
case
|
|
4071
|
-
var
|
|
4072
|
-
return
|
|
4081
|
+
return x(a, a.render, "ForwardRef");
|
|
4082
|
+
case p:
|
|
4083
|
+
var v = a.displayName || null;
|
|
4084
|
+
return v !== null ? v : z(a.type) || "Memo";
|
|
4073
4085
|
case m: {
|
|
4074
|
-
var
|
|
4086
|
+
var _ = a, R = _._payload, j = _._init;
|
|
4075
4087
|
try {
|
|
4076
|
-
return
|
|
4088
|
+
return z(j(R));
|
|
4077
4089
|
} catch {
|
|
4078
4090
|
return null;
|
|
4079
4091
|
}
|
|
@@ -4081,80 +4093,80 @@ function gr() {
|
|
|
4081
4093
|
}
|
|
4082
4094
|
return null;
|
|
4083
4095
|
}
|
|
4084
|
-
var
|
|
4096
|
+
var S = Object.assign, G = 0, K, ge, me, Te, De, W, re;
|
|
4085
4097
|
function ne() {
|
|
4086
4098
|
}
|
|
4087
4099
|
ne.__reactDisabledLog = !0;
|
|
4088
4100
|
function Ue() {
|
|
4089
4101
|
{
|
|
4090
|
-
if (
|
|
4091
|
-
K = console.log, ge = console.info, me = console.warn, Te = console.error, De = console.group,
|
|
4092
|
-
var
|
|
4102
|
+
if (G === 0) {
|
|
4103
|
+
K = console.log, ge = console.info, me = console.warn, Te = console.error, De = console.group, W = console.groupCollapsed, re = console.groupEnd;
|
|
4104
|
+
var a = {
|
|
4093
4105
|
configurable: !0,
|
|
4094
4106
|
enumerable: !0,
|
|
4095
4107
|
value: ne,
|
|
4096
4108
|
writable: !0
|
|
4097
4109
|
};
|
|
4098
4110
|
Object.defineProperties(console, {
|
|
4099
|
-
info:
|
|
4100
|
-
log:
|
|
4101
|
-
warn:
|
|
4102
|
-
error:
|
|
4103
|
-
group:
|
|
4104
|
-
groupCollapsed:
|
|
4105
|
-
groupEnd:
|
|
4111
|
+
info: a,
|
|
4112
|
+
log: a,
|
|
4113
|
+
warn: a,
|
|
4114
|
+
error: a,
|
|
4115
|
+
group: a,
|
|
4116
|
+
groupCollapsed: a,
|
|
4117
|
+
groupEnd: a
|
|
4106
4118
|
});
|
|
4107
4119
|
}
|
|
4108
|
-
|
|
4120
|
+
G++;
|
|
4109
4121
|
}
|
|
4110
4122
|
}
|
|
4111
4123
|
function Ie() {
|
|
4112
4124
|
{
|
|
4113
|
-
if (
|
|
4114
|
-
var
|
|
4125
|
+
if (G--, G === 0) {
|
|
4126
|
+
var a = {
|
|
4115
4127
|
configurable: !0,
|
|
4116
4128
|
enumerable: !0,
|
|
4117
4129
|
writable: !0
|
|
4118
4130
|
};
|
|
4119
4131
|
Object.defineProperties(console, {
|
|
4120
|
-
log:
|
|
4132
|
+
log: S({}, a, {
|
|
4121
4133
|
value: K
|
|
4122
4134
|
}),
|
|
4123
|
-
info:
|
|
4135
|
+
info: S({}, a, {
|
|
4124
4136
|
value: ge
|
|
4125
4137
|
}),
|
|
4126
|
-
warn:
|
|
4138
|
+
warn: S({}, a, {
|
|
4127
4139
|
value: me
|
|
4128
4140
|
}),
|
|
4129
|
-
error:
|
|
4141
|
+
error: S({}, a, {
|
|
4130
4142
|
value: Te
|
|
4131
4143
|
}),
|
|
4132
|
-
group:
|
|
4144
|
+
group: S({}, a, {
|
|
4133
4145
|
value: De
|
|
4134
4146
|
}),
|
|
4135
|
-
groupCollapsed:
|
|
4136
|
-
value:
|
|
4147
|
+
groupCollapsed: S({}, a, {
|
|
4148
|
+
value: W
|
|
4137
4149
|
}),
|
|
4138
|
-
groupEnd:
|
|
4150
|
+
groupEnd: S({}, a, {
|
|
4139
4151
|
value: re
|
|
4140
4152
|
})
|
|
4141
4153
|
});
|
|
4142
4154
|
}
|
|
4143
|
-
|
|
4155
|
+
G < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
4144
4156
|
}
|
|
4145
4157
|
}
|
|
4146
|
-
var Ae =
|
|
4147
|
-
function ie(
|
|
4158
|
+
var Ae = L.ReactCurrentDispatcher, be;
|
|
4159
|
+
function ie(a, h, A) {
|
|
4148
4160
|
{
|
|
4149
4161
|
if (be === void 0)
|
|
4150
4162
|
try {
|
|
4151
4163
|
throw Error();
|
|
4152
|
-
} catch (
|
|
4153
|
-
var
|
|
4154
|
-
be =
|
|
4164
|
+
} catch (_) {
|
|
4165
|
+
var v = _.stack.trim().match(/\n( *(at )?)/);
|
|
4166
|
+
be = v && v[1] || "";
|
|
4155
4167
|
}
|
|
4156
4168
|
return `
|
|
4157
|
-
` + be +
|
|
4169
|
+
` + be + a;
|
|
4158
4170
|
}
|
|
4159
4171
|
}
|
|
4160
4172
|
var ye = !1, oe;
|
|
@@ -4162,418 +4174,418 @@ function gr() {
|
|
|
4162
4174
|
var $e = typeof WeakMap == "function" ? WeakMap : Map;
|
|
4163
4175
|
oe = new $e();
|
|
4164
4176
|
}
|
|
4165
|
-
function Se(
|
|
4166
|
-
if (!
|
|
4177
|
+
function Se(a, h) {
|
|
4178
|
+
if (!a || ye)
|
|
4167
4179
|
return "";
|
|
4168
4180
|
{
|
|
4169
|
-
var
|
|
4170
|
-
if (
|
|
4171
|
-
return
|
|
4181
|
+
var A = oe.get(a);
|
|
4182
|
+
if (A !== void 0)
|
|
4183
|
+
return A;
|
|
4172
4184
|
}
|
|
4173
|
-
var
|
|
4185
|
+
var v;
|
|
4174
4186
|
ye = !0;
|
|
4175
|
-
var
|
|
4187
|
+
var _ = Error.prepareStackTrace;
|
|
4176
4188
|
Error.prepareStackTrace = void 0;
|
|
4177
|
-
var
|
|
4178
|
-
|
|
4189
|
+
var R;
|
|
4190
|
+
R = Ae.current, Ae.current = null, Ue();
|
|
4179
4191
|
try {
|
|
4180
|
-
if (
|
|
4181
|
-
var
|
|
4192
|
+
if (h) {
|
|
4193
|
+
var j = function() {
|
|
4182
4194
|
throw Error();
|
|
4183
4195
|
};
|
|
4184
|
-
if (Object.defineProperty(
|
|
4196
|
+
if (Object.defineProperty(j.prototype, "props", {
|
|
4185
4197
|
set: function() {
|
|
4186
4198
|
throw Error();
|
|
4187
4199
|
}
|
|
4188
4200
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
4189
4201
|
try {
|
|
4190
|
-
Reflect.construct(
|
|
4191
|
-
} catch (
|
|
4192
|
-
|
|
4202
|
+
Reflect.construct(j, []);
|
|
4203
|
+
} catch (Y) {
|
|
4204
|
+
v = Y;
|
|
4193
4205
|
}
|
|
4194
|
-
Reflect.construct(
|
|
4206
|
+
Reflect.construct(a, [], j);
|
|
4195
4207
|
} else {
|
|
4196
4208
|
try {
|
|
4197
|
-
|
|
4198
|
-
} catch (
|
|
4199
|
-
|
|
4209
|
+
j.call();
|
|
4210
|
+
} catch (Y) {
|
|
4211
|
+
v = Y;
|
|
4200
4212
|
}
|
|
4201
|
-
|
|
4213
|
+
a.call(j.prototype);
|
|
4202
4214
|
}
|
|
4203
4215
|
} else {
|
|
4204
4216
|
try {
|
|
4205
4217
|
throw Error();
|
|
4206
|
-
} catch (
|
|
4207
|
-
|
|
4218
|
+
} catch (Y) {
|
|
4219
|
+
v = Y;
|
|
4208
4220
|
}
|
|
4209
|
-
|
|
4221
|
+
a();
|
|
4210
4222
|
}
|
|
4211
|
-
} catch (
|
|
4212
|
-
if (
|
|
4213
|
-
for (var
|
|
4214
|
-
`),
|
|
4215
|
-
`),
|
|
4223
|
+
} catch (Y) {
|
|
4224
|
+
if (Y && v && typeof Y.stack == "string") {
|
|
4225
|
+
for (var T = Y.stack.split(`
|
|
4226
|
+
`), Q = v.stack.split(`
|
|
4227
|
+
`), I = T.length - 1, $ = Q.length - 1; I >= 1 && $ >= 0 && T[I] !== Q[$]; )
|
|
4216
4228
|
$--;
|
|
4217
|
-
for (;
|
|
4218
|
-
if (
|
|
4219
|
-
if (
|
|
4229
|
+
for (; I >= 1 && $ >= 0; I--, $--)
|
|
4230
|
+
if (T[I] !== Q[$]) {
|
|
4231
|
+
if (I !== 1 || $ !== 1)
|
|
4220
4232
|
do
|
|
4221
|
-
if (
|
|
4233
|
+
if (I--, $--, $ < 0 || T[I] !== Q[$]) {
|
|
4222
4234
|
var Z = `
|
|
4223
|
-
` +
|
|
4224
|
-
return
|
|
4235
|
+
` + T[I].replace(" at new ", " at ");
|
|
4236
|
+
return a.displayName && Z.includes("<anonymous>") && (Z = Z.replace("<anonymous>", a.displayName)), typeof a == "function" && oe.set(a, Z), Z;
|
|
4225
4237
|
}
|
|
4226
|
-
while (
|
|
4238
|
+
while (I >= 1 && $ >= 0);
|
|
4227
4239
|
break;
|
|
4228
4240
|
}
|
|
4229
4241
|
}
|
|
4230
4242
|
} finally {
|
|
4231
|
-
ye = !1, Ae.current =
|
|
4243
|
+
ye = !1, Ae.current = R, Ie(), Error.prepareStackTrace = _;
|
|
4232
4244
|
}
|
|
4233
|
-
var fe =
|
|
4234
|
-
return typeof
|
|
4245
|
+
var fe = a ? a.displayName || a.name : "", se = fe ? ie(fe) : "";
|
|
4246
|
+
return typeof a == "function" && oe.set(a, se), se;
|
|
4235
4247
|
}
|
|
4236
|
-
function Me(
|
|
4237
|
-
return Se(
|
|
4248
|
+
function Me(a, h, A) {
|
|
4249
|
+
return Se(a, !1);
|
|
4238
4250
|
}
|
|
4239
|
-
function ze(
|
|
4240
|
-
var
|
|
4241
|
-
return !!(
|
|
4251
|
+
function ze(a) {
|
|
4252
|
+
var h = a.prototype;
|
|
4253
|
+
return !!(h && h.isReactComponent);
|
|
4242
4254
|
}
|
|
4243
|
-
function le(
|
|
4244
|
-
if (
|
|
4255
|
+
function le(a, h, A) {
|
|
4256
|
+
if (a == null)
|
|
4245
4257
|
return "";
|
|
4246
|
-
if (typeof
|
|
4247
|
-
return Se(
|
|
4248
|
-
if (typeof
|
|
4249
|
-
return ie(
|
|
4250
|
-
switch (
|
|
4251
|
-
case d:
|
|
4252
|
-
return ie("Suspense");
|
|
4258
|
+
if (typeof a == "function")
|
|
4259
|
+
return Se(a, ze(a));
|
|
4260
|
+
if (typeof a == "string")
|
|
4261
|
+
return ie(a);
|
|
4262
|
+
switch (a) {
|
|
4253
4263
|
case c:
|
|
4264
|
+
return ie("Suspense");
|
|
4265
|
+
case d:
|
|
4254
4266
|
return ie("SuspenseList");
|
|
4255
4267
|
}
|
|
4256
|
-
if (typeof
|
|
4257
|
-
switch (
|
|
4268
|
+
if (typeof a == "object")
|
|
4269
|
+
switch (a.$$typeof) {
|
|
4258
4270
|
case l:
|
|
4259
|
-
return Me(
|
|
4260
|
-
case
|
|
4261
|
-
return le(
|
|
4271
|
+
return Me(a.render);
|
|
4272
|
+
case p:
|
|
4273
|
+
return le(a.type, h, A);
|
|
4262
4274
|
case m: {
|
|
4263
|
-
var
|
|
4275
|
+
var v = a, _ = v._payload, R = v._init;
|
|
4264
4276
|
try {
|
|
4265
|
-
return le(_
|
|
4277
|
+
return le(R(_), h, A);
|
|
4266
4278
|
} catch {
|
|
4267
4279
|
}
|
|
4268
4280
|
}
|
|
4269
4281
|
}
|
|
4270
4282
|
return "";
|
|
4271
4283
|
}
|
|
4272
|
-
var ue = Object.prototype.hasOwnProperty,
|
|
4273
|
-
function ce(
|
|
4274
|
-
if (
|
|
4275
|
-
var
|
|
4276
|
-
|
|
4284
|
+
var ue = Object.prototype.hasOwnProperty, je = {}, qe = L.ReactDebugCurrentFrame;
|
|
4285
|
+
function ce(a) {
|
|
4286
|
+
if (a) {
|
|
4287
|
+
var h = a._owner, A = le(a.type, a._source, h ? h.type : null);
|
|
4288
|
+
qe.setExtraStackFrame(A);
|
|
4277
4289
|
} else
|
|
4278
|
-
|
|
4290
|
+
qe.setExtraStackFrame(null);
|
|
4279
4291
|
}
|
|
4280
|
-
function Ge(
|
|
4292
|
+
function Ge(a, h, A, v, _) {
|
|
4281
4293
|
{
|
|
4282
|
-
var
|
|
4283
|
-
for (var
|
|
4284
|
-
if (
|
|
4285
|
-
var
|
|
4294
|
+
var R = Function.call.bind(ue);
|
|
4295
|
+
for (var j in a)
|
|
4296
|
+
if (R(a, j)) {
|
|
4297
|
+
var T = void 0;
|
|
4286
4298
|
try {
|
|
4287
|
-
if (typeof
|
|
4288
|
-
var
|
|
4289
|
-
throw
|
|
4299
|
+
if (typeof a[j] != "function") {
|
|
4300
|
+
var Q = Error((v || "React class") + ": " + A + " type `" + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[j] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
4301
|
+
throw Q.name = "Invariant Violation", Q;
|
|
4290
4302
|
}
|
|
4291
|
-
|
|
4292
|
-
} catch (
|
|
4293
|
-
|
|
4303
|
+
T = a[j](h, j, v, A, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
4304
|
+
} catch (I) {
|
|
4305
|
+
T = I;
|
|
4294
4306
|
}
|
|
4295
|
-
|
|
4307
|
+
T && !(T instanceof Error) && (ce(_), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", A, j, typeof T), ce(null)), T instanceof Error && !(T.message in je) && (je[T.message] = !0, ce(_), C("Failed %s type: %s", A, T.message), ce(null));
|
|
4296
4308
|
}
|
|
4297
4309
|
}
|
|
4298
4310
|
}
|
|
4299
4311
|
var He = Array.isArray;
|
|
4300
|
-
function
|
|
4301
|
-
return He(
|
|
4312
|
+
function b(a) {
|
|
4313
|
+
return He(a);
|
|
4302
4314
|
}
|
|
4303
|
-
function
|
|
4315
|
+
function w(a) {
|
|
4304
4316
|
{
|
|
4305
|
-
var
|
|
4306
|
-
return
|
|
4317
|
+
var h = typeof Symbol == "function" && Symbol.toStringTag, A = h && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
4318
|
+
return A;
|
|
4307
4319
|
}
|
|
4308
4320
|
}
|
|
4309
|
-
function J(
|
|
4321
|
+
function J(a) {
|
|
4310
4322
|
try {
|
|
4311
|
-
return X(
|
|
4323
|
+
return X(a), !1;
|
|
4312
4324
|
} catch {
|
|
4313
4325
|
return !0;
|
|
4314
4326
|
}
|
|
4315
4327
|
}
|
|
4316
|
-
function X(
|
|
4317
|
-
return "" +
|
|
4328
|
+
function X(a) {
|
|
4329
|
+
return "" + a;
|
|
4318
4330
|
}
|
|
4319
|
-
function te(
|
|
4320
|
-
if (J(
|
|
4321
|
-
return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
4331
|
+
function te(a) {
|
|
4332
|
+
if (J(a))
|
|
4333
|
+
return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", w(a)), X(a);
|
|
4322
4334
|
}
|
|
4323
|
-
var ee =
|
|
4335
|
+
var ee = L.ReactCurrentOwner, Ve = {
|
|
4324
4336
|
key: !0,
|
|
4325
4337
|
ref: !0,
|
|
4326
4338
|
__self: !0,
|
|
4327
4339
|
__source: !0
|
|
4328
|
-
},
|
|
4329
|
-
function Bt(
|
|
4330
|
-
if (ue.call(
|
|
4331
|
-
var
|
|
4332
|
-
if (
|
|
4340
|
+
}, xe, Ne;
|
|
4341
|
+
function Bt(a) {
|
|
4342
|
+
if (ue.call(a, "ref")) {
|
|
4343
|
+
var h = Object.getOwnPropertyDescriptor(a, "ref").get;
|
|
4344
|
+
if (h && h.isReactWarning)
|
|
4333
4345
|
return !1;
|
|
4334
4346
|
}
|
|
4335
|
-
return
|
|
4347
|
+
return a.ref !== void 0;
|
|
4336
4348
|
}
|
|
4337
|
-
function kt(
|
|
4338
|
-
if (ue.call(
|
|
4339
|
-
var
|
|
4340
|
-
if (
|
|
4349
|
+
function kt(a) {
|
|
4350
|
+
if (ue.call(a, "key")) {
|
|
4351
|
+
var h = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
4352
|
+
if (h && h.isReactWarning)
|
|
4341
4353
|
return !1;
|
|
4342
4354
|
}
|
|
4343
|
-
return
|
|
4355
|
+
return a.key !== void 0;
|
|
4344
4356
|
}
|
|
4345
|
-
function Ft(
|
|
4346
|
-
typeof
|
|
4357
|
+
function Ft(a, h) {
|
|
4358
|
+
typeof a.ref == "string" && ee.current;
|
|
4347
4359
|
}
|
|
4348
|
-
function Tt(
|
|
4360
|
+
function Tt(a, h) {
|
|
4349
4361
|
{
|
|
4350
|
-
var
|
|
4351
|
-
|
|
4362
|
+
var A = function() {
|
|
4363
|
+
xe || (xe = !0, C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
|
|
4352
4364
|
};
|
|
4353
|
-
|
|
4354
|
-
get:
|
|
4365
|
+
A.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
4366
|
+
get: A,
|
|
4355
4367
|
configurable: !0
|
|
4356
4368
|
});
|
|
4357
4369
|
}
|
|
4358
4370
|
}
|
|
4359
|
-
function St(
|
|
4371
|
+
function St(a, h) {
|
|
4360
4372
|
{
|
|
4361
|
-
var
|
|
4362
|
-
|
|
4373
|
+
var A = function() {
|
|
4374
|
+
Ne || (Ne = !0, C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
|
|
4363
4375
|
};
|
|
4364
|
-
|
|
4365
|
-
get:
|
|
4376
|
+
A.isReactWarning = !0, Object.defineProperty(a, "ref", {
|
|
4377
|
+
get: A,
|
|
4366
4378
|
configurable: !0
|
|
4367
4379
|
});
|
|
4368
4380
|
}
|
|
4369
4381
|
}
|
|
4370
|
-
var
|
|
4371
|
-
var
|
|
4382
|
+
var jt = function(a, h, A, v, _, R, j) {
|
|
4383
|
+
var T = {
|
|
4372
4384
|
// This tag allows us to uniquely identify this as a React Element
|
|
4373
4385
|
$$typeof: e,
|
|
4374
4386
|
// Built-in properties that belong on the element
|
|
4375
|
-
type:
|
|
4376
|
-
key:
|
|
4377
|
-
ref:
|
|
4378
|
-
props:
|
|
4387
|
+
type: a,
|
|
4388
|
+
key: h,
|
|
4389
|
+
ref: A,
|
|
4390
|
+
props: j,
|
|
4379
4391
|
// Record the component responsible for creating this element.
|
|
4380
|
-
_owner:
|
|
4392
|
+
_owner: R
|
|
4381
4393
|
};
|
|
4382
|
-
return
|
|
4394
|
+
return T._store = {}, Object.defineProperty(T._store, "validated", {
|
|
4383
4395
|
configurable: !1,
|
|
4384
4396
|
enumerable: !1,
|
|
4385
4397
|
writable: !0,
|
|
4386
4398
|
value: !1
|
|
4387
|
-
}), Object.defineProperty(
|
|
4399
|
+
}), Object.defineProperty(T, "_self", {
|
|
4388
4400
|
configurable: !1,
|
|
4389
4401
|
enumerable: !1,
|
|
4390
4402
|
writable: !1,
|
|
4391
|
-
value:
|
|
4392
|
-
}), Object.defineProperty(
|
|
4403
|
+
value: v
|
|
4404
|
+
}), Object.defineProperty(T, "_source", {
|
|
4393
4405
|
configurable: !1,
|
|
4394
4406
|
enumerable: !1,
|
|
4395
4407
|
writable: !1,
|
|
4396
|
-
value:
|
|
4397
|
-
}), Object.freeze && (Object.freeze(
|
|
4408
|
+
value: _
|
|
4409
|
+
}), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
|
|
4398
4410
|
};
|
|
4399
|
-
function
|
|
4411
|
+
function qt(a, h, A, v, _) {
|
|
4400
4412
|
{
|
|
4401
|
-
var
|
|
4402
|
-
|
|
4403
|
-
for (
|
|
4404
|
-
ue.call(
|
|
4405
|
-
if (
|
|
4406
|
-
var
|
|
4407
|
-
for (
|
|
4408
|
-
|
|
4413
|
+
var R, j = {}, T = null, Q = null;
|
|
4414
|
+
A !== void 0 && (te(A), T = "" + A), kt(h) && (te(h.key), T = "" + h.key), Bt(h) && (Q = h.ref, Ft(h, _));
|
|
4415
|
+
for (R in h)
|
|
4416
|
+
ue.call(h, R) && !Ve.hasOwnProperty(R) && (j[R] = h[R]);
|
|
4417
|
+
if (a && a.defaultProps) {
|
|
4418
|
+
var I = a.defaultProps;
|
|
4419
|
+
for (R in I)
|
|
4420
|
+
j[R] === void 0 && (j[R] = I[R]);
|
|
4409
4421
|
}
|
|
4410
|
-
if (
|
|
4411
|
-
var $ = typeof
|
|
4412
|
-
|
|
4422
|
+
if (T || Q) {
|
|
4423
|
+
var $ = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
|
|
4424
|
+
T && Tt(j, $), Q && St(j, $);
|
|
4413
4425
|
}
|
|
4414
|
-
return
|
|
4426
|
+
return jt(a, T, Q, _, v, ee.current, j);
|
|
4415
4427
|
}
|
|
4416
4428
|
}
|
|
4417
|
-
var We =
|
|
4418
|
-
function de(
|
|
4419
|
-
if (
|
|
4420
|
-
var
|
|
4421
|
-
at.setExtraStackFrame(
|
|
4429
|
+
var We = L.ReactCurrentOwner, at = L.ReactDebugCurrentFrame;
|
|
4430
|
+
function de(a) {
|
|
4431
|
+
if (a) {
|
|
4432
|
+
var h = a._owner, A = le(a.type, a._source, h ? h.type : null);
|
|
4433
|
+
at.setExtraStackFrame(A);
|
|
4422
4434
|
} else
|
|
4423
4435
|
at.setExtraStackFrame(null);
|
|
4424
4436
|
}
|
|
4425
4437
|
var Qe;
|
|
4426
4438
|
Qe = !1;
|
|
4427
|
-
function Ye(
|
|
4428
|
-
return typeof
|
|
4439
|
+
function Ye(a) {
|
|
4440
|
+
return typeof a == "object" && a !== null && a.$$typeof === e;
|
|
4429
4441
|
}
|
|
4430
|
-
function
|
|
4442
|
+
function nt() {
|
|
4431
4443
|
{
|
|
4432
4444
|
if (We.current) {
|
|
4433
|
-
var
|
|
4434
|
-
if (
|
|
4445
|
+
var a = z(We.current.type);
|
|
4446
|
+
if (a)
|
|
4435
4447
|
return `
|
|
4436
4448
|
|
|
4437
|
-
Check the render method of \`` +
|
|
4449
|
+
Check the render method of \`` + a + "`.";
|
|
4438
4450
|
}
|
|
4439
4451
|
return "";
|
|
4440
4452
|
}
|
|
4441
4453
|
}
|
|
4442
|
-
function
|
|
4454
|
+
function Nt(a) {
|
|
4443
4455
|
return "";
|
|
4444
4456
|
}
|
|
4445
|
-
var
|
|
4446
|
-
function _t(
|
|
4457
|
+
var it = {};
|
|
4458
|
+
function _t(a) {
|
|
4447
4459
|
{
|
|
4448
|
-
var
|
|
4449
|
-
if (!
|
|
4450
|
-
var
|
|
4451
|
-
|
|
4460
|
+
var h = nt();
|
|
4461
|
+
if (!h) {
|
|
4462
|
+
var A = typeof a == "string" ? a : a.displayName || a.name;
|
|
4463
|
+
A && (h = `
|
|
4452
4464
|
|
|
4453
|
-
Check the top-level render call using <` +
|
|
4465
|
+
Check the top-level render call using <` + A + ">.");
|
|
4454
4466
|
}
|
|
4455
|
-
return
|
|
4467
|
+
return h;
|
|
4456
4468
|
}
|
|
4457
4469
|
}
|
|
4458
|
-
function
|
|
4470
|
+
function ot(a, h) {
|
|
4459
4471
|
{
|
|
4460
|
-
if (!
|
|
4472
|
+
if (!a._store || a._store.validated || a.key != null)
|
|
4461
4473
|
return;
|
|
4462
|
-
|
|
4463
|
-
var
|
|
4464
|
-
if (
|
|
4474
|
+
a._store.validated = !0;
|
|
4475
|
+
var A = _t(h);
|
|
4476
|
+
if (it[A])
|
|
4465
4477
|
return;
|
|
4466
|
-
|
|
4467
|
-
var
|
|
4468
|
-
|
|
4478
|
+
it[A] = !0;
|
|
4479
|
+
var v = "";
|
|
4480
|
+
a && a._owner && a._owner !== We.current && (v = " It was passed a child from " + z(a._owner.type) + "."), de(a), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', A, v), de(null);
|
|
4469
4481
|
}
|
|
4470
4482
|
}
|
|
4471
|
-
function
|
|
4483
|
+
function lt(a, h) {
|
|
4472
4484
|
{
|
|
4473
|
-
if (typeof
|
|
4485
|
+
if (typeof a != "object")
|
|
4474
4486
|
return;
|
|
4475
|
-
if (
|
|
4476
|
-
for (var
|
|
4477
|
-
var
|
|
4478
|
-
Ye(
|
|
4487
|
+
if (b(a))
|
|
4488
|
+
for (var A = 0; A < a.length; A++) {
|
|
4489
|
+
var v = a[A];
|
|
4490
|
+
Ye(v) && ot(v, h);
|
|
4479
4491
|
}
|
|
4480
|
-
else if (Ye(
|
|
4481
|
-
|
|
4482
|
-
else if (
|
|
4483
|
-
var
|
|
4484
|
-
if (typeof
|
|
4485
|
-
for (var
|
|
4486
|
-
Ye(
|
|
4492
|
+
else if (Ye(a))
|
|
4493
|
+
a._store && (a._store.validated = !0);
|
|
4494
|
+
else if (a) {
|
|
4495
|
+
var _ = M(a);
|
|
4496
|
+
if (typeof _ == "function" && _ !== a.entries)
|
|
4497
|
+
for (var R = _.call(a), j; !(j = R.next()).done; )
|
|
4498
|
+
Ye(j.value) && ot(j.value, h);
|
|
4487
4499
|
}
|
|
4488
4500
|
}
|
|
4489
4501
|
}
|
|
4490
|
-
function
|
|
4502
|
+
function Rt(a) {
|
|
4491
4503
|
{
|
|
4492
|
-
var
|
|
4493
|
-
if (
|
|
4504
|
+
var h = a.type;
|
|
4505
|
+
if (h == null || typeof h == "string")
|
|
4494
4506
|
return;
|
|
4495
|
-
var
|
|
4496
|
-
if (typeof
|
|
4497
|
-
|
|
4498
|
-
else if (typeof
|
|
4507
|
+
var A;
|
|
4508
|
+
if (typeof h == "function")
|
|
4509
|
+
A = h.propTypes;
|
|
4510
|
+
else if (typeof h == "object" && (h.$$typeof === l || // Note: Memo only checks outer props here.
|
|
4499
4511
|
// Inner props are checked in the reconciler.
|
|
4500
|
-
|
|
4501
|
-
|
|
4512
|
+
h.$$typeof === p))
|
|
4513
|
+
A = h.propTypes;
|
|
4502
4514
|
else
|
|
4503
4515
|
return;
|
|
4504
|
-
if (
|
|
4505
|
-
var
|
|
4506
|
-
Ge(
|
|
4507
|
-
} else if (
|
|
4516
|
+
if (A) {
|
|
4517
|
+
var v = z(h);
|
|
4518
|
+
Ge(A, a.props, "prop", v, a);
|
|
4519
|
+
} else if (h.PropTypes !== void 0 && !Qe) {
|
|
4508
4520
|
Qe = !0;
|
|
4509
|
-
var
|
|
4510
|
-
C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
4521
|
+
var _ = z(h);
|
|
4522
|
+
C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _ || "Unknown");
|
|
4511
4523
|
}
|
|
4512
|
-
typeof
|
|
4524
|
+
typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
4513
4525
|
}
|
|
4514
4526
|
}
|
|
4515
|
-
function Lt(
|
|
4527
|
+
function Lt(a) {
|
|
4516
4528
|
{
|
|
4517
|
-
for (var
|
|
4518
|
-
var
|
|
4519
|
-
if (
|
|
4520
|
-
de(
|
|
4529
|
+
for (var h = Object.keys(a.props), A = 0; A < h.length; A++) {
|
|
4530
|
+
var v = h[A];
|
|
4531
|
+
if (v !== "children" && v !== "key") {
|
|
4532
|
+
de(a), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), de(null);
|
|
4521
4533
|
break;
|
|
4522
4534
|
}
|
|
4523
4535
|
}
|
|
4524
|
-
|
|
4536
|
+
a.ref !== null && (de(a), C("Invalid attribute `ref` supplied to `React.Fragment`."), de(null));
|
|
4525
4537
|
}
|
|
4526
4538
|
}
|
|
4527
|
-
var
|
|
4528
|
-
function
|
|
4539
|
+
var ct = {};
|
|
4540
|
+
function dt(a, h, A, v, _, R) {
|
|
4529
4541
|
{
|
|
4530
|
-
var
|
|
4531
|
-
if (!
|
|
4532
|
-
var
|
|
4533
|
-
(
|
|
4534
|
-
var
|
|
4535
|
-
|
|
4536
|
-
var
|
|
4537
|
-
|
|
4542
|
+
var j = N(a);
|
|
4543
|
+
if (!j) {
|
|
4544
|
+
var T = "";
|
|
4545
|
+
(a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
4546
|
+
var Q = Nt();
|
|
4547
|
+
Q ? T += Q : T += nt();
|
|
4548
|
+
var I;
|
|
4549
|
+
a === null ? I = "null" : b(a) ? I = "array" : a !== void 0 && a.$$typeof === e ? (I = "<" + (z(a.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : I = typeof a, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", I, T);
|
|
4538
4550
|
}
|
|
4539
|
-
var $ =
|
|
4551
|
+
var $ = qt(a, h, A, _, R);
|
|
4540
4552
|
if ($ == null)
|
|
4541
4553
|
return $;
|
|
4542
|
-
if (
|
|
4543
|
-
var Z =
|
|
4554
|
+
if (j) {
|
|
4555
|
+
var Z = h.children;
|
|
4544
4556
|
if (Z !== void 0)
|
|
4545
|
-
if (
|
|
4546
|
-
if (
|
|
4557
|
+
if (v)
|
|
4558
|
+
if (b(Z)) {
|
|
4547
4559
|
for (var fe = 0; fe < Z.length; fe++)
|
|
4548
|
-
|
|
4560
|
+
lt(Z[fe], a);
|
|
4549
4561
|
Object.freeze && Object.freeze(Z);
|
|
4550
4562
|
} else
|
|
4551
4563
|
C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
4552
4564
|
else
|
|
4553
|
-
|
|
4565
|
+
lt(Z, a);
|
|
4554
4566
|
}
|
|
4555
|
-
if (ue.call(
|
|
4556
|
-
var
|
|
4567
|
+
if (ue.call(h, "key")) {
|
|
4568
|
+
var se = z(a), Y = Object.keys(h).filter(function(Mt) {
|
|
4557
4569
|
return Mt !== "key";
|
|
4558
|
-
}), Je =
|
|
4559
|
-
if (!
|
|
4560
|
-
var $t =
|
|
4570
|
+
}), Je = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
4571
|
+
if (!ct[se + Je]) {
|
|
4572
|
+
var $t = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
|
|
4561
4573
|
C(`A props object containing a "key" prop is being spread into JSX:
|
|
4562
4574
|
let props = %s;
|
|
4563
4575
|
<%s {...props} />
|
|
4564
4576
|
React keys must be passed directly to JSX without using spread:
|
|
4565
4577
|
let props = %s;
|
|
4566
|
-
<%s key={someKey} {...props} />`, Je,
|
|
4578
|
+
<%s key={someKey} {...props} />`, Je, se, $t, se), ct[se + Je] = !0;
|
|
4567
4579
|
}
|
|
4568
4580
|
}
|
|
4569
|
-
return
|
|
4581
|
+
return a === u ? Lt($) : Rt($), $;
|
|
4570
4582
|
}
|
|
4571
4583
|
}
|
|
4572
|
-
function Ot(
|
|
4573
|
-
return
|
|
4584
|
+
function Ot(a, h, A) {
|
|
4585
|
+
return dt(a, h, A, !0);
|
|
4574
4586
|
}
|
|
4575
|
-
function Pt(
|
|
4576
|
-
return
|
|
4587
|
+
function Pt(a, h, A) {
|
|
4588
|
+
return dt(a, h, A, !1);
|
|
4577
4589
|
}
|
|
4578
4590
|
var Ut = Pt, It = Ot;
|
|
4579
4591
|
we.Fragment = u, we.jsx = Ut, we.jsxs = It;
|
|
@@ -4592,20 +4604,20 @@ class tt {
|
|
|
4592
4604
|
* Filter by field value
|
|
4593
4605
|
*/
|
|
4594
4606
|
static filterBy(e, r, u) {
|
|
4595
|
-
return e.filter((
|
|
4607
|
+
return e.filter((s) => s[r] === u);
|
|
4596
4608
|
}
|
|
4597
4609
|
/**
|
|
4598
4610
|
* Filter by multiple fields
|
|
4599
4611
|
*/
|
|
4600
4612
|
static filterByFields(e, r) {
|
|
4601
|
-
return e.filter((u) => Object.entries(r).every(([
|
|
4613
|
+
return e.filter((u) => Object.entries(r).every(([s, n]) => u[s] === n));
|
|
4602
4614
|
}
|
|
4603
4615
|
/**
|
|
4604
4616
|
* Sort array by field
|
|
4605
4617
|
*/
|
|
4606
4618
|
static sort(e, r, u = "asc") {
|
|
4607
|
-
return [...e].sort((
|
|
4608
|
-
const t =
|
|
4619
|
+
return [...e].sort((s, n) => {
|
|
4620
|
+
const t = s[r], i = n[r];
|
|
4609
4621
|
if (t === i) return 0;
|
|
4610
4622
|
let l = 0;
|
|
4611
4623
|
return t > i && (l = 1), t < i && (l = -1), u === "asc" ? l : -l;
|
|
@@ -4616,19 +4628,19 @@ class tt {
|
|
|
4616
4628
|
*/
|
|
4617
4629
|
static search(e, r, u) {
|
|
4618
4630
|
if (!r.trim()) return e;
|
|
4619
|
-
const
|
|
4631
|
+
const s = r.toLowerCase();
|
|
4620
4632
|
return e.filter((n) => u.some((t) => {
|
|
4621
4633
|
const i = n[t];
|
|
4622
|
-
return i == null ? !1 : String(i).toLowerCase().includes(
|
|
4634
|
+
return i == null ? !1 : String(i).toLowerCase().includes(s);
|
|
4623
4635
|
}));
|
|
4624
4636
|
}
|
|
4625
4637
|
/**
|
|
4626
4638
|
* Paginate array
|
|
4627
4639
|
*/
|
|
4628
4640
|
static paginate(e, r, u) {
|
|
4629
|
-
const
|
|
4641
|
+
const s = (r - 1) * u, n = s + u;
|
|
4630
4642
|
return {
|
|
4631
|
-
data: e.slice(
|
|
4643
|
+
data: e.slice(s, n),
|
|
4632
4644
|
total: e.length,
|
|
4633
4645
|
page: r,
|
|
4634
4646
|
totalPages: Math.ceil(e.length / u)
|
|
@@ -4638,24 +4650,24 @@ class tt {
|
|
|
4638
4650
|
* Group items by field value
|
|
4639
4651
|
*/
|
|
4640
4652
|
static groupBy(e, r) {
|
|
4641
|
-
return e.reduce((u,
|
|
4642
|
-
const n = String(
|
|
4643
|
-
return u[n] || (u[n] = []), u[n].push(
|
|
4653
|
+
return e.reduce((u, s) => {
|
|
4654
|
+
const n = String(s[r]);
|
|
4655
|
+
return u[n] || (u[n] = []), u[n].push(s), u;
|
|
4644
4656
|
}, {});
|
|
4645
4657
|
}
|
|
4646
4658
|
/**
|
|
4647
4659
|
* Get unique values for a field
|
|
4648
4660
|
*/
|
|
4649
4661
|
static unique(e, r) {
|
|
4650
|
-
const u = e.map((
|
|
4662
|
+
const u = e.map((s) => s[r]);
|
|
4651
4663
|
return [...new Set(u)];
|
|
4652
4664
|
}
|
|
4653
4665
|
/**
|
|
4654
4666
|
* Count items by field value
|
|
4655
4667
|
*/
|
|
4656
4668
|
static countBy(e, r) {
|
|
4657
|
-
return e.reduce((u,
|
|
4658
|
-
const n = String(
|
|
4669
|
+
return e.reduce((u, s) => {
|
|
4670
|
+
const n = String(s[r]);
|
|
4659
4671
|
return u[n] = (u[n] || 0) + 1, u;
|
|
4660
4672
|
}, {});
|
|
4661
4673
|
}
|
|
@@ -4663,71 +4675,71 @@ class tt {
|
|
|
4663
4675
|
* Apply multiple operations in sequence
|
|
4664
4676
|
*/
|
|
4665
4677
|
static pipe(e, r) {
|
|
4666
|
-
return r.reduce((u,
|
|
4678
|
+
return r.reduce((u, s) => s(u), e);
|
|
4667
4679
|
}
|
|
4668
4680
|
}
|
|
4669
|
-
function
|
|
4681
|
+
function Er({
|
|
4670
4682
|
endpoint: o,
|
|
4671
4683
|
params: e,
|
|
4672
4684
|
layout: r = "list",
|
|
4673
4685
|
title: u,
|
|
4674
|
-
emptyMessage:
|
|
4686
|
+
emptyMessage: s = "No items found",
|
|
4675
4687
|
renderItem: n,
|
|
4676
|
-
keyExtractor: t = (B,
|
|
4688
|
+
keyExtractor: t = (B, M) => B.id || B._id || String(M),
|
|
4677
4689
|
searchable: i = !1,
|
|
4678
4690
|
searchFields: l = [],
|
|
4679
|
-
searchPlaceholder:
|
|
4680
|
-
filters:
|
|
4681
|
-
pageSize:
|
|
4691
|
+
searchPlaceholder: c = "Search...",
|
|
4692
|
+
filters: d = [],
|
|
4693
|
+
pageSize: p = 20,
|
|
4682
4694
|
onItemClick: m,
|
|
4683
|
-
onRefresh:
|
|
4684
|
-
theme:
|
|
4695
|
+
onRefresh: D,
|
|
4696
|
+
theme: E = {}
|
|
4685
4697
|
}) {
|
|
4686
|
-
const { data: B, loading:
|
|
4698
|
+
const { data: B, loading: M, error: L, refetch: C } = pr(o, e), [U, g] = P(""), [k, y] = P({}), [q, O] = P(1), F = vt(() => {
|
|
4687
4699
|
if (!B) return { data: [], total: 0, totalPages: 0 };
|
|
4688
|
-
let
|
|
4689
|
-
return i &&
|
|
4690
|
-
}, [B,
|
|
4700
|
+
let S = B;
|
|
4701
|
+
return i && U && l.length > 0 && (S = tt.search(S, U, l)), Object.keys(k).length > 0 && (S = tt.filterByFields(S, k)), tt.paginate(S, q, p);
|
|
4702
|
+
}, [B, U, k, q, p, i, l]);
|
|
4691
4703
|
pe(() => {
|
|
4692
|
-
|
|
4693
|
-
}, [
|
|
4694
|
-
const
|
|
4695
|
-
|
|
4696
|
-
},
|
|
4697
|
-
background:
|
|
4698
|
-
cardBackground:
|
|
4699
|
-
text:
|
|
4700
|
-
textSecondary:
|
|
4701
|
-
border:
|
|
4702
|
-
primary:
|
|
4703
|
-
},
|
|
4704
|
+
O(1);
|
|
4705
|
+
}, [U, k]);
|
|
4706
|
+
const N = () => {
|
|
4707
|
+
g(""), y({}), O(1), C(), D == null || D();
|
|
4708
|
+
}, x = {
|
|
4709
|
+
background: E.background || "#ffffff",
|
|
4710
|
+
cardBackground: E.cardBackground || "#f9fafb",
|
|
4711
|
+
text: E.text || "#111827",
|
|
4712
|
+
textSecondary: E.textSecondary || "#6b7280",
|
|
4713
|
+
border: E.border || "#e5e7eb",
|
|
4714
|
+
primary: E.primary || "#3b82f6"
|
|
4715
|
+
}, z = n || ((S) => /* @__PURE__ */ f.jsxs("div", { style: {
|
|
4704
4716
|
padding: "16px",
|
|
4705
4717
|
cursor: m ? "pointer" : "default"
|
|
4706
4718
|
}, children: [
|
|
4707
|
-
/* @__PURE__ */ f.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color:
|
|
4708
|
-
|
|
4719
|
+
/* @__PURE__ */ f.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color: x.text }, children: S.title || S.name || S.label || "Untitled" }),
|
|
4720
|
+
S.description && /* @__PURE__ */ f.jsx("div", { style: { fontSize: "13px", color: x.textSecondary, marginTop: "4px" }, children: S.description })
|
|
4709
4721
|
] }));
|
|
4710
|
-
return
|
|
4722
|
+
return M && !B ? /* @__PURE__ */ f.jsx("div", { style: {
|
|
4711
4723
|
display: "flex",
|
|
4712
4724
|
alignItems: "center",
|
|
4713
4725
|
justifyContent: "center",
|
|
4714
4726
|
padding: "48px",
|
|
4715
|
-
color:
|
|
4716
|
-
}, children: "Loading..." }) :
|
|
4727
|
+
color: x.textSecondary
|
|
4728
|
+
}, children: "Loading..." }) : L ? /* @__PURE__ */ f.jsxs("div", { style: {
|
|
4717
4729
|
padding: "24px",
|
|
4718
4730
|
textAlign: "center",
|
|
4719
4731
|
color: "#ef4444"
|
|
4720
4732
|
}, children: [
|
|
4721
4733
|
/* @__PURE__ */ f.jsx("div", { style: { fontWeight: 500, marginBottom: "8px" }, children: "Error" }),
|
|
4722
|
-
/* @__PURE__ */ f.jsx("div", { style: { fontSize: "14px" }, children:
|
|
4734
|
+
/* @__PURE__ */ f.jsx("div", { style: { fontSize: "14px" }, children: L.message }),
|
|
4723
4735
|
/* @__PURE__ */ f.jsx(
|
|
4724
4736
|
"button",
|
|
4725
4737
|
{
|
|
4726
|
-
onClick:
|
|
4738
|
+
onClick: N,
|
|
4727
4739
|
style: {
|
|
4728
4740
|
marginTop: "16px",
|
|
4729
4741
|
padding: "8px 16px",
|
|
4730
|
-
background:
|
|
4742
|
+
background: x.primary,
|
|
4731
4743
|
color: "white",
|
|
4732
4744
|
border: "none",
|
|
4733
4745
|
borderRadius: "6px",
|
|
@@ -4737,36 +4749,36 @@ function xr({
|
|
|
4737
4749
|
}
|
|
4738
4750
|
)
|
|
4739
4751
|
] }) : /* @__PURE__ */ f.jsxs("div", { style: {
|
|
4740
|
-
background:
|
|
4752
|
+
background: x.background,
|
|
4741
4753
|
borderRadius: "12px",
|
|
4742
4754
|
overflow: "hidden"
|
|
4743
4755
|
}, children: [
|
|
4744
|
-
(u || i ||
|
|
4756
|
+
(u || i || d.length > 0) && /* @__PURE__ */ f.jsxs("div", { style: {
|
|
4745
4757
|
padding: "16px",
|
|
4746
|
-
borderBottom: `1px solid ${
|
|
4758
|
+
borderBottom: `1px solid ${x.border}`
|
|
4747
4759
|
}, children: [
|
|
4748
4760
|
/* @__PURE__ */ f.jsxs("div", { style: {
|
|
4749
4761
|
display: "flex",
|
|
4750
4762
|
alignItems: "center",
|
|
4751
4763
|
justifyContent: "space-between",
|
|
4752
|
-
marginBottom: i ||
|
|
4764
|
+
marginBottom: i || d.length > 0 ? "12px" : "0"
|
|
4753
4765
|
}, children: [
|
|
4754
4766
|
u && /* @__PURE__ */ f.jsx("h2", { style: {
|
|
4755
4767
|
margin: 0,
|
|
4756
4768
|
fontSize: "18px",
|
|
4757
4769
|
fontWeight: 600,
|
|
4758
|
-
color:
|
|
4770
|
+
color: x.text
|
|
4759
4771
|
}, children: u }),
|
|
4760
4772
|
/* @__PURE__ */ f.jsx(
|
|
4761
4773
|
"button",
|
|
4762
4774
|
{
|
|
4763
|
-
onClick:
|
|
4775
|
+
onClick: N,
|
|
4764
4776
|
style: {
|
|
4765
4777
|
padding: "6px 12px",
|
|
4766
4778
|
background: "transparent",
|
|
4767
|
-
border: `1px solid ${
|
|
4779
|
+
border: `1px solid ${x.border}`,
|
|
4768
4780
|
borderRadius: "6px",
|
|
4769
|
-
color:
|
|
4781
|
+
color: x.textSecondary,
|
|
4770
4782
|
cursor: "pointer",
|
|
4771
4783
|
fontSize: "13px"
|
|
4772
4784
|
},
|
|
@@ -4778,13 +4790,13 @@ function xr({
|
|
|
4778
4790
|
"input",
|
|
4779
4791
|
{
|
|
4780
4792
|
type: "text",
|
|
4781
|
-
placeholder:
|
|
4782
|
-
value:
|
|
4783
|
-
onChange: (
|
|
4793
|
+
placeholder: c,
|
|
4794
|
+
value: U,
|
|
4795
|
+
onChange: (S) => g(S.target.value),
|
|
4784
4796
|
style: {
|
|
4785
4797
|
width: "100%",
|
|
4786
4798
|
padding: "8px 12px",
|
|
4787
|
-
border: `1px solid ${
|
|
4799
|
+
border: `1px solid ${x.border}`,
|
|
4788
4800
|
borderRadius: "8px",
|
|
4789
4801
|
fontSize: "14px",
|
|
4790
4802
|
outline: "none"
|
|
@@ -4798,52 +4810,52 @@ function xr({
|
|
|
4798
4810
|
gridTemplateColumns: r === "grid" ? "repeat(auto-fill, minmax(250px, 1fr))" : void 0,
|
|
4799
4811
|
gap: r === "list" ? "0" : "16px",
|
|
4800
4812
|
padding: r === "list" ? "0" : "16px"
|
|
4801
|
-
}, children:
|
|
4813
|
+
}, children: F.data.length === 0 ? /* @__PURE__ */ f.jsx("div", { style: {
|
|
4802
4814
|
padding: "48px",
|
|
4803
4815
|
textAlign: "center",
|
|
4804
|
-
color:
|
|
4805
|
-
}, children:
|
|
4816
|
+
color: x.textSecondary
|
|
4817
|
+
}, children: s }) : F.data.map((S, G) => /* @__PURE__ */ f.jsx(
|
|
4806
4818
|
"div",
|
|
4807
4819
|
{
|
|
4808
|
-
onClick: () => m == null ? void 0 : m(
|
|
4820
|
+
onClick: () => m == null ? void 0 : m(S),
|
|
4809
4821
|
style: {
|
|
4810
|
-
background:
|
|
4822
|
+
background: x.cardBackground,
|
|
4811
4823
|
borderRadius: r === "list" ? "0" : "8px",
|
|
4812
|
-
borderBottom: r === "list" ? `1px solid ${
|
|
4824
|
+
borderBottom: r === "list" ? `1px solid ${x.border}` : "none",
|
|
4813
4825
|
transition: "all 0.15s ease"
|
|
4814
4826
|
},
|
|
4815
4827
|
onMouseEnter: (K) => {
|
|
4816
|
-
m && (K.currentTarget.style.background =
|
|
4828
|
+
m && (K.currentTarget.style.background = x.border);
|
|
4817
4829
|
},
|
|
4818
4830
|
onMouseLeave: (K) => {
|
|
4819
|
-
K.currentTarget.style.background =
|
|
4831
|
+
K.currentTarget.style.background = x.cardBackground;
|
|
4820
4832
|
},
|
|
4821
|
-
children:
|
|
4833
|
+
children: z(S, G)
|
|
4822
4834
|
},
|
|
4823
|
-
t(
|
|
4835
|
+
t(S, G)
|
|
4824
4836
|
)) }),
|
|
4825
|
-
|
|
4837
|
+
F.totalPages > 1 && /* @__PURE__ */ f.jsxs("div", { style: {
|
|
4826
4838
|
padding: "16px",
|
|
4827
|
-
borderTop: `1px solid ${
|
|
4839
|
+
borderTop: `1px solid ${x.border}`,
|
|
4828
4840
|
display: "flex",
|
|
4829
4841
|
alignItems: "center",
|
|
4830
4842
|
justifyContent: "space-between"
|
|
4831
4843
|
}, children: [
|
|
4832
|
-
/* @__PURE__ */ f.jsxs("div", { style: { fontSize: "13px", color:
|
|
4844
|
+
/* @__PURE__ */ f.jsxs("div", { style: { fontSize: "13px", color: x.textSecondary }, children: [
|
|
4833
4845
|
"Page ",
|
|
4834
4846
|
q,
|
|
4835
4847
|
" of ",
|
|
4836
|
-
|
|
4848
|
+
F.totalPages
|
|
4837
4849
|
] }),
|
|
4838
4850
|
/* @__PURE__ */ f.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
4839
4851
|
/* @__PURE__ */ f.jsx(
|
|
4840
4852
|
"button",
|
|
4841
4853
|
{
|
|
4842
|
-
onClick: () =>
|
|
4854
|
+
onClick: () => O((S) => Math.max(1, S - 1)),
|
|
4843
4855
|
disabled: q === 1,
|
|
4844
4856
|
style: {
|
|
4845
4857
|
padding: "6px 12px",
|
|
4846
|
-
border: `1px solid ${
|
|
4858
|
+
border: `1px solid ${x.border}`,
|
|
4847
4859
|
borderRadius: "6px",
|
|
4848
4860
|
background: "white",
|
|
4849
4861
|
cursor: q === 1 ? "not-allowed" : "pointer",
|
|
@@ -4855,15 +4867,15 @@ function xr({
|
|
|
4855
4867
|
/* @__PURE__ */ f.jsx(
|
|
4856
4868
|
"button",
|
|
4857
4869
|
{
|
|
4858
|
-
onClick: () =>
|
|
4859
|
-
disabled: q ===
|
|
4870
|
+
onClick: () => O((S) => Math.min(F.totalPages, S + 1)),
|
|
4871
|
+
disabled: q === F.totalPages,
|
|
4860
4872
|
style: {
|
|
4861
4873
|
padding: "6px 12px",
|
|
4862
|
-
border: `1px solid ${
|
|
4874
|
+
border: `1px solid ${x.border}`,
|
|
4863
4875
|
borderRadius: "6px",
|
|
4864
4876
|
background: "white",
|
|
4865
|
-
cursor: q ===
|
|
4866
|
-
opacity: q ===
|
|
4877
|
+
cursor: q === F.totalPages ? "not-allowed" : "pointer",
|
|
4878
|
+
opacity: q === F.totalPages ? 0.5 : 1
|
|
4867
4879
|
},
|
|
4868
4880
|
children: "Next"
|
|
4869
4881
|
}
|
|
@@ -4877,10 +4889,10 @@ function wr({
|
|
|
4877
4889
|
onClick: e,
|
|
4878
4890
|
title: r = (t) => t.title || t.name || t.label || "Untitled",
|
|
4879
4891
|
subtitle: u = (t) => t.description || t.subtitle || "",
|
|
4880
|
-
image:
|
|
4892
|
+
image: s = (t) => t.image || t.thumbnail || t.photo,
|
|
4881
4893
|
badge: n = (t) => t.badge || t.tag || t.type
|
|
4882
4894
|
}) {
|
|
4883
|
-
const t = r(o), i = u(o), l =
|
|
4895
|
+
const t = r(o), i = u(o), l = s(o), c = n(o);
|
|
4884
4896
|
return /* @__PURE__ */ f.jsxs(
|
|
4885
4897
|
"div",
|
|
4886
4898
|
{
|
|
@@ -4902,7 +4914,7 @@ function wr({
|
|
|
4902
4914
|
/* @__PURE__ */ f.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
4903
4915
|
/* @__PURE__ */ f.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4904
4916
|
/* @__PURE__ */ f.jsx("h3", { className: "font-medium text-gray-900 truncate", children: t }),
|
|
4905
|
-
|
|
4917
|
+
c && /* @__PURE__ */ f.jsx("span", { className: "px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full", children: c })
|
|
4906
4918
|
] }),
|
|
4907
4919
|
i && /* @__PURE__ */ f.jsx("p", { className: "text-sm text-gray-600 truncate mt-0.5", children: i })
|
|
4908
4920
|
] }),
|
|
@@ -4916,7 +4928,7 @@ function Cr({
|
|
|
4916
4928
|
onClose: e,
|
|
4917
4929
|
title: r = (n) => n.title || n.name || n.label || "Detail",
|
|
4918
4930
|
image: u = (n) => n.image || n.thumbnail || n.photo,
|
|
4919
|
-
fields:
|
|
4931
|
+
fields: s = []
|
|
4920
4932
|
}) {
|
|
4921
4933
|
if (!o) return null;
|
|
4922
4934
|
const n = r(o), t = u(o);
|
|
@@ -4941,14 +4953,14 @@ function Cr({
|
|
|
4941
4953
|
className: "w-full h-64 object-cover rounded-lg"
|
|
4942
4954
|
}
|
|
4943
4955
|
) }),
|
|
4944
|
-
|
|
4945
|
-
const
|
|
4946
|
-
return
|
|
4956
|
+
s.length > 0 && /* @__PURE__ */ f.jsx("div", { className: "space-y-4", children: s.map((i, l) => {
|
|
4957
|
+
const c = i.value(o);
|
|
4958
|
+
return c == null || c === "" ? null : /* @__PURE__ */ f.jsxs("div", { children: [
|
|
4947
4959
|
/* @__PURE__ */ f.jsx("div", { className: "text-sm font-medium text-gray-500 mb-1", children: i.label }),
|
|
4948
|
-
/* @__PURE__ */ f.jsx("div", { className: "text-base text-gray-900", children: typeof
|
|
4960
|
+
/* @__PURE__ */ f.jsx("div", { className: "text-base text-gray-900", children: typeof c == "object" ? JSON.stringify(c, null, 2) : String(c) })
|
|
4949
4961
|
] }, l);
|
|
4950
4962
|
}) }),
|
|
4951
|
-
|
|
4963
|
+
s.length === 0 && /* @__PURE__ */ f.jsx("pre", { className: "bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto", children: JSON.stringify(o, null, 2) })
|
|
4952
4964
|
] }),
|
|
4953
4965
|
e && /* @__PURE__ */ f.jsx("div", { className: "sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4", children: /* @__PURE__ */ f.jsx(
|
|
4954
4966
|
"button",
|
|
@@ -4970,85 +4982,85 @@ function Br({
|
|
|
4970
4982
|
cardCount: e = 2,
|
|
4971
4983
|
minInterval: r = 1e3,
|
|
4972
4984
|
maxInterval: u = 3e3,
|
|
4973
|
-
onCardClick:
|
|
4985
|
+
onCardClick: s,
|
|
4974
4986
|
cardSize: n = "medium",
|
|
4975
4987
|
className: t = ""
|
|
4976
4988
|
}) {
|
|
4977
|
-
const i = Math.min(Math.max(e, 1), 5), [l,
|
|
4978
|
-
const q = o.filter((
|
|
4989
|
+
const i = Math.min(Math.max(e, 1), 5), [l, c] = P([]), [d, p] = P([]), [m, D] = P(Array(i).fill(!1)), [E, B] = P(Array(i).fill(!1)), M = ft([]), L = H((y) => {
|
|
4990
|
+
const q = o.filter((F) => !y.includes(F._id));
|
|
4979
4991
|
if (q.length === 0) return null;
|
|
4980
|
-
const
|
|
4981
|
-
return q[
|
|
4982
|
-
}, [o]), C =
|
|
4992
|
+
const O = Math.floor(Math.random() * q.length);
|
|
4993
|
+
return q[O];
|
|
4994
|
+
}, [o]), C = H(() => Math.random() * (u - r) + r, [r, u]);
|
|
4983
4995
|
pe(() => {
|
|
4984
4996
|
if (o.length === 0) {
|
|
4985
|
-
|
|
4997
|
+
c([]), p([]);
|
|
4986
4998
|
return;
|
|
4987
4999
|
}
|
|
4988
|
-
const y = [], q = [],
|
|
4989
|
-
for (let
|
|
4990
|
-
const
|
|
4991
|
-
|
|
5000
|
+
const y = [], q = [], O = [];
|
|
5001
|
+
for (let F = 0; F < i && F < o.length; F++) {
|
|
5002
|
+
const N = L(O);
|
|
5003
|
+
N && (y.push(N), O.push(N._id));
|
|
4992
5004
|
}
|
|
4993
|
-
for (let
|
|
4994
|
-
const
|
|
4995
|
-
y[
|
|
4996
|
-
...y.filter((
|
|
4997
|
-
],
|
|
4998
|
-
|
|
5005
|
+
for (let F = 0; F < y.length; F++) {
|
|
5006
|
+
const N = [
|
|
5007
|
+
y[F]._id,
|
|
5008
|
+
...y.filter((V, z) => z !== F).map((V) => V._id)
|
|
5009
|
+
], x = L(N);
|
|
5010
|
+
x ? q.push(x) : q.push(y[F]);
|
|
4999
5011
|
}
|
|
5000
|
-
|
|
5001
|
-
}, [o, i,
|
|
5002
|
-
const
|
|
5003
|
-
const q = C(),
|
|
5004
|
-
|
|
5005
|
-
const
|
|
5006
|
-
return
|
|
5012
|
+
c(y), p(q);
|
|
5013
|
+
}, [o, i, L]);
|
|
5014
|
+
const U = H((y) => {
|
|
5015
|
+
const q = C(), O = setTimeout(() => {
|
|
5016
|
+
D((F) => {
|
|
5017
|
+
const N = [...F];
|
|
5018
|
+
return N[y] = !N[y], N;
|
|
5007
5019
|
}), setTimeout(() => {
|
|
5008
|
-
B((
|
|
5009
|
-
const
|
|
5010
|
-
return
|
|
5020
|
+
B((F) => {
|
|
5021
|
+
const N = [...F];
|
|
5022
|
+
return N[y] = !N[y], N;
|
|
5011
5023
|
}), setTimeout(() => {
|
|
5012
|
-
const
|
|
5013
|
-
|
|
5014
|
-
const
|
|
5015
|
-
return
|
|
5016
|
-
}),
|
|
5017
|
-
const
|
|
5018
|
-
(
|
|
5019
|
-
...l.filter((
|
|
5020
|
-
...
|
|
5021
|
-
],
|
|
5022
|
-
return
|
|
5024
|
+
const F = !E[y];
|
|
5025
|
+
F && c((N) => {
|
|
5026
|
+
const x = [...N];
|
|
5027
|
+
return x[y] = d[y], x;
|
|
5028
|
+
}), p((N) => {
|
|
5029
|
+
const x = [...N], z = [
|
|
5030
|
+
(F ? d[y] : l[y])._id,
|
|
5031
|
+
...l.filter((G, K) => K !== y).map((G) => G._id),
|
|
5032
|
+
...N.filter((G, K) => K !== y).map((G) => G._id)
|
|
5033
|
+
], S = L(z);
|
|
5034
|
+
return S && (x[y] = S), x;
|
|
5023
5035
|
}), setTimeout(() => {
|
|
5024
|
-
|
|
5036
|
+
U(y);
|
|
5025
5037
|
}, 150);
|
|
5026
5038
|
}, 200);
|
|
5027
5039
|
}, 150);
|
|
5028
5040
|
}, q);
|
|
5029
|
-
|
|
5030
|
-
}, [C,
|
|
5041
|
+
M.current[y] = O;
|
|
5042
|
+
}, [C, L, l, d, E]), g = ft(!1);
|
|
5031
5043
|
pe(() => {
|
|
5032
|
-
if (!(l.length === 0 || o.length <= 1) && !
|
|
5033
|
-
|
|
5044
|
+
if (!(l.length === 0 || o.length <= 1) && !g.current) {
|
|
5045
|
+
g.current = !0;
|
|
5034
5046
|
for (let y = 0; y < l.length; y++)
|
|
5035
|
-
|
|
5047
|
+
U(y);
|
|
5036
5048
|
return () => {
|
|
5037
|
-
|
|
5049
|
+
M.current.forEach((y) => clearTimeout(y)), M.current = [], g.current = !1;
|
|
5038
5050
|
};
|
|
5039
5051
|
}
|
|
5040
5052
|
}, [l.length, o.length]);
|
|
5041
|
-
const
|
|
5042
|
-
|
|
5053
|
+
const k = (y) => {
|
|
5054
|
+
s && s(y);
|
|
5043
5055
|
};
|
|
5044
5056
|
return o.length === 0 ? /* @__PURE__ */ f.jsx("div", { className: `flex items-center justify-center p-8 ${t}`, children: /* @__PURE__ */ f.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : l.length === 0 ? /* @__PURE__ */ f.jsx("div", { className: `flex items-center justify-center p-8 ${t}`, children: /* @__PURE__ */ f.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ f.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${t}`, children: l.map((y, q) => {
|
|
5045
|
-
const
|
|
5057
|
+
const O = d[q], F = E[q];
|
|
5046
5058
|
return /* @__PURE__ */ f.jsx(
|
|
5047
5059
|
"div",
|
|
5048
5060
|
{
|
|
5049
5061
|
className: `relative ${mr[n]}`,
|
|
5050
5062
|
style: { perspective: "1000px" },
|
|
5051
|
-
onClick: () =>
|
|
5063
|
+
onClick: () => k(F ? O : y),
|
|
5052
5064
|
children: /* @__PURE__ */ f.jsxs(
|
|
5053
5065
|
"div",
|
|
5054
5066
|
{
|
|
@@ -5064,7 +5076,7 @@ function Br({
|
|
|
5064
5076
|
{
|
|
5065
5077
|
className: "absolute inset-0 transition-opacity duration-200",
|
|
5066
5078
|
style: {
|
|
5067
|
-
opacity:
|
|
5079
|
+
opacity: F ? 0 : 1
|
|
5068
5080
|
},
|
|
5069
5081
|
children: /* @__PURE__ */ f.jsxs(
|
|
5070
5082
|
"div",
|
|
@@ -5089,12 +5101,12 @@ function Br({
|
|
|
5089
5101
|
)
|
|
5090
5102
|
}
|
|
5091
5103
|
),
|
|
5092
|
-
|
|
5104
|
+
O && /* @__PURE__ */ f.jsx(
|
|
5093
5105
|
"div",
|
|
5094
5106
|
{
|
|
5095
5107
|
className: "absolute inset-0 transition-opacity duration-200",
|
|
5096
5108
|
style: {
|
|
5097
|
-
opacity:
|
|
5109
|
+
opacity: F ? 1 : 0
|
|
5098
5110
|
},
|
|
5099
5111
|
children: /* @__PURE__ */ f.jsxs(
|
|
5100
5112
|
"div",
|
|
@@ -5108,12 +5120,12 @@ function Br({
|
|
|
5108
5120
|
/* @__PURE__ */ f.jsx(
|
|
5109
5121
|
"img",
|
|
5110
5122
|
{
|
|
5111
|
-
src:
|
|
5112
|
-
alt:
|
|
5123
|
+
src: O.data.image,
|
|
5124
|
+
alt: O.title,
|
|
5113
5125
|
className: "w-full h-full object-cover"
|
|
5114
5126
|
}
|
|
5115
5127
|
),
|
|
5116
|
-
/* @__PURE__ */ f.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ f.jsx("p", { className: "text-white text-sm font-medium truncate", children:
|
|
5128
|
+
/* @__PURE__ */ f.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ f.jsx("p", { className: "text-white text-sm font-medium truncate", children: O.title }) })
|
|
5117
5129
|
]
|
|
5118
5130
|
}
|
|
5119
5131
|
)
|
|
@@ -5127,15 +5139,15 @@ function Br({
|
|
|
5127
5139
|
);
|
|
5128
5140
|
}) });
|
|
5129
5141
|
}
|
|
5130
|
-
function
|
|
5142
|
+
function Re(o) {
|
|
5131
5143
|
if (!o) return "";
|
|
5132
5144
|
const e = /=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;
|
|
5133
|
-
return o.replace(e, (r, u,
|
|
5145
|
+
return o.replace(e, (r, u, s, n) => {
|
|
5134
5146
|
try {
|
|
5135
|
-
if (
|
|
5147
|
+
if (s.toUpperCase() === "B") {
|
|
5136
5148
|
const t = atob(n);
|
|
5137
5149
|
return decodeURIComponent(escape(t));
|
|
5138
|
-
} else if (
|
|
5150
|
+
} else if (s.toUpperCase() === "Q") {
|
|
5139
5151
|
const t = n.replace(/_/g, " ").replace(
|
|
5140
5152
|
/=([0-9A-Fa-f]{2})/g,
|
|
5141
5153
|
(i, l) => String.fromCharCode(parseInt(l, 16))
|
|
@@ -5164,198 +5176,198 @@ function kr({
|
|
|
5164
5176
|
systemId: e,
|
|
5165
5177
|
accountId: r,
|
|
5166
5178
|
limit: u = 30,
|
|
5167
|
-
folder:
|
|
5179
|
+
folder: s,
|
|
5168
5180
|
selectable: n = !0,
|
|
5169
5181
|
showDetail: t = !1,
|
|
5170
5182
|
emptyMessage: i = "No emails",
|
|
5171
5183
|
autoLoad: l = !0,
|
|
5172
|
-
onSelect:
|
|
5173
|
-
onSelectionChange:
|
|
5174
|
-
onDelete:
|
|
5184
|
+
onSelect: c,
|
|
5185
|
+
onSelectionChange: d,
|
|
5186
|
+
onDelete: p,
|
|
5175
5187
|
onError: m,
|
|
5176
|
-
onLoad:
|
|
5177
|
-
renderItem:
|
|
5188
|
+
onLoad: D,
|
|
5189
|
+
renderItem: E,
|
|
5178
5190
|
renderDetail: B,
|
|
5179
|
-
renderActions:
|
|
5180
|
-
renderEmpty:
|
|
5191
|
+
renderActions: M,
|
|
5192
|
+
renderEmpty: L,
|
|
5181
5193
|
renderLoading: C,
|
|
5182
|
-
theme:
|
|
5194
|
+
theme: U = {}
|
|
5183
5195
|
}) {
|
|
5184
|
-
const
|
|
5185
|
-
if (
|
|
5186
|
-
|
|
5196
|
+
const g = { ...Dr, ...U }, [k, y] = P([]), [q, O] = P(!1), [F, N] = P(null), [x, V] = P(/* @__PURE__ */ new Set()), [z, S] = P(null), [G, K] = P(null), [ge, me] = P(null), [Te, De] = P(!1), W = vt(() => e ? new cr({ baseUrl: o, system_id: e }) : null, [o, e]), re = H(async () => {
|
|
5197
|
+
if (W) {
|
|
5198
|
+
O(!0), N(null);
|
|
5187
5199
|
try {
|
|
5188
|
-
const
|
|
5189
|
-
|
|
5190
|
-
} catch (
|
|
5191
|
-
const
|
|
5192
|
-
|
|
5200
|
+
const b = await W.listEmails(r, u, s);
|
|
5201
|
+
b != null && b.messages && (y(b.messages), D == null || D(b.messages));
|
|
5202
|
+
} catch (b) {
|
|
5203
|
+
const w = b instanceof Error ? b : new Error("Failed to fetch emails");
|
|
5204
|
+
N(w.message), m == null || m(w);
|
|
5193
5205
|
}
|
|
5194
|
-
|
|
5206
|
+
O(!1);
|
|
5195
5207
|
}
|
|
5196
|
-
}, [
|
|
5208
|
+
}, [W, r, u, s, m, D]);
|
|
5197
5209
|
pe(() => {
|
|
5198
5210
|
l && re();
|
|
5199
5211
|
}, [l, re]), pe(() => {
|
|
5200
5212
|
re();
|
|
5201
|
-
}, [
|
|
5202
|
-
const ne =
|
|
5203
|
-
if (
|
|
5204
|
-
K(
|
|
5213
|
+
}, [s]);
|
|
5214
|
+
const ne = H(async (b) => {
|
|
5215
|
+
if (W) {
|
|
5216
|
+
K(b), me(null), De(!0);
|
|
5205
5217
|
try {
|
|
5206
|
-
const
|
|
5207
|
-
|
|
5208
|
-
} catch (
|
|
5209
|
-
console.error("Failed to fetch email body:",
|
|
5218
|
+
const w = await W.getEmailParsed(r, b.uid, s || "INBOX");
|
|
5219
|
+
w != null && w.body && me(w.body);
|
|
5220
|
+
} catch (w) {
|
|
5221
|
+
console.error("Failed to fetch email body:", w);
|
|
5210
5222
|
}
|
|
5211
5223
|
De(!1);
|
|
5212
5224
|
}
|
|
5213
|
-
}, [
|
|
5214
|
-
|
|
5215
|
-
}, [
|
|
5225
|
+
}, [W, r, s]), Ue = H((b) => {
|
|
5226
|
+
c == null || c(b), t && ne(b);
|
|
5227
|
+
}, [c, t, ne]), Ie = H((b, w, J) => {
|
|
5216
5228
|
if (!n) {
|
|
5217
|
-
|
|
5229
|
+
c == null || c(b), t && ne(b);
|
|
5218
5230
|
return;
|
|
5219
5231
|
}
|
|
5220
|
-
const X =
|
|
5221
|
-
if (J.shiftKey &&
|
|
5222
|
-
const te = Math.min(
|
|
5223
|
-
|
|
5232
|
+
const X = b.uid;
|
|
5233
|
+
if (J.shiftKey && z !== null) {
|
|
5234
|
+
const te = Math.min(z, w), ee = Math.max(z, w), Ve = k.slice(te, ee + 1).map((Ne) => Ne.uid), xe = new Set(Ve);
|
|
5235
|
+
V(xe), d == null || d(Array.from(xe));
|
|
5224
5236
|
} else if (J.ctrlKey || J.metaKey)
|
|
5225
|
-
|
|
5237
|
+
V((te) => {
|
|
5226
5238
|
const ee = new Set(te);
|
|
5227
|
-
return ee.has(X) ? ee.delete(X) : ee.add(X),
|
|
5228
|
-
}),
|
|
5239
|
+
return ee.has(X) ? ee.delete(X) : ee.add(X), d == null || d(Array.from(ee)), ee;
|
|
5240
|
+
}), S(w);
|
|
5229
5241
|
else {
|
|
5230
5242
|
const te = /* @__PURE__ */ new Set([X]);
|
|
5231
|
-
|
|
5243
|
+
V(te), S(w), d == null || d(Array.from(te));
|
|
5232
5244
|
}
|
|
5233
|
-
}, [n,
|
|
5234
|
-
if (!(!
|
|
5245
|
+
}, [n, z, k, x, c, d, t]), Ae = H(async () => {
|
|
5246
|
+
if (!(!W || x.size === 0))
|
|
5235
5247
|
try {
|
|
5236
|
-
const
|
|
5237
|
-
if (console.log("Trash result:",
|
|
5238
|
-
y((J) => J.filter((X) => !
|
|
5239
|
-
const
|
|
5240
|
-
|
|
5248
|
+
const b = await W.trashEmails(r, Array.from(x));
|
|
5249
|
+
if (console.log("Trash result:", b), b.success && b.moved > 0) {
|
|
5250
|
+
y((J) => J.filter((X) => !x.has(X.uid)));
|
|
5251
|
+
const w = Array.from(x);
|
|
5252
|
+
V(/* @__PURE__ */ new Set()), p == null || p(w);
|
|
5241
5253
|
} else
|
|
5242
|
-
|
|
5243
|
-
} catch (
|
|
5244
|
-
const
|
|
5245
|
-
console.error("Trash error:",
|
|
5254
|
+
N("Failed to move emails to trash");
|
|
5255
|
+
} catch (b) {
|
|
5256
|
+
const w = b instanceof Error ? b : new Error("Trash failed");
|
|
5257
|
+
console.error("Trash error:", w), N(w.message), m == null || m(w);
|
|
5246
5258
|
}
|
|
5247
|
-
}, [
|
|
5248
|
-
if (!(!
|
|
5259
|
+
}, [W, r, x, p, m]), be = H(async () => {
|
|
5260
|
+
if (!(!W || x.size === 0))
|
|
5249
5261
|
try {
|
|
5250
|
-
const
|
|
5251
|
-
if (console.log("Archive result:",
|
|
5252
|
-
y((J) => J.filter((X) => !
|
|
5253
|
-
const
|
|
5254
|
-
|
|
5262
|
+
const b = await W.archiveEmails(r, Array.from(x));
|
|
5263
|
+
if (console.log("Archive result:", b), b.success && b.archived > 0) {
|
|
5264
|
+
y((J) => J.filter((X) => !x.has(X.uid)));
|
|
5265
|
+
const w = Array.from(x);
|
|
5266
|
+
V(/* @__PURE__ */ new Set()), p == null || p(w);
|
|
5255
5267
|
} else
|
|
5256
|
-
|
|
5257
|
-
} catch (
|
|
5258
|
-
const
|
|
5259
|
-
console.error("Archive error:",
|
|
5268
|
+
N("Failed to archive emails");
|
|
5269
|
+
} catch (b) {
|
|
5270
|
+
const w = b instanceof Error ? b : new Error("Archive failed");
|
|
5271
|
+
console.error("Archive error:", w), N(w.message), m == null || m(w);
|
|
5260
5272
|
}
|
|
5261
|
-
}, [
|
|
5262
|
-
if (
|
|
5263
|
-
|
|
5273
|
+
}, [W, r, x, p, m]), ie = H(() => {
|
|
5274
|
+
if (x.size === k.length)
|
|
5275
|
+
V(/* @__PURE__ */ new Set()), d == null || d([]);
|
|
5264
5276
|
else {
|
|
5265
|
-
const
|
|
5266
|
-
|
|
5277
|
+
const b = new Set(k.map((w) => w.uid));
|
|
5278
|
+
V(b), d == null || d(Array.from(b));
|
|
5267
5279
|
}
|
|
5268
|
-
}, [
|
|
5269
|
-
|
|
5270
|
-
}, [
|
|
5280
|
+
}, [k, x.size, d]), ye = H(() => {
|
|
5281
|
+
V(/* @__PURE__ */ new Set()), d == null || d([]);
|
|
5282
|
+
}, [d]), oe = {
|
|
5271
5283
|
delete: Ae,
|
|
5272
5284
|
archive: be,
|
|
5273
5285
|
refresh: re,
|
|
5274
5286
|
selectAll: ie,
|
|
5275
5287
|
clearSelection: ye
|
|
5276
|
-
}, $e = (
|
|
5277
|
-
if (!
|
|
5278
|
-
const
|
|
5279
|
-
return
|
|
5280
|
-
}, Se = (
|
|
5288
|
+
}, $e = (b) => {
|
|
5289
|
+
if (!b) return "";
|
|
5290
|
+
const w = new Date(b), J = /* @__PURE__ */ new Date();
|
|
5291
|
+
return w.toDateString() === J.toDateString() ? w.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : w.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
5292
|
+
}, Se = (b, w) => /* @__PURE__ */ f.jsx("div", { style: {
|
|
5281
5293
|
padding: "12px 16px",
|
|
5282
|
-
background:
|
|
5283
|
-
borderBottom: `1px solid ${
|
|
5294
|
+
background: w ? g.selectedBackground : b.seen ? g.cardBackground : g.unreadBackground,
|
|
5295
|
+
borderBottom: `1px solid ${g.border}`,
|
|
5284
5296
|
cursor: "pointer",
|
|
5285
5297
|
transition: "background 0.15s ease"
|
|
5286
5298
|
}, children: /* @__PURE__ */ f.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "12px" }, children: [
|
|
5287
5299
|
/* @__PURE__ */ f.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
5288
5300
|
/* @__PURE__ */ f.jsx("div", { style: {
|
|
5289
5301
|
fontSize: "14px",
|
|
5290
|
-
fontWeight:
|
|
5291
|
-
color:
|
|
5302
|
+
fontWeight: b.seen ? 400 : 600,
|
|
5303
|
+
color: g.text,
|
|
5292
5304
|
whiteSpace: "nowrap",
|
|
5293
5305
|
overflow: "hidden",
|
|
5294
5306
|
textOverflow: "ellipsis"
|
|
5295
|
-
}, children:
|
|
5307
|
+
}, children: Re(b.from).split("@")[0] }),
|
|
5296
5308
|
/* @__PURE__ */ f.jsx("div", { style: {
|
|
5297
5309
|
fontSize: "14px",
|
|
5298
|
-
fontWeight:
|
|
5299
|
-
color:
|
|
5310
|
+
fontWeight: b.seen ? 400 : 500,
|
|
5311
|
+
color: b.seen ? g.textSecondary : g.text,
|
|
5300
5312
|
marginTop: "2px",
|
|
5301
5313
|
whiteSpace: "nowrap",
|
|
5302
5314
|
overflow: "hidden",
|
|
5303
5315
|
textOverflow: "ellipsis"
|
|
5304
|
-
}, children:
|
|
5316
|
+
}, children: Re(b.subject) || "(No subject)" })
|
|
5305
5317
|
] }),
|
|
5306
5318
|
/* @__PURE__ */ f.jsx("div", { style: {
|
|
5307
5319
|
fontSize: "12px",
|
|
5308
|
-
color:
|
|
5320
|
+
color: g.textSecondary,
|
|
5309
5321
|
flexShrink: 0
|
|
5310
|
-
}, children: $e(
|
|
5311
|
-
] }) }), Me = (
|
|
5312
|
-
/* @__PURE__ */ f.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color:
|
|
5313
|
-
/* @__PURE__ */ f.jsxs("div", { style: { fontSize: "14px", color:
|
|
5322
|
+
}, children: $e(b.date) })
|
|
5323
|
+
] }) }), Me = (b) => /* @__PURE__ */ f.jsxs("div", { style: { padding: "24px" }, children: [
|
|
5324
|
+
/* @__PURE__ */ f.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: g.text }, children: Re(b.subject) || "(No subject)" }),
|
|
5325
|
+
/* @__PURE__ */ f.jsxs("div", { style: { fontSize: "14px", color: g.textSecondary, marginBottom: "16px" }, children: [
|
|
5314
5326
|
"From: ",
|
|
5315
|
-
|
|
5327
|
+
Re(b.from),
|
|
5316
5328
|
" • ",
|
|
5317
|
-
new Date(
|
|
5329
|
+
new Date(b.date).toLocaleString()
|
|
5318
5330
|
] }),
|
|
5319
|
-
Te ? /* @__PURE__ */ f.jsx("div", { style: { fontSize: "14px", color:
|
|
5331
|
+
Te ? /* @__PURE__ */ f.jsx("div", { style: { fontSize: "14px", color: g.textSecondary }, children: "Loading..." }) : ge ? /* @__PURE__ */ f.jsx(
|
|
5320
5332
|
"div",
|
|
5321
5333
|
{
|
|
5322
|
-
style: { fontSize: "14px", color:
|
|
5334
|
+
style: { fontSize: "14px", color: g.text },
|
|
5323
5335
|
dangerouslySetInnerHTML: { __html: ge }
|
|
5324
5336
|
}
|
|
5325
|
-
) : /* @__PURE__ */ f.jsx("div", { style: { fontSize: "14px", color:
|
|
5326
|
-
] }), ze = (
|
|
5337
|
+
) : /* @__PURE__ */ f.jsx("div", { style: { fontSize: "14px", color: g.textSecondary }, children: "No content available" })
|
|
5338
|
+
] }), ze = (b, w) => /* @__PURE__ */ f.jsxs("div", { style: {
|
|
5327
5339
|
display: "flex",
|
|
5328
5340
|
alignItems: "center",
|
|
5329
5341
|
gap: "8px",
|
|
5330
5342
|
padding: "8px 16px",
|
|
5331
|
-
background:
|
|
5332
|
-
borderBottom: `1px solid ${
|
|
5343
|
+
background: g.cardBackground,
|
|
5344
|
+
borderBottom: `1px solid ${g.border}`
|
|
5333
5345
|
}, children: [
|
|
5334
5346
|
/* @__PURE__ */ f.jsx(
|
|
5335
5347
|
"button",
|
|
5336
5348
|
{
|
|
5337
|
-
onClick:
|
|
5349
|
+
onClick: w.selectAll,
|
|
5338
5350
|
style: {
|
|
5339
5351
|
padding: "6px 12px",
|
|
5340
5352
|
background: "transparent",
|
|
5341
|
-
border: `1px solid ${
|
|
5353
|
+
border: `1px solid ${g.border}`,
|
|
5342
5354
|
borderRadius: "6px",
|
|
5343
5355
|
fontSize: "13px",
|
|
5344
5356
|
cursor: "pointer",
|
|
5345
|
-
color:
|
|
5357
|
+
color: g.text
|
|
5346
5358
|
},
|
|
5347
|
-
children:
|
|
5359
|
+
children: b.length === k.length ? "Deselect All" : "Select All"
|
|
5348
5360
|
}
|
|
5349
5361
|
),
|
|
5350
|
-
|
|
5351
|
-
/* @__PURE__ */ f.jsxs("span", { style: { fontSize: "13px", color:
|
|
5352
|
-
|
|
5362
|
+
b.length > 0 && /* @__PURE__ */ f.jsxs(f.Fragment, { children: [
|
|
5363
|
+
/* @__PURE__ */ f.jsxs("span", { style: { fontSize: "13px", color: g.textSecondary }, children: [
|
|
5364
|
+
b.length,
|
|
5353
5365
|
" selected"
|
|
5354
5366
|
] }),
|
|
5355
5367
|
/* @__PURE__ */ f.jsx(
|
|
5356
5368
|
"button",
|
|
5357
5369
|
{
|
|
5358
|
-
onClick:
|
|
5370
|
+
onClick: w.archive,
|
|
5359
5371
|
title: "Archive",
|
|
5360
5372
|
style: {
|
|
5361
5373
|
display: "flex",
|
|
@@ -5364,10 +5376,10 @@ function kr({
|
|
|
5364
5376
|
width: "32px",
|
|
5365
5377
|
height: "32px",
|
|
5366
5378
|
background: "transparent",
|
|
5367
|
-
border: `1px solid ${
|
|
5379
|
+
border: `1px solid ${g.border}`,
|
|
5368
5380
|
borderRadius: "6px",
|
|
5369
5381
|
cursor: "pointer",
|
|
5370
|
-
color:
|
|
5382
|
+
color: g.textSecondary
|
|
5371
5383
|
},
|
|
5372
5384
|
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "archive" })
|
|
5373
5385
|
}
|
|
@@ -5375,7 +5387,7 @@ function kr({
|
|
|
5375
5387
|
/* @__PURE__ */ f.jsx(
|
|
5376
5388
|
"button",
|
|
5377
5389
|
{
|
|
5378
|
-
onClick:
|
|
5390
|
+
onClick: w.delete,
|
|
5379
5391
|
title: "Delete",
|
|
5380
5392
|
style: {
|
|
5381
5393
|
display: "flex",
|
|
@@ -5384,10 +5396,10 @@ function kr({
|
|
|
5384
5396
|
width: "32px",
|
|
5385
5397
|
height: "32px",
|
|
5386
5398
|
background: "transparent",
|
|
5387
|
-
border: `1px solid ${
|
|
5399
|
+
border: `1px solid ${g.border}`,
|
|
5388
5400
|
borderRadius: "6px",
|
|
5389
5401
|
cursor: "pointer",
|
|
5390
|
-
color:
|
|
5402
|
+
color: g.textSecondary
|
|
5391
5403
|
},
|
|
5392
5404
|
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "delete" })
|
|
5393
5405
|
}
|
|
@@ -5397,7 +5409,7 @@ function kr({
|
|
|
5397
5409
|
/* @__PURE__ */ f.jsx(
|
|
5398
5410
|
"button",
|
|
5399
5411
|
{
|
|
5400
|
-
onClick:
|
|
5412
|
+
onClick: w.refresh,
|
|
5401
5413
|
title: "Refresh",
|
|
5402
5414
|
style: {
|
|
5403
5415
|
display: "flex",
|
|
@@ -5406,10 +5418,10 @@ function kr({
|
|
|
5406
5418
|
width: "32px",
|
|
5407
5419
|
height: "32px",
|
|
5408
5420
|
background: "transparent",
|
|
5409
|
-
border: `1px solid ${
|
|
5421
|
+
border: `1px solid ${g.border}`,
|
|
5410
5422
|
borderRadius: "6px",
|
|
5411
5423
|
cursor: "pointer",
|
|
5412
|
-
color:
|
|
5424
|
+
color: g.textSecondary
|
|
5413
5425
|
},
|
|
5414
5426
|
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
5415
5427
|
}
|
|
@@ -5417,39 +5429,155 @@ function kr({
|
|
|
5417
5429
|
] }), le = () => /* @__PURE__ */ f.jsx("div", { style: {
|
|
5418
5430
|
padding: "48px",
|
|
5419
5431
|
textAlign: "center",
|
|
5420
|
-
color:
|
|
5432
|
+
color: g.textSecondary
|
|
5421
5433
|
}, children: i }), ue = () => /* @__PURE__ */ f.jsx("div", { style: {
|
|
5422
5434
|
padding: "48px",
|
|
5423
5435
|
textAlign: "center",
|
|
5424
|
-
color:
|
|
5425
|
-
}, children: "Loading..." }),
|
|
5426
|
-
return q &&
|
|
5436
|
+
color: g.textSecondary
|
|
5437
|
+
}, children: "Loading..." }), je = E || Se, qe = B || Me, ce = M || ze, Ge = L || le, He = C || ue;
|
|
5438
|
+
return q && k.length === 0 ? /* @__PURE__ */ f.jsx("div", { style: { background: g.background, width: "100%", height: "100%" }, children: He() }) : /* @__PURE__ */ f.jsxs("div", { style: { display: "flex", background: g.background, width: "100%", height: "100%" }, children: [
|
|
5427
5439
|
/* @__PURE__ */ f.jsxs("div", { style: {
|
|
5428
|
-
flex: t &&
|
|
5440
|
+
flex: t && G ? "0 0 50%" : "1",
|
|
5429
5441
|
display: "flex",
|
|
5430
5442
|
flexDirection: "column",
|
|
5431
|
-
borderRight: t &&
|
|
5443
|
+
borderRight: t && G ? `1px solid ${g.border}` : "none",
|
|
5432
5444
|
overflow: "hidden"
|
|
5433
5445
|
}, children: [
|
|
5434
|
-
n && ce(Array.from(
|
|
5435
|
-
|
|
5446
|
+
n && ce(Array.from(x), oe),
|
|
5447
|
+
F && /* @__PURE__ */ f.jsx("div", { style: {
|
|
5436
5448
|
padding: "12px 16px",
|
|
5437
5449
|
background: "#fef2f2",
|
|
5438
|
-
color:
|
|
5450
|
+
color: g.danger,
|
|
5439
5451
|
fontSize: "14px",
|
|
5440
|
-
borderBottom: `1px solid ${
|
|
5441
|
-
}, children:
|
|
5442
|
-
/* @__PURE__ */ f.jsx("div", { style: { flex: 1, overflowY: "auto" }, children:
|
|
5452
|
+
borderBottom: `1px solid ${g.border}`
|
|
5453
|
+
}, children: F }),
|
|
5454
|
+
/* @__PURE__ */ f.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: k.length === 0 ? Ge() : k.map((b, w) => /* @__PURE__ */ f.jsx(
|
|
5443
5455
|
"div",
|
|
5444
5456
|
{
|
|
5445
|
-
onClick: (J) => Ie(
|
|
5446
|
-
onDoubleClick: () => Ue(
|
|
5447
|
-
children:
|
|
5457
|
+
onClick: (J) => Ie(b, w, J),
|
|
5458
|
+
onDoubleClick: () => Ue(b),
|
|
5459
|
+
children: je(b, x.has(b.uid))
|
|
5448
5460
|
},
|
|
5449
|
-
|
|
5461
|
+
b.uid
|
|
5450
5462
|
)) })
|
|
5451
5463
|
] }),
|
|
5452
|
-
t &&
|
|
5464
|
+
t && G && /* @__PURE__ */ f.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: qe(G) })
|
|
5465
|
+
] });
|
|
5466
|
+
}
|
|
5467
|
+
function Fr({
|
|
5468
|
+
items: o,
|
|
5469
|
+
renderItem: e,
|
|
5470
|
+
onSelectionChange: r,
|
|
5471
|
+
onCurrentChange: u,
|
|
5472
|
+
onAction: s,
|
|
5473
|
+
actions: n = [],
|
|
5474
|
+
emptyMessage: t = "No items",
|
|
5475
|
+
showSelectAll: i = !0,
|
|
5476
|
+
className: l = ""
|
|
5477
|
+
}) {
|
|
5478
|
+
const [c, d] = P(/* @__PURE__ */ new Set()), [p, m] = P(-1), D = o.filter((g) => c.has(g.id)), E = p >= 0 && p < D.length ? D[p] : null, B = H((g) => {
|
|
5479
|
+
d((k) => {
|
|
5480
|
+
const y = new Set(k);
|
|
5481
|
+
return y.has(g) ? y.delete(g) : y.add(g), r == null || r(Array.from(y)), y;
|
|
5482
|
+
});
|
|
5483
|
+
}, [r]), M = H(() => {
|
|
5484
|
+
if (c.size === o.length)
|
|
5485
|
+
d(/* @__PURE__ */ new Set()), m(-1), r == null || r([]);
|
|
5486
|
+
else {
|
|
5487
|
+
const g = new Set(o.map((k) => k.id));
|
|
5488
|
+
d(g), o.length > 0 && (m(0), u == null || u(o[0], 0)), r == null || r(o.map((k) => k.id));
|
|
5489
|
+
}
|
|
5490
|
+
}, [o, c.size, r, u]), L = H(() => {
|
|
5491
|
+
if (D.length === 0) return;
|
|
5492
|
+
const g = p <= 0 ? D.length - 1 : p - 1;
|
|
5493
|
+
m(g), u == null || u(D[g], g);
|
|
5494
|
+
}, [D, p, u]), C = H(() => {
|
|
5495
|
+
if (D.length === 0) return;
|
|
5496
|
+
const g = p >= D.length - 1 ? 0 : p + 1;
|
|
5497
|
+
m(g), u == null || u(D[g], g);
|
|
5498
|
+
}, [D, p, u]), U = H((g) => {
|
|
5499
|
+
s == null || s(g, D, E);
|
|
5500
|
+
}, [s, D, E]);
|
|
5501
|
+
return st.useEffect(() => {
|
|
5502
|
+
D.length === 0 ? m(-1) : p >= D.length ? m(D.length - 1) : p < 0 && D.length > 0 && (m(0), u == null || u(D[0], 0));
|
|
5503
|
+
}, [D.length, p, u]), o.length === 0 ? /* @__PURE__ */ f.jsx("div", { className: `text-sm text-neutral-400 text-center py-4 ${l}`, children: t }) : /* @__PURE__ */ f.jsxs("div", { className: `space-y-2 ${l}`, children: [
|
|
5504
|
+
/* @__PURE__ */ f.jsxs("div", { className: "flex items-center justify-between text-xs text-neutral-500", children: [
|
|
5505
|
+
/* @__PURE__ */ f.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5506
|
+
i && /* @__PURE__ */ f.jsxs(
|
|
5507
|
+
"button",
|
|
5508
|
+
{
|
|
5509
|
+
onClick: M,
|
|
5510
|
+
className: "flex items-center gap-1 hover:text-neutral-700 transition-colors",
|
|
5511
|
+
children: [
|
|
5512
|
+
/* @__PURE__ */ f.jsx("span", { className: "material-icons text-sm", children: c.size === o.length ? "check_box" : c.size > 0 ? "indeterminate_check_box" : "check_box_outline_blank" }),
|
|
5513
|
+
/* @__PURE__ */ f.jsx("span", { children: c.size === o.length ? "Deselect all" : "Select all" })
|
|
5514
|
+
]
|
|
5515
|
+
}
|
|
5516
|
+
),
|
|
5517
|
+
c.size > 0 && /* @__PURE__ */ f.jsxs("span", { className: "text-neutral-400", children: [
|
|
5518
|
+
"(",
|
|
5519
|
+
c.size,
|
|
5520
|
+
" selected)"
|
|
5521
|
+
] })
|
|
5522
|
+
] }),
|
|
5523
|
+
D.length > 1 && /* @__PURE__ */ f.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
5524
|
+
/* @__PURE__ */ f.jsx(
|
|
5525
|
+
"button",
|
|
5526
|
+
{
|
|
5527
|
+
onClick: L,
|
|
5528
|
+
className: "p-1 hover:bg-neutral-100 rounded transition-colors",
|
|
5529
|
+
title: "Previous",
|
|
5530
|
+
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons text-sm", children: "chevron_left" })
|
|
5531
|
+
}
|
|
5532
|
+
),
|
|
5533
|
+
/* @__PURE__ */ f.jsxs("span", { className: "text-xs min-w-[3rem] text-center", children: [
|
|
5534
|
+
p + 1,
|
|
5535
|
+
" / ",
|
|
5536
|
+
D.length
|
|
5537
|
+
] }),
|
|
5538
|
+
/* @__PURE__ */ f.jsx(
|
|
5539
|
+
"button",
|
|
5540
|
+
{
|
|
5541
|
+
onClick: C,
|
|
5542
|
+
className: "p-1 hover:bg-neutral-100 rounded transition-colors",
|
|
5543
|
+
title: "Next",
|
|
5544
|
+
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons text-sm", children: "chevron_right" })
|
|
5545
|
+
}
|
|
5546
|
+
)
|
|
5547
|
+
] })
|
|
5548
|
+
] }),
|
|
5549
|
+
/* @__PURE__ */ f.jsx("div", { className: "space-y-1", children: o.map((g) => {
|
|
5550
|
+
const k = c.has(g.id), y = (E == null ? void 0 : E.id) === g.id;
|
|
5551
|
+
return /* @__PURE__ */ f.jsxs(
|
|
5552
|
+
"div",
|
|
5553
|
+
{
|
|
5554
|
+
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${y ? "bg-blue-50 ring-1 ring-blue-200" : k ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
|
|
5555
|
+
onClick: () => B(g.id),
|
|
5556
|
+
children: [
|
|
5557
|
+
/* @__PURE__ */ f.jsx("span", { className: `material-icons text-lg ${k ? "text-blue-500" : "text-neutral-300"}`, children: k ? "check_box" : "check_box_outline_blank" }),
|
|
5558
|
+
/* @__PURE__ */ f.jsx("div", { className: "flex-1 min-w-0", children: e(g, k, y) })
|
|
5559
|
+
]
|
|
5560
|
+
},
|
|
5561
|
+
g.id
|
|
5562
|
+
);
|
|
5563
|
+
}) }),
|
|
5564
|
+
n.length > 0 && c.size > 0 && /* @__PURE__ */ f.jsx("div", { className: "flex items-center gap-2 pt-2 border-t border-neutral-100", children: n.map((g) => {
|
|
5565
|
+
var y;
|
|
5566
|
+
const k = ((y = g.disabled) == null ? void 0 : y.call(g, D)) ?? !1;
|
|
5567
|
+
return /* @__PURE__ */ f.jsxs(
|
|
5568
|
+
"button",
|
|
5569
|
+
{
|
|
5570
|
+
onClick: () => U(g.id),
|
|
5571
|
+
disabled: k,
|
|
5572
|
+
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${k ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
|
|
5573
|
+
children: [
|
|
5574
|
+
g.icon && /* @__PURE__ */ f.jsx("span", { className: "material-icons text-sm", children: g.icon }),
|
|
5575
|
+
g.label
|
|
5576
|
+
]
|
|
5577
|
+
},
|
|
5578
|
+
g.id
|
|
5579
|
+
);
|
|
5580
|
+
}) })
|
|
5453
5581
|
] });
|
|
5454
5582
|
}
|
|
5455
5583
|
export {
|
|
@@ -5462,9 +5590,10 @@ export {
|
|
|
5462
5590
|
yr as GraphClient,
|
|
5463
5591
|
kr as Mail,
|
|
5464
5592
|
cr as MailClient,
|
|
5465
|
-
|
|
5593
|
+
Fr as SelectableList,
|
|
5594
|
+
Er as Stack,
|
|
5466
5595
|
Ct as getApiClient,
|
|
5467
|
-
|
|
5468
|
-
|
|
5596
|
+
xr as initializeApiClient,
|
|
5597
|
+
vr as useMutation,
|
|
5469
5598
|
pr as useQuery
|
|
5470
5599
|
};
|