@qwanyx/stack 0.2.9 → 0.2.11
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 +5 -0
- package/dist/index.cjs.js +11 -11
- package/dist/index.esm.js +774 -721
- package/dist/types/index.d.ts +14 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import tt, { useState as
|
|
1
|
+
var Et = Object.defineProperty;
|
|
2
|
+
var _t = (h, t, r) => t in h ? Et(h, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : h[t] = r;
|
|
3
|
+
var he = (h, t, r) => _t(h, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import tt, { useState as z, useCallback as X, useEffect as de, useMemo as rt, useRef as Qe } from "react";
|
|
5
5
|
class $t {
|
|
6
6
|
constructor(t) {
|
|
7
|
-
|
|
7
|
+
he(this, "config");
|
|
8
8
|
// ===== FILE OPERATIONS =====
|
|
9
9
|
/**
|
|
10
10
|
* Options for file upload
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
he(this, "defaultUploadOptions", {
|
|
13
13
|
maxSizeMB: 10,
|
|
14
14
|
maxImageDimension: 0,
|
|
15
15
|
// 0 = no resize
|
|
@@ -30,7 +30,7 @@ class $t {
|
|
|
30
30
|
params: r
|
|
31
31
|
};
|
|
32
32
|
try {
|
|
33
|
-
const
|
|
33
|
+
const i = 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 $t {
|
|
|
38
38
|
},
|
|
39
39
|
body: JSON.stringify(n)
|
|
40
40
|
});
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
throw new Error(`API error (${
|
|
41
|
+
if (!i.ok) {
|
|
42
|
+
const o = await i.text();
|
|
43
|
+
throw new Error(`API error (${i.status}): ${o}`);
|
|
44
44
|
}
|
|
45
|
-
const s = await
|
|
45
|
+
const s = await i.json();
|
|
46
46
|
if (!s.success && s.error)
|
|
47
47
|
throw new Error(s.error);
|
|
48
48
|
return s;
|
|
49
|
-
} catch (
|
|
50
|
-
throw console.error("Graph API call failed:",
|
|
49
|
+
} catch (i) {
|
|
50
|
+
throw console.error("Graph API call failed:", i), i;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -96,10 +96,10 @@ class $t {
|
|
|
96
96
|
...r,
|
|
97
97
|
modified: (/* @__PURE__ */ new Date()).toISOString()
|
|
98
98
|
}
|
|
99
|
-
},
|
|
100
|
-
if (!
|
|
99
|
+
}, i = await this.callGraph("update_node", n);
|
|
100
|
+
if (!i.result)
|
|
101
101
|
throw new Error("Failed to update node");
|
|
102
|
-
return
|
|
102
|
+
return i.result;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Delete a node
|
|
@@ -114,23 +114,23 @@ class $t {
|
|
|
114
114
|
/**
|
|
115
115
|
* Get children with edges (supports different display modes)
|
|
116
116
|
*/
|
|
117
|
-
async getChildrenWithEdges(t, r = "children", n,
|
|
117
|
+
async getChildrenWithEdges(t, r = "children", n, i) {
|
|
118
118
|
return (await this.callGraph("get_children_with_edges", {
|
|
119
119
|
node_id: t,
|
|
120
120
|
display_mode: r,
|
|
121
121
|
edge_type: n,
|
|
122
|
-
node_type:
|
|
122
|
+
node_type: i
|
|
123
123
|
})).result || [];
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
126
|
* Add an edge between two nodes
|
|
127
127
|
*/
|
|
128
|
-
async addEdge(t, r, n = "link",
|
|
128
|
+
async addEdge(t, r, n = "link", i) {
|
|
129
129
|
return await this.callGraph("add_edge", {
|
|
130
130
|
source_id: t,
|
|
131
131
|
target_id: r,
|
|
132
132
|
edge_type: n,
|
|
133
|
-
data:
|
|
133
|
+
data: i
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
@@ -209,11 +209,11 @@ class $t {
|
|
|
209
209
|
*/
|
|
210
210
|
fileToBase64(t) {
|
|
211
211
|
return new Promise((r, n) => {
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
r(
|
|
216
|
-
},
|
|
212
|
+
const i = new FileReader();
|
|
213
|
+
i.onload = () => {
|
|
214
|
+
const o = i.result.split(",")[1];
|
|
215
|
+
r(o);
|
|
216
|
+
}, i.onerror = () => n(new Error("Failed to read file")), i.readAsDataURL(t);
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
/**
|
|
@@ -221,38 +221,38 @@ class $t {
|
|
|
221
221
|
* Returns the original file if not an image or no resize needed
|
|
222
222
|
*/
|
|
223
223
|
async resizeImage(t, r, n) {
|
|
224
|
-
return t.type.startsWith("image/") ? new Promise((
|
|
225
|
-
const s = new Image(),
|
|
224
|
+
return t.type.startsWith("image/") ? new Promise((i) => {
|
|
225
|
+
const s = new Image(), o = URL.createObjectURL(t);
|
|
226
226
|
s.onload = () => {
|
|
227
|
-
if (URL.revokeObjectURL(
|
|
228
|
-
|
|
227
|
+
if (URL.revokeObjectURL(o), s.width <= r && s.height <= r) {
|
|
228
|
+
i(t);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
let
|
|
232
|
-
s.width > s.height ? (
|
|
231
|
+
let p, u;
|
|
232
|
+
s.width > s.height ? (p = r, u = Math.round(s.height / s.width * r)) : (u = r, p = Math.round(s.width / s.height * r));
|
|
233
233
|
const g = document.createElement("canvas");
|
|
234
|
-
g.width =
|
|
235
|
-
const
|
|
236
|
-
if (!
|
|
237
|
-
|
|
234
|
+
g.width = p, g.height = u;
|
|
235
|
+
const c = g.getContext("2d");
|
|
236
|
+
if (!c) {
|
|
237
|
+
i(t);
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
|
|
241
|
-
const
|
|
240
|
+
c.drawImage(s, 0, 0, p, u);
|
|
241
|
+
const _ = t.type === "image/png" ? "image/png" : "image/jpeg";
|
|
242
242
|
g.toBlob(
|
|
243
243
|
(x) => {
|
|
244
244
|
if (x) {
|
|
245
|
-
const
|
|
246
|
-
|
|
245
|
+
const m = new File([x], t.name, { type: _ });
|
|
246
|
+
i(m);
|
|
247
247
|
} else
|
|
248
|
-
|
|
248
|
+
i(t);
|
|
249
249
|
},
|
|
250
|
-
|
|
250
|
+
_,
|
|
251
251
|
n
|
|
252
252
|
);
|
|
253
253
|
}, s.onerror = () => {
|
|
254
|
-
URL.revokeObjectURL(
|
|
255
|
-
}, s.src =
|
|
254
|
+
URL.revokeObjectURL(o), i(t);
|
|
255
|
+
}, s.src = o;
|
|
256
256
|
}) : t;
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
@@ -262,27 +262,27 @@ class $t {
|
|
|
262
262
|
* @param file - The File object to upload
|
|
263
263
|
* @param options - Upload options (maxSizeMB, maxImageDimension, imageQuality)
|
|
264
264
|
*/
|
|
265
|
-
async uploadFile(t, r, n,
|
|
266
|
-
const s = { ...this.defaultUploadOptions, ...
|
|
265
|
+
async uploadFile(t, r, n, i = {}) {
|
|
266
|
+
const s = { ...this.defaultUploadOptions, ...i };
|
|
267
267
|
try {
|
|
268
|
-
let
|
|
269
|
-
s.maxImageDimension > 0 && n.type.startsWith("image/") && (
|
|
270
|
-
const
|
|
271
|
-
if (
|
|
268
|
+
let o = n;
|
|
269
|
+
s.maxImageDimension > 0 && n.type.startsWith("image/") && (o = await this.resizeImage(n, s.maxImageDimension, s.imageQuality));
|
|
270
|
+
const p = s.maxSizeMB * 1024 * 1024;
|
|
271
|
+
if (o.size > p)
|
|
272
272
|
return {
|
|
273
273
|
success: !1,
|
|
274
|
-
error: `File too large (${(
|
|
274
|
+
error: `File too large (${(o.size / 1024 / 1024).toFixed(1)} MB). Max: ${s.maxSizeMB} MB`
|
|
275
275
|
};
|
|
276
|
-
const
|
|
276
|
+
const u = await this.fileToBase64(o), g = await this.callGraph("upload_file", {
|
|
277
277
|
node_id: t,
|
|
278
278
|
filename: r,
|
|
279
|
-
content:
|
|
279
|
+
content: u
|
|
280
280
|
});
|
|
281
281
|
return g.success ? { success: !0, path: g.path } : { success: !1, error: g.error || "Upload failed" };
|
|
282
|
-
} catch (
|
|
282
|
+
} catch (o) {
|
|
283
283
|
return {
|
|
284
284
|
success: !1,
|
|
285
|
-
error:
|
|
285
|
+
error: o instanceof Error ? o.message : "Upload failed"
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -291,10 +291,10 @@ class $t {
|
|
|
291
291
|
* @param nodeId - The node to list files for
|
|
292
292
|
*/
|
|
293
293
|
async listFiles(t) {
|
|
294
|
-
var
|
|
295
|
-
return (((
|
|
294
|
+
var i;
|
|
295
|
+
return (((i = (await this.callGraph("list_files", {
|
|
296
296
|
node_id: t
|
|
297
|
-
})).result) == null ? void 0 :
|
|
297
|
+
})).result) == null ? void 0 : i.files) || []).map((s) => ({
|
|
298
298
|
filename: s.name,
|
|
299
299
|
path: s.path
|
|
300
300
|
}));
|
|
@@ -319,9 +319,9 @@ class $t {
|
|
|
319
319
|
return `${this.config.baseUrl}/files/${this.config.system_id}/${t}/${r}`;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
class
|
|
322
|
+
class jt {
|
|
323
323
|
constructor(t) {
|
|
324
|
-
|
|
324
|
+
he(this, "config");
|
|
325
325
|
if (!t.system_id)
|
|
326
326
|
throw new Error("MailClient: system_id is REQUIRED");
|
|
327
327
|
this.config = t;
|
|
@@ -330,7 +330,7 @@ class Et {
|
|
|
330
330
|
* Call a coprocessor (default: mail)
|
|
331
331
|
*/
|
|
332
332
|
async callCoprocessor(t, r, n = {}) {
|
|
333
|
-
const
|
|
333
|
+
const i = {
|
|
334
334
|
coprocessor: t,
|
|
335
335
|
method: r,
|
|
336
336
|
system_id: this.config.system_id,
|
|
@@ -346,16 +346,16 @@ class Et {
|
|
|
346
346
|
"Content-Type": "application/json",
|
|
347
347
|
Authorization: `Bearer ${this.getToken()}`
|
|
348
348
|
},
|
|
349
|
-
body: JSON.stringify(
|
|
349
|
+
body: JSON.stringify(i)
|
|
350
350
|
});
|
|
351
351
|
if (!s.ok) {
|
|
352
|
-
const
|
|
353
|
-
throw new Error(`API error (${s.status}): ${
|
|
352
|
+
const p = await s.text();
|
|
353
|
+
throw new Error(`API error (${s.status}): ${p}`);
|
|
354
354
|
}
|
|
355
|
-
const
|
|
356
|
-
if (!
|
|
357
|
-
throw new Error(
|
|
358
|
-
return
|
|
355
|
+
const o = await s.json();
|
|
356
|
+
if (!o.success && o.error)
|
|
357
|
+
throw new Error(o.error);
|
|
358
|
+
return o.result;
|
|
359
359
|
} catch (s) {
|
|
360
360
|
throw console.error("API call failed:", s), s;
|
|
361
361
|
}
|
|
@@ -436,13 +436,13 @@ class Et {
|
|
|
436
436
|
*/
|
|
437
437
|
async trashEmails(t, r) {
|
|
438
438
|
const n = ["[Gmail]/Trash", "[Gmail]/Corbeille", "[Gmail]/Bin", "Trash"];
|
|
439
|
-
for (const
|
|
439
|
+
for (const i of n) {
|
|
440
440
|
const s = [
|
|
441
441
|
"SELECT INBOX",
|
|
442
|
-
...r.map((
|
|
443
|
-
],
|
|
444
|
-
if (
|
|
445
|
-
return { success: !0, moved:
|
|
442
|
+
...r.map((u) => `UID MOVE ${u} ${i}`)
|
|
443
|
+
], p = (await this.imapExec(t, s)).responses.filter((u) => u.ok && u.command === "UID MOVE").length;
|
|
444
|
+
if (p > 0)
|
|
445
|
+
return { success: !0, moved: p };
|
|
446
446
|
}
|
|
447
447
|
return { success: !1, moved: 0 };
|
|
448
448
|
}
|
|
@@ -452,18 +452,68 @@ class Et {
|
|
|
452
452
|
async archiveEmails(t, r) {
|
|
453
453
|
const n = [
|
|
454
454
|
"SELECT INBOX",
|
|
455
|
-
...r.map((
|
|
455
|
+
...r.map((o) => `UID STORE ${o} +FLAGS (\\Deleted)`),
|
|
456
456
|
"EXPUNGE"
|
|
457
|
-
], s = (await this.imapExec(t, n)).responses.filter((
|
|
457
|
+
], s = (await this.imapExec(t, n)).responses.filter((o) => o.ok && o.command === "UID STORE").length;
|
|
458
458
|
return { success: s > 0, archived: s };
|
|
459
459
|
}
|
|
460
460
|
/**
|
|
461
461
|
* List available folders
|
|
462
462
|
*/
|
|
463
463
|
async listFolders(t) {
|
|
464
|
-
const n = (await this.imapExec(t, ['LIST "" *'])).responses.find((
|
|
464
|
+
const n = (await this.imapExec(t, ['LIST "" *'])).responses.find((i) => i.command === "LIST");
|
|
465
465
|
return n != null && n.ok && n.folders ? { success: !0, folders: n.folders } : { success: !1, folders: [] };
|
|
466
466
|
}
|
|
467
|
+
/**
|
|
468
|
+
* List emails using passthrough (imapExec) with client-side sorting
|
|
469
|
+
* This is the preferred method - all logic in TypeScript, backend is just a proxy
|
|
470
|
+
*/
|
|
471
|
+
async listEmailsSorted(t, r = "INBOX", n = 20) {
|
|
472
|
+
const i = await this.imapExec(t, [
|
|
473
|
+
`SELECT ${r}`,
|
|
474
|
+
"FETCH 1:* (UID INTERNALDATE)"
|
|
475
|
+
]), s = i.responses.find((m) => m.command === "SELECT");
|
|
476
|
+
if (!(s != null && s.ok))
|
|
477
|
+
throw new Error(`Failed to select folder: ${(s == null ? void 0 : s.error) || "Unknown error"}`);
|
|
478
|
+
const o = i.responses.find((m) => m.command === "FETCH");
|
|
479
|
+
if (!(o != null && o.ok) || !o.messages)
|
|
480
|
+
return {
|
|
481
|
+
account: { id: t, label: "", email: "" },
|
|
482
|
+
mailbox: { name: r, total: s.exists || 0 },
|
|
483
|
+
messages: []
|
|
484
|
+
};
|
|
485
|
+
const u = [...o.messages].sort((m, T) => {
|
|
486
|
+
const S = m.internalDate ? new Date(m.internalDate).getTime() : 0;
|
|
487
|
+
return (T.internalDate ? new Date(T.internalDate).getTime() : 0) - S;
|
|
488
|
+
}).slice(0, n).map((m) => m.uid).filter(Boolean);
|
|
489
|
+
if (u.length === 0)
|
|
490
|
+
return {
|
|
491
|
+
account: { id: t, label: "", email: "" },
|
|
492
|
+
mailbox: { name: r, total: s.exists || 0 },
|
|
493
|
+
messages: []
|
|
494
|
+
};
|
|
495
|
+
const c = (await this.imapExec(t, [
|
|
496
|
+
`SELECT ${r}`,
|
|
497
|
+
`UID FETCH ${u.join(",")} (UID FLAGS ENVELOPE)`
|
|
498
|
+
])).responses.find((m) => m.command === "UID FETCH");
|
|
499
|
+
if (!(c != null && c.ok) || !c.messages)
|
|
500
|
+
throw new Error(`Failed to fetch details: ${(c == null ? void 0 : c.error) || "Unknown error"}`);
|
|
501
|
+
const _ = /* @__PURE__ */ new Map();
|
|
502
|
+
for (const m of c.messages)
|
|
503
|
+
m.uid && _.set(m.uid, m);
|
|
504
|
+
const x = u.map((m) => {
|
|
505
|
+
var Y, w, D, y, N;
|
|
506
|
+
const T = _.get(m);
|
|
507
|
+
if (!T) return null;
|
|
508
|
+
const S = ((Y = T.flags) == null ? void 0 : Y.some((F) => F.includes("Seen"))) || !1, V = ((D = (w = T.envelope) == null ? void 0 : w.from) == null ? void 0 : D.email) || "Unknown", B = ((y = T.envelope) == null ? void 0 : y.subject) || "(No subject)", $ = ((N = T.envelope) == null ? void 0 : N.date) || "";
|
|
509
|
+
return { uid: m, from: V, subject: B, date: $, seen: S };
|
|
510
|
+
}).filter(Boolean);
|
|
511
|
+
return {
|
|
512
|
+
account: { id: t, label: "", email: "" },
|
|
513
|
+
mailbox: { name: r, total: s.exists || 0 },
|
|
514
|
+
messages: x
|
|
515
|
+
};
|
|
516
|
+
}
|
|
467
517
|
/**
|
|
468
518
|
* Get a single email by UID with full body content
|
|
469
519
|
*/
|
|
@@ -487,37 +537,37 @@ class Et {
|
|
|
487
537
|
return t.html && (r.html = t.html), t.from && (r.from = t.from), t.smtpConfig && (r.smtp_config = t.smtpConfig), this.callEmail("send", r);
|
|
488
538
|
}
|
|
489
539
|
}
|
|
490
|
-
const
|
|
491
|
-
class
|
|
540
|
+
const Ue = "qwanyx_auth_token", Me = "qwanyx_refresh_token";
|
|
541
|
+
class Tt {
|
|
492
542
|
/**
|
|
493
543
|
* Store authentication token
|
|
494
544
|
*/
|
|
495
545
|
static setToken(t) {
|
|
496
|
-
typeof window < "u" && localStorage.setItem(
|
|
546
|
+
typeof window < "u" && localStorage.setItem(Ue, t);
|
|
497
547
|
}
|
|
498
548
|
/**
|
|
499
549
|
* Get authentication token
|
|
500
550
|
*/
|
|
501
551
|
static getToken() {
|
|
502
|
-
return typeof window < "u" ? localStorage.getItem(
|
|
552
|
+
return typeof window < "u" ? localStorage.getItem(Ue) : null;
|
|
503
553
|
}
|
|
504
554
|
/**
|
|
505
555
|
* Remove authentication token
|
|
506
556
|
*/
|
|
507
557
|
static clearToken() {
|
|
508
|
-
typeof window < "u" && (localStorage.removeItem(
|
|
558
|
+
typeof window < "u" && (localStorage.removeItem(Ue), localStorage.removeItem(Me));
|
|
509
559
|
}
|
|
510
560
|
/**
|
|
511
561
|
* Store refresh token
|
|
512
562
|
*/
|
|
513
563
|
static setRefreshToken(t) {
|
|
514
|
-
typeof window < "u" && localStorage.setItem(
|
|
564
|
+
typeof window < "u" && localStorage.setItem(Me, t);
|
|
515
565
|
}
|
|
516
566
|
/**
|
|
517
567
|
* Get refresh token
|
|
518
568
|
*/
|
|
519
569
|
static getRefreshToken() {
|
|
520
|
-
return typeof window < "u" ? localStorage.getItem(
|
|
570
|
+
return typeof window < "u" ? localStorage.getItem(Me) : null;
|
|
521
571
|
}
|
|
522
572
|
/**
|
|
523
573
|
* Check if user is authenticated
|
|
@@ -533,9 +583,9 @@ class Rt {
|
|
|
533
583
|
return t ? { Authorization: `Bearer ${t}` } : {};
|
|
534
584
|
}
|
|
535
585
|
}
|
|
536
|
-
class
|
|
586
|
+
class kt {
|
|
537
587
|
constructor(t) {
|
|
538
|
-
|
|
588
|
+
he(this, "config");
|
|
539
589
|
this.config = {
|
|
540
590
|
timeout: 3e4,
|
|
541
591
|
headers: {
|
|
@@ -551,8 +601,8 @@ class Tt {
|
|
|
551
601
|
if (!t || Object.keys(t).length === 0)
|
|
552
602
|
return "";
|
|
553
603
|
const r = new URLSearchParams();
|
|
554
|
-
Object.entries(t).forEach(([
|
|
555
|
-
s != null && r.append(
|
|
604
|
+
Object.entries(t).forEach(([i, s]) => {
|
|
605
|
+
s != null && r.append(i, String(s));
|
|
556
606
|
});
|
|
557
607
|
const n = r.toString();
|
|
558
608
|
return n ? `?${n}` : "";
|
|
@@ -563,32 +613,32 @@ class Tt {
|
|
|
563
613
|
async request(t, r = {}) {
|
|
564
614
|
const {
|
|
565
615
|
method: n = "GET",
|
|
566
|
-
headers:
|
|
616
|
+
headers: i = {},
|
|
567
617
|
body: s,
|
|
568
|
-
params:
|
|
569
|
-
} = r,
|
|
618
|
+
params: o
|
|
619
|
+
} = r, p = `${this.config.baseUrl}/${t}${this.buildQueryString(o)}`, u = {
|
|
570
620
|
...this.config.headers,
|
|
571
|
-
...
|
|
572
|
-
...
|
|
621
|
+
...Tt.getAuthHeader(),
|
|
622
|
+
...i
|
|
573
623
|
}, g = {
|
|
574
624
|
method: n,
|
|
575
|
-
headers:
|
|
625
|
+
headers: u
|
|
576
626
|
};
|
|
577
627
|
s && n !== "GET" && (g.body = JSON.stringify(s));
|
|
578
628
|
try {
|
|
579
|
-
const
|
|
629
|
+
const c = new AbortController(), _ = setTimeout(() => c.abort(), this.config.timeout), x = await fetch(p, {
|
|
580
630
|
...g,
|
|
581
|
-
signal:
|
|
631
|
+
signal: c.signal
|
|
582
632
|
});
|
|
583
|
-
if (clearTimeout(
|
|
584
|
-
const
|
|
633
|
+
if (clearTimeout(_), !x.ok) {
|
|
634
|
+
const m = await x.json().catch(() => ({
|
|
585
635
|
message: x.statusText
|
|
586
636
|
}));
|
|
587
|
-
throw new Error(
|
|
637
|
+
throw new Error(m.message || `HTTP ${x.status}`);
|
|
588
638
|
}
|
|
589
639
|
return await x.json();
|
|
590
|
-
} catch (
|
|
591
|
-
throw
|
|
640
|
+
} catch (c) {
|
|
641
|
+
throw c instanceof Error ? c : new Error("An unexpected error occurred");
|
|
592
642
|
}
|
|
593
643
|
}
|
|
594
644
|
/**
|
|
@@ -634,88 +684,88 @@ class Tt {
|
|
|
634
684
|
return this.config.baseUrl;
|
|
635
685
|
}
|
|
636
686
|
}
|
|
637
|
-
let
|
|
638
|
-
function Ft(
|
|
639
|
-
return
|
|
687
|
+
let ke = null;
|
|
688
|
+
function Ft(h) {
|
|
689
|
+
return ke = new kt(h), ke;
|
|
640
690
|
}
|
|
641
691
|
function nt() {
|
|
642
|
-
if (!
|
|
692
|
+
if (!ke)
|
|
643
693
|
throw new Error("API client not initialized. Call initializeApiClient() first.");
|
|
644
|
-
return
|
|
694
|
+
return ke;
|
|
645
695
|
}
|
|
646
|
-
function
|
|
696
|
+
function Rt(h, t, r = {}) {
|
|
647
697
|
const {
|
|
648
698
|
enabled: n = !0,
|
|
649
|
-
refetchOnMount:
|
|
699
|
+
refetchOnMount: i = !0,
|
|
650
700
|
onSuccess: s,
|
|
651
|
-
onError:
|
|
652
|
-
} = r, [
|
|
701
|
+
onError: o
|
|
702
|
+
} = r, [p, u] = z(null), [g, c] = z(n), [_, x] = z(null), m = X(async () => {
|
|
653
703
|
if (n) {
|
|
654
|
-
|
|
704
|
+
c(!0), x(null);
|
|
655
705
|
try {
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
} catch (
|
|
659
|
-
const
|
|
660
|
-
x(
|
|
706
|
+
const S = await nt().get(h, t);
|
|
707
|
+
u(S), s == null || s(S);
|
|
708
|
+
} catch (T) {
|
|
709
|
+
const S = T instanceof Error ? T : new Error("Unknown error");
|
|
710
|
+
x(S), o == null || o(S);
|
|
661
711
|
} finally {
|
|
662
|
-
|
|
712
|
+
c(!1);
|
|
663
713
|
}
|
|
664
714
|
}
|
|
665
|
-
}, [
|
|
666
|
-
return
|
|
667
|
-
|
|
668
|
-
}, [
|
|
669
|
-
data:
|
|
715
|
+
}, [h, JSON.stringify(t), n, s, o]);
|
|
716
|
+
return de(() => {
|
|
717
|
+
i && m();
|
|
718
|
+
}, [m, i]), {
|
|
719
|
+
data: p,
|
|
670
720
|
loading: g,
|
|
671
|
-
error:
|
|
672
|
-
refetch:
|
|
721
|
+
error: _,
|
|
722
|
+
refetch: m
|
|
673
723
|
};
|
|
674
724
|
}
|
|
675
|
-
function
|
|
676
|
-
const { onSuccess: n, onError:
|
|
677
|
-
async (
|
|
678
|
-
|
|
725
|
+
function Dt(h, t = "POST", r = {}) {
|
|
726
|
+
const { onSuccess: n, onError: i } = r, [s, o] = z(null), [p, u] = z(!1), [g, c] = z(null), _ = X(
|
|
727
|
+
async (m) => {
|
|
728
|
+
u(!0), c(null);
|
|
679
729
|
try {
|
|
680
|
-
const
|
|
681
|
-
let
|
|
730
|
+
const T = nt();
|
|
731
|
+
let S;
|
|
682
732
|
switch (t) {
|
|
683
733
|
case "POST":
|
|
684
|
-
|
|
734
|
+
S = await T.post(h, m);
|
|
685
735
|
break;
|
|
686
736
|
case "PUT":
|
|
687
|
-
|
|
737
|
+
S = await T.put(h, m);
|
|
688
738
|
break;
|
|
689
739
|
case "PATCH":
|
|
690
|
-
|
|
740
|
+
S = await T.patch(h, m);
|
|
691
741
|
break;
|
|
692
742
|
case "DELETE":
|
|
693
|
-
|
|
743
|
+
S = await T.delete(h);
|
|
694
744
|
break;
|
|
695
745
|
default:
|
|
696
746
|
throw new Error(`Unsupported method: ${t}`);
|
|
697
747
|
}
|
|
698
|
-
return
|
|
699
|
-
} catch (
|
|
700
|
-
const
|
|
701
|
-
return
|
|
748
|
+
return o(S), n == null || n(S, m), S;
|
|
749
|
+
} catch (T) {
|
|
750
|
+
const S = T instanceof Error ? T : new Error("Unknown error");
|
|
751
|
+
return c(S), i == null || i(S, m), null;
|
|
702
752
|
} finally {
|
|
703
|
-
|
|
753
|
+
u(!1);
|
|
704
754
|
}
|
|
705
755
|
},
|
|
706
|
-
[
|
|
707
|
-
), x =
|
|
708
|
-
|
|
756
|
+
[h, t, n, i]
|
|
757
|
+
), x = X(() => {
|
|
758
|
+
o(null), c(null), u(!1);
|
|
709
759
|
}, []);
|
|
710
760
|
return {
|
|
711
761
|
data: s,
|
|
712
|
-
loading:
|
|
762
|
+
loading: p,
|
|
713
763
|
error: g,
|
|
714
|
-
mutate:
|
|
764
|
+
mutate: _,
|
|
715
765
|
reset: x
|
|
716
766
|
};
|
|
717
767
|
}
|
|
718
|
-
var
|
|
768
|
+
var Ie = { exports: {} }, ge = {};
|
|
719
769
|
/**
|
|
720
770
|
* @license React
|
|
721
771
|
* react-jsx-runtime.production.min.js
|
|
@@ -727,19 +777,19 @@ var Be = { exports: {} }, he = {};
|
|
|
727
777
|
*/
|
|
728
778
|
var Ze;
|
|
729
779
|
function St() {
|
|
730
|
-
if (Ze) return
|
|
780
|
+
if (Ze) return ge;
|
|
731
781
|
Ze = 1;
|
|
732
|
-
var
|
|
733
|
-
function
|
|
734
|
-
var
|
|
735
|
-
g !== void 0 && (x = "" + g),
|
|
736
|
-
for (
|
|
737
|
-
if (
|
|
738
|
-
return { $$typeof: t, type:
|
|
739
|
-
}
|
|
740
|
-
return
|
|
782
|
+
var h = tt, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
783
|
+
function o(p, u, g) {
|
|
784
|
+
var c, _ = {}, x = null, m = null;
|
|
785
|
+
g !== void 0 && (x = "" + g), u.key !== void 0 && (x = "" + u.key), u.ref !== void 0 && (m = u.ref);
|
|
786
|
+
for (c in u) n.call(u, c) && !s.hasOwnProperty(c) && (_[c] = u[c]);
|
|
787
|
+
if (p && p.defaultProps) for (c in u = p.defaultProps, u) _[c] === void 0 && (_[c] = u[c]);
|
|
788
|
+
return { $$typeof: t, type: p, key: x, ref: m, props: _, _owner: i.current };
|
|
789
|
+
}
|
|
790
|
+
return ge.Fragment = r, ge.jsx = o, ge.jsxs = o, ge;
|
|
741
791
|
}
|
|
742
|
-
var
|
|
792
|
+
var me = {};
|
|
743
793
|
/**
|
|
744
794
|
* @license React
|
|
745
795
|
* react-jsx-runtime.development.js
|
|
@@ -752,51 +802,51 @@ var ge = {};
|
|
|
752
802
|
var et;
|
|
753
803
|
function Ot() {
|
|
754
804
|
return et || (et = 1, process.env.NODE_ENV !== "production" && function() {
|
|
755
|
-
var
|
|
756
|
-
function
|
|
805
|
+
var h = tt, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), p = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), T = Symbol.iterator, S = "@@iterator";
|
|
806
|
+
function V(e) {
|
|
757
807
|
if (e === null || typeof e != "object")
|
|
758
808
|
return null;
|
|
759
|
-
var
|
|
760
|
-
return typeof
|
|
809
|
+
var l = T && e[T] || e[S];
|
|
810
|
+
return typeof l == "function" ? l : null;
|
|
761
811
|
}
|
|
762
|
-
var
|
|
812
|
+
var B = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
763
813
|
function $(e) {
|
|
764
814
|
{
|
|
765
|
-
for (var
|
|
766
|
-
|
|
767
|
-
|
|
815
|
+
for (var l = arguments.length, d = new Array(l > 1 ? l - 1 : 0), b = 1; b < l; b++)
|
|
816
|
+
d[b - 1] = arguments[b];
|
|
817
|
+
Y("error", e, d);
|
|
768
818
|
}
|
|
769
819
|
}
|
|
770
|
-
function
|
|
820
|
+
function Y(e, l, d) {
|
|
771
821
|
{
|
|
772
|
-
var
|
|
773
|
-
|
|
774
|
-
var A =
|
|
775
|
-
return String(
|
|
822
|
+
var b = B.ReactDebugCurrentFrame, P = b.getStackAddendum();
|
|
823
|
+
P !== "" && (l += "%s", d = d.concat([P]));
|
|
824
|
+
var A = d.map(function(O) {
|
|
825
|
+
return String(O);
|
|
776
826
|
});
|
|
777
|
-
A.unshift("Warning: " +
|
|
827
|
+
A.unshift("Warning: " + l), Function.prototype.apply.call(console[e], console, A);
|
|
778
828
|
}
|
|
779
829
|
}
|
|
780
|
-
var w = !1,
|
|
781
|
-
|
|
782
|
-
function
|
|
783
|
-
return !!(typeof e == "string" || typeof e == "function" || e === n || e === s || F || e ===
|
|
830
|
+
var w = !1, D = !1, y = !1, N = !1, F = !1, j;
|
|
831
|
+
j = Symbol.for("react.module.reference");
|
|
832
|
+
function C(e) {
|
|
833
|
+
return !!(typeof e == "string" || typeof e == "function" || e === n || e === s || F || e === i || e === g || e === c || N || e === m || w || D || y || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === _ || e.$$typeof === o || e.$$typeof === p || e.$$typeof === u || // This needs to include all possible module reference object
|
|
784
834
|
// types supported by any Flight configuration anywhere since
|
|
785
835
|
// we don't know which Flight build this will end up being used
|
|
786
836
|
// with.
|
|
787
|
-
e.$$typeof ===
|
|
837
|
+
e.$$typeof === j || e.getModuleId !== void 0));
|
|
788
838
|
}
|
|
789
|
-
function
|
|
790
|
-
var
|
|
791
|
-
if (
|
|
792
|
-
return
|
|
793
|
-
var
|
|
794
|
-
return
|
|
839
|
+
function v(e, l, d) {
|
|
840
|
+
var b = e.displayName;
|
|
841
|
+
if (b)
|
|
842
|
+
return b;
|
|
843
|
+
var P = l.displayName || l.name || "";
|
|
844
|
+
return P !== "" ? d + "(" + P + ")" : d;
|
|
795
845
|
}
|
|
796
|
-
function
|
|
846
|
+
function W(e) {
|
|
797
847
|
return e.displayName || "Context";
|
|
798
848
|
}
|
|
799
|
-
function
|
|
849
|
+
function I(e) {
|
|
800
850
|
if (e == null)
|
|
801
851
|
return null;
|
|
802
852
|
if (typeof e.tag == "number" && $("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -810,30 +860,30 @@ function Ot() {
|
|
|
810
860
|
return "Portal";
|
|
811
861
|
case s:
|
|
812
862
|
return "Profiler";
|
|
813
|
-
case
|
|
863
|
+
case i:
|
|
814
864
|
return "StrictMode";
|
|
815
865
|
case g:
|
|
816
866
|
return "Suspense";
|
|
817
|
-
case
|
|
867
|
+
case c:
|
|
818
868
|
return "SuspenseList";
|
|
819
869
|
}
|
|
820
870
|
if (typeof e == "object")
|
|
821
871
|
switch (e.$$typeof) {
|
|
822
|
-
case
|
|
823
|
-
var
|
|
824
|
-
return
|
|
825
|
-
case
|
|
826
|
-
var
|
|
827
|
-
return
|
|
828
|
-
case
|
|
829
|
-
return
|
|
830
|
-
case
|
|
831
|
-
var
|
|
832
|
-
return
|
|
872
|
+
case p:
|
|
873
|
+
var l = e;
|
|
874
|
+
return W(l) + ".Consumer";
|
|
875
|
+
case o:
|
|
876
|
+
var d = e;
|
|
877
|
+
return W(d._context) + ".Provider";
|
|
878
|
+
case u:
|
|
879
|
+
return v(e, e.render, "ForwardRef");
|
|
880
|
+
case _:
|
|
881
|
+
var b = e.displayName || null;
|
|
882
|
+
return b !== null ? b : I(e.type) || "Memo";
|
|
833
883
|
case x: {
|
|
834
|
-
var
|
|
884
|
+
var P = e, A = P._payload, O = P._init;
|
|
835
885
|
try {
|
|
836
|
-
return
|
|
886
|
+
return I(O(A));
|
|
837
887
|
} catch {
|
|
838
888
|
return null;
|
|
839
889
|
}
|
|
@@ -841,14 +891,14 @@ function Ot() {
|
|
|
841
891
|
}
|
|
842
892
|
return null;
|
|
843
893
|
}
|
|
844
|
-
var
|
|
894
|
+
var R = Object.assign, L = 0, J, Q, re, ye, xe, ve, be;
|
|
845
895
|
function we() {
|
|
846
896
|
}
|
|
847
897
|
we.__reactDisabledLog = !0;
|
|
848
|
-
function
|
|
898
|
+
function Re() {
|
|
849
899
|
{
|
|
850
|
-
if (
|
|
851
|
-
|
|
900
|
+
if (L === 0) {
|
|
901
|
+
J = console.log, Q = console.info, re = console.warn, ye = console.error, xe = console.group, ve = console.groupCollapsed, be = console.groupEnd;
|
|
852
902
|
var e = {
|
|
853
903
|
configurable: !0,
|
|
854
904
|
enumerable: !0,
|
|
@@ -865,320 +915,320 @@ function Ot() {
|
|
|
865
915
|
groupEnd: e
|
|
866
916
|
});
|
|
867
917
|
}
|
|
868
|
-
|
|
918
|
+
L++;
|
|
869
919
|
}
|
|
870
920
|
}
|
|
871
921
|
function Se() {
|
|
872
922
|
{
|
|
873
|
-
if (
|
|
923
|
+
if (L--, L === 0) {
|
|
874
924
|
var e = {
|
|
875
925
|
configurable: !0,
|
|
876
926
|
enumerable: !0,
|
|
877
927
|
writable: !0
|
|
878
928
|
};
|
|
879
929
|
Object.defineProperties(console, {
|
|
880
|
-
log:
|
|
881
|
-
value:
|
|
930
|
+
log: R({}, e, {
|
|
931
|
+
value: J
|
|
882
932
|
}),
|
|
883
|
-
info:
|
|
884
|
-
value:
|
|
933
|
+
info: R({}, e, {
|
|
934
|
+
value: Q
|
|
885
935
|
}),
|
|
886
|
-
warn:
|
|
887
|
-
value:
|
|
936
|
+
warn: R({}, e, {
|
|
937
|
+
value: re
|
|
888
938
|
}),
|
|
889
|
-
error:
|
|
890
|
-
value:
|
|
939
|
+
error: R({}, e, {
|
|
940
|
+
value: ye
|
|
891
941
|
}),
|
|
892
|
-
group:
|
|
942
|
+
group: R({}, e, {
|
|
893
943
|
value: xe
|
|
894
944
|
}),
|
|
895
|
-
groupCollapsed:
|
|
945
|
+
groupCollapsed: R({}, e, {
|
|
896
946
|
value: ve
|
|
897
947
|
}),
|
|
898
|
-
groupEnd:
|
|
948
|
+
groupEnd: R({}, e, {
|
|
899
949
|
value: be
|
|
900
950
|
})
|
|
901
951
|
});
|
|
902
952
|
}
|
|
903
|
-
|
|
953
|
+
L < 0 && $("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
904
954
|
}
|
|
905
955
|
}
|
|
906
|
-
var
|
|
907
|
-
function ae(e,
|
|
956
|
+
var ue = B.ReactCurrentDispatcher, fe;
|
|
957
|
+
function ae(e, l, d) {
|
|
908
958
|
{
|
|
909
|
-
if (
|
|
959
|
+
if (fe === void 0)
|
|
910
960
|
try {
|
|
911
961
|
throw Error();
|
|
912
|
-
} catch (
|
|
913
|
-
var
|
|
914
|
-
|
|
962
|
+
} catch (P) {
|
|
963
|
+
var b = P.stack.trim().match(/\n( *(at )?)/);
|
|
964
|
+
fe = b && b[1] || "";
|
|
915
965
|
}
|
|
916
966
|
return `
|
|
917
|
-
` +
|
|
967
|
+
` + fe + e;
|
|
918
968
|
}
|
|
919
969
|
}
|
|
920
|
-
var
|
|
970
|
+
var pe = !1, ie;
|
|
921
971
|
{
|
|
922
972
|
var Oe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
923
973
|
ie = new Oe();
|
|
924
974
|
}
|
|
925
|
-
function
|
|
926
|
-
if (!e ||
|
|
975
|
+
function Ee(e, l) {
|
|
976
|
+
if (!e || pe)
|
|
927
977
|
return "";
|
|
928
978
|
{
|
|
929
|
-
var
|
|
930
|
-
if (
|
|
931
|
-
return
|
|
979
|
+
var d = ie.get(e);
|
|
980
|
+
if (d !== void 0)
|
|
981
|
+
return d;
|
|
932
982
|
}
|
|
933
|
-
var
|
|
934
|
-
|
|
935
|
-
var
|
|
983
|
+
var b;
|
|
984
|
+
pe = !0;
|
|
985
|
+
var P = Error.prepareStackTrace;
|
|
936
986
|
Error.prepareStackTrace = void 0;
|
|
937
987
|
var A;
|
|
938
|
-
A =
|
|
988
|
+
A = ue.current, ue.current = null, Re();
|
|
939
989
|
try {
|
|
940
|
-
if (
|
|
941
|
-
var
|
|
990
|
+
if (l) {
|
|
991
|
+
var O = function() {
|
|
942
992
|
throw Error();
|
|
943
993
|
};
|
|
944
|
-
if (Object.defineProperty(
|
|
994
|
+
if (Object.defineProperty(O.prototype, "props", {
|
|
945
995
|
set: function() {
|
|
946
996
|
throw Error();
|
|
947
997
|
}
|
|
948
998
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
949
999
|
try {
|
|
950
|
-
Reflect.construct(
|
|
951
|
-
} catch (
|
|
952
|
-
|
|
1000
|
+
Reflect.construct(O, []);
|
|
1001
|
+
} catch (H) {
|
|
1002
|
+
b = H;
|
|
953
1003
|
}
|
|
954
|
-
Reflect.construct(e, [],
|
|
1004
|
+
Reflect.construct(e, [], O);
|
|
955
1005
|
} else {
|
|
956
1006
|
try {
|
|
957
|
-
|
|
958
|
-
} catch (
|
|
959
|
-
|
|
1007
|
+
O.call();
|
|
1008
|
+
} catch (H) {
|
|
1009
|
+
b = H;
|
|
960
1010
|
}
|
|
961
|
-
e.call(
|
|
1011
|
+
e.call(O.prototype);
|
|
962
1012
|
}
|
|
963
1013
|
} else {
|
|
964
1014
|
try {
|
|
965
1015
|
throw Error();
|
|
966
|
-
} catch (
|
|
967
|
-
|
|
1016
|
+
} catch (H) {
|
|
1017
|
+
b = H;
|
|
968
1018
|
}
|
|
969
1019
|
e();
|
|
970
1020
|
}
|
|
971
|
-
} catch (
|
|
972
|
-
if (
|
|
973
|
-
for (var
|
|
974
|
-
`),
|
|
975
|
-
`), U =
|
|
1021
|
+
} catch (H) {
|
|
1022
|
+
if (H && b && typeof H.stack == "string") {
|
|
1023
|
+
for (var k = H.stack.split(`
|
|
1024
|
+
`), q = b.stack.split(`
|
|
1025
|
+
`), U = k.length - 1, M = q.length - 1; U >= 1 && M >= 0 && k[U] !== q[M]; )
|
|
976
1026
|
M--;
|
|
977
1027
|
for (; U >= 1 && M >= 0; U--, M--)
|
|
978
|
-
if (
|
|
1028
|
+
if (k[U] !== q[M]) {
|
|
979
1029
|
if (U !== 1 || M !== 1)
|
|
980
1030
|
do
|
|
981
|
-
if (U--, M--, M < 0 ||
|
|
982
|
-
var
|
|
983
|
-
` +
|
|
984
|
-
return e.displayName &&
|
|
1031
|
+
if (U--, M--, M < 0 || k[U] !== q[M]) {
|
|
1032
|
+
var ee = `
|
|
1033
|
+
` + k[U].replace(" at new ", " at ");
|
|
1034
|
+
return e.displayName && ee.includes("<anonymous>") && (ee = ee.replace("<anonymous>", e.displayName)), typeof e == "function" && ie.set(e, ee), ee;
|
|
985
1035
|
}
|
|
986
1036
|
while (U >= 1 && M >= 0);
|
|
987
1037
|
break;
|
|
988
1038
|
}
|
|
989
1039
|
}
|
|
990
1040
|
} finally {
|
|
991
|
-
|
|
1041
|
+
pe = !1, ue.current = A, Se(), Error.prepareStackTrace = P;
|
|
992
1042
|
}
|
|
993
|
-
var ce = e ? e.displayName || e.name : "",
|
|
994
|
-
return typeof e == "function" && ie.set(e,
|
|
1043
|
+
var ce = e ? e.displayName || e.name : "", se = ce ? ae(ce) : "";
|
|
1044
|
+
return typeof e == "function" && ie.set(e, se), se;
|
|
995
1045
|
}
|
|
996
|
-
function Ne(e,
|
|
997
|
-
return
|
|
1046
|
+
function Ne(e, l, d) {
|
|
1047
|
+
return Ee(e, !1);
|
|
998
1048
|
}
|
|
999
|
-
function
|
|
1000
|
-
var
|
|
1001
|
-
return !!(
|
|
1049
|
+
function Ce(e) {
|
|
1050
|
+
var l = e.prototype;
|
|
1051
|
+
return !!(l && l.isReactComponent);
|
|
1002
1052
|
}
|
|
1003
|
-
function oe(e,
|
|
1053
|
+
function oe(e, l, d) {
|
|
1004
1054
|
if (e == null)
|
|
1005
1055
|
return "";
|
|
1006
1056
|
if (typeof e == "function")
|
|
1007
|
-
return
|
|
1057
|
+
return Ee(e, Ce(e));
|
|
1008
1058
|
if (typeof e == "string")
|
|
1009
1059
|
return ae(e);
|
|
1010
1060
|
switch (e) {
|
|
1011
1061
|
case g:
|
|
1012
1062
|
return ae("Suspense");
|
|
1013
|
-
case
|
|
1063
|
+
case c:
|
|
1014
1064
|
return ae("SuspenseList");
|
|
1015
1065
|
}
|
|
1016
1066
|
if (typeof e == "object")
|
|
1017
1067
|
switch (e.$$typeof) {
|
|
1018
|
-
case
|
|
1068
|
+
case u:
|
|
1019
1069
|
return Ne(e.render);
|
|
1020
|
-
case
|
|
1021
|
-
return oe(e.type,
|
|
1070
|
+
case _:
|
|
1071
|
+
return oe(e.type, l, d);
|
|
1022
1072
|
case x: {
|
|
1023
|
-
var
|
|
1073
|
+
var b = e, P = b._payload, A = b._init;
|
|
1024
1074
|
try {
|
|
1025
|
-
return oe(A(
|
|
1075
|
+
return oe(A(P), l, d);
|
|
1026
1076
|
} catch {
|
|
1027
1077
|
}
|
|
1028
1078
|
}
|
|
1029
1079
|
}
|
|
1030
1080
|
return "";
|
|
1031
1081
|
}
|
|
1032
|
-
var
|
|
1033
|
-
function
|
|
1082
|
+
var ne = Object.prototype.hasOwnProperty, f = {}, E = B.ReactDebugCurrentFrame;
|
|
1083
|
+
function G(e) {
|
|
1034
1084
|
if (e) {
|
|
1035
|
-
var
|
|
1036
|
-
|
|
1085
|
+
var l = e._owner, d = oe(e.type, e._source, l ? l.type : null);
|
|
1086
|
+
E.setExtraStackFrame(d);
|
|
1037
1087
|
} else
|
|
1038
|
-
|
|
1088
|
+
E.setExtraStackFrame(null);
|
|
1039
1089
|
}
|
|
1040
|
-
function
|
|
1090
|
+
function K(e, l, d, b, P) {
|
|
1041
1091
|
{
|
|
1042
|
-
var A = Function.call.bind(
|
|
1043
|
-
for (var
|
|
1044
|
-
if (A(e,
|
|
1045
|
-
var
|
|
1092
|
+
var A = Function.call.bind(ne);
|
|
1093
|
+
for (var O in e)
|
|
1094
|
+
if (A(e, O)) {
|
|
1095
|
+
var k = void 0;
|
|
1046
1096
|
try {
|
|
1047
|
-
if (typeof e[
|
|
1048
|
-
var
|
|
1049
|
-
throw
|
|
1097
|
+
if (typeof e[O] != "function") {
|
|
1098
|
+
var q = Error((b || "React class") + ": " + d + " type `" + O + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[O] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1099
|
+
throw q.name = "Invariant Violation", q;
|
|
1050
1100
|
}
|
|
1051
|
-
|
|
1101
|
+
k = e[O](l, O, b, d, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1052
1102
|
} catch (U) {
|
|
1053
|
-
|
|
1103
|
+
k = U;
|
|
1054
1104
|
}
|
|
1055
|
-
|
|
1105
|
+
k && !(k instanceof Error) && (G(P), $("%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).", b || "React class", d, O, typeof k), G(null)), k instanceof Error && !(k.message in f) && (f[k.message] = !0, G(P), $("Failed %s type: %s", d, k.message), G(null));
|
|
1056
1106
|
}
|
|
1057
1107
|
}
|
|
1058
1108
|
}
|
|
1059
1109
|
var te = Array.isArray;
|
|
1060
|
-
function
|
|
1110
|
+
function Z(e) {
|
|
1061
1111
|
return te(e);
|
|
1062
1112
|
}
|
|
1063
|
-
function
|
|
1113
|
+
function Pe(e) {
|
|
1064
1114
|
{
|
|
1065
|
-
var
|
|
1066
|
-
return
|
|
1115
|
+
var l = typeof Symbol == "function" && Symbol.toStringTag, d = l && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
1116
|
+
return d;
|
|
1067
1117
|
}
|
|
1068
1118
|
}
|
|
1069
|
-
function
|
|
1119
|
+
function _e(e) {
|
|
1070
1120
|
try {
|
|
1071
|
-
return
|
|
1121
|
+
return je(e), !1;
|
|
1072
1122
|
} catch {
|
|
1073
1123
|
return !0;
|
|
1074
1124
|
}
|
|
1075
1125
|
}
|
|
1076
|
-
function
|
|
1126
|
+
function je(e) {
|
|
1077
1127
|
return "" + e;
|
|
1078
1128
|
}
|
|
1079
1129
|
function Le(e) {
|
|
1080
|
-
if (
|
|
1081
|
-
return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
1130
|
+
if (_e(e))
|
|
1131
|
+
return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Pe(e)), je(e);
|
|
1082
1132
|
}
|
|
1083
|
-
var ze =
|
|
1133
|
+
var ze = B.ReactCurrentOwner, st = {
|
|
1084
1134
|
key: !0,
|
|
1085
1135
|
ref: !0,
|
|
1086
1136
|
__self: !0,
|
|
1087
1137
|
__source: !0
|
|
1088
|
-
},
|
|
1138
|
+
}, Ge, We;
|
|
1089
1139
|
function at(e) {
|
|
1090
|
-
if (
|
|
1091
|
-
var
|
|
1092
|
-
if (
|
|
1140
|
+
if (ne.call(e, "ref")) {
|
|
1141
|
+
var l = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
1142
|
+
if (l && l.isReactWarning)
|
|
1093
1143
|
return !1;
|
|
1094
1144
|
}
|
|
1095
1145
|
return e.ref !== void 0;
|
|
1096
1146
|
}
|
|
1097
1147
|
function it(e) {
|
|
1098
|
-
if (
|
|
1099
|
-
var
|
|
1100
|
-
if (
|
|
1148
|
+
if (ne.call(e, "key")) {
|
|
1149
|
+
var l = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
1150
|
+
if (l && l.isReactWarning)
|
|
1101
1151
|
return !1;
|
|
1102
1152
|
}
|
|
1103
1153
|
return e.key !== void 0;
|
|
1104
1154
|
}
|
|
1105
|
-
function ot(e,
|
|
1155
|
+
function ot(e, l) {
|
|
1106
1156
|
typeof e.ref == "string" && ze.current;
|
|
1107
1157
|
}
|
|
1108
|
-
function lt(e,
|
|
1158
|
+
function lt(e, l) {
|
|
1109
1159
|
{
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1160
|
+
var d = function() {
|
|
1161
|
+
Ge || (Ge = !0, $("%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)", l));
|
|
1112
1162
|
};
|
|
1113
|
-
|
|
1114
|
-
get:
|
|
1163
|
+
d.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
1164
|
+
get: d,
|
|
1115
1165
|
configurable: !0
|
|
1116
1166
|
});
|
|
1117
1167
|
}
|
|
1118
1168
|
}
|
|
1119
|
-
function ct(e,
|
|
1169
|
+
function ct(e, l) {
|
|
1120
1170
|
{
|
|
1121
|
-
var
|
|
1122
|
-
|
|
1171
|
+
var d = function() {
|
|
1172
|
+
We || (We = !0, $("%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)", l));
|
|
1123
1173
|
};
|
|
1124
|
-
|
|
1125
|
-
get:
|
|
1174
|
+
d.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
1175
|
+
get: d,
|
|
1126
1176
|
configurable: !0
|
|
1127
1177
|
});
|
|
1128
1178
|
}
|
|
1129
1179
|
}
|
|
1130
|
-
var dt = function(e,
|
|
1131
|
-
var
|
|
1180
|
+
var dt = function(e, l, d, b, P, A, O) {
|
|
1181
|
+
var k = {
|
|
1132
1182
|
// This tag allows us to uniquely identify this as a React Element
|
|
1133
1183
|
$$typeof: t,
|
|
1134
1184
|
// Built-in properties that belong on the element
|
|
1135
1185
|
type: e,
|
|
1136
|
-
key:
|
|
1137
|
-
ref:
|
|
1138
|
-
props:
|
|
1186
|
+
key: l,
|
|
1187
|
+
ref: d,
|
|
1188
|
+
props: O,
|
|
1139
1189
|
// Record the component responsible for creating this element.
|
|
1140
1190
|
_owner: A
|
|
1141
1191
|
};
|
|
1142
|
-
return
|
|
1192
|
+
return k._store = {}, Object.defineProperty(k._store, "validated", {
|
|
1143
1193
|
configurable: !1,
|
|
1144
1194
|
enumerable: !1,
|
|
1145
1195
|
writable: !0,
|
|
1146
1196
|
value: !1
|
|
1147
|
-
}), Object.defineProperty(
|
|
1197
|
+
}), Object.defineProperty(k, "_self", {
|
|
1148
1198
|
configurable: !1,
|
|
1149
1199
|
enumerable: !1,
|
|
1150
1200
|
writable: !1,
|
|
1151
|
-
value:
|
|
1152
|
-
}), Object.defineProperty(
|
|
1201
|
+
value: b
|
|
1202
|
+
}), Object.defineProperty(k, "_source", {
|
|
1153
1203
|
configurable: !1,
|
|
1154
1204
|
enumerable: !1,
|
|
1155
1205
|
writable: !1,
|
|
1156
|
-
value:
|
|
1157
|
-
}), Object.freeze && (Object.freeze(
|
|
1206
|
+
value: P
|
|
1207
|
+
}), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
|
|
1158
1208
|
};
|
|
1159
|
-
function ut(e,
|
|
1209
|
+
function ut(e, l, d, b, P) {
|
|
1160
1210
|
{
|
|
1161
|
-
var A,
|
|
1162
|
-
|
|
1163
|
-
for (A in
|
|
1164
|
-
|
|
1211
|
+
var A, O = {}, k = null, q = null;
|
|
1212
|
+
d !== void 0 && (Le(d), k = "" + d), it(l) && (Le(l.key), k = "" + l.key), at(l) && (q = l.ref, ot(l, P));
|
|
1213
|
+
for (A in l)
|
|
1214
|
+
ne.call(l, A) && !st.hasOwnProperty(A) && (O[A] = l[A]);
|
|
1165
1215
|
if (e && e.defaultProps) {
|
|
1166
1216
|
var U = e.defaultProps;
|
|
1167
1217
|
for (A in U)
|
|
1168
|
-
|
|
1218
|
+
O[A] === void 0 && (O[A] = U[A]);
|
|
1169
1219
|
}
|
|
1170
|
-
if (
|
|
1220
|
+
if (k || q) {
|
|
1171
1221
|
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
1172
|
-
|
|
1222
|
+
k && lt(O, M), q && ct(O, M);
|
|
1173
1223
|
}
|
|
1174
|
-
return dt(e,
|
|
1224
|
+
return dt(e, k, q, P, b, ze.current, O);
|
|
1175
1225
|
}
|
|
1176
1226
|
}
|
|
1177
|
-
var Ae =
|
|
1227
|
+
var Ae = B.ReactCurrentOwner, Ye = B.ReactDebugCurrentFrame;
|
|
1178
1228
|
function le(e) {
|
|
1179
1229
|
if (e) {
|
|
1180
|
-
var
|
|
1181
|
-
Ye.setExtraStackFrame(
|
|
1230
|
+
var l = e._owner, d = oe(e.type, e._source, l ? l.type : null);
|
|
1231
|
+
Ye.setExtraStackFrame(d);
|
|
1182
1232
|
} else
|
|
1183
1233
|
Ye.setExtraStackFrame(null);
|
|
1184
1234
|
}
|
|
@@ -1190,7 +1240,7 @@ function Ot() {
|
|
|
1190
1240
|
function qe() {
|
|
1191
1241
|
{
|
|
1192
1242
|
if (Ae.current) {
|
|
1193
|
-
var e =
|
|
1243
|
+
var e = I(Ae.current.type);
|
|
1194
1244
|
if (e)
|
|
1195
1245
|
return `
|
|
1196
1246
|
|
|
@@ -1205,143 +1255,143 @@ Check the render method of \`` + e + "`.";
|
|
|
1205
1255
|
var Ve = {};
|
|
1206
1256
|
function pt(e) {
|
|
1207
1257
|
{
|
|
1208
|
-
var
|
|
1209
|
-
if (!
|
|
1210
|
-
var
|
|
1211
|
-
|
|
1258
|
+
var l = qe();
|
|
1259
|
+
if (!l) {
|
|
1260
|
+
var d = typeof e == "string" ? e : e.displayName || e.name;
|
|
1261
|
+
d && (l = `
|
|
1212
1262
|
|
|
1213
|
-
Check the top-level render call using <` +
|
|
1263
|
+
Check the top-level render call using <` + d + ">.");
|
|
1214
1264
|
}
|
|
1215
|
-
return
|
|
1265
|
+
return l;
|
|
1216
1266
|
}
|
|
1217
1267
|
}
|
|
1218
|
-
function
|
|
1268
|
+
function He(e, l) {
|
|
1219
1269
|
{
|
|
1220
1270
|
if (!e._store || e._store.validated || e.key != null)
|
|
1221
1271
|
return;
|
|
1222
1272
|
e._store.validated = !0;
|
|
1223
|
-
var
|
|
1224
|
-
if (Ve[
|
|
1273
|
+
var d = pt(l);
|
|
1274
|
+
if (Ve[d])
|
|
1225
1275
|
return;
|
|
1226
|
-
Ve[
|
|
1227
|
-
var
|
|
1228
|
-
e && e._owner && e._owner !== Ae.current && (
|
|
1276
|
+
Ve[d] = !0;
|
|
1277
|
+
var b = "";
|
|
1278
|
+
e && e._owner && e._owner !== Ae.current && (b = " It was passed a child from " + I(e._owner.type) + "."), le(e), $('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', d, b), le(null);
|
|
1229
1279
|
}
|
|
1230
1280
|
}
|
|
1231
|
-
function
|
|
1281
|
+
function Je(e, l) {
|
|
1232
1282
|
{
|
|
1233
1283
|
if (typeof e != "object")
|
|
1234
1284
|
return;
|
|
1235
|
-
if (
|
|
1236
|
-
for (var
|
|
1237
|
-
var
|
|
1238
|
-
Fe(
|
|
1285
|
+
if (Z(e))
|
|
1286
|
+
for (var d = 0; d < e.length; d++) {
|
|
1287
|
+
var b = e[d];
|
|
1288
|
+
Fe(b) && He(b, l);
|
|
1239
1289
|
}
|
|
1240
1290
|
else if (Fe(e))
|
|
1241
1291
|
e._store && (e._store.validated = !0);
|
|
1242
1292
|
else if (e) {
|
|
1243
|
-
var
|
|
1244
|
-
if (typeof
|
|
1245
|
-
for (var A =
|
|
1246
|
-
Fe(
|
|
1293
|
+
var P = V(e);
|
|
1294
|
+
if (typeof P == "function" && P !== e.entries)
|
|
1295
|
+
for (var A = P.call(e), O; !(O = A.next()).done; )
|
|
1296
|
+
Fe(O.value) && He(O.value, l);
|
|
1247
1297
|
}
|
|
1248
1298
|
}
|
|
1249
1299
|
}
|
|
1250
1300
|
function ht(e) {
|
|
1251
1301
|
{
|
|
1252
|
-
var
|
|
1253
|
-
if (
|
|
1302
|
+
var l = e.type;
|
|
1303
|
+
if (l == null || typeof l == "string")
|
|
1254
1304
|
return;
|
|
1255
|
-
var
|
|
1256
|
-
if (typeof
|
|
1257
|
-
|
|
1258
|
-
else if (typeof
|
|
1305
|
+
var d;
|
|
1306
|
+
if (typeof l == "function")
|
|
1307
|
+
d = l.propTypes;
|
|
1308
|
+
else if (typeof l == "object" && (l.$$typeof === u || // Note: Memo only checks outer props here.
|
|
1259
1309
|
// Inner props are checked in the reconciler.
|
|
1260
|
-
|
|
1261
|
-
|
|
1310
|
+
l.$$typeof === _))
|
|
1311
|
+
d = l.propTypes;
|
|
1262
1312
|
else
|
|
1263
1313
|
return;
|
|
1264
|
-
if (
|
|
1265
|
-
var
|
|
1266
|
-
|
|
1267
|
-
} else if (
|
|
1314
|
+
if (d) {
|
|
1315
|
+
var b = I(l);
|
|
1316
|
+
K(d, e.props, "prop", b, e);
|
|
1317
|
+
} else if (l.PropTypes !== void 0 && !$e) {
|
|
1268
1318
|
$e = !0;
|
|
1269
|
-
var
|
|
1270
|
-
$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
1319
|
+
var P = I(l);
|
|
1320
|
+
$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown");
|
|
1271
1321
|
}
|
|
1272
|
-
typeof
|
|
1322
|
+
typeof l.getDefaultProps == "function" && !l.getDefaultProps.isReactClassApproved && $("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1273
1323
|
}
|
|
1274
1324
|
}
|
|
1275
1325
|
function gt(e) {
|
|
1276
1326
|
{
|
|
1277
|
-
for (var
|
|
1278
|
-
var
|
|
1279
|
-
if (
|
|
1280
|
-
le(e), $("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
1327
|
+
for (var l = Object.keys(e.props), d = 0; d < l.length; d++) {
|
|
1328
|
+
var b = l[d];
|
|
1329
|
+
if (b !== "children" && b !== "key") {
|
|
1330
|
+
le(e), $("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", b), le(null);
|
|
1281
1331
|
break;
|
|
1282
1332
|
}
|
|
1283
1333
|
}
|
|
1284
1334
|
e.ref !== null && (le(e), $("Invalid attribute `ref` supplied to `React.Fragment`."), le(null));
|
|
1285
1335
|
}
|
|
1286
1336
|
}
|
|
1287
|
-
var
|
|
1288
|
-
function Xe(e,
|
|
1337
|
+
var Ke = {};
|
|
1338
|
+
function Xe(e, l, d, b, P, A) {
|
|
1289
1339
|
{
|
|
1290
|
-
var
|
|
1291
|
-
if (!
|
|
1292
|
-
var
|
|
1293
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
1294
|
-
var
|
|
1295
|
-
|
|
1340
|
+
var O = C(e);
|
|
1341
|
+
if (!O) {
|
|
1342
|
+
var k = "";
|
|
1343
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1344
|
+
var q = ft();
|
|
1345
|
+
q ? k += q : k += qe();
|
|
1296
1346
|
var U;
|
|
1297
|
-
e === null ? U = "null" :
|
|
1347
|
+
e === null ? U = "null" : Z(e) ? U = "array" : e !== void 0 && e.$$typeof === t ? (U = "<" + (I(e.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : U = typeof e, $("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", U, k);
|
|
1298
1348
|
}
|
|
1299
|
-
var M = ut(e,
|
|
1349
|
+
var M = ut(e, l, d, P, A);
|
|
1300
1350
|
if (M == null)
|
|
1301
1351
|
return M;
|
|
1302
|
-
if (
|
|
1303
|
-
var
|
|
1304
|
-
if (
|
|
1305
|
-
if (
|
|
1306
|
-
if (ee
|
|
1307
|
-
for (var ce = 0; ce <
|
|
1308
|
-
|
|
1309
|
-
Object.freeze && Object.freeze(
|
|
1352
|
+
if (O) {
|
|
1353
|
+
var ee = l.children;
|
|
1354
|
+
if (ee !== void 0)
|
|
1355
|
+
if (b)
|
|
1356
|
+
if (Z(ee)) {
|
|
1357
|
+
for (var ce = 0; ce < ee.length; ce++)
|
|
1358
|
+
Je(ee[ce], e);
|
|
1359
|
+
Object.freeze && Object.freeze(ee);
|
|
1310
1360
|
} else
|
|
1311
1361
|
$("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1312
1362
|
else
|
|
1313
|
-
|
|
1363
|
+
Je(ee, e);
|
|
1314
1364
|
}
|
|
1315
|
-
if (
|
|
1316
|
-
var
|
|
1365
|
+
if (ne.call(l, "key")) {
|
|
1366
|
+
var se = I(e), H = Object.keys(l).filter(function(wt) {
|
|
1317
1367
|
return wt !== "key";
|
|
1318
|
-
}),
|
|
1319
|
-
if (!
|
|
1320
|
-
var bt =
|
|
1368
|
+
}), De = H.length > 0 ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1369
|
+
if (!Ke[se + De]) {
|
|
1370
|
+
var bt = H.length > 0 ? "{" + H.join(": ..., ") + ": ...}" : "{}";
|
|
1321
1371
|
$(`A props object containing a "key" prop is being spread into JSX:
|
|
1322
1372
|
let props = %s;
|
|
1323
1373
|
<%s {...props} />
|
|
1324
1374
|
React keys must be passed directly to JSX without using spread:
|
|
1325
1375
|
let props = %s;
|
|
1326
|
-
<%s key={someKey} {...props} />`,
|
|
1376
|
+
<%s key={someKey} {...props} />`, De, se, bt, se), Ke[se + De] = !0;
|
|
1327
1377
|
}
|
|
1328
1378
|
}
|
|
1329
1379
|
return e === n ? gt(M) : ht(M), M;
|
|
1330
1380
|
}
|
|
1331
1381
|
}
|
|
1332
|
-
function
|
|
1333
|
-
return Xe(e,
|
|
1382
|
+
function mt(e, l, d) {
|
|
1383
|
+
return Xe(e, l, d, !0);
|
|
1334
1384
|
}
|
|
1335
|
-
function
|
|
1336
|
-
return Xe(e,
|
|
1385
|
+
function yt(e, l, d) {
|
|
1386
|
+
return Xe(e, l, d, !1);
|
|
1337
1387
|
}
|
|
1338
|
-
var xt =
|
|
1339
|
-
|
|
1340
|
-
}()),
|
|
1388
|
+
var xt = yt, vt = mt;
|
|
1389
|
+
me.Fragment = n, me.jsx = xt, me.jsxs = vt;
|
|
1390
|
+
}()), me;
|
|
1341
1391
|
}
|
|
1342
|
-
process.env.NODE_ENV === "production" ?
|
|
1343
|
-
var a =
|
|
1344
|
-
class
|
|
1392
|
+
process.env.NODE_ENV === "production" ? Ie.exports = St() : Ie.exports = Ot();
|
|
1393
|
+
var a = Ie.exports;
|
|
1394
|
+
class Be {
|
|
1345
1395
|
/**
|
|
1346
1396
|
* Filter array by predicate function
|
|
1347
1397
|
*/
|
|
@@ -1352,23 +1402,23 @@ class Ie {
|
|
|
1352
1402
|
* Filter by field value
|
|
1353
1403
|
*/
|
|
1354
1404
|
static filterBy(t, r, n) {
|
|
1355
|
-
return t.filter((
|
|
1405
|
+
return t.filter((i) => i[r] === n);
|
|
1356
1406
|
}
|
|
1357
1407
|
/**
|
|
1358
1408
|
* Filter by multiple fields
|
|
1359
1409
|
*/
|
|
1360
1410
|
static filterByFields(t, r) {
|
|
1361
|
-
return t.filter((n) => Object.entries(r).every(([
|
|
1411
|
+
return t.filter((n) => Object.entries(r).every(([i, s]) => n[i] === s));
|
|
1362
1412
|
}
|
|
1363
1413
|
/**
|
|
1364
1414
|
* Sort array by field
|
|
1365
1415
|
*/
|
|
1366
1416
|
static sort(t, r, n = "asc") {
|
|
1367
|
-
return [...t].sort((
|
|
1368
|
-
const
|
|
1369
|
-
if (
|
|
1370
|
-
let
|
|
1371
|
-
return
|
|
1417
|
+
return [...t].sort((i, s) => {
|
|
1418
|
+
const o = i[r], p = s[r];
|
|
1419
|
+
if (o === p) return 0;
|
|
1420
|
+
let u = 0;
|
|
1421
|
+
return o > p && (u = 1), o < p && (u = -1), n === "asc" ? u : -u;
|
|
1372
1422
|
});
|
|
1373
1423
|
}
|
|
1374
1424
|
/**
|
|
@@ -1376,19 +1426,19 @@ class Ie {
|
|
|
1376
1426
|
*/
|
|
1377
1427
|
static search(t, r, n) {
|
|
1378
1428
|
if (!r.trim()) return t;
|
|
1379
|
-
const
|
|
1380
|
-
return t.filter((s) => n.some((
|
|
1381
|
-
const
|
|
1382
|
-
return
|
|
1429
|
+
const i = r.toLowerCase();
|
|
1430
|
+
return t.filter((s) => n.some((o) => {
|
|
1431
|
+
const p = s[o];
|
|
1432
|
+
return p == null ? !1 : String(p).toLowerCase().includes(i);
|
|
1383
1433
|
}));
|
|
1384
1434
|
}
|
|
1385
1435
|
/**
|
|
1386
1436
|
* Paginate array
|
|
1387
1437
|
*/
|
|
1388
1438
|
static paginate(t, r, n) {
|
|
1389
|
-
const
|
|
1439
|
+
const i = (r - 1) * n, s = i + n;
|
|
1390
1440
|
return {
|
|
1391
|
-
data: t.slice(
|
|
1441
|
+
data: t.slice(i, s),
|
|
1392
1442
|
total: t.length,
|
|
1393
1443
|
page: r,
|
|
1394
1444
|
totalPages: Math.ceil(t.length / n)
|
|
@@ -1398,24 +1448,24 @@ class Ie {
|
|
|
1398
1448
|
* Group items by field value
|
|
1399
1449
|
*/
|
|
1400
1450
|
static groupBy(t, r) {
|
|
1401
|
-
return t.reduce((n,
|
|
1402
|
-
const s = String(
|
|
1403
|
-
return n[s] || (n[s] = []), n[s].push(
|
|
1451
|
+
return t.reduce((n, i) => {
|
|
1452
|
+
const s = String(i[r]);
|
|
1453
|
+
return n[s] || (n[s] = []), n[s].push(i), n;
|
|
1404
1454
|
}, {});
|
|
1405
1455
|
}
|
|
1406
1456
|
/**
|
|
1407
1457
|
* Get unique values for a field
|
|
1408
1458
|
*/
|
|
1409
1459
|
static unique(t, r) {
|
|
1410
|
-
const n = t.map((
|
|
1460
|
+
const n = t.map((i) => i[r]);
|
|
1411
1461
|
return [...new Set(n)];
|
|
1412
1462
|
}
|
|
1413
1463
|
/**
|
|
1414
1464
|
* Count items by field value
|
|
1415
1465
|
*/
|
|
1416
1466
|
static countBy(t, r) {
|
|
1417
|
-
return t.reduce((n,
|
|
1418
|
-
const s = String(
|
|
1467
|
+
return t.reduce((n, i) => {
|
|
1468
|
+
const s = String(i[r]);
|
|
1419
1469
|
return n[s] = (n[s] || 0) + 1, n;
|
|
1420
1470
|
}, {});
|
|
1421
1471
|
}
|
|
@@ -1423,71 +1473,71 @@ class Ie {
|
|
|
1423
1473
|
* Apply multiple operations in sequence
|
|
1424
1474
|
*/
|
|
1425
1475
|
static pipe(t, r) {
|
|
1426
|
-
return r.reduce((n,
|
|
1476
|
+
return r.reduce((n, i) => i(n), t);
|
|
1427
1477
|
}
|
|
1428
1478
|
}
|
|
1429
|
-
function
|
|
1430
|
-
endpoint:
|
|
1479
|
+
function Ut({
|
|
1480
|
+
endpoint: h,
|
|
1431
1481
|
params: t,
|
|
1432
1482
|
layout: r = "list",
|
|
1433
1483
|
title: n,
|
|
1434
|
-
emptyMessage:
|
|
1484
|
+
emptyMessage: i = "No items found",
|
|
1435
1485
|
renderItem: s,
|
|
1436
|
-
keyExtractor:
|
|
1437
|
-
searchable:
|
|
1438
|
-
searchFields:
|
|
1486
|
+
keyExtractor: o = (S, V) => S.id || S._id || String(V),
|
|
1487
|
+
searchable: p = !1,
|
|
1488
|
+
searchFields: u = [],
|
|
1439
1489
|
searchPlaceholder: g = "Search...",
|
|
1440
|
-
filters:
|
|
1441
|
-
pageSize:
|
|
1490
|
+
filters: c = [],
|
|
1491
|
+
pageSize: _ = 20,
|
|
1442
1492
|
onItemClick: x,
|
|
1443
|
-
onRefresh:
|
|
1444
|
-
theme:
|
|
1493
|
+
onRefresh: m,
|
|
1494
|
+
theme: T = {}
|
|
1445
1495
|
}) {
|
|
1446
|
-
const { data:
|
|
1447
|
-
if (!
|
|
1448
|
-
let
|
|
1449
|
-
return
|
|
1450
|
-
}, [
|
|
1451
|
-
|
|
1496
|
+
const { data: S, loading: V, error: B, refetch: $ } = Rt(h, t), [Y, w] = z(""), [D, y] = z({}), [N, F] = z(1), j = rt(() => {
|
|
1497
|
+
if (!S) return { data: [], total: 0, totalPages: 0 };
|
|
1498
|
+
let R = S;
|
|
1499
|
+
return p && Y && u.length > 0 && (R = Be.search(R, Y, u)), Object.keys(D).length > 0 && (R = Be.filterByFields(R, D)), Be.paginate(R, N, _);
|
|
1500
|
+
}, [S, Y, D, N, _, p, u]);
|
|
1501
|
+
de(() => {
|
|
1452
1502
|
F(1);
|
|
1453
|
-
}, [
|
|
1454
|
-
const
|
|
1455
|
-
w(""),
|
|
1456
|
-
},
|
|
1457
|
-
background:
|
|
1458
|
-
cardBackground:
|
|
1459
|
-
text:
|
|
1460
|
-
textSecondary:
|
|
1461
|
-
border:
|
|
1462
|
-
primary:
|
|
1463
|
-
},
|
|
1503
|
+
}, [Y, D]);
|
|
1504
|
+
const C = () => {
|
|
1505
|
+
w(""), y({}), F(1), $(), m == null || m();
|
|
1506
|
+
}, v = {
|
|
1507
|
+
background: T.background || "#ffffff",
|
|
1508
|
+
cardBackground: T.cardBackground || "#f9fafb",
|
|
1509
|
+
text: T.text || "#111827",
|
|
1510
|
+
textSecondary: T.textSecondary || "#6b7280",
|
|
1511
|
+
border: T.border || "#e5e7eb",
|
|
1512
|
+
primary: T.primary || "#3b82f6"
|
|
1513
|
+
}, I = s || ((R) => /* @__PURE__ */ a.jsxs("div", { style: {
|
|
1464
1514
|
padding: "16px",
|
|
1465
1515
|
cursor: x ? "pointer" : "default"
|
|
1466
1516
|
}, children: [
|
|
1467
|
-
/* @__PURE__ */ a.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color:
|
|
1468
|
-
|
|
1517
|
+
/* @__PURE__ */ a.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color: v.text }, children: R.title || R.name || R.label || "Untitled" }),
|
|
1518
|
+
R.description && /* @__PURE__ */ a.jsx("div", { style: { fontSize: "13px", color: v.textSecondary, marginTop: "4px" }, children: R.description })
|
|
1469
1519
|
] }));
|
|
1470
|
-
return
|
|
1520
|
+
return V && !S ? /* @__PURE__ */ a.jsx("div", { style: {
|
|
1471
1521
|
display: "flex",
|
|
1472
1522
|
alignItems: "center",
|
|
1473
1523
|
justifyContent: "center",
|
|
1474
1524
|
padding: "48px",
|
|
1475
|
-
color:
|
|
1476
|
-
}, children: "Loading..." }) :
|
|
1525
|
+
color: v.textSecondary
|
|
1526
|
+
}, children: "Loading..." }) : B ? /* @__PURE__ */ a.jsxs("div", { style: {
|
|
1477
1527
|
padding: "24px",
|
|
1478
1528
|
textAlign: "center",
|
|
1479
1529
|
color: "#ef4444"
|
|
1480
1530
|
}, children: [
|
|
1481
1531
|
/* @__PURE__ */ a.jsx("div", { style: { fontWeight: 500, marginBottom: "8px" }, children: "Error" }),
|
|
1482
|
-
/* @__PURE__ */ a.jsx("div", { style: { fontSize: "14px" }, children:
|
|
1532
|
+
/* @__PURE__ */ a.jsx("div", { style: { fontSize: "14px" }, children: B.message }),
|
|
1483
1533
|
/* @__PURE__ */ a.jsx(
|
|
1484
1534
|
"button",
|
|
1485
1535
|
{
|
|
1486
|
-
onClick:
|
|
1536
|
+
onClick: C,
|
|
1487
1537
|
style: {
|
|
1488
1538
|
marginTop: "16px",
|
|
1489
1539
|
padding: "8px 16px",
|
|
1490
|
-
background:
|
|
1540
|
+
background: v.primary,
|
|
1491
1541
|
color: "white",
|
|
1492
1542
|
border: "none",
|
|
1493
1543
|
borderRadius: "6px",
|
|
@@ -1497,36 +1547,36 @@ function Mt({
|
|
|
1497
1547
|
}
|
|
1498
1548
|
)
|
|
1499
1549
|
] }) : /* @__PURE__ */ a.jsxs("div", { style: {
|
|
1500
|
-
background:
|
|
1550
|
+
background: v.background,
|
|
1501
1551
|
borderRadius: "12px",
|
|
1502
1552
|
overflow: "hidden"
|
|
1503
1553
|
}, children: [
|
|
1504
|
-
(n ||
|
|
1554
|
+
(n || p || c.length > 0) && /* @__PURE__ */ a.jsxs("div", { style: {
|
|
1505
1555
|
padding: "16px",
|
|
1506
|
-
borderBottom: `1px solid ${
|
|
1556
|
+
borderBottom: `1px solid ${v.border}`
|
|
1507
1557
|
}, children: [
|
|
1508
1558
|
/* @__PURE__ */ a.jsxs("div", { style: {
|
|
1509
1559
|
display: "flex",
|
|
1510
1560
|
alignItems: "center",
|
|
1511
1561
|
justifyContent: "space-between",
|
|
1512
|
-
marginBottom:
|
|
1562
|
+
marginBottom: p || c.length > 0 ? "12px" : "0"
|
|
1513
1563
|
}, children: [
|
|
1514
1564
|
n && /* @__PURE__ */ a.jsx("h2", { style: {
|
|
1515
1565
|
margin: 0,
|
|
1516
1566
|
fontSize: "18px",
|
|
1517
1567
|
fontWeight: 600,
|
|
1518
|
-
color:
|
|
1568
|
+
color: v.text
|
|
1519
1569
|
}, children: n }),
|
|
1520
1570
|
/* @__PURE__ */ a.jsx(
|
|
1521
1571
|
"button",
|
|
1522
1572
|
{
|
|
1523
|
-
onClick:
|
|
1573
|
+
onClick: C,
|
|
1524
1574
|
style: {
|
|
1525
1575
|
padding: "6px 12px",
|
|
1526
1576
|
background: "transparent",
|
|
1527
|
-
border: `1px solid ${
|
|
1577
|
+
border: `1px solid ${v.border}`,
|
|
1528
1578
|
borderRadius: "6px",
|
|
1529
|
-
color:
|
|
1579
|
+
color: v.textSecondary,
|
|
1530
1580
|
cursor: "pointer",
|
|
1531
1581
|
fontSize: "13px"
|
|
1532
1582
|
},
|
|
@@ -1534,17 +1584,17 @@ function Mt({
|
|
|
1534
1584
|
}
|
|
1535
1585
|
)
|
|
1536
1586
|
] }),
|
|
1537
|
-
|
|
1587
|
+
p && /* @__PURE__ */ a.jsx(
|
|
1538
1588
|
"input",
|
|
1539
1589
|
{
|
|
1540
1590
|
type: "text",
|
|
1541
1591
|
placeholder: g,
|
|
1542
|
-
value:
|
|
1543
|
-
onChange: (
|
|
1592
|
+
value: Y,
|
|
1593
|
+
onChange: (R) => w(R.target.value),
|
|
1544
1594
|
style: {
|
|
1545
1595
|
width: "100%",
|
|
1546
1596
|
padding: "8px 12px",
|
|
1547
|
-
border: `1px solid ${
|
|
1597
|
+
border: `1px solid ${v.border}`,
|
|
1548
1598
|
borderRadius: "8px",
|
|
1549
1599
|
fontSize: "14px",
|
|
1550
1600
|
outline: "none"
|
|
@@ -1558,56 +1608,56 @@ function Mt({
|
|
|
1558
1608
|
gridTemplateColumns: r === "grid" ? "repeat(auto-fill, minmax(250px, 1fr))" : void 0,
|
|
1559
1609
|
gap: r === "list" ? "0" : "16px",
|
|
1560
1610
|
padding: r === "list" ? "0" : "16px"
|
|
1561
|
-
}, children:
|
|
1611
|
+
}, children: j.data.length === 0 ? /* @__PURE__ */ a.jsx("div", { style: {
|
|
1562
1612
|
padding: "48px",
|
|
1563
1613
|
textAlign: "center",
|
|
1564
|
-
color:
|
|
1565
|
-
}, children:
|
|
1614
|
+
color: v.textSecondary
|
|
1615
|
+
}, children: i }) : j.data.map((R, L) => /* @__PURE__ */ a.jsx(
|
|
1566
1616
|
"div",
|
|
1567
1617
|
{
|
|
1568
|
-
onClick: () => x == null ? void 0 : x(
|
|
1618
|
+
onClick: () => x == null ? void 0 : x(R),
|
|
1569
1619
|
style: {
|
|
1570
|
-
background:
|
|
1620
|
+
background: v.cardBackground,
|
|
1571
1621
|
borderRadius: r === "list" ? "0" : "8px",
|
|
1572
|
-
borderBottom: r === "list" ? `1px solid ${
|
|
1622
|
+
borderBottom: r === "list" ? `1px solid ${v.border}` : "none",
|
|
1573
1623
|
transition: "all 0.15s ease"
|
|
1574
1624
|
},
|
|
1575
|
-
onMouseEnter: (
|
|
1576
|
-
x && (
|
|
1625
|
+
onMouseEnter: (J) => {
|
|
1626
|
+
x && (J.currentTarget.style.background = v.border);
|
|
1577
1627
|
},
|
|
1578
|
-
onMouseLeave: (
|
|
1579
|
-
|
|
1628
|
+
onMouseLeave: (J) => {
|
|
1629
|
+
J.currentTarget.style.background = v.cardBackground;
|
|
1580
1630
|
},
|
|
1581
|
-
children:
|
|
1631
|
+
children: I(R, L)
|
|
1582
1632
|
},
|
|
1583
|
-
|
|
1633
|
+
o(R, L)
|
|
1584
1634
|
)) }),
|
|
1585
|
-
|
|
1635
|
+
j.totalPages > 1 && /* @__PURE__ */ a.jsxs("div", { style: {
|
|
1586
1636
|
padding: "16px",
|
|
1587
|
-
borderTop: `1px solid ${
|
|
1637
|
+
borderTop: `1px solid ${v.border}`,
|
|
1588
1638
|
display: "flex",
|
|
1589
1639
|
alignItems: "center",
|
|
1590
1640
|
justifyContent: "space-between"
|
|
1591
1641
|
}, children: [
|
|
1592
|
-
/* @__PURE__ */ a.jsxs("div", { style: { fontSize: "13px", color:
|
|
1642
|
+
/* @__PURE__ */ a.jsxs("div", { style: { fontSize: "13px", color: v.textSecondary }, children: [
|
|
1593
1643
|
"Page ",
|
|
1594
|
-
|
|
1644
|
+
N,
|
|
1595
1645
|
" of ",
|
|
1596
|
-
|
|
1646
|
+
j.totalPages
|
|
1597
1647
|
] }),
|
|
1598
1648
|
/* @__PURE__ */ a.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
1599
1649
|
/* @__PURE__ */ a.jsx(
|
|
1600
1650
|
"button",
|
|
1601
1651
|
{
|
|
1602
|
-
onClick: () => F((
|
|
1603
|
-
disabled:
|
|
1652
|
+
onClick: () => F((R) => Math.max(1, R - 1)),
|
|
1653
|
+
disabled: N === 1,
|
|
1604
1654
|
style: {
|
|
1605
1655
|
padding: "6px 12px",
|
|
1606
|
-
border: `1px solid ${
|
|
1656
|
+
border: `1px solid ${v.border}`,
|
|
1607
1657
|
borderRadius: "6px",
|
|
1608
1658
|
background: "white",
|
|
1609
|
-
cursor:
|
|
1610
|
-
opacity:
|
|
1659
|
+
cursor: N === 1 ? "not-allowed" : "pointer",
|
|
1660
|
+
opacity: N === 1 ? 0.5 : 1
|
|
1611
1661
|
},
|
|
1612
1662
|
children: "Previous"
|
|
1613
1663
|
}
|
|
@@ -1615,15 +1665,15 @@ function Mt({
|
|
|
1615
1665
|
/* @__PURE__ */ a.jsx(
|
|
1616
1666
|
"button",
|
|
1617
1667
|
{
|
|
1618
|
-
onClick: () => F((
|
|
1619
|
-
disabled:
|
|
1668
|
+
onClick: () => F((R) => Math.min(j.totalPages, R + 1)),
|
|
1669
|
+
disabled: N === j.totalPages,
|
|
1620
1670
|
style: {
|
|
1621
1671
|
padding: "6px 12px",
|
|
1622
|
-
border: `1px solid ${
|
|
1672
|
+
border: `1px solid ${v.border}`,
|
|
1623
1673
|
borderRadius: "6px",
|
|
1624
1674
|
background: "white",
|
|
1625
|
-
cursor:
|
|
1626
|
-
opacity:
|
|
1675
|
+
cursor: N === j.totalPages ? "not-allowed" : "pointer",
|
|
1676
|
+
opacity: N === j.totalPages ? 0.5 : 1
|
|
1627
1677
|
},
|
|
1628
1678
|
children: "Next"
|
|
1629
1679
|
}
|
|
@@ -1632,15 +1682,15 @@ function Mt({
|
|
|
1632
1682
|
] })
|
|
1633
1683
|
] });
|
|
1634
1684
|
}
|
|
1635
|
-
function
|
|
1636
|
-
item:
|
|
1685
|
+
function Mt({
|
|
1686
|
+
item: h,
|
|
1637
1687
|
onClick: t,
|
|
1638
|
-
title: r = (
|
|
1639
|
-
subtitle: n = (
|
|
1640
|
-
image:
|
|
1641
|
-
badge: s = (
|
|
1688
|
+
title: r = (o) => o.title || o.name || o.label || "Untitled",
|
|
1689
|
+
subtitle: n = (o) => o.description || o.subtitle || "",
|
|
1690
|
+
image: i = (o) => o.image || o.thumbnail || o.photo,
|
|
1691
|
+
badge: s = (o) => o.badge || o.tag || o.type
|
|
1642
1692
|
}) {
|
|
1643
|
-
const
|
|
1693
|
+
const o = r(h), p = n(h), u = i(h), g = s(h);
|
|
1644
1694
|
return /* @__PURE__ */ a.jsxs(
|
|
1645
1695
|
"div",
|
|
1646
1696
|
{
|
|
@@ -1651,35 +1701,35 @@ function Dt({
|
|
|
1651
1701
|
${t ? "cursor-pointer" : ""}
|
|
1652
1702
|
`,
|
|
1653
1703
|
children: [
|
|
1654
|
-
|
|
1704
|
+
u && /* @__PURE__ */ a.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ a.jsx(
|
|
1655
1705
|
"img",
|
|
1656
1706
|
{
|
|
1657
|
-
src:
|
|
1658
|
-
alt:
|
|
1707
|
+
src: u,
|
|
1708
|
+
alt: o,
|
|
1659
1709
|
className: "w-16 h-16 object-cover rounded-lg"
|
|
1660
1710
|
}
|
|
1661
1711
|
) }),
|
|
1662
1712
|
/* @__PURE__ */ a.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1663
1713
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1664
|
-
/* @__PURE__ */ a.jsx("h3", { className: "font-medium text-gray-900 truncate", children:
|
|
1714
|
+
/* @__PURE__ */ a.jsx("h3", { className: "font-medium text-gray-900 truncate", children: o }),
|
|
1665
1715
|
g && /* @__PURE__ */ a.jsx("span", { className: "px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full", children: g })
|
|
1666
1716
|
] }),
|
|
1667
|
-
|
|
1717
|
+
p && /* @__PURE__ */ a.jsx("p", { className: "text-sm text-gray-600 truncate mt-0.5", children: p })
|
|
1668
1718
|
] }),
|
|
1669
1719
|
t && /* @__PURE__ */ a.jsx("div", { className: "flex-shrink-0 text-gray-400", children: /* @__PURE__ */ a.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }) })
|
|
1670
1720
|
]
|
|
1671
1721
|
}
|
|
1672
1722
|
);
|
|
1673
1723
|
}
|
|
1674
|
-
function
|
|
1675
|
-
item:
|
|
1724
|
+
function Bt({
|
|
1725
|
+
item: h,
|
|
1676
1726
|
onClose: t,
|
|
1677
1727
|
title: r = (s) => s.title || s.name || s.label || "Detail",
|
|
1678
1728
|
image: n = (s) => s.image || s.thumbnail || s.photo,
|
|
1679
|
-
fields:
|
|
1729
|
+
fields: i = []
|
|
1680
1730
|
}) {
|
|
1681
|
-
if (!
|
|
1682
|
-
const s = r(
|
|
1731
|
+
if (!h) return null;
|
|
1732
|
+
const s = r(h), o = n(h);
|
|
1683
1733
|
return /* @__PURE__ */ a.jsx("div", { className: "fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4", children: /* @__PURE__ */ a.jsxs("div", { className: "bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl", children: [
|
|
1684
1734
|
/* @__PURE__ */ a.jsxs("div", { className: "sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between", children: [
|
|
1685
1735
|
/* @__PURE__ */ a.jsx("h2", { className: "text-xl font-semibold text-gray-900", children: s }),
|
|
@@ -1693,22 +1743,22 @@ function It({
|
|
|
1693
1743
|
)
|
|
1694
1744
|
] }),
|
|
1695
1745
|
/* @__PURE__ */ a.jsxs("div", { className: "p-6", children: [
|
|
1696
|
-
|
|
1746
|
+
o && /* @__PURE__ */ a.jsx("div", { className: "mb-6", children: /* @__PURE__ */ a.jsx(
|
|
1697
1747
|
"img",
|
|
1698
1748
|
{
|
|
1699
|
-
src:
|
|
1749
|
+
src: o,
|
|
1700
1750
|
alt: s,
|
|
1701
1751
|
className: "w-full h-64 object-cover rounded-lg"
|
|
1702
1752
|
}
|
|
1703
1753
|
) }),
|
|
1704
|
-
|
|
1705
|
-
const g =
|
|
1754
|
+
i.length > 0 && /* @__PURE__ */ a.jsx("div", { className: "space-y-4", children: i.map((p, u) => {
|
|
1755
|
+
const g = p.value(h);
|
|
1706
1756
|
return g == null || g === "" ? null : /* @__PURE__ */ a.jsxs("div", { children: [
|
|
1707
|
-
/* @__PURE__ */ a.jsx("div", { className: "text-sm font-medium text-gray-500 mb-1", children:
|
|
1757
|
+
/* @__PURE__ */ a.jsx("div", { className: "text-sm font-medium text-gray-500 mb-1", children: p.label }),
|
|
1708
1758
|
/* @__PURE__ */ a.jsx("div", { className: "text-base text-gray-900", children: typeof g == "object" ? JSON.stringify(g, null, 2) : String(g) })
|
|
1709
|
-
] },
|
|
1759
|
+
] }, u);
|
|
1710
1760
|
}) }),
|
|
1711
|
-
|
|
1761
|
+
i.length === 0 && /* @__PURE__ */ a.jsx("pre", { className: "bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto", children: JSON.stringify(h, null, 2) })
|
|
1712
1762
|
] }),
|
|
1713
1763
|
t && /* @__PURE__ */ a.jsx("div", { className: "sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4", children: /* @__PURE__ */ a.jsx(
|
|
1714
1764
|
"button",
|
|
@@ -1725,96 +1775,96 @@ const Nt = {
|
|
|
1725
1775
|
medium: "w-48 h-48",
|
|
1726
1776
|
large: "w-64 h-64"
|
|
1727
1777
|
};
|
|
1728
|
-
function
|
|
1729
|
-
nodes:
|
|
1778
|
+
function It({
|
|
1779
|
+
nodes: h,
|
|
1730
1780
|
cardCount: t = 2,
|
|
1731
1781
|
minInterval: r = 1e3,
|
|
1732
1782
|
maxInterval: n = 3e3,
|
|
1733
|
-
onCardClick:
|
|
1783
|
+
onCardClick: i,
|
|
1734
1784
|
cardSize: s = "medium",
|
|
1735
|
-
className:
|
|
1785
|
+
className: o = ""
|
|
1736
1786
|
}) {
|
|
1737
|
-
const
|
|
1738
|
-
const
|
|
1739
|
-
if (
|
|
1740
|
-
const F = Math.floor(Math.random() *
|
|
1741
|
-
return
|
|
1742
|
-
}, [
|
|
1743
|
-
|
|
1744
|
-
if (
|
|
1745
|
-
g([]),
|
|
1787
|
+
const p = Math.min(Math.max(t, 1), 5), [u, g] = z([]), [c, _] = z([]), [x, m] = z(Array(p).fill(!1)), [T, S] = z(Array(p).fill(!1)), V = Qe([]), B = X((y) => {
|
|
1788
|
+
const N = h.filter((j) => !y.includes(j._id));
|
|
1789
|
+
if (N.length === 0) return null;
|
|
1790
|
+
const F = Math.floor(Math.random() * N.length);
|
|
1791
|
+
return N[F];
|
|
1792
|
+
}, [h]), $ = X(() => Math.random() * (n - r) + r, [r, n]);
|
|
1793
|
+
de(() => {
|
|
1794
|
+
if (h.length === 0) {
|
|
1795
|
+
g([]), _([]);
|
|
1746
1796
|
return;
|
|
1747
1797
|
}
|
|
1748
|
-
const
|
|
1749
|
-
for (let
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1798
|
+
const y = [], N = [], F = [];
|
|
1799
|
+
for (let j = 0; j < p && j < h.length; j++) {
|
|
1800
|
+
const C = B(F);
|
|
1801
|
+
C && (y.push(C), F.push(C._id));
|
|
1752
1802
|
}
|
|
1753
|
-
for (let
|
|
1754
|
-
const
|
|
1755
|
-
|
|
1756
|
-
...
|
|
1757
|
-
],
|
|
1758
|
-
|
|
1803
|
+
for (let j = 0; j < y.length; j++) {
|
|
1804
|
+
const C = [
|
|
1805
|
+
y[j]._id,
|
|
1806
|
+
...y.filter((W, I) => I !== j).map((W) => W._id)
|
|
1807
|
+
], v = B(C);
|
|
1808
|
+
v ? N.push(v) : N.push(y[j]);
|
|
1759
1809
|
}
|
|
1760
|
-
g(
|
|
1761
|
-
}, [
|
|
1762
|
-
const
|
|
1763
|
-
const
|
|
1764
|
-
|
|
1765
|
-
const
|
|
1766
|
-
return
|
|
1810
|
+
g(y), _(N);
|
|
1811
|
+
}, [h, p, B]);
|
|
1812
|
+
const Y = X((y) => {
|
|
1813
|
+
const N = $(), F = setTimeout(() => {
|
|
1814
|
+
m((j) => {
|
|
1815
|
+
const C = [...j];
|
|
1816
|
+
return C[y] = !C[y], C;
|
|
1767
1817
|
}), setTimeout(() => {
|
|
1768
|
-
|
|
1769
|
-
const
|
|
1770
|
-
return
|
|
1818
|
+
S((j) => {
|
|
1819
|
+
const C = [...j];
|
|
1820
|
+
return C[y] = !C[y], C;
|
|
1771
1821
|
}), setTimeout(() => {
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1774
|
-
const
|
|
1775
|
-
return y
|
|
1776
|
-
}),
|
|
1777
|
-
const
|
|
1778
|
-
(
|
|
1779
|
-
...
|
|
1780
|
-
...
|
|
1781
|
-
],
|
|
1782
|
-
return
|
|
1822
|
+
const j = !T[y];
|
|
1823
|
+
j && g((C) => {
|
|
1824
|
+
const v = [...C];
|
|
1825
|
+
return v[y] = c[y], v;
|
|
1826
|
+
}), _((C) => {
|
|
1827
|
+
const v = [...C], I = [
|
|
1828
|
+
(j ? c[y] : u[y])._id,
|
|
1829
|
+
...u.filter((L, J) => J !== y).map((L) => L._id),
|
|
1830
|
+
...C.filter((L, J) => J !== y).map((L) => L._id)
|
|
1831
|
+
], R = B(I);
|
|
1832
|
+
return R && (v[y] = R), v;
|
|
1783
1833
|
}), setTimeout(() => {
|
|
1784
|
-
|
|
1834
|
+
Y(y);
|
|
1785
1835
|
}, 150);
|
|
1786
1836
|
}, 200);
|
|
1787
1837
|
}, 150);
|
|
1788
|
-
},
|
|
1789
|
-
|
|
1790
|
-
}, [$,
|
|
1791
|
-
|
|
1792
|
-
if (!(
|
|
1838
|
+
}, N);
|
|
1839
|
+
V.current[y] = F;
|
|
1840
|
+
}, [$, B, u, c, T]), w = Qe(!1);
|
|
1841
|
+
de(() => {
|
|
1842
|
+
if (!(u.length === 0 || h.length <= 1) && !w.current) {
|
|
1793
1843
|
w.current = !0;
|
|
1794
|
-
for (let
|
|
1795
|
-
|
|
1844
|
+
for (let y = 0; y < u.length; y++)
|
|
1845
|
+
Y(y);
|
|
1796
1846
|
return () => {
|
|
1797
|
-
|
|
1847
|
+
V.current.forEach((y) => clearTimeout(y)), V.current = [], w.current = !1;
|
|
1798
1848
|
};
|
|
1799
1849
|
}
|
|
1800
|
-
}, [
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1850
|
+
}, [u.length, h.length]);
|
|
1851
|
+
const D = (y) => {
|
|
1852
|
+
i && i(y);
|
|
1803
1853
|
};
|
|
1804
|
-
return
|
|
1805
|
-
const F =
|
|
1854
|
+
return h.length === 0 ? /* @__PURE__ */ a.jsx("div", { className: `flex items-center justify-center p-8 ${o}`, children: /* @__PURE__ */ a.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : u.length === 0 ? /* @__PURE__ */ a.jsx("div", { className: `flex items-center justify-center p-8 ${o}`, children: /* @__PURE__ */ a.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ a.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${o}`, children: u.map((y, N) => {
|
|
1855
|
+
const F = c[N], j = T[N];
|
|
1806
1856
|
return /* @__PURE__ */ a.jsx(
|
|
1807
1857
|
"div",
|
|
1808
1858
|
{
|
|
1809
1859
|
className: `relative ${Nt[s]}`,
|
|
1810
1860
|
style: { perspective: "1000px" },
|
|
1811
|
-
onClick: () =>
|
|
1861
|
+
onClick: () => D(j ? F : y),
|
|
1812
1862
|
children: /* @__PURE__ */ a.jsxs(
|
|
1813
1863
|
"div",
|
|
1814
1864
|
{
|
|
1815
1865
|
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
1816
1866
|
style: {
|
|
1817
|
-
transform: `rotateY(${x[
|
|
1867
|
+
transform: `rotateY(${x[N] ? 180 : 0}deg)`,
|
|
1818
1868
|
transition: "transform 0.5s",
|
|
1819
1869
|
transformStyle: "preserve-3d"
|
|
1820
1870
|
},
|
|
@@ -1824,13 +1874,13 @@ function Bt({
|
|
|
1824
1874
|
{
|
|
1825
1875
|
className: "absolute inset-0 transition-opacity duration-200",
|
|
1826
1876
|
style: {
|
|
1827
|
-
opacity:
|
|
1877
|
+
opacity: j ? 0 : 1
|
|
1828
1878
|
},
|
|
1829
1879
|
children: /* @__PURE__ */ a.jsxs(
|
|
1830
1880
|
"div",
|
|
1831
1881
|
{
|
|
1832
1882
|
style: {
|
|
1833
|
-
transform: x[
|
|
1883
|
+
transform: x[N] ? "scaleX(-1)" : "scaleX(1)",
|
|
1834
1884
|
width: "100%",
|
|
1835
1885
|
height: "100%"
|
|
1836
1886
|
},
|
|
@@ -1838,12 +1888,12 @@ function Bt({
|
|
|
1838
1888
|
/* @__PURE__ */ a.jsx(
|
|
1839
1889
|
"img",
|
|
1840
1890
|
{
|
|
1841
|
-
src:
|
|
1842
|
-
alt:
|
|
1891
|
+
src: y.data.image,
|
|
1892
|
+
alt: y.title,
|
|
1843
1893
|
className: "w-full h-full object-cover"
|
|
1844
1894
|
}
|
|
1845
1895
|
),
|
|
1846
|
-
/* @__PURE__ */ a.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ a.jsx("p", { className: "text-white text-sm font-medium truncate", children:
|
|
1896
|
+
/* @__PURE__ */ a.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ a.jsx("p", { className: "text-white text-sm font-medium truncate", children: y.title }) })
|
|
1847
1897
|
]
|
|
1848
1898
|
}
|
|
1849
1899
|
)
|
|
@@ -1854,13 +1904,13 @@ function Bt({
|
|
|
1854
1904
|
{
|
|
1855
1905
|
className: "absolute inset-0 transition-opacity duration-200",
|
|
1856
1906
|
style: {
|
|
1857
|
-
opacity:
|
|
1907
|
+
opacity: j ? 1 : 0
|
|
1858
1908
|
},
|
|
1859
1909
|
children: /* @__PURE__ */ a.jsxs(
|
|
1860
1910
|
"div",
|
|
1861
1911
|
{
|
|
1862
1912
|
style: {
|
|
1863
|
-
transform: x[
|
|
1913
|
+
transform: x[N] ? "scaleX(-1)" : "scaleX(1)",
|
|
1864
1914
|
width: "100%",
|
|
1865
1915
|
height: "100%"
|
|
1866
1916
|
},
|
|
@@ -1883,32 +1933,32 @@ function Bt({
|
|
|
1883
1933
|
}
|
|
1884
1934
|
)
|
|
1885
1935
|
},
|
|
1886
|
-
`slot-${
|
|
1936
|
+
`slot-${N}`
|
|
1887
1937
|
);
|
|
1888
1938
|
}) });
|
|
1889
1939
|
}
|
|
1890
|
-
function
|
|
1891
|
-
if (!
|
|
1940
|
+
function Te(h) {
|
|
1941
|
+
if (!h) return "";
|
|
1892
1942
|
const t = /=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;
|
|
1893
|
-
return
|
|
1943
|
+
return h.replace(t, (r, n, i, s) => {
|
|
1894
1944
|
try {
|
|
1895
|
-
if (
|
|
1896
|
-
const
|
|
1897
|
-
return decodeURIComponent(escape(
|
|
1898
|
-
} else if (
|
|
1899
|
-
const
|
|
1945
|
+
if (i.toUpperCase() === "B") {
|
|
1946
|
+
const o = atob(s);
|
|
1947
|
+
return decodeURIComponent(escape(o));
|
|
1948
|
+
} else if (i.toUpperCase() === "Q") {
|
|
1949
|
+
const o = s.replace(/_/g, " ").replace(
|
|
1900
1950
|
/=([0-9A-Fa-f]{2})/g,
|
|
1901
|
-
(
|
|
1951
|
+
(p, u) => String.fromCharCode(parseInt(u, 16))
|
|
1902
1952
|
);
|
|
1903
|
-
return decodeURIComponent(escape(
|
|
1953
|
+
return decodeURIComponent(escape(o));
|
|
1904
1954
|
}
|
|
1905
|
-
} catch (
|
|
1906
|
-
console.warn("MIME decode error:",
|
|
1955
|
+
} catch (o) {
|
|
1956
|
+
console.warn("MIME decode error:", o);
|
|
1907
1957
|
}
|
|
1908
1958
|
return r;
|
|
1909
1959
|
}).replace(/\s+/g, " ").trim();
|
|
1910
1960
|
}
|
|
1911
|
-
const
|
|
1961
|
+
const Ct = {
|
|
1912
1962
|
background: "#ffffff",
|
|
1913
1963
|
cardBackground: "#ffffff",
|
|
1914
1964
|
selectedBackground: "#f5f5f5",
|
|
@@ -1920,118 +1970,121 @@ const Pt = {
|
|
|
1920
1970
|
danger: "#ef4444"
|
|
1921
1971
|
};
|
|
1922
1972
|
function Lt({
|
|
1923
|
-
baseUrl:
|
|
1973
|
+
baseUrl: h,
|
|
1924
1974
|
systemId: t,
|
|
1925
1975
|
accountId: r,
|
|
1926
1976
|
limit: n = 30,
|
|
1927
|
-
folder:
|
|
1977
|
+
folder: i,
|
|
1928
1978
|
selectable: s = !0,
|
|
1929
|
-
showDetail:
|
|
1930
|
-
emptyMessage:
|
|
1931
|
-
autoLoad:
|
|
1979
|
+
showDetail: o = !1,
|
|
1980
|
+
emptyMessage: p = "No emails",
|
|
1981
|
+
autoLoad: u = !0,
|
|
1932
1982
|
onSelect: g,
|
|
1933
|
-
onSelectionChange:
|
|
1934
|
-
onDelete:
|
|
1983
|
+
onSelectionChange: c,
|
|
1984
|
+
onDelete: _,
|
|
1935
1985
|
onError: x,
|
|
1936
|
-
onLoad:
|
|
1937
|
-
renderItem:
|
|
1938
|
-
renderDetail:
|
|
1939
|
-
renderActions:
|
|
1940
|
-
renderEmpty:
|
|
1986
|
+
onLoad: m,
|
|
1987
|
+
renderItem: T,
|
|
1988
|
+
renderDetail: S,
|
|
1989
|
+
renderActions: V,
|
|
1990
|
+
renderEmpty: B,
|
|
1941
1991
|
renderLoading: $,
|
|
1942
|
-
theme:
|
|
1992
|
+
theme: Y = {}
|
|
1943
1993
|
}) {
|
|
1944
|
-
const w = { ...
|
|
1945
|
-
if (
|
|
1946
|
-
F(!0),
|
|
1994
|
+
const w = { ...Ct, ...Y }, [D, y] = z([]), [N, F] = z(!1), [j, C] = z(null), [v, W] = z(/* @__PURE__ */ new Set()), [I, R] = z(null), [L, J] = z(null), Q = rt(() => t ? new jt({ baseUrl: h, system_id: t }) : null, [h, t]), re = X(async () => {
|
|
1995
|
+
if (Q) {
|
|
1996
|
+
F(!0), C(null);
|
|
1947
1997
|
try {
|
|
1948
|
-
const f = await
|
|
1998
|
+
const f = await Q.listEmails(r, n, i);
|
|
1949
1999
|
if (f != null && f.messages) {
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
2000
|
+
const E = [...f.messages].sort((G, K) => {
|
|
2001
|
+
const te = new Date(G.date).getTime() || 0;
|
|
2002
|
+
return (new Date(K.date).getTime() || 0) - te;
|
|
2003
|
+
});
|
|
2004
|
+
y(E), m == null || m(E);
|
|
1954
2005
|
}
|
|
1955
2006
|
} catch (f) {
|
|
1956
|
-
const
|
|
1957
|
-
|
|
2007
|
+
const E = f instanceof Error ? f : new Error("Failed to fetch emails");
|
|
2008
|
+
C(E.message), x == null || x(E);
|
|
1958
2009
|
}
|
|
1959
2010
|
F(!1);
|
|
1960
2011
|
}
|
|
1961
|
-
}, [
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
}, [
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
2012
|
+
}, [Q, r, n, i, x, m]);
|
|
2013
|
+
de(() => {
|
|
2014
|
+
u && re();
|
|
2015
|
+
}, [u, re]), de(() => {
|
|
2016
|
+
re();
|
|
2017
|
+
}, [i]);
|
|
2018
|
+
const ye = X((f) => {
|
|
2019
|
+
g == null || g(f), o && J(f);
|
|
2020
|
+
}, [g, o]), xe = X((f, E, G) => {
|
|
1968
2021
|
if (!s) {
|
|
1969
|
-
g == null || g(f),
|
|
2022
|
+
g == null || g(f), o && J(f);
|
|
1970
2023
|
return;
|
|
1971
2024
|
}
|
|
1972
|
-
const
|
|
1973
|
-
if (
|
|
1974
|
-
const te = Math.min(
|
|
1975
|
-
|
|
1976
|
-
} else if (
|
|
1977
|
-
|
|
1978
|
-
const
|
|
1979
|
-
return
|
|
1980
|
-
}), E
|
|
2025
|
+
const K = f.uid;
|
|
2026
|
+
if (G.shiftKey && I !== null) {
|
|
2027
|
+
const te = Math.min(I, E), Z = Math.max(I, E), Pe = D.slice(te, Z + 1).map((je) => je.uid), _e = new Set(Pe);
|
|
2028
|
+
W(_e), c == null || c(Array.from(_e));
|
|
2029
|
+
} else if (G.ctrlKey || G.metaKey)
|
|
2030
|
+
W((te) => {
|
|
2031
|
+
const Z = new Set(te);
|
|
2032
|
+
return Z.has(K) ? Z.delete(K) : Z.add(K), c == null || c(Array.from(Z)), Z;
|
|
2033
|
+
}), R(E);
|
|
1981
2034
|
else {
|
|
1982
|
-
const te = /* @__PURE__ */ new Set([
|
|
1983
|
-
|
|
2035
|
+
const te = /* @__PURE__ */ new Set([K]);
|
|
2036
|
+
W(te), R(E), c == null || c(Array.from(te));
|
|
1984
2037
|
}
|
|
1985
|
-
}, [s,
|
|
1986
|
-
if (!(!
|
|
2038
|
+
}, [s, I, D, v, g, c, o]), ve = X(async () => {
|
|
2039
|
+
if (!(!Q || v.size === 0))
|
|
1987
2040
|
try {
|
|
1988
|
-
const f = await
|
|
2041
|
+
const f = await Q.trashEmails(r, Array.from(v));
|
|
1989
2042
|
if (console.log("Trash result:", f), f.success && f.moved > 0) {
|
|
1990
|
-
|
|
1991
|
-
const
|
|
1992
|
-
|
|
2043
|
+
y((G) => G.filter((K) => !v.has(K.uid)));
|
|
2044
|
+
const E = Array.from(v);
|
|
2045
|
+
W(/* @__PURE__ */ new Set()), _ == null || _(E);
|
|
1993
2046
|
} else
|
|
1994
|
-
|
|
2047
|
+
C("Failed to move emails to trash");
|
|
1995
2048
|
} catch (f) {
|
|
1996
|
-
const
|
|
1997
|
-
console.error("Trash error:",
|
|
2049
|
+
const E = f instanceof Error ? f : new Error("Trash failed");
|
|
2050
|
+
console.error("Trash error:", E), C(E.message), x == null || x(E);
|
|
1998
2051
|
}
|
|
1999
|
-
}, [
|
|
2000
|
-
if (!(!
|
|
2052
|
+
}, [Q, r, v, _, x]), be = X(async () => {
|
|
2053
|
+
if (!(!Q || v.size === 0))
|
|
2001
2054
|
try {
|
|
2002
|
-
const f = await
|
|
2055
|
+
const f = await Q.archiveEmails(r, Array.from(v));
|
|
2003
2056
|
if (console.log("Archive result:", f), f.success && f.archived > 0) {
|
|
2004
|
-
|
|
2005
|
-
const
|
|
2006
|
-
|
|
2057
|
+
y((G) => G.filter((K) => !v.has(K.uid)));
|
|
2058
|
+
const E = Array.from(v);
|
|
2059
|
+
W(/* @__PURE__ */ new Set()), _ == null || _(E);
|
|
2007
2060
|
} else
|
|
2008
|
-
|
|
2061
|
+
C("Failed to archive emails");
|
|
2009
2062
|
} catch (f) {
|
|
2010
|
-
const
|
|
2011
|
-
console.error("Archive error:",
|
|
2063
|
+
const E = f instanceof Error ? f : new Error("Archive failed");
|
|
2064
|
+
console.error("Archive error:", E), C(E.message), x == null || x(E);
|
|
2012
2065
|
}
|
|
2013
|
-
}, [
|
|
2014
|
-
if (
|
|
2015
|
-
|
|
2066
|
+
}, [Q, r, v, _, x]), we = X(() => {
|
|
2067
|
+
if (v.size === D.length)
|
|
2068
|
+
W(/* @__PURE__ */ new Set()), c == null || c([]);
|
|
2016
2069
|
else {
|
|
2017
|
-
const f = new Set(
|
|
2018
|
-
|
|
2070
|
+
const f = new Set(D.map((E) => E.uid));
|
|
2071
|
+
W(f), c == null || c(Array.from(f));
|
|
2019
2072
|
}
|
|
2020
|
-
}, [
|
|
2021
|
-
|
|
2022
|
-
}, [
|
|
2073
|
+
}, [D, v.size, c]), Re = X(() => {
|
|
2074
|
+
W(/* @__PURE__ */ new Set()), c == null || c([]);
|
|
2075
|
+
}, [c]), Se = {
|
|
2023
2076
|
delete: ve,
|
|
2024
2077
|
archive: be,
|
|
2025
|
-
refresh:
|
|
2078
|
+
refresh: re,
|
|
2026
2079
|
selectAll: we,
|
|
2027
|
-
clearSelection:
|
|
2028
|
-
},
|
|
2080
|
+
clearSelection: Re
|
|
2081
|
+
}, ue = (f) => {
|
|
2029
2082
|
if (!f) return "";
|
|
2030
|
-
const
|
|
2031
|
-
return
|
|
2032
|
-
},
|
|
2083
|
+
const E = new Date(f), G = /* @__PURE__ */ new Date();
|
|
2084
|
+
return E.toDateString() === G.toDateString() ? E.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : E.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
2085
|
+
}, fe = (f, E) => /* @__PURE__ */ a.jsx("div", { style: {
|
|
2033
2086
|
padding: "12px 16px",
|
|
2034
|
-
background:
|
|
2087
|
+
background: E ? w.selectedBackground : f.seen ? w.cardBackground : w.unreadBackground,
|
|
2035
2088
|
borderBottom: `1px solid ${w.border}`,
|
|
2036
2089
|
cursor: "pointer",
|
|
2037
2090
|
transition: "background 0.15s ease"
|
|
@@ -2044,7 +2097,7 @@ function Lt({
|
|
|
2044
2097
|
whiteSpace: "nowrap",
|
|
2045
2098
|
overflow: "hidden",
|
|
2046
2099
|
textOverflow: "ellipsis"
|
|
2047
|
-
}, children:
|
|
2100
|
+
}, children: Te(f.from).split("@")[0] }),
|
|
2048
2101
|
/* @__PURE__ */ a.jsx("div", { style: {
|
|
2049
2102
|
fontSize: "14px",
|
|
2050
2103
|
fontWeight: f.seen ? 400 : 500,
|
|
@@ -2053,23 +2106,23 @@ function Lt({
|
|
|
2053
2106
|
whiteSpace: "nowrap",
|
|
2054
2107
|
overflow: "hidden",
|
|
2055
2108
|
textOverflow: "ellipsis"
|
|
2056
|
-
}, children:
|
|
2109
|
+
}, children: Te(f.subject) || "(No subject)" })
|
|
2057
2110
|
] }),
|
|
2058
2111
|
/* @__PURE__ */ a.jsx("div", { style: {
|
|
2059
2112
|
fontSize: "12px",
|
|
2060
2113
|
color: w.textSecondary,
|
|
2061
2114
|
flexShrink: 0
|
|
2062
|
-
}, children:
|
|
2115
|
+
}, children: ue(f.date) })
|
|
2063
2116
|
] }) }), ae = (f) => /* @__PURE__ */ a.jsxs("div", { style: { padding: "24px" }, children: [
|
|
2064
|
-
/* @__PURE__ */ a.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: w.text }, children:
|
|
2117
|
+
/* @__PURE__ */ a.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: w.text }, children: Te(f.subject) || "(No subject)" }),
|
|
2065
2118
|
/* @__PURE__ */ a.jsxs("div", { style: { fontSize: "14px", color: w.textSecondary, marginBottom: "16px" }, children: [
|
|
2066
2119
|
"From: ",
|
|
2067
|
-
|
|
2120
|
+
Te(f.from),
|
|
2068
2121
|
" • ",
|
|
2069
2122
|
new Date(f.date).toLocaleString()
|
|
2070
2123
|
] }),
|
|
2071
2124
|
/* @__PURE__ */ a.jsx("div", { style: { fontSize: "14px", color: w.text }, children: "Email body not loaded. Implement getEmail(uid) to fetch full content." })
|
|
2072
|
-
] }),
|
|
2125
|
+
] }), pe = (f, E) => /* @__PURE__ */ a.jsxs("div", { style: {
|
|
2073
2126
|
display: "flex",
|
|
2074
2127
|
alignItems: "center",
|
|
2075
2128
|
gap: "8px",
|
|
@@ -2080,7 +2133,7 @@ function Lt({
|
|
|
2080
2133
|
/* @__PURE__ */ a.jsx(
|
|
2081
2134
|
"button",
|
|
2082
2135
|
{
|
|
2083
|
-
onClick:
|
|
2136
|
+
onClick: E.selectAll,
|
|
2084
2137
|
style: {
|
|
2085
2138
|
padding: "6px 12px",
|
|
2086
2139
|
background: "transparent",
|
|
@@ -2090,7 +2143,7 @@ function Lt({
|
|
|
2090
2143
|
cursor: "pointer",
|
|
2091
2144
|
color: w.text
|
|
2092
2145
|
},
|
|
2093
|
-
children: f.length ===
|
|
2146
|
+
children: f.length === D.length ? "Deselect All" : "Select All"
|
|
2094
2147
|
}
|
|
2095
2148
|
),
|
|
2096
2149
|
f.length > 0 && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
@@ -2101,7 +2154,7 @@ function Lt({
|
|
|
2101
2154
|
/* @__PURE__ */ a.jsx(
|
|
2102
2155
|
"button",
|
|
2103
2156
|
{
|
|
2104
|
-
onClick:
|
|
2157
|
+
onClick: E.archive,
|
|
2105
2158
|
title: "Archive",
|
|
2106
2159
|
style: {
|
|
2107
2160
|
display: "flex",
|
|
@@ -2121,7 +2174,7 @@ function Lt({
|
|
|
2121
2174
|
/* @__PURE__ */ a.jsx(
|
|
2122
2175
|
"button",
|
|
2123
2176
|
{
|
|
2124
|
-
onClick:
|
|
2177
|
+
onClick: E.delete,
|
|
2125
2178
|
title: "Delete",
|
|
2126
2179
|
style: {
|
|
2127
2180
|
display: "flex",
|
|
@@ -2143,7 +2196,7 @@ function Lt({
|
|
|
2143
2196
|
/* @__PURE__ */ a.jsx(
|
|
2144
2197
|
"button",
|
|
2145
2198
|
{
|
|
2146
|
-
onClick:
|
|
2199
|
+
onClick: E.refresh,
|
|
2147
2200
|
title: "Refresh",
|
|
2148
2201
|
style: {
|
|
2149
2202
|
display: "flex",
|
|
@@ -2164,53 +2217,53 @@ function Lt({
|
|
|
2164
2217
|
padding: "48px",
|
|
2165
2218
|
textAlign: "center",
|
|
2166
2219
|
color: w.textSecondary
|
|
2167
|
-
}, children:
|
|
2220
|
+
}, children: p }), Oe = () => /* @__PURE__ */ a.jsx("div", { style: {
|
|
2168
2221
|
padding: "48px",
|
|
2169
2222
|
textAlign: "center",
|
|
2170
2223
|
color: w.textSecondary
|
|
2171
|
-
}, children: "Loading..." }),
|
|
2172
|
-
return
|
|
2224
|
+
}, children: "Loading..." }), Ee = T || fe, Ne = S || ae, Ce = V || pe, oe = B || ie, ne = $ || Oe;
|
|
2225
|
+
return N && D.length === 0 ? /* @__PURE__ */ a.jsx("div", { style: { background: w.background, width: "100%", height: "100%" }, children: ne() }) : /* @__PURE__ */ a.jsxs("div", { style: { display: "flex", background: w.background, width: "100%", height: "100%" }, children: [
|
|
2173
2226
|
/* @__PURE__ */ a.jsxs("div", { style: {
|
|
2174
|
-
flex:
|
|
2227
|
+
flex: o && L ? "0 0 50%" : "1",
|
|
2175
2228
|
display: "flex",
|
|
2176
2229
|
flexDirection: "column",
|
|
2177
|
-
borderRight:
|
|
2230
|
+
borderRight: o && L ? `1px solid ${w.border}` : "none",
|
|
2178
2231
|
overflow: "hidden"
|
|
2179
2232
|
}, children: [
|
|
2180
|
-
s &&
|
|
2181
|
-
|
|
2233
|
+
s && Ce(Array.from(v), Se),
|
|
2234
|
+
j && /* @__PURE__ */ a.jsx("div", { style: {
|
|
2182
2235
|
padding: "12px 16px",
|
|
2183
2236
|
background: "#fef2f2",
|
|
2184
2237
|
color: w.danger,
|
|
2185
2238
|
fontSize: "14px",
|
|
2186
2239
|
borderBottom: `1px solid ${w.border}`
|
|
2187
|
-
}, children:
|
|
2188
|
-
/* @__PURE__ */ a.jsx("div", { style: { flex: 1, overflowY: "auto" }, children:
|
|
2240
|
+
}, children: j }),
|
|
2241
|
+
/* @__PURE__ */ a.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: D.length === 0 ? oe() : D.map((f, E) => /* @__PURE__ */ a.jsx(
|
|
2189
2242
|
"div",
|
|
2190
2243
|
{
|
|
2191
|
-
onClick: (
|
|
2192
|
-
onDoubleClick: () =>
|
|
2193
|
-
children:
|
|
2244
|
+
onClick: (G) => xe(f, E, G),
|
|
2245
|
+
onDoubleClick: () => ye(f),
|
|
2246
|
+
children: Ee(f, v.has(f.uid))
|
|
2194
2247
|
},
|
|
2195
2248
|
f.uid
|
|
2196
2249
|
)) })
|
|
2197
2250
|
] }),
|
|
2198
|
-
|
|
2251
|
+
o && L && /* @__PURE__ */ a.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: Ne(L) })
|
|
2199
2252
|
] });
|
|
2200
2253
|
}
|
|
2201
2254
|
export {
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2255
|
+
It as AnimatedCardFlip,
|
|
2256
|
+
kt as ApiClient,
|
|
2257
|
+
Tt as AuthManager,
|
|
2258
|
+
Mt as Card,
|
|
2259
|
+
Be as DataOperations,
|
|
2260
|
+
Bt as Detail,
|
|
2208
2261
|
$t as GraphClient,
|
|
2209
2262
|
Lt as Mail,
|
|
2210
|
-
|
|
2211
|
-
|
|
2263
|
+
jt as MailClient,
|
|
2264
|
+
Ut as Stack,
|
|
2212
2265
|
nt as getApiClient,
|
|
2213
2266
|
Ft as initializeApiClient,
|
|
2214
|
-
|
|
2215
|
-
|
|
2267
|
+
Dt as useMutation,
|
|
2268
|
+
Rt as useQuery
|
|
2216
2269
|
};
|