@cubone/react-file-manager 1.26.2 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -35
- package/dist/react-file-manager.es.js +732 -722
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as c, jsxs as z, Fragment as fe } from "react/jsx-runtime";
|
|
2
2
|
import * as Re from "react";
|
|
3
|
-
import $e, { useState as R, useRef as
|
|
3
|
+
import $e, { useState as R, useRef as re, useEffect as Q, createContext as Pe, useContext as Le, useLayoutEffect as Bn, useCallback as cn, useMemo as Ge } from "react";
|
|
4
4
|
var dn = {
|
|
5
5
|
color: void 0,
|
|
6
6
|
size: void 0,
|
|
@@ -217,7 +217,7 @@ function ut(n) {
|
|
|
217
217
|
}
|
|
218
218
|
const Me = (n = () => {
|
|
219
219
|
}) => {
|
|
220
|
-
const [e, t] = R(!1), o =
|
|
220
|
+
const [e, t] = R(!1), o = re(null), s = (i) => {
|
|
221
221
|
var r;
|
|
222
222
|
(r = o.current) != null && r.contains(i.target) ? t(!1) : (t(!0), n(i, o));
|
|
223
223
|
};
|
|
@@ -230,7 +230,7 @@ const Me = (n = () => {
|
|
|
230
230
|
return ["list", "grid"].includes(i) ? i : "grid";
|
|
231
231
|
}
|
|
232
232
|
return /* @__PURE__ */ c(bn.Provider, { value: { activeLayout: t, setActiveLayout: o }, children: n });
|
|
233
|
-
}, ye = () => Le(bn),
|
|
233
|
+
}, ye = () => Le(bn), B = (n) => typeof n == "string", Ae = () => {
|
|
234
234
|
let n, e;
|
|
235
235
|
const t = new Promise((o, s) => {
|
|
236
236
|
n = o, e = s;
|
|
@@ -240,8 +240,8 @@ const Me = (n = () => {
|
|
|
240
240
|
n.forEach((o) => {
|
|
241
241
|
e[o] && (t[o] = e[o]);
|
|
242
242
|
});
|
|
243
|
-
}, po = /###/g, Lt = (n) => n && n.indexOf("###") > -1 ? n.replace(po, ".") : n, Tt = (n) => !n ||
|
|
244
|
-
const o =
|
|
243
|
+
}, po = /###/g, Lt = (n) => n && n.indexOf("###") > -1 ? n.replace(po, ".") : n, Tt = (n) => !n || B(n), ze = (n, e, t) => {
|
|
244
|
+
const o = B(e) ? e.split(".") : e;
|
|
245
245
|
let s = 0;
|
|
246
246
|
for (; s < o.length - 1; ) {
|
|
247
247
|
if (Tt(n)) return {};
|
|
@@ -283,7 +283,7 @@ const Me = (n = () => {
|
|
|
283
283
|
return o !== void 0 ? o : Be(e, t);
|
|
284
284
|
}, xn = (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]) : xn(n[o], e[o], t) : n[o] = e[o]);
|
|
287
287
|
return n;
|
|
288
288
|
}, Se = (n) => n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
289
289
|
var go = {
|
|
@@ -294,7 +294,7 @@ var go = {
|
|
|
294
294
|
"'": "'",
|
|
295
295
|
"/": "/"
|
|
296
296
|
};
|
|
297
|
-
const vo = (n) =>
|
|
297
|
+
const vo = (n) => B(n) ? n.replace(/[&<>"'\/]/g, (e) => go[e]) : n;
|
|
298
298
|
class $o {
|
|
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, s) {
|
|
388
|
-
return s && !this.debug ? null : (
|
|
388
|
+
return s && !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, {
|
|
@@ -452,9 +452,9 @@ class zt extends Je {
|
|
|
452
452
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
453
453
|
const i = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, r = s.ignoreJSONStructure !== void 0 ? s.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) && i ? l.push(...o.split(i)) : l.push(o)));
|
|
456
456
|
const a = Be(this.data, l);
|
|
457
|
-
return !a && !t && !o && e.indexOf(".") > -1 && (e = l[0], t = l[1], o = l.slice(2).join(".")), a || !r || !
|
|
457
|
+
return !a && !t && !o && e.indexOf(".") > -1 && (e = l[0], t = l[1], o = l.slice(2).join(".")), a || !r || !B(o) ? a : ft((u = (d = this.data) == null ? void 0 : d[e]) == null ? void 0 : u[t], o, i);
|
|
458
458
|
}
|
|
459
459
|
addResource(e, t, o, s) {
|
|
460
460
|
let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
@@ -469,7 +469,7 @@ class zt extends Je {
|
|
|
469
469
|
silent: !1
|
|
470
470
|
};
|
|
471
471
|
for (const i in o)
|
|
472
|
-
(
|
|
472
|
+
(B(o[i]) || Array.isArray(o[i])) && this.addResource(e, t, i, o[i], {
|
|
473
473
|
silent: !0
|
|
474
474
|
});
|
|
475
475
|
s.silent || this.emit("added", e, t, o);
|
|
@@ -518,7 +518,7 @@ var Cn = {
|
|
|
518
518
|
}), e;
|
|
519
519
|
}
|
|
520
520
|
};
|
|
521
|
-
const Rt = {}, Ot = (n) => !
|
|
521
|
+
const Rt = {}, 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 (a && a.length > 0)
|
|
548
548
|
return {
|
|
549
549
|
key: e,
|
|
550
|
-
namespaces:
|
|
550
|
+
namespaces: B(i) ? [i] : i
|
|
551
551
|
};
|
|
552
552
|
const d = e.split(o);
|
|
553
553
|
(o !== s || o === s && this.options.ns.indexOf(d[0]) > -1) && (i = d.shift()), e = d.join(s);
|
|
554
554
|
}
|
|
555
555
|
return {
|
|
556
556
|
key: e,
|
|
557
|
-
namespaces:
|
|
557
|
+
namespaces: B(i) ? [i] : i
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
560
|
translate(e, t, o) {
|
|
@@ -568,15 +568,15 @@ class Ke extends Je {
|
|
|
568
568
|
} = this.extractFromKey(e[e.length - 1], t), a = l[l.length - 1], d = t.lng || this.language, u = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
569
569
|
if ((d == null ? void 0 : d.toLowerCase()) === "cimode") {
|
|
570
570
|
if (u) {
|
|
571
|
-
const
|
|
571
|
+
const C = t.nsSeparator || this.options.nsSeparator;
|
|
572
572
|
return s ? {
|
|
573
|
-
res: `${a}${
|
|
573
|
+
res: `${a}${C}${r}`,
|
|
574
574
|
usedKey: r,
|
|
575
575
|
exactUsedKey: r,
|
|
576
576
|
usedLng: d,
|
|
577
577
|
usedNS: a,
|
|
578
578
|
usedParams: this.getUsedParamsDetails(t)
|
|
579
|
-
} : `${a}${
|
|
579
|
+
} : `${a}${C}${r}`;
|
|
580
580
|
}
|
|
581
581
|
return s ? {
|
|
582
582
|
res: r,
|
|
@@ -587,29 +587,29 @@ class Ke extends Je {
|
|
|
587
587
|
usedParams: this.getUsedParamsDetails(t)
|
|
588
588
|
} : r;
|
|
589
589
|
}
|
|
590
|
-
const
|
|
591
|
-
let
|
|
592
|
-
const h = (
|
|
590
|
+
const f = this.resolve(e, t);
|
|
591
|
+
let p = f == null ? void 0 : f.res;
|
|
592
|
+
const h = (f == null ? void 0 : f.usedKey) || r, m = (f == null ? void 0 : f.exactUsedKey) || r, v = ["[object Number]", "[object Function]", "[object RegExp]"], S = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, N = !this.i18nFormat || this.i18nFormat.handleAsObject, O = t.count !== void 0 && !B(t.count), F = Ke.hasDefaultValue(t), L = O ? this.pluralResolver.getSuffix(d, t.count, t) : "", g = t.ordinal && O ? this.pluralResolver.getSuffix(d, t.count, {
|
|
593
593
|
ordinal: !1
|
|
594
594
|
}) : "", T = O && !t.ordinal && t.count === 0, x = T && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${L}`] || t[`defaultValue${g}`] || t.defaultValue;
|
|
595
|
-
let w =
|
|
596
|
-
N && !
|
|
595
|
+
let w = p;
|
|
596
|
+
N && !p && F && (w = x);
|
|
597
597
|
const $ = Ot(w), b = Object.prototype.toString.apply(w);
|
|
598
|
-
if (N && w && $ && v.indexOf(b) < 0 && !(
|
|
598
|
+
if (N && w && $ && v.indexOf(b) < 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 '${r} (${this.language})' returned an object instead of string.`;
|
|
605
|
-
return s ? (
|
|
605
|
+
return s ? (f.res = C, f.usedParams = this.getUsedParamsDetails(t), f) : C;
|
|
606
606
|
}
|
|
607
607
|
if (i) {
|
|
608
|
-
const
|
|
608
|
+
const C = Array.isArray(w), E = C ? [] : {}, M = C ? m : h;
|
|
609
609
|
for (const k in w)
|
|
610
610
|
if (Object.prototype.hasOwnProperty.call(w, k)) {
|
|
611
611
|
const _ = `${M}${i}${k}`;
|
|
612
|
-
F && !
|
|
612
|
+
F && !p ? E[k] = this.translate(_, {
|
|
613
613
|
...t,
|
|
614
614
|
defaultValue: Ot(x) ? x[k] : void 0,
|
|
615
615
|
joinArrays: !1,
|
|
@@ -620,43 +620,43 @@ class Ke extends Je {
|
|
|
620
620
|
ns: l
|
|
621
621
|
}), E[k] === _ && (E[k] = w[k]);
|
|
622
622
|
}
|
|
623
|
-
|
|
623
|
+
p = E;
|
|
624
624
|
}
|
|
625
|
-
} else if (N &&
|
|
626
|
-
|
|
625
|
+
} else if (N && B(S) && Array.isArray(p))
|
|
626
|
+
p = p.join(S), p && (p = this.extendTranslation(p, e, t, o));
|
|
627
627
|
else {
|
|
628
|
-
let
|
|
629
|
-
!this.isValidLookup(
|
|
630
|
-
const k = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && E ? void 0 :
|
|
631
|
-
if (E ||
|
|
632
|
-
if (this.logger.log(_ ? "updateKey" : "missingKey", d, a, r, _ ? x :
|
|
633
|
-
const
|
|
628
|
+
let C = !1, E = !1;
|
|
629
|
+
!this.isValidLookup(p) && F && (C = !0, p = x), this.isValidLookup(p) || (E = !0, p = r);
|
|
630
|
+
const k = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && E ? void 0 : p, _ = F && x !== p && this.options.updateMissing;
|
|
631
|
+
if (E || C || _) {
|
|
632
|
+
if (this.logger.log(_ ? "updateKey" : "missingKey", d, a, r, _ ? x : p), i) {
|
|
633
|
+
const q = this.resolve(r, {
|
|
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
639
|
let J = [];
|
|
640
|
-
const
|
|
641
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
642
|
-
for (let
|
|
643
|
-
J.push(
|
|
640
|
+
const ne = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
641
|
+
if (this.options.saveMissingTo === "fallback" && ne && ne[0])
|
|
642
|
+
for (let q = 0; q < ne.length; q++)
|
|
643
|
+
J.push(ne[q]);
|
|
644
644
|
else this.options.saveMissingTo === "all" ? J = this.languageUtils.toResolveHierarchy(t.lng || this.language) : J.push(t.lng || this.language);
|
|
645
|
-
const
|
|
646
|
-
var
|
|
647
|
-
const
|
|
648
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
645
|
+
const se = (q, y, P) => {
|
|
646
|
+
var V;
|
|
647
|
+
const j = F && P !== p ? P : k;
|
|
648
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(q, a, y, j, _, t) : (V = this.backendConnector) != null && V.saveMissing && this.backendConnector.saveMissing(q, a, y, j, _, t), this.emit("missingKey", q, a, y, p);
|
|
649
649
|
};
|
|
650
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && O ? J.forEach((
|
|
651
|
-
const y = this.pluralResolver.getSuffixes(
|
|
650
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && O ? J.forEach((q) => {
|
|
651
|
+
const y = this.pluralResolver.getSuffixes(q, t);
|
|
652
652
|
T && t[`defaultValue${this.options.pluralSeparator}zero`] && y.indexOf(`${this.options.pluralSeparator}zero`) < 0 && y.push(`${this.options.pluralSeparator}zero`), y.forEach((P) => {
|
|
653
|
-
|
|
653
|
+
se([q], r + P, t[`defaultValue${P}`] || x);
|
|
654
654
|
});
|
|
655
|
-
}) :
|
|
655
|
+
}) : se(J, r, x));
|
|
656
656
|
}
|
|
657
|
-
|
|
657
|
+
p = this.extendTranslation(p, e, t, f, o), E && p === r && this.options.appendNamespaceToMissingKey && (p = `${a}:${r}`), (E || C) && this.options.parseMissingKeyHandler && (p = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${a}:${r}` : r, C ? p : void 0));
|
|
658
658
|
}
|
|
659
|
-
return s ? (
|
|
659
|
+
return s ? (f.res = p, f.usedParams = this.getUsedParamsDetails(t), f) : p;
|
|
660
660
|
}
|
|
661
661
|
extendTranslation(e, t, o, s, i) {
|
|
662
662
|
var d, u;
|
|
@@ -676,27 +676,27 @@ class Ke extends Je {
|
|
|
676
676
|
...o.interpolation
|
|
677
677
|
}
|
|
678
678
|
});
|
|
679
|
-
const
|
|
680
|
-
let
|
|
681
|
-
if (
|
|
679
|
+
const f = 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 p;
|
|
681
|
+
if (f) {
|
|
682
682
|
const m = e.match(this.interpolator.nestingRegexp);
|
|
683
|
-
|
|
683
|
+
p = 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 || s.usedLng, o),
|
|
689
|
+
}), e = this.interpolator.interpolate(e, h, o.lng || this.language || s.usedLng, o), f) {
|
|
690
690
|
const m = e.match(this.interpolator.nestingRegexp), v = m && m.length;
|
|
691
|
-
|
|
691
|
+
p < v && (o.nest = !1);
|
|
692
692
|
}
|
|
693
693
|
!o.lng && s && s.res && (o.lng = this.language || s.usedLng), o.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
694
|
-
for (var m = arguments.length, v = new Array(m),
|
|
695
|
-
v[
|
|
694
|
+
for (var m = arguments.length, v = new Array(m), S = 0; S < m; S++)
|
|
695
|
+
v[S] = arguments[S];
|
|
696
696
|
return (i == null ? void 0 : i[0]) === v[0] && !o.context ? (r.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${t[0]}`), null) : r.translate(...v, t);
|
|
697
697
|
}, o)), o.interpolation && this.interpolator.reset();
|
|
698
698
|
}
|
|
699
|
-
const l = o.postProcess || this.options.postProcess, a =
|
|
699
|
+
const l = o.postProcess || this.options.postProcess, a = B(l) ? [l] : l;
|
|
700
700
|
return e != null && (a != null && a.length) && o.applyPostProcessor !== !1 && (e = Cn.handle(a, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
701
701
|
i18nResolved: {
|
|
702
702
|
...s,
|
|
@@ -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, s, i, r, l;
|
|
710
|
-
return
|
|
710
|
+
return B(e) && (e = [e]), e.forEach((a) => {
|
|
711
711
|
if (this.isValidLookup(o)) return;
|
|
712
712
|
const d = this.extractFromKey(a, t), u = d.key;
|
|
713
713
|
s = u;
|
|
714
|
-
let
|
|
715
|
-
this.options.fallbackNS && (
|
|
716
|
-
const
|
|
717
|
-
|
|
714
|
+
let f = d.namespaces;
|
|
715
|
+
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
716
|
+
const p = t.count !== void 0 && !B(t.count), h = p && !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
|
+
f.forEach((S) => {
|
|
718
718
|
var N, O;
|
|
719
|
-
this.isValidLookup(o) || (l =
|
|
719
|
+
this.isValidLookup(o) || (l = S, !Rt[`${v[0]}-${S}`] && ((N = this.utils) != null && N.hasLoadedNamespace) && !((O = this.utils) != null && O.hasLoadedNamespace(l)) && (Rt[`${v[0]}-${S}`] = !0, this.logger.warn(`key "${s}" 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((F) => {
|
|
720
720
|
var T;
|
|
721
721
|
if (this.isValidLookup(o)) return;
|
|
722
722
|
r = F;
|
|
723
723
|
const L = [u];
|
|
724
724
|
if ((T = this.i18nFormat) != null && T.addLookupKeys)
|
|
725
|
-
this.i18nFormat.addLookupKeys(L, u, F,
|
|
725
|
+
this.i18nFormat.addLookupKeys(L, u, F, S, t);
|
|
726
726
|
else {
|
|
727
727
|
let x;
|
|
728
|
-
|
|
728
|
+
p && (x = this.pluralResolver.getSuffix(F, t.count, t));
|
|
729
729
|
const w = `${this.options.pluralSeparator}zero`, $ = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
730
|
-
if (
|
|
730
|
+
if (p && (L.push(u + x), t.ordinal && x.indexOf($) === 0 && L.push(u + x.replace($, this.options.pluralSeparator)), h && L.push(u + w)), m) {
|
|
731
731
|
const b = `${u}${this.options.contextSeparator}${t.context}`;
|
|
732
|
-
L.push(b),
|
|
732
|
+
L.push(b), p && (L.push(b + x), t.ordinal && x.indexOf($) === 0 && L.push(b + x.replace($, this.options.pluralSeparator)), h && L.push(b + w));
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
735
|
let g;
|
|
736
736
|
for (; g = L.pop(); )
|
|
737
|
-
this.isValidLookup(o) || (i = g, o = this.getResource(F,
|
|
737
|
+
this.isValidLookup(o) || (i = g, o = this.getResource(F, 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 s = o ? e.replace : e;
|
|
760
760
|
if (o && typeof e.count < "u" && (s.count = e.count), this.options.interpolation.defaultVariables && (s = {
|
|
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), s = [], i = (r) => {
|
|
837
837
|
r && (this.isSupportedCode(r) ? s.push(r) : this.logger.warn(`rejecting language code not found in supportedLngs: ${r}`));
|
|
838
838
|
};
|
|
839
|
-
return
|
|
839
|
+
return B(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && i(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && i(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && i(this.getLanguagePartFromCode(e))) : B(e) && i(this.formatLanguageCode(e)), o.forEach((r) => {
|
|
840
840
|
s.indexOf(r) < 0 && i(this.formatLanguageCode(r));
|
|
841
841
|
}), s;
|
|
842
842
|
}
|
|
@@ -907,7 +907,7 @@ class Co {
|
|
|
907
907
|
}
|
|
908
908
|
const Dt = function(n, e, t) {
|
|
909
909
|
let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, i = mo(n, e, t);
|
|
910
|
-
return !i && s &&
|
|
910
|
+
return !i && s && B(t) && (i = ft(n, t, o), i === void 0 && (i = ft(e, t, o))), i;
|
|
911
911
|
}, tt = (n) => n.replace(/\$/g, "$$$$");
|
|
912
912
|
class So {
|
|
913
913
|
constructor() {
|
|
@@ -930,16 +930,16 @@ class So {
|
|
|
930
930
|
suffixEscaped: a,
|
|
931
931
|
formatSeparator: d,
|
|
932
932
|
unescapeSuffix: u,
|
|
933
|
-
unescapePrefix:
|
|
934
|
-
nestingPrefix:
|
|
933
|
+
unescapePrefix: f,
|
|
934
|
+
nestingPrefix: p,
|
|
935
935
|
nestingPrefixEscaped: h,
|
|
936
936
|
nestingSuffix: m,
|
|
937
937
|
nestingSuffixEscaped: v,
|
|
938
|
-
nestingOptionsSeparator:
|
|
938
|
+
nestingOptionsSeparator: S,
|
|
939
939
|
maxReplaces: N,
|
|
940
940
|
alwaysFormat: O
|
|
941
941
|
} = e.interpolation;
|
|
942
|
-
this.escape = t !== void 0 ? t : vo, this.escapeValue = o !== void 0 ? o : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = i ? Se(i) : r || "{{", this.suffix = l ? Se(l) : a || "}}", this.formatSeparator = d || ",", this.unescapePrefix = u ? "" :
|
|
942
|
+
this.escape = t !== void 0 ? t : vo, this.escapeValue = o !== void 0 ? o : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = i ? Se(i) : r || "{{", this.suffix = l ? Se(l) : a || "}}", this.formatSeparator = d || ",", this.unescapePrefix = u ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : u || "", this.nestingPrefix = p ? Se(p) : h || Se("$t("), this.nestingSuffix = m ? Se(m) : v || Se(")"), this.nestingOptionsSeparator = S || ",", this.maxReplaces = N || 1e3, this.alwaysFormat = O !== void 0 ? O : !1, this.resetRegExp();
|
|
943
943
|
}
|
|
944
944
|
reset() {
|
|
945
945
|
this.options && this.init(this.options);
|
|
@@ -960,15 +960,15 @@ class So {
|
|
|
960
960
|
interpolationkey: m
|
|
961
961
|
}) : O;
|
|
962
962
|
}
|
|
963
|
-
const v = m.split(this.formatSeparator),
|
|
964
|
-
return this.format(Dt(t, a,
|
|
963
|
+
const v = m.split(this.formatSeparator), S = v.shift().trim(), N = v.join(this.formatSeparator).trim();
|
|
964
|
+
return this.format(Dt(t, a, S, this.options.keySeparator, this.options.ignoreJSONStructure), N, o, {
|
|
965
965
|
...s,
|
|
966
966
|
...t,
|
|
967
|
-
interpolationkey:
|
|
967
|
+
interpolationkey: S
|
|
968
968
|
});
|
|
969
969
|
};
|
|
970
970
|
this.resetRegExp();
|
|
971
|
-
const u = (s == null ? void 0 : s.missingInterpolationHandler) || this.options.missingInterpolationHandler,
|
|
971
|
+
const u = (s == null ? void 0 : s.missingInterpolationHandler) || this.options.missingInterpolationHandler, f = ((h = s == null ? void 0 : s.interpolation) == null ? void 0 : h.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
972
972
|
return [{
|
|
973
973
|
regex: this.regexpUnescape,
|
|
974
974
|
safeValue: (m) => tt(m)
|
|
@@ -981,17 +981,17 @@ class So {
|
|
|
981
981
|
if (r = d(v), r === void 0)
|
|
982
982
|
if (typeof u == "function") {
|
|
983
983
|
const N = u(e, i, s);
|
|
984
|
-
r =
|
|
984
|
+
r = B(N) ? N : "";
|
|
985
985
|
} else if (s && Object.prototype.hasOwnProperty.call(s, v))
|
|
986
986
|
r = "";
|
|
987
|
-
else if (
|
|
987
|
+
else if (f) {
|
|
988
988
|
r = i[0];
|
|
989
989
|
continue;
|
|
990
990
|
} else
|
|
991
991
|
this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`), r = "";
|
|
992
|
-
else !
|
|
993
|
-
const
|
|
994
|
-
if (e = e.replace(i[0],
|
|
992
|
+
else !B(r) && !this.useRawValueToEscape && (r = Pt(r));
|
|
993
|
+
const S = m.safeValue(r);
|
|
994
|
+
if (e = e.replace(i[0], S), f ? (m.regex.lastIndex += r.length, m.regex.lastIndex -= i[0].length) : m.regex.lastIndex = 0, l++, l >= this.maxReplaces)
|
|
995
995
|
break;
|
|
996
996
|
}
|
|
997
997
|
}), e;
|
|
@@ -1001,18 +1001,18 @@ class So {
|
|
|
1001
1001
|
const l = (a, d) => {
|
|
1002
1002
|
const u = this.nestingOptionsSeparator;
|
|
1003
1003
|
if (a.indexOf(u) < 0) return a;
|
|
1004
|
-
const
|
|
1005
|
-
let
|
|
1006
|
-
a =
|
|
1007
|
-
const h =
|
|
1008
|
-
(((h == null ? void 0 : h.length) ?? 0) % 2 === 0 && !m || m.length % 2 !== 0) && (
|
|
1004
|
+
const f = a.split(new RegExp(`${u}[ ]*{`));
|
|
1005
|
+
let p = `{${f[1]}`;
|
|
1006
|
+
a = f[0], p = this.interpolate(p, r);
|
|
1007
|
+
const h = p.match(/'/g), m = p.match(/"/g);
|
|
1008
|
+
(((h == null ? void 0 : h.length) ?? 0) % 2 === 0 && !m || m.length % 2 !== 0) && (p = p.replace(/'/g, '"'));
|
|
1009
1009
|
try {
|
|
1010
|
-
r = JSON.parse(
|
|
1010
|
+
r = JSON.parse(p), d && (r = {
|
|
1011
1011
|
...d,
|
|
1012
1012
|
...r
|
|
1013
1013
|
});
|
|
1014
1014
|
} catch (v) {
|
|
1015
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${a}`, v), `${a}${u}${
|
|
1015
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${a}`, v), `${a}${u}${p}`;
|
|
1016
1016
|
}
|
|
1017
1017
|
return r.defaultValue && r.defaultValue.indexOf(this.prefix) > -1 && delete r.defaultValue, a;
|
|
1018
1018
|
};
|
|
@@ -1020,14 +1020,14 @@ class So {
|
|
|
1020
1020
|
let a = [];
|
|
1021
1021
|
r = {
|
|
1022
1022
|
...o
|
|
1023
|
-
}, r = r.replace && !
|
|
1023
|
+
}, r = r.replace && !B(r.replace) ? r.replace : r, r.applyPostProcessor = !1, delete r.defaultValue;
|
|
1024
1024
|
let d = !1;
|
|
1025
1025
|
if (s[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(s[1])) {
|
|
1026
|
-
const u = s[1].split(this.formatSeparator).map((
|
|
1026
|
+
const u = s[1].split(this.formatSeparator).map((f) => f.trim());
|
|
1027
1027
|
s[1] = u.shift(), a = u, d = !0;
|
|
1028
1028
|
}
|
|
1029
|
-
if (i = t(l.call(this, s[1].trim(), r), r), i && s[0] === e && !
|
|
1030
|
-
|
|
1029
|
+
if (i = t(l.call(this, s[1].trim(), r), r), i && s[0] === e && !B(i)) return i;
|
|
1030
|
+
B(i) || (i = Pt(i)), i || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), i = ""), d && (i = a.reduce((u, f) => this.format(u, f, o.lng, {
|
|
1031
1031
|
...o,
|
|
1032
1032
|
interpolationkey: s[1].trim()
|
|
1033
1033
|
}), i.trim())), e = e.replace(s[0], i), this.regexp.lastIndex = 0;
|
|
@@ -1123,16 +1123,16 @@ class No {
|
|
|
1123
1123
|
i[0] = [i[0], ...i.splice(1, l)].join(this.formatSeparator);
|
|
1124
1124
|
}
|
|
1125
1125
|
return i.reduce((l, a) => {
|
|
1126
|
-
var
|
|
1126
|
+
var f;
|
|
1127
1127
|
const {
|
|
1128
1128
|
formatName: d,
|
|
1129
1129
|
formatOptions: u
|
|
1130
1130
|
} = Fo(a);
|
|
1131
1131
|
if (this.formats[d]) {
|
|
1132
|
-
let
|
|
1132
|
+
let p = l;
|
|
1133
1133
|
try {
|
|
1134
|
-
const h = ((
|
|
1135
|
-
|
|
1134
|
+
const h = ((f = s == null ? void 0 : s.formatParams) == null ? void 0 : f[s.interpolationkey]) || {}, m = h.locale || h.lng || s.locale || s.lng || o;
|
|
1135
|
+
p = this.formats[d](l, m, {
|
|
1136
1136
|
...u,
|
|
1137
1137
|
...s,
|
|
1138
1138
|
...h
|
|
@@ -1140,7 +1140,7 @@ class No {
|
|
|
1140
1140
|
} catch (h) {
|
|
1141
1141
|
this.logger.warn(h);
|
|
1142
1142
|
}
|
|
1143
|
-
return
|
|
1143
|
+
return p;
|
|
1144
1144
|
} else
|
|
1145
1145
|
this.logger.warn(`there was no format function for ${d}`);
|
|
1146
1146
|
return l;
|
|
@@ -1160,9 +1160,9 @@ class Po extends Je {
|
|
|
1160
1160
|
const i = {}, r = {}, l = {}, a = {};
|
|
1161
1161
|
return e.forEach((d) => {
|
|
1162
1162
|
let u = !0;
|
|
1163
|
-
t.forEach((
|
|
1164
|
-
const
|
|
1165
|
-
!o.reload && this.store.hasResourceBundle(d,
|
|
1163
|
+
t.forEach((f) => {
|
|
1164
|
+
const p = `${d}|${f}`;
|
|
1165
|
+
!o.reload && this.store.hasResourceBundle(d, f) ? this.state[p] = 2 : this.state[p] < 0 || (this.state[p] === 1 ? r[p] === void 0 && (r[p] = !0) : (this.state[p] = 1, u = !1, r[p] === void 0 && (r[p] = !0), i[p] === void 0 && (i[p] = !0), a[f] === void 0 && (a[f] = !0)));
|
|
1166
1166
|
}), u || (l[d] = !0);
|
|
1167
1167
|
}), (Object.keys(i).length || Object.keys(r).length) && this.queue.push({
|
|
1168
1168
|
pending: r,
|
|
@@ -1187,8 +1187,8 @@ class Po extends Je {
|
|
|
1187
1187
|
ho(a.loaded, [i], r), Eo(a, e), t && a.errors.push(t), a.pendingCount === 0 && !a.done && (Object.keys(a.loaded).forEach((d) => {
|
|
1188
1188
|
l[d] || (l[d] = {});
|
|
1189
1189
|
const u = a.loaded[d];
|
|
1190
|
-
u.length && u.forEach((
|
|
1191
|
-
l[d][
|
|
1190
|
+
u.length && u.forEach((f) => {
|
|
1191
|
+
l[d][f] === void 0 && (l[d][f] = !0);
|
|
1192
1192
|
});
|
|
1193
1193
|
}), a.done = !0, a.errors.length ? a.callback(a.errors) : a.callback());
|
|
1194
1194
|
}), this.emit("loaded", l), this.queue = this.queue.filter((a) => !a.done);
|
|
@@ -1210,8 +1210,8 @@ class Po extends Je {
|
|
|
1210
1210
|
this.readingCalls++;
|
|
1211
1211
|
const l = (d, u) => {
|
|
1212
1212
|
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
1213
|
-
const
|
|
1214
|
-
this.read(
|
|
1213
|
+
const f = this.waitingReads.shift();
|
|
1214
|
+
this.read(f.lng, f.ns, f.fcName, f.tried, f.wait, f.callback);
|
|
1215
1215
|
}
|
|
1216
1216
|
if (d && u && s < this.maxRetries) {
|
|
1217
1217
|
setTimeout(() => {
|
|
@@ -1236,7 +1236,7 @@ class Po extends Je {
|
|
|
1236
1236
|
let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = 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."), s && s();
|
|
1239
|
-
|
|
1239
|
+
B(e) && (e = this.languageUtils.toResolveHierarchy(e)), B(t) && (t = [t]);
|
|
1240
1240
|
const i = this.queueLoad(e, t, o, s);
|
|
1241
1241
|
if (!i.toLoad.length)
|
|
1242
1242
|
return i.pending.length || s(), null;
|
|
@@ -1260,15 +1260,15 @@ class Po extends Je {
|
|
|
1260
1260
|
});
|
|
1261
1261
|
}
|
|
1262
1262
|
saveMissing(e, t, o, s, i) {
|
|
1263
|
-
var a, d, u,
|
|
1263
|
+
var a, d, u, f, p;
|
|
1264
1264
|
let r = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, l = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
|
|
1265
1265
|
};
|
|
1266
|
-
if ((d = (a = this.services) == null ? void 0 : a.utils) != null && d.hasLoadedNamespace && !((
|
|
1266
|
+
if ((d = (a = this.services) == null ? void 0 : a.utils) != null && d.hasLoadedNamespace && !((f = (u = this.services) == null ? void 0 : u.utils) != null && f.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 ((p = this.backend) != null && p.create) {
|
|
1272
1272
|
const h = {
|
|
1273
1273
|
...r,
|
|
1274
1274
|
isUpdate: i
|
|
@@ -1276,7 +1276,7 @@ class Po extends Je {
|
|
|
1276
1276
|
if (m.length < 6)
|
|
1277
1277
|
try {
|
|
1278
1278
|
let v;
|
|
1279
|
-
m.length === 5 ? v = m(e, t, o, s, h) : v = m(e, t, o, s), v && typeof v.then == "function" ? v.then((
|
|
1279
|
+
m.length === 5 ? v = m(e, t, o, s, h) : v = m(e, t, o, s), v && typeof v.then == "function" ? v.then((S) => l(null, S)).catch(l) : l(null, v);
|
|
1280
1280
|
} catch (v) {
|
|
1281
1281
|
l(v);
|
|
1282
1282
|
}
|
|
@@ -1322,7 +1322,7 @@ const Ut = () => ({
|
|
|
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 Ut = () => ({
|
|
|
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
|
}, ke = () => {
|
|
1350
1350
|
}, Lo = (n) => {
|
|
1351
1351
|
Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t) => {
|
|
@@ -1368,7 +1368,7 @@ class Oe 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 s = Ut();
|
|
1373
1373
|
this.options = {
|
|
1374
1374
|
...s,
|
|
@@ -1383,21 +1383,21 @@ class Oe extends Je {
|
|
|
1383
1383
|
this.modules.logger ? me.init(i(this.modules.logger), this.options) : me.init(null, this.options);
|
|
1384
1384
|
let u;
|
|
1385
1385
|
this.modules.formatter ? u = this.modules.formatter : u = No;
|
|
1386
|
-
const
|
|
1386
|
+
const f = new Mt(this.options);
|
|
1387
1387
|
this.store = new zt(this.options.resources, this.options);
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1388
|
+
const p = this.services;
|
|
1389
|
+
p.logger = me, p.resourceStore = this.store, p.languageUtils = f, p.pluralResolver = new Co(f, {
|
|
1390
1390
|
prepend: this.options.pluralSeparator,
|
|
1391
1391
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1392
|
-
}), u && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (
|
|
1392
|
+
}), u && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (p.formatter = i(u), p.formatter.init(p, this.options), this.options.interpolation.format = p.formatter.format.bind(p.formatter)), p.interpolator = new So(this.options), p.utils = {
|
|
1393
1393
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1394
|
-
},
|
|
1395
|
-
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0),
|
|
1396
|
-
v[
|
|
1394
|
+
}, p.backendConnector = new Po(i(this.modules.backend), p.resourceStore, p, this.options), p.backendConnector.on("*", function(h) {
|
|
1395
|
+
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), S = 1; S < m; S++)
|
|
1396
|
+
v[S - 1] = arguments[S];
|
|
1397
1397
|
e.emit(h, ...v);
|
|
1398
|
-
}), this.modules.languageDetector && (
|
|
1399
|
-
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0),
|
|
1400
|
-
v[
|
|
1398
|
+
}), this.modules.languageDetector && (p.languageDetector = i(this.modules.languageDetector), p.languageDetector.init && p.languageDetector.init(p, this.options.detection, this.options)), this.modules.i18nFormat && (p.i18nFormat = i(this.modules.i18nFormat), p.i18nFormat.init && p.i18nFormat.init(this)), this.translator = new Ke(this.services, this.options), this.translator.on("*", function(h) {
|
|
1399
|
+
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), S = 1; S < m; S++)
|
|
1400
|
+
v[S - 1] = arguments[S];
|
|
1401
1401
|
e.emit(h, ...v);
|
|
1402
1402
|
}), this.modules.external.forEach((h) => {
|
|
1403
1403
|
h.init && h.init(this);
|
|
@@ -1417,8 +1417,8 @@ class Oe extends Je {
|
|
|
1417
1417
|
};
|
|
1418
1418
|
});
|
|
1419
1419
|
const a = Ae(), d = () => {
|
|
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), a.resolve(
|
|
1420
|
+
const u = (f, p) => {
|
|
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), a.resolve(p), o(f, p);
|
|
1422
1422
|
};
|
|
1423
1423
|
if (this.languages && !this.isInitialized) return u(null, this.t.bind(this));
|
|
1424
1424
|
this.changeLanguage(this.options.lng, u);
|
|
@@ -1428,13 +1428,13 @@ class Oe extends Je {
|
|
|
1428
1428
|
loadResources(e) {
|
|
1429
1429
|
var i, r;
|
|
1430
1430
|
let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ke;
|
|
1431
|
-
const s =
|
|
1431
|
+
const s = B(e) ? e : this.language;
|
|
1432
1432
|
if (typeof e == "function" && (o = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1433
1433
|
if ((s == null ? void 0 : s.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return o();
|
|
1434
1434
|
const l = [], a = (d) => {
|
|
1435
1435
|
if (!d || d === "cimode") return;
|
|
1436
|
-
this.services.languageUtils.toResolveHierarchy(d).forEach((
|
|
1437
|
-
|
|
1436
|
+
this.services.languageUtils.toResolveHierarchy(d).forEach((f) => {
|
|
1437
|
+
f !== "cimode" && l.indexOf(f) < 0 && l.push(f);
|
|
1438
1438
|
});
|
|
1439
1439
|
};
|
|
1440
1440
|
s ? a(s) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((u) => a(u)), (r = (i = this.options.preload) == null ? void 0 : i.forEach) == null || r.call(i, (d) => a(d)), this.services.backendConnector.load(l, this.options.ns, (d) => {
|
|
@@ -1478,11 +1478,11 @@ class Oe extends Je {
|
|
|
1478
1478
|
return o.t(...arguments);
|
|
1479
1479
|
});
|
|
1480
1480
|
}, l = (a) => {
|
|
1481
|
-
var u,
|
|
1481
|
+
var u, f;
|
|
1482
1482
|
!e && !a && this.services.languageDetector && (a = []);
|
|
1483
|
-
const d = this.services.languageUtils.getBestMatchFromCodes(
|
|
1484
|
-
d && (this.language || i(d), this.translator.language || this.translator.changeLanguage(d), (
|
|
1485
|
-
r(
|
|
1483
|
+
const d = this.services.languageUtils.getBestMatchFromCodes(B(a) ? [a] : a);
|
|
1484
|
+
d && (this.language || i(d), this.translator.language || this.translator.changeLanguage(d), (f = (u = this.services.languageDetector) == null ? void 0 : u.cacheUserLanguage) == null || f.call(u, d)), this.loadResources(d, (p) => {
|
|
1485
|
+
r(p, d);
|
|
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), s;
|
|
@@ -1492,19 +1492,19 @@ class Oe extends Je {
|
|
|
1492
1492
|
const i = function(r, l) {
|
|
1493
1493
|
let a;
|
|
1494
1494
|
if (typeof l != "object") {
|
|
1495
|
-
for (var d = arguments.length, u = new Array(d > 2 ? d - 2 : 0),
|
|
1496
|
-
u[
|
|
1495
|
+
for (var d = arguments.length, u = new Array(d > 2 ? d - 2 : 0), f = 2; f < d; f++)
|
|
1496
|
+
u[f - 2] = arguments[f];
|
|
1497
1497
|
a = s.options.overloadTranslationOptionHandler([r, l].concat(u));
|
|
1498
1498
|
} else
|
|
1499
1499
|
a = {
|
|
1500
1500
|
...l
|
|
1501
1501
|
};
|
|
1502
1502
|
a.lng = a.lng || i.lng, a.lngs = a.lngs || i.lngs, a.ns = a.ns || i.ns, a.keyPrefix !== "" && (a.keyPrefix = a.keyPrefix || o || i.keyPrefix);
|
|
1503
|
-
const
|
|
1503
|
+
const p = s.options.keySeparator || ".";
|
|
1504
1504
|
let h;
|
|
1505
|
-
return a.keyPrefix && Array.isArray(r) ? h = r.map((m) => `${a.keyPrefix}${
|
|
1505
|
+
return a.keyPrefix && Array.isArray(r) ? h = r.map((m) => `${a.keyPrefix}${p}${m}`) : h = a.keyPrefix ? `${a.keyPrefix}${p}${r}` : r, s.t(h, a);
|
|
1506
1506
|
};
|
|
1507
|
-
return
|
|
1507
|
+
return B(e) ? i.lng = e : i.lngs = e, i.ns = t, i.keyPrefix = o, i;
|
|
1508
1508
|
}
|
|
1509
1509
|
t() {
|
|
1510
1510
|
var s;
|
|
@@ -1541,7 +1541,7 @@ class Oe extends Je {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
loadNamespaces(e, t) {
|
|
1543
1543
|
const o = Ae();
|
|
1544
|
-
return this.options.ns ? (
|
|
1544
|
+
return this.options.ns ? (B(e) && (e = [e]), e.forEach((s) => {
|
|
1545
1545
|
this.options.ns.indexOf(s) < 0 && this.options.ns.push(s);
|
|
1546
1546
|
}), this.loadResources((s) => {
|
|
1547
1547
|
o.resolve(), t && t(s);
|
|
@@ -1549,7 +1549,7 @@ class Oe extends Je {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
loadLanguages(e, t) {
|
|
1551
1551
|
const o = Ae();
|
|
1552
|
-
|
|
1552
|
+
B(e) && (e = [e]);
|
|
1553
1553
|
const s = this.options.preload || [], i = e.filter((r) => s.indexOf(r) < 0 && this.services.languageUtils.isSupportedCode(r));
|
|
1554
1554
|
return i.length ? (this.options.preload = s.concat(i), this.loadResources((r) => {
|
|
1555
1555
|
o.resolve(), t && t(r);
|
|
@@ -1583,8 +1583,8 @@ class Oe extends Je {
|
|
|
1583
1583
|
}, o) {
|
|
1584
1584
|
const l = Object.keys(this.store.data).reduce((a, d) => (a[d] = {
|
|
1585
1585
|
...this.store.data[d]
|
|
1586
|
-
}, Object.keys(a[d]).reduce((u,
|
|
1587
|
-
...a[d][
|
|
1586
|
+
}, Object.keys(a[d]).reduce((u, f) => (u[f] = {
|
|
1587
|
+
...a[d][f]
|
|
1588
1588
|
}, u), {})), {});
|
|
1589
1589
|
i.store = new zt(l, s), i.services.resourceStore = i.store;
|
|
1590
1590
|
}
|
|
@@ -2602,8 +2602,8 @@ const To = "مجلد جديد", Ao = "رفع", zo = "لصق", Ro = "تغيير
|
|
|
2602
2602
|
u = a.name.localeCompare(d.name);
|
|
2603
2603
|
break;
|
|
2604
2604
|
case "size":
|
|
2605
|
-
const
|
|
2606
|
-
u =
|
|
2605
|
+
const f = a.size || 0, p = d.size || 0;
|
|
2606
|
+
u = f - p;
|
|
2607
2607
|
break;
|
|
2608
2608
|
case "modified":
|
|
2609
2609
|
const h = a.updatedAt ? new Date(a.updatedAt).getTime() : 0, m = d.updatedAt ? new Date(d.updatedAt).getTime() : 0;
|
|
@@ -2616,13 +2616,13 @@ const To = "مجلد جديد", Ao = "رفع", zo = "لصق", Ro = "تغيير
|
|
|
2616
2616
|
}, r = [...o].sort(i), l = [...s].sort(i);
|
|
2617
2617
|
return [...r, ...l];
|
|
2618
2618
|
}, Nn = Pe(), sv = ({ children: n, initialPath: e, onFolderChange: t }) => {
|
|
2619
|
-
const { files: o } = Xe(), s =
|
|
2619
|
+
const { files: o } = Xe(), s = re(!1), [i, r] = R(""), [l, a] = R(null), [d, u] = R([]), [f, p] = R({ key: "name", direction: "asc" });
|
|
2620
2620
|
return Q(() => {
|
|
2621
2621
|
Array.isArray(o) && o.length > 0 && (u(() => {
|
|
2622
2622
|
const h = o.filter((m) => m.path === `${i}/${m.name}`);
|
|
2623
|
-
return ov(h,
|
|
2623
|
+
return ov(h, f.key, f.direction);
|
|
2624
2624
|
}), a(() => o.find((h) => h.path === i) ?? null));
|
|
2625
|
-
}, [o, i,
|
|
2625
|
+
}, [o, i, f]), Q(() => {
|
|
2626
2626
|
if (!s.current && Array.isArray(o) && o.length > 0) {
|
|
2627
2627
|
const h = o.some((m) => m.isDirectory && m.path === e) ? e : "";
|
|
2628
2628
|
r(h), s.current = !0;
|
|
@@ -2637,8 +2637,8 @@ const To = "مجلد جديد", Ao = "رفع", zo = "لصق", Ro = "تغيير
|
|
|
2637
2637
|
setCurrentFolder: a,
|
|
2638
2638
|
currentPathFiles: d,
|
|
2639
2639
|
setCurrentPathFiles: u,
|
|
2640
|
-
sortConfig:
|
|
2641
|
-
setSortConfig:
|
|
2640
|
+
sortConfig: f,
|
|
2641
|
+
setSortConfig: p,
|
|
2642
2642
|
onFolderChange: t
|
|
2643
2643
|
},
|
|
2644
2644
|
children: n
|
|
@@ -2655,15 +2655,15 @@ const To = "مجلد جديد", Ao = "رفع", zo = "لصق", Ro = "تغيير
|
|
|
2655
2655
|
} catch (o) {
|
|
2656
2656
|
console.error(o.message);
|
|
2657
2657
|
}
|
|
2658
|
-
}, En = Pe(), iv = ({ children: n, onDownload: e, onSelect: t }) => {
|
|
2659
|
-
const [
|
|
2658
|
+
}, En = Pe(), iv = ({ children: n, onDownload: e, onSelect: t, onSelectionChange: o }) => {
|
|
2659
|
+
const [s, i] = R([]);
|
|
2660
2660
|
Q(() => {
|
|
2661
|
-
|
|
2662
|
-
}, [
|
|
2663
|
-
const
|
|
2664
|
-
xe(e, "onDownload",
|
|
2661
|
+
t == null || t(s), o == null || o(s);
|
|
2662
|
+
}, [s]);
|
|
2663
|
+
const r = () => {
|
|
2664
|
+
xe(e, "onDownload", s);
|
|
2665
2665
|
};
|
|
2666
|
-
return /* @__PURE__ */ c(En.Provider, { value: { selectedFiles:
|
|
2666
|
+
return /* @__PURE__ */ c(En.Provider, { value: { selectedFiles: s, setSelectedFiles: i, handleDownload: r }, children: n });
|
|
2667
2667
|
}, ve = () => Le(En), Pn = Pe(), rv = ({ children: n, onPaste: e, onCut: t, onCopy: o }) => {
|
|
2668
2668
|
const [s, i] = R(null), { selectedFiles: r, setSelectedFiles: l } = ve(), a = (u) => {
|
|
2669
2669
|
i({
|
|
@@ -2672,13 +2672,13 @@ const To = "مجلد جديد", Ao = "رفع", zo = "لصق", Ro = "تغيير
|
|
|
2672
2672
|
}), u ? t && t(r) : o && o(r);
|
|
2673
2673
|
}, d = (u) => {
|
|
2674
2674
|
if (u && !u.isDirectory) return;
|
|
2675
|
-
const
|
|
2676
|
-
xe(e, "onPaste",
|
|
2675
|
+
const f = s.files, p = s.isMoving ? "move" : "copy";
|
|
2676
|
+
xe(e, "onPaste", f, u, p), s.isMoving && i(null), l([]);
|
|
2677
2677
|
};
|
|
2678
2678
|
return /* @__PURE__ */ c(Pn.Provider, { value: { clipBoard: s, setClipBoard: i, handleCutCopy: a, handlePasting: d }, children: n });
|
|
2679
2679
|
}, Ze = () => Le(Pn), Ln = ({ onLayoutChange: n, onRefresh: e, triggerAction: t, permissions: o }) => {
|
|
2680
2680
|
var L;
|
|
2681
|
-
const [s, i] = R(!1), { currentFolder: r } = he(), { selectedFiles: l, setSelectedFiles: a, handleDownload: d } = ve(), { clipBoard: u, setClipBoard:
|
|
2681
|
+
const [s, i] = R(!1), { currentFolder: r } = he(), { selectedFiles: l, setSelectedFiles: a, handleDownload: d } = ve(), { clipBoard: u, setClipBoard: f, handleCutCopy: p, handlePasting: h } = Ze(), { activeLayout: m } = ye(), v = de(), S = [
|
|
2682
2682
|
{
|
|
2683
2683
|
icon: /* @__PURE__ */ c(pn, { size: 17, strokeWidth: 0.3 }),
|
|
2684
2684
|
text: v("newFolder"),
|
|
@@ -2707,7 +2707,7 @@ const To = "مجلد جديد", Ao = "رفع", zo = "لصق", Ro = "تغيير
|
|
|
2707
2707
|
icon: /* @__PURE__ */ c(gn, { size: 16 }),
|
|
2708
2708
|
title: v("refresh"),
|
|
2709
2709
|
onClick: () => {
|
|
2710
|
-
xe(e, "onRefresh"),
|
|
2710
|
+
xe(e, "onRefresh"), f(null);
|
|
2711
2711
|
}
|
|
2712
2712
|
}
|
|
2713
2713
|
];
|
|
@@ -2719,11 +2719,11 @@ const To = "مجلد جديد", Ao = "رفع", zo = "لصق", Ro = "تغيير
|
|
|
2719
2719
|
};
|
|
2720
2720
|
return l.length > 0 ? /* @__PURE__ */ c("div", { className: "toolbar file-selected", children: /* @__PURE__ */ z("div", { className: "file-action-container", children: [
|
|
2721
2721
|
/* @__PURE__ */ z("div", { children: [
|
|
2722
|
-
o.move && /* @__PURE__ */ z("button", { className: "item-action file-action", onClick: () =>
|
|
2722
|
+
o.move && /* @__PURE__ */ z("button", { className: "item-action file-action", onClick: () => p(!0), children: [
|
|
2723
2723
|
/* @__PURE__ */ c(mn, { size: 18 }),
|
|
2724
2724
|
/* @__PURE__ */ c("span", { children: v("cut") })
|
|
2725
2725
|
] }),
|
|
2726
|
-
o.copy && /* @__PURE__ */ z("button", { className: "item-action file-action", onClick: () =>
|
|
2726
|
+
o.copy && /* @__PURE__ */ z("button", { className: "item-action file-action", onClick: () => p(!1), children: [
|
|
2727
2727
|
/* @__PURE__ */ c(fn, { strokeWidth: 0.1, size: 17 }),
|
|
2728
2728
|
/* @__PURE__ */ c("span", { children: v("copy") })
|
|
2729
2729
|
] }),
|
|
@@ -2782,7 +2782,7 @@ const To = "مجلد جديد", Ao = "رفع", zo = "لصق", Ro = "تغيير
|
|
|
2782
2782
|
}
|
|
2783
2783
|
)
|
|
2784
2784
|
] }) }) : /* @__PURE__ */ c("div", { className: "toolbar", children: /* @__PURE__ */ z("div", { className: "fm-toolbar", children: [
|
|
2785
|
-
/* @__PURE__ */ c("div", { children:
|
|
2785
|
+
/* @__PURE__ */ c("div", { children: S.filter((g) => g.permission).map((g, T) => /* @__PURE__ */ z("button", { className: "item-action", onClick: g.onClick, children: [
|
|
2786
2786
|
g.icon,
|
|
2787
2787
|
/* @__PURE__ */ c("span", { children: g.text })
|
|
2788
2788
|
] }, T)) }),
|
|
@@ -2831,7 +2831,7 @@ var cv = class extends Error {
|
|
|
2831
2831
|
}
|
|
2832
2832
|
}, qe = (...n) => lv(n[0], `[react-collapsed] -- ${n[1]}`);
|
|
2833
2833
|
function Tn(n) {
|
|
2834
|
-
const e =
|
|
2834
|
+
const e = re(n);
|
|
2835
2835
|
return Q(() => {
|
|
2836
2836
|
e.current = n;
|
|
2837
2837
|
}), cn((...t) => {
|
|
@@ -2840,10 +2840,10 @@ function Tn(n) {
|
|
|
2840
2840
|
}, []);
|
|
2841
2841
|
}
|
|
2842
2842
|
function dv(n, e, t) {
|
|
2843
|
-
const [o, s] = R(e), i =
|
|
2843
|
+
const [o, s] = R(e), i = re(typeof n < "u"), r = i.current ? n : o, l = Tn(t), a = cn(
|
|
2844
2844
|
(d) => {
|
|
2845
|
-
const
|
|
2846
|
-
i.current || s(
|
|
2845
|
+
const f = typeof d == "function" ? d(r) : d;
|
|
2846
|
+
i.current || s(f), l == null || l(f);
|
|
2847
2847
|
},
|
|
2848
2848
|
[l, r]
|
|
2849
2849
|
);
|
|
@@ -2973,10 +2973,10 @@ function Sv({
|
|
|
2973
2973
|
id: r,
|
|
2974
2974
|
...l
|
|
2975
2975
|
} = {}) {
|
|
2976
|
-
const a = Tn(t), d = $v(r ? `${r}` : void 0), [u,
|
|
2976
|
+
const a = Tn(t), d = $v(r ? `${r}` : void 0), [u, f] = dv(
|
|
2977
2977
|
o,
|
|
2978
2978
|
s
|
|
2979
|
-
),
|
|
2979
|
+
), p = re(u), [h, m] = R(!1), v = fv(), S = i ?? v, N = re(), O = re(), F = re(null), [L, g] = R(null);
|
|
2980
2980
|
xv(F);
|
|
2981
2981
|
const T = `${l.collapsedHeight || 0}px`;
|
|
2982
2982
|
function x(w) {
|
|
@@ -2984,18 +2984,18 @@ function Sv({
|
|
|
2984
2984
|
return;
|
|
2985
2985
|
const $ = F.current;
|
|
2986
2986
|
for (const b in w) {
|
|
2987
|
-
const
|
|
2988
|
-
|
|
2987
|
+
const C = w[b];
|
|
2988
|
+
C ? $.style[b] = C : $.style.removeProperty(b);
|
|
2989
2989
|
}
|
|
2990
2990
|
}
|
|
2991
2991
|
return Cv(() => {
|
|
2992
|
-
if (!F.current || u ===
|
|
2992
|
+
if (!F.current || u === p.current)
|
|
2993
2993
|
return;
|
|
2994
|
-
|
|
2994
|
+
p.current = u;
|
|
2995
2995
|
function $(E) {
|
|
2996
|
-
return
|
|
2996
|
+
return S ? 0 : n ?? wv(E);
|
|
2997
2997
|
}
|
|
2998
|
-
const b = (E) => `height ${$(E)}ms ${e}`,
|
|
2998
|
+
const b = (E) => `height ${$(E)}ms ${e}`, C = (E) => {
|
|
2999
2999
|
function M() {
|
|
3000
3000
|
u ? (x({
|
|
3001
3001
|
height: "",
|
|
@@ -3014,12 +3014,12 @@ function Sv({
|
|
|
3014
3014
|
}), N.current = requestAnimationFrame(() => {
|
|
3015
3015
|
a("expanding");
|
|
3016
3016
|
const E = Bt(F);
|
|
3017
|
-
|
|
3017
|
+
C($(E)), F.current && (F.current.style.transition = b(E), F.current.style.height = `${E}px`);
|
|
3018
3018
|
});
|
|
3019
3019
|
}) : N.current = requestAnimationFrame(() => {
|
|
3020
3020
|
a("collapseStart");
|
|
3021
3021
|
const E = Bt(F);
|
|
3022
|
-
|
|
3022
|
+
C($(E)), x({
|
|
3023
3023
|
transition: b(E),
|
|
3024
3024
|
height: `${E}px`
|
|
3025
3025
|
}), N.current = requestAnimationFrame(() => {
|
|
@@ -3034,52 +3034,52 @@ function Sv({
|
|
|
3034
3034
|
}, [
|
|
3035
3035
|
u,
|
|
3036
3036
|
T,
|
|
3037
|
-
|
|
3037
|
+
S,
|
|
3038
3038
|
n,
|
|
3039
3039
|
e,
|
|
3040
3040
|
a
|
|
3041
3041
|
]), {
|
|
3042
3042
|
isExpanded: u,
|
|
3043
|
-
setExpanded:
|
|
3043
|
+
setExpanded: f,
|
|
3044
3044
|
getToggleProps(w) {
|
|
3045
|
-
const { disabled: $, onClick: b, refKey:
|
|
3045
|
+
const { disabled: $, onClick: b, refKey: C, ...E } = {
|
|
3046
3046
|
refKey: "ref",
|
|
3047
3047
|
onClick() {
|
|
3048
3048
|
},
|
|
3049
3049
|
disabled: !1,
|
|
3050
3050
|
...w
|
|
3051
|
-
}, M = L ? L.tagName === "BUTTON" : void 0, k = w == null ? void 0 : w[
|
|
3051
|
+
}, M = L ? L.tagName === "BUTTON" : void 0, k = w == null ? void 0 : w[C || "ref"], _ = {
|
|
3052
3052
|
id: `react-collapsed-toggle-${d}`,
|
|
3053
3053
|
"aria-controls": `react-collapsed-panel-${d}`,
|
|
3054
3054
|
"aria-expanded": u,
|
|
3055
|
-
onClick(
|
|
3056
|
-
$ || (b == null || b(
|
|
3055
|
+
onClick(se) {
|
|
3056
|
+
$ || (b == null || b(se), f((q) => !q));
|
|
3057
3057
|
},
|
|
3058
|
-
[
|
|
3058
|
+
[C || "ref"]: Wt(k, g)
|
|
3059
3059
|
}, J = {
|
|
3060
3060
|
type: "button",
|
|
3061
3061
|
disabled: $ ? !0 : void 0
|
|
3062
|
-
},
|
|
3062
|
+
}, ne = {
|
|
3063
3063
|
"aria-disabled": $ ? !0 : void 0,
|
|
3064
3064
|
role: "button",
|
|
3065
3065
|
tabIndex: $ ? -1 : 0
|
|
3066
3066
|
};
|
|
3067
|
-
return M === !1 ? { ..._, ...
|
|
3067
|
+
return M === !1 ? { ..._, ...ne, ...E } : M === !0 ? { ..._, ...J, ...E } : {
|
|
3068
3068
|
..._,
|
|
3069
3069
|
...J,
|
|
3070
|
-
...
|
|
3070
|
+
...ne,
|
|
3071
3071
|
...E
|
|
3072
3072
|
};
|
|
3073
3073
|
},
|
|
3074
3074
|
getCollapseProps(w) {
|
|
3075
|
-
const { style: $, refKey: b } = { refKey: "ref", style: {}, ...w },
|
|
3075
|
+
const { style: $, refKey: b } = { refKey: "ref", style: {}, ...w }, C = w == null ? void 0 : w[b || "ref"];
|
|
3076
3076
|
return {
|
|
3077
3077
|
id: `react-collapsed-panel-${d}`,
|
|
3078
3078
|
"aria-hidden": !u,
|
|
3079
3079
|
"aria-labelledby": `react-collapsed-toggle-${d}`,
|
|
3080
3080
|
role: "region",
|
|
3081
3081
|
...w,
|
|
3082
|
-
[b || "ref"]: Wt(F,
|
|
3082
|
+
[b || "ref"]: Wt(F, C),
|
|
3083
3083
|
style: {
|
|
3084
3084
|
boxSizing: "border-box",
|
|
3085
3085
|
...!h && !u ? {
|
|
@@ -3119,13 +3119,13 @@ function Kt(n) {
|
|
|
3119
3119
|
const An = ({ folder: n, onFileOpen: e }) => {
|
|
3120
3120
|
const [t, o] = R(!1), [s, i] = R(!1), { currentPath: r, setCurrentPath: l, onFolderChange: a } = he(), d = () => {
|
|
3121
3121
|
i(!0), e(n), l(n.path), a == null || a(n.path);
|
|
3122
|
-
}, u = (
|
|
3123
|
-
|
|
3122
|
+
}, u = (f) => {
|
|
3123
|
+
f.stopPropagation(), o((p) => !p);
|
|
3124
3124
|
};
|
|
3125
3125
|
return Q(() => {
|
|
3126
3126
|
i(r === n.path);
|
|
3127
|
-
const
|
|
3128
|
-
|
|
3127
|
+
const f = r.split("/");
|
|
3128
|
+
f.pop(), f.join("/") === n.path && o(!0);
|
|
3129
3129
|
}, [r]), n.subDirectories.length > 0 ? /* @__PURE__ */ z(fe, { children: [
|
|
3130
3130
|
/* @__PURE__ */ z(
|
|
3131
3131
|
"div",
|
|
@@ -3147,7 +3147,7 @@ const An = ({ folder: n, onFileOpen: e }) => {
|
|
|
3147
3147
|
]
|
|
3148
3148
|
}
|
|
3149
3149
|
),
|
|
3150
|
-
/* @__PURE__ */ c(Fv, { open: t, children: /* @__PURE__ */ c("div", { className: "folder-collapsible", children: n.subDirectories.map((
|
|
3150
|
+
/* @__PURE__ */ c(Fv, { open: t, children: /* @__PURE__ */ c("div", { className: "folder-collapsible", children: n.subDirectories.map((f, p) => /* @__PURE__ */ c(An, { folder: f, onFileOpen: e }, p)) }) })
|
|
3151
3151
|
] }) : /* @__PURE__ */ z(
|
|
3152
3152
|
"div",
|
|
3153
3153
|
{
|
|
@@ -3181,7 +3181,7 @@ zn.displayName = "NavigationPane";
|
|
|
3181
3181
|
function Lv(n) {
|
|
3182
3182
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
3183
3183
|
}
|
|
3184
|
-
var Ie = { exports: {} }, De = { exports: {} },
|
|
3184
|
+
var Ie = { exports: {} }, De = { exports: {} }, ee = {};
|
|
3185
3185
|
/** @license React v16.13.1
|
|
3186
3186
|
* react-is.production.min.js
|
|
3187
3187
|
*
|
|
@@ -3192,9 +3192,9 @@ var Ie = { exports: {} }, De = { exports: {} }, te = {};
|
|
|
3192
3192
|
*/
|
|
3193
3193
|
var qt;
|
|
3194
3194
|
function Tv() {
|
|
3195
|
-
if (qt) return
|
|
3195
|
+
if (qt) return ee;
|
|
3196
3196
|
qt = 1;
|
|
3197
|
-
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, s = n ? Symbol.for("react.strict_mode") : 60108, i = n ? Symbol.for("react.profiler") : 60114, r = n ? Symbol.for("react.provider") : 60109, l = n ? Symbol.for("react.context") : 60110, a = n ? Symbol.for("react.async_mode") : 60111, d = n ? Symbol.for("react.concurrent_mode") : 60111, u = n ? Symbol.for("react.forward_ref") : 60112,
|
|
3197
|
+
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, s = n ? Symbol.for("react.strict_mode") : 60108, i = n ? Symbol.for("react.profiler") : 60114, r = n ? Symbol.for("react.provider") : 60109, l = n ? Symbol.for("react.context") : 60110, a = n ? Symbol.for("react.async_mode") : 60111, d = n ? Symbol.for("react.concurrent_mode") : 60111, u = n ? Symbol.for("react.forward_ref") : 60112, f = n ? Symbol.for("react.suspense") : 60113, p = 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, N = n ? Symbol.for("react.responder") : 60118, O = n ? Symbol.for("react.scope") : 60119;
|
|
3198
3198
|
function F(g) {
|
|
3199
3199
|
if (typeof g == "object" && g !== null) {
|
|
3200
3200
|
var T = g.$$typeof;
|
|
@@ -3206,7 +3206,7 @@ function Tv() {
|
|
|
3206
3206
|
case o:
|
|
3207
3207
|
case i:
|
|
3208
3208
|
case s:
|
|
3209
|
-
case
|
|
3209
|
+
case f:
|
|
3210
3210
|
return g;
|
|
3211
3211
|
default:
|
|
3212
3212
|
switch (g = g && g.$$typeof, g) {
|
|
@@ -3228,35 +3228,35 @@ function Tv() {
|
|
|
3228
3228
|
function L(g) {
|
|
3229
3229
|
return F(g) === d;
|
|
3230
3230
|
}
|
|
3231
|
-
return
|
|
3231
|
+
return ee.AsyncMode = a, ee.ConcurrentMode = d, ee.ContextConsumer = l, ee.ContextProvider = r, ee.Element = e, ee.ForwardRef = u, ee.Fragment = o, ee.Lazy = m, ee.Memo = h, ee.Portal = t, ee.Profiler = i, ee.StrictMode = s, ee.Suspense = f, ee.isAsyncMode = function(g) {
|
|
3232
3232
|
return L(g) || F(g) === a;
|
|
3233
|
-
},
|
|
3233
|
+
}, ee.isConcurrentMode = L, ee.isContextConsumer = function(g) {
|
|
3234
3234
|
return F(g) === l;
|
|
3235
|
-
},
|
|
3235
|
+
}, ee.isContextProvider = function(g) {
|
|
3236
3236
|
return F(g) === r;
|
|
3237
|
-
},
|
|
3237
|
+
}, ee.isElement = function(g) {
|
|
3238
3238
|
return typeof g == "object" && g !== null && g.$$typeof === e;
|
|
3239
|
-
},
|
|
3239
|
+
}, ee.isForwardRef = function(g) {
|
|
3240
3240
|
return F(g) === u;
|
|
3241
|
-
},
|
|
3241
|
+
}, ee.isFragment = function(g) {
|
|
3242
3242
|
return F(g) === o;
|
|
3243
|
-
},
|
|
3243
|
+
}, ee.isLazy = function(g) {
|
|
3244
3244
|
return F(g) === m;
|
|
3245
|
-
},
|
|
3245
|
+
}, ee.isMemo = function(g) {
|
|
3246
3246
|
return F(g) === h;
|
|
3247
|
-
},
|
|
3247
|
+
}, ee.isPortal = function(g) {
|
|
3248
3248
|
return F(g) === t;
|
|
3249
|
-
},
|
|
3249
|
+
}, ee.isProfiler = function(g) {
|
|
3250
3250
|
return F(g) === i;
|
|
3251
|
-
},
|
|
3251
|
+
}, ee.isStrictMode = function(g) {
|
|
3252
3252
|
return F(g) === s;
|
|
3253
|
-
},
|
|
3254
|
-
return F(g) ===
|
|
3255
|
-
},
|
|
3256
|
-
return typeof g == "string" || typeof g == "function" || g === o || g === d || g === i || g === s || g ===
|
|
3257
|
-
},
|
|
3253
|
+
}, ee.isSuspense = function(g) {
|
|
3254
|
+
return F(g) === f;
|
|
3255
|
+
}, ee.isValidElementType = function(g) {
|
|
3256
|
+
return typeof g == "string" || typeof g == "function" || g === o || g === d || g === i || g === s || g === f || g === p || typeof g == "object" && g !== null && (g.$$typeof === m || g.$$typeof === h || g.$$typeof === r || g.$$typeof === l || g.$$typeof === u || g.$$typeof === S || g.$$typeof === N || g.$$typeof === O || g.$$typeof === v);
|
|
3257
|
+
}, ee.typeOf = F, ee;
|
|
3258
3258
|
}
|
|
3259
|
-
var
|
|
3259
|
+
var te = {};
|
|
3260
3260
|
/** @license React v16.13.1
|
|
3261
3261
|
* react-is.development.js
|
|
3262
3262
|
*
|
|
@@ -3268,10 +3268,10 @@ var ne = {};
|
|
|
3268
3268
|
var _t;
|
|
3269
3269
|
function Av() {
|
|
3270
3270
|
return _t || (_t = 1, process.env.NODE_ENV !== "production" && function() {
|
|
3271
|
-
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, s = n ? Symbol.for("react.strict_mode") : 60108, i = n ? Symbol.for("react.profiler") : 60114, r = n ? Symbol.for("react.provider") : 60109, l = n ? Symbol.for("react.context") : 60110, a = n ? Symbol.for("react.async_mode") : 60111, d = n ? Symbol.for("react.concurrent_mode") : 60111, u = n ? Symbol.for("react.forward_ref") : 60112,
|
|
3271
|
+
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, s = n ? Symbol.for("react.strict_mode") : 60108, i = n ? Symbol.for("react.profiler") : 60114, r = n ? Symbol.for("react.provider") : 60109, l = n ? Symbol.for("react.context") : 60110, a = n ? Symbol.for("react.async_mode") : 60111, d = n ? Symbol.for("react.concurrent_mode") : 60111, u = n ? Symbol.for("react.forward_ref") : 60112, f = n ? Symbol.for("react.suspense") : 60113, p = 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, N = n ? Symbol.for("react.responder") : 60118, O = n ? Symbol.for("react.scope") : 60119;
|
|
3272
3272
|
function F(A) {
|
|
3273
3273
|
return typeof A == "string" || typeof A == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
3274
|
-
A === o || A === d || A === i || A === s || A ===
|
|
3274
|
+
A === o || A === d || A === i || A === s || A === f || A === p || typeof A == "object" && A !== null && (A.$$typeof === m || A.$$typeof === h || A.$$typeof === r || A.$$typeof === l || A.$$typeof === u || A.$$typeof === S || A.$$typeof === N || A.$$typeof === O || A.$$typeof === v);
|
|
3275
3275
|
}
|
|
3276
3276
|
function L(A) {
|
|
3277
3277
|
if (typeof A == "object" && A !== null) {
|
|
@@ -3285,7 +3285,7 @@ function Av() {
|
|
|
3285
3285
|
case o:
|
|
3286
3286
|
case i:
|
|
3287
3287
|
case s:
|
|
3288
|
-
case
|
|
3288
|
+
case f:
|
|
3289
3289
|
return we;
|
|
3290
3290
|
default:
|
|
3291
3291
|
var Te = we && we.$$typeof;
|
|
@@ -3305,9 +3305,9 @@ function Av() {
|
|
|
3305
3305
|
}
|
|
3306
3306
|
}
|
|
3307
3307
|
}
|
|
3308
|
-
var g = a, T = d, x = l, w = r, $ = e, b = u,
|
|
3309
|
-
function
|
|
3310
|
-
return
|
|
3308
|
+
var g = a, T = d, x = l, w = r, $ = e, b = u, C = o, E = m, M = h, k = t, _ = i, J = s, ne = f, se = !1;
|
|
3309
|
+
function q(A) {
|
|
3310
|
+
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) || L(A) === a;
|
|
3311
3311
|
}
|
|
3312
3312
|
function y(A) {
|
|
3313
3313
|
return L(A) === d;
|
|
@@ -3315,10 +3315,10 @@ function Av() {
|
|
|
3315
3315
|
function P(A) {
|
|
3316
3316
|
return L(A) === l;
|
|
3317
3317
|
}
|
|
3318
|
-
function
|
|
3318
|
+
function j(A) {
|
|
3319
3319
|
return L(A) === r;
|
|
3320
3320
|
}
|
|
3321
|
-
function
|
|
3321
|
+
function V(A) {
|
|
3322
3322
|
return typeof A == "object" && A !== null && A.$$typeof === e;
|
|
3323
3323
|
}
|
|
3324
3324
|
function U(A) {
|
|
@@ -3327,26 +3327,26 @@ function Av() {
|
|
|
3327
3327
|
function G(A) {
|
|
3328
3328
|
return L(A) === o;
|
|
3329
3329
|
}
|
|
3330
|
-
function
|
|
3330
|
+
function W(A) {
|
|
3331
3331
|
return L(A) === m;
|
|
3332
3332
|
}
|
|
3333
|
-
function
|
|
3333
|
+
function Y(A) {
|
|
3334
3334
|
return L(A) === h;
|
|
3335
3335
|
}
|
|
3336
|
-
function
|
|
3336
|
+
function K(A) {
|
|
3337
3337
|
return L(A) === t;
|
|
3338
3338
|
}
|
|
3339
|
-
function
|
|
3339
|
+
function X(A) {
|
|
3340
3340
|
return L(A) === i;
|
|
3341
3341
|
}
|
|
3342
|
-
function
|
|
3342
|
+
function D(A) {
|
|
3343
3343
|
return L(A) === s;
|
|
3344
3344
|
}
|
|
3345
|
-
function
|
|
3346
|
-
return L(A) ===
|
|
3345
|
+
function ie(A) {
|
|
3346
|
+
return L(A) === f;
|
|
3347
3347
|
}
|
|
3348
|
-
|
|
3349
|
-
}()),
|
|
3348
|
+
te.AsyncMode = g, te.ConcurrentMode = T, te.ContextConsumer = x, te.ContextProvider = w, te.Element = $, te.ForwardRef = b, te.Fragment = C, te.Lazy = E, te.Memo = M, te.Portal = k, te.Profiler = _, te.StrictMode = J, te.Suspense = ne, te.isAsyncMode = q, te.isConcurrentMode = y, te.isContextConsumer = P, te.isContextProvider = j, te.isElement = V, te.isForwardRef = U, te.isFragment = G, te.isLazy = W, te.isMemo = Y, te.isPortal = K, te.isProfiler = X, te.isStrictMode = D, te.isSuspense = ie, te.isValidElementType = F, te.typeOf = L;
|
|
3349
|
+
}()), te;
|
|
3350
3350
|
}
|
|
3351
3351
|
var Gt;
|
|
3352
3352
|
function Rn() {
|
|
@@ -3392,12 +3392,12 @@ function zv() {
|
|
|
3392
3392
|
return ot = s() ? Object.assign : function(i, r) {
|
|
3393
3393
|
for (var l, a = o(i), d, u = 1; u < arguments.length; u++) {
|
|
3394
3394
|
l = Object(arguments[u]);
|
|
3395
|
-
for (var
|
|
3396
|
-
e.call(l,
|
|
3395
|
+
for (var f in l)
|
|
3396
|
+
e.call(l, f) && (a[f] = l[f]);
|
|
3397
3397
|
if (n) {
|
|
3398
3398
|
d = n(l);
|
|
3399
|
-
for (var
|
|
3400
|
-
t.call(l, d[
|
|
3399
|
+
for (var p = 0; p < d.length; p++)
|
|
3400
|
+
t.call(l, d[p]) && (a[d[p]] = l[d[p]]);
|
|
3401
3401
|
}
|
|
3402
3402
|
}
|
|
3403
3403
|
return a;
|
|
@@ -3435,25 +3435,25 @@ function Rv() {
|
|
|
3435
3435
|
if (process.env.NODE_ENV !== "production") {
|
|
3436
3436
|
for (var u in i)
|
|
3437
3437
|
if (o(i, u)) {
|
|
3438
|
-
var
|
|
3438
|
+
var f;
|
|
3439
3439
|
try {
|
|
3440
3440
|
if (typeof i[u] != "function") {
|
|
3441
|
-
var
|
|
3441
|
+
var p = Error(
|
|
3442
3442
|
(a || "React class") + ": " + l + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
3443
3443
|
);
|
|
3444
|
-
throw
|
|
3444
|
+
throw p.name = "Invariant Violation", p;
|
|
3445
3445
|
}
|
|
3446
|
-
|
|
3446
|
+
f = i[u](r, u, a, l, null, e);
|
|
3447
3447
|
} catch (m) {
|
|
3448
|
-
|
|
3448
|
+
f = m;
|
|
3449
3449
|
}
|
|
3450
|
-
if (
|
|
3451
|
-
(a || "React class") + ": type specification of " + l + " `" + u + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof
|
|
3452
|
-
),
|
|
3453
|
-
t[
|
|
3450
|
+
if (f && !(f instanceof Error) && n(
|
|
3451
|
+
(a || "React class") + ": type specification of " + l + " `" + u + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof f + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
3452
|
+
), f instanceof Error && !(f.message in t)) {
|
|
3453
|
+
t[f.message] = !0;
|
|
3454
3454
|
var h = d ? d() : "";
|
|
3455
3455
|
n(
|
|
3456
|
-
"Failed " + l + " type: " +
|
|
3456
|
+
"Failed " + l + " type: " + f.message + (h ?? "")
|
|
3457
3457
|
);
|
|
3458
3458
|
}
|
|
3459
3459
|
}
|
|
@@ -3482,12 +3482,12 @@ function Ov() {
|
|
|
3482
3482
|
}
|
|
3483
3483
|
return at = function(l, a) {
|
|
3484
3484
|
var d = typeof Symbol == "function" && Symbol.iterator, u = "@@iterator";
|
|
3485
|
-
function
|
|
3485
|
+
function f(y) {
|
|
3486
3486
|
var P = y && (d && y[d] || y[u]);
|
|
3487
3487
|
if (typeof P == "function")
|
|
3488
3488
|
return P;
|
|
3489
3489
|
}
|
|
3490
|
-
var
|
|
3490
|
+
var p = "<<anonymous>>", h = {
|
|
3491
3491
|
array: N("array"),
|
|
3492
3492
|
bigint: N("bigint"),
|
|
3493
3493
|
bool: N("boolean"),
|
|
@@ -3515,202 +3515,202 @@ function Ov() {
|
|
|
3515
3515
|
this.message = y, this.data = P && typeof P == "object" ? P : {}, this.stack = "";
|
|
3516
3516
|
}
|
|
3517
3517
|
v.prototype = Error.prototype;
|
|
3518
|
-
function
|
|
3518
|
+
function S(y) {
|
|
3519
3519
|
if (process.env.NODE_ENV !== "production")
|
|
3520
|
-
var P = {},
|
|
3521
|
-
function
|
|
3522
|
-
if (
|
|
3520
|
+
var P = {}, j = 0;
|
|
3521
|
+
function V(G, W, Y, K, X, D, ie) {
|
|
3522
|
+
if (K = K || p, D = D || Y, ie !== t) {
|
|
3523
3523
|
if (a) {
|
|
3524
3524
|
var A = new Error(
|
|
3525
3525
|
"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"
|
|
3526
3526
|
);
|
|
3527
3527
|
throw A.name = "Invariant Violation", A;
|
|
3528
3528
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
3529
|
-
var pe =
|
|
3529
|
+
var pe = K + ":" + Y;
|
|
3530
3530
|
!P[pe] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
3531
|
-
|
|
3532
|
-
"You are manually calling a React.PropTypes validation function for the `" +
|
|
3533
|
-
), P[pe] = !0,
|
|
3531
|
+
j < 3 && (i(
|
|
3532
|
+
"You are manually calling a React.PropTypes validation function for the `" + D + "` prop on `" + K + "`. 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."
|
|
3533
|
+
), P[pe] = !0, j++);
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
3536
|
-
return Y
|
|
3536
|
+
return W[Y] == null ? G ? W[Y] === null ? new v("The " + X + " `" + D + "` is marked as required " + ("in `" + K + "`, but its value is `null`.")) : new v("The " + X + " `" + D + "` is marked as required in " + ("`" + K + "`, but its value is `undefined`.")) : null : y(W, Y, K, X, D);
|
|
3537
3537
|
}
|
|
3538
|
-
var U =
|
|
3539
|
-
return U.isRequired =
|
|
3538
|
+
var U = V.bind(null, !1);
|
|
3539
|
+
return U.isRequired = V.bind(null, !0), U;
|
|
3540
3540
|
}
|
|
3541
3541
|
function N(y) {
|
|
3542
|
-
function P(
|
|
3543
|
-
var
|
|
3544
|
-
if (
|
|
3545
|
-
var
|
|
3542
|
+
function P(j, V, U, G, W, Y) {
|
|
3543
|
+
var K = j[V], X = J(K);
|
|
3544
|
+
if (X !== y) {
|
|
3545
|
+
var D = ne(K);
|
|
3546
3546
|
return new v(
|
|
3547
|
-
"Invalid " + G + " `" +
|
|
3547
|
+
"Invalid " + G + " `" + W + "` of type " + ("`" + D + "` supplied to `" + U + "`, expected ") + ("`" + y + "`."),
|
|
3548
3548
|
{ expectedType: y }
|
|
3549
3549
|
);
|
|
3550
3550
|
}
|
|
3551
3551
|
return null;
|
|
3552
3552
|
}
|
|
3553
|
-
return
|
|
3553
|
+
return S(P);
|
|
3554
3554
|
}
|
|
3555
3555
|
function O() {
|
|
3556
|
-
return
|
|
3556
|
+
return S(r);
|
|
3557
3557
|
}
|
|
3558
3558
|
function F(y) {
|
|
3559
|
-
function P(
|
|
3559
|
+
function P(j, V, U, G, W) {
|
|
3560
3560
|
if (typeof y != "function")
|
|
3561
|
-
return new v("Property `" +
|
|
3562
|
-
var
|
|
3563
|
-
if (!Array.isArray(
|
|
3564
|
-
var
|
|
3565
|
-
return new v("Invalid " + G + " `" +
|
|
3561
|
+
return new v("Property `" + W + "` of component `" + U + "` has invalid PropType notation inside arrayOf.");
|
|
3562
|
+
var Y = j[V];
|
|
3563
|
+
if (!Array.isArray(Y)) {
|
|
3564
|
+
var K = J(Y);
|
|
3565
|
+
return new v("Invalid " + G + " `" + W + "` of type " + ("`" + K + "` supplied to `" + U + "`, expected an array."));
|
|
3566
3566
|
}
|
|
3567
|
-
for (var
|
|
3568
|
-
var
|
|
3569
|
-
if (
|
|
3570
|
-
return
|
|
3567
|
+
for (var X = 0; X < Y.length; X++) {
|
|
3568
|
+
var D = y(Y, X, U, G, W + "[" + X + "]", t);
|
|
3569
|
+
if (D instanceof Error)
|
|
3570
|
+
return D;
|
|
3571
3571
|
}
|
|
3572
3572
|
return null;
|
|
3573
3573
|
}
|
|
3574
|
-
return
|
|
3574
|
+
return S(P);
|
|
3575
3575
|
}
|
|
3576
3576
|
function L() {
|
|
3577
|
-
function y(P,
|
|
3578
|
-
var
|
|
3579
|
-
if (!l(
|
|
3580
|
-
var
|
|
3581
|
-
return new v("Invalid " + U + " `" + G + "` of type " + ("`" +
|
|
3577
|
+
function y(P, j, V, U, G) {
|
|
3578
|
+
var W = P[j];
|
|
3579
|
+
if (!l(W)) {
|
|
3580
|
+
var Y = J(W);
|
|
3581
|
+
return new v("Invalid " + U + " `" + G + "` of type " + ("`" + Y + "` supplied to `" + V + "`, expected a single ReactElement."));
|
|
3582
3582
|
}
|
|
3583
3583
|
return null;
|
|
3584
3584
|
}
|
|
3585
|
-
return
|
|
3585
|
+
return S(y);
|
|
3586
3586
|
}
|
|
3587
3587
|
function g() {
|
|
3588
|
-
function y(P,
|
|
3589
|
-
var
|
|
3590
|
-
if (!n.isValidElementType(
|
|
3591
|
-
var
|
|
3592
|
-
return new v("Invalid " + U + " `" + G + "` of type " + ("`" +
|
|
3588
|
+
function y(P, j, V, U, G) {
|
|
3589
|
+
var W = P[j];
|
|
3590
|
+
if (!n.isValidElementType(W)) {
|
|
3591
|
+
var Y = J(W);
|
|
3592
|
+
return new v("Invalid " + U + " `" + G + "` of type " + ("`" + Y + "` supplied to `" + V + "`, expected a single ReactElement type."));
|
|
3593
3593
|
}
|
|
3594
3594
|
return null;
|
|
3595
3595
|
}
|
|
3596
|
-
return
|
|
3596
|
+
return S(y);
|
|
3597
3597
|
}
|
|
3598
3598
|
function T(y) {
|
|
3599
|
-
function P(
|
|
3600
|
-
if (!(
|
|
3601
|
-
var
|
|
3602
|
-
return new v("Invalid " + G + " `" +
|
|
3599
|
+
function P(j, V, U, G, W) {
|
|
3600
|
+
if (!(j[V] instanceof y)) {
|
|
3601
|
+
var Y = y.name || p, K = q(j[V]);
|
|
3602
|
+
return new v("Invalid " + G + " `" + W + "` of type " + ("`" + K + "` supplied to `" + U + "`, expected ") + ("instance of `" + Y + "`."));
|
|
3603
3603
|
}
|
|
3604
3604
|
return null;
|
|
3605
3605
|
}
|
|
3606
|
-
return
|
|
3606
|
+
return S(P);
|
|
3607
3607
|
}
|
|
3608
3608
|
function x(y) {
|
|
3609
3609
|
if (!Array.isArray(y))
|
|
3610
3610
|
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
|
|
3611
3611
|
"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])."
|
|
3612
3612
|
) : i("Invalid argument supplied to oneOf, expected an array.")), r;
|
|
3613
|
-
function P(
|
|
3614
|
-
for (var
|
|
3615
|
-
if (m(
|
|
3613
|
+
function P(j, V, U, G, W) {
|
|
3614
|
+
for (var Y = j[V], K = 0; K < y.length; K++)
|
|
3615
|
+
if (m(Y, y[K]))
|
|
3616
3616
|
return null;
|
|
3617
|
-
var
|
|
3618
|
-
var pe =
|
|
3617
|
+
var X = JSON.stringify(y, function(ie, A) {
|
|
3618
|
+
var pe = ne(A);
|
|
3619
3619
|
return pe === "symbol" ? String(A) : A;
|
|
3620
3620
|
});
|
|
3621
|
-
return new v("Invalid " + G + " `" +
|
|
3621
|
+
return new v("Invalid " + G + " `" + W + "` of value `" + String(Y) + "` " + ("supplied to `" + U + "`, expected one of " + X + "."));
|
|
3622
3622
|
}
|
|
3623
|
-
return
|
|
3623
|
+
return S(P);
|
|
3624
3624
|
}
|
|
3625
3625
|
function w(y) {
|
|
3626
|
-
function P(
|
|
3626
|
+
function P(j, V, U, G, W) {
|
|
3627
3627
|
if (typeof y != "function")
|
|
3628
|
-
return new v("Property `" +
|
|
3629
|
-
var
|
|
3630
|
-
if (
|
|
3631
|
-
return new v("Invalid " + G + " `" +
|
|
3632
|
-
for (var
|
|
3633
|
-
if (o(
|
|
3634
|
-
var
|
|
3635
|
-
if (
|
|
3636
|
-
return
|
|
3628
|
+
return new v("Property `" + W + "` of component `" + U + "` has invalid PropType notation inside objectOf.");
|
|
3629
|
+
var Y = j[V], K = J(Y);
|
|
3630
|
+
if (K !== "object")
|
|
3631
|
+
return new v("Invalid " + G + " `" + W + "` of type " + ("`" + K + "` supplied to `" + U + "`, expected an object."));
|
|
3632
|
+
for (var X in Y)
|
|
3633
|
+
if (o(Y, X)) {
|
|
3634
|
+
var D = y(Y, X, U, G, W + "." + X, t);
|
|
3635
|
+
if (D instanceof Error)
|
|
3636
|
+
return D;
|
|
3637
3637
|
}
|
|
3638
3638
|
return null;
|
|
3639
3639
|
}
|
|
3640
|
-
return
|
|
3640
|
+
return S(P);
|
|
3641
3641
|
}
|
|
3642
3642
|
function $(y) {
|
|
3643
3643
|
if (!Array.isArray(y))
|
|
3644
3644
|
return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), r;
|
|
3645
3645
|
for (var P = 0; P < y.length; P++) {
|
|
3646
|
-
var
|
|
3647
|
-
if (typeof
|
|
3646
|
+
var j = y[P];
|
|
3647
|
+
if (typeof j != "function")
|
|
3648
3648
|
return i(
|
|
3649
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " +
|
|
3649
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + se(j) + " at index " + P + "."
|
|
3650
3650
|
), r;
|
|
3651
3651
|
}
|
|
3652
|
-
function
|
|
3653
|
-
for (var
|
|
3654
|
-
var
|
|
3652
|
+
function V(U, G, W, Y, K) {
|
|
3653
|
+
for (var X = [], D = 0; D < y.length; D++) {
|
|
3654
|
+
var ie = y[D], A = ie(U, G, W, Y, K, t);
|
|
3655
3655
|
if (A == null)
|
|
3656
3656
|
return null;
|
|
3657
|
-
A.data && o(A.data, "expectedType") &&
|
|
3657
|
+
A.data && o(A.data, "expectedType") && X.push(A.data.expectedType);
|
|
3658
3658
|
}
|
|
3659
|
-
var pe =
|
|
3660
|
-
return new v("Invalid " +
|
|
3659
|
+
var pe = X.length > 0 ? ", expected one of type [" + X.join(", ") + "]" : "";
|
|
3660
|
+
return new v("Invalid " + Y + " `" + K + "` supplied to " + ("`" + W + "`" + pe + "."));
|
|
3661
3661
|
}
|
|
3662
|
-
return
|
|
3662
|
+
return S(V);
|
|
3663
3663
|
}
|
|
3664
3664
|
function b() {
|
|
3665
|
-
function y(P,
|
|
3666
|
-
return k(P[
|
|
3665
|
+
function y(P, j, V, U, G) {
|
|
3666
|
+
return k(P[j]) ? null : new v("Invalid " + U + " `" + G + "` supplied to " + ("`" + V + "`, expected a ReactNode."));
|
|
3667
3667
|
}
|
|
3668
|
-
return
|
|
3668
|
+
return S(y);
|
|
3669
3669
|
}
|
|
3670
|
-
function
|
|
3670
|
+
function C(y, P, j, V, U) {
|
|
3671
3671
|
return new v(
|
|
3672
|
-
(y || "React class") + ": " + P + " type `" +
|
|
3672
|
+
(y || "React class") + ": " + P + " type `" + j + "." + V + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + U + "`."
|
|
3673
3673
|
);
|
|
3674
3674
|
}
|
|
3675
3675
|
function E(y) {
|
|
3676
|
-
function P(
|
|
3677
|
-
var
|
|
3678
|
-
if (
|
|
3679
|
-
return new v("Invalid " + G + " `" +
|
|
3680
|
-
for (var
|
|
3681
|
-
var
|
|
3682
|
-
if (typeof
|
|
3683
|
-
return
|
|
3684
|
-
var
|
|
3685
|
-
if (
|
|
3686
|
-
return
|
|
3676
|
+
function P(j, V, U, G, W) {
|
|
3677
|
+
var Y = j[V], K = J(Y);
|
|
3678
|
+
if (K !== "object")
|
|
3679
|
+
return new v("Invalid " + G + " `" + W + "` of type `" + K + "` " + ("supplied to `" + U + "`, expected `object`."));
|
|
3680
|
+
for (var X in y) {
|
|
3681
|
+
var D = y[X];
|
|
3682
|
+
if (typeof D != "function")
|
|
3683
|
+
return C(U, G, W, X, ne(D));
|
|
3684
|
+
var ie = D(Y, X, U, G, W + "." + X, t);
|
|
3685
|
+
if (ie)
|
|
3686
|
+
return ie;
|
|
3687
3687
|
}
|
|
3688
3688
|
return null;
|
|
3689
3689
|
}
|
|
3690
|
-
return
|
|
3690
|
+
return S(P);
|
|
3691
3691
|
}
|
|
3692
3692
|
function M(y) {
|
|
3693
|
-
function P(
|
|
3694
|
-
var
|
|
3695
|
-
if (
|
|
3696
|
-
return new v("Invalid " + G + " `" +
|
|
3697
|
-
var
|
|
3698
|
-
for (var
|
|
3699
|
-
var
|
|
3700
|
-
if (o(y,
|
|
3701
|
-
return
|
|
3702
|
-
if (!
|
|
3693
|
+
function P(j, V, U, G, W) {
|
|
3694
|
+
var Y = j[V], K = J(Y);
|
|
3695
|
+
if (K !== "object")
|
|
3696
|
+
return new v("Invalid " + G + " `" + W + "` of type `" + K + "` " + ("supplied to `" + U + "`, expected `object`."));
|
|
3697
|
+
var X = e({}, j[V], y);
|
|
3698
|
+
for (var D in X) {
|
|
3699
|
+
var ie = y[D];
|
|
3700
|
+
if (o(y, D) && typeof ie != "function")
|
|
3701
|
+
return C(U, G, W, D, ne(ie));
|
|
3702
|
+
if (!ie)
|
|
3703
3703
|
return new v(
|
|
3704
|
-
"Invalid " + G + " `" +
|
|
3704
|
+
"Invalid " + G + " `" + W + "` key `" + D + "` supplied to `" + U + "`.\nBad object: " + JSON.stringify(j[V], null, " ") + `
|
|
3705
3705
|
Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
|
|
3706
3706
|
);
|
|
3707
|
-
var A =
|
|
3707
|
+
var A = ie(Y, D, U, G, W + "." + D, t);
|
|
3708
3708
|
if (A)
|
|
3709
3709
|
return A;
|
|
3710
3710
|
}
|
|
3711
3711
|
return null;
|
|
3712
3712
|
}
|
|
3713
|
-
return
|
|
3713
|
+
return S(P);
|
|
3714
3714
|
}
|
|
3715
3715
|
function k(y) {
|
|
3716
3716
|
switch (typeof y) {
|
|
@@ -3725,16 +3725,16 @@ Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
|
|
|
3725
3725
|
return y.every(k);
|
|
3726
3726
|
if (y === null || l(y))
|
|
3727
3727
|
return !0;
|
|
3728
|
-
var P =
|
|
3728
|
+
var P = f(y);
|
|
3729
3729
|
if (P) {
|
|
3730
|
-
var
|
|
3730
|
+
var j = P.call(y), V;
|
|
3731
3731
|
if (P !== y.entries) {
|
|
3732
|
-
for (; !(
|
|
3733
|
-
if (!k(
|
|
3732
|
+
for (; !(V = j.next()).done; )
|
|
3733
|
+
if (!k(V.value))
|
|
3734
3734
|
return !1;
|
|
3735
3735
|
} else
|
|
3736
|
-
for (; !(
|
|
3737
|
-
var U =
|
|
3736
|
+
for (; !(V = j.next()).done; ) {
|
|
3737
|
+
var U = V.value;
|
|
3738
3738
|
if (U && !k(U[1]))
|
|
3739
3739
|
return !1;
|
|
3740
3740
|
}
|
|
@@ -3752,7 +3752,7 @@ Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
|
|
|
3752
3752
|
var P = typeof y;
|
|
3753
3753
|
return Array.isArray(y) ? "array" : y instanceof RegExp ? "object" : _(P, y) ? "symbol" : P;
|
|
3754
3754
|
}
|
|
3755
|
-
function
|
|
3755
|
+
function ne(y) {
|
|
3756
3756
|
if (typeof y > "u" || y === null)
|
|
3757
3757
|
return "" + y;
|
|
3758
3758
|
var P = J(y);
|
|
@@ -3764,8 +3764,8 @@ Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
|
|
|
3764
3764
|
}
|
|
3765
3765
|
return P;
|
|
3766
3766
|
}
|
|
3767
|
-
function
|
|
3768
|
-
var P =
|
|
3767
|
+
function se(y) {
|
|
3768
|
+
var P = ne(y);
|
|
3769
3769
|
switch (P) {
|
|
3770
3770
|
case "array":
|
|
3771
3771
|
case "object":
|
|
@@ -3778,8 +3778,8 @@ Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
|
|
|
3778
3778
|
return P;
|
|
3779
3779
|
}
|
|
3780
3780
|
}
|
|
3781
|
-
function
|
|
3782
|
-
return !y.constructor || !y.constructor.name ?
|
|
3781
|
+
function q(y) {
|
|
3782
|
+
return !y.constructor || !y.constructor.name ? p : y.constructor.name;
|
|
3783
3783
|
}
|
|
3784
3784
|
return h.checkPropTypes = s, h.resetWarningCache = s.resetWarningCache, h.PropTypes = h, h;
|
|
3785
3785
|
}, at;
|
|
@@ -3794,12 +3794,12 @@ function Mv() {
|
|
|
3794
3794
|
function t() {
|
|
3795
3795
|
}
|
|
3796
3796
|
return t.resetWarningCache = e, lt = function() {
|
|
3797
|
-
function o(r, l, a, d, u,
|
|
3798
|
-
if (
|
|
3799
|
-
var
|
|
3797
|
+
function o(r, l, a, d, u, f) {
|
|
3798
|
+
if (f !== n) {
|
|
3799
|
+
var p = new Error(
|
|
3800
3800
|
"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"
|
|
3801
3801
|
);
|
|
3802
|
-
throw
|
|
3802
|
+
throw p.name = "Invariant Violation", p;
|
|
3803
3803
|
}
|
|
3804
3804
|
}
|
|
3805
3805
|
o.isRequired = o;
|
|
@@ -3843,7 +3843,7 @@ function kv() {
|
|
|
3843
3843
|
return Ie.exports;
|
|
3844
3844
|
}
|
|
3845
3845
|
var Iv = /* @__PURE__ */ kv();
|
|
3846
|
-
const
|
|
3846
|
+
const I = /* @__PURE__ */ Lv(Iv);
|
|
3847
3847
|
function Dv(n) {
|
|
3848
3848
|
return H({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-2.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z" }, child: [] }] })(n);
|
|
3849
3849
|
}
|
|
@@ -3851,34 +3851,34 @@ function Uv(n) {
|
|
|
3851
3851
|
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);
|
|
3852
3852
|
}
|
|
3853
3853
|
const gt = ({ collapsibleNav: n, isNavigationPaneOpen: e, setNavigationPaneOpen: t }) => {
|
|
3854
|
-
const [o, s] = R([]), [i, r] = R([]), [l, a] = R([]), [d, u] = R(!1), { currentPath:
|
|
3854
|
+
const [o, s] = R([]), [i, r] = R([]), [l, a] = R([]), [d, u] = R(!1), { currentPath: f, setCurrentPath: p, onFolderChange: h } = he(), m = re(null), v = re([]), S = re(null), N = Me(() => {
|
|
3855
3855
|
u(!1);
|
|
3856
|
-
}), O = de(), F =
|
|
3856
|
+
}), O = de(), F = re(null);
|
|
3857
3857
|
Q(() => {
|
|
3858
3858
|
s(() => {
|
|
3859
3859
|
let w = "";
|
|
3860
|
-
return
|
|
3860
|
+
return f == null ? void 0 : f.split("/").map(($) => ({
|
|
3861
3861
|
name: $ || O("home"),
|
|
3862
3862
|
path: $ === "" ? $ : w += `/${$}`
|
|
3863
3863
|
}));
|
|
3864
3864
|
}), r([]), a([]);
|
|
3865
|
-
}, [
|
|
3865
|
+
}, [f, O]);
|
|
3866
3866
|
const L = (w) => {
|
|
3867
|
-
|
|
3867
|
+
p(w), h == null || h(w);
|
|
3868
3868
|
}, g = () => {
|
|
3869
3869
|
var J;
|
|
3870
|
-
const w = m.current.clientWidth, $ = getComputedStyle(m.current), b = parseFloat($.paddingLeft),
|
|
3870
|
+
const w = m.current.clientWidth, $ = getComputedStyle(m.current), b = parseFloat($.paddingLeft), C = n ? 2 : 0, M = n ? ((J = F.current) == null ? void 0 : J.clientWidth) + 1 : 0, k = i.length > 0 ? 1 : 0, _ = parseFloat($.gap) * (o.length + k + C);
|
|
3871
3871
|
return w - (b + _ + M);
|
|
3872
3872
|
}, T = () => {
|
|
3873
|
-
var
|
|
3874
|
-
const w = g(), $ = v.current.reduce((E, M) => M ? E + M.clientWidth : E, 0), b = ((
|
|
3873
|
+
var C;
|
|
3874
|
+
const w = g(), $ = v.current.reduce((E, M) => M ? E + M.clientWidth : E, 0), b = ((C = S.current) == null ? void 0 : C.clientWidth) || 0;
|
|
3875
3875
|
return w - ($ + b);
|
|
3876
3876
|
}, x = () => m.current.scrollWidth > m.current.clientWidth;
|
|
3877
3877
|
return Q(() => {
|
|
3878
3878
|
var w;
|
|
3879
3879
|
if (x()) {
|
|
3880
3880
|
const $ = o[1], b = (w = v.current[1]) == null ? void 0 : w.clientWidth;
|
|
3881
|
-
a((
|
|
3881
|
+
a((C) => [...C, b]), r((C) => [...C, $]), s((C) => C.filter((E, M) => M !== 1));
|
|
3882
3882
|
} else if (i.length > 0 && T() > l.at(-1)) {
|
|
3883
3883
|
const $ = [o[0], i.at(-1), ...o.slice(1)];
|
|
3884
3884
|
s($), r((b) => b.slice(0, -1)), a((b) => b.slice(0, -1));
|
|
@@ -3922,7 +3922,7 @@ const gt = ({ collapsibleNav: n, isNavigationPaneOpen: e, setNavigationPaneOpen:
|
|
|
3922
3922
|
{
|
|
3923
3923
|
className: "folder-name folder-name-btn",
|
|
3924
3924
|
onClick: () => u(!0),
|
|
3925
|
-
ref:
|
|
3925
|
+
ref: S,
|
|
3926
3926
|
title: O("showMoreFolder"),
|
|
3927
3927
|
children: /* @__PURE__ */ c(no, { size: 22, className: "hidden-folders" })
|
|
3928
3928
|
}
|
|
@@ -3943,8 +3943,8 @@ const gt = ({ collapsibleNav: n, isNavigationPaneOpen: e, setNavigationPaneOpen:
|
|
|
3943
3943
|
};
|
|
3944
3944
|
gt.displayName = "BreadCrumb";
|
|
3945
3945
|
gt.propTypes = {
|
|
3946
|
-
isNavigationPaneOpen:
|
|
3947
|
-
setNavigationPaneOpen:
|
|
3946
|
+
isNavigationPaneOpen: I.bool.isRequired,
|
|
3947
|
+
setNavigationPaneOpen: I.func.isRequired
|
|
3948
3948
|
};
|
|
3949
3949
|
const _e = (n) => ({
|
|
3950
3950
|
pdf: /* @__PURE__ */ c(lo, { size: n }),
|
|
@@ -3989,8 +3989,8 @@ const _e = (n) => ({
|
|
|
3989
3989
|
t.forEach((d) => {
|
|
3990
3990
|
const u = d.isDirectory ? d.name : d.name.split(".").slice(0, -1).join(".");
|
|
3991
3991
|
if (r.test(u)) {
|
|
3992
|
-
const
|
|
3993
|
-
!isNaN(
|
|
3992
|
+
const f = u.split(`${s} (`).pop().slice(0, -1), p = parseInt(f);
|
|
3993
|
+
!isNaN(p) && p > i && (i = p);
|
|
3994
3994
|
}
|
|
3995
3995
|
});
|
|
3996
3996
|
const l = ` (${++i})`;
|
|
@@ -4011,9 +4011,9 @@ const _e = (n) => ({
|
|
|
4011
4011
|
rows: l
|
|
4012
4012
|
}
|
|
4013
4013
|
), In = ({ message: n, xPlacement: e, yPlacement: t }) => /* @__PURE__ */ c("p", { className: `error-tooltip ${e} ${t}`, children: n }), Hv = 220, jv = ({ filesViewRef: n, file: e, onCreateFolder: t, triggerAction: o }) => {
|
|
4014
|
-
const [s, i] = R(e.name), [r, l] = R(!1), [a, d] = R(""), [u,
|
|
4014
|
+
const [s, i] = R(e.name), [r, l] = R(!1), [a, d] = R(""), [u, f] = R("right"), [p, h] = R("bottom"), m = Me((x) => {
|
|
4015
4015
|
x.preventDefault(), x.stopPropagation();
|
|
4016
|
-
}), { currentFolder: v, currentPathFiles:
|
|
4016
|
+
}), { currentFolder: v, currentPathFiles: S, setCurrentPathFiles: N } = he(), { activeLayout: O } = ye(), F = de(), L = (x) => {
|
|
4017
4017
|
i(x.target.value), l(!1);
|
|
4018
4018
|
}, g = (x) => {
|
|
4019
4019
|
if (x.stopPropagation(), x.key === "Enter") {
|
|
@@ -4035,11 +4035,11 @@ const _e = (n) => ({
|
|
|
4035
4035
|
}
|
|
4036
4036
|
}, [r]);
|
|
4037
4037
|
function T() {
|
|
4038
|
-
var b,
|
|
4038
|
+
var b, C;
|
|
4039
4039
|
let x = s.trim();
|
|
4040
|
-
const w =
|
|
4040
|
+
const w = S.filter((E) => !(E.key && E.key === e.key));
|
|
4041
4041
|
if (w.find((E) => E.name.toLowerCase() === x.toLowerCase())) {
|
|
4042
|
-
d(F("folderExists", { renameFile: x })), l(!0), (b = m.ref.current) == null || b.focus(), (
|
|
4042
|
+
d(F("folderExists", { renameFile: x })), l(!0), (b = m.ref.current) == null || b.focus(), (C = m.ref.current) == null || C.select(), m.setIsClicked(!1);
|
|
4043
4043
|
return;
|
|
4044
4044
|
}
|
|
4045
4045
|
x === "" && (x = Mn("New Folder", !0, w)), xe(t, "onCreateFolder", x, v), N((E) => E.filter((M) => M.key !== e.key)), o.close();
|
|
@@ -4048,7 +4048,7 @@ const _e = (n) => ({
|
|
|
4048
4048
|
var x, w, $;
|
|
4049
4049
|
if ((x = m.ref.current) == null || x.focus(), (w = m.ref.current) == null || w.select(), ($ = m.ref) != null && $.current) {
|
|
4050
4050
|
const M = n.current.getBoundingClientRect(), k = m.ref.current, _ = k.getBoundingClientRect();
|
|
4051
|
-
M.right - _.left > 313 ?
|
|
4051
|
+
M.right - _.left > 313 ? f("right") : f("left"), M.bottom - (_.top + k.clientHeight) > 88 ? h("bottom") : h("top");
|
|
4052
4052
|
}
|
|
4053
4053
|
}, []), Q(() => {
|
|
4054
4054
|
m.isClicked && T();
|
|
@@ -4071,7 +4071,7 @@ const _e = (n) => ({
|
|
|
4071
4071
|
{
|
|
4072
4072
|
message: a,
|
|
4073
4073
|
xPlacement: u,
|
|
4074
|
-
yPlacement:
|
|
4074
|
+
yPlacement: p
|
|
4075
4075
|
}
|
|
4076
4076
|
)
|
|
4077
4077
|
] });
|
|
@@ -4097,7 +4097,7 @@ const Dn = ({
|
|
|
4097
4097
|
contentClassName: i = "",
|
|
4098
4098
|
closeButton: r = !0
|
|
4099
4099
|
}) => {
|
|
4100
|
-
const l =
|
|
4100
|
+
const l = re(null), a = de(), d = (u) => {
|
|
4101
4101
|
u.key === "Escape" && t(!1);
|
|
4102
4102
|
};
|
|
4103
4103
|
return Q(() => {
|
|
@@ -4127,7 +4127,7 @@ const Dn = ({
|
|
|
4127
4127
|
}
|
|
4128
4128
|
);
|
|
4129
4129
|
}, Ne = (n) => n.split(".").pop(), Bv = 220, Wv = ({ filesViewRef: n, file: e, onRename: t, triggerAction: o }) => {
|
|
4130
|
-
const [s, i] = R(e == null ? void 0 : e.name), [r, l] = R(!1), [a, d] = R(!1), [u,
|
|
4130
|
+
const [s, i] = R(e == null ? void 0 : e.name), [r, l] = R(!1), [a, d] = R(!1), [u, f] = R(""), [p, h] = R("right"), [m, v] = R("bottom"), { currentPathFiles: S, setCurrentPathFiles: N } = he(), { activeLayout: O } = ye(), F = de(), L = re(null), g = Me(($) => {
|
|
4131
4131
|
var b;
|
|
4132
4132
|
(b = L.current) != null && b.contains($.target) || ($.preventDefault(), $.stopPropagation());
|
|
4133
4133
|
}), T = ($) => {
|
|
@@ -4137,16 +4137,16 @@ const Dn = ({
|
|
|
4137
4137
|
}
|
|
4138
4138
|
if ($.key === "Escape") {
|
|
4139
4139
|
$.preventDefault(), N(
|
|
4140
|
-
(
|
|
4140
|
+
(C) => C.map((E) => (E.key === e.key && (E.isEditing = !1), E))
|
|
4141
4141
|
), o.close();
|
|
4142
4142
|
return;
|
|
4143
4143
|
}
|
|
4144
|
-
/[\\/:*?"<>|]/.test($.key) ? ($.preventDefault(),
|
|
4144
|
+
/[\\/:*?"<>|]/.test($.key) ? ($.preventDefault(), f(F("invalidFileName")), d(!0)) : d(!1);
|
|
4145
4145
|
};
|
|
4146
4146
|
Q(() => {
|
|
4147
4147
|
if (a) {
|
|
4148
4148
|
const $ = setTimeout(() => {
|
|
4149
|
-
d(!1),
|
|
4149
|
+
d(!1), f("");
|
|
4150
4150
|
}, 7e3);
|
|
4151
4151
|
return () => clearTimeout($);
|
|
4152
4152
|
}
|
|
@@ -4154,25 +4154,25 @@ const Dn = ({
|
|
|
4154
4154
|
function x($) {
|
|
4155
4155
|
if (s === "" || s === e.name) {
|
|
4156
4156
|
N(
|
|
4157
|
-
(b) => b.map((
|
|
4157
|
+
(b) => b.map((C) => (C.key === e.key && (C.isEditing = !1), C))
|
|
4158
4158
|
), o.close();
|
|
4159
4159
|
return;
|
|
4160
|
-
} else if (
|
|
4161
|
-
d(!0),
|
|
4160
|
+
} else if (S.some((b) => b.name === s)) {
|
|
4161
|
+
d(!0), f(F("folderExists", { renameFile: s })), g.setIsClicked(!1);
|
|
4162
4162
|
return;
|
|
4163
4163
|
} else if (!e.isDirectory && !$) {
|
|
4164
|
-
const b = Ne(e.name),
|
|
4165
|
-
if (b !==
|
|
4164
|
+
const b = Ne(e.name), C = Ne(s);
|
|
4165
|
+
if (b !== C) {
|
|
4166
4166
|
l(!0);
|
|
4167
4167
|
return;
|
|
4168
4168
|
}
|
|
4169
4169
|
}
|
|
4170
|
-
d(!1), xe(t, "onRename", e, s), N((b) => b.filter((
|
|
4170
|
+
d(!1), xe(t, "onRename", e, s), N((b) => b.filter((C) => C.key !== e.key)), o.close();
|
|
4171
4171
|
}
|
|
4172
4172
|
const w = () => {
|
|
4173
|
-
var $, b,
|
|
4173
|
+
var $, b, C, E, M, k;
|
|
4174
4174
|
if ((b = ($ = g.ref) == null ? void 0 : $.current) == null || b.focus(), e.isDirectory)
|
|
4175
|
-
(E = (
|
|
4175
|
+
(E = (C = g.ref) == null ? void 0 : C.current) == null || E.select();
|
|
4176
4176
|
else {
|
|
4177
4177
|
const _ = Ne(e.name), J = e.name.length - _.length - 1;
|
|
4178
4178
|
(k = (M = g.ref) == null ? void 0 : M.current) == null || k.setSelectionRange(0, J);
|
|
@@ -4206,7 +4206,7 @@ const Dn = ({
|
|
|
4206
4206
|
In,
|
|
4207
4207
|
{
|
|
4208
4208
|
message: u,
|
|
4209
|
-
xPlacement:
|
|
4209
|
+
xPlacement: p,
|
|
4210
4210
|
yPlacement: m
|
|
4211
4211
|
}
|
|
4212
4212
|
),
|
|
@@ -4293,13 +4293,13 @@ const Dn = ({
|
|
|
4293
4293
|
triggerAction: a,
|
|
4294
4294
|
handleContextMenu: d,
|
|
4295
4295
|
setLastSelectedFile: u,
|
|
4296
|
-
draggable:
|
|
4296
|
+
draggable: f
|
|
4297
4297
|
}) => {
|
|
4298
4298
|
var pe, we, Te, vt;
|
|
4299
|
-
const [
|
|
4300
|
-
i(e), e.isDirectory ? ($(e.path),
|
|
4301
|
-
}, P = (
|
|
4302
|
-
if (l.length > 0 &&
|
|
4299
|
+
const [p, h] = R(!1), [m, v] = R(0), [S, N] = R("hidden"), [O, F] = R(""), [L, g] = R(null), { activeLayout: T } = ye(), x = T === "grid" ? 48 : 20, w = _e(x), { setCurrentPath: $, currentPathFiles: b, onFolderChange: C } = he(), { setSelectedFiles: E } = ve(), { clipBoard: M, handleCutCopy: k, setClipBoard: _, handlePasting: J } = Ze(), ne = re(null), se = _e(ct), q = (M == null ? void 0 : M.isMoving) && M.files.find((Z) => Z.name === e.name && Z.path === e.path), y = () => {
|
|
4300
|
+
i(e), e.isDirectory ? ($(e.path), C == null || C(e.path), E([])) : s && a.show("previewFile");
|
|
4301
|
+
}, P = (Z, ue) => {
|
|
4302
|
+
if (l.length > 0 && Z) {
|
|
4303
4303
|
let ge = !1, be = l[0], Ce = n;
|
|
4304
4304
|
if (be >= Ce) {
|
|
4305
4305
|
const Vn = be;
|
|
@@ -4311,53 +4311,53 @@ const Dn = ({
|
|
|
4311
4311
|
const be = ge.filter((Ce) => Ce.path !== e.path);
|
|
4312
4312
|
return ge.length === be.length ? [...ge, e] : be;
|
|
4313
4313
|
}) : E([e]);
|
|
4314
|
-
},
|
|
4315
|
-
if (
|
|
4316
|
-
P(
|
|
4314
|
+
}, j = (Z) => {
|
|
4315
|
+
if (Z.stopPropagation(), e.isEditing) return;
|
|
4316
|
+
P(Z.shiftKey, Z.ctrlKey);
|
|
4317
4317
|
const ue = (/* @__PURE__ */ new Date()).getTime();
|
|
4318
4318
|
if (ue - m < 300) {
|
|
4319
4319
|
y();
|
|
4320
4320
|
return;
|
|
4321
4321
|
}
|
|
4322
4322
|
v(ue);
|
|
4323
|
-
},
|
|
4324
|
-
|
|
4325
|
-
}, U = (
|
|
4326
|
-
|
|
4323
|
+
}, V = (Z) => {
|
|
4324
|
+
Z.key === "Enter" && (Z.stopPropagation(), E([e]), y());
|
|
4325
|
+
}, U = (Z) => {
|
|
4326
|
+
Z.stopPropagation(), Z.preventDefault(), !e.isEditing && (p || E([e]), u(e), d(Z, !0));
|
|
4327
4327
|
}, G = () => {
|
|
4328
4328
|
N("visible");
|
|
4329
|
-
},
|
|
4330
|
-
!
|
|
4331
|
-
},
|
|
4332
|
-
|
|
4333
|
-
},
|
|
4334
|
-
|
|
4335
|
-
},
|
|
4336
|
-
|
|
4337
|
-
},
|
|
4338
|
-
|
|
4339
|
-
}, A = (
|
|
4340
|
-
|
|
4329
|
+
}, W = () => {
|
|
4330
|
+
!p && N("hidden");
|
|
4331
|
+
}, Y = (Z) => {
|
|
4332
|
+
Z.target.checked ? E((ue) => [...ue, e]) : E((ue) => ue.filter((ge) => ge.name !== e.name && ge.path !== e.path)), h(Z.target.checked);
|
|
4333
|
+
}, K = (Z) => {
|
|
4334
|
+
Z.dataTransfer.setDragImage(ne.current, 30, 50), Z.dataTransfer.effectAllowed = "copy", k(!0);
|
|
4335
|
+
}, X = () => _(null), D = (Z) => {
|
|
4336
|
+
Z.preventDefault(), p || !e.isDirectory ? Z.dataTransfer.dropEffect = "none" : (g({ x: Z.clientX, y: Z.clientY + 12 }), Z.dataTransfer.dropEffect = "copy", F("file-drop-zone"));
|
|
4337
|
+
}, ie = (Z) => {
|
|
4338
|
+
Z.currentTarget.contains(Z.relatedTarget) || (F((ue) => ue && ""), g(null));
|
|
4339
|
+
}, A = (Z) => {
|
|
4340
|
+
Z.preventDefault(), !(p || !e.isDirectory) && (J(e), F((ue) => ue && ""), g(null));
|
|
4341
4341
|
};
|
|
4342
4342
|
return Q(() => {
|
|
4343
4343
|
h(l.includes(n)), N(l.includes(n) ? "visible" : "hidden");
|
|
4344
4344
|
}, [l]), /* @__PURE__ */ z(
|
|
4345
4345
|
"div",
|
|
4346
4346
|
{
|
|
4347
|
-
className: `file-item-container ${O} ${
|
|
4347
|
+
className: `file-item-container ${O} ${p || e.isEditing ? "file-selected" : ""} ${q ? "file-moving" : ""}`,
|
|
4348
4348
|
tabIndex: 0,
|
|
4349
4349
|
title: e.name,
|
|
4350
|
-
onClick:
|
|
4351
|
-
onKeyDown:
|
|
4350
|
+
onClick: j,
|
|
4351
|
+
onKeyDown: V,
|
|
4352
4352
|
onContextMenu: U,
|
|
4353
4353
|
onMouseOver: G,
|
|
4354
|
-
onMouseLeave:
|
|
4355
|
-
draggable:
|
|
4356
|
-
onDragStart:
|
|
4357
|
-
onDragEnd:
|
|
4358
|
-
onDragEnter:
|
|
4359
|
-
onDragOver:
|
|
4360
|
-
onDragLeave:
|
|
4354
|
+
onMouseLeave: W,
|
|
4355
|
+
draggable: p && f,
|
|
4356
|
+
onDragStart: K,
|
|
4357
|
+
onDragEnd: X,
|
|
4358
|
+
onDragEnter: D,
|
|
4359
|
+
onDragOver: D,
|
|
4360
|
+
onDragLeave: ie,
|
|
4361
4361
|
onDrop: A,
|
|
4362
4362
|
children: [
|
|
4363
4363
|
/* @__PURE__ */ z("div", { className: "file-item", children: [
|
|
@@ -4366,10 +4366,10 @@ const Dn = ({
|
|
|
4366
4366
|
{
|
|
4367
4367
|
name: e.name,
|
|
4368
4368
|
id: e.name,
|
|
4369
|
-
checked:
|
|
4370
|
-
className: `selection-checkbox ${
|
|
4371
|
-
onChange:
|
|
4372
|
-
onClick: (
|
|
4369
|
+
checked: p,
|
|
4370
|
+
className: `selection-checkbox ${S}`,
|
|
4371
|
+
onChange: Y,
|
|
4372
|
+
onClick: (Z) => Z.stopPropagation()
|
|
4373
4373
|
}
|
|
4374
4374
|
),
|
|
4375
4375
|
e.isDirectory ? /* @__PURE__ */ c(Et, { size: x }) : /* @__PURE__ */ c(fe, { children: w[(we = (pe = e.name) == null ? void 0 : pe.split(".").pop()) == null ? void 0 : we.toLowerCase()] ?? /* @__PURE__ */ c(Ve, { size: x }) }),
|
|
@@ -4409,7 +4409,7 @@ const Dn = ({
|
|
|
4409
4409
|
]
|
|
4410
4410
|
}
|
|
4411
4411
|
),
|
|
4412
|
-
/* @__PURE__ */ c("div", { ref:
|
|
4412
|
+
/* @__PURE__ */ c("div", { ref: ne, className: "drag-icon", children: e.isDirectory ? /* @__PURE__ */ c(Et, { size: ct }) : /* @__PURE__ */ c(fe, { children: se[(vt = (Te = e.name) == null ? void 0 : Te.split(".").pop()) == null ? void 0 : vt.toLowerCase()] ?? /* @__PURE__ */ c(Ve, { size: ct }) }) })
|
|
4413
4413
|
]
|
|
4414
4414
|
}
|
|
4415
4415
|
);
|
|
@@ -4418,12 +4418,12 @@ const Dn = ({
|
|
|
4418
4418
|
o.icon,
|
|
4419
4419
|
/* @__PURE__ */ c("span", { children: o.title })
|
|
4420
4420
|
] }, o.title)) }), _v = ({ filesViewRef: n, contextMenuRef: e, menuItems: t, visible: o, clickPosition: s }) => {
|
|
4421
|
-
const [i, r] = R(0), [l, a] = R(0), [d, u] = R(null), [
|
|
4422
|
-
const { clickX: N, clickY: O } = s, F = n.current, L = F.getBoundingClientRect(), g = F.offsetWidth - F.clientWidth, T = e.current.getBoundingClientRect(), x = T.width, w = T.height, $ = N - L.left, b = L.width - ($ + g) > x,
|
|
4423
|
-
b ? (r(`${$}px`),
|
|
4421
|
+
const [i, r] = R(0), [l, a] = R(0), [d, u] = R(null), [f, p] = R("right"), h = re(null), m = () => {
|
|
4422
|
+
const { clickX: N, clickY: O } = s, F = n.current, L = F.getBoundingClientRect(), g = F.offsetWidth - F.clientWidth, T = e.current.getBoundingClientRect(), x = T.width, w = T.height, $ = N - L.left, b = L.width - ($ + g) > x, C = !b, E = O - L.top, M = L.height - E > w, k = !M;
|
|
4423
|
+
b ? (r(`${$}px`), p("right")) : C && (r(`${$ - x}px`), p("left")), M ? a(`${E + F.scrollTop}px`) : k && a(`${E + F.scrollTop - w}px`);
|
|
4424
4424
|
}, v = (N) => {
|
|
4425
4425
|
N.preventDefault(), N.stopPropagation();
|
|
4426
|
-
},
|
|
4426
|
+
}, S = (N) => {
|
|
4427
4427
|
u(N);
|
|
4428
4428
|
};
|
|
4429
4429
|
if (Q(() => {
|
|
@@ -4448,7 +4448,7 @@ const Dn = ({
|
|
|
4448
4448
|
{
|
|
4449
4449
|
onClick: N.onClick,
|
|
4450
4450
|
className: `${N.className ?? ""} ${L ? "active" : ""}`,
|
|
4451
|
-
onMouseOver: () =>
|
|
4451
|
+
onMouseOver: () => S(O),
|
|
4452
4452
|
children: [
|
|
4453
4453
|
N.icon,
|
|
4454
4454
|
/* @__PURE__ */ c("span", { children: N.title }),
|
|
@@ -4459,7 +4459,7 @@ const Dn = ({
|
|
|
4459
4459
|
{
|
|
4460
4460
|
subMenuRef: h,
|
|
4461
4461
|
list: N.children,
|
|
4462
|
-
position:
|
|
4462
|
+
position: f
|
|
4463
4463
|
}
|
|
4464
4464
|
)
|
|
4465
4465
|
] })
|
|
@@ -4476,37 +4476,37 @@ function Gv(n) {
|
|
|
4476
4476
|
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);
|
|
4477
4477
|
}
|
|
4478
4478
|
const Jv = (n, e, t, o, s) => {
|
|
4479
|
-
const [i, r] = R([]), [l, a] = R(!1), [d, u] = R(!1), [
|
|
4479
|
+
const [i, r] = R([]), [l, a] = R(!1), [d, u] = R(!1), [f, p] = R({ clickX: 0, clickY: 0 }), [h, m] = R(null), { clipBoard: v, setClipBoard: S, handleCutCopy: N, handlePasting: O } = Ze(), { selectedFiles: F, setSelectedFiles: L, handleDownload: g } = ve(), { currentPath: T, setCurrentPath: x, currentPathFiles: w, setCurrentPathFiles: $, onFolderChange: b } = he(), { activeLayout: C, setActiveLayout: E } = ye(), M = de(), k = () => {
|
|
4480
4480
|
s(h), h.isDirectory ? (x(h.path), b == null || b(h.path), r([]), L([])) : e && t.show("previewFile"), a(!1);
|
|
4481
|
-
}, _ = (
|
|
4482
|
-
N(
|
|
4481
|
+
}, _ = (D) => {
|
|
4482
|
+
N(D), a(!1);
|
|
4483
4483
|
}, J = () => {
|
|
4484
4484
|
O(h), a(!1);
|
|
4485
|
-
},
|
|
4485
|
+
}, ne = () => {
|
|
4486
4486
|
a(!1), t.show("rename");
|
|
4487
|
-
},
|
|
4487
|
+
}, se = () => {
|
|
4488
4488
|
g(), a(!1);
|
|
4489
|
-
},
|
|
4489
|
+
}, q = () => {
|
|
4490
4490
|
a(!1), t.show("delete");
|
|
4491
4491
|
}, y = () => {
|
|
4492
|
-
a(!1), xe(n, "onRefresh"),
|
|
4492
|
+
a(!1), xe(n, "onRefresh"), S(null);
|
|
4493
4493
|
}, P = () => {
|
|
4494
4494
|
t.show("createFolder"), a(!1);
|
|
4495
|
-
}, B = () => {
|
|
4496
|
-
a(!1), t.show("uploadFile");
|
|
4497
4495
|
}, j = () => {
|
|
4496
|
+
a(!1), t.show("uploadFile");
|
|
4497
|
+
}, V = () => {
|
|
4498
4498
|
L(w), a(!1);
|
|
4499
4499
|
}, U = [
|
|
4500
4500
|
{
|
|
4501
4501
|
title: M("view"),
|
|
4502
|
-
icon:
|
|
4502
|
+
icon: C === "grid" ? /* @__PURE__ */ c(bt, { size: 18 }) : /* @__PURE__ */ c(je, { size: 18 }),
|
|
4503
4503
|
onClick: () => {
|
|
4504
4504
|
},
|
|
4505
4505
|
children: [
|
|
4506
4506
|
{
|
|
4507
4507
|
title: M("grid"),
|
|
4508
4508
|
icon: /* @__PURE__ */ c(bt, { size: 18 }),
|
|
4509
|
-
selected:
|
|
4509
|
+
selected: C === "grid",
|
|
4510
4510
|
onClick: () => {
|
|
4511
4511
|
E("grid"), a(!1);
|
|
4512
4512
|
}
|
|
@@ -4514,7 +4514,7 @@ const Jv = (n, e, t, o, s) => {
|
|
|
4514
4514
|
{
|
|
4515
4515
|
title: M("list"),
|
|
4516
4516
|
icon: /* @__PURE__ */ c(je, { size: 18 }),
|
|
4517
|
-
selected:
|
|
4517
|
+
selected: C === "list",
|
|
4518
4518
|
onClick: () => {
|
|
4519
4519
|
E("list"), a(!1);
|
|
4520
4520
|
}
|
|
@@ -4537,14 +4537,14 @@ const Jv = (n, e, t, o, s) => {
|
|
|
4537
4537
|
{
|
|
4538
4538
|
title: M("upload"),
|
|
4539
4539
|
icon: /* @__PURE__ */ c($n, { size: 18 }),
|
|
4540
|
-
onClick:
|
|
4540
|
+
onClick: j,
|
|
4541
4541
|
divider: !0,
|
|
4542
4542
|
hidden: !o.upload
|
|
4543
4543
|
},
|
|
4544
4544
|
{
|
|
4545
4545
|
title: M("selectAll"),
|
|
4546
4546
|
icon: /* @__PURE__ */ c(so, { size: 18 }),
|
|
4547
|
-
onClick:
|
|
4547
|
+
onClick: V
|
|
4548
4548
|
}
|
|
4549
4549
|
], G = [
|
|
4550
4550
|
{
|
|
@@ -4578,71 +4578,71 @@ const Jv = (n, e, t, o, s) => {
|
|
|
4578
4578
|
{
|
|
4579
4579
|
title: M("rename"),
|
|
4580
4580
|
icon: /* @__PURE__ */ c(yn, { size: 19 }),
|
|
4581
|
-
onClick:
|
|
4581
|
+
onClick: ne,
|
|
4582
4582
|
hidden: F.length > 1,
|
|
4583
4583
|
hidden: !o.rename
|
|
4584
4584
|
},
|
|
4585
4585
|
{
|
|
4586
4586
|
title: M("download"),
|
|
4587
4587
|
icon: /* @__PURE__ */ c(ht, { size: 18 }),
|
|
4588
|
-
onClick:
|
|
4588
|
+
onClick: se,
|
|
4589
4589
|
hidden: !o.download
|
|
4590
4590
|
},
|
|
4591
4591
|
{
|
|
4592
4592
|
title: M("delete"),
|
|
4593
4593
|
icon: /* @__PURE__ */ c(vn, { size: 19 }),
|
|
4594
|
-
onClick:
|
|
4594
|
+
onClick: q,
|
|
4595
4595
|
hidden: !o.delete
|
|
4596
4596
|
}
|
|
4597
|
-
],
|
|
4598
|
-
$((
|
|
4599
|
-
...
|
|
4597
|
+
], W = () => {
|
|
4598
|
+
$((D) => [
|
|
4599
|
+
...D,
|
|
4600
4600
|
{
|
|
4601
|
-
name: Mn("New Folder", !0,
|
|
4601
|
+
name: Mn("New Folder", !0, D),
|
|
4602
4602
|
isDirectory: !0,
|
|
4603
4603
|
path: T,
|
|
4604
4604
|
isEditing: !0,
|
|
4605
4605
|
key: (/* @__PURE__ */ new Date()).valueOf()
|
|
4606
4606
|
}
|
|
4607
4607
|
]);
|
|
4608
|
-
},
|
|
4609
|
-
$((
|
|
4610
|
-
},
|
|
4611
|
-
r([]), L((
|
|
4612
|
-
},
|
|
4613
|
-
|
|
4608
|
+
}, Y = () => {
|
|
4609
|
+
$((D) => (D[i.at(-1)] ? D[i.at(-1)].isEditing = !0 : t.close(), D)), r([]), L([]);
|
|
4610
|
+
}, K = () => {
|
|
4611
|
+
r([]), L((D) => D.length > 0 ? [] : D);
|
|
4612
|
+
}, X = (D, ie = !1) => {
|
|
4613
|
+
D.preventDefault(), p({ clickX: D.clientX, clickY: D.clientY }), u(ie), !ie && K(), a(!0);
|
|
4614
4614
|
};
|
|
4615
4615
|
return Q(() => {
|
|
4616
4616
|
if (t.isActive)
|
|
4617
4617
|
switch (t.actionType) {
|
|
4618
4618
|
case "createFolder":
|
|
4619
|
-
|
|
4619
|
+
W();
|
|
4620
4620
|
break;
|
|
4621
4621
|
case "rename":
|
|
4622
|
-
|
|
4622
|
+
Y();
|
|
4623
4623
|
break;
|
|
4624
4624
|
}
|
|
4625
4625
|
}, [t.isActive]), Q(() => {
|
|
4626
4626
|
r([]), L([]);
|
|
4627
4627
|
}, [T]), Q(() => {
|
|
4628
|
-
F.length > 0 ? r(() => F.map((
|
|
4628
|
+
F.length > 0 ? r(() => F.map((D) => w.findIndex((ie) => ie.path === D.path))) : r([]);
|
|
4629
4629
|
}, [F, w]), {
|
|
4630
4630
|
emptySelecCtxItems: U,
|
|
4631
4631
|
selecCtxItems: G,
|
|
4632
|
-
handleContextMenu:
|
|
4633
|
-
unselectFiles:
|
|
4632
|
+
handleContextMenu: X,
|
|
4633
|
+
unselectFiles: K,
|
|
4634
4634
|
visible: l,
|
|
4635
4635
|
setVisible: a,
|
|
4636
4636
|
setLastSelectedFile: m,
|
|
4637
4637
|
selectedFileIndexes: i,
|
|
4638
|
-
clickPosition:
|
|
4638
|
+
clickPosition: f,
|
|
4639
4639
|
isSelectionCtx: d
|
|
4640
4640
|
};
|
|
4641
4641
|
}, Xv = ({ unselectFiles: n, onSort: e, sortConfig: t }) => {
|
|
4642
|
-
const [o, s] = R(!1), { selectedFiles: i, setSelectedFiles: r } = ve(), { currentPathFiles: l } = he(), a = Ge(() => l.length > 0 && i.length === l.length, [i, l]), d = (
|
|
4643
|
-
|
|
4644
|
-
}, u = (
|
|
4645
|
-
e && e(
|
|
4642
|
+
const [o, s] = R(!1), { selectedFiles: i, setSelectedFiles: r } = ve(), { currentPathFiles: l } = he(), a = Ge(() => l.length > 0 && i.length === l.length, [i, l]), d = (f) => {
|
|
4643
|
+
f.target.checked ? (r(l), s(!0)) : n();
|
|
4644
|
+
}, u = (f) => {
|
|
4645
|
+
e && e(f);
|
|
4646
4646
|
};
|
|
4647
4647
|
return /* @__PURE__ */ z(
|
|
4648
4648
|
"div",
|
|
@@ -4706,11 +4706,11 @@ const Jv = (n, e, t, o, s) => {
|
|
|
4706
4706
|
triggerAction: i,
|
|
4707
4707
|
permissions: r
|
|
4708
4708
|
}) => {
|
|
4709
|
-
const { currentPathFiles: l, sortConfig: a, setSortConfig: d } = he(), u =
|
|
4709
|
+
const { currentPathFiles: l, sortConfig: a, setSortConfig: d } = he(), u = re(null), { activeLayout: f } = ye(), p = de(), {
|
|
4710
4710
|
emptySelecCtxItems: h,
|
|
4711
4711
|
selecCtxItems: m,
|
|
4712
4712
|
handleContextMenu: v,
|
|
4713
|
-
unselectFiles:
|
|
4713
|
+
unselectFiles: S,
|
|
4714
4714
|
visible: N,
|
|
4715
4715
|
setVisible: O,
|
|
4716
4716
|
setLastSelectedFile: F,
|
|
@@ -4725,11 +4725,11 @@ const Jv = (n, e, t, o, s) => {
|
|
|
4725
4725
|
"div",
|
|
4726
4726
|
{
|
|
4727
4727
|
ref: u,
|
|
4728
|
-
className: `files ${
|
|
4728
|
+
className: `files ${f}`,
|
|
4729
4729
|
onContextMenu: v,
|
|
4730
|
-
onClick:
|
|
4730
|
+
onClick: S,
|
|
4731
4731
|
children: [
|
|
4732
|
-
|
|
4732
|
+
f === "list" && /* @__PURE__ */ c(Xv, { unselectFiles: S, onSort: w, sortConfig: a }),
|
|
4733
4733
|
(l == null ? void 0 : l.length) > 0 ? /* @__PURE__ */ c(fe, { children: l.map(($, b) => /* @__PURE__ */ c(
|
|
4734
4734
|
Kv,
|
|
4735
4735
|
{
|
|
@@ -4748,7 +4748,7 @@ const Jv = (n, e, t, o, s) => {
|
|
|
4748
4748
|
draggable: r.move
|
|
4749
4749
|
},
|
|
4750
4750
|
b
|
|
4751
|
-
)) }) : /* @__PURE__ */ c("div", { className: "empty-folder", children:
|
|
4751
|
+
)) }) : /* @__PURE__ */ c("div", { className: "empty-folder", children: p("folderEmpty") }),
|
|
4752
4752
|
/* @__PURE__ */ c(
|
|
4753
4753
|
_v,
|
|
4754
4754
|
{
|
|
@@ -4812,7 +4812,7 @@ const o4 = ({
|
|
|
4812
4812
|
handleFileRemove: r
|
|
4813
4813
|
}) => {
|
|
4814
4814
|
var x, w, $, b;
|
|
4815
|
-
const [l, a] = R(0), [d, u] = R(!1), [
|
|
4815
|
+
const [l, a] = R(0), [d, u] = R(!1), [f, p] = R(!1), [h, m] = R(!1), v = _e(33), S = re(), { onError: N } = Xe(), O = de(), F = (C) => {
|
|
4816
4816
|
a(0), o((M) => ({
|
|
4817
4817
|
...M,
|
|
4818
4818
|
[n]: !1
|
|
@@ -4821,9 +4821,9 @@ const o4 = ({
|
|
|
4821
4821
|
type: "upload",
|
|
4822
4822
|
message: O("uploadFail"),
|
|
4823
4823
|
response: {
|
|
4824
|
-
status:
|
|
4825
|
-
statusText:
|
|
4826
|
-
data:
|
|
4824
|
+
status: C.status,
|
|
4825
|
+
statusText: C.statusText,
|
|
4826
|
+
data: C.response
|
|
4827
4827
|
}
|
|
4828
4828
|
};
|
|
4829
4829
|
t(
|
|
@@ -4832,21 +4832,21 @@ const o4 = ({
|
|
|
4832
4832
|
error: E.message
|
|
4833
4833
|
} : k)
|
|
4834
4834
|
), m(!0), N(E, e.file);
|
|
4835
|
-
}, L = (
|
|
4836
|
-
if (!
|
|
4835
|
+
}, L = (C) => {
|
|
4836
|
+
if (!C.error)
|
|
4837
4837
|
return new Promise((E, M) => {
|
|
4838
4838
|
const k = new XMLHttpRequest();
|
|
4839
|
-
|
|
4840
|
-
...
|
|
4839
|
+
S.current = k, o((q) => ({
|
|
4840
|
+
...q,
|
|
4841
4841
|
[n]: !0
|
|
4842
|
-
})), k.upload.onprogress = (
|
|
4843
|
-
if (
|
|
4844
|
-
const y = Math.round(
|
|
4842
|
+
})), k.upload.onprogress = (q) => {
|
|
4843
|
+
if (q.lengthComputable) {
|
|
4844
|
+
const y = Math.round(q.loaded / q.total * 100);
|
|
4845
4845
|
a(y);
|
|
4846
4846
|
}
|
|
4847
4847
|
}, k.onload = () => {
|
|
4848
|
-
o((
|
|
4849
|
-
...
|
|
4848
|
+
o((q) => ({
|
|
4849
|
+
...q,
|
|
4850
4850
|
[n]: !1
|
|
4851
4851
|
})), k.status === 200 || k.status === 201 ? (u(!0), i(k.response), E(k.response)) : (M(k.statusText), F(k));
|
|
4852
4852
|
}, k.onerror = () => {
|
|
@@ -4855,29 +4855,29 @@ const o4 = ({
|
|
|
4855
4855
|
const _ = (s == null ? void 0 : s.method) || "POST";
|
|
4856
4856
|
k.open(_, s == null ? void 0 : s.url, !0);
|
|
4857
4857
|
const J = s == null ? void 0 : s.headers;
|
|
4858
|
-
for (let
|
|
4859
|
-
k.setRequestHeader(
|
|
4860
|
-
const
|
|
4861
|
-
for (let
|
|
4862
|
-
|
|
4863
|
-
|
|
4858
|
+
for (let q in J)
|
|
4859
|
+
k.setRequestHeader(q, J[q]);
|
|
4860
|
+
const ne = new FormData(), se = C == null ? void 0 : C.appendData;
|
|
4861
|
+
for (let q in se)
|
|
4862
|
+
se[q] && ne.append(q, se[q]);
|
|
4863
|
+
ne.append("file", C.file), k.send(ne);
|
|
4864
4864
|
});
|
|
4865
4865
|
};
|
|
4866
4866
|
Q(() => {
|
|
4867
|
-
|
|
4867
|
+
S.current || L(e);
|
|
4868
4868
|
}, []);
|
|
4869
4869
|
const g = () => {
|
|
4870
|
-
|
|
4871
|
-
...
|
|
4870
|
+
S.current && (S.current.abort(), o((C) => ({
|
|
4871
|
+
...C,
|
|
4872
4872
|
[n]: !1
|
|
4873
|
-
})),
|
|
4873
|
+
})), p(!0), a(0));
|
|
4874
4874
|
}, T = () => {
|
|
4875
4875
|
e != null && e.file && (t(
|
|
4876
|
-
(
|
|
4876
|
+
(C) => C.map((E, M) => n === M ? {
|
|
4877
4877
|
...E,
|
|
4878
4878
|
error: !1
|
|
4879
4879
|
} : E)
|
|
4880
|
-
), L({ ...e, error: !1 }),
|
|
4880
|
+
), L({ ...e, error: !1 }), p(!1), m(!1));
|
|
4881
4881
|
};
|
|
4882
4882
|
return e.removed ? null : /* @__PURE__ */ z("li", { children: [
|
|
4883
4883
|
/* @__PURE__ */ c("div", { className: "file-icon", children: v[Ne((x = e.file) == null ? void 0 : x.name)] ?? /* @__PURE__ */ c(Ve, { size: 33 }) }),
|
|
@@ -4887,7 +4887,7 @@ const o4 = ({
|
|
|
4887
4887
|
/* @__PURE__ */ c("span", { className: "file-name text-truncate", title: (w = e.file) == null ? void 0 : w.name, children: ($ = e.file) == null ? void 0 : $.name }),
|
|
4888
4888
|
/* @__PURE__ */ c("span", { className: "file-size", children: Qe((b = e.file) == null ? void 0 : b.size) })
|
|
4889
4889
|
] }),
|
|
4890
|
-
d ? /* @__PURE__ */ c(Nv, { title: O("uploaded"), className: "upload-success" }) :
|
|
4890
|
+
d ? /* @__PURE__ */ c(Nv, { title: O("uploaded"), className: "upload-success" }) : f || h ? /* @__PURE__ */ c(n4, { className: "retry-upload", title: "Retry", onClick: T }) : /* @__PURE__ */ c(
|
|
4891
4891
|
"div",
|
|
4892
4892
|
{
|
|
4893
4893
|
className: "rm-file",
|
|
@@ -4901,7 +4901,7 @@ const o4 = ({
|
|
|
4901
4901
|
t4,
|
|
4902
4902
|
{
|
|
4903
4903
|
percent: l,
|
|
4904
|
-
isCanceled:
|
|
4904
|
+
isCanceled: f,
|
|
4905
4905
|
isCompleted: d,
|
|
4906
4906
|
error: e.error
|
|
4907
4907
|
}
|
|
@@ -4915,12 +4915,12 @@ const o4 = ({
|
|
|
4915
4915
|
onFileUploading: o,
|
|
4916
4916
|
onFileUploaded: s
|
|
4917
4917
|
}) => {
|
|
4918
|
-
const [i, r] = R([]), [l, a] = R(!1), [d, u] = R({}), { currentFolder:
|
|
4918
|
+
const [i, r] = R([]), [l, a] = R(!1), [d, u] = R({}), { currentFolder: f, currentPathFiles: p } = he(), { onError: h } = Xe(), m = re(null), v = de(), S = (T) => {
|
|
4919
4919
|
T.key === "Enter" && m.current.click();
|
|
4920
4920
|
}, N = (T) => {
|
|
4921
4921
|
if (t && !t.includes(Ne(T.name)))
|
|
4922
4922
|
return v("fileTypeNotAllowed");
|
|
4923
|
-
if (
|
|
4923
|
+
if (p.some(
|
|
4924
4924
|
($) => $.name.toLowerCase() === T.name.toLowerCase() && !$.isDirectory
|
|
4925
4925
|
)) return v("fileAlreadyExist");
|
|
4926
4926
|
if (e && T.size > e) return `${v("maxUploadSize")} ${Qe(e, 0)}.`;
|
|
@@ -4929,7 +4929,7 @@ const o4 = ({
|
|
|
4929
4929
|
(x) => !i.some((w) => w.file.name.toLowerCase() === x.name.toLowerCase())
|
|
4930
4930
|
), T.length > 0) {
|
|
4931
4931
|
const x = T.map((w) => {
|
|
4932
|
-
const $ = o(w,
|
|
4932
|
+
const $ = o(w, f), b = N(w);
|
|
4933
4933
|
return b && h({ type: "upload", message: b }, w), {
|
|
4934
4934
|
file: w,
|
|
4935
4935
|
appendData: $,
|
|
@@ -4970,7 +4970,7 @@ const o4 = ({
|
|
|
4970
4970
|
] })
|
|
4971
4971
|
}
|
|
4972
4972
|
),
|
|
4973
|
-
/* @__PURE__ */ c("div", { className: "btn-choose-file", children: /* @__PURE__ */ z(Ee, { padding: "0", onKeyDown:
|
|
4973
|
+
/* @__PURE__ */ c("div", { className: "btn-choose-file", children: /* @__PURE__ */ z(Ee, { padding: "0", onKeyDown: S, children: [
|
|
4974
4974
|
/* @__PURE__ */ c("label", { htmlFor: "chooseFile", children: v("chooseFile") }),
|
|
4975
4975
|
/* @__PURE__ */ c(
|
|
4976
4976
|
"input",
|
|
@@ -5008,17 +5008,17 @@ const o4 = ({
|
|
|
5008
5008
|
] });
|
|
5009
5009
|
}, on = ["jpg", "jpeg", "png"], sn = ["mp4", "mov", "avi"], rn = ["mp3", "wav", "m4a"], an = ["txt", "pdf"], i4 = ({ filePreviewPath: n, filePreviewComponent: e }) => {
|
|
5010
5010
|
var v;
|
|
5011
|
-
const [t, o] = R(!0), [s, i] = R(!1), { selectedFiles: r } = ve(), l = _e(73), a = (v = Ne(r[0].name)) == null ? void 0 : v.toLowerCase(), d = `${n}${r[0].path}`, u = de(),
|
|
5011
|
+
const [t, o] = R(!0), [s, i] = R(!1), { selectedFiles: r } = ve(), l = _e(73), a = (v = Ne(r[0].name)) == null ? void 0 : v.toLowerCase(), d = `${n}${r[0].path}`, u = de(), f = Ge(
|
|
5012
5012
|
() => e == null ? void 0 : e(r[0]),
|
|
5013
5013
|
[e]
|
|
5014
|
-
),
|
|
5014
|
+
), p = () => {
|
|
5015
5015
|
o(!1), i(!1);
|
|
5016
5016
|
}, h = () => {
|
|
5017
5017
|
o(!1), i(!0);
|
|
5018
5018
|
}, m = () => {
|
|
5019
5019
|
window.location.href = d;
|
|
5020
5020
|
};
|
|
5021
|
-
return $e.isValidElement(
|
|
5021
|
+
return $e.isValidElement(f) ? f : /* @__PURE__ */ z("section", { className: `file-previewer ${a === "pdf" ? "pdf-previewer" : ""}`, children: [
|
|
5022
5022
|
s || ![
|
|
5023
5023
|
...on,
|
|
5024
5024
|
...sn,
|
|
@@ -5045,7 +5045,7 @@ const o4 = ({
|
|
|
5045
5045
|
src: d,
|
|
5046
5046
|
alt: "Preview Unavailable",
|
|
5047
5047
|
className: `photo-popup-image ${t ? "img-loading" : ""}`,
|
|
5048
|
-
onLoad:
|
|
5048
|
+
onLoad: p,
|
|
5049
5049
|
onError: h,
|
|
5050
5050
|
loading: "lazy"
|
|
5051
5051
|
}
|
|
@@ -5057,7 +5057,7 @@ const o4 = ({
|
|
|
5057
5057
|
"iframe",
|
|
5058
5058
|
{
|
|
5059
5059
|
src: d,
|
|
5060
|
-
onLoad:
|
|
5060
|
+
onLoad: p,
|
|
5061
5061
|
onError: h,
|
|
5062
5062
|
frameBorder: "0",
|
|
5063
5063
|
className: `photo-popup-iframe ${t ? "img-loading" : ""}`
|
|
@@ -5065,7 +5065,7 @@ const o4 = ({
|
|
|
5065
5065
|
) })
|
|
5066
5066
|
] });
|
|
5067
5067
|
}, dt = (n) => n.toLowerCase(), le = (n, e, t = !1) => {
|
|
5068
|
-
const o =
|
|
5068
|
+
const o = re(/* @__PURE__ */ new Set([])), s = Ge(() => new Set(n.map((a) => dt(a))), [n]), i = (a) => {
|
|
5069
5069
|
if (!a.repeat && (o.current.add(dt(a.key)), s.isSubsetOf(o.current) && !t)) {
|
|
5070
5070
|
a.preventDefault(), e(a);
|
|
5071
5071
|
return;
|
|
@@ -5097,38 +5097,38 @@ const o4 = ({
|
|
|
5097
5097
|
refresh: ["F5"],
|
|
5098
5098
|
clearSelection: ["Escape"]
|
|
5099
5099
|
}, r4 = (n, e, t) => {
|
|
5100
|
-
const { setClipBoard: o, handleCutCopy: s, handlePasting: i } = Ze(), { currentFolder: r, currentPathFiles: l } = he(), {
|
|
5100
|
+
const { setClipBoard: o, handleCutCopy: s, handlePasting: i } = Ze(), { currentFolder: r, currentPathFiles: l } = he(), { selectedFiles: a, setSelectedFiles: d, handleDownload: u } = ve(), { setActiveLayout: f } = ye(), p = () => {
|
|
5101
5101
|
t.create && n.show("createFolder");
|
|
5102
|
-
}, f = () => {
|
|
5103
|
-
t.upload && n.show("uploadFile");
|
|
5104
5102
|
}, h = () => {
|
|
5105
|
-
t.
|
|
5103
|
+
t.upload && n.show("uploadFile");
|
|
5106
5104
|
}, m = () => {
|
|
5107
|
-
t.
|
|
5105
|
+
t.move && s(!0);
|
|
5108
5106
|
}, v = () => {
|
|
5107
|
+
t.copy && s(!1);
|
|
5108
|
+
}, S = () => {
|
|
5109
5109
|
i(r);
|
|
5110
|
-
}, C = () => {
|
|
5111
|
-
t.rename && n.show("rename");
|
|
5112
5110
|
}, N = () => {
|
|
5113
|
-
t.
|
|
5111
|
+
t.rename && n.show("rename");
|
|
5114
5112
|
}, O = () => {
|
|
5115
|
-
t.
|
|
5113
|
+
t.download && u();
|
|
5116
5114
|
}, F = () => {
|
|
5117
|
-
|
|
5115
|
+
t.delete && a.length && n.show("delete");
|
|
5118
5116
|
}, L = () => {
|
|
5119
|
-
l.length > 0 &&
|
|
5117
|
+
l.length > 0 && d([l[0]]);
|
|
5120
5118
|
}, g = () => {
|
|
5121
|
-
|
|
5119
|
+
l.length > 0 && d([l.at(-1)]);
|
|
5122
5120
|
}, T = () => {
|
|
5123
|
-
|
|
5121
|
+
d(l);
|
|
5124
5122
|
}, x = () => {
|
|
5125
|
-
|
|
5123
|
+
d((C) => C.length > 0 ? [] : C);
|
|
5126
5124
|
}, w = () => {
|
|
5127
|
-
|
|
5125
|
+
xe(e, "onRefresh"), o(null);
|
|
5128
5126
|
}, $ = () => {
|
|
5129
|
-
|
|
5127
|
+
f("grid");
|
|
5128
|
+
}, b = () => {
|
|
5129
|
+
f("list");
|
|
5130
5130
|
};
|
|
5131
|
-
le(ce.createFolder, p, n.isActive), le(ce.uploadFiles,
|
|
5131
|
+
le(ce.createFolder, p, n.isActive), le(ce.uploadFiles, h, n.isActive), le(ce.cut, m, n.isActive), le(ce.copy, v, n.isActive), le(ce.paste, S, n.isActive), le(ce.rename, N, n.isActive), le(ce.download, O, n.isActive), le(ce.delete, F, n.isActive), le(ce.jumpToFirst, L, n.isActive), le(ce.jumpToLast, g, n.isActive), le(ce.selectAll, T, n.isActive), le(ce.clearSelection, x, n.isActive), le(ce.refresh, w, n.isActive), le(ce.gridLayout, $, n.isActive), le(ce.listLayout, b, n.isActive);
|
|
5132
5132
|
}, a4 = ({
|
|
5133
5133
|
fileUploadConfig: n,
|
|
5134
5134
|
onFileUploading: e,
|
|
@@ -5142,7 +5142,7 @@ const o4 = ({
|
|
|
5142
5142
|
triggerAction: d,
|
|
5143
5143
|
permissions: u
|
|
5144
5144
|
}) => {
|
|
5145
|
-
const [
|
|
5145
|
+
const [f, p] = R(null), { selectedFiles: h } = ve(), m = de();
|
|
5146
5146
|
r4(d, s, u);
|
|
5147
5147
|
const v = {
|
|
5148
5148
|
uploadFile: {
|
|
@@ -5178,19 +5178,19 @@ const o4 = ({
|
|
|
5178
5178
|
};
|
|
5179
5179
|
if (Q(() => {
|
|
5180
5180
|
if (d.isActive) {
|
|
5181
|
-
const
|
|
5182
|
-
|
|
5181
|
+
const S = d.actionType;
|
|
5182
|
+
S === "previewFile" && (v[S].title = (h == null ? void 0 : h.name) ?? m("preview")), p(v[S]);
|
|
5183
5183
|
} else
|
|
5184
|
-
|
|
5185
|
-
}, [d.isActive]),
|
|
5184
|
+
p(null);
|
|
5185
|
+
}, [d.isActive]), f)
|
|
5186
5186
|
return /* @__PURE__ */ c(
|
|
5187
5187
|
Dn,
|
|
5188
5188
|
{
|
|
5189
|
-
heading:
|
|
5189
|
+
heading: f.title,
|
|
5190
5190
|
show: d.isActive,
|
|
5191
5191
|
setShow: d.close,
|
|
5192
|
-
dialogWidth:
|
|
5193
|
-
children:
|
|
5192
|
+
dialogWidth: f.width,
|
|
5193
|
+
children: f == null ? void 0 : f.component
|
|
5194
5194
|
}
|
|
5195
5195
|
);
|
|
5196
5196
|
}, l4 = () => {
|
|
@@ -5206,7 +5206,7 @@ const o4 = ({
|
|
|
5206
5206
|
}
|
|
5207
5207
|
};
|
|
5208
5208
|
}, c4 = (n, e) => {
|
|
5209
|
-
const [t, o] = R({ col1: n, col2: e }), [s, i] = R(!1), r =
|
|
5209
|
+
const [t, o] = R({ col1: n, col2: e }), [s, i] = R(!1), r = re(null);
|
|
5210
5210
|
return {
|
|
5211
5211
|
containerRef: r,
|
|
5212
5212
|
colSizes: t,
|
|
@@ -5221,7 +5221,7 @@ const o4 = ({
|
|
|
5221
5221
|
handleMouseMove: (u) => {
|
|
5222
5222
|
if (!s) return;
|
|
5223
5223
|
u.preventDefault();
|
|
5224
|
-
const
|
|
5224
|
+
const p = r.current.getBoundingClientRect(), h = (u.clientX - p.left) / p.width * 100;
|
|
5225
5225
|
h >= 15 && h <= 60 && o({ col1: h, col2: 100 - h });
|
|
5226
5226
|
}
|
|
5227
5227
|
};
|
|
@@ -5263,187 +5263,197 @@ const o4 = ({
|
|
|
5263
5263
|
onPaste: a,
|
|
5264
5264
|
onRename: d,
|
|
5265
5265
|
onDownload: u,
|
|
5266
|
-
onDelete:
|
|
5267
|
-
onLayoutChange:
|
|
5266
|
+
onDelete: f = () => null,
|
|
5267
|
+
onLayoutChange: p = () => {
|
|
5268
5268
|
},
|
|
5269
5269
|
onRefresh: h,
|
|
5270
5270
|
onFileOpen: m = () => {
|
|
5271
5271
|
},
|
|
5272
5272
|
onFolderChange: v = () => {
|
|
5273
5273
|
},
|
|
5274
|
-
onSelect:
|
|
5275
|
-
|
|
5274
|
+
onSelect: S,
|
|
5275
|
+
onSelectionChange: N,
|
|
5276
|
+
onError: O = () => {
|
|
5276
5277
|
},
|
|
5277
|
-
layout:
|
|
5278
|
-
enableFilePreview:
|
|
5279
|
-
maxFileSize:
|
|
5280
|
-
filePreviewPath:
|
|
5281
|
-
acceptedFileTypes:
|
|
5282
|
-
height:
|
|
5283
|
-
width:
|
|
5284
|
-
initialPath:
|
|
5285
|
-
filePreviewComponent:
|
|
5286
|
-
primaryColor:
|
|
5287
|
-
fontFamily:
|
|
5288
|
-
language:
|
|
5289
|
-
permissions:
|
|
5290
|
-
collapsibleNav:
|
|
5291
|
-
defaultNavExpanded:
|
|
5278
|
+
layout: F = "grid",
|
|
5279
|
+
enableFilePreview: L = !0,
|
|
5280
|
+
maxFileSize: g,
|
|
5281
|
+
filePreviewPath: T,
|
|
5282
|
+
acceptedFileTypes: x,
|
|
5283
|
+
height: w = "600px",
|
|
5284
|
+
width: $ = "100%",
|
|
5285
|
+
initialPath: b = "",
|
|
5286
|
+
filePreviewComponent: C,
|
|
5287
|
+
primaryColor: E = "#6155b4",
|
|
5288
|
+
fontFamily: M = "Nunito Sans, sans-serif",
|
|
5289
|
+
language: k = "en",
|
|
5290
|
+
permissions: _ = {},
|
|
5291
|
+
collapsibleNav: J = !1,
|
|
5292
|
+
defaultNavExpanded: ne = !0
|
|
5292
5293
|
}) => {
|
|
5293
|
-
const [
|
|
5294
|
-
"--file-manager-font-family":
|
|
5295
|
-
"--file-manager-primary-color":
|
|
5296
|
-
height:
|
|
5297
|
-
width:
|
|
5298
|
-
},
|
|
5299
|
-
() => ({ ...u4, ...
|
|
5300
|
-
[
|
|
5294
|
+
const [se, q] = R(ne), y = l4(), { containerRef: P, colSizes: j, isDragging: V, handleMouseMove: U, handleMouseUp: G, handleMouseDown: W } = c4(20, 80), Y = {
|
|
5295
|
+
"--file-manager-font-family": M,
|
|
5296
|
+
"--file-manager-primary-color": E,
|
|
5297
|
+
height: w,
|
|
5298
|
+
width: $
|
|
5299
|
+
}, K = Ge(
|
|
5300
|
+
() => ({ ...u4, ..._ }),
|
|
5301
|
+
[_]
|
|
5301
5302
|
);
|
|
5302
|
-
return /* @__PURE__ */ z("main", { className: "file-explorer", onContextMenu: (
|
|
5303
|
+
return /* @__PURE__ */ z("main", { className: "file-explorer", onContextMenu: (X) => X.preventDefault(), style: Y, children: [
|
|
5303
5304
|
/* @__PURE__ */ c(pt, { loading: t }),
|
|
5304
|
-
/* @__PURE__ */ c(ev, { language:
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5305
|
+
/* @__PURE__ */ c(ev, { language: k, children: /* @__PURE__ */ c(nv, { filesData: n, onError: O, children: /* @__PURE__ */ c(sv, { initialPath: b, onFolderChange: v, children: /* @__PURE__ */ c(
|
|
5306
|
+
iv,
|
|
5307
|
+
{
|
|
5308
|
+
onDownload: u,
|
|
5309
|
+
onSelect: S,
|
|
5310
|
+
onSelectionChange: N,
|
|
5311
|
+
children: /* @__PURE__ */ c(rv, { onPaste: a, onCut: r, onCopy: l, children: /* @__PURE__ */ z(uo, { layout: F, children: [
|
|
5312
|
+
/* @__PURE__ */ c(
|
|
5313
|
+
Ln,
|
|
5314
|
+
{
|
|
5315
|
+
onLayoutChange: p,
|
|
5316
|
+
onRefresh: h,
|
|
5317
|
+
triggerAction: y,
|
|
5318
|
+
permissions: K
|
|
5319
|
+
}
|
|
5320
|
+
),
|
|
5321
|
+
/* @__PURE__ */ z(
|
|
5322
|
+
"section",
|
|
5323
|
+
{
|
|
5324
|
+
ref: P,
|
|
5325
|
+
onMouseMove: U,
|
|
5326
|
+
onMouseUp: G,
|
|
5327
|
+
className: "files-container",
|
|
5328
|
+
children: [
|
|
5329
|
+
/* @__PURE__ */ z(
|
|
5330
|
+
"div",
|
|
5331
|
+
{
|
|
5332
|
+
className: `navigation-pane ${se ? "open" : "closed"}`,
|
|
5333
|
+
style: {
|
|
5334
|
+
width: j.col1 + "%"
|
|
5335
|
+
},
|
|
5336
|
+
children: [
|
|
5337
|
+
/* @__PURE__ */ c(zn, { onFileOpen: m }),
|
|
5338
|
+
/* @__PURE__ */ c(
|
|
5339
|
+
"div",
|
|
5340
|
+
{
|
|
5341
|
+
className: `sidebar-resize ${V ? "sidebar-dragging" : ""}`,
|
|
5342
|
+
onMouseDown: W
|
|
5343
|
+
}
|
|
5344
|
+
)
|
|
5345
|
+
]
|
|
5346
|
+
}
|
|
5347
|
+
),
|
|
5348
|
+
/* @__PURE__ */ z(
|
|
5349
|
+
"div",
|
|
5350
|
+
{
|
|
5351
|
+
className: "folders-preview",
|
|
5352
|
+
style: { width: (se ? j.col2 : 100) + "%" },
|
|
5353
|
+
children: [
|
|
5354
|
+
/* @__PURE__ */ c(
|
|
5355
|
+
gt,
|
|
5356
|
+
{
|
|
5357
|
+
collapsibleNav: J,
|
|
5358
|
+
isNavigationPaneOpen: se,
|
|
5359
|
+
setNavigationPaneOpen: q
|
|
5360
|
+
}
|
|
5361
|
+
),
|
|
5362
|
+
/* @__PURE__ */ c(
|
|
5363
|
+
Hn,
|
|
5364
|
+
{
|
|
5365
|
+
onCreateFolder: o,
|
|
5366
|
+
onRename: d,
|
|
5367
|
+
onFileOpen: m,
|
|
5368
|
+
onRefresh: h,
|
|
5369
|
+
enableFilePreview: L,
|
|
5370
|
+
triggerAction: y,
|
|
5371
|
+
permissions: K
|
|
5372
|
+
}
|
|
5373
|
+
)
|
|
5374
|
+
]
|
|
5375
|
+
}
|
|
5376
|
+
)
|
|
5377
|
+
]
|
|
5378
|
+
}
|
|
5379
|
+
),
|
|
5380
|
+
/* @__PURE__ */ c(
|
|
5381
|
+
a4,
|
|
5382
|
+
{
|
|
5383
|
+
fileUploadConfig: e,
|
|
5384
|
+
onFileUploading: s,
|
|
5385
|
+
onFileUploaded: i,
|
|
5386
|
+
onDelete: f,
|
|
5387
|
+
onRefresh: h,
|
|
5388
|
+
maxFileSize: g,
|
|
5389
|
+
filePreviewPath: T,
|
|
5390
|
+
filePreviewComponent: C,
|
|
5391
|
+
acceptedFileTypes: x,
|
|
5392
|
+
triggerAction: y,
|
|
5393
|
+
permissions: K
|
|
5394
|
+
}
|
|
5395
|
+
)
|
|
5396
|
+
] }) })
|
|
5397
|
+
}
|
|
5398
|
+
) }) }) })
|
|
5390
5399
|
] });
|
|
5391
5400
|
};
|
|
5392
5401
|
jn.displayName = "FileManager";
|
|
5393
5402
|
jn.propTypes = {
|
|
5394
|
-
files:
|
|
5395
|
-
|
|
5396
|
-
name:
|
|
5397
|
-
isDirectory:
|
|
5398
|
-
path:
|
|
5403
|
+
files: I.arrayOf(
|
|
5404
|
+
I.shape({
|
|
5405
|
+
name: I.string.isRequired,
|
|
5406
|
+
isDirectory: I.bool.isRequired,
|
|
5407
|
+
path: I.string.isRequired,
|
|
5399
5408
|
updatedAt: d4,
|
|
5400
|
-
size:
|
|
5409
|
+
size: I.number
|
|
5401
5410
|
})
|
|
5402
5411
|
).isRequired,
|
|
5403
|
-
fileUploadConfig:
|
|
5412
|
+
fileUploadConfig: I.shape({
|
|
5404
5413
|
url: ln,
|
|
5405
|
-
headers:
|
|
5406
|
-
method:
|
|
5414
|
+
headers: I.objectOf(I.string),
|
|
5415
|
+
method: I.oneOf(["POST", "PUT"])
|
|
5407
5416
|
}),
|
|
5408
|
-
isLoading:
|
|
5409
|
-
onCreateFolder:
|
|
5410
|
-
onFileUploading:
|
|
5411
|
-
onFileUploaded:
|
|
5412
|
-
onRename:
|
|
5413
|
-
onDelete:
|
|
5414
|
-
onCut:
|
|
5415
|
-
onCopy:
|
|
5416
|
-
onPaste:
|
|
5417
|
-
onDownload:
|
|
5418
|
-
onLayoutChange:
|
|
5419
|
-
onRefresh:
|
|
5420
|
-
onFileOpen:
|
|
5421
|
-
onFolderChange:
|
|
5422
|
-
onSelect:
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5417
|
+
isLoading: I.bool,
|
|
5418
|
+
onCreateFolder: I.func,
|
|
5419
|
+
onFileUploading: I.func,
|
|
5420
|
+
onFileUploaded: I.func,
|
|
5421
|
+
onRename: I.func,
|
|
5422
|
+
onDelete: I.func,
|
|
5423
|
+
onCut: I.func,
|
|
5424
|
+
onCopy: I.func,
|
|
5425
|
+
onPaste: I.func,
|
|
5426
|
+
onDownload: I.func,
|
|
5427
|
+
onLayoutChange: I.func,
|
|
5428
|
+
onRefresh: I.func,
|
|
5429
|
+
onFileOpen: I.func,
|
|
5430
|
+
onFolderChange: I.func,
|
|
5431
|
+
onSelect: I.func,
|
|
5432
|
+
onSelectionChange: I.func,
|
|
5433
|
+
onError: I.func,
|
|
5434
|
+
layout: I.oneOf(["grid", "list"]),
|
|
5435
|
+
maxFileSize: I.number,
|
|
5436
|
+
enableFilePreview: I.bool,
|
|
5427
5437
|
filePreviewPath: ln,
|
|
5428
|
-
acceptedFileTypes:
|
|
5429
|
-
height:
|
|
5430
|
-
width:
|
|
5431
|
-
initialPath:
|
|
5432
|
-
filePreviewComponent:
|
|
5433
|
-
primaryColor:
|
|
5434
|
-
fontFamily:
|
|
5435
|
-
language:
|
|
5436
|
-
permissions:
|
|
5437
|
-
create:
|
|
5438
|
-
upload:
|
|
5439
|
-
move:
|
|
5440
|
-
copy:
|
|
5441
|
-
rename:
|
|
5442
|
-
download:
|
|
5443
|
-
delete:
|
|
5438
|
+
acceptedFileTypes: I.string,
|
|
5439
|
+
height: I.oneOfType([I.string, I.number]),
|
|
5440
|
+
width: I.oneOfType([I.string, I.number]),
|
|
5441
|
+
initialPath: I.string,
|
|
5442
|
+
filePreviewComponent: I.func,
|
|
5443
|
+
primaryColor: I.string,
|
|
5444
|
+
fontFamily: I.string,
|
|
5445
|
+
language: I.string,
|
|
5446
|
+
permissions: I.shape({
|
|
5447
|
+
create: I.bool,
|
|
5448
|
+
upload: I.bool,
|
|
5449
|
+
move: I.bool,
|
|
5450
|
+
copy: I.bool,
|
|
5451
|
+
rename: I.bool,
|
|
5452
|
+
download: I.bool,
|
|
5453
|
+
delete: I.bool
|
|
5444
5454
|
}),
|
|
5445
|
-
collapsibleNav:
|
|
5446
|
-
defaultNavExpanded:
|
|
5455
|
+
collapsibleNav: I.bool,
|
|
5456
|
+
defaultNavExpanded: I.bool
|
|
5447
5457
|
};
|
|
5448
5458
|
export {
|
|
5449
5459
|
jn as FileManager
|