@templatical/media-library 0.43.1 → 0.43.3
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/{MediaEditModal-g37o1fP4.js → MediaEditModal-CO_AVnsB.js} +140 -100
- package/dist/{cdn/chunks/ca-B1Ig3u8O.js → ca-DyHL0z4N.js} +6 -4
- package/dist/cdn/chunks/{MediaEditModal-984aDCxg.js → MediaEditModal-CdquYw2S.js} +317 -277
- package/dist/cdn/chunks/MediaEditModal-CdquYw2S.js.map +1 -0
- package/dist/{ca-B1Ig3u8O.js → cdn/chunks/ca-DyHL0z4N.js} +8 -2
- package/dist/cdn/chunks/ca-DyHL0z4N.js.map +1 -0
- package/dist/cdn/chunks/{de-BNbyJubD.js → de-Dcy8LcNQ.js} +7 -3
- package/dist/cdn/chunks/de-Dcy8LcNQ.js.map +1 -0
- package/dist/{en-CQxhpwqd.js → cdn/chunks/en-w2ihxIL6.js} +8 -2
- package/dist/cdn/chunks/en-w2ihxIL6.js.map +1 -0
- package/dist/cdn/chunks/{es-B2EH-TdJ.js → es-B43D0gmB.js} +7 -3
- package/dist/cdn/chunks/es-B43D0gmB.js.map +1 -0
- package/dist/cdn/chunks/{fr-9SWy_n9K.js → fr-DsxaRm09.js} +7 -3
- package/dist/cdn/chunks/fr-DsxaRm09.js.map +1 -0
- package/dist/cdn/chunks/{icons-4_7522gN.js → icons-DEo4BnEe.js} +6 -6
- package/dist/cdn/chunks/{icons-4_7522gN.js.map → icons-DEo4BnEe.js.map} +1 -1
- package/dist/{ja-CJeeGmVQ.js → cdn/chunks/ja-DDI6z0aO.js} +8 -2
- package/dist/cdn/chunks/ja-DDI6z0aO.js.map +1 -0
- package/dist/{nl-DJasgSvI.js → cdn/chunks/nl-CHa6u0cR.js} +8 -2
- package/dist/cdn/chunks/nl-CHa6u0cR.js.map +1 -0
- package/dist/cdn/chunks/{pt-BR-BtCfbqSj.js → pt-BR-CZmeAVC3.js} +7 -3
- package/dist/cdn/chunks/pt-BR-CZmeAVC3.js.map +1 -0
- package/dist/cdn/chunks/{useFocusTrap-5U5Mu8Hj.js → useFocusTrap-D2cf_o5B.js} +14 -13
- package/dist/cdn/chunks/useFocusTrap-D2cf_o5B.js.map +1 -0
- package/dist/cdn/media-library.css +1 -1
- package/dist/cdn/media-library.js +488 -449
- package/dist/cdn/media-library.js.map +1 -1
- package/dist/{de-BNbyJubD.js → de-Dcy8LcNQ.js} +6 -2
- package/dist/{cdn/chunks/en-CQxhpwqd.js → en-w2ihxIL6.js} +6 -4
- package/dist/{es-B2EH-TdJ.js → es-B43D0gmB.js} +6 -2
- package/dist/{fr-9SWy_n9K.js → fr-DsxaRm09.js} +6 -2
- package/dist/index.d.ts +8 -2
- package/dist/{cdn/chunks/ja-CJeeGmVQ.js → ja-DDI6z0aO.js} +6 -4
- package/dist/{cdn/chunks/nl-DJasgSvI.js → nl-CHa6u0cR.js} +6 -4
- package/dist/{pt-BR-BtCfbqSj.js → pt-BR-CZmeAVC3.js} +6 -2
- package/dist/templatical-media-library.css +1 -1
- package/dist/templatical-media-library.js +426 -387
- package/dist/{useFocusTrap-6eIRXtCA.js → useFocusTrap-CIacOa9R.js} +12 -11
- package/package.json +6 -6
- package/dist/cdn/chunks/MediaEditModal-984aDCxg.js.map +0 -1
- package/dist/cdn/chunks/ca-B1Ig3u8O.js.map +0 -1
- package/dist/cdn/chunks/de-BNbyJubD.js.map +0 -1
- package/dist/cdn/chunks/en-CQxhpwqd.js.map +0 -1
- package/dist/cdn/chunks/es-B2EH-TdJ.js.map +0 -1
- package/dist/cdn/chunks/fr-9SWy_n9K.js.map +0 -1
- package/dist/cdn/chunks/ja-CJeeGmVQ.js.map +0 -1
- package/dist/cdn/chunks/nl-DJasgSvI.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-BtCfbqSj.js.map +0 -1
- package/dist/cdn/chunks/useFocusTrap-5U5Mu8Hj.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as e, D as t, E as n, F as r, G as i, H as a, J as o, K as s, M as c, N as l, O as u, R as d, S as f, T as p, W as m, X as h, Z as g, ct as _, dt as v, j as y, k as b, lt as ee, nt as x, q as S, ut as te, w as ne, x as re, y as ie, z as ae } from "./icons-
|
|
2
|
-
import { f as oe, h as se, l as ce, n as le, t as ue, u as de } from "./useFocusTrap-
|
|
1
|
+
import { A as e, D as t, E as n, F as r, G as i, H as a, J as o, K as s, M as c, N as l, O as u, R as d, S as f, T as p, W as m, X as h, Z as g, ct as _, dt as v, j as y, k as b, lt as ee, nt as x, q as S, ut as te, w as ne, x as re, y as ie, z as ae } from "./icons-DEo4BnEe.js";
|
|
2
|
+
import { f as oe, h as se, l as ce, n as le, t as ue, u as de } from "./useFocusTrap-D2cf_o5B.js";
|
|
3
3
|
//#region src/composables/useImageCrop.ts
|
|
4
4
|
var fe = {
|
|
5
5
|
free: void 0,
|
|
@@ -92,7 +92,7 @@ function w(e, t, n) {
|
|
|
92
92
|
writable: !0
|
|
93
93
|
}) : e[t] = n, e;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function ve(e, t) {
|
|
96
96
|
if (e == null) return {};
|
|
97
97
|
var n, r, i = function(e, t) {
|
|
98
98
|
if (e == null) return {};
|
|
@@ -106,28 +106,28 @@ function T(e, t) {
|
|
|
106
106
|
}
|
|
107
107
|
return i;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function T(e) {
|
|
110
110
|
return function(e) {
|
|
111
|
-
if (Array.isArray(e)) return
|
|
111
|
+
if (Array.isArray(e)) return E(e);
|
|
112
112
|
}(e) || function(e) {
|
|
113
113
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
114
114
|
}(e) || function(e, t) {
|
|
115
115
|
if (e) {
|
|
116
|
-
if (typeof e == "string") return
|
|
116
|
+
if (typeof e == "string") return E(e, t);
|
|
117
117
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
118
118
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
119
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
119
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return E(e, t);
|
|
120
120
|
}
|
|
121
121
|
}(e) || function() {
|
|
122
122
|
throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
123
123
|
}();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function E(e, t) {
|
|
126
126
|
(t == null || t > e.length) && (t = e.length);
|
|
127
127
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
128
128
|
return r;
|
|
129
129
|
}
|
|
130
|
-
var
|
|
130
|
+
var D = function(e) {
|
|
131
131
|
(function() {
|
|
132
132
|
var t = {}.hasOwnProperty;
|
|
133
133
|
function n() {
|
|
@@ -151,15 +151,15 @@ var ve = function(e) {
|
|
|
151
151
|
}
|
|
152
152
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
153
153
|
})();
|
|
154
|
-
},
|
|
155
|
-
path:
|
|
154
|
+
}, O, k, A = (D(k = {
|
|
155
|
+
path: O,
|
|
156
156
|
exports: {},
|
|
157
157
|
require: function(e, t) {
|
|
158
158
|
return function() {
|
|
159
159
|
throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
160
|
-
}(t == null &&
|
|
160
|
+
}(t == null && k.path);
|
|
161
161
|
}
|
|
162
|
-
},
|
|
162
|
+
}, k.exports), k.exports), j = function(e) {
|
|
163
163
|
return function(t, n) {
|
|
164
164
|
if (!t) return e;
|
|
165
165
|
var r;
|
|
@@ -171,7 +171,7 @@ var ve = function(e) {
|
|
|
171
171
|
}), "") : "");
|
|
172
172
|
};
|
|
173
173
|
};
|
|
174
|
-
function
|
|
174
|
+
function M(e, t, n) {
|
|
175
175
|
var r, i, a, o, s;
|
|
176
176
|
function c() {
|
|
177
177
|
var l = Date.now() - o;
|
|
@@ -189,8 +189,8 @@ function j(e, t, n) {
|
|
|
189
189
|
r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
|
|
190
190
|
}, l;
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
var
|
|
192
|
+
M.debounce = M;
|
|
193
|
+
var ye = M, N = function() {
|
|
194
194
|
return N = Object.assign || function(e) {
|
|
195
195
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
196
196
|
return e;
|
|
@@ -206,48 +206,48 @@ function P(e, t) {
|
|
|
206
206
|
function F(e) {
|
|
207
207
|
return /^blob:/.test(e);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function I(e) {
|
|
210
210
|
return F(e) || function(e) {
|
|
211
211
|
return /^data:/.test(e);
|
|
212
212
|
}(e);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function L(e) {
|
|
215
215
|
return !!(e && e.constructor && e.call && e.apply);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function R(e) {
|
|
218
218
|
return e === void 0;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function be(e) {
|
|
221
221
|
return typeof e == "object" && !!e;
|
|
222
222
|
}
|
|
223
223
|
function xe(e, t, n) {
|
|
224
224
|
var r = {};
|
|
225
|
-
return
|
|
226
|
-
r[i] =
|
|
225
|
+
return be(e) ? (Object.keys(t).forEach((function(i) {
|
|
226
|
+
r[i] = R(e[i]) ? t[i] : be(t[i]) ? be(e[i]) ? xe(e[i], t[i], n[i]) : e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? !!e[i] : e[i];
|
|
227
227
|
})), r) : e ? t : n;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function z(e) {
|
|
230
230
|
var t = Number(e);
|
|
231
231
|
return Number.isNaN(t) ? e : t;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Se(e) {
|
|
234
234
|
return typeof (e == "number" || function(e) {
|
|
235
235
|
return typeof e == "object" && !!e;
|
|
236
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
236
|
+
}(e) && toString.call(e) == "[object Number]") && !Ce(e);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function Ce(e) {
|
|
239
239
|
return e != e;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function we(e, t) {
|
|
242
242
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
243
243
|
}
|
|
244
|
-
var
|
|
244
|
+
var B = function(e, t) {
|
|
245
245
|
e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
|
|
246
|
-
},
|
|
246
|
+
}, Te = function(e, t) {
|
|
247
247
|
t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
|
|
248
|
-
},
|
|
248
|
+
}, Ee = function(e) {
|
|
249
249
|
this.type = "move", this.directions = e;
|
|
250
|
-
},
|
|
250
|
+
}, De = function() {
|
|
251
251
|
function e(e, t, n, r, i) {
|
|
252
252
|
this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
|
|
253
253
|
}
|
|
@@ -265,7 +265,7 @@ var z = function(e, t) {
|
|
|
265
265
|
top: 0
|
|
266
266
|
};
|
|
267
267
|
}, e;
|
|
268
|
-
}(),
|
|
268
|
+
}(), Oe = {
|
|
269
269
|
name: "DraggableElement",
|
|
270
270
|
props: { classname: { type: String } },
|
|
271
271
|
beforeMount: function() {
|
|
@@ -286,7 +286,7 @@ var z = function(e, t) {
|
|
|
286
286
|
this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
|
|
287
287
|
},
|
|
288
288
|
onTouchStart: function(e) {
|
|
289
|
-
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches =
|
|
289
|
+
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = T(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
|
|
290
290
|
return {
|
|
291
291
|
clientX: t.clientX + n.clientX / e.touches.length,
|
|
292
292
|
clientY: t.clientY + n.clientY / e.touches.length
|
|
@@ -332,11 +332,11 @@ var z = function(e, t) {
|
|
|
332
332
|
};
|
|
333
333
|
},
|
|
334
334
|
processMove: function(e, t) {
|
|
335
|
-
var n =
|
|
335
|
+
var n = T(t);
|
|
336
336
|
if (this.touches.length) {
|
|
337
337
|
if (this.touches.length === 1 && n.length === 1) {
|
|
338
338
|
var r = this.$refs.draggable;
|
|
339
|
-
this.$emit("drag", new
|
|
339
|
+
this.$emit("drag", new De(e, r, {
|
|
340
340
|
left: n[0].clientX,
|
|
341
341
|
top: n[0].clientY
|
|
342
342
|
}, {
|
|
@@ -358,7 +358,7 @@ var z = function(e, t) {
|
|
|
358
358
|
"enter"
|
|
359
359
|
]
|
|
360
360
|
};
|
|
361
|
-
|
|
361
|
+
Oe.render = function(e, t, n, r, o, s) {
|
|
362
362
|
return a(), b("div", {
|
|
363
363
|
ref: "draggable",
|
|
364
364
|
class: n.classname,
|
|
@@ -376,9 +376,9 @@ ke.render = function(e, t, n, r, o, s) {
|
|
|
376
376
|
}
|
|
377
377
|
}, [i(e.$slots, "default")], 34);
|
|
378
378
|
};
|
|
379
|
-
var
|
|
379
|
+
var ke = j("vue-handler-wrapper"), Ae = {
|
|
380
380
|
name: "HandlerWrapper",
|
|
381
|
-
components: { DraggableElement:
|
|
381
|
+
components: { DraggableElement: Oe },
|
|
382
382
|
props: {
|
|
383
383
|
horizontalPosition: { type: String },
|
|
384
384
|
verticalPosition: { type: String },
|
|
@@ -391,11 +391,11 @@ var Ae = A("vue-handler-wrapper"), je = {
|
|
|
391
391
|
var e;
|
|
392
392
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
393
393
|
var t, n = P(this.horizontalPosition, this.verticalPosition);
|
|
394
|
-
e =
|
|
395
|
-
} else e =
|
|
394
|
+
e = ke((w(t = {}, n.classname, !0), w(t, "disabled", this.disabled), t));
|
|
395
|
+
} else e = ke({ disabled: this.disabled });
|
|
396
396
|
return {
|
|
397
397
|
root: e,
|
|
398
|
-
draggable:
|
|
398
|
+
draggable: ke("draggable")
|
|
399
399
|
};
|
|
400
400
|
} },
|
|
401
401
|
emits: [
|
|
@@ -405,7 +405,7 @@ var Ae = A("vue-handler-wrapper"), je = {
|
|
|
405
405
|
"drag-end"
|
|
406
406
|
]
|
|
407
407
|
};
|
|
408
|
-
|
|
408
|
+
Ae.render = function(e, t, n, r, o, c) {
|
|
409
409
|
var u = s("DraggableElement");
|
|
410
410
|
return a(), b("div", { class: c.classes.root }, [l(u, {
|
|
411
411
|
class: c.classes.draggable,
|
|
@@ -428,9 +428,9 @@ je.render = function(e, t, n, r, o, c) {
|
|
|
428
428
|
_: 3
|
|
429
429
|
}, 8, ["class"])], 2);
|
|
430
430
|
};
|
|
431
|
-
var
|
|
431
|
+
var je = j("vue-line-wrapper"), Me = {
|
|
432
432
|
name: "LineWrapper",
|
|
433
|
-
components: { DraggableElement:
|
|
433
|
+
components: { DraggableElement: Oe },
|
|
434
434
|
props: {
|
|
435
435
|
position: {
|
|
436
436
|
type: String,
|
|
@@ -443,7 +443,7 @@ var Me = A("vue-line-wrapper"), Ne = {
|
|
|
443
443
|
},
|
|
444
444
|
computed: { classname: function() {
|
|
445
445
|
var e;
|
|
446
|
-
return
|
|
446
|
+
return je((w(e = {}, this.position, !0), w(e, "disabled", this.disabled), e));
|
|
447
447
|
} },
|
|
448
448
|
emits: [
|
|
449
449
|
"leave",
|
|
@@ -452,7 +452,7 @@ var Me = A("vue-line-wrapper"), Ne = {
|
|
|
452
452
|
"drag-end"
|
|
453
453
|
]
|
|
454
454
|
};
|
|
455
|
-
|
|
455
|
+
Me.render = function(e, t, n, r, o, c) {
|
|
456
456
|
var l = s("DraggableElement");
|
|
457
457
|
return a(), b(l, {
|
|
458
458
|
class: c.classname,
|
|
@@ -475,23 +475,23 @@ Ne.render = function(e, t, n, r, o, c) {
|
|
|
475
475
|
_: 3
|
|
476
476
|
}, 8, ["class"]);
|
|
477
477
|
};
|
|
478
|
-
var
|
|
478
|
+
var V = [
|
|
479
479
|
"left",
|
|
480
480
|
"right",
|
|
481
481
|
"top",
|
|
482
482
|
"bottom"
|
|
483
|
-
],
|
|
483
|
+
], Ne = ["left", "right"], Pe = ["top", "bottom"], Fe = ["left", "top"], Ie = [
|
|
484
484
|
"fill-area",
|
|
485
485
|
"fit-area",
|
|
486
486
|
"stencil",
|
|
487
487
|
"none"
|
|
488
|
-
],
|
|
488
|
+
], Le = {
|
|
489
489
|
left: 0,
|
|
490
490
|
top: 0,
|
|
491
491
|
width: 0,
|
|
492
492
|
height: 0
|
|
493
493
|
};
|
|
494
|
-
function
|
|
494
|
+
function Re(e, t, n) {
|
|
495
495
|
return !(n ||= [
|
|
496
496
|
"width",
|
|
497
497
|
"height",
|
|
@@ -501,7 +501,7 @@ function ze(e, t, n) {
|
|
|
501
501
|
return e[n] !== t[n];
|
|
502
502
|
}));
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function H(e) {
|
|
505
505
|
return {
|
|
506
506
|
left: e.left,
|
|
507
507
|
top: e.top,
|
|
@@ -509,31 +509,31 @@ function V(e) {
|
|
|
509
509
|
bottom: e.top + e.height
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function U(e, t) {
|
|
513
513
|
return {
|
|
514
514
|
left: e.left - t.left,
|
|
515
515
|
top: e.top - t.top
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function W(e) {
|
|
519
519
|
return {
|
|
520
520
|
left: e.left + e.width / 2,
|
|
521
521
|
top: e.top + e.height / 2
|
|
522
522
|
};
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function ze(e, t) {
|
|
525
525
|
var n = {
|
|
526
526
|
left: 0,
|
|
527
527
|
top: 0,
|
|
528
528
|
right: 0,
|
|
529
529
|
bottom: 0
|
|
530
530
|
};
|
|
531
|
-
return
|
|
532
|
-
var i = t[r], a =
|
|
531
|
+
return V.forEach((function(r) {
|
|
532
|
+
var i = t[r], a = H(e)[r];
|
|
533
533
|
n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
|
|
534
534
|
})), n;
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function G(e, t) {
|
|
537
537
|
return {
|
|
538
538
|
left: e.left - t.left,
|
|
539
539
|
top: e.top - t.top,
|
|
@@ -541,22 +541,22 @@ function W(e, t) {
|
|
|
541
541
|
height: e.height + t.top + t.bottom
|
|
542
542
|
};
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function Be(e) {
|
|
545
545
|
return {
|
|
546
546
|
left: -e.left,
|
|
547
547
|
top: -e.top
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function K(e, t) {
|
|
551
551
|
return N(N({}, e), {
|
|
552
552
|
left: e.left + t.left,
|
|
553
553
|
top: e.top + t.top
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function q(e, t, n, r) {
|
|
557
557
|
if (t !== 1) {
|
|
558
558
|
if (n) {
|
|
559
|
-
var i =
|
|
559
|
+
var i = W(e);
|
|
560
560
|
return {
|
|
561
561
|
width: e.width * t,
|
|
562
562
|
height: e.height * t,
|
|
@@ -573,17 +573,17 @@ function K(e, t, n, r) {
|
|
|
573
573
|
}
|
|
574
574
|
return e;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function J(e) {
|
|
577
577
|
return e.width / e.height;
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function Y(e, t) {
|
|
580
580
|
return Math.min(t.right !== void 0 && t.left !== void 0 ? (t.right - t.left) / e.width : 1 / 0, t.bottom !== void 0 && t.top !== void 0 ? (t.bottom - t.top) / e.height : 1 / 0);
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function Ve(e, t) {
|
|
583
583
|
var n = {
|
|
584
584
|
left: 0,
|
|
585
585
|
top: 0
|
|
586
|
-
}, r =
|
|
586
|
+
}, r = ze(e, t);
|
|
587
587
|
return r.left && r.left > 0 ? n.left = r.left : r.right && r.right > 0 && (n.left = -r.right), r.top && r.top > 0 ? n.top = r.top : r.bottom && r.bottom > 0 && (n.top = -r.bottom), n;
|
|
588
588
|
}
|
|
589
589
|
function He(e, t) {
|
|
@@ -591,7 +591,7 @@ function He(e, t) {
|
|
|
591
591
|
return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
|
|
592
592
|
}
|
|
593
593
|
function Ue(e, t) {
|
|
594
|
-
var n =
|
|
594
|
+
var n = J(e), r = J(t);
|
|
595
595
|
return t.width < 1 / 0 && t.height < 1 / 0 ? n > r ? {
|
|
596
596
|
width: t.width,
|
|
597
597
|
height: t.width / n
|
|
@@ -621,13 +621,13 @@ function X(e, t) {
|
|
|
621
621
|
};
|
|
622
622
|
}
|
|
623
623
|
function Ge(e, t) {
|
|
624
|
-
var n =
|
|
625
|
-
return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width,
|
|
624
|
+
var n = ze(Z(e, t), t);
|
|
625
|
+
return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, Y(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, Y(e, t)) : 1;
|
|
626
626
|
}
|
|
627
627
|
function Z(e, t, n) {
|
|
628
628
|
n === void 0 && (n = !1);
|
|
629
|
-
var r =
|
|
630
|
-
return
|
|
629
|
+
var r = Ve(e, t);
|
|
630
|
+
return K(e, n ? Be(r) : r);
|
|
631
631
|
}
|
|
632
632
|
function Ke(e) {
|
|
633
633
|
return {
|
|
@@ -646,7 +646,7 @@ function qe(e, t) {
|
|
|
646
646
|
function Je(e, t, n) {
|
|
647
647
|
n === void 0 && (n = !0);
|
|
648
648
|
var r = {};
|
|
649
|
-
return
|
|
649
|
+
return V.forEach((function(i) {
|
|
650
650
|
var a = e[i], o = t[i];
|
|
651
651
|
a !== void 0 && o !== void 0 ? r[i] = i === "left" || i === "top" ? n ? Math.max(a, o) : Math.min(a, o) : n ? Math.min(a, o) : Math.max(a, o) : o === void 0 ? a !== void 0 && (r[i] = a) : r[i] = o;
|
|
652
652
|
})), r;
|
|
@@ -656,7 +656,7 @@ function Ye(e, t) {
|
|
|
656
656
|
}
|
|
657
657
|
function Xe(e) {
|
|
658
658
|
var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
|
|
659
|
-
return !!((t.correctRatio ||
|
|
659
|
+
return !!((t.correctRatio || J(t) >= n.minimum && J(t) <= n.maximum) && t.height <= i.maxHeight && t.width <= i.maxWidth && t.width && t.height && (r || t.height >= i.minHeight && t.width >= i.minWidth));
|
|
660
660
|
}
|
|
661
661
|
function Ze(e, t) {
|
|
662
662
|
return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
|
|
@@ -708,15 +708,15 @@ function Q(e) {
|
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
710
|
function Qe(e) {
|
|
711
|
-
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a =
|
|
712
|
-
return
|
|
711
|
+
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = K(n, t.directions);
|
|
712
|
+
return K(a, Ve(a, i));
|
|
713
713
|
}
|
|
714
714
|
function $e(e) {
|
|
715
715
|
var t = e.coordinates, n = e.transform, r = e.imageSize, i = e.sizeRestrictions, a = e.positionRestrictions, o = e.aspectRatio, s = e.visibleArea, c = function(e, t) {
|
|
716
716
|
return Qe({
|
|
717
717
|
coordinates: e,
|
|
718
718
|
positionRestrictions: a,
|
|
719
|
-
event: new
|
|
719
|
+
event: new Ee({
|
|
720
720
|
left: t.left - e.left,
|
|
721
721
|
top: t.top - e.top
|
|
722
722
|
})
|
|
@@ -724,11 +724,11 @@ function $e(e) {
|
|
|
724
724
|
}, l = N({}, t);
|
|
725
725
|
return (Array.isArray(n) ? n : [n]).forEach((function(e) {
|
|
726
726
|
var t = {};
|
|
727
|
-
|
|
727
|
+
R((t = typeof e == "function" ? e({
|
|
728
728
|
coordinates: l,
|
|
729
729
|
imageSize: r,
|
|
730
730
|
visibleArea: s
|
|
731
|
-
}) : e).width) &&
|
|
731
|
+
}) : e).width) && R(t.height) || (l = function(e, t) {
|
|
732
732
|
return c(N(N(N({}, e), Q({
|
|
733
733
|
width: t.width,
|
|
734
734
|
height: t.height,
|
|
@@ -741,29 +741,29 @@ function $e(e) {
|
|
|
741
741
|
left: e.left,
|
|
742
742
|
top: e.top
|
|
743
743
|
});
|
|
744
|
-
}(l, N(N({}, l), t))),
|
|
744
|
+
}(l, N(N({}, l), t))), R(t.left) && R(t.top) || (l = c(l, N(N({}, l), t)));
|
|
745
745
|
})), l;
|
|
746
746
|
}
|
|
747
747
|
function et(e) {
|
|
748
748
|
var t = e.getAreaRestrictions, n = e.boundaries, r = e.coordinates, i = e.visibleArea, a = e.stencilSize, o = e.sizeRestrictions, s = e.positionRestrictions, c, l, u, d = N({}, r), f = N({}, i), p = N({}, a);
|
|
749
|
-
c =
|
|
749
|
+
c = J(p), l = J(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = N(N({}, d), Q({
|
|
750
750
|
sizeRestrictions: o,
|
|
751
751
|
width: d.width,
|
|
752
752
|
height: d.height,
|
|
753
753
|
aspectRatio: {
|
|
754
|
-
minimum:
|
|
755
|
-
maximum:
|
|
754
|
+
minimum: J(p),
|
|
755
|
+
maximum: J(p)
|
|
756
756
|
}
|
|
757
757
|
})));
|
|
758
|
-
var m = Ge(f =
|
|
758
|
+
var m = Ge(f = q(f, d.width * n.width / (f.width * p.width)), t({
|
|
759
759
|
visibleArea: f,
|
|
760
760
|
type: "resize"
|
|
761
761
|
}));
|
|
762
|
-
return m !== 1 && (f =
|
|
762
|
+
return m !== 1 && (f = q(f, m), d = q(d, m)), f = Z(f = K(f, U(W(d), W(f))), t({
|
|
763
763
|
visibleArea: f,
|
|
764
764
|
type: "move"
|
|
765
765
|
})), {
|
|
766
|
-
coordinates: d = Z(d, Ye(
|
|
766
|
+
coordinates: d = Z(d, Ye(H(f), s)),
|
|
767
767
|
visibleArea: f
|
|
768
768
|
};
|
|
769
769
|
}
|
|
@@ -774,15 +774,15 @@ function tt(e) {
|
|
|
774
774
|
width: 0,
|
|
775
775
|
height: 0
|
|
776
776
|
};
|
|
777
|
-
|
|
778
|
-
var u = Ge(c =
|
|
777
|
+
J(r) > J(s) ? (l.height = .8 * r.height, l.width = l.height * J(s)) : (l.width = .8 * r.width, l.height = l.width * J(s));
|
|
778
|
+
var u = Ge(c = q(c, s.width * r.width / (c.width * l.width)), n({
|
|
779
779
|
visibleArea: c,
|
|
780
780
|
type: "resize"
|
|
781
781
|
}));
|
|
782
|
-
c =
|
|
782
|
+
c = q(c, u), u !== 1 && (l.height /= u, l.width /= u), c = Z(c = K(c, U(W(s), W(c))), n({
|
|
783
783
|
visibleArea: c,
|
|
784
784
|
type: "move"
|
|
785
|
-
})), s = Z(s, Ye(
|
|
785
|
+
})), s = Z(s, Ye(H(c), o));
|
|
786
786
|
}
|
|
787
787
|
return {
|
|
788
788
|
coordinates: s,
|
|
@@ -793,13 +793,13 @@ function nt(e) {
|
|
|
793
793
|
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = N({}, r), o = N({}, n);
|
|
794
794
|
if (t.type === "setCoordinates") {
|
|
795
795
|
var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
|
|
796
|
-
s > c ? a =
|
|
796
|
+
s > c ? a = q(a, Math.min(o.width / a.width, Y(a, i({
|
|
797
797
|
visibleArea: a,
|
|
798
798
|
type: "resize"
|
|
799
|
-
})))) : c > s && (a =
|
|
799
|
+
})))) : c > s && (a = q(a, Math.min(o.height / a.height, Y(a, i({
|
|
800
800
|
visibleArea: a,
|
|
801
801
|
type: "resize"
|
|
802
|
-
}))))), a = Z(a =
|
|
802
|
+
}))))), a = Z(a = K(a, Be(Ve(o, H(a)))), i({
|
|
803
803
|
visibleArea: a,
|
|
804
804
|
type: "move"
|
|
805
805
|
}));
|
|
@@ -817,7 +817,7 @@ function rt(e) {
|
|
|
817
817
|
};
|
|
818
818
|
}
|
|
819
819
|
function it(e) {
|
|
820
|
-
var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || 1 / 0, Math.max(r.minimum || 0,
|
|
820
|
+
var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || 1 / 0, Math.max(r.minimum || 0, J(a))), s = a.width < a.height ? {
|
|
821
821
|
width: .8 * a.width,
|
|
822
822
|
height: .8 * a.width / o
|
|
823
823
|
} : {
|
|
@@ -831,7 +831,7 @@ function it(e) {
|
|
|
831
831
|
}
|
|
832
832
|
function at(e) {
|
|
833
833
|
var t, n, r = e.imageSize, i = e.visibleArea, a = e.boundaries, o = e.aspectRatio, s = e.sizeRestrictions, c = e.stencilSize, l = i || r;
|
|
834
|
-
return
|
|
834
|
+
return J(l) > J(a) ? n = (t = c.height * l.height / a.height) * J(c) : t = (n = c.width * l.width / a.width) / J(c), Q({
|
|
835
835
|
width: n,
|
|
836
836
|
height: t,
|
|
837
837
|
aspectRatio: o,
|
|
@@ -839,26 +839,26 @@ function at(e) {
|
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
841
|
function ot(e) {
|
|
842
|
-
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i =
|
|
842
|
+
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = J(e.boundaries);
|
|
843
843
|
if (n) {
|
|
844
844
|
var a = {
|
|
845
845
|
height: Math.max(n.height, r.height),
|
|
846
846
|
width: Math.max(n.width, r.width)
|
|
847
847
|
}, o = Ue({
|
|
848
|
-
width:
|
|
849
|
-
height:
|
|
848
|
+
width: J(a) > i ? a.width : a.height * i,
|
|
849
|
+
height: J(a) > i ? a.width / i : a.height
|
|
850
850
|
}, Ke(t())), s = {
|
|
851
851
|
left: n.left + n.width / 2 - o.width / 2,
|
|
852
852
|
top: n.top + n.height / 2 - o.height / 2,
|
|
853
853
|
width: o.width,
|
|
854
854
|
height: o.height
|
|
855
|
-
}, c =
|
|
855
|
+
}, c = ze(n, H(N({
|
|
856
856
|
left: 0,
|
|
857
857
|
top: 0
|
|
858
858
|
}, r))), l = {};
|
|
859
859
|
return !c.left && !c.right && s.width <= r.width && (l.left = 0, l.right = r.width), !c.top && !c.bottom && s.height <= r.height && (l.top = 0, l.bottom = r.height), Z(s, l);
|
|
860
860
|
}
|
|
861
|
-
var u =
|
|
861
|
+
var u = J(r);
|
|
862
862
|
return o = {
|
|
863
863
|
height: u > i ? r.height : r.width / i,
|
|
864
864
|
width: u > i ? r.height * i : r.width
|
|
@@ -870,27 +870,27 @@ function ot(e) {
|
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
872
|
function st(e, t) {
|
|
873
|
-
return Je(e,
|
|
873
|
+
return Je(e, H(t));
|
|
874
874
|
}
|
|
875
875
|
function ct(e) {
|
|
876
876
|
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.sizeRestrictions, a = e.getAreaRestrictions, o = e.positionRestrictions, s = e.adjustStencil, c = t.scale, l = t.move, u = N({}, r), d = N({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
|
|
877
|
-
u =
|
|
877
|
+
u = K(u, {
|
|
878
878
|
left: l.left || 0,
|
|
879
879
|
top: l.top || 0
|
|
880
880
|
});
|
|
881
881
|
var h = {
|
|
882
882
|
stencil: {
|
|
883
883
|
minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
|
|
884
|
-
maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : 1 / 0, i.maxHeight ? i.maxHeight / d.height : 1 / 0,
|
|
884
|
+
maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : 1 / 0, i.maxHeight ? i.maxHeight / d.height : 1 / 0, Y(d, o))
|
|
885
885
|
},
|
|
886
|
-
area: { maximum:
|
|
886
|
+
area: { maximum: Y(u, a({
|
|
887
887
|
visibleArea: u,
|
|
888
888
|
type: "resize"
|
|
889
889
|
})) }
|
|
890
890
|
};
|
|
891
|
-
c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u =
|
|
891
|
+
c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u = q(u, p, c.center));
|
|
892
892
|
var g = n.left - r.left, _ = r.width + r.left - (n.width + n.left), v = n.top - r.top, y = r.height + r.top - (n.height + n.top);
|
|
893
|
-
return u = Z(u =
|
|
893
|
+
return u = Z(u = K(u, Ve(u, {
|
|
894
894
|
left: o.left === void 0 ? void 0 : o.left - g * p,
|
|
895
895
|
top: o.top === void 0 ? void 0 : o.top - v * p,
|
|
896
896
|
bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
|
|
@@ -898,16 +898,16 @@ function ct(e) {
|
|
|
898
898
|
})), a({
|
|
899
899
|
visibleArea: u,
|
|
900
900
|
type: "move"
|
|
901
|
-
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = Z(d, Ye(
|
|
901
|
+
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = Z(d, Ye(H(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = K(u = Z(u = q(u, f, c.factor > 1 ? c.center : W(d)), a({
|
|
902
902
|
visibleArea: u,
|
|
903
903
|
type: "move"
|
|
904
|
-
})), Ve(
|
|
904
|
+
})), Be(Ve(d, H(u)))))), {
|
|
905
905
|
coordinates: d,
|
|
906
906
|
visibleArea: u
|
|
907
907
|
};
|
|
908
908
|
}
|
|
909
909
|
function lt(e) {
|
|
910
|
-
var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = N({}, r), d = N({}, i), f = X(
|
|
910
|
+
var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = N({}, r), d = N({}, i), f = X(W(N({
|
|
911
911
|
left: 0,
|
|
912
912
|
top: 0
|
|
913
913
|
}, c)), l);
|
|
@@ -916,12 +916,12 @@ function lt(e) {
|
|
|
916
916
|
aspectRatio: t,
|
|
917
917
|
width: u.width,
|
|
918
918
|
height: u.height
|
|
919
|
-
})), X(
|
|
919
|
+
})), X(W(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = q(d, Ge(d, n({
|
|
920
920
|
visibleArea: d,
|
|
921
921
|
type: "resize"
|
|
922
922
|
}))), {
|
|
923
923
|
coordinates: u = Z(u, o),
|
|
924
|
-
visibleArea: d = Z(d =
|
|
924
|
+
visibleArea: d = Z(d = K(d, U(W(u), W(r))), n({
|
|
925
925
|
visibleArea: d,
|
|
926
926
|
type: "move"
|
|
927
927
|
}))
|
|
@@ -933,14 +933,14 @@ function ut(e) {
|
|
|
933
933
|
var f = X({
|
|
934
934
|
left: s.width / 2,
|
|
935
935
|
top: s.height / 2
|
|
936
|
-
}, -r), p = X(
|
|
936
|
+
}, -r), p = X(W(c), -r), m = X({
|
|
937
937
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
938
938
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
939
939
|
}, r);
|
|
940
|
-
c =
|
|
940
|
+
c = K(c, U(m, W(c))), p = X(W(l), -r), l = Z(l = K(l, U(m = X({
|
|
941
941
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
942
942
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
943
|
-
}, r),
|
|
943
|
+
}, r), W(l))), i({
|
|
944
944
|
visibleArea: l,
|
|
945
945
|
type: "move"
|
|
946
946
|
}));
|
|
@@ -951,10 +951,10 @@ function ut(e) {
|
|
|
951
951
|
};
|
|
952
952
|
}
|
|
953
953
|
function dt(e) {
|
|
954
|
-
var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = N({}, t), l =
|
|
954
|
+
var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = N({}, t), l = G(n, c).width, u = G(n, c).height;
|
|
955
955
|
l < 0 && (c.left < 0 && c.right < 0 ? (c.left = -(n.width - a.minWidth) / (c.left / c.right), c.right = -(n.width - a.minWidth) / (c.right / c.left)) : c.left < 0 ? c.left = -(n.width - a.minWidth) : c.right < 0 && (c.right = -(n.width - a.minWidth))), u < 0 && (c.top < 0 && c.bottom < 0 ? (c.top = -(n.height - a.minHeight) / (c.top / c.bottom), c.bottom = -(n.height - a.minHeight) / (c.bottom / c.top)) : c.top < 0 ? c.top = -(n.height - a.minHeight) : c.bottom < 0 && (c.bottom = -(n.height - a.minHeight)));
|
|
956
|
-
var d =
|
|
957
|
-
s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d =
|
|
956
|
+
var d = ze(G(n, c), i);
|
|
957
|
+
s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = ze(G(n, c), i));
|
|
958
958
|
var f = {
|
|
959
959
|
width: 1 / 0,
|
|
960
960
|
height: 1 / 0,
|
|
@@ -963,27 +963,27 @@ function dt(e) {
|
|
|
963
963
|
top: 1 / 0,
|
|
964
964
|
bottom: 1 / 0
|
|
965
965
|
};
|
|
966
|
-
if (
|
|
966
|
+
if (V.forEach((function(e) {
|
|
967
967
|
var t = d[e];
|
|
968
968
|
t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
|
|
969
969
|
})), o) {
|
|
970
|
-
var p = Math.min.apply(null,
|
|
970
|
+
var p = Math.min.apply(null, V.map((function(e) {
|
|
971
971
|
return f[e];
|
|
972
972
|
})));
|
|
973
|
-
p !== 1 / 0 &&
|
|
973
|
+
p !== 1 / 0 && V.forEach((function(e) {
|
|
974
974
|
c[e] *= p;
|
|
975
975
|
}));
|
|
976
|
-
} else
|
|
976
|
+
} else V.forEach((function(e) {
|
|
977
977
|
f[e] !== 1 / 0 && (c[e] *= f[e]);
|
|
978
978
|
}));
|
|
979
|
-
if (l =
|
|
979
|
+
if (l = G(n, c).width, u = G(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
|
|
980
980
|
var m = Math.min(f.width, f.height);
|
|
981
|
-
m !== 1 / 0 &&
|
|
981
|
+
m !== 1 / 0 && V.forEach((function(e) {
|
|
982
982
|
c[e] *= m;
|
|
983
983
|
}));
|
|
984
|
-
} else f.width !== 1 / 0 &&
|
|
984
|
+
} else f.width !== 1 / 0 && Ne.forEach((function(e) {
|
|
985
985
|
c[e] *= f.width;
|
|
986
|
-
})), f.height !== 1 / 0 &&
|
|
986
|
+
})), f.height !== 1 / 0 && Pe.forEach((function(e) {
|
|
987
987
|
c[e] *= f.height;
|
|
988
988
|
}));
|
|
989
989
|
return c;
|
|
@@ -991,9 +991,9 @@ function dt(e) {
|
|
|
991
991
|
function ft(e, t, n) {
|
|
992
992
|
return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
|
|
993
993
|
}
|
|
994
|
-
var pt =
|
|
994
|
+
var pt = j("vue-simple-handler"), mt = j("vue-simple-handler-wrapper"), ht = {
|
|
995
995
|
name: "SimpleHandler",
|
|
996
|
-
components: { HandlerWrapper:
|
|
996
|
+
components: { HandlerWrapper: Ae },
|
|
997
997
|
props: {
|
|
998
998
|
defaultClass: { type: String },
|
|
999
999
|
hoverClass: { type: String },
|
|
@@ -1011,8 +1011,8 @@ var pt = A("vue-simple-handler"), mt = A("vue-simple-handler-wrapper"), ht = {
|
|
|
1011
1011
|
computed: { classes: function() {
|
|
1012
1012
|
var e, t = (w(e = {}, this.horizontalPosition, !!this.horizontalPosition), w(e, this.verticalPosition, !!this.verticalPosition), w(e, `${this.horizontalPosition}-${this.verticalPosition}`, !!(this.verticalPosition && this.horizontalPosition)), w(e, "hover", this.hover), e);
|
|
1013
1013
|
return {
|
|
1014
|
-
default:
|
|
1015
|
-
wrapper:
|
|
1014
|
+
default: A(pt(t), this.defaultClass, this.hover && this.hoverClass),
|
|
1015
|
+
wrapper: A(mt(t), this.wrapperClass)
|
|
1016
1016
|
};
|
|
1017
1017
|
} },
|
|
1018
1018
|
methods: {
|
|
@@ -1058,9 +1058,9 @@ ht.render = function(e, t, n, r, i, o) {
|
|
|
1058
1058
|
"onLeave"
|
|
1059
1059
|
]);
|
|
1060
1060
|
};
|
|
1061
|
-
var gt =
|
|
1061
|
+
var gt = j("vue-simple-line"), _t = j("vue-simple-line-wrapper"), vt = {
|
|
1062
1062
|
name: "SimpleLine",
|
|
1063
|
-
components: { LineWrapper:
|
|
1063
|
+
components: { LineWrapper: Me },
|
|
1064
1064
|
props: {
|
|
1065
1065
|
defaultClass: { type: String },
|
|
1066
1066
|
hoverClass: { type: String },
|
|
@@ -1076,8 +1076,8 @@ var gt = A("vue-simple-line"), _t = A("vue-simple-line-wrapper"), vt = {
|
|
|
1076
1076
|
},
|
|
1077
1077
|
computed: { classes: function() {
|
|
1078
1078
|
return {
|
|
1079
|
-
root:
|
|
1080
|
-
wrapper:
|
|
1079
|
+
root: A(gt(w({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
|
|
1080
|
+
wrapper: A(_t(w({}, this.position, !0)), this.wrapperClass)
|
|
1081
1081
|
};
|
|
1082
1082
|
} },
|
|
1083
1083
|
methods: {
|
|
@@ -1121,7 +1121,7 @@ vt.render = function(e, t, n, r, i, o) {
|
|
|
1121
1121
|
"onLeave"
|
|
1122
1122
|
]);
|
|
1123
1123
|
};
|
|
1124
|
-
var yt =
|
|
1124
|
+
var yt = j("vue-bounding-box"), bt = [
|
|
1125
1125
|
"east",
|
|
1126
1126
|
"west",
|
|
1127
1127
|
null
|
|
@@ -1239,8 +1239,8 @@ var yt = A("vue-bounding-box"), bt = [
|
|
|
1239
1239
|
n.horizontalDirection && n.verticalDirection || !e.lines[n.name] || t.push({
|
|
1240
1240
|
name: n.name,
|
|
1241
1241
|
component: e.linesComponent,
|
|
1242
|
-
class:
|
|
1243
|
-
wrapperClass:
|
|
1242
|
+
class: A(e.classes.lines.default, e.classes.lines[n.name], !e.resizable && e.classes.lines.disabled),
|
|
1243
|
+
wrapperClass: A(e.classes.linesWrappers.default, e.classes.linesWrappers[n.name], !e.resizable && e.classes.linesWrappers.disabled),
|
|
1244
1244
|
hoverClass: e.classes.lines.hover,
|
|
1245
1245
|
verticalDirection: n.verticalDirection,
|
|
1246
1246
|
horizontalDirection: n.horizontalDirection,
|
|
@@ -1255,8 +1255,8 @@ var yt = A("vue-bounding-box"), bt = [
|
|
|
1255
1255
|
var a = {
|
|
1256
1256
|
name: i.name,
|
|
1257
1257
|
component: e.handlersComponent,
|
|
1258
|
-
class:
|
|
1259
|
-
wrapperClass:
|
|
1258
|
+
class: A(e.classes.handlers.default, e.classes.handlers[i.name]),
|
|
1259
|
+
wrapperClass: A(e.classes.handlersWrappers.default, e.classes.handlersWrappers[i.name]),
|
|
1260
1260
|
hoverClass: e.classes.handlers.hover,
|
|
1261
1261
|
verticalDirection: i.verticalDirection,
|
|
1262
1262
|
horizontalDirection: i.horizontalDirection,
|
|
@@ -1291,7 +1291,7 @@ var yt = A("vue-bounding-box"), bt = [
|
|
|
1291
1291
|
top: 0,
|
|
1292
1292
|
bottom: 0
|
|
1293
1293
|
};
|
|
1294
|
-
t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new
|
|
1294
|
+
t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new Te(s, {
|
|
1295
1295
|
allowedDirections: {
|
|
1296
1296
|
left: t === "west" || !t,
|
|
1297
1297
|
right: t === "east" || !t,
|
|
@@ -1365,7 +1365,7 @@ St.render = function(e, t, n, r, o, s) {
|
|
|
1365
1365
|
})), 128))
|
|
1366
1366
|
], 6);
|
|
1367
1367
|
};
|
|
1368
|
-
var Ct =
|
|
1368
|
+
var Ct = j("vue-draggable-area"), wt = {
|
|
1369
1369
|
name: "DraggableArea",
|
|
1370
1370
|
props: {
|
|
1371
1371
|
movable: {
|
|
@@ -1393,14 +1393,14 @@ var Ct = A("vue-draggable-area"), wt = {
|
|
|
1393
1393
|
onTouchStart: function(e) {
|
|
1394
1394
|
if (e.cancelable) {
|
|
1395
1395
|
var t = this.movable && e.touches.length === 1;
|
|
1396
|
-
t && (this.touches =
|
|
1396
|
+
t && (this.touches = T(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
|
|
1397
1397
|
}
|
|
1398
1398
|
},
|
|
1399
1399
|
onTouchEnd: function() {
|
|
1400
1400
|
this.touchStarted = !1, this.processEnd();
|
|
1401
1401
|
},
|
|
1402
1402
|
onTouchMove: function(e) {
|
|
1403
|
-
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) :
|
|
1403
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : we({
|
|
1404
1404
|
x: this.touches[0].clientX,
|
|
1405
1405
|
y: this.touches[0].clientY
|
|
1406
1406
|
}, {
|
|
@@ -1439,10 +1439,10 @@ var Ct = A("vue-draggable-area"), wt = {
|
|
|
1439
1439
|
};
|
|
1440
1440
|
},
|
|
1441
1441
|
processMove: function(e, t) {
|
|
1442
|
-
var n =
|
|
1442
|
+
var n = T(t);
|
|
1443
1443
|
if (this.touches.length) {
|
|
1444
1444
|
var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
|
|
1445
|
-
this.touches.length === 1 && n.length === 1 && this.$emit("move", new
|
|
1445
|
+
this.touches.length === 1 && n.length === 1 && this.$emit("move", new Ee({
|
|
1446
1446
|
left: n[0].clientX - (i + this.anchor.x),
|
|
1447
1447
|
top: n[0].clientY - (a + this.anchor.y)
|
|
1448
1448
|
}));
|
|
@@ -1551,7 +1551,7 @@ function kt(e, t) {
|
|
|
1551
1551
|
return e.forEach((function(t) {
|
|
1552
1552
|
a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
|
|
1553
1553
|
})), e.forEach((function(e) {
|
|
1554
|
-
o +=
|
|
1554
|
+
o += we({
|
|
1555
1555
|
x: a.left,
|
|
1556
1556
|
y: a.top
|
|
1557
1557
|
}, {
|
|
@@ -1594,18 +1594,18 @@ var At = {
|
|
|
1594
1594
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
1595
1595
|
},
|
|
1596
1596
|
created: function() {
|
|
1597
|
-
this.transforming = !1, this.debouncedProcessEnd =
|
|
1597
|
+
this.transforming = !1, this.debouncedProcessEnd = ye(this.processEnd), this.touches = [];
|
|
1598
1598
|
},
|
|
1599
1599
|
methods: {
|
|
1600
1600
|
processMove: function(e, t) {
|
|
1601
1601
|
if (this.touches.length) {
|
|
1602
|
-
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new
|
|
1602
|
+
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new B({
|
|
1603
1603
|
left: this.touches[0].clientX - t[0].clientX,
|
|
1604
1604
|
top: this.touches[0].clientY - t[0].clientY
|
|
1605
1605
|
}));
|
|
1606
1606
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
1607
1607
|
var n = kt(t, this.$refs.container), r = this.oldGeometricProperties;
|
|
1608
|
-
r.count === n.count && r.count > 1 && this.$emit("resize", new
|
|
1608
|
+
r.count === n.count && r.count > 1 && this.$emit("resize", new B({
|
|
1609
1609
|
left: r.centerMass.left - n.centerMass.left,
|
|
1610
1610
|
top: r.centerMass.top - n.centerMass.top
|
|
1611
1611
|
}, {
|
|
@@ -1628,7 +1628,7 @@ var At = {
|
|
|
1628
1628
|
onTouchStart: function(e) {
|
|
1629
1629
|
if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
|
|
1630
1630
|
var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
|
|
1631
|
-
this.touches =
|
|
1631
|
+
this.touches = T(e.touches).filter((function(e) {
|
|
1632
1632
|
return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
|
|
1633
1633
|
})), this.oldGeometricProperties = kt(this.touches, t);
|
|
1634
1634
|
}
|
|
@@ -1639,7 +1639,7 @@ var At = {
|
|
|
1639
1639
|
onTouchMove: function(e) {
|
|
1640
1640
|
var t = this;
|
|
1641
1641
|
if (this.touches.length) {
|
|
1642
|
-
var n =
|
|
1642
|
+
var n = T(e.touches).filter((function(e) {
|
|
1643
1643
|
return !e.identifier || t.touches.find((function(t) {
|
|
1644
1644
|
return t.identifier === e.identifier;
|
|
1645
1645
|
}));
|
|
@@ -1668,11 +1668,11 @@ var At = {
|
|
|
1668
1668
|
},
|
|
1669
1669
|
onWheel: function(e) {
|
|
1670
1670
|
if (this.wheelResize && this.processEvent(e)) {
|
|
1671
|
-
var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 ||
|
|
1671
|
+
var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || Ce(s) ? s : s > 0 ? 1 : -1), a = {
|
|
1672
1672
|
left: e.clientX - n,
|
|
1673
1673
|
top: e.clientY - r
|
|
1674
1674
|
};
|
|
1675
|
-
this.$emit("resize", new
|
|
1675
|
+
this.$emit("resize", new B({}, {
|
|
1676
1676
|
factor: i,
|
|
1677
1677
|
center: a
|
|
1678
1678
|
})), this.touches.length || this.debouncedProcessEnd();
|
|
@@ -1747,7 +1747,7 @@ jt.render = function(e, t, n, r, o, c) {
|
|
|
1747
1747
|
"wheel-resize"
|
|
1748
1748
|
]);
|
|
1749
1749
|
};
|
|
1750
|
-
var Mt =
|
|
1750
|
+
var Mt = j("vue-preview"), Nt = {
|
|
1751
1751
|
props: {
|
|
1752
1752
|
coordinates: { type: Object },
|
|
1753
1753
|
transitions: { type: Object },
|
|
@@ -1780,7 +1780,7 @@ var Mt = A("vue-preview"), Nt = {
|
|
|
1780
1780
|
root: Mt({ fill: this.fill }),
|
|
1781
1781
|
wrapper: Mt("wrapper"),
|
|
1782
1782
|
imageWrapper: Mt("image-wrapper"),
|
|
1783
|
-
image:
|
|
1783
|
+
image: A(Mt("image"), this.imageClass)
|
|
1784
1784
|
};
|
|
1785
1785
|
},
|
|
1786
1786
|
style: function() {
|
|
@@ -1895,7 +1895,7 @@ Pt.render = function(e, t, n, r, i, o) {
|
|
|
1895
1895
|
var c = s("preview");
|
|
1896
1896
|
return a(), b(c, ae(e.$attrs, { fill: !0 }), null, 16);
|
|
1897
1897
|
};
|
|
1898
|
-
var Ft =
|
|
1898
|
+
var Ft = j("vue-rectangle-stencil"), It = {
|
|
1899
1899
|
name: "RectangleStencil",
|
|
1900
1900
|
components: {
|
|
1901
1901
|
StencilPreview: Pt,
|
|
@@ -1970,13 +1970,13 @@ var Ft = A("vue-rectangle-stencil"), It = {
|
|
|
1970
1970
|
computed: {
|
|
1971
1971
|
classes: function() {
|
|
1972
1972
|
return {
|
|
1973
|
-
stencil:
|
|
1973
|
+
stencil: A(Ft({
|
|
1974
1974
|
movable: this.movable,
|
|
1975
1975
|
moving: this.moving,
|
|
1976
1976
|
resizing: this.resizing
|
|
1977
1977
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
1978
|
-
preview:
|
|
1979
|
-
boundingBox:
|
|
1978
|
+
preview: A(Ft("preview"), this.previewClass),
|
|
1979
|
+
boundingBox: A(Ft("bounding-box"), this.boundingBoxClass)
|
|
1980
1980
|
};
|
|
1981
1981
|
},
|
|
1982
1982
|
style: function() {
|
|
@@ -2086,7 +2086,7 @@ It.render = function(e, t, n, r, i, o) {
|
|
|
2086
2086
|
"onResizeEnd"
|
|
2087
2087
|
])], 6);
|
|
2088
2088
|
};
|
|
2089
|
-
var Lt = ["transitions"], $ =
|
|
2089
|
+
var Lt = ["transitions"], $ = j("vue-advanced-cropper"), Rt = {
|
|
2090
2090
|
name: "Cropper",
|
|
2091
2091
|
components: { BackgroundWrapper: jt },
|
|
2092
2092
|
props: {
|
|
@@ -2152,7 +2152,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2152
2152
|
type: String,
|
|
2153
2153
|
default: "fit-area",
|
|
2154
2154
|
validator: function(e) {
|
|
2155
|
-
return
|
|
2155
|
+
return Ie.indexOf(e) !== -1;
|
|
2156
2156
|
}
|
|
2157
2157
|
},
|
|
2158
2158
|
roundResult: {
|
|
@@ -2195,15 +2195,15 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2195
2195
|
bottom: !0,
|
|
2196
2196
|
top: !0
|
|
2197
2197
|
};
|
|
2198
|
-
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0),
|
|
2198
|
+
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), V.forEach((function(e) {
|
|
2199
2199
|
l[e] || (c[e] = 0);
|
|
2200
2200
|
}));
|
|
2201
|
-
var u =
|
|
2201
|
+
var u = G(o, c = dt({
|
|
2202
2202
|
coordinates: o,
|
|
2203
2203
|
directions: c,
|
|
2204
2204
|
sizeRestrictions: a,
|
|
2205
2205
|
positionRestrictions: i
|
|
2206
|
-
})).width, d =
|
|
2206
|
+
})).width, d = G(o, c).height, f = s.preserveRatio ? J(o) : He(u / d, r);
|
|
2207
2207
|
if (f) {
|
|
2208
2208
|
var p = s.respectDirection;
|
|
2209
2209
|
if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
|
|
@@ -2228,10 +2228,10 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2228
2228
|
compensate: s.compensate
|
|
2229
2229
|
});
|
|
2230
2230
|
}
|
|
2231
|
-
return u =
|
|
2231
|
+
return u = G(o, c).width, d = G(o, c).height, (f = s.preserveRatio ? J(o) : He(u / d, r)) && Math.abs(f - u / d) > .001 && V.forEach((function(e) {
|
|
2232
2232
|
l[e] || (c[e] = 0);
|
|
2233
2233
|
})), Qe({
|
|
2234
|
-
event: new
|
|
2234
|
+
event: new Ee({
|
|
2235
2235
|
left: -c.left,
|
|
2236
2236
|
top: -c.top
|
|
2237
2237
|
}),
|
|
@@ -2252,7 +2252,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2252
2252
|
initStretcher: {
|
|
2253
2253
|
type: Function,
|
|
2254
2254
|
default: function(e) {
|
|
2255
|
-
var t = e.stretcher, n = e.imageSize, r =
|
|
2255
|
+
var t = e.stretcher, n = e.imageSize, r = J(n);
|
|
2256
2256
|
t.style.width = n.width + "px", t.style.height = t.clientWidth / r + "px", t.style.width = t.clientWidth + "px";
|
|
2257
2257
|
}
|
|
2258
2258
|
},
|
|
@@ -2270,19 +2270,19 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2270
2270
|
minWidth: Math.min(t.width, i.minWidth)
|
|
2271
2271
|
}
|
|
2272
2272
|
}));
|
|
2273
|
-
return o = Z(o =
|
|
2273
|
+
return o = Z(o = K(o, U(W(n), W(o))), Ye(H(t), a));
|
|
2274
2274
|
}
|
|
2275
2275
|
},
|
|
2276
2276
|
fitVisibleArea: {
|
|
2277
2277
|
type: Function,
|
|
2278
2278
|
default: function(e) {
|
|
2279
2279
|
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = N({}, t);
|
|
2280
|
-
a.height = a.width /
|
|
2281
|
-
var o = Ve(
|
|
2280
|
+
a.height = a.width / J(n), a.top += (t.height - a.height) / 2, (i.height - a.height > 0 || i.width - a.width > 0) && (a = q(a, Math.max(i.height / a.height, i.width / a.width)));
|
|
2281
|
+
var o = Be(Ve(i, H(a = q(a, Ge(a, r({
|
|
2282
2282
|
visibleArea: a,
|
|
2283
2283
|
type: "resize"
|
|
2284
2284
|
}))))));
|
|
2285
|
-
return a.width < i.width && (o.left = 0), a.height < i.height && (o.top = 0), a = Z(a =
|
|
2285
|
+
return a.width < i.width && (o.left = 0), a.height < i.height && (o.top = 0), a = Z(a = K(a, o), r({
|
|
2286
2286
|
visibleArea: a,
|
|
2287
2287
|
type: "move"
|
|
2288
2288
|
}));
|
|
@@ -2297,7 +2297,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2297
2297
|
top: 0,
|
|
2298
2298
|
right: r.width,
|
|
2299
2299
|
bottom: r.height
|
|
2300
|
-
} : i === "fit-area" && (
|
|
2300
|
+
} : i === "fit-area" && (J(n) > J(r) ? (o = {
|
|
2301
2301
|
top: 0,
|
|
2302
2302
|
bottom: r.height
|
|
2303
2303
|
}, t && a === "move" && (t.width > r.width ? (o.left = -(t.width - r.width) / 2, o.right = r.width - o.left) : (o.left = 0, o.right = r.width))) : (o = {
|
|
@@ -2359,7 +2359,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2359
2359
|
height: 0
|
|
2360
2360
|
},
|
|
2361
2361
|
visibleArea: null,
|
|
2362
|
-
coordinates: C({},
|
|
2362
|
+
coordinates: C({}, Le)
|
|
2363
2363
|
};
|
|
2364
2364
|
},
|
|
2365
2365
|
computed: {
|
|
@@ -2438,10 +2438,10 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2438
2438
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
2439
2439
|
var e = this.sizeRestrictionsAlgorithm({
|
|
2440
2440
|
imageSize: this.imageSize,
|
|
2441
|
-
minWidth:
|
|
2442
|
-
minHeight:
|
|
2443
|
-
maxWidth:
|
|
2444
|
-
maxHeight:
|
|
2441
|
+
minWidth: R(this.minWidth) ? 0 : z(this.minWidth),
|
|
2442
|
+
minHeight: R(this.minHeight) ? 0 : z(this.minHeight),
|
|
2443
|
+
maxWidth: R(this.maxWidth) ? 1 / 0 : z(this.maxWidth),
|
|
2444
|
+
maxHeight: R(this.maxHeight) ? 1 / 0 : z(this.maxHeight)
|
|
2445
2445
|
});
|
|
2446
2446
|
if (e = function(e) {
|
|
2447
2447
|
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = N(N({}, n), {
|
|
@@ -2490,14 +2490,14 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2490
2490
|
classes: function() {
|
|
2491
2491
|
return {
|
|
2492
2492
|
cropper: $(),
|
|
2493
|
-
image:
|
|
2493
|
+
image: A($("image"), this.imageClass),
|
|
2494
2494
|
stencil: $("stencil"),
|
|
2495
|
-
boundaries:
|
|
2496
|
-
stretcher:
|
|
2497
|
-
background:
|
|
2498
|
-
foreground:
|
|
2499
|
-
imageWrapper:
|
|
2500
|
-
cropperWrapper:
|
|
2495
|
+
boundaries: A($("boundaries"), this.boundariesClass),
|
|
2496
|
+
stretcher: A($("stretcher")),
|
|
2497
|
+
background: A($("background"), this.backgroundClass),
|
|
2498
|
+
foreground: A($("foreground"), this.foregroundClass),
|
|
2499
|
+
imageWrapper: A($("image-wrapper")),
|
|
2500
|
+
cropperWrapper: A($("cropper-wrapper"))
|
|
2501
2501
|
};
|
|
2502
2502
|
},
|
|
2503
2503
|
stencilCoordinates: function() {
|
|
@@ -2583,7 +2583,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2583
2583
|
}
|
|
2584
2584
|
},
|
|
2585
2585
|
created: function() {
|
|
2586
|
-
this.debouncedUpdate =
|
|
2586
|
+
this.debouncedUpdate = ye(this.update, this.debounce), this.debouncedDisableTransitions = ye(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
2587
2587
|
},
|
|
2588
2588
|
mounted: function() {
|
|
2589
2589
|
this.$refs.image.addEventListener("load", this.onSuccessLoadImage), this.$refs.image.addEventListener("error", this.onFailLoadImage), this.onChangeImage(), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
|
|
@@ -2619,7 +2619,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2619
2619
|
},
|
|
2620
2620
|
zoom: function(e, t) {
|
|
2621
2621
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
2622
|
-
this.onManipulateImage(new
|
|
2622
|
+
this.onManipulateImage(new B({}, {
|
|
2623
2623
|
factor: 1 / e,
|
|
2624
2624
|
center: t
|
|
2625
2625
|
}), {
|
|
@@ -2629,7 +2629,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2629
2629
|
},
|
|
2630
2630
|
move: function(e, t) {
|
|
2631
2631
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
2632
|
-
this.onManipulateImage(new
|
|
2632
|
+
this.onManipulateImage(new B({
|
|
2633
2633
|
left: e || 0,
|
|
2634
2634
|
top: t || 0
|
|
2635
2635
|
}), {
|
|
@@ -2694,10 +2694,10 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2694
2694
|
sizeRestrictions: this.sizeRestrictions,
|
|
2695
2695
|
stencilSize: this.getStencilSize()
|
|
2696
2696
|
});
|
|
2697
|
-
return C(C({}, a), {}, { changed: !
|
|
2697
|
+
return C(C({}, a), {}, { changed: !Re(a.visibleArea, t) || !Re(a.coordinates, n) });
|
|
2698
2698
|
},
|
|
2699
2699
|
runAutoZoom: function(e) {
|
|
2700
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i =
|
|
2700
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = ve(t, Lt), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
|
|
2701
2701
|
r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
|
|
2702
2702
|
},
|
|
2703
2703
|
normalizeEvent: function(e) {
|
|
@@ -2718,13 +2718,13 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2718
2718
|
});
|
|
2719
2719
|
if (t.type === "resize") {
|
|
2720
2720
|
var i = N(N({}, t), { directions: N({}, t.directions) });
|
|
2721
|
-
return
|
|
2721
|
+
return V.forEach((function(e) {
|
|
2722
2722
|
i.directions[e] *= r;
|
|
2723
2723
|
})), i;
|
|
2724
2724
|
}
|
|
2725
2725
|
if (t.type === "move") {
|
|
2726
2726
|
var a = N(N({}, t), { directions: N({}, t.directions) });
|
|
2727
|
-
return
|
|
2727
|
+
return Fe.forEach((function(e) {
|
|
2728
2728
|
a.directions[e] *= r;
|
|
2729
2729
|
})), a;
|
|
2730
2730
|
}
|
|
@@ -2739,7 +2739,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2739
2739
|
height: t.naturalHeight
|
|
2740
2740
|
}, o = We(a, r), s = e.getContext("2d");
|
|
2741
2741
|
e.height = o.height, e.width = o.width, s.save();
|
|
2742
|
-
var c = X(
|
|
2742
|
+
var c = X(W(N({
|
|
2743
2743
|
left: 0,
|
|
2744
2744
|
top: 0
|
|
2745
2745
|
}, a)), r);
|
|
@@ -2809,7 +2809,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2809
2809
|
this.$refs.cropper, this.$refs.image;
|
|
2810
2810
|
var t = this.defaultSize;
|
|
2811
2811
|
t ||= this.stencilSize ? at : it, this.sizeRestrictions;
|
|
2812
|
-
var n =
|
|
2812
|
+
var n = L(t) ? t({
|
|
2813
2813
|
boundaries: this.boundaries,
|
|
2814
2814
|
imageSize: this.imageSize,
|
|
2815
2815
|
aspectRatio: this.getAspectRatio(),
|
|
@@ -2818,13 +2818,13 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2818
2818
|
visibleArea: this.visibleArea
|
|
2819
2819
|
}) : t, r = this.defaultPosition || rt, i = [n, function(t) {
|
|
2820
2820
|
var n = t.coordinates;
|
|
2821
|
-
return C({},
|
|
2821
|
+
return C({}, L(r) ? r({
|
|
2822
2822
|
coordinates: n,
|
|
2823
2823
|
imageSize: e.imageSize,
|
|
2824
2824
|
visibleArea: e.visibleArea
|
|
2825
2825
|
}) : e.defaultPosition);
|
|
2826
2826
|
}];
|
|
2827
|
-
this.delayedTransforms && i.push.apply(i,
|
|
2827
|
+
this.delayedTransforms && i.push.apply(i, T(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
|
|
2828
2828
|
}
|
|
2829
2829
|
},
|
|
2830
2830
|
clearImage: function() {
|
|
@@ -2854,7 +2854,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2854
2854
|
cropper: n,
|
|
2855
2855
|
imageSize: e.imageSize
|
|
2856
2856
|
};
|
|
2857
|
-
if (e.boundaries =
|
|
2857
|
+
if (e.boundaries = L(e.defaultBoundaries) ? e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? function(e) {
|
|
2858
2858
|
var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
|
|
2859
2859
|
return o > i && (o = i, a = n.height * i / n.width), {
|
|
2860
2860
|
width: o,
|
|
@@ -2874,7 +2874,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2874
2874
|
return this.appliedImageTransforms = C(C({}, this.defaultImageTransforms), {}, { flip: C({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
2875
2875
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
2876
2876
|
var t, n, r, i, a, o, s = e.defaultVisibleArea || ot;
|
|
2877
|
-
e.visibleArea =
|
|
2877
|
+
e.visibleArea = L(s) ? s({
|
|
2878
2878
|
imageSize: e.imageSize,
|
|
2879
2879
|
boundaries: e.boundaries,
|
|
2880
2880
|
coordinates: e.priority === "visible-area" ? null : e.coordinates,
|
|
@@ -2884,7 +2884,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2884
2884
|
visibleArea: e.visibleArea,
|
|
2885
2885
|
boundaries: e.boundaries,
|
|
2886
2886
|
getAreaRestrictions: e.getAreaRestrictions
|
|
2887
|
-
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = N({}, n), o =
|
|
2887
|
+
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = N({}, n), o = J(r), a.width / a.height !== o && (a.height = a.width / o), Z(a, i({
|
|
2888
2888
|
visibleArea: a,
|
|
2889
2889
|
type: "move"
|
|
2890
2890
|
}))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({
|
|
@@ -2925,7 +2925,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2925
2925
|
var e, t = this;
|
|
2926
2926
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
2927
2927
|
if (function(e) {
|
|
2928
|
-
if (
|
|
2928
|
+
if (I(e)) return !1;
|
|
2929
2929
|
var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
|
|
2930
2930
|
protocol: n[1] || "",
|
|
2931
2931
|
host: n[2] || "",
|
|
@@ -2935,7 +2935,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2935
2935
|
};
|
|
2936
2936
|
return !(!r.protocol && !r.host && !r.port || r.protocol && r.protocol == t.protocol && r.host && r.host == t.host && r.host && i(r) == i(t));
|
|
2937
2937
|
}(this.src)) {
|
|
2938
|
-
var n =
|
|
2938
|
+
var n = R(this.crossOrigin) ? this.canvas : this.crossOrigin;
|
|
2939
2939
|
!0 === n && (n = "anonymous"), this.imageAttributes.crossOrigin = n || null;
|
|
2940
2940
|
}
|
|
2941
2941
|
if (this.checkOrientation) {
|
|
@@ -2978,13 +2978,13 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
2978
2978
|
},
|
|
2979
2979
|
onParseImage: function(e) {
|
|
2980
2980
|
var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
|
|
2981
|
-
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? F(n) || !
|
|
2981
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? F(n) || !I(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
|
|
2982
2982
|
for (var t = [], n = new Uint8Array(e); n.length > 0;) {
|
|
2983
2983
|
var r = n.subarray(0, 8192);
|
|
2984
2984
|
t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
|
|
2985
2985
|
}
|
|
2986
2986
|
return "data:image/jpeg;base64," + btoa(t.join(""));
|
|
2987
|
-
}(r) : this.imageAttributes.src = n, this.appliedImageTransforms =
|
|
2987
|
+
}(r) : this.imageAttributes.src = n, this.appliedImageTransforms = L(this.defaultTransforms) ? Tt(this.defaultTransforms()) : be(this.defaultTransforms) ? Tt(this.defaultTransforms) : function(e) {
|
|
2988
2988
|
var t = Tt({});
|
|
2989
2989
|
if (e) switch (e) {
|
|
2990
2990
|
case 2:
|
|
@@ -3080,9 +3080,9 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
3080
3080
|
var s = this.$refs.stencil.aspectRatios();
|
|
3081
3081
|
t = s.minimum, n = s.maximum;
|
|
3082
3082
|
}
|
|
3083
|
-
if (
|
|
3084
|
-
var c = this.getStencilSize(), l = c ?
|
|
3085
|
-
|
|
3083
|
+
if (R(t) && (t = R(i) ? a : i), R(n) && (n = R(i) ? o : i), !e && (R(t) || R(n))) {
|
|
3084
|
+
var c = this.getStencilSize(), l = c ? J(c) : null;
|
|
3085
|
+
R(t) && (t = Se(l) ? l : void 0), R(n) && (n = Se(l) ? l : void 0);
|
|
3086
3086
|
}
|
|
3087
3087
|
return {
|
|
3088
3088
|
minimum: t,
|
|
@@ -3100,7 +3100,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
3100
3100
|
coefficient: this.coefficient,
|
|
3101
3101
|
coordinates: this.coordinates,
|
|
3102
3102
|
aspectRatio: this.getAspectRatio(!0)
|
|
3103
|
-
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, He(
|
|
3103
|
+
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, He(J(i = L(n) ? n({
|
|
3104
3104
|
boundaries: t,
|
|
3105
3105
|
aspectRatio: r
|
|
3106
3106
|
}) : n), r) && (i = Q({
|
|
@@ -3126,8 +3126,8 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
3126
3126
|
width: i.width,
|
|
3127
3127
|
height: i.height,
|
|
3128
3128
|
aspectRatio: {
|
|
3129
|
-
minimum:
|
|
3130
|
-
maximum:
|
|
3129
|
+
minimum: J(i),
|
|
3130
|
+
maximum: J(i)
|
|
3131
3131
|
}
|
|
3132
3132
|
})), i;
|
|
3133
3133
|
var e, t, n, r, i;
|
|
@@ -3145,7 +3145,7 @@ var Lt = ["transitions"], $ = A("vue-advanced-cropper"), Rt = {
|
|
|
3145
3145
|
};
|
|
3146
3146
|
},
|
|
3147
3147
|
defaultCoordinates: function() {
|
|
3148
|
-
return C({},
|
|
3148
|
+
return C({}, Le);
|
|
3149
3149
|
},
|
|
3150
3150
|
flip: function(e, t) {
|
|
3151
3151
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
@@ -3332,68 +3332,105 @@ var Vt = ["data-tpl-theme"], Ht = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ut
|
|
|
3332
3332
|
for: "tpl-media-alt",
|
|
3333
3333
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
3334
3334
|
style: { color: "var(--tpl-text-muted)" }
|
|
3335
|
-
}, vn = ["placeholder"], yn = {
|
|
3335
|
+
}, vn = ["placeholder"], yn = {
|
|
3336
|
+
key: 0,
|
|
3337
|
+
id: "tpl-media-edit-error",
|
|
3338
|
+
role: "alert",
|
|
3339
|
+
class: "tpl:shrink-0 tpl:px-5 tpl:pt-3 tpl:text-xs",
|
|
3340
|
+
style: { color: "var(--tpl-danger)" }
|
|
3341
|
+
}, bn = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, xn = ["disabled"], Sn = ["disabled"], Cn = /*#__PURE__*/ le(/* @__PURE__ */ r({
|
|
3336
3342
|
__name: "MediaEditModal",
|
|
3337
3343
|
props: {
|
|
3338
3344
|
visible: { type: Boolean },
|
|
3339
|
-
item: {}
|
|
3345
|
+
item: {},
|
|
3346
|
+
save: { type: Function },
|
|
3347
|
+
canCrop: { type: Boolean }
|
|
3340
3348
|
},
|
|
3341
|
-
emits: ["
|
|
3349
|
+
emits: ["close"],
|
|
3342
3350
|
setup(r, { emit: i }) {
|
|
3343
|
-
let s = r, f = i, { t: S } = de(), ae = d(se, null), le = d(oe, x(null)), _e = S.mediaLibrary, { isImageMimeType: C } = ce(), w = x(""),
|
|
3351
|
+
let s = r, f = i, { t: S } = de(), ae = d(se, null), le = d(oe, x(null)), _e = S.mediaLibrary, { isImageMimeType: C } = ce(), w = x(""), ve = x(""), T = x(null), E = x("free"), D = x(void 0), O = x(void 0), k = x(""), A = x(""), j = x(void 0), M = x(null), ye = x(!1), N = x(!1), P = x(!1), F = x(null), I = null, L = [
|
|
3344
3352
|
"image/jpeg",
|
|
3345
3353
|
"image/png",
|
|
3346
|
-
"image/webp"
|
|
3347
|
-
|
|
3348
|
-
].includes(s.item.mimeType ?? "") : !1), be = t(() => D.value === "original" ? A.value : fe[D.value]), I = t(() => j.value ? ge(j.value.width, j.value.height, ve.value, ye.value) : null);
|
|
3354
|
+
"image/webp"
|
|
3355
|
+
], R = t(() => !s.item || !s.canCrop ? !1 : L.includes(s.item.mimeType ?? "")), be = t(() => D.value !== void 0 || O.value !== void 0), xe = t(() => E.value === "original" ? j.value : fe[E.value]), z = t(() => M.value ? ge(M.value.width, M.value.height, D.value, O.value) : null);
|
|
3349
3356
|
o(() => s.visible, (e) => {
|
|
3350
|
-
e && s.item && (w.value = s.item.filename ?? "",
|
|
3357
|
+
e && s.item && (w.value = s.item.filename ?? "", ve.value = s.item.alt ?? "", E.value = "free", D.value = void 0, O.value = void 0, k.value = "", A.value = "", j.value = void 0, M.value = null, ye.value = !1, P.value = !1, F.value = null, I = null, s.item.width && s.item.height && (j.value = s.item.width / s.item.height));
|
|
3351
3358
|
}, { immediate: !0 });
|
|
3352
|
-
function
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3359
|
+
function Se(e) {
|
|
3360
|
+
return {
|
|
3361
|
+
left: Math.round(e.left),
|
|
3362
|
+
top: Math.round(e.top),
|
|
3363
|
+
width: Math.round(e.width),
|
|
3364
|
+
height: Math.round(e.height)
|
|
3365
|
+
};
|
|
3357
3366
|
}
|
|
3358
|
-
function
|
|
3359
|
-
|
|
3367
|
+
function Ce(e, t) {
|
|
3368
|
+
return e.left === t.left && e.top === t.top && e.width === t.width && e.height === t.height;
|
|
3360
3369
|
}
|
|
3361
|
-
function
|
|
3370
|
+
function we(e) {
|
|
3371
|
+
if (!e.coordinates) return;
|
|
3372
|
+
let t = Se(e.coordinates);
|
|
3373
|
+
if (M.value = {
|
|
3374
|
+
width: t.width,
|
|
3375
|
+
height: t.height
|
|
3376
|
+
}, !I) {
|
|
3377
|
+
I = t;
|
|
3378
|
+
return;
|
|
3379
|
+
}
|
|
3380
|
+
P.value = !Ce(t, I);
|
|
3381
|
+
}
|
|
3382
|
+
function B({ imageSize: e }) {
|
|
3383
|
+
return {
|
|
3384
|
+
width: e.width,
|
|
3385
|
+
height: e.height
|
|
3386
|
+
};
|
|
3387
|
+
}
|
|
3388
|
+
function Te() {
|
|
3389
|
+
ye.value = !0, !j.value && s.item?.width && s.item?.height && (j.value = s.item.width / s.item.height);
|
|
3390
|
+
}
|
|
3391
|
+
function Ee(e) {
|
|
3362
3392
|
let t = e.target.value;
|
|
3363
|
-
|
|
3393
|
+
k.value = t, D.value = t && parseInt(t, 10) || void 0;
|
|
3364
3394
|
}
|
|
3365
|
-
function
|
|
3395
|
+
function De(e) {
|
|
3366
3396
|
let t = e.target.value;
|
|
3367
|
-
|
|
3397
|
+
A.value = t, O.value = t && parseInt(t, 10) || void 0;
|
|
3368
3398
|
}
|
|
3369
|
-
async function
|
|
3399
|
+
async function Oe() {
|
|
3370
3400
|
let e = w.value.trim();
|
|
3371
3401
|
if (!e || !s.item || N.value) return;
|
|
3372
|
-
let t =
|
|
3373
|
-
if (F.value &&
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
} catch {
|
|
3382
|
-
N.value = !1;
|
|
3383
|
-
return;
|
|
3384
|
-
}
|
|
3385
|
-
N.value = !1;
|
|
3402
|
+
let t = s.item, n = C(t.mimeType ?? ""), r;
|
|
3403
|
+
if (N.value = !0, F.value = null, R.value && T.value && (P.value || be.value)) try {
|
|
3404
|
+
let { canvas: e } = T.value.getResult();
|
|
3405
|
+
if (!e) throw Error("The cropper returned no canvas");
|
|
3406
|
+
let n = me(e, D.value, O.value);
|
|
3407
|
+
(P.value || n !== e) && (r = { file: await he(n, t.filename ?? "image", pe(t.mimeType ?? "")) });
|
|
3408
|
+
} catch {
|
|
3409
|
+
F.value = "crop", N.value = !1;
|
|
3410
|
+
return;
|
|
3386
3411
|
}
|
|
3387
|
-
|
|
3412
|
+
let i = await s.save(t.id, e, n ? ve.value : void 0, r);
|
|
3413
|
+
if (N.value = !1, i === "saved") {
|
|
3414
|
+
f("close");
|
|
3415
|
+
return;
|
|
3416
|
+
}
|
|
3417
|
+
i === "replaced" && ke(), F.value = "save";
|
|
3418
|
+
}
|
|
3419
|
+
function ke() {
|
|
3420
|
+
let e = T.value?.getResult().coordinates;
|
|
3421
|
+
e && (I = Se(e)), P.value = !1, D.value = void 0, O.value = void 0, k.value = "", A.value = "";
|
|
3388
3422
|
}
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3423
|
+
function Ae() {
|
|
3424
|
+
N.value || f("close");
|
|
3425
|
+
}
|
|
3426
|
+
let je = x(null), Me = t(() => s.visible && s.item !== null);
|
|
3427
|
+
ue(je, Me);
|
|
3428
|
+
function V(e) {
|
|
3392
3429
|
if (e.stopPropagation(), e.key === "Enter" && !N.value) {
|
|
3393
3430
|
if (e.target?.closest("textarea, [contenteditable]")) return;
|
|
3394
|
-
e.preventDefault(),
|
|
3431
|
+
e.preventDefault(), Oe();
|
|
3395
3432
|
}
|
|
3396
|
-
e.key === "Escape" &&
|
|
3433
|
+
e.key === "Escape" && Ae();
|
|
3397
3434
|
}
|
|
3398
3435
|
return (t, i) => (a(), b(n, { to: _(le) || "body" }, [l(ie, {
|
|
3399
3436
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
@@ -3408,28 +3445,29 @@ var Vt = ["data-tpl-theme"], Ht = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ut
|
|
|
3408
3445
|
"data-tpl-theme": _(ae),
|
|
3409
3446
|
class: ee([_(le) ? void 0 : "tpl", "tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
|
|
3410
3447
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
3411
|
-
onClick:
|
|
3412
|
-
onKeydown:
|
|
3448
|
+
onClick: ne(Ae, ["self"]),
|
|
3449
|
+
onKeydown: V
|
|
3413
3450
|
}, [u("div", {
|
|
3414
3451
|
ref_key: "dialogRef",
|
|
3415
|
-
ref:
|
|
3452
|
+
ref: je,
|
|
3416
3453
|
role: "dialog",
|
|
3417
3454
|
"aria-modal": "true",
|
|
3418
3455
|
"aria-labelledby": "tpl-media-edit-title",
|
|
3419
|
-
class: ee(["tpl:flex tpl:max-h-[90%] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl",
|
|
3456
|
+
class: ee(["tpl:flex tpl:max-h-[90%] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", R.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
|
|
3420
3457
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
3421
3458
|
}, [
|
|
3422
3459
|
u("div", Ht, [u("h3", Ut, v(_(S).mediaLibrary.editFile), 1)]),
|
|
3423
3460
|
u("div", Wt, [
|
|
3424
|
-
|
|
3461
|
+
R.value ? (a(), y("div", Gt, [u("div", Kt, [l(_(Rt), {
|
|
3425
3462
|
ref_key: "cropperRef",
|
|
3426
|
-
ref:
|
|
3463
|
+
ref: T,
|
|
3427
3464
|
src: r.item.url,
|
|
3428
|
-
"stencil-props": { aspectRatio:
|
|
3465
|
+
"stencil-props": { aspectRatio: xe.value },
|
|
3429
3466
|
class: "tpl:h-full tpl:w-full",
|
|
3430
3467
|
"background-class": "tpl-cropper-background",
|
|
3431
|
-
|
|
3432
|
-
|
|
3468
|
+
"default-size": B,
|
|
3469
|
+
onChange: we,
|
|
3470
|
+
onReady: Te
|
|
3433
3471
|
}, null, 8, ["src", "stencil-props"])]), u("div", qt, [
|
|
3434
3472
|
u("div", null, [u("label", Jt, v(_(S).mediaLibrary.cropAspectRatio), 1), u("div", Yt, [(a(), y(p, null, m([
|
|
3435
3473
|
"free",
|
|
@@ -3442,14 +3480,14 @@ var Vt = ["data-tpl-theme"], Ht = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ut
|
|
|
3442
3480
|
type: "button",
|
|
3443
3481
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
3444
3482
|
style: te({
|
|
3445
|
-
borderColor:
|
|
3446
|
-
backgroundColor:
|
|
3447
|
-
color:
|
|
3483
|
+
borderColor: E.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
3484
|
+
backgroundColor: E.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
3485
|
+
color: E.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
3448
3486
|
}),
|
|
3449
|
-
onClick: (t) =>
|
|
3487
|
+
onClick: (t) => E.value = e
|
|
3450
3488
|
}, v(_(_e)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Xt)), 64))])]),
|
|
3451
3489
|
u("div", Zt, [u("div", Qt, [u("label", $t, [c(v(_(S).mediaLibrary.cropMaxWidth) + " ", 1), u("span", en, v(_(S).mediaLibrary.cropOptional), 1)]), u("div", tn, [u("input", {
|
|
3452
|
-
value:
|
|
3490
|
+
value: k.value,
|
|
3453
3491
|
type: "number",
|
|
3454
3492
|
min: "1",
|
|
3455
3493
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
|
|
@@ -3458,10 +3496,10 @@ var Vt = ["data-tpl-theme"], Ht = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ut
|
|
|
3458
3496
|
"background-color": "var(--tpl-bg)",
|
|
3459
3497
|
color: "var(--tpl-text)"
|
|
3460
3498
|
},
|
|
3461
|
-
placeholder:
|
|
3462
|
-
onInput:
|
|
3499
|
+
placeholder: M.value?.width?.toString() || "",
|
|
3500
|
+
onInput: Ee
|
|
3463
3501
|
}, null, 40, nn), u("span", rn, v(_(S).mediaLibrary.cropPixels), 1)])]), u("div", an, [u("label", on, [c(v(_(S).mediaLibrary.cropMaxHeight) + " ", 1), u("span", sn, v(_(S).mediaLibrary.cropOptional), 1)]), u("div", cn, [u("input", {
|
|
3464
|
-
value:
|
|
3502
|
+
value: A.value,
|
|
3465
3503
|
type: "number",
|
|
3466
3504
|
min: "1",
|
|
3467
3505
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
|
|
@@ -3470,10 +3508,10 @@ var Vt = ["data-tpl-theme"], Ht = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ut
|
|
|
3470
3508
|
"background-color": "var(--tpl-bg)",
|
|
3471
3509
|
color: "var(--tpl-text)"
|
|
3472
3510
|
},
|
|
3473
|
-
placeholder:
|
|
3474
|
-
onInput:
|
|
3511
|
+
placeholder: M.value?.height?.toString() || "",
|
|
3512
|
+
onInput: De
|
|
3475
3513
|
}, null, 40, ln), u("span", un, v(_(S).mediaLibrary.cropPixels), 1)])])]),
|
|
3476
|
-
|
|
3514
|
+
z.value ? (a(), y("div", dn, [u("span", null, v(_(S).mediaLibrary.cropOutputSize) + ": ", 1), u("span", fn, v(z.value.width) + " x " + v(z.value.height) + " " + v(_(S).mediaLibrary.cropPixels), 1)])) : e("", !0)
|
|
3477
3515
|
])])) : e("", !0),
|
|
3478
3516
|
u("div", pn, [u("label", mn, v(_(S).mediaLibrary.fileName), 1), g(u("input", {
|
|
3479
3517
|
id: "tpl-media-filename",
|
|
@@ -3485,11 +3523,11 @@ var Vt = ["data-tpl-theme"], Ht = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ut
|
|
|
3485
3523
|
"background-color": "var(--tpl-bg)",
|
|
3486
3524
|
color: "var(--tpl-text)"
|
|
3487
3525
|
},
|
|
3488
|
-
autofocus: !
|
|
3526
|
+
autofocus: !R.value
|
|
3489
3527
|
}, null, 8, hn), [[re, w.value]])]),
|
|
3490
3528
|
_(C)(r.item.mimeType ?? "") ? (a(), y("div", gn, [u("label", _n, v(_(S).mediaLibrary.altText), 1), g(u("input", {
|
|
3491
3529
|
id: "tpl-media-alt",
|
|
3492
|
-
"onUpdate:modelValue": i[1] ||= (e) =>
|
|
3530
|
+
"onUpdate:modelValue": i[1] ||= (e) => ve.value = e,
|
|
3493
3531
|
type: "text",
|
|
3494
3532
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
3495
3533
|
style: {
|
|
@@ -3498,31 +3536,33 @@ var Vt = ["data-tpl-theme"], Ht = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ut
|
|
|
3498
3536
|
color: "var(--tpl-text)"
|
|
3499
3537
|
},
|
|
3500
3538
|
placeholder: _(S).mediaLibrary.altTextPlaceholder
|
|
3501
|
-
}, null, 8, vn), [[re,
|
|
3539
|
+
}, null, 8, vn), [[re, ve.value]])])) : e("", !0)
|
|
3502
3540
|
]),
|
|
3503
|
-
|
|
3541
|
+
F.value ? (a(), y("p", yn, v(F.value === "crop" ? _(S).mediaLibrary.editCropError : _(S).mediaLibrary.editSaveError), 1)) : e("", !0),
|
|
3542
|
+
u("div", bn, [u("button", {
|
|
3504
3543
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
3505
3544
|
style: {
|
|
3506
3545
|
"border-color": "var(--tpl-border)",
|
|
3507
3546
|
color: "var(--tpl-text)",
|
|
3508
3547
|
"background-color": "var(--tpl-bg)"
|
|
3509
3548
|
},
|
|
3510
|
-
|
|
3511
|
-
|
|
3549
|
+
disabled: N.value,
|
|
3550
|
+
onClick: Ae
|
|
3551
|
+
}, v(_(S).mediaLibrary.cancel), 9, xn), u("button", {
|
|
3512
3552
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
3513
3553
|
style: {
|
|
3514
3554
|
"background-color": "var(--tpl-primary)",
|
|
3515
3555
|
color: "var(--tpl-on-primary)"
|
|
3516
3556
|
},
|
|
3517
3557
|
disabled: N.value,
|
|
3518
|
-
onClick:
|
|
3519
|
-
}, v(N.value ? _(S).mediaLibrary.saving : _(S).mediaLibrary.saveChanges), 9,
|
|
3558
|
+
onClick: Oe
|
|
3559
|
+
}, v(N.value ? _(S).mediaLibrary.saving : _(S).mediaLibrary.saveChanges), 9, Sn)])
|
|
3520
3560
|
], 2)], 42, Vt)) : e("", !0)]),
|
|
3521
3561
|
_: 1
|
|
3522
3562
|
})], 8, ["to"]));
|
|
3523
3563
|
}
|
|
3524
|
-
}), [["__scopeId", "data-v-
|
|
3564
|
+
}), [["__scopeId", "data-v-defcfd87"]]);
|
|
3525
3565
|
//#endregion
|
|
3526
|
-
export {
|
|
3566
|
+
export { Cn as default };
|
|
3527
3567
|
|
|
3528
|
-
//# sourceMappingURL=MediaEditModal-
|
|
3568
|
+
//# sourceMappingURL=MediaEditModal-CdquYw2S.js.map
|