vuefinder 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vuefinder.js +869 -869
- package/dist/vuefinder.umd.cjs +4 -4
- package/package.json +2 -4
package/dist/vuefinder.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as V, watch as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { ref as V, watch as Nt, inject as R, openBlock as x, createElementBlock as C, createElementVNode as d, unref as _, normalizeClass as ue, createTextVNode as Me, toDisplayString as E, createCommentVNode as oe, createVNode as ye, TransitionGroup as Ti, withCtx as ee, Fragment as se, renderList as ve, reactive as dt, onMounted as xe, withDirectives as ge, vShow as at, normalizeStyle as Lt, withModifiers as Oe, nextTick as mt, vModelSelect as lr, customRef as Ai, withKeys as Ke, isRef as Oi, vModelText as Ye, provide as yt, createBlock as ce, resolveDynamicComponent as Pi, renderSlot as cr } from "vue";
|
|
2
|
+
import wt from "plupload";
|
|
3
|
+
const ht = (o, { method: e = "get", params: t = {}, json: n = !0 }) => {
|
|
4
4
|
const a = { method: e };
|
|
5
5
|
if (e == "get")
|
|
6
6
|
o += "?" + new URLSearchParams(t);
|
|
@@ -13,7 +13,7 @@ const dt = (o, { method: e = "get", params: t = {}, json: n = !0 }) => {
|
|
|
13
13
|
}
|
|
14
14
|
return fetch(o, a).then((i) => i.ok ? n ? i.json() : i.text() : Promise.reject(i));
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function Ii(o) {
|
|
17
17
|
return { all: o = o || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
18
18
|
var n = o.get(e);
|
|
19
19
|
n ? n.push(t) : o.set(e, [t]);
|
|
@@ -29,10 +29,10 @@ function ji(o) {
|
|
|
29
29
|
});
|
|
30
30
|
} };
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function St(o) {
|
|
33
33
|
let e = localStorage.getItem(o + "_storage");
|
|
34
34
|
const t = V(JSON.parse(e));
|
|
35
|
-
|
|
35
|
+
Nt(t, n);
|
|
36
36
|
function n() {
|
|
37
37
|
t.value === null || t.value === "" ? localStorage.removeItem(o + "_storage") : localStorage.setItem(o + "_storage", JSON.stringify(t.value));
|
|
38
38
|
}
|
|
@@ -44,17 +44,17 @@ function kt(o) {
|
|
|
44
44
|
}
|
|
45
45
|
return { getStore: (f, m = null) => t.value === null || t.value === "" ? m : t.value.hasOwnProperty(f) ? t.value[f] : m, setStore: a, clearStore: i };
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
function
|
|
47
|
+
const ur = V("");
|
|
48
|
+
function Se() {
|
|
49
49
|
function o(e) {
|
|
50
|
-
|
|
50
|
+
ur.value = e;
|
|
51
51
|
}
|
|
52
|
-
return { apiUrl:
|
|
52
|
+
return { apiUrl: ur, setApiUrl: o };
|
|
53
53
|
}
|
|
54
|
-
const
|
|
54
|
+
const Ni = { class: "border-neutral-300 flex justify-between items-center py-1 text-sm" }, Li = {
|
|
55
55
|
key: 0,
|
|
56
56
|
class: "flex text-center"
|
|
57
|
-
},
|
|
57
|
+
}, ji = ["aria-label"], Vi = /* @__PURE__ */ d("svg", {
|
|
58
58
|
xmlns: "http://www.w3.org/2000/svg",
|
|
59
59
|
class: "h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",
|
|
60
60
|
fill: "none",
|
|
@@ -166,7 +166,7 @@ const Ii = { class: "border-neutral-300 flex justify-between items-center py-1 t
|
|
|
166
166
|
data: Object
|
|
167
167
|
},
|
|
168
168
|
setup(o) {
|
|
169
|
-
const e =
|
|
169
|
+
const e = R("emitter"), { getStore: t, setStore: n } = R("storage"), { t: a } = R("i18n"), i = V(t("viewport", "grid")), l = V([]), f = V(t("full-screen", !1)), m = V("");
|
|
170
170
|
e.on("vf-search-query", ({ newQuery: h }) => {
|
|
171
171
|
m.value = h;
|
|
172
172
|
});
|
|
@@ -177,20 +177,20 @@ const Ii = { class: "border-neutral-300 flex justify-between items-center py-1 t
|
|
|
177
177
|
l.value = h;
|
|
178
178
|
}), e.on("vf-view-toggle", (h) => {
|
|
179
179
|
n("viewport", h), i.value = h;
|
|
180
|
-
}), (h, v) => (x(), C("div",
|
|
180
|
+
}), (h, v) => (x(), C("div", Ni, [
|
|
181
181
|
m.value.length ? (x(), C("div", on, [
|
|
182
182
|
d("div", an, [
|
|
183
|
-
|
|
183
|
+
Me(E(_(a)("Search results for")) + " ", 1),
|
|
184
184
|
d("span", sn, E(m.value), 1)
|
|
185
185
|
])
|
|
186
|
-
])) : (x(), C("div",
|
|
186
|
+
])) : (x(), C("div", Li, [
|
|
187
187
|
d("div", {
|
|
188
188
|
class: "mx-1.5",
|
|
189
189
|
"aria-label": _(a)("New Folder"),
|
|
190
190
|
"data-microtip-position": "bottom-right",
|
|
191
191
|
role: "tooltip",
|
|
192
192
|
onClick: v[0] || (v[0] = (b) => _(e).emit("vf-modal-show", { type: "new-folder", items: l.value }))
|
|
193
|
-
}, zi, 8,
|
|
193
|
+
}, zi, 8, ji),
|
|
194
194
|
d("div", {
|
|
195
195
|
class: "mx-1.5",
|
|
196
196
|
"aria-label": _(a)("New File"),
|
|
@@ -207,7 +207,7 @@ const Ii = { class: "border-neutral-300 flex justify-between items-center py-1 t
|
|
|
207
207
|
}, [
|
|
208
208
|
(x(), C("svg", {
|
|
209
209
|
xmlns: "http://www.w3.org/2000/svg",
|
|
210
|
-
class:
|
|
210
|
+
class: ue([l.value.length == 1 ? "cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300" : "stroke-gray-200 dark:stroke-gray-700", "h-6 w-6 md:h-8 md:w-8 m-auto"]),
|
|
211
211
|
fill: "none",
|
|
212
212
|
viewBox: "0 0 24 24",
|
|
213
213
|
stroke: "none",
|
|
@@ -223,7 +223,7 @@ const Ii = { class: "border-neutral-300 flex justify-between items-center py-1 t
|
|
|
223
223
|
}, [
|
|
224
224
|
(x(), C("svg", {
|
|
225
225
|
xmlns: "http://www.w3.org/2000/svg",
|
|
226
|
-
class:
|
|
226
|
+
class: ue([l.value.length ? "cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300" : "stroke-gray-200 dark:stroke-gray-700", "h-6 w-6 md:h-8 md:w-8 m-auto"]),
|
|
227
227
|
fill: "none",
|
|
228
228
|
viewBox: "0 0 24 24",
|
|
229
229
|
stroke: "none",
|
|
@@ -247,7 +247,7 @@ const Ii = { class: "border-neutral-300 flex justify-between items-center py-1 t
|
|
|
247
247
|
}, [
|
|
248
248
|
(x(), C("svg", {
|
|
249
249
|
xmlns: "http://www.w3.org/2000/svg",
|
|
250
|
-
class:
|
|
250
|
+
class: ue([l.value.length ? "cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300" : "stroke-gray-200 dark:stroke-gray-700", "h-6 w-6 md:h-8 md:w-8 m-auto"]),
|
|
251
251
|
fill: "none",
|
|
252
252
|
viewBox: "0 0 24 24",
|
|
253
253
|
stroke: "none",
|
|
@@ -263,7 +263,7 @@ const Ii = { class: "border-neutral-300 flex justify-between items-center py-1 t
|
|
|
263
263
|
}, [
|
|
264
264
|
(x(), C("svg", {
|
|
265
265
|
xmlns: "http://www.w3.org/2000/svg",
|
|
266
|
-
class:
|
|
266
|
+
class: ue([l.value.length ? "cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300" : "stroke-gray-200 dark:stroke-gray-700", "h-6 w-6 md:h-8 md:w-8 m-auto"]),
|
|
267
267
|
fill: "none",
|
|
268
268
|
viewBox: "0 0 24 24",
|
|
269
269
|
stroke: "none",
|
|
@@ -307,21 +307,21 @@ const Ii = { class: "border-neutral-300 flex justify-between items-center py-1 t
|
|
|
307
307
|
}, [
|
|
308
308
|
(x(), C("svg", {
|
|
309
309
|
xmlns: "http://www.w3.org/2000/svg",
|
|
310
|
-
class:
|
|
310
|
+
class: ue([m.value.length ? "stroke-gray-200 dark:stroke-gray-700" : "cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300", "h-6 w-6 md:h-8 md:w-8 m-auto"]),
|
|
311
311
|
fill: "none",
|
|
312
312
|
viewBox: "0 0 24 24",
|
|
313
313
|
stroke: "none",
|
|
314
314
|
"stroke-width": "1.5"
|
|
315
315
|
}, [
|
|
316
|
-
i.value == "grid" ? (x(), C("path", vn)) :
|
|
317
|
-
i.value == "list" ? (x(), C("path", bn)) :
|
|
316
|
+
i.value == "grid" ? (x(), C("path", vn)) : oe("", !0),
|
|
317
|
+
i.value == "list" ? (x(), C("path", bn)) : oe("", !0)
|
|
318
318
|
], 2))
|
|
319
319
|
], 8, gn)
|
|
320
320
|
])
|
|
321
321
|
]));
|
|
322
322
|
}
|
|
323
323
|
});
|
|
324
|
-
var xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
|
|
324
|
+
var xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Mr = { exports: {} };
|
|
325
325
|
(function(o, e) {
|
|
326
326
|
(function(t, n) {
|
|
327
327
|
o.exports = n();
|
|
@@ -442,7 +442,7 @@ var xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
442
442
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
443
443
|
return u;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function L(u, s) {
|
|
446
446
|
return s && (typeof s == "object" || typeof s == "function") ? s : T(u);
|
|
447
447
|
}
|
|
448
448
|
function z(u) {
|
|
@@ -454,7 +454,7 @@ var xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
454
454
|
c = Reflect.construct(g, arguments, y);
|
|
455
455
|
} else
|
|
456
456
|
c = g.apply(this, arguments);
|
|
457
|
-
return
|
|
457
|
+
return L(this, c);
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
460
|
function B(u, s) {
|
|
@@ -471,25 +471,25 @@ var xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
471
471
|
}
|
|
472
472
|
}, P(u, s, r || u);
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
return
|
|
474
|
+
function ne(u, s) {
|
|
475
|
+
return X(u) || le(u, s) || fe(u, s) || I();
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return D(u) ||
|
|
477
|
+
function F(u) {
|
|
478
|
+
return D(u) || q(u) || fe(u) || U();
|
|
479
479
|
}
|
|
480
480
|
function D(u) {
|
|
481
481
|
if (Array.isArray(u))
|
|
482
|
-
return
|
|
482
|
+
return N(u);
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function X(u) {
|
|
485
485
|
if (Array.isArray(u))
|
|
486
486
|
return u;
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function q(u) {
|
|
489
489
|
if (typeof Symbol < "u" && Symbol.iterator in Object(u))
|
|
490
490
|
return Array.from(u);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function le(u, s) {
|
|
493
493
|
if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(u)))) {
|
|
494
494
|
var r = [], g = !0, c = !1, y = void 0;
|
|
495
495
|
try {
|
|
@@ -508,32 +508,32 @@ var xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
508
508
|
return r;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function fe(u, s) {
|
|
512
512
|
if (!!u) {
|
|
513
513
|
if (typeof u == "string")
|
|
514
|
-
return
|
|
514
|
+
return N(u, s);
|
|
515
515
|
var r = Object.prototype.toString.call(u).slice(8, -1);
|
|
516
516
|
if (r === "Object" && u.constructor && (r = u.constructor.name), r === "Map" || r === "Set")
|
|
517
517
|
return Array.from(u);
|
|
518
518
|
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
|
|
519
|
-
return
|
|
519
|
+
return N(u, s);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function N(u, s) {
|
|
523
523
|
(s == null || s > u.length) && (s = u.length);
|
|
524
524
|
for (var r = 0, g = new Array(s); r < s; r++)
|
|
525
525
|
g[r] = u[r];
|
|
526
526
|
return g;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function U() {
|
|
529
529
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
530
530
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function I() {
|
|
533
533
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
534
534
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
535
535
|
}
|
|
536
|
-
var
|
|
536
|
+
var Y = function(s, r, g) {
|
|
537
537
|
var c = s.x, y = s.y, w = g.x, k = g.y, S = {
|
|
538
538
|
"+": {
|
|
539
539
|
x: c + w,
|
|
@@ -553,12 +553,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
553
553
|
}
|
|
554
554
|
};
|
|
555
555
|
return S[r];
|
|
556
|
-
},
|
|
556
|
+
}, H = function(s) {
|
|
557
557
|
return {
|
|
558
558
|
x: s.left,
|
|
559
559
|
y: s.top
|
|
560
560
|
};
|
|
561
|
-
},
|
|
561
|
+
}, te = function(s) {
|
|
562
562
|
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
563
563
|
return {
|
|
564
564
|
left: s.x,
|
|
@@ -568,28 +568,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
568
568
|
width: r,
|
|
569
569
|
height: r
|
|
570
570
|
};
|
|
571
|
-
},
|
|
571
|
+
}, G = function(s) {
|
|
572
572
|
return {
|
|
573
573
|
x: s,
|
|
574
574
|
y: s
|
|
575
575
|
};
|
|
576
|
-
},
|
|
576
|
+
}, We = function(u, s, r) {
|
|
577
577
|
window.addEventListener("resize", s), window.addEventListener("scroll", s), u.forEach(function(g, c) {
|
|
578
578
|
r.observe(g, {
|
|
579
579
|
childList: c !== 0,
|
|
580
580
|
attributes: !0
|
|
581
581
|
});
|
|
582
582
|
});
|
|
583
|
-
},
|
|
584
|
-
var s =
|
|
583
|
+
}, Xe = function(u) {
|
|
584
|
+
var s = Le(u);
|
|
585
585
|
return s.x || s.y ? !0 : u instanceof HTMLDocument ? u.body ? !!(u.body.scrollTop = 1) : !!(u.documentElement.scrollTop = 1) : !!(u.scrollTop = 1);
|
|
586
|
-
},
|
|
586
|
+
}, rt = function(u) {
|
|
587
587
|
var s = document.createElement("div");
|
|
588
588
|
return s.style.position = "fixed", s.style.overflow = "hidden", s.style.pointerEvents = "none", s.style.zIndex = "999999999999999999", s.classList.add(u), s;
|
|
589
|
-
},
|
|
589
|
+
}, it = function(u) {
|
|
590
590
|
var s = document.createElement("div");
|
|
591
591
|
return s.style.position = "absolute", u || (s.style.background = "rgba(0, 0, 255, 0.1)", s.style.border = "1px solid rgba(0, 0, 255, 0.45)", s.style.display = "none", s.style.pointerEvents = "none"), s;
|
|
592
|
-
},
|
|
592
|
+
}, nt = function(u, s) {
|
|
593
593
|
var r;
|
|
594
594
|
return function() {
|
|
595
595
|
for (var g = arguments.length, c = new Array(g), y = 0; y < g; y++)
|
|
@@ -599,13 +599,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
599
599
|
};
|
|
600
600
|
clearTimeout(r), r = setTimeout(w, s);
|
|
601
601
|
};
|
|
602
|
-
},
|
|
602
|
+
}, Ne = function() {
|
|
603
603
|
var u, s, r, g;
|
|
604
604
|
return {
|
|
605
605
|
y: ((u = document.body) === null || u === void 0 ? void 0 : u.scrollTop) || ((s = document.documentElement) === null || s === void 0 ? void 0 : s.scrollTop) || 0,
|
|
606
606
|
x: ((r = document.body) === null || r === void 0 ? void 0 : r.scrollLeft) || ((g = document.documentElement) === null || g === void 0 ? void 0 : g.scrollLeft) || 0
|
|
607
607
|
};
|
|
608
|
-
},
|
|
608
|
+
}, gt = function(u, s) {
|
|
609
609
|
if (u instanceof Document)
|
|
610
610
|
return {
|
|
611
611
|
top: 0,
|
|
@@ -624,27 +624,27 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
624
624
|
width: (u.clientWidth || r.width) * s,
|
|
625
625
|
height: (u.clientHeight || r.height) * s
|
|
626
626
|
};
|
|
627
|
-
},
|
|
628
|
-
return !u || u instanceof Document ?
|
|
629
|
-
x: u.scrollLeft >= 0 ? u.scrollLeft :
|
|
630
|
-
y: u.scrollTop >= 0 ? u.scrollTop :
|
|
627
|
+
}, Le = function(u) {
|
|
628
|
+
return !u || u instanceof Document ? Ne() : {
|
|
629
|
+
x: u.scrollLeft >= 0 ? u.scrollLeft : Ne().x,
|
|
630
|
+
y: u.scrollTop >= 0 ? u.scrollTop : Ne().y
|
|
631
631
|
};
|
|
632
|
-
},
|
|
632
|
+
}, Ht = function(u) {
|
|
633
633
|
var s = u.elementRect, r = u.containerRect, g = u.tolerance, c = g === void 0 ? {
|
|
634
634
|
x: 0,
|
|
635
635
|
y: 0
|
|
636
636
|
} : g, y = [];
|
|
637
637
|
return s.top - c.y < r.top && y.push("top"), s.left - c.x < r.left && y.push("left"), s.bottom + c.y > r.bottom && y.push("bottom"), s.right + c.y > r.right && y.push("right"), y;
|
|
638
|
-
},
|
|
638
|
+
}, Ur = function(u) {
|
|
639
639
|
var s = u.event;
|
|
640
640
|
return {
|
|
641
641
|
x: s.clientX,
|
|
642
642
|
y: s.clientY
|
|
643
643
|
};
|
|
644
|
-
},
|
|
644
|
+
}, Kr = function(u) {
|
|
645
645
|
var s = u.scrollAmount, r = u.initialPointerPos, g = u.pointerPos, c = {};
|
|
646
646
|
return g.x > r.x - s.x ? (c.left = r.x - s.x, c.width = g.x - r.x + s.x) : (c.left = g.x, c.width = r.x - g.x - s.x), g.y > r.y - s.y ? (c.top = r.y - s.y, c.height = g.y - r.y + s.y) : (c.top = g.y, c.height = r.y - g.y - s.y), c;
|
|
647
|
-
},
|
|
647
|
+
}, Ut = function(s) {
|
|
648
648
|
var r = {
|
|
649
649
|
x: 0,
|
|
650
650
|
y: 0
|
|
@@ -666,10 +666,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
666
666
|
}
|
|
667
667
|
return r;
|
|
668
668
|
}
|
|
669
|
-
},
|
|
669
|
+
}, Yr = function(s) {
|
|
670
670
|
var r = s.style.transform;
|
|
671
671
|
if (!r || r.indexOf("translate") < 0)
|
|
672
|
-
return
|
|
672
|
+
return Ut(s);
|
|
673
673
|
var g = {
|
|
674
674
|
x: 0,
|
|
675
675
|
y: 0
|
|
@@ -681,8 +681,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
681
681
|
g.x = parseInt(S[0]) || 0, g.y = parseInt(S[1]) || 0;
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
return !g.x && !g.x ?
|
|
685
|
-
},
|
|
684
|
+
return !g.x && !g.x ? Ut(s) : g;
|
|
685
|
+
}, Wr = function(s) {
|
|
686
686
|
var r = s.style, g = {
|
|
687
687
|
x: parseInt(r.left) || 0,
|
|
688
688
|
y: parseInt(r.top) || 0
|
|
@@ -695,51 +695,51 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
697
|
return g;
|
|
698
|
-
},
|
|
699
|
-
return s ?
|
|
700
|
-
},
|
|
698
|
+
}, Xr = function(u, s) {
|
|
699
|
+
return s ? Yr(u) : Wr(u);
|
|
700
|
+
}, Fr = function(u) {
|
|
701
701
|
var s = u.element, r = u.edges, g = u.elementRect, c = u.containerRect, y = u.elementPos, w = u.useTransform;
|
|
702
|
-
r.includes("top") &&
|
|
702
|
+
r.includes("top") && Fe(s, {
|
|
703
703
|
y: y.y + c.top - g.top,
|
|
704
704
|
x: y.x
|
|
705
|
-
}, w), r.includes("left") &&
|
|
705
|
+
}, w), r.includes("left") && Fe(s, {
|
|
706
706
|
y: y.y,
|
|
707
707
|
x: y.x + c.left - g.left
|
|
708
|
-
}, w), r.includes("bottom") &&
|
|
708
|
+
}, w), r.includes("bottom") && Fe(s, {
|
|
709
709
|
y: y.y + c.bottom - g.bottom,
|
|
710
710
|
x: y.x
|
|
711
|
-
}, w), r.includes("right") &&
|
|
711
|
+
}, w), r.includes("right") && Fe(s, {
|
|
712
712
|
y: y.y,
|
|
713
713
|
x: y.x + c.right - g.right
|
|
714
714
|
}, w);
|
|
715
|
-
},
|
|
715
|
+
}, Kt = function(u) {
|
|
716
716
|
var s = u.computedStyle, r = u.node, g = s.position, c = g === "absolute" || g === "relative" || g === "fixed";
|
|
717
717
|
!(r instanceof HTMLDocument) && !c && (r.style.position = "relative");
|
|
718
|
-
},
|
|
718
|
+
}, qr = function(u) {
|
|
719
719
|
var s = u.shiftKey, r = u.keyboardDragSpeed, g = u.zoom, c = u.key, y = u.dragKeys, w = u.scrollDiff, k = u.canScroll, S = u.scrollCallback, O = {
|
|
720
720
|
x: 0,
|
|
721
721
|
y: 0
|
|
722
722
|
}, $ = s ? r * 4 * g : r * g;
|
|
723
723
|
return y.left.includes(c) && (O.x = w.x || -$, !s && !w.x && k && S(["left"], r)), y.right.includes(c) && (O.x = w.x || $, !s && !w.x && k && S(["right"], r)), y.up.includes(c) && (O.y = w.y || -$, !s && !w.y && k && S(["top"], r)), y.down.includes(c) && (O.y = w.y || $, !s && !w.y && k && S(["bottom"], r)), O;
|
|
724
|
-
},
|
|
724
|
+
}, Gr = function(u) {
|
|
725
725
|
var s = u.element, r = u.force, g = u.multiSelectionToggle, c = u.SelectedSet, y = u.hoverClassName;
|
|
726
726
|
s.classList.contains(y) && !r || (c.has(s) ? g && c.delete(s) : c.add(s), s.classList.add(y));
|
|
727
|
-
},
|
|
727
|
+
}, Jr = function(u) {
|
|
728
728
|
var s = u.element, r = u.force, g = u.SelectedSet, c = u.PrevSelectedSet, y = u.hoverClassName;
|
|
729
729
|
if (!s.classList.contains(y) && !r)
|
|
730
730
|
return !1;
|
|
731
731
|
var w = g.has(s), k = c.has(s);
|
|
732
732
|
w && !k ? g.delete(s) : !w && k && g.add(s), s.classList.remove(y);
|
|
733
|
-
},
|
|
733
|
+
}, vt = function(u, s) {
|
|
734
734
|
return u.left < s.right && u.right > s.left && u.top < s.bottom && u.bottom > s.top;
|
|
735
|
-
},
|
|
736
|
-
var s = u.element, r = u.posDirection, g = u.containerRect, c = u.useTransform, y =
|
|
737
|
-
|
|
738
|
-
var k = s.getBoundingClientRect(), S =
|
|
735
|
+
}, Yt = function(u) {
|
|
736
|
+
var s = u.element, r = u.posDirection, g = u.containerRect, c = u.useTransform, y = Xr(s, c), w = Y(y, "+", r);
|
|
737
|
+
Fe(s, w, c);
|
|
738
|
+
var k = s.getBoundingClientRect(), S = Ht({
|
|
739
739
|
elementRect: k,
|
|
740
740
|
containerRect: g
|
|
741
741
|
});
|
|
742
|
-
|
|
742
|
+
Fr({
|
|
743
743
|
element: s,
|
|
744
744
|
edges: S,
|
|
745
745
|
elementRect: k,
|
|
@@ -747,21 +747,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
747
747
|
elementPos: w,
|
|
748
748
|
useTransform: c
|
|
749
749
|
});
|
|
750
|
-
},
|
|
750
|
+
}, Zr = function(u, s) {
|
|
751
751
|
window.removeEventListener("resize", s), window.removeEventListener("scroll", s), u.disconnect();
|
|
752
|
-
},
|
|
752
|
+
}, Qr = function(u, s, r) {
|
|
753
753
|
if (!!s.length) {
|
|
754
754
|
var g = document && document.documentElement && document.documentElement.scrollTop && document.documentElement, c = u instanceof HTMLDocument ? g || document.body : u, y = s.includes("top") && c.scrollTop > 0, w = s.includes("bottom") && c.scrollTop < c.scrollHeight, k = s.includes("left") && c.scrollLeft > 0, S = s.includes("right") && c.scrollLeft < c.scrollWidth;
|
|
755
755
|
y && (c.scrollTop -= 1 * r), w && (c.scrollTop += 1 * r), k && (c.scrollLeft -= 1 * r), S && (c.scrollLeft += 1 * r);
|
|
756
756
|
}
|
|
757
|
-
},
|
|
757
|
+
}, Fe = function(u, s, r) {
|
|
758
758
|
if (r) {
|
|
759
759
|
var g = u.style.transform;
|
|
760
760
|
u.style.transform = "translate3d(".concat(s.x, "px,").concat(s.y, "px,1px) ").concat(g.replace(/translate.*?\)/g, ""));
|
|
761
761
|
} else
|
|
762
762
|
u.style.left = "".concat(s.x, "px"), u.style.top = "".concat(s.y, "px");
|
|
763
763
|
return u;
|
|
764
|
-
},
|
|
764
|
+
}, ei = function(u) {
|
|
765
765
|
for (var s = u.subscribe, r = u.publish, g = u.Interaction, c = u.SelectedSet, y = {
|
|
766
766
|
"Selected:added": [{
|
|
767
767
|
name: "elementselect"
|
|
@@ -785,28 +785,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
785
785
|
name: "callback"
|
|
786
786
|
}]
|
|
787
787
|
}, w = function() {
|
|
788
|
-
var $ =
|
|
789
|
-
["pre", !1].forEach(function(
|
|
790
|
-
return s(
|
|
791
|
-
return
|
|
792
|
-
return (!
|
|
788
|
+
var $ = ne(S[k], 2), j = $[0], K = $[1];
|
|
789
|
+
["pre", !1].forEach(function(Q) {
|
|
790
|
+
return s(Q ? "".concat(j, ":").concat(Q) : j, function(me) {
|
|
791
|
+
return K.forEach(function(re) {
|
|
792
|
+
return (!re.condition || re.condition(me)) && r(Q ? "".concat(Q).concat(re.name) : re.name, f({
|
|
793
793
|
items: c.elements,
|
|
794
794
|
isDragging: g.isDragging
|
|
795
|
-
},
|
|
795
|
+
}, me));
|
|
796
796
|
});
|
|
797
797
|
});
|
|
798
798
|
});
|
|
799
799
|
}, k = 0, S = Object.entries(y); k < S.length; k++)
|
|
800
800
|
w();
|
|
801
|
-
},
|
|
802
|
-
return u ? !Array.isArray(u) && (u instanceof HTMLElement || u instanceof SVGElement) ? [u] :
|
|
803
|
-
},
|
|
801
|
+
}, je = function(u) {
|
|
802
|
+
return u ? !Array.isArray(u) && (u instanceof HTMLElement || u instanceof SVGElement) ? [u] : F(u) : [];
|
|
803
|
+
}, Wt = function(u, s) {
|
|
804
804
|
u.style.left = "".concat(s.left, "px"), u.style.top = "".concat(s.top, "px"), u.style.width = "".concat(s.width, "px"), u.style.height = "".concat(s.height, "px");
|
|
805
|
-
},
|
|
805
|
+
}, ti = /* @__PURE__ */ function() {
|
|
806
806
|
function u(s) {
|
|
807
807
|
var r = this, g = s.area, c = s.PS, y = s.zoom;
|
|
808
808
|
t(this, u), i(this, "_modificationCallback", void 0), i(this, "_modificationObserver", void 0), i(this, "_zoom", void 0), i(this, "_node", void 0), i(this, "_parentNodes", void 0), i(this, "_computedStyle", void 0), i(this, "_computedBorder", void 0), i(this, "_rect", void 0), i(this, "setArea", function(w) {
|
|
809
|
-
r._node = w,
|
|
809
|
+
r._node = w, Kt({
|
|
810
810
|
computedStyle: r.computedStyle,
|
|
811
811
|
node: r._node
|
|
812
812
|
}), setTimeout(function() {
|
|
@@ -817,18 +817,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
817
817
|
});
|
|
818
818
|
});
|
|
819
819
|
}), i(this, "start", function() {
|
|
820
|
-
|
|
820
|
+
We(r.parentNodes, r._modificationCallback, r._modificationObserver);
|
|
821
821
|
}), i(this, "reset", function() {
|
|
822
822
|
r._computedStyle = void 0, r._rect = void 0, r._computedBorder = void 0, r._parentNodes = void 0;
|
|
823
823
|
}), i(this, "stop", function() {
|
|
824
|
-
|
|
824
|
+
Zr(r._modificationObserver, r._modificationCallback), r.reset();
|
|
825
825
|
}), i(this, "scroll", function(w, k) {
|
|
826
826
|
var S = {
|
|
827
827
|
scroll_directions: w,
|
|
828
828
|
scroll_multiplier: k
|
|
829
829
|
};
|
|
830
|
-
r.PubSub.publish("Area:scroll:pre", S),
|
|
831
|
-
}), this._zoom = y, this.PubSub = c, this.setArea(g), this._modificationCallback =
|
|
830
|
+
r.PubSub.publish("Area:scroll:pre", S), Qr(r._node, w, k), r.PubSub.publish("Area:scroll", S);
|
|
831
|
+
}), this._zoom = y, this.PubSub = c, this.setArea(g), this._modificationCallback = nt(function(w) {
|
|
832
832
|
r.PubSub.publish("Area:modified:pre", {
|
|
833
833
|
event: w,
|
|
834
834
|
item: r
|
|
@@ -861,7 +861,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
861
861
|
}, {
|
|
862
862
|
key: "rect",
|
|
863
863
|
get: function() {
|
|
864
|
-
return this._rect ? this._rect : this._rect =
|
|
864
|
+
return this._rect ? this._rect : this._rect = gt(this.HTMLNode, this._zoom);
|
|
865
865
|
}
|
|
866
866
|
}, {
|
|
867
867
|
key: "parentNodes",
|
|
@@ -875,68 +875,68 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
875
875
|
return this._parentNodes = r([this.HTMLNode]), this._parentNodes;
|
|
876
876
|
}
|
|
877
877
|
}]), u;
|
|
878
|
-
}(),
|
|
878
|
+
}(), ri = /* @__PURE__ */ function() {
|
|
879
879
|
function u(s) {
|
|
880
880
|
var r = this, g = s.DS, c = s.dragKeys, y = s.draggability, w = s.keyboardDrag, k = s.keyboardDragSpeed, S = s.useTransform, O = s.zoom;
|
|
881
881
|
t(this, u), i(this, "_useTransform", void 0), i(this, "_prevCursorPos", void 0), i(this, "_prevScrollPos", void 0), i(this, "_elements", []), i(this, "_draggability", void 0), i(this, "_dragKeys", void 0), i(this, "_dragKeysFlat", void 0), i(this, "_keyboardDrag", void 0), i(this, "_keyboardDragSpeed", void 0), i(this, "_zoom", void 0), i(this, "keyboardDrag", function($) {
|
|
882
|
-
var
|
|
883
|
-
if (!(!r._keyboardDrag || !r._dragKeysFlat.includes(
|
|
884
|
-
var
|
|
885
|
-
event:
|
|
882
|
+
var j = $.event, K = $.key;
|
|
883
|
+
if (!(!r._keyboardDrag || !r._dragKeysFlat.includes(K) || !r.DS.SelectedSet.size || !r._draggability || r.DS.continue)) {
|
|
884
|
+
var Q = {
|
|
885
|
+
event: j,
|
|
886
886
|
isDragging: !0,
|
|
887
887
|
isDraggingKeyboard: !0
|
|
888
888
|
};
|
|
889
|
-
r.DS.publish(["Interaction:start:pre", "Interaction:start"],
|
|
890
|
-
var
|
|
889
|
+
r.DS.publish(["Interaction:start:pre", "Interaction:start"], Q), r._elements = r.DS.getSelection(), r.handleZIndex(!0);
|
|
890
|
+
var me = qr({
|
|
891
891
|
shiftKey: r.DS.stores.KeyStore.currentValues.includes("shift"),
|
|
892
892
|
keyboardDragSpeed: r._keyboardDragSpeed,
|
|
893
893
|
zoom: r._zoom,
|
|
894
|
-
key:
|
|
894
|
+
key: K,
|
|
895
895
|
scrollCallback: r.DS.Area.scroll,
|
|
896
896
|
scrollDiff: r._scrollDiff,
|
|
897
897
|
canScroll: r.DS.stores.ScrollStore.canScroll,
|
|
898
898
|
dragKeys: r._dragKeys
|
|
899
899
|
});
|
|
900
|
-
r._elements.forEach(function(
|
|
901
|
-
return
|
|
902
|
-
element:
|
|
903
|
-
posDirection:
|
|
900
|
+
r._elements.forEach(function(re) {
|
|
901
|
+
return Yt({
|
|
902
|
+
element: re,
|
|
903
|
+
posDirection: me,
|
|
904
904
|
containerRect: r.DS.SelectorArea.rect,
|
|
905
905
|
useTransform: r._useTransform
|
|
906
906
|
});
|
|
907
|
-
}), r.DS.publish(["Interaction:update:pre", "Interaction:update"],
|
|
907
|
+
}), r.DS.publish(["Interaction:update:pre", "Interaction:update"], Q);
|
|
908
908
|
}
|
|
909
909
|
}), i(this, "keyboardEnd", function($) {
|
|
910
|
-
var
|
|
911
|
-
if (!(!r._keyboardDrag || !r._dragKeysFlat.includes(
|
|
912
|
-
var
|
|
913
|
-
event:
|
|
910
|
+
var j = $.event, K = $.key;
|
|
911
|
+
if (!(!r._keyboardDrag || !r._dragKeysFlat.includes(K) || !r.DS.SelectedSet.size || !r._draggability)) {
|
|
912
|
+
var Q = {
|
|
913
|
+
event: j,
|
|
914
914
|
isDragging: r._draggability,
|
|
915
915
|
isDraggingKeyboard: !0
|
|
916
916
|
};
|
|
917
|
-
r.DS.publish(["Interaction:end:pre", "Interaction:end"],
|
|
917
|
+
r.DS.publish(["Interaction:end:pre", "Interaction:end"], Q);
|
|
918
918
|
}
|
|
919
919
|
}), i(this, "start", function($) {
|
|
920
|
-
var
|
|
921
|
-
!
|
|
920
|
+
var j = $.isDragging, K = $.isDraggingKeyboard;
|
|
921
|
+
!j || K || (r._prevCursorPos = null, r._prevScrollPos = null, r._elements = r.DS.getSelection(), r.handleZIndex(!0));
|
|
922
922
|
}), i(this, "stop", function($) {
|
|
923
923
|
$ != null && $.isKeyboard || (r._prevCursorPos = null, r._prevScrollPos = null, r.handleZIndex(!1), r._elements = []);
|
|
924
924
|
}), i(this, "update", function($) {
|
|
925
|
-
var
|
|
926
|
-
if (!(!
|
|
927
|
-
var
|
|
928
|
-
r._elements.forEach(function(
|
|
929
|
-
return
|
|
930
|
-
element:
|
|
931
|
-
posDirection:
|
|
925
|
+
var j = $.isDragging, K = $.isDraggingKeyboard;
|
|
926
|
+
if (!(!j || !r._elements.length || K || r.DS.continue)) {
|
|
927
|
+
var Q = Y(r._cursorDiff, "+", r._scrollDiff);
|
|
928
|
+
r._elements.forEach(function(me) {
|
|
929
|
+
return Yt({
|
|
930
|
+
element: me,
|
|
931
|
+
posDirection: Q,
|
|
932
932
|
containerRect: r.DS.SelectorArea.rect,
|
|
933
933
|
useTransform: r._useTransform
|
|
934
934
|
});
|
|
935
935
|
});
|
|
936
936
|
}
|
|
937
937
|
}), i(this, "handleZIndex", function($) {
|
|
938
|
-
r._elements.forEach(function(
|
|
939
|
-
return
|
|
938
|
+
r._elements.forEach(function(j) {
|
|
939
|
+
return j.style.zIndex = "".concat((parseInt(j.style.zIndex) || 0) + $ ? 9999 : -9998);
|
|
940
940
|
});
|
|
941
941
|
}), this.DS = g, this._useTransform = S, this._keyboardDragSpeed = k, this._keyboardDrag = w, this._zoom = O, this._draggability = y, this._dragKeys = {
|
|
942
942
|
up: c.up.map(function($) {
|
|
@@ -951,12 +951,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
951
951
|
right: c.right.map(function($) {
|
|
952
952
|
return $.toLowerCase();
|
|
953
953
|
})
|
|
954
|
-
}, this._dragKeysFlat = [].concat(
|
|
954
|
+
}, this._dragKeysFlat = [].concat(F(this._dragKeys.up), F(this._dragKeys.down), F(this._dragKeys.left), F(this._dragKeys.right)), this.DS.subscribe("Interaction:start", this.start), this.DS.subscribe("Interaction:end", this.stop), this.DS.subscribe("Interaction:update", this.update), this.DS.subscribe("KeyStore:down", this.keyboardDrag), this.DS.subscribe("KeyStore:up", this.keyboardEnd);
|
|
955
955
|
}
|
|
956
956
|
return a(u, [{
|
|
957
957
|
key: "_cursorDiff",
|
|
958
958
|
get: function() {
|
|
959
|
-
var r = this.DS.stores.PointerStore.currentVal, g = this._prevCursorPos ?
|
|
959
|
+
var r = this.DS.stores.PointerStore.currentVal, g = this._prevCursorPos ? Y(r, "-", this._prevCursorPos) : {
|
|
960
960
|
x: 0,
|
|
961
961
|
y: 0
|
|
962
962
|
};
|
|
@@ -965,14 +965,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
965
965
|
}, {
|
|
966
966
|
key: "_scrollDiff",
|
|
967
967
|
get: function() {
|
|
968
|
-
var r = this.DS.stores.ScrollStore.currentVal, g = this._prevScrollPos ?
|
|
968
|
+
var r = this.DS.stores.ScrollStore.currentVal, g = this._prevScrollPos ? Y(r, "-", this._prevScrollPos) : {
|
|
969
969
|
x: 0,
|
|
970
970
|
y: 0
|
|
971
971
|
};
|
|
972
972
|
return this._prevScrollPos = r, g;
|
|
973
973
|
}
|
|
974
974
|
}]), u;
|
|
975
|
-
}(),
|
|
975
|
+
}(), ii = /* @__PURE__ */ function() {
|
|
976
976
|
function u(s) {
|
|
977
977
|
var r = this, g = s.DS, c = s.areaElement, y = s.draggability, w = s.immediateDrag, k = s.selectableClass;
|
|
978
978
|
t(this, u), i(this, "_areaElement", void 0), i(this, "_draggability", void 0), i(this, "_immediateDrag", void 0), i(this, "_selectableClass", void 0), i(this, "isInteracting", void 0), i(this, "isDragging", void 0), i(this, "init", function() {
|
|
@@ -1001,21 +1001,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1001
1001
|
}), i(this, "onClick", function(S) {
|
|
1002
1002
|
var O = S.event;
|
|
1003
1003
|
if (!!r._canInteract(O) && !(O.detail > 0)) {
|
|
1004
|
-
var $ = r.DS,
|
|
1005
|
-
|
|
1006
|
-
var
|
|
1007
|
-
!
|
|
1004
|
+
var $ = r.DS, j = $.stores, K = j.PointerStore, Q = j.KeyStore, me = $.SelectableSet, re = $.SelectedSet;
|
|
1005
|
+
K.start(O);
|
|
1006
|
+
var Ve = O.target;
|
|
1007
|
+
!me.has(Ve) || (Q.isMultiSelectKeyPressed(O) || re.clear(), re.toggle(Ve), r.reset());
|
|
1008
1008
|
}
|
|
1009
1009
|
}), i(this, "stop", function() {
|
|
1010
1010
|
r.isInteracting = !1, r.isDragging = !1, r._areaElement.removeEventListener("mousedown", r.start), r._areaElement.removeEventListener("touchstart", r.start, {
|
|
1011
1011
|
passive: !1
|
|
1012
1012
|
}), document.removeEventListener("mouseup", r.reset), document.removeEventListener("touchend", r.reset);
|
|
1013
1013
|
}), i(this, "update", function(S) {
|
|
1014
|
-
var O = S.event, $ = S.scroll_directions,
|
|
1014
|
+
var O = S.event, $ = S.scroll_directions, j = S.scroll_multiplier;
|
|
1015
1015
|
r.isInteracting && r.DS.publish(["Interaction:update:pre", "Interaction:update"], {
|
|
1016
1016
|
event: O,
|
|
1017
1017
|
scroll_directions: $,
|
|
1018
|
-
scroll_multiplier:
|
|
1018
|
+
scroll_multiplier: j,
|
|
1019
1019
|
isDragging: r.isDragging
|
|
1020
1020
|
});
|
|
1021
1021
|
}), i(this, "reset", function(S) {
|
|
@@ -1049,7 +1049,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1049
1049
|
) || !g && !this.DS.SelectorArea.isClicked(r));
|
|
1050
1050
|
}
|
|
1051
1051
|
}]), u;
|
|
1052
|
-
}(),
|
|
1052
|
+
}(), ni = function u(s) {
|
|
1053
1053
|
var r = this, g = s.DS;
|
|
1054
1054
|
t(this, u), i(this, "subscribers", {}), i(this, "subscribe", function(c, y) {
|
|
1055
1055
|
return Array.isArray(r.subscribers[c]) || (r.subscribers[c] = []), r.subscribers[c].push(y), r.subscribers[c].length - 1;
|
|
@@ -1077,43 +1077,43 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1077
1077
|
c[w](y);
|
|
1078
1078
|
}
|
|
1079
1079
|
}), this.DS = g;
|
|
1080
|
-
},
|
|
1080
|
+
}, oi = /* @__PURE__ */ function(u) {
|
|
1081
1081
|
m(r, u);
|
|
1082
1082
|
var s = z(r);
|
|
1083
1083
|
function r(g) {
|
|
1084
1084
|
var c, y = g.elements, w = g.className, k = g.hoverClassName, S = g.draggability, O = g.useTransform, $ = g.DS;
|
|
1085
1085
|
return t(this, r), c = s.call(this), i(T(c), "_initElements", void 0), i(T(c), "_className", void 0), i(T(c), "_hoverClassName", void 0), i(T(c), "_useTransform", void 0), i(T(c), "_draggability", void 0), i(T(c), "init", function() {
|
|
1086
|
-
return c._initElements.forEach(function(
|
|
1087
|
-
return c.add(
|
|
1086
|
+
return c._initElements.forEach(function(j) {
|
|
1087
|
+
return c.add(j);
|
|
1088
1088
|
});
|
|
1089
1089
|
}), i(T(c), "clear", function() {
|
|
1090
|
-
return c.forEach(function(
|
|
1091
|
-
return c.delete(
|
|
1090
|
+
return c.forEach(function(j) {
|
|
1091
|
+
return c.delete(j);
|
|
1092
1092
|
});
|
|
1093
|
-
}), i(T(c), "_onClick", function(
|
|
1093
|
+
}), i(T(c), "_onClick", function(j) {
|
|
1094
1094
|
return c.DS.publish(["Selectable:click:pre", "Selectable:click"], {
|
|
1095
|
-
event:
|
|
1095
|
+
event: j
|
|
1096
1096
|
});
|
|
1097
|
-
}), i(T(c), "_onPointer", function(
|
|
1097
|
+
}), i(T(c), "_onPointer", function(j) {
|
|
1098
1098
|
return c.DS.publish(["Selectable:pointer:pre", "Selectable:pointer"], {
|
|
1099
|
-
event:
|
|
1099
|
+
event: j
|
|
1100
1100
|
});
|
|
1101
|
-
}), i(T(c), "addAll", function(
|
|
1102
|
-
return
|
|
1103
|
-
return c.add(
|
|
1101
|
+
}), i(T(c), "addAll", function(j) {
|
|
1102
|
+
return j.forEach(function(K) {
|
|
1103
|
+
return c.add(K);
|
|
1104
1104
|
});
|
|
1105
|
-
}), i(T(c), "deleteAll", function(
|
|
1106
|
-
return
|
|
1107
|
-
return c.delete(
|
|
1105
|
+
}), i(T(c), "deleteAll", function(j) {
|
|
1106
|
+
return j.forEach(function(K) {
|
|
1107
|
+
return c.delete(K);
|
|
1108
1108
|
});
|
|
1109
|
-
}), c.DS = $, c._initElements =
|
|
1109
|
+
}), c.DS = $, c._initElements = je(y), c._className = w, c._hoverClassName = k, c._useTransform = O, c._draggability = S, c.DS.subscribe("Interaction:init", c.init), c;
|
|
1110
1110
|
}
|
|
1111
1111
|
return a(r, [{
|
|
1112
1112
|
key: "add",
|
|
1113
1113
|
value: function(c) {
|
|
1114
1114
|
return c.classList.add(this._className), c.addEventListener("click", this._onClick), c.addEventListener("mousedown", this._onPointer), c.addEventListener("touchstart", this._onPointer, {
|
|
1115
1115
|
passive: !1
|
|
1116
|
-
}), this._draggability && !this._useTransform &&
|
|
1116
|
+
}), this._draggability && !this._useTransform && Kt({
|
|
1117
1117
|
computedStyle: window.getComputedStyle(c),
|
|
1118
1118
|
node: c
|
|
1119
1119
|
}), P(p(r.prototype), "add", this).call(this, c);
|
|
@@ -1131,7 +1131,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1131
1131
|
return Array.from(this.values());
|
|
1132
1132
|
}
|
|
1133
1133
|
}]), r;
|
|
1134
|
-
}(/* @__PURE__ */ M(Set)),
|
|
1134
|
+
}(/* @__PURE__ */ M(Set)), ai = /* @__PURE__ */ function(u) {
|
|
1135
1135
|
m(r, u);
|
|
1136
1136
|
var s = z(r);
|
|
1137
1137
|
function r(g) {
|
|
@@ -1185,7 +1185,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1185
1185
|
return Array.from(this.values());
|
|
1186
1186
|
}
|
|
1187
1187
|
}]), r;
|
|
1188
|
-
}(/* @__PURE__ */ M(Set)),
|
|
1188
|
+
}(/* @__PURE__ */ M(Set)), si = /* @__PURE__ */ function() {
|
|
1189
1189
|
function u(s) {
|
|
1190
1190
|
var r = this, g = s.DS, c = s.hoverClassName, y = s.multiSelectToggling;
|
|
1191
1191
|
t(this, u), i(this, "_prevSelectedSet", void 0), i(this, "_hoverClassName", void 0), i(this, "_multiSelectToggling", void 0), i(this, "start", function(w) {
|
|
@@ -1195,22 +1195,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1195
1195
|
var k = w.isDragging;
|
|
1196
1196
|
k || r.DS.continue || r._handleInsideSelection();
|
|
1197
1197
|
}), i(this, "_handleInsideSelection", function(w, k) {
|
|
1198
|
-
for (var S = r.DS, O = S.SelectableSet, $ = S.SelectorArea,
|
|
1199
|
-
return [
|
|
1200
|
-
}),
|
|
1201
|
-
!$.isInside(
|
|
1202
|
-
var
|
|
1203
|
-
r.DS.continue || (
|
|
1204
|
-
return
|
|
1205
|
-
element:
|
|
1198
|
+
for (var S = r.DS, O = S.SelectableSet, $ = S.SelectorArea, j = S.Selector, K = O.elements.map(function(De) {
|
|
1199
|
+
return [De, De.getBoundingClientRect()];
|
|
1200
|
+
}), Q = [], me = [], re = 0, Ve = K.length; re < Ve; re++)
|
|
1201
|
+
!$.isInside(K[re][0], K[re][1]) || (vt(K[re][1], j.rect) ? Q.push(K[re][0]) : me.push(K[re][0]));
|
|
1202
|
+
var ot = r.DS.stores.KeyStore.isMultiSelectKeyPressed(k) && r._multiSelectToggling;
|
|
1203
|
+
r.DS.continue || (Q.forEach(function(De) {
|
|
1204
|
+
return Gr({
|
|
1205
|
+
element: De,
|
|
1206
1206
|
force: w,
|
|
1207
|
-
multiSelectionToggle:
|
|
1207
|
+
multiSelectionToggle: ot,
|
|
1208
1208
|
SelectedSet: r.DS.SelectedSet,
|
|
1209
1209
|
hoverClassName: r._hoverClassName
|
|
1210
1210
|
});
|
|
1211
|
-
}),
|
|
1212
|
-
return
|
|
1213
|
-
element:
|
|
1211
|
+
}), me.forEach(function(De) {
|
|
1212
|
+
return Jr({
|
|
1213
|
+
element: De,
|
|
1214
1214
|
force: w,
|
|
1215
1215
|
SelectedSet: r.DS.SelectedSet,
|
|
1216
1216
|
hoverClassName: r._hoverClassName,
|
|
@@ -1226,28 +1226,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1226
1226
|
c.isMultiSelectKeyPressed(r) ? this._prevSelectedSet = new Set(y) : this._prevSelectedSet = /* @__PURE__ */ new Set();
|
|
1227
1227
|
}
|
|
1228
1228
|
}]), u;
|
|
1229
|
-
}(),
|
|
1229
|
+
}(), li = /* @__PURE__ */ function() {
|
|
1230
1230
|
function u(s) {
|
|
1231
1231
|
var r = this, g = s.DS, c = s.selector, y = s.selectorClass, w = s.customStyles;
|
|
1232
1232
|
t(this, u), i(this, "_rect", void 0), i(this, "start", function(k) {
|
|
1233
1233
|
var S = k.isDragging;
|
|
1234
1234
|
if (!S) {
|
|
1235
1235
|
var O = r.DS.stores.PointerStore, $ = O.initialValArea;
|
|
1236
|
-
|
|
1236
|
+
Wt(r.HTMLNode, te($, 1)), r.HTMLNode.style.display = "block", r._rect = null;
|
|
1237
1237
|
}
|
|
1238
1238
|
}), i(this, "stop", function() {
|
|
1239
1239
|
r.HTMLNode.style.width = "0", r.HTMLNode.style.height = "0", r.HTMLNode.style.display = "none";
|
|
1240
1240
|
}), i(this, "update", function(k) {
|
|
1241
1241
|
var S = k.isDragging;
|
|
1242
1242
|
if (!(S || r.DS.continue)) {
|
|
1243
|
-
var O = r.DS.stores, $ = O.ScrollStore,
|
|
1243
|
+
var O = r.DS.stores, $ = O.ScrollStore, j = O.PointerStore, K = Kr({
|
|
1244
1244
|
scrollAmount: $.scrollAmount,
|
|
1245
|
-
initialPointerPos:
|
|
1246
|
-
pointerPos:
|
|
1245
|
+
initialPointerPos: j.initialValArea,
|
|
1246
|
+
pointerPos: j.currentValArea
|
|
1247
1247
|
});
|
|
1248
|
-
|
|
1248
|
+
Wt(r.HTMLNode, K), r._rect = null;
|
|
1249
1249
|
}
|
|
1250
|
-
}), this.DS = g, this.HTMLNode = c ||
|
|
1250
|
+
}), this.DS = g, this.HTMLNode = c || it(w), this.HTMLNode.classList.add(y), this.DS.subscribe("Interaction:start", this.start), this.DS.subscribe("Interaction:update", this.update), this.DS.subscribe("Interaction:end", this.stop);
|
|
1251
1251
|
}
|
|
1252
1252
|
return a(u, [{
|
|
1253
1253
|
key: "rect",
|
|
@@ -1255,7 +1255,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1255
1255
|
return this._rect ? this._rect : this._rect = this.HTMLNode.getBoundingClientRect();
|
|
1256
1256
|
}
|
|
1257
1257
|
}]), u;
|
|
1258
|
-
}(),
|
|
1258
|
+
}(), ci = /* @__PURE__ */ function() {
|
|
1259
1259
|
function u(s) {
|
|
1260
1260
|
var r = this, g = s.DS, c = s.selectorAreaClass, y = s.autoScrollSpeed, w = s.overflowTolerance;
|
|
1261
1261
|
t(this, u), i(this, "_autoScrollSpeed", void 0), i(this, "_scrollInterval", void 0), i(this, "_rect", void 0), i(this, "currentEdges", []), i(this, "_overflowTolerance", void 0), i(this, "start", function() {
|
|
@@ -1265,8 +1265,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1265
1265
|
r.HTMLNode[O](r.DS.Selector.HTMLNode), document[S][O](r.HTMLNode);
|
|
1266
1266
|
}), i(this, "updatePos", function() {
|
|
1267
1267
|
r._rect = null;
|
|
1268
|
-
var k = r.DS.Area.rect, S = r.DS.Area.computedBorder, O = r.HTMLNode.style, $ = "".concat(k.top + S.top, "px"),
|
|
1269
|
-
O.top !== $ && (O.top = $), O.left !==
|
|
1268
|
+
var k = r.DS.Area.rect, S = r.DS.Area.computedBorder, O = r.HTMLNode.style, $ = "".concat(k.top + S.top, "px"), j = "".concat(k.left + S.left, "px"), K = "".concat(k.width, "px"), Q = "".concat(k.height, "px");
|
|
1269
|
+
O.top !== $ && (O.top = $), O.left !== j && (O.left = j), O.width !== K && (O.width = K), O.height !== Q && (O.height = Q);
|
|
1270
1270
|
}), i(this, "stop", function(k) {
|
|
1271
1271
|
r.stopAutoScroll(), k && r.applyElements("remove");
|
|
1272
1272
|
}), i(this, "startAutoScroll", function() {
|
|
@@ -1276,8 +1276,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1276
1276
|
}), i(this, "handleAutoScroll", function() {
|
|
1277
1277
|
if (!r.DS.continue) {
|
|
1278
1278
|
var k = r.DS, S = k.stores.PointerStore, O = k.Area;
|
|
1279
|
-
r.currentEdges =
|
|
1280
|
-
elementRect:
|
|
1279
|
+
r.currentEdges = Ht({
|
|
1280
|
+
elementRect: te(S.currentVal),
|
|
1281
1281
|
containerRect: r.rect,
|
|
1282
1282
|
tolerance: r._overflowTolerance
|
|
1283
1283
|
}), r.currentEdges.length && O.scroll(r.currentEdges, r._autoScrollSpeed);
|
|
@@ -1285,8 +1285,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1285
1285
|
}), i(this, "stopAutoScroll", function() {
|
|
1286
1286
|
r.currentEdges = [], clearInterval(r._scrollInterval);
|
|
1287
1287
|
}), i(this, "isInside", function(k, S) {
|
|
1288
|
-
return r.DS.Area.HTMLNode.contains(k) && r.DS.stores.ScrollStore.canScroll ? !0 :
|
|
1289
|
-
}), this._autoScrollSpeed = y, this._overflowTolerance = w, this.DS = g, this.HTMLNode =
|
|
1288
|
+
return r.DS.Area.HTMLNode.contains(k) && r.DS.stores.ScrollStore.canScroll ? !0 : vt(r.rect, S || k.getBoundingClientRect());
|
|
1289
|
+
}), this._autoScrollSpeed = y, this._overflowTolerance = w, this.DS = g, this.HTMLNode = rt(c), this.DS.subscribe("Area:modified", this.updatePos), this.DS.subscribe("Interaction:init", this.start), this.DS.subscribe("Interaction:start", this.startAutoScroll), this.DS.subscribe("Interaction:end", function() {
|
|
1290
1290
|
r.updatePos(), r.stopAutoScroll();
|
|
1291
1291
|
});
|
|
1292
1292
|
}
|
|
@@ -1294,7 +1294,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1294
1294
|
key: "isClicked",
|
|
1295
1295
|
value: function(r) {
|
|
1296
1296
|
var g = this.DS.stores.PointerStore, c = r ? g.getPointerPosition(r) : g.initialVal;
|
|
1297
|
-
return
|
|
1297
|
+
return vt({
|
|
1298
1298
|
left: c.x,
|
|
1299
1299
|
top: c.y,
|
|
1300
1300
|
right: c.x,
|
|
@@ -1307,7 +1307,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1307
1307
|
return this._rect ? this._rect : this._rect = this.HTMLNode.getBoundingClientRect();
|
|
1308
1308
|
}
|
|
1309
1309
|
}]), u;
|
|
1310
|
-
}(),
|
|
1310
|
+
}(), ui = /* @__PURE__ */ function() {
|
|
1311
1311
|
function u(s) {
|
|
1312
1312
|
var r = this, g = s.DS, c = s.multiSelectKeys, y = s.multiSelectMode;
|
|
1313
1313
|
t(this, u), i(this, "_multiSelectMode", void 0), i(this, "_multiSelectKeys", void 0), i(this, "_currentValues", /* @__PURE__ */ new Set()), i(this, "_keyMapping", {
|
|
@@ -1363,7 +1363,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1363
1363
|
return Array.from(this._currentValues.values());
|
|
1364
1364
|
}
|
|
1365
1365
|
}]), u;
|
|
1366
|
-
}(),
|
|
1366
|
+
}(), di = /* @__PURE__ */ function() {
|
|
1367
1367
|
function u(s) {
|
|
1368
1368
|
var r = this, g = s.DS;
|
|
1369
1369
|
t(this, u), i(this, "_isMouseInteraction", !1), i(this, "_initialValArea", void 0), i(this, "_currentValArea", void 0), i(this, "_lastValArea", void 0), i(this, "_initialVal", void 0), i(this, "_currentVal", void 0), i(this, "_lastVal", void 0), i(this, "_lastTouch", void 0), i(this, "init", function() {
|
|
@@ -1371,7 +1371,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1371
1371
|
passive: !1
|
|
1372
1372
|
});
|
|
1373
1373
|
}), i(this, "getPointerPosition", function(c) {
|
|
1374
|
-
return
|
|
1374
|
+
return Ur({
|
|
1375
1375
|
event: r._normalizedEvent(c)
|
|
1376
1376
|
});
|
|
1377
1377
|
}), i(this, "update", function(c) {
|
|
@@ -1439,7 +1439,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1439
1439
|
};
|
|
1440
1440
|
},
|
|
1441
1441
|
set: function(r) {
|
|
1442
|
-
this._initialVal = r, this._initialValArea = r &&
|
|
1442
|
+
this._initialVal = r, this._initialValArea = r && Y(r, "-", Y(H(this.DS.Area.rect), "+", H(this.DS.Area.computedBorder)));
|
|
1443
1443
|
}
|
|
1444
1444
|
}, {
|
|
1445
1445
|
key: "currentVal",
|
|
@@ -1450,7 +1450,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1450
1450
|
};
|
|
1451
1451
|
},
|
|
1452
1452
|
set: function(r) {
|
|
1453
|
-
this._currentVal = r, this._currentValArea = r &&
|
|
1453
|
+
this._currentVal = r, this._currentValArea = r && Y(r, "-", Y(H(this.DS.Area.rect), "+", H(this.DS.Area.computedBorder)));
|
|
1454
1454
|
}
|
|
1455
1455
|
}, {
|
|
1456
1456
|
key: "lastVal",
|
|
@@ -1461,18 +1461,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1461
1461
|
};
|
|
1462
1462
|
},
|
|
1463
1463
|
set: function(r) {
|
|
1464
|
-
this._lastVal = r, this._lastValArea = r &&
|
|
1464
|
+
this._lastVal = r, this._lastValArea = r && Y(r, "-", Y(H(this.DS.Area.rect), "+", H(this.DS.Area.computedBorder)));
|
|
1465
1465
|
}
|
|
1466
1466
|
}]), u;
|
|
1467
|
-
}(),
|
|
1467
|
+
}(), hi = /* @__PURE__ */ function() {
|
|
1468
1468
|
function u(s) {
|
|
1469
1469
|
var r = this, g = s.DS, c = s.areaElement, y = s.zoom;
|
|
1470
1470
|
t(this, u), i(this, "_initialVal", void 0), i(this, "_currentVal", void 0), i(this, "_areaElement", void 0), i(this, "_canScroll", void 0), i(this, "init", function() {
|
|
1471
1471
|
return r._areaElement.addEventListener("scroll", r.update);
|
|
1472
1472
|
}), i(this, "start", function() {
|
|
1473
|
-
r._currentVal = r._initialVal =
|
|
1473
|
+
r._currentVal = r._initialVal = Le(r._areaElement), r._areaElement.addEventListener("scroll", r.update);
|
|
1474
1474
|
}), i(this, "update", function() {
|
|
1475
|
-
return r._currentVal =
|
|
1475
|
+
return r._currentVal = Le(r._areaElement);
|
|
1476
1476
|
}), i(this, "stop", function() {
|
|
1477
1477
|
r._areaElement.removeEventListener("scroll", r.update), r._initialVal = {
|
|
1478
1478
|
x: 0,
|
|
@@ -1489,12 +1489,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1489
1489
|
return a(u, [{
|
|
1490
1490
|
key: "canScroll",
|
|
1491
1491
|
get: function() {
|
|
1492
|
-
return typeof this._canScroll == "boolean" ? this._canScroll : this._canScroll =
|
|
1492
|
+
return typeof this._canScroll == "boolean" ? this._canScroll : this._canScroll = Xe(this._areaElement);
|
|
1493
1493
|
}
|
|
1494
1494
|
}, {
|
|
1495
1495
|
key: "scrollAmount",
|
|
1496
1496
|
get: function() {
|
|
1497
|
-
var r =
|
|
1497
|
+
var r = Y(this.currentVal, "-", this.initialVal), g = G(this.zoom), c = Y(Y(r, "*", g), "-", r);
|
|
1498
1498
|
return {
|
|
1499
1499
|
x: r.x + c.x,
|
|
1500
1500
|
y: r.y + c.y
|
|
@@ -1511,15 +1511,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1511
1511
|
}, {
|
|
1512
1512
|
key: "currentVal",
|
|
1513
1513
|
get: function() {
|
|
1514
|
-
return this._currentVal || (this._currentVal =
|
|
1514
|
+
return this._currentVal || (this._currentVal = Le(this._areaElement)), this._currentVal;
|
|
1515
1515
|
}
|
|
1516
1516
|
}]), u;
|
|
1517
|
-
}(),
|
|
1517
|
+
}(), fi = /* @__PURE__ */ function() {
|
|
1518
1518
|
function u(s) {
|
|
1519
1519
|
var r = this, g = s.area, c = g === void 0 ? document : g, y = s.selectables, w = y === void 0 ? [] : y, k = s.autoScrollSpeed, S = k === void 0 ? 5 : k, O = s.overflowTolerance, $ = O === void 0 ? {
|
|
1520
1520
|
x: 25,
|
|
1521
1521
|
y: 25
|
|
1522
|
-
} : O,
|
|
1522
|
+
} : O, j = s.zoom, K = j === void 0 ? 1 : j, Q = s.customStyles, me = Q === void 0 ? !1 : Q, re = s.multiSelectMode, Ve = re === void 0 ? !1 : re, ot = s.multiSelectToggling, De = ot === void 0 ? !0 : ot, Xt = s.multiSelectKeys, mi = Xt === void 0 ? ["Control", "Shift", "Meta"] : Xt, Ft = s.selector, pi = Ft === void 0 ? void 0 : Ft, qt = s.draggability, bt = qt === void 0 ? !0 : qt, Gt = s.immediateDrag, gi = Gt === void 0 ? !0 : Gt, Jt = s.keyboardDrag, vi = Jt === void 0 ? !0 : Jt, bi = s.dragKeys, Zt = s.keyboardDragSpeed, yi = Zt === void 0 ? 10 : Zt, Qt = s.useTransform, er = Qt === void 0 ? !0 : Qt, tr = s.hoverClass, rr = tr === void 0 ? "ds-hover" : tr, ir = s.selectableClass, nr = ir === void 0 ? "ds-selectable" : ir, or = s.selectedClass, wi = or === void 0 ? "ds-selected" : or, ar = s.selectorClass, xi = ar === void 0 ? "ds-selector" : ar, sr = s.selectorAreaClass, _i = sr === void 0 ? "ds-selector-area" : sr, ki = s.callback, Si = s.onDragMove, Di = s.onDragStartBegin, Ci = s.onDragStart, Mi = s.onElementSelect, $i = s.onElementUnselect;
|
|
1523
1523
|
t(this, u), i(this, "continue", !1), i(this, "start", function() {
|
|
1524
1524
|
r.stopped = !1, r.Interaction.init();
|
|
1525
1525
|
}), i(this, "break", function() {
|
|
@@ -1540,81 +1540,81 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1540
1540
|
return r.stores.PointerStore.currentValArea;
|
|
1541
1541
|
}), i(this, "getPreviousCursorPositionArea", function() {
|
|
1542
1542
|
return r.stores.PointerStore.lastValArea;
|
|
1543
|
-
}), i(this, "isMultiSelect", function(
|
|
1544
|
-
return r.stores.KeyStore.isMultiSelectKeyPressed(
|
|
1543
|
+
}), i(this, "isMultiSelect", function(Ei) {
|
|
1544
|
+
return r.stores.KeyStore.isMultiSelectKeyPressed(Ei);
|
|
1545
1545
|
}), i(this, "isDragging", function() {
|
|
1546
1546
|
return r.Interaction.isDragging;
|
|
1547
|
-
}), this.PubSub = new
|
|
1547
|
+
}), this.PubSub = new ni({
|
|
1548
1548
|
DS: this
|
|
1549
1549
|
}), this.subscribe = this.PubSub.subscribe, this.unsubscribe = this.PubSub.unsubscribe, this.publish = this.PubSub.publish, this._callbacksTemp({
|
|
1550
|
-
callback:
|
|
1551
|
-
onDragMove:
|
|
1552
|
-
onDragStart:
|
|
1553
|
-
onDragStartBegin:
|
|
1554
|
-
onElementSelect:
|
|
1555
|
-
onElementUnselect:
|
|
1550
|
+
callback: ki,
|
|
1551
|
+
onDragMove: Si,
|
|
1552
|
+
onDragStart: Ci,
|
|
1553
|
+
onDragStartBegin: Di,
|
|
1554
|
+
onElementSelect: Mi,
|
|
1555
|
+
onElementUnselect: $i
|
|
1556
1556
|
}), this.stores = {
|
|
1557
|
-
PointerStore: new
|
|
1557
|
+
PointerStore: new di({
|
|
1558
1558
|
DS: this
|
|
1559
1559
|
}),
|
|
1560
|
-
ScrollStore: new
|
|
1560
|
+
ScrollStore: new hi({
|
|
1561
1561
|
DS: this,
|
|
1562
1562
|
areaElement: c,
|
|
1563
|
-
zoom:
|
|
1563
|
+
zoom: K
|
|
1564
1564
|
}),
|
|
1565
|
-
KeyStore: new
|
|
1565
|
+
KeyStore: new ui({
|
|
1566
1566
|
DS: this,
|
|
1567
|
-
multiSelectKeys:
|
|
1568
|
-
multiSelectMode:
|
|
1567
|
+
multiSelectKeys: mi,
|
|
1568
|
+
multiSelectMode: Ve
|
|
1569
1569
|
})
|
|
1570
|
-
}, this.Area = new
|
|
1570
|
+
}, this.Area = new ti({
|
|
1571
1571
|
area: c,
|
|
1572
1572
|
PS: this.PubSub,
|
|
1573
|
-
zoom:
|
|
1574
|
-
}), this.Selector = new
|
|
1573
|
+
zoom: K
|
|
1574
|
+
}), this.Selector = new li({
|
|
1575
1575
|
DS: this,
|
|
1576
|
-
selector:
|
|
1577
|
-
selectorClass:
|
|
1578
|
-
customStyles:
|
|
1579
|
-
}), this.SelectorArea = new
|
|
1576
|
+
selector: pi,
|
|
1577
|
+
selectorClass: xi,
|
|
1578
|
+
customStyles: me
|
|
1579
|
+
}), this.SelectorArea = new ci({
|
|
1580
1580
|
DS: this,
|
|
1581
|
-
selectorAreaClass:
|
|
1581
|
+
selectorAreaClass: _i,
|
|
1582
1582
|
autoScrollSpeed: S,
|
|
1583
1583
|
overflowTolerance: $
|
|
1584
|
-
}), this.SelectableSet = new
|
|
1584
|
+
}), this.SelectableSet = new oi({
|
|
1585
1585
|
elements: w,
|
|
1586
1586
|
DS: this,
|
|
1587
|
-
className:
|
|
1588
|
-
hoverClassName:
|
|
1589
|
-
useTransform:
|
|
1590
|
-
draggability:
|
|
1591
|
-
}), this.SelectedSet = new
|
|
1587
|
+
className: nr,
|
|
1588
|
+
hoverClassName: rr,
|
|
1589
|
+
useTransform: er,
|
|
1590
|
+
draggability: bt
|
|
1591
|
+
}), this.SelectedSet = new ai({
|
|
1592
1592
|
DS: this,
|
|
1593
|
-
className:
|
|
1594
|
-
}), this.Selection = new
|
|
1593
|
+
className: wi
|
|
1594
|
+
}), this.Selection = new si({
|
|
1595
1595
|
DS: this,
|
|
1596
|
-
hoverClassName:
|
|
1597
|
-
multiSelectToggling:
|
|
1598
|
-
}), this.Drag = new
|
|
1596
|
+
hoverClassName: rr,
|
|
1597
|
+
multiSelectToggling: De
|
|
1598
|
+
}), this.Drag = new ri({
|
|
1599
1599
|
DS: this,
|
|
1600
|
-
draggability:
|
|
1601
|
-
useTransform:
|
|
1602
|
-
keyboardDrag:
|
|
1600
|
+
draggability: bt,
|
|
1601
|
+
useTransform: er,
|
|
1602
|
+
keyboardDrag: vi,
|
|
1603
1603
|
dragKeys: Object.assign({
|
|
1604
1604
|
up: ["ArrowUp"],
|
|
1605
1605
|
down: ["ArrowDown"],
|
|
1606
1606
|
left: ["ArrowLeft"],
|
|
1607
1607
|
right: ["ArrowRight"]
|
|
1608
|
-
},
|
|
1609
|
-
zoom:
|
|
1610
|
-
keyboardDragSpeed:
|
|
1611
|
-
}), this.Interaction = new
|
|
1608
|
+
}, bi),
|
|
1609
|
+
zoom: K,
|
|
1610
|
+
keyboardDragSpeed: yi
|
|
1611
|
+
}), this.Interaction = new ii({
|
|
1612
1612
|
areaElement: c,
|
|
1613
1613
|
DS: this,
|
|
1614
|
-
draggability:
|
|
1615
|
-
immediateDrag:
|
|
1616
|
-
selectableClass:
|
|
1617
|
-
}),
|
|
1614
|
+
draggability: bt,
|
|
1615
|
+
immediateDrag: gi,
|
|
1616
|
+
selectableClass: nr
|
|
1617
|
+
}), ei({
|
|
1618
1618
|
subscribe: this.subscribe,
|
|
1619
1619
|
publish: this.publish,
|
|
1620
1620
|
SelectedSet: this.SelectedSet,
|
|
@@ -1626,34 +1626,34 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1626
1626
|
return a(u, [{
|
|
1627
1627
|
key: "_callbacksTemp",
|
|
1628
1628
|
value: function(r) {
|
|
1629
|
-
var g = r.callback, c = r.onDragMove, y = r.onDragStart, w = r.onDragStartBegin, k = r.onElementSelect, S = r.onElementUnselect, O = function(
|
|
1630
|
-
return console.warn("[DragSelect] ".concat(
|
|
1629
|
+
var g = r.callback, c = r.onDragMove, y = r.onDragStart, w = r.onDragStartBegin, k = r.onElementSelect, S = r.onElementUnselect, O = function(j, K) {
|
|
1630
|
+
return console.warn("[DragSelect] ".concat(j, ' is deprecated. Use DragSelect.subscribe("').concat(K, '", (callbackObject) => {}) instead. Act Now! See docs for more info'));
|
|
1631
1631
|
};
|
|
1632
1632
|
g && (O("callback", "callback"), this.subscribe("callback", function($) {
|
|
1633
|
-
var
|
|
1633
|
+
var j = $.items;
|
|
1634
1634
|
$.item;
|
|
1635
|
-
var
|
|
1636
|
-
return g(
|
|
1635
|
+
var K = $.event;
|
|
1636
|
+
return g(j, K);
|
|
1637
1637
|
})), c && (O("onDragMove", "dragmove"), this.subscribe("dragmove", function($) {
|
|
1638
1638
|
$.items, $.item;
|
|
1639
|
-
var
|
|
1640
|
-
return c(
|
|
1639
|
+
var j = $.event;
|
|
1640
|
+
return c(j);
|
|
1641
1641
|
})), y && (O("onDragStart", "dragstart"), this.subscribe("dragstart", function($) {
|
|
1642
1642
|
$.items, $.item;
|
|
1643
|
-
var
|
|
1644
|
-
return y(
|
|
1643
|
+
var j = $.event;
|
|
1644
|
+
return y(j);
|
|
1645
1645
|
})), w && (O("onDragStartBegin", "dragstart"), this.subscribe("dragstart", function($) {
|
|
1646
1646
|
$.items, $.item;
|
|
1647
|
-
var
|
|
1648
|
-
return w(
|
|
1647
|
+
var j = $.event;
|
|
1648
|
+
return w(j);
|
|
1649
1649
|
})), k && (O("onElementSelect", "elementselect"), this.subscribe("elementselect", function($) {
|
|
1650
1650
|
$.items;
|
|
1651
|
-
var
|
|
1652
|
-
return k(
|
|
1651
|
+
var j = $.item, K = $.event;
|
|
1652
|
+
return k(j, K);
|
|
1653
1653
|
})), S && (O("onElementUnselect", "elementunselect"), this.subscribe("elementunselect", function($) {
|
|
1654
1654
|
$.items;
|
|
1655
|
-
var
|
|
1656
|
-
return S(
|
|
1655
|
+
var j = $.item, K = $.event;
|
|
1656
|
+
return S(j, K);
|
|
1657
1657
|
}));
|
|
1658
1658
|
}
|
|
1659
1659
|
}, {
|
|
@@ -1668,7 +1668,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1668
1668
|
key: "addSelection",
|
|
1669
1669
|
value: function(r) {
|
|
1670
1670
|
var g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
1671
|
-
return this.SelectedSet.addAll(
|
|
1671
|
+
return this.SelectedSet.addAll(je(r)), c || this.addSelectables(r), g && this.PubSub.publish("callback", {
|
|
1672
1672
|
items: this.getSelection()
|
|
1673
1673
|
}), this.getSelection();
|
|
1674
1674
|
}
|
|
@@ -1676,7 +1676,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1676
1676
|
key: "removeSelection",
|
|
1677
1677
|
value: function(r) {
|
|
1678
1678
|
var g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
1679
|
-
return this.SelectedSet.deleteAll(
|
|
1679
|
+
return this.SelectedSet.deleteAll(je(r)), c && this.removeSelectables(r), g && this.PubSub.publish("callback", {
|
|
1680
1680
|
items: this.getSelection()
|
|
1681
1681
|
}), this.getSelection();
|
|
1682
1682
|
}
|
|
@@ -1684,7 +1684,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1684
1684
|
key: "toggleSelection",
|
|
1685
1685
|
value: function(r) {
|
|
1686
1686
|
var g = this, c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, y = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
1687
|
-
return
|
|
1687
|
+
return je(r).forEach(function(w) {
|
|
1688
1688
|
return g.SelectedSet.has(w) ? g.removeSelection(r, c, y) : g.addSelection(r, c, y);
|
|
1689
1689
|
}), c && this.PubSub.publish("callback", {
|
|
1690
1690
|
items: this.getSelection()
|
|
@@ -1707,7 +1707,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1707
1707
|
}, {
|
|
1708
1708
|
key: "addSelectables",
|
|
1709
1709
|
value: function(r) {
|
|
1710
|
-
var g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, c =
|
|
1710
|
+
var g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, c = je(r);
|
|
1711
1711
|
return this.SelectableSet.addAll(c), g && this.SelectedSet.addAll(c), r;
|
|
1712
1712
|
}
|
|
1713
1713
|
}, {
|
|
@@ -1720,7 +1720,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1720
1720
|
key: "removeSelectables",
|
|
1721
1721
|
value: function(r) {
|
|
1722
1722
|
var g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
1723
|
-
return this.SelectableSet.deleteAll(
|
|
1723
|
+
return this.SelectableSet.deleteAll(je(r)), g && this.removeSelection(r), r;
|
|
1724
1724
|
}
|
|
1725
1725
|
}, {
|
|
1726
1726
|
key: "getCursorPositionDifference",
|
|
@@ -1728,14 +1728,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1728
1728
|
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
1729
1729
|
console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");
|
|
1730
1730
|
var c = g ? this.getCurrentCursorPositionArea() : this.getCurrentCursorPosition(), y = r ? g ? this.getPreviousCursorPositionArea() : this.getPreviousCursorPosition() : g ? this.getInitialCursorPositionArea() : this.getInitialCursorPosition();
|
|
1731
|
-
return
|
|
1731
|
+
return Y(c, "-", y);
|
|
1732
1732
|
}
|
|
1733
1733
|
}]), u;
|
|
1734
1734
|
}();
|
|
1735
|
-
return
|
|
1735
|
+
return fi;
|
|
1736
1736
|
});
|
|
1737
|
-
})(
|
|
1738
|
-
const _n =
|
|
1737
|
+
})(Mr);
|
|
1738
|
+
const _n = Mr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a = t(o) / t(n) | 0, o / e.pow(n, a)).toFixed(0) + " " + (a ? "KMGTPEZY"[--a] + "iB" : "B"), Sn = (o, e = "en-US") => new Date(o * 1e3).toLocaleString(e), Dn = {
|
|
1739
1739
|
key: 0,
|
|
1740
1740
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1741
1741
|
class: "h-5 w-5",
|
|
@@ -1761,19 +1761,19 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
1761
1761
|
En
|
|
1762
1762
|
], An = {
|
|
1763
1763
|
name: "VFSortIcon"
|
|
1764
|
-
},
|
|
1764
|
+
}, st = /* @__PURE__ */ Object.assign(An, {
|
|
1765
1765
|
props: { direction: String },
|
|
1766
1766
|
setup(o) {
|
|
1767
1767
|
return (e, t) => (x(), C("div", null, [
|
|
1768
|
-
o.direction == "down" ? (x(), C("svg", Dn, Mn)) :
|
|
1769
|
-
o.direction == "up" ? (x(), C("svg", $n, Tn)) :
|
|
1768
|
+
o.direction == "down" ? (x(), C("svg", Dn, Mn)) : oe("", !0),
|
|
1769
|
+
o.direction == "up" ? (x(), C("svg", $n, Tn)) : oe("", !0)
|
|
1770
1770
|
]));
|
|
1771
1771
|
}
|
|
1772
1772
|
}), On = ["onClick"], Pn = {
|
|
1773
1773
|
name: "VFToast.vue"
|
|
1774
|
-
},
|
|
1774
|
+
}, In = /* @__PURE__ */ Object.assign(Pn, {
|
|
1775
1775
|
setup(o) {
|
|
1776
|
-
const e =
|
|
1776
|
+
const e = R("emitter"), { getStore: t } = R("storage"), n = V(t("full-screen", !1)), a = (m) => m == "error" ? "text-red-400 border-red-400" : "text-lime-600 border-lime-600", i = V([]), l = (m) => {
|
|
1777
1777
|
i.value.splice(m, 1);
|
|
1778
1778
|
}, f = (m) => {
|
|
1779
1779
|
let p = i.value.findIndex((h) => h.id === m);
|
|
@@ -1785,25 +1785,25 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
1785
1785
|
f(p);
|
|
1786
1786
|
}, 5e3);
|
|
1787
1787
|
}), (m, p) => (x(), C("div", {
|
|
1788
|
-
class:
|
|
1788
|
+
class: ue([n.value.value ? "fixed" : "absolute", "bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])
|
|
1789
1789
|
}, [
|
|
1790
|
-
|
|
1790
|
+
ye(Ti, {
|
|
1791
1791
|
name: "vf-toast-item",
|
|
1792
1792
|
"leave-active-class": "transition-all duration-1000",
|
|
1793
1793
|
"leave-to-class": "opacity-0"
|
|
1794
1794
|
}, {
|
|
1795
|
-
default:
|
|
1796
|
-
(x(!0), C(
|
|
1795
|
+
default: ee(() => [
|
|
1796
|
+
(x(!0), C(se, null, ve(i.value, (h, v) => (x(), C("div", {
|
|
1797
1797
|
onClick: (b) => l(v),
|
|
1798
1798
|
key: h,
|
|
1799
|
-
class:
|
|
1799
|
+
class: ue([a(h.type), "inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 border text-xs rounded cursor-pointer"])
|
|
1800
1800
|
}, E(h.label), 11, On))), 128))
|
|
1801
1801
|
]),
|
|
1802
1802
|
_: 1
|
|
1803
1803
|
})
|
|
1804
1804
|
], 2));
|
|
1805
1805
|
}
|
|
1806
|
-
}),
|
|
1806
|
+
}), Ie = (o) => Object.entries(o).map((e) => e.map(encodeURIComponent).join("=")).join("&"), { apiUrl: Nn } = Se(), Dt = (o, e) => Nn.value + "?" + Ie({ q: "preview", adapter: o, path: e }), Ln = { class: "relative flex-auto flex flex-col overflow-hidden" }, jn = {
|
|
1807
1807
|
key: 0,
|
|
1808
1808
|
class: "grid grid-cols-12 border-b border-neutral-300 dark:border-gray-700 text-xs select-none"
|
|
1809
1809
|
}, Vn = { class: "absolute" }, zn = /* @__PURE__ */ d("svg", {
|
|
@@ -1915,118 +1915,118 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
1915
1915
|
search: Object
|
|
1916
1916
|
},
|
|
1917
1917
|
setup(o) {
|
|
1918
|
-
const e = o, t =
|
|
1918
|
+
const e = o, t = R("emitter"), { setStore: n, getStore: a } = R("storage"), i = (N) => N == null ? void 0 : N.substring(0, 3), l = (N) => N.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/, "$2..$4"), f = V(null), m = V(null), p = V(0), h = V(null), { t: v } = R("i18n"), b = Math.floor(Math.random() * 2 ** 32), A = V(a("full-screen", !1));
|
|
1919
1919
|
t.on("vf-fullscreen-toggle", () => {
|
|
1920
1920
|
A.value = !A.value, n("full-screen", A.value);
|
|
1921
1921
|
});
|
|
1922
1922
|
const M = V("");
|
|
1923
|
-
t.on("vf-search-query", ({ newQuery:
|
|
1924
|
-
M.value =
|
|
1923
|
+
t.on("vf-search-query", ({ newQuery: N }) => {
|
|
1924
|
+
M.value = N, N ? t.emit("vf-fetch", { q: "search", adapter: e.data.adapter, path: e.data.dirname, filter: N }) : t.emit("vf-fetch", { q: "index", adapter: e.data.adapter, path: e.data.dirname });
|
|
1925
1925
|
});
|
|
1926
1926
|
let T = null;
|
|
1927
|
-
const
|
|
1927
|
+
const L = () => {
|
|
1928
1928
|
T && clearTimeout(T);
|
|
1929
|
-
}, z = (
|
|
1929
|
+
}, z = (N) => {
|
|
1930
1930
|
T = setTimeout(() => {
|
|
1931
|
-
B(
|
|
1931
|
+
B(N);
|
|
1932
1932
|
}, 500);
|
|
1933
|
-
}, B = (
|
|
1934
|
-
|
|
1935
|
-
}, P =
|
|
1936
|
-
let
|
|
1937
|
-
if (!
|
|
1938
|
-
return
|
|
1939
|
-
const
|
|
1940
|
-
return P.active && (
|
|
1941
|
-
},
|
|
1942
|
-
P.active && P.column ==
|
|
1943
|
-
}, D = () => h.value.getSelection().map((
|
|
1944
|
-
if (
|
|
1945
|
-
return
|
|
1946
|
-
|
|
1947
|
-
},
|
|
1948
|
-
|
|
1949
|
-
let
|
|
1950
|
-
if (
|
|
1933
|
+
}, B = (N) => {
|
|
1934
|
+
N.type == "dir" ? (t.emit("vf-search-exit"), t.emit("vf-fetch", { q: "index", adapter: e.data.adapter, path: N.path })) : t.emit("vf-modal-show", { type: "preview", adapter: e.data.adapter, item: N });
|
|
1935
|
+
}, P = dt({ active: !1, column: "", order: "" }), ne = (N = !0) => {
|
|
1936
|
+
let U = [...e.data.files], I = P.column, Y = P.order == "asc" ? 1 : -1;
|
|
1937
|
+
if (!N)
|
|
1938
|
+
return U;
|
|
1939
|
+
const H = (te, G) => typeof te == "string" && typeof G == "string" ? te.toLowerCase().localeCompare(G.toLowerCase()) : te < G ? -1 : te > G ? 1 : 0;
|
|
1940
|
+
return P.active && (U = U.slice().sort((te, G) => H(te[I], G[I]) * Y)), U;
|
|
1941
|
+
}, F = (N) => {
|
|
1942
|
+
P.active && P.column == N ? (P.active = P.order == "asc", P.column = N, P.order = "desc") : (P.active = !0, P.column = N, P.order = "asc");
|
|
1943
|
+
}, D = () => h.value.getSelection().map((N) => JSON.parse(N.dataset.item)), X = (N, U) => {
|
|
1944
|
+
if (N.altKey || N.ctrlKey || N.metaKey)
|
|
1945
|
+
return N.preventDefault(), !1;
|
|
1946
|
+
N.dataTransfer.setDragImage(m.value, 0, 15), N.dataTransfer.effectAllowed = "all", N.dataTransfer.dropEffect = "copy", N.dataTransfer.setData("items", JSON.stringify(D()));
|
|
1947
|
+
}, q = (N, U) => {
|
|
1948
|
+
N.preventDefault();
|
|
1949
|
+
let I = JSON.parse(N.dataTransfer.getData("items"));
|
|
1950
|
+
if (I.find((Y) => Y.storage != a("adapter", "local"))) {
|
|
1951
1951
|
alert("Moving items between different storages is not supported yet.");
|
|
1952
1952
|
return;
|
|
1953
1953
|
}
|
|
1954
|
-
t.emit("vf-modal-show", { type: "move", items: { from:
|
|
1955
|
-
},
|
|
1956
|
-
|
|
1954
|
+
t.emit("vf-modal-show", { type: "move", items: { from: I, to: U } });
|
|
1955
|
+
}, le = (N, U) => {
|
|
1956
|
+
N.preventDefault(), !U || U.type !== "dir" || h.value.getSelection().find((I) => I == N.currentTarget) ? (N.dataTransfer.dropEffect = "none", N.dataTransfer.effectAllowed = "none") : N.dataTransfer.dropEffect = "copy";
|
|
1957
1957
|
};
|
|
1958
|
-
return
|
|
1958
|
+
return xe(() => {
|
|
1959
1959
|
h.value = new _n({
|
|
1960
1960
|
area: f.value,
|
|
1961
1961
|
keyboardDrag: !1,
|
|
1962
1962
|
selectedClass: "vf-explorer-selected",
|
|
1963
1963
|
selectorClass: "vf-explorer-selector"
|
|
1964
|
-
}), t.on("vf-explorer-update", () =>
|
|
1964
|
+
}), t.on("vf-explorer-update", () => mt(() => {
|
|
1965
1965
|
h.value.clearSelection(), h.value.setSelectables(document.getElementsByClassName("vf-item-" + b));
|
|
1966
|
-
})), h.value.subscribe("predragstart", ({ event:
|
|
1967
|
-
if (
|
|
1966
|
+
})), h.value.subscribe("predragstart", ({ event: N, isDragging: U }) => {
|
|
1967
|
+
if (U)
|
|
1968
1968
|
p.value = h.value.getSelection().length, h.value.break();
|
|
1969
1969
|
else {
|
|
1970
|
-
const
|
|
1971
|
-
|
|
1970
|
+
const I = N.target.offsetWidth - N.offsetX, Y = N.target.offsetHeight - N.offsetY;
|
|
1971
|
+
I < 15 && Y < 15 && (h.value.clearSelection(), h.value.break());
|
|
1972
1972
|
}
|
|
1973
|
-
}), h.value.subscribe("predragmove", ({ isDragging:
|
|
1974
|
-
|
|
1975
|
-
}), h.value.subscribe("callback", ({ items:
|
|
1973
|
+
}), h.value.subscribe("predragmove", ({ isDragging: N }) => {
|
|
1974
|
+
N && h.value.break();
|
|
1975
|
+
}), h.value.subscribe("callback", ({ items: N, event: U, isDragging: I }) => {
|
|
1976
1976
|
t.emit("vf-nodes-selected", D()), p.value = h.value.getSelection().length;
|
|
1977
1977
|
});
|
|
1978
|
-
}),
|
|
1979
|
-
|
|
1980
|
-
}), (
|
|
1981
|
-
o.view == "list" || M.value.length ? (x(), C("div",
|
|
1978
|
+
}), xe(() => {
|
|
1979
|
+
Nt(() => e.view, () => t.emit("vf-explorer-update"));
|
|
1980
|
+
}), (N, U) => (x(), C("div", Ln, [
|
|
1981
|
+
o.view == "list" || M.value.length ? (x(), C("div", jn, [
|
|
1982
1982
|
d("div", {
|
|
1983
|
-
onClick:
|
|
1983
|
+
onClick: U[0] || (U[0] = (I) => F("basename")),
|
|
1984
1984
|
class: "col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"
|
|
1985
1985
|
}, [
|
|
1986
|
-
|
|
1987
|
-
|
|
1986
|
+
Me(E(_(v)("Name")) + " ", 1),
|
|
1987
|
+
ge(ye(st, {
|
|
1988
1988
|
direction: P.order == "asc" ? "down" : "up"
|
|
1989
1989
|
}, null, 8, ["direction"]), [
|
|
1990
|
-
[
|
|
1990
|
+
[at, P.active && P.column == "basename"]
|
|
1991
1991
|
])
|
|
1992
1992
|
]),
|
|
1993
|
-
M.value.length ?
|
|
1993
|
+
M.value.length ? oe("", !0) : (x(), C("div", {
|
|
1994
1994
|
key: 0,
|
|
1995
|
-
onClick:
|
|
1995
|
+
onClick: U[1] || (U[1] = (I) => F("file_size")),
|
|
1996
1996
|
class: "col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"
|
|
1997
1997
|
}, [
|
|
1998
|
-
|
|
1999
|
-
|
|
1998
|
+
Me(E(_(v)("Size")) + " ", 1),
|
|
1999
|
+
ge(ye(st, {
|
|
2000
2000
|
direction: P.order == "asc" ? "down" : "up"
|
|
2001
2001
|
}, null, 8, ["direction"]), [
|
|
2002
|
-
[
|
|
2002
|
+
[at, P.active && P.column == "file_size"]
|
|
2003
2003
|
])
|
|
2004
2004
|
])),
|
|
2005
|
-
M.value.length ?
|
|
2005
|
+
M.value.length ? oe("", !0) : (x(), C("div", {
|
|
2006
2006
|
key: 1,
|
|
2007
|
-
onClick:
|
|
2007
|
+
onClick: U[2] || (U[2] = (I) => F("last_modified")),
|
|
2008
2008
|
class: "col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"
|
|
2009
2009
|
}, [
|
|
2010
|
-
|
|
2011
|
-
|
|
2010
|
+
Me(E(_(v)("Date")) + " ", 1),
|
|
2011
|
+
ge(ye(st, {
|
|
2012
2012
|
direction: P.order == "asc" ? "down" : "up"
|
|
2013
2013
|
}, null, 8, ["direction"]), [
|
|
2014
|
-
[
|
|
2014
|
+
[at, P.active && P.column == "last_modified"]
|
|
2015
2015
|
])
|
|
2016
2016
|
])),
|
|
2017
2017
|
M.value.length ? (x(), C("div", {
|
|
2018
2018
|
key: 2,
|
|
2019
|
-
onClick:
|
|
2019
|
+
onClick: U[3] || (U[3] = (I) => F("path")),
|
|
2020
2020
|
class: "col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"
|
|
2021
2021
|
}, [
|
|
2022
|
-
|
|
2023
|
-
|
|
2022
|
+
Me(E(_(v)("Filepath")) + " ", 1),
|
|
2023
|
+
ge(ye(st, {
|
|
2024
2024
|
direction: P.order == "asc" ? "down" : "up"
|
|
2025
2025
|
}, null, 8, ["direction"]), [
|
|
2026
|
-
[
|
|
2026
|
+
[at, P.active && P.column == "path"]
|
|
2027
2027
|
])
|
|
2028
|
-
])) :
|
|
2029
|
-
])) :
|
|
2028
|
+
])) : oe("", !0)
|
|
2029
|
+
])) : oe("", !0),
|
|
2030
2030
|
d("div", Vn, [
|
|
2031
2031
|
d("div", {
|
|
2032
2032
|
ref_key: "dragImage",
|
|
@@ -2038,85 +2038,85 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2038
2038
|
], 512)
|
|
2039
2039
|
]),
|
|
2040
2040
|
d("div", {
|
|
2041
|
-
style:
|
|
2042
|
-
class:
|
|
2041
|
+
style: Lt(A.value ? "height: 100%;" : ""),
|
|
2042
|
+
class: ue([A.value ? "" : "resize-y", "h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),
|
|
2043
2043
|
ref_key: "selectorArea",
|
|
2044
2044
|
ref: f,
|
|
2045
|
-
onContextmenu:
|
|
2045
|
+
onContextmenu: U[7] || (U[7] = Oe((I) => _(t).emit("vf-contextmenu-show", { event: I, area: f.value, items: D() }), ["self", "prevent"]))
|
|
2046
2046
|
}, [
|
|
2047
|
-
M.value.length ? (x(!0), C(
|
|
2048
|
-
onDblclick: (
|
|
2049
|
-
onTouchstart: (
|
|
2050
|
-
onTouchend:
|
|
2051
|
-
onContextmenu:
|
|
2052
|
-
class:
|
|
2053
|
-
"data-type":
|
|
2054
|
-
"data-item": JSON.stringify(
|
|
2055
|
-
"data-index":
|
|
2047
|
+
M.value.length ? (x(!0), C(se, { key: 0 }, ve(ne(), (I, Y) => (x(), C("div", {
|
|
2048
|
+
onDblclick: (H) => B(I),
|
|
2049
|
+
onTouchstart: (H) => z(I),
|
|
2050
|
+
onTouchend: U[4] || (U[4] = (H) => L()),
|
|
2051
|
+
onContextmenu: Oe((H) => _(t).emit("vf-contextmenu-show", { event: H, area: f.value, items: D(), target: I }), ["prevent"]),
|
|
2052
|
+
class: ue(["vf-item-" + _(b), "grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),
|
|
2053
|
+
"data-type": I.type,
|
|
2054
|
+
"data-item": JSON.stringify(I),
|
|
2055
|
+
"data-index": Y
|
|
2056
2056
|
}, [
|
|
2057
2057
|
d("div", Hn, [
|
|
2058
2058
|
d("div", Un, [
|
|
2059
|
-
|
|
2060
|
-
d("span", Gn, E(
|
|
2059
|
+
I.type == "dir" ? (x(), C("svg", Kn, Wn)) : (x(), C("svg", Xn, qn)),
|
|
2060
|
+
d("span", Gn, E(I.basename), 1)
|
|
2061
2061
|
]),
|
|
2062
|
-
d("div", Jn, E(
|
|
2062
|
+
d("div", Jn, E(I.path), 1)
|
|
2063
2063
|
])
|
|
2064
|
-
], 42, Rn))), 256)) :
|
|
2065
|
-
o.view == "list" && !M.value.length ? (x(!0), C(
|
|
2064
|
+
], 42, Rn))), 256)) : oe("", !0),
|
|
2065
|
+
o.view == "list" && !M.value.length ? (x(!0), C(se, { key: 1 }, ve(ne(), (I, Y) => (x(), C("div", {
|
|
2066
2066
|
draggable: "true",
|
|
2067
|
-
onDblclick: (
|
|
2068
|
-
onTouchstart: (
|
|
2069
|
-
onTouchend:
|
|
2070
|
-
onContextmenu:
|
|
2071
|
-
onDragstart: (
|
|
2072
|
-
onDragover: (
|
|
2073
|
-
onDrop: (
|
|
2074
|
-
class:
|
|
2075
|
-
"data-type":
|
|
2076
|
-
"data-item": JSON.stringify(
|
|
2077
|
-
"data-index":
|
|
2067
|
+
onDblclick: (H) => B(I),
|
|
2068
|
+
onTouchstart: (H) => z(I),
|
|
2069
|
+
onTouchend: U[5] || (U[5] = (H) => L()),
|
|
2070
|
+
onContextmenu: Oe((H) => _(t).emit("vf-contextmenu-show", { event: H, area: f.value, items: D(), target: I }), ["prevent"]),
|
|
2071
|
+
onDragstart: (H) => X(H),
|
|
2072
|
+
onDragover: (H) => le(H, I),
|
|
2073
|
+
onDrop: (H) => q(H, I),
|
|
2074
|
+
class: ue(["vf-item-" + _(b), "grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),
|
|
2075
|
+
"data-type": I.type,
|
|
2076
|
+
"data-item": JSON.stringify(I),
|
|
2077
|
+
"data-index": Y
|
|
2078
2078
|
}, [
|
|
2079
2079
|
d("div", Qn, [
|
|
2080
2080
|
d("div", eo, [
|
|
2081
|
-
|
|
2082
|
-
d("span", so, E(
|
|
2081
|
+
I.type == "dir" ? (x(), C("svg", to, io)) : (x(), C("svg", no, ao)),
|
|
2082
|
+
d("span", so, E(I.basename), 1)
|
|
2083
2083
|
]),
|
|
2084
|
-
d("div", lo, E(
|
|
2085
|
-
d("div", co, E(_(Sn)(
|
|
2084
|
+
d("div", lo, E(I.file_size ? _(kn)(I.file_size) : ""), 1),
|
|
2085
|
+
d("div", co, E(_(Sn)(I.last_modified)), 1)
|
|
2086
2086
|
])
|
|
2087
|
-
], 42, Zn))), 256)) :
|
|
2088
|
-
o.view == "grid" && !M.value.length ? (x(!0), C(
|
|
2089
|
-
var
|
|
2087
|
+
], 42, Zn))), 256)) : oe("", !0),
|
|
2088
|
+
o.view == "grid" && !M.value.length ? (x(!0), C(se, { key: 2 }, ve(ne(!1), (I, Y) => {
|
|
2089
|
+
var H, te;
|
|
2090
2090
|
return x(), C("div", {
|
|
2091
2091
|
draggable: "true",
|
|
2092
|
-
onDblclick: (
|
|
2093
|
-
onTouchstart: (
|
|
2094
|
-
onTouchend:
|
|
2095
|
-
onContextmenu:
|
|
2096
|
-
onDragstart: (
|
|
2097
|
-
onDragover: (
|
|
2098
|
-
onDrop: (
|
|
2099
|
-
class:
|
|
2100
|
-
"data-type":
|
|
2101
|
-
"data-item": JSON.stringify(
|
|
2102
|
-
"data-index":
|
|
2092
|
+
onDblclick: (G) => B(I),
|
|
2093
|
+
onTouchstart: (G) => z(I),
|
|
2094
|
+
onTouchend: U[6] || (U[6] = (G) => L()),
|
|
2095
|
+
onContextmenu: Oe((G) => _(t).emit("vf-contextmenu-show", { event: G, area: f.value, items: D(), target: I }), ["prevent"]),
|
|
2096
|
+
onDragstart: (G) => X(G),
|
|
2097
|
+
onDragover: (G) => le(G, I),
|
|
2098
|
+
onDrop: (G) => q(G, I),
|
|
2099
|
+
class: ue(["vf-item-" + _(b), "border border-transparent hover:bg-neutral-50 m-0.5 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 md:h-24 text-center justify-center select-none"]),
|
|
2100
|
+
"data-type": I.type,
|
|
2101
|
+
"data-item": JSON.stringify(I),
|
|
2102
|
+
"data-index": Y
|
|
2103
2103
|
}, [
|
|
2104
2104
|
d("div", null, [
|
|
2105
2105
|
d("div", ho, [
|
|
2106
|
-
|
|
2106
|
+
I.type == "dir" ? (x(), C("svg", fo, po)) : ((H = I.mime_type) != null ? H : "").startsWith("image") ? (x(), C("img", {
|
|
2107
2107
|
key: 1,
|
|
2108
2108
|
class: "h-10 md:h-12 m-auto",
|
|
2109
|
-
src: _(
|
|
2109
|
+
src: _(Dt)(_(a)("adapter", e.data.adapter), I.path),
|
|
2110
2110
|
alt: ""
|
|
2111
2111
|
}, null, 8, go)) : (x(), C("svg", vo, yo)),
|
|
2112
|
-
((
|
|
2112
|
+
((te = I.mime_type) != null ? te : "").startsWith("image") ? oe("", !0) : (x(), C("div", wo, E(i(I.extension)), 1))
|
|
2113
2113
|
]),
|
|
2114
|
-
d("span", xo, E(l(
|
|
2114
|
+
d("span", xo, E(l(I.basename)), 1)
|
|
2115
2115
|
])
|
|
2116
2116
|
], 42, uo);
|
|
2117
|
-
}), 256)) :
|
|
2117
|
+
}), 256)) : oe("", !0)
|
|
2118
2118
|
], 38),
|
|
2119
|
-
|
|
2119
|
+
ye(In)
|
|
2120
2120
|
]));
|
|
2121
2121
|
}
|
|
2122
2122
|
}), So = { class: "p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none" }, Do = { class: "flex leading-5 items-center" }, Co = ["aria-label"], Mo = /* @__PURE__ */ d("svg", {
|
|
@@ -2134,10 +2134,10 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2134
2134
|
})
|
|
2135
2135
|
], -1), $o = [
|
|
2136
2136
|
Mo
|
|
2137
|
-
], Eo = ["value"], To = { class: "ml-3" }, Ao = { key: 0 }, Oo = { class: "ml-1" }, Po = { class: "flex leading-5 items-center" },
|
|
2137
|
+
], Eo = ["value"], To = { class: "ml-3" }, Ao = { key: 0 }, Oo = { class: "ml-1" }, Po = { class: "flex leading-5 items-center" }, Io = {
|
|
2138
2138
|
value: "",
|
|
2139
2139
|
disabled: ""
|
|
2140
|
-
},
|
|
2140
|
+
}, No = /* @__PURE__ */ d("option", { value: "tr" }, "Turkish", -1), Lo = /* @__PURE__ */ d("option", { value: "en" }, "English", -1), jo = /* @__PURE__ */ d("option", { value: "fr" }, "French", -1), Vo = ["aria-label"], zo = /* @__PURE__ */ d("svg", {
|
|
2141
2141
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2142
2142
|
class: "h-5 w-5 stroke-slate-500 cursor-pointer",
|
|
2143
2143
|
fill: "none",
|
|
@@ -2160,7 +2160,7 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2160
2160
|
},
|
|
2161
2161
|
setup(o) {
|
|
2162
2162
|
var b;
|
|
2163
|
-
const e = o, t =
|
|
2163
|
+
const e = o, t = R("emitter"), { getStore: n, setStore: a } = R("storage"), i = V(0), l = V((b = n("adapter")) != null ? b : e.data.adapter), { t: f, changeLocale: m } = R("i18n"), p = V(n("locale", "")), h = () => {
|
|
2164
2164
|
t.emit("vf-search-exit"), t.emit("vf-fetch", { q: "index", adapter: l.value }), a("adapter", l.value);
|
|
2165
2165
|
};
|
|
2166
2166
|
t.on("vf-nodes-selected", (A) => {
|
|
@@ -2177,32 +2177,32 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2177
2177
|
"data-microtip-position": "top-right",
|
|
2178
2178
|
role: "tooltip"
|
|
2179
2179
|
}, $o, 8, Co),
|
|
2180
|
-
|
|
2180
|
+
ge(d("select", {
|
|
2181
2181
|
"onUpdate:modelValue": M[0] || (M[0] = (T) => l.value = T),
|
|
2182
2182
|
onChange: h,
|
|
2183
2183
|
class: "py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"
|
|
2184
2184
|
}, [
|
|
2185
|
-
(x(!0), C(
|
|
2185
|
+
(x(!0), C(se, null, ve(o.data.storages, (T) => (x(), C("option", { value: T }, E(T), 9, Eo))), 256))
|
|
2186
2186
|
], 544), [
|
|
2187
|
-
[
|
|
2187
|
+
[lr, l.value]
|
|
2188
2188
|
]),
|
|
2189
2189
|
d("div", To, [
|
|
2190
|
-
v.value.length ? (x(), C("span", Ao, E(o.data.files.length) + " items found. ", 1)) :
|
|
2190
|
+
v.value.length ? (x(), C("span", Ao, E(o.data.files.length) + " items found. ", 1)) : oe("", !0),
|
|
2191
2191
|
d("span", Oo, E(i.value > 0 ? i.value + " " + _(f)("item(s) selected.") : ""), 1)
|
|
2192
2192
|
])
|
|
2193
2193
|
]),
|
|
2194
2194
|
d("div", Po, [
|
|
2195
|
-
|
|
2195
|
+
ge(d("select", {
|
|
2196
2196
|
"onUpdate:modelValue": M[1] || (M[1] = (T) => p.value = T),
|
|
2197
2197
|
onChange: M[2] || (M[2] = (T) => _(m)(T.target.value)),
|
|
2198
2198
|
class: "py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"
|
|
2199
2199
|
}, [
|
|
2200
|
-
d("option",
|
|
2201
|
-
Io,
|
|
2200
|
+
d("option", Io, E(_(f)("Language")), 1),
|
|
2202
2201
|
No,
|
|
2203
|
-
Lo
|
|
2202
|
+
Lo,
|
|
2203
|
+
jo
|
|
2204
2204
|
], 544), [
|
|
2205
|
-
[
|
|
2205
|
+
[lr, p.value]
|
|
2206
2206
|
]),
|
|
2207
2207
|
d("span", {
|
|
2208
2208
|
"aria-label": _(f)("About"),
|
|
@@ -2222,7 +2222,7 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2222
2222
|
};
|
|
2223
2223
|
}, Ko = (o, e, t) => {
|
|
2224
2224
|
const n = V(o);
|
|
2225
|
-
return
|
|
2225
|
+
return Ai((i, l) => ({
|
|
2226
2226
|
get() {
|
|
2227
2227
|
return i(), n.value;
|
|
2228
2228
|
},
|
|
@@ -2269,15 +2269,15 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2269
2269
|
data: Object
|
|
2270
2270
|
},
|
|
2271
2271
|
setup(o) {
|
|
2272
|
-
const e = o, t =
|
|
2272
|
+
const e = o, t = R("emitter"), { getStore: n } = R("storage"), a = V(null), i = V([]), l = V(!1), f = V(null), { t: m } = R("i18n");
|
|
2273
2273
|
t.on("vf-explorer-update", () => {
|
|
2274
2274
|
var B;
|
|
2275
|
-
let
|
|
2275
|
+
let L = [], z = [];
|
|
2276
2276
|
a.value = (B = e.data.dirname) != null ? B : n("adapter", "local") + "://", a.value.length == 0 && (i.value = []), a.value.replace(n("adapter", "local") + "://", "").split("/").forEach(function(P) {
|
|
2277
|
-
|
|
2277
|
+
L.push(P), L.join("/") != "" && z.push({
|
|
2278
2278
|
basename: P,
|
|
2279
2279
|
name: P,
|
|
2280
|
-
path: n("adapter", "local") + "://" +
|
|
2280
|
+
path: n("adapter", "local") + "://" + L.join("/"),
|
|
2281
2281
|
type: "dir"
|
|
2282
2282
|
});
|
|
2283
2283
|
}), z.length > 4 && (z = z.slice(-5), z[0].name = ".."), i.value = z;
|
|
@@ -2289,15 +2289,15 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2289
2289
|
p();
|
|
2290
2290
|
});
|
|
2291
2291
|
const h = () => {
|
|
2292
|
-
l.value = !0,
|
|
2292
|
+
l.value = !0, mt(() => f.value.focus());
|
|
2293
2293
|
}, v = Ko("", 400);
|
|
2294
|
-
|
|
2295
|
-
t.emit("vf-search-query", { newQuery:
|
|
2294
|
+
Nt(v, (L) => {
|
|
2295
|
+
t.emit("vf-search-query", { newQuery: L });
|
|
2296
2296
|
});
|
|
2297
|
-
const b = () => i.value.length && !l.value, A = (
|
|
2297
|
+
const b = () => i.value.length && !l.value, A = (L) => {
|
|
2298
2298
|
var B;
|
|
2299
|
-
|
|
2300
|
-
let z = JSON.parse(
|
|
2299
|
+
L.preventDefault();
|
|
2300
|
+
let z = JSON.parse(L.dataTransfer.getData("items"));
|
|
2301
2301
|
if (z.find((P) => P.storage != n("adapter", "local"))) {
|
|
2302
2302
|
alert("Moving items between different storages is not supported yet.");
|
|
2303
2303
|
return;
|
|
@@ -2306,12 +2306,12 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2306
2306
|
type: "move",
|
|
2307
2307
|
items: { from: z, to: (B = i.value[i.value.length - 2]) != null ? B : { path: n("adapter", "local") + "://" } }
|
|
2308
2308
|
});
|
|
2309
|
-
}, M = (
|
|
2310
|
-
|
|
2309
|
+
}, M = (L) => {
|
|
2310
|
+
L.preventDefault(), b() ? L.dataTransfer.dropEffect = "copy" : (L.dataTransfer.dropEffect = "none", L.dataTransfer.effectAllowed = "none");
|
|
2311
2311
|
}, T = () => {
|
|
2312
2312
|
v.value == "" && p();
|
|
2313
2313
|
};
|
|
2314
|
-
return (
|
|
2314
|
+
return (L, z) => (x(), C("div", Yo, [
|
|
2315
2315
|
d("span", {
|
|
2316
2316
|
"aria-label": _(m)("Go up a directory"),
|
|
2317
2317
|
"data-microtip-position": "bottom-right",
|
|
@@ -2321,10 +2321,10 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2321
2321
|
onDragover: z[0] || (z[0] = (B) => M(B)),
|
|
2322
2322
|
onDrop: z[1] || (z[1] = (B) => A(B)),
|
|
2323
2323
|
onClick: z[2] || (z[2] = (B) => {
|
|
2324
|
-
var P,
|
|
2325
|
-
return !b() || _(t).emit("vf-fetch", { q: "index", adapter: o.data.adapter, path: (
|
|
2324
|
+
var P, ne;
|
|
2325
|
+
return !b() || _(t).emit("vf-fetch", { q: "index", adapter: o.data.adapter, path: (ne = (P = i.value[i.value.length - 2]) == null ? void 0 : P.path) != null ? ne : _(n)("adapter", "local") + "://" });
|
|
2326
2326
|
}),
|
|
2327
|
-
class:
|
|
2327
|
+
class: ue(["h-6 w-6 p-0.5 rounded", b() ? "text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer" : "text-gray-400 dark:text-neutral-500"]),
|
|
2328
2328
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2329
2329
|
viewBox: "0 0 20 20",
|
|
2330
2330
|
fill: "currentColor"
|
|
@@ -2332,17 +2332,17 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2332
2332
|
], 8, Wo),
|
|
2333
2333
|
l.value ? (x(), C("div", ta, [
|
|
2334
2334
|
ra,
|
|
2335
|
-
|
|
2335
|
+
ge(d("input", {
|
|
2336
2336
|
ref_key: "searchInput",
|
|
2337
2337
|
ref: f,
|
|
2338
|
-
onKeydown:
|
|
2338
|
+
onKeydown: Ke(p, ["esc"]),
|
|
2339
2339
|
onBlur: T,
|
|
2340
|
-
"onUpdate:modelValue": z[4] || (z[4] = (B) =>
|
|
2340
|
+
"onUpdate:modelValue": z[4] || (z[4] = (B) => Oi(v) ? v.value = B : null),
|
|
2341
2341
|
placeholder: _(m)("Search anything.."),
|
|
2342
2342
|
class: "py-0 px-2 w-full border-0 ring-0 outline-0 text-sm text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",
|
|
2343
2343
|
type: "text"
|
|
2344
2344
|
}, null, 40, ia), [
|
|
2345
|
-
[
|
|
2345
|
+
[Ye, _(v)]
|
|
2346
2346
|
]),
|
|
2347
2347
|
(x(), C("svg", {
|
|
2348
2348
|
class: "w-6 h-6 cursor-pointer",
|
|
@@ -2356,7 +2356,7 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2356
2356
|
])) : (x(), C("div", {
|
|
2357
2357
|
key: 0,
|
|
2358
2358
|
class: "group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",
|
|
2359
|
-
onClick:
|
|
2359
|
+
onClick: Oe(h, ["self"])
|
|
2360
2360
|
}, [
|
|
2361
2361
|
(x(), C("svg", {
|
|
2362
2362
|
onClick: z[3] || (z[3] = (B) => _(t).emit("vf-fetch", { q: "index", adapter: o.data.adapter })),
|
|
@@ -2366,12 +2366,12 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2366
2366
|
fill: "currentColor"
|
|
2367
2367
|
}, Jo)),
|
|
2368
2368
|
d("div", Zo, [
|
|
2369
|
-
(x(!0), C(
|
|
2369
|
+
(x(!0), C(se, null, ve(i.value, (B, P) => (x(), C("div", { key: P }, [
|
|
2370
2370
|
Qo,
|
|
2371
2371
|
d("span", {
|
|
2372
2372
|
class: "px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",
|
|
2373
2373
|
title: B.basename,
|
|
2374
|
-
onClick: (
|
|
2374
|
+
onClick: (ne) => _(t).emit("vf-fetch", { q: "index", adapter: o.data.adapter, path: B.path })
|
|
2375
2375
|
}, E(B.name), 9, ea)
|
|
2376
2376
|
]))), 128))
|
|
2377
2377
|
])
|
|
@@ -2385,7 +2385,7 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2385
2385
|
current: Object
|
|
2386
2386
|
},
|
|
2387
2387
|
setup(o) {
|
|
2388
|
-
const e = o, t =
|
|
2388
|
+
const e = o, t = R("emitter"), n = V(null), { apiUrl: a } = Se(), i = dt({
|
|
2389
2389
|
active: !1,
|
|
2390
2390
|
items: [],
|
|
2391
2391
|
positions: {
|
|
@@ -2396,7 +2396,7 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2396
2396
|
t.on("vf-context-selected", (b) => {
|
|
2397
2397
|
l.value = b;
|
|
2398
2398
|
});
|
|
2399
|
-
const { t: f } =
|
|
2399
|
+
const { t: f } = R("i18n"), m = {
|
|
2400
2400
|
newfolder: {
|
|
2401
2401
|
title: () => f("New Folder"),
|
|
2402
2402
|
action: () => {
|
|
@@ -2436,7 +2436,7 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2436
2436
|
download: {
|
|
2437
2437
|
title: () => f("Download"),
|
|
2438
2438
|
action: () => {
|
|
2439
|
-
const b = a.value + "?" +
|
|
2439
|
+
const b = a.value + "?" + Ie({ q: "download", adapter: l.value[0].adapter, path: l.value[0].path });
|
|
2440
2440
|
t.emit("vf-download", b);
|
|
2441
2441
|
}
|
|
2442
2442
|
},
|
|
@@ -2470,17 +2470,17 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2470
2470
|
else
|
|
2471
2471
|
return;
|
|
2472
2472
|
else
|
|
2473
|
-
!T && !h.value ? (i.items.push(m.refresh), i.items.push(m.newfolder), t.emit("vf-context-selected", []), console.log("no files selected")) : M.length > 1 && M.some((
|
|
2473
|
+
!T && !h.value ? (i.items.push(m.refresh), i.items.push(m.newfolder), t.emit("vf-context-selected", []), console.log("no files selected")) : M.length > 1 && M.some((L) => L.path === T.path) ? (i.items.push(m.refresh), i.items.push(m.archive), i.items.push(m.delete), t.emit("vf-context-selected", M), console.log(M.length + " selected (more than 1 item.)")) : (T.type == "dir" ? i.items.push(m.open) : i.items.push(m.preview), i.items.push(m.rename), i.items.push(m.download), T.mime_type == "application/zip" ? i.items.push(m.unarchive) : i.items.push(m.archive), i.items.push(m.delete), t.emit("vf-context-selected", [T]), console.log(T.type + " is selected"));
|
|
2474
2474
|
v(b, A);
|
|
2475
2475
|
}), t.on("vf-contextmenu-hide", () => {
|
|
2476
2476
|
i.active = !1;
|
|
2477
2477
|
});
|
|
2478
2478
|
const v = (b, A) => {
|
|
2479
|
-
i.active = !0,
|
|
2480
|
-
let M = A.getBoundingClientRect(), T = b.pageX,
|
|
2481
|
-
T = M.right - b.pageX + window.scrollX < B ? T - B : T,
|
|
2479
|
+
i.active = !0, mt(() => {
|
|
2480
|
+
let M = A.getBoundingClientRect(), T = b.pageX, L = b.pageY, z = n.value.offsetHeight, B = n.value.offsetWidth;
|
|
2481
|
+
T = M.right - b.pageX + window.scrollX < B ? T - B : T, L = M.bottom - b.pageY + window.scrollY < z ? L - z : L, i.positions = {
|
|
2482
2482
|
left: T + "px",
|
|
2483
|
-
top:
|
|
2483
|
+
top: L + "px"
|
|
2484
2484
|
};
|
|
2485
2485
|
});
|
|
2486
2486
|
};
|
|
@@ -2489,9 +2489,9 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2489
2489
|
class: "z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",
|
|
2490
2490
|
ref_key: "contextmenu",
|
|
2491
2491
|
ref: n,
|
|
2492
|
-
style:
|
|
2492
|
+
style: Lt(i.positions)
|
|
2493
2493
|
}, [
|
|
2494
|
-
(x(!0), C(
|
|
2494
|
+
(x(!0), C(se, null, ve(i.items, (M) => (x(), C("li", {
|
|
2495
2495
|
class: "px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",
|
|
2496
2496
|
key: M.title,
|
|
2497
2497
|
onClick: (T) => p(M)
|
|
@@ -2499,7 +2499,7 @@ const _n = Cr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2499
2499
|
ca,
|
|
2500
2500
|
d("span", null, E(M.title()), 1)
|
|
2501
2501
|
], 8, la))), 128))
|
|
2502
|
-
], 4)) :
|
|
2502
|
+
], 4)) : oe("", !0);
|
|
2503
2503
|
}
|
|
2504
2504
|
}), ha = (o, e) => {
|
|
2505
2505
|
const t = o[e];
|
|
@@ -2512,7 +2512,7 @@ async function fa(o) {
|
|
|
2512
2512
|
return JSON.parse(e.default);
|
|
2513
2513
|
}
|
|
2514
2514
|
function ma(o, e) {
|
|
2515
|
-
const { getStore: t, setStore: n } =
|
|
2515
|
+
const { getStore: t, setStore: n } = St(o), a = ["en", "tr"], i = V({}), l = (m) => {
|
|
2516
2516
|
a.includes(m) || (console.log("The selected locale is not yet supported. The fallback language is set as 'en'"), m = "en"), fa(m).then((p) => {
|
|
2517
2517
|
i.value = p, n("locale", m), n("translations", p), console.log(m + " is loaded.");
|
|
2518
2518
|
});
|
|
@@ -2551,13 +2551,13 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2551
2551
|
}
|
|
2552
2552
|
},
|
|
2553
2553
|
setup(o) {
|
|
2554
|
-
const e = o, t =
|
|
2555
|
-
|
|
2554
|
+
const e = o, t = Ii(), { setStore: n, getStore: a } = St(e.id);
|
|
2555
|
+
yt("emitter", t), yt("storage", St(e.id));
|
|
2556
2556
|
const i = ma(e.id, e.locale);
|
|
2557
|
-
|
|
2558
|
-
const { apiUrl: l, setApiUrl: f } =
|
|
2557
|
+
yt("i18n", i);
|
|
2558
|
+
const { apiUrl: l, setApiUrl: f } = Se();
|
|
2559
2559
|
f(e.url);
|
|
2560
|
-
const m =
|
|
2560
|
+
const m = dt({ adapter: "local", storages: [], dirname: ".", files: [] }), p = V(a("viewport", "grid")), h = V(a("darkMode", e.dark));
|
|
2561
2561
|
t.on("vf-darkMode-toggle", () => {
|
|
2562
2562
|
h.value = !h.value, n("darkMode", h.value);
|
|
2563
2563
|
});
|
|
@@ -2567,7 +2567,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2567
2567
|
}), t.on("vf-view-toggle", (M) => {
|
|
2568
2568
|
p.value = M;
|
|
2569
2569
|
});
|
|
2570
|
-
const b =
|
|
2570
|
+
const b = dt({
|
|
2571
2571
|
active: !1,
|
|
2572
2572
|
type: "delete",
|
|
2573
2573
|
data: {}
|
|
@@ -2581,43 +2581,43 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2581
2581
|
Object.assign(m, M), t.emit("vf-nodes-selected", {}), t.emit("vf-explorer-update");
|
|
2582
2582
|
};
|
|
2583
2583
|
return t.on("vf-fetch", (M) => {
|
|
2584
|
-
|
|
2584
|
+
ht(l.value, { params: M }).then((T) => {
|
|
2585
2585
|
t.emit("vf-modal-close"), A(T);
|
|
2586
2586
|
});
|
|
2587
2587
|
}), t.on("vf-download", (M) => {
|
|
2588
2588
|
document.getElementById("download_frame").src = M, t.emit("vf-modal-close");
|
|
2589
|
-
}),
|
|
2589
|
+
}), xe(() => {
|
|
2590
2590
|
t.emit("vf-fetch", { q: "index", adapter: a("adapter", m.adapter) });
|
|
2591
2591
|
}), (M, T) => (x(), C("div", {
|
|
2592
|
-
class:
|
|
2592
|
+
class: ue(h.value ? "dark" : "")
|
|
2593
2593
|
}, [
|
|
2594
2594
|
d("div", {
|
|
2595
|
-
class:
|
|
2596
|
-
style:
|
|
2597
|
-
onMousedown: T[0] || (T[0] = (
|
|
2595
|
+
class: ue([v.value ? "fixed w-screen inset-0 z-20" : "relative", "border flex flex-col rounded-md bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),
|
|
2596
|
+
style: Lt(v.value ? "" : "max-height: " + o.maxHeight),
|
|
2597
|
+
onMousedown: T[0] || (T[0] = (L) => _(t).emit("vf-contextmenu-hide"))
|
|
2598
2598
|
}, [
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2599
|
+
ye(wn, { data: m }, null, 8, ["data"]),
|
|
2600
|
+
ye(sa, { data: m }, null, 8, ["data"]),
|
|
2601
|
+
ye(ko, {
|
|
2602
2602
|
view: p.value,
|
|
2603
2603
|
data: m
|
|
2604
2604
|
}, null, 8, ["view", "data"]),
|
|
2605
|
-
|
|
2605
|
+
ye(Ho, { data: m }, null, 8, ["data"])
|
|
2606
2606
|
], 38),
|
|
2607
|
-
b.active ? (x(),
|
|
2607
|
+
b.active ? (x(), ce(Pi("v-f-modal-" + b.type), {
|
|
2608
2608
|
key: 0,
|
|
2609
2609
|
selection: b.data,
|
|
2610
2610
|
current: m
|
|
2611
|
-
}, null, 8, ["selection", "current"])) :
|
|
2612
|
-
|
|
2611
|
+
}, null, 8, ["selection", "current"])) : oe("", !0),
|
|
2612
|
+
ye(da, { current: m }, null, 8, ["current"]),
|
|
2613
2613
|
pa
|
|
2614
2614
|
], 2));
|
|
2615
2615
|
}
|
|
2616
|
-
}), ba = /* @__PURE__ */ d("div", { class: "fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" }, null, -1), ya = { class: "fixed z-10 inset-0 overflow-y-auto" }, wa = { class: "relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl sm:w-full" }, xa = { class: "bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4" }, _a = { class: "bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse" },
|
|
2616
|
+
}), ba = /* @__PURE__ */ d("div", { class: "fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" }, null, -1), ya = { class: "fixed z-10 inset-0 overflow-y-auto" }, wa = { class: "relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl sm:w-full" }, xa = { class: "bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4" }, _a = { class: "bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse" }, ke = {
|
|
2617
2617
|
__name: "ModalLayout",
|
|
2618
2618
|
setup(o) {
|
|
2619
|
-
const e =
|
|
2620
|
-
return
|
|
2619
|
+
const e = R("emitter");
|
|
2620
|
+
return xe(() => {
|
|
2621
2621
|
const t = document.querySelector(".v-f-modal input");
|
|
2622
2622
|
t && t.focus();
|
|
2623
2623
|
}), (t, n) => (x(), C("div", {
|
|
@@ -2625,21 +2625,21 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2625
2625
|
"aria-labelledby": "modal-title",
|
|
2626
2626
|
role: "dialog",
|
|
2627
2627
|
"aria-modal": "true",
|
|
2628
|
-
onKeyup: n[1] || (n[1] =
|
|
2628
|
+
onKeyup: n[1] || (n[1] = Ke((a) => _(e).emit("vf-modal-close"), ["esc"])),
|
|
2629
2629
|
tabindex: "0"
|
|
2630
2630
|
}, [
|
|
2631
2631
|
ba,
|
|
2632
2632
|
d("div", ya, [
|
|
2633
2633
|
d("div", {
|
|
2634
2634
|
class: "flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",
|
|
2635
|
-
onMousedown: n[0] || (n[0] =
|
|
2635
|
+
onMousedown: n[0] || (n[0] = Oe((a) => _(e).emit("vf-modal-close"), ["self"]))
|
|
2636
2636
|
}, [
|
|
2637
2637
|
d("div", wa, [
|
|
2638
2638
|
d("div", xa, [
|
|
2639
|
-
|
|
2639
|
+
cr(t.$slots, "default")
|
|
2640
2640
|
]),
|
|
2641
2641
|
d("div", _a, [
|
|
2642
|
-
|
|
2642
|
+
cr(t.$slots, "buttons")
|
|
2643
2643
|
])
|
|
2644
2644
|
])
|
|
2645
2645
|
], 32)
|
|
@@ -2686,13 +2686,13 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2686
2686
|
viewBox: "0 0 24 24",
|
|
2687
2687
|
stroke: "currentColor",
|
|
2688
2688
|
"stroke-width": "1"
|
|
2689
|
-
},
|
|
2689
|
+
}, Ia = /* @__PURE__ */ d("path", {
|
|
2690
2690
|
"stroke-linecap": "round",
|
|
2691
2691
|
"stroke-linejoin": "round",
|
|
2692
2692
|
d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"
|
|
2693
|
-
}, null, -1),
|
|
2694
|
-
|
|
2695
|
-
],
|
|
2693
|
+
}, null, -1), Na = [
|
|
2694
|
+
Ia
|
|
2695
|
+
], La = { class: "ml-1.5" }, ja = { class: "m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center" }, Va = {
|
|
2696
2696
|
name: "VFModalDelete"
|
|
2697
2697
|
}, za = /* @__PURE__ */ Object.assign(Va, {
|
|
2698
2698
|
props: {
|
|
@@ -2700,7 +2700,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2700
2700
|
current: Object
|
|
2701
2701
|
},
|
|
2702
2702
|
setup(o) {
|
|
2703
|
-
const e = o, t =
|
|
2703
|
+
const e = o, t = R("emitter"), { getStore: n } = R("storage"), { t: a } = R("i18n"), i = V(e.selection.items), l = () => {
|
|
2704
2704
|
i.value.length && t.emit("vf-fetch", {
|
|
2705
2705
|
q: "delete",
|
|
2706
2706
|
adapter: n("adapter", "local"),
|
|
@@ -2708,8 +2708,8 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2708
2708
|
items: JSON.stringify(i.value.map(({ path: f, type: m }) => ({ path: f, type: m })))
|
|
2709
2709
|
});
|
|
2710
2710
|
};
|
|
2711
|
-
return (f, m) => (x(),
|
|
2712
|
-
buttons:
|
|
2711
|
+
return (f, m) => (x(), ce(ke, null, {
|
|
2712
|
+
buttons: ee(() => [
|
|
2713
2713
|
d("button", {
|
|
2714
2714
|
type: "button",
|
|
2715
2715
|
onClick: l,
|
|
@@ -2720,18 +2720,18 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2720
2720
|
onClick: m[0] || (m[0] = (p) => _(t).emit("vf-modal-close")),
|
|
2721
2721
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
2722
2722
|
}, E(_(a)("Cancel")), 1),
|
|
2723
|
-
d("div",
|
|
2723
|
+
d("div", ja, E(_(a)("This action cannot be undone.")), 1)
|
|
2724
2724
|
]),
|
|
2725
|
-
default:
|
|
2725
|
+
default: ee(() => [
|
|
2726
2726
|
d("div", ka, [
|
|
2727
2727
|
Sa,
|
|
2728
2728
|
d("div", Da, [
|
|
2729
2729
|
d("h3", Ca, E(_(a)("Delete files")), 1),
|
|
2730
2730
|
d("div", Ma, [
|
|
2731
2731
|
d("p", $a, E(_(a)("Are you sure you want to delete these files ?")), 1),
|
|
2732
|
-
(x(!0), C(
|
|
2733
|
-
p.type == "dir" ? (x(), C("svg", Ta, Oa)) : (x(), C("svg", Pa,
|
|
2734
|
-
d("span",
|
|
2732
|
+
(x(!0), C(se, null, ve(i.value, (p) => (x(), C("p", Ea, [
|
|
2733
|
+
p.type == "dir" ? (x(), C("svg", Ta, Oa)) : (x(), C("svg", Pa, Na)),
|
|
2734
|
+
d("span", La, E(p.basename), 1)
|
|
2735
2735
|
]))), 256))
|
|
2736
2736
|
])
|
|
2737
2737
|
])
|
|
@@ -2765,16 +2765,16 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2765
2765
|
selection: Object
|
|
2766
2766
|
},
|
|
2767
2767
|
setup(o) {
|
|
2768
|
-
const e =
|
|
2769
|
-
return (n, a) => (x(),
|
|
2770
|
-
buttons:
|
|
2768
|
+
const e = R("emitter"), { t } = R("i18n");
|
|
2769
|
+
return (n, a) => (x(), ce(ke, null, {
|
|
2770
|
+
buttons: ee(() => [
|
|
2771
2771
|
d("button", {
|
|
2772
2772
|
type: "button",
|
|
2773
2773
|
onClick: a[0] || (a[0] = (i) => _(e).emit("vf-modal-close")),
|
|
2774
2774
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
2775
2775
|
}, E(_(t)("Close")), 1)
|
|
2776
2776
|
]),
|
|
2777
|
-
default:
|
|
2777
|
+
default: ee(() => {
|
|
2778
2778
|
var i, l, f, m;
|
|
2779
2779
|
return [
|
|
2780
2780
|
d("div", Ba, [
|
|
@@ -2817,7 +2817,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2817
2817
|
current: Object
|
|
2818
2818
|
},
|
|
2819
2819
|
setup(o) {
|
|
2820
|
-
const e = o, t =
|
|
2820
|
+
const e = o, t = R("emitter"), { getStore: n } = R("storage"), { t: a } = R("i18n"), i = V(""), l = () => {
|
|
2821
2821
|
i.value != "" && (t.emit("vf-fetch", {
|
|
2822
2822
|
q: "newfolder",
|
|
2823
2823
|
adapter: n("adapter", "local"),
|
|
@@ -2825,8 +2825,8 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2825
2825
|
name: i.value
|
|
2826
2826
|
}), t.emit("vf-toast-push", { label: "New Folder is created successfully", type: "success" }));
|
|
2827
2827
|
};
|
|
2828
|
-
return (f, m) => (x(),
|
|
2829
|
-
buttons:
|
|
2828
|
+
return (f, m) => (x(), ce(ke, null, {
|
|
2829
|
+
buttons: ee(() => [
|
|
2830
2830
|
d("button", {
|
|
2831
2831
|
type: "button",
|
|
2832
2832
|
onClick: l,
|
|
@@ -2838,21 +2838,21 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2838
2838
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
2839
2839
|
}, E(_(a)("Cancel")), 1)
|
|
2840
2840
|
]),
|
|
2841
|
-
default:
|
|
2841
|
+
default: ee(() => [
|
|
2842
2842
|
d("div", Fa, [
|
|
2843
2843
|
qa,
|
|
2844
2844
|
d("div", Ga, [
|
|
2845
2845
|
d("h3", Ja, E(_(a)("New Folder")), 1),
|
|
2846
2846
|
d("div", Za, [
|
|
2847
2847
|
d("p", Qa, E(_(a)("Create a new folder")), 1),
|
|
2848
|
-
|
|
2848
|
+
ge(d("input", {
|
|
2849
2849
|
"onUpdate:modelValue": m[0] || (m[0] = (p) => i.value = p),
|
|
2850
|
-
onKeyup:
|
|
2850
|
+
onKeyup: Ke(l, ["enter"]),
|
|
2851
2851
|
class: "px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",
|
|
2852
2852
|
placeholder: _(a)("Folder Name"),
|
|
2853
2853
|
type: "text"
|
|
2854
2854
|
}, null, 40, es), [
|
|
2855
|
-
[
|
|
2855
|
+
[Ye, i.value]
|
|
2856
2856
|
])
|
|
2857
2857
|
])
|
|
2858
2858
|
])
|
|
@@ -2887,7 +2887,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2887
2887
|
current: Object
|
|
2888
2888
|
},
|
|
2889
2889
|
setup(o) {
|
|
2890
|
-
const e = o, t =
|
|
2890
|
+
const e = o, t = R("emitter"), { getStore: n } = R("storage"), { t: a } = R("i18n"), i = V(""), l = () => {
|
|
2891
2891
|
i.value != "" && t.emit("vf-fetch", {
|
|
2892
2892
|
q: "newfile",
|
|
2893
2893
|
adapter: n("adapter", "local"),
|
|
@@ -2895,8 +2895,8 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2895
2895
|
name: i.value
|
|
2896
2896
|
});
|
|
2897
2897
|
};
|
|
2898
|
-
return (f, m) => (x(),
|
|
2899
|
-
buttons:
|
|
2898
|
+
return (f, m) => (x(), ce(ke, null, {
|
|
2899
|
+
buttons: ee(() => [
|
|
2900
2900
|
d("button", {
|
|
2901
2901
|
type: "button",
|
|
2902
2902
|
onClick: l,
|
|
@@ -2908,21 +2908,21 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2908
2908
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
2909
2909
|
}, "Cancel")
|
|
2910
2910
|
]),
|
|
2911
|
-
default:
|
|
2911
|
+
default: ee(() => [
|
|
2912
2912
|
d("div", is, [
|
|
2913
2913
|
ns,
|
|
2914
2914
|
d("div", os, [
|
|
2915
2915
|
d("h3", as, E(_(a)("New File")), 1),
|
|
2916
2916
|
d("div", ss, [
|
|
2917
2917
|
d("p", ls, E(_(a)("Create a new file")), 1),
|
|
2918
|
-
|
|
2918
|
+
ge(d("input", {
|
|
2919
2919
|
"onUpdate:modelValue": m[0] || (m[0] = (p) => i.value = p),
|
|
2920
|
-
onKeyup:
|
|
2920
|
+
onKeyup: Ke(l, ["enter"]),
|
|
2921
2921
|
class: "px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",
|
|
2922
2922
|
placeholder: _(a)("File Name"),
|
|
2923
2923
|
type: "text"
|
|
2924
2924
|
}, null, 40, cs), [
|
|
2925
|
-
[
|
|
2925
|
+
[Ye, i.value]
|
|
2926
2926
|
])
|
|
2927
2927
|
])
|
|
2928
2928
|
])
|
|
@@ -2944,9 +2944,9 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2944
2944
|
},
|
|
2945
2945
|
emits: ["load"],
|
|
2946
2946
|
setup(o, { emit: e }) {
|
|
2947
|
-
const t = o, n = V(""), a = V(""), i = V(null), l = V(!1), { apiUrl: f } =
|
|
2948
|
-
|
|
2949
|
-
|
|
2947
|
+
const t = o, n = V(""), a = V(""), i = V(null), l = V(!1), { apiUrl: f } = Se(), { t: m } = R("i18n");
|
|
2948
|
+
xe(() => {
|
|
2949
|
+
ht(f.value, {
|
|
2950
2950
|
params: { q: "preview", adapter: t.selection.adapter, path: t.selection.item.path },
|
|
2951
2951
|
json: !1
|
|
2952
2952
|
}).then((v) => {
|
|
@@ -2954,11 +2954,11 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2954
2954
|
});
|
|
2955
2955
|
});
|
|
2956
2956
|
const p = () => {
|
|
2957
|
-
l.value = !l.value, a.value = n.value, l.value == !0 &&
|
|
2957
|
+
l.value = !l.value, a.value = n.value, l.value == !0 && mt(() => {
|
|
2958
2958
|
i.value.focus();
|
|
2959
2959
|
});
|
|
2960
2960
|
}, h = () => {
|
|
2961
|
-
|
|
2961
|
+
ht(f.value, {
|
|
2962
2962
|
method: "POST",
|
|
2963
2963
|
params: { q: "save", adapter: t.selection.adapter, path: t.selection.item.path, content: a.value },
|
|
2964
2964
|
json: !1
|
|
@@ -2966,7 +2966,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2966
2966
|
n.value = v, e("load"), l.value = !l.value;
|
|
2967
2967
|
}).catch((v) => console.log(v.statusText));
|
|
2968
2968
|
};
|
|
2969
|
-
return (v, b) => (x(), C(
|
|
2969
|
+
return (v, b) => (x(), C(se, null, [
|
|
2970
2970
|
d("div", hs, [
|
|
2971
2971
|
d("div", fs, E(o.selection.item.basename), 1),
|
|
2972
2972
|
d("div", ms, [
|
|
@@ -2974,7 +2974,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2974
2974
|
key: 0,
|
|
2975
2975
|
onClick: h,
|
|
2976
2976
|
class: "ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"
|
|
2977
|
-
}, E(_(m)("Save")), 1)) :
|
|
2977
|
+
}, E(_(m)("Save")), 1)) : oe("", !0),
|
|
2978
2978
|
d("button", {
|
|
2979
2979
|
class: "ml-1 px-2 py-1 text-blue-500",
|
|
2980
2980
|
onClick: b[0] || (b[0] = (A) => p())
|
|
@@ -2983,7 +2983,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2983
2983
|
]),
|
|
2984
2984
|
d("div", null, [
|
|
2985
2985
|
l.value ? (x(), C("div", gs, [
|
|
2986
|
-
|
|
2986
|
+
ge(d("textarea", {
|
|
2987
2987
|
ref_key: "editInput",
|
|
2988
2988
|
ref: i,
|
|
2989
2989
|
"onUpdate:modelValue": b[1] || (b[1] = (A) => a.value = A),
|
|
@@ -2993,7 +2993,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
2993
2993
|
cols: "30",
|
|
2994
2994
|
rows: "10"
|
|
2995
2995
|
}, null, 512), [
|
|
2996
|
-
[
|
|
2996
|
+
[Ye, a.value]
|
|
2997
2997
|
])
|
|
2998
2998
|
])) : (x(), C("pre", ps, E(n.value), 1))
|
|
2999
2999
|
])
|
|
@@ -3009,7 +3009,7 @@ const pa = /* @__PURE__ */ d("iframe", {
|
|
|
3009
3009
|
*
|
|
3010
3010
|
* Date: 2021-06-12T08:00:17.411Z
|
|
3011
3011
|
*/
|
|
3012
|
-
function
|
|
3012
|
+
function dr(o, e) {
|
|
3013
3013
|
var t = Object.keys(o);
|
|
3014
3014
|
if (Object.getOwnPropertySymbols) {
|
|
3015
3015
|
var n = Object.getOwnPropertySymbols(o);
|
|
@@ -3019,36 +3019,36 @@ function ur(o, e) {
|
|
|
3019
3019
|
}
|
|
3020
3020
|
return t;
|
|
3021
3021
|
}
|
|
3022
|
-
function
|
|
3022
|
+
function $r(o) {
|
|
3023
3023
|
for (var e = 1; e < arguments.length; e++) {
|
|
3024
3024
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
3025
|
-
e % 2 ?
|
|
3025
|
+
e % 2 ? dr(Object(t), !0).forEach(function(n) {
|
|
3026
3026
|
ws(o, n, t[n]);
|
|
3027
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) :
|
|
3027
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : dr(Object(t)).forEach(function(n) {
|
|
3028
3028
|
Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(t, n));
|
|
3029
3029
|
});
|
|
3030
3030
|
}
|
|
3031
3031
|
return o;
|
|
3032
3032
|
}
|
|
3033
|
-
function
|
|
3034
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ?
|
|
3033
|
+
function ut(o) {
|
|
3034
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? ut = function(e) {
|
|
3035
3035
|
return typeof e;
|
|
3036
|
-
} :
|
|
3036
|
+
} : ut = function(e) {
|
|
3037
3037
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
3038
|
-
},
|
|
3038
|
+
}, ut(o);
|
|
3039
3039
|
}
|
|
3040
3040
|
function bs(o, e) {
|
|
3041
3041
|
if (!(o instanceof e))
|
|
3042
3042
|
throw new TypeError("Cannot call a class as a function");
|
|
3043
3043
|
}
|
|
3044
|
-
function
|
|
3044
|
+
function hr(o, e) {
|
|
3045
3045
|
for (var t = 0; t < e.length; t++) {
|
|
3046
3046
|
var n = e[t];
|
|
3047
3047
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(o, n.key, n);
|
|
3048
3048
|
}
|
|
3049
3049
|
}
|
|
3050
3050
|
function ys(o, e, t) {
|
|
3051
|
-
return e &&
|
|
3051
|
+
return e && hr(o.prototype, e), t && hr(o, t), o;
|
|
3052
3052
|
}
|
|
3053
3053
|
function ws(o, e, t) {
|
|
3054
3054
|
return e in o ? Object.defineProperty(o, e, {
|
|
@@ -3058,12 +3058,12 @@ function ws(o, e, t) {
|
|
|
3058
3058
|
writable: !0
|
|
3059
3059
|
}) : o[e] = t, o;
|
|
3060
3060
|
}
|
|
3061
|
-
function
|
|
3061
|
+
function Er(o) {
|
|
3062
3062
|
return xs(o) || _s(o) || ks(o) || Ss();
|
|
3063
3063
|
}
|
|
3064
3064
|
function xs(o) {
|
|
3065
3065
|
if (Array.isArray(o))
|
|
3066
|
-
return
|
|
3066
|
+
return Ct(o);
|
|
3067
3067
|
}
|
|
3068
3068
|
function _s(o) {
|
|
3069
3069
|
if (typeof Symbol < "u" && o[Symbol.iterator] != null || o["@@iterator"] != null)
|
|
@@ -3072,15 +3072,15 @@ function _s(o) {
|
|
|
3072
3072
|
function ks(o, e) {
|
|
3073
3073
|
if (!!o) {
|
|
3074
3074
|
if (typeof o == "string")
|
|
3075
|
-
return
|
|
3075
|
+
return Ct(o, e);
|
|
3076
3076
|
var t = Object.prototype.toString.call(o).slice(8, -1);
|
|
3077
3077
|
if (t === "Object" && o.constructor && (t = o.constructor.name), t === "Map" || t === "Set")
|
|
3078
3078
|
return Array.from(o);
|
|
3079
3079
|
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
|
|
3080
|
-
return
|
|
3080
|
+
return Ct(o, e);
|
|
3081
3081
|
}
|
|
3082
3082
|
}
|
|
3083
|
-
function
|
|
3083
|
+
function Ct(o, e) {
|
|
3084
3084
|
(e == null || e > o.length) && (e = o.length);
|
|
3085
3085
|
for (var t = 0, n = new Array(e); t < e; t++)
|
|
3086
3086
|
n[t] = o[t];
|
|
@@ -3090,9 +3090,9 @@ function Ss() {
|
|
|
3090
3090
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3091
3091
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
3092
3092
|
}
|
|
3093
|
-
var
|
|
3093
|
+
var pt = typeof window < "u" && typeof window.document < "u", _e = pt ? window : {}, jt = pt && _e.document.documentElement ? "ontouchstart" in _e.document.documentElement : !1, Vt = pt ? "PointerEvent" in _e : !1, J = "cropper", zt = "all", Tr = "crop", Ar = "move", Or = "zoom", Te = "e", Ae = "w", ze = "s", Ce = "n", qe = "ne", Ge = "nw", Je = "se", Ze = "sw", Mt = "".concat(J, "-crop"), fr = "".concat(J, "-disabled"), he = "".concat(J, "-hidden"), mr = "".concat(J, "-hide"), Ds = "".concat(J, "-invisible"), ft = "".concat(J, "-modal"), $t = "".concat(J, "-move"), et = "".concat(J, "Action"), lt = "".concat(J, "Preview"), Bt = "crop", Pr = "move", Ir = "none", Et = "crop", Tt = "cropend", At = "cropmove", Ot = "cropstart", pr = "dblclick", Cs = jt ? "touchstart" : "mousedown", Ms = jt ? "touchmove" : "mousemove", $s = jt ? "touchend touchcancel" : "mouseup", gr = Vt ? "pointerdown" : Cs, vr = Vt ? "pointermove" : Ms, br = Vt ? "pointerup pointercancel" : $s, yr = "ready", wr = "resize", xr = "wheel", Pt = "zoom", _r = "image/jpeg", Es = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/, Ts = /^data:/, As = /^data:image\/jpeg;base64,/, Os = /^img|canvas$/i, Nr = 200, Lr = 100, kr = {
|
|
3094
3094
|
viewMode: 0,
|
|
3095
|
-
dragMode:
|
|
3095
|
+
dragMode: Bt,
|
|
3096
3096
|
initialAspectRatio: NaN,
|
|
3097
3097
|
aspectRatio: NaN,
|
|
3098
3098
|
data: null,
|
|
@@ -3122,80 +3122,80 @@ var mt = typeof window < "u" && typeof window.document < "u", xe = mt ? window :
|
|
|
3122
3122
|
minCanvasHeight: 0,
|
|
3123
3123
|
minCropBoxWidth: 0,
|
|
3124
3124
|
minCropBoxHeight: 0,
|
|
3125
|
-
minContainerWidth:
|
|
3126
|
-
minContainerHeight:
|
|
3125
|
+
minContainerWidth: Nr,
|
|
3126
|
+
minContainerHeight: Lr,
|
|
3127
3127
|
ready: null,
|
|
3128
3128
|
cropstart: null,
|
|
3129
3129
|
cropmove: null,
|
|
3130
3130
|
cropend: null,
|
|
3131
3131
|
crop: null,
|
|
3132
3132
|
zoom: null
|
|
3133
|
-
}, Ps = '<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',
|
|
3134
|
-
function
|
|
3135
|
-
return typeof o == "number" && !
|
|
3133
|
+
}, Ps = '<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>', Is = Number.isNaN || _e.isNaN;
|
|
3134
|
+
function W(o) {
|
|
3135
|
+
return typeof o == "number" && !Is(o);
|
|
3136
3136
|
}
|
|
3137
|
-
var
|
|
3137
|
+
var Sr = function(e) {
|
|
3138
3138
|
return e > 0 && e < 1 / 0;
|
|
3139
3139
|
};
|
|
3140
|
-
function
|
|
3140
|
+
function xt(o) {
|
|
3141
3141
|
return typeof o > "u";
|
|
3142
3142
|
}
|
|
3143
|
-
function
|
|
3144
|
-
return
|
|
3143
|
+
function Pe(o) {
|
|
3144
|
+
return ut(o) === "object" && o !== null;
|
|
3145
3145
|
}
|
|
3146
|
-
var
|
|
3147
|
-
function
|
|
3148
|
-
if (!
|
|
3146
|
+
var Ns = Object.prototype.hasOwnProperty;
|
|
3147
|
+
function Be(o) {
|
|
3148
|
+
if (!Pe(o))
|
|
3149
3149
|
return !1;
|
|
3150
3150
|
try {
|
|
3151
3151
|
var e = o.constructor, t = e.prototype;
|
|
3152
|
-
return e && t &&
|
|
3152
|
+
return e && t && Ns.call(t, "isPrototypeOf");
|
|
3153
3153
|
} catch {
|
|
3154
3154
|
return !1;
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
|
-
function
|
|
3157
|
+
function de(o) {
|
|
3158
3158
|
return typeof o == "function";
|
|
3159
3159
|
}
|
|
3160
|
-
var
|
|
3161
|
-
function
|
|
3162
|
-
return Array.from ? Array.from(o) :
|
|
3160
|
+
var Ls = Array.prototype.slice;
|
|
3161
|
+
function jr(o) {
|
|
3162
|
+
return Array.from ? Array.from(o) : Ls.call(o);
|
|
3163
3163
|
}
|
|
3164
|
-
function
|
|
3165
|
-
return o &&
|
|
3164
|
+
function ie(o, e) {
|
|
3165
|
+
return o && de(e) && (Array.isArray(o) || W(o.length) ? jr(o).forEach(function(t, n) {
|
|
3166
3166
|
e.call(o, t, n, o);
|
|
3167
|
-
}) :
|
|
3167
|
+
}) : Pe(o) && Object.keys(o).forEach(function(t) {
|
|
3168
3168
|
e.call(o, o[t], t, o);
|
|
3169
3169
|
})), o;
|
|
3170
3170
|
}
|
|
3171
|
-
var
|
|
3171
|
+
var Z = Object.assign || function(e) {
|
|
3172
3172
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++)
|
|
3173
3173
|
n[a - 1] = arguments[a];
|
|
3174
|
-
return
|
|
3175
|
-
|
|
3174
|
+
return Pe(e) && n.length > 0 && n.forEach(function(i) {
|
|
3175
|
+
Pe(i) && Object.keys(i).forEach(function(l) {
|
|
3176
3176
|
e[l] = i[l];
|
|
3177
3177
|
});
|
|
3178
3178
|
}), e;
|
|
3179
|
-
},
|
|
3180
|
-
function
|
|
3179
|
+
}, js = /\.\d*(?:0|9){12}\d*$/;
|
|
3180
|
+
function He(o) {
|
|
3181
3181
|
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e11;
|
|
3182
|
-
return
|
|
3182
|
+
return js.test(o) ? Math.round(o * e) / e : o;
|
|
3183
3183
|
}
|
|
3184
3184
|
var Vs = /^width|height|left|top|marginLeft|marginTop$/;
|
|
3185
|
-
function
|
|
3185
|
+
function $e(o, e) {
|
|
3186
3186
|
var t = o.style;
|
|
3187
|
-
|
|
3188
|
-
Vs.test(a) &&
|
|
3187
|
+
ie(e, function(n, a) {
|
|
3188
|
+
Vs.test(a) && W(n) && (n = "".concat(n, "px")), t[a] = n;
|
|
3189
3189
|
});
|
|
3190
3190
|
}
|
|
3191
3191
|
function zs(o, e) {
|
|
3192
3192
|
return o.classList ? o.classList.contains(e) : o.className.indexOf(e) > -1;
|
|
3193
3193
|
}
|
|
3194
|
-
function
|
|
3194
|
+
function ae(o, e) {
|
|
3195
3195
|
if (!!e) {
|
|
3196
|
-
if (
|
|
3197
|
-
|
|
3198
|
-
|
|
3196
|
+
if (W(o.length)) {
|
|
3197
|
+
ie(o, function(n) {
|
|
3198
|
+
ae(n, e);
|
|
3199
3199
|
});
|
|
3200
3200
|
return;
|
|
3201
3201
|
}
|
|
@@ -3207,11 +3207,11 @@ function oe(o, e) {
|
|
|
3207
3207
|
t ? t.indexOf(e) < 0 && (o.className = "".concat(t, " ").concat(e)) : o.className = e;
|
|
3208
3208
|
}
|
|
3209
3209
|
}
|
|
3210
|
-
function
|
|
3210
|
+
function we(o, e) {
|
|
3211
3211
|
if (!!e) {
|
|
3212
|
-
if (
|
|
3213
|
-
|
|
3214
|
-
|
|
3212
|
+
if (W(o.length)) {
|
|
3213
|
+
ie(o, function(t) {
|
|
3214
|
+
we(t, e);
|
|
3215
3215
|
});
|
|
3216
3216
|
return;
|
|
3217
3217
|
}
|
|
@@ -3222,29 +3222,29 @@ function ye(o, e) {
|
|
|
3222
3222
|
o.className.indexOf(e) >= 0 && (o.className = o.className.replace(e, ""));
|
|
3223
3223
|
}
|
|
3224
3224
|
}
|
|
3225
|
-
function
|
|
3225
|
+
function Re(o, e, t) {
|
|
3226
3226
|
if (!!e) {
|
|
3227
|
-
if (
|
|
3228
|
-
|
|
3229
|
-
|
|
3227
|
+
if (W(o.length)) {
|
|
3228
|
+
ie(o, function(n) {
|
|
3229
|
+
Re(n, e, t);
|
|
3230
3230
|
});
|
|
3231
3231
|
return;
|
|
3232
3232
|
}
|
|
3233
|
-
t ?
|
|
3233
|
+
t ? ae(o, e) : we(o, e);
|
|
3234
3234
|
}
|
|
3235
3235
|
}
|
|
3236
3236
|
var Bs = /([a-z\d])([A-Z])/g;
|
|
3237
|
-
function
|
|
3237
|
+
function Rt(o) {
|
|
3238
3238
|
return o.replace(Bs, "$1-$2").toLowerCase();
|
|
3239
3239
|
}
|
|
3240
|
-
function
|
|
3241
|
-
return
|
|
3240
|
+
function It(o, e) {
|
|
3241
|
+
return Pe(o[e]) ? o[e] : o.dataset ? o.dataset[e] : o.getAttribute("data-".concat(Rt(e)));
|
|
3242
3242
|
}
|
|
3243
|
-
function
|
|
3244
|
-
|
|
3243
|
+
function tt(o, e, t) {
|
|
3244
|
+
Pe(t) ? o[e] = t : o.dataset ? o.dataset[e] = t : o.setAttribute("data-".concat(Rt(e)), t);
|
|
3245
3245
|
}
|
|
3246
3246
|
function Rs(o, e) {
|
|
3247
|
-
if (
|
|
3247
|
+
if (Pe(o[e]))
|
|
3248
3248
|
try {
|
|
3249
3249
|
delete o[e];
|
|
3250
3250
|
} catch {
|
|
@@ -3257,11 +3257,11 @@ function Rs(o, e) {
|
|
|
3257
3257
|
o.dataset[e] = void 0;
|
|
3258
3258
|
}
|
|
3259
3259
|
else
|
|
3260
|
-
o.removeAttribute("data-".concat(
|
|
3260
|
+
o.removeAttribute("data-".concat(Rt(e)));
|
|
3261
3261
|
}
|
|
3262
|
-
var
|
|
3262
|
+
var Vr = /\s\s*/, zr = function() {
|
|
3263
3263
|
var o = !1;
|
|
3264
|
-
if (
|
|
3264
|
+
if (pt) {
|
|
3265
3265
|
var e = !1, t = function() {
|
|
3266
3266
|
}, n = Object.defineProperty({}, "once", {
|
|
3267
3267
|
get: function() {
|
|
@@ -3271,24 +3271,24 @@ var Lr = /\s\s*/, Vr = function() {
|
|
|
3271
3271
|
e = i;
|
|
3272
3272
|
}
|
|
3273
3273
|
});
|
|
3274
|
-
|
|
3274
|
+
_e.addEventListener("test", t, n), _e.removeEventListener("test", t, n);
|
|
3275
3275
|
}
|
|
3276
3276
|
return o;
|
|
3277
3277
|
}();
|
|
3278
|
-
function
|
|
3278
|
+
function be(o, e, t) {
|
|
3279
3279
|
var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, a = t;
|
|
3280
|
-
e.trim().split(
|
|
3281
|
-
if (!
|
|
3280
|
+
e.trim().split(Vr).forEach(function(i) {
|
|
3281
|
+
if (!zr) {
|
|
3282
3282
|
var l = o.listeners;
|
|
3283
3283
|
l && l[i] && l[i][t] && (a = l[i][t], delete l[i][t], Object.keys(l[i]).length === 0 && delete l[i], Object.keys(l).length === 0 && delete o.listeners);
|
|
3284
3284
|
}
|
|
3285
3285
|
o.removeEventListener(i, a, n);
|
|
3286
3286
|
});
|
|
3287
3287
|
}
|
|
3288
|
-
function
|
|
3288
|
+
function pe(o, e, t) {
|
|
3289
3289
|
var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, a = t;
|
|
3290
|
-
e.trim().split(
|
|
3291
|
-
if (n.once && !
|
|
3290
|
+
e.trim().split(Vr).forEach(function(i) {
|
|
3291
|
+
if (n.once && !zr) {
|
|
3292
3292
|
var l = o.listeners, f = l === void 0 ? {} : l;
|
|
3293
3293
|
a = function() {
|
|
3294
3294
|
delete f[i][t], o.removeEventListener(i, a, n);
|
|
@@ -3300,33 +3300,33 @@ function me(o, e, t) {
|
|
|
3300
3300
|
o.addEventListener(i, a, n);
|
|
3301
3301
|
});
|
|
3302
3302
|
}
|
|
3303
|
-
function
|
|
3303
|
+
function Ue(o, e, t) {
|
|
3304
3304
|
var n;
|
|
3305
|
-
return
|
|
3305
|
+
return de(Event) && de(CustomEvent) ? n = new CustomEvent(e, {
|
|
3306
3306
|
detail: t,
|
|
3307
3307
|
bubbles: !0,
|
|
3308
3308
|
cancelable: !0
|
|
3309
3309
|
}) : (n = document.createEvent("CustomEvent"), n.initCustomEvent(e, !0, !0, t)), o.dispatchEvent(n);
|
|
3310
3310
|
}
|
|
3311
|
-
function
|
|
3311
|
+
function Br(o) {
|
|
3312
3312
|
var e = o.getBoundingClientRect();
|
|
3313
3313
|
return {
|
|
3314
3314
|
left: e.left + (window.pageXOffset - document.documentElement.clientLeft),
|
|
3315
3315
|
top: e.top + (window.pageYOffset - document.documentElement.clientTop)
|
|
3316
3316
|
};
|
|
3317
3317
|
}
|
|
3318
|
-
var
|
|
3319
|
-
function
|
|
3318
|
+
var _t = _e.location, Hs = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
|
|
3319
|
+
function Dr(o) {
|
|
3320
3320
|
var e = o.match(Hs);
|
|
3321
|
-
return e !== null && (e[1] !==
|
|
3321
|
+
return e !== null && (e[1] !== _t.protocol || e[2] !== _t.hostname || e[3] !== _t.port);
|
|
3322
3322
|
}
|
|
3323
|
-
function
|
|
3323
|
+
function Cr(o) {
|
|
3324
3324
|
var e = "timestamp=".concat(new Date().getTime());
|
|
3325
3325
|
return o + (o.indexOf("?") === -1 ? "?" : "&") + e;
|
|
3326
3326
|
}
|
|
3327
|
-
function
|
|
3327
|
+
function Qe(o) {
|
|
3328
3328
|
var e = o.rotate, t = o.scaleX, n = o.scaleY, a = o.translateX, i = o.translateY, l = [];
|
|
3329
|
-
|
|
3329
|
+
W(a) && a !== 0 && l.push("translateX(".concat(a, "px)")), W(i) && i !== 0 && l.push("translateY(".concat(i, "px)")), W(e) && e !== 0 && l.push("rotate(".concat(e, "deg)")), W(t) && t !== 1 && l.push("scaleX(".concat(t, ")")), W(n) && n !== 1 && l.push("scaleY(".concat(n, ")"));
|
|
3330
3330
|
var f = l.length ? l.join(" ") : "none";
|
|
3331
3331
|
return {
|
|
3332
3332
|
WebkitTransform: f,
|
|
@@ -3335,27 +3335,27 @@ function Ze(o) {
|
|
|
3335
3335
|
};
|
|
3336
3336
|
}
|
|
3337
3337
|
function Us(o) {
|
|
3338
|
-
var e =
|
|
3339
|
-
return
|
|
3340
|
-
delete e[a],
|
|
3338
|
+
var e = $r({}, o), t = 0;
|
|
3339
|
+
return ie(o, function(n, a) {
|
|
3340
|
+
delete e[a], ie(e, function(i) {
|
|
3341
3341
|
var l = Math.abs(n.startX - i.startX), f = Math.abs(n.startY - i.startY), m = Math.abs(n.endX - i.endX), p = Math.abs(n.endY - i.endY), h = Math.sqrt(l * l + f * f), v = Math.sqrt(m * m + p * p), b = (v - h) / h;
|
|
3342
3342
|
Math.abs(b) > Math.abs(t) && (t = b);
|
|
3343
3343
|
});
|
|
3344
3344
|
}), t;
|
|
3345
3345
|
}
|
|
3346
|
-
function
|
|
3346
|
+
function ct(o, e) {
|
|
3347
3347
|
var t = o.pageX, n = o.pageY, a = {
|
|
3348
3348
|
endX: t,
|
|
3349
3349
|
endY: n
|
|
3350
3350
|
};
|
|
3351
|
-
return e ? a :
|
|
3351
|
+
return e ? a : $r({
|
|
3352
3352
|
startX: t,
|
|
3353
3353
|
startY: n
|
|
3354
3354
|
}, a);
|
|
3355
3355
|
}
|
|
3356
3356
|
function Ks(o) {
|
|
3357
3357
|
var e = 0, t = 0, n = 0;
|
|
3358
|
-
return
|
|
3358
|
+
return ie(o, function(a) {
|
|
3359
3359
|
var i = a.startX, l = a.startY;
|
|
3360
3360
|
e += i, t += l, n += 1;
|
|
3361
3361
|
}), e /= n, t /= n, {
|
|
@@ -3363,8 +3363,8 @@ function Ks(o) {
|
|
|
3363
3363
|
pageY: t
|
|
3364
3364
|
};
|
|
3365
3365
|
}
|
|
3366
|
-
function
|
|
3367
|
-
var e = o.aspectRatio, t = o.height, n = o.width, a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "contain", i =
|
|
3366
|
+
function Ee(o) {
|
|
3367
|
+
var e = o.aspectRatio, t = o.height, n = o.width, a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "contain", i = Sr(n), l = Sr(t);
|
|
3368
3368
|
if (i && l) {
|
|
3369
3369
|
var f = t * e;
|
|
3370
3370
|
a === "contain" && f > n || a === "cover" && f < n ? t = n / e : n = t * e;
|
|
@@ -3392,45 +3392,45 @@ function Ys(o) {
|
|
|
3392
3392
|
};
|
|
3393
3393
|
}
|
|
3394
3394
|
function Ws(o, e, t, n) {
|
|
3395
|
-
var a = e.aspectRatio, i = e.naturalWidth, l = e.naturalHeight, f = e.rotate, m = f === void 0 ? 0 : f, p = e.scaleX, h = p === void 0 ? 1 : p, v = e.scaleY, b = v === void 0 ? 1 : v, A = t.aspectRatio, M = t.naturalWidth, T = t.naturalHeight,
|
|
3395
|
+
var a = e.aspectRatio, i = e.naturalWidth, l = e.naturalHeight, f = e.rotate, m = f === void 0 ? 0 : f, p = e.scaleX, h = p === void 0 ? 1 : p, v = e.scaleY, b = v === void 0 ? 1 : v, A = t.aspectRatio, M = t.naturalWidth, T = t.naturalHeight, L = n.fillColor, z = L === void 0 ? "transparent" : L, B = n.imageSmoothingEnabled, P = B === void 0 ? !0 : B, ne = n.imageSmoothingQuality, F = ne === void 0 ? "low" : ne, D = n.maxWidth, X = D === void 0 ? 1 / 0 : D, q = n.maxHeight, le = q === void 0 ? 1 / 0 : q, fe = n.minWidth, N = fe === void 0 ? 0 : fe, U = n.minHeight, I = U === void 0 ? 0 : U, Y = document.createElement("canvas"), H = Y.getContext("2d"), te = Ee({
|
|
3396
3396
|
aspectRatio: A,
|
|
3397
|
-
width:
|
|
3398
|
-
height:
|
|
3399
|
-
}),
|
|
3397
|
+
width: X,
|
|
3398
|
+
height: le
|
|
3399
|
+
}), G = Ee({
|
|
3400
3400
|
aspectRatio: A,
|
|
3401
|
-
width:
|
|
3402
|
-
height:
|
|
3403
|
-
}, "cover"),
|
|
3401
|
+
width: N,
|
|
3402
|
+
height: I
|
|
3403
|
+
}, "cover"), We = Math.min(te.width, Math.max(G.width, M)), Xe = Math.min(te.height, Math.max(G.height, T)), rt = Ee({
|
|
3404
3404
|
aspectRatio: a,
|
|
3405
|
-
width:
|
|
3406
|
-
height:
|
|
3407
|
-
}),
|
|
3405
|
+
width: X,
|
|
3406
|
+
height: le
|
|
3407
|
+
}), it = Ee({
|
|
3408
3408
|
aspectRatio: a,
|
|
3409
|
-
width:
|
|
3410
|
-
height:
|
|
3411
|
-
}, "cover"),
|
|
3412
|
-
return
|
|
3413
|
-
return Math.floor(
|
|
3414
|
-
})))),
|
|
3409
|
+
width: N,
|
|
3410
|
+
height: I
|
|
3411
|
+
}, "cover"), nt = Math.min(rt.width, Math.max(it.width, i)), Ne = Math.min(rt.height, Math.max(it.height, l)), gt = [-nt / 2, -Ne / 2, nt, Ne];
|
|
3412
|
+
return Y.width = He(We), Y.height = He(Xe), H.fillStyle = z, H.fillRect(0, 0, We, Xe), H.save(), H.translate(We / 2, Xe / 2), H.rotate(m * Math.PI / 180), H.scale(h, b), H.imageSmoothingEnabled = P, H.imageSmoothingQuality = F, H.drawImage.apply(H, [o].concat(Er(gt.map(function(Le) {
|
|
3413
|
+
return Math.floor(He(Le));
|
|
3414
|
+
})))), H.restore(), Y;
|
|
3415
3415
|
}
|
|
3416
|
-
var
|
|
3416
|
+
var Rr = String.fromCharCode;
|
|
3417
3417
|
function Xs(o, e, t) {
|
|
3418
3418
|
var n = "";
|
|
3419
3419
|
t += e;
|
|
3420
3420
|
for (var a = e; a < t; a += 1)
|
|
3421
|
-
n +=
|
|
3421
|
+
n += Rr(o.getUint8(a));
|
|
3422
3422
|
return n;
|
|
3423
3423
|
}
|
|
3424
3424
|
var Fs = /^data:.*,/;
|
|
3425
3425
|
function qs(o) {
|
|
3426
3426
|
var e = o.replace(Fs, ""), t = atob(e), n = new ArrayBuffer(t.length), a = new Uint8Array(n);
|
|
3427
|
-
return
|
|
3427
|
+
return ie(a, function(i, l) {
|
|
3428
3428
|
a[l] = t.charCodeAt(l);
|
|
3429
3429
|
}), n;
|
|
3430
3430
|
}
|
|
3431
3431
|
function Gs(o, e) {
|
|
3432
3432
|
for (var t = [], n = 8192, a = new Uint8Array(o); a.length > 0; )
|
|
3433
|
-
t.push(
|
|
3433
|
+
t.push(Rr.apply(null, jr(a.subarray(0, n)))), a = a.subarray(n);
|
|
3434
3434
|
return "data:".concat(e, ";base64,").concat(btoa(t.join("")));
|
|
3435
3435
|
}
|
|
3436
3436
|
function Js(o) {
|
|
@@ -3505,15 +3505,15 @@ var Qs = {
|
|
|
3505
3505
|
},
|
|
3506
3506
|
initContainer: function() {
|
|
3507
3507
|
var e = this.element, t = this.options, n = this.container, a = this.cropper, i = Number(t.minContainerWidth), l = Number(t.minContainerHeight);
|
|
3508
|
-
|
|
3508
|
+
ae(a, he), we(e, he);
|
|
3509
3509
|
var f = {
|
|
3510
|
-
width: Math.max(n.offsetWidth, i >= 0 ? i :
|
|
3511
|
-
height: Math.max(n.offsetHeight, l >= 0 ? l :
|
|
3510
|
+
width: Math.max(n.offsetWidth, i >= 0 ? i : Nr),
|
|
3511
|
+
height: Math.max(n.offsetHeight, l >= 0 ? l : Lr)
|
|
3512
3512
|
};
|
|
3513
|
-
this.containerData = f,
|
|
3513
|
+
this.containerData = f, $e(a, {
|
|
3514
3514
|
width: f.width,
|
|
3515
3515
|
height: f.height
|
|
3516
|
-
}),
|
|
3516
|
+
}), ae(e, he), we(a, he);
|
|
3517
3517
|
},
|
|
3518
3518
|
initCanvas: function() {
|
|
3519
3519
|
var e = this.containerData, t = this.imageData, n = this.options.viewMode, a = Math.abs(t.rotate) % 180 === 90, i = a ? t.naturalHeight : t.naturalWidth, l = a ? t.naturalWidth : t.naturalHeight, f = i / l, m = e.width, p = e.height;
|
|
@@ -3525,14 +3525,14 @@ var Qs = {
|
|
|
3525
3525
|
width: m,
|
|
3526
3526
|
height: p
|
|
3527
3527
|
};
|
|
3528
|
-
this.canvasData = h, this.limited = n === 1 || n === 2, this.limitCanvas(!0, !0), h.width = Math.min(Math.max(h.width, h.minWidth), h.maxWidth), h.height = Math.min(Math.max(h.height, h.minHeight), h.maxHeight), h.left = (e.width - h.width) / 2, h.top = (e.height - h.height) / 2, h.oldLeft = h.left, h.oldTop = h.top, this.initialCanvasData =
|
|
3528
|
+
this.canvasData = h, this.limited = n === 1 || n === 2, this.limitCanvas(!0, !0), h.width = Math.min(Math.max(h.width, h.minWidth), h.maxWidth), h.height = Math.min(Math.max(h.height, h.minHeight), h.maxHeight), h.left = (e.width - h.width) / 2, h.top = (e.height - h.height) / 2, h.oldLeft = h.left, h.oldTop = h.top, this.initialCanvasData = Z({}, h);
|
|
3529
3529
|
},
|
|
3530
3530
|
limitCanvas: function(e, t) {
|
|
3531
3531
|
var n = this.options, a = this.containerData, i = this.canvasData, l = this.cropBoxData, f = n.viewMode, m = i.aspectRatio, p = this.cropped && l;
|
|
3532
3532
|
if (e) {
|
|
3533
3533
|
var h = Number(n.minCanvasWidth) || 0, v = Number(n.minCanvasHeight) || 0;
|
|
3534
3534
|
f > 1 ? (h = Math.max(h, a.width), v = Math.max(v, a.height), f === 3 && (v * m > h ? h = v * m : v = h / m)) : f > 0 && (h ? h = Math.max(h, p ? l.width : 0) : v ? v = Math.max(v, p ? l.height : 0) : p && (h = l.width, v = l.height, v * m > h ? h = v * m : v = h / m));
|
|
3535
|
-
var b =
|
|
3535
|
+
var b = Ee({
|
|
3536
3536
|
aspectRatio: m,
|
|
3537
3537
|
width: h,
|
|
3538
3538
|
height: v
|
|
@@ -3556,25 +3556,25 @@ var Qs = {
|
|
|
3556
3556
|
}), l = i.width, f = i.height, m = n.width * (l / n.naturalWidth), p = n.height * (f / n.naturalHeight);
|
|
3557
3557
|
n.left -= (m - n.width) / 2, n.top -= (p - n.height) / 2, n.width = m, n.height = p, n.aspectRatio = l / f, n.naturalWidth = l, n.naturalHeight = f, this.limitCanvas(!0, !1);
|
|
3558
3558
|
}
|
|
3559
|
-
(n.width > n.maxWidth || n.width < n.minWidth) && (n.left = n.oldLeft), (n.height > n.maxHeight || n.height < n.minHeight) && (n.top = n.oldTop), n.width = Math.min(Math.max(n.width, n.minWidth), n.maxWidth), n.height = Math.min(Math.max(n.height, n.minHeight), n.maxHeight), this.limitCanvas(!1, !0), n.left = Math.min(Math.max(n.left, n.minLeft), n.maxLeft), n.top = Math.min(Math.max(n.top, n.minTop), n.maxTop), n.oldLeft = n.left, n.oldTop = n.top,
|
|
3559
|
+
(n.width > n.maxWidth || n.width < n.minWidth) && (n.left = n.oldLeft), (n.height > n.maxHeight || n.height < n.minHeight) && (n.top = n.oldTop), n.width = Math.min(Math.max(n.width, n.minWidth), n.maxWidth), n.height = Math.min(Math.max(n.height, n.minHeight), n.maxHeight), this.limitCanvas(!1, !0), n.left = Math.min(Math.max(n.left, n.minLeft), n.maxLeft), n.top = Math.min(Math.max(n.top, n.minTop), n.maxTop), n.oldLeft = n.left, n.oldTop = n.top, $e(this.canvas, Z({
|
|
3560
3560
|
width: n.width,
|
|
3561
3561
|
height: n.height
|
|
3562
|
-
},
|
|
3562
|
+
}, Qe({
|
|
3563
3563
|
translateX: n.left,
|
|
3564
3564
|
translateY: n.top
|
|
3565
3565
|
}))), this.renderImage(e), this.cropped && this.limited && this.limitCropBox(!0, !0);
|
|
3566
3566
|
},
|
|
3567
3567
|
renderImage: function(e) {
|
|
3568
3568
|
var t = this.canvasData, n = this.imageData, a = n.naturalWidth * (t.width / t.naturalWidth), i = n.naturalHeight * (t.height / t.naturalHeight);
|
|
3569
|
-
|
|
3569
|
+
Z(n, {
|
|
3570
3570
|
width: a,
|
|
3571
3571
|
height: i,
|
|
3572
3572
|
left: (t.width - a) / 2,
|
|
3573
3573
|
top: (t.height - i) / 2
|
|
3574
|
-
}),
|
|
3574
|
+
}), $e(this.image, Z({
|
|
3575
3575
|
width: n.width,
|
|
3576
3576
|
height: n.height
|
|
3577
|
-
},
|
|
3577
|
+
}, Qe(Z({
|
|
3578
3578
|
translateX: n.left,
|
|
3579
3579
|
translateY: n.top
|
|
3580
3580
|
}, n)))), e && this.output();
|
|
@@ -3584,7 +3584,7 @@ var Qs = {
|
|
|
3584
3584
|
width: t.width,
|
|
3585
3585
|
height: t.height
|
|
3586
3586
|
};
|
|
3587
|
-
n && (t.height * n > t.width ? i.height = i.width / n : i.width = i.height * n), this.cropBoxData = i, this.limitCropBox(!0, !0), i.width = Math.min(Math.max(i.width, i.minWidth), i.maxWidth), i.height = Math.min(Math.max(i.height, i.minHeight), i.maxHeight), i.width = Math.max(i.minWidth, i.width * a), i.height = Math.max(i.minHeight, i.height * a), i.left = t.left + (t.width - i.width) / 2, i.top = t.top + (t.height - i.height) / 2, i.oldLeft = i.left, i.oldTop = i.top, this.initialCropBoxData =
|
|
3587
|
+
n && (t.height * n > t.width ? i.height = i.width / n : i.width = i.height * n), this.cropBoxData = i, this.limitCropBox(!0, !0), i.width = Math.min(Math.max(i.width, i.minWidth), i.maxWidth), i.height = Math.min(Math.max(i.height, i.minHeight), i.maxHeight), i.width = Math.max(i.minWidth, i.width * a), i.height = Math.max(i.minHeight, i.height * a), i.left = t.left + (t.width - i.width) / 2, i.top = t.top + (t.height - i.height) / 2, i.oldLeft = i.left, i.oldTop = i.top, this.initialCropBoxData = Z({}, i);
|
|
3588
3588
|
},
|
|
3589
3589
|
limitCropBox: function(e, t) {
|
|
3590
3590
|
var n = this.options, a = this.containerData, i = this.canvasData, l = this.cropBoxData, f = this.limited, m = n.aspectRatio;
|
|
@@ -3596,25 +3596,25 @@ var Qs = {
|
|
|
3596
3596
|
},
|
|
3597
3597
|
renderCropBox: function() {
|
|
3598
3598
|
var e = this.options, t = this.containerData, n = this.cropBoxData;
|
|
3599
|
-
(n.width > n.maxWidth || n.width < n.minWidth) && (n.left = n.oldLeft), (n.height > n.maxHeight || n.height < n.minHeight) && (n.top = n.oldTop), n.width = Math.min(Math.max(n.width, n.minWidth), n.maxWidth), n.height = Math.min(Math.max(n.height, n.minHeight), n.maxHeight), this.limitCropBox(!1, !0), n.left = Math.min(Math.max(n.left, n.minLeft), n.maxLeft), n.top = Math.min(Math.max(n.top, n.minTop), n.maxTop), n.oldLeft = n.left, n.oldTop = n.top, e.movable && e.cropBoxMovable &&
|
|
3599
|
+
(n.width > n.maxWidth || n.width < n.minWidth) && (n.left = n.oldLeft), (n.height > n.maxHeight || n.height < n.minHeight) && (n.top = n.oldTop), n.width = Math.min(Math.max(n.width, n.minWidth), n.maxWidth), n.height = Math.min(Math.max(n.height, n.minHeight), n.maxHeight), this.limitCropBox(!1, !0), n.left = Math.min(Math.max(n.left, n.minLeft), n.maxLeft), n.top = Math.min(Math.max(n.top, n.minTop), n.maxTop), n.oldLeft = n.left, n.oldTop = n.top, e.movable && e.cropBoxMovable && tt(this.face, et, n.width >= t.width && n.height >= t.height ? Ar : zt), $e(this.cropBox, Z({
|
|
3600
3600
|
width: n.width,
|
|
3601
3601
|
height: n.height
|
|
3602
|
-
},
|
|
3602
|
+
}, Qe({
|
|
3603
3603
|
translateX: n.left,
|
|
3604
3604
|
translateY: n.top
|
|
3605
3605
|
}))), this.cropped && this.limited && this.limitCanvas(!0, !0), this.disabled || this.output();
|
|
3606
3606
|
},
|
|
3607
3607
|
output: function() {
|
|
3608
|
-
this.preview(),
|
|
3608
|
+
this.preview(), Ue(this.element, Et, this.getData());
|
|
3609
3609
|
}
|
|
3610
3610
|
}, el = {
|
|
3611
3611
|
initPreview: function() {
|
|
3612
3612
|
var e = this.element, t = this.crossOrigin, n = this.options.preview, a = t ? this.crossOriginUrl : this.url, i = e.alt || "The image to preview", l = document.createElement("img");
|
|
3613
3613
|
if (t && (l.crossOrigin = t), l.src = a, l.alt = i, this.viewBox.appendChild(l), this.viewBoxImage = l, !!n) {
|
|
3614
3614
|
var f = n;
|
|
3615
|
-
typeof n == "string" ? f = e.ownerDocument.querySelectorAll(n) : n.querySelector && (f = [n]), this.previews = f,
|
|
3615
|
+
typeof n == "string" ? f = e.ownerDocument.querySelectorAll(n) : n.querySelector && (f = [n]), this.previews = f, ie(f, function(m) {
|
|
3616
3616
|
var p = document.createElement("img");
|
|
3617
|
-
|
|
3617
|
+
tt(m, lt, {
|
|
3618
3618
|
width: m.offsetWidth,
|
|
3619
3619
|
height: m.offsetHeight,
|
|
3620
3620
|
html: m.innerHTML
|
|
@@ -3623,50 +3623,50 @@ var Qs = {
|
|
|
3623
3623
|
}
|
|
3624
3624
|
},
|
|
3625
3625
|
resetPreview: function() {
|
|
3626
|
-
|
|
3627
|
-
var t =
|
|
3628
|
-
|
|
3626
|
+
ie(this.previews, function(e) {
|
|
3627
|
+
var t = It(e, lt);
|
|
3628
|
+
$e(e, {
|
|
3629
3629
|
width: t.width,
|
|
3630
3630
|
height: t.height
|
|
3631
|
-
}), e.innerHTML = t.html, Rs(e,
|
|
3631
|
+
}), e.innerHTML = t.html, Rs(e, lt);
|
|
3632
3632
|
});
|
|
3633
3633
|
},
|
|
3634
3634
|
preview: function() {
|
|
3635
3635
|
var e = this.imageData, t = this.canvasData, n = this.cropBoxData, a = n.width, i = n.height, l = e.width, f = e.height, m = n.left - t.left - e.left, p = n.top - t.top - e.top;
|
|
3636
|
-
!this.cropped || this.disabled || (
|
|
3636
|
+
!this.cropped || this.disabled || ($e(this.viewBoxImage, Z({
|
|
3637
3637
|
width: l,
|
|
3638
3638
|
height: f
|
|
3639
|
-
},
|
|
3639
|
+
}, Qe(Z({
|
|
3640
3640
|
translateX: -m,
|
|
3641
3641
|
translateY: -p
|
|
3642
|
-
}, e)))),
|
|
3643
|
-
var v =
|
|
3644
|
-
a && (
|
|
3642
|
+
}, e)))), ie(this.previews, function(h) {
|
|
3643
|
+
var v = It(h, lt), b = v.width, A = v.height, M = b, T = A, L = 1;
|
|
3644
|
+
a && (L = b / a, T = i * L), i && T > A && (L = A / i, M = a * L, T = A), $e(h, {
|
|
3645
3645
|
width: M,
|
|
3646
3646
|
height: T
|
|
3647
|
-
}),
|
|
3648
|
-
width: l *
|
|
3649
|
-
height: f *
|
|
3650
|
-
},
|
|
3651
|
-
translateX: -m *
|
|
3652
|
-
translateY: -p *
|
|
3647
|
+
}), $e(h.getElementsByTagName("img")[0], Z({
|
|
3648
|
+
width: l * L,
|
|
3649
|
+
height: f * L
|
|
3650
|
+
}, Qe(Z({
|
|
3651
|
+
translateX: -m * L,
|
|
3652
|
+
translateY: -p * L
|
|
3653
3653
|
}, e))));
|
|
3654
3654
|
}));
|
|
3655
3655
|
}
|
|
3656
3656
|
}, tl = {
|
|
3657
3657
|
bind: function() {
|
|
3658
3658
|
var e = this.element, t = this.options, n = this.cropper;
|
|
3659
|
-
|
|
3659
|
+
de(t.cropstart) && pe(e, Ot, t.cropstart), de(t.cropmove) && pe(e, At, t.cropmove), de(t.cropend) && pe(e, Tt, t.cropend), de(t.crop) && pe(e, Et, t.crop), de(t.zoom) && pe(e, Pt, t.zoom), pe(n, gr, this.onCropStart = this.cropStart.bind(this)), t.zoomable && t.zoomOnWheel && pe(n, xr, this.onWheel = this.wheel.bind(this), {
|
|
3660
3660
|
passive: !1,
|
|
3661
3661
|
capture: !0
|
|
3662
|
-
}), t.toggleDragModeOnDblclick &&
|
|
3662
|
+
}), t.toggleDragModeOnDblclick && pe(n, pr, this.onDblclick = this.dblclick.bind(this)), pe(e.ownerDocument, vr, this.onCropMove = this.cropMove.bind(this)), pe(e.ownerDocument, br, this.onCropEnd = this.cropEnd.bind(this)), t.responsive && pe(window, wr, this.onResize = this.resize.bind(this));
|
|
3663
3663
|
},
|
|
3664
3664
|
unbind: function() {
|
|
3665
3665
|
var e = this.element, t = this.options, n = this.cropper;
|
|
3666
|
-
|
|
3666
|
+
de(t.cropstart) && be(e, Ot, t.cropstart), de(t.cropmove) && be(e, At, t.cropmove), de(t.cropend) && be(e, Tt, t.cropend), de(t.crop) && be(e, Et, t.crop), de(t.zoom) && be(e, Pt, t.zoom), be(n, gr, this.onCropStart), t.zoomable && t.zoomOnWheel && be(n, xr, this.onWheel, {
|
|
3667
3667
|
passive: !1,
|
|
3668
3668
|
capture: !0
|
|
3669
|
-
}), t.toggleDragModeOnDblclick &&
|
|
3669
|
+
}), t.toggleDragModeOnDblclick && be(n, pr, this.onDblclick), be(e.ownerDocument, vr, this.onCropMove), be(e.ownerDocument, br, this.onCropEnd), t.responsive && be(window, wr, this.onResize);
|
|
3670
3670
|
}
|
|
3671
3671
|
}, rl = {
|
|
3672
3672
|
resize: function() {
|
|
@@ -3674,16 +3674,16 @@ var Qs = {
|
|
|
3674
3674
|
var e = this.options, t = this.container, n = this.containerData, a = t.offsetWidth / n.width, i = t.offsetHeight / n.height, l = Math.abs(a - 1) > Math.abs(i - 1) ? a : i;
|
|
3675
3675
|
if (l !== 1) {
|
|
3676
3676
|
var f, m;
|
|
3677
|
-
e.restore && (f = this.getCanvasData(), m = this.getCropBoxData()), this.render(), e.restore && (this.setCanvasData(
|
|
3677
|
+
e.restore && (f = this.getCanvasData(), m = this.getCropBoxData()), this.render(), e.restore && (this.setCanvasData(ie(f, function(p, h) {
|
|
3678
3678
|
f[h] = p * l;
|
|
3679
|
-
})), this.setCropBoxData(
|
|
3679
|
+
})), this.setCropBoxData(ie(m, function(p, h) {
|
|
3680
3680
|
m[h] = p * l;
|
|
3681
3681
|
})));
|
|
3682
3682
|
}
|
|
3683
3683
|
}
|
|
3684
3684
|
},
|
|
3685
3685
|
dblclick: function() {
|
|
3686
|
-
this.disabled || this.options.dragMode ===
|
|
3686
|
+
this.disabled || this.options.dragMode === Ir || this.setDragMode(zs(this.dragBox, Mt) ? Pr : Bt);
|
|
3687
3687
|
},
|
|
3688
3688
|
wheel: function(e) {
|
|
3689
3689
|
var t = this, n = Number(this.options.wheelZoomRatio) || 0.1, a = 1;
|
|
@@ -3693,34 +3693,34 @@ var Qs = {
|
|
|
3693
3693
|
},
|
|
3694
3694
|
cropStart: function(e) {
|
|
3695
3695
|
var t = e.buttons, n = e.button;
|
|
3696
|
-
if (!(this.disabled || (e.type === "mousedown" || e.type === "pointerdown" && e.pointerType === "mouse") && (
|
|
3696
|
+
if (!(this.disabled || (e.type === "mousedown" || e.type === "pointerdown" && e.pointerType === "mouse") && (W(t) && t !== 1 || W(n) && n !== 0 || e.ctrlKey))) {
|
|
3697
3697
|
var a = this.options, i = this.pointers, l;
|
|
3698
|
-
e.changedTouches ?
|
|
3699
|
-
i[f.identifier] =
|
|
3700
|
-
}) : i[e.pointerId || 0] =
|
|
3698
|
+
e.changedTouches ? ie(e.changedTouches, function(f) {
|
|
3699
|
+
i[f.identifier] = ct(f);
|
|
3700
|
+
}) : i[e.pointerId || 0] = ct(e), Object.keys(i).length > 1 && a.zoomable && a.zoomOnTouch ? l = Or : l = It(e.target, et), !!Es.test(l) && Ue(this.element, Ot, {
|
|
3701
3701
|
originalEvent: e,
|
|
3702
3702
|
action: l
|
|
3703
|
-
}) !== !1 && (e.preventDefault(), this.action = l, this.cropping = !1, l ===
|
|
3703
|
+
}) !== !1 && (e.preventDefault(), this.action = l, this.cropping = !1, l === Tr && (this.cropping = !0, ae(this.dragBox, ft)));
|
|
3704
3704
|
}
|
|
3705
3705
|
},
|
|
3706
3706
|
cropMove: function(e) {
|
|
3707
3707
|
var t = this.action;
|
|
3708
3708
|
if (!(this.disabled || !t)) {
|
|
3709
3709
|
var n = this.pointers;
|
|
3710
|
-
e.preventDefault(),
|
|
3710
|
+
e.preventDefault(), Ue(this.element, At, {
|
|
3711
3711
|
originalEvent: e,
|
|
3712
3712
|
action: t
|
|
3713
|
-
}) !== !1 && (e.changedTouches ?
|
|
3714
|
-
|
|
3715
|
-
}) :
|
|
3713
|
+
}) !== !1 && (e.changedTouches ? ie(e.changedTouches, function(a) {
|
|
3714
|
+
Z(n[a.identifier] || {}, ct(a, !0));
|
|
3715
|
+
}) : Z(n[e.pointerId || 0] || {}, ct(e, !0)), this.change(e));
|
|
3716
3716
|
}
|
|
3717
3717
|
},
|
|
3718
3718
|
cropEnd: function(e) {
|
|
3719
3719
|
if (!this.disabled) {
|
|
3720
3720
|
var t = this.action, n = this.pointers;
|
|
3721
|
-
e.changedTouches ?
|
|
3721
|
+
e.changedTouches ? ie(e.changedTouches, function(a) {
|
|
3722
3722
|
delete n[a.identifier];
|
|
3723
|
-
}) : delete n[e.pointerId || 0], t && (e.preventDefault(), Object.keys(n).length || (this.action = ""), this.cropping && (this.cropping = !1,
|
|
3723
|
+
}) : delete n[e.pointerId || 0], t && (e.preventDefault(), Object.keys(n).length || (this.action = ""), this.cropping && (this.cropping = !1, Re(this.dragBox, ft, this.cropped && this.options.modal)), Ue(this.element, Tt, {
|
|
3724
3724
|
originalEvent: e,
|
|
3725
3725
|
action: t
|
|
3726
3726
|
}));
|
|
@@ -3728,159 +3728,159 @@ var Qs = {
|
|
|
3728
3728
|
}
|
|
3729
3729
|
}, il = {
|
|
3730
3730
|
change: function(e) {
|
|
3731
|
-
var t = this.options, n = this.canvasData, a = this.containerData, i = this.cropBoxData, l = this.pointers, f = this.action, m = t.aspectRatio, p = i.left, h = i.top, v = i.width, b = i.height, A = p + v, M = h + b, T = 0,
|
|
3732
|
-
!m && e.shiftKey && (m = v && b ? v / b : 1), this.limited && (T = i.minLeft,
|
|
3733
|
-
var
|
|
3734
|
-
x:
|
|
3735
|
-
y:
|
|
3736
|
-
},
|
|
3737
|
-
switch (
|
|
3738
|
-
case
|
|
3731
|
+
var t = this.options, n = this.canvasData, a = this.containerData, i = this.cropBoxData, l = this.pointers, f = this.action, m = t.aspectRatio, p = i.left, h = i.top, v = i.width, b = i.height, A = p + v, M = h + b, T = 0, L = 0, z = a.width, B = a.height, P = !0, ne;
|
|
3732
|
+
!m && e.shiftKey && (m = v && b ? v / b : 1), this.limited && (T = i.minLeft, L = i.minTop, z = T + Math.min(a.width, n.width, n.left + n.width), B = L + Math.min(a.height, n.height, n.top + n.height));
|
|
3733
|
+
var F = l[Object.keys(l)[0]], D = {
|
|
3734
|
+
x: F.endX - F.startX,
|
|
3735
|
+
y: F.endY - F.startY
|
|
3736
|
+
}, X = function(le) {
|
|
3737
|
+
switch (le) {
|
|
3738
|
+
case Te:
|
|
3739
3739
|
A + D.x > z && (D.x = z - A);
|
|
3740
3740
|
break;
|
|
3741
|
-
case
|
|
3741
|
+
case Ae:
|
|
3742
3742
|
p + D.x < T && (D.x = T - p);
|
|
3743
3743
|
break;
|
|
3744
|
-
case
|
|
3745
|
-
h + D.y <
|
|
3744
|
+
case Ce:
|
|
3745
|
+
h + D.y < L && (D.y = L - h);
|
|
3746
3746
|
break;
|
|
3747
|
-
case
|
|
3747
|
+
case ze:
|
|
3748
3748
|
M + D.y > B && (D.y = B - M);
|
|
3749
3749
|
break;
|
|
3750
3750
|
}
|
|
3751
3751
|
};
|
|
3752
3752
|
switch (f) {
|
|
3753
|
-
case
|
|
3753
|
+
case zt:
|
|
3754
3754
|
p += D.x, h += D.y;
|
|
3755
3755
|
break;
|
|
3756
|
-
case
|
|
3757
|
-
if (D.x >= 0 && (A >= z || m && (h <=
|
|
3756
|
+
case Te:
|
|
3757
|
+
if (D.x >= 0 && (A >= z || m && (h <= L || M >= B))) {
|
|
3758
3758
|
P = !1;
|
|
3759
3759
|
break;
|
|
3760
3760
|
}
|
|
3761
|
-
|
|
3761
|
+
X(Te), v += D.x, v < 0 && (f = Ae, v = -v, p -= v), m && (b = v / m, h += (i.height - b) / 2);
|
|
3762
3762
|
break;
|
|
3763
|
-
case
|
|
3764
|
-
if (D.y <= 0 && (h <=
|
|
3763
|
+
case Ce:
|
|
3764
|
+
if (D.y <= 0 && (h <= L || m && (p <= T || A >= z))) {
|
|
3765
3765
|
P = !1;
|
|
3766
3766
|
break;
|
|
3767
3767
|
}
|
|
3768
|
-
|
|
3768
|
+
X(Ce), b -= D.y, h += D.y, b < 0 && (f = ze, b = -b, h -= b), m && (v = b * m, p += (i.width - v) / 2);
|
|
3769
3769
|
break;
|
|
3770
|
-
case
|
|
3771
|
-
if (D.x <= 0 && (p <= T || m && (h <=
|
|
3770
|
+
case Ae:
|
|
3771
|
+
if (D.x <= 0 && (p <= T || m && (h <= L || M >= B))) {
|
|
3772
3772
|
P = !1;
|
|
3773
3773
|
break;
|
|
3774
3774
|
}
|
|
3775
|
-
|
|
3775
|
+
X(Ae), v -= D.x, p += D.x, v < 0 && (f = Te, v = -v, p -= v), m && (b = v / m, h += (i.height - b) / 2);
|
|
3776
3776
|
break;
|
|
3777
|
-
case
|
|
3777
|
+
case ze:
|
|
3778
3778
|
if (D.y >= 0 && (M >= B || m && (p <= T || A >= z))) {
|
|
3779
3779
|
P = !1;
|
|
3780
3780
|
break;
|
|
3781
3781
|
}
|
|
3782
|
-
|
|
3782
|
+
X(ze), b += D.y, b < 0 && (f = Ce, b = -b, h -= b), m && (v = b * m, p += (i.width - v) / 2);
|
|
3783
3783
|
break;
|
|
3784
|
-
case
|
|
3784
|
+
case qe:
|
|
3785
3785
|
if (m) {
|
|
3786
|
-
if (D.y <= 0 && (h <=
|
|
3786
|
+
if (D.y <= 0 && (h <= L || A >= z)) {
|
|
3787
3787
|
P = !1;
|
|
3788
3788
|
break;
|
|
3789
3789
|
}
|
|
3790
|
-
|
|
3790
|
+
X(Ce), b -= D.y, h += D.y, v = b * m;
|
|
3791
3791
|
} else
|
|
3792
|
-
|
|
3793
|
-
v < 0 && b < 0 ? (f =
|
|
3792
|
+
X(Ce), X(Te), D.x >= 0 ? A < z ? v += D.x : D.y <= 0 && h <= L && (P = !1) : v += D.x, D.y <= 0 ? h > L && (b -= D.y, h += D.y) : (b -= D.y, h += D.y);
|
|
3793
|
+
v < 0 && b < 0 ? (f = Ze, b = -b, v = -v, h -= b, p -= v) : v < 0 ? (f = Ge, v = -v, p -= v) : b < 0 && (f = Je, b = -b, h -= b);
|
|
3794
3794
|
break;
|
|
3795
|
-
case
|
|
3795
|
+
case Ge:
|
|
3796
3796
|
if (m) {
|
|
3797
|
-
if (D.y <= 0 && (h <=
|
|
3797
|
+
if (D.y <= 0 && (h <= L || p <= T)) {
|
|
3798
3798
|
P = !1;
|
|
3799
3799
|
break;
|
|
3800
3800
|
}
|
|
3801
|
-
|
|
3801
|
+
X(Ce), b -= D.y, h += D.y, v = b * m, p += i.width - v;
|
|
3802
3802
|
} else
|
|
3803
|
-
|
|
3804
|
-
v < 0 && b < 0 ? (f =
|
|
3803
|
+
X(Ce), X(Ae), D.x <= 0 ? p > T ? (v -= D.x, p += D.x) : D.y <= 0 && h <= L && (P = !1) : (v -= D.x, p += D.x), D.y <= 0 ? h > L && (b -= D.y, h += D.y) : (b -= D.y, h += D.y);
|
|
3804
|
+
v < 0 && b < 0 ? (f = Je, b = -b, v = -v, h -= b, p -= v) : v < 0 ? (f = qe, v = -v, p -= v) : b < 0 && (f = Ze, b = -b, h -= b);
|
|
3805
3805
|
break;
|
|
3806
|
-
case
|
|
3806
|
+
case Ze:
|
|
3807
3807
|
if (m) {
|
|
3808
3808
|
if (D.x <= 0 && (p <= T || M >= B)) {
|
|
3809
3809
|
P = !1;
|
|
3810
3810
|
break;
|
|
3811
3811
|
}
|
|
3812
|
-
|
|
3812
|
+
X(Ae), v -= D.x, p += D.x, b = v / m;
|
|
3813
3813
|
} else
|
|
3814
|
-
|
|
3815
|
-
v < 0 && b < 0 ? (f =
|
|
3814
|
+
X(ze), X(Ae), D.x <= 0 ? p > T ? (v -= D.x, p += D.x) : D.y >= 0 && M >= B && (P = !1) : (v -= D.x, p += D.x), D.y >= 0 ? M < B && (b += D.y) : b += D.y;
|
|
3815
|
+
v < 0 && b < 0 ? (f = qe, b = -b, v = -v, h -= b, p -= v) : v < 0 ? (f = Je, v = -v, p -= v) : b < 0 && (f = Ge, b = -b, h -= b);
|
|
3816
3816
|
break;
|
|
3817
|
-
case
|
|
3817
|
+
case Je:
|
|
3818
3818
|
if (m) {
|
|
3819
3819
|
if (D.x >= 0 && (A >= z || M >= B)) {
|
|
3820
3820
|
P = !1;
|
|
3821
3821
|
break;
|
|
3822
3822
|
}
|
|
3823
|
-
|
|
3823
|
+
X(Te), v += D.x, b = v / m;
|
|
3824
3824
|
} else
|
|
3825
|
-
|
|
3826
|
-
v < 0 && b < 0 ? (f =
|
|
3825
|
+
X(ze), X(Te), D.x >= 0 ? A < z ? v += D.x : D.y >= 0 && M >= B && (P = !1) : v += D.x, D.y >= 0 ? M < B && (b += D.y) : b += D.y;
|
|
3826
|
+
v < 0 && b < 0 ? (f = Ge, b = -b, v = -v, h -= b, p -= v) : v < 0 ? (f = Ze, v = -v, p -= v) : b < 0 && (f = qe, b = -b, h -= b);
|
|
3827
3827
|
break;
|
|
3828
|
-
case
|
|
3828
|
+
case Ar:
|
|
3829
3829
|
this.move(D.x, D.y), P = !1;
|
|
3830
3830
|
break;
|
|
3831
|
-
case
|
|
3831
|
+
case Or:
|
|
3832
3832
|
this.zoom(Us(l), e), P = !1;
|
|
3833
3833
|
break;
|
|
3834
|
-
case
|
|
3834
|
+
case Tr:
|
|
3835
3835
|
if (!D.x || !D.y) {
|
|
3836
3836
|
P = !1;
|
|
3837
3837
|
break;
|
|
3838
3838
|
}
|
|
3839
|
-
|
|
3839
|
+
ne = Br(this.cropper), p = F.startX - ne.left, h = F.startY - ne.top, v = i.minWidth, b = i.minHeight, D.x > 0 ? f = D.y > 0 ? Je : qe : D.x < 0 && (p -= v, f = D.y > 0 ? Ze : Ge), D.y < 0 && (h -= b), this.cropped || (we(this.cropBox, he), this.cropped = !0, this.limited && this.limitCropBox(!0, !0));
|
|
3840
3840
|
break;
|
|
3841
3841
|
}
|
|
3842
|
-
P && (i.width = v, i.height = b, i.left = p, i.top = h, this.action = f, this.renderCropBox()),
|
|
3843
|
-
|
|
3842
|
+
P && (i.width = v, i.height = b, i.left = p, i.top = h, this.action = f, this.renderCropBox()), ie(l, function(q) {
|
|
3843
|
+
q.startX = q.endX, q.startY = q.endY;
|
|
3844
3844
|
});
|
|
3845
3845
|
}
|
|
3846
3846
|
}, nl = {
|
|
3847
3847
|
crop: function() {
|
|
3848
|
-
return this.ready && !this.cropped && !this.disabled && (this.cropped = !0, this.limitCropBox(!0, !0), this.options.modal &&
|
|
3848
|
+
return this.ready && !this.cropped && !this.disabled && (this.cropped = !0, this.limitCropBox(!0, !0), this.options.modal && ae(this.dragBox, ft), we(this.cropBox, he), this.setCropBoxData(this.initialCropBoxData)), this;
|
|
3849
3849
|
},
|
|
3850
3850
|
reset: function() {
|
|
3851
|
-
return this.ready && !this.disabled && (this.imageData =
|
|
3851
|
+
return this.ready && !this.disabled && (this.imageData = Z({}, this.initialImageData), this.canvasData = Z({}, this.initialCanvasData), this.cropBoxData = Z({}, this.initialCropBoxData), this.renderCanvas(), this.cropped && this.renderCropBox()), this;
|
|
3852
3852
|
},
|
|
3853
3853
|
clear: function() {
|
|
3854
|
-
return this.cropped && !this.disabled && (
|
|
3854
|
+
return this.cropped && !this.disabled && (Z(this.cropBoxData, {
|
|
3855
3855
|
left: 0,
|
|
3856
3856
|
top: 0,
|
|
3857
3857
|
width: 0,
|
|
3858
3858
|
height: 0
|
|
3859
|
-
}), this.cropped = !1, this.renderCropBox(), this.limitCanvas(!0, !0), this.renderCanvas(),
|
|
3859
|
+
}), this.cropped = !1, this.renderCropBox(), this.limitCanvas(!0, !0), this.renderCanvas(), we(this.dragBox, ft), ae(this.cropBox, he)), this;
|
|
3860
3860
|
},
|
|
3861
3861
|
replace: function(e) {
|
|
3862
3862
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
3863
|
-
return !this.disabled && e && (this.isImg && (this.element.src = e), t ? (this.url = e, this.image.src = e, this.ready && (this.viewBoxImage.src = e,
|
|
3863
|
+
return !this.disabled && e && (this.isImg && (this.element.src = e), t ? (this.url = e, this.image.src = e, this.ready && (this.viewBoxImage.src = e, ie(this.previews, function(n) {
|
|
3864
3864
|
n.getElementsByTagName("img")[0].src = e;
|
|
3865
3865
|
}))) : (this.isImg && (this.replaced = !0), this.options.data = null, this.uncreate(), this.load(e))), this;
|
|
3866
3866
|
},
|
|
3867
3867
|
enable: function() {
|
|
3868
|
-
return this.ready && this.disabled && (this.disabled = !1,
|
|
3868
|
+
return this.ready && this.disabled && (this.disabled = !1, we(this.cropper, fr)), this;
|
|
3869
3869
|
},
|
|
3870
3870
|
disable: function() {
|
|
3871
|
-
return this.ready && !this.disabled && (this.disabled = !0,
|
|
3871
|
+
return this.ready && !this.disabled && (this.disabled = !0, ae(this.cropper, fr)), this;
|
|
3872
3872
|
},
|
|
3873
3873
|
destroy: function() {
|
|
3874
3874
|
var e = this.element;
|
|
3875
|
-
return e[
|
|
3875
|
+
return e[J] ? (e[J] = void 0, this.isImg && this.replaced && (e.src = this.originalUrl), this.uncreate(), this) : this;
|
|
3876
3876
|
},
|
|
3877
3877
|
move: function(e) {
|
|
3878
3878
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = this.canvasData, a = n.left, i = n.top;
|
|
3879
|
-
return this.moveTo(
|
|
3879
|
+
return this.moveTo(xt(e) ? e : a + Number(e), xt(t) ? t : i + Number(t));
|
|
3880
3880
|
},
|
|
3881
3881
|
moveTo: function(e) {
|
|
3882
3882
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = this.canvasData, a = !1;
|
|
3883
|
-
return e = Number(e), t = Number(t), this.ready && !this.disabled && this.options.movable && (
|
|
3883
|
+
return e = Number(e), t = Number(t), this.ready && !this.disabled && this.options.movable && (W(e) && (n.left = e, a = !0), W(t) && (n.top = t, a = !0), a && this.renderCanvas(!0)), this;
|
|
3884
3884
|
},
|
|
3885
3885
|
zoom: function(e, t) {
|
|
3886
3886
|
var n = this.canvasData;
|
|
@@ -3890,20 +3890,20 @@ var Qs = {
|
|
|
3890
3890
|
var a = this.options, i = this.canvasData, l = i.width, f = i.height, m = i.naturalWidth, p = i.naturalHeight;
|
|
3891
3891
|
if (e = Number(e), e >= 0 && this.ready && !this.disabled && a.zoomable) {
|
|
3892
3892
|
var h = m * e, v = p * e;
|
|
3893
|
-
if (
|
|
3893
|
+
if (Ue(this.element, Pt, {
|
|
3894
3894
|
ratio: e,
|
|
3895
3895
|
oldRatio: l / m,
|
|
3896
3896
|
originalEvent: n
|
|
3897
3897
|
}) === !1)
|
|
3898
3898
|
return this;
|
|
3899
3899
|
if (n) {
|
|
3900
|
-
var b = this.pointers, A =
|
|
3900
|
+
var b = this.pointers, A = Br(this.cropper), M = b && Object.keys(b).length ? Ks(b) : {
|
|
3901
3901
|
pageX: n.pageX,
|
|
3902
3902
|
pageY: n.pageY
|
|
3903
3903
|
};
|
|
3904
3904
|
i.left -= (h - l) * ((M.pageX - A.left - i.left) / l), i.top -= (v - f) * ((M.pageY - A.top - i.top) / f);
|
|
3905
3905
|
} else
|
|
3906
|
-
|
|
3906
|
+
Be(t) && W(t.x) && W(t.y) ? (i.left -= (h - l) * ((t.x - i.left) / l), i.top -= (v - f) * ((t.y - i.top) / f)) : (i.left -= (h - l) / 2, i.top -= (v - f) / 2);
|
|
3907
3907
|
i.width = h, i.height = v, this.renderCanvas(!0);
|
|
3908
3908
|
}
|
|
3909
3909
|
return this;
|
|
@@ -3912,19 +3912,19 @@ var Qs = {
|
|
|
3912
3912
|
return this.rotateTo((this.imageData.rotate || 0) + Number(e));
|
|
3913
3913
|
},
|
|
3914
3914
|
rotateTo: function(e) {
|
|
3915
|
-
return e = Number(e),
|
|
3915
|
+
return e = Number(e), W(e) && this.ready && !this.disabled && this.options.rotatable && (this.imageData.rotate = e % 360, this.renderCanvas(!0, !0)), this;
|
|
3916
3916
|
},
|
|
3917
3917
|
scaleX: function(e) {
|
|
3918
3918
|
var t = this.imageData.scaleY;
|
|
3919
|
-
return this.scale(e,
|
|
3919
|
+
return this.scale(e, W(t) ? t : 1);
|
|
3920
3920
|
},
|
|
3921
3921
|
scaleY: function(e) {
|
|
3922
3922
|
var t = this.imageData.scaleX;
|
|
3923
|
-
return this.scale(
|
|
3923
|
+
return this.scale(W(t) ? t : 1, e);
|
|
3924
3924
|
},
|
|
3925
3925
|
scale: function(e) {
|
|
3926
3926
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = this.imageData, a = !1;
|
|
3927
|
-
return e = Number(e), t = Number(t), this.ready && !this.disabled && this.options.scalable && (
|
|
3927
|
+
return e = Number(e), t = Number(t), this.ready && !this.disabled && this.options.scalable && (W(e) && (n.scaleX = e, a = !0), W(t) && (n.scaleY = t, a = !0), a && this.renderCanvas(!0, !0)), this;
|
|
3928
3928
|
},
|
|
3929
3929
|
getData: function() {
|
|
3930
3930
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = this.options, n = this.imageData, a = this.canvasData, i = this.cropBoxData, l;
|
|
@@ -3936,7 +3936,7 @@ var Qs = {
|
|
|
3936
3936
|
height: i.height
|
|
3937
3937
|
};
|
|
3938
3938
|
var f = n.width / n.naturalWidth;
|
|
3939
|
-
if (
|
|
3939
|
+
if (ie(l, function(h, v) {
|
|
3940
3940
|
l[v] = h / f;
|
|
3941
3941
|
}), e) {
|
|
3942
3942
|
var m = Math.round(l.y + l.height), p = Math.round(l.x + l.width);
|
|
@@ -3953,29 +3953,29 @@ var Qs = {
|
|
|
3953
3953
|
},
|
|
3954
3954
|
setData: function(e) {
|
|
3955
3955
|
var t = this.options, n = this.imageData, a = this.canvasData, i = {};
|
|
3956
|
-
if (this.ready && !this.disabled &&
|
|
3956
|
+
if (this.ready && !this.disabled && Be(e)) {
|
|
3957
3957
|
var l = !1;
|
|
3958
|
-
t.rotatable &&
|
|
3958
|
+
t.rotatable && W(e.rotate) && e.rotate !== n.rotate && (n.rotate = e.rotate, l = !0), t.scalable && (W(e.scaleX) && e.scaleX !== n.scaleX && (n.scaleX = e.scaleX, l = !0), W(e.scaleY) && e.scaleY !== n.scaleY && (n.scaleY = e.scaleY, l = !0)), l && this.renderCanvas(!0, !0);
|
|
3959
3959
|
var f = n.width / n.naturalWidth;
|
|
3960
|
-
|
|
3960
|
+
W(e.x) && (i.left = e.x * f + a.left), W(e.y) && (i.top = e.y * f + a.top), W(e.width) && (i.width = e.width * f), W(e.height) && (i.height = e.height * f), this.setCropBoxData(i);
|
|
3961
3961
|
}
|
|
3962
3962
|
return this;
|
|
3963
3963
|
},
|
|
3964
3964
|
getContainerData: function() {
|
|
3965
|
-
return this.ready ?
|
|
3965
|
+
return this.ready ? Z({}, this.containerData) : {};
|
|
3966
3966
|
},
|
|
3967
3967
|
getImageData: function() {
|
|
3968
|
-
return this.sized ?
|
|
3968
|
+
return this.sized ? Z({}, this.imageData) : {};
|
|
3969
3969
|
},
|
|
3970
3970
|
getCanvasData: function() {
|
|
3971
3971
|
var e = this.canvasData, t = {};
|
|
3972
|
-
return this.ready &&
|
|
3972
|
+
return this.ready && ie(["left", "top", "width", "height", "naturalWidth", "naturalHeight"], function(n) {
|
|
3973
3973
|
t[n] = e[n];
|
|
3974
3974
|
}), t;
|
|
3975
3975
|
},
|
|
3976
3976
|
setCanvasData: function(e) {
|
|
3977
3977
|
var t = this.canvasData, n = t.aspectRatio;
|
|
3978
|
-
return this.ready && !this.disabled &&
|
|
3978
|
+
return this.ready && !this.disabled && Be(e) && (W(e.left) && (t.left = e.left), W(e.top) && (t.top = e.top), W(e.width) ? (t.width = e.width, t.height = e.width / n) : W(e.height) && (t.height = e.height, t.width = e.height * n), this.renderCanvas(!0)), this;
|
|
3979
3979
|
},
|
|
3980
3980
|
getCropBoxData: function() {
|
|
3981
3981
|
var e = this.cropBoxData, t;
|
|
@@ -3988,7 +3988,7 @@ var Qs = {
|
|
|
3988
3988
|
},
|
|
3989
3989
|
setCropBoxData: function(e) {
|
|
3990
3990
|
var t = this.cropBoxData, n = this.options.aspectRatio, a, i;
|
|
3991
|
-
return this.ready && this.cropped && !this.disabled &&
|
|
3991
|
+
return this.ready && this.cropped && !this.disabled && Be(e) && (W(e.left) && (t.left = e.left), W(e.top) && (t.top = e.top), W(e.width) && e.width !== t.width && (a = !0, t.width = e.width), W(e.height) && e.height !== t.height && (i = !0, t.height = e.height), n && (a ? t.height = t.width / n : i && (t.width = t.height * n)), this.renderCropBox()), this;
|
|
3992
3992
|
},
|
|
3993
3993
|
getCroppedCanvas: function() {
|
|
3994
3994
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -3999,60 +3999,60 @@ var Qs = {
|
|
|
3999
3999
|
return n;
|
|
4000
4000
|
var a = this.getData(), i = a.x, l = a.y, f = a.width, m = a.height, p = n.width / Math.floor(t.naturalWidth);
|
|
4001
4001
|
p !== 1 && (i *= p, l *= p, f *= p, m *= p);
|
|
4002
|
-
var h = f / m, v =
|
|
4002
|
+
var h = f / m, v = Ee({
|
|
4003
4003
|
aspectRatio: h,
|
|
4004
4004
|
width: e.maxWidth || 1 / 0,
|
|
4005
4005
|
height: e.maxHeight || 1 / 0
|
|
4006
|
-
}), b =
|
|
4006
|
+
}), b = Ee({
|
|
4007
4007
|
aspectRatio: h,
|
|
4008
4008
|
width: e.minWidth || 0,
|
|
4009
4009
|
height: e.minHeight || 0
|
|
4010
|
-
}, "cover"), A =
|
|
4010
|
+
}, "cover"), A = Ee({
|
|
4011
4011
|
aspectRatio: h,
|
|
4012
4012
|
width: e.width || (p !== 1 ? n.width : f),
|
|
4013
4013
|
height: e.height || (p !== 1 ? n.height : m)
|
|
4014
4014
|
}), M = A.width, T = A.height;
|
|
4015
4015
|
M = Math.min(v.width, Math.max(b.width, M)), T = Math.min(v.height, Math.max(b.height, T));
|
|
4016
|
-
var
|
|
4017
|
-
|
|
4018
|
-
var B = e.imageSmoothingEnabled, P = B === void 0 ? !0 : B,
|
|
4019
|
-
z.imageSmoothingEnabled = P,
|
|
4020
|
-
var
|
|
4021
|
-
|
|
4022
|
-
var
|
|
4023
|
-
if (
|
|
4024
|
-
var
|
|
4025
|
-
|
|
4016
|
+
var L = document.createElement("canvas"), z = L.getContext("2d");
|
|
4017
|
+
L.width = He(M), L.height = He(T), z.fillStyle = e.fillColor || "transparent", z.fillRect(0, 0, M, T);
|
|
4018
|
+
var B = e.imageSmoothingEnabled, P = B === void 0 ? !0 : B, ne = e.imageSmoothingQuality;
|
|
4019
|
+
z.imageSmoothingEnabled = P, ne && (z.imageSmoothingQuality = ne);
|
|
4020
|
+
var F = n.width, D = n.height, X = i, q = l, le, fe, N, U, I, Y;
|
|
4021
|
+
X <= -f || X > F ? (X = 0, le = 0, N = 0, I = 0) : X <= 0 ? (N = -X, X = 0, le = Math.min(F, f + X), I = le) : X <= F && (N = 0, le = Math.min(f, F - X), I = le), le <= 0 || q <= -m || q > D ? (q = 0, fe = 0, U = 0, Y = 0) : q <= 0 ? (U = -q, q = 0, fe = Math.min(D, m + q), Y = fe) : q <= D && (U = 0, fe = Math.min(m, D - q), Y = fe);
|
|
4022
|
+
var H = [X, q, le, fe];
|
|
4023
|
+
if (I > 0 && Y > 0) {
|
|
4024
|
+
var te = M / f;
|
|
4025
|
+
H.push(N * te, U * te, I * te, Y * te);
|
|
4026
4026
|
}
|
|
4027
|
-
return z.drawImage.apply(z, [n].concat(
|
|
4028
|
-
return Math.floor(
|
|
4029
|
-
})))),
|
|
4027
|
+
return z.drawImage.apply(z, [n].concat(Er(H.map(function(G) {
|
|
4028
|
+
return Math.floor(He(G));
|
|
4029
|
+
})))), L;
|
|
4030
4030
|
},
|
|
4031
4031
|
setAspectRatio: function(e) {
|
|
4032
4032
|
var t = this.options;
|
|
4033
|
-
return !this.disabled && !
|
|
4033
|
+
return !this.disabled && !xt(e) && (t.aspectRatio = Math.max(0, e) || NaN, this.ready && (this.initCropBox(), this.cropped && this.renderCropBox())), this;
|
|
4034
4034
|
},
|
|
4035
4035
|
setDragMode: function(e) {
|
|
4036
4036
|
var t = this.options, n = this.dragBox, a = this.face;
|
|
4037
4037
|
if (this.ready && !this.disabled) {
|
|
4038
|
-
var i = e ===
|
|
4039
|
-
e = i || l ? e :
|
|
4038
|
+
var i = e === Bt, l = t.movable && e === Pr;
|
|
4039
|
+
e = i || l ? e : Ir, t.dragMode = e, tt(n, et, e), Re(n, Mt, i), Re(n, $t, l), t.cropBoxMovable || (tt(a, et, e), Re(a, Mt, i), Re(a, $t, l));
|
|
4040
4040
|
}
|
|
4041
4041
|
return this;
|
|
4042
4042
|
}
|
|
4043
|
-
}, ol =
|
|
4043
|
+
}, ol = _e.Cropper, Hr = /* @__PURE__ */ function() {
|
|
4044
4044
|
function o(e) {
|
|
4045
4045
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4046
4046
|
if (bs(this, o), !e || !Os.test(e.tagName))
|
|
4047
4047
|
throw new Error("The first argument is required and must be an <img> or <canvas> element.");
|
|
4048
|
-
this.element = e, this.options =
|
|
4048
|
+
this.element = e, this.options = Z({}, kr, Be(t) && t), this.cropped = !1, this.disabled = !1, this.pointers = {}, this.ready = !1, this.reloading = !1, this.replaced = !1, this.sized = !1, this.sizing = !1, this.init();
|
|
4049
4049
|
}
|
|
4050
4050
|
return ys(o, [{
|
|
4051
4051
|
key: "init",
|
|
4052
4052
|
value: function() {
|
|
4053
4053
|
var t = this.element, n = t.tagName.toLowerCase(), a;
|
|
4054
|
-
if (!t[
|
|
4055
|
-
if (t[
|
|
4054
|
+
if (!t[J]) {
|
|
4055
|
+
if (t[J] = this, n === "img") {
|
|
4056
4056
|
if (this.isImg = !0, a = t.getAttribute("src") || "", this.originalUrl = a, !a)
|
|
4057
4057
|
return;
|
|
4058
4058
|
a = t.src;
|
|
@@ -4078,12 +4078,12 @@ var Qs = {
|
|
|
4078
4078
|
}
|
|
4079
4079
|
var l = new XMLHttpRequest(), f = this.clone.bind(this);
|
|
4080
4080
|
this.reloading = !0, this.xhr = l, l.onabort = f, l.onerror = f, l.ontimeout = f, l.onprogress = function() {
|
|
4081
|
-
l.getResponseHeader("content-type") !==
|
|
4081
|
+
l.getResponseHeader("content-type") !== _r && l.abort();
|
|
4082
4082
|
}, l.onload = function() {
|
|
4083
4083
|
n.read(l.response);
|
|
4084
4084
|
}, l.onloadend = function() {
|
|
4085
4085
|
n.reloading = !1, n.xhr = null;
|
|
4086
|
-
}, i.checkCrossOrigin &&
|
|
4086
|
+
}, i.checkCrossOrigin && Dr(t) && a.crossOrigin && (t = Cr(t)), l.open("GET", t, !0), l.responseType = "arraybuffer", l.withCredentials = a.crossOrigin === "use-credentials", l.send();
|
|
4087
4087
|
}
|
|
4088
4088
|
}
|
|
4089
4089
|
}, {
|
|
@@ -4091,7 +4091,7 @@ var Qs = {
|
|
|
4091
4091
|
value: function(t) {
|
|
4092
4092
|
var n = this.options, a = this.imageData, i = Js(t), l = 0, f = 1, m = 1;
|
|
4093
4093
|
if (i > 1) {
|
|
4094
|
-
this.url = Gs(t,
|
|
4094
|
+
this.url = Gs(t, _r);
|
|
4095
4095
|
var p = Zs(i);
|
|
4096
4096
|
l = p.rotate, f = p.scaleX, m = p.scaleY;
|
|
4097
4097
|
}
|
|
@@ -4101,21 +4101,21 @@ var Qs = {
|
|
|
4101
4101
|
key: "clone",
|
|
4102
4102
|
value: function() {
|
|
4103
4103
|
var t = this.element, n = this.url, a = t.crossOrigin, i = n;
|
|
4104
|
-
this.options.checkCrossOrigin &&
|
|
4104
|
+
this.options.checkCrossOrigin && Dr(n) && (a || (a = "anonymous"), i = Cr(n)), this.crossOrigin = a, this.crossOriginUrl = i;
|
|
4105
4105
|
var l = document.createElement("img");
|
|
4106
|
-
a && (l.crossOrigin = a), l.src = i || n, l.alt = t.alt || "The image to crop", this.image = l, l.onload = this.start.bind(this), l.onerror = this.stop.bind(this),
|
|
4106
|
+
a && (l.crossOrigin = a), l.src = i || n, l.alt = t.alt || "The image to crop", this.image = l, l.onload = this.start.bind(this), l.onerror = this.stop.bind(this), ae(l, mr), t.parentNode.insertBefore(l, t.nextSibling);
|
|
4107
4107
|
}
|
|
4108
4108
|
}, {
|
|
4109
4109
|
key: "start",
|
|
4110
4110
|
value: function() {
|
|
4111
4111
|
var t = this, n = this.image;
|
|
4112
4112
|
n.onload = null, n.onerror = null, this.sizing = !0;
|
|
4113
|
-
var a =
|
|
4114
|
-
|
|
4113
|
+
var a = _e.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(_e.navigator.userAgent), i = function(p, h) {
|
|
4114
|
+
Z(t.imageData, {
|
|
4115
4115
|
naturalWidth: p,
|
|
4116
4116
|
naturalHeight: h,
|
|
4117
4117
|
aspectRatio: p / h
|
|
4118
|
-
}), t.initialImageData =
|
|
4118
|
+
}), t.initialImageData = Z({}, t.imageData), t.sizing = !1, t.sized = !0, t.build();
|
|
4119
4119
|
};
|
|
4120
4120
|
if (n.naturalWidth && !a) {
|
|
4121
4121
|
i(n.naturalWidth, n.naturalHeight);
|
|
@@ -4138,16 +4138,16 @@ var Qs = {
|
|
|
4138
4138
|
if (!(!this.sized || this.ready)) {
|
|
4139
4139
|
var t = this.element, n = this.options, a = this.image, i = t.parentNode, l = document.createElement("div");
|
|
4140
4140
|
l.innerHTML = Ps;
|
|
4141
|
-
var f = l.querySelector(".".concat(
|
|
4142
|
-
this.container = i, this.cropper = f, this.canvas = m, this.dragBox = p, this.cropBox = h, this.viewBox = f.querySelector(".".concat(
|
|
4141
|
+
var f = l.querySelector(".".concat(J, "-container")), m = f.querySelector(".".concat(J, "-canvas")), p = f.querySelector(".".concat(J, "-drag-box")), h = f.querySelector(".".concat(J, "-crop-box")), v = h.querySelector(".".concat(J, "-face"));
|
|
4142
|
+
this.container = i, this.cropper = f, this.canvas = m, this.dragBox = p, this.cropBox = h, this.viewBox = f.querySelector(".".concat(J, "-view-box")), this.face = v, m.appendChild(a), ae(t, he), i.insertBefore(f, t.nextSibling), this.isImg || we(a, mr), this.initPreview(), this.bind(), n.initialAspectRatio = Math.max(0, n.initialAspectRatio) || NaN, n.aspectRatio = Math.max(0, n.aspectRatio) || NaN, n.viewMode = Math.max(0, Math.min(3, Math.round(n.viewMode))) || 0, ae(h, he), n.guides || ae(h.getElementsByClassName("".concat(J, "-dashed")), he), n.center || ae(h.getElementsByClassName("".concat(J, "-center")), he), n.background && ae(f, "".concat(J, "-bg")), n.highlight || ae(v, Ds), n.cropBoxMovable && (ae(v, $t), tt(v, et, zt)), n.cropBoxResizable || (ae(h.getElementsByClassName("".concat(J, "-line")), he), ae(h.getElementsByClassName("".concat(J, "-point")), he)), this.render(), this.ready = !0, this.setDragMode(n.dragMode), n.autoCrop && this.crop(), this.setData(n.data), de(n.ready) && pe(t, yr, n.ready, {
|
|
4143
4143
|
once: !0
|
|
4144
|
-
}),
|
|
4144
|
+
}), Ue(t, yr);
|
|
4145
4145
|
}
|
|
4146
4146
|
}
|
|
4147
4147
|
}, {
|
|
4148
4148
|
key: "unbuild",
|
|
4149
4149
|
value: function() {
|
|
4150
|
-
!this.ready || (this.ready = !1, this.unbind(), this.resetPreview(), this.cropper.parentNode.removeChild(this.cropper),
|
|
4150
|
+
!this.ready || (this.ready = !1, this.unbind(), this.resetPreview(), this.cropper.parentNode.removeChild(this.cropper), we(this.element, he));
|
|
4151
4151
|
}
|
|
4152
4152
|
}, {
|
|
4153
4153
|
key: "uncreate",
|
|
@@ -4162,11 +4162,11 @@ var Qs = {
|
|
|
4162
4162
|
}, {
|
|
4163
4163
|
key: "setDefaults",
|
|
4164
4164
|
value: function(t) {
|
|
4165
|
-
|
|
4165
|
+
Z(kr, Be(t) && t);
|
|
4166
4166
|
}
|
|
4167
4167
|
}]), o;
|
|
4168
4168
|
}();
|
|
4169
|
-
|
|
4169
|
+
Z(Hr.prototype, Qs, el, tl, rl, il, nl);
|
|
4170
4170
|
const al = { class: "flex" }, sl = {
|
|
4171
4171
|
class: "mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",
|
|
4172
4172
|
id: "modal-title"
|
|
@@ -4177,8 +4177,8 @@ const al = { class: "flex" }, sl = {
|
|
|
4177
4177
|
},
|
|
4178
4178
|
emits: ["load"],
|
|
4179
4179
|
setup(o, { emit: e }) {
|
|
4180
|
-
const t = o, { t: n } =
|
|
4181
|
-
l.value = !l.value, l.value ? i.value = new
|
|
4180
|
+
const t = o, { t: n } = R("i18n"), a = V(null), i = V(null), l = V(!1), f = () => {
|
|
4181
|
+
l.value = !l.value, l.value ? i.value = new Hr(a.value, {
|
|
4182
4182
|
crop(p) {
|
|
4183
4183
|
}
|
|
4184
4184
|
}) : i.value.destroy();
|
|
@@ -4188,20 +4188,20 @@ const al = { class: "flex" }, sl = {
|
|
|
4188
4188
|
height: 341
|
|
4189
4189
|
}).toBlob(
|
|
4190
4190
|
(p) => {
|
|
4191
|
-
|
|
4191
|
+
ht(apiUrl.value, {
|
|
4192
4192
|
method: "POST",
|
|
4193
4193
|
params: { q: "upload", adapter: t.selection.adapter, path: t.selection.item.path, file: p },
|
|
4194
4194
|
name: t.selection.item.basename,
|
|
4195
4195
|
json: !1
|
|
4196
4196
|
}).then((h) => {
|
|
4197
|
-
a.value.src =
|
|
4197
|
+
a.value.src = Dt(t.selection.adapter, t.selection.item.path), f(), e("load");
|
|
4198
4198
|
}).catch((h) => console.log(h.statusText));
|
|
4199
4199
|
}
|
|
4200
4200
|
);
|
|
4201
4201
|
};
|
|
4202
4202
|
return onMounted(() => {
|
|
4203
4203
|
e("load");
|
|
4204
|
-
}), (p, h) => (x(), C(
|
|
4204
|
+
}), (p, h) => (x(), C(se, null, [
|
|
4205
4205
|
d("div", al, [
|
|
4206
4206
|
d("h3", sl, E(o.selection.item.basename), 1),
|
|
4207
4207
|
d("div", ll, [
|
|
@@ -4209,7 +4209,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4209
4209
|
key: 0,
|
|
4210
4210
|
onClick: m,
|
|
4211
4211
|
class: "ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"
|
|
4212
|
-
}, E(_(n)("Crop")), 1)) :
|
|
4212
|
+
}, E(_(n)("Crop")), 1)) : oe("", !0),
|
|
4213
4213
|
d("button", {
|
|
4214
4214
|
class: "ml-1 px-2 py-1 text-blue-500",
|
|
4215
4215
|
onClick: h[0] || (h[0] = (v) => f())
|
|
@@ -4221,7 +4221,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4221
4221
|
ref_key: "image",
|
|
4222
4222
|
ref: a,
|
|
4223
4223
|
class: "max-w-[60vh] max-h-[60vh]",
|
|
4224
|
-
src: _(
|
|
4224
|
+
src: _(Dt)(t.selection.adapter, t.selection.item.path),
|
|
4225
4225
|
alt: ""
|
|
4226
4226
|
}, null, 8, ul)
|
|
4227
4227
|
])
|
|
@@ -4237,9 +4237,9 @@ const al = { class: "flex" }, sl = {
|
|
|
4237
4237
|
},
|
|
4238
4238
|
emits: ["load"],
|
|
4239
4239
|
setup(o, { emit: e }) {
|
|
4240
|
-
return
|
|
4240
|
+
return xe(() => {
|
|
4241
4241
|
e("load");
|
|
4242
|
-
}), (t, n) => (x(), C(
|
|
4242
|
+
}), (t, n) => (x(), C(se, null, [
|
|
4243
4243
|
d("h3", hl, E(o.selection.item.basename), 1),
|
|
4244
4244
|
fl
|
|
4245
4245
|
], 64));
|
|
@@ -4251,17 +4251,17 @@ const al = { class: "flex" }, sl = {
|
|
|
4251
4251
|
class: "w-full",
|
|
4252
4252
|
preload: "",
|
|
4253
4253
|
controls: ""
|
|
4254
|
-
}, vl = ["src"], bl = /* @__PURE__ */
|
|
4254
|
+
}, vl = ["src"], bl = /* @__PURE__ */ Me(" Your browser does not support the video tag. "), yl = {
|
|
4255
4255
|
__name: "Video",
|
|
4256
4256
|
props: {
|
|
4257
4257
|
selection: Object
|
|
4258
4258
|
},
|
|
4259
4259
|
emits: ["load"],
|
|
4260
4260
|
setup(o, { emit: e }) {
|
|
4261
|
-
const t = o, { apiUrl: n } =
|
|
4262
|
-
return
|
|
4261
|
+
const t = o, { apiUrl: n } = Se(), a = () => n.value + "?" + Ie({ q: "preview", adapter: t.selection.adapter, path: t.selection.item.path });
|
|
4262
|
+
return xe(() => {
|
|
4263
4263
|
e("load");
|
|
4264
|
-
}), (i, l) => (x(), C(
|
|
4264
|
+
}), (i, l) => (x(), C(se, null, [
|
|
4265
4265
|
d("h3", pl, E(o.selection.item.basename), 1),
|
|
4266
4266
|
d("div", null, [
|
|
4267
4267
|
d("video", gl, [
|
|
@@ -4280,17 +4280,17 @@ const al = { class: "flex" }, sl = {
|
|
|
4280
4280
|
}, xl = {
|
|
4281
4281
|
class: "w-full",
|
|
4282
4282
|
controls: ""
|
|
4283
|
-
}, _l = ["src"], kl = /* @__PURE__ */
|
|
4283
|
+
}, _l = ["src"], kl = /* @__PURE__ */ Me(" Your browser does not support the audio element. "), Sl = {
|
|
4284
4284
|
__name: "Audio",
|
|
4285
4285
|
props: {
|
|
4286
4286
|
selection: Object
|
|
4287
4287
|
},
|
|
4288
4288
|
emits: ["load"],
|
|
4289
4289
|
setup(o, { emit: e }) {
|
|
4290
|
-
const t = o, { apiUrl: n } =
|
|
4291
|
-
return
|
|
4290
|
+
const t = o, { apiUrl: n } = Se(), a = () => n.value + "?" + Ie({ q: "preview", adapter: t.selection.adapter, path: t.selection.item.path });
|
|
4291
|
+
return xe(() => {
|
|
4292
4292
|
e("load");
|
|
4293
|
-
}), (i, l) => (x(), C(
|
|
4293
|
+
}), (i, l) => (x(), C(se, null, [
|
|
4294
4294
|
d("h3", wl, E(o.selection.item.basename), 1),
|
|
4295
4295
|
d("div", null, [
|
|
4296
4296
|
d("audio", xl, [
|
|
@@ -4313,10 +4313,10 @@ const al = { class: "flex" }, sl = {
|
|
|
4313
4313
|
},
|
|
4314
4314
|
emits: ["load"],
|
|
4315
4315
|
setup(o, { emit: e }) {
|
|
4316
|
-
const t = o, { apiUrl: n } =
|
|
4317
|
-
return
|
|
4316
|
+
const t = o, { apiUrl: n } = Se(), a = () => n.value + "?" + Ie({ q: "preview", adapter: t.selection.adapter, path: t.selection.item.path });
|
|
4317
|
+
return xe(() => {
|
|
4318
4318
|
e("load");
|
|
4319
|
-
}), (i, l) => (x(), C(
|
|
4319
|
+
}), (i, l) => (x(), C(se, null, [
|
|
4320
4320
|
d("h3", Dl, E(o.selection.item.basename), 1),
|
|
4321
4321
|
d("div", null, [
|
|
4322
4322
|
d("object", {
|
|
@@ -4364,22 +4364,22 @@ const al = { class: "flex" }, sl = {
|
|
|
4364
4364
|
fill: "currentColor",
|
|
4365
4365
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
4366
4366
|
})
|
|
4367
|
-
], -1),
|
|
4367
|
+
], -1), Il = {
|
|
4368
4368
|
name: "VFModalPreview"
|
|
4369
|
-
},
|
|
4369
|
+
}, Nl = /* @__PURE__ */ Object.assign(Il, {
|
|
4370
4370
|
props: {
|
|
4371
4371
|
selection: Object
|
|
4372
4372
|
},
|
|
4373
4373
|
setup(o) {
|
|
4374
|
-
const e = o, { apiUrl: t } =
|
|
4374
|
+
const e = o, { apiUrl: t } = Se(), n = R("emitter"), { t: a } = R("i18n"), i = V(!1), l = (p) => i.value = p, f = (p) => {
|
|
4375
4375
|
var h;
|
|
4376
4376
|
return ((h = e.selection.item.mime_type) != null ? h : "").startsWith(p);
|
|
4377
4377
|
}, m = () => {
|
|
4378
|
-
const p = t.value + "?" +
|
|
4378
|
+
const p = t.value + "?" + Ie({ q: "download", adapter: e.selection.adapter, path: e.selection.item.path });
|
|
4379
4379
|
n.emit("vf-download", p);
|
|
4380
4380
|
};
|
|
4381
|
-
return (p, h) => (x(),
|
|
4382
|
-
buttons:
|
|
4381
|
+
return (p, h) => (x(), ce(ke, null, {
|
|
4382
|
+
buttons: ee(() => [
|
|
4383
4383
|
d("button", {
|
|
4384
4384
|
type: "button",
|
|
4385
4385
|
onClick: h[6] || (h[6] = (v) => _(n).emit("vf-modal-close")),
|
|
@@ -4391,31 +4391,31 @@ const al = { class: "flex" }, sl = {
|
|
|
4391
4391
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
4392
4392
|
}, E(_(a)("Download")), 1)
|
|
4393
4393
|
]),
|
|
4394
|
-
default:
|
|
4394
|
+
default: ee(() => [
|
|
4395
4395
|
d("div", El, [
|
|
4396
4396
|
d("div", Tl, [
|
|
4397
4397
|
d("div", null, [
|
|
4398
|
-
f("text") ? (x(),
|
|
4398
|
+
f("text") ? (x(), ce(vs, {
|
|
4399
4399
|
key: 0,
|
|
4400
4400
|
selection: o.selection,
|
|
4401
4401
|
onLoad: h[0] || (h[0] = (v) => l(!0))
|
|
4402
|
-
}, null, 8, ["selection"])) : f("image") ? (x(),
|
|
4402
|
+
}, null, 8, ["selection"])) : f("image") ? (x(), ce(dl, {
|
|
4403
4403
|
key: 1,
|
|
4404
4404
|
selection: o.selection,
|
|
4405
4405
|
onLoad: h[1] || (h[1] = (v) => l(!0))
|
|
4406
|
-
}, null, 8, ["selection"])) : f("video") ? (x(),
|
|
4406
|
+
}, null, 8, ["selection"])) : f("video") ? (x(), ce(yl, {
|
|
4407
4407
|
key: 2,
|
|
4408
4408
|
selection: o.selection,
|
|
4409
4409
|
onLoad: h[2] || (h[2] = (v) => l(!0))
|
|
4410
|
-
}, null, 8, ["selection"])) : f("audio") ? (x(),
|
|
4410
|
+
}, null, 8, ["selection"])) : f("audio") ? (x(), ce(Sl, {
|
|
4411
4411
|
key: 3,
|
|
4412
4412
|
selection: o.selection,
|
|
4413
4413
|
onLoad: h[3] || (h[3] = (v) => l(!0))
|
|
4414
|
-
}, null, 8, ["selection"])) : f("application/pdf") ? (x(),
|
|
4414
|
+
}, null, 8, ["selection"])) : f("application/pdf") ? (x(), ce($l, {
|
|
4415
4415
|
key: 4,
|
|
4416
4416
|
selection: o.selection,
|
|
4417
4417
|
onLoad: h[4] || (h[4] = (v) => l(!0))
|
|
4418
|
-
}, null, 8, ["selection"])) : (x(),
|
|
4418
|
+
}, null, 8, ["selection"])) : (x(), ce(ml, {
|
|
4419
4419
|
key: 5,
|
|
4420
4420
|
selection: o.selection,
|
|
4421
4421
|
onLoad: h[5] || (h[5] = (v) => l(!0))
|
|
@@ -4427,7 +4427,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4427
4427
|
i.value == !1 ? (x(), C("div", Ol, [
|
|
4428
4428
|
Pl,
|
|
4429
4429
|
d("span", null, E(_(a)("Loading")), 1)
|
|
4430
|
-
])) :
|
|
4430
|
+
])) : oe("", !0)
|
|
4431
4431
|
])
|
|
4432
4432
|
])
|
|
4433
4433
|
])
|
|
@@ -4435,7 +4435,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4435
4435
|
_: 1
|
|
4436
4436
|
}));
|
|
4437
4437
|
}
|
|
4438
|
-
}),
|
|
4438
|
+
}), Ll = { class: "sm:flex sm:items-start" }, jl = /* @__PURE__ */ d("div", { class: "mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10" }, [
|
|
4439
4439
|
/* @__PURE__ */ d("svg", {
|
|
4440
4440
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4441
4441
|
class: "h-6 w-6 stroke-blue-600 dark:stroke-blue-100",
|
|
@@ -4489,7 +4489,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4489
4489
|
current: Object
|
|
4490
4490
|
},
|
|
4491
4491
|
setup(o) {
|
|
4492
|
-
const e = o, t =
|
|
4492
|
+
const e = o, t = R("emitter"), { getStore: n } = R("storage"), { t: a } = R("i18n"), i = V(e.selection.items[0]), l = V(e.selection.items[0].basename), f = () => {
|
|
4493
4493
|
l.value != "" && t.emit("vf-fetch", {
|
|
4494
4494
|
q: "rename",
|
|
4495
4495
|
adapter: n("adapter", "local"),
|
|
@@ -4498,8 +4498,8 @@ const al = { class: "flex" }, sl = {
|
|
|
4498
4498
|
name: l.value
|
|
4499
4499
|
});
|
|
4500
4500
|
};
|
|
4501
|
-
return (m, p) => (x(),
|
|
4502
|
-
buttons:
|
|
4501
|
+
return (m, p) => (x(), ce(ke, null, {
|
|
4502
|
+
buttons: ee(() => [
|
|
4503
4503
|
d("button", {
|
|
4504
4504
|
type: "button",
|
|
4505
4505
|
onClick: f,
|
|
@@ -4511,9 +4511,9 @@ const al = { class: "flex" }, sl = {
|
|
|
4511
4511
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
4512
4512
|
}, E(_(a)("Cancel")), 1)
|
|
4513
4513
|
]),
|
|
4514
|
-
default:
|
|
4515
|
-
d("div",
|
|
4516
|
-
|
|
4514
|
+
default: ee(() => [
|
|
4515
|
+
d("div", Ll, [
|
|
4516
|
+
jl,
|
|
4517
4517
|
d("div", Vl, [
|
|
4518
4518
|
d("h3", zl, E(_(a)("Rename")), 1),
|
|
4519
4519
|
d("div", Bl, [
|
|
@@ -4521,14 +4521,14 @@ const al = { class: "flex" }, sl = {
|
|
|
4521
4521
|
i.value.type == "dir" ? (x(), C("svg", Hl, Kl)) : (x(), C("svg", Yl, Xl)),
|
|
4522
4522
|
d("span", Fl, E(i.value.basename), 1)
|
|
4523
4523
|
]),
|
|
4524
|
-
|
|
4524
|
+
ge(d("input", {
|
|
4525
4525
|
"onUpdate:modelValue": p[0] || (p[0] = (h) => l.value = h),
|
|
4526
|
-
onKeyup:
|
|
4526
|
+
onKeyup: Ke(f, ["enter"]),
|
|
4527
4527
|
class: "px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",
|
|
4528
4528
|
placeholder: "Name",
|
|
4529
4529
|
type: "text"
|
|
4530
4530
|
}, null, 40, ql), [
|
|
4531
|
-
[
|
|
4531
|
+
[Ye, l.value]
|
|
4532
4532
|
])
|
|
4533
4533
|
])
|
|
4534
4534
|
])
|
|
@@ -4565,27 +4565,27 @@ const al = { class: "flex" }, sl = {
|
|
|
4565
4565
|
current: Object
|
|
4566
4566
|
},
|
|
4567
4567
|
setup(o) {
|
|
4568
|
-
const e = o, t =
|
|
4568
|
+
const e = o, t = R("emitter"), { apiUrl: n } = Se(), { t: a } = R("i18n"), i = V(null), l = V(null), f = V(null), m = V([]), p = V(!0), h = () => {
|
|
4569
4569
|
i.value.start();
|
|
4570
4570
|
};
|
|
4571
|
-
return
|
|
4572
|
-
i.value = new
|
|
4571
|
+
return xe(() => {
|
|
4572
|
+
i.value = new wt.Uploader({
|
|
4573
4573
|
runtimes: "html5",
|
|
4574
4574
|
browse_button: f.value,
|
|
4575
4575
|
container: l.value,
|
|
4576
4576
|
max_file_size: "10mb",
|
|
4577
4577
|
multiple_queues: !0,
|
|
4578
4578
|
file_data_name: "file",
|
|
4579
|
-
url: n.value + "?" +
|
|
4579
|
+
url: n.value + "?" + Ie({ q: "upload", adapter: e.current.adapter, path: e.current.dirname }),
|
|
4580
4580
|
init: {
|
|
4581
4581
|
PostInit: function() {
|
|
4582
4582
|
},
|
|
4583
4583
|
FilesAdded: function(v, b) {
|
|
4584
|
-
p.value = !1,
|
|
4584
|
+
p.value = !1, wt.each(b, function(A) {
|
|
4585
4585
|
m.value.push({
|
|
4586
4586
|
id: A.id,
|
|
4587
4587
|
name: A.name,
|
|
4588
|
-
size:
|
|
4588
|
+
size: wt.formatSize(A.size),
|
|
4589
4589
|
percent: ""
|
|
4590
4590
|
});
|
|
4591
4591
|
});
|
|
@@ -4600,13 +4600,13 @@ const al = { class: "flex" }, sl = {
|
|
|
4600
4600
|
}
|
|
4601
4601
|
}
|
|
4602
4602
|
}), i.value.init();
|
|
4603
|
-
}), (v, b) => (x(),
|
|
4604
|
-
buttons:
|
|
4603
|
+
}), (v, b) => (x(), ce(ke, null, {
|
|
4604
|
+
buttons: ee(() => [
|
|
4605
4605
|
d("button", {
|
|
4606
4606
|
disabled: p.value,
|
|
4607
|
-
onClick:
|
|
4607
|
+
onClick: Oe(h, ["prevent"]),
|
|
4608
4608
|
type: "button",
|
|
4609
|
-
class:
|
|
4609
|
+
class: ue([p.value ? "bg-red-200 hover:bg-red-200" : "bg-red-600 hover:bg-red-700", "w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"])
|
|
4610
4610
|
}, E(_(a)("Upload")), 11, ac),
|
|
4611
4611
|
d("button", {
|
|
4612
4612
|
type: "button",
|
|
@@ -4614,22 +4614,22 @@ const al = { class: "flex" }, sl = {
|
|
|
4614
4614
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
4615
4615
|
}, E(_(a)("Cancel")), 1)
|
|
4616
4616
|
]),
|
|
4617
|
-
default:
|
|
4617
|
+
default: ee(() => [
|
|
4618
4618
|
d("div", Zl, [
|
|
4619
4619
|
Ql,
|
|
4620
4620
|
d("div", ec, [
|
|
4621
4621
|
d("h3", tc, E(_(a)("Upload files")), 1),
|
|
4622
4622
|
d("div", rc, [
|
|
4623
4623
|
d("div", ic, [
|
|
4624
|
-
(x(!0), C(
|
|
4624
|
+
(x(!0), C(se, null, ve(m.value, (A) => (x(), C("div", null, [
|
|
4625
4625
|
d("div", {
|
|
4626
4626
|
id: A.id
|
|
4627
4627
|
}, [
|
|
4628
|
-
|
|
4628
|
+
Me(E(A.name) + " ( " + E(A.size) + ") ", 1),
|
|
4629
4629
|
d("b", null, E(A.percent), 1)
|
|
4630
4630
|
], 8, nc)
|
|
4631
4631
|
]))), 256)),
|
|
4632
|
-
m.value.length ?
|
|
4632
|
+
m.value.length ? oe("", !0) : (x(), C("div", oc, E(_(a)("No files selected!")), 1))
|
|
4633
4633
|
]),
|
|
4634
4634
|
d("div", {
|
|
4635
4635
|
class: "text-gray-500",
|
|
@@ -4704,7 +4704,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4704
4704
|
current: Object
|
|
4705
4705
|
},
|
|
4706
4706
|
setup(o) {
|
|
4707
|
-
const e = o, t =
|
|
4707
|
+
const e = o, t = R("emitter"), { getStore: n } = R("storage"), { t: a } = R("i18n"), i = V(""), l = V(e.selection.items), f = () => {
|
|
4708
4708
|
l.value.length && t.emit("vf-fetch", {
|
|
4709
4709
|
q: "archive",
|
|
4710
4710
|
adapter: n("adapter", "local"),
|
|
@@ -4713,8 +4713,8 @@ const al = { class: "flex" }, sl = {
|
|
|
4713
4713
|
name: i.value
|
|
4714
4714
|
});
|
|
4715
4715
|
};
|
|
4716
|
-
return (m, p) => (x(),
|
|
4717
|
-
buttons:
|
|
4716
|
+
return (m, p) => (x(), ce(ke, null, {
|
|
4717
|
+
buttons: ee(() => [
|
|
4718
4718
|
d("button", {
|
|
4719
4719
|
type: "button",
|
|
4720
4720
|
onClick: f,
|
|
@@ -4726,24 +4726,24 @@ const al = { class: "flex" }, sl = {
|
|
|
4726
4726
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
4727
4727
|
}, E(_(a)("Cancel")), 1)
|
|
4728
4728
|
]),
|
|
4729
|
-
default:
|
|
4729
|
+
default: ee(() => [
|
|
4730
4730
|
d("div", cc, [
|
|
4731
4731
|
uc,
|
|
4732
4732
|
d("div", dc, [
|
|
4733
4733
|
d("h3", hc, E(_(a)("Archive the files")), 1),
|
|
4734
4734
|
d("div", fc, [
|
|
4735
|
-
(x(!0), C(
|
|
4735
|
+
(x(!0), C(se, null, ve(l.value, (h) => (x(), C("p", mc, [
|
|
4736
4736
|
h.type == "dir" ? (x(), C("svg", pc, vc)) : (x(), C("svg", bc, wc)),
|
|
4737
4737
|
d("span", xc, E(h.basename), 1)
|
|
4738
4738
|
]))), 256)),
|
|
4739
|
-
|
|
4739
|
+
ge(d("input", {
|
|
4740
4740
|
"onUpdate:modelValue": p[0] || (p[0] = (h) => i.value = h),
|
|
4741
|
-
onKeyup:
|
|
4741
|
+
onKeyup: Ke(f, ["enter"]),
|
|
4742
4742
|
class: "my-1 px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",
|
|
4743
4743
|
placeholder: _(a)("Archive name. (.zip file will be created)"),
|
|
4744
4744
|
type: "text"
|
|
4745
4745
|
}, null, 40, _c), [
|
|
4746
|
-
[
|
|
4746
|
+
[Ye, i.value]
|
|
4747
4747
|
])
|
|
4748
4748
|
])
|
|
4749
4749
|
])
|
|
@@ -4784,7 +4784,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4784
4784
|
d: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"
|
|
4785
4785
|
}, null, -1), Pc = [
|
|
4786
4786
|
Oc
|
|
4787
|
-
],
|
|
4787
|
+
], Ic = {
|
|
4788
4788
|
key: 1,
|
|
4789
4789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4790
4790
|
class: "h-5 w-5 text-neutral-500",
|
|
@@ -4792,13 +4792,13 @@ const al = { class: "flex" }, sl = {
|
|
|
4792
4792
|
viewBox: "0 0 24 24",
|
|
4793
4793
|
stroke: "currentColor",
|
|
4794
4794
|
"stroke-width": "1"
|
|
4795
|
-
},
|
|
4795
|
+
}, Nc = /* @__PURE__ */ d("path", {
|
|
4796
4796
|
"stroke-linecap": "round",
|
|
4797
4797
|
"stroke-linejoin": "round",
|
|
4798
4798
|
d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"
|
|
4799
|
-
}, null, -1),
|
|
4800
|
-
|
|
4801
|
-
],
|
|
4799
|
+
}, null, -1), Lc = [
|
|
4800
|
+
Nc
|
|
4801
|
+
], jc = { class: "ml-1.5" }, Vc = { class: "my-1 text-sm text-gray-500" }, zc = {
|
|
4802
4802
|
name: "VFModalUnarchive"
|
|
4803
4803
|
}, Bc = /* @__PURE__ */ Object.assign(zc, {
|
|
4804
4804
|
props: {
|
|
@@ -4806,7 +4806,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4806
4806
|
current: Object
|
|
4807
4807
|
},
|
|
4808
4808
|
setup(o) {
|
|
4809
|
-
const e = o, t =
|
|
4809
|
+
const e = o, t = R("emitter"), { getStore: n } = R("storage"), { t: a } = R("i18n");
|
|
4810
4810
|
V("");
|
|
4811
4811
|
const i = V(e.selection.items[0]), l = V([]), f = () => {
|
|
4812
4812
|
t.emit("vf-fetch", {
|
|
@@ -4816,8 +4816,8 @@ const al = { class: "flex" }, sl = {
|
|
|
4816
4816
|
item: i.value.path
|
|
4817
4817
|
});
|
|
4818
4818
|
};
|
|
4819
|
-
return (m, p) => (x(),
|
|
4820
|
-
buttons:
|
|
4819
|
+
return (m, p) => (x(), ce(ke, null, {
|
|
4820
|
+
buttons: ee(() => [
|
|
4821
4821
|
d("button", {
|
|
4822
4822
|
type: "button",
|
|
4823
4823
|
onClick: f,
|
|
@@ -4829,15 +4829,15 @@ const al = { class: "flex" }, sl = {
|
|
|
4829
4829
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
4830
4830
|
}, E(_(a)("Cancel")), 1)
|
|
4831
4831
|
]),
|
|
4832
|
-
default:
|
|
4832
|
+
default: ee(() => [
|
|
4833
4833
|
d("div", Dc, [
|
|
4834
4834
|
Cc,
|
|
4835
4835
|
d("div", Mc, [
|
|
4836
4836
|
d("h3", $c, E(_(a)("Unarchive")), 1),
|
|
4837
4837
|
d("div", Ec, [
|
|
4838
|
-
(x(!0), C(
|
|
4839
|
-
h.type == "dir" ? (x(), C("svg", Ac, Pc)) : (x(), C("svg",
|
|
4840
|
-
d("span",
|
|
4838
|
+
(x(!0), C(se, null, ve(l.value, (h) => (x(), C("p", Tc, [
|
|
4839
|
+
h.type == "dir" ? (x(), C("svg", Ac, Pc)) : (x(), C("svg", Ic, Lc)),
|
|
4840
|
+
d("span", jc, E(h.basename), 1)
|
|
4841
4841
|
]))), 256)),
|
|
4842
4842
|
d("p", Vc, E(_(a)("The archive will be unarchived at")) + " (" + E(o.current.dirname) + ")", 1)
|
|
4843
4843
|
])
|
|
@@ -4915,7 +4915,7 @@ const al = { class: "flex" }, sl = {
|
|
|
4915
4915
|
current: Object
|
|
4916
4916
|
},
|
|
4917
4917
|
setup(o) {
|
|
4918
|
-
const e = o, t =
|
|
4918
|
+
const e = o, t = R("emitter"), { t: n } = R("i18n"), { getStore: a } = R("storage"), i = V(e.selection.items.from), l = () => {
|
|
4919
4919
|
i.value.length && t.emit("vf-fetch", {
|
|
4920
4920
|
q: "move",
|
|
4921
4921
|
adapter: a("adapter", "local"),
|
|
@@ -4924,8 +4924,8 @@ const al = { class: "flex" }, sl = {
|
|
|
4924
4924
|
item: e.selection.items.to.path
|
|
4925
4925
|
});
|
|
4926
4926
|
};
|
|
4927
|
-
return (f, m) => (x(),
|
|
4928
|
-
buttons:
|
|
4927
|
+
return (f, m) => (x(), ce(ke, null, {
|
|
4928
|
+
buttons: ee(() => [
|
|
4929
4929
|
d("button", {
|
|
4930
4930
|
type: "button",
|
|
4931
4931
|
onClick: l,
|
|
@@ -4937,13 +4937,13 @@ const al = { class: "flex" }, sl = {
|
|
|
4937
4937
|
class: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
4938
4938
|
}, E(_(n)("Cancel")), 1)
|
|
4939
4939
|
]),
|
|
4940
|
-
default:
|
|
4940
|
+
default: ee(() => [
|
|
4941
4941
|
d("div", Rc, [
|
|
4942
4942
|
Hc,
|
|
4943
4943
|
d("div", Uc, [
|
|
4944
4944
|
d("h3", Kc, E(_(n)("Move files")), 1),
|
|
4945
4945
|
d("div", Yc, [
|
|
4946
|
-
(x(!0), C(
|
|
4946
|
+
(x(!0), C(se, null, ve(i.value, (p) => (x(), C("p", Wc, [
|
|
4947
4947
|
p.type == "dir" ? (x(), C("svg", Xc, qc)) : (x(), C("svg", Gc, Zc)),
|
|
4948
4948
|
d("span", Qc, E(p.path), 1)
|
|
4949
4949
|
]))), 256)),
|
|
@@ -4965,21 +4965,21 @@ const al = { class: "flex" }, sl = {
|
|
|
4965
4965
|
ModalMessage: Xa,
|
|
4966
4966
|
ModalNewFolder: rs,
|
|
4967
4967
|
ModalNewFile: ds,
|
|
4968
|
-
ModalPreview:
|
|
4968
|
+
ModalPreview: Nl,
|
|
4969
4969
|
ModalRename: Jl,
|
|
4970
4970
|
ModalUpload: lc,
|
|
4971
4971
|
ModalArchive: Sc,
|
|
4972
4972
|
ModalUnarchive: Bc,
|
|
4973
4973
|
ModalMove: ou
|
|
4974
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4974
|
+
}, Symbol.toStringTag, { value: "Module" })), kt = {
|
|
4975
4975
|
VueFinder: va,
|
|
4976
4976
|
...au
|
|
4977
4977
|
};
|
|
4978
4978
|
const cu = {
|
|
4979
4979
|
install(o) {
|
|
4980
|
-
for (const e in
|
|
4981
|
-
if (
|
|
4982
|
-
const t =
|
|
4980
|
+
for (const e in kt)
|
|
4981
|
+
if (kt.hasOwnProperty(e)) {
|
|
4982
|
+
const t = kt[e];
|
|
4983
4983
|
o.component(t.name, t);
|
|
4984
4984
|
}
|
|
4985
4985
|
}
|