@jfvilas/react-file-manager 1.0.1 → 1.0.2
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/README.md +45 -36
- package/dist/react-file-manager.es.js +1328 -1298
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d, jsxs as k, Fragment as pe } from "react/jsx-runtime";
|
|
2
2
|
import * as Re from "react";
|
|
3
|
-
import
|
|
3
|
+
import ye, { useState as M, useRef as ae, useEffect as Q, createContext as Pe, useContext as Te, useLayoutEffect as Wn, useCallback as dn, useMemo as Ge } from "react";
|
|
4
4
|
var un = {
|
|
5
5
|
color: void 0,
|
|
6
6
|
size: void 0,
|
|
7
7
|
className: void 0,
|
|
8
8
|
style: void 0,
|
|
9
9
|
attr: void 0
|
|
10
|
-
}, wt =
|
|
10
|
+
}, wt = ye.createContext && /* @__PURE__ */ ye.createContext(un), Yn = ["attr", "size", "title"];
|
|
11
11
|
function Kn(n, e) {
|
|
12
12
|
if (n == null) return {};
|
|
13
13
|
var t = qn(n, e), o, i;
|
|
@@ -77,12 +77,12 @@ function Jn(n, e) {
|
|
|
77
77
|
return (e === "string" ? String : Number)(n);
|
|
78
78
|
}
|
|
79
79
|
function fn(n) {
|
|
80
|
-
return n && n.map((e, t) => /* @__PURE__ */
|
|
80
|
+
return n && n.map((e, t) => /* @__PURE__ */ ye.createElement(e.tag, je({
|
|
81
81
|
key: t
|
|
82
82
|
}, e.attr), fn(e.child)));
|
|
83
83
|
}
|
|
84
84
|
function H(n) {
|
|
85
|
-
return (e) => /* @__PURE__ */
|
|
85
|
+
return (e) => /* @__PURE__ */ ye.createElement(Zn, Ue({
|
|
86
86
|
attr: je({}, n.attr)
|
|
87
87
|
}, e), fn(n.child));
|
|
88
88
|
}
|
|
@@ -93,7 +93,7 @@ function Zn(n) {
|
|
|
93
93
|
size: i,
|
|
94
94
|
title: s
|
|
95
95
|
} = n, a = Kn(n, Yn), l = i || t.size || "1em", r;
|
|
96
|
-
return t.className && (r = t.className), n.className && (r = (r ? r + " " : "") + n.className), /* @__PURE__ */
|
|
96
|
+
return t.className && (r = t.className), n.className && (r = (r ? r + " " : "") + n.className), /* @__PURE__ */ ye.createElement("svg", Ue({
|
|
97
97
|
stroke: "currentColor",
|
|
98
98
|
fill: "currentColor",
|
|
99
99
|
strokeWidth: "0"
|
|
@@ -105,14 +105,14 @@ function Zn(n) {
|
|
|
105
105
|
height: l,
|
|
106
106
|
width: l,
|
|
107
107
|
xmlns: "http://www.w3.org/2000/svg"
|
|
108
|
-
}), s && /* @__PURE__ */
|
|
108
|
+
}), s && /* @__PURE__ */ ye.createElement("title", null, s), n.children);
|
|
109
109
|
};
|
|
110
|
-
return wt !== void 0 ? /* @__PURE__ */
|
|
110
|
+
return wt !== void 0 ? /* @__PURE__ */ ye.createElement(wt.Consumer, null, (t) => e(t)) : e(un);
|
|
111
111
|
}
|
|
112
112
|
function Xn(n) {
|
|
113
113
|
return H({ attr: { version: "1.1", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M16 8c-0.020-1.045-0.247-2.086-0.665-3.038-0.417-0.953-1.023-1.817-1.766-2.53s-1.624-1.278-2.578-1.651c-0.953-0.374-1.978-0.552-2.991-0.531-1.013 0.020-2.021 0.24-2.943 0.646-0.923 0.405-1.758 0.992-2.449 1.712s-1.237 1.574-1.597 2.497c-0.361 0.923-0.533 1.914-0.512 2.895 0.020 0.981 0.234 1.955 0.627 2.847 0.392 0.892 0.961 1.7 1.658 2.368s1.523 1.195 2.416 1.543c0.892 0.348 1.851 0.514 2.799 0.493 0.949-0.020 1.89-0.227 2.751-0.608 0.862-0.379 1.642-0.929 2.287-1.604s1.154-1.472 1.488-2.335c0.204-0.523 0.342-1.069 0.415-1.622 0.019 0.001 0.039 0.002 0.059 0.002 0.552 0 1-0.448 1-1 0-0.028-0.001-0.056-0.004-0.083h0.004zM14.411 10.655c-0.367 0.831-0.898 1.584-1.55 2.206s-1.422 1.112-2.254 1.434c-0.832 0.323-1.723 0.476-2.608 0.454-0.884-0.020-1.759-0.215-2.56-0.57-0.801-0.354-1.526-0.867-2.125-1.495s-1.071-1.371-1.38-2.173c-0.31-0.801-0.457-1.66-0.435-2.512s0.208-1.694 0.551-2.464c0.342-0.77 0.836-1.468 1.441-2.044s1.321-1.029 2.092-1.326c0.771-0.298 1.596-0.438 2.416-0.416s1.629 0.202 2.368 0.532c0.74 0.329 1.41 0.805 1.963 1.387s0.988 1.27 1.272 2.011c0.285 0.74 0.418 1.532 0.397 2.32h0.004c-0.002 0.027-0.004 0.055-0.004 0.083 0 0.516 0.39 0.94 0.892 0.994-0.097 0.544-0.258 1.075-0.481 1.578z" }, child: [] }] })(n);
|
|
114
114
|
}
|
|
115
|
-
const pt = ({ loading: n = !1, className: e }) => n ? /* @__PURE__ */
|
|
115
|
+
const pt = ({ loading: n = !1, className: e }) => n ? /* @__PURE__ */ d("div", { className: `loader-container ${e}`, children: /* @__PURE__ */ d(Xn, { className: "spinner" }) }) : null;
|
|
116
116
|
function pn(n) {
|
|
117
117
|
return H({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z" }, child: [] }] })(n);
|
|
118
118
|
}
|
|
@@ -179,7 +179,7 @@ function He(n) {
|
|
|
179
179
|
function Ct(n) {
|
|
180
180
|
return H({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M64 464l256 0c8.8 0 16-7.2 16-16l0-288-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16zM0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM192 272l0 128c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5L129.4 376 112 376c-8.8 0-16-7.2-16-16l0-48c0-8.8 7.2-16 16-16l17.4 0 35.3-35.3c4.6-4.6 11.5-5.9 17.4-3.5s9.9 8.3 9.9 14.8zm85.8-4c11.6 20 18.2 43.3 18.2 68s-6.6 48-18.2 68c-6.6 11.5-21.3 15.4-32.8 8.8s-15.4-21.3-8.8-32.8c7.5-12.9 11.8-27.9 11.8-44s-4.3-31.1-11.8-44c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8z" }, child: [] }] })(n);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function le(n) {
|
|
183
183
|
return H({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm97 289c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L79 303c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-31-31 31-31zM257 255c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9l-48-48z" }, child: [] }] })(n);
|
|
184
184
|
}
|
|
185
185
|
function St(n) {
|
|
@@ -217,7 +217,7 @@ function ut(n) {
|
|
|
217
217
|
}
|
|
218
218
|
const Oe = (n = () => {
|
|
219
219
|
}) => {
|
|
220
|
-
const [e, t] =
|
|
220
|
+
const [e, t] = M(!1), o = ae(null), i = (s) => {
|
|
221
221
|
var a;
|
|
222
222
|
(a = o.current) != null && a.contains(s.target) ? t(!1) : (t(!0), n(s, o));
|
|
223
223
|
};
|
|
@@ -225,12 +225,12 @@ const Oe = (n = () => {
|
|
|
225
225
|
document.removeEventListener("click", i, !0), document.removeEventListener("mousedown", i, !0);
|
|
226
226
|
}), []), { ref: o, isClicked: e, setIsClicked: t };
|
|
227
227
|
}, xn = Pe(), fo = ({ children: n, layout: e }) => {
|
|
228
|
-
const [t, o] =
|
|
228
|
+
const [t, o] = M(() => i(e));
|
|
229
229
|
function i(s) {
|
|
230
230
|
return ["list", "grid"].includes(s) ? s : "grid";
|
|
231
231
|
}
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
},
|
|
232
|
+
return /* @__PURE__ */ d(xn.Provider, { value: { activeLayout: t, setActiveLayout: o }, children: n });
|
|
233
|
+
}, we = () => Te(xn), B = (n) => typeof n == "string", Le = () => {
|
|
234
234
|
let n, e;
|
|
235
235
|
const t = new Promise((o, i) => {
|
|
236
236
|
n = o, e = i;
|
|
@@ -240,8 +240,8 @@ const Oe = (n = () => {
|
|
|
240
240
|
n.forEach((o) => {
|
|
241
241
|
e[o] && (t[o] = e[o]);
|
|
242
242
|
});
|
|
243
|
-
}, ho = /###/g, zt = (n) => n && n.indexOf("###") > -1 ? n.replace(ho, ".") : n, Lt = (n) => !n ||
|
|
244
|
-
const o =
|
|
243
|
+
}, ho = /###/g, zt = (n) => n && n.indexOf("###") > -1 ? n.replace(ho, ".") : n, Lt = (n) => !n || B(n), Ae = (n, e, t) => {
|
|
244
|
+
const o = B(e) ? e.split(".") : e;
|
|
245
245
|
let i = 0;
|
|
246
246
|
for (; i < o.length - 1; ) {
|
|
247
247
|
if (Lt(n)) return {};
|
|
@@ -283,7 +283,7 @@ const Oe = (n = () => {
|
|
|
283
283
|
return o !== void 0 ? o : Be(e, t);
|
|
284
284
|
}, Cn = (n, e, t) => {
|
|
285
285
|
for (const o in e)
|
|
286
|
-
o !== "__proto__" && o !== "constructor" && (o in n ?
|
|
286
|
+
o !== "__proto__" && o !== "constructor" && (o in n ? B(n[o]) || n[o] instanceof String || B(e[o]) || e[o] instanceof String ? t && (n[o] = e[o]) : Cn(n[o], e[o], t) : n[o] = e[o]);
|
|
287
287
|
return n;
|
|
288
288
|
}, Se = (n) => n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
289
289
|
var vo = {
|
|
@@ -294,7 +294,7 @@ var vo = {
|
|
|
294
294
|
"'": "'",
|
|
295
295
|
"/": "/"
|
|
296
296
|
};
|
|
297
|
-
const $o = (n) =>
|
|
297
|
+
const $o = (n) => B(n) ? n.replace(/[&<>"'\/]/g, (e) => vo[e]) : n;
|
|
298
298
|
class yo {
|
|
299
299
|
constructor(e) {
|
|
300
300
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
@@ -385,7 +385,7 @@ class Ye {
|
|
|
385
385
|
return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
|
|
386
386
|
}
|
|
387
387
|
forward(e, t, o, i) {
|
|
388
|
-
return i && !this.debug ? null : (
|
|
388
|
+
return i && !this.debug ? null : (B(e[0]) && (e[0] = `${o}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
389
389
|
}
|
|
390
390
|
create(e) {
|
|
391
391
|
return new Ye(this.logger, {
|
|
@@ -423,11 +423,11 @@ class Je {
|
|
|
423
423
|
o[i - 1] = arguments[i];
|
|
424
424
|
this.observers[e] && Array.from(this.observers[e].entries()).forEach((a) => {
|
|
425
425
|
let [l, r] = a;
|
|
426
|
-
for (let
|
|
426
|
+
for (let c = 0; c < r; c++)
|
|
427
427
|
l(...o);
|
|
428
428
|
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((a) => {
|
|
429
429
|
let [l, r] = a;
|
|
430
|
-
for (let
|
|
430
|
+
for (let c = 0; c < r; c++)
|
|
431
431
|
l.apply(l, [e, ...o]);
|
|
432
432
|
});
|
|
433
433
|
}
|
|
@@ -448,13 +448,13 @@ class Rt extends Je {
|
|
|
448
448
|
t > -1 && this.options.ns.splice(t, 1);
|
|
449
449
|
}
|
|
450
450
|
getResource(e, t, o) {
|
|
451
|
-
var
|
|
451
|
+
var c, u;
|
|
452
452
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
453
453
|
const s = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, a = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
454
454
|
let l;
|
|
455
|
-
e.indexOf(".") > -1 ? l = e.split(".") : (l = [e, t], o && (Array.isArray(o) ? l.push(...o) :
|
|
455
|
+
e.indexOf(".") > -1 ? l = e.split(".") : (l = [e, t], o && (Array.isArray(o) ? l.push(...o) : B(o) && s ? l.push(...o.split(s)) : l.push(o)));
|
|
456
456
|
const r = Be(this.data, l);
|
|
457
|
-
return !r && !t && !o && e.indexOf(".") > -1 && (e = l[0], t = l[1], o = l.slice(2).join(".")), r || !a || !
|
|
457
|
+
return !r && !t && !o && e.indexOf(".") > -1 && (e = l[0], t = l[1], o = l.slice(2).join(".")), r || !a || !B(o) ? r : ft((u = (c = this.data) == null ? void 0 : c[e]) == null ? void 0 : u[t], o, s);
|
|
458
458
|
}
|
|
459
459
|
addResource(e, t, o, i) {
|
|
460
460
|
let s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
@@ -469,7 +469,7 @@ class Rt extends Je {
|
|
|
469
469
|
silent: !1
|
|
470
470
|
};
|
|
471
471
|
for (const s in o)
|
|
472
|
-
(
|
|
472
|
+
(B(o[s]) || Array.isArray(o[s])) && this.addResource(e, t, s, o[s], {
|
|
473
473
|
silent: !0
|
|
474
474
|
});
|
|
475
475
|
i.silent || this.emit("added", e, t, o);
|
|
@@ -518,7 +518,7 @@ var Sn = {
|
|
|
518
518
|
}), e;
|
|
519
519
|
}
|
|
520
520
|
};
|
|
521
|
-
const kt = {}, Ot = (n) => !
|
|
521
|
+
const kt = {}, Ot = (n) => !B(n) && typeof n != "boolean" && typeof n != "number";
|
|
522
522
|
class Ke extends Je {
|
|
523
523
|
constructor(e) {
|
|
524
524
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -547,14 +547,14 @@ class Ke extends Je {
|
|
|
547
547
|
if (r && r.length > 0)
|
|
548
548
|
return {
|
|
549
549
|
key: e,
|
|
550
|
-
namespaces:
|
|
550
|
+
namespaces: B(s) ? [s] : s
|
|
551
551
|
};
|
|
552
|
-
const
|
|
553
|
-
(o !== i || o === i && this.options.ns.indexOf(
|
|
552
|
+
const c = e.split(o);
|
|
553
|
+
(o !== i || o === i && this.options.ns.indexOf(c[0]) > -1) && (s = c.shift()), e = c.join(i);
|
|
554
554
|
}
|
|
555
555
|
return {
|
|
556
556
|
key: e,
|
|
557
|
-
namespaces:
|
|
557
|
+
namespaces: B(s) ? [s] : s
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
560
|
translate(e, t, o) {
|
|
@@ -565,103 +565,103 @@ class Ke extends Je {
|
|
|
565
565
|
const i = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
|
|
566
566
|
key: a,
|
|
567
567
|
namespaces: l
|
|
568
|
-
} = this.extractFromKey(e[e.length - 1], t), r = l[l.length - 1],
|
|
569
|
-
if ((
|
|
568
|
+
} = this.extractFromKey(e[e.length - 1], t), r = l[l.length - 1], c = t.lng || this.language, u = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
569
|
+
if ((c == null ? void 0 : c.toLowerCase()) === "cimode") {
|
|
570
570
|
if (u) {
|
|
571
|
-
const
|
|
571
|
+
const C = t.nsSeparator || this.options.nsSeparator;
|
|
572
572
|
return i ? {
|
|
573
|
-
res: `${r}${
|
|
573
|
+
res: `${r}${C}${a}`,
|
|
574
574
|
usedKey: a,
|
|
575
575
|
exactUsedKey: a,
|
|
576
|
-
usedLng:
|
|
576
|
+
usedLng: c,
|
|
577
577
|
usedNS: r,
|
|
578
578
|
usedParams: this.getUsedParamsDetails(t)
|
|
579
|
-
} : `${r}${
|
|
579
|
+
} : `${r}${C}${a}`;
|
|
580
580
|
}
|
|
581
581
|
return i ? {
|
|
582
582
|
res: a,
|
|
583
583
|
usedKey: a,
|
|
584
584
|
exactUsedKey: a,
|
|
585
|
-
usedLng:
|
|
585
|
+
usedLng: c,
|
|
586
586
|
usedNS: r,
|
|
587
587
|
usedParams: this.getUsedParamsDetails(t)
|
|
588
588
|
} : a;
|
|
589
589
|
}
|
|
590
|
-
const
|
|
591
|
-
let
|
|
592
|
-
const h = (
|
|
590
|
+
const p = this.resolve(e, t);
|
|
591
|
+
let f = p == null ? void 0 : p.res;
|
|
592
|
+
const h = (p == null ? void 0 : p.usedKey) || a, m = (p == null ? void 0 : p.exactUsedKey) || a, v = ["[object Number]", "[object Function]", "[object RegExp]"], S = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, F = !this.i18nFormat || this.i18nFormat.handleAsObject, O = t.count !== void 0 && !B(t.count), N = Ke.hasDefaultValue(t), z = O ? this.pluralResolver.getSuffix(c, t.count, t) : "", g = t.ordinal && O ? this.pluralResolver.getSuffix(c, t.count, {
|
|
593
593
|
ordinal: !1
|
|
594
|
-
}) : "",
|
|
595
|
-
let w =
|
|
596
|
-
|
|
597
|
-
const $ = Ot(w),
|
|
598
|
-
if (
|
|
594
|
+
}) : "", P = O && !t.ordinal && t.count === 0, b = P && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${z}`] || t[`defaultValue${g}`] || t.defaultValue;
|
|
595
|
+
let w = f;
|
|
596
|
+
F && !f && N && (w = b);
|
|
597
|
+
const $ = Ot(w), x = Object.prototype.toString.apply(w);
|
|
598
|
+
if (F && w && $ && v.indexOf(x) < 0 && !(B(S) && Array.isArray(w))) {
|
|
599
599
|
if (!t.returnObjects && !this.options.returnObjects) {
|
|
600
600
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
601
|
-
const
|
|
601
|
+
const C = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, w, {
|
|
602
602
|
...t,
|
|
603
603
|
ns: l
|
|
604
604
|
}) : `key '${a} (${this.language})' returned an object instead of string.`;
|
|
605
|
-
return i ? (
|
|
605
|
+
return i ? (p.res = C, p.usedParams = this.getUsedParamsDetails(t), p) : C;
|
|
606
606
|
}
|
|
607
607
|
if (s) {
|
|
608
|
-
const
|
|
609
|
-
for (const
|
|
610
|
-
if (Object.prototype.hasOwnProperty.call(w,
|
|
611
|
-
const
|
|
612
|
-
|
|
608
|
+
const C = Array.isArray(w), E = C ? [] : {}, T = C ? m : h;
|
|
609
|
+
for (const R in w)
|
|
610
|
+
if (Object.prototype.hasOwnProperty.call(w, R)) {
|
|
611
|
+
const V = `${T}${s}${R}`;
|
|
612
|
+
N && !f ? E[R] = this.translate(V, {
|
|
613
613
|
...t,
|
|
614
|
-
defaultValue: Ot(
|
|
614
|
+
defaultValue: Ot(b) ? b[R] : void 0,
|
|
615
615
|
joinArrays: !1,
|
|
616
616
|
ns: l
|
|
617
|
-
}) :
|
|
617
|
+
}) : E[R] = this.translate(V, {
|
|
618
618
|
...t,
|
|
619
619
|
joinArrays: !1,
|
|
620
620
|
ns: l
|
|
621
|
-
}),
|
|
621
|
+
}), E[R] === V && (E[R] = w[R]);
|
|
622
622
|
}
|
|
623
|
-
|
|
623
|
+
f = E;
|
|
624
624
|
}
|
|
625
|
-
} else if (
|
|
626
|
-
|
|
625
|
+
} else if (F && B(S) && Array.isArray(f))
|
|
626
|
+
f = f.join(S), f && (f = this.extendTranslation(f, e, t, o));
|
|
627
627
|
else {
|
|
628
|
-
let
|
|
629
|
-
!this.isValidLookup(
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
if (this.logger.log(
|
|
633
|
-
const
|
|
628
|
+
let C = !1, E = !1;
|
|
629
|
+
!this.isValidLookup(f) && N && (C = !0, f = b), this.isValidLookup(f) || (E = !0, f = a);
|
|
630
|
+
const R = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && E ? void 0 : f, V = N && b !== f && this.options.updateMissing;
|
|
631
|
+
if (E || C || V) {
|
|
632
|
+
if (this.logger.log(V ? "updateKey" : "missingKey", c, r, a, V ? b : f), s) {
|
|
633
|
+
const q = this.resolve(a, {
|
|
634
634
|
...t,
|
|
635
635
|
keySeparator: !1
|
|
636
636
|
});
|
|
637
|
-
|
|
637
|
+
q && q.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
|
|
638
638
|
}
|
|
639
|
-
let
|
|
640
|
-
const
|
|
641
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
642
|
-
for (let
|
|
643
|
-
|
|
644
|
-
else this.options.saveMissingTo === "all" ?
|
|
645
|
-
const
|
|
639
|
+
let _ = [];
|
|
640
|
+
const ee = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
641
|
+
if (this.options.saveMissingTo === "fallback" && ee && ee[0])
|
|
642
|
+
for (let q = 0; q < ee.length; q++)
|
|
643
|
+
_.push(ee[q]);
|
|
644
|
+
else this.options.saveMissingTo === "all" ? _ = this.languageUtils.toResolveHierarchy(t.lng || this.language) : _.push(t.lng || this.language);
|
|
645
|
+
const se = (q, y, L) => {
|
|
646
646
|
var U;
|
|
647
|
-
const
|
|
648
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
647
|
+
const W = N && L !== f ? L : R;
|
|
648
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(q, r, y, W, V, t) : (U = this.backendConnector) != null && U.saveMissing && this.backendConnector.saveMissing(q, r, y, W, V, t), this.emit("missingKey", q, r, y, f);
|
|
649
649
|
};
|
|
650
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && O ?
|
|
651
|
-
const y = this.pluralResolver.getSuffixes(
|
|
652
|
-
|
|
653
|
-
|
|
650
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && O ? _.forEach((q) => {
|
|
651
|
+
const y = this.pluralResolver.getSuffixes(q, t);
|
|
652
|
+
P && t[`defaultValue${this.options.pluralSeparator}zero`] && y.indexOf(`${this.options.pluralSeparator}zero`) < 0 && y.push(`${this.options.pluralSeparator}zero`), y.forEach((L) => {
|
|
653
|
+
se([q], a + L, t[`defaultValue${L}`] || b);
|
|
654
654
|
});
|
|
655
|
-
}) :
|
|
655
|
+
}) : se(_, a, b));
|
|
656
656
|
}
|
|
657
|
-
|
|
657
|
+
f = this.extendTranslation(f, e, t, p, o), E && f === a && this.options.appendNamespaceToMissingKey && (f = `${r}:${a}`), (E || C) && this.options.parseMissingKeyHandler && (f = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${r}:${a}` : a, C ? f : void 0));
|
|
658
658
|
}
|
|
659
|
-
return i ? (
|
|
659
|
+
return i ? (p.res = f, p.usedParams = this.getUsedParamsDetails(t), p) : f;
|
|
660
660
|
}
|
|
661
661
|
extendTranslation(e, t, o, i, s) {
|
|
662
|
-
var
|
|
662
|
+
var c, u;
|
|
663
663
|
var a = this;
|
|
664
|
-
if ((
|
|
664
|
+
if ((c = this.i18nFormat) != null && c.parse)
|
|
665
665
|
e = this.i18nFormat.parse(e, {
|
|
666
666
|
...this.options.interpolation.defaultVariables,
|
|
667
667
|
...o
|
|
@@ -676,19 +676,19 @@ class Ke extends Je {
|
|
|
676
676
|
...o.interpolation
|
|
677
677
|
}
|
|
678
678
|
});
|
|
679
|
-
const
|
|
680
|
-
let
|
|
681
|
-
if (
|
|
679
|
+
const p = B(e) && (((u = o == null ? void 0 : o.interpolation) == null ? void 0 : u.skipOnVariables) !== void 0 ? o.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
680
|
+
let f;
|
|
681
|
+
if (p) {
|
|
682
682
|
const m = e.match(this.interpolator.nestingRegexp);
|
|
683
|
-
|
|
683
|
+
f = m && m.length;
|
|
684
684
|
}
|
|
685
|
-
let h = o.replace && !
|
|
685
|
+
let h = o.replace && !B(o.replace) ? o.replace : o;
|
|
686
686
|
if (this.options.interpolation.defaultVariables && (h = {
|
|
687
687
|
...this.options.interpolation.defaultVariables,
|
|
688
688
|
...h
|
|
689
|
-
}), e = this.interpolator.interpolate(e, h, o.lng || this.language || i.usedLng, o),
|
|
689
|
+
}), e = this.interpolator.interpolate(e, h, o.lng || this.language || i.usedLng, o), p) {
|
|
690
690
|
const m = e.match(this.interpolator.nestingRegexp), v = m && m.length;
|
|
691
|
-
|
|
691
|
+
f < v && (o.nest = !1);
|
|
692
692
|
}
|
|
693
693
|
!o.lng && i && i.res && (o.lng = this.language || i.usedLng), o.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
694
694
|
for (var m = arguments.length, v = new Array(m), S = 0; S < m; S++)
|
|
@@ -696,7 +696,7 @@ class Ke extends Je {
|
|
|
696
696
|
return (s == null ? void 0 : s[0]) === v[0] && !o.context ? (a.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${t[0]}`), null) : a.translate(...v, t);
|
|
697
697
|
}, o)), o.interpolation && this.interpolator.reset();
|
|
698
698
|
}
|
|
699
|
-
const l = o.postProcess || this.options.postProcess, r =
|
|
699
|
+
const l = o.postProcess || this.options.postProcess, r = B(l) ? [l] : l;
|
|
700
700
|
return e != null && (r != null && r.length) && o.applyPostProcessor !== !1 && (e = Sn.handle(r, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
701
701
|
i18nResolved: {
|
|
702
702
|
...i,
|
|
@@ -707,34 +707,34 @@ class Ke extends Je {
|
|
|
707
707
|
}
|
|
708
708
|
resolve(e) {
|
|
709
709
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o, i, s, a, l;
|
|
710
|
-
return
|
|
710
|
+
return B(e) && (e = [e]), e.forEach((r) => {
|
|
711
711
|
if (this.isValidLookup(o)) return;
|
|
712
|
-
const
|
|
712
|
+
const c = this.extractFromKey(r, t), u = c.key;
|
|
713
713
|
i = u;
|
|
714
|
-
let
|
|
715
|
-
this.options.fallbackNS && (
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
var
|
|
719
|
-
this.isValidLookup(o) || (l = S, !kt[`${v[0]}-${S}`] && ((
|
|
720
|
-
var
|
|
714
|
+
let p = c.namespaces;
|
|
715
|
+
this.options.fallbackNS && (p = p.concat(this.options.fallbackNS));
|
|
716
|
+
const f = t.count !== void 0 && !B(t.count), h = f && !t.ordinal && t.count === 0, m = t.context !== void 0 && (B(t.context) || typeof t.context == "number") && t.context !== "", v = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
717
|
+
p.forEach((S) => {
|
|
718
|
+
var F, O;
|
|
719
|
+
this.isValidLookup(o) || (l = S, !kt[`${v[0]}-${S}`] && ((F = this.utils) != null && F.hasLoadedNamespace) && !((O = this.utils) != null && O.hasLoadedNamespace(l)) && (kt[`${v[0]}-${S}`] = !0, this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), v.forEach((N) => {
|
|
720
|
+
var P;
|
|
721
721
|
if (this.isValidLookup(o)) return;
|
|
722
|
-
a =
|
|
722
|
+
a = N;
|
|
723
723
|
const z = [u];
|
|
724
|
-
if ((
|
|
725
|
-
this.i18nFormat.addLookupKeys(z, u,
|
|
724
|
+
if ((P = this.i18nFormat) != null && P.addLookupKeys)
|
|
725
|
+
this.i18nFormat.addLookupKeys(z, u, N, S, t);
|
|
726
726
|
else {
|
|
727
|
-
let
|
|
728
|
-
|
|
727
|
+
let b;
|
|
728
|
+
f && (b = this.pluralResolver.getSuffix(N, t.count, t));
|
|
729
729
|
const w = `${this.options.pluralSeparator}zero`, $ = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
730
|
-
if (
|
|
731
|
-
const
|
|
732
|
-
z.push(
|
|
730
|
+
if (f && (z.push(u + b), t.ordinal && b.indexOf($) === 0 && z.push(u + b.replace($, this.options.pluralSeparator)), h && z.push(u + w)), m) {
|
|
731
|
+
const x = `${u}${this.options.contextSeparator}${t.context}`;
|
|
732
|
+
z.push(x), f && (z.push(x + b), t.ordinal && b.indexOf($) === 0 && z.push(x + b.replace($, this.options.pluralSeparator)), h && z.push(x + w));
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
735
|
let g;
|
|
736
736
|
for (; g = z.pop(); )
|
|
737
|
-
this.isValidLookup(o) || (s = g, o = this.getResource(
|
|
737
|
+
this.isValidLookup(o) || (s = g, o = this.getResource(N, S, g, t));
|
|
738
738
|
}));
|
|
739
739
|
});
|
|
740
740
|
}), {
|
|
@@ -755,7 +755,7 @@ class Ke extends Je {
|
|
|
755
755
|
}
|
|
756
756
|
getUsedParamsDetails() {
|
|
757
757
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
758
|
-
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], o = e.replace && !
|
|
758
|
+
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], o = e.replace && !B(e.replace);
|
|
759
759
|
let i = o ? e.replace : e;
|
|
760
760
|
if (o && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
|
|
761
761
|
...this.options.interpolation.defaultVariables,
|
|
@@ -792,7 +792,7 @@ class Mt {
|
|
|
792
792
|
return this.formatLanguageCode(t[0]);
|
|
793
793
|
}
|
|
794
794
|
formatLanguageCode(e) {
|
|
795
|
-
if (
|
|
795
|
+
if (B(e) && e.indexOf("-") > -1) {
|
|
796
796
|
let t;
|
|
797
797
|
try {
|
|
798
798
|
t = Intl.getCanonicalLocales(e)[0];
|
|
@@ -827,7 +827,7 @@ class Mt {
|
|
|
827
827
|
}
|
|
828
828
|
getFallbackCodes(e, t) {
|
|
829
829
|
if (!e) return [];
|
|
830
|
-
if (typeof e == "function" && (e = e(t)),
|
|
830
|
+
if (typeof e == "function" && (e = e(t)), B(e) && (e = [e]), Array.isArray(e)) return e;
|
|
831
831
|
if (!t) return e.default || [];
|
|
832
832
|
let o = e[t];
|
|
833
833
|
return o || (o = e[this.getScriptPartFromCode(t)]), o || (o = e[this.formatLanguageCode(t)]), o || (o = e[this.getLanguagePartFromCode(t)]), o || (o = e.default), o || [];
|
|
@@ -836,7 +836,7 @@ class Mt {
|
|
|
836
836
|
const o = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], s = (a) => {
|
|
837
837
|
a && (this.isSupportedCode(a) ? i.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
|
|
838
838
|
};
|
|
839
|
-
return
|
|
839
|
+
return B(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && s(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && s(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && s(this.getLanguagePartFromCode(e))) : B(e) && s(this.formatLanguageCode(e)), o.forEach((a) => {
|
|
840
840
|
i.indexOf(a) < 0 && s(this.formatLanguageCode(a));
|
|
841
841
|
}), i;
|
|
842
842
|
}
|
|
@@ -907,7 +907,7 @@ class So {
|
|
|
907
907
|
}
|
|
908
908
|
const Ut = function(n, e, t) {
|
|
909
909
|
let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s = go(n, e, t);
|
|
910
|
-
return !s && i &&
|
|
910
|
+
return !s && i && B(t) && (s = ft(n, t, o), s === void 0 && (s = ft(e, t, o))), s;
|
|
911
911
|
}, tt = (n) => n.replace(/\$/g, "$$$$");
|
|
912
912
|
class Fo {
|
|
913
913
|
constructor() {
|
|
@@ -928,18 +928,18 @@ class Fo {
|
|
|
928
928
|
prefixEscaped: a,
|
|
929
929
|
suffix: l,
|
|
930
930
|
suffixEscaped: r,
|
|
931
|
-
formatSeparator:
|
|
931
|
+
formatSeparator: c,
|
|
932
932
|
unescapeSuffix: u,
|
|
933
|
-
unescapePrefix:
|
|
934
|
-
nestingPrefix:
|
|
933
|
+
unescapePrefix: p,
|
|
934
|
+
nestingPrefix: f,
|
|
935
935
|
nestingPrefixEscaped: h,
|
|
936
936
|
nestingSuffix: m,
|
|
937
937
|
nestingSuffixEscaped: v,
|
|
938
938
|
nestingOptionsSeparator: S,
|
|
939
|
-
maxReplaces:
|
|
939
|
+
maxReplaces: F,
|
|
940
940
|
alwaysFormat: O
|
|
941
941
|
} = e.interpolation;
|
|
942
|
-
this.escape = t !== void 0 ? t : $o, this.escapeValue = o !== void 0 ? o : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = s ? Se(s) : a || "{{", this.suffix = l ? Se(l) : r || "}}", this.formatSeparator =
|
|
942
|
+
this.escape = t !== void 0 ? t : $o, this.escapeValue = o !== void 0 ? o : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = s ? Se(s) : a || "{{", this.suffix = l ? Se(l) : r || "}}", this.formatSeparator = c || ",", this.unescapePrefix = u ? "" : p || "-", this.unescapeSuffix = this.unescapePrefix ? "" : u || "", this.nestingPrefix = f ? Se(f) : h || Se("$t("), this.nestingSuffix = m ? Se(m) : v || Se(")"), this.nestingOptionsSeparator = S || ",", this.maxReplaces = F || 1e3, this.alwaysFormat = O !== void 0 ? O : !1, this.resetRegExp();
|
|
943
943
|
}
|
|
944
944
|
reset() {
|
|
945
945
|
this.options && this.init(this.options);
|
|
@@ -951,7 +951,7 @@ class Fo {
|
|
|
951
951
|
interpolate(e, t, o, i) {
|
|
952
952
|
var h;
|
|
953
953
|
let s, a, l;
|
|
954
|
-
const r = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {},
|
|
954
|
+
const r = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (m) => {
|
|
955
955
|
if (m.indexOf(this.formatSeparator) < 0) {
|
|
956
956
|
const O = Ut(t, r, m, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
957
957
|
return this.alwaysFormat ? this.format(O, void 0, o, {
|
|
@@ -960,15 +960,15 @@ class Fo {
|
|
|
960
960
|
interpolationkey: m
|
|
961
961
|
}) : O;
|
|
962
962
|
}
|
|
963
|
-
const v = m.split(this.formatSeparator), S = v.shift().trim(),
|
|
964
|
-
return this.format(Ut(t, r, S, this.options.keySeparator, this.options.ignoreJSONStructure),
|
|
963
|
+
const v = m.split(this.formatSeparator), S = v.shift().trim(), F = v.join(this.formatSeparator).trim();
|
|
964
|
+
return this.format(Ut(t, r, S, this.options.keySeparator, this.options.ignoreJSONStructure), F, o, {
|
|
965
965
|
...i,
|
|
966
966
|
...t,
|
|
967
967
|
interpolationkey: S
|
|
968
968
|
});
|
|
969
969
|
};
|
|
970
970
|
this.resetRegExp();
|
|
971
|
-
const u = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler,
|
|
971
|
+
const u = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, p = ((h = i == null ? void 0 : i.interpolation) == null ? void 0 : h.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
972
972
|
return [{
|
|
973
973
|
regex: this.regexpUnescape,
|
|
974
974
|
safeValue: (m) => tt(m)
|
|
@@ -978,41 +978,41 @@ class Fo {
|
|
|
978
978
|
}].forEach((m) => {
|
|
979
979
|
for (l = 0; s = m.regex.exec(e); ) {
|
|
980
980
|
const v = s[1].trim();
|
|
981
|
-
if (a =
|
|
981
|
+
if (a = c(v), a === void 0)
|
|
982
982
|
if (typeof u == "function") {
|
|
983
|
-
const
|
|
984
|
-
a =
|
|
983
|
+
const F = u(e, s, i);
|
|
984
|
+
a = B(F) ? F : "";
|
|
985
985
|
} else if (i && Object.prototype.hasOwnProperty.call(i, v))
|
|
986
986
|
a = "";
|
|
987
|
-
else if (
|
|
987
|
+
else if (p) {
|
|
988
988
|
a = s[0];
|
|
989
989
|
continue;
|
|
990
990
|
} else
|
|
991
991
|
this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`), a = "";
|
|
992
|
-
else !
|
|
992
|
+
else !B(a) && !this.useRawValueToEscape && (a = Tt(a));
|
|
993
993
|
const S = m.safeValue(a);
|
|
994
|
-
if (e = e.replace(s[0], S),
|
|
994
|
+
if (e = e.replace(s[0], S), p ? (m.regex.lastIndex += a.length, m.regex.lastIndex -= s[0].length) : m.regex.lastIndex = 0, l++, l >= this.maxReplaces)
|
|
995
995
|
break;
|
|
996
996
|
}
|
|
997
997
|
}), e;
|
|
998
998
|
}
|
|
999
999
|
nest(e, t) {
|
|
1000
1000
|
let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, s, a;
|
|
1001
|
-
const l = (r,
|
|
1001
|
+
const l = (r, c) => {
|
|
1002
1002
|
const u = this.nestingOptionsSeparator;
|
|
1003
1003
|
if (r.indexOf(u) < 0) return r;
|
|
1004
|
-
const
|
|
1005
|
-
let
|
|
1006
|
-
r =
|
|
1007
|
-
const h =
|
|
1008
|
-
(((h == null ? void 0 : h.length) ?? 0) % 2 === 0 && !m || m.length % 2 !== 0) && (
|
|
1004
|
+
const p = r.split(new RegExp(`${u}[ ]*{`));
|
|
1005
|
+
let f = `{${p[1]}`;
|
|
1006
|
+
r = p[0], f = this.interpolate(f, a);
|
|
1007
|
+
const h = f.match(/'/g), m = f.match(/"/g);
|
|
1008
|
+
(((h == null ? void 0 : h.length) ?? 0) % 2 === 0 && !m || m.length % 2 !== 0) && (f = f.replace(/'/g, '"'));
|
|
1009
1009
|
try {
|
|
1010
|
-
a = JSON.parse(
|
|
1011
|
-
...
|
|
1010
|
+
a = JSON.parse(f), c && (a = {
|
|
1011
|
+
...c,
|
|
1012
1012
|
...a
|
|
1013
1013
|
});
|
|
1014
1014
|
} catch (v) {
|
|
1015
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${r}`, v), `${r}${u}${
|
|
1015
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${r}`, v), `${r}${u}${f}`;
|
|
1016
1016
|
}
|
|
1017
1017
|
return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, r;
|
|
1018
1018
|
};
|
|
@@ -1020,14 +1020,14 @@ class Fo {
|
|
|
1020
1020
|
let r = [];
|
|
1021
1021
|
a = {
|
|
1022
1022
|
...o
|
|
1023
|
-
}, a = a.replace && !
|
|
1024
|
-
let
|
|
1023
|
+
}, a = a.replace && !B(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
1024
|
+
let c = !1;
|
|
1025
1025
|
if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
|
|
1026
|
-
const u = i[1].split(this.formatSeparator).map((
|
|
1027
|
-
i[1] = u.shift(), r = u,
|
|
1026
|
+
const u = i[1].split(this.formatSeparator).map((p) => p.trim());
|
|
1027
|
+
i[1] = u.shift(), r = u, c = !0;
|
|
1028
1028
|
}
|
|
1029
|
-
if (s = t(l.call(this, i[1].trim(), a), a), s && i[0] === e && !
|
|
1030
|
-
|
|
1029
|
+
if (s = t(l.call(this, i[1].trim(), a), a), s && i[0] === e && !B(s)) return s;
|
|
1030
|
+
B(s) || (s = Tt(s)), s || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), s = ""), c && (s = r.reduce((u, p) => this.format(u, p, o.lng, {
|
|
1031
1031
|
...o,
|
|
1032
1032
|
interpolationkey: i[1].trim()
|
|
1033
1033
|
}), s.trim())), e = e.replace(i[0], s), this.regexp.lastIndex = 0;
|
|
@@ -1044,8 +1044,8 @@ const No = (n) => {
|
|
|
1044
1044
|
const i = o[1].substring(0, o[1].length - 1);
|
|
1045
1045
|
e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((a) => {
|
|
1046
1046
|
if (a) {
|
|
1047
|
-
const [l, ...r] = a.split(":"),
|
|
1048
|
-
t[u] || (t[u] =
|
|
1047
|
+
const [l, ...r] = a.split(":"), c = r.join(":").trim().replace(/^'+|'+$/g, ""), u = l.trim();
|
|
1048
|
+
t[u] || (t[u] = c), c === "false" && (t[u] = !1), c === "true" && (t[u] = !0), isNaN(c) || (t[u] = parseInt(c, 10));
|
|
1049
1049
|
}
|
|
1050
1050
|
});
|
|
1051
1051
|
}
|
|
@@ -1123,16 +1123,16 @@ class Eo {
|
|
|
1123
1123
|
s[0] = [s[0], ...s.splice(1, l)].join(this.formatSeparator);
|
|
1124
1124
|
}
|
|
1125
1125
|
return s.reduce((l, r) => {
|
|
1126
|
-
var
|
|
1126
|
+
var p;
|
|
1127
1127
|
const {
|
|
1128
|
-
formatName:
|
|
1128
|
+
formatName: c,
|
|
1129
1129
|
formatOptions: u
|
|
1130
1130
|
} = No(r);
|
|
1131
|
-
if (this.formats[
|
|
1132
|
-
let
|
|
1131
|
+
if (this.formats[c]) {
|
|
1132
|
+
let f = l;
|
|
1133
1133
|
try {
|
|
1134
|
-
const h = ((
|
|
1135
|
-
|
|
1134
|
+
const h = ((p = i == null ? void 0 : i.formatParams) == null ? void 0 : p[i.interpolationkey]) || {}, m = h.locale || h.lng || i.locale || i.lng || o;
|
|
1135
|
+
f = this.formats[c](l, m, {
|
|
1136
1136
|
...u,
|
|
1137
1137
|
...i,
|
|
1138
1138
|
...h
|
|
@@ -1140,9 +1140,9 @@ class Eo {
|
|
|
1140
1140
|
} catch (h) {
|
|
1141
1141
|
this.logger.warn(h);
|
|
1142
1142
|
}
|
|
1143
|
-
return
|
|
1143
|
+
return f;
|
|
1144
1144
|
} else
|
|
1145
|
-
this.logger.warn(`there was no format function for ${
|
|
1145
|
+
this.logger.warn(`there was no format function for ${c}`);
|
|
1146
1146
|
return l;
|
|
1147
1147
|
}, e);
|
|
1148
1148
|
}
|
|
@@ -1158,12 +1158,12 @@ class To extends Je {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
queueLoad(e, t, o, i) {
|
|
1160
1160
|
const s = {}, a = {}, l = {}, r = {};
|
|
1161
|
-
return e.forEach((
|
|
1161
|
+
return e.forEach((c) => {
|
|
1162
1162
|
let u = !0;
|
|
1163
|
-
t.forEach((
|
|
1164
|
-
const
|
|
1165
|
-
!o.reload && this.store.hasResourceBundle(
|
|
1166
|
-
}), u || (l[
|
|
1163
|
+
t.forEach((p) => {
|
|
1164
|
+
const f = `${c}|${p}`;
|
|
1165
|
+
!o.reload && this.store.hasResourceBundle(c, p) ? this.state[f] = 2 : this.state[f] < 0 || (this.state[f] === 1 ? a[f] === void 0 && (a[f] = !0) : (this.state[f] = 1, u = !1, a[f] === void 0 && (a[f] = !0), s[f] === void 0 && (s[f] = !0), r[p] === void 0 && (r[p] = !0)));
|
|
1166
|
+
}), u || (l[c] = !0);
|
|
1167
1167
|
}), (Object.keys(s).length || Object.keys(a).length) && this.queue.push({
|
|
1168
1168
|
pending: a,
|
|
1169
1169
|
pendingCount: Object.keys(a).length,
|
|
@@ -1184,11 +1184,11 @@ class To extends Je {
|
|
|
1184
1184
|
}), this.state[e] = t ? -1 : 2, t && o && (this.state[e] = 0);
|
|
1185
1185
|
const l = {};
|
|
1186
1186
|
this.queue.forEach((r) => {
|
|
1187
|
-
mo(r.loaded, [s], a), Po(r, e), t && r.errors.push(t), r.pendingCount === 0 && !r.done && (Object.keys(r.loaded).forEach((
|
|
1188
|
-
l[
|
|
1189
|
-
const u = r.loaded[
|
|
1190
|
-
u.length && u.forEach((
|
|
1191
|
-
l[
|
|
1187
|
+
mo(r.loaded, [s], a), Po(r, e), t && r.errors.push(t), r.pendingCount === 0 && !r.done && (Object.keys(r.loaded).forEach((c) => {
|
|
1188
|
+
l[c] || (l[c] = {});
|
|
1189
|
+
const u = r.loaded[c];
|
|
1190
|
+
u.length && u.forEach((p) => {
|
|
1191
|
+
l[c][p] === void 0 && (l[c][p] = !0);
|
|
1192
1192
|
});
|
|
1193
1193
|
}), r.done = !0, r.errors.length ? r.callback(r.errors) : r.callback());
|
|
1194
1194
|
}), this.emit("loaded", l), this.queue = this.queue.filter((r) => !r.done);
|
|
@@ -1208,25 +1208,25 @@ class To extends Je {
|
|
|
1208
1208
|
return;
|
|
1209
1209
|
}
|
|
1210
1210
|
this.readingCalls++;
|
|
1211
|
-
const l = (
|
|
1211
|
+
const l = (c, u) => {
|
|
1212
1212
|
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
1213
|
-
const
|
|
1214
|
-
this.read(
|
|
1213
|
+
const p = this.waitingReads.shift();
|
|
1214
|
+
this.read(p.lng, p.ns, p.fcName, p.tried, p.wait, p.callback);
|
|
1215
1215
|
}
|
|
1216
|
-
if (
|
|
1216
|
+
if (c && u && i < this.maxRetries) {
|
|
1217
1217
|
setTimeout(() => {
|
|
1218
1218
|
this.read.call(this, e, t, o, i + 1, s * 2, a);
|
|
1219
1219
|
}, s);
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
|
-
a(
|
|
1222
|
+
a(c, u);
|
|
1223
1223
|
}, r = this.backend[o].bind(this.backend);
|
|
1224
1224
|
if (r.length === 2) {
|
|
1225
1225
|
try {
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1228
|
-
} catch (
|
|
1229
|
-
l(
|
|
1226
|
+
const c = r(e, t);
|
|
1227
|
+
c && typeof c.then == "function" ? c.then((u) => l(null, u)).catch(l) : l(null, c);
|
|
1228
|
+
} catch (c) {
|
|
1229
|
+
l(c);
|
|
1230
1230
|
}
|
|
1231
1231
|
return;
|
|
1232
1232
|
}
|
|
@@ -1236,7 +1236,7 @@ class To extends Je {
|
|
|
1236
1236
|
let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
|
|
1237
1237
|
if (!this.backend)
|
|
1238
1238
|
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
|
|
1239
|
-
|
|
1239
|
+
B(e) && (e = this.languageUtils.toResolveHierarchy(e)), B(t) && (t = [t]);
|
|
1240
1240
|
const s = this.queueLoad(e, t, o, i);
|
|
1241
1241
|
if (!s.toLoad.length)
|
|
1242
1242
|
return s.pending.length || i(), null;
|
|
@@ -1260,15 +1260,15 @@ class To extends Je {
|
|
|
1260
1260
|
});
|
|
1261
1261
|
}
|
|
1262
1262
|
saveMissing(e, t, o, i, s) {
|
|
1263
|
-
var r,
|
|
1263
|
+
var r, c, u, p, f;
|
|
1264
1264
|
let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, l = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
|
|
1265
1265
|
};
|
|
1266
|
-
if ((
|
|
1266
|
+
if ((c = (r = this.services) == null ? void 0 : r.utils) != null && c.hasLoadedNamespace && !((p = (u = this.services) == null ? void 0 : u.utils) != null && p.hasLoadedNamespace(t))) {
|
|
1267
1267
|
this.logger.warn(`did not save key "${o}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
|
|
1268
1268
|
return;
|
|
1269
1269
|
}
|
|
1270
1270
|
if (!(o == null || o === "")) {
|
|
1271
|
-
if ((
|
|
1271
|
+
if ((f = this.backend) != null && f.create) {
|
|
1272
1272
|
const h = {
|
|
1273
1273
|
...a,
|
|
1274
1274
|
isUpdate: s
|
|
@@ -1322,7 +1322,7 @@ const jt = () => ({
|
|
|
1322
1322
|
appendNamespaceToCIMode: !1,
|
|
1323
1323
|
overloadTranslationOptionHandler: (n) => {
|
|
1324
1324
|
let e = {};
|
|
1325
|
-
if (typeof n[1] == "object" && (e = n[1]),
|
|
1325
|
+
if (typeof n[1] == "object" && (e = n[1]), B(n[1]) && (e.defaultValue = n[1]), B(n[2]) && (e.tDescription = n[2]), typeof n[2] == "object" || typeof n[3] == "object") {
|
|
1326
1326
|
const t = n[3] || n[2];
|
|
1327
1327
|
Object.keys(t).forEach((o) => {
|
|
1328
1328
|
e[o] = t[o];
|
|
@@ -1345,7 +1345,7 @@ const jt = () => ({
|
|
|
1345
1345
|
}
|
|
1346
1346
|
}), Ht = (n) => {
|
|
1347
1347
|
var e, t;
|
|
1348
|
-
return
|
|
1348
|
+
return B(n.ns) && (n.ns = [n.ns]), B(n.fallbackLng) && (n.fallbackLng = [n.fallbackLng]), B(n.fallbackNS) && (n.fallbackNS = [n.fallbackNS]), ((t = (e = n.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (n.supportedLngs = n.supportedLngs.concat(["cimode"])), typeof n.initImmediate == "boolean" && (n.initAsync = n.initImmediate), n;
|
|
1349
1349
|
}, Me = () => {
|
|
1350
1350
|
}, zo = (n) => {
|
|
1351
1351
|
Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t) => {
|
|
@@ -1368,7 +1368,7 @@ class ke extends Je {
|
|
|
1368
1368
|
init() {
|
|
1369
1369
|
var e = this;
|
|
1370
1370
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 ? arguments[1] : void 0;
|
|
1371
|
-
this.isInitializing = !0, typeof t == "function" && (o = t, t = {}), t.defaultNS == null && t.ns && (
|
|
1371
|
+
this.isInitializing = !0, typeof t == "function" && (o = t, t = {}), t.defaultNS == null && t.ns && (B(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
1372
1372
|
const i = jt();
|
|
1373
1373
|
this.options = {
|
|
1374
1374
|
...i,
|
|
@@ -1383,19 +1383,19 @@ class ke extends Je {
|
|
|
1383
1383
|
this.modules.logger ? me.init(s(this.modules.logger), this.options) : me.init(null, this.options);
|
|
1384
1384
|
let u;
|
|
1385
1385
|
this.modules.formatter ? u = this.modules.formatter : u = Eo;
|
|
1386
|
-
const
|
|
1386
|
+
const p = new Mt(this.options);
|
|
1387
1387
|
this.store = new Rt(this.options.resources, this.options);
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1388
|
+
const f = this.services;
|
|
1389
|
+
f.logger = me, f.resourceStore = this.store, f.languageUtils = p, f.pluralResolver = new So(p, {
|
|
1390
1390
|
prepend: this.options.pluralSeparator,
|
|
1391
1391
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1392
|
-
}), u && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (
|
|
1392
|
+
}), u && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (f.formatter = s(u), f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new Fo(this.options), f.utils = {
|
|
1393
1393
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1394
|
-
},
|
|
1394
|
+
}, f.backendConnector = new To(s(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", function(h) {
|
|
1395
1395
|
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), S = 1; S < m; S++)
|
|
1396
1396
|
v[S - 1] = arguments[S];
|
|
1397
1397
|
e.emit(h, ...v);
|
|
1398
|
-
}), this.modules.languageDetector && (
|
|
1398
|
+
}), this.modules.languageDetector && (f.languageDetector = s(this.modules.languageDetector), f.languageDetector.init && f.languageDetector.init(f, this.options.detection, this.options)), this.modules.i18nFormat && (f.i18nFormat = s(this.modules.i18nFormat), f.i18nFormat.init && f.i18nFormat.init(this)), this.translator = new Ke(this.services, this.options), this.translator.on("*", function(h) {
|
|
1399
1399
|
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), S = 1; S < m; S++)
|
|
1400
1400
|
v[S - 1] = arguments[S];
|
|
1401
1401
|
e.emit(h, ...v);
|
|
@@ -1416,29 +1416,29 @@ class ke extends Je {
|
|
|
1416
1416
|
return e.store[u](...arguments), e;
|
|
1417
1417
|
};
|
|
1418
1418
|
});
|
|
1419
|
-
const r = Le(),
|
|
1420
|
-
const u = (
|
|
1421
|
-
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), r.resolve(
|
|
1419
|
+
const r = Le(), c = () => {
|
|
1420
|
+
const u = (p, f) => {
|
|
1421
|
+
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), r.resolve(f), o(p, f);
|
|
1422
1422
|
};
|
|
1423
1423
|
if (this.languages && !this.isInitialized) return u(null, this.t.bind(this));
|
|
1424
1424
|
this.changeLanguage(this.options.lng, u);
|
|
1425
1425
|
};
|
|
1426
|
-
return this.options.resources || !this.options.initAsync ?
|
|
1426
|
+
return this.options.resources || !this.options.initAsync ? c() : setTimeout(c, 0), r;
|
|
1427
1427
|
}
|
|
1428
1428
|
loadResources(e) {
|
|
1429
1429
|
var s, a;
|
|
1430
1430
|
let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Me;
|
|
1431
|
-
const i =
|
|
1431
|
+
const i = B(e) ? e : this.language;
|
|
1432
1432
|
if (typeof e == "function" && (o = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1433
1433
|
if ((i == null ? void 0 : i.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return o();
|
|
1434
|
-
const l = [], r = (
|
|
1435
|
-
if (!
|
|
1436
|
-
this.services.languageUtils.toResolveHierarchy(
|
|
1437
|
-
|
|
1434
|
+
const l = [], r = (c) => {
|
|
1435
|
+
if (!c || c === "cimode") return;
|
|
1436
|
+
this.services.languageUtils.toResolveHierarchy(c).forEach((p) => {
|
|
1437
|
+
p !== "cimode" && l.indexOf(p) < 0 && l.push(p);
|
|
1438
1438
|
});
|
|
1439
1439
|
};
|
|
1440
|
-
i ? r(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((u) => r(u)), (a = (s = this.options.preload) == null ? void 0 : s.forEach) == null || a.call(s, (
|
|
1441
|
-
!
|
|
1440
|
+
i ? r(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((u) => r(u)), (a = (s = this.options.preload) == null ? void 0 : s.forEach) == null || a.call(s, (c) => r(c)), this.services.backendConnector.load(l, this.options.ns, (c) => {
|
|
1441
|
+
!c && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), o(c);
|
|
1442
1442
|
});
|
|
1443
1443
|
} else
|
|
1444
1444
|
o(null);
|
|
@@ -1471,18 +1471,18 @@ class ke extends Je {
|
|
|
1471
1471
|
this.emit("languageChanging", e);
|
|
1472
1472
|
const s = (r) => {
|
|
1473
1473
|
this.language = r, this.languages = this.services.languageUtils.toResolveHierarchy(r), this.resolvedLanguage = void 0, this.setResolvedLanguage(r);
|
|
1474
|
-
}, a = (r,
|
|
1475
|
-
|
|
1474
|
+
}, a = (r, c) => {
|
|
1475
|
+
c ? this.isLanguageChangingTo === e && (s(c), this.translator.changeLanguage(c), this.isLanguageChangingTo = void 0, this.emit("languageChanged", c), this.logger.log("languageChanged", c)) : this.isLanguageChangingTo = void 0, i.resolve(function() {
|
|
1476
1476
|
return o.t(...arguments);
|
|
1477
1477
|
}), t && t(r, function() {
|
|
1478
1478
|
return o.t(...arguments);
|
|
1479
1479
|
});
|
|
1480
1480
|
}, l = (r) => {
|
|
1481
|
-
var u,
|
|
1481
|
+
var u, p;
|
|
1482
1482
|
!e && !r && this.services.languageDetector && (r = []);
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
a(
|
|
1483
|
+
const c = this.services.languageUtils.getBestMatchFromCodes(B(r) ? [r] : r);
|
|
1484
|
+
c && (this.language || s(c), this.translator.language || this.translator.changeLanguage(c), (p = (u = this.services.languageDetector) == null ? void 0 : u.cacheUserLanguage) == null || p.call(u, c)), this.loadResources(c, (f) => {
|
|
1485
|
+
a(f, c);
|
|
1486
1486
|
});
|
|
1487
1487
|
};
|
|
1488
1488
|
return !e && this.services.languageDetector && !this.services.languageDetector.async ? l(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(l) : this.services.languageDetector.detect(l) : l(e), i;
|
|
@@ -1492,19 +1492,19 @@ class ke extends Je {
|
|
|
1492
1492
|
const s = function(a, l) {
|
|
1493
1493
|
let r;
|
|
1494
1494
|
if (typeof l != "object") {
|
|
1495
|
-
for (var
|
|
1496
|
-
u[
|
|
1495
|
+
for (var c = arguments.length, u = new Array(c > 2 ? c - 2 : 0), p = 2; p < c; p++)
|
|
1496
|
+
u[p - 2] = arguments[p];
|
|
1497
1497
|
r = i.options.overloadTranslationOptionHandler([a, l].concat(u));
|
|
1498
1498
|
} else
|
|
1499
1499
|
r = {
|
|
1500
1500
|
...l
|
|
1501
1501
|
};
|
|
1502
1502
|
r.lng = r.lng || s.lng, r.lngs = r.lngs || s.lngs, r.ns = r.ns || s.ns, r.keyPrefix !== "" && (r.keyPrefix = r.keyPrefix || o || s.keyPrefix);
|
|
1503
|
-
const
|
|
1503
|
+
const f = i.options.keySeparator || ".";
|
|
1504
1504
|
let h;
|
|
1505
|
-
return r.keyPrefix && Array.isArray(a) ? h = a.map((m) => `${r.keyPrefix}${
|
|
1505
|
+
return r.keyPrefix && Array.isArray(a) ? h = a.map((m) => `${r.keyPrefix}${f}${m}`) : h = r.keyPrefix ? `${r.keyPrefix}${f}${a}` : a, i.t(h, r);
|
|
1506
1506
|
};
|
|
1507
|
-
return
|
|
1507
|
+
return B(e) ? s.lng = e : s.lngs = e, s.ns = t, s.keyPrefix = o, s;
|
|
1508
1508
|
}
|
|
1509
1509
|
t() {
|
|
1510
1510
|
var i;
|
|
@@ -1530,8 +1530,8 @@ class ke extends Je {
|
|
|
1530
1530
|
const o = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, s = this.languages[this.languages.length - 1];
|
|
1531
1531
|
if (o.toLowerCase() === "cimode") return !0;
|
|
1532
1532
|
const a = (l, r) => {
|
|
1533
|
-
const
|
|
1534
|
-
return
|
|
1533
|
+
const c = this.services.backendConnector.state[`${l}|${r}`];
|
|
1534
|
+
return c === -1 || c === 0 || c === 2;
|
|
1535
1535
|
};
|
|
1536
1536
|
if (t.precheck) {
|
|
1537
1537
|
const l = t.precheck(this, a);
|
|
@@ -1541,7 +1541,7 @@ class ke extends Je {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
loadNamespaces(e, t) {
|
|
1543
1543
|
const o = Le();
|
|
1544
|
-
return this.options.ns ? (
|
|
1544
|
+
return this.options.ns ? (B(e) && (e = [e]), e.forEach((i) => {
|
|
1545
1545
|
this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
|
|
1546
1546
|
}), this.loadResources((i) => {
|
|
1547
1547
|
o.resolve(), t && t(i);
|
|
@@ -1549,7 +1549,7 @@ class ke extends Je {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
loadLanguages(e, t) {
|
|
1551
1551
|
const o = Le();
|
|
1552
|
-
|
|
1552
|
+
B(e) && (e = [e]);
|
|
1553
1553
|
const i = this.options.preload || [], s = e.filter((a) => i.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
|
|
1554
1554
|
return s.length ? (this.options.preload = i.concat(s), this.loadResources((a) => {
|
|
1555
1555
|
o.resolve(), t && t(a);
|
|
@@ -1581,17 +1581,17 @@ class ke extends Je {
|
|
|
1581
1581
|
}, s.services.utils = {
|
|
1582
1582
|
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
1583
1583
|
}, o) {
|
|
1584
|
-
const l = Object.keys(this.store.data).reduce((r,
|
|
1585
|
-
...this.store.data[
|
|
1586
|
-
}, Object.keys(r[
|
|
1587
|
-
...r[
|
|
1584
|
+
const l = Object.keys(this.store.data).reduce((r, c) => (r[c] = {
|
|
1585
|
+
...this.store.data[c]
|
|
1586
|
+
}, Object.keys(r[c]).reduce((u, p) => (u[p] = {
|
|
1587
|
+
...r[c][p]
|
|
1588
1588
|
}, u), {})), {});
|
|
1589
1589
|
s.store = new Rt(l, i), s.services.resourceStore = s.store;
|
|
1590
1590
|
}
|
|
1591
1591
|
return s.translator = new Ke(s.services, i), s.translator.on("*", function(l) {
|
|
1592
|
-
for (var r = arguments.length,
|
|
1593
|
-
|
|
1594
|
-
s.emit(l, ...
|
|
1592
|
+
for (var r = arguments.length, c = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
|
|
1593
|
+
c[u - 1] = arguments[u];
|
|
1594
|
+
s.emit(l, ...c);
|
|
1595
1595
|
}), s.init(i, t), s.translator.options = i, s.translator.backendConnector.services.utils = {
|
|
1596
1596
|
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
1597
1597
|
}, s;
|
|
@@ -2660,82 +2660,82 @@ const Lo = "مجلد جديد", Ao = "رفع", Ro = "لصق", ko = "تغيير
|
|
|
2660
2660
|
}
|
|
2661
2661
|
});
|
|
2662
2662
|
}, Fn = Pe(() => (n) => n), Z4 = ({ children: n, language: e }) => {
|
|
2663
|
-
const [t, o] =
|
|
2663
|
+
const [t, o] = M(() => ie.t.bind(ie));
|
|
2664
2664
|
return Q(() => {
|
|
2665
2665
|
J4(e), o(() => ie.t.bind(ie));
|
|
2666
|
-
}, [e]), /* @__PURE__ */
|
|
2667
|
-
},
|
|
2666
|
+
}, [e]), /* @__PURE__ */ d(Fn.Provider, { value: t, children: n });
|
|
2667
|
+
}, ce = () => Te(Fn), X4 = ({ setShowToggleViewMenu: n, onLayoutChange: e }) => {
|
|
2668
2668
|
const t = Oe(() => {
|
|
2669
2669
|
n(!1);
|
|
2670
|
-
}), { activeLayout: o, setActiveLayout: i } =
|
|
2670
|
+
}), { activeLayout: o, setActiveLayout: i } = we(), s = ce(), a = [
|
|
2671
2671
|
{
|
|
2672
2672
|
key: "grid",
|
|
2673
2673
|
name: s("grid"),
|
|
2674
|
-
icon: /* @__PURE__ */
|
|
2674
|
+
icon: /* @__PURE__ */ d(mn, { size: 18 })
|
|
2675
2675
|
},
|
|
2676
2676
|
{
|
|
2677
2677
|
key: "list",
|
|
2678
2678
|
name: s("list"),
|
|
2679
|
-
icon: /* @__PURE__ */
|
|
2679
|
+
icon: /* @__PURE__ */ d(He, { size: 18 })
|
|
2680
2680
|
}
|
|
2681
2681
|
], l = (r) => {
|
|
2682
2682
|
i(r), e(r), n(!1);
|
|
2683
2683
|
};
|
|
2684
|
-
return /* @__PURE__ */
|
|
2684
|
+
return /* @__PURE__ */ d("div", { ref: t.ref, className: "toggle-view", role: "dropdown", children: /* @__PURE__ */ d("ul", { role: "menu", "aria-orientation": "vertical", children: a.map((r) => /* @__PURE__ */ k(
|
|
2685
2685
|
"li",
|
|
2686
2686
|
{
|
|
2687
2687
|
role: "menuitem",
|
|
2688
2688
|
onClick: () => l(r.key),
|
|
2689
2689
|
onKeyDown: () => l(r.key),
|
|
2690
2690
|
children: [
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */
|
|
2691
|
+
/* @__PURE__ */ d("span", { children: r.key === o && /* @__PURE__ */ d(bn, { size: 13 }) }),
|
|
2692
|
+
/* @__PURE__ */ d("span", { children: r.icon }),
|
|
2693
|
+
/* @__PURE__ */ d("span", { children: r.name })
|
|
2694
2694
|
]
|
|
2695
2695
|
},
|
|
2696
2696
|
r.key
|
|
2697
2697
|
)) }) });
|
|
2698
2698
|
}, Nn = Pe(), Q4 = ({ children: n, filesData: e, onError: t }) => {
|
|
2699
|
-
const [o, i] =
|
|
2699
|
+
const [o, i] = M([]);
|
|
2700
2700
|
Q(() => {
|
|
2701
2701
|
i(e);
|
|
2702
2702
|
}, [e]);
|
|
2703
2703
|
const s = (a) => a.isDirectory ? o.filter((l) => l.path === `${a.path}/${l.name}`) : [];
|
|
2704
|
-
return /* @__PURE__ */
|
|
2704
|
+
return /* @__PURE__ */ d(Nn.Provider, { value: { files: o, setFiles: i, getChildren: s, onError: t }, children: n });
|
|
2705
2705
|
}, Ze = () => Te(Nn), e$ = (n, e = "name", t = "asc") => {
|
|
2706
|
-
const o = n.filter((r) => r.isDirectory), i = n.filter((r) => !r.isDirectory), s = (r,
|
|
2706
|
+
const o = n.filter((r) => r.isDirectory), i = n.filter((r) => !r.isDirectory), s = (r, c) => {
|
|
2707
2707
|
let u = 0;
|
|
2708
2708
|
switch (e) {
|
|
2709
2709
|
case "name":
|
|
2710
|
-
u = r.name.localeCompare(
|
|
2710
|
+
u = r.name.localeCompare(c.name);
|
|
2711
2711
|
break;
|
|
2712
2712
|
case "size":
|
|
2713
|
-
const
|
|
2714
|
-
u =
|
|
2713
|
+
const p = r.size || 0, f = c.size || 0;
|
|
2714
|
+
u = p - f;
|
|
2715
2715
|
break;
|
|
2716
2716
|
case "modified":
|
|
2717
|
-
const h = r.updatedAt ? new Date(r.updatedAt).getTime() : 0, m =
|
|
2717
|
+
const h = r.updatedAt ? new Date(r.updatedAt).getTime() : 0, m = c.updatedAt ? new Date(c.updatedAt).getTime() : 0;
|
|
2718
2718
|
u = h - m;
|
|
2719
2719
|
break;
|
|
2720
2720
|
default:
|
|
2721
|
-
u = r.name.localeCompare(
|
|
2721
|
+
u = r.name.localeCompare(c.name);
|
|
2722
2722
|
}
|
|
2723
2723
|
return t === "asc" ? u : -u;
|
|
2724
2724
|
}, a = [...o].sort(s), l = [...i].sort(s);
|
|
2725
2725
|
return [...a, ...l];
|
|
2726
2726
|
}, En = Pe(), t$ = ({ children: n, initialPath: e, onFolderChange: t }) => {
|
|
2727
|
-
const { files: o } = Ze(), i =
|
|
2727
|
+
const { files: o } = Ze(), i = ae(!1), [s, a] = M(""), [l, r] = M(null), [c, u] = M([]), [p, f] = M({ key: "name", direction: "asc" });
|
|
2728
2728
|
return Q(() => {
|
|
2729
2729
|
Array.isArray(o) && o.length > 0 ? (u(() => {
|
|
2730
2730
|
const h = o.filter((m) => m.path === `${s}/${m.name}`);
|
|
2731
|
-
return e$(h,
|
|
2731
|
+
return e$(h, p.key, p.direction);
|
|
2732
2732
|
}), r(() => o.find((h) => h.path === s) ?? null)) : (u([]), r(null));
|
|
2733
|
-
}, [o, s,
|
|
2733
|
+
}, [o, s, p]), Q(() => {
|
|
2734
2734
|
if (!i.current && Array.isArray(o) && o.length > 0) {
|
|
2735
2735
|
const h = o.some((m) => m.isDirectory && m.path === e) ? e : "";
|
|
2736
2736
|
a(h), i.current = !0;
|
|
2737
2737
|
}
|
|
2738
|
-
}, [o]), /* @__PURE__ */
|
|
2738
|
+
}, [o]), /* @__PURE__ */ d(
|
|
2739
2739
|
En.Provider,
|
|
2740
2740
|
{
|
|
2741
2741
|
value: {
|
|
@@ -2743,10 +2743,10 @@ const Lo = "مجلد جديد", Ao = "رفع", Ro = "لصق", ko = "تغيير
|
|
|
2743
2743
|
setCurrentPath: a,
|
|
2744
2744
|
currentFolder: l,
|
|
2745
2745
|
setCurrentFolder: r,
|
|
2746
|
-
currentPathFiles:
|
|
2746
|
+
currentPathFiles: c,
|
|
2747
2747
|
setCurrentPathFiles: u,
|
|
2748
|
-
sortConfig:
|
|
2749
|
-
setSortConfig:
|
|
2748
|
+
sortConfig: p,
|
|
2749
|
+
setSortConfig: f,
|
|
2750
2750
|
onFolderChange: t
|
|
2751
2751
|
},
|
|
2752
2752
|
children: n
|
|
@@ -2764,142 +2764,142 @@ const Lo = "مجلد جديد", Ao = "رفع", Ro = "لصق", ko = "تغيير
|
|
|
2764
2764
|
console.error(o.message);
|
|
2765
2765
|
}
|
|
2766
2766
|
}, Pn = Pe(), n$ = ({ children: n, onDownload: e, onSelect: t, onSelectionChange: o }) => {
|
|
2767
|
-
const [i, s] =
|
|
2767
|
+
const [i, s] = M([]);
|
|
2768
2768
|
Q(() => {
|
|
2769
2769
|
t == null || t(i), o == null || o(i);
|
|
2770
2770
|
}, [i]);
|
|
2771
2771
|
const a = () => {
|
|
2772
2772
|
xe(e, "onDownload", i);
|
|
2773
2773
|
};
|
|
2774
|
-
return /* @__PURE__ */
|
|
2775
|
-
},
|
|
2776
|
-
const [i, s] =
|
|
2774
|
+
return /* @__PURE__ */ d(Pn.Provider, { value: { selectedFiles: i, setSelectedFiles: s, handleDownload: a }, children: n });
|
|
2775
|
+
}, $e = () => Te(Pn), Tn = Pe(), o$ = ({ children: n, onPaste: e, onCut: t, onCopy: o }) => {
|
|
2776
|
+
const [i, s] = M(null), { selectedFiles: a, setSelectedFiles: l } = $e(), r = (u) => {
|
|
2777
2777
|
s({
|
|
2778
2778
|
files: a,
|
|
2779
2779
|
isMoving: u
|
|
2780
2780
|
}), u ? t && t(a) : o && o(a);
|
|
2781
|
-
},
|
|
2781
|
+
}, c = (u) => {
|
|
2782
2782
|
if (u && !u.isDirectory) return;
|
|
2783
|
-
const
|
|
2784
|
-
xe(e, "onPaste",
|
|
2783
|
+
const p = i.files, f = i.isMoving ? "move" : "copy";
|
|
2784
|
+
xe(e, "onPaste", p, u, f), i.isMoving && s(null), l([]);
|
|
2785
2785
|
};
|
|
2786
|
-
return /* @__PURE__ */
|
|
2786
|
+
return /* @__PURE__ */ d(Tn.Provider, { value: { clipBoard: i, setClipBoard: s, handleCutCopy: r, handlePasting: c }, children: n });
|
|
2787
2787
|
}, Xe = () => Te(Tn), zn = ({ onLayoutChange: n, onRefresh: e, triggerAction: t, permissions: o }) => {
|
|
2788
2788
|
var z;
|
|
2789
|
-
const [i, s] =
|
|
2789
|
+
const [i, s] = M(!1), { currentFolder: a } = he(), { selectedFiles: l, setSelectedFiles: r, handleDownload: c } = $e(), { clipBoard: u, setClipBoard: p, handleCutCopy: f, handlePasting: h } = Xe(), { activeLayout: m } = we(), v = ce(), S = [
|
|
2790
2790
|
{
|
|
2791
|
-
icon: /* @__PURE__ */
|
|
2791
|
+
icon: /* @__PURE__ */ d(hn, { size: 17, strokeWidth: 0.3 }),
|
|
2792
2792
|
text: v("newFolder"),
|
|
2793
2793
|
permission: o.create,
|
|
2794
2794
|
onClick: () => t.show("createFolder")
|
|
2795
2795
|
},
|
|
2796
2796
|
{
|
|
2797
|
-
icon: /* @__PURE__ */
|
|
2797
|
+
icon: /* @__PURE__ */ d(yn, { size: 18 }),
|
|
2798
2798
|
text: v("upload"),
|
|
2799
2799
|
permission: o.upload,
|
|
2800
2800
|
onClick: () => t.show("uploadFile")
|
|
2801
2801
|
},
|
|
2802
2802
|
{
|
|
2803
|
-
icon: /* @__PURE__ */
|
|
2803
|
+
icon: /* @__PURE__ */ d(ut, { size: 18 }),
|
|
2804
2804
|
text: v("paste"),
|
|
2805
2805
|
permission: !!u,
|
|
2806
2806
|
onClick: O
|
|
2807
2807
|
}
|
|
2808
|
-
],
|
|
2808
|
+
], F = [
|
|
2809
2809
|
{
|
|
2810
|
-
icon: m === "grid" ? /* @__PURE__ */
|
|
2810
|
+
icon: m === "grid" ? /* @__PURE__ */ d(mn, { size: 16 }) : /* @__PURE__ */ d(He, { size: 16 }),
|
|
2811
2811
|
title: v("changeView"),
|
|
2812
2812
|
onClick: () => s((g) => !g)
|
|
2813
2813
|
},
|
|
2814
2814
|
{
|
|
2815
|
-
icon: /* @__PURE__ */
|
|
2815
|
+
icon: /* @__PURE__ */ d(vn, { size: 16 }),
|
|
2816
2816
|
title: v("refresh"),
|
|
2817
2817
|
onClick: () => {
|
|
2818
|
-
xe(e, "onRefresh"),
|
|
2818
|
+
xe(e, "onRefresh"), p(null);
|
|
2819
2819
|
}
|
|
2820
2820
|
}
|
|
2821
2821
|
];
|
|
2822
2822
|
function O() {
|
|
2823
2823
|
h(a);
|
|
2824
2824
|
}
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2825
|
+
const N = () => {
|
|
2826
|
+
c(), r([]);
|
|
2827
2827
|
};
|
|
2828
|
-
return l.length > 0 ? /* @__PURE__ */
|
|
2829
|
-
/* @__PURE__ */
|
|
2830
|
-
o.move && /* @__PURE__ */
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2828
|
+
return l.length > 0 ? /* @__PURE__ */ d("div", { className: "toolbar file-selected", children: /* @__PURE__ */ k("div", { className: "file-action-container", children: [
|
|
2829
|
+
/* @__PURE__ */ k("div", { children: [
|
|
2830
|
+
o.move && /* @__PURE__ */ k("button", { className: "item-action file-action", onClick: () => f(!0), children: [
|
|
2831
|
+
/* @__PURE__ */ d(gn, { size: 18 }),
|
|
2832
|
+
/* @__PURE__ */ d("span", { children: v("cut") })
|
|
2833
2833
|
] }),
|
|
2834
|
-
o.copy && /* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
2836
|
-
/* @__PURE__ */
|
|
2834
|
+
o.copy && /* @__PURE__ */ k("button", { className: "item-action file-action", onClick: () => f(!1), children: [
|
|
2835
|
+
/* @__PURE__ */ d(pn, { strokeWidth: 0.1, size: 17 }),
|
|
2836
|
+
/* @__PURE__ */ d("span", { children: v("copy") })
|
|
2837
2837
|
] }),
|
|
2838
|
-
((z = u == null ? void 0 : u.files) == null ? void 0 : z.length) > 0 && /* @__PURE__ */
|
|
2838
|
+
((z = u == null ? void 0 : u.files) == null ? void 0 : z.length) > 0 && /* @__PURE__ */ k(
|
|
2839
2839
|
"button",
|
|
2840
2840
|
{
|
|
2841
2841
|
className: "item-action file-action",
|
|
2842
2842
|
onClick: O,
|
|
2843
2843
|
children: [
|
|
2844
|
-
/* @__PURE__ */
|
|
2845
|
-
/* @__PURE__ */
|
|
2844
|
+
/* @__PURE__ */ d(ut, { size: 18 }),
|
|
2845
|
+
/* @__PURE__ */ d("span", { children: v("paste") })
|
|
2846
2846
|
]
|
|
2847
2847
|
}
|
|
2848
2848
|
),
|
|
2849
|
-
l.length === 1 && o.rename && /* @__PURE__ */
|
|
2849
|
+
l.length === 1 && o.rename && /* @__PURE__ */ k(
|
|
2850
2850
|
"button",
|
|
2851
2851
|
{
|
|
2852
2852
|
className: "item-action file-action",
|
|
2853
2853
|
onClick: () => t.show("rename"),
|
|
2854
2854
|
children: [
|
|
2855
|
-
/* @__PURE__ */
|
|
2856
|
-
/* @__PURE__ */
|
|
2855
|
+
/* @__PURE__ */ d(wn, { size: 19 }),
|
|
2856
|
+
/* @__PURE__ */ d("span", { children: v("rename") })
|
|
2857
2857
|
]
|
|
2858
2858
|
}
|
|
2859
2859
|
),
|
|
2860
|
-
o.download && /* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
2860
|
+
o.download && /* @__PURE__ */ k("button", { className: "item-action file-action", onClick: N, children: [
|
|
2861
|
+
/* @__PURE__ */ d(ht, { size: 19 }),
|
|
2862
|
+
/* @__PURE__ */ d("span", { children: v("download") })
|
|
2863
2863
|
] }),
|
|
2864
|
-
o.delete && /* @__PURE__ */
|
|
2864
|
+
o.delete && /* @__PURE__ */ k(
|
|
2865
2865
|
"button",
|
|
2866
2866
|
{
|
|
2867
2867
|
className: "item-action file-action",
|
|
2868
2868
|
onClick: () => t.show("delete"),
|
|
2869
2869
|
children: [
|
|
2870
|
-
/* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ d($n, { size: 19 }),
|
|
2871
|
+
/* @__PURE__ */ d("span", { children: v("delete") })
|
|
2872
2872
|
]
|
|
2873
2873
|
}
|
|
2874
2874
|
)
|
|
2875
2875
|
] }),
|
|
2876
|
-
/* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ k(
|
|
2877
2877
|
"button",
|
|
2878
2878
|
{
|
|
2879
2879
|
className: "item-action file-action",
|
|
2880
2880
|
title: v("clearSelection"),
|
|
2881
2881
|
onClick: () => r([]),
|
|
2882
2882
|
children: [
|
|
2883
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ k("span", { children: [
|
|
2884
2884
|
l.length,
|
|
2885
2885
|
" ",
|
|
2886
2886
|
v(l.length > 1 ? "itemsSelected" : "itemSelected")
|
|
2887
2887
|
] }),
|
|
2888
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ d(eo, { size: 18 })
|
|
2889
2889
|
]
|
|
2890
2890
|
}
|
|
2891
2891
|
)
|
|
2892
|
-
] }) }) : /* @__PURE__ */
|
|
2893
|
-
/* @__PURE__ */
|
|
2892
|
+
] }) }) : /* @__PURE__ */ d("div", { className: "toolbar", children: /* @__PURE__ */ k("div", { className: "fm-toolbar", children: [
|
|
2893
|
+
/* @__PURE__ */ d("div", { children: S.filter((g) => g.permission).map((g, P) => /* @__PURE__ */ k("button", { className: "item-action", onClick: g.onClick, children: [
|
|
2894
2894
|
g.icon,
|
|
2895
|
-
/* @__PURE__ */
|
|
2896
|
-
] },
|
|
2897
|
-
/* @__PURE__ */
|
|
2898
|
-
|
|
2899
|
-
/* @__PURE__ */
|
|
2900
|
-
|
|
2901
|
-
] },
|
|
2902
|
-
i && /* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ d("span", { children: g.text })
|
|
2896
|
+
] }, P)) }),
|
|
2897
|
+
/* @__PURE__ */ k("div", { children: [
|
|
2898
|
+
F.map((g, P) => /* @__PURE__ */ k("div", { className: "toolbar-left-items", children: [
|
|
2899
|
+
/* @__PURE__ */ d("button", { className: "item-action icon-only", title: g.title, onClick: g.onClick, children: g.icon }),
|
|
2900
|
+
P !== F.length - 1 && /* @__PURE__ */ d("div", { className: "item-separator" })
|
|
2901
|
+
] }, P)),
|
|
2902
|
+
i && /* @__PURE__ */ d(
|
|
2903
2903
|
X4,
|
|
2904
2904
|
{
|
|
2905
2905
|
setShowToggleViewMenu: s,
|
|
@@ -2939,7 +2939,7 @@ var a$ = class extends Error {
|
|
|
2939
2939
|
}
|
|
2940
2940
|
}, qe = (...n) => s$(n[0], `[react-collapsed] -- ${n[1]}`);
|
|
2941
2941
|
function Ln(n) {
|
|
2942
|
-
const e =
|
|
2942
|
+
const e = ae(n);
|
|
2943
2943
|
return Q(() => {
|
|
2944
2944
|
e.current = n;
|
|
2945
2945
|
}), dn((...t) => {
|
|
@@ -2948,10 +2948,10 @@ function Ln(n) {
|
|
|
2948
2948
|
}, []);
|
|
2949
2949
|
}
|
|
2950
2950
|
function r$(n, e, t) {
|
|
2951
|
-
const [o, i] =
|
|
2952
|
-
(
|
|
2953
|
-
const
|
|
2954
|
-
s.current || i(
|
|
2951
|
+
const [o, i] = M(e), s = ae(typeof n < "u"), a = s.current ? n : o, l = Ln(t), r = dn(
|
|
2952
|
+
(c) => {
|
|
2953
|
+
const p = typeof c == "function" ? c(a) : c;
|
|
2954
|
+
s.current || i(p), l == null || l(p);
|
|
2955
2955
|
},
|
|
2956
2956
|
[l, a]
|
|
2957
2957
|
);
|
|
@@ -2967,7 +2967,7 @@ function r$(n, e, t) {
|
|
|
2967
2967
|
}
|
|
2968
2968
|
var l$ = "(prefers-reduced-motion: reduce)";
|
|
2969
2969
|
function c$() {
|
|
2970
|
-
const [n, e] =
|
|
2970
|
+
const [n, e] = M(!1);
|
|
2971
2971
|
return Q(() => {
|
|
2972
2972
|
if (typeof window > "u" || typeof window.matchMedia != "function")
|
|
2973
2973
|
return;
|
|
@@ -3081,119 +3081,119 @@ function b$({
|
|
|
3081
3081
|
id: a,
|
|
3082
3082
|
...l
|
|
3083
3083
|
} = {}) {
|
|
3084
|
-
const r = Ln(t),
|
|
3084
|
+
const r = Ln(t), c = m$(a ? `${a}` : void 0), [u, p] = r$(
|
|
3085
3085
|
o,
|
|
3086
3086
|
i
|
|
3087
|
-
),
|
|
3088
|
-
y$(
|
|
3089
|
-
const
|
|
3090
|
-
function
|
|
3091
|
-
if (!
|
|
3087
|
+
), f = ae(u), [h, m] = M(!1), v = c$(), S = s ?? v, F = ae(), O = ae(), N = ae(null), [z, g] = M(null);
|
|
3088
|
+
y$(N);
|
|
3089
|
+
const P = `${l.collapsedHeight || 0}px`;
|
|
3090
|
+
function b(w) {
|
|
3091
|
+
if (!N.current)
|
|
3092
3092
|
return;
|
|
3093
|
-
const $ =
|
|
3094
|
-
for (const
|
|
3095
|
-
const
|
|
3096
|
-
|
|
3093
|
+
const $ = N.current;
|
|
3094
|
+
for (const x in w) {
|
|
3095
|
+
const C = w[x];
|
|
3096
|
+
C ? $.style[x] = C : $.style.removeProperty(x);
|
|
3097
3097
|
}
|
|
3098
3098
|
}
|
|
3099
3099
|
return w$(() => {
|
|
3100
|
-
if (!
|
|
3100
|
+
if (!N.current || u === f.current)
|
|
3101
3101
|
return;
|
|
3102
|
-
|
|
3103
|
-
function $(
|
|
3104
|
-
return S ? 0 : n ?? v$(
|
|
3102
|
+
f.current = u;
|
|
3103
|
+
function $(E) {
|
|
3104
|
+
return S ? 0 : n ?? v$(E);
|
|
3105
3105
|
}
|
|
3106
|
-
const
|
|
3107
|
-
function
|
|
3108
|
-
u ? (
|
|
3106
|
+
const x = (E) => `height ${$(E)}ms ${e}`, C = (E) => {
|
|
3107
|
+
function T() {
|
|
3108
|
+
u ? (b({
|
|
3109
3109
|
height: "",
|
|
3110
3110
|
overflow: "",
|
|
3111
3111
|
transition: "",
|
|
3112
3112
|
display: ""
|
|
3113
|
-
}), r("expandEnd")) : (
|
|
3113
|
+
}), r("expandEnd")) : (b({ transition: "" }), r("collapseEnd")), m(!1);
|
|
3114
3114
|
}
|
|
3115
|
-
O.current && Bt(O.current), O.current = g$(
|
|
3115
|
+
O.current && Bt(O.current), O.current = g$(T, E);
|
|
3116
3116
|
};
|
|
3117
|
-
return m(!0), u ?
|
|
3118
|
-
r("expandStart"),
|
|
3117
|
+
return m(!0), u ? F.current = requestAnimationFrame(() => {
|
|
3118
|
+
r("expandStart"), b({
|
|
3119
3119
|
display: "block",
|
|
3120
3120
|
overflow: "hidden",
|
|
3121
|
-
height:
|
|
3122
|
-
}),
|
|
3121
|
+
height: P
|
|
3122
|
+
}), F.current = requestAnimationFrame(() => {
|
|
3123
3123
|
r("expanding");
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3124
|
+
const E = Wt(N);
|
|
3125
|
+
C($(E)), N.current && (N.current.style.transition = x(E), N.current.style.height = `${E}px`);
|
|
3126
3126
|
});
|
|
3127
|
-
}) :
|
|
3127
|
+
}) : F.current = requestAnimationFrame(() => {
|
|
3128
3128
|
r("collapseStart");
|
|
3129
|
-
const
|
|
3130
|
-
|
|
3131
|
-
transition:
|
|
3132
|
-
height: `${
|
|
3133
|
-
}),
|
|
3134
|
-
r("collapsing"),
|
|
3135
|
-
height:
|
|
3129
|
+
const E = Wt(N);
|
|
3130
|
+
C($(E)), b({
|
|
3131
|
+
transition: x(E),
|
|
3132
|
+
height: `${E}px`
|
|
3133
|
+
}), F.current = requestAnimationFrame(() => {
|
|
3134
|
+
r("collapsing"), b({
|
|
3135
|
+
height: P,
|
|
3136
3136
|
overflow: "hidden"
|
|
3137
3137
|
});
|
|
3138
3138
|
});
|
|
3139
3139
|
}), () => {
|
|
3140
|
-
|
|
3140
|
+
F.current && cancelAnimationFrame(F.current), O.current && Bt(O.current);
|
|
3141
3141
|
};
|
|
3142
3142
|
}, [
|
|
3143
3143
|
u,
|
|
3144
|
-
|
|
3144
|
+
P,
|
|
3145
3145
|
S,
|
|
3146
3146
|
n,
|
|
3147
3147
|
e,
|
|
3148
3148
|
r
|
|
3149
3149
|
]), {
|
|
3150
3150
|
isExpanded: u,
|
|
3151
|
-
setExpanded:
|
|
3151
|
+
setExpanded: p,
|
|
3152
3152
|
getToggleProps(w) {
|
|
3153
|
-
const { disabled: $, onClick:
|
|
3153
|
+
const { disabled: $, onClick: x, refKey: C, ...E } = {
|
|
3154
3154
|
refKey: "ref",
|
|
3155
3155
|
onClick() {
|
|
3156
3156
|
},
|
|
3157
3157
|
disabled: !1,
|
|
3158
3158
|
...w
|
|
3159
|
-
},
|
|
3160
|
-
id: `react-collapsed-toggle-${
|
|
3161
|
-
"aria-controls": `react-collapsed-panel-${
|
|
3159
|
+
}, T = z ? z.tagName === "BUTTON" : void 0, R = w == null ? void 0 : w[C || "ref"], V = {
|
|
3160
|
+
id: `react-collapsed-toggle-${c}`,
|
|
3161
|
+
"aria-controls": `react-collapsed-panel-${c}`,
|
|
3162
3162
|
"aria-expanded": u,
|
|
3163
|
-
onClick(
|
|
3164
|
-
$ || (
|
|
3163
|
+
onClick(se) {
|
|
3164
|
+
$ || (x == null || x(se), p((q) => !q));
|
|
3165
3165
|
},
|
|
3166
|
-
[
|
|
3167
|
-
},
|
|
3166
|
+
[C || "ref"]: Yt(R, g)
|
|
3167
|
+
}, _ = {
|
|
3168
3168
|
type: "button",
|
|
3169
3169
|
disabled: $ ? !0 : void 0
|
|
3170
|
-
},
|
|
3170
|
+
}, ee = {
|
|
3171
3171
|
"aria-disabled": $ ? !0 : void 0,
|
|
3172
3172
|
role: "button",
|
|
3173
3173
|
tabIndex: $ ? -1 : 0
|
|
3174
3174
|
};
|
|
3175
|
-
return
|
|
3176
|
-
...
|
|
3177
|
-
...
|
|
3178
|
-
...
|
|
3179
|
-
...
|
|
3175
|
+
return T === !1 ? { ...V, ...ee, ...E } : T === !0 ? { ...V, ..._, ...E } : {
|
|
3176
|
+
...V,
|
|
3177
|
+
..._,
|
|
3178
|
+
...ee,
|
|
3179
|
+
...E
|
|
3180
3180
|
};
|
|
3181
3181
|
},
|
|
3182
3182
|
getCollapseProps(w) {
|
|
3183
|
-
const { style: $, refKey:
|
|
3183
|
+
const { style: $, refKey: x } = { refKey: "ref", style: {}, ...w }, C = w == null ? void 0 : w[x || "ref"];
|
|
3184
3184
|
return {
|
|
3185
|
-
id: `react-collapsed-panel-${
|
|
3185
|
+
id: `react-collapsed-panel-${c}`,
|
|
3186
3186
|
"aria-hidden": !u,
|
|
3187
|
-
"aria-labelledby": `react-collapsed-toggle-${
|
|
3187
|
+
"aria-labelledby": `react-collapsed-toggle-${c}`,
|
|
3188
3188
|
role: "region",
|
|
3189
3189
|
...w,
|
|
3190
|
-
[
|
|
3190
|
+
[x || "ref"]: Yt(N, C),
|
|
3191
3191
|
style: {
|
|
3192
3192
|
boxSizing: "border-box",
|
|
3193
3193
|
...!h && !u ? {
|
|
3194
3194
|
// collapsed and not animating
|
|
3195
|
-
display:
|
|
3196
|
-
height:
|
|
3195
|
+
display: P === "0px" ? "none" : "block",
|
|
3196
|
+
height: P,
|
|
3197
3197
|
overflow: "hidden"
|
|
3198
3198
|
} : {},
|
|
3199
3199
|
// additional styles passed, e.g. getCollapseProps({style: {}})
|
|
@@ -3204,13 +3204,13 @@ function b$({
|
|
|
3204
3204
|
};
|
|
3205
3205
|
}
|
|
3206
3206
|
const x$ = ({ open: n, children: e }) => {
|
|
3207
|
-
const [t, o] =
|
|
3207
|
+
const [t, o] = M(n), { getCollapseProps: i } = b$({
|
|
3208
3208
|
isExpanded: t,
|
|
3209
3209
|
duration: 500
|
|
3210
3210
|
});
|
|
3211
3211
|
return Q(() => {
|
|
3212
3212
|
o(n);
|
|
3213
|
-
}, [n, o]), /* @__PURE__ */
|
|
3213
|
+
}, [n, o]), /* @__PURE__ */ d(pe, { children: /* @__PURE__ */ d("div", { ...i(), children: e }) });
|
|
3214
3214
|
};
|
|
3215
3215
|
function C$(n) {
|
|
3216
3216
|
return H({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 48c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m140.204 130.267l-22.536-22.718c-4.667-4.705-12.265-4.736-16.97-.068L215.346 303.697l-59.792-60.277c-4.667-4.705-12.265-4.736-16.97-.069l-22.719 22.536c-4.705 4.667-4.736 12.265-.068 16.971l90.781 91.516c4.667 4.705 12.265 4.736 16.97.068l172.589-171.204c4.704-4.668 4.734-12.266.067-16.971z" }, child: [] }] })(n);
|
|
@@ -3224,72 +3224,75 @@ function Kt(n) {
|
|
|
3224
3224
|
function qt(n) {
|
|
3225
3225
|
return H({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M464 128H272l-54.63-54.63c-6-6-14.14-9.37-22.63-9.37H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48zm0 272H48V112h140.12l54.63 54.63c6 6 14.14 9.37 22.63 9.37H464v224z" }, child: [] }] })(n);
|
|
3226
3226
|
}
|
|
3227
|
-
const An = ({ folder: n, onFileOpen: e }) => {
|
|
3228
|
-
const [
|
|
3229
|
-
|
|
3230
|
-
},
|
|
3231
|
-
f.stopPropagation(),
|
|
3227
|
+
const An = ({ folder: n, onFileOpen: e, icons: t }) => {
|
|
3228
|
+
const [o, i] = M(!1), [s, a] = M(!1), { currentPath: l, setCurrentPath: r, onFolderChange: c } = he(), u = () => {
|
|
3229
|
+
a(!0), e(n), r(n.path), c == null || c(n.path);
|
|
3230
|
+
}, p = (f) => {
|
|
3231
|
+
f.stopPropagation(), i((h) => !h);
|
|
3232
3232
|
};
|
|
3233
3233
|
return Q(() => {
|
|
3234
|
-
|
|
3235
|
-
const f =
|
|
3236
|
-
f.pop(), f.join("/") === n.path &&
|
|
3237
|
-
}, [
|
|
3238
|
-
/* @__PURE__ */
|
|
3234
|
+
a(l === n.path);
|
|
3235
|
+
const f = l.split("/");
|
|
3236
|
+
f.pop(), f.join("/") === n.path && i(!0);
|
|
3237
|
+
}, [l]), n.subDirectories.length > 0 ? /* @__PURE__ */ k(pe, { children: [
|
|
3238
|
+
/* @__PURE__ */ k(
|
|
3239
3239
|
"div",
|
|
3240
3240
|
{
|
|
3241
|
-
className: `sb-folders-list-item ${
|
|
3242
|
-
onClick:
|
|
3241
|
+
className: `sb-folders-list-item ${s ? "active-list-item" : ""}`,
|
|
3242
|
+
onClick: u,
|
|
3243
3243
|
children: [
|
|
3244
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ d("span", { onClick: p, children: /* @__PURE__ */ d(
|
|
3245
3245
|
to,
|
|
3246
3246
|
{
|
|
3247
3247
|
size: 20,
|
|
3248
|
-
className: `folder-icon-default ${
|
|
3248
|
+
className: `folder-icon-default ${o ? "folder-rotate-down" : ""}`
|
|
3249
3249
|
}
|
|
3250
3250
|
) }),
|
|
3251
|
-
/* @__PURE__ */
|
|
3252
|
-
|
|
3253
|
-
|
|
3251
|
+
/* @__PURE__ */ k("div", { className: "sb-folder-details", children: [
|
|
3252
|
+
o ? (
|
|
3253
|
+
//{isOpen || isActive ? (
|
|
3254
|
+
n.class && t && t.get(n.class) ? t.get(n.class)[1] : /* @__PURE__ */ d(Kt, { size: 20, className: "folder-open-icon" })
|
|
3255
|
+
) : n.class && t && t.get(n.class) ? t.get(n.class)[0] : /* @__PURE__ */ d(qt, { size: 17, className: "folder-close-icon" }),
|
|
3256
|
+
/* @__PURE__ */ d("span", { className: "sb-folder-name", title: n.name, children: n.name })
|
|
3254
3257
|
] })
|
|
3255
3258
|
]
|
|
3256
3259
|
}
|
|
3257
3260
|
),
|
|
3258
|
-
/* @__PURE__ */
|
|
3259
|
-
] }) : /* @__PURE__ */
|
|
3261
|
+
/* @__PURE__ */ d(x$, { open: o, children: /* @__PURE__ */ d("div", { className: "folder-collapsible", children: n.subDirectories.map((f, h) => /* @__PURE__ */ d(An, { folder: f, onFileOpen: e, icons: t }, h)) }) })
|
|
3262
|
+
] }) : /* @__PURE__ */ k(
|
|
3260
3263
|
"div",
|
|
3261
3264
|
{
|
|
3262
|
-
className: `sb-folders-list-item ${
|
|
3263
|
-
onClick:
|
|
3265
|
+
className: `sb-folders-list-item ${s ? "active-list-item" : ""}`,
|
|
3266
|
+
onClick: u,
|
|
3264
3267
|
children: [
|
|
3265
|
-
/* @__PURE__ */
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
|
|
3268
|
-
/* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ d("span", { className: "non-expanable" }),
|
|
3269
|
+
/* @__PURE__ */ k("div", { className: "sb-folder-details", children: [
|
|
3270
|
+
s ? n.class && t && t.get(n.class) ? t.get(n.class)[1] : /* @__PURE__ */ d(Kt, { size: 20, className: "folder-open-icon" }) : n.class && t && t.get(n.class) ? t.get(n.class)[0] : /* @__PURE__ */ d(qt, { size: 17, className: "folder-close-icon" }),
|
|
3271
|
+
/* @__PURE__ */ d("span", { className: "sb-folder-name", title: n.name, children: n.name })
|
|
3269
3272
|
] })
|
|
3270
3273
|
]
|
|
3271
3274
|
}
|
|
3272
3275
|
);
|
|
3273
|
-
}, F$ = (n) => n == null ? void 0 : n.split("/").slice(0, -1).join("/"), Rn = ({ onFileOpen: n }) => {
|
|
3274
|
-
const [
|
|
3275
|
-
var
|
|
3276
|
-
return l
|
|
3277
|
-
...
|
|
3278
|
-
subDirectories:
|
|
3276
|
+
}, F$ = (n) => n == null ? void 0 : n.split("/").slice(0, -1).join("/"), Rn = ({ onFileOpen: n, icons: e }) => {
|
|
3277
|
+
const [t, o] = M([]), { files: i } = Ze(), s = ce(), a = (l, r) => {
|
|
3278
|
+
var c;
|
|
3279
|
+
return r[l] ? (c = r[l]) == null ? void 0 : c.map((u) => ({
|
|
3280
|
+
...u,
|
|
3281
|
+
subDirectories: a(u.path, r)
|
|
3279
3282
|
})) : [];
|
|
3280
3283
|
};
|
|
3281
3284
|
return Q(() => {
|
|
3282
|
-
if (Array.isArray(
|
|
3283
|
-
const
|
|
3284
|
-
|
|
3285
|
+
if (Array.isArray(i)) {
|
|
3286
|
+
const l = i.filter((c) => c.isDirectory), r = Object.groupBy(l, ({ path: c }) => F$(c));
|
|
3287
|
+
o(() => a("", r));
|
|
3285
3288
|
}
|
|
3286
|
-
}, [
|
|
3289
|
+
}, [i]), /* @__PURE__ */ d("div", { className: "sb-folders-list", children: (t == null ? void 0 : t.length) > 0 ? /* @__PURE__ */ d(pe, { children: t == null ? void 0 : t.map((l, r) => /* @__PURE__ */ d(An, { folder: l, onFileOpen: n, icons: e }, r)) }) : /* @__PURE__ */ d("div", { className: "empty-nav-pane", children: s("nothingHereYet") }) });
|
|
3287
3290
|
};
|
|
3288
3291
|
Rn.displayName = "NavigationPane";
|
|
3289
3292
|
function N$(n) {
|
|
3290
3293
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
3291
3294
|
}
|
|
3292
|
-
var Ie = { exports: {} }, De = { exports: {} },
|
|
3295
|
+
var Ie = { exports: {} }, De = { exports: {} }, te = {};
|
|
3293
3296
|
/** @license React v16.13.1
|
|
3294
3297
|
* react-is.production.min.js
|
|
3295
3298
|
*
|
|
@@ -3300,21 +3303,21 @@ var Ie = { exports: {} }, De = { exports: {} }, ee = {};
|
|
|
3300
3303
|
*/
|
|
3301
3304
|
var _t;
|
|
3302
3305
|
function E$() {
|
|
3303
|
-
if (_t) return
|
|
3306
|
+
if (_t) return te;
|
|
3304
3307
|
_t = 1;
|
|
3305
|
-
var n = typeof Symbol == "function" && Symbol.for, e = n ? Symbol.for("react.element") : 60103, t = n ? Symbol.for("react.portal") : 60106, o = n ? Symbol.for("react.fragment") : 60107, i = n ? Symbol.for("react.strict_mode") : 60108, s = n ? Symbol.for("react.profiler") : 60114, a = n ? Symbol.for("react.provider") : 60109, l = n ? Symbol.for("react.context") : 60110, r = n ? Symbol.for("react.async_mode") : 60111,
|
|
3306
|
-
function
|
|
3308
|
+
var n = typeof Symbol == "function" && Symbol.for, e = n ? Symbol.for("react.element") : 60103, t = n ? Symbol.for("react.portal") : 60106, o = n ? Symbol.for("react.fragment") : 60107, i = n ? Symbol.for("react.strict_mode") : 60108, s = n ? Symbol.for("react.profiler") : 60114, a = n ? Symbol.for("react.provider") : 60109, l = n ? Symbol.for("react.context") : 60110, r = n ? Symbol.for("react.async_mode") : 60111, c = n ? Symbol.for("react.concurrent_mode") : 60111, u = n ? Symbol.for("react.forward_ref") : 60112, p = n ? Symbol.for("react.suspense") : 60113, f = n ? Symbol.for("react.suspense_list") : 60120, h = n ? Symbol.for("react.memo") : 60115, m = n ? Symbol.for("react.lazy") : 60116, v = n ? Symbol.for("react.block") : 60121, S = n ? Symbol.for("react.fundamental") : 60117, F = n ? Symbol.for("react.responder") : 60118, O = n ? Symbol.for("react.scope") : 60119;
|
|
3309
|
+
function N(g) {
|
|
3307
3310
|
if (typeof g == "object" && g !== null) {
|
|
3308
|
-
var
|
|
3309
|
-
switch (
|
|
3311
|
+
var P = g.$$typeof;
|
|
3312
|
+
switch (P) {
|
|
3310
3313
|
case e:
|
|
3311
3314
|
switch (g = g.type, g) {
|
|
3312
3315
|
case r:
|
|
3313
|
-
case
|
|
3316
|
+
case c:
|
|
3314
3317
|
case o:
|
|
3315
3318
|
case s:
|
|
3316
3319
|
case i:
|
|
3317
|
-
case
|
|
3320
|
+
case p:
|
|
3318
3321
|
return g;
|
|
3319
3322
|
default:
|
|
3320
3323
|
switch (g = g && g.$$typeof, g) {
|
|
@@ -3325,46 +3328,46 @@ function E$() {
|
|
|
3325
3328
|
case a:
|
|
3326
3329
|
return g;
|
|
3327
3330
|
default:
|
|
3328
|
-
return
|
|
3331
|
+
return P;
|
|
3329
3332
|
}
|
|
3330
3333
|
}
|
|
3331
3334
|
case t:
|
|
3332
|
-
return
|
|
3335
|
+
return P;
|
|
3333
3336
|
}
|
|
3334
3337
|
}
|
|
3335
3338
|
}
|
|
3336
3339
|
function z(g) {
|
|
3337
|
-
return
|
|
3340
|
+
return N(g) === c;
|
|
3338
3341
|
}
|
|
3339
|
-
return
|
|
3340
|
-
return z(g) ||
|
|
3341
|
-
},
|
|
3342
|
-
return
|
|
3343
|
-
},
|
|
3344
|
-
return
|
|
3345
|
-
},
|
|
3342
|
+
return te.AsyncMode = r, te.ConcurrentMode = c, te.ContextConsumer = l, te.ContextProvider = a, te.Element = e, te.ForwardRef = u, te.Fragment = o, te.Lazy = m, te.Memo = h, te.Portal = t, te.Profiler = s, te.StrictMode = i, te.Suspense = p, te.isAsyncMode = function(g) {
|
|
3343
|
+
return z(g) || N(g) === r;
|
|
3344
|
+
}, te.isConcurrentMode = z, te.isContextConsumer = function(g) {
|
|
3345
|
+
return N(g) === l;
|
|
3346
|
+
}, te.isContextProvider = function(g) {
|
|
3347
|
+
return N(g) === a;
|
|
3348
|
+
}, te.isElement = function(g) {
|
|
3346
3349
|
return typeof g == "object" && g !== null && g.$$typeof === e;
|
|
3347
|
-
},
|
|
3348
|
-
return
|
|
3349
|
-
},
|
|
3350
|
-
return
|
|
3351
|
-
},
|
|
3352
|
-
return
|
|
3353
|
-
},
|
|
3354
|
-
return
|
|
3355
|
-
},
|
|
3356
|
-
return
|
|
3357
|
-
},
|
|
3358
|
-
return
|
|
3359
|
-
},
|
|
3360
|
-
return
|
|
3361
|
-
},
|
|
3362
|
-
return
|
|
3363
|
-
},
|
|
3364
|
-
return typeof g == "string" || typeof g == "function" || g === o || g ===
|
|
3365
|
-
},
|
|
3350
|
+
}, te.isForwardRef = function(g) {
|
|
3351
|
+
return N(g) === u;
|
|
3352
|
+
}, te.isFragment = function(g) {
|
|
3353
|
+
return N(g) === o;
|
|
3354
|
+
}, te.isLazy = function(g) {
|
|
3355
|
+
return N(g) === m;
|
|
3356
|
+
}, te.isMemo = function(g) {
|
|
3357
|
+
return N(g) === h;
|
|
3358
|
+
}, te.isPortal = function(g) {
|
|
3359
|
+
return N(g) === t;
|
|
3360
|
+
}, te.isProfiler = function(g) {
|
|
3361
|
+
return N(g) === s;
|
|
3362
|
+
}, te.isStrictMode = function(g) {
|
|
3363
|
+
return N(g) === i;
|
|
3364
|
+
}, te.isSuspense = function(g) {
|
|
3365
|
+
return N(g) === p;
|
|
3366
|
+
}, te.isValidElementType = function(g) {
|
|
3367
|
+
return typeof g == "string" || typeof g == "function" || g === o || g === c || g === s || g === i || g === p || g === f || typeof g == "object" && g !== null && (g.$$typeof === m || g.$$typeof === h || g.$$typeof === a || g.$$typeof === l || g.$$typeof === u || g.$$typeof === S || g.$$typeof === F || g.$$typeof === O || g.$$typeof === v);
|
|
3368
|
+
}, te.typeOf = N, te;
|
|
3366
3369
|
}
|
|
3367
|
-
var
|
|
3370
|
+
var ne = {};
|
|
3368
3371
|
/** @license React v16.13.1
|
|
3369
3372
|
* react-is.development.js
|
|
3370
3373
|
*
|
|
@@ -3376,27 +3379,27 @@ var te = {};
|
|
|
3376
3379
|
var Gt;
|
|
3377
3380
|
function P$() {
|
|
3378
3381
|
return Gt || (Gt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
3379
|
-
var n = typeof Symbol == "function" && Symbol.for, e = n ? Symbol.for("react.element") : 60103, t = n ? Symbol.for("react.portal") : 60106, o = n ? Symbol.for("react.fragment") : 60107, i = n ? Symbol.for("react.strict_mode") : 60108, s = n ? Symbol.for("react.profiler") : 60114, a = n ? Symbol.for("react.provider") : 60109, l = n ? Symbol.for("react.context") : 60110, r = n ? Symbol.for("react.async_mode") : 60111,
|
|
3380
|
-
function
|
|
3381
|
-
return typeof
|
|
3382
|
-
|
|
3382
|
+
var n = typeof Symbol == "function" && Symbol.for, e = n ? Symbol.for("react.element") : 60103, t = n ? Symbol.for("react.portal") : 60106, o = n ? Symbol.for("react.fragment") : 60107, i = n ? Symbol.for("react.strict_mode") : 60108, s = n ? Symbol.for("react.profiler") : 60114, a = n ? Symbol.for("react.provider") : 60109, l = n ? Symbol.for("react.context") : 60110, r = n ? Symbol.for("react.async_mode") : 60111, c = n ? Symbol.for("react.concurrent_mode") : 60111, u = n ? Symbol.for("react.forward_ref") : 60112, p = n ? Symbol.for("react.suspense") : 60113, f = n ? Symbol.for("react.suspense_list") : 60120, h = n ? Symbol.for("react.memo") : 60115, m = n ? Symbol.for("react.lazy") : 60116, v = n ? Symbol.for("react.block") : 60121, S = n ? Symbol.for("react.fundamental") : 60117, F = n ? Symbol.for("react.responder") : 60118, O = n ? Symbol.for("react.scope") : 60119;
|
|
3383
|
+
function N(A) {
|
|
3384
|
+
return typeof A == "string" || typeof A == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
3385
|
+
A === o || A === c || A === s || A === i || A === p || A === f || typeof A == "object" && A !== null && (A.$$typeof === m || A.$$typeof === h || A.$$typeof === a || A.$$typeof === l || A.$$typeof === u || A.$$typeof === S || A.$$typeof === F || A.$$typeof === O || A.$$typeof === v);
|
|
3383
3386
|
}
|
|
3384
|
-
function z(
|
|
3385
|
-
if (typeof
|
|
3386
|
-
var
|
|
3387
|
-
switch (
|
|
3387
|
+
function z(A) {
|
|
3388
|
+
if (typeof A == "object" && A !== null) {
|
|
3389
|
+
var re = A.$$typeof;
|
|
3390
|
+
switch (re) {
|
|
3388
3391
|
case e:
|
|
3389
|
-
var
|
|
3390
|
-
switch (
|
|
3392
|
+
var ge = A.type;
|
|
3393
|
+
switch (ge) {
|
|
3391
3394
|
case r:
|
|
3392
|
-
case
|
|
3395
|
+
case c:
|
|
3393
3396
|
case o:
|
|
3394
3397
|
case s:
|
|
3395
3398
|
case i:
|
|
3396
|
-
case
|
|
3397
|
-
return
|
|
3399
|
+
case p:
|
|
3400
|
+
return ge;
|
|
3398
3401
|
default:
|
|
3399
|
-
var ze =
|
|
3402
|
+
var ze = ge && ge.$$typeof;
|
|
3400
3403
|
switch (ze) {
|
|
3401
3404
|
case l:
|
|
3402
3405
|
case u:
|
|
@@ -3405,56 +3408,56 @@ function P$() {
|
|
|
3405
3408
|
case a:
|
|
3406
3409
|
return ze;
|
|
3407
3410
|
default:
|
|
3408
|
-
return
|
|
3411
|
+
return re;
|
|
3409
3412
|
}
|
|
3410
3413
|
}
|
|
3411
3414
|
case t:
|
|
3412
|
-
return
|
|
3415
|
+
return re;
|
|
3413
3416
|
}
|
|
3414
3417
|
}
|
|
3415
3418
|
}
|
|
3416
|
-
var g = r,
|
|
3417
|
-
function
|
|
3418
|
-
return
|
|
3419
|
+
var g = r, P = c, b = l, w = a, $ = e, x = u, C = o, E = m, T = h, R = t, V = s, _ = i, ee = p, se = !1;
|
|
3420
|
+
function q(A) {
|
|
3421
|
+
return se || (se = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), y(A) || z(A) === r;
|
|
3419
3422
|
}
|
|
3420
|
-
function y(
|
|
3421
|
-
return z(
|
|
3423
|
+
function y(A) {
|
|
3424
|
+
return z(A) === c;
|
|
3422
3425
|
}
|
|
3423
|
-
function
|
|
3424
|
-
return z(
|
|
3426
|
+
function L(A) {
|
|
3427
|
+
return z(A) === l;
|
|
3425
3428
|
}
|
|
3426
|
-
function
|
|
3427
|
-
return z(
|
|
3429
|
+
function W(A) {
|
|
3430
|
+
return z(A) === a;
|
|
3428
3431
|
}
|
|
3429
|
-
function U(
|
|
3430
|
-
return typeof
|
|
3432
|
+
function U(A) {
|
|
3433
|
+
return typeof A == "object" && A !== null && A.$$typeof === e;
|
|
3431
3434
|
}
|
|
3432
|
-
function j(
|
|
3433
|
-
return z(
|
|
3435
|
+
function j(A) {
|
|
3436
|
+
return z(A) === u;
|
|
3434
3437
|
}
|
|
3435
|
-
function
|
|
3436
|
-
return z(
|
|
3438
|
+
function G(A) {
|
|
3439
|
+
return z(A) === o;
|
|
3437
3440
|
}
|
|
3438
|
-
function
|
|
3439
|
-
return z(
|
|
3441
|
+
function Y(A) {
|
|
3442
|
+
return z(A) === m;
|
|
3440
3443
|
}
|
|
3441
|
-
function
|
|
3442
|
-
return z(
|
|
3444
|
+
function K(A) {
|
|
3445
|
+
return z(A) === h;
|
|
3443
3446
|
}
|
|
3444
|
-
function
|
|
3445
|
-
return z(
|
|
3447
|
+
function J(A) {
|
|
3448
|
+
return z(A) === t;
|
|
3446
3449
|
}
|
|
3447
|
-
function Z(
|
|
3448
|
-
return z(
|
|
3450
|
+
function Z(A) {
|
|
3451
|
+
return z(A) === s;
|
|
3449
3452
|
}
|
|
3450
|
-
function D(
|
|
3451
|
-
return z(
|
|
3453
|
+
function D(A) {
|
|
3454
|
+
return z(A) === i;
|
|
3452
3455
|
}
|
|
3453
|
-
function
|
|
3454
|
-
return z(
|
|
3456
|
+
function oe(A) {
|
|
3457
|
+
return z(A) === p;
|
|
3455
3458
|
}
|
|
3456
|
-
|
|
3457
|
-
}()),
|
|
3459
|
+
ne.AsyncMode = g, ne.ConcurrentMode = P, ne.ContextConsumer = b, ne.ContextProvider = w, ne.Element = $, ne.ForwardRef = x, ne.Fragment = C, ne.Lazy = E, ne.Memo = T, ne.Portal = R, ne.Profiler = V, ne.StrictMode = _, ne.Suspense = ee, ne.isAsyncMode = q, ne.isConcurrentMode = y, ne.isContextConsumer = L, ne.isContextProvider = W, ne.isElement = U, ne.isForwardRef = j, ne.isFragment = G, ne.isLazy = Y, ne.isMemo = K, ne.isPortal = J, ne.isProfiler = Z, ne.isStrictMode = D, ne.isSuspense = oe, ne.isValidElementType = N, ne.typeOf = z;
|
|
3460
|
+
}()), ne;
|
|
3458
3461
|
}
|
|
3459
3462
|
var Jt;
|
|
3460
3463
|
function kn() {
|
|
@@ -3489,23 +3492,23 @@ function T$() {
|
|
|
3489
3492
|
});
|
|
3490
3493
|
if (r.join("") !== "0123456789")
|
|
3491
3494
|
return !1;
|
|
3492
|
-
var
|
|
3495
|
+
var c = {};
|
|
3493
3496
|
return "abcdefghijklmnopqrst".split("").forEach(function(u) {
|
|
3494
|
-
|
|
3495
|
-
}), Object.keys(Object.assign({},
|
|
3497
|
+
c[u] = u;
|
|
3498
|
+
}), Object.keys(Object.assign({}, c)).join("") === "abcdefghijklmnopqrst";
|
|
3496
3499
|
} catch {
|
|
3497
3500
|
return !1;
|
|
3498
3501
|
}
|
|
3499
3502
|
}
|
|
3500
3503
|
return ot = i() ? Object.assign : function(s, a) {
|
|
3501
|
-
for (var l, r = o(s),
|
|
3504
|
+
for (var l, r = o(s), c, u = 1; u < arguments.length; u++) {
|
|
3502
3505
|
l = Object(arguments[u]);
|
|
3503
|
-
for (var
|
|
3504
|
-
e.call(l,
|
|
3506
|
+
for (var p in l)
|
|
3507
|
+
e.call(l, p) && (r[p] = l[p]);
|
|
3505
3508
|
if (n) {
|
|
3506
|
-
|
|
3507
|
-
for (var
|
|
3508
|
-
t.call(l,
|
|
3509
|
+
c = n(l);
|
|
3510
|
+
for (var f = 0; f < c.length; f++)
|
|
3511
|
+
t.call(l, c[f]) && (r[c[f]] = l[c[f]]);
|
|
3509
3512
|
}
|
|
3510
3513
|
}
|
|
3511
3514
|
return r;
|
|
@@ -3539,29 +3542,29 @@ function z$() {
|
|
|
3539
3542
|
}
|
|
3540
3543
|
};
|
|
3541
3544
|
}
|
|
3542
|
-
function i(s, a, l, r,
|
|
3545
|
+
function i(s, a, l, r, c) {
|
|
3543
3546
|
if (process.env.NODE_ENV !== "production") {
|
|
3544
3547
|
for (var u in s)
|
|
3545
3548
|
if (o(s, u)) {
|
|
3546
|
-
var
|
|
3549
|
+
var p;
|
|
3547
3550
|
try {
|
|
3548
3551
|
if (typeof s[u] != "function") {
|
|
3549
|
-
var
|
|
3552
|
+
var f = Error(
|
|
3550
3553
|
(r || "React class") + ": " + l + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
3551
3554
|
);
|
|
3552
|
-
throw
|
|
3555
|
+
throw f.name = "Invariant Violation", f;
|
|
3553
3556
|
}
|
|
3554
|
-
|
|
3557
|
+
p = s[u](a, u, r, l, null, e);
|
|
3555
3558
|
} catch (m) {
|
|
3556
|
-
|
|
3559
|
+
p = m;
|
|
3557
3560
|
}
|
|
3558
|
-
if (
|
|
3559
|
-
(r || "React class") + ": type specification of " + l + " `" + u + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof
|
|
3560
|
-
),
|
|
3561
|
-
t[
|
|
3562
|
-
var h =
|
|
3561
|
+
if (p && !(p instanceof Error) && n(
|
|
3562
|
+
(r || "React class") + ": type specification of " + l + " `" + u + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof p + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
3563
|
+
), p instanceof Error && !(p.message in t)) {
|
|
3564
|
+
t[p.message] = !0;
|
|
3565
|
+
var h = c ? c() : "";
|
|
3563
3566
|
n(
|
|
3564
|
-
"Failed " + l + " type: " +
|
|
3567
|
+
"Failed " + l + " type: " + p.message + (h ?? "")
|
|
3565
3568
|
);
|
|
3566
3569
|
}
|
|
3567
3570
|
}
|
|
@@ -3589,238 +3592,238 @@ function L$() {
|
|
|
3589
3592
|
return null;
|
|
3590
3593
|
}
|
|
3591
3594
|
return rt = function(l, r) {
|
|
3592
|
-
var
|
|
3593
|
-
function
|
|
3594
|
-
var
|
|
3595
|
-
if (typeof
|
|
3596
|
-
return
|
|
3595
|
+
var c = typeof Symbol == "function" && Symbol.iterator, u = "@@iterator";
|
|
3596
|
+
function p(y) {
|
|
3597
|
+
var L = y && (c && y[c] || y[u]);
|
|
3598
|
+
if (typeof L == "function")
|
|
3599
|
+
return L;
|
|
3597
3600
|
}
|
|
3598
|
-
var
|
|
3599
|
-
array:
|
|
3600
|
-
bigint:
|
|
3601
|
-
bool:
|
|
3602
|
-
func:
|
|
3603
|
-
number:
|
|
3604
|
-
object:
|
|
3605
|
-
string:
|
|
3606
|
-
symbol:
|
|
3601
|
+
var f = "<<anonymous>>", h = {
|
|
3602
|
+
array: F("array"),
|
|
3603
|
+
bigint: F("bigint"),
|
|
3604
|
+
bool: F("boolean"),
|
|
3605
|
+
func: F("function"),
|
|
3606
|
+
number: F("number"),
|
|
3607
|
+
object: F("object"),
|
|
3608
|
+
string: F("string"),
|
|
3609
|
+
symbol: F("symbol"),
|
|
3607
3610
|
any: O(),
|
|
3608
|
-
arrayOf:
|
|
3611
|
+
arrayOf: N,
|
|
3609
3612
|
element: z(),
|
|
3610
3613
|
elementType: g(),
|
|
3611
|
-
instanceOf:
|
|
3612
|
-
node:
|
|
3614
|
+
instanceOf: P,
|
|
3615
|
+
node: x(),
|
|
3613
3616
|
objectOf: w,
|
|
3614
|
-
oneOf:
|
|
3617
|
+
oneOf: b,
|
|
3615
3618
|
oneOfType: $,
|
|
3616
|
-
shape:
|
|
3617
|
-
exact:
|
|
3619
|
+
shape: E,
|
|
3620
|
+
exact: T
|
|
3618
3621
|
};
|
|
3619
|
-
function m(y,
|
|
3620
|
-
return y ===
|
|
3622
|
+
function m(y, L) {
|
|
3623
|
+
return y === L ? y !== 0 || 1 / y === 1 / L : y !== y && L !== L;
|
|
3621
3624
|
}
|
|
3622
|
-
function v(y,
|
|
3623
|
-
this.message = y, this.data =
|
|
3625
|
+
function v(y, L) {
|
|
3626
|
+
this.message = y, this.data = L && typeof L == "object" ? L : {}, this.stack = "";
|
|
3624
3627
|
}
|
|
3625
3628
|
v.prototype = Error.prototype;
|
|
3626
3629
|
function S(y) {
|
|
3627
3630
|
if (process.env.NODE_ENV !== "production")
|
|
3628
|
-
var
|
|
3629
|
-
function U(
|
|
3630
|
-
if (
|
|
3631
|
+
var L = {}, W = 0;
|
|
3632
|
+
function U(G, Y, K, J, Z, D, oe) {
|
|
3633
|
+
if (J = J || f, D = D || K, oe !== t) {
|
|
3631
3634
|
if (r) {
|
|
3632
|
-
var
|
|
3635
|
+
var A = new Error(
|
|
3633
3636
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
3634
3637
|
);
|
|
3635
|
-
throw
|
|
3638
|
+
throw A.name = "Invariant Violation", A;
|
|
3636
3639
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
3637
|
-
var
|
|
3638
|
-
!
|
|
3639
|
-
|
|
3640
|
-
"You are manually calling a React.PropTypes validation function for the `" + D + "` prop on `" +
|
|
3641
|
-
),
|
|
3640
|
+
var re = J + ":" + K;
|
|
3641
|
+
!L[re] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
3642
|
+
W < 3 && (s(
|
|
3643
|
+
"You are manually calling a React.PropTypes validation function for the `" + D + "` prop on `" + J + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
3644
|
+
), L[re] = !0, W++);
|
|
3642
3645
|
}
|
|
3643
3646
|
}
|
|
3644
|
-
return
|
|
3647
|
+
return Y[K] == null ? G ? Y[K] === null ? new v("The " + Z + " `" + D + "` is marked as required " + ("in `" + J + "`, but its value is `null`.")) : new v("The " + Z + " `" + D + "` is marked as required in " + ("`" + J + "`, but its value is `undefined`.")) : null : y(Y, K, J, Z, D);
|
|
3645
3648
|
}
|
|
3646
3649
|
var j = U.bind(null, !1);
|
|
3647
3650
|
return j.isRequired = U.bind(null, !0), j;
|
|
3648
3651
|
}
|
|
3649
|
-
function
|
|
3650
|
-
function
|
|
3651
|
-
var
|
|
3652
|
+
function F(y) {
|
|
3653
|
+
function L(W, U, j, G, Y, K) {
|
|
3654
|
+
var J = W[U], Z = _(J);
|
|
3652
3655
|
if (Z !== y) {
|
|
3653
|
-
var D =
|
|
3656
|
+
var D = ee(J);
|
|
3654
3657
|
return new v(
|
|
3655
|
-
"Invalid " +
|
|
3658
|
+
"Invalid " + G + " `" + Y + "` of type " + ("`" + D + "` supplied to `" + j + "`, expected ") + ("`" + y + "`."),
|
|
3656
3659
|
{ expectedType: y }
|
|
3657
3660
|
);
|
|
3658
3661
|
}
|
|
3659
3662
|
return null;
|
|
3660
3663
|
}
|
|
3661
|
-
return S(
|
|
3664
|
+
return S(L);
|
|
3662
3665
|
}
|
|
3663
3666
|
function O() {
|
|
3664
3667
|
return S(a);
|
|
3665
3668
|
}
|
|
3666
|
-
function
|
|
3667
|
-
function
|
|
3669
|
+
function N(y) {
|
|
3670
|
+
function L(W, U, j, G, Y) {
|
|
3668
3671
|
if (typeof y != "function")
|
|
3669
|
-
return new v("Property `" +
|
|
3670
|
-
var
|
|
3671
|
-
if (!Array.isArray(
|
|
3672
|
-
var
|
|
3673
|
-
return new v("Invalid " +
|
|
3672
|
+
return new v("Property `" + Y + "` of component `" + j + "` has invalid PropType notation inside arrayOf.");
|
|
3673
|
+
var K = W[U];
|
|
3674
|
+
if (!Array.isArray(K)) {
|
|
3675
|
+
var J = _(K);
|
|
3676
|
+
return new v("Invalid " + G + " `" + Y + "` of type " + ("`" + J + "` supplied to `" + j + "`, expected an array."));
|
|
3674
3677
|
}
|
|
3675
|
-
for (var Z = 0; Z <
|
|
3676
|
-
var D = y(
|
|
3678
|
+
for (var Z = 0; Z < K.length; Z++) {
|
|
3679
|
+
var D = y(K, Z, j, G, Y + "[" + Z + "]", t);
|
|
3677
3680
|
if (D instanceof Error)
|
|
3678
3681
|
return D;
|
|
3679
3682
|
}
|
|
3680
3683
|
return null;
|
|
3681
3684
|
}
|
|
3682
|
-
return S(
|
|
3685
|
+
return S(L);
|
|
3683
3686
|
}
|
|
3684
3687
|
function z() {
|
|
3685
|
-
function y(
|
|
3686
|
-
var
|
|
3687
|
-
if (!l(
|
|
3688
|
-
var
|
|
3689
|
-
return new v("Invalid " + j + " `" +
|
|
3688
|
+
function y(L, W, U, j, G) {
|
|
3689
|
+
var Y = L[W];
|
|
3690
|
+
if (!l(Y)) {
|
|
3691
|
+
var K = _(Y);
|
|
3692
|
+
return new v("Invalid " + j + " `" + G + "` of type " + ("`" + K + "` supplied to `" + U + "`, expected a single ReactElement."));
|
|
3690
3693
|
}
|
|
3691
3694
|
return null;
|
|
3692
3695
|
}
|
|
3693
3696
|
return S(y);
|
|
3694
3697
|
}
|
|
3695
3698
|
function g() {
|
|
3696
|
-
function y(
|
|
3697
|
-
var
|
|
3698
|
-
if (!n.isValidElementType(
|
|
3699
|
-
var
|
|
3700
|
-
return new v("Invalid " + j + " `" +
|
|
3699
|
+
function y(L, W, U, j, G) {
|
|
3700
|
+
var Y = L[W];
|
|
3701
|
+
if (!n.isValidElementType(Y)) {
|
|
3702
|
+
var K = _(Y);
|
|
3703
|
+
return new v("Invalid " + j + " `" + G + "` of type " + ("`" + K + "` supplied to `" + U + "`, expected a single ReactElement type."));
|
|
3701
3704
|
}
|
|
3702
3705
|
return null;
|
|
3703
3706
|
}
|
|
3704
3707
|
return S(y);
|
|
3705
3708
|
}
|
|
3706
|
-
function
|
|
3707
|
-
function
|
|
3708
|
-
if (!(
|
|
3709
|
-
var
|
|
3710
|
-
return new v("Invalid " +
|
|
3709
|
+
function P(y) {
|
|
3710
|
+
function L(W, U, j, G, Y) {
|
|
3711
|
+
if (!(W[U] instanceof y)) {
|
|
3712
|
+
var K = y.name || f, J = q(W[U]);
|
|
3713
|
+
return new v("Invalid " + G + " `" + Y + "` of type " + ("`" + J + "` supplied to `" + j + "`, expected ") + ("instance of `" + K + "`."));
|
|
3711
3714
|
}
|
|
3712
3715
|
return null;
|
|
3713
3716
|
}
|
|
3714
|
-
return S(
|
|
3717
|
+
return S(L);
|
|
3715
3718
|
}
|
|
3716
|
-
function
|
|
3719
|
+
function b(y) {
|
|
3717
3720
|
if (!Array.isArray(y))
|
|
3718
3721
|
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s(
|
|
3719
3722
|
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
3720
3723
|
) : s("Invalid argument supplied to oneOf, expected an array.")), a;
|
|
3721
|
-
function
|
|
3722
|
-
for (var
|
|
3723
|
-
if (m(
|
|
3724
|
+
function L(W, U, j, G, Y) {
|
|
3725
|
+
for (var K = W[U], J = 0; J < y.length; J++)
|
|
3726
|
+
if (m(K, y[J]))
|
|
3724
3727
|
return null;
|
|
3725
|
-
var Z = JSON.stringify(y, function(
|
|
3726
|
-
var
|
|
3727
|
-
return
|
|
3728
|
+
var Z = JSON.stringify(y, function(oe, A) {
|
|
3729
|
+
var re = ee(A);
|
|
3730
|
+
return re === "symbol" ? String(A) : A;
|
|
3728
3731
|
});
|
|
3729
|
-
return new v("Invalid " +
|
|
3732
|
+
return new v("Invalid " + G + " `" + Y + "` of value `" + String(K) + "` " + ("supplied to `" + j + "`, expected one of " + Z + "."));
|
|
3730
3733
|
}
|
|
3731
|
-
return S(
|
|
3734
|
+
return S(L);
|
|
3732
3735
|
}
|
|
3733
3736
|
function w(y) {
|
|
3734
|
-
function
|
|
3737
|
+
function L(W, U, j, G, Y) {
|
|
3735
3738
|
if (typeof y != "function")
|
|
3736
|
-
return new v("Property `" +
|
|
3737
|
-
var
|
|
3738
|
-
if (
|
|
3739
|
-
return new v("Invalid " +
|
|
3740
|
-
for (var Z in
|
|
3741
|
-
if (o(
|
|
3742
|
-
var D = y(
|
|
3739
|
+
return new v("Property `" + Y + "` of component `" + j + "` has invalid PropType notation inside objectOf.");
|
|
3740
|
+
var K = W[U], J = _(K);
|
|
3741
|
+
if (J !== "object")
|
|
3742
|
+
return new v("Invalid " + G + " `" + Y + "` of type " + ("`" + J + "` supplied to `" + j + "`, expected an object."));
|
|
3743
|
+
for (var Z in K)
|
|
3744
|
+
if (o(K, Z)) {
|
|
3745
|
+
var D = y(K, Z, j, G, Y + "." + Z, t);
|
|
3743
3746
|
if (D instanceof Error)
|
|
3744
3747
|
return D;
|
|
3745
3748
|
}
|
|
3746
3749
|
return null;
|
|
3747
3750
|
}
|
|
3748
|
-
return S(
|
|
3751
|
+
return S(L);
|
|
3749
3752
|
}
|
|
3750
3753
|
function $(y) {
|
|
3751
3754
|
if (!Array.isArray(y))
|
|
3752
3755
|
return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), a;
|
|
3753
|
-
for (var
|
|
3754
|
-
var
|
|
3755
|
-
if (typeof
|
|
3756
|
+
for (var L = 0; L < y.length; L++) {
|
|
3757
|
+
var W = y[L];
|
|
3758
|
+
if (typeof W != "function")
|
|
3756
3759
|
return s(
|
|
3757
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " +
|
|
3760
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + se(W) + " at index " + L + "."
|
|
3758
3761
|
), a;
|
|
3759
3762
|
}
|
|
3760
|
-
function U(j,
|
|
3763
|
+
function U(j, G, Y, K, J) {
|
|
3761
3764
|
for (var Z = [], D = 0; D < y.length; D++) {
|
|
3762
|
-
var
|
|
3763
|
-
if (
|
|
3765
|
+
var oe = y[D], A = oe(j, G, Y, K, J, t);
|
|
3766
|
+
if (A == null)
|
|
3764
3767
|
return null;
|
|
3765
|
-
|
|
3768
|
+
A.data && o(A.data, "expectedType") && Z.push(A.data.expectedType);
|
|
3766
3769
|
}
|
|
3767
|
-
var
|
|
3768
|
-
return new v("Invalid " +
|
|
3770
|
+
var re = Z.length > 0 ? ", expected one of type [" + Z.join(", ") + "]" : "";
|
|
3771
|
+
return new v("Invalid " + K + " `" + J + "` supplied to " + ("`" + Y + "`" + re + "."));
|
|
3769
3772
|
}
|
|
3770
3773
|
return S(U);
|
|
3771
3774
|
}
|
|
3772
|
-
function
|
|
3773
|
-
function y(
|
|
3774
|
-
return
|
|
3775
|
+
function x() {
|
|
3776
|
+
function y(L, W, U, j, G) {
|
|
3777
|
+
return R(L[W]) ? null : new v("Invalid " + j + " `" + G + "` supplied to " + ("`" + U + "`, expected a ReactNode."));
|
|
3775
3778
|
}
|
|
3776
3779
|
return S(y);
|
|
3777
3780
|
}
|
|
3778
|
-
function
|
|
3781
|
+
function C(y, L, W, U, j) {
|
|
3779
3782
|
return new v(
|
|
3780
|
-
(y || "React class") + ": " +
|
|
3783
|
+
(y || "React class") + ": " + L + " type `" + W + "." + U + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + j + "`."
|
|
3781
3784
|
);
|
|
3782
3785
|
}
|
|
3783
|
-
function
|
|
3784
|
-
function
|
|
3785
|
-
var
|
|
3786
|
-
if (
|
|
3787
|
-
return new v("Invalid " +
|
|
3786
|
+
function E(y) {
|
|
3787
|
+
function L(W, U, j, G, Y) {
|
|
3788
|
+
var K = W[U], J = _(K);
|
|
3789
|
+
if (J !== "object")
|
|
3790
|
+
return new v("Invalid " + G + " `" + Y + "` of type `" + J + "` " + ("supplied to `" + j + "`, expected `object`."));
|
|
3788
3791
|
for (var Z in y) {
|
|
3789
3792
|
var D = y[Z];
|
|
3790
3793
|
if (typeof D != "function")
|
|
3791
|
-
return
|
|
3792
|
-
var
|
|
3793
|
-
if (
|
|
3794
|
-
return
|
|
3794
|
+
return C(j, G, Y, Z, ee(D));
|
|
3795
|
+
var oe = D(K, Z, j, G, Y + "." + Z, t);
|
|
3796
|
+
if (oe)
|
|
3797
|
+
return oe;
|
|
3795
3798
|
}
|
|
3796
3799
|
return null;
|
|
3797
3800
|
}
|
|
3798
|
-
return S(
|
|
3801
|
+
return S(L);
|
|
3799
3802
|
}
|
|
3800
|
-
function
|
|
3801
|
-
function
|
|
3802
|
-
var
|
|
3803
|
-
if (
|
|
3804
|
-
return new v("Invalid " +
|
|
3805
|
-
var Z = e({},
|
|
3803
|
+
function T(y) {
|
|
3804
|
+
function L(W, U, j, G, Y) {
|
|
3805
|
+
var K = W[U], J = _(K);
|
|
3806
|
+
if (J !== "object")
|
|
3807
|
+
return new v("Invalid " + G + " `" + Y + "` of type `" + J + "` " + ("supplied to `" + j + "`, expected `object`."));
|
|
3808
|
+
var Z = e({}, W[U], y);
|
|
3806
3809
|
for (var D in Z) {
|
|
3807
|
-
var
|
|
3808
|
-
if (o(y, D) && typeof
|
|
3809
|
-
return
|
|
3810
|
-
if (!
|
|
3810
|
+
var oe = y[D];
|
|
3811
|
+
if (o(y, D) && typeof oe != "function")
|
|
3812
|
+
return C(j, G, Y, D, ee(oe));
|
|
3813
|
+
if (!oe)
|
|
3811
3814
|
return new v(
|
|
3812
|
-
"Invalid " +
|
|
3815
|
+
"Invalid " + G + " `" + Y + "` key `" + D + "` supplied to `" + j + "`.\nBad object: " + JSON.stringify(W[U], null, " ") + `
|
|
3813
3816
|
Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
|
|
3814
3817
|
);
|
|
3815
|
-
var
|
|
3816
|
-
if (
|
|
3817
|
-
return
|
|
3818
|
+
var A = oe(K, D, j, G, Y + "." + D, t);
|
|
3819
|
+
if (A)
|
|
3820
|
+
return A;
|
|
3818
3821
|
}
|
|
3819
3822
|
return null;
|
|
3820
3823
|
}
|
|
3821
|
-
return S(
|
|
3824
|
+
return S(L);
|
|
3822
3825
|
}
|
|
3823
|
-
function
|
|
3826
|
+
function R(y) {
|
|
3824
3827
|
switch (typeof y) {
|
|
3825
3828
|
case "number":
|
|
3826
3829
|
case "string":
|
|
@@ -3830,20 +3833,20 @@ Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
|
|
|
3830
3833
|
return !y;
|
|
3831
3834
|
case "object":
|
|
3832
3835
|
if (Array.isArray(y))
|
|
3833
|
-
return y.every(
|
|
3836
|
+
return y.every(R);
|
|
3834
3837
|
if (y === null || l(y))
|
|
3835
3838
|
return !0;
|
|
3836
|
-
var
|
|
3837
|
-
if (
|
|
3838
|
-
var
|
|
3839
|
-
if (
|
|
3840
|
-
for (; !(U =
|
|
3841
|
-
if (!
|
|
3839
|
+
var L = p(y);
|
|
3840
|
+
if (L) {
|
|
3841
|
+
var W = L.call(y), U;
|
|
3842
|
+
if (L !== y.entries) {
|
|
3843
|
+
for (; !(U = W.next()).done; )
|
|
3844
|
+
if (!R(U.value))
|
|
3842
3845
|
return !1;
|
|
3843
3846
|
} else
|
|
3844
|
-
for (; !(U =
|
|
3847
|
+
for (; !(U = W.next()).done; ) {
|
|
3845
3848
|
var j = U.value;
|
|
3846
|
-
if (j && !
|
|
3849
|
+
if (j && !R(j[1]))
|
|
3847
3850
|
return !1;
|
|
3848
3851
|
}
|
|
3849
3852
|
} else
|
|
@@ -3853,41 +3856,41 @@ Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
|
|
|
3853
3856
|
return !1;
|
|
3854
3857
|
}
|
|
3855
3858
|
}
|
|
3856
|
-
function
|
|
3857
|
-
return y === "symbol" ? !0 :
|
|
3859
|
+
function V(y, L) {
|
|
3860
|
+
return y === "symbol" ? !0 : L ? L["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && L instanceof Symbol : !1;
|
|
3858
3861
|
}
|
|
3859
|
-
function
|
|
3860
|
-
var
|
|
3861
|
-
return Array.isArray(y) ? "array" : y instanceof RegExp ? "object" :
|
|
3862
|
+
function _(y) {
|
|
3863
|
+
var L = typeof y;
|
|
3864
|
+
return Array.isArray(y) ? "array" : y instanceof RegExp ? "object" : V(L, y) ? "symbol" : L;
|
|
3862
3865
|
}
|
|
3863
|
-
function
|
|
3866
|
+
function ee(y) {
|
|
3864
3867
|
if (typeof y > "u" || y === null)
|
|
3865
3868
|
return "" + y;
|
|
3866
|
-
var
|
|
3867
|
-
if (
|
|
3869
|
+
var L = _(y);
|
|
3870
|
+
if (L === "object") {
|
|
3868
3871
|
if (y instanceof Date)
|
|
3869
3872
|
return "date";
|
|
3870
3873
|
if (y instanceof RegExp)
|
|
3871
3874
|
return "regexp";
|
|
3872
3875
|
}
|
|
3873
|
-
return
|
|
3876
|
+
return L;
|
|
3874
3877
|
}
|
|
3875
|
-
function
|
|
3876
|
-
var
|
|
3877
|
-
switch (
|
|
3878
|
+
function se(y) {
|
|
3879
|
+
var L = ee(y);
|
|
3880
|
+
switch (L) {
|
|
3878
3881
|
case "array":
|
|
3879
3882
|
case "object":
|
|
3880
|
-
return "an " +
|
|
3883
|
+
return "an " + L;
|
|
3881
3884
|
case "boolean":
|
|
3882
3885
|
case "date":
|
|
3883
3886
|
case "regexp":
|
|
3884
|
-
return "a " +
|
|
3887
|
+
return "a " + L;
|
|
3885
3888
|
default:
|
|
3886
|
-
return
|
|
3889
|
+
return L;
|
|
3887
3890
|
}
|
|
3888
3891
|
}
|
|
3889
|
-
function
|
|
3890
|
-
return !y.constructor || !y.constructor.name ?
|
|
3892
|
+
function q(y) {
|
|
3893
|
+
return !y.constructor || !y.constructor.name ? f : y.constructor.name;
|
|
3891
3894
|
}
|
|
3892
3895
|
return h.checkPropTypes = i, h.resetWarningCache = i.resetWarningCache, h.PropTypes = h, h;
|
|
3893
3896
|
}, rt;
|
|
@@ -3902,12 +3905,12 @@ function A$() {
|
|
|
3902
3905
|
function t() {
|
|
3903
3906
|
}
|
|
3904
3907
|
return t.resetWarningCache = e, lt = function() {
|
|
3905
|
-
function o(a, l, r,
|
|
3906
|
-
if (
|
|
3907
|
-
var
|
|
3908
|
+
function o(a, l, r, c, u, p) {
|
|
3909
|
+
if (p !== n) {
|
|
3910
|
+
var f = new Error(
|
|
3908
3911
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
3909
3912
|
);
|
|
3910
|
-
throw
|
|
3913
|
+
throw f.name = "Invariant Violation", f;
|
|
3911
3914
|
}
|
|
3912
3915
|
}
|
|
3913
3916
|
o.isRequired = o;
|
|
@@ -3959,85 +3962,85 @@ function M$(n) {
|
|
|
3959
3962
|
return H({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, child: [] }, { tag: "path", attr: { d: "M9 4v16" }, child: [] }, { tag: "path", attr: { d: "M14 10l2 2l-2 2" }, child: [] }] })(n);
|
|
3960
3963
|
}
|
|
3961
3964
|
const gt = ({ collapsibleNav: n, isNavigationPaneOpen: e, setNavigationPaneOpen: t }) => {
|
|
3962
|
-
const [o, i] =
|
|
3965
|
+
const [o, i] = M([]), [s, a] = M([]), [l, r] = M([]), [c, u] = M(!1), { currentPath: p, setCurrentPath: f, onFolderChange: h } = he(), m = ae(null), v = ae([]), S = ae(null), F = Oe(() => {
|
|
3963
3966
|
u(!1);
|
|
3964
|
-
}), O =
|
|
3967
|
+
}), O = ce(), N = ae(null);
|
|
3965
3968
|
Q(() => {
|
|
3966
3969
|
i(() => {
|
|
3967
3970
|
let w = "";
|
|
3968
|
-
return
|
|
3971
|
+
return p == null ? void 0 : p.split("/").map(($) => ({
|
|
3969
3972
|
name: $ || O("home"),
|
|
3970
3973
|
path: $ === "" ? $ : w += `/${$}`
|
|
3971
3974
|
}));
|
|
3972
3975
|
}), a([]), r([]);
|
|
3973
|
-
}, [
|
|
3976
|
+
}, [p, O]);
|
|
3974
3977
|
const z = (w) => {
|
|
3975
|
-
|
|
3978
|
+
f(w), h == null || h(w);
|
|
3976
3979
|
}, g = () => {
|
|
3977
|
-
var
|
|
3978
|
-
const w = m.current.clientWidth, $ = getComputedStyle(m.current),
|
|
3979
|
-
return w - (
|
|
3980
|
-
},
|
|
3981
|
-
var
|
|
3982
|
-
const w = g(), $ = v.current.reduce((
|
|
3983
|
-
return w - ($ +
|
|
3984
|
-
},
|
|
3980
|
+
var _;
|
|
3981
|
+
const w = m.current.clientWidth, $ = getComputedStyle(m.current), x = parseFloat($.paddingLeft), C = n ? 2 : 0, T = n ? ((_ = N.current) == null ? void 0 : _.clientWidth) + 1 : 0, R = s.length > 0 ? 1 : 0, V = parseFloat($.gap) * (o.length + R + C);
|
|
3982
|
+
return w - (x + V + T);
|
|
3983
|
+
}, P = () => {
|
|
3984
|
+
var C;
|
|
3985
|
+
const w = g(), $ = v.current.reduce((E, T) => T ? E + T.clientWidth : E, 0), x = ((C = S.current) == null ? void 0 : C.clientWidth) || 0;
|
|
3986
|
+
return w - ($ + x);
|
|
3987
|
+
}, b = () => m.current.scrollWidth > m.current.clientWidth;
|
|
3985
3988
|
return Q(() => {
|
|
3986
3989
|
var w;
|
|
3987
|
-
if (
|
|
3988
|
-
const $ = o[1],
|
|
3989
|
-
r((
|
|
3990
|
-
} else if (s.length > 0 &&
|
|
3990
|
+
if (b()) {
|
|
3991
|
+
const $ = o[1], x = (w = v.current[1]) == null ? void 0 : w.clientWidth;
|
|
3992
|
+
r((C) => [...C, x]), a((C) => [...C, $]), i((C) => C.filter((E, T) => T !== 1));
|
|
3993
|
+
} else if (s.length > 0 && P() > l.at(-1)) {
|
|
3991
3994
|
const $ = [o[0], s.at(-1), ...o.slice(1)];
|
|
3992
|
-
i($), a((
|
|
3995
|
+
i($), a((x) => x.slice(0, -1)), r((x) => x.slice(0, -1));
|
|
3993
3996
|
}
|
|
3994
|
-
}, [
|
|
3995
|
-
/* @__PURE__ */
|
|
3996
|
-
n && /* @__PURE__ */
|
|
3997
|
-
/* @__PURE__ */
|
|
3997
|
+
}, [b]), /* @__PURE__ */ k("div", { className: "bread-crumb-container", children: [
|
|
3998
|
+
/* @__PURE__ */ k("div", { className: "breadcrumb", ref: m, children: [
|
|
3999
|
+
n && /* @__PURE__ */ k(pe, { children: [
|
|
4000
|
+
/* @__PURE__ */ d(
|
|
3998
4001
|
"div",
|
|
3999
4002
|
{
|
|
4000
|
-
ref:
|
|
4003
|
+
ref: N,
|
|
4001
4004
|
className: "nav-toggler",
|
|
4002
4005
|
title: `${O(e ? "collapseNavigationPane" : "expandNavigationPane")}`,
|
|
4003
|
-
children: /* @__PURE__ */
|
|
4006
|
+
children: /* @__PURE__ */ d(
|
|
4004
4007
|
"span",
|
|
4005
4008
|
{
|
|
4006
4009
|
className: "folder-name folder-name-btn",
|
|
4007
4010
|
onClick: () => t((w) => !w),
|
|
4008
|
-
children: e ? /* @__PURE__ */
|
|
4011
|
+
children: e ? /* @__PURE__ */ d(O$, {}) : /* @__PURE__ */ d(M$, {})
|
|
4009
4012
|
}
|
|
4010
4013
|
)
|
|
4011
4014
|
}
|
|
4012
4015
|
),
|
|
4013
|
-
/* @__PURE__ */
|
|
4016
|
+
/* @__PURE__ */ d("div", { className: "divider" })
|
|
4014
4017
|
] }),
|
|
4015
|
-
o.map((w, $) => /* @__PURE__ */
|
|
4016
|
-
/* @__PURE__ */
|
|
4018
|
+
o.map((w, $) => /* @__PURE__ */ k("div", { style: { display: "contents" }, children: [
|
|
4019
|
+
/* @__PURE__ */ k(
|
|
4017
4020
|
"span",
|
|
4018
4021
|
{
|
|
4019
4022
|
className: "folder-name",
|
|
4020
4023
|
onClick: () => z(w.path),
|
|
4021
|
-
ref: (
|
|
4024
|
+
ref: (x) => v.current[$] = x,
|
|
4022
4025
|
children: [
|
|
4023
|
-
$ === 0 ? /* @__PURE__ */
|
|
4026
|
+
$ === 0 ? /* @__PURE__ */ d(Qn, {}) : /* @__PURE__ */ d(io, {}),
|
|
4024
4027
|
w.name
|
|
4025
4028
|
]
|
|
4026
4029
|
}
|
|
4027
4030
|
),
|
|
4028
|
-
(s == null ? void 0 : s.length) > 0 && $ === 0 && /* @__PURE__ */
|
|
4031
|
+
(s == null ? void 0 : s.length) > 0 && $ === 0 && /* @__PURE__ */ d(
|
|
4029
4032
|
"button",
|
|
4030
4033
|
{
|
|
4031
4034
|
className: "folder-name folder-name-btn",
|
|
4032
4035
|
onClick: () => u(!0),
|
|
4033
4036
|
ref: S,
|
|
4034
4037
|
title: O("showMoreFolder"),
|
|
4035
|
-
children: /* @__PURE__ */
|
|
4038
|
+
children: /* @__PURE__ */ d(oo, { size: 22, className: "hidden-folders" })
|
|
4036
4039
|
}
|
|
4037
4040
|
)
|
|
4038
4041
|
] }, $))
|
|
4039
4042
|
] }),
|
|
4040
|
-
|
|
4043
|
+
c && /* @__PURE__ */ d("ul", { ref: F.ref, className: "hidden-folders-container", children: s.map((w, $) => /* @__PURE__ */ d(
|
|
4041
4044
|
"li",
|
|
4042
4045
|
{
|
|
4043
4046
|
onClick: () => {
|
|
@@ -4055,57 +4058,57 @@ gt.propTypes = {
|
|
|
4055
4058
|
setNavigationPaneOpen: I.func.isRequired
|
|
4056
4059
|
};
|
|
4057
4060
|
const _e = (n) => ({
|
|
4058
|
-
pdf: /* @__PURE__ */
|
|
4059
|
-
jpg: /* @__PURE__ */
|
|
4060
|
-
jpeg: /* @__PURE__ */
|
|
4061
|
-
png: /* @__PURE__ */
|
|
4062
|
-
txt: /* @__PURE__ */
|
|
4063
|
-
doc: /* @__PURE__ */
|
|
4064
|
-
docx: /* @__PURE__ */
|
|
4065
|
-
mp4: /* @__PURE__ */
|
|
4066
|
-
webm: /* @__PURE__ */
|
|
4067
|
-
mp3: /* @__PURE__ */
|
|
4068
|
-
m4a: /* @__PURE__ */
|
|
4069
|
-
zip: /* @__PURE__ */
|
|
4070
|
-
ppt: /* @__PURE__ */
|
|
4071
|
-
pptx: /* @__PURE__ */
|
|
4072
|
-
xls: /* @__PURE__ */
|
|
4073
|
-
xlsx: /* @__PURE__ */
|
|
4074
|
-
exe: /* @__PURE__ */
|
|
4075
|
-
html: /* @__PURE__ */
|
|
4076
|
-
css: /* @__PURE__ */
|
|
4077
|
-
js: /* @__PURE__ */
|
|
4078
|
-
php: /* @__PURE__ */
|
|
4079
|
-
py: /* @__PURE__ */
|
|
4080
|
-
java: /* @__PURE__ */
|
|
4081
|
-
cpp: /* @__PURE__ */
|
|
4082
|
-
c: /* @__PURE__ */
|
|
4083
|
-
ts: /* @__PURE__ */
|
|
4084
|
-
jsx: /* @__PURE__ */
|
|
4085
|
-
tsx: /* @__PURE__ */
|
|
4086
|
-
json: /* @__PURE__ */
|
|
4087
|
-
xml: /* @__PURE__ */
|
|
4088
|
-
sql: /* @__PURE__ */
|
|
4089
|
-
csv: /* @__PURE__ */
|
|
4090
|
-
md: /* @__PURE__ */
|
|
4091
|
-
svg: /* @__PURE__ */
|
|
4061
|
+
pdf: /* @__PURE__ */ d(co, { size: n }),
|
|
4062
|
+
jpg: /* @__PURE__ */ d(et, { size: n }),
|
|
4063
|
+
jpeg: /* @__PURE__ */ d(et, { size: n }),
|
|
4064
|
+
png: /* @__PURE__ */ d(et, { size: n }),
|
|
4065
|
+
txt: /* @__PURE__ */ d(lo, { size: n }),
|
|
4066
|
+
doc: /* @__PURE__ */ d(Et, { size: n }),
|
|
4067
|
+
docx: /* @__PURE__ */ d(Et, { size: n }),
|
|
4068
|
+
mp4: /* @__PURE__ */ d(Nt, { size: n }),
|
|
4069
|
+
webm: /* @__PURE__ */ d(Nt, { size: n }),
|
|
4070
|
+
mp3: /* @__PURE__ */ d(Ct, { size: n }),
|
|
4071
|
+
m4a: /* @__PURE__ */ d(Ct, { size: n }),
|
|
4072
|
+
zip: /* @__PURE__ */ d(uo, { size: n }),
|
|
4073
|
+
ppt: /* @__PURE__ */ d(Ft, { size: n }),
|
|
4074
|
+
pptx: /* @__PURE__ */ d(Ft, { size: n }),
|
|
4075
|
+
xls: /* @__PURE__ */ d(St, { size: n }),
|
|
4076
|
+
xlsx: /* @__PURE__ */ d(St, { size: n }),
|
|
4077
|
+
exe: /* @__PURE__ */ d(ro, { size: n }),
|
|
4078
|
+
html: /* @__PURE__ */ d(le, { size: n }),
|
|
4079
|
+
css: /* @__PURE__ */ d(le, { size: n }),
|
|
4080
|
+
js: /* @__PURE__ */ d(le, { size: n }),
|
|
4081
|
+
php: /* @__PURE__ */ d(le, { size: n }),
|
|
4082
|
+
py: /* @__PURE__ */ d(le, { size: n }),
|
|
4083
|
+
java: /* @__PURE__ */ d(le, { size: n }),
|
|
4084
|
+
cpp: /* @__PURE__ */ d(le, { size: n }),
|
|
4085
|
+
c: /* @__PURE__ */ d(le, { size: n }),
|
|
4086
|
+
ts: /* @__PURE__ */ d(le, { size: n }),
|
|
4087
|
+
jsx: /* @__PURE__ */ d(le, { size: n }),
|
|
4088
|
+
tsx: /* @__PURE__ */ d(le, { size: n }),
|
|
4089
|
+
json: /* @__PURE__ */ d(le, { size: n }),
|
|
4090
|
+
xml: /* @__PURE__ */ d(le, { size: n }),
|
|
4091
|
+
sql: /* @__PURE__ */ d(le, { size: n }),
|
|
4092
|
+
csv: /* @__PURE__ */ d(le, { size: n }),
|
|
4093
|
+
md: /* @__PURE__ */ d(le, { size: n }),
|
|
4094
|
+
svg: /* @__PURE__ */ d(le, { size: n })
|
|
4092
4095
|
}), Mn = (n, e, t) => {
|
|
4093
4096
|
if (t.find((o) => o.name === n)) {
|
|
4094
4097
|
const o = "", i = n;
|
|
4095
4098
|
let s = 0;
|
|
4096
4099
|
const a = new RegExp(`${i} \\(\\d+\\)`);
|
|
4097
|
-
t.forEach((
|
|
4098
|
-
const u =
|
|
4100
|
+
t.forEach((c) => {
|
|
4101
|
+
const u = c.isDirectory ? c.name : c.name.split(".").slice(0, -1).join(".");
|
|
4099
4102
|
if (a.test(u)) {
|
|
4100
|
-
const
|
|
4101
|
-
!isNaN(
|
|
4103
|
+
const p = u.split(`${i} (`).pop().slice(0, -1), f = parseInt(p);
|
|
4104
|
+
!isNaN(f) && f > s && (s = f);
|
|
4102
4105
|
}
|
|
4103
4106
|
});
|
|
4104
4107
|
const l = ` (${++s})`;
|
|
4105
4108
|
return i + l + o;
|
|
4106
4109
|
} else
|
|
4107
4110
|
return n;
|
|
4108
|
-
}, In = ({ nameInputRef: n, id: e, maxLength: t, value: o, onChange: i, onKeyDown: s, onClick: a, rows: l }) => /* @__PURE__ */
|
|
4111
|
+
}, In = ({ nameInputRef: n, id: e, maxLength: t, value: o, onChange: i, onKeyDown: s, onClick: a, rows: l }) => /* @__PURE__ */ d(
|
|
4109
4112
|
"textarea",
|
|
4110
4113
|
{
|
|
4111
4114
|
ref: n,
|
|
@@ -4118,50 +4121,50 @@ const _e = (n) => ({
|
|
|
4118
4121
|
onClick: a,
|
|
4119
4122
|
rows: l
|
|
4120
4123
|
}
|
|
4121
|
-
), Dn = ({ message: n, xPlacement: e, yPlacement: t }) => /* @__PURE__ */
|
|
4122
|
-
const [i, s] =
|
|
4123
|
-
|
|
4124
|
-
}), { currentFolder: v, currentPathFiles: S, setCurrentPathFiles:
|
|
4125
|
-
s(
|
|
4126
|
-
}, g = (
|
|
4127
|
-
if (
|
|
4128
|
-
|
|
4124
|
+
), Dn = ({ message: n, xPlacement: e, yPlacement: t }) => /* @__PURE__ */ d("p", { className: `error-tooltip ${e} ${t}`, children: n }), I$ = 220, D$ = ({ filesViewRef: n, file: e, onCreateFolder: t, triggerAction: o }) => {
|
|
4125
|
+
const [i, s] = M(e.name), [a, l] = M(!1), [r, c] = M(""), [u, p] = M("right"), [f, h] = M("bottom"), m = Oe((b) => {
|
|
4126
|
+
b.preventDefault(), b.stopPropagation();
|
|
4127
|
+
}), { currentFolder: v, currentPathFiles: S, setCurrentPathFiles: F } = he(), { activeLayout: O } = we(), N = ce(), z = (b) => {
|
|
4128
|
+
s(b.target.value), l(!1);
|
|
4129
|
+
}, g = (b) => {
|
|
4130
|
+
if (b.stopPropagation(), b.key === "Enter") {
|
|
4131
|
+
b.preventDefault(), P();
|
|
4129
4132
|
return;
|
|
4130
4133
|
}
|
|
4131
|
-
if (
|
|
4132
|
-
|
|
4134
|
+
if (b.key === "Escape") {
|
|
4135
|
+
b.preventDefault(), o.close(), F(($) => $.filter((x) => x.key !== e.key));
|
|
4133
4136
|
return;
|
|
4134
4137
|
}
|
|
4135
|
-
/[\\/:*?"<>|]/.test(
|
|
4138
|
+
/[\\/:*?"<>|]/.test(b.key) ? (b.preventDefault(), c(N("invalidFileName")), l(!0)) : (l(!1), c(""));
|
|
4136
4139
|
};
|
|
4137
4140
|
Q(() => {
|
|
4138
4141
|
if (a) {
|
|
4139
|
-
const
|
|
4140
|
-
l(!1),
|
|
4142
|
+
const b = setTimeout(() => {
|
|
4143
|
+
l(!1), c("");
|
|
4141
4144
|
}, 7e3);
|
|
4142
|
-
return () => clearTimeout(
|
|
4145
|
+
return () => clearTimeout(b);
|
|
4143
4146
|
}
|
|
4144
4147
|
}, [a]);
|
|
4145
|
-
function
|
|
4146
|
-
var
|
|
4147
|
-
let
|
|
4148
|
-
const w = S.filter((
|
|
4149
|
-
if (w.find((
|
|
4150
|
-
|
|
4148
|
+
function P() {
|
|
4149
|
+
var x, C;
|
|
4150
|
+
let b = i.trim();
|
|
4151
|
+
const w = S.filter((E) => !(E.key && E.key === e.key));
|
|
4152
|
+
if (w.find((E) => E.name.toLowerCase() === b.toLowerCase())) {
|
|
4153
|
+
c(N("folderExists", { renameFile: b })), l(!0), (x = m.ref.current) == null || x.focus(), (C = m.ref.current) == null || C.select(), m.setIsClicked(!1);
|
|
4151
4154
|
return;
|
|
4152
4155
|
}
|
|
4153
|
-
|
|
4156
|
+
b === "" && (b = Mn("New Folder", !0, w)), xe(t, "onCreateFolder", b, v), F((E) => E.filter((T) => T.key !== e.key)), o.close();
|
|
4154
4157
|
}
|
|
4155
4158
|
return Q(() => {
|
|
4156
|
-
var
|
|
4157
|
-
if ((
|
|
4158
|
-
const
|
|
4159
|
-
|
|
4159
|
+
var b, w, $;
|
|
4160
|
+
if ((b = m.ref.current) == null || b.focus(), (w = m.ref.current) == null || w.select(), ($ = m.ref) != null && $.current) {
|
|
4161
|
+
const T = n.current.getBoundingClientRect(), R = m.ref.current, V = R.getBoundingClientRect();
|
|
4162
|
+
T.right - V.left > 313 ? p("right") : p("left"), T.bottom - (V.top + R.clientHeight) > 88 ? h("bottom") : h("top");
|
|
4160
4163
|
}
|
|
4161
4164
|
}, []), Q(() => {
|
|
4162
|
-
m.isClicked &&
|
|
4163
|
-
}, [m.isClicked]), /* @__PURE__ */
|
|
4164
|
-
/* @__PURE__ */
|
|
4165
|
+
m.isClicked && P();
|
|
4166
|
+
}, [m.isClicked]), /* @__PURE__ */ k(pe, { children: [
|
|
4167
|
+
/* @__PURE__ */ d(
|
|
4165
4168
|
In,
|
|
4166
4169
|
{
|
|
4167
4170
|
id: "newFolder",
|
|
@@ -4170,20 +4173,20 @@ const _e = (n) => ({
|
|
|
4170
4173
|
value: i,
|
|
4171
4174
|
onChange: z,
|
|
4172
4175
|
onKeyDown: g,
|
|
4173
|
-
onClick: (
|
|
4176
|
+
onClick: (b) => b.stopPropagation(),
|
|
4174
4177
|
...O === "list" && { rows: 1 }
|
|
4175
4178
|
}
|
|
4176
4179
|
),
|
|
4177
|
-
a && /* @__PURE__ */
|
|
4180
|
+
a && /* @__PURE__ */ d(
|
|
4178
4181
|
Dn,
|
|
4179
4182
|
{
|
|
4180
4183
|
message: r,
|
|
4181
4184
|
xPlacement: u,
|
|
4182
|
-
yPlacement:
|
|
4185
|
+
yPlacement: f
|
|
4183
4186
|
}
|
|
4184
4187
|
)
|
|
4185
4188
|
] });
|
|
4186
|
-
}, Ee = ({ onClick: n, onKeyDown: e, type: t = "primary", padding: o = "0.4rem 0.8rem", children: i }) => /* @__PURE__ */
|
|
4189
|
+
}, Ee = ({ onClick: n, onKeyDown: e, type: t = "primary", padding: o = "0.4rem 0.8rem", children: i }) => /* @__PURE__ */ d(
|
|
4187
4190
|
"button",
|
|
4188
4191
|
{
|
|
4189
4192
|
onClick: n,
|
|
@@ -4205,22 +4208,22 @@ const Un = ({
|
|
|
4205
4208
|
contentClassName: s = "",
|
|
4206
4209
|
closeButton: a = !0
|
|
4207
4210
|
}) => {
|
|
4208
|
-
const l =
|
|
4211
|
+
const l = ae(null), r = ce(), c = (u) => {
|
|
4209
4212
|
u.key === "Escape" && t(!1);
|
|
4210
4213
|
};
|
|
4211
4214
|
return Q(() => {
|
|
4212
4215
|
e ? l.current.showModal() : l.current.close();
|
|
4213
|
-
}, [e]), /* @__PURE__ */
|
|
4216
|
+
}, [e]), /* @__PURE__ */ k(
|
|
4214
4217
|
"dialog",
|
|
4215
4218
|
{
|
|
4216
4219
|
ref: l,
|
|
4217
4220
|
className: "fm-modal dialog",
|
|
4218
4221
|
style: { width: i },
|
|
4219
|
-
onKeyDown:
|
|
4222
|
+
onKeyDown: c,
|
|
4220
4223
|
children: [
|
|
4221
|
-
/* @__PURE__ */
|
|
4222
|
-
/* @__PURE__ */
|
|
4223
|
-
a && /* @__PURE__ */
|
|
4224
|
+
/* @__PURE__ */ k("div", { className: "fm-modal-header", children: [
|
|
4225
|
+
/* @__PURE__ */ d("span", { className: "fm-modal-heading", children: o }),
|
|
4226
|
+
a && /* @__PURE__ */ d(
|
|
4224
4227
|
no,
|
|
4225
4228
|
{
|
|
4226
4229
|
size: 18,
|
|
@@ -4235,67 +4238,67 @@ const Un = ({
|
|
|
4235
4238
|
}
|
|
4236
4239
|
);
|
|
4237
4240
|
}, Ne = (n) => n.split(".").pop(), j$ = 220, H$ = ({ filesViewRef: n, file: e, onRename: t, triggerAction: o }) => {
|
|
4238
|
-
const [i, s] =
|
|
4239
|
-
var
|
|
4240
|
-
(
|
|
4241
|
-
}),
|
|
4241
|
+
const [i, s] = M(e == null ? void 0 : e.name), [a, l] = M(!1), [r, c] = M(!1), [u, p] = M(""), [f, h] = M("right"), [m, v] = M("bottom"), { currentPathFiles: S, setCurrentPathFiles: F } = he(), { activeLayout: O } = we(), N = ce(), z = ae(null), g = Oe(($) => {
|
|
4242
|
+
var x;
|
|
4243
|
+
(x = z.current) != null && x.contains($.target) || ($.preventDefault(), $.stopPropagation());
|
|
4244
|
+
}), P = ($) => {
|
|
4242
4245
|
if ($.stopPropagation(), $.key === "Enter") {
|
|
4243
4246
|
$.preventDefault(), g.setIsClicked(!0);
|
|
4244
4247
|
return;
|
|
4245
4248
|
}
|
|
4246
4249
|
if ($.key === "Escape") {
|
|
4247
|
-
$.preventDefault(),
|
|
4248
|
-
(
|
|
4250
|
+
$.preventDefault(), F(
|
|
4251
|
+
(C) => C.map((E) => (E.key === e.key && (E.isEditing = !1), E))
|
|
4249
4252
|
), o.close();
|
|
4250
4253
|
return;
|
|
4251
4254
|
}
|
|
4252
|
-
/[\\/:*?"<>|]/.test($.key) ? ($.preventDefault(),
|
|
4255
|
+
/[\\/:*?"<>|]/.test($.key) ? ($.preventDefault(), p(N("invalidFileName")), c(!0)) : c(!1);
|
|
4253
4256
|
};
|
|
4254
4257
|
Q(() => {
|
|
4255
4258
|
if (r) {
|
|
4256
4259
|
const $ = setTimeout(() => {
|
|
4257
|
-
|
|
4260
|
+
c(!1), p("");
|
|
4258
4261
|
}, 7e3);
|
|
4259
4262
|
return () => clearTimeout($);
|
|
4260
4263
|
}
|
|
4261
4264
|
}, [r]);
|
|
4262
|
-
function
|
|
4265
|
+
function b($) {
|
|
4263
4266
|
if (i === "" || i === e.name) {
|
|
4264
|
-
|
|
4265
|
-
(
|
|
4267
|
+
F(
|
|
4268
|
+
(x) => x.map((C) => (C.key === e.key && (C.isEditing = !1), C))
|
|
4266
4269
|
), o.close();
|
|
4267
4270
|
return;
|
|
4268
|
-
} else if (S.some((
|
|
4269
|
-
|
|
4271
|
+
} else if (S.some((x) => x.name === i)) {
|
|
4272
|
+
c(!0), p(N("folderExists", { renameFile: i })), g.setIsClicked(!1);
|
|
4270
4273
|
return;
|
|
4271
4274
|
} else if (!e.isDirectory && !$) {
|
|
4272
|
-
const
|
|
4273
|
-
if (
|
|
4275
|
+
const x = Ne(e.name), C = Ne(i);
|
|
4276
|
+
if (x !== C) {
|
|
4274
4277
|
l(!0);
|
|
4275
4278
|
return;
|
|
4276
4279
|
}
|
|
4277
4280
|
}
|
|
4278
|
-
|
|
4281
|
+
c(!1), xe(t, "onRename", e, i), F((x) => x.filter((C) => C.key !== e.key)), o.close();
|
|
4279
4282
|
}
|
|
4280
4283
|
const w = () => {
|
|
4281
|
-
var $, C,
|
|
4282
|
-
if ((
|
|
4283
|
-
(
|
|
4284
|
+
var $, x, C, E, T, R;
|
|
4285
|
+
if ((x = ($ = g.ref) == null ? void 0 : $.current) == null || x.focus(), e.isDirectory)
|
|
4286
|
+
(E = (C = g.ref) == null ? void 0 : C.current) == null || E.select();
|
|
4284
4287
|
else {
|
|
4285
|
-
const
|
|
4286
|
-
(
|
|
4288
|
+
const V = Ne(e.name), _ = e.name.length - V.length - 1;
|
|
4289
|
+
(R = (T = g.ref) == null ? void 0 : T.current) == null || R.setSelectionRange(0, _);
|
|
4287
4290
|
}
|
|
4288
4291
|
};
|
|
4289
4292
|
return Q(() => {
|
|
4290
4293
|
var $;
|
|
4291
4294
|
if (w(), ($ = g.ref) != null && $.current) {
|
|
4292
|
-
const
|
|
4293
|
-
|
|
4295
|
+
const T = n.current.getBoundingClientRect(), R = g.ref.current, V = R.getBoundingClientRect();
|
|
4296
|
+
T.right - V.left > 313 ? h("right") : h("left"), T.bottom - (V.top + R.clientHeight) > 88 ? v("bottom") : v("top");
|
|
4294
4297
|
}
|
|
4295
4298
|
}, []), Q(() => {
|
|
4296
|
-
g.isClicked &&
|
|
4297
|
-
}, [g.isClicked]), /* @__PURE__ */
|
|
4298
|
-
/* @__PURE__ */
|
|
4299
|
+
g.isClicked && b(!1), w();
|
|
4300
|
+
}, [g.isClicked]), /* @__PURE__ */ k(pe, { children: [
|
|
4301
|
+
/* @__PURE__ */ d(
|
|
4299
4302
|
In,
|
|
4300
4303
|
{
|
|
4301
4304
|
id: e.name,
|
|
@@ -4303,55 +4306,55 @@ const Un = ({
|
|
|
4303
4306
|
maxLength: j$,
|
|
4304
4307
|
value: i,
|
|
4305
4308
|
onChange: ($) => {
|
|
4306
|
-
s($.target.value),
|
|
4309
|
+
s($.target.value), c(!1);
|
|
4307
4310
|
},
|
|
4308
|
-
onKeyDown:
|
|
4311
|
+
onKeyDown: P,
|
|
4309
4312
|
onClick: ($) => $.stopPropagation(),
|
|
4310
4313
|
...O === "list" && { rows: 1 }
|
|
4311
4314
|
}
|
|
4312
4315
|
),
|
|
4313
|
-
r && /* @__PURE__ */
|
|
4316
|
+
r && /* @__PURE__ */ d(
|
|
4314
4317
|
Dn,
|
|
4315
4318
|
{
|
|
4316
4319
|
message: u,
|
|
4317
|
-
xPlacement:
|
|
4320
|
+
xPlacement: f,
|
|
4318
4321
|
yPlacement: m
|
|
4319
4322
|
}
|
|
4320
4323
|
),
|
|
4321
|
-
/* @__PURE__ */
|
|
4324
|
+
/* @__PURE__ */ d(
|
|
4322
4325
|
Un,
|
|
4323
4326
|
{
|
|
4324
|
-
heading:
|
|
4327
|
+
heading: N("rename"),
|
|
4325
4328
|
show: a,
|
|
4326
4329
|
setShow: l,
|
|
4327
4330
|
dialogWidth: "25vw",
|
|
4328
4331
|
closeButton: !1,
|
|
4329
|
-
children: /* @__PURE__ */
|
|
4330
|
-
/* @__PURE__ */
|
|
4331
|
-
/* @__PURE__ */
|
|
4332
|
-
/* @__PURE__ */
|
|
4332
|
+
children: /* @__PURE__ */ k("div", { className: "fm-rename-folder-container", ref: z, children: [
|
|
4333
|
+
/* @__PURE__ */ d("div", { className: "fm-rename-folder-input", children: /* @__PURE__ */ k("div", { className: "fm-rename-warning", children: [
|
|
4334
|
+
/* @__PURE__ */ d(U$, { size: 70, color: "orange" }),
|
|
4335
|
+
/* @__PURE__ */ d("div", { children: N("fileNameChangeWarning") })
|
|
4333
4336
|
] }) }),
|
|
4334
|
-
/* @__PURE__ */
|
|
4335
|
-
/* @__PURE__ */
|
|
4337
|
+
/* @__PURE__ */ k("div", { className: "fm-rename-folder-action", children: [
|
|
4338
|
+
/* @__PURE__ */ d(
|
|
4336
4339
|
Ee,
|
|
4337
4340
|
{
|
|
4338
4341
|
type: "secondary",
|
|
4339
4342
|
onClick: () => {
|
|
4340
|
-
|
|
4341
|
-
($) => $.map((
|
|
4343
|
+
F(
|
|
4344
|
+
($) => $.map((x) => (x.key === e.key && (x.isEditing = !1), x))
|
|
4342
4345
|
), l(!1), o.close();
|
|
4343
4346
|
},
|
|
4344
|
-
children:
|
|
4347
|
+
children: N("no")
|
|
4345
4348
|
}
|
|
4346
4349
|
),
|
|
4347
|
-
/* @__PURE__ */
|
|
4350
|
+
/* @__PURE__ */ d(
|
|
4348
4351
|
Ee,
|
|
4349
4352
|
{
|
|
4350
4353
|
type: "danger",
|
|
4351
4354
|
onClick: () => {
|
|
4352
|
-
l(!1),
|
|
4355
|
+
l(!1), b(!0);
|
|
4353
4356
|
},
|
|
4354
|
-
children:
|
|
4357
|
+
children: N("yes")
|
|
4355
4358
|
}
|
|
4356
4359
|
)
|
|
4357
4360
|
] })
|
|
@@ -4368,7 +4371,7 @@ const Un = ({
|
|
|
4368
4371
|
return `${o.toFixed(e)} MB`;
|
|
4369
4372
|
if (o >= 1024)
|
|
4370
4373
|
return `${i.toFixed(e)} GB`;
|
|
4371
|
-
}, jn = ({ name: n, id: e, checked: t, onClick: o, onChange: i, className: s = "", title: a, disabled: l = !1 }) => /* @__PURE__ */
|
|
4374
|
+
}, jn = ({ name: n, id: e, checked: t, onClick: o, onChange: i, className: s = "", title: a, disabled: l = !1 }) => /* @__PURE__ */ d(
|
|
4372
4375
|
"input",
|
|
4373
4376
|
{
|
|
4374
4377
|
className: `fm-checkbox ${s}`,
|
|
@@ -4391,90 +4394,90 @@ const Un = ({
|
|
|
4391
4394
|
filesViewRef: a,
|
|
4392
4395
|
selectedFileIndexes: l,
|
|
4393
4396
|
triggerAction: r,
|
|
4394
|
-
handleContextMenu:
|
|
4397
|
+
handleContextMenu: c,
|
|
4395
4398
|
setLastSelectedFile: u,
|
|
4396
|
-
draggable:
|
|
4397
|
-
formatDate:
|
|
4399
|
+
draggable: p,
|
|
4400
|
+
formatDate: f
|
|
4398
4401
|
}) => {
|
|
4399
|
-
var
|
|
4400
|
-
const [h, m] =
|
|
4401
|
-
s(e), e.isDirectory ? (
|
|
4402
|
-
},
|
|
4402
|
+
var ge, ze, vt, $t;
|
|
4403
|
+
const [h, m] = M(!1), [v, S] = M(0), [F, O] = M("hidden"), [N, z] = M(""), [g, P] = M(null), { activeLayout: b } = we(), w = b === "grid" ? 48 : 20, $ = _e(w), { setCurrentPath: x, currentPathFiles: C, onFolderChange: E } = he(), { setSelectedFiles: T } = $e(), { clipBoard: R, handleCutCopy: V, setClipBoard: _, handlePasting: ee } = Xe(), se = ae(null), q = _e(ct), y = (R == null ? void 0 : R.isMoving) && R.files.find((X) => X.name === e.name && X.path === e.path), L = () => {
|
|
4404
|
+
s(e), e.isDirectory ? (x(e.path), E == null || E(e.path), T([])) : i && r.show("previewFile");
|
|
4405
|
+
}, W = (X, fe) => {
|
|
4403
4406
|
if (l.length > 0 && X) {
|
|
4404
|
-
let
|
|
4407
|
+
let ve = !1, be = l[0], Ce = n;
|
|
4405
4408
|
if (be >= Ce) {
|
|
4406
4409
|
const Bn = be;
|
|
4407
|
-
be = Ce, Ce = Bn,
|
|
4410
|
+
be = Ce, Ce = Bn, ve = !0;
|
|
4408
4411
|
}
|
|
4409
|
-
const yt =
|
|
4410
|
-
|
|
4411
|
-
} else l.length > 0 && fe ?
|
|
4412
|
-
const be =
|
|
4413
|
-
return
|
|
4414
|
-
}) :
|
|
4412
|
+
const yt = C.slice(be, Ce + 1);
|
|
4413
|
+
T(ve ? yt.reverse() : yt);
|
|
4414
|
+
} else l.length > 0 && fe ? T((ve) => {
|
|
4415
|
+
const be = ve.filter((Ce) => Ce.path !== e.path);
|
|
4416
|
+
return ve.length === be.length ? [...ve, e] : be;
|
|
4417
|
+
}) : T([e]);
|
|
4415
4418
|
}, U = (X) => {
|
|
4416
4419
|
if (X.stopPropagation(), e.isEditing) return;
|
|
4417
|
-
|
|
4420
|
+
W(X.shiftKey, X.ctrlKey);
|
|
4418
4421
|
const fe = (/* @__PURE__ */ new Date()).getTime();
|
|
4419
4422
|
if (fe - v < 300) {
|
|
4420
|
-
|
|
4423
|
+
L();
|
|
4421
4424
|
return;
|
|
4422
4425
|
}
|
|
4423
4426
|
S(fe);
|
|
4424
4427
|
}, j = (X) => {
|
|
4425
|
-
X.key === "Enter" && (X.stopPropagation(),
|
|
4426
|
-
},
|
|
4427
|
-
X.stopPropagation(), X.preventDefault(), !e.isEditing && (h ||
|
|
4428
|
-
}, W = () => {
|
|
4429
|
-
O("visible");
|
|
4428
|
+
X.key === "Enter" && (X.stopPropagation(), T([e]), L());
|
|
4429
|
+
}, G = (X) => {
|
|
4430
|
+
X.stopPropagation(), X.preventDefault(), !e.isEditing && (h || T([e]), u(e), c(X, !0));
|
|
4430
4431
|
}, Y = () => {
|
|
4432
|
+
O("visible");
|
|
4433
|
+
}, K = () => {
|
|
4431
4434
|
!h && O("hidden");
|
|
4432
|
-
},
|
|
4433
|
-
X.target.checked ?
|
|
4435
|
+
}, J = (X) => {
|
|
4436
|
+
X.target.checked ? T((fe) => [...fe, e]) : T((fe) => fe.filter((ve) => ve.name !== e.name && ve.path !== e.path)), m(X.target.checked);
|
|
4434
4437
|
}, Z = (X) => {
|
|
4435
|
-
X.dataTransfer.setDragImage(
|
|
4436
|
-
}, D = () =>
|
|
4437
|
-
X.preventDefault(), h || !e.isDirectory ? X.dataTransfer.dropEffect = "none" : (
|
|
4438
|
-
},
|
|
4439
|
-
X.currentTarget.contains(X.relatedTarget) || (z((fe) => fe && ""),
|
|
4440
|
-
},
|
|
4441
|
-
X.preventDefault(), !(h || !e.isDirectory) && (
|
|
4438
|
+
X.dataTransfer.setDragImage(se.current, 30, 50), X.dataTransfer.effectAllowed = "copy", V(!0);
|
|
4439
|
+
}, D = () => _(null), oe = (X) => {
|
|
4440
|
+
X.preventDefault(), h || !e.isDirectory ? X.dataTransfer.dropEffect = "none" : (P({ x: X.clientX, y: X.clientY + 12 }), X.dataTransfer.dropEffect = "copy", z("file-drop-zone"));
|
|
4441
|
+
}, A = (X) => {
|
|
4442
|
+
X.currentTarget.contains(X.relatedTarget) || (z((fe) => fe && ""), P(null));
|
|
4443
|
+
}, re = (X) => {
|
|
4444
|
+
X.preventDefault(), !(h || !e.isDirectory) && (ee(e), z((fe) => fe && ""), P(null));
|
|
4442
4445
|
};
|
|
4443
4446
|
return Q(() => {
|
|
4444
4447
|
m(l.includes(n)), O(l.includes(n) ? "visible" : "hidden");
|
|
4445
|
-
}, [l]), /* @__PURE__ */
|
|
4448
|
+
}, [l]), /* @__PURE__ */ k(
|
|
4446
4449
|
"div",
|
|
4447
4450
|
{
|
|
4448
|
-
className: `file-item-container ${
|
|
4451
|
+
className: `file-item-container ${N} ${h || e.isEditing ? "file-selected" : ""} ${y ? "file-moving" : ""}`,
|
|
4449
4452
|
tabIndex: 0,
|
|
4450
4453
|
title: e.name,
|
|
4451
4454
|
onClick: U,
|
|
4452
4455
|
onKeyDown: j,
|
|
4453
|
-
onContextMenu:
|
|
4454
|
-
onMouseOver:
|
|
4455
|
-
onMouseLeave:
|
|
4456
|
-
draggable: h &&
|
|
4456
|
+
onContextMenu: G,
|
|
4457
|
+
onMouseOver: Y,
|
|
4458
|
+
onMouseLeave: K,
|
|
4459
|
+
draggable: h && p,
|
|
4457
4460
|
onDragStart: Z,
|
|
4458
4461
|
onDragEnd: D,
|
|
4459
|
-
onDragEnter:
|
|
4460
|
-
onDragOver:
|
|
4461
|
-
onDragLeave:
|
|
4462
|
-
onDrop:
|
|
4462
|
+
onDragEnter: oe,
|
|
4463
|
+
onDragOver: oe,
|
|
4464
|
+
onDragLeave: A,
|
|
4465
|
+
onDrop: re,
|
|
4463
4466
|
children: [
|
|
4464
|
-
/* @__PURE__ */
|
|
4465
|
-
!e.isEditing && /* @__PURE__ */
|
|
4467
|
+
/* @__PURE__ */ k("div", { className: "file-item", children: [
|
|
4468
|
+
!e.isEditing && /* @__PURE__ */ d(
|
|
4466
4469
|
jn,
|
|
4467
4470
|
{
|
|
4468
4471
|
name: e.name,
|
|
4469
4472
|
id: e.name,
|
|
4470
4473
|
checked: h,
|
|
4471
|
-
className: `selection-checkbox ${
|
|
4472
|
-
onChange:
|
|
4474
|
+
className: `selection-checkbox ${F}`,
|
|
4475
|
+
onChange: J,
|
|
4473
4476
|
onClick: (X) => X.stopPropagation()
|
|
4474
4477
|
}
|
|
4475
4478
|
),
|
|
4476
|
-
e.isDirectory ? /* @__PURE__ */
|
|
4477
|
-
e.isEditing ? /* @__PURE__ */
|
|
4479
|
+
e.isDirectory ? /* @__PURE__ */ d(Pt, { size: w }) : /* @__PURE__ */ d(pe, { children: $[(ze = (ge = e.name) == null ? void 0 : ge.split(".").pop()) == null ? void 0 : ze.toLowerCase()] ?? /* @__PURE__ */ d(Ve, { size: w }) }),
|
|
4480
|
+
e.isEditing ? /* @__PURE__ */ d("div", { className: `rename-file-container ${b}`, children: r.actionType === "createFolder" ? /* @__PURE__ */ d(
|
|
4478
4481
|
D$,
|
|
4479
4482
|
{
|
|
4480
4483
|
filesViewRef: a,
|
|
@@ -4482,7 +4485,7 @@ const Un = ({
|
|
|
4482
4485
|
onCreateFolder: t,
|
|
4483
4486
|
triggerAction: r
|
|
4484
4487
|
}
|
|
4485
|
-
) : /* @__PURE__ */
|
|
4488
|
+
) : /* @__PURE__ */ d(
|
|
4486
4489
|
H$,
|
|
4487
4490
|
{
|
|
4488
4491
|
filesViewRef: a,
|
|
@@ -4490,13 +4493,13 @@ const Un = ({
|
|
|
4490
4493
|
onRename: o,
|
|
4491
4494
|
triggerAction: r
|
|
4492
4495
|
}
|
|
4493
|
-
) }) : /* @__PURE__ */
|
|
4496
|
+
) }) : /* @__PURE__ */ d("span", { className: "text-truncate file-name", children: e.name })
|
|
4494
4497
|
] }),
|
|
4495
|
-
|
|
4496
|
-
/* @__PURE__ */
|
|
4497
|
-
/* @__PURE__ */
|
|
4498
|
+
b === "list" && /* @__PURE__ */ k(pe, { children: [
|
|
4499
|
+
/* @__PURE__ */ d("div", { className: "modified-date", children: f(e.updatedAt) }),
|
|
4500
|
+
/* @__PURE__ */ d("div", { className: "size", children: (e == null ? void 0 : e.size) > 0 ? Qe(e == null ? void 0 : e.size) : "" })
|
|
4498
4501
|
] }),
|
|
4499
|
-
g && /* @__PURE__ */
|
|
4502
|
+
g && /* @__PURE__ */ k(
|
|
4500
4503
|
"div",
|
|
4501
4504
|
{
|
|
4502
4505
|
style: {
|
|
@@ -4506,69 +4509,69 @@ const Un = ({
|
|
|
4506
4509
|
className: "drag-move-tooltip",
|
|
4507
4510
|
children: [
|
|
4508
4511
|
"Move to ",
|
|
4509
|
-
/* @__PURE__ */
|
|
4512
|
+
/* @__PURE__ */ d("span", { className: "drop-zone-file-name", children: e.name })
|
|
4510
4513
|
]
|
|
4511
4514
|
}
|
|
4512
4515
|
),
|
|
4513
|
-
/* @__PURE__ */
|
|
4516
|
+
/* @__PURE__ */ d("div", { ref: se, className: "drag-icon", children: e.isDirectory ? /* @__PURE__ */ d(Pt, { size: ct }) : /* @__PURE__ */ d(pe, { children: q[($t = (vt = e.name) == null ? void 0 : vt.split(".").pop()) == null ? void 0 : $t.toLowerCase()] ?? /* @__PURE__ */ d(Ve, { size: ct }) }) })
|
|
4514
4517
|
]
|
|
4515
4518
|
}
|
|
4516
4519
|
);
|
|
4517
|
-
}, B$ = ({ subMenuRef: n, list: e, position: t = "right" }) => /* @__PURE__ */
|
|
4518
|
-
/* @__PURE__ */
|
|
4520
|
+
}, B$ = ({ subMenuRef: n, list: e, position: t = "right" }) => /* @__PURE__ */ d("ul", { ref: n, className: `sub-menu ${t}`, children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ k("li", { onClick: o.onClick, children: [
|
|
4521
|
+
/* @__PURE__ */ d("span", { className: "item-selected", children: o.selected && /* @__PURE__ */ d(bn, { size: 13 }) }),
|
|
4519
4522
|
o.icon,
|
|
4520
|
-
/* @__PURE__ */
|
|
4523
|
+
/* @__PURE__ */ d("span", { children: o.title })
|
|
4521
4524
|
] }, o.title)) }), W$ = ({ filesViewRef: n, contextMenuRef: e, menuItems: t, visible: o, clickPosition: i }) => {
|
|
4522
|
-
const [s, a] =
|
|
4523
|
-
const { clickX:
|
|
4524
|
-
|
|
4525
|
-
}, v = (
|
|
4526
|
-
|
|
4527
|
-
}, S = (
|
|
4528
|
-
u(
|
|
4525
|
+
const [s, a] = M(0), [l, r] = M(0), [c, u] = M(null), [p, f] = M("right"), h = ae(null), m = () => {
|
|
4526
|
+
const { clickX: F, clickY: O } = i, N = n.current, z = N.getBoundingClientRect(), g = N.offsetWidth - N.clientWidth, P = e.current.getBoundingClientRect(), b = P.width, w = P.height, $ = F - z.left, x = z.width - ($ + g) > b, C = !x, E = O - z.top, T = z.height - E > w, R = !T;
|
|
4527
|
+
x ? (a(`${$}px`), f("right")) : C && (a(`${$ - b}px`), f("left")), T ? r(`${E + N.scrollTop}px`) : R && r(`${E + N.scrollTop - w}px`);
|
|
4528
|
+
}, v = (F) => {
|
|
4529
|
+
F.preventDefault(), F.stopPropagation();
|
|
4530
|
+
}, S = (F) => {
|
|
4531
|
+
u(F);
|
|
4529
4532
|
};
|
|
4530
4533
|
if (Q(() => {
|
|
4531
4534
|
o && e.current ? m() : (r(0), a(0), u(null));
|
|
4532
4535
|
}, [o]), o)
|
|
4533
|
-
return /* @__PURE__ */
|
|
4536
|
+
return /* @__PURE__ */ d(
|
|
4534
4537
|
"div",
|
|
4535
4538
|
{
|
|
4536
4539
|
ref: e,
|
|
4537
4540
|
onContextMenu: v,
|
|
4538
|
-
onClick: (
|
|
4541
|
+
onClick: (F) => F.stopPropagation(),
|
|
4539
4542
|
className: `fm-context-menu ${l ? "visible" : "hidden"}`,
|
|
4540
4543
|
style: {
|
|
4541
4544
|
top: l,
|
|
4542
4545
|
left: s
|
|
4543
4546
|
},
|
|
4544
|
-
children: /* @__PURE__ */
|
|
4545
|
-
const
|
|
4546
|
-
return /* @__PURE__ */
|
|
4547
|
-
/* @__PURE__ */
|
|
4547
|
+
children: /* @__PURE__ */ d("div", { className: "file-context-menu-list", children: /* @__PURE__ */ d("ul", { children: t.filter((F) => !F.hidden).map((F, O) => {
|
|
4548
|
+
const N = F.hasOwnProperty("children"), z = c === O && N;
|
|
4549
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
4550
|
+
/* @__PURE__ */ k(
|
|
4548
4551
|
"li",
|
|
4549
4552
|
{
|
|
4550
|
-
onClick:
|
|
4551
|
-
className: `${
|
|
4553
|
+
onClick: F.onClick,
|
|
4554
|
+
className: `${F.className ?? ""} ${z ? "active" : ""}`,
|
|
4552
4555
|
onMouseOver: () => S(O),
|
|
4553
4556
|
children: [
|
|
4554
|
-
|
|
4555
|
-
/* @__PURE__ */
|
|
4556
|
-
|
|
4557
|
-
/* @__PURE__ */
|
|
4558
|
-
z && /* @__PURE__ */
|
|
4557
|
+
F.icon,
|
|
4558
|
+
/* @__PURE__ */ d("span", { children: F.title }),
|
|
4559
|
+
N && /* @__PURE__ */ k(pe, { children: [
|
|
4560
|
+
/* @__PURE__ */ d(ao, { size: 14, className: "list-expand-icon" }),
|
|
4561
|
+
z && /* @__PURE__ */ d(
|
|
4559
4562
|
B$,
|
|
4560
4563
|
{
|
|
4561
4564
|
subMenuRef: h,
|
|
4562
|
-
list:
|
|
4563
|
-
position:
|
|
4565
|
+
list: F.children,
|
|
4566
|
+
position: p
|
|
4564
4567
|
}
|
|
4565
4568
|
)
|
|
4566
4569
|
] })
|
|
4567
4570
|
]
|
|
4568
4571
|
}
|
|
4569
4572
|
),
|
|
4570
|
-
|
|
4571
|
-
] },
|
|
4573
|
+
F.divider && O !== t.filter((g) => !g.hidden).length - 1 && /* @__PURE__ */ d("div", { className: "divider" })
|
|
4574
|
+
] }, F.title);
|
|
4572
4575
|
}) }) })
|
|
4573
4576
|
}
|
|
4574
4577
|
);
|
|
@@ -4577,227 +4580,227 @@ function Y$(n) {
|
|
|
4577
4580
|
return H({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z" }, child: [] }] })(n);
|
|
4578
4581
|
}
|
|
4579
4582
|
const K$ = (n, e, t, o, i) => {
|
|
4580
|
-
const [s, a] =
|
|
4581
|
-
i(h), h.isDirectory ? (
|
|
4582
|
-
},
|
|
4583
|
-
|
|
4584
|
-
},
|
|
4583
|
+
const [s, a] = M([]), [l, r] = M(!1), [c, u] = M(!1), [p, f] = M({ clickX: 0, clickY: 0 }), [h, m] = M(null), { clipBoard: v, setClipBoard: S, handleCutCopy: F, handlePasting: O } = Xe(), { selectedFiles: N, setSelectedFiles: z, handleDownload: g } = $e(), { currentPath: P, setCurrentPath: b, currentPathFiles: w, setCurrentPathFiles: $, onFolderChange: x } = he(), { activeLayout: C, setActiveLayout: E } = we(), T = ce(), R = () => {
|
|
4584
|
+
i(h), h.isDirectory ? (b(h.path), x == null || x(h.path), a([]), z([])) : e && t.show("previewFile"), r(!1);
|
|
4585
|
+
}, V = (D) => {
|
|
4586
|
+
F(D), r(!1);
|
|
4587
|
+
}, _ = () => {
|
|
4585
4588
|
O(h), r(!1);
|
|
4586
|
-
},
|
|
4589
|
+
}, ee = () => {
|
|
4587
4590
|
r(!1), t.show("rename");
|
|
4588
|
-
},
|
|
4591
|
+
}, se = () => {
|
|
4589
4592
|
g(), r(!1);
|
|
4590
|
-
},
|
|
4593
|
+
}, q = () => {
|
|
4591
4594
|
r(!1), t.show("delete");
|
|
4592
4595
|
}, y = () => {
|
|
4593
4596
|
r(!1), xe(n, "onRefresh"), S(null);
|
|
4594
|
-
},
|
|
4597
|
+
}, L = () => {
|
|
4595
4598
|
t.show("createFolder"), r(!1);
|
|
4596
|
-
},
|
|
4599
|
+
}, W = () => {
|
|
4597
4600
|
r(!1), t.show("uploadFile");
|
|
4598
4601
|
}, U = () => {
|
|
4599
4602
|
z(w), r(!1);
|
|
4600
4603
|
}, j = [
|
|
4601
4604
|
{
|
|
4602
|
-
title:
|
|
4603
|
-
icon:
|
|
4605
|
+
title: T("view"),
|
|
4606
|
+
icon: C === "grid" ? /* @__PURE__ */ d(xt, { size: 18 }) : /* @__PURE__ */ d(He, { size: 18 }),
|
|
4604
4607
|
onClick: () => {
|
|
4605
4608
|
},
|
|
4606
4609
|
children: [
|
|
4607
4610
|
{
|
|
4608
|
-
title:
|
|
4609
|
-
icon: /* @__PURE__ */
|
|
4610
|
-
selected:
|
|
4611
|
+
title: T("grid"),
|
|
4612
|
+
icon: /* @__PURE__ */ d(xt, { size: 18 }),
|
|
4613
|
+
selected: C === "grid",
|
|
4611
4614
|
onClick: () => {
|
|
4612
|
-
|
|
4615
|
+
E("grid"), r(!1);
|
|
4613
4616
|
}
|
|
4614
4617
|
},
|
|
4615
4618
|
{
|
|
4616
|
-
title:
|
|
4617
|
-
icon: /* @__PURE__ */
|
|
4618
|
-
selected:
|
|
4619
|
+
title: T("list"),
|
|
4620
|
+
icon: /* @__PURE__ */ d(He, { size: 18 }),
|
|
4621
|
+
selected: C === "list",
|
|
4619
4622
|
onClick: () => {
|
|
4620
|
-
|
|
4623
|
+
E("list"), r(!1);
|
|
4621
4624
|
}
|
|
4622
4625
|
}
|
|
4623
4626
|
]
|
|
4624
4627
|
},
|
|
4625
4628
|
{
|
|
4626
|
-
title:
|
|
4627
|
-
icon: /* @__PURE__ */
|
|
4629
|
+
title: T("refresh"),
|
|
4630
|
+
icon: /* @__PURE__ */ d(vn, { size: 18 }),
|
|
4628
4631
|
onClick: y,
|
|
4629
4632
|
divider: !0
|
|
4630
4633
|
},
|
|
4631
4634
|
{
|
|
4632
|
-
title:
|
|
4633
|
-
icon: /* @__PURE__ */
|
|
4634
|
-
onClick:
|
|
4635
|
+
title: T("newFolder"),
|
|
4636
|
+
icon: /* @__PURE__ */ d(hn, { size: 18 }),
|
|
4637
|
+
onClick: L,
|
|
4635
4638
|
hidden: !o.create,
|
|
4636
4639
|
divider: !o.upload
|
|
4637
4640
|
},
|
|
4638
4641
|
{
|
|
4639
|
-
title:
|
|
4640
|
-
icon: /* @__PURE__ */
|
|
4641
|
-
onClick:
|
|
4642
|
+
title: T("upload"),
|
|
4643
|
+
icon: /* @__PURE__ */ d(yn, { size: 18 }),
|
|
4644
|
+
onClick: W,
|
|
4642
4645
|
divider: !0,
|
|
4643
4646
|
hidden: !o.upload
|
|
4644
4647
|
},
|
|
4645
4648
|
{
|
|
4646
|
-
title:
|
|
4647
|
-
icon: /* @__PURE__ */
|
|
4649
|
+
title: T("selectAll"),
|
|
4650
|
+
icon: /* @__PURE__ */ d(so, { size: 18 }),
|
|
4648
4651
|
onClick: U
|
|
4649
4652
|
}
|
|
4650
|
-
],
|
|
4653
|
+
], G = [
|
|
4651
4654
|
{
|
|
4652
|
-
title:
|
|
4653
|
-
icon: h != null && h.isDirectory ? /* @__PURE__ */
|
|
4654
|
-
onClick:
|
|
4655
|
+
title: T("open"),
|
|
4656
|
+
icon: h != null && h.isDirectory ? /* @__PURE__ */ d(Y$, { size: 20 }) : /* @__PURE__ */ d(Ve, { size: 16 }),
|
|
4657
|
+
onClick: R,
|
|
4655
4658
|
divider: !0
|
|
4656
4659
|
},
|
|
4657
4660
|
{
|
|
4658
|
-
title:
|
|
4659
|
-
icon: /* @__PURE__ */
|
|
4660
|
-
onClick: () =>
|
|
4661
|
+
title: T("cut"),
|
|
4662
|
+
icon: /* @__PURE__ */ d(gn, { size: 19 }),
|
|
4663
|
+
onClick: () => V(!0),
|
|
4661
4664
|
divider: !(h != null && h.isDirectory) && !o.copy,
|
|
4662
4665
|
hidden: !o.move
|
|
4663
4666
|
},
|
|
4664
4667
|
{
|
|
4665
|
-
title:
|
|
4666
|
-
icon: /* @__PURE__ */
|
|
4667
|
-
onClick: () =>
|
|
4668
|
+
title: T("copy"),
|
|
4669
|
+
icon: /* @__PURE__ */ d(pn, { strokeWidth: 0.1, size: 17 }),
|
|
4670
|
+
onClick: () => V(!1),
|
|
4668
4671
|
divider: !(h != null && h.isDirectory),
|
|
4669
4672
|
hidden: !o.copy
|
|
4670
4673
|
},
|
|
4671
4674
|
{
|
|
4672
|
-
title:
|
|
4673
|
-
icon: /* @__PURE__ */
|
|
4674
|
-
onClick:
|
|
4675
|
+
title: T("paste"),
|
|
4676
|
+
icon: /* @__PURE__ */ d(ut, { size: 18 }),
|
|
4677
|
+
onClick: _,
|
|
4675
4678
|
className: `${v ? "" : "disable-paste"}`,
|
|
4676
4679
|
hidden: !(h != null && h.isDirectory) || !o.move && !o.copy,
|
|
4677
4680
|
divider: !0
|
|
4678
4681
|
},
|
|
4679
4682
|
{
|
|
4680
|
-
title:
|
|
4681
|
-
icon: /* @__PURE__ */
|
|
4682
|
-
onClick:
|
|
4683
|
-
hidden:
|
|
4683
|
+
title: T("rename"),
|
|
4684
|
+
icon: /* @__PURE__ */ d(wn, { size: 19 }),
|
|
4685
|
+
onClick: ee,
|
|
4686
|
+
hidden: N.length > 1,
|
|
4684
4687
|
hidden: !o.rename
|
|
4685
4688
|
},
|
|
4686
4689
|
{
|
|
4687
|
-
title:
|
|
4688
|
-
icon: /* @__PURE__ */
|
|
4689
|
-
onClick:
|
|
4690
|
+
title: T("download"),
|
|
4691
|
+
icon: /* @__PURE__ */ d(ht, { size: 18 }),
|
|
4692
|
+
onClick: se,
|
|
4690
4693
|
hidden: !o.download
|
|
4691
4694
|
},
|
|
4692
4695
|
{
|
|
4693
|
-
title:
|
|
4694
|
-
icon: /* @__PURE__ */
|
|
4695
|
-
onClick:
|
|
4696
|
+
title: T("delete"),
|
|
4697
|
+
icon: /* @__PURE__ */ d($n, { size: 19 }),
|
|
4698
|
+
onClick: q,
|
|
4696
4699
|
hidden: !o.delete
|
|
4697
4700
|
}
|
|
4698
|
-
],
|
|
4701
|
+
], Y = () => {
|
|
4699
4702
|
$((D) => [
|
|
4700
4703
|
...D,
|
|
4701
4704
|
{
|
|
4702
4705
|
name: Mn("New Folder", !0, D),
|
|
4703
4706
|
isDirectory: !0,
|
|
4704
|
-
path:
|
|
4707
|
+
path: P,
|
|
4705
4708
|
isEditing: !0,
|
|
4706
4709
|
key: (/* @__PURE__ */ new Date()).valueOf()
|
|
4707
4710
|
}
|
|
4708
4711
|
]);
|
|
4709
|
-
},
|
|
4712
|
+
}, K = () => {
|
|
4710
4713
|
$((D) => {
|
|
4711
|
-
const
|
|
4712
|
-
return D[
|
|
4713
|
-
...
|
|
4714
|
+
const oe = s.at(-1);
|
|
4715
|
+
return D[oe] ? D.map((A, re) => re === oe ? {
|
|
4716
|
+
...A,
|
|
4714
4717
|
isEditing: !0
|
|
4715
|
-
} :
|
|
4718
|
+
} : A) : (t.close(), D);
|
|
4716
4719
|
}), a([]), z([]);
|
|
4717
|
-
},
|
|
4720
|
+
}, J = () => {
|
|
4718
4721
|
a([]), z((D) => D.length > 0 ? [] : D);
|
|
4719
|
-
}, Z = (D,
|
|
4720
|
-
D.preventDefault(),
|
|
4722
|
+
}, Z = (D, oe = !1) => {
|
|
4723
|
+
D.preventDefault(), f({ clickX: D.clientX, clickY: D.clientY }), u(oe), !oe && J(), r(!0);
|
|
4721
4724
|
};
|
|
4722
4725
|
return Q(() => {
|
|
4723
4726
|
if (t.isActive)
|
|
4724
4727
|
switch (t.actionType) {
|
|
4725
4728
|
case "createFolder":
|
|
4726
|
-
|
|
4729
|
+
Y();
|
|
4727
4730
|
break;
|
|
4728
4731
|
case "rename":
|
|
4729
|
-
|
|
4732
|
+
K();
|
|
4730
4733
|
break;
|
|
4731
4734
|
}
|
|
4732
4735
|
}, [t.isActive]), Q(() => {
|
|
4733
4736
|
a([]), z([]);
|
|
4734
|
-
}, [
|
|
4735
|
-
|
|
4736
|
-
}, [
|
|
4737
|
+
}, [P]), Q(() => {
|
|
4738
|
+
N.length > 0 ? a(() => N.map((D) => w.findIndex((oe) => oe.path === D.path))) : a([]);
|
|
4739
|
+
}, [N, w]), {
|
|
4737
4740
|
emptySelecCtxItems: j,
|
|
4738
|
-
selecCtxItems:
|
|
4741
|
+
selecCtxItems: G,
|
|
4739
4742
|
handleContextMenu: Z,
|
|
4740
|
-
unselectFiles:
|
|
4743
|
+
unselectFiles: J,
|
|
4741
4744
|
visible: l,
|
|
4742
4745
|
setVisible: r,
|
|
4743
4746
|
setLastSelectedFile: m,
|
|
4744
4747
|
selectedFileIndexes: s,
|
|
4745
|
-
clickPosition:
|
|
4746
|
-
isSelectionCtx:
|
|
4748
|
+
clickPosition: p,
|
|
4749
|
+
isSelectionCtx: c
|
|
4747
4750
|
};
|
|
4748
4751
|
}, q$ = ({ unselectFiles: n, onSort: e, sortConfig: t }) => {
|
|
4749
|
-
const o =
|
|
4750
|
-
|
|
4751
|
-
},
|
|
4752
|
-
e && e(
|
|
4752
|
+
const o = ce(), [i, s] = M(!1), { selectedFiles: a, setSelectedFiles: l } = $e(), { currentPathFiles: r } = he(), c = Ge(() => r.length > 0 && a.length === r.length, [a, r]), u = (f) => {
|
|
4753
|
+
f.target.checked ? (l(r), s(!0)) : n();
|
|
4754
|
+
}, p = (f) => {
|
|
4755
|
+
e && e(f);
|
|
4753
4756
|
};
|
|
4754
|
-
return /* @__PURE__ */
|
|
4757
|
+
return /* @__PURE__ */ k(
|
|
4755
4758
|
"div",
|
|
4756
4759
|
{
|
|
4757
4760
|
className: "files-header",
|
|
4758
4761
|
onMouseOver: () => s(!0),
|
|
4759
4762
|
onMouseLeave: () => s(!1),
|
|
4760
4763
|
children: [
|
|
4761
|
-
/* @__PURE__ */
|
|
4764
|
+
/* @__PURE__ */ d("div", { className: "file-select-all", children: (i || c) && /* @__PURE__ */ d(
|
|
4762
4765
|
jn,
|
|
4763
4766
|
{
|
|
4764
4767
|
id: "selectAll",
|
|
4765
|
-
checked:
|
|
4768
|
+
checked: c,
|
|
4766
4769
|
onChange: u,
|
|
4767
4770
|
title: "Select all",
|
|
4768
4771
|
disabled: r.length === 0
|
|
4769
4772
|
}
|
|
4770
4773
|
) }),
|
|
4771
|
-
/* @__PURE__ */
|
|
4774
|
+
/* @__PURE__ */ k(
|
|
4772
4775
|
"div",
|
|
4773
4776
|
{
|
|
4774
4777
|
className: `file-name ${(t == null ? void 0 : t.key) === "name" ? "active" : ""}`,
|
|
4775
|
-
onClick: () =>
|
|
4778
|
+
onClick: () => p("name"),
|
|
4776
4779
|
children: [
|
|
4777
4780
|
o("name"),
|
|
4778
|
-
(t == null ? void 0 : t.key) === "name" && /* @__PURE__ */
|
|
4781
|
+
(t == null ? void 0 : t.key) === "name" && /* @__PURE__ */ d("span", { className: "sort-indicator", children: t.direction === "asc" ? " ▲" : " ▼" })
|
|
4779
4782
|
]
|
|
4780
4783
|
}
|
|
4781
4784
|
),
|
|
4782
|
-
/* @__PURE__ */
|
|
4785
|
+
/* @__PURE__ */ k(
|
|
4783
4786
|
"div",
|
|
4784
4787
|
{
|
|
4785
4788
|
className: `file-date ${(t == null ? void 0 : t.key) === "modified" ? "active" : ""}`,
|
|
4786
|
-
onClick: () =>
|
|
4789
|
+
onClick: () => p("modified"),
|
|
4787
4790
|
children: [
|
|
4788
4791
|
o("modified"),
|
|
4789
|
-
(t == null ? void 0 : t.key) === "modified" && /* @__PURE__ */
|
|
4792
|
+
(t == null ? void 0 : t.key) === "modified" && /* @__PURE__ */ d("span", { className: "sort-indicator", children: t.direction === "asc" ? " ▲" : " ▼" })
|
|
4790
4793
|
]
|
|
4791
4794
|
}
|
|
4792
4795
|
),
|
|
4793
|
-
/* @__PURE__ */
|
|
4796
|
+
/* @__PURE__ */ k(
|
|
4794
4797
|
"div",
|
|
4795
4798
|
{
|
|
4796
4799
|
className: `file-size ${(t == null ? void 0 : t.key) === "size" ? "active" : ""}`,
|
|
4797
|
-
onClick: () =>
|
|
4800
|
+
onClick: () => p("size"),
|
|
4798
4801
|
children: [
|
|
4799
4802
|
o("size"),
|
|
4800
|
-
(t == null ? void 0 : t.key) === "size" && /* @__PURE__ */
|
|
4803
|
+
(t == null ? void 0 : t.key) === "size" && /* @__PURE__ */ d("span", { className: "sort-indicator", children: t.direction === "asc" ? " ▲" : " ▼" })
|
|
4801
4804
|
]
|
|
4802
4805
|
}
|
|
4803
4806
|
)
|
|
@@ -4805,68 +4808,91 @@ const K$ = (n, e, t, o, i) => {
|
|
|
4805
4808
|
}
|
|
4806
4809
|
);
|
|
4807
4810
|
}, Hn = ({
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4811
|
+
actions: n,
|
|
4812
|
+
onCreateFolder: e,
|
|
4813
|
+
onRename: t,
|
|
4814
|
+
onFileOpen: o,
|
|
4815
|
+
onRefresh: i,
|
|
4816
|
+
enableFilePreview: s,
|
|
4817
|
+
triggerAction: a,
|
|
4818
|
+
permissions: l,
|
|
4819
|
+
formatDate: r
|
|
4816
4820
|
}) => {
|
|
4817
|
-
const { currentPathFiles:
|
|
4818
|
-
emptySelecCtxItems:
|
|
4819
|
-
selecCtxItems:
|
|
4820
|
-
handleContextMenu:
|
|
4821
|
-
unselectFiles:
|
|
4822
|
-
visible:
|
|
4823
|
-
setVisible:
|
|
4824
|
-
setLastSelectedFile:
|
|
4825
|
-
selectedFileIndexes:
|
|
4826
|
-
clickPosition:
|
|
4827
|
-
isSelectionCtx:
|
|
4828
|
-
} = K$(
|
|
4829
|
-
let
|
|
4830
|
-
|
|
4821
|
+
const { currentPathFiles: c, sortConfig: u, setSortConfig: p } = he(), f = ae(null), { activeLayout: h } = we(), m = ce(), {
|
|
4822
|
+
emptySelecCtxItems: v,
|
|
4823
|
+
selecCtxItems: S,
|
|
4824
|
+
handleContextMenu: F,
|
|
4825
|
+
unselectFiles: O,
|
|
4826
|
+
visible: N,
|
|
4827
|
+
setVisible: z,
|
|
4828
|
+
setLastSelectedFile: g,
|
|
4829
|
+
selectedFileIndexes: P,
|
|
4830
|
+
clickPosition: b,
|
|
4831
|
+
isSelectionCtx: w
|
|
4832
|
+
} = K$(i, s, a, l, o), $ = Oe(() => z(!1)), x = (T) => {
|
|
4833
|
+
let R = "asc";
|
|
4834
|
+
u.key === T && u.direction === "asc" && (R = "desc"), p({ key: T, direction: R });
|
|
4835
|
+
}, C = (T) => {
|
|
4836
|
+
z(!1);
|
|
4837
|
+
for (let R of n.keys())
|
|
4838
|
+
if (P.length > 0 && P.every((_) => c[_].class === R)) {
|
|
4839
|
+
for (let _ of n.get(R))
|
|
4840
|
+
if (_.title === T.target.innerText) {
|
|
4841
|
+
let ee = c.filter((se, q) => P.includes(q));
|
|
4842
|
+
_.onClick(ee);
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4831
4845
|
};
|
|
4832
|
-
|
|
4846
|
+
let E = S;
|
|
4847
|
+
for (let T of n.keys())
|
|
4848
|
+
if (P.length > 0 && P.every((V) => c[V].class === T)) {
|
|
4849
|
+
E[E.length - 1].divider = !0;
|
|
4850
|
+
for (let V of n.get(T))
|
|
4851
|
+
E.push({
|
|
4852
|
+
title: V.title,
|
|
4853
|
+
icon: V.icon,
|
|
4854
|
+
divider: V.divider,
|
|
4855
|
+
onClick: C
|
|
4856
|
+
});
|
|
4857
|
+
}
|
|
4858
|
+
return /* @__PURE__ */ k(
|
|
4833
4859
|
"div",
|
|
4834
4860
|
{
|
|
4835
4861
|
ref: f,
|
|
4836
|
-
className: `files ${
|
|
4837
|
-
onContextMenu:
|
|
4838
|
-
onClick:
|
|
4862
|
+
className: `files ${h}`,
|
|
4863
|
+
onContextMenu: F,
|
|
4864
|
+
onClick: O,
|
|
4839
4865
|
children: [
|
|
4840
|
-
|
|
4841
|
-
(
|
|
4866
|
+
h === "list" && /* @__PURE__ */ d(q$, { unselectFiles: O, onSort: x, sortConfig: u }),
|
|
4867
|
+
(c == null ? void 0 : c.length) > 0 ? /* @__PURE__ */ d(pe, { children: c.map((T, R) => /* @__PURE__ */ d(
|
|
4842
4868
|
V$,
|
|
4843
4869
|
{
|
|
4844
|
-
index:
|
|
4845
|
-
file:
|
|
4846
|
-
onCreateFolder:
|
|
4847
|
-
onRename:
|
|
4848
|
-
onFileOpen:
|
|
4849
|
-
enableFilePreview:
|
|
4850
|
-
triggerAction:
|
|
4870
|
+
index: R,
|
|
4871
|
+
file: T,
|
|
4872
|
+
onCreateFolder: e,
|
|
4873
|
+
onRename: t,
|
|
4874
|
+
onFileOpen: o,
|
|
4875
|
+
enableFilePreview: s,
|
|
4876
|
+
triggerAction: a,
|
|
4851
4877
|
filesViewRef: f,
|
|
4852
|
-
selectedFileIndexes:
|
|
4853
|
-
handleContextMenu:
|
|
4854
|
-
setVisible:
|
|
4855
|
-
setLastSelectedFile:
|
|
4856
|
-
draggable:
|
|
4857
|
-
formatDate:
|
|
4878
|
+
selectedFileIndexes: P,
|
|
4879
|
+
handleContextMenu: F,
|
|
4880
|
+
setVisible: z,
|
|
4881
|
+
setLastSelectedFile: g,
|
|
4882
|
+
draggable: l.move,
|
|
4883
|
+
formatDate: r
|
|
4858
4884
|
},
|
|
4859
|
-
|
|
4860
|
-
)) }) : /* @__PURE__ */
|
|
4861
|
-
/* @__PURE__ */
|
|
4885
|
+
R
|
|
4886
|
+
)) }) : /* @__PURE__ */ d("div", { className: "empty-folder", children: m("folderEmpty") }),
|
|
4887
|
+
/* @__PURE__ */ d(
|
|
4862
4888
|
W$,
|
|
4863
4889
|
{
|
|
4864
4890
|
filesViewRef: f,
|
|
4865
|
-
contextMenuRef:
|
|
4866
|
-
menuItems:
|
|
4867
|
-
visible:
|
|
4868
|
-
setVisible:
|
|
4869
|
-
clickPosition:
|
|
4891
|
+
contextMenuRef: $.ref,
|
|
4892
|
+
menuItems: w ? E : v,
|
|
4893
|
+
visible: N,
|
|
4894
|
+
setVisible: z,
|
|
4895
|
+
clickPosition: b
|
|
4870
4896
|
}
|
|
4871
4897
|
)
|
|
4872
4898
|
]
|
|
@@ -4875,7 +4901,7 @@ const K$ = (n, e, t, o, i) => {
|
|
|
4875
4901
|
};
|
|
4876
4902
|
Hn.displayName = "FileList";
|
|
4877
4903
|
const _$ = ({ triggerAction: n, onDelete: e }) => {
|
|
4878
|
-
const [t, o] =
|
|
4904
|
+
const [t, o] = M(""), { selectedFiles: i, setSelectedFiles: s } = $e(), a = ce();
|
|
4879
4905
|
Q(() => {
|
|
4880
4906
|
o(() => {
|
|
4881
4907
|
if (i.length === 1)
|
|
@@ -4887,11 +4913,11 @@ const _$ = ({ triggerAction: n, onDelete: e }) => {
|
|
|
4887
4913
|
const l = () => {
|
|
4888
4914
|
e(i), s([]), n.close();
|
|
4889
4915
|
};
|
|
4890
|
-
return /* @__PURE__ */
|
|
4891
|
-
/* @__PURE__ */
|
|
4892
|
-
/* @__PURE__ */
|
|
4893
|
-
/* @__PURE__ */
|
|
4894
|
-
/* @__PURE__ */
|
|
4916
|
+
return /* @__PURE__ */ k("div", { className: "file-delete-confirm", children: [
|
|
4917
|
+
/* @__PURE__ */ d("p", { className: "file-delete-confirm-text", children: t }),
|
|
4918
|
+
/* @__PURE__ */ k("div", { className: "file-delete-confirm-actions", children: [
|
|
4919
|
+
/* @__PURE__ */ d(Ee, { type: "secondary", onClick: () => n.close(), children: a("cancel") }),
|
|
4920
|
+
/* @__PURE__ */ d(Ee, { type: "danger", onClick: l, children: a("delete") })
|
|
4895
4921
|
] })
|
|
4896
4922
|
] });
|
|
4897
4923
|
};
|
|
@@ -4902,10 +4928,10 @@ function J$(n) {
|
|
|
4902
4928
|
return H({ attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M518.3 459a8 8 0 0 0-12.6 0l-112 141.7a7.98 7.98 0 0 0 6.3 12.9h73.9V856c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V613.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 459z" }, child: [] }, { tag: "path", attr: { d: "M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0 1 52.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 0 1-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z" }, child: [] }] })(n);
|
|
4903
4929
|
}
|
|
4904
4930
|
const Z$ = ({ percent: n = 0, isCanceled: e = !1, isCompleted: t = !1, error: o }) => {
|
|
4905
|
-
const i =
|
|
4906
|
-
return /* @__PURE__ */
|
|
4907
|
-
!o && /* @__PURE__ */
|
|
4908
|
-
e ? /* @__PURE__ */
|
|
4931
|
+
const i = ce();
|
|
4932
|
+
return /* @__PURE__ */ k("div", { role: "progressbar", className: "fm-progress", children: [
|
|
4933
|
+
!o && /* @__PURE__ */ d("div", { className: "fm-progress-bar", children: /* @__PURE__ */ d("div", { className: "fm-progress-bar-fill", style: { width: `${n}%` } }) }),
|
|
4934
|
+
e ? /* @__PURE__ */ d("span", { className: "fm-upload-canceled", children: i("canceled") }) : o ? /* @__PURE__ */ d("span", { className: "fm-upload-canceled", children: o }) : /* @__PURE__ */ d("div", { className: "fm-progress-status", children: /* @__PURE__ */ d("span", { children: t ? i("completed") : i("percentDone", { percent: n }) }) })
|
|
4909
4935
|
] });
|
|
4910
4936
|
};
|
|
4911
4937
|
function X$(n) {
|
|
@@ -4920,98 +4946,98 @@ const Q$ = ({
|
|
|
4920
4946
|
onFileUploaded: s,
|
|
4921
4947
|
handleFileRemove: a
|
|
4922
4948
|
}) => {
|
|
4923
|
-
var
|
|
4924
|
-
const [l, r] =
|
|
4925
|
-
r(0), o((
|
|
4926
|
-
...
|
|
4949
|
+
var b, w, $, x;
|
|
4950
|
+
const [l, r] = M(0), [c, u] = M(!1), [p, f] = M(!1), [h, m] = M(!1), v = _e(33), S = ae(), { onError: F } = Ze(), O = ce(), N = (C) => {
|
|
4951
|
+
r(0), o((T) => ({
|
|
4952
|
+
...T,
|
|
4927
4953
|
[n]: !1
|
|
4928
4954
|
}));
|
|
4929
|
-
const
|
|
4955
|
+
const E = {
|
|
4930
4956
|
type: "upload",
|
|
4931
4957
|
message: O("uploadFail"),
|
|
4932
4958
|
response: {
|
|
4933
|
-
status:
|
|
4934
|
-
statusText:
|
|
4935
|
-
data:
|
|
4959
|
+
status: C.status,
|
|
4960
|
+
statusText: C.statusText,
|
|
4961
|
+
data: C.response
|
|
4936
4962
|
}
|
|
4937
4963
|
};
|
|
4938
4964
|
t(
|
|
4939
|
-
(
|
|
4940
|
-
...
|
|
4941
|
-
error:
|
|
4942
|
-
} :
|
|
4943
|
-
), m(!0),
|
|
4944
|
-
}, z = (
|
|
4945
|
-
if (!
|
|
4946
|
-
return new Promise((
|
|
4947
|
-
const
|
|
4948
|
-
S.current =
|
|
4949
|
-
...
|
|
4965
|
+
(T) => T.map((R, V) => n === V ? {
|
|
4966
|
+
...R,
|
|
4967
|
+
error: E.message
|
|
4968
|
+
} : R)
|
|
4969
|
+
), m(!0), F(E, e.file);
|
|
4970
|
+
}, z = (C) => {
|
|
4971
|
+
if (!C.error)
|
|
4972
|
+
return new Promise((E, T) => {
|
|
4973
|
+
const R = new XMLHttpRequest();
|
|
4974
|
+
S.current = R, o((q) => ({
|
|
4975
|
+
...q,
|
|
4950
4976
|
[n]: !0
|
|
4951
|
-
})),
|
|
4952
|
-
if (
|
|
4953
|
-
const y = Math.round(
|
|
4977
|
+
})), R.upload.onprogress = (q) => {
|
|
4978
|
+
if (q.lengthComputable) {
|
|
4979
|
+
const y = Math.round(q.loaded / q.total * 100);
|
|
4954
4980
|
r(y);
|
|
4955
4981
|
}
|
|
4956
|
-
},
|
|
4957
|
-
o((
|
|
4958
|
-
...
|
|
4982
|
+
}, R.onload = () => {
|
|
4983
|
+
o((q) => ({
|
|
4984
|
+
...q,
|
|
4959
4985
|
[n]: !1
|
|
4960
|
-
})),
|
|
4961
|
-
},
|
|
4962
|
-
R
|
|
4986
|
+
})), R.status === 200 || R.status === 201 ? (u(!0), s(R.response), E(R.response)) : (T(R.statusText), N(R));
|
|
4987
|
+
}, R.onerror = () => {
|
|
4988
|
+
T(R.statusText), N(R);
|
|
4963
4989
|
};
|
|
4964
|
-
const
|
|
4965
|
-
|
|
4966
|
-
const
|
|
4967
|
-
for (let
|
|
4968
|
-
|
|
4969
|
-
const
|
|
4970
|
-
for (let
|
|
4971
|
-
|
|
4972
|
-
|
|
4990
|
+
const V = (i == null ? void 0 : i.method) || "POST";
|
|
4991
|
+
R.open(V, i == null ? void 0 : i.url, !0);
|
|
4992
|
+
const _ = i == null ? void 0 : i.headers;
|
|
4993
|
+
for (let q in _)
|
|
4994
|
+
R.setRequestHeader(q, _[q]);
|
|
4995
|
+
const ee = new FormData(), se = C == null ? void 0 : C.appendData;
|
|
4996
|
+
for (let q in se)
|
|
4997
|
+
se[q] && ee.append(q, se[q]);
|
|
4998
|
+
ee.append("file", C.file), R.send(ee);
|
|
4973
4999
|
});
|
|
4974
5000
|
};
|
|
4975
5001
|
Q(() => {
|
|
4976
5002
|
S.current || z(e);
|
|
4977
5003
|
}, []);
|
|
4978
5004
|
const g = () => {
|
|
4979
|
-
S.current && (S.current.abort(), o((
|
|
4980
|
-
...
|
|
5005
|
+
S.current && (S.current.abort(), o((C) => ({
|
|
5006
|
+
...C,
|
|
4981
5007
|
[n]: !1
|
|
4982
|
-
})),
|
|
4983
|
-
},
|
|
5008
|
+
})), f(!0), r(0));
|
|
5009
|
+
}, P = () => {
|
|
4984
5010
|
e != null && e.file && (t(
|
|
4985
|
-
(
|
|
4986
|
-
...
|
|
5011
|
+
(C) => C.map((E, T) => n === T ? {
|
|
5012
|
+
...E,
|
|
4987
5013
|
error: !1
|
|
4988
|
-
} :
|
|
4989
|
-
), z({ ...e, error: !1 }),
|
|
5014
|
+
} : E)
|
|
5015
|
+
), z({ ...e, error: !1 }), f(!1), m(!1));
|
|
4990
5016
|
};
|
|
4991
|
-
return e.removed ? null : /* @__PURE__ */
|
|
4992
|
-
/* @__PURE__ */
|
|
4993
|
-
/* @__PURE__ */
|
|
4994
|
-
/* @__PURE__ */
|
|
4995
|
-
/* @__PURE__ */
|
|
4996
|
-
/* @__PURE__ */
|
|
4997
|
-
/* @__PURE__ */
|
|
5017
|
+
return e.removed ? null : /* @__PURE__ */ k("li", { children: [
|
|
5018
|
+
/* @__PURE__ */ d("div", { className: "file-icon", children: v[Ne((b = e.file) == null ? void 0 : b.name)] ?? /* @__PURE__ */ d(Ve, { size: 33 }) }),
|
|
5019
|
+
/* @__PURE__ */ k("div", { className: "file", children: [
|
|
5020
|
+
/* @__PURE__ */ k("div", { className: "file-details", children: [
|
|
5021
|
+
/* @__PURE__ */ k("div", { className: "file-info", children: [
|
|
5022
|
+
/* @__PURE__ */ d("span", { className: "file-name text-truncate", title: (w = e.file) == null ? void 0 : w.name, children: ($ = e.file) == null ? void 0 : $.name }),
|
|
5023
|
+
/* @__PURE__ */ d("span", { className: "file-size", children: Qe((x = e.file) == null ? void 0 : x.size) })
|
|
4998
5024
|
] }),
|
|
4999
|
-
|
|
5025
|
+
c ? /* @__PURE__ */ d(C$, { title: O("uploaded"), className: "upload-success" }) : p || h ? /* @__PURE__ */ d(X$, { className: "retry-upload", title: "Retry", onClick: P }) : /* @__PURE__ */ d(
|
|
5000
5026
|
"div",
|
|
5001
5027
|
{
|
|
5002
5028
|
className: "rm-file",
|
|
5003
5029
|
title: `${e.error ? O("Remove") : O("abortUpload")}`,
|
|
5004
5030
|
onClick: e.error ? () => a(n) : g,
|
|
5005
|
-
children: /* @__PURE__ */
|
|
5031
|
+
children: /* @__PURE__ */ d(G$, {})
|
|
5006
5032
|
}
|
|
5007
5033
|
)
|
|
5008
5034
|
] }),
|
|
5009
|
-
/* @__PURE__ */
|
|
5035
|
+
/* @__PURE__ */ d(
|
|
5010
5036
|
Z$,
|
|
5011
5037
|
{
|
|
5012
5038
|
percent: l,
|
|
5013
|
-
isCanceled:
|
|
5014
|
-
isCompleted:
|
|
5039
|
+
isCanceled: p,
|
|
5040
|
+
isCompleted: c,
|
|
5015
5041
|
error: e.error
|
|
5016
5042
|
}
|
|
5017
5043
|
)
|
|
@@ -5024,64 +5050,64 @@ const Q$ = ({
|
|
|
5024
5050
|
onFileUploading: o,
|
|
5025
5051
|
onFileUploaded: i
|
|
5026
5052
|
}) => {
|
|
5027
|
-
const [s, a] =
|
|
5028
|
-
|
|
5029
|
-
},
|
|
5030
|
-
if (t && !t.includes(Ne(
|
|
5053
|
+
const [s, a] = M([]), [l, r] = M(!1), [c, u] = M({}), { currentFolder: p, currentPathFiles: f } = he(), { onError: h } = Ze(), m = ae(null), v = ce(), S = (P) => {
|
|
5054
|
+
P.key === "Enter" && m.current.click();
|
|
5055
|
+
}, F = (P) => {
|
|
5056
|
+
if (t && !t.includes(Ne(P.name)))
|
|
5031
5057
|
return v("fileTypeNotAllowed");
|
|
5032
|
-
if (
|
|
5033
|
-
($) => $.name.toLowerCase() ===
|
|
5058
|
+
if (f.some(
|
|
5059
|
+
($) => $.name.toLowerCase() === P.name.toLowerCase() && !$.isDirectory
|
|
5034
5060
|
)) return v("fileAlreadyExist");
|
|
5035
|
-
if (e &&
|
|
5036
|
-
}, O = (
|
|
5037
|
-
if (
|
|
5038
|
-
(
|
|
5039
|
-
),
|
|
5040
|
-
const
|
|
5041
|
-
const $ = o(w,
|
|
5042
|
-
return
|
|
5061
|
+
if (e && P.size > e) return `${v("maxUploadSize")} ${Qe(e, 0)}.`;
|
|
5062
|
+
}, O = (P) => {
|
|
5063
|
+
if (P = P.filter(
|
|
5064
|
+
(b) => !s.some((w) => w.file.name.toLowerCase() === b.name.toLowerCase())
|
|
5065
|
+
), P.length > 0) {
|
|
5066
|
+
const b = P.map((w) => {
|
|
5067
|
+
const $ = o(w, p), x = F(w);
|
|
5068
|
+
return x && h({ type: "upload", message: x }, w), {
|
|
5043
5069
|
file: w,
|
|
5044
5070
|
appendData: $,
|
|
5045
|
-
...
|
|
5071
|
+
...x && { error: x }
|
|
5046
5072
|
};
|
|
5047
5073
|
});
|
|
5048
|
-
a((w) => [...w, ...
|
|
5074
|
+
a((w) => [...w, ...b]);
|
|
5049
5075
|
}
|
|
5050
|
-
},
|
|
5051
|
-
|
|
5052
|
-
const
|
|
5053
|
-
O(
|
|
5054
|
-
}, z = (
|
|
5055
|
-
const
|
|
5056
|
-
O(
|
|
5057
|
-
}, g = (
|
|
5058
|
-
a((
|
|
5059
|
-
const w =
|
|
5076
|
+
}, N = (P) => {
|
|
5077
|
+
P.preventDefault(), r(!1);
|
|
5078
|
+
const b = Array.from(P.dataTransfer.files);
|
|
5079
|
+
O(b);
|
|
5080
|
+
}, z = (P) => {
|
|
5081
|
+
const b = Array.from(P.target.files);
|
|
5082
|
+
O(b);
|
|
5083
|
+
}, g = (P) => {
|
|
5084
|
+
a((b) => {
|
|
5085
|
+
const w = b.map(($, x) => P === x ? {
|
|
5060
5086
|
...$,
|
|
5061
5087
|
removed: !0
|
|
5062
5088
|
} : $);
|
|
5063
5089
|
return w.every(($) => !!$.removed) ? [] : w;
|
|
5064
5090
|
});
|
|
5065
5091
|
};
|
|
5066
|
-
return /* @__PURE__ */
|
|
5067
|
-
/* @__PURE__ */
|
|
5068
|
-
/* @__PURE__ */
|
|
5092
|
+
return /* @__PURE__ */ k("div", { className: `fm-upload-file ${s.length > 0 ? "file-selcted" : ""}`, children: [
|
|
5093
|
+
/* @__PURE__ */ k("div", { className: "select-files", children: [
|
|
5094
|
+
/* @__PURE__ */ d(
|
|
5069
5095
|
"div",
|
|
5070
5096
|
{
|
|
5071
5097
|
className: `draggable-file-input ${l ? "dragging" : ""}`,
|
|
5072
|
-
onDrop:
|
|
5073
|
-
onDragOver: (
|
|
5098
|
+
onDrop: N,
|
|
5099
|
+
onDragOver: (P) => P.preventDefault(),
|
|
5074
5100
|
onDragEnter: () => r(!0),
|
|
5075
5101
|
onDragLeave: () => r(!1),
|
|
5076
|
-
children: /* @__PURE__ */
|
|
5077
|
-
/* @__PURE__ */
|
|
5078
|
-
/* @__PURE__ */
|
|
5102
|
+
children: /* @__PURE__ */ k("div", { className: "input-text", children: [
|
|
5103
|
+
/* @__PURE__ */ d(J$, { size: 30 }),
|
|
5104
|
+
/* @__PURE__ */ d("span", { children: v("dragFileToUpload") })
|
|
5079
5105
|
] })
|
|
5080
5106
|
}
|
|
5081
5107
|
),
|
|
5082
|
-
/* @__PURE__ */
|
|
5083
|
-
/* @__PURE__ */
|
|
5084
|
-
/* @__PURE__ */
|
|
5108
|
+
/* @__PURE__ */ d("div", { className: "btn-choose-file", children: /* @__PURE__ */ k(Ee, { padding: "0", onKeyDown: S, children: [
|
|
5109
|
+
/* @__PURE__ */ d("label", { htmlFor: "chooseFile", children: v("chooseFile") }),
|
|
5110
|
+
/* @__PURE__ */ d(
|
|
5085
5111
|
"input",
|
|
5086
5112
|
{
|
|
5087
5113
|
ref: m,
|
|
@@ -5095,86 +5121,86 @@ const Q$ = ({
|
|
|
5095
5121
|
)
|
|
5096
5122
|
] }) })
|
|
5097
5123
|
] }),
|
|
5098
|
-
s.length > 0 && /* @__PURE__ */
|
|
5099
|
-
/* @__PURE__ */
|
|
5100
|
-
/* @__PURE__ */
|
|
5101
|
-
/* @__PURE__ */
|
|
5102
|
-
] }) : /* @__PURE__ */
|
|
5103
|
-
/* @__PURE__ */
|
|
5124
|
+
s.length > 0 && /* @__PURE__ */ k("div", { className: "files-progress", children: [
|
|
5125
|
+
/* @__PURE__ */ d("div", { className: "heading", children: Object.values(c).some((P) => P) ? /* @__PURE__ */ k(pe, { children: [
|
|
5126
|
+
/* @__PURE__ */ d("h2", { children: v("uploading") }),
|
|
5127
|
+
/* @__PURE__ */ d(pt, { loading: !0, className: "upload-loading" })
|
|
5128
|
+
] }) : /* @__PURE__ */ d("h2", { children: v("completed") }) }),
|
|
5129
|
+
/* @__PURE__ */ d("ul", { children: s.map((P, b) => /* @__PURE__ */ d(
|
|
5104
5130
|
Q$,
|
|
5105
5131
|
{
|
|
5106
|
-
index:
|
|
5107
|
-
fileData:
|
|
5132
|
+
index: b,
|
|
5133
|
+
fileData: P,
|
|
5108
5134
|
setFiles: a,
|
|
5109
5135
|
fileUploadConfig: n,
|
|
5110
5136
|
setIsUploading: u,
|
|
5111
5137
|
onFileUploaded: i,
|
|
5112
5138
|
handleFileRemove: g
|
|
5113
5139
|
},
|
|
5114
|
-
|
|
5140
|
+
b
|
|
5115
5141
|
)) })
|
|
5116
5142
|
] })
|
|
5117
5143
|
] });
|
|
5118
5144
|
}, sn = ["jpg", "jpeg", "png"], an = ["mp4", "mov", "avi"], rn = ["mp3", "wav", "m4a"], ln = ["txt", "pdf"], t6 = ({ filePreviewPath: n, filePreviewComponent: e }) => {
|
|
5119
5145
|
var v;
|
|
5120
|
-
const [t, o] =
|
|
5146
|
+
const [t, o] = M(!0), [i, s] = M(!1), { selectedFiles: a } = $e(), l = _e(73), r = (v = Ne(a[0].name)) == null ? void 0 : v.toLowerCase(), c = `${n}${a[0].path}`, u = ce(), p = Ge(
|
|
5121
5147
|
() => e == null ? void 0 : e(a[0]),
|
|
5122
5148
|
[e]
|
|
5123
|
-
),
|
|
5149
|
+
), f = () => {
|
|
5124
5150
|
o(!1), s(!1);
|
|
5125
5151
|
}, h = () => {
|
|
5126
5152
|
o(!1), s(!0);
|
|
5127
5153
|
}, m = () => {
|
|
5128
|
-
window.location.href =
|
|
5154
|
+
window.location.href = c;
|
|
5129
5155
|
};
|
|
5130
|
-
return
|
|
5156
|
+
return ye.isValidElement(p) ? p : /* @__PURE__ */ k("section", { className: `file-previewer ${r === "pdf" ? "pdf-previewer" : ""}`, children: [
|
|
5131
5157
|
i || ![
|
|
5132
5158
|
...sn,
|
|
5133
5159
|
...an,
|
|
5134
5160
|
...rn,
|
|
5135
5161
|
...ln
|
|
5136
|
-
].includes(r) && /* @__PURE__ */
|
|
5137
|
-
/* @__PURE__ */
|
|
5138
|
-
/* @__PURE__ */
|
|
5139
|
-
/* @__PURE__ */
|
|
5140
|
-
/* @__PURE__ */
|
|
5141
|
-
a[0].size && /* @__PURE__ */
|
|
5142
|
-
/* @__PURE__ */
|
|
5162
|
+
].includes(r) && /* @__PURE__ */ k("div", { className: "preview-error", children: [
|
|
5163
|
+
/* @__PURE__ */ d("span", { className: "error-icon", children: l[r] ?? /* @__PURE__ */ d(S$, { size: 73 }) }),
|
|
5164
|
+
/* @__PURE__ */ d("span", { className: "error-msg", children: u("previewUnavailable") }),
|
|
5165
|
+
/* @__PURE__ */ k("div", { className: "file-info", children: [
|
|
5166
|
+
/* @__PURE__ */ d("span", { className: "file-name", children: a[0].name }),
|
|
5167
|
+
a[0].size && /* @__PURE__ */ d("span", { children: "-" }),
|
|
5168
|
+
/* @__PURE__ */ d("span", { className: "file-size", children: Qe(a[0].size) })
|
|
5143
5169
|
] }),
|
|
5144
|
-
/* @__PURE__ */
|
|
5145
|
-
/* @__PURE__ */
|
|
5146
|
-
/* @__PURE__ */
|
|
5170
|
+
/* @__PURE__ */ d(Ee, { onClick: m, padding: "0.45rem .9rem", children: /* @__PURE__ */ k("div", { className: "download-btn", children: [
|
|
5171
|
+
/* @__PURE__ */ d(ht, { size: 18 }),
|
|
5172
|
+
/* @__PURE__ */ d("span", { children: u("download") })
|
|
5147
5173
|
] }) })
|
|
5148
5174
|
] }),
|
|
5149
|
-
sn.includes(r) && /* @__PURE__ */
|
|
5150
|
-
/* @__PURE__ */
|
|
5151
|
-
/* @__PURE__ */
|
|
5175
|
+
sn.includes(r) && /* @__PURE__ */ k(pe, { children: [
|
|
5176
|
+
/* @__PURE__ */ d(pt, { isLoading: t }),
|
|
5177
|
+
/* @__PURE__ */ d(
|
|
5152
5178
|
"img",
|
|
5153
5179
|
{
|
|
5154
|
-
src:
|
|
5180
|
+
src: c,
|
|
5155
5181
|
alt: "Preview Unavailable",
|
|
5156
5182
|
className: `photo-popup-image ${t ? "img-loading" : ""}`,
|
|
5157
|
-
onLoad:
|
|
5183
|
+
onLoad: f,
|
|
5158
5184
|
onError: h,
|
|
5159
5185
|
loading: "lazy"
|
|
5160
5186
|
}
|
|
5161
5187
|
)
|
|
5162
5188
|
] }),
|
|
5163
|
-
an.includes(r) && /* @__PURE__ */
|
|
5164
|
-
rn.includes(r) && /* @__PURE__ */
|
|
5165
|
-
ln.includes(r) && /* @__PURE__ */
|
|
5189
|
+
an.includes(r) && /* @__PURE__ */ d("video", { src: c, className: "video-preview", controls: !0, autoPlay: !0 }),
|
|
5190
|
+
rn.includes(r) && /* @__PURE__ */ d("audio", { src: c, controls: !0, autoPlay: !0, className: "audio-preview" }),
|
|
5191
|
+
ln.includes(r) && /* @__PURE__ */ d(pe, { children: /* @__PURE__ */ d(
|
|
5166
5192
|
"iframe",
|
|
5167
5193
|
{
|
|
5168
|
-
src:
|
|
5169
|
-
onLoad:
|
|
5194
|
+
src: c,
|
|
5195
|
+
onLoad: f,
|
|
5170
5196
|
onError: h,
|
|
5171
5197
|
frameBorder: "0",
|
|
5172
5198
|
className: `photo-popup-iframe ${t ? "img-loading" : ""}`
|
|
5173
5199
|
}
|
|
5174
5200
|
) })
|
|
5175
5201
|
] });
|
|
5176
|
-
}, dt = (n) => n.toLowerCase(),
|
|
5177
|
-
const o =
|
|
5202
|
+
}, dt = (n) => n.toLowerCase(), de = (n, e, t = !1) => {
|
|
5203
|
+
const o = ae(/* @__PURE__ */ new Set([])), i = Ge(() => new Set(n.map((r) => dt(r))), [n]), s = (r) => {
|
|
5178
5204
|
if (!r.repeat && (o.current.add(dt(r.key)), i.isSubsetOf(o.current) && !t)) {
|
|
5179
5205
|
r.preventDefault(), e(r);
|
|
5180
5206
|
return;
|
|
@@ -5187,7 +5213,7 @@ const Q$ = ({
|
|
|
5187
5213
|
Q(() => (window.addEventListener("keydown", s), window.addEventListener("keyup", a), window.addEventListener("blur", l), () => {
|
|
5188
5214
|
window.removeEventListener("keydown", s), window.removeEventListener("keyup", a), window.removeEventListener("blur", l);
|
|
5189
5215
|
}), [i, e, t]);
|
|
5190
|
-
},
|
|
5216
|
+
}, ue = {
|
|
5191
5217
|
createFolder: ["Alt", "Shift", "N"],
|
|
5192
5218
|
uploadFiles: ["Control", "U"],
|
|
5193
5219
|
cut: ["Control", "X"],
|
|
@@ -5206,7 +5232,7 @@ const Q$ = ({
|
|
|
5206
5232
|
refresh: ["F5"],
|
|
5207
5233
|
clearSelection: ["Escape"]
|
|
5208
5234
|
}, n6 = (n, e, t) => {
|
|
5209
|
-
const { setClipBoard: o, handleCutCopy: i, handlePasting: s } = Xe(), { currentFolder: a, currentPathFiles: l } = he(), { selectedFiles: r, setSelectedFiles:
|
|
5235
|
+
const { setClipBoard: o, handleCutCopy: i, handlePasting: s } = Xe(), { currentFolder: a, currentPathFiles: l } = he(), { selectedFiles: r, setSelectedFiles: c, handleDownload: u } = $e(), { setActiveLayout: p } = we(), f = () => {
|
|
5210
5236
|
t.create && n.show("createFolder");
|
|
5211
5237
|
}, h = () => {
|
|
5212
5238
|
t.upload && n.show("uploadFile");
|
|
@@ -5216,28 +5242,28 @@ const Q$ = ({
|
|
|
5216
5242
|
t.copy && i(!1);
|
|
5217
5243
|
}, S = () => {
|
|
5218
5244
|
s(a);
|
|
5219
|
-
},
|
|
5245
|
+
}, F = () => {
|
|
5220
5246
|
t.rename && n.show("rename");
|
|
5221
5247
|
}, O = () => {
|
|
5222
5248
|
t.download && u();
|
|
5223
|
-
},
|
|
5249
|
+
}, N = () => {
|
|
5224
5250
|
t.delete && r.length && n.show("delete");
|
|
5225
5251
|
}, z = () => {
|
|
5226
|
-
l.length > 0 &&
|
|
5252
|
+
l.length > 0 && c([l[0]]);
|
|
5227
5253
|
}, g = () => {
|
|
5228
|
-
l.length > 0 &&
|
|
5229
|
-
},
|
|
5230
|
-
|
|
5231
|
-
},
|
|
5232
|
-
|
|
5254
|
+
l.length > 0 && c([l.at(-1)]);
|
|
5255
|
+
}, P = () => {
|
|
5256
|
+
c(l);
|
|
5257
|
+
}, b = () => {
|
|
5258
|
+
c((C) => C.length > 0 ? [] : C);
|
|
5233
5259
|
}, w = () => {
|
|
5234
5260
|
xe(e, "onRefresh"), o(null);
|
|
5235
5261
|
}, $ = () => {
|
|
5236
|
-
|
|
5237
|
-
},
|
|
5238
|
-
|
|
5262
|
+
p("grid");
|
|
5263
|
+
}, x = () => {
|
|
5264
|
+
p("list");
|
|
5239
5265
|
};
|
|
5240
|
-
|
|
5266
|
+
de(ue.createFolder, f, n.isActive), de(ue.uploadFiles, h, n.isActive), de(ue.cut, m, n.isActive), de(ue.copy, v, n.isActive), de(ue.paste, S, n.isActive), de(ue.rename, F, n.isActive), de(ue.download, O, n.isActive), de(ue.delete, N, n.isActive), de(ue.jumpToFirst, z, n.isActive), de(ue.jumpToLast, g, n.isActive), de(ue.selectAll, P, n.isActive), de(ue.clearSelection, b, n.isActive), de(ue.refresh, w, n.isActive), de(ue.gridLayout, $, n.isActive), de(ue.listLayout, x, n.isActive);
|
|
5241
5267
|
}, o6 = ({
|
|
5242
5268
|
fileUploadConfig: n,
|
|
5243
5269
|
onFileUploading: e,
|
|
@@ -5248,15 +5274,15 @@ const Q$ = ({
|
|
|
5248
5274
|
filePreviewPath: a,
|
|
5249
5275
|
filePreviewComponent: l,
|
|
5250
5276
|
acceptedFileTypes: r,
|
|
5251
|
-
triggerAction:
|
|
5277
|
+
triggerAction: c,
|
|
5252
5278
|
permissions: u
|
|
5253
5279
|
}) => {
|
|
5254
|
-
const [
|
|
5255
|
-
n6(
|
|
5280
|
+
const [p, f] = M(null), { selectedFiles: h } = $e(), m = ce();
|
|
5281
|
+
n6(c, i, u);
|
|
5256
5282
|
const v = {
|
|
5257
5283
|
uploadFile: {
|
|
5258
5284
|
title: m("upload"),
|
|
5259
|
-
component: /* @__PURE__ */
|
|
5285
|
+
component: /* @__PURE__ */ d(
|
|
5260
5286
|
e6,
|
|
5261
5287
|
{
|
|
5262
5288
|
fileUploadConfig: n,
|
|
@@ -5270,12 +5296,12 @@ const Q$ = ({
|
|
|
5270
5296
|
},
|
|
5271
5297
|
delete: {
|
|
5272
5298
|
title: m("delete"),
|
|
5273
|
-
component: /* @__PURE__ */
|
|
5299
|
+
component: /* @__PURE__ */ d(_$, { triggerAction: c, onDelete: o }),
|
|
5274
5300
|
width: "25%"
|
|
5275
5301
|
},
|
|
5276
5302
|
previewFile: {
|
|
5277
5303
|
title: m("preview"),
|
|
5278
|
-
component: /* @__PURE__ */
|
|
5304
|
+
component: /* @__PURE__ */ d(
|
|
5279
5305
|
t6,
|
|
5280
5306
|
{
|
|
5281
5307
|
filePreviewPath: a,
|
|
@@ -5286,24 +5312,24 @@ const Q$ = ({
|
|
|
5286
5312
|
}
|
|
5287
5313
|
};
|
|
5288
5314
|
if (Q(() => {
|
|
5289
|
-
if (
|
|
5290
|
-
const S =
|
|
5291
|
-
S === "previewFile" && (v[S].title = (h == null ? void 0 : h.name) ?? m("preview")),
|
|
5315
|
+
if (c.isActive) {
|
|
5316
|
+
const S = c.actionType;
|
|
5317
|
+
S === "previewFile" && (v[S].title = (h == null ? void 0 : h.name) ?? m("preview")), f(v[S]);
|
|
5292
5318
|
} else
|
|
5293
|
-
|
|
5294
|
-
}, [
|
|
5295
|
-
return /* @__PURE__ */
|
|
5319
|
+
f(null);
|
|
5320
|
+
}, [c.isActive]), p)
|
|
5321
|
+
return /* @__PURE__ */ d(
|
|
5296
5322
|
Un,
|
|
5297
5323
|
{
|
|
5298
|
-
heading:
|
|
5299
|
-
show:
|
|
5300
|
-
setShow:
|
|
5301
|
-
dialogWidth:
|
|
5302
|
-
children:
|
|
5324
|
+
heading: p.title,
|
|
5325
|
+
show: c.isActive,
|
|
5326
|
+
setShow: c.close,
|
|
5327
|
+
dialogWidth: p.width,
|
|
5328
|
+
children: p == null ? void 0 : p.component
|
|
5303
5329
|
}
|
|
5304
5330
|
);
|
|
5305
5331
|
}, i6 = () => {
|
|
5306
|
-
const [n, e] =
|
|
5332
|
+
const [n, e] = M(!1), [t, o] = M(null);
|
|
5307
5333
|
return {
|
|
5308
5334
|
isActive: n,
|
|
5309
5335
|
actionType: t,
|
|
@@ -5315,7 +5341,7 @@ const Q$ = ({
|
|
|
5315
5341
|
}
|
|
5316
5342
|
};
|
|
5317
5343
|
}, s6 = (n, e) => {
|
|
5318
|
-
const [t, o] =
|
|
5344
|
+
const [t, o] = M({ col1: n, col2: e }), [i, s] = M(!1), a = ae(null);
|
|
5319
5345
|
return {
|
|
5320
5346
|
containerRef: a,
|
|
5321
5347
|
colSizes: t,
|
|
@@ -5330,7 +5356,7 @@ const Q$ = ({
|
|
|
5330
5356
|
handleMouseMove: (u) => {
|
|
5331
5357
|
if (!i) return;
|
|
5332
5358
|
u.preventDefault();
|
|
5333
|
-
const
|
|
5359
|
+
const f = a.current.getBoundingClientRect(), h = (u.clientX - f.left) / f.width * 100;
|
|
5334
5360
|
h >= 15 && h <= 60 && o({ col1: h, col2: 100 - h });
|
|
5335
5361
|
}
|
|
5336
5362
|
};
|
|
@@ -5367,135 +5393,138 @@ const Q$ = ({
|
|
|
5367
5393
|
const i = n.getMonth() + 1, s = n.getDate(), a = n.getFullYear();
|
|
5368
5394
|
return `${i}/${s}/${a} ${e}:${t < 10 ? "0" + t : t} ${o}`;
|
|
5369
5395
|
}, Vn = ({
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5396
|
+
actions: n,
|
|
5397
|
+
files: e,
|
|
5398
|
+
fileUploadConfig: t,
|
|
5399
|
+
icons: o,
|
|
5400
|
+
isLoading: i,
|
|
5401
|
+
onCreateFolder: s,
|
|
5402
|
+
onFileUploading: a = () => {
|
|
5375
5403
|
},
|
|
5376
|
-
onFileUploaded:
|
|
5404
|
+
onFileUploaded: l = () => {
|
|
5377
5405
|
},
|
|
5378
|
-
onCut:
|
|
5379
|
-
onCopy:
|
|
5380
|
-
onPaste:
|
|
5381
|
-
onRename:
|
|
5382
|
-
onDownload:
|
|
5383
|
-
onDelete:
|
|
5384
|
-
onLayoutChange:
|
|
5406
|
+
onCut: r,
|
|
5407
|
+
onCopy: c,
|
|
5408
|
+
onPaste: u,
|
|
5409
|
+
onRename: p,
|
|
5410
|
+
onDownload: f,
|
|
5411
|
+
onDelete: h = () => null,
|
|
5412
|
+
onLayoutChange: m = () => {
|
|
5385
5413
|
},
|
|
5386
|
-
onRefresh:
|
|
5387
|
-
onFileOpen:
|
|
5414
|
+
onRefresh: v,
|
|
5415
|
+
onFileOpen: S = () => {
|
|
5388
5416
|
},
|
|
5389
|
-
onFolderChange:
|
|
5417
|
+
onFolderChange: F = () => {
|
|
5390
5418
|
},
|
|
5391
|
-
onSelect:
|
|
5419
|
+
onSelect: O,
|
|
5392
5420
|
onSelectionChange: N,
|
|
5393
|
-
onError:
|
|
5421
|
+
onError: z = () => {
|
|
5394
5422
|
},
|
|
5395
|
-
layout:
|
|
5396
|
-
enableFilePreview:
|
|
5397
|
-
maxFileSize:
|
|
5398
|
-
filePreviewPath:
|
|
5399
|
-
acceptedFileTypes:
|
|
5400
|
-
height:
|
|
5401
|
-
width:
|
|
5402
|
-
initialPath:
|
|
5403
|
-
filePreviewComponent:
|
|
5404
|
-
primaryColor:
|
|
5405
|
-
fontFamily:
|
|
5406
|
-
language:
|
|
5407
|
-
permissions:
|
|
5408
|
-
collapsibleNav:
|
|
5409
|
-
defaultNavExpanded:
|
|
5410
|
-
className:
|
|
5411
|
-
style:
|
|
5412
|
-
formatDate:
|
|
5423
|
+
layout: g = "grid",
|
|
5424
|
+
enableFilePreview: P = !0,
|
|
5425
|
+
maxFileSize: b,
|
|
5426
|
+
filePreviewPath: w,
|
|
5427
|
+
acceptedFileTypes: $,
|
|
5428
|
+
height: x = "600px",
|
|
5429
|
+
width: C = "100%",
|
|
5430
|
+
initialPath: E = "",
|
|
5431
|
+
filePreviewComponent: T,
|
|
5432
|
+
primaryColor: R = "#6155b4",
|
|
5433
|
+
fontFamily: V = "Nunito Sans, sans-serif",
|
|
5434
|
+
language: _ = "en-US",
|
|
5435
|
+
permissions: ee = {},
|
|
5436
|
+
collapsibleNav: se = !1,
|
|
5437
|
+
defaultNavExpanded: q = !0,
|
|
5438
|
+
className: y = "",
|
|
5439
|
+
style: L = {},
|
|
5440
|
+
formatDate: W = l6
|
|
5413
5441
|
}) => {
|
|
5414
|
-
const [
|
|
5415
|
-
"--file-manager-font-family":
|
|
5416
|
-
"--file-manager-primary-color":
|
|
5417
|
-
height:
|
|
5418
|
-
width:
|
|
5419
|
-
},
|
|
5420
|
-
() => ({ ...r6, ...
|
|
5421
|
-
[
|
|
5442
|
+
const [U, j] = M(q), G = i6(), { containerRef: Y, colSizes: K, isDragging: J, handleMouseMove: Z, handleMouseUp: D, handleMouseDown: oe } = s6(20, 80), A = {
|
|
5443
|
+
"--file-manager-font-family": V,
|
|
5444
|
+
"--file-manager-primary-color": R,
|
|
5445
|
+
height: x,
|
|
5446
|
+
width: C
|
|
5447
|
+
}, re = Ge(
|
|
5448
|
+
() => ({ ...r6, ...ee }),
|
|
5449
|
+
[ee]
|
|
5422
5450
|
);
|
|
5423
|
-
return /* @__PURE__ */
|
|
5451
|
+
return /* @__PURE__ */ k(
|
|
5424
5452
|
"main",
|
|
5425
5453
|
{
|
|
5426
|
-
className: `file-explorer ${
|
|
5427
|
-
onContextMenu: (
|
|
5428
|
-
style: { ...
|
|
5454
|
+
className: `file-explorer ${y}`,
|
|
5455
|
+
onContextMenu: (ge) => ge.preventDefault(),
|
|
5456
|
+
style: { ...A, ...L },
|
|
5429
5457
|
children: [
|
|
5430
|
-
/* @__PURE__ */
|
|
5431
|
-
/* @__PURE__ */
|
|
5458
|
+
/* @__PURE__ */ d(pt, { loading: i }),
|
|
5459
|
+
/* @__PURE__ */ d(Z4, { language: _, children: /* @__PURE__ */ d(Q4, { filesData: e, onError: z, children: /* @__PURE__ */ d(t$, { initialPath: E, onFolderChange: F, children: /* @__PURE__ */ d(
|
|
5432
5460
|
n$,
|
|
5433
5461
|
{
|
|
5434
|
-
onDownload:
|
|
5435
|
-
onSelect:
|
|
5462
|
+
onDownload: f,
|
|
5463
|
+
onSelect: O,
|
|
5436
5464
|
onSelectionChange: N,
|
|
5437
|
-
children: /* @__PURE__ */
|
|
5438
|
-
/* @__PURE__ */
|
|
5465
|
+
children: /* @__PURE__ */ d(o$, { onPaste: u, onCut: r, onCopy: c, children: /* @__PURE__ */ k(fo, { layout: g, children: [
|
|
5466
|
+
/* @__PURE__ */ d(
|
|
5439
5467
|
zn,
|
|
5440
5468
|
{
|
|
5441
|
-
onLayoutChange:
|
|
5442
|
-
onRefresh:
|
|
5443
|
-
triggerAction:
|
|
5444
|
-
permissions:
|
|
5469
|
+
onLayoutChange: m,
|
|
5470
|
+
onRefresh: v,
|
|
5471
|
+
triggerAction: G,
|
|
5472
|
+
permissions: re
|
|
5445
5473
|
}
|
|
5446
5474
|
),
|
|
5447
|
-
/* @__PURE__ */
|
|
5475
|
+
/* @__PURE__ */ k(
|
|
5448
5476
|
"section",
|
|
5449
5477
|
{
|
|
5450
|
-
ref:
|
|
5451
|
-
onMouseMove:
|
|
5452
|
-
onMouseUp:
|
|
5478
|
+
ref: Y,
|
|
5479
|
+
onMouseMove: Z,
|
|
5480
|
+
onMouseUp: D,
|
|
5453
5481
|
className: "files-container",
|
|
5454
5482
|
children: [
|
|
5455
|
-
/* @__PURE__ */
|
|
5483
|
+
/* @__PURE__ */ k(
|
|
5456
5484
|
"div",
|
|
5457
5485
|
{
|
|
5458
|
-
className: `navigation-pane ${
|
|
5486
|
+
className: `navigation-pane ${U ? "open" : "closed"}`,
|
|
5459
5487
|
style: {
|
|
5460
|
-
width:
|
|
5488
|
+
width: K.col1 + "%"
|
|
5461
5489
|
},
|
|
5462
5490
|
children: [
|
|
5463
|
-
/* @__PURE__ */
|
|
5464
|
-
/* @__PURE__ */
|
|
5491
|
+
/* @__PURE__ */ d(Rn, { onFileOpen: S, icons: o }),
|
|
5492
|
+
/* @__PURE__ */ d(
|
|
5465
5493
|
"div",
|
|
5466
5494
|
{
|
|
5467
|
-
className: `sidebar-resize ${
|
|
5468
|
-
onMouseDown:
|
|
5495
|
+
className: `sidebar-resize ${J ? "sidebar-dragging" : ""}`,
|
|
5496
|
+
onMouseDown: oe
|
|
5469
5497
|
}
|
|
5470
5498
|
)
|
|
5471
5499
|
]
|
|
5472
5500
|
}
|
|
5473
5501
|
),
|
|
5474
|
-
/* @__PURE__ */
|
|
5502
|
+
/* @__PURE__ */ k(
|
|
5475
5503
|
"div",
|
|
5476
5504
|
{
|
|
5477
5505
|
className: "folders-preview",
|
|
5478
|
-
style: { width: (
|
|
5506
|
+
style: { width: (U ? K.col2 : 100) + "%" },
|
|
5479
5507
|
children: [
|
|
5480
|
-
/* @__PURE__ */
|
|
5508
|
+
/* @__PURE__ */ d(
|
|
5481
5509
|
gt,
|
|
5482
5510
|
{
|
|
5483
|
-
collapsibleNav:
|
|
5484
|
-
isNavigationPaneOpen:
|
|
5485
|
-
setNavigationPaneOpen:
|
|
5511
|
+
collapsibleNav: se,
|
|
5512
|
+
isNavigationPaneOpen: U,
|
|
5513
|
+
setNavigationPaneOpen: j
|
|
5486
5514
|
}
|
|
5487
5515
|
),
|
|
5488
|
-
/* @__PURE__ */
|
|
5516
|
+
/* @__PURE__ */ d(
|
|
5489
5517
|
Hn,
|
|
5490
5518
|
{
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5519
|
+
actions: n,
|
|
5520
|
+
onCreateFolder: s,
|
|
5521
|
+
onRename: p,
|
|
5522
|
+
onFileOpen: S,
|
|
5523
|
+
onRefresh: v,
|
|
5524
|
+
enableFilePreview: P,
|
|
5525
|
+
triggerAction: G,
|
|
5526
|
+
permissions: re,
|
|
5527
|
+
formatDate: W
|
|
5499
5528
|
}
|
|
5500
5529
|
)
|
|
5501
5530
|
]
|
|
@@ -5504,20 +5533,20 @@ const Q$ = ({
|
|
|
5504
5533
|
]
|
|
5505
5534
|
}
|
|
5506
5535
|
),
|
|
5507
|
-
/* @__PURE__ */
|
|
5536
|
+
/* @__PURE__ */ d(
|
|
5508
5537
|
o6,
|
|
5509
5538
|
{
|
|
5510
|
-
fileUploadConfig:
|
|
5511
|
-
onFileUploading:
|
|
5512
|
-
onFileUploaded:
|
|
5513
|
-
onDelete:
|
|
5514
|
-
onRefresh:
|
|
5515
|
-
maxFileSize:
|
|
5516
|
-
filePreviewPath:
|
|
5517
|
-
filePreviewComponent:
|
|
5518
|
-
acceptedFileTypes:
|
|
5519
|
-
triggerAction:
|
|
5520
|
-
permissions:
|
|
5539
|
+
fileUploadConfig: t,
|
|
5540
|
+
onFileUploading: a,
|
|
5541
|
+
onFileUploaded: l,
|
|
5542
|
+
onDelete: h,
|
|
5543
|
+
onRefresh: v,
|
|
5544
|
+
maxFileSize: b,
|
|
5545
|
+
filePreviewPath: w,
|
|
5546
|
+
filePreviewComponent: T,
|
|
5547
|
+
acceptedFileTypes: $,
|
|
5548
|
+
triggerAction: G,
|
|
5549
|
+
permissions: re
|
|
5521
5550
|
}
|
|
5522
5551
|
)
|
|
5523
5552
|
] }) })
|
|
@@ -5535,7 +5564,8 @@ Vn.propTypes = {
|
|
|
5535
5564
|
isDirectory: I.bool.isRequired,
|
|
5536
5565
|
path: I.string.isRequired,
|
|
5537
5566
|
updatedAt: a6,
|
|
5538
|
-
size: I.number
|
|
5567
|
+
size: I.number,
|
|
5568
|
+
class: I.string
|
|
5539
5569
|
})
|
|
5540
5570
|
).isRequired,
|
|
5541
5571
|
fileUploadConfig: I.shape({
|